@freegridjs/core 1.9.0 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,29 @@
1
- "use strict";var FreeGrid=(()=>{var On=Object.defineProperty;var Qi=Object.getOwnPropertyDescriptor;var es=Object.getOwnPropertyNames;var ts=Object.prototype.hasOwnProperty;var ns=(o,e)=>{for(var t in e)On(o,t,{get:e[t],enumerable:!0})},os=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of es(e))!ts.call(o,r)&&r!==t&&On(o,r,{get:()=>e[r],enumerable:!(n=Qi(e,r))||n.enumerable});return o};var rs=o=>os(On({},"__esModule",{value:!0}),o);var Rl={};ns(Rl,{buildWorkbook:()=>$o,changeTracker:()=>Ni,connectLive:()=>Yi,createGrid:()=>Wi,csrfHeaders:()=>Xi,en:()=>he,evaluateFormula:()=>Ot,exportWorkbook:()=>ji,formulaFunctions:()=>kr,loadData:()=>_i,locales:()=>Zi,messageToTransaction:()=>Ho,parseCsv:()=>pn,readXlsx:()=>gn,registerFormulaFunction:()=>Cr,registerLocale:()=>Mt,renderChart:()=>kn,resolveLocale:()=>st,restDatasource:()=>Bo,saveChanges:()=>Ki,setLicenseKey:()=>Ri,verifyLicense:()=>Mo,version:()=>We,writeXlsx:()=>ze});var is={code:"en",noRows:"No rows to show",filter:"Filter",apply:"Apply",reset:"Reset",selectAll:"(Select all)",search:"Search\u2026",blanks:"(Blanks)",value:"Value",valueTo:"To",sortAsc:"Sort ascending",sortDesc:"Sort descending",clearSort:"Clear sort",pinLeft:"Pin left",pinRight:"Pin right",unpin:"Unpin",columnMenu:"Column menu",selectRow:"Select row",selectAllRows:"Select all rows",chooseColumns:"Choose columns",columns:"Columns",autosizeThis:"Autosize this column",autosizeAll:"Autosize all columns",resetColumns:"Reset columns",hideColumn:"Hide column",close:"Close",copy:"Copy",cut:"Cut",copyWithHeaders:"Copy with headers",paste:"Paste",pasteHint:"Clipboard access was blocked. Press Ctrl+V to paste.",required:"This field is required",invalidValue:"Invalid value",and:"And",or:"Or",advancedFilter:"Advanced filter",addCondition:"Add condition",duplicate:"This value is already used",undo:"Undo",redo:"Redo",deleteRows:"Delete selected rows",copyRows:"Copy selected rows",statusRows:"{n} rows",statusFiltered:"{shown} of {total} rows",statusSelected:"{n} selected",count:"Count",sum:"Sum",avg:"Average",min:"Min",max:"Max",findPlaceholder:"Find in grid",noMatches:"No matches",findNext:"Next match",findPrevious:"Previous match",groupPanelHint:"Drag a column header here to group rows",groupByThis:"Group by this column",ungroup:"Remove grouping",expandAll:"Expand all",collapseAll:"Collapse all",pagerRange:"{from}\u2013{to} of {total}",pageOf:"Page {page} of {pages}",pageSize:"Rows per page",firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",loading:"Loading\u2026",loadFailed:"Could not load rows",filters:"Filters",clearFilters:"Clear all filters",exportCsv:"Export CSV",exportExcel:"Export Excel",print:"Print\u2026",printLimited:"Printed the first {n} of {total} rows. Export to Excel or CSV for all of them.",pivot:"Pivot",pivotMode:"Pivot mode",pivotRows:"Row groups",pivotColumns:"Column labels",pivotValues:"Values",total:"Total",addColumn:"Add a column\u2026",chartBar:"Bar chart",chartStacked:"Stacked bar chart",chartLine:"Line chart",chartArea:"Area chart",chartPie:"Pie chart",chartDonut:"Donut chart",chartCombo:"Bar and line chart",chartScatter:"Scatter chart",freeBadge:"Free version",exportPdf:"Export PDF",exportJson:"Export JSON",ai:{title:"AI assistant",placeholder:"Ask about the data or tell the grid what to do",send:"Send",thinking:"Working\u2026",undo:"Undo",undone:"Undone",failed:"The assistant did not answer",skipped:"Skipped",done:"Done"},cf:{title:"Conditional formatting",add:"Add rule",clear:"Clear rules",none:"No rules for this column",type:"Rule",style:"Format",wholeRow:"Whole row",count:"Count",types:{value:"Cell value",formula:"Formula",top:"Top",bottom:"Bottom",aboveAverage:"Above average",belowAverage:"Below average",duplicate:"Duplicate values",unique:"Unique values",dataBar:"Data bars",colorScale:"Color scale",iconSet:"Icon set"},ops:{notBetween:"Not between",notContains:"Does not contain"},styles:{red:"Light red fill",yellow:"Yellow fill",green:"Green fill",blue:"Blue fill",redText:"Red text",bold:"Bold"}},ops:{contains:"Contains",equals:"Equals",notEquals:"Does not equal",startsWith:"Starts with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",eq:"Equals",ne:"Does not equal",lt:"Less than",lte:"Less than or equal",gt:"Greater than",gte:"Greater than or equal",between:"Between",before:"Before",after:"After"}},he=is;var Vo=new Set;function q(o){Vo.has(o)||(Vo.add(o),console.warn(`[FreeGrid] ${o}`))}var Pe=new Map([["en",he]]);function Mt(o){Pe.set(o.code,o)}function qo(o){let e=o.toLowerCase();for(let n of Pe.keys())if(n.toLowerCase()===e)return n;let t=e.split("-")[0];if(t==="zh"){if(/-(tw|hk|mo|hant)(-|$)/.test(e)&&Pe.has("zh-TW"))return"zh-TW";if(Pe.has("zh-CN"))return"zh-CN"}for(let n of Pe.keys())if(n.toLowerCase().split("-")[0]===t)return n}function ss(){var o;return typeof navigator=="undefined"?[]:(o=navigator.languages)!=null&&o.length?navigator.languages:navigator.language?[navigator.language]:[]}function as(o){var e,t;return{...he,...o,code:(e=o.code)!=null?e:"en",ops:{...he.ops,...(t=o.ops)!=null?t:{}}}}function st(o,e=ss()){if(o&&typeof o=="object")return as(o);if(typeof o=="string"){let t=qo(o);return t?Pe.get(t):(q(`locale "${o}" is not registered \u2014 import it from "@freegridjs/core/locales/${o}" and pass the pack (or call registerLocale). Falling back to "en".`),he)}for(let t of e){let n=qo(t);if(n)return Pe.get(n)}return he}var ls={code:"de",noRows:"Keine Zeilen vorhanden",filter:"Filter",apply:"Anwenden",reset:"Zur\xFCcksetzen",selectAll:"(Alle ausw\xE4hlen)",search:"Suchen\u2026",blanks:"(Leer)",value:"Wert",valueTo:"Bis",sortAsc:"Aufsteigend sortieren",sortDesc:"Absteigend sortieren",clearSort:"Sortierung aufheben",pinLeft:"Links fixieren",pinRight:"Rechts fixieren",unpin:"Fixierung l\xF6sen",columnMenu:"Spaltenmen\xFC",selectRow:"Zeile ausw\xE4hlen",selectAllRows:"Alle Zeilen ausw\xE4hlen",chooseColumns:"Spalten ausw\xE4hlen",columns:"Spalten",autosizeThis:"Diese Spalte automatisch anpassen",autosizeAll:"Alle Spalten automatisch anpassen",resetColumns:"Spalten zur\xFCcksetzen",hideColumn:"Spalte ausblenden",close:"Schlie\xDFen",copy:"Kopieren",cut:"Ausschneiden",copyWithHeaders:"Mit \xDCberschriften kopieren",paste:"Einf\xFCgen",pasteHint:"Der Browser hat die Zwischenablage blockiert. Dr\xFCcken Sie Ctrl+V zum Einf\xFCgen.",required:"Dieses Feld ist erforderlich",invalidValue:"Ung\xFCltiger Wert",and:"Und",or:"Oder",advancedFilter:"Erweiterter Filter",addCondition:"Bedingung hinzuf\xFCgen",duplicate:"Dieser Wert wird bereits verwendet",undo:"R\xFCckg\xE4ngig",redo:"Wiederholen",deleteRows:"Ausgew\xE4hlte Zeilen l\xF6schen",copyRows:"Ausgew\xE4hlte Zeilen kopieren",statusRows:"{n} Zeilen",statusFiltered:"{shown} von {total} Zeilen",statusSelected:"{n} ausgew\xE4hlt",count:"Anzahl",sum:"Summe",avg:"Mittelwert",min:"Min",max:"Max",findPlaceholder:"Im Raster suchen",noMatches:"Keine Treffer",findNext:"N\xE4chster Treffer",findPrevious:"Vorheriger Treffer",groupPanelHint:"Spalten\xFCberschrift hierher ziehen, um zu gruppieren",groupByThis:"Nach dieser Spalte gruppieren",ungroup:"Gruppierung aufheben",expandAll:"Alle aufklappen",collapseAll:"Alle zuklappen",pagerRange:"{from}\u2013{to} von {total}",pageOf:"Seite {page} von {pages}",pageSize:"Zeilen pro Seite",firstPage:"Erste Seite",previousPage:"Vorherige Seite",nextPage:"N\xE4chste Seite",lastPage:"Letzte Seite",loading:"Wird geladen\u2026",loadFailed:"Zeilen konnten nicht geladen werden",filters:"Filter",clearFilters:"Alle Filter entfernen",exportCsv:"Als CSV exportieren",exportExcel:"Nach Excel exportieren",print:"Drucken\u2026",printLimited:"Die ersten {n} von {total} Zeilen wurden gedruckt. F\xFCr alle Zeilen nach Excel oder CSV exportieren.",pivot:"Pivot",pivotMode:"Pivot-Modus",pivotRows:"Zeilengruppen",pivotColumns:"Spaltenbeschriftungen",pivotValues:"Werte",total:"Gesamt",addColumn:"Spalte hinzuf\xFCgen\u2026",chartBar:"Balkendiagramm",chartStacked:"Gestapelte Balken",chartLine:"Liniendiagramm",chartArea:"Fl\xE4chendiagramm",chartPie:"Kreisdiagramm",chartDonut:"Ringdiagramm",chartCombo:"Balken- und Liniendiagramm",chartScatter:"Streudiagramm",freeBadge:"Kostenlose Version",exportPdf:"Als PDF exportieren",exportJson:"Als JSON exportieren",ai:{title:"KI-Assistent",placeholder:"Fragen Sie zu den Daten oder sagen Sie der Tabelle, was sie tun soll",send:"Senden",thinking:"Wird bearbeitet\u2026",undo:"R\xFCckg\xE4ngig",undone:"R\xFCckg\xE4ngig gemacht",failed:"Der Assistent hat nicht geantwortet",skipped:"\xDCbersprungen",done:"Fertig"},cf:{title:"Bedingte Formatierung",add:"Regel hinzuf\xFCgen",clear:"Regeln l\xF6schen",none:"Keine Regeln f\xFCr diese Spalte",type:"Regel",style:"Format",wholeRow:"Ganze Zeile",count:"Anzahl",types:{value:"Zellwert",formula:"Formel",top:"Obere",bottom:"Untere",aboveAverage:"\xDCber dem Durchschnitt",belowAverage:"Unter dem Durchschnitt",duplicate:"Doppelte Werte",unique:"Eindeutige Werte",dataBar:"Datenbalken",colorScale:"Farbskala",iconSet:"Symbolsatz"},ops:{notBetween:"Nicht zwischen",notContains:"Enth\xE4lt nicht"},styles:{red:"Hellrote F\xFCllung",yellow:"Gelbe F\xFCllung",green:"Gr\xFCne F\xFCllung",blue:"Blaue F\xFCllung",redText:"Roter Text",bold:"Fett"}},ops:{contains:"Enth\xE4lt",equals:"Gleich",notEquals:"Ungleich",startsWith:"Beginnt mit",endsWith:"Endet mit",blank:"Leer",notBlank:"Nicht leer",eq:"Gleich",ne:"Ungleich",lt:"Kleiner als",lte:"Kleiner oder gleich",gt:"Gr\xF6\xDFer als",gte:"Gr\xF6\xDFer oder gleich",between:"Zwischen",before:"Vor",after:"Nach"}},Wo=ls;var ds={code:"es",noRows:"No hay filas para mostrar",filter:"Filtro",apply:"Aplicar",reset:"Restablecer",selectAll:"(Seleccionar todo)",search:"Buscar\u2026",blanks:"(Vac\xEDos)",value:"Valor",valueTo:"Hasta",sortAsc:"Orden ascendente",sortDesc:"Orden descendente",clearSort:"Quitar orden",pinLeft:"Fijar a la izquierda",pinRight:"Fijar a la derecha",unpin:"Desfijar",columnMenu:"Men\xFA de columna",selectRow:"Seleccionar fila",selectAllRows:"Seleccionar todas las filas",chooseColumns:"Elegir columnas",columns:"Columnas",autosizeThis:"Ajustar esta columna",autosizeAll:"Ajustar todas las columnas",resetColumns:"Restablecer columnas",hideColumn:"Ocultar columna",close:"Cerrar",copy:"Copiar",cut:"Cortar",copyWithHeaders:"Copiar con encabezados",paste:"Pegar",pasteHint:"El navegador bloque\xF3 el portapapeles. Pulsa Ctrl+V para pegar.",required:"Este campo es obligatorio",invalidValue:"Valor no v\xE1lido",and:"Y",or:"O",advancedFilter:"Filtro avanzado",addCondition:"A\xF1adir condici\xF3n",duplicate:"Este valor ya est\xE1 en uso",undo:"Deshacer",redo:"Rehacer",deleteRows:"Eliminar filas seleccionadas",copyRows:"Copiar filas seleccionadas",statusRows:"{n} filas",statusFiltered:"{shown} de {total} filas",statusSelected:"{n} seleccionadas",count:"Recuento",sum:"Suma",avg:"Promedio",min:"M\xEDn.",max:"M\xE1x.",findPlaceholder:"Buscar en la tabla",noMatches:"Sin coincidencias",findNext:"Siguiente",findPrevious:"Anterior",groupPanelHint:"Arrastre aqu\xED un encabezado de columna para agrupar",groupByThis:"Agrupar por esta columna",ungroup:"Quitar agrupaci\xF3n",expandAll:"Expandir todo",collapseAll:"Contraer todo",pagerRange:"{from}\u2013{to} de {total}",pageOf:"P\xE1gina {page} de {pages}",pageSize:"Filas por p\xE1gina",firstPage:"Primera p\xE1gina",previousPage:"P\xE1gina anterior",nextPage:"P\xE1gina siguiente",lastPage:"\xDAltima p\xE1gina",loading:"Cargando\u2026",loadFailed:"No se pudieron cargar las filas",filters:"Filtros",clearFilters:"Quitar todos los filtros",exportCsv:"Exportar CSV",exportExcel:"Exportar a Excel",print:"Imprimir\u2026",printLimited:"Se imprimieron las primeras {n} de {total} filas. Exporte a Excel o CSV para obtenerlas todas.",pivot:"Tabla din\xE1mica",pivotMode:"Modo tabla din\xE1mica",pivotRows:"Grupos de filas",pivotColumns:"Etiquetas de columna",pivotValues:"Valores",total:"Total",addColumn:"A\xF1adir columna\u2026",chartBar:"Gr\xE1fico de barras",chartStacked:"Barras apiladas",chartLine:"Gr\xE1fico de l\xEDneas",chartArea:"Gr\xE1fico de \xE1reas",chartPie:"Gr\xE1fico circular",chartDonut:"Gr\xE1fico de anillo",chartCombo:"Gr\xE1fico de barras y l\xEDneas",chartScatter:"Gr\xE1fico de dispersi\xF3n",freeBadge:"Versi\xF3n gratuita",exportPdf:"Exportar PDF",exportJson:"Exportar JSON",ai:{title:"Asistente de IA",placeholder:"Pregunte por los datos o diga a la tabla qu\xE9 hacer",send:"Enviar",thinking:"Procesando\u2026",undo:"Deshacer",undone:"Deshecho",failed:"El asistente no respondi\xF3",skipped:"Omitido",done:"Hecho"},cf:{title:"Formato condicional",add:"A\xF1adir regla",clear:"Borrar reglas",none:"No hay reglas para esta columna",type:"Regla",style:"Formato",wholeRow:"Fila completa",count:"Cantidad",types:{value:"Valor de celda",formula:"F\xF3rmula",top:"Superiores",bottom:"Inferiores",aboveAverage:"Por encima del promedio",belowAverage:"Por debajo del promedio",duplicate:"Valores duplicados",unique:"Valores \xFAnicos",dataBar:"Barras de datos",colorScale:"Escala de color",iconSet:"Conjunto de iconos"},ops:{notBetween:"No est\xE1 entre",notContains:"No contiene"},styles:{red:"Relleno rojo claro",yellow:"Relleno amarillo",green:"Relleno verde",blue:"Relleno azul",redText:"Texto rojo",bold:"Negrita"}},ops:{contains:"Contiene",equals:"Igual a",notEquals:"Distinto de",startsWith:"Empieza por",endsWith:"Termina en",blank:"Vac\xEDo",notBlank:"No vac\xEDo",eq:"Igual a",ne:"Distinto de",lt:"Menor que",lte:"Menor o igual que",gt:"Mayor que",gte:"Mayor o igual que",between:"Entre",before:"Antes de",after:"Despu\xE9s de"}},jo=ds;var cs={code:"fr",noRows:"Aucune ligne \xE0 afficher",filter:"Filtre",apply:"Appliquer",reset:"R\xE9initialiser",selectAll:"(Tout s\xE9lectionner)",search:"Rechercher\u2026",blanks:"(Vides)",value:"Valeur",valueTo:"\xC0",sortAsc:"Tri croissant",sortDesc:"Tri d\xE9croissant",clearSort:"Annuler le tri",pinLeft:"\xC9pingler \xE0 gauche",pinRight:"\xC9pingler \xE0 droite",unpin:"D\xE9s\xE9pingler",columnMenu:"Menu de colonne",selectRow:"S\xE9lectionner la ligne",selectAllRows:"S\xE9lectionner toutes les lignes",chooseColumns:"Choisir les colonnes",columns:"Colonnes",autosizeThis:"Ajuster cette colonne",autosizeAll:"Ajuster toutes les colonnes",resetColumns:"R\xE9initialiser les colonnes",hideColumn:"Masquer la colonne",close:"Fermer",copy:"Copier",cut:"Couper",copyWithHeaders:"Copier avec les en-t\xEAtes",paste:"Coller",pasteHint:"Le navigateur a bloqu\xE9 le presse-papiers. Appuyez sur Ctrl+V pour coller.",required:"Ce champ est obligatoire",invalidValue:"Valeur non valide",and:"Et",or:"Ou",advancedFilter:"Filtre avanc\xE9",addCondition:"Ajouter une condition",duplicate:"Cette valeur est d\xE9j\xE0 utilis\xE9e",undo:"Annuler",redo:"R\xE9tablir",deleteRows:"Supprimer les lignes s\xE9lectionn\xE9es",copyRows:"Copier les lignes s\xE9lectionn\xE9es",statusRows:"{n} lignes",statusFiltered:"{shown} sur {total} lignes",statusSelected:"{n} s\xE9lectionn\xE9es",count:"Nombre",sum:"Somme",avg:"Moyenne",min:"Min",max:"Max",findPlaceholder:"Rechercher dans la grille",noMatches:"Aucun r\xE9sultat",findNext:"Suivant",findPrevious:"Pr\xE9c\xE9dent",groupPanelHint:"Faites glisser un en-t\xEAte de colonne ici pour regrouper",groupByThis:"Regrouper par cette colonne",ungroup:"Supprimer le regroupement",expandAll:"Tout d\xE9velopper",collapseAll:"Tout r\xE9duire",pagerRange:"{from}\u2013{to} sur {total}",pageOf:"Page {page} sur {pages}",pageSize:"Lignes par page",firstPage:"Premi\xE8re page",previousPage:"Page pr\xE9c\xE9dente",nextPage:"Page suivante",lastPage:"Derni\xE8re page",loading:"Chargement\u2026",loadFailed:"Impossible de charger les lignes",filters:"Filtres",clearFilters:"Effacer tous les filtres",exportCsv:"Exporter en CSV",exportExcel:"Exporter vers Excel",print:"Imprimer\u2026",printLimited:"Les {n} premi\xE8res lignes sur {total} ont \xE9t\xE9 imprim\xE9es. Exportez vers Excel ou CSV pour toutes les avoir.",pivot:"Tableau crois\xE9",pivotMode:"Mode tableau crois\xE9",pivotRows:"Groupes de lignes",pivotColumns:"\xC9tiquettes de colonnes",pivotValues:"Valeurs",total:"Total",addColumn:"Ajouter une colonne\u2026",chartBar:"Histogramme",chartStacked:"Histogramme empil\xE9",chartLine:"Courbes",chartArea:"Aires",chartPie:"Secteurs",chartDonut:"Graphique en anneau",chartCombo:"Graphique barres et lignes",chartScatter:"Nuage de points",freeBadge:"Version gratuite",exportPdf:"Exporter en PDF",exportJson:"Exporter en JSON",ai:{title:"Assistant IA",placeholder:"Posez une question sur les donn\xE9es ou dites \xE0 la grille quoi faire",send:"Envoyer",thinking:"En cours\u2026",undo:"Annuler",undone:"Annul\xE9",failed:"L'assistant n'a pas r\xE9pondu",skipped:"Ignor\xE9",done:"Termin\xE9"},cf:{title:"Mise en forme conditionnelle",add:"Ajouter une r\xE8gle",clear:"Effacer les r\xE8gles",none:"Aucune r\xE8gle pour cette colonne",type:"R\xE8gle",style:"Format",wholeRow:"Ligne enti\xE8re",count:"Nombre",types:{value:"Valeur de la cellule",formula:"Formule",top:"Premiers",bottom:"Derniers",aboveAverage:"Au-dessus de la moyenne",belowAverage:"En dessous de la moyenne",duplicate:"Valeurs en double",unique:"Valeurs uniques",dataBar:"Barres de donn\xE9es",colorScale:"Nuances de couleurs",iconSet:"Jeu d'ic\xF4nes"},ops:{notBetween:"Pas entre",notContains:"Ne contient pas"},styles:{red:"Remplissage rouge clair",yellow:"Remplissage jaune",green:"Remplissage vert",blue:"Remplissage bleu",redText:"Texte rouge",bold:"Gras"}},ops:{contains:"Contient",equals:"\xC9gal \xE0",notEquals:"Diff\xE9rent de",startsWith:"Commence par",endsWith:"Se termine par",blank:"Vide",notBlank:"Non vide",eq:"\xC9gal \xE0",ne:"Diff\xE9rent de",lt:"Inf\xE9rieur \xE0",lte:"Inf\xE9rieur ou \xE9gal \xE0",gt:"Sup\xE9rieur \xE0",gte:"Sup\xE9rieur ou \xE9gal \xE0",between:"Entre",before:"Avant",after:"Apr\xE8s"}},Uo=cs;var us={code:"ja",noRows:"\u8868\u793A\u3059\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",filter:"\u30D5\u30A3\u30EB\u30BF\u30FC",apply:"\u9069\u7528",reset:"\u30EA\u30BB\u30C3\u30C8",selectAll:"(\u3059\u3079\u3066\u9078\u629E)",search:"\u691C\u7D22\u2026",blanks:"(\u7A7A\u767D)",value:"\u5024",valueTo:"\u7D42\u4E86\u5024",sortAsc:"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048",sortDesc:"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048",clearSort:"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664",pinLeft:"\u5DE6\u306B\u56FA\u5B9A",pinRight:"\u53F3\u306B\u56FA\u5B9A",unpin:"\u56FA\u5B9A\u3092\u89E3\u9664",columnMenu:"\u5217\u30E1\u30CB\u30E5\u30FC",selectRow:"\u884C\u3092\u9078\u629E",selectAllRows:"\u3059\u3079\u3066\u306E\u884C\u3092\u9078\u629E",chooseColumns:"\u5217\u3092\u9078\u629E",columns:"\u5217",autosizeThis:"\u3053\u306E\u5217\u306E\u5E45\u3092\u81EA\u52D5\u8ABF\u6574",autosizeAll:"\u3059\u3079\u3066\u306E\u5217\u306E\u5E45\u3092\u81EA\u52D5\u8ABF\u6574",resetColumns:"\u5217\u3092\u30EA\u30BB\u30C3\u30C8",hideColumn:"\u5217\u3092\u975E\u8868\u793A",close:"\u9589\u3058\u308B",copy:"\u30B3\u30D4\u30FC",cut:"\u5207\u308A\u53D6\u308A",copyWithHeaders:"\u30D8\u30C3\u30C0\u30FC\u4ED8\u304D\u3067\u30B3\u30D4\u30FC",paste:"\u8CBC\u308A\u4ED8\u3051",pasteHint:"\u30D6\u30E9\u30A6\u30B6\u30FC\u304C\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u30D6\u30ED\u30C3\u30AF\u3057\u307E\u3057\u305F\u3002Ctrl+V \u3067\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002",required:"\u3053\u306E\u9805\u76EE\u306F\u5FC5\u9808\u3067\u3059",invalidValue:"\u7121\u52B9\u306A\u5024\u3067\u3059",and:"\u304B\u3064",or:"\u307E\u305F\u306F",advancedFilter:"\u8A73\u7D30\u30D5\u30A3\u30EB\u30BF\u30FC",addCondition:"\u6761\u4EF6\u3092\u8FFD\u52A0",duplicate:"\u3053\u306E\u5024\u306F\u3059\u3067\u306B\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059",undo:"\u5143\u306B\u623B\u3059",redo:"\u3084\u308A\u76F4\u3057",deleteRows:"\u9078\u629E\u3057\u305F\u884C\u3092\u524A\u9664",copyRows:"\u9078\u629E\u3057\u305F\u884C\u3092\u30B3\u30D4\u30FC",statusRows:"{n} \u884C",statusFiltered:"{total} \u884C\u4E2D {shown} \u884C",statusSelected:"{n} \u4EF6\u9078\u629E",count:"\u30C7\u30FC\u30BF\u306E\u500B\u6570",sum:"\u5408\u8A08",avg:"\u5E73\u5747",min:"\u6700\u5C0F",max:"\u6700\u5927",findPlaceholder:"\u30B0\u30EA\u30C3\u30C9\u5185\u3092\u691C\u7D22",noMatches:"\u4E00\u81F4\u306A\u3057",findNext:"\u6B21\u3092\u691C\u7D22",findPrevious:"\u524D\u3092\u691C\u7D22",groupPanelHint:"\u5217\u898B\u51FA\u3057\u3092\u3053\u3053\u306B\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30B0\u30EB\u30FC\u30D7\u5316",groupByThis:"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316",ungroup:"\u30B0\u30EB\u30FC\u30D7\u5316\u3092\u89E3\u9664",expandAll:"\u3059\u3079\u3066\u5C55\u958B",collapseAll:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u3080",pagerRange:"{total} \u4EF6\u4E2D {from}\u2013{to} \u4EF6",pageOf:"{pages} \u30DA\u30FC\u30B8\u4E2D {page} \u30DA\u30FC\u30B8",pageSize:"1 \u30DA\u30FC\u30B8\u306E\u884C\u6570",firstPage:"\u6700\u521D\u306E\u30DA\u30FC\u30B8",previousPage:"\u524D\u306E\u30DA\u30FC\u30B8",nextPage:"\u6B21\u306E\u30DA\u30FC\u30B8",lastPage:"\u6700\u5F8C\u306E\u30DA\u30FC\u30B8",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",loadFailed:"\u884C\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",filters:"\u30D5\u30A3\u30EB\u30BF\u30FC",clearFilters:"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u89E3\u9664",exportCsv:"CSV \u306B\u66F8\u304D\u51FA\u3059",exportExcel:"Excel \u306B\u66F8\u304D\u51FA\u3059",print:"\u5370\u5237\u2026",printLimited:"\u5168 {total} \u884C\u306E\u3046\u3061\u6700\u521D\u306E {n} \u884C\u306E\u307F\u5370\u5237\u3057\u307E\u3057\u305F\u3002\u3059\u3079\u3066\u306E\u884C\u306F Excel \u307E\u305F\u306F CSV \u306B\u66F8\u304D\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002",pivot:"\u30D4\u30DC\u30C3\u30C8",pivotMode:"\u30D4\u30DC\u30C3\u30C8\u30E2\u30FC\u30C9",pivotRows:"\u884C\u30B0\u30EB\u30FC\u30D7",pivotColumns:"\u5217\u30E9\u30D9\u30EB",pivotValues:"\u5024",total:"\u5408\u8A08",addColumn:"\u5217\u3092\u8FFD\u52A0\u2026",chartBar:"\u68D2\u30B0\u30E9\u30D5",chartStacked:"\u7A4D\u307F\u4E0A\u3052\u68D2\u30B0\u30E9\u30D5",chartLine:"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chartArea:"\u9762\u30B0\u30E9\u30D5",chartPie:"\u5186\u30B0\u30E9\u30D5",chartDonut:"\u30C9\u30FC\u30CA\u30C4\u30B0\u30E9\u30D5",chartCombo:"\u68D2\u30FB\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chartScatter:"\u6563\u5E03\u56F3",freeBadge:"\u7121\u6599\u7248\u3092\u4F7F\u7528\u4E2D",exportPdf:"PDF \u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",exportJson:"JSON \u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",ai:{title:"AI \u30A2\u30B7\u30B9\u30BF\u30F3\u30C8",placeholder:"\u30C7\u30FC\u30BF\u306B\u3064\u3044\u3066\u8CEA\u554F\u3059\u308B\u304B\u3001\u30B0\u30EA\u30C3\u30C9\u3078\u306E\u6307\u793A\u3092\u5165\u529B",send:"\u9001\u4FE1",thinking:"\u51E6\u7406\u4E2D\u2026",undo:"\u5143\u306B\u623B\u3059",undone:"\u5143\u306B\u623B\u3057\u307E\u3057\u305F",failed:"\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u304B\u3089\u5FDC\u7B54\u304C\u3042\u308A\u307E\u305B\u3093",skipped:"\u30B9\u30AD\u30C3\u30D7",done:"\u5B8C\u4E86"},cf:{title:"\u6761\u4EF6\u4ED8\u304D\u66F8\u5F0F",add:"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0",clear:"\u30EB\u30FC\u30EB\u3092\u30AF\u30EA\u30A2",none:"\u3053\u306E\u5217\u306B\u30EB\u30FC\u30EB\u306F\u3042\u308A\u307E\u305B\u3093",type:"\u30EB\u30FC\u30EB",style:"\u66F8\u5F0F",wholeRow:"\u884C\u5168\u4F53",count:"\u4EF6\u6570",types:{value:"\u30BB\u30EB\u306E\u5024",formula:"\u6570\u5F0F",top:"\u4E0A\u4F4D",bottom:"\u4E0B\u4F4D",aboveAverage:"\u5E73\u5747\u3088\u308A\u4E0A",belowAverage:"\u5E73\u5747\u3088\u308A\u4E0B",duplicate:"\u91CD\u8907\u3059\u308B\u5024",unique:"\u4E00\u610F\u306E\u5024",dataBar:"\u30C7\u30FC\u30BF\u30D0\u30FC",colorScale:"\u30AB\u30E9\u30FC\u30B9\u30B1\u30FC\u30EB",iconSet:"\u30A2\u30A4\u30B3\u30F3\u30BB\u30C3\u30C8"},ops:{notBetween:"\u7BC4\u56F2\u5916",notContains:"\u542B\u307E\u306A\u3044"},styles:{red:"\u8584\u3044\u8D64\u306E\u5857\u308A\u3064\u3076\u3057",yellow:"\u9EC4\u8272\u306E\u5857\u308A\u3064\u3076\u3057",green:"\u7DD1\u306E\u5857\u308A\u3064\u3076\u3057",blue:"\u9752\u306E\u5857\u308A\u3064\u3076\u3057",redText:"\u8D64\u306E\u6587\u5B57",bold:"\u592A\u5B57"}},ops:{contains:"\u542B\u3080",equals:"\u7B49\u3057\u3044",notEquals:"\u7B49\u3057\u304F\u306A\u3044",startsWith:"\u3067\u59CB\u307E\u308B",endsWith:"\u3067\u7D42\u308F\u308B",blank:"\u7A7A\u767D",notBlank:"\u7A7A\u767D\u4EE5\u5916",eq:"\u7B49\u3057\u3044",ne:"\u7B49\u3057\u304F\u306A\u3044",lt:"\u3088\u308A\u5C0F\u3055\u3044",lte:"\u4EE5\u4E0B",gt:"\u3088\u308A\u5927\u304D\u3044",gte:"\u4EE5\u4E0A",between:"\u7BC4\u56F2\u5185",before:"\u3088\u308A\u524D",after:"\u3088\u308A\u5F8C"}},Ko=us;var fs={code:"ko",noRows:"\uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",filter:"\uD544\uD130",apply:"\uC801\uC6A9",reset:"\uCD08\uAE30\uD654",selectAll:"(\uC804\uCCB4 \uC120\uD0DD)",search:"\uAC80\uC0C9\u2026",blanks:"(\uBE48 \uAC12)",value:"\uAC12",valueTo:"\uB05D \uAC12",sortAsc:"\uC624\uB984\uCC28\uC21C \uC815\uB82C",sortDesc:"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C",clearSort:"\uC815\uB82C \uD574\uC81C",pinLeft:"\uC67C\uCABD \uACE0\uC815",pinRight:"\uC624\uB978\uCABD \uACE0\uC815",unpin:"\uACE0\uC815 \uD574\uC81C",columnMenu:"\uCEEC\uB7FC \uBA54\uB274",selectRow:"\uD589 \uC120\uD0DD",selectAllRows:"\uC804\uCCB4 \uD589 \uC120\uD0DD",chooseColumns:"\uCEEC\uB7FC \uC120\uD0DD",columns:"\uCEEC\uB7FC",autosizeThis:"\uC774 \uCEEC\uB7FC \uB108\uBE44 \uC790\uB3D9 \uB9DE\uCDA4",autosizeAll:"\uBAA8\uB4E0 \uCEEC\uB7FC \uB108\uBE44 \uC790\uB3D9 \uB9DE\uCDA4",resetColumns:"\uCEEC\uB7FC \uCD08\uAE30\uD654",hideColumn:"\uCEEC\uB7FC \uC228\uAE30\uAE30",close:"\uB2EB\uAE30",copy:"\uBCF5\uC0AC",cut:"\uC798\uB77C\uB0B4\uAE30",copyWithHeaders:"\uD5E4\uB354 \uD3EC\uD568 \uBCF5\uC0AC",paste:"\uBD99\uC5EC\uB123\uAE30",pasteHint:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uD074\uB9BD\uBCF4\uB4DC \uC811\uADFC\uC744 \uB9C9\uC558\uC2B5\uB2C8\uB2E4. Ctrl+V\uB85C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.",required:"\uD544\uC218 \uC785\uB825 \uD56D\uBAA9\uC785\uB2C8\uB2E4",invalidValue:"\uC62C\uBC14\uB978 \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4",and:"\uADF8\uB9AC\uACE0",or:"\uB610\uB294",advancedFilter:"\uACE0\uAE09 \uD544\uD130",addCondition:"\uC870\uAC74 \uCD94\uAC00",duplicate:"\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uAC12\uC785\uB2C8\uB2E4",undo:"\uC2E4\uD589 \uCDE8\uC18C",redo:"\uB2E4\uC2DC \uC2E4\uD589",deleteRows:"\uC120\uD0DD\uD55C \uD589 \uC0AD\uC81C",copyRows:"\uC120\uD0DD\uD55C \uD589 \uBCF5\uC0AC",statusRows:"{n}\uD589",statusFiltered:"{total}\uD589 \uC911 {shown}\uD589",statusSelected:"{n}\uAC1C \uC120\uD0DD",count:"\uAC1C\uC218",sum:"\uD569\uACC4",avg:"\uD3C9\uADE0",min:"\uCD5C\uC18C",max:"\uCD5C\uB300",findPlaceholder:"\uADF8\uB9AC\uB4DC\uC5D0\uC11C \uCC3E\uAE30",noMatches:"\uC77C\uCE58 \uD56D\uBAA9 \uC5C6\uC74C",findNext:"\uB2E4\uC74C \uCC3E\uAE30",findPrevious:"\uC774\uC804 \uCC3E\uAE30",groupPanelHint:"\uC5F4 \uBA38\uB9AC\uAE00\uC744 \uC5EC\uAE30\uB85C \uB04C\uC5B4\uC640 \uD589\uC744 \uBB36\uC73C\uC138\uC694",groupByThis:"\uC774 \uC5F4\uB85C \uBB36\uAE30",ungroup:"\uBB36\uAE30 \uD574\uC81C",expandAll:"\uBAA8\uB450 \uD3BC\uCE58\uAE30",collapseAll:"\uBAA8\uB450 \uC811\uAE30",pagerRange:"{total}\uAC1C \uC911 {from}\u2013{to}",pageOf:"{pages}\uCABD \uC911 {page}\uCABD",pageSize:"\uCABD\uB2F9 \uD589 \uC218",firstPage:"\uCCAB \uCABD",previousPage:"\uC774\uC804 \uCABD",nextPage:"\uB2E4\uC74C \uCABD",lastPage:"\uB9C8\uC9C0\uB9C9 \uCABD",loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026",loadFailed:"\uD589\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4",filters:"\uD544\uD130",clearFilters:"\uD544\uD130 \uBAA8\uB450 \uC9C0\uC6B0\uAE30",exportCsv:"CSV\uB85C \uB0B4\uBCF4\uB0B4\uAE30",exportExcel:"\uC5D1\uC140\uB85C \uB0B4\uBCF4\uB0B4\uAE30",print:"\uC778\uC1C4\u2026",printLimited:"\uC804\uCCB4 {total}\uD589 \uC911 \uCC98\uC74C {n}\uD589\uB9CC \uC778\uC1C4\uD588\uC2B5\uB2C8\uB2E4. \uC804\uCCB4\uB294 \uC5D1\uC140\uC774\uB098 CSV\uB85C \uB0B4\uBCF4\uB0B4\uC138\uC694.",pivot:"\uD53C\uBC97",pivotMode:"\uD53C\uBC97 \uBAA8\uB4DC",pivotRows:"\uD589 \uADF8\uB8F9",pivotColumns:"\uC5F4 \uB808\uC774\uBE14",pivotValues:"\uAC12",total:"\uD569\uACC4",addColumn:"\uCEEC\uB7FC \uCD94\uAC00\u2026",chartBar:"\uB9C9\uB300 \uCC28\uD2B8",chartStacked:"\uB204\uC801 \uB9C9\uB300 \uCC28\uD2B8",chartLine:"\uAEBE\uC740\uC120 \uCC28\uD2B8",chartArea:"\uC601\uC5ED \uCC28\uD2B8",chartPie:"\uC6D0\uD615 \uCC28\uD2B8",chartDonut:"\uB3C4\uB11B \uCC28\uD2B8",chartCombo:"\uB9C9\uB300\xB7\uAEBE\uC740\uC120 \uCC28\uD2B8",chartScatter:"\uBD84\uC0B0\uD615 \uCC28\uD2B8",freeBadge:"\uBB34\uB8CC \uC0AC\uC6A9 \uC911",exportPdf:"PDF\uB85C \uB0B4\uBCF4\uB0B4\uAE30",exportJson:"JSON\uC73C\uB85C \uB0B4\uBCF4\uB0B4\uAE30",ai:{title:"AI \uC5B4\uC2DC\uC2A4\uD134\uD2B8",placeholder:"\uB370\uC774\uD130\uC5D0 \uB300\uD574 \uBB3B\uAC70\uB098 \uADF8\uB9AC\uB4DC\uC5D0 \uD560 \uC77C\uC744 \uB9D0\uD574 \uBCF4\uC138\uC694",send:"\uBCF4\uB0B4\uAE30",thinking:"\uCC98\uB9AC \uC911\u2026",undo:"\uB418\uB3CC\uB9AC\uAE30",undone:"\uB418\uB3CC\uB838\uC2B5\uB2C8\uB2E4",failed:"\uC5B4\uC2DC\uC2A4\uD134\uD2B8\uAC00 \uC751\uB2F5\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4",skipped:"\uAC74\uB108\uB700",done:"\uC644\uB8CC"},cf:{title:"\uC870\uAC74\uBD80 \uC11C\uC2DD",add:"\uADDC\uCE59 \uCD94\uAC00",clear:"\uADDC\uCE59 \uC9C0\uC6B0\uAE30",none:"\uC774 \uCEEC\uB7FC\uC5D0 \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",type:"\uADDC\uCE59",style:"\uC11C\uC2DD",wholeRow:"\uD589 \uC804\uCCB4",count:"\uAC1C\uC218",types:{value:"\uC140 \uAC12",formula:"\uC218\uC2DD",top:"\uC0C1\uC704",bottom:"\uD558\uC704",aboveAverage:"\uD3C9\uADE0 \uCD08\uACFC",belowAverage:"\uD3C9\uADE0 \uBBF8\uB9CC",duplicate:"\uC911\uBCF5 \uAC12",unique:"\uACE0\uC720 \uAC12",dataBar:"\uB370\uC774\uD130 \uB9C9\uB300",colorScale:"\uC0C9\uC870",iconSet:"\uC544\uC774\uCF58 \uC9D1\uD569"},ops:{notBetween:"\uBC94\uC704 \uBC16",notContains:"\uD3EC\uD568\uD558\uC9C0 \uC54A\uC74C"},styles:{red:"\uC5F0\uD55C \uBE68\uAC15 \uCC44\uC6B0\uAE30",yellow:"\uB178\uB791 \uCC44\uC6B0\uAE30",green:"\uCD08\uB85D \uCC44\uC6B0\uAE30",blue:"\uD30C\uB791 \uCC44\uC6B0\uAE30",redText:"\uBE68\uAC15 \uAE00\uC790",bold:"\uAD75\uAC8C"}},ops:{contains:"\uD3EC\uD568",equals:"\uAC19\uC74C",notEquals:"\uAC19\uC9C0 \uC54A\uC74C",startsWith:"\uC2DC\uC791 \uBB38\uC790",endsWith:"\uB05D \uBB38\uC790",blank:"\uBE48 \uAC12",notBlank:"\uBE48 \uAC12 \uC544\uB2D8",eq:"\uAC19\uC74C",ne:"\uAC19\uC9C0 \uC54A\uC74C",lt:"\uBBF8\uB9CC",lte:"\uC774\uD558",gt:"\uCD08\uACFC",gte:"\uC774\uC0C1",between:"\uBC94\uC704",before:"\uC774\uC804",after:"\uC774\uD6C4"}},_o=fs;var ps={code:"zh-CN",noRows:"\u6CA1\u6709\u53EF\u663E\u793A\u7684\u6570\u636E",filter:"\u7B5B\u9009",apply:"\u5E94\u7528",reset:"\u91CD\u7F6E",selectAll:"(\u5168\u9009)",search:"\u641C\u7D22\u2026",blanks:"(\u7A7A\u767D)",value:"\u503C",valueTo:"\u81F3",sortAsc:"\u5347\u5E8F\u6392\u5E8F",sortDesc:"\u964D\u5E8F\u6392\u5E8F",clearSort:"\u6E05\u9664\u6392\u5E8F",pinLeft:"\u56FA\u5B9A\u5728\u5DE6\u4FA7",pinRight:"\u56FA\u5B9A\u5728\u53F3\u4FA7",unpin:"\u53D6\u6D88\u56FA\u5B9A",columnMenu:"\u5217\u83DC\u5355",selectRow:"\u9009\u62E9\u884C",selectAllRows:"\u9009\u62E9\u6240\u6709\u884C",chooseColumns:"\u9009\u62E9\u5217",columns:"\u5217",autosizeThis:"\u81EA\u52A8\u8C03\u6574\u6B64\u5217\u5BBD\u5EA6",autosizeAll:"\u81EA\u52A8\u8C03\u6574\u6240\u6709\u5217\u5BBD\u5EA6",resetColumns:"\u91CD\u7F6E\u5217",hideColumn:"\u9690\u85CF\u5217",close:"\u5173\u95ED",copy:"\u590D\u5236",cut:"\u526A\u5207",copyWithHeaders:"\u8FDE\u540C\u6807\u9898\u590D\u5236",paste:"\u7C98\u8D34",pasteHint:"\u6D4F\u89C8\u5668\u963B\u6B62\u4E86\u526A\u8D34\u677F\u8BBF\u95EE\u3002\u8BF7\u6309 Ctrl+V \u7C98\u8D34\u3002",required:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879",invalidValue:"\u503C\u65E0\u6548",and:"\u4E14",or:"\u6216",advancedFilter:"\u9AD8\u7EA7\u7B5B\u9009",addCondition:"\u6DFB\u52A0\u6761\u4EF6",duplicate:"\u8BE5\u503C\u5DF2\u88AB\u4F7F\u7528",undo:"\u64A4\u9500",redo:"\u91CD\u505A",deleteRows:"\u5220\u9664\u6240\u9009\u884C",copyRows:"\u590D\u5236\u6240\u9009\u884C",statusRows:"{n} \u884C",statusFiltered:"{total} \u884C\u4E2D\u7684 {shown} \u884C",statusSelected:"\u5DF2\u9009 {n} \u884C",count:"\u8BA1\u6570",sum:"\u6C42\u548C",avg:"\u5E73\u5747\u503C",min:"\u6700\u5C0F\u503C",max:"\u6700\u5927\u503C",findPlaceholder:"\u5728\u8868\u683C\u4E2D\u67E5\u627E",noMatches:"\u65E0\u5339\u914D\u9879",findNext:"\u4E0B\u4E00\u4E2A",findPrevious:"\u4E0A\u4E00\u4E2A",groupPanelHint:"\u5C06\u5217\u6807\u9898\u62D6\u5230\u6B64\u5904\u4EE5\u5206\u7EC4",groupByThis:"\u6309\u6B64\u5217\u5206\u7EC4",ungroup:"\u53D6\u6D88\u5206\u7EC4",expandAll:"\u5168\u90E8\u5C55\u5F00",collapseAll:"\u5168\u90E8\u6298\u53E0",pagerRange:"\u7B2C {from}\u2013{to} \u6761\uFF0C\u5171 {total} \u6761",pageOf:"\u7B2C {page} \u9875\uFF0C\u5171 {pages} \u9875",pageSize:"\u6BCF\u9875\u884C\u6570",firstPage:"\u9996\u9875",previousPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",lastPage:"\u672B\u9875",loading:"\u52A0\u8F7D\u4E2D\u2026",loadFailed:"\u65E0\u6CD5\u52A0\u8F7D\u6570\u636E",filters:"\u7B5B\u9009",clearFilters:"\u6E05\u9664\u6240\u6709\u7B5B\u9009",exportCsv:"\u5BFC\u51FA CSV",exportExcel:"\u5BFC\u51FA Excel",print:"\u6253\u5370\u2026",printLimited:"\u4EC5\u6253\u5370\u4E86 {total} \u884C\u4E2D\u7684\u524D {n} \u884C\u3002\u5982\u9700\u5168\u90E8\uFF0C\u8BF7\u5BFC\u51FA\u4E3A Excel \u6216 CSV\u3002",pivot:"\u6570\u636E\u900F\u89C6",pivotMode:"\u900F\u89C6\u6A21\u5F0F",pivotRows:"\u884C\u5206\u7EC4",pivotColumns:"\u5217\u6807\u7B7E",pivotValues:"\u503C",total:"\u603B\u8BA1",addColumn:"\u6DFB\u52A0\u5217\u2026",chartBar:"\u67F1\u72B6\u56FE",chartStacked:"\u5806\u79EF\u67F1\u72B6\u56FE",chartLine:"\u6298\u7EBF\u56FE",chartArea:"\u9762\u79EF\u56FE",chartPie:"\u997C\u56FE",chartDonut:"\u73AF\u5F62\u56FE",chartCombo:"\u67F1\u7EBF\u7EC4\u5408\u56FE",chartScatter:"\u6563\u70B9\u56FE",freeBadge:"\u514D\u8D39\u4F7F\u7528\u4E2D",exportPdf:"\u5BFC\u51FA PDF",exportJson:"\u5BFC\u51FA JSON",ai:{title:"AI \u52A9\u624B",placeholder:"\u8BE2\u95EE\u6570\u636E\uFF0C\u6216\u544A\u8BC9\u8868\u683C\u8981\u505A\u4EC0\u4E48",send:"\u53D1\u9001",thinking:"\u5904\u7406\u4E2D\u2026",undo:"\u64A4\u9500",undone:"\u5DF2\u64A4\u9500",failed:"\u52A9\u624B\u6CA1\u6709\u56DE\u5E94",skipped:"\u5DF2\u8DF3\u8FC7",done:"\u5B8C\u6210"},cf:{title:"\u6761\u4EF6\u683C\u5F0F",add:"\u6DFB\u52A0\u89C4\u5219",clear:"\u6E05\u9664\u89C4\u5219",none:"\u6B64\u5217\u6CA1\u6709\u89C4\u5219",type:"\u89C4\u5219",style:"\u683C\u5F0F",wholeRow:"\u6574\u884C",count:"\u6570\u91CF",types:{value:"\u5355\u5143\u683C\u503C",formula:"\u516C\u5F0F",top:"\u524D",bottom:"\u540E",aboveAverage:"\u9AD8\u4E8E\u5E73\u5747\u503C",belowAverage:"\u4F4E\u4E8E\u5E73\u5747\u503C",duplicate:"\u91CD\u590D\u503C",unique:"\u552F\u4E00\u503C",dataBar:"\u6570\u636E\u6761",colorScale:"\u8272\u9636",iconSet:"\u56FE\u6807\u96C6"},ops:{notBetween:"\u4E0D\u4ECB\u4E8E",notContains:"\u4E0D\u5305\u542B"},styles:{red:"\u6D45\u7EA2\u8272\u586B\u5145",yellow:"\u9EC4\u8272\u586B\u5145",green:"\u7EFF\u8272\u586B\u5145",blue:"\u84DD\u8272\u586B\u5145",redText:"\u7EA2\u8272\u6587\u672C",bold:"\u52A0\u7C97"}},ops:{contains:"\u5305\u542B",equals:"\u7B49\u4E8E",notEquals:"\u4E0D\u7B49\u4E8E",startsWith:"\u5F00\u5934\u662F",endsWith:"\u7ED3\u5C3E\u662F",blank:"\u4E3A\u7A7A",notBlank:"\u4E0D\u4E3A\u7A7A",eq:"\u7B49\u4E8E",ne:"\u4E0D\u7B49\u4E8E",lt:"\u5C0F\u4E8E",lte:"\u5C0F\u4E8E\u6216\u7B49\u4E8E",gt:"\u5927\u4E8E",gte:"\u5927\u4E8E\u6216\u7B49\u4E8E",between:"\u4ECB\u4E8E",before:"\u65E9\u4E8E",after:"\u665A\u4E8E"}},Xo=ps;var hs={code:"zh-TW",noRows:"\u6C92\u6709\u53EF\u986F\u793A\u7684\u8CC7\u6599",filter:"\u7BE9\u9078",apply:"\u5957\u7528",reset:"\u91CD\u8A2D",selectAll:"(\u5168\u9078)",search:"\u641C\u5C0B\u2026",blanks:"(\u7A7A\u767D)",value:"\u503C",valueTo:"\u81F3",sortAsc:"\u905E\u589E\u6392\u5E8F",sortDesc:"\u905E\u6E1B\u6392\u5E8F",clearSort:"\u6E05\u9664\u6392\u5E8F",pinLeft:"\u56FA\u5B9A\u5728\u5DE6\u5074",pinRight:"\u56FA\u5B9A\u5728\u53F3\u5074",unpin:"\u53D6\u6D88\u56FA\u5B9A",columnMenu:"\u6B04\u4F4D\u9078\u55AE",selectRow:"\u9078\u53D6\u5217",selectAllRows:"\u9078\u53D6\u6240\u6709\u5217",chooseColumns:"\u9078\u64C7\u6B04\u4F4D",columns:"\u6B04\u4F4D",autosizeThis:"\u81EA\u52D5\u8ABF\u6574\u6B64\u6B04\u5BEC",autosizeAll:"\u81EA\u52D5\u8ABF\u6574\u6240\u6709\u6B04\u5BEC",resetColumns:"\u91CD\u8A2D\u6B04\u4F4D",hideColumn:"\u96B1\u85CF\u6B04\u4F4D",close:"\u95DC\u9589",copy:"\u8907\u88FD",cut:"\u526A\u4E0B",copyWithHeaders:"\u9023\u540C\u6A19\u984C\u8907\u88FD",paste:"\u8CBC\u4E0A",pasteHint:"\u7121\u6CD5\u5B58\u53D6\u526A\u8CBC\u7C3F\u3002\u8ACB\u6309 Ctrl+V \u8CBC\u4E0A\u3002",required:"\u6B64\u6B04\u4F4D\u70BA\u5FC5\u586B",invalidValue:"\u503C\u7121\u6548",and:"\u4E14",or:"\u6216",advancedFilter:"\u9032\u968E\u7BE9\u9078",addCondition:"\u65B0\u589E\u689D\u4EF6",duplicate:"\u6B64\u503C\u5DF2\u88AB\u4F7F\u7528",undo:"\u5FA9\u539F",redo:"\u91CD\u505A",deleteRows:"\u522A\u9664\u9078\u53D6\u7684\u5217",copyRows:"\u8907\u88FD\u9078\u53D6\u7684\u5217",statusRows:"{n} \u5217",statusFiltered:"{total} \u5217\u4E2D\u7684 {shown} \u5217",statusSelected:"\u5DF2\u9078\u53D6 {n} \u5217",count:"\u7B46\u6578",sum:"\u5408\u8A08",avg:"\u5E73\u5747",min:"\u6700\u5C0F",max:"\u6700\u5927",findPlaceholder:"\u5728\u8868\u683C\u4E2D\u5C0B\u627E",noMatches:"\u6C92\u6709\u7B26\u5408\u7684\u7D50\u679C",findNext:"\u4E0B\u4E00\u500B",findPrevious:"\u4E0A\u4E00\u500B",groupPanelHint:"\u5C07\u6B04\u4F4D\u6A19\u984C\u62D6\u66F3\u5230\u9019\u88E1\u4EE5\u5206\u7D44",groupByThis:"\u4F9D\u6B64\u6B04\u4F4D\u5206\u7D44",ungroup:"\u53D6\u6D88\u5206\u7D44",expandAll:"\u5168\u90E8\u5C55\u958B",collapseAll:"\u5168\u90E8\u647A\u758A",pagerRange:"{from}\u2013{to}\uFF0C\u5171 {total} \u7B46",pageOf:"\u7B2C {page} \u9801\uFF0C\u5171 {pages} \u9801",pageSize:"\u6BCF\u9801\u5217\u6578",firstPage:"\u7B2C\u4E00\u9801",previousPage:"\u4E0A\u4E00\u9801",nextPage:"\u4E0B\u4E00\u9801",lastPage:"\u6700\u5F8C\u4E00\u9801",loading:"\u8F09\u5165\u4E2D\u2026",loadFailed:"\u7121\u6CD5\u8F09\u5165\u8CC7\u6599",filters:"\u7BE9\u9078",clearFilters:"\u6E05\u9664\u6240\u6709\u7BE9\u9078",exportCsv:"\u532F\u51FA CSV",exportExcel:"\u532F\u51FA Excel",print:"\u5217\u5370\u2026",printLimited:"\u50C5\u5217\u5370\u4E86 {total} \u5217\u4E2D\u7684\u524D {n} \u5217\u3002\u5982\u9700\u5168\u90E8\uFF0C\u8ACB\u532F\u51FA\u70BA Excel \u6216 CSV\u3002",pivot:"\u6A1E\u7D10\u5206\u6790",pivotMode:"\u6A1E\u7D10\u5206\u6790\u6A21\u5F0F",pivotRows:"\u5217\u7FA4\u7D44",pivotColumns:"\u6B04\u6A19\u7C64",pivotValues:"\u503C",total:"\u7E3D\u8A08",addColumn:"\u65B0\u589E\u6B04\u4F4D\u2026",chartBar:"\u76F4\u689D\u5716",chartStacked:"\u5806\u758A\u76F4\u689D\u5716",chartLine:"\u6298\u7DDA\u5716",chartArea:"\u5340\u57DF\u5716",chartPie:"\u5713\u5F62\u5716",chartDonut:"\u74B0\u5708\u5716",chartCombo:"\u76F4\u689D\u8207\u6298\u7DDA\u5716",chartScatter:"\u6563\u4F48\u5716",freeBadge:"\u514D\u8CBB\u7248",exportPdf:"\u532F\u51FA PDF",exportJson:"\u532F\u51FA JSON",ai:{title:"AI \u52A9\u7406",placeholder:"\u8A62\u554F\u8CC7\u6599\uFF0C\u6216\u544A\u8A34\u8868\u683C\u8981\u505A\u4EC0\u9EBC",send:"\u50B3\u9001",thinking:"\u8655\u7406\u4E2D\u2026",undo:"\u5FA9\u539F",undone:"\u5DF2\u5FA9\u539F",failed:"\u52A9\u7406\u6C92\u6709\u56DE\u61C9",skipped:"\u5DF2\u7565\u904E",done:"\u5B8C\u6210"},cf:{title:"\u8A2D\u5B9A\u683C\u5F0F\u5316\u7684\u689D\u4EF6",add:"\u65B0\u589E\u898F\u5247",clear:"\u6E05\u9664\u898F\u5247",none:"\u6B64\u6B04\u6C92\u6709\u898F\u5247",type:"\u898F\u5247",style:"\u683C\u5F0F",wholeRow:"\u6574\u5217",count:"\u6578\u91CF",types:{value:"\u5132\u5B58\u683C\u503C",formula:"\u516C\u5F0F",top:"\u524D",bottom:"\u5F8C",aboveAverage:"\u9AD8\u65BC\u5E73\u5747",belowAverage:"\u4F4E\u65BC\u5E73\u5747",duplicate:"\u91CD\u8907\u503C",unique:"\u552F\u4E00\u503C",dataBar:"\u8CC7\u6599\u6A6B\u689D",colorScale:"\u8272\u968E",iconSet:"\u5716\u793A\u96C6"},ops:{notBetween:"\u4E0D\u4ECB\u65BC",notContains:"\u4E0D\u5305\u542B"},styles:{red:"\u6DFA\u7D05\u8272\u586B\u6EFF",yellow:"\u9EC3\u8272\u586B\u6EFF",green:"\u7DA0\u8272\u586B\u6EFF",blue:"\u85CD\u8272\u586B\u6EFF",redText:"\u7D05\u8272\u6587\u5B57",bold:"\u7C97\u9AD4"}},ops:{contains:"\u5305\u542B",equals:"\u7B49\u65BC",notEquals:"\u4E0D\u7B49\u65BC",startsWith:"\u958B\u982D\u70BA",endsWith:"\u7D50\u5C3E\u70BA",blank:"\u7A7A\u767D",notBlank:"\u975E\u7A7A\u767D",eq:"\u7B49\u65BC",ne:"\u4E0D\u7B49\u65BC",lt:"\u5C0F\u65BC",lte:"\u5C0F\u65BC\u6216\u7B49\u65BC",gt:"\u5927\u65BC",gte:"\u5927\u65BC\u6216\u7B49\u65BC",between:"\u4ECB\u65BC",before:"\u65E9\u65BC",after:"\u665A\u65BC"}},Jo=hs;var ms={code:"vi",noRows:"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",filter:"L\u1ECDc",apply:"\xC1p d\u1EE5ng",reset:"\u0110\u1EB7t l\u1EA1i",selectAll:"(Ch\u1ECDn t\u1EA5t c\u1EA3)",search:"T\xECm\u2026",blanks:"(Tr\u1ED1ng)",value:"Gi\xE1 tr\u1ECB",valueTo:"\u0110\u1EBFn",sortAsc:"S\u1EAFp x\u1EBFp t\u0103ng d\u1EA7n",sortDesc:"S\u1EAFp x\u1EBFp gi\u1EA3m d\u1EA7n",clearSort:"B\u1ECF s\u1EAFp x\u1EBFp",pinLeft:"Ghim tr\xE1i",pinRight:"Ghim ph\u1EA3i",unpin:"B\u1ECF ghim",columnMenu:"Menu c\u1ED9t",selectRow:"Ch\u1ECDn d\xF2ng",selectAllRows:"Ch\u1ECDn t\u1EA5t c\u1EA3 d\xF2ng",chooseColumns:"Ch\u1ECDn c\u1ED9t",columns:"C\u1ED9t",autosizeThis:"T\u1EF1 \u0111\u1ED9ng ch\u1EC9nh \u0111\u1ED9 r\u1ED9ng c\u1ED9t n\xE0y",autosizeAll:"T\u1EF1 \u0111\u1ED9ng ch\u1EC9nh \u0111\u1ED9 r\u1ED9ng t\u1EA5t c\u1EA3 c\u1ED9t",resetColumns:"\u0110\u1EB7t l\u1EA1i c\u1ED9t",hideColumn:"\u1EA8n c\u1ED9t",close:"\u0110\xF3ng",copy:"Sao ch\xE9p",cut:"C\u1EAFt",copyWithHeaders:"Sao ch\xE9p k\xE8m ti\xEAu \u0111\u1EC1",paste:"D\xE1n",pasteHint:"Kh\xF4ng truy c\u1EADp \u0111\u01B0\u1EE3c b\u1ED9 nh\u1EDB t\u1EA1m. Nh\u1EA5n Ctrl+V \u0111\u1EC3 d\xE1n.",required:"Tr\u01B0\u1EDDng n\xE0y l\xE0 b\u1EAFt bu\u1ED9c",invalidValue:"Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7",and:"V\xE0",or:"Ho\u1EB7c",advancedFilter:"L\u1ECDc n\xE2ng cao",addCondition:"Th\xEAm \u0111i\u1EC1u ki\u1EC7n",duplicate:"Gi\xE1 tr\u1ECB n\xE0y \u0111\xE3 \u0111\u01B0\u1EE3c d\xF9ng",undo:"Ho\xE0n t\xE1c",redo:"L\xE0m l\u1EA1i",deleteRows:"X\xF3a c\xE1c d\xF2ng \u0111\xE3 ch\u1ECDn",copyRows:"Sao ch\xE9p c\xE1c d\xF2ng \u0111\xE3 ch\u1ECDn",statusRows:"{n} d\xF2ng",statusFiltered:"{shown} / {total} d\xF2ng",statusSelected:"\u0110\xE3 ch\u1ECDn {n}",count:"S\u1ED1 l\u01B0\u1EE3ng",sum:"T\u1ED5ng",avg:"Trung b\xECnh",min:"Nh\u1ECF nh\u1EA5t",max:"L\u1EDBn nh\u1EA5t",findPlaceholder:"T\xECm trong b\u1EA3ng",noMatches:"Kh\xF4ng t\xECm th\u1EA5y",findNext:"K\u1EBFt qu\u1EA3 ti\u1EBFp",findPrevious:"K\u1EBFt qu\u1EA3 tr\u01B0\u1EDBc",groupPanelHint:"K\xE9o ti\xEAu \u0111\u1EC1 c\u1ED9t v\xE0o \u0111\xE2y \u0111\u1EC3 nh\xF3m d\xF2ng",groupByThis:"Nh\xF3m theo c\u1ED9t n\xE0y",ungroup:"B\u1ECF nh\xF3m",expandAll:"M\u1EDF r\u1ED9ng t\u1EA5t c\u1EA3",collapseAll:"Thu g\u1ECDn t\u1EA5t c\u1EA3",pagerRange:"{from}\u2013{to} / {total}",pageOf:"Trang {page} / {pages}",pageSize:"S\u1ED1 d\xF2ng m\u1ED7i trang",firstPage:"Trang \u0111\u1EA7u",previousPage:"Trang tr\u01B0\u1EDBc",nextPage:"Trang sau",lastPage:"Trang cu\u1ED1i",loading:"\u0110ang t\u1EA3i\u2026",loadFailed:"Kh\xF4ng t\u1EA3i \u0111\u01B0\u1EE3c d\u1EEF li\u1EC7u",filters:"B\u1ED9 l\u1ECDc",clearFilters:"X\xF3a t\u1EA5t c\u1EA3 b\u1ED9 l\u1ECDc",exportCsv:"Xu\u1EA5t CSV",exportExcel:"Xu\u1EA5t Excel",print:"In\u2026",printLimited:"\u0110\xE3 in {n} h\xE0ng \u0111\u1EA7u ti\xEAn trong t\u1ED5ng s\u1ED1 {total} h\xE0ng. Xu\u1EA5t sang Excel ho\u1EB7c CSV \u0111\u1EC3 c\xF3 t\u1EA5t c\u1EA3.",pivot:"Pivot",pivotMode:"Ch\u1EBF \u0111\u1ED9 pivot",pivotRows:"Nh\xF3m d\xF2ng",pivotColumns:"Nh\xE3n c\u1ED9t",pivotValues:"Gi\xE1 tr\u1ECB",total:"T\u1ED5ng c\u1ED9ng",addColumn:"Th\xEAm c\u1ED9t\u2026",chartBar:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t",chartStacked:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t ch\u1ED3ng",chartLine:"Bi\u1EC3u \u0111\u1ED3 \u0111\u01B0\u1EDDng",chartArea:"Bi\u1EC3u \u0111\u1ED3 v\xF9ng",chartPie:"Bi\u1EC3u \u0111\u1ED3 tr\xF2n",chartDonut:"Bi\u1EC3u \u0111\u1ED3 v\xE0nh khuy\xEAn",chartCombo:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t v\xE0 \u0111\u01B0\u1EDDng",chartScatter:"Bi\u1EC3u \u0111\u1ED3 ph\xE2n t\xE1n",freeBadge:"B\u1EA3n mi\u1EC5n ph\xED",exportPdf:"Xu\u1EA5t PDF",exportJson:"Xu\u1EA5t JSON",ai:{title:"Tr\u1EE3 l\xFD AI",placeholder:"H\u1ECFi v\u1EC1 d\u1EEF li\u1EC7u ho\u1EB7c b\u1EA3o b\u1EA3ng c\u1EA7n l\xE0m g\xEC",send:"G\u1EEDi",thinking:"\u0110ang x\u1EED l\xFD\u2026",undo:"Ho\xE0n t\xE1c",undone:"\u0110\xE3 ho\xE0n t\xE1c",failed:"Tr\u1EE3 l\xFD kh\xF4ng ph\u1EA3n h\u1ED3i",skipped:"\u0110\xE3 b\u1ECF qua",done:"Xong"},cf:{title:"\u0110\u1ECBnh d\u1EA1ng c\xF3 \u0111i\u1EC1u ki\u1EC7n",add:"Th\xEAm quy t\u1EAFc",clear:"X\xF3a quy t\u1EAFc",none:"C\u1ED9t n\xE0y ch\u01B0a c\xF3 quy t\u1EAFc",type:"Quy t\u1EAFc",style:"\u0110\u1ECBnh d\u1EA1ng",wholeRow:"C\u1EA3 h\xE0ng",count:"S\u1ED1 l\u01B0\u1EE3ng",types:{value:"Gi\xE1 tr\u1ECB \xF4",formula:"C\xF4ng th\u1EE9c",top:"Cao nh\u1EA5t",bottom:"Th\u1EA5p nh\u1EA5t",aboveAverage:"Tr\xEAn trung b\xECnh",belowAverage:"D\u01B0\u1EDBi trung b\xECnh",duplicate:"Gi\xE1 tr\u1ECB tr\xF9ng l\u1EB7p",unique:"Gi\xE1 tr\u1ECB duy nh\u1EA5t",dataBar:"Thanh d\u1EEF li\u1EC7u",colorScale:"Thang m\xE0u",iconSet:"B\u1ED9 bi\u1EC3u t\u01B0\u1EE3ng"},ops:{notBetween:"Kh\xF4ng n\u1EB1m gi\u1EEFa",notContains:"Kh\xF4ng ch\u1EE9a"},styles:{red:"T\xF4 \u0111\u1ECF nh\u1EA1t",yellow:"T\xF4 v\xE0ng",green:"T\xF4 xanh l\xE1",blue:"T\xF4 xanh d\u01B0\u01A1ng",redText:"Ch\u1EEF \u0111\u1ECF",bold:"In \u0111\u1EADm"}},ops:{contains:"Ch\u1EE9a",equals:"B\u1EB1ng",notEquals:"Kh\xE1c",startsWith:"B\u1EAFt \u0111\u1EA7u b\u1EB1ng",endsWith:"K\u1EBFt th\xFAc b\u1EB1ng",blank:"Tr\u1ED1ng",notBlank:"Kh\xF4ng tr\u1ED1ng",eq:"B\u1EB1ng",ne:"Kh\xE1c",lt:"Nh\u1ECF h\u01A1n",lte:"Nh\u1ECF h\u01A1n ho\u1EB7c b\u1EB1ng",gt:"L\u1EDBn h\u01A1n",gte:"L\u1EDBn h\u01A1n ho\u1EB7c b\u1EB1ng",between:"Trong kho\u1EA3ng",before:"Tr\u01B0\u1EDBc",after:"Sau"}},Yo=ms;var gs={code:"th",noRows:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",filter:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",apply:"\u0E43\u0E0A\u0E49",reset:"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15",selectAll:"(\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14)",search:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",blanks:"(\u0E27\u0E48\u0E32\u0E07)",value:"\u0E04\u0E48\u0E32",valueTo:"\u0E16\u0E36\u0E07",sortAsc:"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",sortDesc:"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",clearSort:"\u0E25\u0E49\u0E32\u0E07\u0E01\u0E32\u0E23\u0E40\u0E23\u0E35\u0E22\u0E07",pinLeft:"\u0E15\u0E23\u0E36\u0E07\u0E0B\u0E49\u0E32\u0E22",pinRight:"\u0E15\u0E23\u0E36\u0E07\u0E02\u0E27\u0E32",unpin:"\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07",columnMenu:"\u0E40\u0E21\u0E19\u0E39\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",selectRow:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",selectAllRows:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",chooseColumns:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",columns:"\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",autosizeThis:"\u0E1B\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",autosizeAll:"\u0E1B\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E17\u0E38\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",resetColumns:"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",hideColumn:"\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",close:"\u0E1B\u0E34\u0E14",copy:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",cut:"\u0E15\u0E31\u0E14",copyWithHeaders:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E2B\u0E31\u0E27\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",paste:"\u0E27\u0E32\u0E07",pasteHint:"\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E01\u0E14 Ctrl+V \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E27\u0E32\u0E07",required:"\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E23\u0E2D\u0E01\u0E0A\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",invalidValue:"\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",and:"\u0E41\u0E25\u0E30",or:"\u0E2B\u0E23\u0E37\u0E2D",advancedFilter:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07",addCondition:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02",duplicate:"\u0E04\u0E48\u0E32\u0E19\u0E35\u0E49\u0E16\u0E39\u0E01\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27",undo:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",redo:"\u0E17\u0E33\u0E0B\u0E49\u0E33",deleteRows:"\u0E25\u0E1A\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",copyRows:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",statusRows:"{n} \u0E41\u0E16\u0E27",statusFiltered:"{shown} \u0E08\u0E32\u0E01 {total} \u0E41\u0E16\u0E27",statusSelected:"\u0E40\u0E25\u0E37\u0E2D\u0E01 {n} \u0E41\u0E16\u0E27",count:"\u0E08\u0E33\u0E19\u0E27\u0E19",sum:"\u0E1C\u0E25\u0E23\u0E27\u0E21",avg:"\u0E04\u0E48\u0E32\u0E40\u0E09\u0E25\u0E35\u0E48\u0E22",min:"\u0E15\u0E48\u0E33\u0E2A\u0E38\u0E14",max:"\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14",findPlaceholder:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E43\u0E19\u0E15\u0E32\u0E23\u0E32\u0E07",noMatches:"\u0E44\u0E21\u0E48\u0E1E\u0E1A",findNext:"\u0E16\u0E31\u0E14\u0E44\u0E1B",findPrevious:"\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",groupPanelHint:"\u0E25\u0E32\u0E01\u0E2B\u0E31\u0E27\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E21\u0E32\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",groupByThis:"\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21\u0E15\u0E32\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49",ungroup:"\u0E40\u0E25\u0E34\u0E01\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",expandAll:"\u0E02\u0E22\u0E32\u0E22\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",collapseAll:"\u0E22\u0E38\u0E1A\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",pagerRange:"{from}\u2013{to} \u0E08\u0E32\u0E01 {total}",pageOf:"\u0E2B\u0E19\u0E49\u0E32 {page} \u0E08\u0E32\u0E01 {pages}",pageSize:"\u0E41\u0E16\u0E27\u0E15\u0E48\u0E2D\u0E2B\u0E19\u0E49\u0E32",firstPage:"\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",previousPage:"\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19",nextPage:"\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",lastPage:"\u0E2B\u0E19\u0E49\u0E32\u0E2A\u0E38\u0E14\u0E17\u0E49\u0E32\u0E22",loading:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",loadFailed:"\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08",filters:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",clearFilters:"\u0E25\u0E49\u0E32\u0E07\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",exportCsv:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 CSV",exportExcel:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 Excel",print:"\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u2026",printLimited:"\u0E1E\u0E34\u0E21\u0E1E\u0E4C {n} \u0E41\u0E16\u0E27\u0E41\u0E23\u0E01\u0E08\u0E32\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14 {total} \u0E41\u0E16\u0E27 \u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01\u0E40\u0E1B\u0E47\u0E19 Excel \u0E2B\u0E23\u0E37\u0E2D CSV \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E23\u0E31\u0E1A\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",pivot:"Pivot",pivotMode:"\u0E42\u0E2B\u0E21\u0E14 Pivot",pivotRows:"\u0E01\u0E25\u0E38\u0E48\u0E21\u0E41\u0E16\u0E27",pivotColumns:"\u0E1B\u0E49\u0E32\u0E22\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",pivotValues:"\u0E04\u0E48\u0E32",total:"\u0E23\u0E27\u0E21",addColumn:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u2026",chartBar:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07",chartStacked:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E0B\u0E49\u0E2D\u0E19",chartLine:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19",chartArea:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E1E\u0E37\u0E49\u0E19\u0E17\u0E35\u0E48",chartPie:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E27\u0E07\u0E01\u0E25\u0E21",chartDonut:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E42\u0E14\u0E19\u0E31\u0E17",chartCombo:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E41\u0E25\u0E30\u0E40\u0E2A\u0E49\u0E19",chartScatter:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22",freeBadge:"\u0E23\u0E38\u0E48\u0E19\u0E1F\u0E23\u0E35",exportPdf:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 PDF",exportJson:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 JSON",ai:{title:"\u0E1C\u0E39\u0E49\u0E0A\u0E48\u0E27\u0E22 AI",placeholder:"\u0E16\u0E32\u0E21\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25 \u0E2B\u0E23\u0E37\u0E2D\u0E1A\u0E2D\u0E01\u0E15\u0E32\u0E23\u0E32\u0E07\u0E27\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E17\u0E33\u0E2D\u0E30\u0E44\u0E23",send:"\u0E2A\u0E48\u0E07",thinking:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E17\u0E33\u0E07\u0E32\u0E19\u2026",undo:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",undone:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33\u0E41\u0E25\u0E49\u0E27",failed:"\u0E1C\u0E39\u0E49\u0E0A\u0E48\u0E27\u0E22\u0E44\u0E21\u0E48\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A",skipped:"\u0E02\u0E49\u0E32\u0E21",done:"\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E41\u0E25\u0E49\u0E27"},cf:{title:"\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E15\u0E32\u0E21\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02",add:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E01\u0E0E",clear:"\u0E25\u0E49\u0E32\u0E07\u0E01\u0E0E",none:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E0E\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49",type:"\u0E01\u0E0E",style:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A",wholeRow:"\u0E17\u0E31\u0E49\u0E07\u0E41\u0E16\u0E27",count:"\u0E08\u0E33\u0E19\u0E27\u0E19",types:{value:"\u0E04\u0E48\u0E32\u0E43\u0E19\u0E40\u0E0B\u0E25\u0E25\u0E4C",formula:"\u0E2A\u0E39\u0E15\u0E23",top:"\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14",bottom:"\u0E15\u0E48\u0E33\u0E2A\u0E38\u0E14",aboveAverage:"\u0E2A\u0E39\u0E07\u0E01\u0E27\u0E48\u0E32\u0E04\u0E48\u0E32\u0E40\u0E09\u0E25\u0E35\u0E48\u0E22",belowAverage:"\u0E15\u0E48\u0E33\u0E01\u0E27\u0E48\u0E32\u0E04\u0E48\u0E32\u0E40\u0E09\u0E25\u0E35\u0E48\u0E22",duplicate:"\u0E04\u0E48\u0E32\u0E17\u0E35\u0E48\u0E0B\u0E49\u0E33\u0E01\u0E31\u0E19",unique:"\u0E04\u0E48\u0E32\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E0B\u0E49\u0E33",dataBar:"\u0E41\u0E16\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",colorScale:"\u0E23\u0E30\u0E14\u0E31\u0E1A\u0E2A\u0E35",iconSet:"\u0E0A\u0E38\u0E14\u0E44\u0E2D\u0E04\u0E2D\u0E19"},ops:{notBetween:"\u0E44\u0E21\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07",notContains:"\u0E44\u0E21\u0E48\u0E21\u0E35"},styles:{red:"\u0E40\u0E15\u0E34\u0E21\u0E2A\u0E35\u0E41\u0E14\u0E07\u0E2D\u0E48\u0E2D\u0E19",yellow:"\u0E40\u0E15\u0E34\u0E21\u0E2A\u0E35\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E07",green:"\u0E40\u0E15\u0E34\u0E21\u0E2A\u0E35\u0E40\u0E02\u0E35\u0E22\u0E27",blue:"\u0E40\u0E15\u0E34\u0E21\u0E2A\u0E35\u0E19\u0E49\u0E33\u0E40\u0E07\u0E34\u0E19",redText:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E35\u0E41\u0E14\u0E07",bold:"\u0E15\u0E31\u0E27\u0E2B\u0E19\u0E32"}},ops:{contains:"\u0E21\u0E35\u0E04\u0E33\u0E27\u0E48\u0E32",equals:"\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",notEquals:"\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",startsWith:"\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22",endsWith:"\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22",blank:"\u0E27\u0E48\u0E32\u0E07",notBlank:"\u0E44\u0E21\u0E48\u0E27\u0E48\u0E32\u0E07",eq:"\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",ne:"\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",lt:"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",lte:"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",gt:"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",gte:"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",between:"\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07",before:"\u0E01\u0E48\u0E2D\u0E19",after:"\u0E2B\u0E25\u0E31\u0E07"}},Zo=gs;var ws={code:"id",noRows:"Tidak ada data",filter:"Filter",apply:"Terapkan",reset:"Atur ulang",selectAll:"(Pilih semua)",search:"Cari\u2026",blanks:"(Kosong)",value:"Nilai",valueTo:"Sampai",sortAsc:"Urutkan naik",sortDesc:"Urutkan turun",clearSort:"Hapus urutan",pinLeft:"Sematkan kiri",pinRight:"Sematkan kanan",unpin:"Lepas sematan",columnMenu:"Menu kolom",selectRow:"Pilih baris",selectAllRows:"Pilih semua baris",chooseColumns:"Pilih kolom",columns:"Kolom",autosizeThis:"Sesuaikan lebar kolom ini",autosizeAll:"Sesuaikan lebar semua kolom",resetColumns:"Atur ulang kolom",hideColumn:"Sembunyikan kolom",close:"Tutup",copy:"Salin",cut:"Potong",copyWithHeaders:"Salin dengan judul",paste:"Tempel",pasteHint:"Akses papan klip diblokir. Tekan Ctrl+V untuk menempel.",required:"Kolom ini wajib diisi",invalidValue:"Nilai tidak valid",and:"Dan",or:"Atau",advancedFilter:"Filter lanjutan",addCondition:"Tambah kondisi",duplicate:"Nilai ini sudah dipakai",undo:"Urungkan",redo:"Ulangi",deleteRows:"Hapus baris terpilih",copyRows:"Salin baris terpilih",statusRows:"{n} baris",statusFiltered:"{shown} dari {total} baris",statusSelected:"{n} dipilih",count:"Jumlah data",sum:"Total",avg:"Rata-rata",min:"Min",max:"Maks",findPlaceholder:"Cari di tabel",noMatches:"Tidak ditemukan",findNext:"Berikutnya",findPrevious:"Sebelumnya",groupPanelHint:"Seret judul kolom ke sini untuk mengelompokkan",groupByThis:"Kelompokkan menurut kolom ini",ungroup:"Hapus pengelompokan",expandAll:"Buka semua",collapseAll:"Tutup semua",pagerRange:"{from}\u2013{to} dari {total}",pageOf:"Halaman {page} dari {pages}",pageSize:"Baris per halaman",firstPage:"Halaman pertama",previousPage:"Halaman sebelumnya",nextPage:"Halaman berikutnya",lastPage:"Halaman terakhir",loading:"Memuat\u2026",loadFailed:"Gagal memuat data",filters:"Filter",clearFilters:"Hapus semua filter",exportCsv:"Ekspor CSV",exportExcel:"Ekspor Excel",print:"Cetak\u2026",printLimited:"Dicetak {n} baris pertama dari {total}. Ekspor ke Excel atau CSV untuk semua baris.",pivot:"Pivot",pivotMode:"Mode pivot",pivotRows:"Grup baris",pivotColumns:"Label kolom",pivotValues:"Nilai",total:"Total",addColumn:"Tambah kolom\u2026",chartBar:"Diagram batang",chartStacked:"Diagram batang bertumpuk",chartLine:"Diagram garis",chartArea:"Diagram area",chartPie:"Diagram lingkaran",chartDonut:"Diagram donat",chartCombo:"Diagram batang dan garis",chartScatter:"Diagram sebar",freeBadge:"Versi gratis",exportPdf:"Ekspor PDF",exportJson:"Ekspor JSON",ai:{title:"Asisten AI",placeholder:"Tanyakan tentang data atau beri tahu grid apa yang harus dilakukan",send:"Kirim",thinking:"Memproses\u2026",undo:"Urungkan",undone:"Diurungkan",failed:"Asisten tidak menjawab",skipped:"Dilewati",done:"Selesai"},cf:{title:"Pemformatan bersyarat",add:"Tambah aturan",clear:"Hapus aturan",none:"Tidak ada aturan untuk kolom ini",type:"Aturan",style:"Format",wholeRow:"Seluruh baris",count:"Jumlah",types:{value:"Nilai sel",formula:"Rumus",top:"Teratas",bottom:"Terbawah",aboveAverage:"Di atas rata-rata",belowAverage:"Di bawah rata-rata",duplicate:"Nilai duplikat",unique:"Nilai unik",dataBar:"Bilah data",colorScale:"Skala warna",iconSet:"Set ikon"},ops:{notBetween:"Tidak di antara",notContains:"Tidak berisi"},styles:{red:"Isian merah muda",yellow:"Isian kuning",green:"Isian hijau",blue:"Isian biru",redText:"Teks merah",bold:"Tebal"}},ops:{contains:"Berisi",equals:"Sama dengan",notEquals:"Tidak sama dengan",startsWith:"Diawali",endsWith:"Diakhiri",blank:"Kosong",notBlank:"Tidak kosong",eq:"Sama dengan",ne:"Tidak sama dengan",lt:"Kurang dari",lte:"Kurang dari atau sama dengan",gt:"Lebih dari",gte:"Lebih dari atau sama dengan",between:"Di antara",before:"Sebelum",after:"Sesudah"}},Qo=ws;var ys={code:"ru",noRows:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445",filter:"\u0424\u0438\u043B\u044C\u0442\u0440",apply:"\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C",reset:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C",selectAll:"(\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435)",search:"\u041F\u043E\u0438\u0441\u043A\u2026",blanks:"(\u041F\u0443\u0441\u0442\u044B\u0435)",value:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435",valueTo:"\u041F\u043E",sortAsc:"\u041F\u043E \u0432\u043E\u0437\u0440\u0430\u0441\u0442\u0430\u043D\u0438\u044E",sortDesc:"\u041F\u043E \u0443\u0431\u044B\u0432\u0430\u043D\u0438\u044E",clearSort:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0443",pinLeft:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0441\u043B\u0435\u0432\u0430",pinRight:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0441\u043F\u0440\u0430\u0432\u0430",unpin:"\u041E\u0442\u043A\u0440\u0435\u043F\u0438\u0442\u044C",columnMenu:"\u041C\u0435\u043D\u044E \u0441\u0442\u043E\u043B\u0431\u0446\u0430",selectRow:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443",selectAllRows:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",chooseColumns:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0446\u044B",columns:"\u0421\u0442\u043E\u043B\u0431\u0446\u044B",autosizeThis:"\u041F\u043E\u0434\u043E\u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0441\u0442\u043E\u043B\u0431\u0446\u0430",autosizeAll:"\u041F\u043E\u0434\u043E\u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",resetColumns:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0446\u044B",hideColumn:"\u0421\u043A\u0440\u044B\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446",close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",copy:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",cut:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C",copyWithHeaders:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u043C\u0438",paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C",pasteHint:"\u0414\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0437\u0430\u043F\u0440\u0435\u0449\u0451\u043D. \u041D\u0430\u0436\u043C\u0438\u0442\u0435 Ctrl+V, \u0447\u0442\u043E\u0431\u044B \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C.",required:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435",invalidValue:"\u041D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435",and:"\u0418",or:"\u0418\u043B\u0438",advancedFilter:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0439 \u0444\u0438\u043B\u044C\u0442\u0440",addCondition:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0441\u043B\u043E\u0432\u0438\u0435",duplicate:"\u042D\u0442\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0443\u0436\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F",undo:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",redo:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",deleteRows:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",copyRows:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",statusRows:"\u0421\u0442\u0440\u043E\u043A: {n}",statusFiltered:"{shown} \u0438\u0437 {total} \u0441\u0442\u0440\u043E\u043A",statusSelected:"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}",count:"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E",sum:"\u0421\u0443\u043C\u043C\u0430",avg:"\u0421\u0440\u0435\u0434\u043D\u0435\u0435",min:"\u041C\u0438\u043D.",max:"\u041C\u0430\u043A\u0441.",findPlaceholder:"\u041D\u0430\u0439\u0442\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435",noMatches:"\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",findNext:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435",findPrevious:"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435",groupPanelHint:"\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0441\u044E\u0434\u0430 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0441\u0442\u043E\u043B\u0431\u0446\u0430 \u0434\u043B\u044F \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438",groupByThis:"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u044D\u0442\u043E\u043C\u0443 \u0441\u0442\u043E\u043B\u0431\u0446\u0443",ungroup:"\u0423\u0431\u0440\u0430\u0442\u044C \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0443",expandAll:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0435",collapseAll:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0435",pagerRange:"{from}\u2013{to} \u0438\u0437 {total}",pageOf:"\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 {page} \u0438\u0437 {pages}",pageSize:"\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",firstPage:"\u041F\u0435\u0440\u0432\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",previousPage:"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",nextPage:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",lastPage:"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",loadFailed:"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",filters:"\u0424\u0438\u043B\u044C\u0442\u0440\u044B",clearFilters:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u0441\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B",exportCsv:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 CSV",exportExcel:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 Excel",print:"\u041F\u0435\u0447\u0430\u0442\u044C\u2026",printLimited:"\u041D\u0430\u043F\u0435\u0447\u0430\u0442\u0430\u043D\u044B \u043F\u0435\u0440\u0432\u044B\u0435 {n} \u0438\u0437 {total} \u0441\u0442\u0440\u043E\u043A. \u0427\u0442\u043E\u0431\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0432\u0441\u0435, \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 Excel \u0438\u043B\u0438 CSV.",pivot:"\u0421\u0432\u043E\u0434\u043D\u0430\u044F",pivotMode:"\u0420\u0435\u0436\u0438\u043C \u0441\u0432\u043E\u0434\u043D\u043E\u0439 \u0442\u0430\u0431\u043B\u0438\u0446\u044B",pivotRows:"\u0413\u0440\u0443\u043F\u043F\u044B \u0441\u0442\u0440\u043E\u043A",pivotColumns:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",pivotValues:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u044F",total:"\u0418\u0442\u043E\u0433\u043E",addColumn:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446\u2026",chartBar:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430",chartStacked:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0441 \u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u0435\u043C",chartLine:"\u0413\u0440\u0430\u0444\u0438\u043A",chartArea:"\u0414\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430 \u0441 \u043E\u0431\u043B\u0430\u0441\u0442\u044F\u043C\u0438",chartPie:"\u041A\u0440\u0443\u0433\u043E\u0432\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",chartDonut:"\u041A\u043E\u043B\u044C\u0446\u0435\u0432\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",chartCombo:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0438 \u0433\u0440\u0430\u0444\u0438\u043A",chartScatter:"\u0422\u043E\u0447\u0435\u0447\u043D\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",freeBadge:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u0430\u044F \u0432\u0435\u0440\u0441\u0438\u044F",exportPdf:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 PDF",exportJson:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 JSON",ai:{title:"\u0418\u0418-\u043F\u043E\u043C\u043E\u0449\u043D\u0438\u043A",placeholder:"\u0421\u043F\u0440\u043E\u0441\u0438\u0442\u0435 \u043E \u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u043B\u0438 \u0441\u043A\u0430\u0436\u0438\u0442\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u0435, \u0447\u0442\u043E \u0441\u0434\u0435\u043B\u0430\u0442\u044C",send:"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",thinking:"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u2026",undo:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",undone:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043E",failed:"\u041F\u043E\u043C\u043E\u0449\u043D\u0438\u043A \u043D\u0435 \u043E\u0442\u0432\u0435\u0442\u0438\u043B",skipped:"\u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E",done:"\u0413\u043E\u0442\u043E\u0432\u043E"},cf:{title:"\u0423\u0441\u043B\u043E\u0432\u043D\u043E\u0435 \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435",add:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u043E",clear:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u0430",none:"\u0414\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u0441\u0442\u043E\u043B\u0431\u0446\u0430 \u043D\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B",type:"\u041F\u0440\u0430\u0432\u0438\u043B\u043E",style:"\u0424\u043E\u0440\u043C\u0430\u0442",wholeRow:"\u0412\u0441\u044F \u0441\u0442\u0440\u043E\u043A\u0430",count:"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E",types:{value:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u044F\u0447\u0435\u0439\u043A\u0438",formula:"\u0424\u043E\u0440\u043C\u0443\u043B\u0430",top:"\u041F\u0435\u0440\u0432\u044B\u0435",bottom:"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435",aboveAverage:"\u0412\u044B\u0448\u0435 \u0441\u0440\u0435\u0434\u043D\u0435\u0433\u043E",belowAverage:"\u041D\u0438\u0436\u0435 \u0441\u0440\u0435\u0434\u043D\u0435\u0433\u043E",duplicate:"\u041F\u043E\u0432\u0442\u043E\u0440\u044F\u044E\u0449\u0438\u0435\u0441\u044F \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F",unique:"\u0423\u043D\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F",dataBar:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u044B",colorScale:"\u0426\u0432\u0435\u0442\u043E\u0432\u0430\u044F \u0448\u043A\u0430\u043B\u0430",iconSet:"\u041D\u0430\u0431\u043E\u0440\u044B \u0437\u043D\u0430\u0447\u043A\u043E\u0432"},ops:{notBetween:"\u0412\u043D\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430",notContains:"\u041D\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442"},styles:{red:"\u0421\u0432\u0435\u0442\u043B\u043E-\u043A\u0440\u0430\u0441\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430",yellow:"\u0416\u0451\u043B\u0442\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430",green:"\u0417\u0435\u043B\u0451\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430",blue:"\u0421\u0438\u043D\u044F\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430",redText:"\u041A\u0440\u0430\u0441\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442",bold:"\u041F\u043E\u043B\u0443\u0436\u0438\u0440\u043D\u044B\u0439"}},ops:{contains:"\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442",equals:"\u0420\u0430\u0432\u043D\u043E",notEquals:"\u041D\u0435 \u0440\u0430\u0432\u043D\u043E",startsWith:"\u041D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0441",endsWith:"\u0417\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043D\u0430",blank:"\u041F\u0443\u0441\u0442\u043E",notBlank:"\u041D\u0435 \u043F\u0443\u0441\u0442\u043E",eq:"\u0420\u0430\u0432\u043D\u043E",ne:"\u041D\u0435 \u0440\u0430\u0432\u043D\u043E",lt:"\u041C\u0435\u043D\u044C\u0448\u0435",lte:"\u041C\u0435\u043D\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u043E",gt:"\u0411\u043E\u043B\u044C\u0448\u0435",gte:"\u0411\u043E\u043B\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u043E",between:"\u041C\u0435\u0436\u0434\u0443",before:"\u0414\u043E",after:"\u041F\u043E\u0441\u043B\u0435"}},er=ys;var bs={code:"pt-BR",noRows:"Nenhuma linha para mostrar",filter:"Filtro",apply:"Aplicar",reset:"Limpar",selectAll:"(Selecionar tudo)",search:"Pesquisar\u2026",blanks:"(Vazios)",value:"Valor",valueTo:"At\xE9",sortAsc:"Ordenar crescente",sortDesc:"Ordenar decrescente",clearSort:"Remover ordena\xE7\xE3o",pinLeft:"Fixar \xE0 esquerda",pinRight:"Fixar \xE0 direita",unpin:"Desafixar",columnMenu:"Menu da coluna",selectRow:"Selecionar linha",selectAllRows:"Selecionar todas as linhas",chooseColumns:"Escolher colunas",columns:"Colunas",autosizeThis:"Ajustar largura desta coluna",autosizeAll:"Ajustar largura de todas as colunas",resetColumns:"Redefinir colunas",hideColumn:"Ocultar coluna",close:"Fechar",copy:"Copiar",cut:"Recortar",copyWithHeaders:"Copiar com cabe\xE7alhos",paste:"Colar",pasteHint:"O acesso \xE0 \xE1rea de transfer\xEAncia foi bloqueado. Pressione Ctrl+V para colar.",required:"Campo obrigat\xF3rio",invalidValue:"Valor inv\xE1lido",and:"E",or:"Ou",advancedFilter:"Filtro avan\xE7ado",addCondition:"Adicionar condi\xE7\xE3o",duplicate:"Este valor j\xE1 est\xE1 em uso",undo:"Desfazer",redo:"Refazer",deleteRows:"Excluir linhas selecionadas",copyRows:"Copiar linhas selecionadas",statusRows:"{n} linhas",statusFiltered:"{shown} de {total} linhas",statusSelected:"{n} selecionadas",count:"Contagem",sum:"Soma",avg:"M\xE9dia",min:"M\xEDn.",max:"M\xE1x.",findPlaceholder:"Localizar na tabela",noMatches:"Nenhum resultado",findNext:"Pr\xF3ximo",findPrevious:"Anterior",groupPanelHint:"Arraste um cabe\xE7alho de coluna aqui para agrupar",groupByThis:"Agrupar por esta coluna",ungroup:"Remover agrupamento",expandAll:"Expandir tudo",collapseAll:"Recolher tudo",pagerRange:"{from}\u2013{to} de {total}",pageOf:"P\xE1gina {page} de {pages}",pageSize:"Linhas por p\xE1gina",firstPage:"Primeira p\xE1gina",previousPage:"P\xE1gina anterior",nextPage:"Pr\xF3xima p\xE1gina",lastPage:"\xDAltima p\xE1gina",loading:"Carregando\u2026",loadFailed:"N\xE3o foi poss\xEDvel carregar as linhas",filters:"Filtros",clearFilters:"Limpar todos os filtros",exportCsv:"Exportar CSV",exportExcel:"Exportar Excel",print:"Imprimir\u2026",printLimited:"Foram impressas as primeiras {n} de {total} linhas. Exporte para Excel ou CSV para obter todas.",pivot:"Piv\xF4",pivotMode:"Modo piv\xF4",pivotRows:"Grupos de linhas",pivotColumns:"R\xF3tulos de coluna",pivotValues:"Valores",total:"Total",addColumn:"Adicionar coluna\u2026",chartBar:"Gr\xE1fico de barras",chartStacked:"Gr\xE1fico de barras empilhadas",chartLine:"Gr\xE1fico de linhas",chartArea:"Gr\xE1fico de \xE1rea",chartPie:"Gr\xE1fico de pizza",chartDonut:"Gr\xE1fico de rosca",chartCombo:"Gr\xE1fico de barras e linhas",chartScatter:"Gr\xE1fico de dispers\xE3o",freeBadge:"Vers\xE3o gratuita",exportPdf:"Exportar PDF",exportJson:"Exportar JSON",ai:{title:"Assistente de IA",placeholder:"Pergunte sobre os dados ou diga \xE0 grade o que fazer",send:"Enviar",thinking:"Processando\u2026",undo:"Desfazer",undone:"Desfeito",failed:"O assistente n\xE3o respondeu",skipped:"Ignorado",done:"Pronto"},cf:{title:"Formata\xE7\xE3o condicional",add:"Adicionar regra",clear:"Limpar regras",none:"Nenhuma regra para esta coluna",type:"Regra",style:"Formato",wholeRow:"Linha inteira",count:"Quantidade",types:{value:"Valor da c\xE9lula",formula:"F\xF3rmula",top:"Primeiros",bottom:"\xDAltimos",aboveAverage:"Acima da m\xE9dia",belowAverage:"Abaixo da m\xE9dia",duplicate:"Valores duplicados",unique:"Valores \xFAnicos",dataBar:"Barras de dados",colorScale:"Escala de cor",iconSet:"Conjunto de \xEDcones"},ops:{notBetween:"N\xE3o est\xE1 entre",notContains:"N\xE3o cont\xE9m"},styles:{red:"Preenchimento vermelho claro",yellow:"Preenchimento amarelo",green:"Preenchimento verde",blue:"Preenchimento azul",redText:"Texto vermelho",bold:"Negrito"}},ops:{contains:"Cont\xE9m",equals:"Igual a",notEquals:"Diferente de",startsWith:"Come\xE7a com",endsWith:"Termina com",blank:"Vazio",notBlank:"N\xE3o vazio",eq:"Igual a",ne:"Diferente de",lt:"Menor que",lte:"Menor ou igual a",gt:"Maior que",gte:"Maior ou igual a",between:"Entre",before:"Antes de",after:"Depois de"}},tr=bs;var vs={code:"it",noRows:"Nessuna riga da mostrare",filter:"Filtro",apply:"Applica",reset:"Reimposta",selectAll:"(Seleziona tutto)",search:"Cerca\u2026",blanks:"(Vuoti)",value:"Valore",valueTo:"A",sortAsc:"Ordine crescente",sortDesc:"Ordine decrescente",clearSort:"Rimuovi ordinamento",pinLeft:"Blocca a sinistra",pinRight:"Blocca a destra",unpin:"Sblocca",columnMenu:"Menu colonna",selectRow:"Seleziona riga",selectAllRows:"Seleziona tutte le righe",chooseColumns:"Scegli colonne",columns:"Colonne",autosizeThis:"Adatta larghezza di questa colonna",autosizeAll:"Adatta larghezza di tutte le colonne",resetColumns:"Ripristina colonne",hideColumn:"Nascondi colonna",close:"Chiudi",copy:"Copia",cut:"Taglia",copyWithHeaders:"Copia con intestazioni",paste:"Incolla",pasteHint:"Accesso agli appunti bloccato. Premi Ctrl+V per incollare.",required:"Campo obbligatorio",invalidValue:"Valore non valido",and:"E",or:"O",advancedFilter:"Filtro avanzato",addCondition:"Aggiungi condizione",duplicate:"Questo valore \xE8 gi\xE0 in uso",undo:"Annulla",redo:"Ripeti",deleteRows:"Elimina righe selezionate",copyRows:"Copia righe selezionate",statusRows:"{n} righe",statusFiltered:"{shown} di {total} righe",statusSelected:"{n} selezionate",count:"Conteggio",sum:"Somma",avg:"Media",min:"Min",max:"Max",findPlaceholder:"Trova nella tabella",noMatches:"Nessun risultato",findNext:"Successivo",findPrevious:"Precedente",groupPanelHint:"Trascina qui un'intestazione di colonna per raggruppare",groupByThis:"Raggruppa per questa colonna",ungroup:"Rimuovi raggruppamento",expandAll:"Espandi tutto",collapseAll:"Comprimi tutto",pagerRange:"{from}\u2013{to} di {total}",pageOf:"Pagina {page} di {pages}",pageSize:"Righe per pagina",firstPage:"Prima pagina",previousPage:"Pagina precedente",nextPage:"Pagina successiva",lastPage:"Ultima pagina",loading:"Caricamento\u2026",loadFailed:"Impossibile caricare le righe",filters:"Filtri",clearFilters:"Rimuovi tutti i filtri",exportCsv:"Esporta CSV",exportExcel:"Esporta Excel",print:"Stampa\u2026",printLimited:"Stampate le prime {n} di {total} righe. Esporta in Excel o CSV per averle tutte.",pivot:"Pivot",pivotMode:"Modalit\xE0 pivot",pivotRows:"Gruppi di righe",pivotColumns:"Etichette di colonna",pivotValues:"Valori",total:"Totale",addColumn:"Aggiungi colonna\u2026",chartBar:"Grafico a barre",chartStacked:"Grafico a barre in pila",chartLine:"Grafico a linee",chartArea:"Grafico ad area",chartPie:"Grafico a torta",chartDonut:"Grafico ad anello",chartCombo:"Grafico a barre e linee",chartScatter:"Grafico a dispersione",freeBadge:"Versione gratuita",exportPdf:"Esporta PDF",exportJson:"Esporta JSON",ai:{title:"Assistente IA",placeholder:"Chiedi qualcosa sui dati o di\u2019 alla griglia cosa fare",send:"Invia",thinking:"In corso\u2026",undo:"Annulla",undone:"Annullato",failed:"L'assistente non ha risposto",skipped:"Saltato",done:"Fatto"},cf:{title:"Formattazione condizionale",add:"Aggiungi regola",clear:"Cancella regole",none:"Nessuna regola per questa colonna",type:"Regola",style:"Formato",wholeRow:"Intera riga",count:"Numero",types:{value:"Valore cella",formula:"Formula",top:"Primi",bottom:"Ultimi",aboveAverage:"Sopra la media",belowAverage:"Sotto la media",duplicate:"Valori duplicati",unique:"Valori univoci",dataBar:"Barre dei dati",colorScale:"Scala di colori",iconSet:"Set di icone"},ops:{notBetween:"Non compreso tra",notContains:"Non contiene"},styles:{red:"Riempimento rosso chiaro",yellow:"Riempimento giallo",green:"Riempimento verde",blue:"Riempimento blu",redText:"Testo rosso",bold:"Grassetto"}},ops:{contains:"Contiene",equals:"Uguale a",notEquals:"Diverso da",startsWith:"Inizia con",endsWith:"Finisce con",blank:"Vuoto",notBlank:"Non vuoto",eq:"Uguale a",ne:"Diverso da",lt:"Minore di",lte:"Minore o uguale a",gt:"Maggiore di",gte:"Maggiore o uguale a",between:"Tra",before:"Prima di",after:"Dopo"}},nr=vs;function U(o){return o==null||typeof o=="string"&&o.trim()===""||typeof o=="number"&&Number.isNaN(o)}var or=o=>String(o).padStart(2,"0");function se(o){if(U(o))return null;if(typeof o=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(o))return o;let e=o instanceof Date?o:new Date(o);return Number.isNaN(e.getTime())?null:`${e.getFullYear()}-${or(e.getMonth()+1)}-${or(e.getDate())}`}function ne(o){var e;return U(o)?"":o instanceof Date?(e=se(o))!=null?e:"":String(o)}var we=()=>!0;function Et(o){var e;switch(o.type){case"combined":{let t=(Array.isArray(o.conditions)?o.conditions:[]).map(Et);return t.length?o.operator==="or"?n=>t.some(r=>r(n)):n=>t.every(r=>r(n)):we}case"text":{let t=((e=o.value)!=null?e:"").toLowerCase(),n=r=>U(r)?"":String(r).toLowerCase();switch(o.op){case"contains":return r=>n(r).includes(t);case"equals":return r=>n(r)===t;case"notEquals":return r=>n(r)!==t;case"startsWith":return r=>n(r).startsWith(t);case"endsWith":return r=>n(r).endsWith(t);case"blank":return U;case"notBlank":return r=>!U(r)}return we}case"number":{let t=r=>U(r)?NaN:Number(r);if(o.op==="blank")return r=>Number.isNaN(t(r));if(o.op==="notBlank")return r=>!Number.isNaN(t(r));let n=o.value;if(n==null||Number.isNaN(n))return we;switch(o.op){case"eq":return r=>t(r)===n;case"ne":return r=>t(r)!==n;case"lt":return r=>t(r)<n;case"lte":return r=>t(r)<=n;case"gt":return r=>t(r)>n;case"gte":return r=>t(r)>=n;case"between":{let r=o.valueTo;if(r==null||Number.isNaN(r))return we;let i=Math.min(n,r),s=Math.max(n,r);return a=>{let l=t(a);return l>=i&&l<=s}}}return we}case"date":{if(o.op==="blank")return r=>se(r)===null;if(o.op==="notBlank")return r=>se(r)!==null;let t=o.value;if(!t)return we;let n=r=>se(r);switch(o.op){case"equals":return r=>n(r)===t;case"before":return r=>{let i=n(r);return i!==null&&i<t};case"after":return r=>{let i=n(r);return i!==null&&i>t};case"between":{let r=o.valueTo;if(!r)return we;let i=t<r?t:r,s=t<r?r:t;return a=>{let l=n(a);return l!==null&&l>=i&&l<=s}}}return we}case"set":{let t=new Set(o.values.map(ne));return n=>t.has(ne(n))}}return we}function rr(o){let e=o.trim().toLowerCase();return e?e.split(/\s+/):[]}function ir(o,e){return o.every(t=>e.includes(t))}function Bn(o,e,t){let n=[];for(let r of Array.isArray(o==null?void 0:o.conditions)?o.conditions:[]){if(!r||typeof r!="object")continue;if("conditions"in r){let a=Bn(r,e,t);a&&n.push(a);continue}let i=e(r.colId);if(!i||!r.model)continue;let s=Et(r.model);n.push(a=>s(t(i,a)))}return n.length?o.operator==="or"?r=>n.some(i=>i(r)):r=>n.every(i=>i(r)):null}var sr=new Map,ar=new Map;function ke(o,e){let t=`${o}|${e!=null?e:""}`,n=ar.get(t);return n||(n=new Intl.NumberFormat(o,e==null?void 0:{maximumFractionDigits:e}),ar.set(t,n)),n}function xs(o){var r;if(o==="integer")return{maximumFractionDigits:0};if(o==="percent")return{style:"percent"};if(o.startsWith("currency:"))return{style:"currency",currency:o.slice(9)};if(!/^[#0,]*(\.[#0]+)?%?$/.test(o)||!/[#0]/.test(o))return null;let e=o.endsWith("%"),t=e?o.slice(0,-1):o,n=t.includes(".")?t.split(".")[1]:"";return{useGrouping:t.includes(","),minimumFractionDigits:((r=n.match(/0/g))!=null?r:[]).length,maximumFractionDigits:n.length,...e?{style:"percent"}:{}}}var At={date:{year:"numeric",month:"2-digit",day:"2-digit"},datetime:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},time:{hour:"2-digit",minute:"2-digit"},short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"}};function me(o){if(U(o))return null;if(o instanceof Date)return Number.isNaN(o.getTime())?null:o;if(typeof o=="string"){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(o);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]))}if(typeof o!="string"&&typeof o!="number")return null;let e=new Date(o);return Number.isNaN(e.getTime())?null:e}function Cs(o,e,t){var n;switch(o){case"number":{let r={};if(typeof e=="string"){let s=xs(e);s||q(`unknown number format "${e}"`),r=s!=null?s:{}}else e&&(r=e);let i=new Intl.NumberFormat(t,r);return s=>{if(U(s))return"";let a=typeof s=="number"?s:Number(s);return Number.isNaN(a)?String(s):i.format(a)}}case"date":{if(t.toLowerCase().startsWith("ko")&&(e===void 0||e==="date"||e==="datetime")){let s=l=>String(l).padStart(2,"0"),a=e==="datetime";return l=>{let c=me(l);if(!c)return U(l)?"":String(l);let d=`${c.getFullYear()}-${s(c.getMonth()+1)}-${s(c.getDate())}`;return a?`${d} ${s(c.getHours())}:${s(c.getMinutes())}`:d}}let r=At.date;typeof e=="string"?(At[e]||q(`unknown date format "${e}"`),r=(n=At[e])!=null?n:At.date):e&&(r=e);let i=new Intl.DateTimeFormat(t,r);return s=>{let a=me(s);return a?i.format(a):U(s)?"":String(s)}}case"boolean":return r=>r===!0?"\u2713":r===!1?"\u2717":"";default:return r=>U(r)?"":r instanceof Date?r.toISOString():String(r)}}var ks=o=>Array.isArray(o)?o.join(", "):o==null?"":String(o),Hn=new WeakMap,Gn=new WeakMap;function lr(){Hn=new WeakMap,Gn=new WeakMap}function at(o,e,t,n=o.format){if(e===o.type&&n===o.format)return ee(o,t);if(n!==o.format&&typeof n!="string")return ee({...o,type:e,format:n},t);let r=Gn.get(o);r||Gn.set(o,r=new Map);let i=`${e!=null?e:""}|${n===o.format?"":`=${n}`}`,s=r.get(i);return s||r.set(i,s={...o,type:e,format:n}),ee(s,t)}function ee(o,e){var s;if(o.sparkline)return ks;let t=o.format,n=Hn.get(o);if(n&&n.locale===e&&n.type===o.type&&n.format===t)return n.fmt;let r=`${e}|${(s=o.type)!=null?s:"text"}|${typeof t=="string"?t:JSON.stringify(t!=null?t:null)}`,i=sr.get(r);return i||(i=Cs(o.type,t,e),sr.set(r,i)),Hn.set(o,{locale:e,type:o.type,format:t,fmt:i}),i}var le="__fg_select__",dr={id:le,header:"",width:44,minWidth:44,maxWidth:44,pinned:"left",sortable:!1,resizable:!1,filter:!1},Fe="__fg_drag__",cr={id:Fe,header:"",width:28,minWidth:28,maxWidth:28,pinned:"left",sortable:!1,resizable:!1,filter:!1,chooser:!1},Re="__fg_rownum__",ur=(o=52,e="#")=>({id:Re,header:e,width:o,minWidth:o,maxWidth:o,pinned:"left",sortable:!1,resizable:!1,filter:!1,chooser:!1}),H=o=>o===le||o===Fe||o===Re,Rs=120,Ss=40,Ms=["left","center","right"];function ue(o){if(H(o.id)||o.filter===!1)return null;if(o.filter)return o.filter;switch(o.type){case"number":return"number";case"date":return"date";case"boolean":return"set";default:return"text"}}function ye(o,e,t){let n=o.editable;if(typeof n!="function")return!!n;try{return!!n({value:o.valueGetter?o.valueGetter(e):o.field?e[o.field]:void 0,row:e,rowIndex:t,column:o})}catch{return!1}}var Ie=o=>o.id!==le&&o.sortable!==!1,Pt=o=>o.id!==le&&o.resizable!==!1;function Tt(o,e){var r,i;let t=(r=o.minWidth)!=null?r:Ss,n=(i=o.maxWidth)!=null?i:1/0;return Math.round(Math.min(n,Math.max(t,e)))}function fr(o){return o.children?1+Math.max(0,...o.children.map(fr)):1}var Lt=class{constructor(e){this.depth=1;this.roots_=[];this.defs=[];this.byId=new Map;this.containerWidth=0;this.layout={left:[],center:[],right:[]};this.leafById=new Map;this.declared=[];this.setDefs(e)}setDefs(e){lr(),this.defs=e,this.byId=new Map;let t=0,n=(i,s,a)=>{var f,h,p,g,w;let l=Array.isArray(i.children)&&i.children.length>0,c=t++,d=(f=i.id)!=null?f:l?`g${c}`:i.field;if(d||(d=`c${c}`,q(`column #${c} has neither "field" nor "id"; using "${d}"`)),this.byId.has(d)){let m=1;for(;this.byId.has(`${d}_${m}`);)m++;q(`duplicate column id "${d}"; renamed to "${d}_${m}"`),d=`${d}_${m}`}let u={id:d,def:i,parent:s,children:null,depth:a,width:Tt(i,(h=i.width)!=null?h:Rs),flex:i.flex&&i.flex>0?i.flex:null,hide:(p=i.hide)!=null?p:!1,pinned:(w=(g=i.pinned)!=null?g:s==null?void 0:s.pinned)!=null?w:null,open:!!i.openByDefault};return this.byId.set(d,u),l&&(u.children=r(i.children).map(m=>n(m,u,a+1))),u},r=i=>{let s=i.filter(a=>a!==null&&typeof a=="object");return s.length!==i.length&&q("columns contain entries that are not objects; they were skipped"),s};this.roots_=r(e).map(i=>n(i,null,0)),this.declared=this.leafNodes().map(i=>i.id),this.depth=Math.max(1,...this.roots_.map(fr)),this.relayout()}updateDefs(e){var s,a,l,c;let t=new Map(this.byId),n=this.declared,r=this.leafNodes().map(d=>d.id);this.setDefs(e);for(let[d,u]of this.byId){let f=t.get(d);if(!f||!!f.children!=!!u.children)continue;let h=f.def,p=u.def;h.width===p.width&&h.flex===p.flex&&h.minWidth===p.minWidth&&h.maxWidth===p.maxWidth&&(u.width=f.width,u.flex=f.flex),((s=h.hide)!=null?s:!1)===((a=p.hide)!=null?a:!1)&&(u.hide=f.hide),h.pinned===p.pinned&&((l=f.parent)==null?void 0:l.def.pinned)===((c=u.parent)==null?void 0:c.def.pinned)&&(u.pinned=f.pinned),!!h.openByDefault==!!p.openByDefault&&(u.open=f.open)}let i=(d,u)=>d.length===u.length&&d.every((f,h)=>f===u[h]);i(n,this.declared)&&!i(r,n)?this.applyState(r.map(d=>({colId:d}))):this.relayout()}setContainerWidth(e){if(e===this.containerWidth)return!1;this.containerWidth=e;let t=this.displayed().map(n=>n.width).join();return this.relayout(),t!==this.displayed().map(n=>n.width).join()}roots(){return this.roots_}reset(){this.setDefs(this.defs)}region(e){return this.layout[e]}displayed(){return[...this.layout.left,...this.layout.center,...this.layout.right]}regionWidth(e){let t=this.layout[e],n=t[t.length-1];return n?n.left+n.width:0}getColumn(e){return this.leafById.get(e)}getNode(e){return this.byId.get(e)}siblings(e){let t=this.byId.get(e);return t?t.parent?t.parent.children:this.roots_:[]}setWidth(e,t){let n=this.byId.get(e);return!n||n.children?0:(n.flex=null,n.width=Tt(n.def,t),this.relayout(),n.width)}setPinned(e,t){let n=this.byId.get(e);!n||n.children||H(e)||(n.pinned=t,this.relayout())}setHide(e,t){let n=this.byId.get(e);!n||n.children||(n.hide=t,this.relayout())}move(e,t){let n=this.siblings(e),r=n.findIndex(s=>s.id===e);if(r<0)return;let[i]=n.splice(r,1);n.splice(Math.max(0,Math.min(n.length,t)),0,i),this.relayout()}headerCells(e){var r,i,s;let t=[],n=new Map;for(let a of this.layout[e]){let l=[];for(let c=a.node.parent;c;c=c.parent)l.unshift(c);for(let c of l){let d=n.get(c.id);if(d){d.width+=a.width;continue}let u={id:c.id,label:(r=c.def.header)!=null?r:"",isGroup:!0,column:null,node:c,row:c.depth,rowSpan:1,left:a.left,width:a.width};n.set(c.id,u),t.push(u)}t.push({id:a.id,label:(s=(i=a.def.header)!=null?i:a.def.field)!=null?s:"",isGroup:!1,column:a,node:a.node,row:a.node.depth,rowSpan:this.depth-a.node.depth,left:a.left,width:a.width})}return t}getState(){return this.leafNodes().filter(e=>!H(e.id)).map(e=>{var t,n,r;return{colId:e.id,width:(n=(t=this.leafById.get(e.id))==null?void 0:t.width)!=null?n:e.width,hide:!!e.hide,pinned:(r=e.pinned)!=null?r:null}})}applyState(e){let t=new Map;e.forEach((i,s)=>{t.set(i.colId,s);let a=this.byId.get(i.colId);!a||a.children||H(i.colId)||(typeof i.width=="number"&&Number.isFinite(i.width)&&(a.flex=null,a.width=Tt(a.def,i.width)),typeof i.hide=="boolean"&&(a.hide=i.hide),"pinned"in i&&(a.pinned=i.pinned==="left"||i.pinned==="right"?i.pinned:null))}),t.set(Re,-3),t.set(Fe,-2),t.set(le,-1);let n=i=>{var s;return i.children?Math.min(1/0,...i.children.map(n)):(s=t.get(i.id))!=null?s:1/0},r=i=>{let s=i.map((a,l)=>({n:a,i:l,r:n(a)}));s.sort((a,l)=>a.r===l.r?a.i-l.i:a.r-l.r),i.splice(0,i.length,...s.map(a=>a.n));for(let a of i)a.children&&r(a.children)};r(this.roots_),this.relayout()}leafNodes(){let e=[],t=n=>n.children?n.children.forEach(t):e.push(n);return this.roots_.forEach(t),e}isCollapsible(e){var t;return!!((t=e.children)!=null&&t.some(n=>n.def.columnGroupShow==="open"||n.def.columnGroupShow==="closed"))}setGroupOpen(e,t){let n=this.byId.get(e);return!(n!=null&&n.children)||n.open===t?!1:(n.open=t,this.relayout(),!0)}groupOpenState(){let e={};for(let t of this.byId.values())this.isCollapsible(t)&&(e[t.id]=t.open);return e}shownByGroups(e){for(let t=e;t!=null&&t.parent;t=t.parent){let n=t.def.columnGroupShow;if(n==="open"&&!t.parent.open||n==="closed"&&t.parent.open)return!1}return!0}relayout(){var l;let e=this.leafNodes().filter(c=>!c.hide&&this.shownByGroups(c)),t=e.reduce((c,d)=>c+(d.flex?0:d.width),0),n=e.reduce((c,d)=>{var u;return c+((u=d.flex)!=null?u:0)},0),r=Math.max(0,this.containerWidth-t),i=c=>c.flex?Tt(c.def,Math.floor(r*c.flex/n)):c.width,s={left:[],center:[],right:[]};this.leafById=new Map;let a=0;for(let c of Ms){let d=0;for(let u of e){if(((l=u.pinned)!=null?l:"center")!==c)continue;let f={id:u.id,def:u.def,node:u,width:i(u),region:c,left:d,index:a++};d+=f.width,s[c].push(f),this.leafById.set(u.id,f)}}this.layout=s}};var K=class extends Error{constructor(t){super(t);this.code=t}},Es=/^#(?:[A-Z/0]+[!?]|N\/A)$/,Je=o=>typeof o=="string"&&Es.test(o);function As(o){let e=[],t=0;for(;t<o.length;){let n=o[t];if(/\s/.test(n))t++;else if(/[0-9.]/.test(n)){let r=/^(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/i.exec(o.slice(t));if(!r)throw new K("#ERROR!");e.push({t:"num",v:Number(r[0])}),t+=r[0].length}else if(n==='"'){let r="";for(t++;;){if(t>=o.length)throw new K("#ERROR!");if(o[t]==='"'){if(o[t+1]==='"'){r+='"',t+=2;continue}t++;break}r+=o[t++]}e.push({t:"str",v:r})}else if(n==="["){let r=o.indexOf("]",t);if(r<0)throw new K("#ERROR!");e.push({t:"id",v:o.slice(t+1,r)}),t=r+1}else if(/[A-Za-z_À-￿]/.test(n)){let r=/^[A-Za-z_À-￿][\wÀ-￿.]*/.exec(o.slice(t));e.push({t:"id",v:r[0]}),t+=r[0].length}else{let r=o.slice(t,t+2);if(r==="<>"||r==="<="||r===">=")e.push({t:"op",v:r}),t+=2;else if("+-*/%^&=<>(),;".includes(n))e.push({t:"op",v:n===";"?",":n}),t++;else throw new K("#ERROR!")}}return e}var de=o=>o==null||o==="";function W(o){if(typeof o=="number")return o;if(typeof o=="boolean")return o?1:0;if(de(o))return 0;if(o instanceof Date)return o.getTime();if(typeof o=="string"&&o.trim()!==""&&Number.isFinite(Number(o)))return Number(o);throw new K("#VALUE!")}var Z=o=>de(o)?"":typeof o=="boolean"?o?"TRUE":"FALSE":o instanceof Date?lt(o):String(o),Me=o=>typeof o=="boolean"?o:typeof o=="string"&&/^(true|false)$/i.test(o)?o.toLowerCase()==="true":W(o)!==0;function Ft(o,e,t="near"){let n=Math.trunc(e),r=t==="near"?Math.round:t==="up"?Math.ceil:Math.floor,i=(a,l)=>{let[c,d="0"]=String(a).split("e");return+`${c}e${Number(d)+l}`},s=i(r(i(Math.abs(o),n)),-n);return o<0?-s:s}function dt(o,e){let t=n=>typeof n=="number"||typeof n=="boolean"||de(n);return t(o)&&t(e)?W(o)-W(e):o instanceof Date||e instanceof Date?W(fe(o))-W(fe(e)):Z(o).localeCompare(Z(e),void 0,{sensitivity:"accent"})}var Se=o=>o.flatMap(e=>Array.isArray(e)?e:[e]);var De=o=>o.flatMap(e=>Array.isArray(e)?vr(e).filter(t=>typeof t=="number"&&Number.isFinite(t)):de(e)?[]:[W(e)]);function vr(o){let e=o.find(Je);if(e!==void 0)throw new K(e);return o}function fe(o){var e,t,n;if(o instanceof Date)return o;if(typeof o=="number")return new Date(o);if(typeof o=="string"){let r=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/.exec(o.trim());if(r)return new Date(+r[1],+r[2]-1,+r[3],+((e=r[4])!=null?e:0),+((t=r[5])!=null?t:0),+((n=r[6])!=null?n:0))}throw new K("#VALUE!")}var Dt=o=>String(o).padStart(2,"0");function lt(o){return`${o.getFullYear()}-${Dt(o.getMonth()+1)}-${Dt(o.getDate())}`}var Ts=864e5,pr=o=>Math.round(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate())/Ts);function xr(o){var i;if(typeof o!="string")return s=>dt(s,o)===0&&!de(s)==!de(o);let e=/^(<=|>=|<>|<|>|=)?(.*)$/s.exec(o),t=(i=e[1])!=null?i:"=",n=e[2],r=n.trim()!==""&&Number.isFinite(Number(n))?Number(n):n;if((t==="="||t==="<>")&&typeof r=="string"&&/[*?]/.test(r)){let s=new RegExp(`^${r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")}$`,"i");return t==="="?a=>s.test(Z(a)):a=>!s.test(Z(a))}return s=>{if(t==="="&&r==="")return de(s);if(t==="<>"&&r==="")return!de(s);if(typeof r=="number"&&typeof s!="number"&&!(typeof s=="string"&&s.trim()!==""&&Number.isFinite(Number(s))))return t==="<>";let a;try{a=dt(s,r)}catch{return!1}return t==="="?a===0:t==="<>"?a!==0:t==="<"?a<0:t===">"?a>0:t==="<="?a<=0:a>=0}}function Ee(o){if(Array.isArray(o))return o;throw new K("#VALUE!")}function hr(o,e,t){let n=Ee(e),r=xr(t),i=[],s=vr(o.length?Ee(o[0]):n);return n.forEach((a,l)=>{let c=s[l];r(a)&&typeof c=="number"&&Number.isFinite(c)&&i.push(c)}),i}var ge={SUM:o=>De(o).reduce((e,t)=>e+t,0),AVG:o=>{let e=De(o);if(!e.length)throw new K("#DIV/0!");return e.reduce((t,n)=>t+n,0)/e.length},MIN:o=>{let e=De(o);return e.length?e.reduce((t,n)=>Math.min(t,n)):0},MAX:o=>{let e=De(o);return e.length?e.reduce((t,n)=>Math.max(t,n)):0},MEDIAN:o=>{let e=De(o).sort((n,r)=>n-r);if(!e.length)throw new K("#NUM!");let t=e.length>>1;return e.length%2?e[t]:(e[t-1]+e[t])/2},COUNT:o=>Se(o).filter(e=>typeof e=="number"&&Number.isFinite(e)).length,COUNTA:o=>Se(o).filter(e=>!de(e)).length,COUNTBLANK:o=>Se(o).filter(de).length,PRODUCT:o=>De(o).reduce((e,t)=>e*t,1),ROUND:o=>Ft(W(o[0]),o.length>1?W(o[1]):0),ROUNDUP:o=>Ft(W(o[0]),o.length>1?W(o[1]):0,"up"),ROUNDDOWN:o=>Ft(W(o[0]),o.length>1?W(o[1]):0,"down"),INT:o=>Math.floor(W(o[0])),TRUNC:o=>Ft(W(o[0]),o.length>1?W(o[1]):0,W(o[0])<0?"up":"down"),ABS:o=>Math.abs(W(o[0])),SIGN:o=>Math.sign(W(o[0])),SQRT:o=>{let e=W(o[0]);if(e<0)throw new K("#NUM!");return Math.sqrt(e)},POWER:o=>W(o[0])**W(o[1]),EXP:o=>Math.exp(W(o[0])),LN:o=>{let e=W(o[0]);if(e<=0)throw new K("#NUM!");return Math.log(e)},LOG10:o=>{let e=W(o[0]);if(e<=0)throw new K("#NUM!");return Math.log10(e)},MOD:o=>{let e=W(o[1]);if(e===0)throw new K("#DIV/0!");let t=W(o[0]);return t-e*Math.floor(t/e)},CEILING:o=>{let e=o.length>1?W(o[1]):1;return e===0?0:Math.ceil(W(o[0])/e)*e},FLOOR:o=>{let e=o.length>1?W(o[1]):1;return e===0?0:Math.floor(W(o[0])/e)*e},PI:()=>Math.PI,CONCAT:o=>Se(o).map(Z).join(""),TEXTJOIN:o=>Se(o.slice(2)).filter(e=>!Me(o[1])||!de(e)).map(Z).join(Z(o[0])),LEN:o=>Z(o[0]).length,LEFT:o=>Z(o[0]).slice(0,o.length>1?Math.max(0,W(o[1])):1),RIGHT:o=>{let e=Z(o[0]),t=o.length>1?Math.max(0,W(o[1])):1;return t?e.slice(-t):""},MID:o=>Z(o[0]).substr(Math.max(0,W(o[1])-1),Math.max(0,W(o[2]))),UPPER:o=>Z(o[0]).toUpperCase(),LOWER:o=>Z(o[0]).toLowerCase(),PROPER:o=>Z(o[0]).toLowerCase().replace(/(^|[^\p{L}])(\p{L})/gu,(e,t,n)=>t+n.toUpperCase()),TRIM:o=>Z(o[0]).trim().replace(/\s+/g," "),SUBSTITUTE:o=>Z(o[0]).split(Z(o[1])).join(Z(o[2])),REPLACE:o=>{let e=Z(o[0]),t=Math.max(0,W(o[1])-1);return e.slice(0,t)+Z(o[3])+e.slice(t+Math.max(0,W(o[2])))},REPT:o=>Z(o[0]).repeat(Math.max(0,Math.min(1e4,W(o[1])))),FIND:o=>{let e=Z(o[1]).indexOf(Z(o[0]),o.length>2?W(o[2])-1:0);if(e<0)throw new K("#VALUE!");return e+1},SEARCH:o=>{let e=Z(o[1]).toLowerCase().indexOf(Z(o[0]).toLowerCase(),o.length>2?W(o[2])-1:0);if(e<0)throw new K("#VALUE!");return e+1},VALUE:o=>W(Z(o[0]).replace(/,/g,"")),TEXT:o=>{var s,a;let e=o[0],t=Z(o[1]),n=(a=(s=/0\.(0+)/.exec(t))==null?void 0:s[1].length)!=null?a:0;if(/[yd]/i.test(t)){let l=fe(e);return t.replace(/yyyy/gi,String(l.getFullYear())).replace(/mm/g,Dt(l.getMonth()+1)).replace(/dd/gi,Dt(l.getDate()))}let r=W(e);return t.includes("%")?(r*100).toFixed(n)+"%":t.includes(",")?r.toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}):r.toFixed(n)},AND:o=>Se(o).every(Me),OR:o=>Se(o).some(Me),XOR:o=>Se(o).filter(Me).length%2===1,NOT:o=>!Me(o[0]),ISBLANK:o=>de(o[0]),ISNUMBER:o=>typeof o[0]=="number"&&Number.isFinite(o[0]),ISTEXT:o=>typeof o[0]=="string"&&!Je(o[0]),ISERROR:o=>Je(o[0]),TODAY:()=>lt(new Date),NOW:()=>new Date,DATE:o=>lt(new Date(W(o[0]),W(o[1])-1,W(o[2]))),YEAR:o=>fe(o[0]).getFullYear(),MONTH:o=>fe(o[0]).getMonth()+1,DAY:o=>fe(o[0]).getDate(),WEEKDAY:o=>fe(o[0]).getDay()+1,DAYS:o=>pr(fe(o[0]))-pr(fe(o[1])),EDATE:o=>{let e=fe(o[0]),t=e.getDate(),n=new Date(e.getFullYear(),e.getMonth()+W(o[1]),1);return n.setDate(Math.min(t,new Date(n.getFullYear(),n.getMonth()+1,0).getDate())),lt(n)},EOMONTH:o=>{let e=fe(o[0]);return lt(new Date(e.getFullYear(),e.getMonth()+W(o[1])+1,0))},SUMIF:o=>hr(o.slice(2),Ee(o[0]),o[1]).reduce((e,t)=>e+t,0),COUNTIF:o=>{let e=xr(o[1]);return Ee(o[0]).filter(e).length},AVERAGEIF:o=>{let e=hr(o.slice(2),Ee(o[0]),o[1]);if(!e.length)throw new K("#DIV/0!");return e.reduce((t,n)=>t+n,0)/e.length},LOOKUP:o=>{let e=Ee(o[1]),t=o.length>2?Ee(o[2]):e,n=e.findIndex(r=>{try{return dt(r,o[0])===0}catch{return!1}});if(n<0){if(o.length>3)return o[3];throw new K("#N/A")}return t[n]},RANK:o=>{let e=W(o[0]),t=De([Ee(o[1])]),n=o.length>2&&Me(o[2]);return 1+t.filter(r=>n?r<e:r>e).length}};ge.AVERAGE=ge.AVG;ge.XLOOKUP=ge.LOOKUP;ge.CONCATENATE=ge.CONCAT;var $t=new Map;function Cr(o,e){typeof o!="string"||!/^[A-Za-z_][\w.]*$/.test(o)||typeof e!="function"||($t.set(o.toUpperCase(),e),_e.clear())}function kr(){return[...new Set([...Object.keys(ge),...Ls,...Ps,...$t.keys()])].sort()}var Ls=["IF","IFS","IFERROR","IFNA","SWITCH","CHOOSE"],Ps=["COL","PREV","NEXT","ROW"],zn=class{constructor(e){this.tokens=e;this.i=0}parse(){let e=this.comparison();if(this.i<this.tokens.length)throw new K("#ERROR!");return e}peek(e){let t=this.tokens[this.i];return!!t&&t.t==="op"&&(e===void 0||t.v===e)}take(e){return this.peek(e)?(this.i++,!0):!1}comparison(){let e=this.concat();for(let t of["=","<>","<=",">=","<",">"])if(this.take(t))return{k:"bin",op:t,a:e,b:this.concat()};return e}concat(){let e=this.additive();for(;this.take("&");)e={k:"bin",op:"&",a:e,b:this.additive()};return e}additive(){let e=this.multiplicative();for(;;)if(this.take("+"))e={k:"bin",op:"+",a:e,b:this.multiplicative()};else if(this.take("-"))e={k:"bin",op:"-",a:e,b:this.multiplicative()};else return e}multiplicative(){let e=this.unary();for(;;)if(this.take("*"))e={k:"bin",op:"*",a:e,b:this.unary()};else if(this.take("/"))e={k:"bin",op:"/",a:e,b:this.unary()};else if(this.take("%"))e={k:"bin",op:"%",a:e,b:this.unary()};else return e}unary(){return this.take("-")?{k:"un",op:"-",a:this.unary()}:this.take("+")?{k:"un",op:"+",a:this.unary()}:this.power()}power(){let e=this.primary();return this.take("^")?{k:"bin",op:"^",a:e,b:this.unary()}:e}primary(){let e=this.tokens[this.i++];if(!e)throw new K("#ERROR!");if(e.t==="num"||e.t==="str")return{k:"lit",v:e.v};if(e.t==="op"){if(e.v!=="(")throw new K("#ERROR!");let n=this.comparison();if(!this.take(")"))throw new K("#ERROR!");return n}let t=e.v;if(this.peek("(")){this.i++;let n=[];if(!this.take(")")){do n.push(this.comparison());while(this.take(","));if(!this.take(")"))throw new K("#ERROR!")}let r=t.toUpperCase();if((r==="COL"||r==="PREV"||r==="NEXT")&&(!n.length||n[0].k!=="ref"))throw new K("#ERROR!");let i=r!=="PREV"&&r!=="NEXT"&&r!=="ROW"&&n.every(s=>It(s,r==="COL"));return{k:"call",name:r,args:n,rowFree:i}}return/^(true|false)$/i.test(t)?{k:"lit",v:t.toLowerCase()==="true"}:{k:"ref",name:t}}};function It(o,e=!1){return o.k==="lit"?!0:o.k==="ref"?e:o.k==="un"?It(o.a):o.k==="bin"?It(o.a)&&It(o.b):o.rowFree}var _e=new Map,Fs=2e3;function Rr(o){let e=_e.get(o);if(!e){try{e=new zn(As(o.slice(1))).parse()}catch(t){e=t instanceof K?t:new K("#ERROR!")}_e.size>=Fs&&_e.delete(_e.keys().next().value),_e.set(o,e)}if(e instanceof K)throw e;return e}var mr=new WeakMap;function Ae(o){let e=o.rows(),t=o.version(),n=mr.get(o);return(!n||n.data!==e||n.version!==t)&&(n={data:e,version:t,index:null,cols:new Map,values:new WeakMap,rowFree:new Map,filled:new Map},mr.set(o,n)),n}var Vn=new WeakMap;function Sr(o,e){for(let t of o)t&&typeof t=="object"&&Vn.set(t,e)}var Mr=32;function qn(o,e){let{row:t,scope:n}=o;if(t&&Object.hasOwn(t,e)){let i=t[e];return typeof i=="string"&&i.startsWith("=")&&i.length>1?gr(o,e,i):i}let r=n==null?void 0:n.computed(e);if(r!==void 0)return gr(o,e,r);throw new K("#REF!")}function gr(o,e,t){if(o.seen.has(e)||o.depth>=Mr)throw new K("#CYCLE!");let n;if(o.memo.has(e))n=o.memo.get(e);else{let r=o.scope?Ae(o.scope).values.get(o.row):void 0;r!=null&&r.has(e)?n=r.get(e):(n=Nt(t,{...o,seen:new Set([...o.seen,e]),depth:o.depth+1}),o.memo.set(e,n))}if(Je(n))throw new K(n);return n}function Is(o,e,t){var l,c;let n=o.scope;if(!n)throw new K("#REF!");let r=Ae(n);if(e<0||e>=r.data.length)return null;let i=r.data[e],s=(l=r.filled.get(t))!=null?l:-1;if(e>s+1&&e-s>1)for(let d=s+1;d<e;d++)ct(n,r,r.data[d],t);let a=ct(n,r,i,t);if(e>((c=r.filled.get(t))!=null?c:-1)&&r.filled.set(t,e),Je(a))throw new K(a);return a}function ct(o,e,t,n){let r=e.values.get(t);if(r!=null&&r.has(n))return r.get(n);let i;try{i=qn({row:t,scope:o,seen:new Set,depth:0,memo:new Map},n)}catch(s){i=s instanceof K?s.code:"#ERROR!"}return r||e.values.set(t,r=new Map),r.set(n,i),i}function wr(o){if(!o.scope)throw new K("#REF!");let e=Ae(o.scope);e.index||(e.index=new Map(e.data.map((n,r)=>[n,r])));let t=e.index.get(o.row);if(t===void 0)throw new K("#REF!");return t}function Ds(o,e){if(!o.scope)throw new K("#REF!");let t=o.scope,n=Ae(t),r=n.cols.get(e);if(r||(n.cols.set(e,yr),r=n.data.map(i=>ct(t,n,i,e)),n.cols.set(e,r)),r===yr)throw new K("#CYCLE!");return r}var yr=[];function Xe(o,e){switch(o.k){case"lit":return o.v;case"ref":return qn(e,o.name);case"un":return o.op==="-"?-W(Xe(o.a,e)):W(Xe(o.a,e));case"bin":{let t=Xe(o.a,e),n=Xe(o.b,e);switch(o.op){case"+":return W(t)+W(n);case"-":return W(t)-W(n);case"*":return W(t)*W(n);case"/":case"%":{let r=W(n);if(r===0)throw new K("#DIV/0!");return o.op==="/"?W(t)/r:W(t)%r}case"^":return W(t)**W(n);case"&":return Z(t)+Z(n);default:{let r=dt(t,n);return o.op==="="?r===0:o.op==="<>"?r!==0:o.op==="<"?r<0:o.op===">"?r>0:o.op==="<="?r<=0:r>=0}}}case"call":{if(o.rowFree&&e.scope){let t=Ae(e.scope);if(t.rowFree.has(o)){let n=t.rowFree.get(o);if(n instanceof K)throw n;return n}try{let n=br(o,e);return t.rowFree.set(o,n),n}catch(n){throw n instanceof K&&t.rowFree.set(o,n),n}}return br(o,e)}}}function br(o,e){var a;let{name:t,args:n}=o,r=l=>Xe(n[l],e);switch(t){case"IF":{if(n.length<2)throw new K("#ERROR!");return Me(r(0))?r(1):n.length>2?r(2):!1}case"IFS":for(let l=0;l+1<n.length;l+=2)if(Me(r(l)))return r(l+1);throw new K("#N/A");case"IFERROR":case"IFNA":try{let l=r(0);return Je(l)&&(t==="IFERROR"||l==="#N/A")?n.length>1?r(1):"":l}catch(l){if(!(l instanceof K)||t==="IFNA"&&l.code!=="#N/A")throw l;return n.length>1?r(1):""}case"SWITCH":{let l=r(0);for(let c=1;c+1<n.length;c+=2)if(dt(l,r(c))===0)return r(c+1);if(n.length%2===0)return r(n.length-1);throw new K("#N/A")}case"CHOOSE":{let l=Math.trunc(W(r(0)));if(l<1||l>=n.length)throw new K("#VALUE!");return r(l)}case"COL":return Ds(e,n[0].name);case"ROW":return wr(e)+1;case"PREV":case"NEXT":{let l=n.length>1?Math.trunc(W(r(1))):1,c=wr(e)+(t==="PREV"?-l:l),d=n[0].name;if(t==="NEXT"&&e.depth>=Mr)throw new K("#CYCLE!");return t==="PREV"?Is(e,c,d):$s(e,c,d)}}let i=(a=Object.hasOwn(ge,t)?ge[t]:void 0)!=null?a:$t.get(t);if(!i)throw new K("#NAME?");let s=n.map((l,c)=>r(c));if($t.has(t)&&!Object.hasOwn(ge,t))try{return i(s)}catch(l){throw l instanceof K?l:new K("#VALUE!")}return i(s)}function $s(o,e,t){let n=o.scope?Ae(o.scope):null;if(!n)throw new K("#REF!");return e<0||e>=n.data.length?null:qn({...o,row:n.data[e],seen:new Set,depth:o.depth+1,memo:new Map},t)}function Nt(o,e){try{let t=Xe(Rr(o),e);return typeof t=="number"&&!Number.isFinite(t)?"#NUM!":Array.isArray(t)?"#VALUE!":t}catch(t){return t instanceof RangeError?"#CYCLE!":t instanceof K?t.code:"#ERROR!"}}function Ot(o,e,t=new Set,n=0,r=new Map,i=null){return Nt(o,{row:e,scope:i,seen:t,depth:n,memo:r})}function Wn(o,e){var r,i;let t=(r=Vn.get(o))!=null?r:null,n=(i=o.id)!=null?i:o.field;if(o.formula){if(t&&n){let s=Ae(t);return ct(t,s,e,n)}return Nt(o.formula,{row:e,scope:t,seen:new Set(n?[n]:[]),depth:0,memo:new Map})}return t?ct(t,Ae(t),e,o.field):Nt(e[o.field],{row:e,scope:t,seen:new Set([o.field]),depth:0,memo:new Map})}var jn=o=>{var e,t;return!!((t=(e=Vn.get(o))==null?void 0:e.off)!=null&&t.call(e))},$e=o=>typeof o=="string"&&o.length>1&&o.startsWith("=");function Er(o){let e;try{e=Rr(o)}catch{return null}let t=new Set,n=r=>{r.k==="ref"?t.add(r.name):r.k==="un"?n(r.a):r.k==="bin"?(n(r.a),n(r.b)):r.k==="call"&&r.args.forEach(n)};return n(e),[...t]}function j(o,e){var n;if(o.valueGetter)try{return o.valueGetter(e)}catch{q(`valueGetter of column "${(n=o.id)!=null?n:o.field}" threw; rendering an empty cell`);return}if(typeof o.formula=="string"&&$e(o.formula)&&!jn(o))return Wn(o,e);if(o.field==null)return;let t=e[o.field];return o.formulas&&$e(t)&&!jn(o)?Wn(o,e):t}var ut=["left","center","right"],Ar=[[">=","gte"],["<=","lte"],["<>","ne"],["!=","ne"],[">","gt"],["<","lt"],["=","eq"]],Tr=[[">","after"],["<","before"],["=","equals"]],Ns=/^(.+?)\s*(?:~|\.\.)\s*(.+)$/,Un=o=>{let e=Number(o.replace(/[,\s₩$€¥]/g,""));return o.trim()!==""&&Number.isFinite(e)?e:null},Kn=o=>{let e=/^(\d{4})[-./]\s*(\d{1,2})[-./]\s*(\d{1,2})\.?$/.exec(o.trim());if(!e)return null;let t=Number(e[1]),n=Number(e[2]),r=Number(e[3]);return n<1||n>12||r<1||r>new Date(Date.UTC(t,n,0)).getUTCDate()?null:`${e[1]}-${e[2].padStart(2,"0")}-${e[3].padStart(2,"0")}`};function Os(o,e){let t=e.trim();if(!t)return null;if(o==="text")return{type:"text",op:"contains",value:t};let n=Ns.exec(t);if(o==="number"){if(n){let l=Un(n[1]),c=Un(n[2]);return l===null||c===null?void 0:{type:"number",op:"between",value:Math.min(l,c),valueTo:Math.max(l,c)}}let s=Ar.find(([l])=>t.startsWith(l)),a=Un(s?t.slice(s[0].length):t);return a===null?void 0:{type:"number",op:s?s[1]:"eq",value:a}}if(n){let s=Kn(n[1]),a=Kn(n[2]);return!s||!a?void 0:{type:"date",op:"between",value:s<a?s:a,valueTo:s<a?a:s}}let r=Tr.find(([s])=>t.startsWith(s)),i=Kn(r?t.slice(r[0].length):t);return i?{type:"date",op:r?r[1]:"equals",value:i}:void 0}function Bs(o){var e,t,n;if(!o)return"";if(o.type==="text")return o.op==="contains"&&(e=o.value)!=null?e:"";if(o.type==="number"){if(o.op==="between")return`${o.value}~${o.valueTo}`;let r=(t=Ar.find(([,i])=>i===o.op))==null?void 0:t[0];return r&&o.value!==void 0?`${r==="="?"":r}${o.value}`:""}if(o.type==="date"){if(o.op==="between")return`${o.value}~${o.valueTo}`;let r=(n=Tr.find(([,i])=>i===o.op))==null?void 0:n[0];return r&&o.value?`${r==="="?"":r}${o.value}`:""}return""}var Bt=class{constructor(e,t){this.grid=e;this.layout="";this.timers=new Map;this.data=null;this.synced=null;this.rebuilt=!1;this.inners={};for(let n of ut)this.inners[n]=k("div","fg-filter-row",{role:"row"}),t[n].append(this.inners[n])}get height(){return Math.round(this.grid.renderer.opts.rowHeight*.95)}render(){let{columns:e,store:t}=this.grid,n=this.height,r=e.displayed(),i=`${n}|${t.state.locale.code}|${r.map(s=>`${s.id}:${s.left}:${s.width}:${s.region}`).join(",")}`;if(i!==this.layout){this.layout=i;for(let s of ut){let a=this.inners[s];a.style.width=`${e.regionWidth(s)}px`,a.style.height=`${n}px`,a.replaceChildren(...e.region(s).map(l=>this.cell(l,n)))}this.data=t.state.data,this.rebuilt=!0}else t.state.data!==this.data&&(this.data=t.state.data,this.refreshLists());this.sync()}sync(){let e=this.grid.store.state.filters;if(!(e===this.synced&&!this.rebuilt)){this.synced=e,this.rebuilt=!1;for(let t of ut)for(let n of this.inners[t].querySelectorAll("[data-col]")){let r=n.dataset.col,i=e[r];if(n.closest(".fg-filter-cell").classList.toggle("fg-filter-active",!!i),!(n===n.ownerDocument.activeElement||n.getRootNode().activeElement===n)){if(n instanceof HTMLSelectElement){let s=(i==null?void 0:i.type)==="set"&&i.values.length===1?JSON.stringify(i.values[0]):"";[...n.options].some(a=>a.value===s)&&(n.value=s)}else n.value=Bs(i);n.classList.remove("fg-filter-bad")}}}}refreshLists(){var e;for(let t of ut)for(let n of this.inners[t].querySelectorAll("select[data-col]")){let r=(e=this.grid.columns.getNode(n.dataset.col))==null?void 0:e.def;if(!r)continue;let i=n.value;if(this.fillOptions(n,r),i&&![...n.options].some(s=>s.value===i)){let s=k("option","",{value:i});s.textContent=String(JSON.parse(i)),n.append(s)}n.value=i}}fillOptions(e,t){let n=k("option","",{value:""});n.textContent=this.grid.store.state.locale.selectAll;let r=this.distinct(t).map(i=>{let s=k("option","",{value:JSON.stringify(i)});return s.textContent=i===!0?"\u2713":i===!1?"\u2717":String(i),s});e.replaceChildren(n,...r)}cell(e,t){var c,d;let n=k("div","fg-filter-cell");n.style.left=`${e.left}px`,n.style.width=`${e.width}px`,n.style.height=`${t}px`;let r=H(e.id)?null:ue(e.def);if(!r)return n;let s=`${this.grid.store.state.locale.filter}: ${(d=(c=e.def.header)!=null?c:e.def.field)!=null?d:e.id}`;if(r==="set"){let u=k("select","fg-filter-input",{"aria-label":s});return u.dataset.col=e.id,this.fillOptions(u,e.def),u.addEventListener("change",()=>{this.grid.setFilter(e.id,u.value?{type:"set",values:[JSON.parse(u.value)]}:null)}),n.append(u),n}let a=k("input","fg-filter-input",{type:"text","aria-label":s,spellcheck:"false",autocomplete:"off"});a.dataset.col=e.id,r==="number"&&(a.placeholder=">0, 10~20"),r==="date"&&(a.placeholder=">2026-01-01");let l=()=>{let u=Os(r,a.value);a.classList.toggle("fg-filter-bad",u===void 0),u!==void 0&&this.grid.setFilter(e.id,u)};return a.addEventListener("input",()=>{clearTimeout(this.timers.get(e.id)),this.timers.set(e.id,window.setTimeout(l,200))}),a.addEventListener("keydown",u=>{u.stopPropagation(),u.key==="Enter"?(clearTimeout(this.timers.get(e.id)),l()):u.key==="Escape"&&(a.value="",clearTimeout(this.timers.get(e.id)),l())}),n.append(a),n}distinct(e){let t=new Map;for(let n of this.grid.store.state.data){let r=j(e,n);if(r==null||r==="")continue;let i=JSON.stringify(r);if(t.has(i)||t.set(i,r),t.size>=200)break}return[...t.values()].sort((n,r)=>String(n).localeCompare(String(r)))}setTransform(e){this.inners.center.style.transform=`translateX(${-e}px)`}destroy(){for(let e of this.timers.values())clearTimeout(e);for(let e of ut)this.inners[e].remove()}};function _n(o){let e=[];for(let t of o){if(U(t)||t instanceof Date)continue;let n=typeof t=="number"?t:Number(t);Number.isNaN(n)||e.push(n)}return e}function Lr(o,e){let t=o.filter(i=>i instanceof Date&&!Number.isNaN(i.getTime()));if(t.length)return t.reduce((i,s)=>(e?s>i:s<i)?s:i);let n=_n(o);if(!n.length)return null;let r=n[0];for(let i of n)(e?i>r:i<r)&&(r=i);return r}function Te(o,e,t){if(typeof o=="function")return o(e,t);switch(o){case"sum":return _n(e).reduce((n,r)=>n+r,0);case"avg":{let n=_n(e);return n.length?n.reduce((r,i)=>r+i,0)/n.length:null}case"min":return Lr(e,!1);case"max":return Lr(e,!0);case"count":return t.length}return null}function ft(o){return typeof o=="object"&&o!==null&&"agg"in o?o:{agg:o}}function Pr(o,e,t){let n=new Map,r=(i,s)=>{let a=n.get(i);return a||n.set(i,a=e.map(l=>j(s,l))),a};return o.map(i=>{var a;let s={};for(let[l,c]of Object.entries((a=i.columns)!=null?a:{})){let d=t(l);d&&(s[l]=Te(ft(c).agg,r(l,d),e))}return s})}function pt(o,e,t,n,r){if(!o)return 1;let i=1;try{i=Math.floor(Number(o({value:j(e,t),row:t,rowIndex:n})))}catch{i=1}return Number.isFinite(i)?Math.max(1,Math.min(r,i)):1}function Ht(o,e){let t=o.length,n=new Int32Array(t),r=new Int32Array(t);if(e.rowSpan){for(let a=0;a<t;){let l=pt(e.rowSpan,e,o[a],a,t-a);for(let c=a;c<a+l;c++)n[c]=a,r[c]=a+l-1;a+=l}return{start:n,end:r}}let i=typeof e.merge=="function"?(a,l)=>{try{return!!e.merge(j(e,o[a]),j(e,o[l]),o[a],o[l])}catch{return!1}}:(()=>{let a=o.map(l=>{let c=j(e,l);return U(c)?null:ne(c)});return(l,c)=>a[l]!==null&&a[l]===a[c]})(),s=0;for(let a=1;a<=t;a++)if(!(a<t&&i(a-1,a))){for(let l=s;l<a;l++)n[l]=s,r[l]=a-1;s=a}return{start:n,end:r}}function Fr(o,e,t,n,r=4){if(n<=0||t<=0)return{first:0,last:-1};let i=Math.max(0,Math.floor(o/t)-r),s=Math.floor((o+e)/t);return{first:Math.min(i,n-1),last:Math.min(n-1,s+r)}}function Gt(o,e,t,n,r=2){let i=o.length;if(!i)return{first:0,last:-1};let s=0,a=i-1;for(;s<a;){let d=s+a>>1;o[d]+e[d]<=t?s=d+1:a=d}let l=s,c=t+n;for(a=i-1;s<a;){let d=s+a+1>>1;o[d]<c?s=d:a=d-1}return{first:Math.max(0,l-r),last:Math.min(i-1,Math.max(l,s)+r)}}function Ir(o,e,t,n,r=4){if(n<=0)return{first:0,last:-1};let i=0,s=n-1;for(;i<s;){let c=i+s>>1;o[c+1]<=e?i=c+1:s=c}let a=i,l=e+t;for(s=n-1;i<s;){let c=i+s+1>>1;o[c]<l?i=c:s=c-1}return{first:Math.max(0,a-r),last:Math.min(n-1,i+r)}}var re=["left","center","right"],Dr=6,Hs=8,Xn=2,Gs='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M3 4h10M3 8h10M3 12h10" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>',Jn='<svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>';var zs='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M2.5 3h11l-4.2 5v4.5l-2.6 1.2V8z" fill="currentColor"/></svg>';function k(o,e="",t={}){let n=document.createElement(o);e&&(n.className=e);for(let[r,i]of Object.entries(t))n.setAttribute(r,i);return n}var zt=class{constructor(e,t,n){this.grid=t;this.opts=n;this.filterRow=null;this.activeCellId="";this.idBase=`fg${Math.random().toString(36).slice(2,8)}`;this.painted={left:new Map,center:new Map,right:new Map};this.geo={top:0,left:0,cw:0,ch:0,ow:0,oh:0};this.layoutSig="";this.touched=new Set;this.measureAll=!1;this.pool={left:[],center:[],right:[]};this.frame=0;this.headerDirty=!0;this.version=0;this.rowVersions=new Map;this.lastRange={first:0,last:-1};this.summaryEl=null;this.summaryPanes=null;this.summaryInners=null;this.summaryKey=null;this.canvasSummary={left:[],center:[],right:[]};this.topOffset=0;this.pinnedTop=null;this.pinnedBottom=null;this.statusEl=null;this.statusKey="";this.pagerEl=null;this.cards=null;this.cardMode=!1;this.pagerKey="";this.offsets=null;this.details=new Map;this.firstDataId="";this.rowHeights=new Map;this.heightsVersion=0;this.groupLabelId="";this.onScroll=()=>{this.frame&&cancelAnimationFrame(this.frame),this.frame=0,this.render(),this.grid.events.emit("scroll",this.cards?this.getScroll():{top:this.geo.top,left:this.geo.left})};this.onSideWheel=e=>{e.deltaY&&(e.preventDefault(),this.scroller.scrollTop+=e.deltaY)};this.overlayKey="";this.heightFn=null;this.onCardClick=e=>{var l;let t=e.target,n=t.closest(".fg-card");if(!n)return;let r=Number(n.dataset.row),i=this.grid.rowModel.getRow(r);if(!i||i.kind)return;if(t.closest(".fg-card-check")){this.grid.selectFromClick(r,!0,!1),this.invalidate({rows:!0});return}let s=(l=t.closest(".fg-card-value"))==null?void 0:l.dataset.col,a=s?this.grid.columns.getColumn(s):void 0;a&&this.grid.events.emit("cellClick",{row:i.data,rowIndex:r,colId:a.id,value:j(a.def,i.data),event:e})};this.root=k("div","",{tabindex:"-1"}),this.root.addEventListener("focus",()=>this.gridEl.focus({preventScroll:!0})),this.gridEl=k("div","fg-grid",{role:"grid",tabindex:"0"}),this.headerEl=k("div","fg-header",{role:"rowgroup"}),this.bodyEl=k("div","fg-body",{role:"rowgroup"});let r=i=>({left:k("div",`${i} ${i}-left`),center:k("div",`${i} ${i}-center`),right:k("div",`${i} ${i}-right`)});this.headerPanes=r("fg-header-pane"),this.headerInners=r("fg-header-inner");for(let i of re)this.headerInners[i].setAttribute("role","row");this.bodyPanes=r("fg-body-pane"),this.canvases=r("fg-canvas");for(let i of re)this.headerPanes[i].dataset.region=i,this.bodyPanes[i].dataset.region=i,this.headerPanes[i].append(this.headerInners[i]),this.bodyPanes[i].append(this.canvases[i]),this.headerEl.append(this.headerPanes[i]),this.bodyEl.append(this.bodyPanes[i]);this.scroller=this.bodyPanes.center,t.options.filterRow&&(this.filterRow=new Bt(t,this.headerPanes)),this.overlay=k("div","fg-overlay",{"aria-live":"polite"}),this.main=k("div","fg-main"),this.gridEl.append(this.headerEl,this.bodyEl),this.main.append(this.gridEl,this.overlay),this.root.append(this.main),e.append(this.root),this.applyTheme(),this.scroller.addEventListener("scroll",this.onScroll,{passive:!0}),this.bodyPanes.left.addEventListener("wheel",this.onSideWheel,{passive:!1}),this.bodyPanes.right.addEventListener("wheel",this.onSideWheel,{passive:!1})}get activeScroller(){var e,t;return(t=(e=this.cards)==null?void 0:e.scroller)!=null?t:this.scroller}readGeo(){let e=this.scroller;this.geo={top:e.scrollTop,left:e.scrollLeft,cw:e.clientWidth,ch:e.clientHeight,ow:e.offsetWidth,oh:e.offsetHeight}}getScroll(){let e=this.activeScroller;return{top:e.scrollTop,left:e.scrollLeft}}setScroll(e){let t=this.activeScroller;typeof(e==null?void 0:e.top)=="number"&&Number.isFinite(e.top)&&(t.scrollTop=Math.max(0,e.top)),typeof(e==null?void 0:e.left)=="number"&&Number.isFinite(e.left)&&(t.scrollLeft=Math.max(0,e.left))}applyFont(e,t){e?this.root.style.setProperty("--fg-font-size",`${e}px`):this.root.style.removeProperty("--fg-font-size"),t?this.root.style.setProperty("--fg-font",t):this.root.style.removeProperty("--fg-font")}applyTheme(){let e=this.grid.options.direction==="rtl";this.root.className=`fg-root fg-theme-${this.grid.store.state.theme}${e?" fg-rtl":""}${this.cardMode?" fg-card-mode":""}${this.grid.density!=="normal"?` fg-density-${this.grid.density}`:""}`,this.root.setAttribute("dir",e?"rtl":"ltr")}get rtl(){return this.grid.options.direction==="rtl"}invalidate(e={}){e.header&&(this.headerDirty=!0),e.rows&&(this.version++,this.rowVersions.clear()),this.schedule()}invalidateRowIds(e){var t;for(let n of e)this.rowVersions.set(n,((t=this.rowVersions.get(n))!=null?t:0)+1);this.schedule()}schedule(){this.frame||(this.frame=requestAnimationFrame(()=>{this.frame=0,this.render()}))}render(){var C,R,A,x,M,T,E,L,F,$;let{columns:e,rowModel:t,store:n,options:r}=this.grid,{rowHeight:i,headerHeight:s}=this.opts;this.readGeo();let a=this.geo.ow-this.geo.cw;e.setContainerWidth(Math.max(0,this.main.clientWidth-a))&&(this.headerDirty=!0,this.version++);let l=t.getRowCount(),c=!!this.grid.options.autoRowHeight&&!t.server,d=t.layout(i,this.detailHeight(),c?this.rowHeights:void 0,this.heightsVersion,t.server?void 0:this.heightOf);if(this.offsets=d.uniform?null:d.offsets,this.firstDataId=(R=(C=e.displayed().find(D=>!H(D.id)))==null?void 0:C.id)!=null?R:"",this.groupLabelId=(x=(A=e.region("center").find(D=>!H(D.id)))==null?void 0:A.id)!=null?x:this.firstDataId,this.useCards()){this.renderCards(l),this.renderStatusBar(t.dataCount()),this.renderPager(),this.orderSections(null),this.paintOverlay(l);return}let u=this.grid.summary(),f=u?u.opts.rows.length:0,h=(M=u==null?void 0:u.opts.position)!=null?M:"bottom",p=u?u.opts.pinned!==!1:!1;this.topOffset=u&&!p&&h==="top"?f*i:0;let g=u&&!p&&h==="bottom"?f*i:0;this.syncSummaryPane(u&&p?h:null,f*i);let w=e.depth*s+((E=(T=this.filterRow)==null?void 0:T.height)!=null?E:0);this.headerEl.style.height=`${w}px`;for(let D of re){let N=e.regionWidth(D);D!=="center"&&(this.headerPanes[D].style.width=this.bodyPanes[D].style.width=`${N}px`,this.headerPanes[D].hidden=this.bodyPanes[D].hidden=N===0),this.canvases[D].style.width=`${N}px`,this.canvases[D].style.height=`${this.rowsHeight(l)+this.topOffset+g}px`}r.autoHeight&&!this.useCards()&&(this.root.classList.add("fg-auto-height"),this.bodyEl.style.height=`${this.rowsHeight(l)+this.topOffset+g+Math.max(0,this.scroller.offsetHeight-this.scroller.clientHeight)}px`);let m=`${w}|${re.map(D=>e.regionWidth(D)).join(",")}|${this.rowsHeight(l)+this.topOffset+g}|${u&&p?h:""}|${f}|${r.autoHeight?1:0}`;m!==this.layoutSig&&(this.layoutSig=m,this.readGeo());let y=this.geo.oh-this.geo.ch;this.bodyPanes.left.style.marginBottom=this.bodyPanes.right.style.marginBottom=`${y}px`;let b=this.gridEl;b.setAttribute("role",r.treeData||this.grid.getGroupBy().length?"treegrid":"grid"),b.setAttribute("aria-rowcount",String(l+e.depth+(this.filterRow?1:0))),b.setAttribute("aria-colcount",String(e.displayed().length)),r.rowSelection==="multiple"&&b.setAttribute("aria-multiselectable","true"),this.headerDirty&&(this.headerDirty=!1,this.renderHeader()),(L=this.filterRow)==null||L.render(),this.renderRows(l),this.updateActiveCell(),c&&this.measureRows(),this.renderSummary(l,u&&u.opts.rows,(F=u==null?void 0:u.values)!=null?F:[],p,h),this.pinnedTop=this.renderPinned(this.pinnedTop,"top",this.grid.pinnedRows.top),this.pinnedBottom=this.renderPinned(this.pinnedBottom,"bottom",this.grid.pinnedRows.bottom),this.renderStatusBar(t.dataCount()),this.renderPager(),this.orderSections(u&&p?h:null),this.paintOverlay(l),this.overlay.style.top=`${w}px`;let{top:v,left:S}=this.geo;this.bodyPanes.left.scrollTop=this.bodyPanes.right.scrollTop=v,this.headerInners.center.style.transform=`translateX(${-S}px)`,($=this.filterRow)==null||$.setTransform(S),this.summaryInners&&(this.summaryInners.center.style.transform=`translateX(${-S}px)`);for(let D of[this.pinnedTop,this.pinnedBottom])D&&(D.inners.center.style.transform=`translateX(${-S}px)`);this.grid.fillHandle.update()}orderSections(e){var s,a,l,c;let t=[e==="top"?this.summaryEl:null,(a=(s=this.pinnedTop)==null?void 0:s.el)!=null?a:null].filter(d=>!!d),n=[(c=(l=this.pinnedBottom)==null?void 0:l.el)!=null?c:null,e==="bottom"?this.summaryEl:null].filter(d=>!!d),r=[this.statusEl,this.pagerEl].filter(d=>!!d);for(let d of t)d.nextElementSibling!==this.bodyEl&&!t.includes(d.nextElementSibling)&&this.gridEl.insertBefore(d,this.bodyEl);let i=this.bodyEl;for(let d=t.length-1;d>=0;d--)i.previousElementSibling!==t[d]&&this.gridEl.insertBefore(t[d],i),i=t[d];i=this.bodyEl;for(let d of n)i.nextElementSibling!==d&&i.after(d),i=d;i=this.gridEl;for(let d of r)i.nextElementSibling!==d&&i.after(d),i=d}paintOverlay(e){var d;let{grid:t}=this,{store:n,rowModel:r,options:i}=t,s=(d=t.forcedOverlay)!=null?d:e>0?null:r.loading()?"loading":"noRows";if(this.overlay.hidden=!s,!s){this.overlayKey="";return}let a=!r.server&&n.state.data.length>0,l=s==="loading"?i.loadingOverlay:i.noRowsOverlay,c=`${s}|${a}|${n.state.locale.code}`;if(c!==this.overlayKey)if(this.overlayKey=c,this.overlay.classList.toggle("fg-overlay-custom",typeof l=="function"),l==null)this.overlay.textContent=s==="loading"?n.state.locale.loading:n.state.locale.noRows;else if(typeof l=="string")this.overlay.textContent=l;else try{let u=l({filtered:a});typeof u=="string"?this.overlay.textContent=u:this.overlay.replaceChildren(u)}catch{q(`${s==="loading"?"loadingOverlay":"noRowsOverlay"} threw`),this.overlay.textContent=s==="loading"?n.state.locale.loading:n.state.locale.noRows}}updateActiveCell(){var n,r,i;let e=this.activeCellId&&(i=(r=(n=this.root.getRootNode()).getElementById)==null?void 0:r.call(n,this.activeCellId))!=null?i:null,t=this.gridEl.querySelector(".fg-body .fg-cell-focused, .fg-body .fg-row-group .fg-cell-focused");if(e&&e!==t&&e.removeAttribute("id"),!t){this.gridEl.removeAttribute("aria-activedescendant"),this.activeCellId="";return}t.id||(t.id=`${this.idBase}-cell`),this.activeCellId=t.id,this.gridEl.setAttribute("aria-activedescendant",t.id)}renderPinned(e,t,n){if(!n.length)return e==null||e.el.remove(),null;let r=e!=null?e:new Yn(`fg-pinned-rows fg-pinned-${t}`),{columns:i}=this.grid,s=this.opts.rowHeight;r.size(i,n.length*s,this.geo.ow-this.geo.cw);let a=i.region("center"),l=Gt(a.map(d=>d.left),a.map(d=>d.width),this.geo.left,this.geo.cw,Xn),c=[n,n.length,this.version,this.grid.valuesVersion,l.first,l.last,s,this.grid.store.state.locale.code];if(e&&$r(c,r.key))return r;r.key=c;for(let d of re){let u=d==="center"?a.slice(l.first,l.last+1):i.region(d);r.inners[d].replaceChildren(...n.map((f,h)=>{let p=k("div","fg-row fg-row-pinned",{role:"row"});p.style.transform=`translateY(${h*s}px)`,p.style.height=`${s}px`;let g={id:`pinned-${t}-${h}`,data:f,sourceIndex:-1};for(let w of u){let m=k("div","fg-cell",{role:"gridcell"});H(w.id)?(m.style.left=`${w.left}px`,m.style.width=`${w.width}px`):this.paintCell(m,g,-1,w,!1,!1),p.append(m)}return p}))}return r}renderStatusBar(e){var u,f;if(!this.grid.options.statusBar){(u=this.statusEl)==null||u.remove(),this.statusEl=null;return}let{grid:t}=this,n=t.store.state,r=t.rowModel.server?e:t.viewRows().length,i=`${this.version}.${t.valuesVersion}|${e}|${r}|${n.selected.size}|${JSON.stringify(n.range)}|${n.locale.code}`;if(this.statusEl&&i===this.statusKey)return;this.statusKey=i,(f=this.statusEl)!=null||(this.statusEl=k("div","fg-statusbar",{role:"status","aria-live":"polite"}));let s=n.locale,a=ke(s.code,2),l=k("span","fg-status-rows");l.textContent=(e===r?s.statusRows.replace("{n}",a.format(r)):s.statusFiltered.replace("{shown}",a.format(e)).replace("{total}",a.format(r)))+(n.selected.size?` \xB7 ${s.statusSelected.replace("{n}",a.format(n.selected.size))}`:"");let c=k("span","fg-status-aggs"),d=t.rangeAggregates();if(d&&d.cells>1){let h=[`${s.count} ${a.format(d.count)}`];d.numbers&&h.push(`${s.sum} ${a.format(d.sum)}`,`${s.avg} ${a.format(d.sum/d.numbers)}`,`${s.min} ${a.format(d.min)}`,`${s.max} ${a.format(d.max)}`),c.textContent=h.join(" ")}this.statusEl.replaceChildren(l,c)}renderHeader(){let{columns:e,store:t}=this.grid,{sort:n,filters:r,locale:i}=t.state;for(let s of re){let a=this.headerInners[s];a.style.width=`${e.regionWidth(s)}px`,a.style.height=`${e.depth*this.opts.headerHeight}px`,a.replaceChildren(...e.headerCells(s).map(l=>this.headerCell(l,n,r,i)))}}headerCell(e,t,n,r){var f,h;let i=this.opts.headerHeight,s=k("div",e.isGroup?"fg-header-cell fg-header-group":"fg-header-cell",{role:"columnheader"});if(s.dataset.col=e.id,s.style.left=`${e.left}px`,s.style.top=`${e.row*i}px`,s.style.width=`${e.width}px`,s.style.height=`${e.rowSpan*i}px`,H(e.id))return e.id===Re&&(s.classList.add("fg-header-rownum"),s.textContent=e.label),e.id===le&&(s.classList.add("fg-header-select"),s.append(this.selectAllBox(r))),s;let a=k("span","fg-header-label"),l=e.node.def;if(a.textContent=e.label,l.headerRenderer)try{let p=l.headerRenderer({header:e.label,column:l});typeof p=="string"?a.innerHTML=p:a.replaceChildren(p)}catch{q(`headerRenderer of column "${e.id}" threw; showing the plain header`),a.textContent=e.label}let c=null;if(e.isGroup&&this.grid.columns.isCollapsible(e.node)){let p=e.node.open,g=k("button",p?"fg-colgroup-toggle fg-expanded":"fg-colgroup-toggle",{type:"button",tabindex:"-1","aria-expanded":String(p),"aria-label":p?r.collapseAll:r.expandAll});g.textContent=p?"\u2212":"+",g.addEventListener("click",w=>{w.stopPropagation(),this.grid.setColumnGroupOpened(e.id,!p)}),s.classList.add("fg-header-collapsible"),c=g}if(l.headerClass)try{let p=typeof l.headerClass=="function"?l.headerClass(l):l.headerClass;p&&s.classList.add(...p.split(/\s+/).filter(Boolean))}catch{q(`headerClass of column "${e.id}" threw`)}if(s.append(a),c&&s.append(c),e.isGroup||!e.column)return s;let d=e.node.def;((f=d.wrapHeaderText)!=null?f:this.grid.options.wrapHeaderText)&&s.classList.add("fg-header-wrap"),s.setAttribute("aria-colindex",String(e.column.index+1)),((h=d.align)!=null?h:d.type==="number"?"right":"left")==="right"&&s.classList.add("fg-align-right");let u=t.findIndex(p=>p.colId===e.id);if(s.setAttribute("aria-sort",u<0?"none":t[u].dir==="asc"?"ascending":"descending"),Ie(d)&&s.classList.add("fg-sortable"),u>=0){let p=k("span","fg-sort-icon");if(p.textContent=t[u].dir==="asc"?"\u2191":"\u2193",t.length>1){let g=k("sup");g.textContent=String(u+1),p.append(g)}s.append(p)}if(Ie(d)||ue(d)){let p=!!n[e.id],g=k("button",p?"fg-menu-btn fg-filter-active":"fg-menu-btn",{type:"button",tabindex:"-1","aria-label":r.columnMenu});g.innerHTML=p?zs:Gs,s.append(g)}return Pt(d)&&s.append(k("div","fg-resize",{"aria-hidden":"true"})),s}selectAllBox(e){let t=k("input","fg-checkbox fg-select-all",{type:"checkbox",tabindex:"-1","aria-label":e.selectAllRows});return this.paintSelectAll(t),t.hidden=this.grid.options.rowSelection!=="multiple"||this.grid.options.headerCheckbox===!1,t}paintSelectAll(e){let t=this.grid.selectableIds(),n=0;for(let r of this.grid.store.state.selected)t.has(r)&&n++;e.checked=t.size>0&&n===t.size,e.indeterminate=n>0&&n<t.size}selectionChanged(){let e=this.headerEl.querySelectorAll(".fg-select-all");if(e.length)for(let t of e)this.paintSelectAll(t)}renderRows(e){var w,m,y,b;let{columns:t,rowModel:n,store:r}=this.grid,{selected:i,focus:s}=r.state,a=this.grid.allRangeBounds(),l=this.grid.mergeSpans(),{geo:c}=this,d=Math.max(0,c.top-this.topOffset),u=this.grid.options.autoHeight&&!n.server?{first:0,last:e-1}:this.offsets?Ir(this.offsets,d,c.ch,e,Dr):Fr(d,c.ch,this.opts.rowHeight,e,Dr);this.lastRange=u;let f=t.region("center"),h=Gt(f.map(v=>v.left),f.map(v=>v.width),this.geo.left,this.geo.cw,Xn),p=f.some(v=>v.def.colSpan);p&&(h.first=Math.max(0,h.first-Hs));let g=!p&&!l.size;this.touched.clear();for(let v of re){let S=v==="center"?f.slice(h.first,h.last+1):t.region(v),C=this.painted[v];for(let[A,x]of C)A>=u.first&&A<=u.last&&S.length||(x.el.remove(),this.pool[v].push(x.el),C.delete(A));if(!S.length)continue;let R=v==="center"?`${h.first}-${h.last}`:"";for(let A=u.first;A<=u.last;A++){let x=n.getRow(A),M=i.has(x.id),T=s&&s.rowIndex===A?s.colId:"",E=a.filter(B=>A>=B.r1&&A<=B.r2),L=E.map(B=>`${B.c1}-${B.c2}`).join(","),F=this.mergeState(l,S,A,u.first),$=x.kind==="detail"?`${c.left}:${c.cw}`:"",D=`${x.id}|${this.version}.${(w=this.rowVersions.get(x.id))!=null?w:0}|${M?1:0}${x.kind==="group"?`:${this.grid.selectionVersion}`:""}|${T}|${L}|${F}|${$}`,N=`${R}|${D}`,P=C.get(A);if(!P){let B=(m=this.pool[v].pop())!=null?m:k("div","fg-row",{role:"row"});this.canvases[v].append(B),P={el:B,key:""},C.set(A,P)}if(P.key!==N){if(this.touched.add(A),g&&v==="center"&&!x.kind&&P.base===D&&this.slideCells(P,x,A,f,h,M,T,E)){P.key=N;continue}P.key=N,P.base=v==="center"&&!x.kind?D:void 0,P.first=h.first,P.last=h.last,P.el.dataset.kind!==((y=x.kind)!=null?y:"")&&(P.el.replaceChildren(),P.el.dataset.kind=(b=x.kind)!=null?b:""),x.kind==="group"?this.paintGroupRow(P.el,x,A,S,T):x.kind==="detail"?this.paintDetailRow(P.el,x,A,v):x.kind==="loading"?this.paintLoadingRow(P.el,A,S):this.paintRow(P.el,x,A,S,M,T,E,l,u.first)}}}}slideCells(e,t,n,r,i,s,a,l){let c=e.first,d=e.last;if(i.first>d||i.last<c||e.el.childElementCount!==d-c+1)return!1;let u=e.el;for(let h=c;h<i.first;h++)u.firstElementChild.remove();for(let h=d;h>i.last;h--)u.lastElementChild.remove();let f=h=>{let p=k("div","fg-cell",{role:"gridcell"});return this.paintCell(p,t,n,h,s,a===h.id),h.id===this.firstDataId&&this.decorate(p,t),!H(h.id)&&l.some(g=>h.index>=g.c1&&h.index<=g.c2)&&p.classList.add("fg-cell-range"),p};return i.first<c&&u.prepend(...r.slice(i.first,c).map(f)),i.last>d&&u.append(...r.slice(d+1,i.last+1).map(f)),e.first=i.first,e.last=i.last,!0}mergeState(e,t,n,r){if(!e.size)return"";let i="";for(let s of t){let a=e.get(s.id);if(!a)continue;let l=a.start[n],c=a.end[n];i+=l===c?"n":n===Math.max(l,r)?`d${l}`:"h"}return i}paintRow(e,t,n,r,i,s,a,l=new Map,c=0){let d=this.opts.rowHeight;for(e.className=`fg-row${n%2?" fg-row-odd":""}${i?" fg-row-selected":""}${this.grid.tracker.created.has(t.data)?" fg-row-created":""}${this.grid.editor.editingRow(t.id)?" fg-row-editing":""}`,this.placeRow(e,n),this.grid.options.rowSelection&&e.setAttribute("aria-selected",String(i)),t.level!==void 0?e.setAttribute("aria-level",String(t.level+1)):e.removeAttribute("aria-level"),t.hasChildren?e.setAttribute("aria-expanded",String(!!t.expanded)):e.removeAttribute("aria-expanded");e.childElementCount>r.length;)e.lastElementChild.remove();for(;e.childElementCount<r.length;)e.append(k("div","fg-cell",{role:"gridcell"}));let u=!1,f=r.length?this.grid.columns.region(r[0].region):[],h=f.some(w=>w.def.colSpan),p=-1,g=h?new Map(f.map((w,m)=>[w.id,m])):null;r.forEach((w,m)=>{let y=e.children[m];if(this.paintCell(y,t,n,w,i,s===w.id),g){let v=g.get(w.id);if(v<=p)y.classList.add("fg-cell-span-hidden");else if(w.def.colSpan&&!H(w.id)){let S=pt(w.def.colSpan,w.def,t.data,n,f.length-v);if(S>1){p=v+S-1;let C=0;for(let R=v;R<=p;R++)C+=f[R].width;y.style.width=`${C}px`,y.classList.add("fg-cell-colspan")}}}w.id===this.firstDataId&&this.decorate(y,t),y.style.top=y.style.height=y.style.bottom="";let b=l.get(w.id);b&&b.start[n]!==b.end[n]&&(n===Math.max(b.start[n],c)?(y.classList.add("fg-cell-merged"),y.style.top=`${-(this.rowTop(n)-this.rowTop(b.start[n]))}px`,y.style.height=`${this.rowTop(b.end[n])+this.rowH(b.end[n])-this.rowTop(b.start[n])}px`,y.style.bottom="auto",u=!0):y.classList.add("fg-cell-merge-hidden")),!H(w.id)&&a.some(v=>w.index>=v.c1&&w.index<=v.c2)&&y.classList.add("fg-cell-range")}),e.style.zIndex=u?"1":""}paintCell(e,t,n,r,i,s){var p;let a=this.grid.store.state.locale;e.style.left=`${r.left}px`,e.style.width=`${r.width}px`,e.dataset.col=r.id,e.setAttribute("aria-colindex",String(r.index+1));let l=s?"fg-cell fg-cell-focused":"fg-cell";if(r.id===Re){e.className=`${l} fg-cell-rownum`;let g=n>=0&&!t.kind?this.grid.rowNumber(n):null;e.textContent=g===null?"":String(g);return}if(r.id===Fe){e.className=`${l} fg-cell-drag`;let g=k("span",this.grid.canMoveRows()?"fg-drag-handle":"fg-drag-handle fg-drag-disabled",{"aria-hidden":"true"});g.textContent="\u22EE\u22EE",e.replaceChildren(g);return}if(r.id===le){e.className=`${l} fg-cell-select`;let g=k("input","fg-checkbox",{type:"checkbox",tabindex:"-1","aria-label":a.selectRow});g.checked=i,n>=0&&!t.kind&&!this.grid.rowSelectable(t.data)&&(g.disabled=!0,e.classList.add("fg-cell-select-locked")),e.replaceChildren(g);return}let c=r.def,d=j(c,t.data),u=ee(c,a.code)(d);l+=` fg-align-${(p=c.align)!=null?p:c.type==="number"?"right":c.type==="boolean"?"center":"left"}`;let f={value:d,formatted:u,row:t.data,rowIndex:n,column:c};if(c.cellClass)try{let g=typeof c.cellClass=="function"?c.cellClass(f):c.cellClass;g&&(l+=` ${g}`)}catch{q(`cellClass of column "${r.id}" threw`)}this.grid.tracker.isDirty(t.data,c.field)&&(l+=" fg-cell-dirty"),c.wrapText&&(l+=" fg-cell-wrap"),typeof c.editable=="function"&&n>=0&&!ye(c,t.data,n)&&(l+=" fg-cell-readonly"),n>=0&&(l+=this.grid.finder.classFor(n,r.id)),l+=this.grid.flashClass(t.id,r.id);let h=n>=0&&!t.kind?this.grid.cellFormat(t.data,r.id,d):null;if(h!=null&&h.bar&&(l+=" fg-cf-bar"),e.className=l,this.applyFormat(e,h),c.sparkline&&!c.renderer){let g=Array.isArray(d)?d.map(Number).filter(Number.isFinite):[];g.length?e.replaceChildren(Vs(g,c.sparkline===!0?{}:c.sparkline,r.width,this.opts.rowHeight)):e.replaceChildren(),e.setAttribute("aria-label",Array.isArray(d)?d.join(", "):"");return}if(!c.renderer){if(e.textContent=u,h!=null&&h.icon){let g=k("span","fg-cf-icon",{"aria-hidden":"true"});g.textContent=h.icon.char,g.style.color=h.icon.color,e.prepend(g)}return}try{let g=c.renderer(f);typeof g=="string"?e.innerHTML=g:e.replaceChildren(g)}catch{q(`renderer of column "${r.id}" threw; rendering an empty cell`),e.textContent=""}}applyFormat(e,t){var i,s;let n=e.style;if(!t){e.dataset.cf&&(n.color=n.background=n.fontWeight=n.fontStyle=n.textDecoration="",n.removeProperty("--fg-bar-from"),n.removeProperty("--fg-bar-to"),n.removeProperty("--fg-bar-color"),delete e.dataset.cf);return}e.dataset.cf="1";let r=t.style;n.color=(i=r.color)!=null?i:"",n.background=(s=r.background)!=null?s:"",n.fontWeight=r.bold?"600":"",n.fontStyle=r.italic?"italic":"",n.textDecoration=r.strike?"line-through":"",t.bar?(n.setProperty("--fg-bar-from",`${(t.bar.from*100).toFixed(2)}%`),n.setProperty("--fg-bar-to",`${(t.bar.to*100).toFixed(2)}%`),n.setProperty("--fg-bar-color",t.bar.color)):(n.removeProperty("--fg-bar-from"),n.removeProperty("--fg-bar-to"),n.removeProperty("--fg-bar-color"))}cellAt(e){let t=e instanceof Element?e.closest(".fg-cell"):null,n=t==null?void 0:t.parentElement;return!t||!(n!=null&&n.dataset.row)||!t.dataset.col||t.closest(".fg-root")!==this.root?null:{rowIndex:Number(n.dataset.row),colId:t.dataset.col}}ensureVisible(e,t){let n=this.scroller,r=this.rowTop(e),i=r+Math.min(this.rowH(e),n.clientHeight||1/0);r<n.scrollTop?n.scrollTop=r:i>n.scrollTop+n.clientHeight&&(n.scrollTop=i-n.clientHeight);let s=t?this.grid.columns.getColumn(t):void 0;(s==null?void 0:s.region)==="center"&&(s.left<n.scrollLeft?n.scrollLeft=s.left:s.left+s.width>n.scrollLeft+n.clientWidth&&(n.scrollLeft=s.left+s.width-n.clientWidth))}syncSummaryPane(e,t){var r;if(!e){(r=this.summaryEl)==null||r.remove(),this.summaryEl=this.summaryPanes=this.summaryInners=null;return}if(!this.summaryEl){let i=s=>({left:k("div",`${s} ${s}-left`),center:k("div",`${s} ${s}-center`),right:k("div",`${s} ${s}-right`)});this.summaryEl=k("div","fg-summary",{role:"rowgroup"}),this.summaryPanes=i("fg-summary-pane"),this.summaryInners=i("fg-summary-inner");for(let s of re)this.summaryPanes[s].append(this.summaryInners[s]),this.summaryEl.append(this.summaryPanes[s])}this.summaryEl.className=`fg-summary fg-summary-${e}`,this.summaryEl.style.height=`${t}px`;for(let i of re){let s=this.grid.columns.regionWidth(i);i!=="center"&&(this.summaryPanes[i].style.width=`${s}px`,this.summaryPanes[i].hidden=s===0),this.summaryInners[i].style.width=`${s}px`,this.summaryInners[i].style.height=`${t}px`}let n=this.geo.ow-this.geo.cw;this.summaryPanes.center.style.marginRight=`${n}px`}renderSummary(e,t,n,r,i){if(!t&&!this.summaryKey)return;let s=this.grid.columns.region("center"),a=Gt(s.map(f=>f.left),s.map(f=>f.width),this.geo.left,this.geo.cw,Xn),l=[t,n,r,i,this.summaryInners,this.version,a.first,a.last,this.opts.rowHeight,r?0:this.rowsHeight(e),this.grid.store.state.locale.code];if($r(l,this.summaryKey))return;this.summaryKey=l;for(let f of re){for(let h of this.canvasSummary[f])h.remove();this.canvasSummary[f]=[]}if(!t){this.summaryKey=null;return}let{columns:c}=this.grid,d=this.opts.rowHeight,u=c.displayed().filter(f=>!H(f.id));for(let f of re){let h=f==="center"?s.slice(a.first,a.last+1):c.region(f),p=t.map((g,w)=>{var v,S,C;let m=g.label!=null&&(S=(v=u.find(R=>{var A;return!(R.id in((A=g.columns)!=null?A:{}))}))==null?void 0:v.id)!=null?S:null,y=k("div","fg-row fg-summary-row",{role:"row"}),b=r||i==="top"?w*d:this.rowsHeight(e)+w*d;y.style.transform=`translateY(${b}px)`,y.style.height=`${d}px`;for(let R of h)y.append(this.summaryCell(R,g,(C=n[w])!=null?C:{},m));return y});r?this.summaryInners[f].replaceChildren(...p):(this.canvases[f].append(...p),this.canvasSummary[f]=p)}}summaryCell(e,t,n,r){var h,p,g,w,m;let i=k("div","fg-cell",{role:"gridcell"});i.style.left=`${e.left}px`,i.style.width=`${e.width}px`,i.dataset.col=e.id;let s=e.def,a=(h=s.align)!=null?h:s.type==="number"?"right":s.type==="boolean"?"center":"left";i.className=`fg-cell fg-align-${a}`;let l=(p=t.columns)==null?void 0:p[e.id];if(l===void 0)return e.id===r&&(i.textContent=(g=t.label)!=null?g:"",i.classList.add("fg-summary-label")),i;let c=n[e.id],d=ft(l),u=this.grid.store.state.locale.code,f;if(c==null||c==="")f="";else if(typeof c=="string")f=c;else if(d.agg==="count")f=ke(u).format(c);else{let y=(w=s.type)!=null?w:typeof c=="number"?"number":c instanceof Date?"date":void 0;f=at(s,y,u,(m=d.format)!=null?m:s.format)(c)}return i.textContent=d.prefix&&f?`${d.prefix} ${f}`:f,i}get heightOf(){var t;let e=this.grid.options.getRowHeight;if(e)return(t=this.heightFn)!=null?t:this.heightFn=n=>{var r;try{return(r=e(n))!=null?r:void 0}catch{return}}}invalidateHeights(){this.heightOf&&this.heightsVersion++,this.rowHeights.size&&(this.rowHeights.clear(),this.measureAll=!0,this.heightsVersion++)}measureRows(){var i;let e=this.opts.rowHeight,t=new Map,n=this.measureAll?new Set(re.flatMap(s=>[...this.painted[s].keys()])):this.touched;this.measureAll=!1;for(let s of n){let a=this.grid.rowModel.getRow(s);if(!a||a.kind)continue;let l=e;for(let c of re){let d=this.painted[c].get(s);if(d)for(let u of d.el.querySelectorAll(".fg-cell-wrap"))u.classList.contains("fg-cell-merged")||u.classList.contains("fg-cell-merge-hidden")||(l=Math.max(l,Math.ceil(u.scrollHeight)))}t.set(s,l)}this.touched.clear();let r=!1;for(let[s,a]of t){let l=this.grid.rowModel.getRow(s).id,c=(i=this.rowHeights.get(l))!=null?i:e;Math.abs(c-a)>1&&(a===e?this.rowHeights.delete(l):this.rowHeights.set(l,a),r=!0)}r&&(this.heightsVersion++,this.version++,this.schedule())}detailHeight(){let e=this.grid.options.detailHeight;return typeof e=="number"&&e>0?e:240}rowTop(e){return(this.offsets?this.offsets[e]:e*this.opts.rowHeight)+this.topOffset}rowH(e){return this.offsets?this.offsets[e+1]-this.offsets[e]:this.opts.rowHeight}rowsHeight(e){return this.offsets?this.offsets[e]:e*this.opts.rowHeight}placeRow(e,t){e.style.transform=`translateY(${this.rowTop(t)}px)`,e.style.height=`${this.rowH(t)}px`,e.dataset.row=String(t),e.setAttribute("aria-rowindex",String(t+1+this.grid.columns.depth+(this.filterRow?1:0)))}decorate(e,t){var c;let{grid:n}=this,r=n.store.state.locale,i=(c=t.level)!=null?c:0,s=!!n.options.treeData,a=n.canExpandDetail(t.data);if(!s&&!a&&!i)return;e.classList.add("fg-cell-lead"),e.style.setProperty("--fg-level",String(i));let l=[];if(s)if(t.hasChildren){let d=k("button",t.expanded?"fg-tree-toggle fg-expanded":t.loading?"fg-tree-toggle fg-tree-loading":"fg-tree-toggle",{type:"button",tabindex:"-1","aria-label":t.expanded?r.collapseAll:r.expandAll,"aria-expanded":String(!!t.expanded)});t.loading&&d.setAttribute("aria-busy","true"),d.innerHTML=Jn,l.push(d)}else l.push(k("span","fg-tree-spacer",{"aria-hidden":"true"}));if(a){let d=n.isDetailExpanded(t.data),u=k("button",d?"fg-detail-toggle fg-expanded":"fg-detail-toggle",{type:"button",tabindex:"-1","aria-expanded":String(d),"aria-label":d?r.collapseAll:r.expandAll});u.innerHTML=Jn,l.push(u)}e.prepend(...l)}paintGroupRow(e,t,n,r,i){var c;let s=t.group,{grid:a}=this,l=a.store.state.locale;for(e.className="fg-row fg-row-group",this.placeRow(e,n),e.setAttribute("aria-level",String(((c=t.level)!=null?c:0)+1)),e.setAttribute("aria-expanded",String(s.expanded)),e.removeAttribute("aria-selected"),e.style.zIndex="";e.childElementCount>r.length;)e.lastElementChild.remove();for(;e.childElementCount<r.length;)e.append(k("div","fg-cell",{role:"gridcell"}));r.forEach((d,u)=>{var m,y,b,v,S,C,R;let f=e.children[u];f.style.left=`${d.left}px`,f.style.width=`${d.width}px`,f.style.top=f.style.height=f.style.bottom="",f.style.removeProperty("--fg-level"),f.dataset.col=d.id,f.setAttribute("aria-colindex",String(d.index+1));let h=i===d.id?" fg-cell-focused":"";if(d.id===le){if(f.className=`fg-cell fg-cell-select${h}`,a.options.rowSelection!=="multiple"){f.replaceChildren();return}let A=a.groupSelection(t),x=k("input","fg-checkbox",{type:"checkbox",tabindex:"-1","aria-label":l.selectAllRows});x.checked=A==="all",x.indeterminate=A==="some",f.replaceChildren(x);return}if(d.id===this.groupLabelId){f.className=`fg-cell fg-group-cell${h}`,f.style.setProperty("--fg-level",String((m=t.level)!=null?m:0));let A=k("button",s.expanded?"fg-group-toggle fg-expanded":"fg-group-toggle",{type:"button",tabindex:"-1","aria-expanded":String(s.expanded),"aria-label":s.expanded?l.collapseAll:l.expandAll});A.innerHTML=Jn;let x=(y=a.columns.getNode(s.colId))==null?void 0:y.def,M=k("span","fg-group-label"),T=U(s.value)?l.blanks:x?ee(x,l.code)(s.value):String(s.value),E=ke(l.code),L=(b=s.count)!=null?b:s.aggregates?null:s.rows.length;M.textContent=`${(S=(v=x==null?void 0:x.header)!=null?v:x==null?void 0:x.field)!=null?S:s.colId}: ${T}${L==null?"":` (${E.format(L)})`}`,f.replaceChildren(A,M);return}let p=d.def,g=(C=p.align)!=null?C:p.type==="number"?"right":p.type==="boolean"?"center":"left";f.className=`fg-cell fg-align-${g}${h}`;let w=p.aggFunc&&!H(d.id)?a.groupAggregate(t,d.id):void 0;if(w==null||w==="")f.textContent="";else if(p.aggFunc==="count")f.textContent=ke(l.code).format(w);else{let A=(R=p.type)!=null?R:typeof w=="number"?"number":w instanceof Date?"date":void 0;f.textContent=at(p,A,l.code)(w)}f.textContent&&f.classList.add("fg-cell-agg")})}paintDetailRow(e,t,n,r){var a,l;if(e.className="fg-row fg-row-detail",this.placeRow(e,n),e.style.zIndex="",r!=="center"){e.replaceChildren();return}let i=t.detailOf,s=this.details.get(i.id);if(!s){s=k("div","fg-detail");try{let c=(l=(a=this.grid.options).detailRenderer)==null?void 0:l.call(a,{row:i.data,rowIndex:n-1});typeof c=="string"?s.innerHTML=c:c&&s.append(c)}catch{q("detailRenderer threw; showing an empty panel")}this.details.set(i.id,s)}s.style.left=`${this.geo.left}px`,s.style.width=`${this.geo.cw||this.grid.columns.regionWidth("center")}px`,(e.firstChild!==s||e.childNodes.length!==1)&&e.replaceChildren(s)}paintLoadingRow(e,t,n){e.className="fg-row fg-row-loading",this.placeRow(e,t),e.setAttribute("aria-busy","true"),e.style.zIndex="",e.replaceChildren(...n.map(r=>{let i=k("div","fg-cell",{role:"gridcell"});return i.style.left=`${r.left}px`,i.style.width=`${r.width}px`,i.dataset.col=r.id,H(r.id)||i.append(k("span","fg-skeleton",{"aria-hidden":"true"})),i}))}renderPager(){var m;let{grid:e}=this,t=e.options.pagination;if(!t){(m=this.pagerEl)==null||m.remove(),this.pagerEl=null;return}let n=e.store.state.locale,r=e.getPage(),i=e.getPageSize(),s=e.getPageCount(),a=e.rowModel.fullCount(),l=typeof t=="object"&&Array.isArray(t.pageSizes)?t.pageSizes.filter(y=>Number.isInteger(y)&&y>0):[],c=`${r}|${i}|${s}|${a}|${n.code}|${l.join(",")}`;if(this.pagerEl&&c===this.pagerKey)return;this.pagerKey=c,this.pagerEl||(this.pagerEl=k("div","fg-pager",{role:"navigation"}),this.pagerEl.addEventListener("click",y=>{var S;let b=(S=y.target.closest("button[data-action]"))==null?void 0:S.dataset.action,v=e.getPage();b==="first"?e.setPage(0):b==="prev"?e.setPage(v-1):b==="next"?e.setPage(v+1):b==="last"&&e.setPage(e.getPageCount()-1)}),this.pagerEl.addEventListener("change",y=>{let b=y.target;b.classList.contains("fg-pager-size")&&e.setPageSize(Number(b.value))})),this.pagerEl.setAttribute("aria-label",n.pageSize);let d=ke(n.code),u=a?r*i+1:0,f=Math.min(a,(r+1)*i),h=k("span","fg-pager-range");h.textContent=n.pagerRange.replace("{from}",d.format(u)).replace("{to}",d.format(f)).replace("{total}",d.format(a));let p=[h,k("span","fg-pager-spacer")];if(l.length){let y=k("label","fg-pager-size-label");y.textContent=n.pageSize;let b=k("select","fg-pager-size");for(let v of[...new Set([...l,i])].sort((S,C)=>S-C)){let S=k("option");S.value=String(v),S.textContent=d.format(v),S.selected=v===i,b.append(S)}y.append(b),p.push(y)}let g=(y,b,v,S)=>{let C=k("button","fg-pager-btn",{type:"button","aria-label":v,title:v});return C.dataset.action=y,C.textContent=b,C.disabled=S,C},w=k("span","fg-pager-page",{"aria-live":"polite"});w.textContent=n.pageOf.replace("{page}",d.format(r+1)).replace("{pages}",d.format(s)),p.push(g("first","\xAB",n.firstPage,r===0),g("prev","\u2039",n.previousPage,r===0),w,g("next","\u203A",n.nextPage,r>=s-1),g("last","\xBB",n.lastPage,r>=s-1)),this.pagerEl.replaceChildren(...p)}showFreeBadge(){if(this.root.querySelector(".fg-free-badge"))return;let e=k("a","fg-free-badge",{href:"https://freegrid.app/pricing/",target:"_blank",rel:"noopener"});e.innerHTML='<svg viewBox="0 0 32 32" width="14" height="14" aria-hidden="true"><rect width="32" height="32" rx="7" fill="#0E1726"/><path d="M7 11.5h18M7 16.5h18M7 21.5h18M13 7v18" stroke="#fff" stroke-width="2" stroke-linecap="round"/><rect x="14" y="12.5" width="11" height="3" rx="1" fill="#F2A900"/></svg>';let t=k("span");t.textContent=`FreeGrid \xB7 ${this.grid.store.state.locale.freeBadge}`,e.append(t),this.root.append(e)}useCards(){let e=this.grid.options.cardView,t=e===!0?640:typeof e=="number"?e:-1,n=t>0&&this.main.clientWidth<t;return n!==this.cardMode&&(this.cardMode=n,this.root.classList.toggle("fg-card-mode",n),!n&&this.cards&&(this.cards.scroller.remove(),this.cards=null),this.version++),n}renderCards(e){var g,w,m,y,b;let{grid:t}=this;if(!this.cards){let v=k("div","fg-cards",{role:"list"}),S=k("div","fg-cards-canvas");v.append(S),this.main.insertBefore(v,this.overlay),v.addEventListener("scroll",()=>{this.schedule(),this.grid.events.emit("scroll",this.getScroll())},{passive:!0}),v.addEventListener("click",this.onCardClick),this.cards={scroller:v,canvas:S}}let{scroller:n,canvas:r}=this.cards,i=t.columns.displayed().filter(v=>!H(v.id)),s=Math.round(this.opts.rowHeight*.75),a=!!t.options.rowSelection,l=20+i.length*s+(a?s:0),c=10;r.style.height=`${e*(l+c)}px`;let d=Math.max(0,Math.floor(n.scrollTop/(l+c))-2),u=Math.min(e-1,Math.ceil((n.scrollTop+(n.clientHeight||800))/(l+c))+2),{selected:f,locale:h}=t.store.state,p=[];for(let v=d;v<=u;v++){let S=t.rowModel.getRow(v);if(!S)continue;let C=k("div",S.kind?"fg-card fg-card-other":f.has(S.id)?"fg-card fg-card-selected":"fg-card",{role:"listitem"});if(C.dataset.row=String(v),C.style.transform=`translateY(${v*(l+c)}px)`,C.style.height=`${l}px`,C.style.setProperty("--fg-card-line",`${s}px`),S.kind==="group"&&S.group){let R=(g=t.columns.getNode(S.group.colId))==null?void 0:g.def;C.textContent=`${(w=R==null?void 0:R.header)!=null?w:S.group.colId}: ${String((m=S.group.value)!=null?m:h.blanks)} (${S.group.rows.length})`}else if(!S.kind){if(a){let R=k("label","fg-card-head"),A=k("input","fg-card-check fg-checkbox",{type:"checkbox","aria-label":h.selectRow});A.checked=f.has(S.id),A.disabled=!t.rowSelectable(S.data),R.append(A,document.createTextNode(`#${v+1}`)),C.append(R)}for(let R of i){let A=k("div","fg-card-line"),x=k("span","fg-card-label");x.textContent=(b=(y=R.def.header)!=null?y:R.def.field)!=null?b:R.id;let M=k("span","fg-card-value");M.dataset.col=R.id;let T=j(R.def,S.data),E=ee(R.def,h.code)(T);if(R.def.renderer)try{let L=R.def.renderer({value:T,formatted:E,row:S.data,rowIndex:v,column:R.def});typeof L=="string"?M.innerHTML=L:M.replaceChildren(L)}catch{M.textContent=E}else M.textContent=E;A.append(x,M),C.append(A)}}p.push(C)}r.replaceChildren(...p)}dropDetail(e){e===void 0?this.details.clear():this.details.delete(e)}renderedRange(){return this.lastRange}measureText(e,t){let n=getComputedStyle(this.main),r=parseFloat(getComputedStyle(this.root).getPropertyValue("--fg-font-size"))||13;this.measureCtx===void 0&&(this.measureCtx=document.createElement("canvas").getContext("2d"));let i=this.measureCtx;return i?(i.font=`${t?600:400} ${r}px ${n.fontFamily||"sans-serif"}`,i.measureText(e).width):e.length*r*.6}scrollToRow(e){this.scroller.scrollTop=this.rowTop(Math.max(0,Math.min(e,this.grid.rowModel.getRowCount())))}pageRows(){return Math.max(1,Math.floor(this.scroller.clientHeight/this.opts.rowHeight))}destroy(){var e;(e=this.filterRow)==null||e.destroy(),this.frame&&cancelAnimationFrame(this.frame),this.scroller.removeEventListener("scroll",this.onScroll),this.root.remove()}},Yn=class{constructor(e){this.key=null;let t=n=>({left:k("div",`${n} ${n}-left`),center:k("div",`${n} ${n}-center`),right:k("div",`${n} ${n}-right`)});this.el=k("div",e,{role:"rowgroup"}),this.panes=t("fg-section-pane"),this.inners=t("fg-section-inner");for(let n of re)this.panes[n].append(this.inners[n]),this.el.append(this.panes[n])}size(e,t,n){this.el.style.height=`${t}px`;for(let r of re){let i=e.regionWidth(r);r!=="center"&&(this.panes[r].style.width=`${i}px`,this.panes[r].hidden=i===0),this.inners[r].style.width=`${i}px`,this.inners[r].style.height=`${t}px`}this.panes.center.style.marginRight=`${n}px`}};function $r(o,e){return!!e&&o.length===e.length&&o.every((t,n)=>t===e[n])}var Nr="http://www.w3.org/2000/svg";function Vs(o,e,t,n){var m;let r=Math.max(20,t-16),i=Math.max(10,n-14),s=document.createElementNS(Nr,"svg");s.setAttribute("class","fg-sparkline"),s.setAttribute("width",String(r)),s.setAttribute("height",String(i)),s.setAttribute("viewBox",`0 0 ${r} ${i}`),s.setAttribute("aria-hidden","true");let a=(m=e.color)!=null?m:"var(--fg-accent)",l=e.type==="bar",c=o.reduce((y,b)=>Math.min(y,b),l?0:1/0),d=o.reduce((y,b)=>Math.max(y,b),l?0:-1/0);c===d&&(c-=1,d+=1);let u=d-c,f=y=>i-1-(y-c)/u*(i-2),h=(y,b)=>{let v=document.createElementNS(Nr,y);for(let[S,C]of Object.entries(b))v.setAttribute(S,String(C));return s.append(v),v};if(e.type==="bar"){let y=r/o.length;return o.forEach((b,v)=>h("rect",{x:v*y+1,y:Math.min(f(b),f(0)),width:Math.max(1,y-2),height:Math.max(1,Math.abs(f(b)-f(0))),fill:b<0?"#ef4444":a})),s}let p=o.length>1?(r-2)/(o.length-1):0,g=o.map((y,b)=>`${1+b*p},${f(y)}`).join(" ");e.type==="area"&&h("polygon",{points:`1,${i} ${g} ${1+(o.length-1)*p},${i}`,fill:a,"fill-opacity":.2}),h("polyline",{points:g,fill:"none",stroke:a,"stroke-width":1.5,"stroke-linejoin":"round"});let w=o.length-1;return h("circle",{cx:1+w*p,cy:f(o[w]),r:2,fill:a}),s}var qs=4,Vt=class{constructor(e){this.grid=e;this.onClick=e=>{var r;let t=e.target.closest(".fg-group-chip-remove"),n=(r=t==null?void 0:t.closest(".fg-group-chip"))==null?void 0:r.dataset.col;n&&this.grid.setGroupBy(this.grid.getGroupBy().filter(i=>i!==n))};this.onPointerDown=e=>{let t=e.target,n=t.closest(".fg-group-chip");if(e.button!==0||!n||t.closest("button"))return;let r=n.dataset.col,i=e.clientX,s=!1,a=c=>{!s&&Math.abs(c.clientX-i)<qs||(s=!0,n.classList.add("fg-dragging"))},l=c=>{if(window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",l),n.classList.remove("fg-dragging"),!s)return;let u=[...this.el.querySelectorAll(".fg-group-chip")].filter(h=>h!==n).filter(h=>{let p=h.getBoundingClientRect();return c.clientX>p.left+p.width/2}).length,f=this.grid.getGroupBy().filter(h=>h!==r);f.splice(u,0,r),this.grid.setGroupBy(f)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",l)};this.el=k("div","fg-group-panel",{role:"toolbar"}),e.renderer.main.insertBefore(this.el,e.renderer.gridEl),this.el.addEventListener("click",this.onClick),this.el.addEventListener("pointerdown",this.onPointerDown),this.refresh()}contains(e,t){let n=this.el.getBoundingClientRect();return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}highlight(e){this.el.classList.toggle("fg-group-panel-over",e)}refresh(){let{grid:e}=this,t=e.store.state.locale;this.el.setAttribute("aria-label",t.groupByThis);let n=e.getGroupBy();if(!n.length){let r=k("span","fg-group-hint");r.textContent=t.groupPanelHint,this.el.replaceChildren(r);return}this.el.replaceChildren(...n.map((r,i)=>{var d,u,f;let s=(d=e.columns.getNode(r))==null?void 0:d.def,a=k("span","fg-group-chip");a.dataset.col=r;let l=k("span","fg-group-chip-label");l.textContent=(f=(u=s==null?void 0:s.header)!=null?u:s==null?void 0:s.field)!=null?f:r;let c=k("button","fg-group-chip-remove",{type:"button","aria-label":`${t.ungroup}: ${l.textContent}`});if(c.textContent="\xD7",a.append(l,c),i<n.length-1){let h=k("span","fg-group-sep",{"aria-hidden":"true"});return h.textContent="\u203A",[a,h]}return[a]}).flat())}destroy(){this.el.removeEventListener("click",this.onClick),this.el.removeEventListener("pointerdown",this.onPointerDown),this.el.remove()}};var Ye=class{constructor(){this.listeners=new Map}on(e,t){let n=this.listeners.get(e);return n||this.listeners.set(e,n=new Set),n.add(t),()=>{n.delete(t)}}emit(e,t){let n=this.listeners.get(e);if(n)for(let r of[...n])try{r(t)}catch(i){console.error("[FreeGrid] event listener threw",i)}}clear(){this.listeners.clear()}};function oe(o){let e=o.getRootNode();return typeof ShadowRoot!="undefined"&&e instanceof ShadowRoot?e:document.body}function ht(o,e,t){var r;let n=o.getRootNode();return(r=typeof n.elementFromPoint=="function"?n.elementFromPoint(e,t):null)!=null?r:document.elementFromPoint(e,t)}function Or(o){var t;return(t=o.getRootNode().activeElement)!=null?t:document.activeElement}function ce(o,...e){let t=typeof o.composedPath=="function"?o.composedPath():[];return t.length?e.some(n=>!!n&&t.includes(n)):e.some(n=>!!n&&n.contains(o.target))}var Zn=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","Home","End","PageUp","PageDown"]);function Qn(o,e,t,n){let r=s=>Math.max(0,Math.min(n.rows-1,s)),i=s=>Math.max(0,Math.min(n.cols-1,s));switch(o){case"ArrowUp":return{rowIndex:r(t.rowIndex-1),colIndex:t.colIndex};case"ArrowDown":return{rowIndex:r(t.rowIndex+1),colIndex:t.colIndex};case"ArrowLeft":return{rowIndex:t.rowIndex,colIndex:i(t.colIndex-1)};case"ArrowRight":return{rowIndex:t.rowIndex,colIndex:i(t.colIndex+1)};case"PageUp":return{rowIndex:r(t.rowIndex-n.pageRows),colIndex:t.colIndex};case"PageDown":return{rowIndex:r(t.rowIndex+n.pageRows),colIndex:t.colIndex};case"Home":return{rowIndex:e.ctrl?0:t.rowIndex,colIndex:0};case"End":return{rowIndex:e.ctrl?n.rows-1:t.rowIndex,colIndex:n.cols-1};case"Tab":{let s=t.rowIndex*n.cols+t.colIndex+(e.shift?-1:1);return s<0||s>=n.rows*n.cols?null:{rowIndex:Math.floor(s/n.cols),colIndex:s%n.cols}}default:return null}}var qt=new Map,eo=new WeakMap,Br=o=>o?eo.get(o):void 0,Hr=o=>o?qt.get(o):void 0;var Ws={Enter:"edit",F2:"edit",Delete:"clear",Backspace:"clear","Ctrl+Z":"undo","Ctrl+Y":"redo","Ctrl+Shift+Z":"redo","Ctrl+F":"find"};function js(o){let e=[];return(o.ctrlKey||o.metaKey)&&e.push("Ctrl"),o.altKey&&e.push("Alt"),o.shiftKey&&o.key.length>1&&e.push("Shift"),o.shiftKey&&o.key.length===1&&(o.ctrlKey||o.metaKey)&&e.push("Shift"),e.push(o.key.length===1?o.key.toUpperCase():o.key),e.join("+")}var Us=3;function Ks(o,e){return o.renderer.rtl?e.key==="ArrowLeft"?"ArrowRight":e.key==="ArrowRight"?"ArrowLeft":e.key:e.key}function Gr(o){var A;let{renderer:e}=o,t=e.bodyEl,n=e.root,r=x=>Ks(o,x),i="mouse",s=0,a=!1,l=x=>{let M=e.cellAt(x.target);if(!M)return null;let T=o.rowModel.getRow(M.rowIndex),E=o.columns.getColumn(M.colId);if(!T||!E)return null;let L=H(E.id)?void 0:j(E.def,T.data);return{row:T.data,rowIndex:M.rowIndex,colId:M.colId,value:L,event:x}},c=x=>{var L,F;let M=(F=(L=x.target).closest)==null?void 0:F.call(L,".fg-group-toggle, .fg-tree-toggle, .fg-detail-toggle"),T=M&&e.cellAt(x.target);if(!T)return!1;e.gridEl.focus({preventScroll:!0}),o.setFocus(T.rowIndex,T.colId),o.setRange(null);let E=o.rowModel.getRow(T.rowIndex);return M.classList.contains("fg-detail-toggle")?o.setDetailExpanded(E.data,!o.isDetailExpanded(E.data)):o.toggleRow(T.rowIndex),!0},d=x=>{var D;if(c(x))return;let M=o.store.state.focus,T=e.cellAt(x.target);if(T&&((D=o.rowModel.getRow(T.rowIndex))!=null&&D.kind)){T.colId===le&&o.rowModel.getRow(T.rowIndex).kind==="group"&&o.toggleGroupSelection(o.rowModel.getRow(T.rowIndex)),e.gridEl.focus({preventScroll:!0}),o.setFocus(T.rowIndex,T.colId),o.setRange(null);return}let E=l(x);if(!E)return;if(e.gridEl.focus({preventScroll:!0}),E.colId===Re){let N=o.columns.displayed().filter(P=>!H(P.id));N.length&&(o.setFocus(E.rowIndex,N[0].id),o.rangesOn()&&o.setRange({start:{rowIndex:E.rowIndex,colId:N[0].id},end:{rowIndex:E.rowIndex,colId:N[N.length-1].id}}));return}let L=a;a=!1;let F=o.store.state.focus,$=E.colId===le;if(!L)if(x.shiftKey&&F&&!$&&!H(F.colId)&&o.rangesOn())o.setRange({start:F,end:{rowIndex:E.rowIndex,colId:E.colId}},!0);else if((x.ctrlKey||x.metaKey)&&!$&&!H(E.colId)&&o.rangesOn()){let N={rowIndex:E.rowIndex,colId:E.colId};o.addRange({start:N,end:N}),o.setFocus(E.rowIndex,E.colId)}else o.setFocus(E.rowIndex,E.colId),o.setRange(null);o.options.rowSelection&&!L&&($||o.options.rowClickSelection!==!1)&&o.selectFromClick(E.rowIndex,$||x.ctrlKey||x.metaKey,x.shiftKey),o.events.emit("cellClick",E),i==="touch"&&!L&&M&&M.rowIndex===E.rowIndex&&M.colId===E.colId&&o.editor.canEdit(E.rowIndex,E.colId)&&(o.columns.getColumn(E.colId).def.type==="boolean"?o.applyEdit(E.rowIndex,E.colId,E.value!==!0):o.editor.start(E.rowIndex,E.colId))},u=x=>{var F,$;if(($=(F=x.target).closest)!=null&&$.call(F,"button"))return;let M=e.cellAt(x.target),T=M&&o.rowModel.getRow(M.rowIndex);if((T==null?void 0:T.kind)==="group"){o.toggleRow(M.rowIndex);return}if(T!=null&&T.kind)return;let E=l(x);if(!E||(o.events.emit("cellDoubleClick",E),!o.editor.canEdit(E.rowIndex,E.colId)))return;o.columns.getColumn(E.colId).def.type==="boolean"?o.applyEdit(E.rowIndex,E.colId,E.value!==!0):o.editor.start(E.rowIndex,E.colId)},f={...Ws};for(let[x,M]of Object.entries((A=o.options.keymap)!=null?A:{}))f[x]=M===!1?"none":M;let h=x=>{var L,F;let M=o.store.state.focus,T=f[js(x)];if(T==="none")return!1;switch(T){case"edit":return!M||!o.editor.canEdit(M.rowIndex,M.colId)||o.columns.getColumn(M.colId).def.type==="boolean"?!1:(o.editor.start(M.rowIndex,M.colId),!0);case"clear":return o.clearCells(),!0;case"undo":return o.undo(),!0;case"redo":return o.redo(),!0;case"copy":return o.copyToClipboard(!1),!0;case"cut":return o.cutToClipboard(),!0;case"selectAll":return o.selectAllCells(),!0;case"find":return o.options.findBar===!1||!o.paid?!1:(o.finder.openBar(),!0);case"paste":return(F=(L=navigator.clipboard)==null?void 0:L.readText)==null||F.call(L).then($=>o.pasteText($),()=>{}),!0}if(!M||!o.editor.canEdit(M.rowIndex,M.colId))return!1;let E=o.columns.getColumn(M.colId).def;if(x.key===" "&&E.type==="boolean"&&!x.ctrlKey&&!x.metaKey){let $=o.rowModel.getRow(M.rowIndex).data;return o.applyEdit(M.rowIndex,M.colId,$[E.field]!==!0),!0}return x.key.length===1&&x.key!==" "&&!x.ctrlKey&&!x.metaKey&&!x.altKey&&E.type!=="boolean"?(o.editor.start(M.rowIndex,M.colId,x.key),!0):!1},p=x=>{var $,D,N;let M=o.store.state.focus;if(!M||x.ctrlKey||x.metaKey||x.altKey||x.shiftKey)return!1;let T=o.rowModel.getRow(M.rowIndex);if(!o.isExpandable(T))return!1;let E=T.kind==="group";if(!E&&M.colId!==(($=o.columns.displayed().find(P=>!H(P.id)))==null?void 0:$.id))return!1;let L=!!((N=(D=T.group)==null?void 0:D.expanded)!=null?N:T.expanded),F=o.expandKey(T);if(E&&(x.key==="Enter"||x.key===" "))o.setGroupExpanded(F,!L);else if(r(x)==="ArrowRight"&&!L)o.setGroupExpanded(F,!0);else if(r(x)==="ArrowLeft"&&L)o.setGroupExpanded(F,!1);else return!1;return!0},g=x=>{let M=e.cellAt(x.target);if(!M||M.colId!==Fe)return!1;x.preventDefault();let T=o.rowModel.getRow(M.rowIndex);if(!T||T.kind||!o.canMoveRows())return!0;let E=T.data,L=k("div","fg-row-drop-marker"),F=null;n.classList.add("fg-row-dragging");let $=N=>{var Y,pe;let P=ht(n,N.clientX,N.clientY),B=P==null?void 0:P.closest(".fg-root"),O=B===n?o:Hr(B),z=o.dragOptions.group;if(F=null,L.remove(),!O||!B||O!==o&&(!z||O.dragOptions.group!==z||!O.options.rowDrag))return;let V=P.closest(".fg-row[data-row]"),_=V==null?void 0:V.getBoundingClientRect(),J=null,I="after",G;if(V&&_){let ie=O.rowModel.getRow(Number(V.dataset.row));if(!ie||ie.kind==="group")return;J=(pe=(Y=ie.detailOf)==null?void 0:Y.data)!=null?pe:ie.data;let Q=(N.clientY-_.top)/_.height;ie.kind==="detail"?I="after":O.options.treeData?I=Q<.25?"before":Q>.75?"after":"inside":I=Q<.5?"before":"after",G=I==="before"?_.top:_.bottom}else{if(!P.closest(".fg-body"))return;let ie=B.querySelectorAll(".fg-body-pane-center .fg-row[data-row]");G=ie.length?Math.max(...[...ie].map(Q=>Q.getBoundingClientRect().bottom)):B.querySelector(".fg-body").getBoundingClientRect().top}if(!O.canDropRow(E,J,I,o))return;F={into:O,target:J,position:I};let X=B.getBoundingClientRect().top;L.classList.toggle("fg-row-drop-inside",I==="inside"),L.style.top=`${I==="inside"?_.top-X:G-X-1}px`,L.style.height=I==="inside"?`${_.height}px`:"",B.append(L)},D=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",D),window.removeEventListener("pointercancel",D),n.classList.remove("fg-row-dragging"),L.remove(),F&&F.into.dropRow(E,F.target,F.position,o)};return window.addEventListener("pointermove",$),window.addEventListener("pointerup",D),window.addEventListener("pointercancel",D),!0},w=x=>{let M=e.cellAt(x.target);if(!M)return;let T=x.clientX,E=x.clientY,L=()=>{clearTimeout(s),window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L)},F=$=>{Math.hypot($.clientX-T,$.clientY-E)>8&&L()};clearTimeout(s),s=window.setTimeout(()=>{L(),o.contextMenu.enabled()&&(a=!0,H(M.colId)||(o.setFocus(M.rowIndex,M.colId),o.rangeContains(M.rowIndex,M.colId)||o.setRange({start:M,end:M})),o.contextMenu.open(T,E,M.rowIndex,M.colId))},550),window.addEventListener("pointermove",F),window.addEventListener("pointerup",L),window.addEventListener("pointercancel",L)},m=x=>{if(i=x.pointerType||"mouse",i==="touch"){w(x);return}if(x.button===0&&g(x)||!o.rangesOn()||x.button!==0||x.shiftKey||x.target.closest("input, a, button"))return;let M=e.cellAt(x.target);if(!M||H(M.colId))return;let T=x.clientX,E=x.clientY,L=x.ctrlKey||x.metaKey,F=!1,$=N=>{if(!F&&Math.hypot(N.clientX-T,N.clientY-E)<Us)return;let P=e.cellAt(ht(n,N.clientX,N.clientY));!P||H(P.colId)||(F||(F=!0,n.classList.add("fg-range-dragging"),L&&o.addRange({start:M,end:M}),o.setFocus(M.rowIndex,M.colId)),o.setRange({start:M,end:P},L))},D=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",D),n.classList.remove("fg-range-dragging"),F&&(a=!0)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",D)},y=x=>{var B,O;if(x.target!==n&&x.target!==e.gridEl)return;let M=o.columns.displayed(),T=o.rowModel.getRowCount();if(!M.length||!T)return;if(p(x)){x.preventDefault();return}if(h(x)){x.preventDefault();return}let E=o.store.state.focus,L=x.ctrlKey||x.metaKey;if(x.key==="Escape"&&o.store.state.range){x.preventDefault(),o.setRange(null);return}if(L&&x.key.toLowerCase()==="a"&&o.rangesOn()){x.preventDefault(),o.selectAllCells();return}if(x.key==="ContextMenu"||x.key==="F10"&&x.shiftKey){x.preventDefault(),o.contextMenu.openAtFocus();return}if(x.key===" "&&E&&o.options.rowSelection){x.preventDefault(),o.selectFromClick(Math.min(E.rowIndex,T-1),!0,x.shiftKey);return}let F={rows:T,cols:M.length,pageRows:e.pageRows()},$=M.findIndex(z=>!H(z.id));if(o.rangesOn()&&x.shiftKey&&x.key!=="Tab"&&Zn.has(x.key)){let z=E!=null?E:{rowIndex:0,colId:M[$].id},V=o.store.state.range,_=(B=V==null?void 0:V.end)!=null?B:z,J={rowIndex:Math.min(_.rowIndex,T-1),colIndex:Math.max(0,M.findIndex(X=>X.id===_.colId))},I=Qn(r(x),{ctrl:L,shift:!1},J,F);if(!I)return;x.preventDefault();let G=M[Math.max($,I.colIndex)].id;E||o.setFocus(z.rowIndex,z.colId),o.setRange({start:(O=V==null?void 0:V.start)!=null?O:z,end:{rowIndex:I.rowIndex,colId:G}}),e.ensureVisible(I.rowIndex,G);return}let N;if(!E)N=Zn.has(x.key)&&x.key!=="Tab"?{rowIndex:0,colIndex:0}:null;else{let z=Math.max(0,M.findIndex(V=>V.id===E.colId));N=Qn(r(x),{ctrl:L,shift:x.shiftKey},{rowIndex:Math.min(E.rowIndex,T-1),colIndex:z},F)}if(!N)return;x.preventDefault();let P=M[N.colIndex].id;o.setFocus(N.rowIndex,P),o.setRange(null),e.ensureVisible(N.rowIndex,P)},b=x=>{var M,T;return(T=(M=x.target)==null?void 0:M.closest)==null?void 0:T.call(M,".fg-editor, input, textarea, select, [contenteditable]")},v=x=>{var M,T;return((T=(M=x.target)==null?void 0:M.closest)==null?void 0:T.call(M,".fg-root"))!==n},S=x=>{if(b(x)||v(x))return;let M=o.selectionTSV(!1);!M||!x.clipboardData||(x.clipboardData.setData("text/plain",M),x.preventDefault())},C=x=>{if(b(x)||v(x))return;let M=o.selectionTSV(!1);!M||!x.clipboardData||(x.clipboardData.setData("text/plain",M),x.preventDefault(),o.clearCells(!0))},R=x=>{var T;if(b(x)||v(x))return;let M=(T=x.clipboardData)==null?void 0:T.getData("text/plain");M&&(x.preventDefault(),o.pasteText(M))};return t.addEventListener("click",d),t.addEventListener("dblclick",u),t.addEventListener("pointerdown",m),n.addEventListener("keydown",y),n.addEventListener("copy",S),n.addEventListener("paste",R),n.addEventListener("cut",C),()=>{t.removeEventListener("click",d),t.removeEventListener("dblclick",u),t.removeEventListener("pointerdown",m),n.removeEventListener("keydown",y),n.removeEventListener("copy",S),n.removeEventListener("paste",R),n.removeEventListener("cut",C)}}var Wt=class{constructor(e){this.grid=e;this.open=new Set;this.el=k("div","fg-filters-panel")}refresh(){var l,c;let{grid:e}=this,t=e.store.state.locale,n=e.store.state.filters,r=k("div","fg-filters-head"),i=k("span","fg-filters-title");i.textContent=t.filters;let s=k("button","fg-btn fg-filters-clear",{type:"button"});s.textContent=t.clearFilters,s.disabled=!Object.keys(n).length,s.addEventListener("click",()=>{for(let d of Object.keys(e.store.state.filters))e.setFilter(d,null)}),r.append(i,s);let a=k("div","fg-filters-list");for(let d of e.columns.displayed()){if(H(d.id)||!ue(d.def))continue;let u=k("details",n[d.id]?"fg-filters-item fg-filter-on":"fg-filters-item");u.dataset.col=d.id,u.open=this.open.has(d.id);let f=k("summary");f.textContent=(c=(l=d.def.header)!=null?l:d.def.field)!=null?c:d.id,u.append(f);let h=()=>{if(u.querySelector(".fg-filter"))return;let p=e.menu.filterSection(d.id,()=>{});p&&u.append(p)};u.open&&h(),u.addEventListener("toggle",()=>{u.open?(this.open.add(d.id),h()):this.open.delete(d.id)}),a.append(u)}this.el.replaceChildren(r,a)}};var _s=["sum","avg","min","max","count"],jt=class{constructor(e){this.grid=e;this.draft={rows:[],columns:[],values:[]};this.el=k("div","fg-pivot-panel")}apply(){this.grid.getPivot()?this.grid.setPivot(this.draft):this.refresh()}refresh(){var c;let{grid:e}=this,t=e.store.state.locale,n=e.getPivot();n&&(this.draft={rows:[...n.rows],columns:[...(c=n.columns)!=null?c:[]],values:n.values.map(d=>({colId:d.colId,aggFunc:typeof d.aggFunc=="string"?d.aggFunc:"sum"}))});let r=e.sourceLeaves(),i=d=>{var f,h,p;let u=(f=r.find(g=>g.id===d))==null?void 0:f.def;return(p=(h=u==null?void 0:u.header)!=null?h:u==null?void 0:u.field)!=null?p:d},s=k("label","fg-pivot-mode"),a=k("input","fg-checkbox",{type:"checkbox"});a.checked=!!n,a.addEventListener("click",()=>e.setPivot(a.checked?this.draft:null)),s.append(a,document.createTextNode(t.pivotMode));let l=(d,u)=>{let f=k("div","fg-pivot-zone");f.dataset.zone=d;let h=k("div","fg-pivot-zone-title");h.textContent=u;let p=k("div","fg-pivot-chips"),g=d==="values"?this.draft.values.map(y=>y.colId):this.draft[d];g.forEach((y,b)=>{let v=k("span","fg-group-chip");v.dataset.col=y;let S=k("span","fg-group-chip-label");if(S.textContent=i(y),v.append(S),d==="values"){let R=k("select","fg-pivot-agg",{"aria-label":`${i(y)} ${t.pivotValues}`});for(let A of _s){let x=k("option");x.value=A,x.textContent=t[A],R.append(x)}R.value=this.draft.values[b].aggFunc,R.addEventListener("change",()=>{this.draft.values[b].aggFunc=R.value,this.apply()}),v.append(R)}let C=k("button","fg-group-chip-remove",{type:"button","aria-label":`${t.ungroup}: ${i(y)}`});C.textContent="\xD7",C.addEventListener("click",()=>{d==="values"?this.draft.values.splice(b,1):this.draft[d].splice(b,1),this.apply()}),v.append(C),p.append(v)});let w=k("select","fg-pivot-add",{"aria-label":`${u}: ${t.addColumn}`}),m=k("option");m.value="",m.textContent=t.addColumn,w.append(m);for(let y of r){if(g.includes(y.id)||d==="values"&&y.def.type!=="number")continue;let b=k("option");b.value=y.id,b.textContent=i(y.id),w.append(b)}return w.addEventListener("change",()=>{w.value&&(d==="values"?this.draft.values.push({colId:w.value,aggFunc:"sum"}):this.draft[d].push(w.value),this.apply())}),f.append(h,p,w),f};this.el.replaceChildren(s,l("rows",t.pivotRows),l("columns",t.pivotColumns),l("values",t.pivotValues))}};var Xs=4,Ut=o=>!H(o.id)&&(o.children?o.children.some(Ut):o.def.chooser!==!1),to=o=>{var e,t;return(t=(e=o.def.header)!=null?e:o.def.field)!=null?t:o.id},Kt=class{constructor(e){this.grid=e;this.collapsed=new Set;this.el=k("div","fg-chooser"),this.search=k("input","fg-input fg-chooser-search",{type:"search"});let t=k("label","fg-chooser-all");this.allBox=k("input","fg-checkbox",{type:"checkbox"}),this.allText=k("span"),t.append(this.allBox,this.allText),this.list=k("div","fg-chooser-list",{role:"tree"}),this.el.append(this.search,t,this.list),this.search.addEventListener("input",()=>this.refresh()),this.allBox.addEventListener("change",()=>this.setVisible(this.matchingLeaves(),this.allBox.checked)),this.list.addEventListener("change",n=>{let r=n.target,i=this.nodeOf(r);i&&this.setVisible(this.leavesOf(i),r.checked)}),this.list.addEventListener("click",n=>{let r=n.target.closest(".fg-chooser-caret"),i=r&&this.nodeOf(r);i&&(this.collapsed.has(i.id)?this.collapsed.delete(i.id):this.collapsed.add(i.id),this.refresh())}),this.list.addEventListener("pointerdown",n=>this.onPointerDown(n)),this.refresh()}refresh(){let e=this.grid.store.state.locale;this.search.placeholder=e.search,this.search.setAttribute("aria-label",e.search),this.allText.textContent=e.selectAll;let t=this.query(),n=[],r=(a,l)=>{for(let c of a)!Ut(c)||t&&!this.subtreeMatches(c,t)||(n.push(this.item(c,l)),c.children&&(t||!this.collapsed.has(c.id))&&r(c.children,l+1))};r(this.grid.columns.roots(),0),this.list.replaceChildren(...n);let i=this.matchingLeaves(),s=i.filter(a=>!a.hide).length;this.allBox.checked=i.length>0&&s===i.length,this.allBox.indeterminate=s>0&&s<i.length}query(){return this.search.value.trim().toLowerCase()}subtreeMatches(e,t){for(let n=e;n;n=n.parent)if(to(n).toLowerCase().includes(t))return!0;return!!e.children&&e.children.some(n=>Ut(n)&&this.subtreeMatches(n,t))}leavesOf(e){return Ut(e)?e.children?e.children.flatMap(t=>this.leavesOf(t)):[e]:[]}matchingLeaves(){let e=this.query(),t=this.grid.columns.roots().flatMap(n=>this.leavesOf(n));return e?t.filter(n=>this.subtreeMatches(n,e)):t}nodeOf(e){var n;let t=(n=e.closest(".fg-chooser-item"))==null?void 0:n.dataset.col;return t?this.grid.columns.getNode(t):void 0}setVisible(e,t){this.grid.setColumnsVisible(e.filter(n=>!n.def.lockVisible).map(n=>n.id),t)}item(e,t){let n=k("div",e.children?"fg-chooser-item fg-chooser-group":"fg-chooser-item",{role:"treeitem"});n.dataset.col=e.id,n.style.paddingLeft=`${6+t*16}px`;let r=k("span","fg-chooser-handle",{"aria-hidden":"true"});if(r.textContent="\u22EE\u22EE",n.append(r),e.children){let c=!this.collapsed.has(e.id),d=k("button","fg-chooser-caret",{type:"button",tabindex:"-1","aria-hidden":"true"});d.textContent=c?"\u25BE":"\u25B8",n.setAttribute("aria-expanded",String(c)),n.append(d)}let i=this.leavesOf(e),s=i.filter(c=>!c.hide).length,a=k("input","fg-checkbox",{type:"checkbox","aria-label":to(e)});a.checked=i.length>0&&s===i.length,a.indeterminate=s>0&&s<i.length,a.disabled=i.every(c=>c.def.lockVisible);let l=k("span","fg-chooser-label");if(l.textContent=to(e),n.append(a,l),!e.children&&e.pinned){let c=k("span","fg-chooser-pin");c.textContent=e.pinned==="left"?"\u21E4":"\u21E5",n.append(c)}return n}onPointerDown(e){let t=e.target.closest(".fg-chooser-handle"),n=t==null?void 0:t.closest(".fg-chooser-item"),r=n&&this.nodeOf(n);if(!n||!r||e.button!==0)return;e.preventDefault();let i=new Set(this.grid.columns.siblings(r.id).map(h=>h.id).filter(h=>h!==r.id)),s=[...this.list.querySelectorAll(".fg-chooser-item")].filter(h=>i.has(h.dataset.col)),a=e.clientY,l=!1,c=-1,d=k("div","fg-chooser-marker"),u=h=>{if(!l){if(Math.abs(h.clientY-a)<Xs||!s.length)return;l=!0,n.classList.add("fg-dragging"),this.list.append(d)}c=s.filter(w=>{let m=w.getBoundingClientRect();return h.clientY>m.top+m.height/2}).length;let p=this.list.getBoundingClientRect().top-this.list.scrollTop,g=c<s.length?s[c].getBoundingClientRect().top:s[s.length-1].getBoundingClientRect().bottom;d.style.top=`${g-p-1}px`},f=()=>{if(window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",f),d.remove(),n.classList.remove("fg-dragging"),!l||c<0)return;let h=this.grid.columns.siblings(r.id).map(w=>w.id).filter(w=>w!==r.id),p=c<s.length?h.indexOf(s[c].dataset.col):h.indexOf(s[s.length-1].dataset.col)+1;p=Math.max(h.filter(H).length,p);let g=this.grid.columns.siblings(r.id).findIndex(w=>w.id===r.id);p!==g&&(this.grid.columns.move(r.id,p),this.grid.layoutChanged(),this.grid.events.emit("columnMove",{colId:r.id,toIndex:p}))};window.addEventListener("pointermove",u),window.addEventListener("pointerup",f)}},_t=class{constructor(e){this.grid=e;this.popup=null;this.panel=null;this.off=[]}get isOpen(){return!!this.popup}open(){this.close();let e=this.grid.store.state.locale,t=k("div",`fg-menu fg-chooser-dialog fg-theme-${this.grid.store.state.theme}`,{role:"dialog","aria-label":e.chooseColumns});this.grid.applyFontTo(t);let n=k("div","fg-chooser-head"),r=k("span","fg-menu-title");r.textContent=e.chooseColumns;let i=k("button","fg-chooser-close",{type:"button","aria-label":e.close});i.textContent="\xD7",i.addEventListener("click",()=>this.close()),n.append(r,i),this.panel=new Kt(this.grid),t.append(n,this.panel.el),oe(this.grid.renderer.root).append(t);let s=this.grid.renderer.root.getBoundingClientRect(),a=t.offsetWidth||280;t.style.left=`${Math.max(4,Math.min(s.right-a-8,window.innerWidth-a-4))}px`,t.style.top=`${Math.max(4,s.top+8)}px`,this.popup=t;let l=d=>{ce(d,t)||this.close()},c=d=>{d.key==="Escape"&&this.close()};document.addEventListener("pointerdown",l,!0),document.addEventListener("keydown",c,!0),this.off.push(()=>document.removeEventListener("pointerdown",l,!0),()=>document.removeEventListener("keydown",c,!0)),t.querySelector(".fg-chooser-search").focus()}refresh(){var e;(e=this.panel)==null||e.refresh()}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null,this.panel=null}},Xt=class{constructor(e,t,n=["columns","filters"]){this.grid=e;this.tabs=new Map;this.el=k("div","fg-sidebar"),this.panelHost=k("div","fg-sidebar-panel"),this.columns=new Kt(e),this.filters=new Wt(e),this.pivot=new jt(e);let r=n.filter(s=>s==="columns"||s==="filters"||s==="pivot");r.length||r.push("columns"),this.current=r[0];let i=k("div","fg-sidebar-tabs",{role:"tablist"});for(let s of r){let a=k("button","fg-sidebar-tab",{type:"button",role:"tab"});a.dataset.panel=s,a.addEventListener("click",()=>this.toggle(!(this.isOpen&&this.current===s),s)),this.tabs.set(s,a),i.append(a)}this.el.append(this.panelHost,i),e.renderer.root.append(this.el),this.panelHost.hidden=!t,this.show(),this.refresh()}get isOpen(){return!this.panelHost.hidden}show(){this.panelHost.replaceChildren(this.current==="filters"?this.filters.el:this.current==="pivot"?this.pivot.el:this.columns.el)}toggle(e=!this.isOpen,t){t&&this.tabs.has(t)&&t!==this.current&&(this.current=t,this.show()),this.panelHost.hidden=!e,this.syncTabs(),this.grid.renderer.invalidate({header:!0,rows:!0})}syncTabs(){this.el.classList.toggle("fg-sidebar-open",this.isOpen);for(let[e,t]of this.tabs){let n=this.isOpen&&e===this.current;t.setAttribute("aria-expanded",String(n)),t.setAttribute("aria-selected",String(n))}}refresh(){let e=this.grid.store.state.locale;for(let[t,n]of this.tabs)n.textContent=t==="filters"?e.filters:t==="pivot"?e.pivot:e.columns;this.syncTabs(),this.columns.refresh(),this.filters.refresh(),this.pivot.refresh()}};var Js=()=>typeof navigator!="undefined"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent||""),Ze=o=>Js()?`\u2318${o}`:`Ctrl+${o}`,Jt=class{constructor(e){this.grid=e;this.popup=null;this.off=[];let t=e.renderer.root,n=r=>this.onContextMenu(r);t.addEventListener("contextmenu",n),this.detach=()=>t.removeEventListener("contextmenu",n)}destroy(){this.close(),this.detach()}enabled(){return this.grid.options.contextMenu!==!1&&this.grid.allow("contextMenu")}onContextMenu(e){let{grid:t}=this;if(t.options.contextMenu===!1)return;let n=e.target,r=n.closest(".fg-header-cell");if(r){let s=r.dataset.col;if(!s||H(s)||r.classList.contains("fg-header-group"))return;e.preventDefault(),this.close(),t.menu.open(s,r);return}let i=t.renderer.cellAt(n);!i||!this.enabled()||(e.preventDefault(),t.renderer.gridEl.focus({preventScroll:!0}),!H(i.colId)&&!t.rangeContains(i.rowIndex,i.colId)&&(t.setFocus(i.rowIndex,i.colId),t.setRange({start:i,end:i})),this.open(e.clientX,e.clientY,i.rowIndex,i.colId))}openAtFocus(){var i;let e=this.grid.store.state.focus;if(!e||!this.enabled())return;let t=this.grid.renderer.root.getBoundingClientRect(),n=this.grid.renderer.root.querySelector(`.fg-row[data-row="${e.rowIndex}"] .fg-cell[data-col="${CSS.escape(e.colId)}"]`),r=(i=n==null?void 0:n.getBoundingClientRect())!=null?i:t;this.open(r.left+8,r.bottom,e.rowIndex,e.colId)}defaultItems(e){var c;let{grid:t}=this,n=t.store.state.locale,r=t.columns.getNode(e),i=r==null?void 0:r.def,s=!!i&&!H(e),a=[{label:n.copy,shortcut:Ze("C"),action:()=>t.copyToClipboard(!1)},{label:n.copyWithHeaders,action:()=>t.copyToClipboard(!0)},{label:n.cut,shortcut:Ze("X"),action:()=>t.cutToClipboard()},...t.store.state.selected.size?[{label:n.copyRows,action:()=>t.copyToClipboard(!1,!0)}]:[],{label:n.paste,shortcut:Ze("V"),action:()=>this.pasteFromClipboard()}];(t.history.canUndo()||t.history.canRedo())&&a.push("separator",{label:n.undo,shortcut:Ze("Z"),action:()=>t.undo(),disabled:!t.history.canUndo()},{label:n.redo,shortcut:Ze("Y"),action:()=>t.redo(),disabled:!t.history.canRedo()}),t.options.rowSelection&&t.store.state.selected.size&&a.push({label:n.deleteRows,action:()=>t.api.removeSelectedRows()}),s&&(a.push("separator",{label:n.autosizeThis,action:()=>t.autoSize([e])}),i.lockVisible||a.push({label:n.hideColumn,action:()=>t.setColumnsVisible([e],!1)}),a.push({label:n.pinLeft,action:()=>t.setPinned(e,"left"),disabled:r.pinned==="left"},{label:n.pinRight,action:()=>t.setPinned(e,"right"),disabled:r.pinned==="right"},{label:n.unpin,action:()=>t.setPinned(e,null),disabled:!r.pinned})),a.push("separator"),t.options.rowSelection==="multiple"&&a.push({label:n.selectAllRows,action:()=>t.api.selectAll()}),a.push({label:n.chooseColumns,action:()=>t.chooser.open()});let l=t.rangeBounds();return l&&(l.r2>l.r1||l.c2>l.c1)&&t.paid&&a.push("separator",{label:n.chartBar,action:()=>t.api.createChart({type:"bar"})},{label:n.chartLine,action:()=>t.api.createChart({type:"line"})},{label:n.chartPie,action:()=>t.api.createChart({type:"pie"})}),a.push("separator",{label:n.exportCsv,action:()=>t.api.exportCsv()},...t.paid?[{label:n.exportExcel,action:()=>t.api.exportXlsx()}]:[],{label:n.exportJson,action:()=>t.api.exportJson()},...(c=t.options.assistant)!=null&&c.url&&t.paid?[{label:`${n.ai.title}\u2026`,action:()=>t.api.openAssistant()}]:[],...t.paid?[{label:n.exportPdf,action:()=>t.api.exportPdf()}]:[]),t.options.advancedFilter!==!1&&!t.options.pivot&&t.paid&&a.push("separator",{label:`${n.advancedFilter}\u2026`,action:()=>t.filterBuilder.open()}),a.push("separator",{label:n.print,action:()=>t.api.print()}),a}pasteFromClipboard(){let e=typeof navigator!="undefined"?navigator.clipboard:void 0,t=()=>this.grid.toast(this.grid.store.state.locale.pasteHint.replace("Ctrl+V",Ze("V")));if(!(e!=null&&e.readText))return t();e.readText().then(n=>this.grid.pasteText(n),t)}open(e,t,n,r){var v,S,C;this.close(),this.grid.menu.close();let{grid:i}=this,s=i.rowModel.getRow(n),a=i.columns.getColumn(r),l=this.defaultItems(r),c={row:(v=s==null?void 0:s.data)!=null?v:null,rowIndex:n,colId:r,value:s&&a&&!H(r)?j(a.def,s.data):void 0,defaultItems:l},d=i.options.contextMenu,u=l;if(typeof d=="function")try{u=d(c)}catch{u=l}let f=i.store.state.locale,h=k("div",`fg-menu fg-context-menu fg-theme-${i.store.state.theme}`,{role:"menu","aria-label":f.columnMenu});i.applyFontTo(h);let p=!0;for(let R of u){if(R==="separator"){p||h.append(k("div","fg-cm-sep",{role:"separator"})),p=!0;continue}let A=k("button","fg-menu-item fg-cm-item",{type:"button",role:"menuitem"}),x=k("span","fg-cm-label");if(x.textContent=R.label,A.append(x),R.shortcut){let M=k("span","fg-cm-shortcut");M.textContent=R.shortcut,A.append(M)}A.disabled=!!R.disabled,A.addEventListener("click",()=>{this.close(),R.action()}),h.append(A),p=!1}(S=h.lastElementChild)!=null&&S.classList.contains("fg-cm-sep")&&h.lastElementChild.remove(),oe(this.grid.renderer.root).append(h);let g=h.offsetWidth||220,w=h.offsetHeight||300;h.style.left=`${Math.max(4,Math.min(e,window.innerWidth-g-4))}px`,h.style.top=`${Math.max(4,Math.min(t,window.innerHeight-w-4))}px`,this.popup=h;let m=R=>{ce(R,h)||this.close()},y=R=>{if(R.key==="Escape"){this.close(),i.renderer.gridEl.focus();return}if(R.key!=="ArrowDown"&&R.key!=="ArrowUp")return;let A=[...h.querySelectorAll("button:not(:disabled)")],x=A.indexOf(Or(h)),M=A[(x+(R.key==="ArrowDown"?1:A.length-1)+A.length)%A.length];M==null||M.focus(),R.preventDefault()},b=()=>this.close();document.addEventListener("pointerdown",m,!0),document.addEventListener("keydown",y,!0),i.renderer.scroller.addEventListener("scroll",b,{passive:!0}),this.off.push(()=>document.removeEventListener("pointerdown",m,!0),()=>document.removeEventListener("keydown",y,!0),()=>i.renderer.scroller.removeEventListener("scroll",b)),(C=h.querySelector("button:not(:disabled)"))==null||C.focus()}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var Yt=class{constructor(e){this.grid=e;this.onDown=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=this.source();if(!t)return;let{grid:n}=this,r=null,i=n.renderer.root,s=l=>{let c=n.renderer.cellAt(ht(n.renderer.root,l.clientX,l.clientY)),d=c&&n.columns.getColumn(c.colId);if(!c||!d||H(d.id))return;let u=c.rowIndex>t.r2?c.rowIndex-t.r2:c.rowIndex<t.r1?c.rowIndex-t.r1:0,f=d.index>t.c2?d.index-t.c2:d.index<t.c1?d.index-t.c1:0;!u&&!f?r=null:Math.abs(u)>=Math.abs(f)?r={r1:Math.min(t.r1,c.rowIndex),r2:Math.max(t.r2,c.rowIndex),c1:t.c1,c2:t.c2}:r={r1:t.r1,r2:t.r2,c1:Math.min(t.c1,d.index),c2:Math.max(t.c2,d.index)},this.showPreview(r)},a=()=>{if(window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",a),this.preview.remove(),i.classList.remove("fg-range-dragging"),!r)return;let l=n.columns.displayed();n.fillRange({start:{rowIndex:r.r1,colId:l[r.c1].id},end:{rowIndex:r.r2,colId:l[r.c2].id}})};i.classList.add("fg-range-dragging"),window.addEventListener("pointermove",s),window.addEventListener("pointerup",a)};this.handle=k("div","fg-fill-handle",{"aria-hidden":"true"}),this.preview=k("div","fg-fill-preview",{"aria-hidden":"true"}),this.handle.addEventListener("pointerdown",this.onDown)}enabled(){return this.grid.options.fillHandle!==!1&&this.grid.rangesOn()}source(){let e=this.grid.rangeBounds();if(e)return e;let t=this.grid.store.state.focus,n=t&&this.grid.columns.getColumn(t.colId);return!t||!n||H(n.id)?null:{r1:t.rowIndex,r2:t.rowIndex,c1:n.index,c2:n.index}}cellEl(e,t){let n=this.grid.columns.displayed()[t];return n?this.grid.renderer.root.querySelector(`.fg-body .fg-row[data-row="${e}"] .fg-cell[data-col="${CSS.escape(n.id)}"]`):null}update(){let e=this.enabled()?this.source():null,t=this.grid.columns.displayed(),r=!!e&&t.slice(e.c1,e.c2+1).some(a=>a.def.editable&&a.def.field)&&e?this.cellEl(e.r2,e.c2):null;if(!r){this.handle.remove();return}let i=this.grid.renderer.root.getBoundingClientRect(),s=r.getBoundingClientRect();this.handle.style.left=`${(this.grid.renderer.rtl?s.left:s.right)-i.left-4}px`,this.handle.style.top=`${s.bottom-i.top-4}px`,this.handle.isConnected||this.grid.renderer.root.append(this.handle)}showPreview(e){let t=e&&this.cellEl(e.r1,e.c1),n=e&&this.cellEl(e.r2,e.c2);if(!t||!n){this.preview.remove();return}let r=this.grid.renderer.root.getBoundingClientRect(),i=t.getBoundingClientRect(),s=n.getBoundingClientRect();Object.assign(this.preview.style,{left:`${i.left-r.left}px`,top:`${i.top-r.top}px`,width:`${s.right-i.left}px`,height:`${s.bottom-i.top}px`}),this.preview.isConnected||this.grid.renderer.root.append(this.preview)}destroy(){this.handle.remove(),this.preview.remove()}};var Zt=1e4,Qt=class{constructor(e){this.grid=e;this.matches=[];this.lookup=new Map;this.index=-1;this.query="";this.bar=null;this.countEl=null}get active(){return!!this.query}classFor(e,t){if(!this.query)return"";let n=this.lookup.get(`${e}|${t}`);return n===void 0?"":n===this.index?" fg-cell-match fg-cell-match-current":" fg-cell-match"}find(e){if(this.query=e.trim().toLowerCase(),this.matches=[],this.lookup.clear(),this.index=-1,this.query){let t=this.grid.rowModel.rows(),n=this.scanner();for(let r=0;r<t.length&&this.matches.length<Zt;r++)n(r,this.matches);this.matches.length=Math.min(this.matches.length,Zt),this.reindex(),this.matches.length&&this.go(0)}return this.updateCount(),this.grid.renderer.invalidate({rows:!0}),this.matches.length}scanner(){let{grid:e}=this,t=e.store.state.locale.code,n=e.columns.displayed().filter(s=>!H(s.id)),r=n.map(s=>ee(s.def,t)),i=e.rowModel.rows();return(s,a)=>{let l=i[s];if(!(!l||l.kind))for(let c=0;c<n.length;c++)r[c](j(n[c].def,l.data)).toLowerCase().includes(this.query)&&a.push({rowIndex:s,colId:n[c].id})}}reindex(){this.lookup.clear(),this.matches.forEach((e,t)=>this.lookup.set(`${e.rowIndex}|${e.colId}`,t))}refreshRows(e){if(!this.query)return;if(this.matches.length>=Zt)return this.refresh();let{rowModel:t}=this.grid,n=new Set;for(let h of e){let p=t.indexOfId(h);p>=0&&n.add(p)}if(!n.size)return;let r=this.matches[this.index],i=this.scanner(),s=[];for(let h of n)i(h,s);let a=this.matches.length,l=this.matches.filter(h=>n.has(h.rowIndex)),c=h=>h.map(p=>`${p.rowIndex}|${p.colId}`).sort().join(",");if(c(l)===c(s))return;let d=new Map(this.grid.columns.displayed().map((h,p)=>[h.id,p]));this.matches=[...this.matches.filter(h=>!n.has(h.rowIndex)),...s].sort((h,p)=>{var g,w;return h.rowIndex-p.rowIndex||((g=d.get(h.colId))!=null?g:0)-((w=d.get(p.colId))!=null?w:0)}).slice(0,Zt),this.reindex();let u=r?this.lookup.get(`${r.rowIndex}|${r.colId}`):void 0,f=this.index;u!==void 0?this.index=u:this.matches.length?this.index=Math.min(Math.max(this.index,0),this.matches.length-1):this.index=-1,(a!==this.matches.length||f!==this.index||u===void 0)&&this.updateCount(),this.grid.renderer.invalidate({rows:!0})}refresh(){this.query&&this.find(this.query)}next(){this.matches.length&&this.go((this.index+1)%this.matches.length)}previous(){this.matches.length&&this.go((this.index-1+this.matches.length)%this.matches.length)}clear(){this.query="",this.matches=[],this.lookup.clear(),this.index=-1,this.grid.renderer.invalidate({rows:!0})}go(e){this.index=e;let t=this.matches[e];this.grid.setFocus(t.rowIndex,t.colId),this.grid.renderer.ensureVisible(t.rowIndex,t.colId),this.updateCount(),this.grid.renderer.invalidate({rows:!0})}updateCount(){if(!this.countEl)return;let e=this.grid.store.state.locale;this.countEl.textContent=this.query?this.matches.length?`${this.index+1}/${this.matches.length}`:e.noMatches:""}openBar(){if(this.grid.options.findBar===!1||!this.grid.paid)return;if(this.bar){this.bar.querySelector("input").focus();return}let e=this.grid.store.state.locale,t=k("div","fg-findbar",{role:"search"}),n=k("input","fg-input",{type:"search",placeholder:e.findPlaceholder,"aria-label":e.findPlaceholder});this.countEl=k("span","fg-findbar-count",{"aria-live":"polite"});let r=(i,s,a)=>{let l=k("button","fg-findbar-btn",{type:"button","aria-label":i,title:i});return l.textContent=s,l.addEventListener("click",a),l};t.append(n,this.countEl,r(e.findPrevious,"\u2191",()=>this.previous()),r(e.findNext,"\u2193",()=>this.next()),r(e.close,"\xD7",()=>this.closeBar())),n.addEventListener("input",()=>this.find(n.value)),t.addEventListener("keydown",i=>{i.stopPropagation(),i.key==="Escape"?(i.preventDefault(),this.closeBar()):i.key==="Enter"&&(i.preventDefault(),i.shiftKey?this.previous():this.next())}),this.grid.renderer.root.append(t),this.bar=t,n.focus()}closeBar(){var e;(e=this.bar)==null||e.remove(),this.bar=null,this.countEl=null,this.clear(),this.grid.renderer.gridEl.focus({preventScroll:!0})}};var Ys=864e5;function mt(o,e){if(!o.length||e<=0)return[];let t=()=>Array.from({length:e},(i,s)=>o[s%o.length]);if(o.every(i=>typeof i=="number"&&!Number.isNaN(i))){let i=o;if(i.length===1)return t();let s=i[1]-i[0];if(!i.every((l,c)=>c===0||Math.abs(l-i[c-1]-s)<1e-9))return t();let a=i[i.length-1];return Array.from({length:e},(l,c)=>Math.round((a+s*(c+1))*1e12)/1e12)}let n=o.map(i=>i instanceof Date||typeof i=="string"&&/^\d{4}-\d{2}-\d{2}/.test(i)?me(i):null);if(n.every(Boolean)&&o.length>=2){let i=n.map(a=>Math.round(a.getTime()/Ys)),s=i[1]-i[0];if(i.every((a,l)=>l===0||a-i[l-1]===s)){let a=n[n.length-1],l=o[o.length-1]instanceof Date;return Array.from({length:e},(c,d)=>{let u=new Date(a.getFullYear(),a.getMonth(),a.getDate()+s*(d+1));return l?u:se(u)})}return t()}let r=o[o.length-1];if(typeof r=="string"&&!U(r)&&o.every(i=>typeof i=="string")){let i=/^(.*?)(\d+)$/.exec(r);if(i){let s=i[2].length,a=Number(i[2]);return Array.from({length:e},(l,c)=>`${i[1]}${String(a+c+1).padStart(s,"0")}`)}}return t()}function no(o){let e=t=>/[\t\n\r"]/.test(t)?`"${t.replace(/"/g,'""')}"`:t;return o.map(t=>t.map(e).join(" ")).join(`\r
1
+ "use strict";var FreeGrid=(()=>{var On=Object.defineProperty;var ns=Object.getOwnPropertyDescriptor;var os=Object.getOwnPropertyNames;var rs=Object.prototype.hasOwnProperty;var is=(o,e)=>{for(var t in e)On(o,t,{get:e[t],enumerable:!0})},ss=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of os(e))!rs.call(o,r)&&r!==t&&On(o,r,{get:()=>e[r],enumerable:!(n=ns(e,r))||n.enumerable});return o};var as=o=>ss(On({},"__esModule",{value:!0}),o);var Tl={};is(Tl,{buildWorkbook:()=>$o,changeTracker:()=>Hi,connectLive:()=>es,createGrid:()=>Ki,csrfHeaders:()=>Zi,en:()=>he,evaluateFormula:()=>Bt,exportWorkbook:()=>_i,formulaFunctions:()=>kr,loadData:()=>Yi,locales:()=>ts,messageToTransaction:()=>Ho,parseCsv:()=>hn,readXlsx:()=>wn,registerFormulaFunction:()=>Cr,registerLocale:()=>Et,renderChart:()=>Rn,resolveLocale:()=>st,restDatasource:()=>Bo,saveChanges:()=>Ji,setLicenseKey:()=>Mi,verifyLicense:()=>Mo,version:()=>je,writeXlsx:()=>Ve});var ls={code:"en",noRows:"No rows to show",filter:"Filter",apply:"Apply",reset:"Reset",selectAll:"(Select all)",search:"Search\u2026",blanks:"(Blanks)",value:"Value",valueTo:"To",sortAsc:"Sort ascending",sortDesc:"Sort descending",clearSort:"Clear sort",pinLeft:"Pin left",pinRight:"Pin right",unpin:"Unpin",columnMenu:"Column menu",selectRow:"Select row",selectAllRows:"Select all rows",chooseColumns:"Choose columns",columns:"Columns",autosizeThis:"Autosize this column",autosizeAll:"Autosize all columns",resetColumns:"Reset columns",hideColumn:"Hide column",close:"Close",copy:"Copy",cut:"Cut",copyWithHeaders:"Copy with headers",paste:"Paste",pasteHint:"Clipboard access was blocked. Press Ctrl+V to paste.",required:"This field is required",invalidValue:"Invalid value",and:"And",or:"Or",advancedFilter:"Advanced filter",addCondition:"Add condition",duplicate:"This value is already used",undo:"Undo",redo:"Redo",deleteRows:"Delete selected rows",copyRows:"Copy selected rows",statusRows:"{n} rows",statusFiltered:"{shown} of {total} rows",statusSelected:"{n} selected",count:"Count",sum:"Sum",avg:"Average",min:"Min",max:"Max",findPlaceholder:"Find in grid",noMatches:"No matches",findNext:"Next match",findPrevious:"Previous match",groupPanelHint:"Drag a column header here to group rows",groupByThis:"Group by this column",ungroup:"Remove grouping",expandAll:"Expand all",collapseAll:"Collapse all",pagerRange:"{from}\u2013{to} of {total}",pageOf:"Page {page} of {pages}",pageSize:"Rows per page",firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",loading:"Loading\u2026",loadFailed:"Could not load rows",filters:"Filters",clearFilters:"Clear all filters",exportCsv:"Export CSV",exportExcel:"Export Excel",print:"Print\u2026",printLimited:"Printed the first {n} of {total} rows. Export to Excel or CSV for all of them.",pivot:"Pivot",pivotMode:"Pivot mode",pivotRows:"Row groups",pivotColumns:"Column labels",pivotValues:"Values",total:"Total",addColumn:"Add a column\u2026",chartBar:"Bar chart",chartStacked:"Stacked bar chart",chartLine:"Line chart",chartArea:"Area chart",chartPie:"Pie chart",chartDonut:"Donut chart",chartCombo:"Bar and line chart",chartScatter:"Scatter chart",freeBadge:"Free version",exportPdf:"Export PDF",exportJson:"Export JSON",ai:{title:"AI assistant",placeholder:"Ask about the data or tell the grid what to do",send:"Send",thinking:"Working\u2026",undo:"Undo",undone:"Undone",failed:"The assistant did not answer",skipped:"Skipped",done:"Done"},cf:{title:"Conditional formatting",add:"Add rule",clear:"Clear rules",none:"No rules for this column",type:"Rule",style:"Format",wholeRow:"Whole row",count:"Count",types:{value:"Cell value",formula:"Formula",top:"Top",bottom:"Bottom",aboveAverage:"Above average",belowAverage:"Below average",duplicate:"Duplicate values",unique:"Unique values",dataBar:"Data bars",colorScale:"Color scale",iconSet:"Icon set"},ops:{notBetween:"Not between",notContains:"Does not contain"},styles:{red:"Light red fill",yellow:"Yellow fill",green:"Green fill",blue:"Blue fill",redText:"Red text",bold:"Bold"}},ops:{contains:"Contains",equals:"Equals",notEquals:"Does not equal",startsWith:"Starts with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",eq:"Equals",ne:"Does not equal",lt:"Less than",lte:"Less than or equal",gt:"Greater than",gte:"Greater than or equal",between:"Between",before:"Before",after:"After"}},he=ls;var Vo=new Set;function V(o){Vo.has(o)||(Vo.add(o),console.warn(`[FreeGrid] ${o}`))}var Fe=new Map([["en",he]]);function Et(o){Fe.set(o.code,o)}function qo(o){let e=o.toLowerCase();for(let n of Fe.keys())if(n.toLowerCase()===e)return n;let t=e.split("-")[0];if(t==="zh"){if(/-(tw|hk|mo|hant)(-|$)/.test(e)&&Fe.has("zh-TW"))return"zh-TW";if(Fe.has("zh-CN"))return"zh-CN"}for(let n of Fe.keys())if(n.toLowerCase().split("-")[0]===t)return n}function ds(){var o;return typeof navigator=="undefined"?[]:(o=navigator.languages)!=null&&o.length?navigator.languages:navigator.language?[navigator.language]:[]}function cs(o){var e,t;return{...he,...o,code:(e=o.code)!=null?e:"en",ops:{...he.ops,...(t=o.ops)!=null?t:{}}}}function st(o,e=ds()){if(o&&typeof o=="object")return cs(o);if(typeof o=="string"){let t=qo(o);return t?Fe.get(t):(V(`locale "${o}" is not registered \u2014 import it from "@freegridjs/core/locales/${o}" and pass the pack (or call registerLocale). Falling back to "en".`),he)}for(let t of e){let n=qo(t);if(n)return Fe.get(n)}return he}var us={code:"de",noRows:"Keine Zeilen vorhanden",filter:"Filter",apply:"Anwenden",reset:"Zur\xFCcksetzen",selectAll:"(Alle ausw\xE4hlen)",search:"Suchen\u2026",blanks:"(Leer)",value:"Wert",valueTo:"Bis",sortAsc:"Aufsteigend sortieren",sortDesc:"Absteigend sortieren",clearSort:"Sortierung aufheben",pinLeft:"Links fixieren",pinRight:"Rechts fixieren",unpin:"Fixierung l\xF6sen",columnMenu:"Spaltenmen\xFC",selectRow:"Zeile ausw\xE4hlen",selectAllRows:"Alle Zeilen ausw\xE4hlen",chooseColumns:"Spalten ausw\xE4hlen",columns:"Spalten",autosizeThis:"Diese Spalte automatisch anpassen",autosizeAll:"Alle Spalten automatisch anpassen",resetColumns:"Spalten zur\xFCcksetzen",hideColumn:"Spalte ausblenden",close:"Schlie\xDFen",copy:"Kopieren",cut:"Ausschneiden",copyWithHeaders:"Mit \xDCberschriften kopieren",paste:"Einf\xFCgen",pasteHint:"Der Browser hat die Zwischenablage blockiert. Dr\xFCcken Sie Ctrl+V zum Einf\xFCgen.",required:"Dieses Feld ist erforderlich",invalidValue:"Ung\xFCltiger Wert",and:"Und",or:"Oder",advancedFilter:"Erweiterter Filter",addCondition:"Bedingung hinzuf\xFCgen",duplicate:"Dieser Wert wird bereits verwendet",undo:"R\xFCckg\xE4ngig",redo:"Wiederholen",deleteRows:"Ausgew\xE4hlte Zeilen l\xF6schen",copyRows:"Ausgew\xE4hlte Zeilen kopieren",statusRows:"{n} Zeilen",statusFiltered:"{shown} von {total} Zeilen",statusSelected:"{n} ausgew\xE4hlt",count:"Anzahl",sum:"Summe",avg:"Mittelwert",min:"Min",max:"Max",findPlaceholder:"Im Raster suchen",noMatches:"Keine Treffer",findNext:"N\xE4chster Treffer",findPrevious:"Vorheriger Treffer",groupPanelHint:"Spalten\xFCberschrift hierher ziehen, um zu gruppieren",groupByThis:"Nach dieser Spalte gruppieren",ungroup:"Gruppierung aufheben",expandAll:"Alle aufklappen",collapseAll:"Alle zuklappen",pagerRange:"{from}\u2013{to} von {total}",pageOf:"Seite {page} von {pages}",pageSize:"Zeilen pro Seite",firstPage:"Erste Seite",previousPage:"Vorherige Seite",nextPage:"N\xE4chste Seite",lastPage:"Letzte Seite",loading:"Wird geladen\u2026",loadFailed:"Zeilen konnten nicht geladen werden",filters:"Filter",clearFilters:"Alle Filter entfernen",exportCsv:"Als CSV exportieren",exportExcel:"Nach Excel exportieren",print:"Drucken\u2026",printLimited:"Die ersten {n} von {total} Zeilen wurden gedruckt. F\xFCr alle Zeilen nach Excel oder CSV exportieren.",pivot:"Pivot",pivotMode:"Pivot-Modus",pivotRows:"Zeilengruppen",pivotColumns:"Spaltenbeschriftungen",pivotValues:"Werte",total:"Gesamt",addColumn:"Spalte hinzuf\xFCgen\u2026",chartBar:"Balkendiagramm",chartStacked:"Gestapelte Balken",chartLine:"Liniendiagramm",chartArea:"Fl\xE4chendiagramm",chartPie:"Kreisdiagramm",chartDonut:"Ringdiagramm",chartCombo:"Balken- und Liniendiagramm",chartScatter:"Streudiagramm",freeBadge:"Kostenlose Version",exportPdf:"Als PDF exportieren",exportJson:"Als JSON exportieren",ai:{title:"KI-Assistent",placeholder:"Fragen Sie zu den Daten oder sagen Sie der Tabelle, was sie tun soll",send:"Senden",thinking:"Wird bearbeitet\u2026",undo:"R\xFCckg\xE4ngig",undone:"R\xFCckg\xE4ngig gemacht",failed:"Der Assistent hat nicht geantwortet",skipped:"\xDCbersprungen",done:"Fertig"},cf:{title:"Bedingte Formatierung",add:"Regel hinzuf\xFCgen",clear:"Regeln l\xF6schen",none:"Keine Regeln f\xFCr diese Spalte",type:"Regel",style:"Format",wholeRow:"Ganze Zeile",count:"Anzahl",types:{value:"Zellwert",formula:"Formel",top:"Obere",bottom:"Untere",aboveAverage:"\xDCber dem Durchschnitt",belowAverage:"Unter dem Durchschnitt",duplicate:"Doppelte Werte",unique:"Eindeutige Werte",dataBar:"Datenbalken",colorScale:"Farbskala",iconSet:"Symbolsatz"},ops:{notBetween:"Nicht zwischen",notContains:"Enth\xE4lt nicht"},styles:{red:"Hellrote F\xFCllung",yellow:"Gelbe F\xFCllung",green:"Gr\xFCne F\xFCllung",blue:"Blaue F\xFCllung",redText:"Roter Text",bold:"Fett"}},ops:{contains:"Enth\xE4lt",equals:"Gleich",notEquals:"Ungleich",startsWith:"Beginnt mit",endsWith:"Endet mit",blank:"Leer",notBlank:"Nicht leer",eq:"Gleich",ne:"Ungleich",lt:"Kleiner als",lte:"Kleiner oder gleich",gt:"Gr\xF6\xDFer als",gte:"Gr\xF6\xDFer oder gleich",between:"Zwischen",before:"Vor",after:"Nach"}},Wo=us;var fs={code:"es",noRows:"No hay filas para mostrar",filter:"Filtro",apply:"Aplicar",reset:"Restablecer",selectAll:"(Seleccionar todo)",search:"Buscar\u2026",blanks:"(Vac\xEDos)",value:"Valor",valueTo:"Hasta",sortAsc:"Orden ascendente",sortDesc:"Orden descendente",clearSort:"Quitar orden",pinLeft:"Fijar a la izquierda",pinRight:"Fijar a la derecha",unpin:"Desfijar",columnMenu:"Men\xFA de columna",selectRow:"Seleccionar fila",selectAllRows:"Seleccionar todas las filas",chooseColumns:"Elegir columnas",columns:"Columnas",autosizeThis:"Ajustar esta columna",autosizeAll:"Ajustar todas las columnas",resetColumns:"Restablecer columnas",hideColumn:"Ocultar columna",close:"Cerrar",copy:"Copiar",cut:"Cortar",copyWithHeaders:"Copiar con encabezados",paste:"Pegar",pasteHint:"El navegador bloque\xF3 el portapapeles. Pulsa Ctrl+V para pegar.",required:"Este campo es obligatorio",invalidValue:"Valor no v\xE1lido",and:"Y",or:"O",advancedFilter:"Filtro avanzado",addCondition:"A\xF1adir condici\xF3n",duplicate:"Este valor ya est\xE1 en uso",undo:"Deshacer",redo:"Rehacer",deleteRows:"Eliminar filas seleccionadas",copyRows:"Copiar filas seleccionadas",statusRows:"{n} filas",statusFiltered:"{shown} de {total} filas",statusSelected:"{n} seleccionadas",count:"Recuento",sum:"Suma",avg:"Promedio",min:"M\xEDn.",max:"M\xE1x.",findPlaceholder:"Buscar en la tabla",noMatches:"Sin coincidencias",findNext:"Siguiente",findPrevious:"Anterior",groupPanelHint:"Arrastre aqu\xED un encabezado de columna para agrupar",groupByThis:"Agrupar por esta columna",ungroup:"Quitar agrupaci\xF3n",expandAll:"Expandir todo",collapseAll:"Contraer todo",pagerRange:"{from}\u2013{to} de {total}",pageOf:"P\xE1gina {page} de {pages}",pageSize:"Filas por p\xE1gina",firstPage:"Primera p\xE1gina",previousPage:"P\xE1gina anterior",nextPage:"P\xE1gina siguiente",lastPage:"\xDAltima p\xE1gina",loading:"Cargando\u2026",loadFailed:"No se pudieron cargar las filas",filters:"Filtros",clearFilters:"Quitar todos los filtros",exportCsv:"Exportar CSV",exportExcel:"Exportar a Excel",print:"Imprimir\u2026",printLimited:"Se imprimieron las primeras {n} de {total} filas. Exporte a Excel o CSV para obtenerlas todas.",pivot:"Tabla din\xE1mica",pivotMode:"Modo tabla din\xE1mica",pivotRows:"Grupos de filas",pivotColumns:"Etiquetas de columna",pivotValues:"Valores",total:"Total",addColumn:"A\xF1adir columna\u2026",chartBar:"Gr\xE1fico de barras",chartStacked:"Barras apiladas",chartLine:"Gr\xE1fico de l\xEDneas",chartArea:"Gr\xE1fico de \xE1reas",chartPie:"Gr\xE1fico circular",chartDonut:"Gr\xE1fico de anillo",chartCombo:"Gr\xE1fico de barras y l\xEDneas",chartScatter:"Gr\xE1fico de dispersi\xF3n",freeBadge:"Versi\xF3n gratuita",exportPdf:"Exportar PDF",exportJson:"Exportar JSON",ai:{title:"Asistente de IA",placeholder:"Pregunte por los datos o diga a la tabla qu\xE9 hacer",send:"Enviar",thinking:"Procesando\u2026",undo:"Deshacer",undone:"Deshecho",failed:"El asistente no respondi\xF3",skipped:"Omitido",done:"Hecho"},cf:{title:"Formato condicional",add:"A\xF1adir regla",clear:"Borrar reglas",none:"No hay reglas para esta columna",type:"Regla",style:"Formato",wholeRow:"Fila completa",count:"Cantidad",types:{value:"Valor de celda",formula:"F\xF3rmula",top:"Superiores",bottom:"Inferiores",aboveAverage:"Por encima del promedio",belowAverage:"Por debajo del promedio",duplicate:"Valores duplicados",unique:"Valores \xFAnicos",dataBar:"Barras de datos",colorScale:"Escala de color",iconSet:"Conjunto de iconos"},ops:{notBetween:"No est\xE1 entre",notContains:"No contiene"},styles:{red:"Relleno rojo claro",yellow:"Relleno amarillo",green:"Relleno verde",blue:"Relleno azul",redText:"Texto rojo",bold:"Negrita"}},ops:{contains:"Contiene",equals:"Igual a",notEquals:"Distinto de",startsWith:"Empieza por",endsWith:"Termina en",blank:"Vac\xEDo",notBlank:"No vac\xEDo",eq:"Igual a",ne:"Distinto de",lt:"Menor que",lte:"Menor o igual que",gt:"Mayor que",gte:"Mayor o igual que",between:"Entre",before:"Antes de",after:"Despu\xE9s de"}},jo=fs;var ps={code:"fr",noRows:"Aucune ligne \xE0 afficher",filter:"Filtre",apply:"Appliquer",reset:"R\xE9initialiser",selectAll:"(Tout s\xE9lectionner)",search:"Rechercher\u2026",blanks:"(Vides)",value:"Valeur",valueTo:"\xC0",sortAsc:"Tri croissant",sortDesc:"Tri d\xE9croissant",clearSort:"Annuler le tri",pinLeft:"\xC9pingler \xE0 gauche",pinRight:"\xC9pingler \xE0 droite",unpin:"D\xE9s\xE9pingler",columnMenu:"Menu de colonne",selectRow:"S\xE9lectionner la ligne",selectAllRows:"S\xE9lectionner toutes les lignes",chooseColumns:"Choisir les colonnes",columns:"Colonnes",autosizeThis:"Ajuster cette colonne",autosizeAll:"Ajuster toutes les colonnes",resetColumns:"R\xE9initialiser les colonnes",hideColumn:"Masquer la colonne",close:"Fermer",copy:"Copier",cut:"Couper",copyWithHeaders:"Copier avec les en-t\xEAtes",paste:"Coller",pasteHint:"Le navigateur a bloqu\xE9 le presse-papiers. Appuyez sur Ctrl+V pour coller.",required:"Ce champ est obligatoire",invalidValue:"Valeur non valide",and:"Et",or:"Ou",advancedFilter:"Filtre avanc\xE9",addCondition:"Ajouter une condition",duplicate:"Cette valeur est d\xE9j\xE0 utilis\xE9e",undo:"Annuler",redo:"R\xE9tablir",deleteRows:"Supprimer les lignes s\xE9lectionn\xE9es",copyRows:"Copier les lignes s\xE9lectionn\xE9es",statusRows:"{n} lignes",statusFiltered:"{shown} sur {total} lignes",statusSelected:"{n} s\xE9lectionn\xE9es",count:"Nombre",sum:"Somme",avg:"Moyenne",min:"Min",max:"Max",findPlaceholder:"Rechercher dans la grille",noMatches:"Aucun r\xE9sultat",findNext:"Suivant",findPrevious:"Pr\xE9c\xE9dent",groupPanelHint:"Faites glisser un en-t\xEAte de colonne ici pour regrouper",groupByThis:"Regrouper par cette colonne",ungroup:"Supprimer le regroupement",expandAll:"Tout d\xE9velopper",collapseAll:"Tout r\xE9duire",pagerRange:"{from}\u2013{to} sur {total}",pageOf:"Page {page} sur {pages}",pageSize:"Lignes par page",firstPage:"Premi\xE8re page",previousPage:"Page pr\xE9c\xE9dente",nextPage:"Page suivante",lastPage:"Derni\xE8re page",loading:"Chargement\u2026",loadFailed:"Impossible de charger les lignes",filters:"Filtres",clearFilters:"Effacer tous les filtres",exportCsv:"Exporter en CSV",exportExcel:"Exporter vers Excel",print:"Imprimer\u2026",printLimited:"Les {n} premi\xE8res lignes sur {total} ont \xE9t\xE9 imprim\xE9es. Exportez vers Excel ou CSV pour toutes les avoir.",pivot:"Tableau crois\xE9",pivotMode:"Mode tableau crois\xE9",pivotRows:"Groupes de lignes",pivotColumns:"\xC9tiquettes de colonnes",pivotValues:"Valeurs",total:"Total",addColumn:"Ajouter une colonne\u2026",chartBar:"Histogramme",chartStacked:"Histogramme empil\xE9",chartLine:"Courbes",chartArea:"Aires",chartPie:"Secteurs",chartDonut:"Graphique en anneau",chartCombo:"Graphique barres et lignes",chartScatter:"Nuage de points",freeBadge:"Version gratuite",exportPdf:"Exporter en PDF",exportJson:"Exporter en JSON",ai:{title:"Assistant IA",placeholder:"Posez une question sur les donn\xE9es ou dites \xE0 la grille quoi faire",send:"Envoyer",thinking:"En cours\u2026",undo:"Annuler",undone:"Annul\xE9",failed:"L'assistant n'a pas r\xE9pondu",skipped:"Ignor\xE9",done:"Termin\xE9"},cf:{title:"Mise en forme conditionnelle",add:"Ajouter une r\xE8gle",clear:"Effacer les r\xE8gles",none:"Aucune r\xE8gle pour cette colonne",type:"R\xE8gle",style:"Format",wholeRow:"Ligne enti\xE8re",count:"Nombre",types:{value:"Valeur de la cellule",formula:"Formule",top:"Premiers",bottom:"Derniers",aboveAverage:"Au-dessus de la moyenne",belowAverage:"En dessous de la moyenne",duplicate:"Valeurs en double",unique:"Valeurs uniques",dataBar:"Barres de donn\xE9es",colorScale:"Nuances de couleurs",iconSet:"Jeu d'ic\xF4nes"},ops:{notBetween:"Pas entre",notContains:"Ne contient pas"},styles:{red:"Remplissage rouge clair",yellow:"Remplissage jaune",green:"Remplissage vert",blue:"Remplissage bleu",redText:"Texte rouge",bold:"Gras"}},ops:{contains:"Contient",equals:"\xC9gal \xE0",notEquals:"Diff\xE9rent de",startsWith:"Commence par",endsWith:"Se termine par",blank:"Vide",notBlank:"Non vide",eq:"\xC9gal \xE0",ne:"Diff\xE9rent de",lt:"Inf\xE9rieur \xE0",lte:"Inf\xE9rieur ou \xE9gal \xE0",gt:"Sup\xE9rieur \xE0",gte:"Sup\xE9rieur ou \xE9gal \xE0",between:"Entre",before:"Avant",after:"Apr\xE8s"}},Uo=ps;var hs={code:"ja",noRows:"\u8868\u793A\u3059\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",filter:"\u30D5\u30A3\u30EB\u30BF\u30FC",apply:"\u9069\u7528",reset:"\u30EA\u30BB\u30C3\u30C8",selectAll:"(\u3059\u3079\u3066\u9078\u629E)",search:"\u691C\u7D22\u2026",blanks:"(\u7A7A\u767D)",value:"\u5024",valueTo:"\u7D42\u4E86\u5024",sortAsc:"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048",sortDesc:"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048",clearSort:"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664",pinLeft:"\u5DE6\u306B\u56FA\u5B9A",pinRight:"\u53F3\u306B\u56FA\u5B9A",unpin:"\u56FA\u5B9A\u3092\u89E3\u9664",columnMenu:"\u5217\u30E1\u30CB\u30E5\u30FC",selectRow:"\u884C\u3092\u9078\u629E",selectAllRows:"\u3059\u3079\u3066\u306E\u884C\u3092\u9078\u629E",chooseColumns:"\u5217\u3092\u9078\u629E",columns:"\u5217",autosizeThis:"\u3053\u306E\u5217\u306E\u5E45\u3092\u81EA\u52D5\u8ABF\u6574",autosizeAll:"\u3059\u3079\u3066\u306E\u5217\u306E\u5E45\u3092\u81EA\u52D5\u8ABF\u6574",resetColumns:"\u5217\u3092\u30EA\u30BB\u30C3\u30C8",hideColumn:"\u5217\u3092\u975E\u8868\u793A",close:"\u9589\u3058\u308B",copy:"\u30B3\u30D4\u30FC",cut:"\u5207\u308A\u53D6\u308A",copyWithHeaders:"\u30D8\u30C3\u30C0\u30FC\u4ED8\u304D\u3067\u30B3\u30D4\u30FC",paste:"\u8CBC\u308A\u4ED8\u3051",pasteHint:"\u30D6\u30E9\u30A6\u30B6\u30FC\u304C\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u30D6\u30ED\u30C3\u30AF\u3057\u307E\u3057\u305F\u3002Ctrl+V \u3067\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002",required:"\u3053\u306E\u9805\u76EE\u306F\u5FC5\u9808\u3067\u3059",invalidValue:"\u7121\u52B9\u306A\u5024\u3067\u3059",and:"\u304B\u3064",or:"\u307E\u305F\u306F",advancedFilter:"\u8A73\u7D30\u30D5\u30A3\u30EB\u30BF\u30FC",addCondition:"\u6761\u4EF6\u3092\u8FFD\u52A0",duplicate:"\u3053\u306E\u5024\u306F\u3059\u3067\u306B\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059",undo:"\u5143\u306B\u623B\u3059",redo:"\u3084\u308A\u76F4\u3057",deleteRows:"\u9078\u629E\u3057\u305F\u884C\u3092\u524A\u9664",copyRows:"\u9078\u629E\u3057\u305F\u884C\u3092\u30B3\u30D4\u30FC",statusRows:"{n} \u884C",statusFiltered:"{total} \u884C\u4E2D {shown} \u884C",statusSelected:"{n} \u4EF6\u9078\u629E",count:"\u30C7\u30FC\u30BF\u306E\u500B\u6570",sum:"\u5408\u8A08",avg:"\u5E73\u5747",min:"\u6700\u5C0F",max:"\u6700\u5927",findPlaceholder:"\u30B0\u30EA\u30C3\u30C9\u5185\u3092\u691C\u7D22",noMatches:"\u4E00\u81F4\u306A\u3057",findNext:"\u6B21\u3092\u691C\u7D22",findPrevious:"\u524D\u3092\u691C\u7D22",groupPanelHint:"\u5217\u898B\u51FA\u3057\u3092\u3053\u3053\u306B\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30B0\u30EB\u30FC\u30D7\u5316",groupByThis:"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316",ungroup:"\u30B0\u30EB\u30FC\u30D7\u5316\u3092\u89E3\u9664",expandAll:"\u3059\u3079\u3066\u5C55\u958B",collapseAll:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u3080",pagerRange:"{total} \u4EF6\u4E2D {from}\u2013{to} \u4EF6",pageOf:"{pages} \u30DA\u30FC\u30B8\u4E2D {page} \u30DA\u30FC\u30B8",pageSize:"1 \u30DA\u30FC\u30B8\u306E\u884C\u6570",firstPage:"\u6700\u521D\u306E\u30DA\u30FC\u30B8",previousPage:"\u524D\u306E\u30DA\u30FC\u30B8",nextPage:"\u6B21\u306E\u30DA\u30FC\u30B8",lastPage:"\u6700\u5F8C\u306E\u30DA\u30FC\u30B8",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",loadFailed:"\u884C\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",filters:"\u30D5\u30A3\u30EB\u30BF\u30FC",clearFilters:"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u89E3\u9664",exportCsv:"CSV \u306B\u66F8\u304D\u51FA\u3059",exportExcel:"Excel \u306B\u66F8\u304D\u51FA\u3059",print:"\u5370\u5237\u2026",printLimited:"\u5168 {total} \u884C\u306E\u3046\u3061\u6700\u521D\u306E {n} \u884C\u306E\u307F\u5370\u5237\u3057\u307E\u3057\u305F\u3002\u3059\u3079\u3066\u306E\u884C\u306F Excel \u307E\u305F\u306F CSV \u306B\u66F8\u304D\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002",pivot:"\u30D4\u30DC\u30C3\u30C8",pivotMode:"\u30D4\u30DC\u30C3\u30C8\u30E2\u30FC\u30C9",pivotRows:"\u884C\u30B0\u30EB\u30FC\u30D7",pivotColumns:"\u5217\u30E9\u30D9\u30EB",pivotValues:"\u5024",total:"\u5408\u8A08",addColumn:"\u5217\u3092\u8FFD\u52A0\u2026",chartBar:"\u68D2\u30B0\u30E9\u30D5",chartStacked:"\u7A4D\u307F\u4E0A\u3052\u68D2\u30B0\u30E9\u30D5",chartLine:"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chartArea:"\u9762\u30B0\u30E9\u30D5",chartPie:"\u5186\u30B0\u30E9\u30D5",chartDonut:"\u30C9\u30FC\u30CA\u30C4\u30B0\u30E9\u30D5",chartCombo:"\u68D2\u30FB\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chartScatter:"\u6563\u5E03\u56F3",freeBadge:"\u7121\u6599\u7248\u3092\u4F7F\u7528\u4E2D",exportPdf:"PDF \u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",exportJson:"JSON \u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",ai:{title:"AI \u30A2\u30B7\u30B9\u30BF\u30F3\u30C8",placeholder:"\u30C7\u30FC\u30BF\u306B\u3064\u3044\u3066\u8CEA\u554F\u3059\u308B\u304B\u3001\u30B0\u30EA\u30C3\u30C9\u3078\u306E\u6307\u793A\u3092\u5165\u529B",send:"\u9001\u4FE1",thinking:"\u51E6\u7406\u4E2D\u2026",undo:"\u5143\u306B\u623B\u3059",undone:"\u5143\u306B\u623B\u3057\u307E\u3057\u305F",failed:"\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u304B\u3089\u5FDC\u7B54\u304C\u3042\u308A\u307E\u305B\u3093",skipped:"\u30B9\u30AD\u30C3\u30D7",done:"\u5B8C\u4E86"},cf:{title:"\u6761\u4EF6\u4ED8\u304D\u66F8\u5F0F",add:"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0",clear:"\u30EB\u30FC\u30EB\u3092\u30AF\u30EA\u30A2",none:"\u3053\u306E\u5217\u306B\u30EB\u30FC\u30EB\u306F\u3042\u308A\u307E\u305B\u3093",type:"\u30EB\u30FC\u30EB",style:"\u66F8\u5F0F",wholeRow:"\u884C\u5168\u4F53",count:"\u4EF6\u6570",types:{value:"\u30BB\u30EB\u306E\u5024",formula:"\u6570\u5F0F",top:"\u4E0A\u4F4D",bottom:"\u4E0B\u4F4D",aboveAverage:"\u5E73\u5747\u3088\u308A\u4E0A",belowAverage:"\u5E73\u5747\u3088\u308A\u4E0B",duplicate:"\u91CD\u8907\u3059\u308B\u5024",unique:"\u4E00\u610F\u306E\u5024",dataBar:"\u30C7\u30FC\u30BF\u30D0\u30FC",colorScale:"\u30AB\u30E9\u30FC\u30B9\u30B1\u30FC\u30EB",iconSet:"\u30A2\u30A4\u30B3\u30F3\u30BB\u30C3\u30C8"},ops:{notBetween:"\u7BC4\u56F2\u5916",notContains:"\u542B\u307E\u306A\u3044"},styles:{red:"\u8584\u3044\u8D64\u306E\u5857\u308A\u3064\u3076\u3057",yellow:"\u9EC4\u8272\u306E\u5857\u308A\u3064\u3076\u3057",green:"\u7DD1\u306E\u5857\u308A\u3064\u3076\u3057",blue:"\u9752\u306E\u5857\u308A\u3064\u3076\u3057",redText:"\u8D64\u306E\u6587\u5B57",bold:"\u592A\u5B57"}},ops:{contains:"\u542B\u3080",equals:"\u7B49\u3057\u3044",notEquals:"\u7B49\u3057\u304F\u306A\u3044",startsWith:"\u3067\u59CB\u307E\u308B",endsWith:"\u3067\u7D42\u308F\u308B",blank:"\u7A7A\u767D",notBlank:"\u7A7A\u767D\u4EE5\u5916",eq:"\u7B49\u3057\u3044",ne:"\u7B49\u3057\u304F\u306A\u3044",lt:"\u3088\u308A\u5C0F\u3055\u3044",lte:"\u4EE5\u4E0B",gt:"\u3088\u308A\u5927\u304D\u3044",gte:"\u4EE5\u4E0A",between:"\u7BC4\u56F2\u5185",before:"\u3088\u308A\u524D",after:"\u3088\u308A\u5F8C"}},Ko=hs;var ms={code:"ko",noRows:"\uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",filter:"\uD544\uD130",apply:"\uC801\uC6A9",reset:"\uCD08\uAE30\uD654",selectAll:"(\uC804\uCCB4 \uC120\uD0DD)",search:"\uAC80\uC0C9\u2026",blanks:"(\uBE48 \uAC12)",value:"\uAC12",valueTo:"\uB05D \uAC12",sortAsc:"\uC624\uB984\uCC28\uC21C \uC815\uB82C",sortDesc:"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C",clearSort:"\uC815\uB82C \uD574\uC81C",pinLeft:"\uC67C\uCABD \uACE0\uC815",pinRight:"\uC624\uB978\uCABD \uACE0\uC815",unpin:"\uACE0\uC815 \uD574\uC81C",columnMenu:"\uCEEC\uB7FC \uBA54\uB274",selectRow:"\uD589 \uC120\uD0DD",selectAllRows:"\uC804\uCCB4 \uD589 \uC120\uD0DD",chooseColumns:"\uCEEC\uB7FC \uC120\uD0DD",columns:"\uCEEC\uB7FC",autosizeThis:"\uC774 \uCEEC\uB7FC \uB108\uBE44 \uC790\uB3D9 \uB9DE\uCDA4",autosizeAll:"\uBAA8\uB4E0 \uCEEC\uB7FC \uB108\uBE44 \uC790\uB3D9 \uB9DE\uCDA4",resetColumns:"\uCEEC\uB7FC \uCD08\uAE30\uD654",hideColumn:"\uCEEC\uB7FC \uC228\uAE30\uAE30",close:"\uB2EB\uAE30",copy:"\uBCF5\uC0AC",cut:"\uC798\uB77C\uB0B4\uAE30",copyWithHeaders:"\uD5E4\uB354 \uD3EC\uD568 \uBCF5\uC0AC",paste:"\uBD99\uC5EC\uB123\uAE30",pasteHint:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uD074\uB9BD\uBCF4\uB4DC \uC811\uADFC\uC744 \uB9C9\uC558\uC2B5\uB2C8\uB2E4. Ctrl+V\uB85C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.",required:"\uD544\uC218 \uC785\uB825 \uD56D\uBAA9\uC785\uB2C8\uB2E4",invalidValue:"\uC62C\uBC14\uB978 \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4",and:"\uADF8\uB9AC\uACE0",or:"\uB610\uB294",advancedFilter:"\uACE0\uAE09 \uD544\uD130",addCondition:"\uC870\uAC74 \uCD94\uAC00",duplicate:"\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uAC12\uC785\uB2C8\uB2E4",undo:"\uC2E4\uD589 \uCDE8\uC18C",redo:"\uB2E4\uC2DC \uC2E4\uD589",deleteRows:"\uC120\uD0DD\uD55C \uD589 \uC0AD\uC81C",copyRows:"\uC120\uD0DD\uD55C \uD589 \uBCF5\uC0AC",statusRows:"{n}\uD589",statusFiltered:"{total}\uD589 \uC911 {shown}\uD589",statusSelected:"{n}\uAC1C \uC120\uD0DD",count:"\uAC1C\uC218",sum:"\uD569\uACC4",avg:"\uD3C9\uADE0",min:"\uCD5C\uC18C",max:"\uCD5C\uB300",findPlaceholder:"\uADF8\uB9AC\uB4DC\uC5D0\uC11C \uCC3E\uAE30",noMatches:"\uC77C\uCE58 \uD56D\uBAA9 \uC5C6\uC74C",findNext:"\uB2E4\uC74C \uCC3E\uAE30",findPrevious:"\uC774\uC804 \uCC3E\uAE30",groupPanelHint:"\uC5F4 \uBA38\uB9AC\uAE00\uC744 \uC5EC\uAE30\uB85C \uB04C\uC5B4\uC640 \uD589\uC744 \uBB36\uC73C\uC138\uC694",groupByThis:"\uC774 \uC5F4\uB85C \uBB36\uAE30",ungroup:"\uBB36\uAE30 \uD574\uC81C",expandAll:"\uBAA8\uB450 \uD3BC\uCE58\uAE30",collapseAll:"\uBAA8\uB450 \uC811\uAE30",pagerRange:"{total}\uAC1C \uC911 {from}\u2013{to}",pageOf:"{pages}\uCABD \uC911 {page}\uCABD",pageSize:"\uCABD\uB2F9 \uD589 \uC218",firstPage:"\uCCAB \uCABD",previousPage:"\uC774\uC804 \uCABD",nextPage:"\uB2E4\uC74C \uCABD",lastPage:"\uB9C8\uC9C0\uB9C9 \uCABD",loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026",loadFailed:"\uD589\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4",filters:"\uD544\uD130",clearFilters:"\uD544\uD130 \uBAA8\uB450 \uC9C0\uC6B0\uAE30",exportCsv:"CSV\uB85C \uB0B4\uBCF4\uB0B4\uAE30",exportExcel:"\uC5D1\uC140\uB85C \uB0B4\uBCF4\uB0B4\uAE30",print:"\uC778\uC1C4\u2026",printLimited:"\uC804\uCCB4 {total}\uD589 \uC911 \uCC98\uC74C {n}\uD589\uB9CC \uC778\uC1C4\uD588\uC2B5\uB2C8\uB2E4. \uC804\uCCB4\uB294 \uC5D1\uC140\uC774\uB098 CSV\uB85C \uB0B4\uBCF4\uB0B4\uC138\uC694.",pivot:"\uD53C\uBC97",pivotMode:"\uD53C\uBC97 \uBAA8\uB4DC",pivotRows:"\uD589 \uADF8\uB8F9",pivotColumns:"\uC5F4 \uB808\uC774\uBE14",pivotValues:"\uAC12",total:"\uD569\uACC4",addColumn:"\uCEEC\uB7FC \uCD94\uAC00\u2026",chartBar:"\uB9C9\uB300 \uCC28\uD2B8",chartStacked:"\uB204\uC801 \uB9C9\uB300 \uCC28\uD2B8",chartLine:"\uAEBE\uC740\uC120 \uCC28\uD2B8",chartArea:"\uC601\uC5ED \uCC28\uD2B8",chartPie:"\uC6D0\uD615 \uCC28\uD2B8",chartDonut:"\uB3C4\uB11B \uCC28\uD2B8",chartCombo:"\uB9C9\uB300\xB7\uAEBE\uC740\uC120 \uCC28\uD2B8",chartScatter:"\uBD84\uC0B0\uD615 \uCC28\uD2B8",freeBadge:"\uBB34\uB8CC \uC0AC\uC6A9 \uC911",exportPdf:"PDF\uB85C \uB0B4\uBCF4\uB0B4\uAE30",exportJson:"JSON\uC73C\uB85C \uB0B4\uBCF4\uB0B4\uAE30",ai:{title:"AI \uC5B4\uC2DC\uC2A4\uD134\uD2B8",placeholder:"\uB370\uC774\uD130\uC5D0 \uB300\uD574 \uBB3B\uAC70\uB098 \uADF8\uB9AC\uB4DC\uC5D0 \uD560 \uC77C\uC744 \uB9D0\uD574 \uBCF4\uC138\uC694",send:"\uBCF4\uB0B4\uAE30",thinking:"\uCC98\uB9AC \uC911\u2026",undo:"\uB418\uB3CC\uB9AC\uAE30",undone:"\uB418\uB3CC\uB838\uC2B5\uB2C8\uB2E4",failed:"\uC5B4\uC2DC\uC2A4\uD134\uD2B8\uAC00 \uC751\uB2F5\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4",skipped:"\uAC74\uB108\uB700",done:"\uC644\uB8CC"},cf:{title:"\uC870\uAC74\uBD80 \uC11C\uC2DD",add:"\uADDC\uCE59 \uCD94\uAC00",clear:"\uADDC\uCE59 \uC9C0\uC6B0\uAE30",none:"\uC774 \uCEEC\uB7FC\uC5D0 \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",type:"\uADDC\uCE59",style:"\uC11C\uC2DD",wholeRow:"\uD589 \uC804\uCCB4",count:"\uAC1C\uC218",types:{value:"\uC140 \uAC12",formula:"\uC218\uC2DD",top:"\uC0C1\uC704",bottom:"\uD558\uC704",aboveAverage:"\uD3C9\uADE0 \uCD08\uACFC",belowAverage:"\uD3C9\uADE0 \uBBF8\uB9CC",duplicate:"\uC911\uBCF5 \uAC12",unique:"\uACE0\uC720 \uAC12",dataBar:"\uB370\uC774\uD130 \uB9C9\uB300",colorScale:"\uC0C9\uC870",iconSet:"\uC544\uC774\uCF58 \uC9D1\uD569"},ops:{notBetween:"\uBC94\uC704 \uBC16",notContains:"\uD3EC\uD568\uD558\uC9C0 \uC54A\uC74C"},styles:{red:"\uC5F0\uD55C \uBE68\uAC15 \uCC44\uC6B0\uAE30",yellow:"\uB178\uB791 \uCC44\uC6B0\uAE30",green:"\uCD08\uB85D \uCC44\uC6B0\uAE30",blue:"\uD30C\uB791 \uCC44\uC6B0\uAE30",redText:"\uBE68\uAC15 \uAE00\uC790",bold:"\uAD75\uAC8C"}},ops:{contains:"\uD3EC\uD568",equals:"\uAC19\uC74C",notEquals:"\uAC19\uC9C0 \uC54A\uC74C",startsWith:"\uC2DC\uC791 \uBB38\uC790",endsWith:"\uB05D \uBB38\uC790",blank:"\uBE48 \uAC12",notBlank:"\uBE48 \uAC12 \uC544\uB2D8",eq:"\uAC19\uC74C",ne:"\uAC19\uC9C0 \uC54A\uC74C",lt:"\uBBF8\uB9CC",lte:"\uC774\uD558",gt:"\uCD08\uACFC",gte:"\uC774\uC0C1",between:"\uBC94\uC704",before:"\uC774\uC804",after:"\uC774\uD6C4"}},_o=ms;var gs={code:"zh-CN",noRows:"\u6CA1\u6709\u53EF\u663E\u793A\u7684\u6570\u636E",filter:"\u7B5B\u9009",apply:"\u5E94\u7528",reset:"\u91CD\u7F6E",selectAll:"(\u5168\u9009)",search:"\u641C\u7D22\u2026",blanks:"(\u7A7A\u767D)",value:"\u503C",valueTo:"\u81F3",sortAsc:"\u5347\u5E8F\u6392\u5E8F",sortDesc:"\u964D\u5E8F\u6392\u5E8F",clearSort:"\u6E05\u9664\u6392\u5E8F",pinLeft:"\u56FA\u5B9A\u5728\u5DE6\u4FA7",pinRight:"\u56FA\u5B9A\u5728\u53F3\u4FA7",unpin:"\u53D6\u6D88\u56FA\u5B9A",columnMenu:"\u5217\u83DC\u5355",selectRow:"\u9009\u62E9\u884C",selectAllRows:"\u9009\u62E9\u6240\u6709\u884C",chooseColumns:"\u9009\u62E9\u5217",columns:"\u5217",autosizeThis:"\u81EA\u52A8\u8C03\u6574\u6B64\u5217\u5BBD\u5EA6",autosizeAll:"\u81EA\u52A8\u8C03\u6574\u6240\u6709\u5217\u5BBD\u5EA6",resetColumns:"\u91CD\u7F6E\u5217",hideColumn:"\u9690\u85CF\u5217",close:"\u5173\u95ED",copy:"\u590D\u5236",cut:"\u526A\u5207",copyWithHeaders:"\u8FDE\u540C\u6807\u9898\u590D\u5236",paste:"\u7C98\u8D34",pasteHint:"\u6D4F\u89C8\u5668\u963B\u6B62\u4E86\u526A\u8D34\u677F\u8BBF\u95EE\u3002\u8BF7\u6309 Ctrl+V \u7C98\u8D34\u3002",required:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879",invalidValue:"\u503C\u65E0\u6548",and:"\u4E14",or:"\u6216",advancedFilter:"\u9AD8\u7EA7\u7B5B\u9009",addCondition:"\u6DFB\u52A0\u6761\u4EF6",duplicate:"\u8BE5\u503C\u5DF2\u88AB\u4F7F\u7528",undo:"\u64A4\u9500",redo:"\u91CD\u505A",deleteRows:"\u5220\u9664\u6240\u9009\u884C",copyRows:"\u590D\u5236\u6240\u9009\u884C",statusRows:"{n} \u884C",statusFiltered:"{total} \u884C\u4E2D\u7684 {shown} \u884C",statusSelected:"\u5DF2\u9009 {n} \u884C",count:"\u8BA1\u6570",sum:"\u6C42\u548C",avg:"\u5E73\u5747\u503C",min:"\u6700\u5C0F\u503C",max:"\u6700\u5927\u503C",findPlaceholder:"\u5728\u8868\u683C\u4E2D\u67E5\u627E",noMatches:"\u65E0\u5339\u914D\u9879",findNext:"\u4E0B\u4E00\u4E2A",findPrevious:"\u4E0A\u4E00\u4E2A",groupPanelHint:"\u5C06\u5217\u6807\u9898\u62D6\u5230\u6B64\u5904\u4EE5\u5206\u7EC4",groupByThis:"\u6309\u6B64\u5217\u5206\u7EC4",ungroup:"\u53D6\u6D88\u5206\u7EC4",expandAll:"\u5168\u90E8\u5C55\u5F00",collapseAll:"\u5168\u90E8\u6298\u53E0",pagerRange:"\u7B2C {from}\u2013{to} \u6761\uFF0C\u5171 {total} \u6761",pageOf:"\u7B2C {page} \u9875\uFF0C\u5171 {pages} \u9875",pageSize:"\u6BCF\u9875\u884C\u6570",firstPage:"\u9996\u9875",previousPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",lastPage:"\u672B\u9875",loading:"\u52A0\u8F7D\u4E2D\u2026",loadFailed:"\u65E0\u6CD5\u52A0\u8F7D\u6570\u636E",filters:"\u7B5B\u9009",clearFilters:"\u6E05\u9664\u6240\u6709\u7B5B\u9009",exportCsv:"\u5BFC\u51FA CSV",exportExcel:"\u5BFC\u51FA Excel",print:"\u6253\u5370\u2026",printLimited:"\u4EC5\u6253\u5370\u4E86 {total} \u884C\u4E2D\u7684\u524D {n} \u884C\u3002\u5982\u9700\u5168\u90E8\uFF0C\u8BF7\u5BFC\u51FA\u4E3A Excel \u6216 CSV\u3002",pivot:"\u6570\u636E\u900F\u89C6",pivotMode:"\u900F\u89C6\u6A21\u5F0F",pivotRows:"\u884C\u5206\u7EC4",pivotColumns:"\u5217\u6807\u7B7E",pivotValues:"\u503C",total:"\u603B\u8BA1",addColumn:"\u6DFB\u52A0\u5217\u2026",chartBar:"\u67F1\u72B6\u56FE",chartStacked:"\u5806\u79EF\u67F1\u72B6\u56FE",chartLine:"\u6298\u7EBF\u56FE",chartArea:"\u9762\u79EF\u56FE",chartPie:"\u997C\u56FE",chartDonut:"\u73AF\u5F62\u56FE",chartCombo:"\u67F1\u7EBF\u7EC4\u5408\u56FE",chartScatter:"\u6563\u70B9\u56FE",freeBadge:"\u514D\u8D39\u4F7F\u7528\u4E2D",exportPdf:"\u5BFC\u51FA PDF",exportJson:"\u5BFC\u51FA JSON",ai:{title:"AI \u52A9\u624B",placeholder:"\u8BE2\u95EE\u6570\u636E\uFF0C\u6216\u544A\u8BC9\u8868\u683C\u8981\u505A\u4EC0\u4E48",send:"\u53D1\u9001",thinking:"\u5904\u7406\u4E2D\u2026",undo:"\u64A4\u9500",undone:"\u5DF2\u64A4\u9500",failed:"\u52A9\u624B\u6CA1\u6709\u56DE\u5E94",skipped:"\u5DF2\u8DF3\u8FC7",done:"\u5B8C\u6210"},cf:{title:"\u6761\u4EF6\u683C\u5F0F",add:"\u6DFB\u52A0\u89C4\u5219",clear:"\u6E05\u9664\u89C4\u5219",none:"\u6B64\u5217\u6CA1\u6709\u89C4\u5219",type:"\u89C4\u5219",style:"\u683C\u5F0F",wholeRow:"\u6574\u884C",count:"\u6570\u91CF",types:{value:"\u5355\u5143\u683C\u503C",formula:"\u516C\u5F0F",top:"\u524D",bottom:"\u540E",aboveAverage:"\u9AD8\u4E8E\u5E73\u5747\u503C",belowAverage:"\u4F4E\u4E8E\u5E73\u5747\u503C",duplicate:"\u91CD\u590D\u503C",unique:"\u552F\u4E00\u503C",dataBar:"\u6570\u636E\u6761",colorScale:"\u8272\u9636",iconSet:"\u56FE\u6807\u96C6"},ops:{notBetween:"\u4E0D\u4ECB\u4E8E",notContains:"\u4E0D\u5305\u542B"},styles:{red:"\u6D45\u7EA2\u8272\u586B\u5145",yellow:"\u9EC4\u8272\u586B\u5145",green:"\u7EFF\u8272\u586B\u5145",blue:"\u84DD\u8272\u586B\u5145",redText:"\u7EA2\u8272\u6587\u672C",bold:"\u52A0\u7C97"}},ops:{contains:"\u5305\u542B",equals:"\u7B49\u4E8E",notEquals:"\u4E0D\u7B49\u4E8E",startsWith:"\u5F00\u5934\u662F",endsWith:"\u7ED3\u5C3E\u662F",blank:"\u4E3A\u7A7A",notBlank:"\u4E0D\u4E3A\u7A7A",eq:"\u7B49\u4E8E",ne:"\u4E0D\u7B49\u4E8E",lt:"\u5C0F\u4E8E",lte:"\u5C0F\u4E8E\u6216\u7B49\u4E8E",gt:"\u5927\u4E8E",gte:"\u5927\u4E8E\u6216\u7B49\u4E8E",between:"\u4ECB\u4E8E",before:"\u65E9\u4E8E",after:"\u665A\u4E8E"}},Xo=gs;var ws={code:"zh-TW",noRows:"\u6C92\u6709\u53EF\u986F\u793A\u7684\u8CC7\u6599",filter:"\u7BE9\u9078",apply:"\u5957\u7528",reset:"\u91CD\u8A2D",selectAll:"(\u5168\u9078)",search:"\u641C\u5C0B\u2026",blanks:"(\u7A7A\u767D)",value:"\u503C",valueTo:"\u81F3",sortAsc:"\u905E\u589E\u6392\u5E8F",sortDesc:"\u905E\u6E1B\u6392\u5E8F",clearSort:"\u6E05\u9664\u6392\u5E8F",pinLeft:"\u56FA\u5B9A\u5728\u5DE6\u5074",pinRight:"\u56FA\u5B9A\u5728\u53F3\u5074",unpin:"\u53D6\u6D88\u56FA\u5B9A",columnMenu:"\u6B04\u4F4D\u9078\u55AE",selectRow:"\u9078\u53D6\u5217",selectAllRows:"\u9078\u53D6\u6240\u6709\u5217",chooseColumns:"\u9078\u64C7\u6B04\u4F4D",columns:"\u6B04\u4F4D",autosizeThis:"\u81EA\u52D5\u8ABF\u6574\u6B64\u6B04\u5BEC",autosizeAll:"\u81EA\u52D5\u8ABF\u6574\u6240\u6709\u6B04\u5BEC",resetColumns:"\u91CD\u8A2D\u6B04\u4F4D",hideColumn:"\u96B1\u85CF\u6B04\u4F4D",close:"\u95DC\u9589",copy:"\u8907\u88FD",cut:"\u526A\u4E0B",copyWithHeaders:"\u9023\u540C\u6A19\u984C\u8907\u88FD",paste:"\u8CBC\u4E0A",pasteHint:"\u7121\u6CD5\u5B58\u53D6\u526A\u8CBC\u7C3F\u3002\u8ACB\u6309 Ctrl+V \u8CBC\u4E0A\u3002",required:"\u6B64\u6B04\u4F4D\u70BA\u5FC5\u586B",invalidValue:"\u503C\u7121\u6548",and:"\u4E14",or:"\u6216",advancedFilter:"\u9032\u968E\u7BE9\u9078",addCondition:"\u65B0\u589E\u689D\u4EF6",duplicate:"\u6B64\u503C\u5DF2\u88AB\u4F7F\u7528",undo:"\u5FA9\u539F",redo:"\u91CD\u505A",deleteRows:"\u522A\u9664\u9078\u53D6\u7684\u5217",copyRows:"\u8907\u88FD\u9078\u53D6\u7684\u5217",statusRows:"{n} \u5217",statusFiltered:"{total} \u5217\u4E2D\u7684 {shown} \u5217",statusSelected:"\u5DF2\u9078\u53D6 {n} \u5217",count:"\u7B46\u6578",sum:"\u5408\u8A08",avg:"\u5E73\u5747",min:"\u6700\u5C0F",max:"\u6700\u5927",findPlaceholder:"\u5728\u8868\u683C\u4E2D\u5C0B\u627E",noMatches:"\u6C92\u6709\u7B26\u5408\u7684\u7D50\u679C",findNext:"\u4E0B\u4E00\u500B",findPrevious:"\u4E0A\u4E00\u500B",groupPanelHint:"\u5C07\u6B04\u4F4D\u6A19\u984C\u62D6\u66F3\u5230\u9019\u88E1\u4EE5\u5206\u7D44",groupByThis:"\u4F9D\u6B64\u6B04\u4F4D\u5206\u7D44",ungroup:"\u53D6\u6D88\u5206\u7D44",expandAll:"\u5168\u90E8\u5C55\u958B",collapseAll:"\u5168\u90E8\u647A\u758A",pagerRange:"{from}\u2013{to}\uFF0C\u5171 {total} \u7B46",pageOf:"\u7B2C {page} \u9801\uFF0C\u5171 {pages} \u9801",pageSize:"\u6BCF\u9801\u5217\u6578",firstPage:"\u7B2C\u4E00\u9801",previousPage:"\u4E0A\u4E00\u9801",nextPage:"\u4E0B\u4E00\u9801",lastPage:"\u6700\u5F8C\u4E00\u9801",loading:"\u8F09\u5165\u4E2D\u2026",loadFailed:"\u7121\u6CD5\u8F09\u5165\u8CC7\u6599",filters:"\u7BE9\u9078",clearFilters:"\u6E05\u9664\u6240\u6709\u7BE9\u9078",exportCsv:"\u532F\u51FA CSV",exportExcel:"\u532F\u51FA Excel",print:"\u5217\u5370\u2026",printLimited:"\u50C5\u5217\u5370\u4E86 {total} \u5217\u4E2D\u7684\u524D {n} \u5217\u3002\u5982\u9700\u5168\u90E8\uFF0C\u8ACB\u532F\u51FA\u70BA Excel \u6216 CSV\u3002",pivot:"\u6A1E\u7D10\u5206\u6790",pivotMode:"\u6A1E\u7D10\u5206\u6790\u6A21\u5F0F",pivotRows:"\u5217\u7FA4\u7D44",pivotColumns:"\u6B04\u6A19\u7C64",pivotValues:"\u503C",total:"\u7E3D\u8A08",addColumn:"\u65B0\u589E\u6B04\u4F4D\u2026",chartBar:"\u76F4\u689D\u5716",chartStacked:"\u5806\u758A\u76F4\u689D\u5716",chartLine:"\u6298\u7DDA\u5716",chartArea:"\u5340\u57DF\u5716",chartPie:"\u5713\u5F62\u5716",chartDonut:"\u74B0\u5708\u5716",chartCombo:"\u76F4\u689D\u8207\u6298\u7DDA\u5716",chartScatter:"\u6563\u4F48\u5716",freeBadge:"\u514D\u8CBB\u7248",exportPdf:"\u532F\u51FA PDF",exportJson:"\u532F\u51FA JSON",ai:{title:"AI \u52A9\u7406",placeholder:"\u8A62\u554F\u8CC7\u6599\uFF0C\u6216\u544A\u8A34\u8868\u683C\u8981\u505A\u4EC0\u9EBC",send:"\u50B3\u9001",thinking:"\u8655\u7406\u4E2D\u2026",undo:"\u5FA9\u539F",undone:"\u5DF2\u5FA9\u539F",failed:"\u52A9\u7406\u6C92\u6709\u56DE\u61C9",skipped:"\u5DF2\u7565\u904E",done:"\u5B8C\u6210"},cf:{title:"\u8A2D\u5B9A\u683C\u5F0F\u5316\u7684\u689D\u4EF6",add:"\u65B0\u589E\u898F\u5247",clear:"\u6E05\u9664\u898F\u5247",none:"\u6B64\u6B04\u6C92\u6709\u898F\u5247",type:"\u898F\u5247",style:"\u683C\u5F0F",wholeRow:"\u6574\u5217",count:"\u6578\u91CF",types:{value:"\u5132\u5B58\u683C\u503C",formula:"\u516C\u5F0F",top:"\u524D",bottom:"\u5F8C",aboveAverage:"\u9AD8\u65BC\u5E73\u5747",belowAverage:"\u4F4E\u65BC\u5E73\u5747",duplicate:"\u91CD\u8907\u503C",unique:"\u552F\u4E00\u503C",dataBar:"\u8CC7\u6599\u6A6B\u689D",colorScale:"\u8272\u968E",iconSet:"\u5716\u793A\u96C6"},ops:{notBetween:"\u4E0D\u4ECB\u65BC",notContains:"\u4E0D\u5305\u542B"},styles:{red:"\u6DFA\u7D05\u8272\u586B\u6EFF",yellow:"\u9EC3\u8272\u586B\u6EFF",green:"\u7DA0\u8272\u586B\u6EFF",blue:"\u85CD\u8272\u586B\u6EFF",redText:"\u7D05\u8272\u6587\u5B57",bold:"\u7C97\u9AD4"}},ops:{contains:"\u5305\u542B",equals:"\u7B49\u65BC",notEquals:"\u4E0D\u7B49\u65BC",startsWith:"\u958B\u982D\u70BA",endsWith:"\u7D50\u5C3E\u70BA",blank:"\u7A7A\u767D",notBlank:"\u975E\u7A7A\u767D",eq:"\u7B49\u65BC",ne:"\u4E0D\u7B49\u65BC",lt:"\u5C0F\u65BC",lte:"\u5C0F\u65BC\u6216\u7B49\u65BC",gt:"\u5927\u65BC",gte:"\u5927\u65BC\u6216\u7B49\u65BC",between:"\u4ECB\u65BC",before:"\u65E9\u65BC",after:"\u665A\u65BC"}},Jo=ws;var ys={code:"vi",noRows:"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",filter:"L\u1ECDc",apply:"\xC1p d\u1EE5ng",reset:"\u0110\u1EB7t l\u1EA1i",selectAll:"(Ch\u1ECDn t\u1EA5t c\u1EA3)",search:"T\xECm\u2026",blanks:"(Tr\u1ED1ng)",value:"Gi\xE1 tr\u1ECB",valueTo:"\u0110\u1EBFn",sortAsc:"S\u1EAFp x\u1EBFp t\u0103ng d\u1EA7n",sortDesc:"S\u1EAFp x\u1EBFp gi\u1EA3m d\u1EA7n",clearSort:"B\u1ECF s\u1EAFp x\u1EBFp",pinLeft:"Ghim tr\xE1i",pinRight:"Ghim ph\u1EA3i",unpin:"B\u1ECF ghim",columnMenu:"Menu c\u1ED9t",selectRow:"Ch\u1ECDn d\xF2ng",selectAllRows:"Ch\u1ECDn t\u1EA5t c\u1EA3 d\xF2ng",chooseColumns:"Ch\u1ECDn c\u1ED9t",columns:"C\u1ED9t",autosizeThis:"T\u1EF1 \u0111\u1ED9ng ch\u1EC9nh \u0111\u1ED9 r\u1ED9ng c\u1ED9t n\xE0y",autosizeAll:"T\u1EF1 \u0111\u1ED9ng ch\u1EC9nh \u0111\u1ED9 r\u1ED9ng t\u1EA5t c\u1EA3 c\u1ED9t",resetColumns:"\u0110\u1EB7t l\u1EA1i c\u1ED9t",hideColumn:"\u1EA8n c\u1ED9t",close:"\u0110\xF3ng",copy:"Sao ch\xE9p",cut:"C\u1EAFt",copyWithHeaders:"Sao ch\xE9p k\xE8m ti\xEAu \u0111\u1EC1",paste:"D\xE1n",pasteHint:"Kh\xF4ng truy c\u1EADp \u0111\u01B0\u1EE3c b\u1ED9 nh\u1EDB t\u1EA1m. Nh\u1EA5n Ctrl+V \u0111\u1EC3 d\xE1n.",required:"Tr\u01B0\u1EDDng n\xE0y l\xE0 b\u1EAFt bu\u1ED9c",invalidValue:"Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7",and:"V\xE0",or:"Ho\u1EB7c",advancedFilter:"L\u1ECDc n\xE2ng cao",addCondition:"Th\xEAm \u0111i\u1EC1u ki\u1EC7n",duplicate:"Gi\xE1 tr\u1ECB n\xE0y \u0111\xE3 \u0111\u01B0\u1EE3c d\xF9ng",undo:"Ho\xE0n t\xE1c",redo:"L\xE0m l\u1EA1i",deleteRows:"X\xF3a c\xE1c d\xF2ng \u0111\xE3 ch\u1ECDn",copyRows:"Sao ch\xE9p c\xE1c d\xF2ng \u0111\xE3 ch\u1ECDn",statusRows:"{n} d\xF2ng",statusFiltered:"{shown} / {total} d\xF2ng",statusSelected:"\u0110\xE3 ch\u1ECDn {n}",count:"S\u1ED1 l\u01B0\u1EE3ng",sum:"T\u1ED5ng",avg:"Trung b\xECnh",min:"Nh\u1ECF nh\u1EA5t",max:"L\u1EDBn nh\u1EA5t",findPlaceholder:"T\xECm trong b\u1EA3ng",noMatches:"Kh\xF4ng t\xECm th\u1EA5y",findNext:"K\u1EBFt qu\u1EA3 ti\u1EBFp",findPrevious:"K\u1EBFt qu\u1EA3 tr\u01B0\u1EDBc",groupPanelHint:"K\xE9o ti\xEAu \u0111\u1EC1 c\u1ED9t v\xE0o \u0111\xE2y \u0111\u1EC3 nh\xF3m d\xF2ng",groupByThis:"Nh\xF3m theo c\u1ED9t n\xE0y",ungroup:"B\u1ECF nh\xF3m",expandAll:"M\u1EDF r\u1ED9ng t\u1EA5t c\u1EA3",collapseAll:"Thu g\u1ECDn t\u1EA5t c\u1EA3",pagerRange:"{from}\u2013{to} / {total}",pageOf:"Trang {page} / {pages}",pageSize:"S\u1ED1 d\xF2ng m\u1ED7i trang",firstPage:"Trang \u0111\u1EA7u",previousPage:"Trang tr\u01B0\u1EDBc",nextPage:"Trang sau",lastPage:"Trang cu\u1ED1i",loading:"\u0110ang t\u1EA3i\u2026",loadFailed:"Kh\xF4ng t\u1EA3i \u0111\u01B0\u1EE3c d\u1EEF li\u1EC7u",filters:"B\u1ED9 l\u1ECDc",clearFilters:"X\xF3a t\u1EA5t c\u1EA3 b\u1ED9 l\u1ECDc",exportCsv:"Xu\u1EA5t CSV",exportExcel:"Xu\u1EA5t Excel",print:"In\u2026",printLimited:"\u0110\xE3 in {n} h\xE0ng \u0111\u1EA7u ti\xEAn trong t\u1ED5ng s\u1ED1 {total} h\xE0ng. Xu\u1EA5t sang Excel ho\u1EB7c CSV \u0111\u1EC3 c\xF3 t\u1EA5t c\u1EA3.",pivot:"Pivot",pivotMode:"Ch\u1EBF \u0111\u1ED9 pivot",pivotRows:"Nh\xF3m d\xF2ng",pivotColumns:"Nh\xE3n c\u1ED9t",pivotValues:"Gi\xE1 tr\u1ECB",total:"T\u1ED5ng c\u1ED9ng",addColumn:"Th\xEAm c\u1ED9t\u2026",chartBar:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t",chartStacked:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t ch\u1ED3ng",chartLine:"Bi\u1EC3u \u0111\u1ED3 \u0111\u01B0\u1EDDng",chartArea:"Bi\u1EC3u \u0111\u1ED3 v\xF9ng",chartPie:"Bi\u1EC3u \u0111\u1ED3 tr\xF2n",chartDonut:"Bi\u1EC3u \u0111\u1ED3 v\xE0nh khuy\xEAn",chartCombo:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t v\xE0 \u0111\u01B0\u1EDDng",chartScatter:"Bi\u1EC3u \u0111\u1ED3 ph\xE2n t\xE1n",freeBadge:"B\u1EA3n mi\u1EC5n ph\xED",exportPdf:"Xu\u1EA5t PDF",exportJson:"Xu\u1EA5t JSON",ai:{title:"Tr\u1EE3 l\xFD AI",placeholder:"H\u1ECFi v\u1EC1 d\u1EEF li\u1EC7u ho\u1EB7c b\u1EA3o b\u1EA3ng c\u1EA7n l\xE0m g\xEC",send:"G\u1EEDi",thinking:"\u0110ang x\u1EED l\xFD\u2026",undo:"Ho\xE0n t\xE1c",undone:"\u0110\xE3 ho\xE0n t\xE1c",failed:"Tr\u1EE3 l\xFD kh\xF4ng ph\u1EA3n h\u1ED3i",skipped:"\u0110\xE3 b\u1ECF qua",done:"Xong"},cf:{title:"\u0110\u1ECBnh d\u1EA1ng c\xF3 \u0111i\u1EC1u ki\u1EC7n",add:"Th\xEAm quy t\u1EAFc",clear:"X\xF3a quy t\u1EAFc",none:"C\u1ED9t n\xE0y ch\u01B0a c\xF3 quy t\u1EAFc",type:"Quy t\u1EAFc",style:"\u0110\u1ECBnh d\u1EA1ng",wholeRow:"C\u1EA3 h\xE0ng",count:"S\u1ED1 l\u01B0\u1EE3ng",types:{value:"Gi\xE1 tr\u1ECB \xF4",formula:"C\xF4ng th\u1EE9c",top:"Cao nh\u1EA5t",bottom:"Th\u1EA5p nh\u1EA5t",aboveAverage:"Tr\xEAn trung b\xECnh",belowAverage:"D\u01B0\u1EDBi trung b\xECnh",duplicate:"Gi\xE1 tr\u1ECB tr\xF9ng l\u1EB7p",unique:"Gi\xE1 tr\u1ECB duy nh\u1EA5t",dataBar:"Thanh d\u1EEF li\u1EC7u",colorScale:"Thang m\xE0u",iconSet:"B\u1ED9 bi\u1EC3u t\u01B0\u1EE3ng"},ops:{notBetween:"Kh\xF4ng n\u1EB1m gi\u1EEFa",notContains:"Kh\xF4ng ch\u1EE9a"},styles:{red:"T\xF4 \u0111\u1ECF nh\u1EA1t",yellow:"T\xF4 v\xE0ng",green:"T\xF4 xanh l\xE1",blue:"T\xF4 xanh d\u01B0\u01A1ng",redText:"Ch\u1EEF \u0111\u1ECF",bold:"In \u0111\u1EADm"}},ops:{contains:"Ch\u1EE9a",equals:"B\u1EB1ng",notEquals:"Kh\xE1c",startsWith:"B\u1EAFt \u0111\u1EA7u b\u1EB1ng",endsWith:"K\u1EBFt th\xFAc b\u1EB1ng",blank:"Tr\u1ED1ng",notBlank:"Kh\xF4ng tr\u1ED1ng",eq:"B\u1EB1ng",ne:"Kh\xE1c",lt:"Nh\u1ECF h\u01A1n",lte:"Nh\u1ECF h\u01A1n ho\u1EB7c b\u1EB1ng",gt:"L\u1EDBn h\u01A1n",gte:"L\u1EDBn h\u01A1n ho\u1EB7c b\u1EB1ng",between:"Trong kho\u1EA3ng",before:"Tr\u01B0\u1EDBc",after:"Sau"}},Yo=ys;var bs={code:"th",noRows:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",filter:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",apply:"\u0E43\u0E0A\u0E49",reset:"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15",selectAll:"(\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14)",search:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",blanks:"(\u0E27\u0E48\u0E32\u0E07)",value:"\u0E04\u0E48\u0E32",valueTo:"\u0E16\u0E36\u0E07",sortAsc:"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",sortDesc:"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",clearSort:"\u0E25\u0E49\u0E32\u0E07\u0E01\u0E32\u0E23\u0E40\u0E23\u0E35\u0E22\u0E07",pinLeft:"\u0E15\u0E23\u0E36\u0E07\u0E0B\u0E49\u0E32\u0E22",pinRight:"\u0E15\u0E23\u0E36\u0E07\u0E02\u0E27\u0E32",unpin:"\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07",columnMenu:"\u0E40\u0E21\u0E19\u0E39\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",selectRow:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",selectAllRows:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",chooseColumns:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",columns:"\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",autosizeThis:"\u0E1B\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",autosizeAll:"\u0E1B\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E17\u0E38\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",resetColumns:"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",hideColumn:"\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",close:"\u0E1B\u0E34\u0E14",copy:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",cut:"\u0E15\u0E31\u0E14",copyWithHeaders:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E2B\u0E31\u0E27\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",paste:"\u0E27\u0E32\u0E07",pasteHint:"\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E01\u0E14 Ctrl+V \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E27\u0E32\u0E07",required:"\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E23\u0E2D\u0E01\u0E0A\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",invalidValue:"\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",and:"\u0E41\u0E25\u0E30",or:"\u0E2B\u0E23\u0E37\u0E2D",advancedFilter:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07",addCondition:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02",duplicate:"\u0E04\u0E48\u0E32\u0E19\u0E35\u0E49\u0E16\u0E39\u0E01\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27",undo:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",redo:"\u0E17\u0E33\u0E0B\u0E49\u0E33",deleteRows:"\u0E25\u0E1A\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",copyRows:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",statusRows:"{n} \u0E41\u0E16\u0E27",statusFiltered:"{shown} \u0E08\u0E32\u0E01 {total} \u0E41\u0E16\u0E27",statusSelected:"\u0E40\u0E25\u0E37\u0E2D\u0E01 {n} \u0E41\u0E16\u0E27",count:"\u0E08\u0E33\u0E19\u0E27\u0E19",sum:"\u0E1C\u0E25\u0E23\u0E27\u0E21",avg:"\u0E04\u0E48\u0E32\u0E40\u0E09\u0E25\u0E35\u0E48\u0E22",min:"\u0E15\u0E48\u0E33\u0E2A\u0E38\u0E14",max:"\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14",findPlaceholder:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E43\u0E19\u0E15\u0E32\u0E23\u0E32\u0E07",noMatches:"\u0E44\u0E21\u0E48\u0E1E\u0E1A",findNext:"\u0E16\u0E31\u0E14\u0E44\u0E1B",findPrevious:"\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",groupPanelHint:"\u0E25\u0E32\u0E01\u0E2B\u0E31\u0E27\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E21\u0E32\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",groupByThis:"\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21\u0E15\u0E32\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49",ungroup:"\u0E40\u0E25\u0E34\u0E01\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",expandAll:"\u0E02\u0E22\u0E32\u0E22\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",collapseAll:"\u0E22\u0E38\u0E1A\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",pagerRange:"{from}\u2013{to} \u0E08\u0E32\u0E01 {total}",pageOf:"\u0E2B\u0E19\u0E49\u0E32 {page} \u0E08\u0E32\u0E01 {pages}",pageSize:"\u0E41\u0E16\u0E27\u0E15\u0E48\u0E2D\u0E2B\u0E19\u0E49\u0E32",firstPage:"\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",previousPage:"\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19",nextPage:"\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",lastPage:"\u0E2B\u0E19\u0E49\u0E32\u0E2A\u0E38\u0E14\u0E17\u0E49\u0E32\u0E22",loading:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",loadFailed:"\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08",filters:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",clearFilters:"\u0E25\u0E49\u0E32\u0E07\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",exportCsv:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 CSV",exportExcel:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 Excel",print:"\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u2026",printLimited:"\u0E1E\u0E34\u0E21\u0E1E\u0E4C {n} \u0E41\u0E16\u0E27\u0E41\u0E23\u0E01\u0E08\u0E32\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14 {total} \u0E41\u0E16\u0E27 \u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01\u0E40\u0E1B\u0E47\u0E19 Excel \u0E2B\u0E23\u0E37\u0E2D CSV \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E23\u0E31\u0E1A\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",pivot:"Pivot",pivotMode:"\u0E42\u0E2B\u0E21\u0E14 Pivot",pivotRows:"\u0E01\u0E25\u0E38\u0E48\u0E21\u0E41\u0E16\u0E27",pivotColumns:"\u0E1B\u0E49\u0E32\u0E22\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",pivotValues:"\u0E04\u0E48\u0E32",total:"\u0E23\u0E27\u0E21",addColumn:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u2026",chartBar:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07",chartStacked:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E0B\u0E49\u0E2D\u0E19",chartLine:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19",chartArea:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E1E\u0E37\u0E49\u0E19\u0E17\u0E35\u0E48",chartPie:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E27\u0E07\u0E01\u0E25\u0E21",chartDonut:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E42\u0E14\u0E19\u0E31\u0E17",chartCombo:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E41\u0E25\u0E30\u0E40\u0E2A\u0E49\u0E19",chartScatter:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22",freeBadge:"\u0E23\u0E38\u0E48\u0E19\u0E1F\u0E23\u0E35",exportPdf:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 PDF",exportJson:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 JSON",ai:{title:"\u0E1C\u0E39\u0E49\u0E0A\u0E48\u0E27\u0E22 AI",placeholder:"\u0E16\u0E32\u0E21\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25 \u0E2B\u0E23\u0E37\u0E2D\u0E1A\u0E2D\u0E01\u0E15\u0E32\u0E23\u0E32\u0E07\u0E27\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E17\u0E33\u0E2D\u0E30\u0E44\u0E23",send:"\u0E2A\u0E48\u0E07",thinking:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E17\u0E33\u0E07\u0E32\u0E19\u2026",undo:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",undone:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33\u0E41\u0E25\u0E49\u0E27",failed:"\u0E1C\u0E39\u0E49\u0E0A\u0E48\u0E27\u0E22\u0E44\u0E21\u0E48\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A",skipped:"\u0E02\u0E49\u0E32\u0E21",done:"\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E41\u0E25\u0E49\u0E27"},cf:{title:"\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E15\u0E32\u0E21\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02",add:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E01\u0E0E",clear:"\u0E25\u0E49\u0E32\u0E07\u0E01\u0E0E",none:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E01\u0E0E\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49",type:"\u0E01\u0E0E",style:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A",wholeRow:"\u0E17\u0E31\u0E49\u0E07\u0E41\u0E16\u0E27",count:"\u0E08\u0E33\u0E19\u0E27\u0E19",types:{value:"\u0E04\u0E48\u0E32\u0E43\u0E19\u0E40\u0E0B\u0E25\u0E25\u0E4C",formula:"\u0E2A\u0E39\u0E15\u0E23",top:"\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14",bottom:"\u0E15\u0E48\u0E33\u0E2A\u0E38\u0E14",aboveAverage:"\u0E2A\u0E39\u0E07\u0E01\u0E27\u0E48\u0E32\u0E04\u0E48\u0E32\u0E40\u0E09\u0E25\u0E35\u0E48\u0E22",belowAverage:"\u0E15\u0E48\u0E33\u0E01\u0E27\u0E48\u0E32\u0E04\u0E48\u0E32\u0E40\u0E09\u0E25\u0E35\u0E48\u0E22",duplicate:"\u0E04\u0E48\u0E32\u0E17\u0E35\u0E48\u0E0B\u0E49\u0E33\u0E01\u0E31\u0E19",unique:"\u0E04\u0E48\u0E32\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E0B\u0E49\u0E33",dataBar:"\u0E41\u0E16\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",colorScale:"\u0E23\u0E30\u0E14\u0E31\u0E1A\u0E2A\u0E35",iconSet:"\u0E0A\u0E38\u0E14\u0E44\u0E2D\u0E04\u0E2D\u0E19"},ops:{notBetween:"\u0E44\u0E21\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07",notContains:"\u0E44\u0E21\u0E48\u0E21\u0E35"},styles:{red:"\u0E40\u0E15\u0E34\u0E21\u0E2A\u0E35\u0E41\u0E14\u0E07\u0E2D\u0E48\u0E2D\u0E19",yellow:"\u0E40\u0E15\u0E34\u0E21\u0E2A\u0E35\u0E40\u0E2B\u0E25\u0E37\u0E2D\u0E07",green:"\u0E40\u0E15\u0E34\u0E21\u0E2A\u0E35\u0E40\u0E02\u0E35\u0E22\u0E27",blue:"\u0E40\u0E15\u0E34\u0E21\u0E2A\u0E35\u0E19\u0E49\u0E33\u0E40\u0E07\u0E34\u0E19",redText:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E35\u0E41\u0E14\u0E07",bold:"\u0E15\u0E31\u0E27\u0E2B\u0E19\u0E32"}},ops:{contains:"\u0E21\u0E35\u0E04\u0E33\u0E27\u0E48\u0E32",equals:"\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",notEquals:"\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",startsWith:"\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22",endsWith:"\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22",blank:"\u0E27\u0E48\u0E32\u0E07",notBlank:"\u0E44\u0E21\u0E48\u0E27\u0E48\u0E32\u0E07",eq:"\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",ne:"\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",lt:"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",lte:"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",gt:"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",gte:"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",between:"\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07",before:"\u0E01\u0E48\u0E2D\u0E19",after:"\u0E2B\u0E25\u0E31\u0E07"}},Zo=bs;var vs={code:"id",noRows:"Tidak ada data",filter:"Filter",apply:"Terapkan",reset:"Atur ulang",selectAll:"(Pilih semua)",search:"Cari\u2026",blanks:"(Kosong)",value:"Nilai",valueTo:"Sampai",sortAsc:"Urutkan naik",sortDesc:"Urutkan turun",clearSort:"Hapus urutan",pinLeft:"Sematkan kiri",pinRight:"Sematkan kanan",unpin:"Lepas sematan",columnMenu:"Menu kolom",selectRow:"Pilih baris",selectAllRows:"Pilih semua baris",chooseColumns:"Pilih kolom",columns:"Kolom",autosizeThis:"Sesuaikan lebar kolom ini",autosizeAll:"Sesuaikan lebar semua kolom",resetColumns:"Atur ulang kolom",hideColumn:"Sembunyikan kolom",close:"Tutup",copy:"Salin",cut:"Potong",copyWithHeaders:"Salin dengan judul",paste:"Tempel",pasteHint:"Akses papan klip diblokir. Tekan Ctrl+V untuk menempel.",required:"Kolom ini wajib diisi",invalidValue:"Nilai tidak valid",and:"Dan",or:"Atau",advancedFilter:"Filter lanjutan",addCondition:"Tambah kondisi",duplicate:"Nilai ini sudah dipakai",undo:"Urungkan",redo:"Ulangi",deleteRows:"Hapus baris terpilih",copyRows:"Salin baris terpilih",statusRows:"{n} baris",statusFiltered:"{shown} dari {total} baris",statusSelected:"{n} dipilih",count:"Jumlah data",sum:"Total",avg:"Rata-rata",min:"Min",max:"Maks",findPlaceholder:"Cari di tabel",noMatches:"Tidak ditemukan",findNext:"Berikutnya",findPrevious:"Sebelumnya",groupPanelHint:"Seret judul kolom ke sini untuk mengelompokkan",groupByThis:"Kelompokkan menurut kolom ini",ungroup:"Hapus pengelompokan",expandAll:"Buka semua",collapseAll:"Tutup semua",pagerRange:"{from}\u2013{to} dari {total}",pageOf:"Halaman {page} dari {pages}",pageSize:"Baris per halaman",firstPage:"Halaman pertama",previousPage:"Halaman sebelumnya",nextPage:"Halaman berikutnya",lastPage:"Halaman terakhir",loading:"Memuat\u2026",loadFailed:"Gagal memuat data",filters:"Filter",clearFilters:"Hapus semua filter",exportCsv:"Ekspor CSV",exportExcel:"Ekspor Excel",print:"Cetak\u2026",printLimited:"Dicetak {n} baris pertama dari {total}. Ekspor ke Excel atau CSV untuk semua baris.",pivot:"Pivot",pivotMode:"Mode pivot",pivotRows:"Grup baris",pivotColumns:"Label kolom",pivotValues:"Nilai",total:"Total",addColumn:"Tambah kolom\u2026",chartBar:"Diagram batang",chartStacked:"Diagram batang bertumpuk",chartLine:"Diagram garis",chartArea:"Diagram area",chartPie:"Diagram lingkaran",chartDonut:"Diagram donat",chartCombo:"Diagram batang dan garis",chartScatter:"Diagram sebar",freeBadge:"Versi gratis",exportPdf:"Ekspor PDF",exportJson:"Ekspor JSON",ai:{title:"Asisten AI",placeholder:"Tanyakan tentang data atau beri tahu grid apa yang harus dilakukan",send:"Kirim",thinking:"Memproses\u2026",undo:"Urungkan",undone:"Diurungkan",failed:"Asisten tidak menjawab",skipped:"Dilewati",done:"Selesai"},cf:{title:"Pemformatan bersyarat",add:"Tambah aturan",clear:"Hapus aturan",none:"Tidak ada aturan untuk kolom ini",type:"Aturan",style:"Format",wholeRow:"Seluruh baris",count:"Jumlah",types:{value:"Nilai sel",formula:"Rumus",top:"Teratas",bottom:"Terbawah",aboveAverage:"Di atas rata-rata",belowAverage:"Di bawah rata-rata",duplicate:"Nilai duplikat",unique:"Nilai unik",dataBar:"Bilah data",colorScale:"Skala warna",iconSet:"Set ikon"},ops:{notBetween:"Tidak di antara",notContains:"Tidak berisi"},styles:{red:"Isian merah muda",yellow:"Isian kuning",green:"Isian hijau",blue:"Isian biru",redText:"Teks merah",bold:"Tebal"}},ops:{contains:"Berisi",equals:"Sama dengan",notEquals:"Tidak sama dengan",startsWith:"Diawali",endsWith:"Diakhiri",blank:"Kosong",notBlank:"Tidak kosong",eq:"Sama dengan",ne:"Tidak sama dengan",lt:"Kurang dari",lte:"Kurang dari atau sama dengan",gt:"Lebih dari",gte:"Lebih dari atau sama dengan",between:"Di antara",before:"Sebelum",after:"Sesudah"}},Qo=vs;var xs={code:"ru",noRows:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445",filter:"\u0424\u0438\u043B\u044C\u0442\u0440",apply:"\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C",reset:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C",selectAll:"(\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435)",search:"\u041F\u043E\u0438\u0441\u043A\u2026",blanks:"(\u041F\u0443\u0441\u0442\u044B\u0435)",value:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435",valueTo:"\u041F\u043E",sortAsc:"\u041F\u043E \u0432\u043E\u0437\u0440\u0430\u0441\u0442\u0430\u043D\u0438\u044E",sortDesc:"\u041F\u043E \u0443\u0431\u044B\u0432\u0430\u043D\u0438\u044E",clearSort:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0443",pinLeft:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0441\u043B\u0435\u0432\u0430",pinRight:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0441\u043F\u0440\u0430\u0432\u0430",unpin:"\u041E\u0442\u043A\u0440\u0435\u043F\u0438\u0442\u044C",columnMenu:"\u041C\u0435\u043D\u044E \u0441\u0442\u043E\u043B\u0431\u0446\u0430",selectRow:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443",selectAllRows:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",chooseColumns:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0446\u044B",columns:"\u0421\u0442\u043E\u043B\u0431\u0446\u044B",autosizeThis:"\u041F\u043E\u0434\u043E\u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0441\u0442\u043E\u043B\u0431\u0446\u0430",autosizeAll:"\u041F\u043E\u0434\u043E\u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",resetColumns:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0446\u044B",hideColumn:"\u0421\u043A\u0440\u044B\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446",close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",copy:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",cut:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C",copyWithHeaders:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u043C\u0438",paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C",pasteHint:"\u0414\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0437\u0430\u043F\u0440\u0435\u0449\u0451\u043D. \u041D\u0430\u0436\u043C\u0438\u0442\u0435 Ctrl+V, \u0447\u0442\u043E\u0431\u044B \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C.",required:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435",invalidValue:"\u041D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435",and:"\u0418",or:"\u0418\u043B\u0438",advancedFilter:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0439 \u0444\u0438\u043B\u044C\u0442\u0440",addCondition:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0441\u043B\u043E\u0432\u0438\u0435",duplicate:"\u042D\u0442\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0443\u0436\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F",undo:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",redo:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",deleteRows:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",copyRows:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",statusRows:"\u0421\u0442\u0440\u043E\u043A: {n}",statusFiltered:"{shown} \u0438\u0437 {total} \u0441\u0442\u0440\u043E\u043A",statusSelected:"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}",count:"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E",sum:"\u0421\u0443\u043C\u043C\u0430",avg:"\u0421\u0440\u0435\u0434\u043D\u0435\u0435",min:"\u041C\u0438\u043D.",max:"\u041C\u0430\u043A\u0441.",findPlaceholder:"\u041D\u0430\u0439\u0442\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435",noMatches:"\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",findNext:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435",findPrevious:"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435",groupPanelHint:"\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0441\u044E\u0434\u0430 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0441\u0442\u043E\u043B\u0431\u0446\u0430 \u0434\u043B\u044F \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438",groupByThis:"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u044D\u0442\u043E\u043C\u0443 \u0441\u0442\u043E\u043B\u0431\u0446\u0443",ungroup:"\u0423\u0431\u0440\u0430\u0442\u044C \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0443",expandAll:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0435",collapseAll:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0435",pagerRange:"{from}\u2013{to} \u0438\u0437 {total}",pageOf:"\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 {page} \u0438\u0437 {pages}",pageSize:"\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",firstPage:"\u041F\u0435\u0440\u0432\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",previousPage:"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",nextPage:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",lastPage:"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",loadFailed:"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",filters:"\u0424\u0438\u043B\u044C\u0442\u0440\u044B",clearFilters:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u0441\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B",exportCsv:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 CSV",exportExcel:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 Excel",print:"\u041F\u0435\u0447\u0430\u0442\u044C\u2026",printLimited:"\u041D\u0430\u043F\u0435\u0447\u0430\u0442\u0430\u043D\u044B \u043F\u0435\u0440\u0432\u044B\u0435 {n} \u0438\u0437 {total} \u0441\u0442\u0440\u043E\u043A. \u0427\u0442\u043E\u0431\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0432\u0441\u0435, \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 Excel \u0438\u043B\u0438 CSV.",pivot:"\u0421\u0432\u043E\u0434\u043D\u0430\u044F",pivotMode:"\u0420\u0435\u0436\u0438\u043C \u0441\u0432\u043E\u0434\u043D\u043E\u0439 \u0442\u0430\u0431\u043B\u0438\u0446\u044B",pivotRows:"\u0413\u0440\u0443\u043F\u043F\u044B \u0441\u0442\u0440\u043E\u043A",pivotColumns:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",pivotValues:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u044F",total:"\u0418\u0442\u043E\u0433\u043E",addColumn:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446\u2026",chartBar:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430",chartStacked:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0441 \u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u0435\u043C",chartLine:"\u0413\u0440\u0430\u0444\u0438\u043A",chartArea:"\u0414\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430 \u0441 \u043E\u0431\u043B\u0430\u0441\u0442\u044F\u043C\u0438",chartPie:"\u041A\u0440\u0443\u0433\u043E\u0432\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",chartDonut:"\u041A\u043E\u043B\u044C\u0446\u0435\u0432\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",chartCombo:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0438 \u0433\u0440\u0430\u0444\u0438\u043A",chartScatter:"\u0422\u043E\u0447\u0435\u0447\u043D\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",freeBadge:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u0430\u044F \u0432\u0435\u0440\u0441\u0438\u044F",exportPdf:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 PDF",exportJson:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 JSON",ai:{title:"\u0418\u0418-\u043F\u043E\u043C\u043E\u0449\u043D\u0438\u043A",placeholder:"\u0421\u043F\u0440\u043E\u0441\u0438\u0442\u0435 \u043E \u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u043B\u0438 \u0441\u043A\u0430\u0436\u0438\u0442\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u0435, \u0447\u0442\u043E \u0441\u0434\u0435\u043B\u0430\u0442\u044C",send:"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",thinking:"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u2026",undo:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",undone:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043E",failed:"\u041F\u043E\u043C\u043E\u0449\u043D\u0438\u043A \u043D\u0435 \u043E\u0442\u0432\u0435\u0442\u0438\u043B",skipped:"\u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E",done:"\u0413\u043E\u0442\u043E\u0432\u043E"},cf:{title:"\u0423\u0441\u043B\u043E\u0432\u043D\u043E\u0435 \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435",add:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u043E",clear:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u0430",none:"\u0414\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u0441\u0442\u043E\u043B\u0431\u0446\u0430 \u043D\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B",type:"\u041F\u0440\u0430\u0432\u0438\u043B\u043E",style:"\u0424\u043E\u0440\u043C\u0430\u0442",wholeRow:"\u0412\u0441\u044F \u0441\u0442\u0440\u043E\u043A\u0430",count:"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E",types:{value:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u044F\u0447\u0435\u0439\u043A\u0438",formula:"\u0424\u043E\u0440\u043C\u0443\u043B\u0430",top:"\u041F\u0435\u0440\u0432\u044B\u0435",bottom:"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435",aboveAverage:"\u0412\u044B\u0448\u0435 \u0441\u0440\u0435\u0434\u043D\u0435\u0433\u043E",belowAverage:"\u041D\u0438\u0436\u0435 \u0441\u0440\u0435\u0434\u043D\u0435\u0433\u043E",duplicate:"\u041F\u043E\u0432\u0442\u043E\u0440\u044F\u044E\u0449\u0438\u0435\u0441\u044F \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F",unique:"\u0423\u043D\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F",dataBar:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u044B",colorScale:"\u0426\u0432\u0435\u0442\u043E\u0432\u0430\u044F \u0448\u043A\u0430\u043B\u0430",iconSet:"\u041D\u0430\u0431\u043E\u0440\u044B \u0437\u043D\u0430\u0447\u043A\u043E\u0432"},ops:{notBetween:"\u0412\u043D\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430",notContains:"\u041D\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442"},styles:{red:"\u0421\u0432\u0435\u0442\u043B\u043E-\u043A\u0440\u0430\u0441\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430",yellow:"\u0416\u0451\u043B\u0442\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430",green:"\u0417\u0435\u043B\u0451\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430",blue:"\u0421\u0438\u043D\u044F\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430",redText:"\u041A\u0440\u0430\u0441\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442",bold:"\u041F\u043E\u043B\u0443\u0436\u0438\u0440\u043D\u044B\u0439"}},ops:{contains:"\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442",equals:"\u0420\u0430\u0432\u043D\u043E",notEquals:"\u041D\u0435 \u0440\u0430\u0432\u043D\u043E",startsWith:"\u041D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0441",endsWith:"\u0417\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043D\u0430",blank:"\u041F\u0443\u0441\u0442\u043E",notBlank:"\u041D\u0435 \u043F\u0443\u0441\u0442\u043E",eq:"\u0420\u0430\u0432\u043D\u043E",ne:"\u041D\u0435 \u0440\u0430\u0432\u043D\u043E",lt:"\u041C\u0435\u043D\u044C\u0448\u0435",lte:"\u041C\u0435\u043D\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u043E",gt:"\u0411\u043E\u043B\u044C\u0448\u0435",gte:"\u0411\u043E\u043B\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u043E",between:"\u041C\u0435\u0436\u0434\u0443",before:"\u0414\u043E",after:"\u041F\u043E\u0441\u043B\u0435"}},er=xs;var Cs={code:"pt-BR",noRows:"Nenhuma linha para mostrar",filter:"Filtro",apply:"Aplicar",reset:"Limpar",selectAll:"(Selecionar tudo)",search:"Pesquisar\u2026",blanks:"(Vazios)",value:"Valor",valueTo:"At\xE9",sortAsc:"Ordenar crescente",sortDesc:"Ordenar decrescente",clearSort:"Remover ordena\xE7\xE3o",pinLeft:"Fixar \xE0 esquerda",pinRight:"Fixar \xE0 direita",unpin:"Desafixar",columnMenu:"Menu da coluna",selectRow:"Selecionar linha",selectAllRows:"Selecionar todas as linhas",chooseColumns:"Escolher colunas",columns:"Colunas",autosizeThis:"Ajustar largura desta coluna",autosizeAll:"Ajustar largura de todas as colunas",resetColumns:"Redefinir colunas",hideColumn:"Ocultar coluna",close:"Fechar",copy:"Copiar",cut:"Recortar",copyWithHeaders:"Copiar com cabe\xE7alhos",paste:"Colar",pasteHint:"O acesso \xE0 \xE1rea de transfer\xEAncia foi bloqueado. Pressione Ctrl+V para colar.",required:"Campo obrigat\xF3rio",invalidValue:"Valor inv\xE1lido",and:"E",or:"Ou",advancedFilter:"Filtro avan\xE7ado",addCondition:"Adicionar condi\xE7\xE3o",duplicate:"Este valor j\xE1 est\xE1 em uso",undo:"Desfazer",redo:"Refazer",deleteRows:"Excluir linhas selecionadas",copyRows:"Copiar linhas selecionadas",statusRows:"{n} linhas",statusFiltered:"{shown} de {total} linhas",statusSelected:"{n} selecionadas",count:"Contagem",sum:"Soma",avg:"M\xE9dia",min:"M\xEDn.",max:"M\xE1x.",findPlaceholder:"Localizar na tabela",noMatches:"Nenhum resultado",findNext:"Pr\xF3ximo",findPrevious:"Anterior",groupPanelHint:"Arraste um cabe\xE7alho de coluna aqui para agrupar",groupByThis:"Agrupar por esta coluna",ungroup:"Remover agrupamento",expandAll:"Expandir tudo",collapseAll:"Recolher tudo",pagerRange:"{from}\u2013{to} de {total}",pageOf:"P\xE1gina {page} de {pages}",pageSize:"Linhas por p\xE1gina",firstPage:"Primeira p\xE1gina",previousPage:"P\xE1gina anterior",nextPage:"Pr\xF3xima p\xE1gina",lastPage:"\xDAltima p\xE1gina",loading:"Carregando\u2026",loadFailed:"N\xE3o foi poss\xEDvel carregar as linhas",filters:"Filtros",clearFilters:"Limpar todos os filtros",exportCsv:"Exportar CSV",exportExcel:"Exportar Excel",print:"Imprimir\u2026",printLimited:"Foram impressas as primeiras {n} de {total} linhas. Exporte para Excel ou CSV para obter todas.",pivot:"Piv\xF4",pivotMode:"Modo piv\xF4",pivotRows:"Grupos de linhas",pivotColumns:"R\xF3tulos de coluna",pivotValues:"Valores",total:"Total",addColumn:"Adicionar coluna\u2026",chartBar:"Gr\xE1fico de barras",chartStacked:"Gr\xE1fico de barras empilhadas",chartLine:"Gr\xE1fico de linhas",chartArea:"Gr\xE1fico de \xE1rea",chartPie:"Gr\xE1fico de pizza",chartDonut:"Gr\xE1fico de rosca",chartCombo:"Gr\xE1fico de barras e linhas",chartScatter:"Gr\xE1fico de dispers\xE3o",freeBadge:"Vers\xE3o gratuita",exportPdf:"Exportar PDF",exportJson:"Exportar JSON",ai:{title:"Assistente de IA",placeholder:"Pergunte sobre os dados ou diga \xE0 grade o que fazer",send:"Enviar",thinking:"Processando\u2026",undo:"Desfazer",undone:"Desfeito",failed:"O assistente n\xE3o respondeu",skipped:"Ignorado",done:"Pronto"},cf:{title:"Formata\xE7\xE3o condicional",add:"Adicionar regra",clear:"Limpar regras",none:"Nenhuma regra para esta coluna",type:"Regra",style:"Formato",wholeRow:"Linha inteira",count:"Quantidade",types:{value:"Valor da c\xE9lula",formula:"F\xF3rmula",top:"Primeiros",bottom:"\xDAltimos",aboveAverage:"Acima da m\xE9dia",belowAverage:"Abaixo da m\xE9dia",duplicate:"Valores duplicados",unique:"Valores \xFAnicos",dataBar:"Barras de dados",colorScale:"Escala de cor",iconSet:"Conjunto de \xEDcones"},ops:{notBetween:"N\xE3o est\xE1 entre",notContains:"N\xE3o cont\xE9m"},styles:{red:"Preenchimento vermelho claro",yellow:"Preenchimento amarelo",green:"Preenchimento verde",blue:"Preenchimento azul",redText:"Texto vermelho",bold:"Negrito"}},ops:{contains:"Cont\xE9m",equals:"Igual a",notEquals:"Diferente de",startsWith:"Come\xE7a com",endsWith:"Termina com",blank:"Vazio",notBlank:"N\xE3o vazio",eq:"Igual a",ne:"Diferente de",lt:"Menor que",lte:"Menor ou igual a",gt:"Maior que",gte:"Maior ou igual a",between:"Entre",before:"Antes de",after:"Depois de"}},tr=Cs;var ks={code:"it",noRows:"Nessuna riga da mostrare",filter:"Filtro",apply:"Applica",reset:"Reimposta",selectAll:"(Seleziona tutto)",search:"Cerca\u2026",blanks:"(Vuoti)",value:"Valore",valueTo:"A",sortAsc:"Ordine crescente",sortDesc:"Ordine decrescente",clearSort:"Rimuovi ordinamento",pinLeft:"Blocca a sinistra",pinRight:"Blocca a destra",unpin:"Sblocca",columnMenu:"Menu colonna",selectRow:"Seleziona riga",selectAllRows:"Seleziona tutte le righe",chooseColumns:"Scegli colonne",columns:"Colonne",autosizeThis:"Adatta larghezza di questa colonna",autosizeAll:"Adatta larghezza di tutte le colonne",resetColumns:"Ripristina colonne",hideColumn:"Nascondi colonna",close:"Chiudi",copy:"Copia",cut:"Taglia",copyWithHeaders:"Copia con intestazioni",paste:"Incolla",pasteHint:"Accesso agli appunti bloccato. Premi Ctrl+V per incollare.",required:"Campo obbligatorio",invalidValue:"Valore non valido",and:"E",or:"O",advancedFilter:"Filtro avanzato",addCondition:"Aggiungi condizione",duplicate:"Questo valore \xE8 gi\xE0 in uso",undo:"Annulla",redo:"Ripeti",deleteRows:"Elimina righe selezionate",copyRows:"Copia righe selezionate",statusRows:"{n} righe",statusFiltered:"{shown} di {total} righe",statusSelected:"{n} selezionate",count:"Conteggio",sum:"Somma",avg:"Media",min:"Min",max:"Max",findPlaceholder:"Trova nella tabella",noMatches:"Nessun risultato",findNext:"Successivo",findPrevious:"Precedente",groupPanelHint:"Trascina qui un'intestazione di colonna per raggruppare",groupByThis:"Raggruppa per questa colonna",ungroup:"Rimuovi raggruppamento",expandAll:"Espandi tutto",collapseAll:"Comprimi tutto",pagerRange:"{from}\u2013{to} di {total}",pageOf:"Pagina {page} di {pages}",pageSize:"Righe per pagina",firstPage:"Prima pagina",previousPage:"Pagina precedente",nextPage:"Pagina successiva",lastPage:"Ultima pagina",loading:"Caricamento\u2026",loadFailed:"Impossibile caricare le righe",filters:"Filtri",clearFilters:"Rimuovi tutti i filtri",exportCsv:"Esporta CSV",exportExcel:"Esporta Excel",print:"Stampa\u2026",printLimited:"Stampate le prime {n} di {total} righe. Esporta in Excel o CSV per averle tutte.",pivot:"Pivot",pivotMode:"Modalit\xE0 pivot",pivotRows:"Gruppi di righe",pivotColumns:"Etichette di colonna",pivotValues:"Valori",total:"Totale",addColumn:"Aggiungi colonna\u2026",chartBar:"Grafico a barre",chartStacked:"Grafico a barre in pila",chartLine:"Grafico a linee",chartArea:"Grafico ad area",chartPie:"Grafico a torta",chartDonut:"Grafico ad anello",chartCombo:"Grafico a barre e linee",chartScatter:"Grafico a dispersione",freeBadge:"Versione gratuita",exportPdf:"Esporta PDF",exportJson:"Esporta JSON",ai:{title:"Assistente IA",placeholder:"Chiedi qualcosa sui dati o di\u2019 alla griglia cosa fare",send:"Invia",thinking:"In corso\u2026",undo:"Annulla",undone:"Annullato",failed:"L'assistente non ha risposto",skipped:"Saltato",done:"Fatto"},cf:{title:"Formattazione condizionale",add:"Aggiungi regola",clear:"Cancella regole",none:"Nessuna regola per questa colonna",type:"Regola",style:"Formato",wholeRow:"Intera riga",count:"Numero",types:{value:"Valore cella",formula:"Formula",top:"Primi",bottom:"Ultimi",aboveAverage:"Sopra la media",belowAverage:"Sotto la media",duplicate:"Valori duplicati",unique:"Valori univoci",dataBar:"Barre dei dati",colorScale:"Scala di colori",iconSet:"Set di icone"},ops:{notBetween:"Non compreso tra",notContains:"Non contiene"},styles:{red:"Riempimento rosso chiaro",yellow:"Riempimento giallo",green:"Riempimento verde",blue:"Riempimento blu",redText:"Testo rosso",bold:"Grassetto"}},ops:{contains:"Contiene",equals:"Uguale a",notEquals:"Diverso da",startsWith:"Inizia con",endsWith:"Finisce con",blank:"Vuoto",notBlank:"Non vuoto",eq:"Uguale a",ne:"Diverso da",lt:"Minore di",lte:"Minore o uguale a",gt:"Maggiore di",gte:"Maggiore o uguale a",between:"Tra",before:"Prima di",after:"Dopo"}},nr=ks;function K(o){return o==null||typeof o=="string"&&o.trim()===""||typeof o=="number"&&Number.isNaN(o)}var or=o=>String(o).padStart(2,"0");function ie(o){if(K(o))return null;if(typeof o=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(o))return o;let e=o instanceof Date?o:new Date(o);return Number.isNaN(e.getTime())?null:`${e.getFullYear()}-${or(e.getMonth()+1)}-${or(e.getDate())}`}function ne(o){var e;return K(o)?"":o instanceof Date?(e=ie(o))!=null?e:"":String(o)}var we=()=>!0;function At(o){var e;switch(o.type){case"combined":{let t=(Array.isArray(o.conditions)?o.conditions:[]).map(At);return t.length?o.operator==="or"?n=>t.some(r=>r(n)):n=>t.every(r=>r(n)):we}case"text":{let t=((e=o.value)!=null?e:"").toLowerCase(),n=r=>K(r)?"":String(r).toLowerCase();switch(o.op){case"contains":return r=>n(r).includes(t);case"equals":return r=>n(r)===t;case"notEquals":return r=>n(r)!==t;case"startsWith":return r=>n(r).startsWith(t);case"endsWith":return r=>n(r).endsWith(t);case"blank":return K;case"notBlank":return r=>!K(r)}return we}case"number":{let t=r=>K(r)?NaN:Number(r);if(o.op==="blank")return r=>Number.isNaN(t(r));if(o.op==="notBlank")return r=>!Number.isNaN(t(r));let n=o.value;if(n==null||Number.isNaN(n))return we;switch(o.op){case"eq":return r=>t(r)===n;case"ne":return r=>t(r)!==n;case"lt":return r=>t(r)<n;case"lte":return r=>t(r)<=n;case"gt":return r=>t(r)>n;case"gte":return r=>t(r)>=n;case"between":{let r=o.valueTo;if(r==null||Number.isNaN(r))return we;let i=Math.min(n,r),s=Math.max(n,r);return a=>{let l=t(a);return l>=i&&l<=s}}}return we}case"date":{if(o.op==="blank")return r=>ie(r)===null;if(o.op==="notBlank")return r=>ie(r)!==null;let t=o.value;if(!t)return we;let n=r=>ie(r);switch(o.op){case"equals":return r=>n(r)===t;case"before":return r=>{let i=n(r);return i!==null&&i<t};case"after":return r=>{let i=n(r);return i!==null&&i>t};case"between":{let r=o.valueTo;if(!r)return we;let i=t<r?t:r,s=t<r?r:t;return a=>{let l=n(a);return l!==null&&l>=i&&l<=s}}}return we}case"set":{let t=new Set(o.values.map(ne));return n=>t.has(ne(n))}}return we}function rr(o){let e=o.trim().toLowerCase();return e?e.split(/\s+/):[]}function ir(o,e){return o.every(t=>e.includes(t))}function Bn(o,e,t){let n=[];for(let r of Array.isArray(o==null?void 0:o.conditions)?o.conditions:[]){if(!r||typeof r!="object")continue;if("conditions"in r){let a=Bn(r,e,t);a&&n.push(a);continue}let i=e(r.colId);if(!i||!r.model)continue;let s=At(r.model);n.push(a=>s(t(i,a)))}return n.length?o.operator==="or"?r=>n.some(i=>i(r)):r=>n.every(i=>i(r)):null}var sr=new Map,ar=new Map;function Re(o,e){let t=`${o}|${e!=null?e:""}`,n=ar.get(t);return n||(n=new Intl.NumberFormat(o,e==null?void 0:{maximumFractionDigits:e}),ar.set(t,n)),n}function Rs(o){var r;if(o==="integer")return{maximumFractionDigits:0};if(o==="percent")return{style:"percent"};if(o.startsWith("currency:"))return{style:"currency",currency:o.slice(9)};if(!/^[#0,]*(\.[#0]+)?%?$/.test(o)||!/[#0]/.test(o))return null;let e=o.endsWith("%"),t=e?o.slice(0,-1):o,n=t.includes(".")?t.split(".")[1]:"";return{useGrouping:t.includes(","),minimumFractionDigits:((r=n.match(/0/g))!=null?r:[]).length,maximumFractionDigits:n.length,...e?{style:"percent"}:{}}}var Tt={date:{year:"numeric",month:"2-digit",day:"2-digit"},datetime:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},time:{hour:"2-digit",minute:"2-digit"},short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"}};function me(o){if(K(o))return null;if(o instanceof Date)return Number.isNaN(o.getTime())?null:o;if(typeof o=="string"){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(o);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]))}if(typeof o!="string"&&typeof o!="number")return null;let e=new Date(o);return Number.isNaN(e.getTime())?null:e}function Ss(o,e,t){var n;switch(o){case"number":{let r={};if(typeof e=="string"){let s=Rs(e);s||V(`unknown number format "${e}"`),r=s!=null?s:{}}else e&&(r=e);let i=new Intl.NumberFormat(t,r);return s=>{if(K(s))return"";let a=typeof s=="number"?s:Number(s);return Number.isNaN(a)?String(s):i.format(a)}}case"date":{if(t.toLowerCase().startsWith("ko")&&(e===void 0||e==="date"||e==="datetime")){let s=l=>String(l).padStart(2,"0"),a=e==="datetime";return l=>{let c=me(l);if(!c)return K(l)?"":String(l);let d=`${c.getFullYear()}-${s(c.getMonth()+1)}-${s(c.getDate())}`;return a?`${d} ${s(c.getHours())}:${s(c.getMinutes())}`:d}}let r=Tt.date;typeof e=="string"?(Tt[e]||V(`unknown date format "${e}"`),r=(n=Tt[e])!=null?n:Tt.date):e&&(r=e);let i=new Intl.DateTimeFormat(t,r);return s=>{let a=me(s);return a?i.format(a):K(s)?"":String(s)}}case"boolean":return r=>r===!0?"\u2713":r===!1?"\u2717":"";default:return r=>K(r)?"":r instanceof Date?r.toISOString():String(r)}}var Ms=o=>Array.isArray(o)?o.join(", "):o==null?"":String(o),Hn=new WeakMap,Gn=new WeakMap;function lr(){Hn=new WeakMap,Gn=new WeakMap}function at(o,e,t,n=o.format){if(e===o.type&&n===o.format)return ee(o,t);if(n!==o.format&&typeof n!="string")return ee({...o,type:e,format:n},t);let r=Gn.get(o);r||Gn.set(o,r=new Map);let i=`${e!=null?e:""}|${n===o.format?"":`=${n}`}`,s=r.get(i);return s||r.set(i,s={...o,type:e,format:n}),ee(s,t)}function ee(o,e){var s;if(o.sparkline)return Ms;let t=o.format,n=Hn.get(o);if(n&&n.locale===e&&n.type===o.type&&n.format===t)return n.fmt;let r=`${e}|${(s=o.type)!=null?s:"text"}|${typeof t=="string"?t:JSON.stringify(t!=null?t:null)}`,i=sr.get(r);return i||(i=Ss(o.type,t,e),sr.set(r,i)),Hn.set(o,{locale:e,type:o.type,format:t,fmt:i}),i}var le="__fg_select__",dr={id:le,header:"",width:44,minWidth:44,maxWidth:44,pinned:"left",sortable:!1,resizable:!1,filter:!1},Ie="__fg_drag__",cr={id:Ie,header:"",width:28,minWidth:28,maxWidth:28,pinned:"left",sortable:!1,resizable:!1,filter:!1,chooser:!1},Se="__fg_rownum__",ur=(o=52,e="#")=>({id:Se,header:e,width:o,minWidth:o,maxWidth:o,pinned:"left",sortable:!1,resizable:!1,filter:!1,chooser:!1}),G=o=>o===le||o===Ie||o===Se,Es=120,As=40,Ts=["left","center","right"];function ue(o){if(G(o.id)||o.filter===!1)return null;if(o.filter)return o.filter;switch(o.type){case"number":return"number";case"date":return"date";case"boolean":return"set";default:return"text"}}function ye(o,e,t){let n=o.editable;if(typeof n!="function")return!!n;try{return!!n({value:o.valueGetter?o.valueGetter(e):o.field?e[o.field]:void 0,row:e,rowIndex:t,column:o})}catch{return!1}}var De=o=>o.id!==le&&o.sortable!==!1,Ft=o=>o.id!==le&&o.resizable!==!1;function Lt(o,e){var r,i;let t=(r=o.minWidth)!=null?r:As,n=(i=o.maxWidth)!=null?i:1/0;return Math.round(Math.min(n,Math.max(t,e)))}function fr(o){return o.children?1+Math.max(0,...o.children.map(fr)):1}var Pt=class{constructor(e){this.depth=1;this.roots_=[];this.defs=[];this.byId=new Map;this.containerWidth=0;this.layout={left:[],center:[],right:[]};this.leafById=new Map;this.declared=[];this.setDefs(e)}setDefs(e){lr(),this.defs=e,this.byId=new Map;let t=0,n=(i,s,a)=>{var f,p,h,g,w;let l=Array.isArray(i.children)&&i.children.length>0,c=t++,d=(f=i.id)!=null?f:l?`g${c}`:i.field;if(d||(d=`c${c}`,V(`column #${c} has neither "field" nor "id"; using "${d}"`)),this.byId.has(d)){let m=1;for(;this.byId.has(`${d}_${m}`);)m++;V(`duplicate column id "${d}"; renamed to "${d}_${m}"`),d=`${d}_${m}`}let u={id:d,def:i,parent:s,children:null,depth:a,width:Lt(i,(p=i.width)!=null?p:Es),flex:i.flex&&i.flex>0?i.flex:null,hide:(h=i.hide)!=null?h:!1,pinned:(w=(g=i.pinned)!=null?g:s==null?void 0:s.pinned)!=null?w:null,open:!!i.openByDefault};return this.byId.set(d,u),l&&(u.children=r(i.children).map(m=>n(m,u,a+1))),u},r=i=>{let s=i.filter(a=>a!==null&&typeof a=="object");return s.length!==i.length&&V("columns contain entries that are not objects; they were skipped"),s};this.roots_=r(e).map(i=>n(i,null,0)),this.declared=this.leafNodes().map(i=>i.id),this.depth=Math.max(1,...this.roots_.map(fr)),this.relayout()}updateDefs(e){var s,a,l,c;let t=new Map(this.byId),n=this.declared,r=this.leafNodes().map(d=>d.id);this.setDefs(e);for(let[d,u]of this.byId){let f=t.get(d);if(!f||!!f.children!=!!u.children)continue;let p=f.def,h=u.def;p.width===h.width&&p.flex===h.flex&&p.minWidth===h.minWidth&&p.maxWidth===h.maxWidth&&(u.width=f.width,u.flex=f.flex),((s=p.hide)!=null?s:!1)===((a=h.hide)!=null?a:!1)&&(u.hide=f.hide),p.pinned===h.pinned&&((l=f.parent)==null?void 0:l.def.pinned)===((c=u.parent)==null?void 0:c.def.pinned)&&(u.pinned=f.pinned),!!p.openByDefault==!!h.openByDefault&&(u.open=f.open)}let i=(d,u)=>d.length===u.length&&d.every((f,p)=>f===u[p]);i(n,this.declared)&&!i(r,n)?this.applyState(r.map(d=>({colId:d}))):this.relayout()}setContainerWidth(e){if(e===this.containerWidth)return!1;this.containerWidth=e;let t=this.displayed().map(n=>n.width).join();return this.relayout(),t!==this.displayed().map(n=>n.width).join()}roots(){return this.roots_}reset(){this.setDefs(this.defs)}region(e){return this.layout[e]}displayed(){return[...this.layout.left,...this.layout.center,...this.layout.right]}regionWidth(e){let t=this.layout[e],n=t[t.length-1];return n?n.left+n.width:0}getColumn(e){return this.leafById.get(e)}getNode(e){return this.byId.get(e)}siblings(e){let t=this.byId.get(e);return t?t.parent?t.parent.children:this.roots_:[]}setWidth(e,t){let n=this.byId.get(e);return!n||n.children?0:(n.flex=null,n.width=Lt(n.def,t),this.relayout(),n.width)}setPinned(e,t){let n=this.byId.get(e);!n||n.children||G(e)||(n.pinned=t,this.relayout())}setHide(e,t){let n=this.byId.get(e);!n||n.children||(n.hide=t,this.relayout())}move(e,t){let n=this.siblings(e),r=n.findIndex(s=>s.id===e);if(r<0)return;let[i]=n.splice(r,1);n.splice(Math.max(0,Math.min(n.length,t)),0,i),this.relayout()}headerCells(e){var r,i,s;let t=[],n=new Map;for(let a of this.layout[e]){let l=[];for(let c=a.node.parent;c;c=c.parent)l.unshift(c);for(let c of l){let d=n.get(c.id);if(d){d.width+=a.width;continue}let u={id:c.id,label:(r=c.def.header)!=null?r:"",isGroup:!0,column:null,node:c,row:c.depth,rowSpan:1,left:a.left,width:a.width};n.set(c.id,u),t.push(u)}t.push({id:a.id,label:(s=(i=a.def.header)!=null?i:a.def.field)!=null?s:"",isGroup:!1,column:a,node:a.node,row:a.node.depth,rowSpan:this.depth-a.node.depth,left:a.left,width:a.width})}return t}getState(){return this.leafNodes().filter(e=>!G(e.id)).map(e=>{var t,n,r;return{colId:e.id,width:(n=(t=this.leafById.get(e.id))==null?void 0:t.width)!=null?n:e.width,hide:!!e.hide,pinned:(r=e.pinned)!=null?r:null}})}applyState(e){let t=new Map;e.forEach((i,s)=>{t.set(i.colId,s);let a=this.byId.get(i.colId);!a||a.children||G(i.colId)||(typeof i.width=="number"&&Number.isFinite(i.width)&&(a.flex=null,a.width=Lt(a.def,i.width)),typeof i.hide=="boolean"&&(a.hide=i.hide),"pinned"in i&&(a.pinned=i.pinned==="left"||i.pinned==="right"?i.pinned:null))}),t.set(Se,-3),t.set(Ie,-2),t.set(le,-1);let n=i=>{var s;return i.children?Math.min(1/0,...i.children.map(n)):(s=t.get(i.id))!=null?s:1/0},r=i=>{let s=i.map((a,l)=>({n:a,i:l,r:n(a)}));s.sort((a,l)=>a.r===l.r?a.i-l.i:a.r-l.r),i.splice(0,i.length,...s.map(a=>a.n));for(let a of i)a.children&&r(a.children)};r(this.roots_),this.relayout()}leafNodes(){let e=[],t=n=>n.children?n.children.forEach(t):e.push(n);return this.roots_.forEach(t),e}isCollapsible(e){var t;return!!((t=e.children)!=null&&t.some(n=>n.def.columnGroupShow==="open"||n.def.columnGroupShow==="closed"))}setGroupOpen(e,t){let n=this.byId.get(e);return!(n!=null&&n.children)||n.open===t?!1:(n.open=t,this.relayout(),!0)}groupOpenState(){let e={};for(let t of this.byId.values())this.isCollapsible(t)&&(e[t.id]=t.open);return e}shownByGroups(e){for(let t=e;t!=null&&t.parent;t=t.parent){let n=t.def.columnGroupShow;if(n==="open"&&!t.parent.open||n==="closed"&&t.parent.open)return!1}return!0}relayout(){var l;let e=this.leafNodes().filter(c=>!c.hide&&this.shownByGroups(c)),t=e.reduce((c,d)=>c+(d.flex?0:d.width),0),n=e.reduce((c,d)=>{var u;return c+((u=d.flex)!=null?u:0)},0),r=Math.max(0,this.containerWidth-t),i=c=>c.flex?Lt(c.def,Math.floor(r*c.flex/n)):c.width,s={left:[],center:[],right:[]};this.leafById=new Map;let a=0;for(let c of Ts){let d=0;for(let u of e){if(((l=u.pinned)!=null?l:"center")!==c)continue;let f={id:u.id,def:u.def,node:u,width:i(u),region:c,left:d,index:a++};d+=f.width,s[c].push(f),this.leafById.set(u.id,f)}}this.layout=s}};var _=class extends Error{constructor(t){super(t);this.code=t}},Ls=/^#(?:[A-Z/0]+[!?]|N\/A)$/,Je=o=>typeof o=="string"&&Ls.test(o);function Ps(o){let e=[],t=0;for(;t<o.length;){let n=o[t];if(/\s/.test(n))t++;else if(/[0-9.]/.test(n)){let r=/^(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/i.exec(o.slice(t));if(!r)throw new _("#ERROR!");e.push({t:"num",v:Number(r[0])}),t+=r[0].length}else if(n==='"'){let r="";for(t++;;){if(t>=o.length)throw new _("#ERROR!");if(o[t]==='"'){if(o[t+1]==='"'){r+='"',t+=2;continue}t++;break}r+=o[t++]}e.push({t:"str",v:r})}else if(n==="["){let r=o.indexOf("]",t);if(r<0)throw new _("#ERROR!");e.push({t:"id",v:o.slice(t+1,r)}),t=r+1}else if(/[A-Za-z_À-￿]/.test(n)){let r=/^[A-Za-z_À-￿][\wÀ-￿.]*/.exec(o.slice(t));e.push({t:"id",v:r[0]}),t+=r[0].length}else{let r=o.slice(t,t+2);if(r==="<>"||r==="<="||r===">=")e.push({t:"op",v:r}),t+=2;else if("+-*/%^&=<>(),;".includes(n))e.push({t:"op",v:n===";"?",":n}),t++;else throw new _("#ERROR!")}}return e}var de=o=>o==null||o==="";function q(o){if(typeof o=="number")return o;if(typeof o=="boolean")return o?1:0;if(de(o))return 0;if(o instanceof Date)return o.getTime();if(typeof o=="string"&&o.trim()!==""&&Number.isFinite(Number(o)))return Number(o);throw new _("#VALUE!")}var Q=o=>de(o)?"":typeof o=="boolean"?o?"TRUE":"FALSE":o instanceof Date?lt(o):String(o),Ee=o=>typeof o=="boolean"?o:typeof o=="string"&&/^(true|false)$/i.test(o)?o.toLowerCase()==="true":q(o)!==0;function It(o,e,t="near"){let n=Math.trunc(e),r=t==="near"?Math.round:t==="up"?Math.ceil:Math.floor,i=(a,l)=>{let[c,d="0"]=String(a).split("e");return+`${c}e${Number(d)+l}`},s=i(r(i(Math.abs(o),n)),-n);return o<0?-s:s}function dt(o,e){let t=n=>typeof n=="number"||typeof n=="boolean"||de(n);return t(o)&&t(e)?q(o)-q(e):o instanceof Date||e instanceof Date?q(fe(o))-q(fe(e)):Q(o).localeCompare(Q(e),void 0,{sensitivity:"accent"})}var Me=o=>o.flatMap(e=>Array.isArray(e)?e:[e]);var $e=o=>o.flatMap(e=>Array.isArray(e)?vr(e).filter(t=>typeof t=="number"&&Number.isFinite(t)):de(e)?[]:[q(e)]);function vr(o){let e=o.find(Je);if(e!==void 0)throw new _(e);return o}function fe(o){var e,t,n;if(o instanceof Date)return o;if(typeof o=="number")return new Date(o);if(typeof o=="string"){let r=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/.exec(o.trim());if(r)return new Date(+r[1],+r[2]-1,+r[3],+((e=r[4])!=null?e:0),+((t=r[5])!=null?t:0),+((n=r[6])!=null?n:0))}throw new _("#VALUE!")}var $t=o=>String(o).padStart(2,"0");function lt(o){return`${o.getFullYear()}-${$t(o.getMonth()+1)}-${$t(o.getDate())}`}var Fs=864e5,pr=o=>Math.round(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate())/Fs);function xr(o){var i;if(typeof o!="string")return s=>dt(s,o)===0&&!de(s)==!de(o);let e=/^(<=|>=|<>|<|>|=)?(.*)$/s.exec(o),t=(i=e[1])!=null?i:"=",n=e[2],r=n.trim()!==""&&Number.isFinite(Number(n))?Number(n):n;if((t==="="||t==="<>")&&typeof r=="string"&&/[*?]/.test(r)){let s=new RegExp(`^${r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".")}$`,"i");return t==="="?a=>s.test(Q(a)):a=>!s.test(Q(a))}return s=>{if(t==="="&&r==="")return de(s);if(t==="<>"&&r==="")return!de(s);if(typeof r=="number"&&typeof s!="number"&&!(typeof s=="string"&&s.trim()!==""&&Number.isFinite(Number(s))))return t==="<>";let a;try{a=dt(s,r)}catch{return!1}return t==="="?a===0:t==="<>"?a!==0:t==="<"?a<0:t===">"?a>0:t==="<="?a<=0:a>=0}}function Ae(o){if(Array.isArray(o))return o;throw new _("#VALUE!")}function hr(o,e,t){let n=Ae(e),r=xr(t),i=[],s=vr(o.length?Ae(o[0]):n);return n.forEach((a,l)=>{let c=s[l];r(a)&&typeof c=="number"&&Number.isFinite(c)&&i.push(c)}),i}var ge={SUM:o=>$e(o).reduce((e,t)=>e+t,0),AVG:o=>{let e=$e(o);if(!e.length)throw new _("#DIV/0!");return e.reduce((t,n)=>t+n,0)/e.length},MIN:o=>{let e=$e(o);return e.length?e.reduce((t,n)=>Math.min(t,n)):0},MAX:o=>{let e=$e(o);return e.length?e.reduce((t,n)=>Math.max(t,n)):0},MEDIAN:o=>{let e=$e(o).sort((n,r)=>n-r);if(!e.length)throw new _("#NUM!");let t=e.length>>1;return e.length%2?e[t]:(e[t-1]+e[t])/2},COUNT:o=>Me(o).filter(e=>typeof e=="number"&&Number.isFinite(e)).length,COUNTA:o=>Me(o).filter(e=>!de(e)).length,COUNTBLANK:o=>Me(o).filter(de).length,PRODUCT:o=>$e(o).reduce((e,t)=>e*t,1),ROUND:o=>It(q(o[0]),o.length>1?q(o[1]):0),ROUNDUP:o=>It(q(o[0]),o.length>1?q(o[1]):0,"up"),ROUNDDOWN:o=>It(q(o[0]),o.length>1?q(o[1]):0,"down"),INT:o=>Math.floor(q(o[0])),TRUNC:o=>It(q(o[0]),o.length>1?q(o[1]):0,q(o[0])<0?"up":"down"),ABS:o=>Math.abs(q(o[0])),SIGN:o=>Math.sign(q(o[0])),SQRT:o=>{let e=q(o[0]);if(e<0)throw new _("#NUM!");return Math.sqrt(e)},POWER:o=>q(o[0])**q(o[1]),EXP:o=>Math.exp(q(o[0])),LN:o=>{let e=q(o[0]);if(e<=0)throw new _("#NUM!");return Math.log(e)},LOG10:o=>{let e=q(o[0]);if(e<=0)throw new _("#NUM!");return Math.log10(e)},MOD:o=>{let e=q(o[1]);if(e===0)throw new _("#DIV/0!");let t=q(o[0]);return t-e*Math.floor(t/e)},CEILING:o=>{let e=o.length>1?q(o[1]):1;return e===0?0:Math.ceil(q(o[0])/e)*e},FLOOR:o=>{let e=o.length>1?q(o[1]):1;return e===0?0:Math.floor(q(o[0])/e)*e},PI:()=>Math.PI,CONCAT:o=>Me(o).map(Q).join(""),TEXTJOIN:o=>Me(o.slice(2)).filter(e=>!Ee(o[1])||!de(e)).map(Q).join(Q(o[0])),LEN:o=>Q(o[0]).length,LEFT:o=>Q(o[0]).slice(0,o.length>1?Math.max(0,q(o[1])):1),RIGHT:o=>{let e=Q(o[0]),t=o.length>1?Math.max(0,q(o[1])):1;return t?e.slice(-t):""},MID:o=>Q(o[0]).substr(Math.max(0,q(o[1])-1),Math.max(0,q(o[2]))),UPPER:o=>Q(o[0]).toUpperCase(),LOWER:o=>Q(o[0]).toLowerCase(),PROPER:o=>Q(o[0]).toLowerCase().replace(/(^|[^\p{L}])(\p{L})/gu,(e,t,n)=>t+n.toUpperCase()),TRIM:o=>Q(o[0]).trim().replace(/\s+/g," "),SUBSTITUTE:o=>Q(o[0]).split(Q(o[1])).join(Q(o[2])),REPLACE:o=>{let e=Q(o[0]),t=Math.max(0,q(o[1])-1);return e.slice(0,t)+Q(o[3])+e.slice(t+Math.max(0,q(o[2])))},REPT:o=>Q(o[0]).repeat(Math.max(0,Math.min(1e4,q(o[1])))),FIND:o=>{let e=Q(o[1]).indexOf(Q(o[0]),o.length>2?q(o[2])-1:0);if(e<0)throw new _("#VALUE!");return e+1},SEARCH:o=>{let e=Q(o[1]).toLowerCase().indexOf(Q(o[0]).toLowerCase(),o.length>2?q(o[2])-1:0);if(e<0)throw new _("#VALUE!");return e+1},VALUE:o=>q(Q(o[0]).replace(/,/g,"")),TEXT:o=>{var s,a;let e=o[0],t=Q(o[1]),n=(a=(s=/0\.(0+)/.exec(t))==null?void 0:s[1].length)!=null?a:0;if(/[yd]/i.test(t)){let l=fe(e);return t.replace(/yyyy/gi,String(l.getFullYear())).replace(/mm/g,$t(l.getMonth()+1)).replace(/dd/gi,$t(l.getDate()))}let r=q(e);return t.includes("%")?(r*100).toFixed(n)+"%":t.includes(",")?r.toLocaleString("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}):r.toFixed(n)},AND:o=>Me(o).every(Ee),OR:o=>Me(o).some(Ee),XOR:o=>Me(o).filter(Ee).length%2===1,NOT:o=>!Ee(o[0]),ISBLANK:o=>de(o[0]),ISNUMBER:o=>typeof o[0]=="number"&&Number.isFinite(o[0]),ISTEXT:o=>typeof o[0]=="string"&&!Je(o[0]),ISERROR:o=>Je(o[0]),TODAY:()=>lt(new Date),NOW:()=>new Date,DATE:o=>lt(new Date(q(o[0]),q(o[1])-1,q(o[2]))),YEAR:o=>fe(o[0]).getFullYear(),MONTH:o=>fe(o[0]).getMonth()+1,DAY:o=>fe(o[0]).getDate(),WEEKDAY:o=>fe(o[0]).getDay()+1,DAYS:o=>pr(fe(o[0]))-pr(fe(o[1])),EDATE:o=>{let e=fe(o[0]),t=e.getDate(),n=new Date(e.getFullYear(),e.getMonth()+q(o[1]),1);return n.setDate(Math.min(t,new Date(n.getFullYear(),n.getMonth()+1,0).getDate())),lt(n)},EOMONTH:o=>{let e=fe(o[0]);return lt(new Date(e.getFullYear(),e.getMonth()+q(o[1])+1,0))},SUMIF:o=>hr(o.slice(2),Ae(o[0]),o[1]).reduce((e,t)=>e+t,0),COUNTIF:o=>{let e=xr(o[1]);return Ae(o[0]).filter(e).length},AVERAGEIF:o=>{let e=hr(o.slice(2),Ae(o[0]),o[1]);if(!e.length)throw new _("#DIV/0!");return e.reduce((t,n)=>t+n,0)/e.length},LOOKUP:o=>{let e=Ae(o[1]),t=o.length>2?Ae(o[2]):e,n=e.findIndex(r=>{try{return dt(r,o[0])===0}catch{return!1}});if(n<0){if(o.length>3)return o[3];throw new _("#N/A")}return t[n]},RANK:o=>{let e=q(o[0]),t=$e([Ae(o[1])]),n=o.length>2&&Ee(o[2]);return 1+t.filter(r=>n?r<e:r>e).length}};ge.AVERAGE=ge.AVG;ge.XLOOKUP=ge.LOOKUP;ge.CONCATENATE=ge.CONCAT;var Nt=new Map;function Cr(o,e){typeof o!="string"||!/^[A-Za-z_][\w.]*$/.test(o)||typeof e!="function"||(Nt.set(o.toUpperCase(),e),_e.clear())}function kr(){return[...new Set([...Object.keys(ge),...Is,...Ds,...Nt.keys()])].sort()}var Is=["IF","IFS","IFERROR","IFNA","SWITCH","CHOOSE"],Ds=["COL","PREV","NEXT","ROW"],zn=class{constructor(e){this.tokens=e;this.i=0}parse(){let e=this.comparison();if(this.i<this.tokens.length)throw new _("#ERROR!");return e}peek(e){let t=this.tokens[this.i];return!!t&&t.t==="op"&&(e===void 0||t.v===e)}take(e){return this.peek(e)?(this.i++,!0):!1}comparison(){let e=this.concat();for(let t of["=","<>","<=",">=","<",">"])if(this.take(t))return{k:"bin",op:t,a:e,b:this.concat()};return e}concat(){let e=this.additive();for(;this.take("&");)e={k:"bin",op:"&",a:e,b:this.additive()};return e}additive(){let e=this.multiplicative();for(;;)if(this.take("+"))e={k:"bin",op:"+",a:e,b:this.multiplicative()};else if(this.take("-"))e={k:"bin",op:"-",a:e,b:this.multiplicative()};else return e}multiplicative(){let e=this.unary();for(;;)if(this.take("*"))e={k:"bin",op:"*",a:e,b:this.unary()};else if(this.take("/"))e={k:"bin",op:"/",a:e,b:this.unary()};else if(this.take("%"))e={k:"bin",op:"%",a:e,b:this.unary()};else return e}unary(){return this.take("-")?{k:"un",op:"-",a:this.unary()}:this.take("+")?{k:"un",op:"+",a:this.unary()}:this.power()}power(){let e=this.primary();return this.take("^")?{k:"bin",op:"^",a:e,b:this.unary()}:e}primary(){let e=this.tokens[this.i++];if(!e)throw new _("#ERROR!");if(e.t==="num"||e.t==="str")return{k:"lit",v:e.v};if(e.t==="op"){if(e.v!=="(")throw new _("#ERROR!");let n=this.comparison();if(!this.take(")"))throw new _("#ERROR!");return n}let t=e.v;if(this.peek("(")){this.i++;let n=[];if(!this.take(")")){do n.push(this.comparison());while(this.take(","));if(!this.take(")"))throw new _("#ERROR!")}let r=t.toUpperCase();if((r==="COL"||r==="PREV"||r==="NEXT")&&(!n.length||n[0].k!=="ref"))throw new _("#ERROR!");let i=r!=="PREV"&&r!=="NEXT"&&r!=="ROW"&&n.every(s=>Dt(s,r==="COL"));return{k:"call",name:r,args:n,rowFree:i}}return/^(true|false)$/i.test(t)?{k:"lit",v:t.toLowerCase()==="true"}:{k:"ref",name:t}}};function Dt(o,e=!1){return o.k==="lit"?!0:o.k==="ref"?e:o.k==="un"?Dt(o.a):o.k==="bin"?Dt(o.a)&&Dt(o.b):o.rowFree}var _e=new Map,$s=2e3;function Rr(o){let e=_e.get(o);if(!e){try{e=new zn(Ps(o.slice(1))).parse()}catch(t){e=t instanceof _?t:new _("#ERROR!")}_e.size>=$s&&_e.delete(_e.keys().next().value),_e.set(o,e)}if(e instanceof _)throw e;return e}var mr=new WeakMap;function Te(o){let e=o.rows(),t=o.version(),n=mr.get(o);return(!n||n.data!==e||n.version!==t)&&(n={data:e,version:t,index:null,cols:new Map,values:new WeakMap,rowFree:new Map,filled:new Map},mr.set(o,n)),n}var Vn=new WeakMap;function Sr(o,e){for(let t of o)t&&typeof t=="object"&&Vn.set(t,e)}var Mr=32;function qn(o,e){let{row:t,scope:n}=o;if(t&&Object.hasOwn(t,e)){let i=t[e];return typeof i=="string"&&i.startsWith("=")&&i.length>1?gr(o,e,i):i}let r=n==null?void 0:n.computed(e);if(r!==void 0)return gr(o,e,r);throw new _("#REF!")}function gr(o,e,t){if(o.seen.has(e)||o.depth>=Mr)throw new _("#CYCLE!");let n;if(o.memo.has(e))n=o.memo.get(e);else{let r=o.scope?Te(o.scope).values.get(o.row):void 0;r!=null&&r.has(e)?n=r.get(e):(n=Ot(t,{...o,seen:new Set([...o.seen,e]),depth:o.depth+1}),o.memo.set(e,n))}if(Je(n))throw new _(n);return n}function Ns(o,e,t){var l,c;let n=o.scope;if(!n)throw new _("#REF!");let r=Te(n);if(e<0||e>=r.data.length)return null;let i=r.data[e],s=(l=r.filled.get(t))!=null?l:-1;if(e>s+1&&e-s>1)for(let d=s+1;d<e;d++)ct(n,r,r.data[d],t);let a=ct(n,r,i,t);if(e>((c=r.filled.get(t))!=null?c:-1)&&r.filled.set(t,e),Je(a))throw new _(a);return a}function ct(o,e,t,n){let r=e.values.get(t);if(r!=null&&r.has(n))return r.get(n);let i;try{i=qn({row:t,scope:o,seen:new Set,depth:0,memo:new Map},n)}catch(s){i=s instanceof _?s.code:"#ERROR!"}return r||e.values.set(t,r=new Map),r.set(n,i),i}function wr(o){if(!o.scope)throw new _("#REF!");let e=Te(o.scope);e.index||(e.index=new Map(e.data.map((n,r)=>[n,r])));let t=e.index.get(o.row);if(t===void 0)throw new _("#REF!");return t}function Os(o,e){if(!o.scope)throw new _("#REF!");let t=o.scope,n=Te(t),r=n.cols.get(e);if(r||(n.cols.set(e,yr),r=n.data.map(i=>ct(t,n,i,e)),n.cols.set(e,r)),r===yr)throw new _("#CYCLE!");return r}var yr=[];function Xe(o,e){switch(o.k){case"lit":return o.v;case"ref":return qn(e,o.name);case"un":return o.op==="-"?-q(Xe(o.a,e)):q(Xe(o.a,e));case"bin":{let t=Xe(o.a,e),n=Xe(o.b,e);switch(o.op){case"+":return q(t)+q(n);case"-":return q(t)-q(n);case"*":return q(t)*q(n);case"/":case"%":{let r=q(n);if(r===0)throw new _("#DIV/0!");return o.op==="/"?q(t)/r:q(t)%r}case"^":return q(t)**q(n);case"&":return Q(t)+Q(n);default:{let r=dt(t,n);return o.op==="="?r===0:o.op==="<>"?r!==0:o.op==="<"?r<0:o.op===">"?r>0:o.op==="<="?r<=0:r>=0}}}case"call":{if(o.rowFree&&e.scope){let t=Te(e.scope);if(t.rowFree.has(o)){let n=t.rowFree.get(o);if(n instanceof _)throw n;return n}try{let n=br(o,e);return t.rowFree.set(o,n),n}catch(n){throw n instanceof _&&t.rowFree.set(o,n),n}}return br(o,e)}}}function br(o,e){var a;let{name:t,args:n}=o,r=l=>Xe(n[l],e);switch(t){case"IF":{if(n.length<2)throw new _("#ERROR!");return Ee(r(0))?r(1):n.length>2?r(2):!1}case"IFS":for(let l=0;l+1<n.length;l+=2)if(Ee(r(l)))return r(l+1);throw new _("#N/A");case"IFERROR":case"IFNA":try{let l=r(0);return Je(l)&&(t==="IFERROR"||l==="#N/A")?n.length>1?r(1):"":l}catch(l){if(!(l instanceof _)||t==="IFNA"&&l.code!=="#N/A")throw l;return n.length>1?r(1):""}case"SWITCH":{let l=r(0);for(let c=1;c+1<n.length;c+=2)if(dt(l,r(c))===0)return r(c+1);if(n.length%2===0)return r(n.length-1);throw new _("#N/A")}case"CHOOSE":{let l=Math.trunc(q(r(0)));if(l<1||l>=n.length)throw new _("#VALUE!");return r(l)}case"COL":return Os(e,n[0].name);case"ROW":return wr(e)+1;case"PREV":case"NEXT":{let l=n.length>1?Math.trunc(q(r(1))):1,c=wr(e)+(t==="PREV"?-l:l),d=n[0].name;if(t==="NEXT"&&e.depth>=Mr)throw new _("#CYCLE!");return t==="PREV"?Ns(e,c,d):Bs(e,c,d)}}let i=(a=Object.hasOwn(ge,t)?ge[t]:void 0)!=null?a:Nt.get(t);if(!i)throw new _("#NAME?");let s=n.map((l,c)=>r(c));if(Nt.has(t)&&!Object.hasOwn(ge,t))try{return i(s)}catch(l){throw l instanceof _?l:new _("#VALUE!")}return i(s)}function Bs(o,e,t){let n=o.scope?Te(o.scope):null;if(!n)throw new _("#REF!");return e<0||e>=n.data.length?null:qn({...o,row:n.data[e],seen:new Set,depth:o.depth+1,memo:new Map},t)}function Ot(o,e){try{let t=Xe(Rr(o),e);return typeof t=="number"&&!Number.isFinite(t)?"#NUM!":Array.isArray(t)?"#VALUE!":t}catch(t){return t instanceof RangeError?"#CYCLE!":t instanceof _?t.code:"#ERROR!"}}function Bt(o,e,t=new Set,n=0,r=new Map,i=null){return Ot(o,{row:e,scope:i,seen:t,depth:n,memo:r})}function Wn(o,e){var r,i;let t=(r=Vn.get(o))!=null?r:null,n=(i=o.id)!=null?i:o.field;if(o.formula){if(t&&n){let s=Te(t);return ct(t,s,e,n)}return Ot(o.formula,{row:e,scope:t,seen:new Set(n?[n]:[]),depth:0,memo:new Map})}return t?ct(t,Te(t),e,o.field):Ot(e[o.field],{row:e,scope:t,seen:new Set([o.field]),depth:0,memo:new Map})}var jn=o=>{var e,t;return!!((t=(e=Vn.get(o))==null?void 0:e.off)!=null&&t.call(e))},Ne=o=>typeof o=="string"&&o.length>1&&o.startsWith("=");function Er(o){let e;try{e=Rr(o)}catch{return null}let t=new Set,n=r=>{r.k==="ref"?t.add(r.name):r.k==="un"?n(r.a):r.k==="bin"?(n(r.a),n(r.b)):r.k==="call"&&r.args.forEach(n)};return n(e),[...t]}function j(o,e){var n;if(o.valueGetter)try{return o.valueGetter(e)}catch{V(`valueGetter of column "${(n=o.id)!=null?n:o.field}" threw; rendering an empty cell`);return}if(typeof o.formula=="string"&&Ne(o.formula)&&!jn(o))return Wn(o,e);if(o.field==null)return;let t=e[o.field];return o.formulas&&Ne(t)&&!jn(o)?Wn(o,e):t}var ut=["left","center","right"],Ar=[[">=","gte"],["<=","lte"],["<>","ne"],["!=","ne"],[">","gt"],["<","lt"],["=","eq"]],Tr=[[">","after"],["<","before"],["=","equals"]],Hs=/^(.+?)\s*(?:~|\.\.)\s*(.+)$/,Un=o=>{let e=Number(o.replace(/[,\s₩$€¥]/g,""));return o.trim()!==""&&Number.isFinite(e)?e:null},Kn=o=>{let e=/^(\d{4})[-./]\s*(\d{1,2})[-./]\s*(\d{1,2})\.?$/.exec(o.trim());if(!e)return null;let t=Number(e[1]),n=Number(e[2]),r=Number(e[3]);return n<1||n>12||r<1||r>new Date(Date.UTC(t,n,0)).getUTCDate()?null:`${e[1]}-${e[2].padStart(2,"0")}-${e[3].padStart(2,"0")}`};function Gs(o,e){let t=e.trim();if(!t)return null;if(o==="text")return{type:"text",op:"contains",value:t};let n=Hs.exec(t);if(o==="number"){if(n){let l=Un(n[1]),c=Un(n[2]);return l===null||c===null?void 0:{type:"number",op:"between",value:Math.min(l,c),valueTo:Math.max(l,c)}}let s=Ar.find(([l])=>t.startsWith(l)),a=Un(s?t.slice(s[0].length):t);return a===null?void 0:{type:"number",op:s?s[1]:"eq",value:a}}if(n){let s=Kn(n[1]),a=Kn(n[2]);return!s||!a?void 0:{type:"date",op:"between",value:s<a?s:a,valueTo:s<a?a:s}}let r=Tr.find(([s])=>t.startsWith(s)),i=Kn(r?t.slice(r[0].length):t);return i?{type:"date",op:r?r[1]:"equals",value:i}:void 0}function zs(o){var e,t,n;if(!o)return"";if(o.type==="text")return o.op==="contains"&&(e=o.value)!=null?e:"";if(o.type==="number"){if(o.op==="between")return`${o.value}~${o.valueTo}`;let r=(t=Ar.find(([,i])=>i===o.op))==null?void 0:t[0];return r&&o.value!==void 0?`${r==="="?"":r}${o.value}`:""}if(o.type==="date"){if(o.op==="between")return`${o.value}~${o.valueTo}`;let r=(n=Tr.find(([,i])=>i===o.op))==null?void 0:n[0];return r&&o.value?`${r==="="?"":r}${o.value}`:""}return""}var Ht=class{constructor(e,t){this.grid=e;this.layout="";this.timers=new Map;this.data=null;this.synced=null;this.rebuilt=!1;this.inners={};for(let n of ut)this.inners[n]=C("div","fg-filter-row",{role:"row"}),t[n].append(this.inners[n])}get height(){return Math.round(this.grid.renderer.opts.rowHeight*.95)}render(){let{columns:e,store:t}=this.grid,n=this.height,r=e.displayed(),i=`${n}|${t.state.locale.code}|${r.map(s=>`${s.id}:${s.left}:${s.width}:${s.region}`).join(",")}`;if(i!==this.layout){this.layout=i;for(let s of ut){let a=this.inners[s];a.style.width=`${e.regionWidth(s)}px`,a.style.height=`${n}px`,a.replaceChildren(...e.region(s).map(l=>this.cell(l,n)))}this.data=t.state.data,this.rebuilt=!0}else t.state.data!==this.data&&(this.data=t.state.data,this.refreshLists());this.sync()}sync(){let e=this.grid.store.state.filters;if(!(e===this.synced&&!this.rebuilt)){this.synced=e,this.rebuilt=!1;for(let t of ut)for(let n of this.inners[t].querySelectorAll("[data-col]")){let r=n.dataset.col,i=e[r];if(n.closest(".fg-filter-cell").classList.toggle("fg-filter-active",!!i),!(n===n.ownerDocument.activeElement||n.getRootNode().activeElement===n)){if(n instanceof HTMLSelectElement){let s=(i==null?void 0:i.type)==="set"&&i.values.length===1?JSON.stringify(i.values[0]):"";[...n.options].some(a=>a.value===s)&&(n.value=s)}else n.value=zs(i);n.classList.remove("fg-filter-bad")}}}}refreshLists(){var e;for(let t of ut)for(let n of this.inners[t].querySelectorAll("select[data-col]")){let r=(e=this.grid.columns.getNode(n.dataset.col))==null?void 0:e.def;if(!r)continue;let i=n.value;if(this.fillOptions(n,r),i&&![...n.options].some(s=>s.value===i)){let s=C("option","",{value:i});s.textContent=String(JSON.parse(i)),n.append(s)}n.value=i}}fillOptions(e,t){let n=C("option","",{value:""});n.textContent=this.grid.store.state.locale.selectAll;let r=this.distinct(t).map(i=>{let s=C("option","",{value:JSON.stringify(i)});return s.textContent=i===!0?"\u2713":i===!1?"\u2717":String(i),s});e.replaceChildren(n,...r)}cell(e,t){var c,d;let n=C("div","fg-filter-cell");n.style.left=`${e.left}px`,n.style.width=`${e.width}px`,n.style.height=`${t}px`;let r=G(e.id)?null:ue(e.def);if(!r)return n;let s=`${this.grid.store.state.locale.filter}: ${(d=(c=e.def.header)!=null?c:e.def.field)!=null?d:e.id}`;if(r==="set"){let u=C("select","fg-filter-input",{"aria-label":s});return u.dataset.col=e.id,this.fillOptions(u,e.def),u.addEventListener("change",()=>{this.grid.setFilter(e.id,u.value?{type:"set",values:[JSON.parse(u.value)]}:null)}),n.append(u),n}let a=C("input","fg-filter-input",{type:"text","aria-label":s,spellcheck:"false",autocomplete:"off"});a.dataset.col=e.id,r==="number"&&(a.placeholder=">0, 10~20"),r==="date"&&(a.placeholder=">2026-01-01");let l=()=>{let u=Gs(r,a.value);a.classList.toggle("fg-filter-bad",u===void 0),u!==void 0&&this.grid.setFilter(e.id,u)};return a.addEventListener("input",()=>{clearTimeout(this.timers.get(e.id)),this.timers.set(e.id,window.setTimeout(l,200))}),a.addEventListener("keydown",u=>{u.stopPropagation(),u.key==="Enter"?(clearTimeout(this.timers.get(e.id)),l()):u.key==="Escape"&&(a.value="",clearTimeout(this.timers.get(e.id)),l())}),n.append(a),n}distinct(e){let t=new Map;for(let n of this.grid.store.state.data){let r=j(e,n);if(r==null||r==="")continue;let i=JSON.stringify(r);if(t.has(i)||t.set(i,r),t.size>=200)break}return[...t.values()].sort((n,r)=>String(n).localeCompare(String(r)))}setTransform(e){this.inners.center.style.transform=`translateX(${-e}px)`}destroy(){for(let e of this.timers.values())clearTimeout(e);for(let e of ut)this.inners[e].remove()}};function _n(o){let e=[];for(let t of o){if(K(t)||t instanceof Date)continue;let n=typeof t=="number"?t:Number(t);Number.isNaN(n)||e.push(n)}return e}function Lr(o,e){let t=o.filter(i=>i instanceof Date&&!Number.isNaN(i.getTime()));if(t.length)return t.reduce((i,s)=>(e?s>i:s<i)?s:i);let n=_n(o);if(!n.length)return null;let r=n[0];for(let i of n)(e?i>r:i<r)&&(r=i);return r}function Le(o,e,t){if(typeof o=="function")return o(e,t);switch(o){case"sum":return _n(e).reduce((n,r)=>n+r,0);case"avg":{let n=_n(e);return n.length?n.reduce((r,i)=>r+i,0)/n.length:null}case"min":return Lr(e,!1);case"max":return Lr(e,!0);case"count":return t.length}return null}function ft(o){return typeof o=="object"&&o!==null&&"agg"in o?o:{agg:o}}function Pr(o,e,t){let n=new Map,r=(i,s)=>{let a=n.get(i);return a||n.set(i,a=e.map(l=>j(s,l))),a};return o.map(i=>{var a;let s={};for(let[l,c]of Object.entries((a=i.columns)!=null?a:{})){let d=t(l);d&&(s[l]=Le(ft(c).agg,r(l,d),e))}return s})}function pt(o,e,t,n,r){if(!o)return 1;let i=1;try{i=Math.floor(Number(o({value:j(e,t),row:t,rowIndex:n})))}catch{i=1}return Number.isFinite(i)?Math.max(1,Math.min(r,i)):1}function Gt(o,e){let t=o.length,n=new Int32Array(t),r=new Int32Array(t);if(e.rowSpan){for(let a=0;a<t;){let l=pt(e.rowSpan,e,o[a],a,t-a);for(let c=a;c<a+l;c++)n[c]=a,r[c]=a+l-1;a+=l}return{start:n,end:r}}let i=typeof e.merge=="function"?(a,l)=>{try{return!!e.merge(j(e,o[a]),j(e,o[l]),o[a],o[l])}catch{return!1}}:(()=>{let a=o.map(l=>{let c=j(e,l);return K(c)?null:ne(c)});return(l,c)=>a[l]!==null&&a[l]===a[c]})(),s=0;for(let a=1;a<=t;a++)if(!(a<t&&i(a-1,a))){for(let l=s;l<a;l++)n[l]=s,r[l]=a-1;s=a}return{start:n,end:r}}function Fr(o,e,t,n,r=4){if(n<=0||t<=0)return{first:0,last:-1};let i=Math.max(0,Math.floor(o/t)-r),s=Math.floor((o+e)/t);return{first:Math.min(i,n-1),last:Math.min(n-1,s+r)}}function zt(o,e,t,n,r=2){let i=o.length;if(!i)return{first:0,last:-1};let s=0,a=i-1;for(;s<a;){let d=s+a>>1;o[d]+e[d]<=t?s=d+1:a=d}let l=s,c=t+n;for(a=i-1;s<a;){let d=s+a+1>>1;o[d]<c?s=d:a=d-1}return{first:Math.max(0,l-r),last:Math.min(i-1,Math.max(l,s)+r)}}function Ir(o,e,t,n,r=4){if(n<=0)return{first:0,last:-1};let i=0,s=n-1;for(;i<s;){let c=i+s>>1;o[c+1]<=e?i=c+1:s=c}let a=i,l=e+t;for(s=n-1;i<s;){let c=i+s+1>>1;o[c]<l?i=c:s=c-1}return{first:Math.max(0,a-r),last:Math.min(n-1,i+r)}}var oe=["left","center","right"],Dr=6,Vs=8,Xn=2,qs='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M3 4h10M3 8h10M3 12h10" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>',Jn='<svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>';var Ws='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M2.5 3h11l-4.2 5v4.5l-2.6 1.2V8z" fill="currentColor"/></svg>';function C(o,e="",t={}){let n=document.createElement(o);e&&(n.className=e);for(let[r,i]of Object.entries(t))n.setAttribute(r,i);return n}var Vt=class{constructor(e,t,n){this.grid=t;this.opts=n;this.filterRow=null;this.activeCellId="";this.idBase=`fg${Math.random().toString(36).slice(2,8)}`;this.painted={left:new Map,center:new Map,right:new Map};this.geo={top:0,left:0,cw:0,ch:0,ow:0,oh:0};this.layoutSig="";this.touched=new Set;this.measureAll=!1;this.pool={left:[],center:[],right:[]};this.frame=0;this.headerDirty=!0;this.version=0;this.rowVersions=new Map;this.lastRange={first:0,last:-1};this.summaryEl=null;this.summaryPanes=null;this.summaryInners=null;this.summaryKey=null;this.canvasSummary={left:[],center:[],right:[]};this.topOffset=0;this.pinnedTop=null;this.pinnedBottom=null;this.statusEl=null;this.statusKey="";this.pagerEl=null;this.cards=null;this.cardMode=!1;this.pagerKey="";this.offsets=null;this.details=new Map;this.firstDataId="";this.rowHeights=new Map;this.heightsVersion=0;this.groupLabelId="";this.onScroll=()=>{this.frame&&cancelAnimationFrame(this.frame),this.frame=0,this.render(),this.grid.events.emit("scroll",this.cards?this.getScroll():{top:this.geo.top,left:this.geo.left})};this.onSideWheel=e=>{e.deltaY&&(e.preventDefault(),this.scroller.scrollTop+=e.deltaY)};this.overlayKey="";this.heightFn=null;this.onCardClick=e=>{var l;let t=e.target,n=t.closest(".fg-card");if(!n)return;let r=Number(n.dataset.row),i=this.grid.rowModel.getRow(r);if(!i||i.kind)return;if(t.closest(".fg-card-check")){this.grid.selectFromClick(r,!0,!1),this.invalidate({rows:!0});return}let s=(l=t.closest(".fg-card-value"))==null?void 0:l.dataset.col,a=s?this.grid.columns.getColumn(s):void 0;a&&this.grid.events.emit("cellClick",{row:i.data,rowIndex:r,colId:a.id,value:j(a.def,i.data),event:e})};this.root=C("div","",{tabindex:"-1"}),this.root.addEventListener("focus",()=>this.gridEl.focus({preventScroll:!0})),this.gridEl=C("div","fg-grid",{role:"grid",tabindex:"0"}),this.headerEl=C("div","fg-header",{role:"rowgroup"}),this.bodyEl=C("div","fg-body",{role:"rowgroup"});let r=i=>({left:C("div",`${i} ${i}-left`),center:C("div",`${i} ${i}-center`),right:C("div",`${i} ${i}-right`)});this.headerPanes=r("fg-header-pane"),this.headerInners=r("fg-header-inner");for(let i of oe)this.headerInners[i].setAttribute("role","row");this.bodyPanes=r("fg-body-pane"),this.canvases=r("fg-canvas");for(let i of oe)this.headerPanes[i].dataset.region=i,this.bodyPanes[i].dataset.region=i,this.headerPanes[i].append(this.headerInners[i]),this.bodyPanes[i].append(this.canvases[i]),this.headerEl.append(this.headerPanes[i]),this.bodyEl.append(this.bodyPanes[i]);this.scroller=this.bodyPanes.center,t.options.filterRow&&(this.filterRow=new Ht(t,this.headerPanes)),this.overlay=C("div","fg-overlay",{"aria-live":"polite"}),this.main=C("div","fg-main"),this.gridEl.append(this.headerEl,this.bodyEl),this.main.append(this.gridEl,this.overlay),this.root.append(this.main),e.append(this.root),this.applyTheme(),this.scroller.addEventListener("scroll",this.onScroll,{passive:!0}),this.bodyPanes.left.addEventListener("wheel",this.onSideWheel,{passive:!1}),this.bodyPanes.right.addEventListener("wheel",this.onSideWheel,{passive:!1})}get activeScroller(){var e,t;return(t=(e=this.cards)==null?void 0:e.scroller)!=null?t:this.scroller}readGeo(){let e=this.scroller;this.geo={top:e.scrollTop,left:e.scrollLeft,cw:e.clientWidth,ch:e.clientHeight,ow:e.offsetWidth,oh:e.offsetHeight}}getScroll(){let e=this.activeScroller;return{top:e.scrollTop,left:e.scrollLeft}}setScroll(e){let t=this.activeScroller;typeof(e==null?void 0:e.top)=="number"&&Number.isFinite(e.top)&&(t.scrollTop=Math.max(0,e.top)),typeof(e==null?void 0:e.left)=="number"&&Number.isFinite(e.left)&&(t.scrollLeft=Math.max(0,e.left))}applyFont(e,t){e?this.root.style.setProperty("--fg-font-size",`${e}px`):this.root.style.removeProperty("--fg-font-size"),t?this.root.style.setProperty("--fg-font",t):this.root.style.removeProperty("--fg-font")}applyTheme(){let e=this.grid.options.direction==="rtl";this.root.className=`fg-root fg-theme-${this.grid.store.state.theme}${e?" fg-rtl":""}${this.cardMode?" fg-card-mode":""}${this.grid.density!=="normal"?` fg-density-${this.grid.density}`:""}`,this.root.setAttribute("dir",e?"rtl":"ltr")}get rtl(){return this.grid.options.direction==="rtl"}invalidate(e={}){e.header&&(this.headerDirty=!0),e.rows&&(this.version++,this.rowVersions.clear()),this.schedule()}invalidateRowIds(e){var t;for(let n of e)this.rowVersions.set(n,((t=this.rowVersions.get(n))!=null?t:0)+1);this.schedule()}schedule(){this.frame||(this.frame=requestAnimationFrame(()=>{this.frame=0,this.render()}))}render(){var x,k,E,L,R,M,T,A,F,$;let{columns:e,rowModel:t,store:n,options:r}=this.grid,{rowHeight:i,headerHeight:s}=this.opts;this.readGeo();let a=this.geo.ow-this.geo.cw;e.setContainerWidth(Math.max(0,this.main.clientWidth-a))&&(this.headerDirty=!0,this.version++);let l=t.getRowCount(),c=!!this.grid.options.autoRowHeight&&!t.server,d=t.layout(i,this.detailHeight(),c?this.rowHeights:void 0,this.heightsVersion,t.server?void 0:this.heightOf);if(this.offsets=d.uniform?null:d.offsets,this.firstDataId=(k=(x=e.displayed().find(D=>!G(D.id)))==null?void 0:x.id)!=null?k:"",this.groupLabelId=(L=(E=e.region("center").find(D=>!G(D.id)))==null?void 0:E.id)!=null?L:this.firstDataId,this.useCards()){this.renderCards(l),this.renderStatusBar(t.dataCount()),this.renderPager(),this.orderSections(null),this.paintOverlay(l);return}let u=this.grid.summary(),f=u?u.opts.rows.length:0,p=(R=u==null?void 0:u.opts.position)!=null?R:"bottom",h=u?u.opts.pinned!==!1:!1;this.topOffset=u&&!h&&p==="top"?f*i:0;let g=u&&!h&&p==="bottom"?f*i:0;this.syncSummaryPane(u&&h?p:null,f*i);let w=e.depth*s+((T=(M=this.filterRow)==null?void 0:M.height)!=null?T:0);this.headerEl.style.height=`${w}px`;for(let D of oe){let O=e.regionWidth(D);D!=="center"&&(this.headerPanes[D].style.width=this.bodyPanes[D].style.width=`${O}px`,this.headerPanes[D].hidden=this.bodyPanes[D].hidden=O===0),this.canvases[D].style.width=`${O}px`,this.canvases[D].style.height=`${this.rowsHeight(l)+this.topOffset+g}px`}r.autoHeight&&!this.useCards()&&(this.root.classList.add("fg-auto-height"),this.bodyEl.style.height=`${this.rowsHeight(l)+this.topOffset+g+Math.max(0,this.scroller.offsetHeight-this.scroller.clientHeight)}px`);let m=`${w}|${oe.map(D=>e.regionWidth(D)).join(",")}|${this.rowsHeight(l)+this.topOffset+g}|${u&&h?p:""}|${f}|${r.autoHeight?1:0}`;m!==this.layoutSig&&(this.layoutSig=m,this.readGeo());let y=this.geo.oh-this.geo.ch;this.bodyPanes.left.style.marginBottom=this.bodyPanes.right.style.marginBottom=`${y}px`;let b=this.gridEl;b.setAttribute("role",r.treeData||this.grid.getGroupBy().length?"treegrid":"grid"),b.setAttribute("aria-rowcount",String(l+e.depth+(this.filterRow?1:0))),b.setAttribute("aria-colcount",String(e.displayed().length)),r.rowSelection==="multiple"&&b.setAttribute("aria-multiselectable","true"),this.headerDirty&&(this.headerDirty=!1,this.renderHeader()),(A=this.filterRow)==null||A.render(),this.renderRows(l),this.updateActiveCell(),c&&this.measureRows(),this.renderSummary(l,u&&u.opts.rows,(F=u==null?void 0:u.values)!=null?F:[],h,p),this.pinnedTop=this.renderPinned(this.pinnedTop,"top",this.grid.pinnedRows.top),this.pinnedBottom=this.renderPinned(this.pinnedBottom,"bottom",this.grid.pinnedRows.bottom),this.renderStatusBar(t.dataCount()),this.renderPager(),this.orderSections(u&&h?p:null),this.paintOverlay(l),this.overlay.style.top=`${w}px`;let{top:v,left:S}=this.geo;this.bodyPanes.left.scrollTop=this.bodyPanes.right.scrollTop=v,this.headerInners.center.style.transform=`translateX(${-S}px)`,($=this.filterRow)==null||$.setTransform(S),this.summaryInners&&(this.summaryInners.center.style.transform=`translateX(${-S}px)`);for(let D of[this.pinnedTop,this.pinnedBottom])D&&(D.inners.center.style.transform=`translateX(${-S}px)`);this.grid.fillHandle.update()}orderSections(e){var s,a,l,c;let t=[e==="top"?this.summaryEl:null,(a=(s=this.pinnedTop)==null?void 0:s.el)!=null?a:null].filter(d=>!!d),n=[(c=(l=this.pinnedBottom)==null?void 0:l.el)!=null?c:null,e==="bottom"?this.summaryEl:null].filter(d=>!!d),r=[this.statusEl,this.pagerEl].filter(d=>!!d);for(let d of t)d.nextElementSibling!==this.bodyEl&&!t.includes(d.nextElementSibling)&&this.gridEl.insertBefore(d,this.bodyEl);let i=this.bodyEl;for(let d=t.length-1;d>=0;d--)i.previousElementSibling!==t[d]&&this.gridEl.insertBefore(t[d],i),i=t[d];i=this.bodyEl;for(let d of n)i.nextElementSibling!==d&&i.after(d),i=d;i=this.gridEl;for(let d of r)i.nextElementSibling!==d&&i.after(d),i=d}paintOverlay(e){var d;let{grid:t}=this,{store:n,rowModel:r,options:i}=t,s=(d=t.forcedOverlay)!=null?d:e>0?null:r.loading()?"loading":"noRows";if(this.overlay.hidden=!s,!s){this.overlayKey="";return}let a=!r.server&&n.state.data.length>0,l=s==="loading"?i.loadingOverlay:i.noRowsOverlay,c=`${s}|${a}|${n.state.locale.code}`;if(c!==this.overlayKey)if(this.overlayKey=c,this.overlay.classList.toggle("fg-overlay-custom",typeof l=="function"),l==null)this.overlay.textContent=s==="loading"?n.state.locale.loading:n.state.locale.noRows;else if(typeof l=="string")this.overlay.textContent=l;else try{let u=l({filtered:a});typeof u=="string"?this.overlay.textContent=u:this.overlay.replaceChildren(u)}catch{V(`${s==="loading"?"loadingOverlay":"noRowsOverlay"} threw`),this.overlay.textContent=s==="loading"?n.state.locale.loading:n.state.locale.noRows}}updateActiveCell(){var n,r,i;let e=this.activeCellId&&(i=(r=(n=this.root.getRootNode()).getElementById)==null?void 0:r.call(n,this.activeCellId))!=null?i:null,t=this.gridEl.querySelector(".fg-body .fg-cell-focused, .fg-body .fg-row-group .fg-cell-focused");if(e&&e!==t&&e.removeAttribute("id"),!t){this.gridEl.removeAttribute("aria-activedescendant"),this.activeCellId="";return}t.id||(t.id=`${this.idBase}-cell`),this.activeCellId=t.id,this.gridEl.setAttribute("aria-activedescendant",t.id)}renderPinned(e,t,n){if(!n.length)return e==null||e.el.remove(),null;let r=e!=null?e:new Yn(`fg-pinned-rows fg-pinned-${t}`),{columns:i}=this.grid,s=this.opts.rowHeight;r.size(i,n.length*s,this.geo.ow-this.geo.cw);let a=i.region("center"),l=zt(a.map(d=>d.left),a.map(d=>d.width),this.geo.left,this.geo.cw,Xn),c=[n,n.length,this.version,this.grid.valuesVersion,l.first,l.last,s,this.grid.store.state.locale.code];if(e&&$r(c,r.key))return r;r.key=c;for(let d of oe){let u=d==="center"?a.slice(l.first,l.last+1):i.region(d);r.inners[d].replaceChildren(...n.map((f,p)=>{let h=C("div","fg-row fg-row-pinned",{role:"row"});h.style.transform=`translateY(${p*s}px)`,h.style.height=`${s}px`;let g={id:`pinned-${t}-${p}`,data:f,sourceIndex:-1};for(let w of u){let m=C("div","fg-cell",{role:"gridcell"});G(w.id)?(m.style.left=`${w.left}px`,m.style.width=`${w.width}px`):this.paintCell(m,g,-1,w,!1,!1),h.append(m)}return h}))}return r}renderStatusBar(e){var u,f;if(!this.grid.options.statusBar){(u=this.statusEl)==null||u.remove(),this.statusEl=null;return}let{grid:t}=this,n=t.store.state,r=t.rowModel.server?e:t.viewRows().length,i=`${this.version}.${t.valuesVersion}|${e}|${r}|${n.selected.size}|${JSON.stringify(n.range)}|${n.locale.code}`;if(this.statusEl&&i===this.statusKey)return;this.statusKey=i,(f=this.statusEl)!=null||(this.statusEl=C("div","fg-statusbar",{role:"status","aria-live":"polite"}));let s=n.locale,a=Re(s.code,2),l=C("span","fg-status-rows");l.textContent=(e===r?s.statusRows.replace("{n}",a.format(r)):s.statusFiltered.replace("{shown}",a.format(e)).replace("{total}",a.format(r)))+(n.selected.size?` \xB7 ${s.statusSelected.replace("{n}",a.format(n.selected.size))}`:"");let c=C("span","fg-status-aggs"),d=t.rangeAggregates();if(d&&d.cells>1){let p=[`${s.count} ${a.format(d.count)}`];d.numbers&&p.push(`${s.sum} ${a.format(d.sum)}`,`${s.avg} ${a.format(d.sum/d.numbers)}`,`${s.min} ${a.format(d.min)}`,`${s.max} ${a.format(d.max)}`),c.textContent=p.join(" ")}this.statusEl.replaceChildren(l,c)}renderHeader(){let{columns:e,store:t}=this.grid,{sort:n,filters:r,locale:i}=t.state;for(let s of oe){let a=this.headerInners[s];a.style.width=`${e.regionWidth(s)}px`,a.style.height=`${e.depth*this.opts.headerHeight}px`,a.replaceChildren(...e.headerCells(s).map(l=>this.headerCell(l,n,r,i)))}}headerCell(e,t,n,r){var f,p;let i=this.opts.headerHeight,s=C("div",e.isGroup?"fg-header-cell fg-header-group":"fg-header-cell",{role:"columnheader"});if(s.dataset.col=e.id,s.style.left=`${e.left}px`,s.style.top=`${e.row*i}px`,s.style.width=`${e.width}px`,s.style.height=`${e.rowSpan*i}px`,G(e.id))return e.id===Se&&(s.classList.add("fg-header-rownum"),s.textContent=e.label),e.id===le&&(s.classList.add("fg-header-select"),s.append(this.selectAllBox(r))),s;let a=C("span","fg-header-label"),l=e.node.def;if(a.textContent=e.label,l.headerRenderer)try{let h=l.headerRenderer({header:e.label,column:l});typeof h=="string"?a.innerHTML=h:a.replaceChildren(h)}catch{V(`headerRenderer of column "${e.id}" threw; showing the plain header`),a.textContent=e.label}let c=null;if(e.isGroup&&this.grid.columns.isCollapsible(e.node)){let h=e.node.open,g=C("button",h?"fg-colgroup-toggle fg-expanded":"fg-colgroup-toggle",{type:"button",tabindex:"-1","aria-expanded":String(h),"aria-label":h?r.collapseAll:r.expandAll});g.textContent=h?"\u2212":"+",g.addEventListener("click",w=>{w.stopPropagation(),this.grid.setColumnGroupOpened(e.id,!h)}),s.classList.add("fg-header-collapsible"),c=g}if(l.headerClass)try{let h=typeof l.headerClass=="function"?l.headerClass(l):l.headerClass;h&&s.classList.add(...h.split(/\s+/).filter(Boolean))}catch{V(`headerClass of column "${e.id}" threw`)}if(s.append(a),c&&s.append(c),e.isGroup||!e.column)return s;let d=e.node.def;((f=d.wrapHeaderText)!=null?f:this.grid.options.wrapHeaderText)&&s.classList.add("fg-header-wrap"),s.setAttribute("aria-colindex",String(e.column.index+1)),((p=d.align)!=null?p:d.type==="number"?"right":"left")==="right"&&s.classList.add("fg-align-right");let u=t.findIndex(h=>h.colId===e.id);if(s.setAttribute("aria-sort",u<0?"none":t[u].dir==="asc"?"ascending":"descending"),De(d)&&s.classList.add("fg-sortable"),u>=0){let h=C("span","fg-sort-icon");if(h.textContent=t[u].dir==="asc"?"\u2191":"\u2193",t.length>1){let g=C("sup");g.textContent=String(u+1),h.append(g)}s.append(h)}if(De(d)||ue(d)){let h=!!n[e.id],g=C("button",h?"fg-menu-btn fg-filter-active":"fg-menu-btn",{type:"button",tabindex:"-1","aria-label":r.columnMenu});g.innerHTML=h?Ws:qs,s.append(g)}return Ft(d)&&s.append(C("div","fg-resize",{"aria-hidden":"true"})),s}selectAllBox(e){let t=C("input","fg-checkbox fg-select-all",{type:"checkbox",tabindex:"-1","aria-label":e.selectAllRows});return this.paintSelectAll(t),t.hidden=this.grid.options.rowSelection!=="multiple"||this.grid.options.headerCheckbox===!1,t}paintSelectAll(e){let t=this.grid.selectableIds(),n=0;for(let r of this.grid.store.state.selected)t.has(r)&&n++;e.checked=t.size>0&&n===t.size,e.indeterminate=n>0&&n<t.size}selectionChanged(){let e=this.headerEl.querySelectorAll(".fg-select-all");if(e.length)for(let t of e)this.paintSelectAll(t)}renderRows(e){var w,m,y,b;let{columns:t,rowModel:n,store:r}=this.grid,{selected:i,focus:s}=r.state,a=this.grid.allRangeBounds(),l=this.grid.mergeSpans(),{geo:c}=this,d=Math.max(0,c.top-this.topOffset),u=this.grid.options.autoHeight&&!n.server?{first:0,last:e-1}:this.offsets?Ir(this.offsets,d,c.ch,e,Dr):Fr(d,c.ch,this.opts.rowHeight,e,Dr);this.lastRange=u;let f=t.region("center"),p=zt(f.map(v=>v.left),f.map(v=>v.width),this.geo.left,this.geo.cw,Xn),h=f.some(v=>v.def.colSpan);h&&(p.first=Math.max(0,p.first-Vs));let g=!h&&!l.size;this.touched.clear();for(let v of oe){let S=v==="center"?f.slice(p.first,p.last+1):t.region(v),x=this.painted[v];for(let[E,L]of x)E>=u.first&&E<=u.last&&S.length||(L.el.remove(),this.pool[v].push(L.el),x.delete(E));if(!S.length)continue;let k=v==="center"?`${p.first}-${p.last}`:"";for(let E=u.first;E<=u.last;E++){let L=n.getRow(E),R=i.has(L.id),M=s&&s.rowIndex===E?s.colId:"",T=a.filter(N=>E>=N.r1&&E<=N.r2),A=T.map(N=>`${N.c1}-${N.c2}`).join(","),F=this.mergeState(l,S,E,u.first),$=L.kind==="detail"?`${c.left}:${c.cw}`:"",D=`${L.id}|${this.version}.${(w=this.rowVersions.get(L.id))!=null?w:0}|${R?1:0}${L.kind==="group"?`:${this.grid.selectionVersion}`:""}|${M}|${A}|${F}|${$}`,O=`${k}|${D}`,P=x.get(E);if(!P){let N=(m=this.pool[v].pop())!=null?m:C("div","fg-row",{role:"row"});this.canvases[v].append(N),P={el:N,key:""},x.set(E,P)}if(P.key!==O){if(this.touched.add(E),g&&v==="center"&&!L.kind&&P.base===D&&this.slideCells(P,L,E,f,p,R,M,T)){P.key=O;continue}P.key=O,P.base=v==="center"&&!L.kind?D:void 0,P.first=p.first,P.last=p.last,P.el.dataset.kind!==((y=L.kind)!=null?y:"")&&(P.el.replaceChildren(),P.el.dataset.kind=(b=L.kind)!=null?b:""),L.kind==="group"?this.paintGroupRow(P.el,L,E,S,M):L.kind==="detail"?this.paintDetailRow(P.el,L,E,v):L.kind==="loading"?this.paintLoadingRow(P.el,E,S):this.paintRow(P.el,L,E,S,R,M,T,l,u.first)}}}l.size&&this.stickMergedText(d)}stickMergedText(e){for(let t of oe)for(let n of this.painted[t].values())for(let r of n.el.querySelectorAll(".fg-cell-merged")){let i=Number(r.dataset.mergeTop),s=Number(r.dataset.mergeLast);if(!Number.isFinite(i)||!Number.isFinite(s))continue;let a=`${Math.round(Math.min(s,Math.max(0,e-i)))}px`;r.style.getPropertyValue("--fg-merge-shift")!==a&&r.style.setProperty("--fg-merge-shift",a)}}slideCells(e,t,n,r,i,s,a,l){let c=e.first,d=e.last;if(i.first>d||i.last<c||e.el.childElementCount!==d-c+1)return!1;let u=e.el;for(let p=c;p<i.first;p++)u.firstElementChild.remove();for(let p=d;p>i.last;p--)u.lastElementChild.remove();let f=p=>{let h=C("div","fg-cell",{role:"gridcell"});return this.paintCell(h,t,n,p,s,a===p.id),p.id===this.firstDataId&&this.decorate(h,t),!G(p.id)&&l.some(g=>p.index>=g.c1&&p.index<=g.c2)&&h.classList.add("fg-cell-range"),h};return i.first<c&&u.prepend(...r.slice(i.first,c).map(f)),i.last>d&&u.append(...r.slice(d+1,i.last+1).map(f)),e.first=i.first,e.last=i.last,!0}mergeState(e,t,n,r){if(!e.size)return"";let i="";for(let s of t){let a=e.get(s.id);if(!a)continue;let l=a.start[n],c=a.end[n];i+=l===c?"n":n===Math.max(l,r)?`d${l}`:"h"}return i}paintRow(e,t,n,r,i,s,a,l=new Map,c=0){let d=this.opts.rowHeight;for(e.className=`fg-row${n%2?" fg-row-odd":""}${i?" fg-row-selected":""}${this.grid.tracker.created.has(t.data)?" fg-row-created":""}${this.grid.editor.editingRow(t.id)?" fg-row-editing":""}`,this.placeRow(e,n),this.grid.options.rowSelection&&e.setAttribute("aria-selected",String(i)),t.level!==void 0?e.setAttribute("aria-level",String(t.level+1)):e.removeAttribute("aria-level"),t.hasChildren?e.setAttribute("aria-expanded",String(!!t.expanded)):e.removeAttribute("aria-expanded");e.childElementCount>r.length;)e.lastElementChild.remove();for(;e.childElementCount<r.length;)e.append(C("div","fg-cell",{role:"gridcell"}));let u=!1,f=r.length?this.grid.columns.region(r[0].region):[],p=f.some(w=>w.def.colSpan),h=-1,g=p?new Map(f.map((w,m)=>[w.id,m])):null;r.forEach((w,m)=>{let y=e.children[m];if(this.paintCell(y,t,n,w,i,s===w.id),g){let v=g.get(w.id);if(v<=h)y.classList.add("fg-cell-span-hidden");else if(w.def.colSpan&&!G(w.id)){let S=pt(w.def.colSpan,w.def,t.data,n,f.length-v);if(S>1){h=v+S-1;let x=0;for(let k=v;k<=h;k++)x+=f[k].width;y.style.width=`${x}px`,y.classList.add("fg-cell-colspan")}}}w.id===this.firstDataId&&this.decorate(y,t),y.style.top=y.style.height=y.style.bottom="";let b=l.get(w.id);b&&b.start[n]!==b.end[n]&&(n===Math.max(b.start[n],c)?(y.classList.add("fg-cell-merged"),y.style.top=`${-(this.rowTop(n)-this.rowTop(b.start[n]))}px`,y.style.height=`${this.rowTop(b.end[n])+this.rowH(b.end[n])-this.rowTop(b.start[n])}px`,y.style.bottom="auto",y.dataset.mergeTop=String(this.rowTop(b.start[n])),y.dataset.mergeLast=String(this.rowTop(b.end[n])-this.rowTop(b.start[n])),u=!0):y.classList.add("fg-cell-merge-hidden")),!y.classList.contains("fg-cell-merged")&&y.dataset.mergeTop!==void 0&&(delete y.dataset.mergeTop,delete y.dataset.mergeLast,y.style.removeProperty("--fg-merge-shift")),!G(w.id)&&a.some(v=>w.index>=v.c1&&w.index<=v.c2)&&y.classList.add("fg-cell-range")}),e.style.zIndex=u?"1":""}paintCell(e,t,n,r,i,s){var h;let a=this.grid.store.state.locale;e.style.left=`${r.left}px`,e.style.width=`${r.width}px`,e.dataset.col=r.id,e.setAttribute("aria-colindex",String(r.index+1));let l=s?"fg-cell fg-cell-focused":"fg-cell";if(r.id===Se){e.className=`${l} fg-cell-rownum`;let g=n>=0&&!t.kind?this.grid.rowNumber(n):null;e.textContent=g===null?"":String(g);return}if(r.id===Ie){e.className=`${l} fg-cell-drag`;let g=C("span",this.grid.canMoveRows()?"fg-drag-handle":"fg-drag-handle fg-drag-disabled",{"aria-hidden":"true"});g.textContent="\u22EE\u22EE",e.replaceChildren(g);return}if(r.id===le){e.className=`${l} fg-cell-select`;let g=C("input","fg-checkbox",{type:"checkbox",tabindex:"-1","aria-label":a.selectRow});g.checked=i,n>=0&&!t.kind&&!this.grid.rowSelectable(t.data)&&(g.disabled=!0,e.classList.add("fg-cell-select-locked")),e.replaceChildren(g);return}let c=r.def,d=j(c,t.data),u=ee(c,a.code)(d);l+=` fg-align-${(h=c.align)!=null?h:c.type==="number"?"right":c.type==="boolean"?"center":"left"}`;let f={value:d,formatted:u,row:t.data,rowIndex:n,column:c};if(c.cellClass)try{let g=typeof c.cellClass=="function"?c.cellClass(f):c.cellClass;g&&(l+=` ${g}`)}catch{V(`cellClass of column "${r.id}" threw`)}this.grid.tracker.isDirty(t.data,c.field)&&(l+=" fg-cell-dirty"),c.wrapText&&(l+=" fg-cell-wrap"),typeof c.editable=="function"&&n>=0&&!ye(c,t.data,n)&&(l+=" fg-cell-readonly"),n>=0&&(l+=this.grid.finder.classFor(n,r.id)),l+=this.grid.flashClass(t.id,r.id);let p=n>=0&&!t.kind?this.grid.cellFormat(t.data,r.id,d):null;if(p!=null&&p.bar&&(l+=" fg-cf-bar"),e.className=l,this.applyFormat(e,p),c.sparkline&&!c.renderer){let g=Array.isArray(d)?d.map(Number).filter(Number.isFinite):[];g.length?e.replaceChildren(js(g,c.sparkline===!0?{}:c.sparkline,r.width,this.opts.rowHeight)):e.replaceChildren(),e.setAttribute("aria-label",Array.isArray(d)?d.join(", "):"");return}if(!c.renderer){if(e.textContent=u,p!=null&&p.icon){let g=C("span","fg-cf-icon",{"aria-hidden":"true"});g.textContent=p.icon.char,g.style.color=p.icon.color,e.prepend(g)}return}try{let g=c.renderer(f);typeof g=="string"?e.innerHTML=g:e.replaceChildren(g)}catch{V(`renderer of column "${r.id}" threw; rendering an empty cell`),e.textContent=""}}applyFormat(e,t){var i,s;let n=e.style;if(!t){e.dataset.cf&&(n.color=n.background=n.fontWeight=n.fontStyle=n.textDecoration="",n.removeProperty("--fg-bar-from"),n.removeProperty("--fg-bar-to"),n.removeProperty("--fg-bar-color"),delete e.dataset.cf);return}e.dataset.cf="1";let r=t.style;n.color=(i=r.color)!=null?i:"",n.background=(s=r.background)!=null?s:"",n.fontWeight=r.bold?"600":"",n.fontStyle=r.italic?"italic":"",n.textDecoration=r.strike?"line-through":"",t.bar?(n.setProperty("--fg-bar-from",`${(t.bar.from*100).toFixed(2)}%`),n.setProperty("--fg-bar-to",`${(t.bar.to*100).toFixed(2)}%`),n.setProperty("--fg-bar-color",t.bar.color)):(n.removeProperty("--fg-bar-from"),n.removeProperty("--fg-bar-to"),n.removeProperty("--fg-bar-color"))}cellAt(e){let t=e instanceof Element?e.closest(".fg-cell"):null,n=t==null?void 0:t.parentElement;return!t||!(n!=null&&n.dataset.row)||!t.dataset.col||t.closest(".fg-root")!==this.root?null:{rowIndex:Number(n.dataset.row),colId:t.dataset.col}}ensureVisible(e,t){let n=this.scroller,r=this.rowTop(e),i=r+Math.min(this.rowH(e),n.clientHeight||1/0);r<n.scrollTop?n.scrollTop=r:i>n.scrollTop+n.clientHeight&&(n.scrollTop=i-n.clientHeight);let s=t?this.grid.columns.getColumn(t):void 0;(s==null?void 0:s.region)==="center"&&(s.left<n.scrollLeft?n.scrollLeft=s.left:s.left+s.width>n.scrollLeft+n.clientWidth&&(n.scrollLeft=s.left+s.width-n.clientWidth))}syncSummaryPane(e,t){var r;if(!e){(r=this.summaryEl)==null||r.remove(),this.summaryEl=this.summaryPanes=this.summaryInners=null;return}if(!this.summaryEl){let i=s=>({left:C("div",`${s} ${s}-left`),center:C("div",`${s} ${s}-center`),right:C("div",`${s} ${s}-right`)});this.summaryEl=C("div","fg-summary",{role:"rowgroup"}),this.summaryPanes=i("fg-summary-pane"),this.summaryInners=i("fg-summary-inner");for(let s of oe)this.summaryPanes[s].append(this.summaryInners[s]),this.summaryEl.append(this.summaryPanes[s])}this.summaryEl.className=`fg-summary fg-summary-${e}`,this.summaryEl.style.height=`${t}px`;for(let i of oe){let s=this.grid.columns.regionWidth(i);i!=="center"&&(this.summaryPanes[i].style.width=`${s}px`,this.summaryPanes[i].hidden=s===0),this.summaryInners[i].style.width=`${s}px`,this.summaryInners[i].style.height=`${t}px`}let n=this.geo.ow-this.geo.cw;this.summaryPanes.center.style.marginRight=`${n}px`}renderSummary(e,t,n,r,i){if(!t&&!this.summaryKey)return;let s=this.grid.columns.region("center"),a=zt(s.map(f=>f.left),s.map(f=>f.width),this.geo.left,this.geo.cw,Xn),l=[t,n,r,i,this.summaryInners,this.version,a.first,a.last,this.opts.rowHeight,r?0:this.rowsHeight(e),this.grid.store.state.locale.code];if($r(l,this.summaryKey))return;this.summaryKey=l;for(let f of oe){for(let p of this.canvasSummary[f])p.remove();this.canvasSummary[f]=[]}if(!t){this.summaryKey=null;return}let{columns:c}=this.grid,d=this.opts.rowHeight,u=c.displayed().filter(f=>!G(f.id));for(let f of oe){let p=f==="center"?s.slice(a.first,a.last+1):c.region(f),h=t.map((g,w)=>{var v,S,x;let m=g.label!=null&&(S=(v=u.find(k=>{var E;return!(k.id in((E=g.columns)!=null?E:{}))}))==null?void 0:v.id)!=null?S:null,y=C("div","fg-row fg-summary-row",{role:"row"}),b=r||i==="top"?w*d:this.rowsHeight(e)+w*d;y.style.transform=`translateY(${b}px)`,y.style.height=`${d}px`;for(let k of p)y.append(this.summaryCell(k,g,(x=n[w])!=null?x:{},m));return y});r?this.summaryInners[f].replaceChildren(...h):(this.canvases[f].append(...h),this.canvasSummary[f]=h)}}summaryCell(e,t,n,r){var p,h,g,w,m;let i=C("div","fg-cell",{role:"gridcell"});i.style.left=`${e.left}px`,i.style.width=`${e.width}px`,i.dataset.col=e.id;let s=e.def,a=(p=s.align)!=null?p:s.type==="number"?"right":s.type==="boolean"?"center":"left";i.className=`fg-cell fg-align-${a}`;let l=(h=t.columns)==null?void 0:h[e.id];if(l===void 0)return e.id===r&&(i.textContent=(g=t.label)!=null?g:"",i.classList.add("fg-summary-label")),i;let c=n[e.id],d=ft(l),u=this.grid.store.state.locale.code,f;if(c==null||c==="")f="";else if(typeof c=="string")f=c;else if(d.agg==="count")f=Re(u).format(c);else{let y=(w=s.type)!=null?w:typeof c=="number"?"number":c instanceof Date?"date":void 0;f=at(s,y,u,(m=d.format)!=null?m:s.format)(c)}return i.textContent=d.prefix&&f?`${d.prefix} ${f}`:f,i}get heightOf(){var t;let e=this.grid.options.getRowHeight;if(e)return(t=this.heightFn)!=null?t:this.heightFn=n=>{var r;try{return(r=e(n))!=null?r:void 0}catch{return}}}invalidateHeights(){this.heightOf&&this.heightsVersion++,this.rowHeights.size&&(this.rowHeights.clear(),this.measureAll=!0,this.heightsVersion++)}measureRows(){var i;let e=this.opts.rowHeight,t=new Map,n=this.measureAll?new Set(oe.flatMap(s=>[...this.painted[s].keys()])):this.touched;this.measureAll=!1;for(let s of n){let a=this.grid.rowModel.getRow(s);if(!a||a.kind)continue;let l=e;for(let c of oe){let d=this.painted[c].get(s);if(d)for(let u of d.el.querySelectorAll(".fg-cell-wrap"))u.classList.contains("fg-cell-merged")||u.classList.contains("fg-cell-merge-hidden")||(l=Math.max(l,Math.ceil(u.scrollHeight)))}t.set(s,l)}this.touched.clear();let r=!1;for(let[s,a]of t){let l=this.grid.rowModel.getRow(s).id,c=(i=this.rowHeights.get(l))!=null?i:e;Math.abs(c-a)>1&&(a===e?this.rowHeights.delete(l):this.rowHeights.set(l,a),r=!0)}r&&(this.heightsVersion++,this.version++,this.schedule())}detailHeight(){let e=this.grid.options.detailHeight;return typeof e=="number"&&e>0?e:240}rowTop(e){return(this.offsets?this.offsets[e]:e*this.opts.rowHeight)+this.topOffset}rowH(e){return this.offsets?this.offsets[e+1]-this.offsets[e]:this.opts.rowHeight}rowsHeight(e){return this.offsets?this.offsets[e]:e*this.opts.rowHeight}placeRow(e,t){e.style.transform=`translateY(${this.rowTop(t)}px)`,e.style.height=`${this.rowH(t)}px`,e.dataset.row=String(t),e.setAttribute("aria-rowindex",String(t+1+this.grid.columns.depth+(this.filterRow?1:0)))}decorate(e,t){var c;let{grid:n}=this,r=n.store.state.locale,i=(c=t.level)!=null?c:0,s=!!n.options.treeData,a=n.canExpandDetail(t.data);if(!s&&!a&&!i)return;e.classList.add("fg-cell-lead"),e.style.setProperty("--fg-level",String(i));let l=[];if(s)if(t.hasChildren){let d=C("button",t.expanded?"fg-tree-toggle fg-expanded":t.loading?"fg-tree-toggle fg-tree-loading":"fg-tree-toggle",{type:"button",tabindex:"-1","aria-label":t.expanded?r.collapseAll:r.expandAll,"aria-expanded":String(!!t.expanded)});t.loading&&d.setAttribute("aria-busy","true"),d.innerHTML=Jn,l.push(d)}else l.push(C("span","fg-tree-spacer",{"aria-hidden":"true"}));if(a){let d=n.isDetailExpanded(t.data),u=C("button",d?"fg-detail-toggle fg-expanded":"fg-detail-toggle",{type:"button",tabindex:"-1","aria-expanded":String(d),"aria-label":d?r.collapseAll:r.expandAll});u.innerHTML=Jn,l.push(u)}e.prepend(...l)}paintGroupRow(e,t,n,r,i){var c;let s=t.group,{grid:a}=this,l=a.store.state.locale;for(e.className="fg-row fg-row-group",this.placeRow(e,n),e.setAttribute("aria-level",String(((c=t.level)!=null?c:0)+1)),e.setAttribute("aria-expanded",String(s.expanded)),e.removeAttribute("aria-selected"),e.style.zIndex="";e.childElementCount>r.length;)e.lastElementChild.remove();for(;e.childElementCount<r.length;)e.append(C("div","fg-cell",{role:"gridcell"}));r.forEach((d,u)=>{var m,y,b,v,S,x,k;let f=e.children[u];f.style.left=`${d.left}px`,f.style.width=`${d.width}px`,f.style.top=f.style.height=f.style.bottom="",f.style.removeProperty("--fg-level"),f.dataset.col=d.id,f.setAttribute("aria-colindex",String(d.index+1));let p=i===d.id?" fg-cell-focused":"";if(d.id===le){if(f.className=`fg-cell fg-cell-select${p}`,a.options.rowSelection!=="multiple"){f.replaceChildren();return}let E=a.groupSelection(t),L=C("input","fg-checkbox",{type:"checkbox",tabindex:"-1","aria-label":l.selectAllRows});L.checked=E==="all",L.indeterminate=E==="some",f.replaceChildren(L);return}if(d.id===this.groupLabelId){f.className=`fg-cell fg-group-cell${p}`,f.style.setProperty("--fg-level",String((m=t.level)!=null?m:0));let E=C("button",s.expanded?"fg-group-toggle fg-expanded":"fg-group-toggle",{type:"button",tabindex:"-1","aria-expanded":String(s.expanded),"aria-label":s.expanded?l.collapseAll:l.expandAll});E.innerHTML=Jn;let L=(y=a.columns.getNode(s.colId))==null?void 0:y.def,R=C("span","fg-group-label"),M=K(s.value)?l.blanks:L?ee(L,l.code)(s.value):String(s.value),T=Re(l.code),A=(b=s.count)!=null?b:s.aggregates?null:s.rows.length;R.textContent=`${(S=(v=L==null?void 0:L.header)!=null?v:L==null?void 0:L.field)!=null?S:s.colId}: ${M}${A==null?"":` (${T.format(A)})`}`,f.replaceChildren(E,R);return}let h=d.def,g=(x=h.align)!=null?x:h.type==="number"?"right":h.type==="boolean"?"center":"left";f.className=`fg-cell fg-align-${g}${p}`;let w=h.aggFunc&&!G(d.id)?a.groupAggregate(t,d.id):void 0;if(w==null||w==="")f.textContent="";else if(h.aggFunc==="count")f.textContent=Re(l.code).format(w);else{let E=(k=h.type)!=null?k:typeof w=="number"?"number":w instanceof Date?"date":void 0;f.textContent=at(h,E,l.code)(w)}f.textContent&&f.classList.add("fg-cell-agg")})}paintDetailRow(e,t,n,r){var a,l;if(e.className="fg-row fg-row-detail",this.placeRow(e,n),e.style.zIndex="",r!=="center"){e.replaceChildren();return}let i=t.detailOf,s=this.details.get(i.id);if(!s){s=C("div","fg-detail");try{let c=(l=(a=this.grid.options).detailRenderer)==null?void 0:l.call(a,{row:i.data,rowIndex:n-1});typeof c=="string"?s.innerHTML=c:c&&s.append(c)}catch{V("detailRenderer threw; showing an empty panel")}this.details.set(i.id,s)}s.style.left=`${this.geo.left}px`,s.style.width=`${this.geo.cw||this.grid.columns.regionWidth("center")}px`,(e.firstChild!==s||e.childNodes.length!==1)&&e.replaceChildren(s)}paintLoadingRow(e,t,n){e.className="fg-row fg-row-loading",this.placeRow(e,t),e.setAttribute("aria-busy","true"),e.style.zIndex="",e.replaceChildren(...n.map(r=>{let i=C("div","fg-cell",{role:"gridcell"});return i.style.left=`${r.left}px`,i.style.width=`${r.width}px`,i.dataset.col=r.id,G(r.id)||i.append(C("span","fg-skeleton",{"aria-hidden":"true"})),i}))}renderPager(){var m;let{grid:e}=this,t=e.options.pagination;if(!t){(m=this.pagerEl)==null||m.remove(),this.pagerEl=null;return}let n=e.store.state.locale,r=e.getPage(),i=e.getPageSize(),s=e.getPageCount(),a=e.rowModel.fullCount(),l=typeof t=="object"&&Array.isArray(t.pageSizes)?t.pageSizes.filter(y=>Number.isInteger(y)&&y>0):[],c=`${r}|${i}|${s}|${a}|${n.code}|${l.join(",")}`;if(this.pagerEl&&c===this.pagerKey)return;this.pagerKey=c,this.pagerEl||(this.pagerEl=C("div","fg-pager",{role:"navigation"}),this.pagerEl.addEventListener("click",y=>{var S;let b=(S=y.target.closest("button[data-action]"))==null?void 0:S.dataset.action,v=e.getPage();b==="first"?e.setPage(0):b==="prev"?e.setPage(v-1):b==="next"?e.setPage(v+1):b==="last"&&e.setPage(e.getPageCount()-1)}),this.pagerEl.addEventListener("change",y=>{let b=y.target;b.classList.contains("fg-pager-size")&&e.setPageSize(Number(b.value))})),this.pagerEl.setAttribute("aria-label",n.pageSize);let d=Re(n.code),u=a?r*i+1:0,f=Math.min(a,(r+1)*i),p=C("span","fg-pager-range");p.textContent=n.pagerRange.replace("{from}",d.format(u)).replace("{to}",d.format(f)).replace("{total}",d.format(a));let h=[p,C("span","fg-pager-spacer")];if(l.length){let y=C("label","fg-pager-size-label");y.textContent=n.pageSize;let b=C("select","fg-pager-size");for(let v of[...new Set([...l,i])].sort((S,x)=>S-x)){let S=C("option");S.value=String(v),S.textContent=d.format(v),S.selected=v===i,b.append(S)}y.append(b),h.push(y)}let g=(y,b,v,S)=>{let x=C("button","fg-pager-btn",{type:"button","aria-label":v,title:v});return x.dataset.action=y,x.textContent=b,x.disabled=S,x},w=C("span","fg-pager-page",{"aria-live":"polite"});w.textContent=n.pageOf.replace("{page}",d.format(r+1)).replace("{pages}",d.format(s)),h.push(g("first","\xAB",n.firstPage,r===0),g("prev","\u2039",n.previousPage,r===0),w,g("next","\u203A",n.nextPage,r>=s-1),g("last","\xBB",n.lastPage,r>=s-1)),this.pagerEl.replaceChildren(...h)}showFreeBadge(){if(this.root.querySelector(".fg-free-badge"))return;let e=C("a","fg-free-badge",{href:"https://freegrid.app/pricing/",target:"_blank",rel:"noopener"});e.innerHTML='<svg viewBox="0 0 32 32" width="14" height="14" aria-hidden="true"><rect width="32" height="32" rx="7" fill="#0E1726"/><path d="M7 11.5h18M7 16.5h18M7 21.5h18M13 7v18" stroke="#fff" stroke-width="2" stroke-linecap="round"/><rect x="14" y="12.5" width="11" height="3" rx="1" fill="#F2A900"/></svg>';let t=C("span");t.textContent=`FreeGrid \xB7 ${this.grid.store.state.locale.freeBadge}`,e.append(t),this.root.append(e)}useCards(){let e=this.grid.options.cardView,t=e===!0?640:typeof e=="number"?e:-1,n=t>0&&this.main.clientWidth<t;return n!==this.cardMode&&(this.cardMode=n,this.root.classList.toggle("fg-card-mode",n),!n&&this.cards&&(this.cards.scroller.remove(),this.cards=null),this.version++),n}renderCards(e){var g,w,m,y,b;let{grid:t}=this;if(!this.cards){let v=C("div","fg-cards",{role:"list"}),S=C("div","fg-cards-canvas");v.append(S),this.main.insertBefore(v,this.overlay),v.addEventListener("scroll",()=>{this.schedule(),this.grid.events.emit("scroll",this.getScroll())},{passive:!0}),v.addEventListener("click",this.onCardClick),this.cards={scroller:v,canvas:S}}let{scroller:n,canvas:r}=this.cards,i=t.columns.displayed().filter(v=>!G(v.id)),s=Math.round(this.opts.rowHeight*.75),a=!!t.options.rowSelection,l=20+i.length*s+(a?s:0),c=10;r.style.height=`${e*(l+c)}px`;let d=Math.max(0,Math.floor(n.scrollTop/(l+c))-2),u=Math.min(e-1,Math.ceil((n.scrollTop+(n.clientHeight||800))/(l+c))+2),{selected:f,locale:p}=t.store.state,h=[];for(let v=d;v<=u;v++){let S=t.rowModel.getRow(v);if(!S)continue;let x=C("div",S.kind?"fg-card fg-card-other":f.has(S.id)?"fg-card fg-card-selected":"fg-card",{role:"listitem"});if(x.dataset.row=String(v),x.style.transform=`translateY(${v*(l+c)}px)`,x.style.height=`${l}px`,x.style.setProperty("--fg-card-line",`${s}px`),S.kind==="group"&&S.group){let k=(g=t.columns.getNode(S.group.colId))==null?void 0:g.def;x.textContent=`${(w=k==null?void 0:k.header)!=null?w:S.group.colId}: ${String((m=S.group.value)!=null?m:p.blanks)} (${S.group.rows.length})`}else if(!S.kind){if(a){let k=C("label","fg-card-head"),E=C("input","fg-card-check fg-checkbox",{type:"checkbox","aria-label":p.selectRow});E.checked=f.has(S.id),E.disabled=!t.rowSelectable(S.data),k.append(E,document.createTextNode(`#${v+1}`)),x.append(k)}for(let k of i){let E=C("div","fg-card-line"),L=C("span","fg-card-label");L.textContent=(b=(y=k.def.header)!=null?y:k.def.field)!=null?b:k.id;let R=C("span","fg-card-value");R.dataset.col=k.id;let M=j(k.def,S.data),T=ee(k.def,p.code)(M);if(k.def.renderer)try{let A=k.def.renderer({value:M,formatted:T,row:S.data,rowIndex:v,column:k.def});typeof A=="string"?R.innerHTML=A:R.replaceChildren(A)}catch{R.textContent=T}else R.textContent=T;E.append(L,R),x.append(E)}}h.push(x)}r.replaceChildren(...h)}dropDetail(e){e===void 0?this.details.clear():this.details.delete(e)}renderedRange(){return this.lastRange}measureText(e,t){let n=getComputedStyle(this.main),r=parseFloat(getComputedStyle(this.root).getPropertyValue("--fg-font-size"))||13;this.measureCtx===void 0&&(this.measureCtx=document.createElement("canvas").getContext("2d"));let i=this.measureCtx;return i?(i.font=`${t?600:400} ${r}px ${n.fontFamily||"sans-serif"}`,i.measureText(e).width):e.length*r*.6}scrollToRow(e){this.scroller.scrollTop=this.rowTop(Math.max(0,Math.min(e,this.grid.rowModel.getRowCount())))}pageRows(){return Math.max(1,Math.floor(this.scroller.clientHeight/this.opts.rowHeight))}destroy(){var e;(e=this.filterRow)==null||e.destroy(),this.frame&&cancelAnimationFrame(this.frame),this.scroller.removeEventListener("scroll",this.onScroll),this.root.remove()}},Yn=class{constructor(e){this.key=null;let t=n=>({left:C("div",`${n} ${n}-left`),center:C("div",`${n} ${n}-center`),right:C("div",`${n} ${n}-right`)});this.el=C("div",e,{role:"rowgroup"}),this.panes=t("fg-section-pane"),this.inners=t("fg-section-inner");for(let n of oe)this.panes[n].append(this.inners[n]),this.el.append(this.panes[n])}size(e,t,n){this.el.style.height=`${t}px`;for(let r of oe){let i=e.regionWidth(r);r!=="center"&&(this.panes[r].style.width=`${i}px`,this.panes[r].hidden=i===0),this.inners[r].style.width=`${i}px`,this.inners[r].style.height=`${t}px`}this.panes.center.style.marginRight=`${n}px`}};function $r(o,e){return!!e&&o.length===e.length&&o.every((t,n)=>t===e[n])}var Nr="http://www.w3.org/2000/svg";function js(o,e,t,n){var m;let r=Math.max(20,t-16),i=Math.max(10,n-14),s=document.createElementNS(Nr,"svg");s.setAttribute("class","fg-sparkline"),s.setAttribute("width",String(r)),s.setAttribute("height",String(i)),s.setAttribute("viewBox",`0 0 ${r} ${i}`),s.setAttribute("aria-hidden","true");let a=(m=e.color)!=null?m:"var(--fg-accent)",l=e.type==="bar",c=o.reduce((y,b)=>Math.min(y,b),l?0:1/0),d=o.reduce((y,b)=>Math.max(y,b),l?0:-1/0);c===d&&(c-=1,d+=1);let u=d-c,f=y=>i-1-(y-c)/u*(i-2),p=(y,b)=>{let v=document.createElementNS(Nr,y);for(let[S,x]of Object.entries(b))v.setAttribute(S,String(x));return s.append(v),v};if(e.type==="bar"){let y=r/o.length;return o.forEach((b,v)=>p("rect",{x:v*y+1,y:Math.min(f(b),f(0)),width:Math.max(1,y-2),height:Math.max(1,Math.abs(f(b)-f(0))),fill:b<0?"#ef4444":a})),s}let h=o.length>1?(r-2)/(o.length-1):0,g=o.map((y,b)=>`${1+b*h},${f(y)}`).join(" ");e.type==="area"&&p("polygon",{points:`1,${i} ${g} ${1+(o.length-1)*h},${i}`,fill:a,"fill-opacity":.2}),p("polyline",{points:g,fill:"none",stroke:a,"stroke-width":1.5,"stroke-linejoin":"round"});let w=o.length-1;return p("circle",{cx:1+w*h,cy:f(o[w]),r:2,fill:a}),s}var Us=4,qt=class{constructor(e){this.grid=e;this.onClick=e=>{var r;let t=e.target.closest(".fg-group-chip-remove"),n=(r=t==null?void 0:t.closest(".fg-group-chip"))==null?void 0:r.dataset.col;n&&this.grid.setGroupBy(this.grid.getGroupBy().filter(i=>i!==n))};this.onPointerDown=e=>{let t=e.target,n=t.closest(".fg-group-chip");if(e.button!==0||!n||t.closest("button"))return;let r=n.dataset.col,i=e.clientX,s=!1,a=c=>{!s&&Math.abs(c.clientX-i)<Us||(s=!0,n.classList.add("fg-dragging"))},l=c=>{if(window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",l),n.classList.remove("fg-dragging"),!s)return;let u=[...this.el.querySelectorAll(".fg-group-chip")].filter(p=>p!==n).filter(p=>{let h=p.getBoundingClientRect();return c.clientX>h.left+h.width/2}).length,f=this.grid.getGroupBy().filter(p=>p!==r);f.splice(u,0,r),this.grid.setGroupBy(f)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",l)};this.el=C("div","fg-group-panel",{role:"toolbar"}),e.renderer.main.insertBefore(this.el,e.renderer.gridEl),this.el.addEventListener("click",this.onClick),this.el.addEventListener("pointerdown",this.onPointerDown),this.refresh()}contains(e,t){let n=this.el.getBoundingClientRect();return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}highlight(e){this.el.classList.toggle("fg-group-panel-over",e)}refresh(){let{grid:e}=this,t=e.store.state.locale;this.el.setAttribute("aria-label",t.groupByThis);let n=e.getGroupBy();if(!n.length){let r=C("span","fg-group-hint");r.textContent=t.groupPanelHint,this.el.replaceChildren(r);return}this.el.replaceChildren(...n.map((r,i)=>{var d,u,f;let s=(d=e.columns.getNode(r))==null?void 0:d.def,a=C("span","fg-group-chip");a.dataset.col=r;let l=C("span","fg-group-chip-label");l.textContent=(f=(u=s==null?void 0:s.header)!=null?u:s==null?void 0:s.field)!=null?f:r;let c=C("button","fg-group-chip-remove",{type:"button","aria-label":`${t.ungroup}: ${l.textContent}`});if(c.textContent="\xD7",a.append(l,c),i<n.length-1){let p=C("span","fg-group-sep",{"aria-hidden":"true"});return p.textContent="\u203A",[a,p]}return[a]}).flat())}destroy(){this.el.removeEventListener("click",this.onClick),this.el.removeEventListener("pointerdown",this.onPointerDown),this.el.remove()}};var Ye=class{constructor(){this.listeners=new Map}on(e,t){let n=this.listeners.get(e);return n||this.listeners.set(e,n=new Set),n.add(t),()=>{n.delete(t)}}emit(e,t){let n=this.listeners.get(e);if(n)for(let r of[...n])try{r(t)}catch(i){console.error("[FreeGrid] event listener threw",i)}}clear(){this.listeners.clear()}};function re(o){let e=o.getRootNode();return typeof ShadowRoot!="undefined"&&e instanceof ShadowRoot?e:document.body}function ht(o,e,t){var r;let n=o.getRootNode();return(r=typeof n.elementFromPoint=="function"?n.elementFromPoint(e,t):null)!=null?r:document.elementFromPoint(e,t)}function Or(o){var t;return(t=o.getRootNode().activeElement)!=null?t:document.activeElement}function ce(o,...e){let t=typeof o.composedPath=="function"?o.composedPath():[];return t.length?e.some(n=>!!n&&t.includes(n)):e.some(n=>!!n&&n.contains(o.target))}var Zn=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","Home","End","PageUp","PageDown"]);function Qn(o,e,t,n){let r=s=>Math.max(0,Math.min(n.rows-1,s)),i=s=>Math.max(0,Math.min(n.cols-1,s));switch(o){case"ArrowUp":return{rowIndex:r(t.rowIndex-1),colIndex:t.colIndex};case"ArrowDown":return{rowIndex:r(t.rowIndex+1),colIndex:t.colIndex};case"ArrowLeft":return{rowIndex:t.rowIndex,colIndex:i(t.colIndex-1)};case"ArrowRight":return{rowIndex:t.rowIndex,colIndex:i(t.colIndex+1)};case"PageUp":return{rowIndex:r(t.rowIndex-n.pageRows),colIndex:t.colIndex};case"PageDown":return{rowIndex:r(t.rowIndex+n.pageRows),colIndex:t.colIndex};case"Home":return{rowIndex:e.ctrl?0:t.rowIndex,colIndex:0};case"End":return{rowIndex:e.ctrl?n.rows-1:t.rowIndex,colIndex:n.cols-1};case"Tab":{let s=t.rowIndex*n.cols+t.colIndex+(e.shift?-1:1);return s<0||s>=n.rows*n.cols?null:{rowIndex:Math.floor(s/n.cols),colIndex:s%n.cols}}default:return null}}var Wt=new Map,eo=new WeakMap,Br=o=>o?eo.get(o):void 0,Hr=o=>o?Wt.get(o):void 0;var Ks={Enter:"edit",F2:"edit",Delete:"clear",Backspace:"clear","Ctrl+Z":"undo","Ctrl+Y":"redo","Ctrl+Shift+Z":"redo","Ctrl+F":"find"};function _s(o){let e=[];return(o.ctrlKey||o.metaKey)&&e.push("Ctrl"),o.altKey&&e.push("Alt"),o.shiftKey&&o.key.length>1&&e.push("Shift"),o.shiftKey&&o.key.length===1&&(o.ctrlKey||o.metaKey)&&e.push("Shift"),e.push(o.key.length===1?o.key.toUpperCase():o.key),e.join("+")}var Xs=3;function Js(o,e){return o.renderer.rtl?e.key==="ArrowLeft"?"ArrowRight":e.key==="ArrowRight"?"ArrowLeft":e.key:e.key}function Gr(o){var L;let{renderer:e}=o,t=e.bodyEl,n=e.root,r=R=>Js(o,R),i="mouse",s=0,a=null,l=!1,c=R=>{let M=e.cellAt(R.target);if(!M)return null;let T=o.rowModel.getRow(M.rowIndex),A=o.columns.getColumn(M.colId);if(!T||!A)return null;let F=G(A.id)?void 0:j(A.def,T.data);return{row:T.data,rowIndex:M.rowIndex,colId:M.colId,value:F,event:R}},d=R=>{var F,$;let M=($=(F=R.target).closest)==null?void 0:$.call(F,".fg-group-toggle, .fg-tree-toggle, .fg-detail-toggle"),T=M&&e.cellAt(R.target);if(!T)return!1;e.gridEl.focus({preventScroll:!0}),o.setFocus(T.rowIndex,T.colId),o.setRange(null);let A=o.rowModel.getRow(T.rowIndex);return M.classList.contains("fg-detail-toggle")?o.setDetailExpanded(A.data,!o.isDetailExpanded(A.data)):o.toggleRow(T.rowIndex),!0},u=R=>{var O;if(d(R))return;let M=o.store.state.focus,T=e.cellAt(R.target);if(T&&((O=o.rowModel.getRow(T.rowIndex))!=null&&O.kind)){T.colId===le&&o.rowModel.getRow(T.rowIndex).kind==="group"&&o.toggleGroupSelection(o.rowModel.getRow(T.rowIndex)),e.gridEl.focus({preventScroll:!0}),o.setFocus(T.rowIndex,T.colId),o.setRange(null);return}let A=c(R);if(!A)return;if(e.gridEl.focus({preventScroll:!0}),A.colId===Se){let P=o.columns.displayed().filter(N=>!G(N.id));P.length&&(o.setFocus(A.rowIndex,P[0].id),o.rangesOn()&&o.setRange({start:{rowIndex:A.rowIndex,colId:P[0].id},end:{rowIndex:A.rowIndex,colId:P[P.length-1].id}}));return}let F=l;l=!1;let $=o.store.state.focus,D=A.colId===le;if(!F)if(R.shiftKey&&$&&!D&&!G($.colId)&&o.rangesOn())o.setRange({start:$,end:{rowIndex:A.rowIndex,colId:A.colId}},!0);else if((R.ctrlKey||R.metaKey)&&!D&&!G(A.colId)&&o.rangesOn()){let P={rowIndex:A.rowIndex,colId:A.colId};o.addRange({start:P,end:P}),o.setFocus(A.rowIndex,A.colId)}else o.setFocus(A.rowIndex,A.colId),o.setRange(null);o.options.rowSelection&&!F&&(D||o.options.rowClickSelection!==!1)&&o.selectFromClick(A.rowIndex,D||R.ctrlKey||R.metaKey,R.shiftKey),o.events.emit("cellClick",A),i==="touch"&&!F&&M&&M.rowIndex===A.rowIndex&&M.colId===A.colId&&o.editor.canEdit(A.rowIndex,A.colId)&&(o.columns.getColumn(A.colId).def.type==="boolean"?o.applyEdit(A.rowIndex,A.colId,A.value!==!0):o.editor.start(A.rowIndex,A.colId))},f=R=>{var $,D;if((D=($=R.target).closest)!=null&&D.call($,"button"))return;let M=e.cellAt(R.target),T=M&&o.rowModel.getRow(M.rowIndex);if((T==null?void 0:T.kind)==="group"){o.toggleRow(M.rowIndex);return}if(T!=null&&T.kind)return;let A=c(R);if(!A||(o.events.emit("cellDoubleClick",A),!o.editor.canEdit(A.rowIndex,A.colId)))return;o.columns.getColumn(A.colId).def.type==="boolean"?o.applyEdit(A.rowIndex,A.colId,A.value!==!0):o.editor.start(A.rowIndex,A.colId)},p={...Ks};for(let[R,M]of Object.entries((L=o.options.keymap)!=null?L:{}))p[R]=M===!1?"none":M;let h=R=>{var F,$;let M=o.store.state.focus,T=p[_s(R)];if(T==="none")return!1;switch(T){case"edit":return!M||!o.editor.canEdit(M.rowIndex,M.colId)||o.columns.getColumn(M.colId).def.type==="boolean"?!1:(o.editor.start(M.rowIndex,M.colId),!0);case"clear":return o.clearCells(),!0;case"undo":return o.undo(),!0;case"redo":return o.redo(),!0;case"copy":return o.copyToClipboard(!1),!0;case"cut":return o.cutToClipboard(),!0;case"selectAll":return o.selectAllCells(),!0;case"find":return o.options.findBar===!1||!o.paid?!1:(o.finder.openBar(),!0);case"paste":return($=(F=navigator.clipboard)==null?void 0:F.readText)==null||$.call(F).then(D=>o.pasteText(D),()=>{}),!0}if(!M||!o.editor.canEdit(M.rowIndex,M.colId))return!1;let A=o.columns.getColumn(M.colId).def;if(R.key===" "&&A.type==="boolean"&&!R.ctrlKey&&!R.metaKey){let D=o.rowModel.getRow(M.rowIndex).data;return o.applyEdit(M.rowIndex,M.colId,D[A.field]!==!0),!0}return R.key.length===1&&R.key!==" "&&!R.ctrlKey&&!R.metaKey&&!R.altKey&&A.type!=="boolean"?(o.editor.start(M.rowIndex,M.colId,R.key),!0):!1},g=R=>{var D,O,P;let M=o.store.state.focus;if(!M||R.ctrlKey||R.metaKey||R.altKey||R.shiftKey)return!1;let T=o.rowModel.getRow(M.rowIndex);if(!o.isExpandable(T))return!1;let A=T.kind==="group";if(!A&&M.colId!==((D=o.columns.displayed().find(N=>!G(N.id)))==null?void 0:D.id))return!1;let F=!!((P=(O=T.group)==null?void 0:O.expanded)!=null?P:T.expanded),$=o.expandKey(T);if(A&&(R.key==="Enter"||R.key===" "))o.setGroupExpanded($,!F);else if(r(R)==="ArrowRight"&&!F)o.setGroupExpanded($,!0);else if(r(R)==="ArrowLeft"&&F)o.setGroupExpanded($,!1);else return!1;return!0},w=R=>{let M=e.cellAt(R.target);if(!M||M.colId!==Ie)return!1;R.preventDefault();let T=o.rowModel.getRow(M.rowIndex);if(!T||T.kind||!o.canMoveRows())return!0;let A=T.data,F=C("div","fg-row-drop-marker"),$=null;n.classList.add("fg-row-dragging");let D=P=>{var pe,ke;let N=ht(n,P.clientX,P.clientY),B=N==null?void 0:N.closest(".fg-root"),z=B===n?o:Hr(B),W=o.dragOptions.group;if($=null,F.remove(),!z||!B||z!==o&&(!W||z.dragOptions.group!==W||!z.options.rowDrag))return;let U=N.closest(".fg-row[data-row]"),X=U==null?void 0:U.getBoundingClientRect(),I=null,H="after",J;if(U&&X){let Z=z.rowModel.getRow(Number(U.dataset.row));if(!Z||Z.kind==="group")return;I=(ke=(pe=Z.detailOf)==null?void 0:pe.data)!=null?ke:Z.data;let se=(P.clientY-X.top)/X.height;Z.kind==="detail"?H="after":z.options.treeData?H=se<.25?"before":se>.75?"after":"inside":H=se<.5?"before":"after",J=H==="before"?X.top:X.bottom}else{if(!N.closest(".fg-body"))return;let Z=B.querySelectorAll(".fg-body-pane-center .fg-row[data-row]");J=Z.length?Math.max(...[...Z].map(se=>se.getBoundingClientRect().bottom)):B.querySelector(".fg-body").getBoundingClientRect().top}if(!z.canDropRow(A,I,H,o))return;$={into:z,target:I,position:H};let Y=B.getBoundingClientRect().top;F.classList.toggle("fg-row-drop-inside",H==="inside"),F.style.top=`${H==="inside"?X.top-Y:J-Y-1}px`,F.style.height=H==="inside"?`${X.height}px`:"",B.append(F)},O=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),n.classList.remove("fg-row-dragging"),F.remove(),$&&$.into.dropRow(A,$.target,$.position,o)};return window.addEventListener("pointermove",D),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O),!0},m=R=>{let M=e.cellAt(R.target);if(!M)return;let T=R.clientX,A=R.clientY,F=()=>{clearTimeout(s),window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",F),window.removeEventListener("pointercancel",F),a===F&&(a=null)},$=D=>{Math.hypot(D.clientX-T,D.clientY-A)>8&&F()};clearTimeout(s),s=window.setTimeout(()=>{F(),o.contextMenu.enabled()&&(l=!0,G(M.colId)||(o.setFocus(M.rowIndex,M.colId),o.rangeContains(M.rowIndex,M.colId)||o.setRange({start:M,end:M})),o.contextMenu.open(T,A,M.rowIndex,M.colId))},550),a==null||a(),a=F,window.addEventListener("pointermove",$),window.addEventListener("pointerup",F),window.addEventListener("pointercancel",F)},y=R=>{if(i=R.pointerType||"mouse",i==="touch"){m(R);return}if(R.button===0&&w(R)||!o.rangesOn()||R.button!==0||R.shiftKey||R.target.closest("input, a, button"))return;let M=e.cellAt(R.target);if(!M||G(M.colId))return;let T=R.clientX,A=R.clientY,F=R.ctrlKey||R.metaKey,$=!1,D=P=>{if(!$&&Math.hypot(P.clientX-T,P.clientY-A)<Xs)return;let N=e.cellAt(ht(n,P.clientX,P.clientY));!N||G(N.colId)||($||($=!0,n.classList.add("fg-range-dragging"),F&&o.addRange({start:M,end:M}),o.setFocus(M.rowIndex,M.colId)),o.setRange({start:M,end:N},F))},O=()=>{window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O),n.classList.remove("fg-range-dragging"),$&&(l=!0),a===O&&(a=null)};a==null||a(),a=O,window.addEventListener("pointermove",D),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O)},b=R=>{var B,z;if(R.target!==n&&R.target!==e.gridEl)return;let M=o.columns.displayed(),T=o.rowModel.getRowCount();if(!M.length||!T)return;if(g(R)){R.preventDefault();return}if(h(R)){R.preventDefault();return}let A=o.store.state.focus,F=R.ctrlKey||R.metaKey;if(R.key==="Escape"&&o.store.state.range){R.preventDefault(),o.setRange(null);return}if(F&&R.key.toLowerCase()==="a"&&o.rangesOn()){R.preventDefault(),o.selectAllCells();return}if(R.key==="ContextMenu"||R.key==="F10"&&R.shiftKey){R.preventDefault(),o.contextMenu.openAtFocus();return}if(R.key===" "&&A&&o.options.rowSelection){R.preventDefault(),o.selectFromClick(Math.min(A.rowIndex,T-1),!0,R.shiftKey);return}let $={rows:T,cols:M.length,pageRows:e.pageRows()},D=M.findIndex(W=>!G(W.id));if(o.rangesOn()&&R.shiftKey&&R.key!=="Tab"&&Zn.has(R.key)){let W=A!=null?A:{rowIndex:0,colId:M[D].id},U=o.store.state.range,X=(B=U==null?void 0:U.end)!=null?B:W,I={rowIndex:Math.min(X.rowIndex,T-1),colIndex:Math.max(0,M.findIndex(Y=>Y.id===X.colId))},H=Qn(r(R),{ctrl:F,shift:!1},I,$);if(!H)return;R.preventDefault();let J=M[Math.max(D,H.colIndex)].id;A||o.setFocus(W.rowIndex,W.colId),o.setRange({start:(z=U==null?void 0:U.start)!=null?z:W,end:{rowIndex:H.rowIndex,colId:J}}),e.ensureVisible(H.rowIndex,J);return}let P;if(!A)P=Zn.has(R.key)&&R.key!=="Tab"?{rowIndex:0,colIndex:0}:null;else{let W=Math.max(0,M.findIndex(U=>U.id===A.colId));P=Qn(r(R),{ctrl:F,shift:R.shiftKey},{rowIndex:Math.min(A.rowIndex,T-1),colIndex:W},$)}if(!P)return;R.preventDefault();let N=M[P.colIndex].id;o.setFocus(P.rowIndex,N),o.setRange(null),e.ensureVisible(P.rowIndex,N)},v=R=>{var M,T;return(T=(M=R.target)==null?void 0:M.closest)==null?void 0:T.call(M,".fg-editor, input, textarea, select, [contenteditable]")},S=R=>{var M,T;return((T=(M=R.target)==null?void 0:M.closest)==null?void 0:T.call(M,".fg-root"))!==n},x=R=>{if(v(R)||S(R))return;let M=o.selectionTSV(!1);!M||!R.clipboardData||(R.clipboardData.setData("text/plain",M),R.preventDefault())},k=R=>{if(v(R)||S(R))return;let M=o.selectionTSV(!1);!M||!R.clipboardData||(R.clipboardData.setData("text/plain",M),R.preventDefault(),o.clearCells(!0))},E=R=>{var T;if(v(R)||S(R))return;let M=(T=R.clipboardData)==null?void 0:T.getData("text/plain");M&&(R.preventDefault(),o.pasteText(M))};return t.addEventListener("click",u),t.addEventListener("dblclick",f),t.addEventListener("pointerdown",y),n.addEventListener("keydown",b),n.addEventListener("copy",x),n.addEventListener("paste",E),n.addEventListener("cut",k),()=>{clearTimeout(s),a==null||a(),t.removeEventListener("click",u),t.removeEventListener("dblclick",f),t.removeEventListener("pointerdown",y),n.removeEventListener("keydown",b),n.removeEventListener("copy",x),n.removeEventListener("paste",E),n.removeEventListener("cut",k)}}var jt=class{constructor(e){this.grid=e;this.open=new Set;this.el=C("div","fg-filters-panel")}refresh(){var l,c;let{grid:e}=this,t=e.store.state.locale,n=e.store.state.filters,r=C("div","fg-filters-head"),i=C("span","fg-filters-title");i.textContent=t.filters;let s=C("button","fg-btn fg-filters-clear",{type:"button"});s.textContent=t.clearFilters,s.disabled=!Object.keys(n).length,s.addEventListener("click",()=>{for(let d of Object.keys(e.store.state.filters))e.setFilter(d,null)}),r.append(i,s);let a=C("div","fg-filters-list");for(let d of e.columns.displayed()){if(G(d.id)||!ue(d.def))continue;let u=C("details",n[d.id]?"fg-filters-item fg-filter-on":"fg-filters-item");u.dataset.col=d.id,u.open=this.open.has(d.id);let f=C("summary");f.textContent=(c=(l=d.def.header)!=null?l:d.def.field)!=null?c:d.id,u.append(f);let p=()=>{if(u.querySelector(".fg-filter"))return;let h=e.menu.filterSection(d.id,()=>{});h&&u.append(h)};u.open&&p(),u.addEventListener("toggle",()=>{u.open?(this.open.add(d.id),p()):this.open.delete(d.id)}),a.append(u)}this.el.replaceChildren(r,a)}};var Ys=["sum","avg","min","max","count"],Ut=class{constructor(e){this.grid=e;this.draft={rows:[],columns:[],values:[]};this.el=C("div","fg-pivot-panel")}apply(){this.grid.getPivot()?this.grid.setPivot(this.draft):this.refresh()}refresh(){var c;let{grid:e}=this,t=e.store.state.locale,n=e.getPivot();n&&(this.draft={rows:[...n.rows],columns:[...(c=n.columns)!=null?c:[]],values:n.values.map(d=>({colId:d.colId,aggFunc:typeof d.aggFunc=="string"?d.aggFunc:"sum"}))});let r=e.sourceLeaves(),i=d=>{var f,p,h;let u=(f=r.find(g=>g.id===d))==null?void 0:f.def;return(h=(p=u==null?void 0:u.header)!=null?p:u==null?void 0:u.field)!=null?h:d},s=C("label","fg-pivot-mode"),a=C("input","fg-checkbox",{type:"checkbox"});a.checked=!!n,a.addEventListener("click",()=>e.setPivot(a.checked?this.draft:null)),s.append(a,document.createTextNode(t.pivotMode));let l=(d,u)=>{let f=C("div","fg-pivot-zone");f.dataset.zone=d;let p=C("div","fg-pivot-zone-title");p.textContent=u;let h=C("div","fg-pivot-chips"),g=d==="values"?this.draft.values.map(y=>y.colId):this.draft[d];g.forEach((y,b)=>{let v=C("span","fg-group-chip");v.dataset.col=y;let S=C("span","fg-group-chip-label");if(S.textContent=i(y),v.append(S),d==="values"){let k=C("select","fg-pivot-agg",{"aria-label":`${i(y)} ${t.pivotValues}`});for(let E of Ys){let L=C("option");L.value=E,L.textContent=t[E],k.append(L)}k.value=this.draft.values[b].aggFunc,k.addEventListener("change",()=>{this.draft.values[b].aggFunc=k.value,this.apply()}),v.append(k)}let x=C("button","fg-group-chip-remove",{type:"button","aria-label":`${t.ungroup}: ${i(y)}`});x.textContent="\xD7",x.addEventListener("click",()=>{d==="values"?this.draft.values.splice(b,1):this.draft[d].splice(b,1),this.apply()}),v.append(x),h.append(v)});let w=C("select","fg-pivot-add",{"aria-label":`${u}: ${t.addColumn}`}),m=C("option");m.value="",m.textContent=t.addColumn,w.append(m);for(let y of r){if(g.includes(y.id)||d==="values"&&y.def.type!=="number")continue;let b=C("option");b.value=y.id,b.textContent=i(y.id),w.append(b)}return w.addEventListener("change",()=>{w.value&&(d==="values"?this.draft.values.push({colId:w.value,aggFunc:"sum"}):this.draft[d].push(w.value),this.apply())}),f.append(p,h,w),f};this.el.replaceChildren(s,l("rows",t.pivotRows),l("columns",t.pivotColumns),l("values",t.pivotValues))}};var Zs=4,Kt=o=>!G(o.id)&&(o.children?o.children.some(Kt):o.def.chooser!==!1),to=o=>{var e,t;return(t=(e=o.def.header)!=null?e:o.def.field)!=null?t:o.id},_t=class{constructor(e){this.grid=e;this.collapsed=new Set;this.el=C("div","fg-chooser"),this.search=C("input","fg-input fg-chooser-search",{type:"search"});let t=C("label","fg-chooser-all");this.allBox=C("input","fg-checkbox",{type:"checkbox"}),this.allText=C("span"),t.append(this.allBox,this.allText),this.list=C("div","fg-chooser-list",{role:"tree"}),this.el.append(this.search,t,this.list),this.search.addEventListener("input",()=>this.refresh()),this.allBox.addEventListener("change",()=>this.setVisible(this.matchingLeaves(),this.allBox.checked)),this.list.addEventListener("change",n=>{let r=n.target,i=this.nodeOf(r);i&&this.setVisible(this.leavesOf(i),r.checked)}),this.list.addEventListener("click",n=>{let r=n.target.closest(".fg-chooser-caret"),i=r&&this.nodeOf(r);i&&(this.collapsed.has(i.id)?this.collapsed.delete(i.id):this.collapsed.add(i.id),this.refresh())}),this.list.addEventListener("pointerdown",n=>this.onPointerDown(n)),this.refresh()}refresh(){let e=this.grid.store.state.locale;this.search.placeholder=e.search,this.search.setAttribute("aria-label",e.search),this.allText.textContent=e.selectAll;let t=this.query(),n=[],r=(a,l)=>{for(let c of a)!Kt(c)||t&&!this.subtreeMatches(c,t)||(n.push(this.item(c,l)),c.children&&(t||!this.collapsed.has(c.id))&&r(c.children,l+1))};r(this.grid.columns.roots(),0),this.list.replaceChildren(...n);let i=this.matchingLeaves(),s=i.filter(a=>!a.hide).length;this.allBox.checked=i.length>0&&s===i.length,this.allBox.indeterminate=s>0&&s<i.length}query(){return this.search.value.trim().toLowerCase()}subtreeMatches(e,t){for(let n=e;n;n=n.parent)if(to(n).toLowerCase().includes(t))return!0;return!!e.children&&e.children.some(n=>Kt(n)&&this.subtreeMatches(n,t))}leavesOf(e){return Kt(e)?e.children?e.children.flatMap(t=>this.leavesOf(t)):[e]:[]}matchingLeaves(){let e=this.query(),t=this.grid.columns.roots().flatMap(n=>this.leavesOf(n));return e?t.filter(n=>this.subtreeMatches(n,e)):t}nodeOf(e){var n;let t=(n=e.closest(".fg-chooser-item"))==null?void 0:n.dataset.col;return t?this.grid.columns.getNode(t):void 0}setVisible(e,t){this.grid.setColumnsVisible(e.filter(n=>!n.def.lockVisible).map(n=>n.id),t)}item(e,t){let n=C("div",e.children?"fg-chooser-item fg-chooser-group":"fg-chooser-item",{role:"treeitem"});n.dataset.col=e.id,n.style.paddingLeft=`${6+t*16}px`;let r=C("span","fg-chooser-handle",{"aria-hidden":"true"});if(r.textContent="\u22EE\u22EE",n.append(r),e.children){let c=!this.collapsed.has(e.id),d=C("button","fg-chooser-caret",{type:"button",tabindex:"-1","aria-hidden":"true"});d.textContent=c?"\u25BE":"\u25B8",n.setAttribute("aria-expanded",String(c)),n.append(d)}let i=this.leavesOf(e),s=i.filter(c=>!c.hide).length,a=C("input","fg-checkbox",{type:"checkbox","aria-label":to(e)});a.checked=i.length>0&&s===i.length,a.indeterminate=s>0&&s<i.length,a.disabled=i.every(c=>c.def.lockVisible);let l=C("span","fg-chooser-label");if(l.textContent=to(e),n.append(a,l),!e.children&&e.pinned){let c=C("span","fg-chooser-pin");c.textContent=e.pinned==="left"?"\u21E4":"\u21E5",n.append(c)}return n}onPointerDown(e){let t=e.target.closest(".fg-chooser-handle"),n=t==null?void 0:t.closest(".fg-chooser-item"),r=n&&this.nodeOf(n);if(!n||!r||e.button!==0)return;e.preventDefault();let i=new Set(this.grid.columns.siblings(r.id).map(p=>p.id).filter(p=>p!==r.id)),s=[...this.list.querySelectorAll(".fg-chooser-item")].filter(p=>i.has(p.dataset.col)),a=e.clientY,l=!1,c=-1,d=C("div","fg-chooser-marker"),u=p=>{if(!l){if(Math.abs(p.clientY-a)<Zs||!s.length)return;l=!0,n.classList.add("fg-dragging"),this.list.append(d)}c=s.filter(w=>{let m=w.getBoundingClientRect();return p.clientY>m.top+m.height/2}).length;let h=this.list.getBoundingClientRect().top-this.list.scrollTop,g=c<s.length?s[c].getBoundingClientRect().top:s[s.length-1].getBoundingClientRect().bottom;d.style.top=`${g-h-1}px`},f=()=>{if(window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",f),d.remove(),n.classList.remove("fg-dragging"),!l||c<0)return;let p=this.grid.columns.siblings(r.id).map(w=>w.id).filter(w=>w!==r.id),h=c<s.length?p.indexOf(s[c].dataset.col):p.indexOf(s[s.length-1].dataset.col)+1;h=Math.max(p.filter(G).length,h);let g=this.grid.columns.siblings(r.id).findIndex(w=>w.id===r.id);h!==g&&(this.grid.columns.move(r.id,h),this.grid.layoutChanged(),this.grid.events.emit("columnMove",{colId:r.id,toIndex:h}))};window.addEventListener("pointermove",u),window.addEventListener("pointerup",f)}},Xt=class{constructor(e){this.grid=e;this.popup=null;this.panel=null;this.off=[]}get isOpen(){return!!this.popup}open(){this.close();let e=this.grid.store.state.locale,t=C("div",`fg-menu fg-chooser-dialog fg-theme-${this.grid.store.state.theme}`,{role:"dialog","aria-label":e.chooseColumns});this.grid.applyFontTo(t);let n=C("div","fg-chooser-head"),r=C("span","fg-menu-title");r.textContent=e.chooseColumns;let i=C("button","fg-chooser-close",{type:"button","aria-label":e.close});i.textContent="\xD7",i.addEventListener("click",()=>this.close()),n.append(r,i),this.panel=new _t(this.grid),t.append(n,this.panel.el),re(this.grid.renderer.root).append(t);let s=this.grid.renderer.root.getBoundingClientRect(),a=t.offsetWidth||280;t.style.left=`${Math.max(4,Math.min(s.right-a-8,window.innerWidth-a-4))}px`,t.style.top=`${Math.max(4,s.top+8)}px`,this.popup=t;let l=d=>{ce(d,t)||this.close()},c=d=>{d.key==="Escape"&&this.close()};document.addEventListener("pointerdown",l,!0),document.addEventListener("keydown",c,!0),this.off.push(()=>document.removeEventListener("pointerdown",l,!0),()=>document.removeEventListener("keydown",c,!0)),t.querySelector(".fg-chooser-search").focus()}refresh(){var e;(e=this.panel)==null||e.refresh()}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null,this.panel=null}},Jt=class{constructor(e,t,n=["columns","filters"]){this.grid=e;this.tabs=new Map;this.el=C("div","fg-sidebar"),this.panelHost=C("div","fg-sidebar-panel"),this.columns=new _t(e),this.filters=new jt(e),this.pivot=new Ut(e);let r=n.filter(s=>s==="columns"||s==="filters"||s==="pivot");r.length||r.push("columns"),this.current=r[0];let i=C("div","fg-sidebar-tabs",{role:"tablist"});for(let s of r){let a=C("button","fg-sidebar-tab",{type:"button",role:"tab"});a.dataset.panel=s,a.addEventListener("click",()=>this.toggle(!(this.isOpen&&this.current===s),s)),this.tabs.set(s,a),i.append(a)}this.el.append(this.panelHost,i),e.renderer.root.append(this.el),this.panelHost.hidden=!t,this.show(),this.refresh()}get isOpen(){return!this.panelHost.hidden}show(){this.panelHost.replaceChildren(this.current==="filters"?this.filters.el:this.current==="pivot"?this.pivot.el:this.columns.el)}toggle(e=!this.isOpen,t){t&&this.tabs.has(t)&&t!==this.current&&(this.current=t,this.show()),this.panelHost.hidden=!e,this.syncTabs(),this.grid.renderer.invalidate({header:!0,rows:!0})}syncTabs(){this.el.classList.toggle("fg-sidebar-open",this.isOpen);for(let[e,t]of this.tabs){let n=this.isOpen&&e===this.current;t.setAttribute("aria-expanded",String(n)),t.setAttribute("aria-selected",String(n))}}refresh(){let e=this.grid.store.state.locale;for(let[t,n]of this.tabs)n.textContent=t==="filters"?e.filters:t==="pivot"?e.pivot:e.columns;this.syncTabs(),this.columns.refresh(),this.filters.refresh(),this.pivot.refresh()}};var Qs=()=>typeof navigator!="undefined"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent||""),Ze=o=>Qs()?`\u2318${o}`:`Ctrl+${o}`,Yt=class{constructor(e){this.grid=e;this.popup=null;this.off=[];let t=e.renderer.root,n=r=>this.onContextMenu(r);t.addEventListener("contextmenu",n),this.detach=()=>t.removeEventListener("contextmenu",n)}destroy(){this.close(),this.detach()}enabled(){return this.grid.options.contextMenu!==!1&&this.grid.allow("contextMenu")}onContextMenu(e){let{grid:t}=this;if(t.options.contextMenu===!1)return;let n=e.target,r=n.closest(".fg-header-cell");if(r){let s=r.dataset.col;if(!s||G(s)||r.classList.contains("fg-header-group"))return;e.preventDefault(),this.close(),t.menu.open(s,r);return}let i=t.renderer.cellAt(n);!i||!this.enabled()||(e.preventDefault(),t.renderer.gridEl.focus({preventScroll:!0}),!G(i.colId)&&!t.rangeContains(i.rowIndex,i.colId)&&(t.setFocus(i.rowIndex,i.colId),t.setRange({start:i,end:i})),this.open(e.clientX,e.clientY,i.rowIndex,i.colId))}openAtFocus(){var i;let e=this.grid.store.state.focus;if(!e||!this.enabled())return;let t=this.grid.renderer.root.getBoundingClientRect(),n=this.grid.renderer.root.querySelector(`.fg-row[data-row="${e.rowIndex}"] .fg-cell[data-col="${CSS.escape(e.colId)}"]`),r=(i=n==null?void 0:n.getBoundingClientRect())!=null?i:t;this.open(r.left+8,r.bottom,e.rowIndex,e.colId)}defaultItems(e){var c;let{grid:t}=this,n=t.store.state.locale,r=t.columns.getNode(e),i=r==null?void 0:r.def,s=!!i&&!G(e),a=[{label:n.copy,shortcut:Ze("C"),action:()=>t.copyToClipboard(!1)},{label:n.copyWithHeaders,action:()=>t.copyToClipboard(!0)},{label:n.cut,shortcut:Ze("X"),action:()=>t.cutToClipboard()},...t.store.state.selected.size?[{label:n.copyRows,action:()=>t.copyToClipboard(!1,!0)}]:[],{label:n.paste,shortcut:Ze("V"),action:()=>this.pasteFromClipboard()}];(t.history.canUndo()||t.history.canRedo())&&a.push("separator",{label:n.undo,shortcut:Ze("Z"),action:()=>t.undo(),disabled:!t.history.canUndo()},{label:n.redo,shortcut:Ze("Y"),action:()=>t.redo(),disabled:!t.history.canRedo()}),t.options.rowSelection&&t.store.state.selected.size&&a.push({label:n.deleteRows,action:()=>t.api.removeSelectedRows()}),s&&(a.push("separator",{label:n.autosizeThis,action:()=>t.autoSize([e])}),i.lockVisible||a.push({label:n.hideColumn,action:()=>t.setColumnsVisible([e],!1)}),a.push({label:n.pinLeft,action:()=>t.setPinned(e,"left"),disabled:r.pinned==="left"},{label:n.pinRight,action:()=>t.setPinned(e,"right"),disabled:r.pinned==="right"},{label:n.unpin,action:()=>t.setPinned(e,null),disabled:!r.pinned})),a.push("separator"),t.options.rowSelection==="multiple"&&a.push({label:n.selectAllRows,action:()=>t.api.selectAll()}),a.push({label:n.chooseColumns,action:()=>t.chooser.open()});let l=t.rangeBounds();return l&&(l.r2>l.r1||l.c2>l.c1)&&t.paid&&a.push("separator",{label:n.chartBar,action:()=>t.api.createChart({type:"bar"})},{label:n.chartLine,action:()=>t.api.createChart({type:"line"})},{label:n.chartPie,action:()=>t.api.createChart({type:"pie"})}),a.push("separator",{label:n.exportCsv,action:()=>t.api.exportCsv()},...t.paid?[{label:n.exportExcel,action:()=>t.api.exportXlsx()}]:[],{label:n.exportJson,action:()=>t.api.exportJson()},...(c=t.options.assistant)!=null&&c.url&&t.paid?[{label:`${n.ai.title}\u2026`,action:()=>t.api.openAssistant()}]:[],...t.paid?[{label:n.exportPdf,action:()=>t.api.exportPdf()}]:[]),t.options.advancedFilter!==!1&&!t.options.pivot&&t.paid&&a.push("separator",{label:`${n.advancedFilter}\u2026`,action:()=>t.filterBuilder.open()}),a.push("separator",{label:n.print,action:()=>t.api.print()}),a}pasteFromClipboard(){let e=typeof navigator!="undefined"?navigator.clipboard:void 0,t=()=>this.grid.toast(this.grid.store.state.locale.pasteHint.replace("Ctrl+V",Ze("V")));if(!(e!=null&&e.readText))return t();e.readText().then(n=>this.grid.pasteText(n),t)}open(e,t,n,r){var v,S,x;this.close(),this.grid.menu.close();let{grid:i}=this,s=i.rowModel.getRow(n),a=i.columns.getColumn(r),l=this.defaultItems(r),c={row:(v=s==null?void 0:s.data)!=null?v:null,rowIndex:n,colId:r,value:s&&a&&!G(r)?j(a.def,s.data):void 0,defaultItems:l},d=i.options.contextMenu,u=l;if(typeof d=="function")try{u=d(c)}catch{u=l}let f=i.store.state.locale,p=C("div",`fg-menu fg-context-menu fg-theme-${i.store.state.theme}`,{role:"menu","aria-label":f.columnMenu});i.applyFontTo(p);let h=!0;for(let k of u){if(k==="separator"){h||p.append(C("div","fg-cm-sep",{role:"separator"})),h=!0;continue}let E=C("button","fg-menu-item fg-cm-item",{type:"button",role:"menuitem"}),L=C("span","fg-cm-label");if(L.textContent=k.label,E.append(L),k.shortcut){let R=C("span","fg-cm-shortcut");R.textContent=k.shortcut,E.append(R)}E.disabled=!!k.disabled,E.addEventListener("click",()=>{this.close(),k.action()}),p.append(E),h=!1}(S=p.lastElementChild)!=null&&S.classList.contains("fg-cm-sep")&&p.lastElementChild.remove(),re(this.grid.renderer.root).append(p);let g=p.offsetWidth||220,w=p.offsetHeight||300;p.style.left=`${Math.max(4,Math.min(e,window.innerWidth-g-4))}px`,p.style.top=`${Math.max(4,Math.min(t,window.innerHeight-w-4))}px`,this.popup=p;let m=k=>{ce(k,p)||this.close()},y=k=>{if(k.key==="Escape"){this.close(),i.renderer.gridEl.focus();return}if(k.key!=="ArrowDown"&&k.key!=="ArrowUp")return;let E=[...p.querySelectorAll("button:not(:disabled)")],L=E.indexOf(Or(p)),R=E[(L+(k.key==="ArrowDown"?1:E.length-1)+E.length)%E.length];R==null||R.focus(),k.preventDefault()},b=()=>this.close();document.addEventListener("pointerdown",m,!0),document.addEventListener("keydown",y,!0),i.renderer.scroller.addEventListener("scroll",b,{passive:!0}),this.off.push(()=>document.removeEventListener("pointerdown",m,!0),()=>document.removeEventListener("keydown",y,!0),()=>i.renderer.scroller.removeEventListener("scroll",b)),(x=p.querySelector("button:not(:disabled)"))==null||x.focus()}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var Zt=class{constructor(e){this.grid=e;this.onDown=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=this.source();if(!t)return;let{grid:n}=this,r=null,i=n.renderer.root,s=l=>{let c=n.renderer.cellAt(ht(n.renderer.root,l.clientX,l.clientY)),d=c&&n.columns.getColumn(c.colId);if(!c||!d||G(d.id))return;let u=c.rowIndex>t.r2?c.rowIndex-t.r2:c.rowIndex<t.r1?c.rowIndex-t.r1:0,f=d.index>t.c2?d.index-t.c2:d.index<t.c1?d.index-t.c1:0;!u&&!f?r=null:Math.abs(u)>=Math.abs(f)?r={r1:Math.min(t.r1,c.rowIndex),r2:Math.max(t.r2,c.rowIndex),c1:t.c1,c2:t.c2}:r={r1:t.r1,r2:t.r2,c1:Math.min(t.c1,d.index),c2:Math.max(t.c2,d.index)},this.showPreview(r)},a=()=>{if(window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",a),this.preview.remove(),i.classList.remove("fg-range-dragging"),!r)return;let l=n.columns.displayed();n.fillRange({start:{rowIndex:r.r1,colId:l[r.c1].id},end:{rowIndex:r.r2,colId:l[r.c2].id}})};i.classList.add("fg-range-dragging"),window.addEventListener("pointermove",s),window.addEventListener("pointerup",a)};this.handle=C("div","fg-fill-handle",{"aria-hidden":"true"}),this.preview=C("div","fg-fill-preview",{"aria-hidden":"true"}),this.handle.addEventListener("pointerdown",this.onDown)}enabled(){return this.grid.options.fillHandle!==!1&&this.grid.rangesOn()}source(){let e=this.grid.rangeBounds();if(e)return e;let t=this.grid.store.state.focus,n=t&&this.grid.columns.getColumn(t.colId);return!t||!n||G(n.id)?null:{r1:t.rowIndex,r2:t.rowIndex,c1:n.index,c2:n.index}}cellEl(e,t){let n=this.grid.columns.displayed()[t];return n?this.grid.renderer.root.querySelector(`.fg-body .fg-row[data-row="${e}"] .fg-cell[data-col="${CSS.escape(n.id)}"]`):null}update(){let e=this.enabled()?this.source():null,t=this.grid.columns.displayed(),r=!!e&&t.slice(e.c1,e.c2+1).some(a=>a.def.editable&&a.def.field)&&e?this.cellEl(e.r2,e.c2):null;if(!r){this.handle.remove();return}let i=this.grid.renderer.root.getBoundingClientRect(),s=r.getBoundingClientRect();this.handle.style.left=`${(this.grid.renderer.rtl?s.left:s.right)-i.left-4}px`,this.handle.style.top=`${s.bottom-i.top-4}px`,this.handle.isConnected||this.grid.renderer.root.append(this.handle)}showPreview(e){let t=e&&this.cellEl(e.r1,e.c1),n=e&&this.cellEl(e.r2,e.c2);if(!t||!n){this.preview.remove();return}let r=this.grid.renderer.root.getBoundingClientRect(),i=t.getBoundingClientRect(),s=n.getBoundingClientRect();Object.assign(this.preview.style,{left:`${i.left-r.left}px`,top:`${i.top-r.top}px`,width:`${s.right-i.left}px`,height:`${s.bottom-i.top}px`}),this.preview.isConnected||this.grid.renderer.root.append(this.preview)}destroy(){this.handle.remove(),this.preview.remove()}};var Qt=1e4,en=class{constructor(e){this.grid=e;this.matches=[];this.lookup=new Map;this.index=-1;this.query="";this.bar=null;this.countEl=null}get active(){return!!this.query}classFor(e,t){if(!this.query)return"";let n=this.lookup.get(`${e}|${t}`);return n===void 0?"":n===this.index?" fg-cell-match fg-cell-match-current":" fg-cell-match"}find(e){if(this.query=e.trim().toLowerCase(),this.matches=[],this.lookup.clear(),this.index=-1,this.query){let t=this.grid.rowModel.rows(),n=this.scanner();for(let r=0;r<t.length&&this.matches.length<Qt;r++)n(r,this.matches);this.matches.length=Math.min(this.matches.length,Qt),this.reindex(),this.matches.length&&this.go(0)}return this.updateCount(),this.grid.renderer.invalidate({rows:!0}),this.matches.length}scanner(){let{grid:e}=this,t=e.store.state.locale.code,n=e.columns.displayed().filter(s=>!G(s.id)),r=n.map(s=>ee(s.def,t)),i=e.rowModel.rows();return(s,a)=>{let l=i[s];if(!(!l||l.kind))for(let c=0;c<n.length;c++)r[c](j(n[c].def,l.data)).toLowerCase().includes(this.query)&&a.push({rowIndex:s,colId:n[c].id})}}reindex(){this.lookup.clear(),this.matches.forEach((e,t)=>this.lookup.set(`${e.rowIndex}|${e.colId}`,t))}refreshRows(e){if(!this.query)return;if(this.matches.length>=Qt)return this.refresh();let{rowModel:t}=this.grid,n=new Set;for(let p of e){let h=t.indexOfId(p);h>=0&&n.add(h)}if(!n.size)return;let r=this.matches[this.index],i=this.scanner(),s=[];for(let p of n)i(p,s);let a=this.matches.length,l=this.matches.filter(p=>n.has(p.rowIndex)),c=p=>p.map(h=>`${h.rowIndex}|${h.colId}`).sort().join(",");if(c(l)===c(s))return;let d=new Map(this.grid.columns.displayed().map((p,h)=>[p.id,h]));this.matches=[...this.matches.filter(p=>!n.has(p.rowIndex)),...s].sort((p,h)=>{var g,w;return p.rowIndex-h.rowIndex||((g=d.get(p.colId))!=null?g:0)-((w=d.get(h.colId))!=null?w:0)}).slice(0,Qt),this.reindex();let u=r?this.lookup.get(`${r.rowIndex}|${r.colId}`):void 0,f=this.index;u!==void 0?this.index=u:this.matches.length?this.index=Math.min(Math.max(this.index,0),this.matches.length-1):this.index=-1,(a!==this.matches.length||f!==this.index||u===void 0)&&this.updateCount(),this.grid.renderer.invalidate({rows:!0})}refresh(){this.query&&this.find(this.query)}next(){this.matches.length&&this.go((this.index+1)%this.matches.length)}previous(){this.matches.length&&this.go((this.index-1+this.matches.length)%this.matches.length)}clear(){this.query="",this.matches=[],this.lookup.clear(),this.index=-1,this.grid.renderer.invalidate({rows:!0})}go(e){this.index=e;let t=this.matches[e];this.grid.setFocus(t.rowIndex,t.colId),this.grid.renderer.ensureVisible(t.rowIndex,t.colId),this.updateCount(),this.grid.renderer.invalidate({rows:!0})}updateCount(){if(!this.countEl)return;let e=this.grid.store.state.locale;this.countEl.textContent=this.query?this.matches.length?`${this.index+1}/${this.matches.length}`:e.noMatches:""}openBar(){if(this.grid.options.findBar===!1||!this.grid.paid)return;if(this.bar){this.bar.querySelector("input").focus();return}let e=this.grid.store.state.locale,t=C("div","fg-findbar",{role:"search"}),n=C("input","fg-input",{type:"search",placeholder:e.findPlaceholder,"aria-label":e.findPlaceholder});this.countEl=C("span","fg-findbar-count",{"aria-live":"polite"});let r=(i,s,a)=>{let l=C("button","fg-findbar-btn",{type:"button","aria-label":i,title:i});return l.textContent=s,l.addEventListener("click",a),l};t.append(n,this.countEl,r(e.findPrevious,"\u2191",()=>this.previous()),r(e.findNext,"\u2193",()=>this.next()),r(e.close,"\xD7",()=>this.closeBar())),n.addEventListener("input",()=>this.find(n.value)),t.addEventListener("keydown",i=>{i.stopPropagation(),i.key==="Escape"?(i.preventDefault(),this.closeBar()):i.key==="Enter"&&(i.preventDefault(),i.shiftKey?this.previous():this.next())}),this.grid.renderer.root.append(t),this.bar=t,n.focus()}closeBar(){var e;(e=this.bar)==null||e.remove(),this.bar=null,this.countEl=null,this.clear(),this.grid.renderer.gridEl.focus({preventScroll:!0})}};var ea=864e5;function mt(o,e){if(!o.length||e<=0)return[];let t=()=>Array.from({length:e},(i,s)=>o[s%o.length]);if(o.every(i=>typeof i=="number"&&!Number.isNaN(i))){let i=o;if(i.length===1)return t();let s=i[1]-i[0];if(!i.every((l,c)=>c===0||Math.abs(l-i[c-1]-s)<1e-9))return t();let a=i[i.length-1];return Array.from({length:e},(l,c)=>Math.round((a+s*(c+1))*1e12)/1e12)}let n=o.map(i=>i instanceof Date||typeof i=="string"&&/^\d{4}-\d{2}-\d{2}/.test(i)?me(i):null);if(n.every(Boolean)&&o.length>=2){let i=n.map(a=>Math.round(a.getTime()/ea)),s=i[1]-i[0];if(i.every((a,l)=>l===0||a-i[l-1]===s)){let a=n[n.length-1],l=o[o.length-1]instanceof Date;return Array.from({length:e},(c,d)=>{let u=new Date(a.getFullYear(),a.getMonth(),a.getDate()+s*(d+1));return l?u:ie(u)})}return t()}let r=o[o.length-1];if(typeof r=="string"&&!K(r)&&o.every(i=>typeof i=="string")){let i=/^(.*?)(\d+)$/.exec(r);if(i){let s=i[2].length,a=Number(i[2]);return Array.from({length:e},(l,c)=>`${i[1]}${String(a+c+1).padStart(s,"0")}`)}}return t()}function no(o){let e=t=>/[\t\n\r"]/.test(t)?`"${t.replace(/"/g,'""')}"`:t;return o.map(t=>t.map(e).join(" ")).join(`\r
2
2
  `)}function Vr(o){return oo(o," ")}function oo(o,e){if(!o)return[];let t=[],n=[],r="",i=0,s=!1,a=!0;for(;i<o.length;){let l=o[i];if(s){if(l==='"'){if(o[i+1]==='"'){r+='"',i+=2;continue}s=!1,i++;continue}r+=l,i++;continue}if(l==='"'&&a){s=!0,a=!1,i++;continue}if(l===e){n.push(r),r="",a=!0,i++;continue}if(l==="\r"||l===`
3
3
  `){n.push(r),t.push(n),n=[],r="",a=!0,i+=l==="\r"&&o[i+1]===`
4
- `?2:1;continue}r+=l,a=!1,i++}return(r!==""||n.length||!a)&&(n.push(r),t.push(n)),t}function en(o,e,t){var n;if(U(e))return"";if(Array.isArray(e))return e.join(", ");switch(o.type){case"number":{let r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?String(e):String(r)}case"date":return(n=se(e))!=null?n:String(e);case"boolean":return e===!0?"TRUE":e===!1?"FALSE":String(e);default:return ee(o,t)(e)}}var Zs=new Set(["true","1","y","yes","\uC608","o","on"]),Qs=new Set(["false","0","n","no","\uC544\uB2C8\uC624","x","off"]);function ea(o){let e=o.trim();if(!e)return{ok:!0,value:null};let t=!1;/^\(.*\)$/.test(e)&&(t=!0,e=e.slice(1,-1));let n=e.endsWith("%");if(n&&(e=e.slice(0,-1)),e=e.replace(/[\s,₩$€£¥원]/g,""),!/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i.test(e))return{ok:!1};let r=Number(e);return n&&(r/=100),t&&(r=-r),Number.isFinite(r)?{ok:!0,value:Math.abs(r)<1e15?Math.round(r*1e12)/1e12:r}:{ok:!1}}function zr(o,e,t){let n=new Date(o,e-1,t);return n.getFullYear()===o&&n.getMonth()===e-1&&n.getDate()===t?n:null}function ta(o,e){let t=o.trim();if(!t)return{ok:!0,value:null};let n=null,r=/^(\d{4})\s*[-./년]\s*(\d{1,2})\s*[-./월]\s*(\d{1,2})\s*[.일]?$/.exec(t);return r?n=zr(+r[1],+r[2],+r[3]):(r=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(t))?n=zr(+r[3],+r[1],+r[2]):/^\d{4}-\d{2}-\d{2}T/.test(t)&&(n=me(t)),n?{ok:!0,value:e instanceof Date?n:se(n)}:{ok:!1}}function tn(o,e,t){switch(o.type){case"number":return ea(e);case"date":return ta(e,t);case"boolean":{let n=e.trim().toLowerCase();return n?Zs.has(n)?{ok:!0,value:!0}:Qs.has(n)?{ok:!0,value:!1}:{ok:!1}:{ok:!0,value:null}}default:return{ok:!0,value:e}}}var na=o=>o.map(e=>e!==null&&typeof e=="object"&&"value"in e?e:{value:e,label:String(e),disabled:!1}),Ne=o=>String(o).padStart(2,"0");function oa(o){let e=o instanceof Date?o:typeof o=="string"&&o?new Date(o):null;return!e||Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${Ne(e.getMonth()+1)}-${Ne(e.getDate())}T${Ne(e.getHours())}:${Ne(e.getMinutes())}`}function ra(o){if(o instanceof Date)return`${Ne(o.getHours())}:${Ne(o.getMinutes())}`;let e=typeof o=="string"?/(\d{1,2}):(\d{2})/.exec(o):null;return e?`${Ne(Number(e[1]))}:${e[2]}`:""}var nn=class{constructor(e){this.grid=e;this.cur=null;this.session=null;e.events.on("focusChange",({rowIndex:t})=>{var n;this.session&&!this.cur&&((n=this.grid.rowModel.getRow(t))==null?void 0:n.data)!==this.session.row&&this.endRow(!0)})}get rowMode(){return this.grid.options.editType==="row"}editingRow(e){var t;return((t=this.session)==null?void 0:t.id)===e}beginRow(e,t){var n;((n=this.session)==null?void 0:n.row)!==e&&(this.session&&this.endRow(!0),this.session={row:e,id:this.grid.rowModel.idOf(e),before:{...e},undoMark:this.grid.history.mark()},this.grid.renderer.invalidate({rows:!0}),this.grid.events.emit("rowEditStart",{row:e,rowIndex:t}))}endRow(e){let t=this.session;if(!t)return;if(this.cur){if(e&&!this.commit(null))return;e||this.close(!1)}this.session=null;let{grid:n}=this,r=n.rowModel.indexOfId(t.id),i=n.columns.displayed().filter(a=>a.def.field&&!H(a.id));if(!e){let a=[];for(let l of i){let c=l.def.field;Object.is(t.row[c],t.before[c])||n.writeCell(a,t.row,c,l.id,r,t.before[c])}n.endCellTx(a),n.history.rollback(t.undoMark)}let s=i.filter(a=>!Object.is(t.row[a.def.field],t.before[a.def.field])).map(a=>({colId:a.id,oldValue:t.before[a.def.field],newValue:t.row[a.def.field]}));n.renderer.invalidate({rows:!0}),n.events.emit("rowEditStop",{row:t.row,rowIndex:r,committed:e,changes:s})}get active(){return this.cur&&{rowIndex:this.cur.rowIndex,colId:this.cur.colId}}canEdit(e,t){if(H(t))return!1;let n=this.grid.columns.getColumn(t);if(!(n!=null&&n.def.field)||e<0||e>=this.grid.rowModel.getRowCount())return!1;let r=this.grid.rowModel.getRow(e);return!r.kind&&ye(n.def,r.data,e)}start(e,t,n){var b,v,S;if(this.cur&&!this.commit(null)||!this.canEdit(e,t))return!1;let{grid:r}=this;if(r.veto("beforeEdit",{row:r.rowModel.getRow(e).data,rowIndex:e,colId:t}))return!1;let{renderer:i}=r,a=r.columns.getColumn(t).def,l=r.rowModel.getRow(e).data,c=l[a.field];this.rowMode&&this.beginRow(l,e),r.setFocus(e,t),i.ensureVisible(e,t),i.render();let d=k("div","fg-editor");this.place(d,e,t);let u,f,h=()=>{},p=a.editor;if(typeof p=="function"){let C=p({value:c,row:l,column:a,initialText:n});u=C.el,f=()=>({value:C.getValue()}),h=()=>{var R;return(R=C.destroy)==null?void 0:R.call(C)},d.append(u),queueMicrotask(()=>{var R;return(R=C.focus)==null?void 0:R.call(C)})}else if((p==null?void 0:p.type)==="select"){let C=na(typeof p.options=="function"?p.options(l):p.options),R=k("select","fg-editor-control");C.forEach((A,x)=>{var T;let M=k("option");M.value=String(x),M.textContent=(T=A.label)!=null?T:String(A.value),M.disabled=!!A.disabled,R.append(M)}),R.selectedIndex=Math.max(0,C.findIndex(A=>Object.is(A.value,c))),u=R,f=()=>{var A,x;return{value:(x=(A=C[R.selectedIndex])==null?void 0:A.value)!=null?x:null}},d.append(R)}else if((p==null?void 0:p.type)==="time"||(p==null?void 0:p.type)==="datetime"||!p&&a.type==="date"&&a.format==="datetime"){let C=(p==null?void 0:p.type)==="time",R=k("input","fg-editor-control",{type:C?"time":"datetime-local"});R.value=C?ra(c):oa(c),u=R,f=()=>R.value?C?{value:R.value}:{value:c instanceof Date?new Date(R.value):R.value}:{value:null},d.append(R)}else{let R=(p==null?void 0:p.type)==="textarea"?k("textarea","fg-editor-control"):k("input","fg-editor-control");R instanceof HTMLInputElement&&(R.type=a.type==="date"&&n===void 0?"date":"text",a.type==="number"&&(R.inputMode="decimal"));let A=a.type==="date"?(b=se(c))!=null?b:"":U(c)?"":String(c);R.value=n!=null?n:A,u=R,f=()=>({text:R.value}),d.append(R)}u.setAttribute("aria-label",(S=(v=a.header)!=null?v:a.field)!=null?S:t);let g=k("div","fg-editor-msg",{role:"alert"});d.append(g);let w=C=>{if(C.stopPropagation(),C.key==="Escape")C.preventDefault(),this.cancel();else if(C.key==="Enter"){if(u instanceof HTMLTextAreaElement&&!(C.ctrlKey||C.metaKey))return;C.preventDefault(),this.commit(C.shiftKey?"up":"down")}else C.key==="Tab"&&(C.preventDefault(),this.commit(C.shiftKey?"left":"right"))},m=C=>{var R;((R=this.cur)==null?void 0:R.wrap)===d&&!d.contains(C.relatedTarget)&&this.commit(null)},y=()=>this.commit(null);return d.addEventListener("keydown",w),d.addEventListener("focusout",m),i.scroller.addEventListener("scroll",y,{passive:!0}),i.root.append(d),this.cur={rowIndex:e,colId:t,row:l,def:a,wrap:d,read:f,dispose:()=>{d.removeEventListener("keydown",w),d.removeEventListener("focusout",m),i.scroller.removeEventListener("scroll",y),h(),d.remove()}},typeof p!="function"&&(u.focus(),n===void 0&&u instanceof HTMLInputElement&&u.type==="text"&&u.select()),r.events.emit("editStart",{rowIndex:e,colId:t}),!0}place(e,t,n){var l,c,d;let{renderer:r}=this.grid,i=r.root.querySelector(`.fg-row[data-row="${t}"] .fg-cell[data-col="${CSS.escape(n)}"]`),s=r.root.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect();return e.style.left=`${((l=a==null?void 0:a.left)!=null?l:s.left)-s.left}px`,e.style.top=`${((c=a==null?void 0:a.top)!=null?c:s.top)-s.top}px`,e.style.width=`${(a==null?void 0:a.width)||((d=this.grid.columns.getColumn(n))==null?void 0:d.width)}px`,e.style.height=`${(a==null?void 0:a.height)||r.opts.rowHeight}px`,!!i}indexOf(e){var r;let t=this.grid.rowModel,n=t.indexOfId(t.idOf(e));return n>=0&&((r=t.getRow(n))==null?void 0:r.data)===e?n:-1}sync(){let e=this.cur;if(!e)return;let t=this.indexOf(e.row);if(t<0)return this.cancel();t!==e.rowIndex&&(e.rowIndex=t,this.grid.setFocus(t,e.colId),this.grid.renderer.render(),this.place(e.wrap,t,e.colId)||this.commit(null))}commit(e){let t=this.cur;if(!t)return!1;let{grid:n}=this,r=n.store.state.locale,i=t.def.field,s=t.row[i],a=t.read(),l;if("text"in a&&t.def.formulas&&$e(a.text.trim()))l=a.text.trim();else if("text"in a){let u=tn(t.def,a.text,s);if(!u.ok)return this.fail(a.text,r.invalidValue);l=u.value}else l=a.value;let c=n.cellError(t.def,t.row,l);if(c!==null)return this.fail(l,c);let d=this.indexOf(t.row);return d<0?(this.cancel(),!1):(t.rowIndex=d,this.close(!0),n.applyEdit(d,t.colId,l),this.session&&(e==="down"||e==="up")&&this.endRow(!0),this.move(d,t.colId,e),!0)}cancel(){this.close(!1),this.session&&this.endRow(!1)}destroy(){var e;(e=this.cur)==null||e.dispose(),this.cur=null,this.session=null}fail(e,t){let n=this.cur;return n.wrap.classList.add("fg-editor-invalid"),n.wrap.querySelector(".fg-editor-msg").textContent=t,this.grid.events.emit("validationFailed",{rowIndex:n.rowIndex,colId:n.colId,value:e,message:t}),!1}close(e){let t=this.cur;t&&(this.cur=null,t.dispose(),this.grid.renderer.gridEl.focus({preventScroll:!0}),this.grid.events.emit("editStop",{rowIndex:t.rowIndex,colId:t.colId,committed:e}))}move(e,t,n){if(!n)return;let{grid:r}=this,i=r.rowModel.getRowCount();if(n==="down"||n==="up"){let d=Math.max(0,Math.min(i-1,e+(n==="down"?1:-1)));r.setFocus(d,t),r.renderer.ensureVisible(d,t);return}let s=r.columns.displayed().filter(d=>this.canEdit(e,d.id)||d.def.editable);if(!s.length)return;let a=n==="right"?1:-1,l=e,c=s.findIndex(d=>d.id===t)+a;c>=s.length&&(c=0,this.session||l++),c<0&&(c=s.length-1,this.session||l--),!(l<0||l>=i)&&this.start(l,s[c].id)}};var on=class{constructor(e=200){this.limit=e;this.entries=[];this.index=0}push(e){this.entries.splice(this.index),this.entries.push(e),this.entries.length>this.limit&&this.entries.shift(),this.index=this.entries.length}canUndo(){return this.index>0}canRedo(){return this.index<this.entries.length}undo(){return this.canUndo()?(this.entries[--this.index].undo(),!0):!1}redo(){return this.canRedo()?(this.entries[this.index++].redo(),!0):!1}mark(){var e;return(e=this.entries[this.index-1])!=null?e:null}rollback(e){let t=e?this.entries.indexOf(e)+1:0;this.entries.splice(t),this.index=Math.min(this.index,t)}clear(){this.entries=[],this.index=0}};var qr=(o,e)=>o instanceof Date&&e instanceof Date?o.getTime()===e.getTime():Object.is(o,e),rn=class{constructor(){this.originals=new Map;this.created=new Set;this.deleted=new Map}beforeChange(e){!this.created.has(e)&&!this.originals.has(e)&&this.originals.set(e,{...e})}isDirty(e,t){if(!t||this.created.has(e))return!1;let n=this.originals.get(e);return!!n&&!qr(n[t],e[t])}diff(e,t){let n=this.originals.get(e);return n?t.filter(r=>!qr(n[r],e[r])):[]}commit(e,t){for(let n of t)this.deleted.delete(n);for(let[n,r]of e)this.created.delete(n),this.originals.set(n,{...r})}get size(){return this.originals.size+this.created.size+this.deleted.size}reset(){this.originals.clear(),this.created.clear(),this.deleted.clear()}};function gt(o){return{r1:Math.min(o.start.rowIndex,o.end.rowIndex),r2:Math.max(o.start.rowIndex,o.end.rowIndex),c1:Math.min(o.start.colIndex,o.end.colIndex),c2:Math.max(o.start.colIndex,o.end.colIndex)}}function Wr(o,e,t){return e>=o.r1&&e<=o.r2&&t>=o.c1&&t<=o.c2}var ia=5;function jr(o,e){let t=r=>o(r),n=r=>{window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",n),window.removeEventListener("pointercancel",n),e(r)};window.addEventListener("pointermove",t),window.addEventListener("pointerup",n),window.addEventListener("pointercancel",n)}function sa(o,e,t){let n=o.columns.getColumn(t);if(!n)return;let r=e.clientX,i=n.width;o.renderer.root.classList.add("fg-resizing"),jr(s=>{o.columns.setWidth(t,i+(s.clientX-r)*(o.renderer.rtl?-1:1)),o.layoutChanged()},()=>{var a,l;o.renderer.root.classList.remove("fg-resizing");let s=(l=(a=o.columns.getColumn(t))==null?void 0:a.width)!=null?l:i;s!==i&&o.events.emit("columnResize",{colId:t,width:s})})}function aa(o,e){let t=o.columns.getNode(e);return!!o.groupPanel&&!!t&&!t.children&&!o.options.treeData&&!o.getGroupBy().includes(e)}function la(o,e,t,n){var l,c;let r=new Set(o.columns.siblings(e).map(d=>d.id).filter(d=>d!==e&&!H(d))),i=[...n.querySelectorAll(".fg-header-cell")].filter(d=>r.has(d.dataset.col)).map(d=>({id:d.dataset.col,el:d})),s=k("div",`fg-drag-ghost fg-theme-${o.store.state.theme}`);s.textContent=(c=(l=t.querySelector(".fg-header-label"))==null?void 0:l.textContent)!=null?c:"",o.applyFontTo(s),oe(o.renderer.root).append(s);let a=k("div","fg-drop-marker");return a.style.height=`${o.renderer.headerEl.offsetHeight}px`,o.renderer.root.append(a),t.classList.add("fg-dragging"),{ghost:s,marker:a,cell:t,sibs:i,target:-1,overPanel:!1}}function da(o,e,t,n,r){var d,u;t.ghost.style.transform=`translate(${n+12}px, ${r+8}px)`,t.overPanel=aa(o,e)&&!!((d=o.groupPanel)!=null&&d.contains(n,r)),(u=o.groupPanel)==null||u.highlight(t.overPanel),t.marker.hidden=t.overPanel;let i=0;for(let f of t.sibs){let h=f.el.getBoundingClientRect();(o.renderer.rtl?n<h.left+h.width/2:n>h.left+h.width/2)&&i++}t.target=i;let s=o.renderer.root.getBoundingClientRect().left,a=f=>o.renderer.rtl?f.getBoundingClientRect().right:f.getBoundingClientRect().left,l=f=>o.renderer.rtl?f.getBoundingClientRect().left:f.getBoundingClientRect().right,c=i<t.sibs.length?a(t.sibs[i].el):t.sibs.length?l(t.sibs[t.sibs.length-1].el):a(t.cell);t.marker.style.left=`${c-s-1}px`}function ca(o,e,t){var a;if(t.ghost.remove(),t.marker.remove(),t.cell.classList.remove("fg-dragging"),t.overPanel){(a=o.groupPanel)==null||a.highlight(!1),o.setGroupBy([...o.getGroupBy(),e]);return}if(t.target<0||!t.sibs.length)return;let n=o.columns.siblings(e),r=n.findIndex(l=>l.id===e),i=n.map(l=>l.id).filter(l=>l!==e),s=t.target<t.sibs.length?i.indexOf(t.sibs[t.target].id):i.indexOf(t.sibs[t.sibs.length-1].id)+1;s=Math.max(i.filter(H).length,s),s!==r&&(o.columns.move(e,s),o.layoutChanged(),o.events.emit("columnMove",{colId:e,toIndex:s}))}function ua(o,e,t,n){let r=o.columns.getNode(t),i=n.closest(".fg-header-pane");if(!r||!i)return;let s=e.clientX,a=null;jr(l=>{if(!a){if(Math.abs(l.clientX-s)<ia)return;a=la(o,t,n,i)}da(o,t,a,l.clientX,l.clientY)},l=>{a?ca(o,t,a):!r.children&&Ie(r.def)&&o.toggleSort(t,l.shiftKey||l.ctrlKey||l.metaKey)})}function Ur(o){let e=o.renderer.headerEl,t=r=>{if(r.button!==0)return;let i=r.target,s=i.closest(".fg-header-cell"),a=s==null?void 0:s.dataset.col;!s||!a||H(a)||i.closest(".fg-menu-btn")||i.closest("button, a, input, select, textarea, [data-fg-no-sort]")&&i.closest(".fg-header-label")||(r.preventDefault(),i.closest(".fg-resize")?sa(o,r,a):ua(o,r,a,s))},n=r=>{var a;let i=r.target,s=i.closest(".fg-menu-btn");if(s){let l=(a=s.closest(".fg-header-cell"))==null?void 0:a.dataset.col;l&&o.menu.toggle(l,s);return}i.closest(".fg-select-all")&&o.toggleSelectAll()};return e.addEventListener("pointerdown",t),e.addEventListener("click",n),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("click",n)}}var an={A4:[210,297],A3:[297,420],A5:[148,210],B4:[250,353],B5:[176,250],letter:[215.9,279.4],legal:[215.9,355.6]},wt=96/25.4,Kr=72/25.4,fa="system-ui, 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans CJK KR', sans-serif",pa=10.5,Be=15,ln=7,Qe=4,sn=8;function ha(o){let e=atob(o),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}var dn={surface(o,e){if(typeof document=="undefined")return null;let t=document.createElement("canvas");t.width=o,t.height=e;let n=null;try{n=t.getContext("2d")}catch{n=null}return n?{ctx:n,jpeg:r=>{var i;return ha((i=t.toDataURL("image/jpeg",r).split(",")[1])!=null?i:"")}}:null}},He=(o,e=pa)=>`${o} ${e}px ${fa}`;function Xr(o,e,t){var r;if(!e)return[""];let n=[];for(let i of e.split(/\r?\n/)){let s="",a=(r=i.match(/[ -鿿가-힯＀-￯]|[^\s -鿿가-힯＀-￯]+\s*|\s+/g))!=null?r:[""];for(let l of a){let c=s+l;if(!s||o.measureText(c.trimEnd()).width<=t)if(!s&&o.measureText(l.trimEnd()).width>t)for(let d of l)s&&o.measureText(s+d).width>t&&(n.push(s),s=""),s+=d;else s=c;else n.push(s.trimEnd()),s=l.trimStart();if(n.length>=sn)break}if(n.push(s.trimEnd()),n.length>=sn)break}return n.length>sn&&(n.length=sn),n}function ma(o){var m;let[e,t]=(m=an[o.paper])!=null?m:an.A4,[n,r]=o.orientation==="landscape"?[t,e]:[e,t],i=n*wt,s=r*wt,a=12*wt,l=14*wt,c=i-a*2,d=o.numbered?40:0,u=o.widths.slice(o.numbered?1:0),f=u.reduce((y,b)=>y+b,0)||1,h=o.fit?(c-d)/f:Math.min(1,(c-d)/f),p=[...o.numbered?[d]:[],...u.map(y=>y*h)],g=[],w=a;for(let y of p)g.push(w),w+=y;return{pageW:i,pageH:s,margin:a,marginBottom:l,colX:g,colW:p}}function _r(o,e,t,n,r){var l,c,d;let i={cells:[],kind:n,level:r,y:0,h:0},s=0,a=22;for(let u of t){let f=Math.max(1,(l=u.span)!=null?l:1),h=(c=e.colX[s])!=null?c:e.margin,p=0;for(let m=s;m<s+f&&m<e.colW.length;m++)p+=e.colW[m];s+=f,o.font=He(n==="group"?600:n==="total"||u.bold?700:400);let g=((d=u.indent)!=null?d:0)*14,w=Xr(o,u.text,Math.max(8,p-ln*2-g-(u.icon?14:0)));a=Math.max(a,w.length*Be+Qe*2),i.cells.push({cell:u,x:h,w:p,y:0,h:0,lines:w})}return i.h=a,i}function ga(o,e,t){let n=t.map(()=>({cells:[],kind:"head",y:0,h:22})),r=t.map(()=>e.colW.map(()=>!1)),i=[];o.font=He(600),t.forEach((s,a)=>{var c,d,u;let l=0;for(let f of s){for(;l<e.colW.length&&r[a][l];)l++;let h=Math.max(1,(c=f.span)!=null?c:1),p=Math.max(1,Math.min(t.length-a,(d=f.rowspan)!=null?d:1));for(let m=a;m<a+p;m++)for(let y=l;y<l+h&&y<e.colW.length;y++)r[m][y]=!0;let g=0;for(let m=l;m<l+h&&m<e.colW.length;m++)g+=e.colW[m];let w=Xr(o,f.text,Math.max(8,g-ln*2));i.push({cell:f,r:a,col:l,span:h,rs:p,lines:w,x:(u=e.colX[l])!=null?u:e.margin,w:g}),l+=h}});for(let s of i){let l=(s.lines.length*Be+Qe*2)/s.rs;for(let c=s.r;c<s.r+s.rs;c++)n[c].h=Math.max(n[c].h,l)}for(let s of i)n[s.r].cells.push({cell:s.cell,x:s.x,w:s.w,y:0,h:n.slice(s.r,s.r+s.rs).reduce((a,l)=>a+l.h,0),lines:s.lines});return n}function Jr(o){return!o.title&&!o.subtitle&&!o.printed?0:(o.title?24:12)+(o.subtitle?17:0)+18}function wa(o,e){let t=ma(e),n=ga(o,t,e.head),r=0,i=e.body.map(g=>{let w=_r(o,t,g.cells,g.kind,g.level);return g.kind==="row"&&(w.odd=r++%2===1),w}),s=i.slice(0,e.repeatRows),a=i.slice(e.repeatRows),l=e.foot.map(g=>_r(o,t,g.cells,g.kind,g.level)),c=t.pageH-t.marginBottom,d=Jr(e),u=[],f=[...a,...l],h=g=>({...g,cells:g.cells.map(w=>({...w}))}),p=0;do{let g=u.length===0,w={rows:[],title:g||e.repeatTitle},m=t.margin+(w.title?d:0),y=v=>{let S=h(v);S.y=m;for(let C of S.cells)C.y=m,S.kind!=="head"&&(C.h=S.h);w.rows.push(S),m+=S.h};(g||e.repeatHeader)&&n.forEach(y),s.forEach(y);let b=m;for(;p<f.length;){let v=f[p],S=v.kind==="group"&&p+1<f.length?v.h+f[p+1].h:v.h;if(m+S>c&&m>b)break;y(v),p++}u.push(w)}while(p<f.length&&u.length<5e3);return{pages:u,g:t}}function Oe(o,e,t,n,r,i,s){o.strokeStyle=i,o.lineWidth=s,o.beginPath(),o.moveTo(e,t),o.lineTo(n,r),o.stroke()}function ya(o,e,t,n){var s;let r=n.colX.length?n.colX[n.colX.length-1]+n.colW[n.colW.length-1]:n.pageW-n.margin,i=e.kind==="head"?"#f3f4f6":e.kind==="group"?e.level?"#eef2f7":"#e2e8f0":e.kind==="total"?"#f3f4f6":t.striped&&e.odd?"#f9fafb":"";for(let a of e.cells){let l=a.cell.fill||i;l&&(o.fillStyle=l,o.fillRect(a.x,a.y,a.w,a.h)),a.cell.bar&&(o.save(),o.globalAlpha=.4,o.fillStyle=a.cell.bar.color,o.fillRect(a.x+a.w*a.cell.bar.from,a.y+a.h*.15,a.w*(a.cell.bar.to-a.cell.bar.from),a.h*.7),o.restore());let c=e.kind==="head"||e.kind==="group"?600:e.kind==="total"?700:a.cell.bold?600:400;o.font=`${a.cell.italic?"italic ":""}${He(c)}`,o.fillStyle=a.cell.num?"#9ca3af":a.cell.color||(e.kind==="head"?"#374151":"#111827"),o.textBaseline="middle",o.save(),o.beginPath(),o.rect(a.x,a.y,a.w,a.h),o.clip();let d=((s=a.cell.indent)!=null?s:0)*14,u=a.lines.length*Be,f=e.kind==="head"?a.y+a.h-Qe-u+Be/2:a.y+Qe+Be/2;e.kind!=="head"&&a.h>u+Qe*2&&(f=a.y+Qe+Be/2);for(let[h,p]of a.lines.entries()){let g=a.x+ln+d,w=o.measureText(p).width+(a.cell.icon&&h===0?14:0),m=a.cell.group?"center":a.cell.align;if(m==="right"?g=a.x+a.w-ln-w:m==="center"&&(g=a.x+(a.w-w)/2),o.textAlign="left",a.cell.icon&&h===0){let y=o.fillStyle;o.fillStyle=a.cell.icon.color,o.fillText(a.cell.icon.char,g,f),o.fillStyle=y,g+=14}o.fillText(p,g,f),a.cell.strike&&Oe(o,g,f,g+o.measureText(p).width,f,String(o.fillStyle),1),f+=Be}o.restore(),e.kind==="head"&&a.x>n.margin+.5&&Oe(o,a.x,a.y,a.x,a.y+a.h,"#e5e7eb",1),e.kind==="head"&&Oe(o,a.x,a.y+a.h,a.x+a.w,a.y+a.h,"#9ca3af",1.5)}e.kind==="group"&&Oe(o,n.margin,e.y,r,e.y,"#cbd5e1",1),e.kind==="total"?Oe(o,n.margin,e.y,r,e.y,"#111827",1.5):e.kind!=="head"&&Oe(o,n.margin,e.y+e.h,r,e.y+e.h,"#e5e7eb",1)}function ba(o,e,t){let n=Jr(e);if(!n)return;let r=t.pageW-t.margin,i=t.margin;if(o.textAlign="left",o.textBaseline="top",e.title&&(o.font=He(700,17),o.fillStyle="#111827",o.fillText(e.title,t.margin,i),i+=24),e.subtitle&&(o.font=He(400,11),o.fillStyle="#4b5563",o.fillText(e.subtitle,t.margin,i),i+=17),e.printed){o.font=He(400,9.5),o.fillStyle="#6b7280";let s=o.measureText(e.printed).width;o.fillText(e.printed,r-s,t.margin+n-18-13)}Oe(o,t.margin,t.margin+n-10,r,t.margin+n-10,"#111827",2)}function va(o,e,t,n,r){let i=t.pageH-7*wt;if(o.font=He(400,8.5),o.fillStyle="#6b7280",o.textBaseline="middle",o.textAlign="left",e.footer&&o.fillText(e.footer,t.margin,i),e.pageNumbers){let s=`${n+1} / ${r}`;o.fillText(s,t.pageW-t.margin-o.measureText(s).width,i)}}function ro(o,e=dn,t={}){var g;let n=typeof t.scale=="number"&&t.scale>0?Math.min(4,t.scale):2,r=typeof t.quality=="number"&&t.quality>0&&t.quality<=1?t.quality:.92,i=e.surface(8,8);if(!i)return null;let{pages:s,g:a}=wa(i.ctx,o),l=Math.round(a.pageW*n),c=Math.round(a.pageH*n),d=[];s.forEach((w,m)=>{let y=e.surface(l,c);if(!y)return;let b=y.ctx;b.setTransform(n,0,0,n,0,0),b.fillStyle="#ffffff",b.fillRect(0,0,a.pageW,a.pageH),w.title&&ba(b,o,a);for(let v of w.rows)ya(b,v,o,a);va(b,o,a,m,s.length),d.push(y.jpeg(r))});let[u,f]=(g=an[o.paper])!=null?g:an.A4,[h,p]=o.orientation==="landscape"?[f,u]:[u,f];return Ca(d.map(w=>({jpeg:w,width:l,height:c})),h*Kr,p*Kr,o.title)}function xa(o){if(/^[\x20-\x7e]*$/.test(o))return`(${o.replace(/[\\()]/g,t=>`\\${t}`)})`;let e="FEFF";for(let t=0;t<o.length;t++)e+=o.charCodeAt(t).toString(16).padStart(4,"0").toUpperCase();return`<${e}>`}function Ca(o,e,t,n=""){var b;let r=new TextEncoder,i=[],s=[],a=0,l=v=>{let S=typeof v=="string"?r.encode(v):v;i.push(S),a+=S.length},c=(v,S)=>{s[v]=a,l(`${v} 0 obj
4
+ `?2:1;continue}r+=l,a=!1,i++}return(r!==""||n.length||!a)&&(n.push(r),t.push(n)),t}function tn(o,e,t){var n;if(K(e))return"";if(Array.isArray(e))return e.join(", ");switch(o.type){case"number":{let r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?String(e):String(r)}case"date":return(n=ie(e))!=null?n:String(e);case"boolean":return e===!0?"TRUE":e===!1?"FALSE":String(e);default:return ee(o,t)(e)}}var ta=new Set(["true","1","y","yes","\uC608","o","on"]),na=new Set(["false","0","n","no","\uC544\uB2C8\uC624","x","off"]);function oa(o){let e=o.trim();if(!e)return{ok:!0,value:null};let t=!1;/^\(.*\)$/.test(e)&&(t=!0,e=e.slice(1,-1));let n=e.endsWith("%");if(n&&(e=e.slice(0,-1)),e=e.replace(/[\s,₩$€£¥원]/g,""),!/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i.test(e))return{ok:!1};let r=Number(e);return n&&(r/=100),t&&(r=-r),Number.isFinite(r)?{ok:!0,value:Math.abs(r)<1e15?Math.round(r*1e12)/1e12:r}:{ok:!1}}function zr(o,e,t){let n=new Date(o,e-1,t);return n.getFullYear()===o&&n.getMonth()===e-1&&n.getDate()===t?n:null}function ra(o,e){let t=o.trim();if(!t)return{ok:!0,value:null};let n=null,r=/^(\d{4})\s*[-./년]\s*(\d{1,2})\s*[-./월]\s*(\d{1,2})\s*[.일]?$/.exec(t);return r?n=zr(+r[1],+r[2],+r[3]):(r=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(t))?n=zr(+r[3],+r[1],+r[2]):/^\d{4}-\d{2}-\d{2}T/.test(t)&&(n=me(t)),n?{ok:!0,value:e instanceof Date?n:ie(n)}:{ok:!1}}function nn(o,e,t){switch(o.type){case"number":return oa(e);case"date":return ra(e,t);case"boolean":{let n=e.trim().toLowerCase();return n?ta.has(n)?{ok:!0,value:!0}:na.has(n)?{ok:!0,value:!1}:{ok:!1}:{ok:!0,value:null}}default:return{ok:!0,value:e}}}var ia=o=>o.map(e=>e!==null&&typeof e=="object"&&"value"in e?e:{value:e,label:String(e),disabled:!1}),Oe=o=>String(o).padStart(2,"0");function sa(o){let e=o instanceof Date?o:typeof o=="string"&&o?new Date(o):null;return!e||Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${Oe(e.getMonth()+1)}-${Oe(e.getDate())}T${Oe(e.getHours())}:${Oe(e.getMinutes())}`}function aa(o){if(o instanceof Date)return`${Oe(o.getHours())}:${Oe(o.getMinutes())}`;let e=typeof o=="string"?/(\d{1,2}):(\d{2})/.exec(o):null;return e?`${Oe(Number(e[1]))}:${e[2]}`:""}var on=class{constructor(e){this.grid=e;this.cur=null;this.session=null;e.events.on("focusChange",({rowIndex:t})=>{var n;this.session&&!this.cur&&((n=this.grid.rowModel.getRow(t))==null?void 0:n.data)!==this.session.row&&this.endRow(!0)})}get rowMode(){return this.grid.options.editType==="row"}editingRow(e){var t;return((t=this.session)==null?void 0:t.id)===e}beginRow(e,t){var n;((n=this.session)==null?void 0:n.row)!==e&&(this.session&&this.endRow(!0),this.session={row:e,id:this.grid.rowModel.idOf(e),before:{...e},undoMark:this.grid.history.mark()},this.grid.renderer.invalidate({rows:!0}),this.grid.events.emit("rowEditStart",{row:e,rowIndex:t}))}endRow(e){let t=this.session;if(!t)return;if(this.cur){if(e&&!this.commit(null))return;e||this.close(!1)}this.session=null;let{grid:n}=this,r=n.rowModel.indexOfId(t.id),i=n.columns.displayed().filter(a=>a.def.field&&!G(a.id));if(!e){let a=[];for(let l of i){let c=l.def.field;Object.is(t.row[c],t.before[c])||n.writeCell(a,t.row,c,l.id,r,t.before[c])}n.endCellTx(a),n.history.rollback(t.undoMark)}let s=i.filter(a=>!Object.is(t.row[a.def.field],t.before[a.def.field])).map(a=>({colId:a.id,oldValue:t.before[a.def.field],newValue:t.row[a.def.field]}));n.renderer.invalidate({rows:!0}),n.events.emit("rowEditStop",{row:t.row,rowIndex:r,committed:e,changes:s})}get active(){return this.cur&&{rowIndex:this.cur.rowIndex,colId:this.cur.colId}}canEdit(e,t){if(G(t))return!1;let n=this.grid.columns.getColumn(t);if(!(n!=null&&n.def.field)||e<0||e>=this.grid.rowModel.getRowCount())return!1;let r=this.grid.rowModel.getRow(e);return!r.kind&&ye(n.def,r.data,e)}start(e,t,n){var b,v,S;if(this.cur&&!this.commit(null)||!this.canEdit(e,t))return!1;let{grid:r}=this;if(r.veto("beforeEdit",{row:r.rowModel.getRow(e).data,rowIndex:e,colId:t}))return!1;let{renderer:i}=r,a=r.columns.getColumn(t).def,l=r.rowModel.getRow(e).data,c=l[a.field];this.rowMode&&this.beginRow(l,e),r.setFocus(e,t),i.ensureVisible(e,t),i.render();let d=C("div","fg-editor");this.place(d,e,t);let u,f,p=()=>{},h=a.editor;if(typeof h=="function"){let x=h({value:c,row:l,column:a,initialText:n});u=x.el,f=()=>({value:x.getValue()}),p=()=>{var k;return(k=x.destroy)==null?void 0:k.call(x)},d.append(u),queueMicrotask(()=>{var k;return(k=x.focus)==null?void 0:k.call(x)})}else if((h==null?void 0:h.type)==="select"){let x=ia(typeof h.options=="function"?h.options(l):h.options),k=C("select","fg-editor-control");x.forEach((E,L)=>{var M;let R=C("option");R.value=String(L),R.textContent=(M=E.label)!=null?M:String(E.value),R.disabled=!!E.disabled,k.append(R)}),k.selectedIndex=Math.max(0,x.findIndex(E=>Object.is(E.value,c))),u=k,f=()=>{var E,L;return{value:(L=(E=x[k.selectedIndex])==null?void 0:E.value)!=null?L:null}},d.append(k)}else if((h==null?void 0:h.type)==="time"||(h==null?void 0:h.type)==="datetime"||!h&&a.type==="date"&&a.format==="datetime"){let x=(h==null?void 0:h.type)==="time",k=C("input","fg-editor-control",{type:x?"time":"datetime-local"});k.value=x?aa(c):sa(c),u=k,f=()=>k.value?x?{value:k.value}:{value:c instanceof Date?new Date(k.value):k.value}:{value:null},d.append(k)}else{let k=(h==null?void 0:h.type)==="textarea"?C("textarea","fg-editor-control"):C("input","fg-editor-control");k instanceof HTMLInputElement&&(k.type=a.type==="date"&&n===void 0?"date":"text",a.type==="number"&&(k.inputMode="decimal"));let E=a.type==="date"?(b=ie(c))!=null?b:"":K(c)?"":String(c);k.value=n!=null?n:E,u=k,f=()=>({text:k.value}),d.append(k)}u.setAttribute("aria-label",(S=(v=a.header)!=null?v:a.field)!=null?S:t);let g=C("div","fg-editor-msg",{role:"alert"});d.append(g);let w=x=>{if(x.stopPropagation(),x.key==="Escape")x.preventDefault(),this.cancel();else if(x.key==="Enter"){if(u instanceof HTMLTextAreaElement&&!(x.ctrlKey||x.metaKey))return;x.preventDefault(),this.commit(x.shiftKey?"up":"down")}else x.key==="Tab"&&(x.preventDefault(),this.commit(x.shiftKey?"left":"right"))},m=x=>{var k;((k=this.cur)==null?void 0:k.wrap)===d&&!d.contains(x.relatedTarget)&&this.commit(null)},y=()=>this.commit(null);return d.addEventListener("keydown",w),d.addEventListener("focusout",m),i.scroller.addEventListener("scroll",y,{passive:!0}),i.root.append(d),this.cur={rowIndex:e,colId:t,row:l,def:a,wrap:d,read:f,dispose:()=>{d.removeEventListener("keydown",w),d.removeEventListener("focusout",m),i.scroller.removeEventListener("scroll",y),p(),d.remove()}},typeof h!="function"&&(u.focus(),n===void 0&&u instanceof HTMLInputElement&&u.type==="text"&&u.select()),r.events.emit("editStart",{rowIndex:e,colId:t}),!0}place(e,t,n){var l,c,d;let{renderer:r}=this.grid,i=r.root.querySelector(`.fg-row[data-row="${t}"] .fg-cell[data-col="${CSS.escape(n)}"]`),s=r.root.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect();return e.style.left=`${((l=a==null?void 0:a.left)!=null?l:s.left)-s.left}px`,e.style.top=`${((c=a==null?void 0:a.top)!=null?c:s.top)-s.top}px`,e.style.width=`${(a==null?void 0:a.width)||((d=this.grid.columns.getColumn(n))==null?void 0:d.width)}px`,e.style.height=`${(a==null?void 0:a.height)||r.opts.rowHeight}px`,!!i}indexOf(e){var r;let t=this.grid.rowModel,n=t.indexOfId(t.idOf(e));return n>=0&&((r=t.getRow(n))==null?void 0:r.data)===e?n:-1}sync(){let e=this.cur;if(!e)return;let t=this.indexOf(e.row);if(t<0)return this.cancel();t!==e.rowIndex&&(e.rowIndex=t,this.grid.setFocus(t,e.colId),this.grid.renderer.render(),this.place(e.wrap,t,e.colId)||this.commit(null))}commit(e){let t=this.cur;if(!t)return!1;let{grid:n}=this,r=n.store.state.locale,i=t.def.field,s=t.row[i],a=t.read(),l;if("text"in a&&t.def.formulas&&Ne(a.text.trim()))l=a.text.trim();else if("text"in a){let u=nn(t.def,a.text,s);if(!u.ok)return this.fail(a.text,r.invalidValue);l=u.value}else l=a.value;let c=n.cellError(t.def,t.row,l);if(c!==null)return this.fail(l,c);let d=this.indexOf(t.row);return d<0?(this.cancel(),!1):(t.rowIndex=d,this.close(!0),n.applyEdit(d,t.colId,l),this.session&&(e==="down"||e==="up")&&this.endRow(!0),this.move(d,t.colId,e),!0)}cancel(){this.close(!1),this.session&&this.endRow(!1)}destroy(){var e;(e=this.cur)==null||e.dispose(),this.cur=null,this.session=null}fail(e,t){let n=this.cur;return n.wrap.classList.add("fg-editor-invalid"),n.wrap.querySelector(".fg-editor-msg").textContent=t,this.grid.events.emit("validationFailed",{rowIndex:n.rowIndex,colId:n.colId,value:e,message:t}),!1}close(e){let t=this.cur;t&&(this.cur=null,t.dispose(),this.grid.renderer.gridEl.focus({preventScroll:!0}),this.grid.events.emit("editStop",{rowIndex:t.rowIndex,colId:t.colId,committed:e}))}move(e,t,n){if(!n)return;let{grid:r}=this,i=r.rowModel.getRowCount();if(n==="down"||n==="up"){let d=Math.max(0,Math.min(i-1,e+(n==="down"?1:-1)));r.setFocus(d,t),r.renderer.ensureVisible(d,t);return}let s=r.columns.displayed().filter(d=>this.canEdit(e,d.id)||d.def.editable);if(!s.length)return;let a=n==="right"?1:-1,l=e,c=s.findIndex(d=>d.id===t)+a;c>=s.length&&(c=0,this.session||l++),c<0&&(c=s.length-1,this.session||l--),!(l<0||l>=i)&&this.start(l,s[c].id)}};var rn=class{constructor(e=200){this.limit=e;this.entries=[];this.index=0}push(e){this.entries.splice(this.index),this.entries.push(e),this.entries.length>this.limit&&this.entries.shift(),this.index=this.entries.length}canUndo(){return this.index>0}canRedo(){return this.index<this.entries.length}undo(){return this.canUndo()?(this.entries[--this.index].undo(),!0):!1}redo(){return this.canRedo()?(this.entries[this.index++].redo(),!0):!1}mark(){var e;return(e=this.entries[this.index-1])!=null?e:null}rollback(e){let t=e?this.entries.indexOf(e)+1:0;this.entries.splice(t),this.index=Math.min(this.index,t)}clear(){this.entries=[],this.index=0}};var qr=(o,e)=>o instanceof Date&&e instanceof Date?o.getTime()===e.getTime():Object.is(o,e),sn=class{constructor(){this.originals=new Map;this.created=new Set;this.deleted=new Map}beforeChange(e){!this.created.has(e)&&!this.originals.has(e)&&this.originals.set(e,{...e})}isDirty(e,t){if(!t||this.created.has(e))return!1;let n=this.originals.get(e);return!!n&&!qr(n[t],e[t])}diff(e,t){let n=this.originals.get(e);return n?t.filter(r=>!qr(n[r],e[r])):[]}commit(e,t){for(let n of t)this.deleted.delete(n);for(let[n,r]of e)this.created.delete(n),this.originals.set(n,{...r})}get size(){return this.originals.size+this.created.size+this.deleted.size}reset(){this.originals.clear(),this.created.clear(),this.deleted.clear()}};function gt(o){return{r1:Math.min(o.start.rowIndex,o.end.rowIndex),r2:Math.max(o.start.rowIndex,o.end.rowIndex),c1:Math.min(o.start.colIndex,o.end.colIndex),c2:Math.max(o.start.colIndex,o.end.colIndex)}}function Wr(o,e,t){return e>=o.r1&&e<=o.r2&&t>=o.c1&&t<=o.c2}var la=5;function jr(o,e){let t=r=>o(r),n=r=>{window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",n),window.removeEventListener("pointercancel",n),e(r)};window.addEventListener("pointermove",t),window.addEventListener("pointerup",n),window.addEventListener("pointercancel",n)}function da(o,e,t){let n=o.columns.getColumn(t);if(!n)return;let r=e.clientX,i=n.width;o.renderer.root.classList.add("fg-resizing"),jr(s=>{o.columns.setWidth(t,i+(s.clientX-r)*(o.renderer.rtl?-1:1)),o.layoutChanged()},()=>{var a,l;o.renderer.root.classList.remove("fg-resizing");let s=(l=(a=o.columns.getColumn(t))==null?void 0:a.width)!=null?l:i;s!==i&&o.events.emit("columnResize",{colId:t,width:s})})}function ca(o,e){let t=o.columns.getNode(e);return!!o.groupPanel&&!!t&&!t.children&&!o.options.treeData&&!o.getGroupBy().includes(e)}function ua(o,e,t,n){var l,c;let r=new Set(o.columns.siblings(e).map(d=>d.id).filter(d=>d!==e&&!G(d))),i=[...n.querySelectorAll(".fg-header-cell")].filter(d=>r.has(d.dataset.col)).map(d=>({id:d.dataset.col,el:d})),s=C("div",`fg-drag-ghost fg-theme-${o.store.state.theme}`);s.textContent=(c=(l=t.querySelector(".fg-header-label"))==null?void 0:l.textContent)!=null?c:"",o.applyFontTo(s),re(o.renderer.root).append(s);let a=C("div","fg-drop-marker");return a.style.height=`${o.renderer.headerEl.offsetHeight}px`,o.renderer.root.append(a),t.classList.add("fg-dragging"),{ghost:s,marker:a,cell:t,sibs:i,target:-1,overPanel:!1}}function fa(o,e,t,n,r){var d,u;t.ghost.style.transform=`translate(${n+12}px, ${r+8}px)`,t.overPanel=ca(o,e)&&!!((d=o.groupPanel)!=null&&d.contains(n,r)),(u=o.groupPanel)==null||u.highlight(t.overPanel),t.marker.hidden=t.overPanel;let i=0;for(let f of t.sibs){let p=f.el.getBoundingClientRect();(o.renderer.rtl?n<p.left+p.width/2:n>p.left+p.width/2)&&i++}t.target=i;let s=o.renderer.root.getBoundingClientRect().left,a=f=>o.renderer.rtl?f.getBoundingClientRect().right:f.getBoundingClientRect().left,l=f=>o.renderer.rtl?f.getBoundingClientRect().left:f.getBoundingClientRect().right,c=i<t.sibs.length?a(t.sibs[i].el):t.sibs.length?l(t.sibs[t.sibs.length-1].el):a(t.cell);t.marker.style.left=`${c-s-1}px`}function pa(o,e,t){var a;if(t.ghost.remove(),t.marker.remove(),t.cell.classList.remove("fg-dragging"),t.overPanel){(a=o.groupPanel)==null||a.highlight(!1),o.setGroupBy([...o.getGroupBy(),e]);return}if(t.target<0||!t.sibs.length)return;let n=o.columns.siblings(e),r=n.findIndex(l=>l.id===e),i=n.map(l=>l.id).filter(l=>l!==e),s=t.target<t.sibs.length?i.indexOf(t.sibs[t.target].id):i.indexOf(t.sibs[t.sibs.length-1].id)+1;s=Math.max(i.filter(G).length,s),s!==r&&(o.columns.move(e,s),o.layoutChanged(),o.events.emit("columnMove",{colId:e,toIndex:s}))}function ha(o,e,t,n){let r=o.columns.getNode(t),i=n.closest(".fg-header-pane");if(!r||!i)return;let s=e.clientX,a=null;jr(l=>{if(!a){if(Math.abs(l.clientX-s)<la)return;a=ua(o,t,n,i)}fa(o,t,a,l.clientX,l.clientY)},l=>{a?pa(o,t,a):!r.children&&De(r.def)&&o.toggleSort(t,l.shiftKey||l.ctrlKey||l.metaKey)})}function Ur(o){let e=o.renderer.headerEl,t=r=>{if(r.button!==0)return;let i=r.target,s=i.closest(".fg-header-cell"),a=s==null?void 0:s.dataset.col;!s||!a||G(a)||i.closest(".fg-menu-btn")||i.closest("button, a, input, select, textarea, [data-fg-no-sort]")&&i.closest(".fg-header-label")||(r.preventDefault(),i.closest(".fg-resize")?da(o,r,a):ha(o,r,a,s))},n=r=>{var a;let i=r.target,s=i.closest(".fg-menu-btn");if(s){let l=(a=s.closest(".fg-header-cell"))==null?void 0:a.dataset.col;l&&o.menu.toggle(l,s);return}i.closest(".fg-select-all")&&o.toggleSelectAll()};return e.addEventListener("pointerdown",t),e.addEventListener("click",n),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("click",n)}}var ln={A4:[210,297],A3:[297,420],A5:[148,210],B4:[250,353],B5:[176,250],letter:[215.9,279.4],legal:[215.9,355.6]},wt=96/25.4,Kr=72/25.4,ma="system-ui, 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans CJK KR', sans-serif",ga=10.5,He=15,dn=7,Qe=4,an=8;function wa(o){let e=atob(o),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}var cn={surface(o,e){if(typeof document=="undefined")return null;let t=document.createElement("canvas");t.width=o,t.height=e;let n=null;try{n=t.getContext("2d")}catch{n=null}return n?{ctx:n,jpeg:r=>{var i;return wa((i=t.toDataURL("image/jpeg",r).split(",")[1])!=null?i:"")}}:null}},Ge=(o,e=ga)=>`${o} ${e}px ${ma}`;function Xr(o,e,t){var r;if(!e)return[""];let n=[];for(let i of e.split(/\r?\n/)){let s="",a=(r=i.match(/[ -鿿가-힯＀-￯]|[^\s -鿿가-힯＀-￯]+\s*|\s+/g))!=null?r:[""];for(let l of a){let c=s+l;if(!s||o.measureText(c.trimEnd()).width<=t)if(!s&&o.measureText(l.trimEnd()).width>t)for(let d of l)s&&o.measureText(s+d).width>t&&(n.push(s),s=""),s+=d;else s=c;else n.push(s.trimEnd()),s=l.trimStart();if(n.length>=an)break}if(n.push(s.trimEnd()),n.length>=an)break}return n.length>an&&(n.length=an),n}function ya(o){var m;let[e,t]=(m=ln[o.paper])!=null?m:ln.A4,[n,r]=o.orientation==="landscape"?[t,e]:[e,t],i=n*wt,s=r*wt,a=12*wt,l=14*wt,c=i-a*2,d=o.numbered?40:0,u=o.widths.slice(o.numbered?1:0),f=u.reduce((y,b)=>y+b,0)||1,p=o.fit?(c-d)/f:Math.min(1,(c-d)/f),h=[...o.numbered?[d]:[],...u.map(y=>y*p)],g=[],w=a;for(let y of h)g.push(w),w+=y;return{pageW:i,pageH:s,margin:a,marginBottom:l,colX:g,colW:h}}function _r(o,e,t,n,r){var l,c,d;let i={cells:[],kind:n,level:r,y:0,h:0},s=0,a=22;for(let u of t){let f=Math.max(1,(l=u.span)!=null?l:1),p=(c=e.colX[s])!=null?c:e.margin,h=0;for(let m=s;m<s+f&&m<e.colW.length;m++)h+=e.colW[m];s+=f,o.font=Ge(n==="group"?600:n==="total"||u.bold?700:400);let g=((d=u.indent)!=null?d:0)*14,w=Xr(o,u.text,Math.max(8,h-dn*2-g-(u.icon?14:0)));a=Math.max(a,w.length*He+Qe*2),i.cells.push({cell:u,x:p,w:h,y:0,h:0,lines:w})}return i.h=a,i}function ba(o,e,t){let n=t.map(()=>({cells:[],kind:"head",y:0,h:22})),r=t.map(()=>e.colW.map(()=>!1)),i=[];o.font=Ge(600),t.forEach((s,a)=>{var c,d,u;let l=0;for(let f of s){for(;l<e.colW.length&&r[a][l];)l++;let p=Math.max(1,(c=f.span)!=null?c:1),h=Math.max(1,Math.min(t.length-a,(d=f.rowspan)!=null?d:1));for(let m=a;m<a+h;m++)for(let y=l;y<l+p&&y<e.colW.length;y++)r[m][y]=!0;let g=0;for(let m=l;m<l+p&&m<e.colW.length;m++)g+=e.colW[m];let w=Xr(o,f.text,Math.max(8,g-dn*2));i.push({cell:f,r:a,col:l,span:p,rs:h,lines:w,x:(u=e.colX[l])!=null?u:e.margin,w:g}),l+=p}});for(let s of i){let l=(s.lines.length*He+Qe*2)/s.rs;for(let c=s.r;c<s.r+s.rs;c++)n[c].h=Math.max(n[c].h,l)}for(let s of i)n[s.r].cells.push({cell:s.cell,x:s.x,w:s.w,y:0,h:n.slice(s.r,s.r+s.rs).reduce((a,l)=>a+l.h,0),lines:s.lines});return n}function Jr(o){return!o.title&&!o.subtitle&&!o.printed?0:(o.title?24:12)+(o.subtitle?17:0)+18}function va(o,e){let t=ya(e),n=ba(o,t,e.head),r=0,i=e.body.map(g=>{let w=_r(o,t,g.cells,g.kind,g.level);return g.kind==="row"&&(w.odd=r++%2===1),w}),s=i.slice(0,e.repeatRows),a=i.slice(e.repeatRows),l=e.foot.map(g=>_r(o,t,g.cells,g.kind,g.level)),c=t.pageH-t.marginBottom,d=Jr(e),u=[],f=[...a,...l],p=g=>({...g,cells:g.cells.map(w=>({...w}))}),h=0;do{let g=u.length===0,w={rows:[],title:g||e.repeatTitle},m=t.margin+(w.title?d:0),y=v=>{let S=p(v);S.y=m;for(let x of S.cells)x.y=m,S.kind!=="head"&&(x.h=S.h);w.rows.push(S),m+=S.h};(g||e.repeatHeader)&&n.forEach(y),s.forEach(y);let b=m;for(;h<f.length;){let v=f[h],S=v.kind==="group"&&h+1<f.length?v.h+f[h+1].h:v.h;if(m+S>c&&m>b)break;y(v),h++}u.push(w)}while(h<f.length&&u.length<5e3);return{pages:u,g:t}}function Be(o,e,t,n,r,i,s){o.strokeStyle=i,o.lineWidth=s,o.beginPath(),o.moveTo(e,t),o.lineTo(n,r),o.stroke()}function xa(o,e,t,n){var s;let r=n.colX.length?n.colX[n.colX.length-1]+n.colW[n.colW.length-1]:n.pageW-n.margin,i=e.kind==="head"?"#f3f4f6":e.kind==="group"?e.level?"#eef2f7":"#e2e8f0":e.kind==="total"?"#f3f4f6":t.striped&&e.odd?"#f9fafb":"";for(let a of e.cells){let l=a.cell.fill||i;l&&(o.fillStyle=l,o.fillRect(a.x,a.y,a.w,a.h)),a.cell.bar&&(o.save(),o.globalAlpha=.4,o.fillStyle=a.cell.bar.color,o.fillRect(a.x+a.w*a.cell.bar.from,a.y+a.h*.15,a.w*(a.cell.bar.to-a.cell.bar.from),a.h*.7),o.restore());let c=e.kind==="head"||e.kind==="group"?600:e.kind==="total"?700:a.cell.bold?600:400;o.font=`${a.cell.italic?"italic ":""}${Ge(c)}`,o.fillStyle=a.cell.num?"#9ca3af":a.cell.color||(e.kind==="head"?"#374151":"#111827"),o.textBaseline="middle",o.save(),o.beginPath(),o.rect(a.x,a.y,a.w,a.h),o.clip();let d=((s=a.cell.indent)!=null?s:0)*14,u=a.lines.length*He,f=e.kind==="head"?a.y+a.h-Qe-u+He/2:a.y+Qe+He/2;e.kind!=="head"&&a.h>u+Qe*2&&(f=a.y+Qe+He/2);for(let[p,h]of a.lines.entries()){let g=a.x+dn+d,w=o.measureText(h).width+(a.cell.icon&&p===0?14:0),m=a.cell.group?"center":a.cell.align;if(m==="right"?g=a.x+a.w-dn-w:m==="center"&&(g=a.x+(a.w-w)/2),o.textAlign="left",a.cell.icon&&p===0){let y=o.fillStyle;o.fillStyle=a.cell.icon.color,o.fillText(a.cell.icon.char,g,f),o.fillStyle=y,g+=14}o.fillText(h,g,f),a.cell.strike&&Be(o,g,f,g+o.measureText(h).width,f,String(o.fillStyle),1),f+=He}o.restore(),e.kind==="head"&&a.x>n.margin+.5&&Be(o,a.x,a.y,a.x,a.y+a.h,"#e5e7eb",1),e.kind==="head"&&Be(o,a.x,a.y+a.h,a.x+a.w,a.y+a.h,"#9ca3af",1.5)}e.kind==="group"&&Be(o,n.margin,e.y,r,e.y,"#cbd5e1",1),e.kind==="total"?Be(o,n.margin,e.y,r,e.y,"#111827",1.5):e.kind!=="head"&&Be(o,n.margin,e.y+e.h,r,e.y+e.h,"#e5e7eb",1)}function Ca(o,e,t){let n=Jr(e);if(!n)return;let r=t.pageW-t.margin,i=t.margin;if(o.textAlign="left",o.textBaseline="top",e.title&&(o.font=Ge(700,17),o.fillStyle="#111827",o.fillText(e.title,t.margin,i),i+=24),e.subtitle&&(o.font=Ge(400,11),o.fillStyle="#4b5563",o.fillText(e.subtitle,t.margin,i),i+=17),e.printed){o.font=Ge(400,9.5),o.fillStyle="#6b7280";let s=o.measureText(e.printed).width;o.fillText(e.printed,r-s,t.margin+n-18-13)}Be(o,t.margin,t.margin+n-10,r,t.margin+n-10,"#111827",2)}function ka(o,e,t,n,r){let i=t.pageH-7*wt;if(o.font=Ge(400,8.5),o.fillStyle="#6b7280",o.textBaseline="middle",o.textAlign="left",e.footer&&o.fillText(e.footer,t.margin,i),e.pageNumbers){let s=`${n+1} / ${r}`;o.fillText(s,t.pageW-t.margin-o.measureText(s).width,i)}}function ro(o,e=cn,t={}){var g;let n=typeof t.scale=="number"&&t.scale>0?Math.min(4,t.scale):2,r=typeof t.quality=="number"&&t.quality>0&&t.quality<=1?t.quality:.92,i=e.surface(8,8);if(!i)return null;let{pages:s,g:a}=va(i.ctx,o),l=Math.round(a.pageW*n),c=Math.round(a.pageH*n),d=[];s.forEach((w,m)=>{let y=e.surface(l,c);if(!y)return;let b=y.ctx;b.setTransform(n,0,0,n,0,0),b.fillStyle="#ffffff",b.fillRect(0,0,a.pageW,a.pageH),w.title&&Ca(b,o,a);for(let v of w.rows)xa(b,v,o,a);ka(b,o,a,m,s.length),d.push(y.jpeg(r))});let[u,f]=(g=ln[o.paper])!=null?g:ln.A4,[p,h]=o.orientation==="landscape"?[f,u]:[u,f];return Sa(d.map(w=>({jpeg:w,width:l,height:c})),p*Kr,h*Kr,o.title)}function Ra(o){if(/^[\x20-\x7e]*$/.test(o))return`(${o.replace(/[\\()]/g,t=>`\\${t}`)})`;let e="FEFF";for(let t=0;t<o.length;t++)e+=o.charCodeAt(t).toString(16).padStart(4,"0").toUpperCase();return`<${e}>`}function Sa(o,e,t,n=""){var b;let r=new TextEncoder,i=[],s=[],a=0,l=v=>{let S=typeof v=="string"?r.encode(v):v;i.push(S),a+=S.length},c=(v,S)=>{s[v]=a,l(`${v} 0 obj
5
5
  `),typeof S=="string"?l(S):S(),l(`
6
6
  endobj
7
7
  `)};l(`%PDF-1.4
8
- `),l(new Uint8Array([37,226,227,207,211,10]));let d=o.length,u=o.map((v,S)=>4+S*3),f=e.toFixed(2),h=t.toFixed(2);c(1,"<< /Type /Catalog /Pages 2 0 R >>"),c(2,`<< /Type /Pages /Count ${d} /Kids [${u.map(v=>`${v} 0 R`).join(" ")}] >>`),c(3,`<< /Producer (FreeGrid)${n?` /Title ${xa(n)}`:""} >>`),o.forEach((v,S)=>{let C=u[S],R=`q ${f} 0 0 ${h} 0 0 cm /Im0 Do Q`;c(C,`<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${f} ${h}] /Resources << /XObject << /Im0 ${C+2} 0 R >> >> /Contents ${C+1} 0 R >>`),c(C+1,`<< /Length ${R.length} >>
8
+ `),l(new Uint8Array([37,226,227,207,211,10]));let d=o.length,u=o.map((v,S)=>4+S*3),f=e.toFixed(2),p=t.toFixed(2);c(1,"<< /Type /Catalog /Pages 2 0 R >>"),c(2,`<< /Type /Pages /Count ${d} /Kids [${u.map(v=>`${v} 0 R`).join(" ")}] >>`),c(3,`<< /Producer (FreeGrid)${n?` /Title ${Ra(n)}`:""} >>`),o.forEach((v,S)=>{let x=u[S],k=`q ${f} 0 0 ${p} 0 0 cm /Im0 Do Q`;c(x,`<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${f} ${p}] /Resources << /XObject << /Im0 ${x+2} 0 R >> >> /Contents ${x+1} 0 R >>`),c(x+1,`<< /Length ${k.length} >>
9
9
  stream
10
- ${R}
11
- endstream`),c(C+2,()=>{l(`<< /Type /XObject /Subtype /Image /Width ${v.width} /Height ${v.height} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${v.jpeg.length} >>
10
+ ${k}
11
+ endstream`),c(x+2,()=>{l(`<< /Type /XObject /Subtype /Image /Width ${v.width} /Height ${v.height} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${v.jpeg.length} >>
12
12
  stream
13
13
  `),l(v.jpeg),l(`
14
- endstream`)})});let p=4+d*3,g=a,w=`xref
15
- 0 ${p}
14
+ endstream`)})});let h=4+d*3,g=a,w=`xref
15
+ 0 ${h}
16
16
  0000000000 65535 f
17
- `;for(let v=1;v<p;v++)w+=`${String((b=s[v])!=null?b:0).padStart(10,"0")} 00000 n
17
+ `;for(let v=1;v<h;v++)w+=`${String((b=s[v])!=null?b:0).padStart(10,"0")} 00000 n
18
18
  `;l(`${w}trailer
19
- << /Size ${p} /Root 1 0 R /Info 3 0 R >>
19
+ << /Size ${h} /Root 1 0 R /Info 3 0 R >>
20
20
  startxref
21
21
  ${g}
22
22
  %%EOF
23
- `);let m=new Uint8Array(a),y=0;for(let v of i)m.set(v,y),y+=v.length;return m}var Ge=o=>typeof o=="number"?Number.isFinite(o)?o:null:typeof o=="string"&&o.trim()!==""&&Number.isFinite(Number(o))?Number(o):o instanceof Date?o.getTime():null,ka=new Set(["top","bottom","aboveAverage","belowAverage","duplicate","unique","dataBar","colorScale","iconSet"]),Yr={arrows:[{char:"\u25B2",color:"#16a34a",label:"up"},{char:"\u25B6",color:"#d97706",label:"level"},{char:"\u25BC",color:"#dc2626",label:"down"}],traffic:[{char:"\u25CF",color:"#16a34a",label:"good"},{char:"\u25CF",color:"#f59e0b",label:"fair"},{char:"\u25CF",color:"#dc2626",label:"poor"}],signs:[{char:"\u2714",color:"#16a34a",label:"good"},{char:"!",color:"#d97706",label:"fair"},{char:"\u2716",color:"#dc2626",label:"poor"}]};function so(o){let e=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());if(!e)return null;let t=e[1].length===3?[...e[1]].map(n=>n+n).join(""):e[1];return[0,2,4].map(n=>parseInt(t.slice(n,n+2),16))}function io(o,e,t){let n=so(o),r=so(e);return!n||!r?t<.5?o:e:`#${n.map((s,a)=>Math.round(s+(r[a]-s)*Math.max(0,Math.min(1,t)))).map(s=>s.toString(16).padStart(2,"0")).join("")}`}function yt(o){return o==null?"":o instanceof Date?o.toISOString():String(o)}function Ra(o,e){var c;let t=(c=o.op)!=null?c:"eq";if(t==="blank")return U(e);if(t==="notBlank")return!U(e);if(t==="contains"||t==="notContains"||t==="startsWith"||t==="endsWith"){let d=yt(e).toLowerCase(),u=yt(o.value).toLowerCase(),f=t==="startsWith"?d.startsWith(u):t==="endsWith"?d.endsWith(u):d.includes(u);return t==="notContains"?!f:f}if(U(e))return t==="ne";let n=Ge(e),r=Ge(o.value),i=Ge(o.valueTo);if(n!==null&&r!==null)switch(t){case"eq":return n===r;case"ne":return n!==r;case"gt":return n>r;case"gte":return n>=r;case"lt":return n<r;case"lte":return n<=r;case"between":case"notBetween":{if(i===null)return!1;let d=n>=Math.min(r,i)&&n<=Math.max(r,i);return t==="between"?d:!d}}let s=yt(e).toLowerCase(),a=yt(o.value).toLowerCase(),l=yt(o.valueTo).toLowerCase();switch(t){case"eq":return s===a;case"ne":return s!==a;case"gt":return s>a;case"gte":return s>=a;case"lt":return s<a;case"lte":return s<=a;case"between":return s>=a&&s<=l;case"notBetween":return s<a||s>l}return!1}var cn=class{constructor(e){this.deps=e;this.stats=new Map;this.statsKey=[];this.rowCache=new WeakMap}dependsOnOtherRows(){return this.deps.rules().some(e=>{var t;return e&&(ka.has((t=e.type)!=null?t:"value")||e.type==="formula")})}fresh(){let e=[this.deps.rows(),this.deps.version(),this.deps.rules()];e.every((t,n)=>t===this.statsKey[n])||(this.statsKey=e,this.stats.clear(),this.rowCache=new WeakMap)}statsOf(e){var n,r,i;let t=this.stats.get(e);if(!t){let s=[],a=new Map;for(let c of this.deps.rows()){let d=this.deps.value(e,c),u=Ge(d);if(u!==null&&s.push(u),!U(d)){let f=ne(d);a.set(f,((n=a.get(f))!=null?n:0)+1)}}s.sort((c,d)=>c-d);let l=s.reduce((c,d)=>c+d,0);t={min:(r=s[0])!=null?r:0,max:(i=s[s.length-1])!=null?i:0,avg:s.length?l/s.length:0,sorted:s,counts:a},this.stats.set(e,t)}return t}test(e,t,n,r){var s,a,l,c;let i=(s=e.type)!=null?s:"value";switch(i){case"value":return Ra(e,n);case"formula":{if(typeof e.formula!="string")return!1;let d=this.deps.formula(e.formula.startsWith("=")?e.formula:`=${e.formula}`,r);return d===!0||typeof d=="number"&&d!==0}case"top":case"bottom":{let d=Ge(n);if(d===null)return!1;let u=this.statsOf(t);if(!u.sorted.length)return!1;let f=Math.max(1,e.percent?Math.ceil(u.sorted.length*((a=e.rank)!=null?a:10)/100):Math.floor((l=e.rank)!=null?l:10));return i==="top"?d>=u.sorted[Math.max(0,u.sorted.length-f)]:d<=u.sorted[Math.min(u.sorted.length-1,f-1)]}case"aboveAverage":case"belowAverage":{let d=Ge(n);if(d===null)return!1;let u=this.statsOf(t).avg;return i==="aboveAverage"?d>u:d<u}case"duplicate":case"unique":{if(U(n))return!1;let d=(c=this.statsOf(t).counts.get(ne(n)))!=null?c:0;return i==="duplicate"?d>1:d===1}}return!1}rowStyle(e){if(this.rowCache.has(e))return this.rowCache.get(e);let t=null;for(let n of this.deps.rules()){if(!(n!=null&&n.row)||!Array.isArray(n.columns)||!n.columns.length)continue;let r=n.columns[0];if(this.test(n,r,this.deps.value(r,e),e)&&(t={...t!=null?t:{},...n.style},n.stopIfTrue))break}return this.rowCache.set(e,t),t}cell(e,t,n){var a,l,c;let r=this.deps.rules();if(!r.length)return null;this.fresh();let i=null,s=this.rowStyle(t);s&&(i={style:{...s}});for(let d of r){if(!d||d.row||!Array.isArray(d.columns)||!d.columns.includes(e))continue;let u=(a=d.type)!=null?a:"value";if(u==="dataBar"||u==="colorScale"||u==="iconSet"){let f=Ge(n);if(f===null)continue;let h=this.statsOf(e),p=typeof d.min=="number"?d.min:h.min,g=typeof d.max=="number"?d.max:h.max,w=g===p?1:Math.max(0,Math.min(1,(f-p)/(g-p)));if(i!=null||(i={style:{}}),u==="dataBar"){let m=p<0&&g>0?-p/(g-p):p>=0?0:1,y=g===p?1:w;i.bar={from:Math.min(m,y),to:Math.max(m,y),color:d.color||"var(--fg-accent)"}}else if(u==="colorScale"){let m=Array.isArray(d.colors)&&d.colors.length>=2?d.colors:["#f8696b","#ffeb84","#63be7b"],y=m.length>=3?w<.5?io(m[0],m[1],w*2):io(m[1],m[2],(w-.5)*2):io(m[0],m[1],w);i.style={...i.style,background:y}}else{let m=(c=Yr[(l=d.icons)!=null?l:"arrows"])!=null?c:Yr.arrows;i.icon=w>=2/3?m[0]:w>=1/3?m[1]:m[2]}continue}if(this.test(d,e,n,t)&&(i!=null||(i={style:{}}),i.style={...i.style,...d.style},d.stopIfTrue))break}return i}};function ao(o){let e=o?so(o):null;return e?`FF${e.map(t=>t.toString(16).padStart(2,"0")).join("").toUpperCase()}`:void 0}var Sa=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i;function un(o){if(typeof o=="number")return o;if(typeof o!="string"||!o)return NaN;let e=o.charCodeAt(0);return e>=48&&e<=57||e===43||e===45||e===46?Sa.test(o)?Number(o):NaN:NaN}function lo(o,e,t){if(typeof o=="number"&&typeof e=="number")return o-e;if(typeof o=="number"||typeof e=="number"){let n=un(o),r=un(e),i=!Number.isNaN(n),s=!Number.isNaN(r);if(i&&s)return n-r;if(i!==s)return i?-1:1}else if(typeof o=="string"&&typeof e=="string"){let n=un(o),r=un(e);if(!Number.isNaN(n)&&!Number.isNaN(r))return n-r;if(!Number.isNaN(n)||!Number.isNaN(r))return Number.isNaN(n)?1:-1}return o instanceof Date&&e instanceof Date?o.getTime()-e.getTime():typeof o=="boolean"&&typeof e=="boolean"?Number(o)-Number(e):t.compare(String(o),String(e))}function Ma(o,e){var t,n;if(U(e))return null;if(o.type==="number"){let r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?null:r}return o.type==="date"?(n=(t=me(e))==null?void 0:t.getTime())!=null?n:null:e}function bt(o,e,t){let n=U(o),r=U(e);return n||r?n===r?0:n?1:-1:lo(o,e,t)}function fn(o,e,t,n){let r=U(o),i=U(e);return r||i?r===i?0:r?1:-1:lo(o,e,t)*n}function Zr(o,e,t,n){let r=e.map(a=>({def:t(a.colId),mul:a.dir==="desc"?-1:1})).filter(a=>!!a.def);if(!r.length)return o;let i=r.map(a=>o.map(l=>{let c=j(a.def,l.data);return a.def.comparator?c:Ma(a.def,c)})),s=o.map((a,l)=>l);return s.sort((a,l)=>{var c;for(let d=0;d<r.length;d++){let{def:u,mul:f}=r[d],h=i[d][a],p=i[d][l],g;if(u.comparator)try{g=(Number(u.comparator(h,p,o[a].data,o[l].data))||0)*f}catch{q(`comparator of column "${(c=u.id)!=null?c:u.field}" threw; treating values as equal`),g=0}else{let w=U(h),m=U(p);g=w||m?w===m?0:w?1:-1:lo(h,p,n)*f}if(g)return g}return a-l}),s.map(a=>o[a])}var Ea=/^[=+\-@\t\r]/;function Qr(o,e=","){let t=n=>{let r=n.value;return n.text&&Ea.test(r)&&(r=`'${r}`),r.includes(e)||/["\r\n]/.test(r)||/^\s|\s$/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return o.map(n=>n.map(t).join(e)).join(`\r
24
- `)}function co(o){let e=o.slice(0,o.search(/\r?\n|$/)),t=s=>e.split(s).length-1,n=t(" "),r=t(";"),i=t(",");return n&&n>=i&&n>=r?" ":r>i?";":","}function pn(o,e=co(o)){return oo(o.replace(/^\uFEFF/,""),e)}var Aa=(()=>{let o=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;o[e]=t>>>0}return o})();function Ta(o){let e=4294967295;for(let t=0;t<o.length;t++)e=Aa[(e^o[t])&255]^e>>>8;return(e^4294967295)>>>0}var ei=new TextEncoder;function ti(o){let e=o.map(d=>{let u=ei.encode(d.name),f=typeof d.data=="string"?ei.encode(d.data):d.data;return{name:u,data:f,crc:Ta(f),offset:0}}),t=e.reduce((d,u)=>d+30+u.name.length+u.data.length,0),n=e.reduce((d,u)=>d+46+u.name.length,0),r=new Uint8Array(t+n+22),i=new DataView(r.buffer),s=0,a=0,l=33;for(let d of e)d.offset=s,i.setUint32(s,67324752,!0),i.setUint16(s+4,20,!0),i.setUint16(s+6,2048,!0),i.setUint16(s+8,0,!0),i.setUint16(s+10,a,!0),i.setUint16(s+12,l,!0),i.setUint32(s+14,d.crc,!0),i.setUint32(s+18,d.data.length,!0),i.setUint32(s+22,d.data.length,!0),i.setUint16(s+26,d.name.length,!0),i.setUint16(s+28,0,!0),r.set(d.name,s+30),r.set(d.data,s+30+d.name.length),s+=30+d.name.length+d.data.length;let c=s;for(let d of e)i.setUint32(s,33639248,!0),i.setUint16(s+4,20,!0),i.setUint16(s+6,20,!0),i.setUint16(s+8,2048,!0),i.setUint16(s+10,0,!0),i.setUint16(s+12,a,!0),i.setUint16(s+14,l,!0),i.setUint32(s+16,d.crc,!0),i.setUint32(s+20,d.data.length,!0),i.setUint32(s+24,d.data.length,!0),i.setUint16(s+28,d.name.length,!0),i.setUint16(s+30,0,!0),i.setUint16(s+32,0,!0),i.setUint16(s+34,0,!0),i.setUint16(s+36,0,!0),i.setUint32(s+38,0,!0),i.setUint32(s+42,d.offset,!0),r.set(d.name,s+46),s+=46+d.name.length;return i.setUint32(s,101010256,!0),i.setUint16(s+8,e.length,!0),i.setUint16(s+10,e.length,!0),i.setUint32(s+12,s-c,!0),i.setUint32(s+16,c,!0),r}var hn=o=>o.length>4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,ni=o=>new Error(`Zip file is too large: it unpacks to more than ${o>=1048576?`${Math.round(o/1048576)} MB`:`${o} bytes`}`);async function La(o,e){if(typeof DecompressionStream=="undefined")throw new Error("This browser cannot read compressed xlsx files (no DecompressionStream)");let n=new Response(o).body.pipeThrough(new DecompressionStream("deflate-raw")).getReader(),r=[],i=0;for(;;){let{done:l,value:c}=await n.read();if(l)break;if(i+=c.length,i>e)throw await n.cancel().catch(()=>{}),ni(e);r.push(c)}let s=new Uint8Array(i),a=0;for(let l of r)s.set(l,a),a+=l.length;return s}async function oi(o,e={}){var u,f;let t=(u=e.maxBytes)!=null?u:209715200,n=(f=e.maxEntries)!=null?f:1e4,r=new DataView(o.buffer,o.byteOffset,o.byteLength),i=-1;for(let h=o.length-22;h>=Math.max(0,o.length-65557);h--)if(r.getUint32(h,!0)===101010256){i=h;break}if(i<0)throw new Error("Not a zip file");let s=r.getUint16(i+10,!0);if(s>n)throw new Error(`Zip file has too many entries (${s}, at most ${n})`);let a=r.getUint32(i+16,!0),l=new TextDecoder,c=new Map,d=0;for(let h=0;h<s;h++){if(r.getUint32(a,!0)!==33639248)throw new Error("Broken zip directory");let p=r.getUint16(a+10,!0),g=r.getUint32(a+20,!0),w=r.getUint16(a+28,!0),m=r.getUint16(a+30,!0),y=r.getUint16(a+32,!0),b=r.getUint32(a+42,!0),v=l.decode(o.subarray(a+46,a+46+w)),S=r.getUint16(b+26,!0),C=r.getUint16(b+28,!0),R=b+30+S+C,A=o.subarray(R,R+g),x;if(p===0)x=A;else if(p===8)x=await La(A,t-d);else throw new Error(`Unsupported zip compression ${p}`);if(d+=x.length,d>t)throw ni(t);c.set(v,x),a+=46+w+m+y}return c}function uo(o){let e="";for(let t=o+1;t>0;t=Math.floor((t-1)/26))e=String.fromCharCode(65+(t-1)%26)+e;return e}var ri=Date.UTC(1899,11,30),ii=864e5;function Pa(o){return(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds())-ri)/ii}function Fa(o){let e=new Date(Math.round(o*ii)+ri);return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}var Ia=/[\u0000-\u0008\u000b\u000c\u000e-\u001f￾￿]/g,mn=o=>o.replace(Ia,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),et=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
25
- `,fo="http://schemas.openxmlformats.org/spreadsheetml/2006/main",tt="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function Da(o){let e=new Set;return o.map((t,n)=>{var s;let r=((s=t.name)!=null?s:`Sheet${n+1}`).replace(/[[\]:*?/\\]/g," ").slice(0,31).trim()||`Sheet${n+1}`,i=r;for(let a=2;e.has(i.toLowerCase());a++)i=`${r.slice(0,31-` (${a})`.length)} (${a})`;return e.add(i.toLowerCase()),i})}function ze(o){let e=new Map([["General",0]]),t=[],n=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'],r=new Map([["General||||",0]]),i=['<font><sz val="11"/><name val="Calibri"/></font>','<font><b/><sz val="11"/><name val="Calibri"/></font>'],s=new Map([["0|",0],["1|",1]]),a=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>','<fill><patternFill patternType="solid"><fgColor rgb="FFF2F4F7"/><bgColor indexed="64"/></patternFill></fill>'],l=new Map([["FFF2F4F7",2]]),c=m=>m&&/^[0-9a-f]{8}$/i.test(m)?m.toUpperCase():m&&/^[0-9a-f]{6}$/i.test(m)?`FF${m.toUpperCase()}`:"",d=(m,y)=>{let b=`${m?1:0}|${y}`,v=s.get(b);return v===void 0&&(v=i.length,i.push(`<font>${m?"<b/>":""}<sz val="11"/>${y?`<color rgb="${y}"/>`:""}<name val="Calibri"/></font>`),s.set(b,v)),v},u=m=>{if(!m)return 0;let y=l.get(m);return y===void 0&&(y=a.length,a.push(`<fill><patternFill patternType="solid"><fgColor rgb="${m}"/><bgColor indexed="64"/></patternFill></fill>`),l.set(m,y)),y},f=(m,y)=>{let b=c(y.color),v=y.header?"FFF2F4F7":c(y.fill),S=!!(y.bold||y.header),C=y.align==="left"||y.align==="center"||y.align==="right"?y.align:"",R=`${m}|${S?1:""}|${b}|${v}|${C}`,A=r.get(R);if(A!==void 0)return A;let x=e.get(m);x===void 0&&(x=164+t.length,t.push(m),e.set(m,x));let M=d(S,b),T=u(v),E=`numFmtId="${x}" fontId="${M}" fillId="${T}" borderId="0" xfId="0"`+(x?' applyNumberFormat="1"':"")+(M?' applyFont="1"':"")+(T?' applyFill="1"':"")+(C?' applyAlignment="1"':"");return A=n.length,n.push(C?`<xf ${E}><alignment horizontal="${C}"/></xf>`:`<xf ${E}/>`),r.set(R,A),A},h=Da(o),p=o.map(m=>{var M,T,E;let y=m.rows.map((L,F)=>{let $=L.map((D,N)=>{var J;let P=D!==null&&typeof D=="object"&&!(D instanceof Date)?D:{v:D},B=`${uo(N)}${F+1}`,O=P.v,z=(J=P.fmt)!=null?J:"General";O instanceof Date&&(Number.isNaN(O.getTime())?O=null:(z==="General"&&(z="yyyy-mm-dd"),O=Pa(O)));let V=f(z,P),_=V?` s="${V}"`:"";return O==null||O===""?_?`<c r="${B}"${_}/>`:"":typeof O=="number"?Number.isFinite(O)?`<c r="${B}"${_}><v>${O}</v></c>`:"":typeof O=="boolean"?`<c r="${B}"${_} t="b"><v>${O?1:0}</v></c>`:`<c r="${B}"${_} t="inlineStr"><is><t xml:space="preserve">${mn(String(O))}</t></is></c>`}).join("");return`<row r="${F+1}">${$}</row>`}).join(""),b=Math.max(0,...m.rows.map(L=>L.length)),v=(M=m.freezeRows)!=null?M:0,S=v?`<sheetViews><sheetView workbookViewId="0"><pane ySplit="${v}" topLeftCell="A${v+1}" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>`:'<sheetViews><sheetView workbookViewId="0"/></sheetViews>',C=(T=m.widths)!=null&&T.length?`<cols>${m.widths.map((L,F)=>`<col min="${F+1}" max="${F+1}" width="${Math.max(4,Math.min(120,L)).toFixed(1)}" customWidth="1"/>`).join("")}</cols>`:"",R=m.autoFilter&&b&&v&&m.rows.length>=v?`<autoFilter ref="A${v}:${uo(b-1)}${m.rows.length}"/>`:"",A=((E=m.merges)!=null?E:[]).filter(L=>typeof L=="string"&&/^[A-Z]{1,3}\d{1,7}:[A-Z]{1,3}\d{1,7}$/.test(L)),x=A.length?`<mergeCells count="${A.length}">${A.map(L=>`<mergeCell ref="${L}"/>`).join("")}</mergeCells>`:"";return`${et}<worksheet xmlns="${fo}" xmlns:r="${tt}">${S}<sheetFormatPr defaultRowHeight="15"/>${C}<sheetData>${y}</sheetData>${R}${x}</worksheet>`}),g=`${et}<styleSheet xmlns="${fo}">`+(t.length?`<numFmts count="${t.length}">${t.map((m,y)=>`<numFmt numFmtId="${164+y}" formatCode="${mn(m)}"/>`).join("")}</numFmts>`:"")+`<fonts count="${i.length}">${i.join("")}</fonts><fills count="${a.length}">${a.join("")}</fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${n.length}">${n.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`,w=[{name:"[Content_Types].xml",data:`${et}<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/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>`+o.map((m,y)=>`<Override PartName="/xl/worksheets/sheet${y+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")+"</Types>"},{name:"_rels/.rels",data:`${et}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${tt}/officeDocument" Target="xl/workbook.xml"/></Relationships>`},{name:"xl/workbook.xml",data:`${et}<workbook xmlns="${fo}" xmlns:r="${tt}"><sheets>`+h.map((m,y)=>`<sheet name="${mn(m)}" sheetId="${y+1}" r:id="rId${y+1}"/>`).join("")+"</sheets>"+(o.some(m=>m.autoFilter&&m.freezeRows||m.printTitleRows)?`<definedNames>${o.map((m,y)=>{var A;let b=Math.max(0,...m.rows.map(x=>x.length)),v=`'${mn(h[y].replace(/'/g,"''"))}'`,S=m.autoFilter&&m.freezeRows&&b?`<definedName name="_xlnm._FilterDatabase" localSheetId="${y}" hidden="1">${v}!$A$${m.freezeRows}:$${uo(b-1)}$${m.rows.length}</definedName>`:"",C=Math.min((A=m.printTitleRows)!=null?A:0,m.rows.length),R=C>0&&Number.isInteger(C)?`<definedName name="_xlnm.Print_Titles" localSheetId="${y}">${v}!$1:$${C}</definedName>`:"";return S+R}).join("")}</definedNames>`:"")+"</workbook>"},{name:"xl/_rels/workbook.xml.rels",data:`${et}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+o.map((m,y)=>`<Relationship Id="rId${y+1}" Type="${tt}/worksheet" Target="worksheets/sheet${y+1}.xml"/>`).join("")+`<Relationship Id="rId${o.length+1}" Type="${tt}/styles" Target="styles.xml"/></Relationships>`},{name:"xl/styles.xml",data:g},...p.map((m,y)=>({name:`xl/worksheets/sheet${y+1}.xml`,data:m}))];return ti(w)}var $a=new Set([14,15,16,17,18,19,20,21,22,27,30,36,45,46,47,50,57]);function Na(o){let e=o.replace(/"[^"]*"/g,"").replace(/\[[^\]]*\]/g,"").replace(/\\./g,"");return/[dmyhs]/i.test(e)&&!/^[#0.,%\s]*$/.test(e)}function vt(o){return o?new DOMParser().parseFromString(new TextDecoder().decode(o),"application/xml"):null}var be=(o,e)=>[...o.getElementsByTagNameNS("*",e)];function Oa(o){let e=0;for(let t of o){let n=t.charCodeAt(0);if(n<65||n>90)break;e=e*26+(n-64)}return e-1}var Ba=1048576,Ha=16384;async function gn(o){var h,p,g,w,m,y,b,v,S;let e=o instanceof Uint8Array?o:new Uint8Array(o);if(!hn(e))throw new Error("Not an xlsx file");let t=await oi(e),n=vt(t.get("xl/workbook.xml"));if(!n)throw new Error("xlsx has no workbook");let r=vt(t.get("xl/_rels/workbook.xml.rels")),i=new Map(r?be(r,"Relationship").map(C=>{var R,A;return[(R=C.getAttribute("Id"))!=null?R:"",(A=C.getAttribute("Target"))!=null?A:""]}):[]),s=vt(t.get("xl/sharedStrings.xml")),a=s?be(s,"si").map(C=>be(C,"t").map(R=>{var A;return(A=R.textContent)!=null?A:""}).join("")):[],l=vt(t.get("xl/styles.xml")),c=new Map(l?be(l,"numFmt").map(C=>{var R;return[Number(C.getAttribute("numFmtId")),(R=C.getAttribute("formatCode"))!=null?R:""]}):[]),d=l?be(l,"cellXfs")[0]:void 0,u=(d?[...d.children].filter(C=>C.localName==="xf"):[]).map(C=>{var A;let R=Number((A=C.getAttribute("numFmtId"))!=null?A:0);return $a.has(R)||c.has(R)&&Na(c.get(R))}),f=[];for(let C of be(n,"sheet")){let R=(p=(h=C.getAttribute("r:id"))!=null?h:C.getAttributeNS(tt,"id"))!=null?p:"",A=(g=i.get(R))!=null?g:"";A=A.startsWith("/")?A.slice(1):`xl/${A}`;let x=vt(t.get(A)),M=[];if(x){for(let T of be(x,"row")){let E=Number((w=T.getAttribute("r"))!=null?w:M.length+1)-1;if(!Number.isInteger(E)||E<0||E>=Ba)continue;let L=[],F=0;for(let $ of[...T.children].filter(D=>D.localName==="c")){let D=$.getAttribute("r"),N=D?Oa(D):F;if(N<0||N>=Ha)continue;F=N+1;let P=$.getAttribute("t"),B=(y=(m=be($,"v")[0])==null?void 0:m.textContent)!=null?y:null,O=null;if(P==="s")O=B===null?null:(b=a[Number(B)])!=null?b:"";else if(P==="inlineStr")O=be($,"t").map(z=>{var V;return(V=z.textContent)!=null?V:""}).join("");else if(P==="b")O=B==="1";else if(P==="str"||P==="e")O=B;else if(B!==null&&B!==""){let z=Number(B);O=u[Number((v=$.getAttribute("s"))!=null?v:0)]?Fa(z):z}L[N]=O}for(let $=0;$<L.length;$++)L[$]===void 0&&(L[$]=null);M[E]=L}for(let T=0;T<M.length;T++)M[T]||(M[T]=[])}f.push({name:(S=C.getAttribute("name"))!=null?S:`Sheet${f.length+1}`,rows:M})}return f}function vn(o,e){return Array.isArray(e)?e.flatMap(t=>{var r,i;let n=o.columns.getNode(t);return!n||n.children||H(t)?(q(`export: unknown column "${t}"`),[]):[{id:t,def:n.def,node:n,width:(i=(r=o.columns.getColumn(t))==null?void 0:r.width)!=null?i:n.width}]}):o.columns.displayed().filter(t=>!H(t.id)).map(t=>({id:t.id,def:t.def,node:t.node,width:t.width}))}function xn(o,e){return e==="selected"?o.selectedRows():e==="all"?o.rowModel.server?o.rowModel.dataRows().map(t=>t.data):o.viewRows():o.rowModel.dataRows().map(t=>t.data)}var Ve=(o,e)=>{var t,n;return(n=(t=o.header)!=null?t:o.field)!=null?n:e},Ga=["left","center","right"],za=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,ve=o=>String(o!=null?o:"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e]),Va=["A4","A3","A5","B4","B5","letter","legal"],qa=760,Wa=o=>`"${o.replace(/[\\"<\n\r]/g,e=>e===`
26
- `?"\\A ":e==="\r"?"":`\\${e.charCodeAt(0).toString(16)} `)}"`,si=o=>o?`#${o.slice(2)}`:"";function ja(o,e,t){let n=[],r=0,i=o.store.state.sort,s=o.collator(),a=(l,c)=>{var p,g;if(c>=t.length){for(let w of l)n.push({kind:"row",row:w,n:++r});return}let d=t[c],u=(p=o.columns.getNode(d))==null?void 0:p.def;if(!u)return a(l,c+1);let f=new Map;for(let w of l){let m=j(u,w),y=U(m)?"":ne(m),b=f.get(y);b||f.set(y,b={value:m,rows:[]}),b.rows.push(w)}let h=((g=i.find(w=>w.colId===d))==null?void 0:g.dir)==="desc"?-1:1;for(let w of[...f.values()].sort((m,y)=>fn(m.value,y.value,s,h)))n.push({kind:"group",colId:d,value:w.value,rows:w.rows,level:c}),a(w.rows,c+1)};return a(e,0),n}var Ua=`
23
+ `);let m=new Uint8Array(a),y=0;for(let v of i)m.set(v,y),y+=v.length;return m}var ze=o=>typeof o=="number"?Number.isFinite(o)?o:null:typeof o=="string"&&o.trim()!==""&&Number.isFinite(Number(o))?Number(o):o instanceof Date?o.getTime():null,Ma=new Set(["top","bottom","aboveAverage","belowAverage","duplicate","unique","dataBar","colorScale","iconSet"]),Yr={arrows:[{char:"\u25B2",color:"#16a34a",label:"up"},{char:"\u25B6",color:"#d97706",label:"level"},{char:"\u25BC",color:"#dc2626",label:"down"}],traffic:[{char:"\u25CF",color:"#16a34a",label:"good"},{char:"\u25CF",color:"#f59e0b",label:"fair"},{char:"\u25CF",color:"#dc2626",label:"poor"}],signs:[{char:"\u2714",color:"#16a34a",label:"good"},{char:"!",color:"#d97706",label:"fair"},{char:"\u2716",color:"#dc2626",label:"poor"}]};function so(o){let e=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());if(!e)return null;let t=e[1].length===3?[...e[1]].map(n=>n+n).join(""):e[1];return[0,2,4].map(n=>parseInt(t.slice(n,n+2),16))}function io(o,e,t){let n=so(o),r=so(e);return!n||!r?t<.5?o:e:`#${n.map((s,a)=>Math.round(s+(r[a]-s)*Math.max(0,Math.min(1,t)))).map(s=>s.toString(16).padStart(2,"0")).join("")}`}function yt(o){return o==null?"":o instanceof Date?o.toISOString():String(o)}function Ea(o,e){var c;let t=(c=o.op)!=null?c:"eq";if(t==="blank")return K(e);if(t==="notBlank")return!K(e);if(t==="contains"||t==="notContains"||t==="startsWith"||t==="endsWith"){let d=yt(e).toLowerCase(),u=yt(o.value).toLowerCase(),f=t==="startsWith"?d.startsWith(u):t==="endsWith"?d.endsWith(u):d.includes(u);return t==="notContains"?!f:f}if(K(e))return t==="ne";let n=ze(e),r=ze(o.value),i=ze(o.valueTo);if(n!==null&&r!==null)switch(t){case"eq":return n===r;case"ne":return n!==r;case"gt":return n>r;case"gte":return n>=r;case"lt":return n<r;case"lte":return n<=r;case"between":case"notBetween":{if(i===null)return!1;let d=n>=Math.min(r,i)&&n<=Math.max(r,i);return t==="between"?d:!d}}let s=yt(e).toLowerCase(),a=yt(o.value).toLowerCase(),l=yt(o.valueTo).toLowerCase();switch(t){case"eq":return s===a;case"ne":return s!==a;case"gt":return s>a;case"gte":return s>=a;case"lt":return s<a;case"lte":return s<=a;case"between":return s>=a&&s<=l;case"notBetween":return s<a||s>l}return!1}var un=class{constructor(e){this.deps=e;this.stats=new Map;this.statsKey=[];this.rowCache=new WeakMap}dependsOnOtherRows(){return this.deps.rules().some(e=>{var t;return e&&(Ma.has((t=e.type)!=null?t:"value")||e.type==="formula")})}fresh(){let e=[this.deps.rows(),this.deps.version(),this.deps.rules()];e.every((t,n)=>t===this.statsKey[n])||(this.statsKey=e,this.stats.clear(),this.rowCache=new WeakMap)}statsOf(e){var n,r,i;let t=this.stats.get(e);if(!t){let s=[],a=new Map;for(let c of this.deps.rows()){let d=this.deps.value(e,c),u=ze(d);if(u!==null&&s.push(u),!K(d)){let f=ne(d);a.set(f,((n=a.get(f))!=null?n:0)+1)}}s.sort((c,d)=>c-d);let l=s.reduce((c,d)=>c+d,0);t={min:(r=s[0])!=null?r:0,max:(i=s[s.length-1])!=null?i:0,avg:s.length?l/s.length:0,sorted:s,counts:a},this.stats.set(e,t)}return t}test(e,t,n,r){var s,a,l,c;let i=(s=e.type)!=null?s:"value";switch(i){case"value":return Ea(e,n);case"formula":{if(typeof e.formula!="string")return!1;let d=this.deps.formula(e.formula.startsWith("=")?e.formula:`=${e.formula}`,r);return d===!0||typeof d=="number"&&d!==0}case"top":case"bottom":{let d=ze(n);if(d===null)return!1;let u=this.statsOf(t);if(!u.sorted.length)return!1;let f=Math.max(1,e.percent?Math.ceil(u.sorted.length*((a=e.rank)!=null?a:10)/100):Math.floor((l=e.rank)!=null?l:10));return i==="top"?d>=u.sorted[Math.max(0,u.sorted.length-f)]:d<=u.sorted[Math.min(u.sorted.length-1,f-1)]}case"aboveAverage":case"belowAverage":{let d=ze(n);if(d===null)return!1;let u=this.statsOf(t).avg;return i==="aboveAverage"?d>u:d<u}case"duplicate":case"unique":{if(K(n))return!1;let d=(c=this.statsOf(t).counts.get(ne(n)))!=null?c:0;return i==="duplicate"?d>1:d===1}}return!1}rowStyle(e){if(this.rowCache.has(e))return this.rowCache.get(e);let t=null;for(let n of this.deps.rules()){if(!(n!=null&&n.row)||!Array.isArray(n.columns)||!n.columns.length)continue;let r=n.columns[0];if(this.test(n,r,this.deps.value(r,e),e)&&(t={...t!=null?t:{},...n.style},n.stopIfTrue))break}return this.rowCache.set(e,t),t}cell(e,t,n){var a,l,c;let r=this.deps.rules();if(!r.length)return null;this.fresh();let i=null,s=this.rowStyle(t);s&&(i={style:{...s}});for(let d of r){if(!d||d.row||!Array.isArray(d.columns)||!d.columns.includes(e))continue;let u=(a=d.type)!=null?a:"value";if(u==="dataBar"||u==="colorScale"||u==="iconSet"){let f=ze(n);if(f===null)continue;let p=this.statsOf(e),h=typeof d.min=="number"?d.min:p.min,g=typeof d.max=="number"?d.max:p.max,w=g===h?1:Math.max(0,Math.min(1,(f-h)/(g-h)));if(i!=null||(i={style:{}}),u==="dataBar"){let m=h<0&&g>0?-h/(g-h):h>=0?0:1,y=g===h?1:w;i.bar={from:Math.min(m,y),to:Math.max(m,y),color:d.color||"var(--fg-accent)"}}else if(u==="colorScale"){let m=Array.isArray(d.colors)&&d.colors.length>=2?d.colors:["#f8696b","#ffeb84","#63be7b"],y=m.length>=3?w<.5?io(m[0],m[1],w*2):io(m[1],m[2],(w-.5)*2):io(m[0],m[1],w);i.style={...i.style,background:y}}else{let m=(c=Yr[(l=d.icons)!=null?l:"arrows"])!=null?c:Yr.arrows;i.icon=w>=2/3?m[0]:w>=1/3?m[1]:m[2]}continue}if(this.test(d,e,n,t)&&(i!=null||(i={style:{}}),i.style={...i.style,...d.style},d.stopIfTrue))break}return i}};function ao(o){let e=o?so(o):null;return e?`FF${e.map(t=>t.toString(16).padStart(2,"0")).join("").toUpperCase()}`:void 0}var Aa=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i;function fn(o){if(typeof o=="number")return o;if(typeof o!="string"||!o)return NaN;let e=o.charCodeAt(0);return e>=48&&e<=57||e===43||e===45||e===46?Aa.test(o)?Number(o):NaN:NaN}function lo(o,e,t){if(typeof o=="number"&&typeof e=="number")return o-e;if(typeof o=="number"||typeof e=="number"){let n=fn(o),r=fn(e),i=!Number.isNaN(n),s=!Number.isNaN(r);if(i&&s)return n-r;if(i!==s)return i?-1:1}else if(typeof o=="string"&&typeof e=="string"){let n=fn(o),r=fn(e);if(!Number.isNaN(n)&&!Number.isNaN(r))return n-r;if(!Number.isNaN(n)||!Number.isNaN(r))return Number.isNaN(n)?1:-1}return o instanceof Date&&e instanceof Date?o.getTime()-e.getTime():typeof o=="boolean"&&typeof e=="boolean"?Number(o)-Number(e):t.compare(String(o),String(e))}function Ta(o,e){var t,n;if(K(e))return null;if(o.type==="number"){let r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?null:r}return o.type==="date"?(n=(t=me(e))==null?void 0:t.getTime())!=null?n:null:e}function bt(o,e,t){let n=K(o),r=K(e);return n||r?n===r?0:n?1:-1:lo(o,e,t)}function pn(o,e,t,n){let r=K(o),i=K(e);return r||i?r===i?0:r?1:-1:lo(o,e,t)*n}function Zr(o,e,t,n){let r=e.map(a=>({def:t(a.colId),mul:a.dir==="desc"?-1:1})).filter(a=>!!a.def);if(!r.length)return o;let i=r.map(a=>o.map(l=>{let c=j(a.def,l.data);return a.def.comparator?c:Ta(a.def,c)})),s=o.map((a,l)=>l);return s.sort((a,l)=>{var c;for(let d=0;d<r.length;d++){let{def:u,mul:f}=r[d],p=i[d][a],h=i[d][l],g;if(u.comparator)try{g=(Number(u.comparator(p,h,o[a].data,o[l].data))||0)*f}catch{V(`comparator of column "${(c=u.id)!=null?c:u.field}" threw; treating values as equal`),g=0}else{let w=K(p),m=K(h);g=w||m?w===m?0:w?1:-1:lo(p,h,n)*f}if(g)return g}return a-l}),s.map(a=>o[a])}var La=/^[=+\-@\t\r]/;function Qr(o,e=","){let t=n=>{let r=n.value;return n.text&&La.test(r)&&(r=`'${r}`),r.includes(e)||/["\r\n]/.test(r)||/^\s|\s$/.test(r)?`"${r.replace(/"/g,'""')}"`:r};return o.map(n=>n.map(t).join(e)).join(`\r
24
+ `)}function co(o){let e=o.slice(0,o.search(/\r?\n|$/)),t=s=>e.split(s).length-1,n=t(" "),r=t(";"),i=t(",");return n&&n>=i&&n>=r?" ":r>i?";":","}function hn(o,e=co(o)){return oo(o.replace(/^\uFEFF/,""),e)}var Pa=(()=>{let o=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;o[e]=t>>>0}return o})();function Fa(o){let e=4294967295;for(let t=0;t<o.length;t++)e=Pa[(e^o[t])&255]^e>>>8;return(e^4294967295)>>>0}var ei=new TextEncoder;function ti(o){let e=o.map(d=>{let u=ei.encode(d.name),f=typeof d.data=="string"?ei.encode(d.data):d.data;return{name:u,data:f,crc:Fa(f),offset:0}}),t=e.reduce((d,u)=>d+30+u.name.length+u.data.length,0),n=e.reduce((d,u)=>d+46+u.name.length,0),r=new Uint8Array(t+n+22),i=new DataView(r.buffer),s=0,a=0,l=33;for(let d of e)d.offset=s,i.setUint32(s,67324752,!0),i.setUint16(s+4,20,!0),i.setUint16(s+6,2048,!0),i.setUint16(s+8,0,!0),i.setUint16(s+10,a,!0),i.setUint16(s+12,l,!0),i.setUint32(s+14,d.crc,!0),i.setUint32(s+18,d.data.length,!0),i.setUint32(s+22,d.data.length,!0),i.setUint16(s+26,d.name.length,!0),i.setUint16(s+28,0,!0),r.set(d.name,s+30),r.set(d.data,s+30+d.name.length),s+=30+d.name.length+d.data.length;let c=s;for(let d of e)i.setUint32(s,33639248,!0),i.setUint16(s+4,20,!0),i.setUint16(s+6,20,!0),i.setUint16(s+8,2048,!0),i.setUint16(s+10,0,!0),i.setUint16(s+12,a,!0),i.setUint16(s+14,l,!0),i.setUint32(s+16,d.crc,!0),i.setUint32(s+20,d.data.length,!0),i.setUint32(s+24,d.data.length,!0),i.setUint16(s+28,d.name.length,!0),i.setUint16(s+30,0,!0),i.setUint16(s+32,0,!0),i.setUint16(s+34,0,!0),i.setUint16(s+36,0,!0),i.setUint32(s+38,0,!0),i.setUint32(s+42,d.offset,!0),r.set(d.name,s+46),s+=46+d.name.length;return i.setUint32(s,101010256,!0),i.setUint16(s+8,e.length,!0),i.setUint16(s+10,e.length,!0),i.setUint32(s+12,s-c,!0),i.setUint32(s+16,c,!0),r}var mn=o=>o.length>4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,ni=o=>new Error(`Zip file is too large: it unpacks to more than ${o>=1048576?`${Math.round(o/1048576)} MB`:`${o} bytes`}`);async function Ia(o,e){if(typeof DecompressionStream=="undefined")throw new Error("This browser cannot read compressed xlsx files (no DecompressionStream)");let n=new Response(o).body.pipeThrough(new DecompressionStream("deflate-raw")).getReader(),r=[],i=0;for(;;){let{done:l,value:c}=await n.read();if(l)break;if(i+=c.length,i>e)throw await n.cancel().catch(()=>{}),ni(e);r.push(c)}let s=new Uint8Array(i),a=0;for(let l of r)s.set(l,a),a+=l.length;return s}async function oi(o,e={}){var u,f;let t=(u=e.maxBytes)!=null?u:209715200,n=(f=e.maxEntries)!=null?f:1e4,r=new DataView(o.buffer,o.byteOffset,o.byteLength),i=-1;for(let p=o.length-22;p>=Math.max(0,o.length-65557);p--)if(r.getUint32(p,!0)===101010256){i=p;break}if(i<0)throw new Error("Not a zip file");let s=r.getUint16(i+10,!0);if(s>n)throw new Error(`Zip file has too many entries (${s}, at most ${n})`);let a=r.getUint32(i+16,!0),l=new TextDecoder,c=new Map,d=0;for(let p=0;p<s;p++){if(r.getUint32(a,!0)!==33639248)throw new Error("Broken zip directory");let h=r.getUint16(a+10,!0),g=r.getUint32(a+20,!0),w=r.getUint16(a+28,!0),m=r.getUint16(a+30,!0),y=r.getUint16(a+32,!0),b=r.getUint32(a+42,!0),v=l.decode(o.subarray(a+46,a+46+w)),S=r.getUint16(b+26,!0),x=r.getUint16(b+28,!0),k=b+30+S+x,E=o.subarray(k,k+g),L;if(h===0)L=E;else if(h===8)L=await Ia(E,t-d);else throw new Error(`Unsupported zip compression ${h}`);if(d+=L.length,d>t)throw ni(t);c.set(v,L),a+=46+w+m+y}return c}function uo(o){let e="";for(let t=o+1;t>0;t=Math.floor((t-1)/26))e=String.fromCharCode(65+(t-1)%26)+e;return e}var ri=Date.UTC(1899,11,30),ii=864e5;function Da(o){return(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds())-ri)/ii}function $a(o){let e=new Date(Math.round(o*ii)+ri);return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}var Na=/[\u0000-\u0008\u000b\u000c\u000e-\u001f￾￿]/g,gn=o=>o.replace(Na,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),et=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
25
+ `,fo="http://schemas.openxmlformats.org/spreadsheetml/2006/main",tt="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function Oa(o){let e=new Set;return o.map((t,n)=>{var s;let r=((s=t.name)!=null?s:`Sheet${n+1}`).replace(/[[\]:*?/\\]/g," ").slice(0,31).trim()||`Sheet${n+1}`,i=r;for(let a=2;e.has(i.toLowerCase());a++)i=`${r.slice(0,31-` (${a})`.length)} (${a})`;return e.add(i.toLowerCase()),i})}function Ve(o){let e=new Map([["General",0]]),t=[],n=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'],r=new Map([["General||||",0]]),i=['<font><sz val="11"/><name val="Calibri"/></font>','<font><b/><sz val="11"/><name val="Calibri"/></font>'],s=new Map([["0|",0],["1|",1]]),a=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>','<fill><patternFill patternType="solid"><fgColor rgb="FFF2F4F7"/><bgColor indexed="64"/></patternFill></fill>'],l=new Map([["FFF2F4F7",2]]),c=m=>m&&/^[0-9a-f]{8}$/i.test(m)?m.toUpperCase():m&&/^[0-9a-f]{6}$/i.test(m)?`FF${m.toUpperCase()}`:"",d=(m,y)=>{let b=`${m?1:0}|${y}`,v=s.get(b);return v===void 0&&(v=i.length,i.push(`<font>${m?"<b/>":""}<sz val="11"/>${y?`<color rgb="${y}"/>`:""}<name val="Calibri"/></font>`),s.set(b,v)),v},u=m=>{if(!m)return 0;let y=l.get(m);return y===void 0&&(y=a.length,a.push(`<fill><patternFill patternType="solid"><fgColor rgb="${m}"/><bgColor indexed="64"/></patternFill></fill>`),l.set(m,y)),y},f=(m,y)=>{let b=c(y.color),v=y.header?"FFF2F4F7":c(y.fill),S=!!(y.bold||y.header),x=y.align==="left"||y.align==="center"||y.align==="right"?y.align:"",k=`${m}|${S?1:""}|${b}|${v}|${x}`,E=r.get(k);if(E!==void 0)return E;let L=e.get(m);L===void 0&&(L=164+t.length,t.push(m),e.set(m,L));let R=d(S,b),M=u(v),T=`numFmtId="${L}" fontId="${R}" fillId="${M}" borderId="0" xfId="0"`+(L?' applyNumberFormat="1"':"")+(R?' applyFont="1"':"")+(M?' applyFill="1"':"")+(x?' applyAlignment="1"':"");return E=n.length,n.push(x?`<xf ${T}><alignment horizontal="${x}"/></xf>`:`<xf ${T}/>`),r.set(k,E),E},p=Oa(o),h=o.map(m=>{var R,M,T;let y=m.rows.map((A,F)=>{let $=A.map((D,O)=>{var X;let P=D!==null&&typeof D=="object"&&!(D instanceof Date)?D:{v:D},N=`${uo(O)}${F+1}`,B=P.v,z=(X=P.fmt)!=null?X:"General";B instanceof Date&&(Number.isNaN(B.getTime())?B=null:(z==="General"&&(z="yyyy-mm-dd"),B=Da(B)));let W=f(z,P),U=W?` s="${W}"`:"";return B==null||B===""?U?`<c r="${N}"${U}/>`:"":typeof B=="number"?Number.isFinite(B)?`<c r="${N}"${U}><v>${B}</v></c>`:"":typeof B=="boolean"?`<c r="${N}"${U} t="b"><v>${B?1:0}</v></c>`:`<c r="${N}"${U} t="inlineStr"><is><t xml:space="preserve">${gn(String(B))}</t></is></c>`}).join("");return`<row r="${F+1}">${$}</row>`}).join(""),b=Math.max(0,...m.rows.map(A=>A.length)),v=(R=m.freezeRows)!=null?R:0,S=v?`<sheetViews><sheetView workbookViewId="0"><pane ySplit="${v}" topLeftCell="A${v+1}" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>`:'<sheetViews><sheetView workbookViewId="0"/></sheetViews>',x=(M=m.widths)!=null&&M.length?`<cols>${m.widths.map((A,F)=>`<col min="${F+1}" max="${F+1}" width="${Math.max(4,Math.min(120,A)).toFixed(1)}" customWidth="1"/>`).join("")}</cols>`:"",k=m.autoFilter&&b&&v&&m.rows.length>=v?`<autoFilter ref="A${v}:${uo(b-1)}${m.rows.length}"/>`:"",E=((T=m.merges)!=null?T:[]).filter(A=>typeof A=="string"&&/^[A-Z]{1,3}\d{1,7}:[A-Z]{1,3}\d{1,7}$/.test(A)),L=E.length?`<mergeCells count="${E.length}">${E.map(A=>`<mergeCell ref="${A}"/>`).join("")}</mergeCells>`:"";return`${et}<worksheet xmlns="${fo}" xmlns:r="${tt}">${S}<sheetFormatPr defaultRowHeight="15"/>${x}<sheetData>${y}</sheetData>${k}${L}</worksheet>`}),g=`${et}<styleSheet xmlns="${fo}">`+(t.length?`<numFmts count="${t.length}">${t.map((m,y)=>`<numFmt numFmtId="${164+y}" formatCode="${gn(m)}"/>`).join("")}</numFmts>`:"")+`<fonts count="${i.length}">${i.join("")}</fonts><fills count="${a.length}">${a.join("")}</fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${n.length}">${n.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`,w=[{name:"[Content_Types].xml",data:`${et}<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/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>`+o.map((m,y)=>`<Override PartName="/xl/worksheets/sheet${y+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")+"</Types>"},{name:"_rels/.rels",data:`${et}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${tt}/officeDocument" Target="xl/workbook.xml"/></Relationships>`},{name:"xl/workbook.xml",data:`${et}<workbook xmlns="${fo}" xmlns:r="${tt}"><sheets>`+p.map((m,y)=>`<sheet name="${gn(m)}" sheetId="${y+1}" r:id="rId${y+1}"/>`).join("")+"</sheets>"+(o.some(m=>m.autoFilter&&m.freezeRows||m.printTitleRows)?`<definedNames>${o.map((m,y)=>{var E;let b=Math.max(0,...m.rows.map(L=>L.length)),v=`'${gn(p[y].replace(/'/g,"''"))}'`,S=m.autoFilter&&m.freezeRows&&b?`<definedName name="_xlnm._FilterDatabase" localSheetId="${y}" hidden="1">${v}!$A$${m.freezeRows}:$${uo(b-1)}$${m.rows.length}</definedName>`:"",x=Math.min((E=m.printTitleRows)!=null?E:0,m.rows.length),k=x>0&&Number.isInteger(x)?`<definedName name="_xlnm.Print_Titles" localSheetId="${y}">${v}!$1:$${x}</definedName>`:"";return S+k}).join("")}</definedNames>`:"")+"</workbook>"},{name:"xl/_rels/workbook.xml.rels",data:`${et}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+o.map((m,y)=>`<Relationship Id="rId${y+1}" Type="${tt}/worksheet" Target="worksheets/sheet${y+1}.xml"/>`).join("")+`<Relationship Id="rId${o.length+1}" Type="${tt}/styles" Target="styles.xml"/></Relationships>`},{name:"xl/styles.xml",data:g},...h.map((m,y)=>({name:`xl/worksheets/sheet${y+1}.xml`,data:m}))];return ti(w)}var Ba=new Set([14,15,16,17,18,19,20,21,22,27,30,36,45,46,47,50,57]);function Ha(o){let e=o.replace(/"[^"]*"/g,"").replace(/\[[^\]]*\]/g,"").replace(/\\./g,"");return/[dmyhs]/i.test(e)&&!/^[#0.,%\s]*$/.test(e)}function vt(o){return o?new DOMParser().parseFromString(new TextDecoder().decode(o),"application/xml"):null}var be=(o,e)=>[...o.getElementsByTagNameNS("*",e)];function Ga(o){let e=0;for(let t of o){let n=t.charCodeAt(0);if(n<65||n>90)break;e=e*26+(n-64)}return e-1}var za=1048576,Va=16384;async function wn(o){var p,h,g,w,m,y,b,v,S;let e=o instanceof Uint8Array?o:new Uint8Array(o);if(!mn(e))throw new Error("Not an xlsx file");let t=await oi(e),n=vt(t.get("xl/workbook.xml"));if(!n)throw new Error("xlsx has no workbook");let r=vt(t.get("xl/_rels/workbook.xml.rels")),i=new Map(r?be(r,"Relationship").map(x=>{var k,E;return[(k=x.getAttribute("Id"))!=null?k:"",(E=x.getAttribute("Target"))!=null?E:""]}):[]),s=vt(t.get("xl/sharedStrings.xml")),a=s?be(s,"si").map(x=>be(x,"t").map(k=>{var E;return(E=k.textContent)!=null?E:""}).join("")):[],l=vt(t.get("xl/styles.xml")),c=new Map(l?be(l,"numFmt").map(x=>{var k;return[Number(x.getAttribute("numFmtId")),(k=x.getAttribute("formatCode"))!=null?k:""]}):[]),d=l?be(l,"cellXfs")[0]:void 0,u=(d?[...d.children].filter(x=>x.localName==="xf"):[]).map(x=>{var E;let k=Number((E=x.getAttribute("numFmtId"))!=null?E:0);return Ba.has(k)||c.has(k)&&Ha(c.get(k))}),f=[];for(let x of be(n,"sheet")){let k=(h=(p=x.getAttribute("r:id"))!=null?p:x.getAttributeNS(tt,"id"))!=null?h:"",E=(g=i.get(k))!=null?g:"";E=E.startsWith("/")?E.slice(1):`xl/${E}`;let L=vt(t.get(E)),R=[];if(L){for(let M of be(L,"row")){let T=Number((w=M.getAttribute("r"))!=null?w:R.length+1)-1;if(!Number.isInteger(T)||T<0||T>=za)continue;let A=[],F=0;for(let $ of[...M.children].filter(D=>D.localName==="c")){let D=$.getAttribute("r"),O=D?Ga(D):F;if(O<0||O>=Va)continue;F=O+1;let P=$.getAttribute("t"),N=(y=(m=be($,"v")[0])==null?void 0:m.textContent)!=null?y:null,B=null;if(P==="s")B=N===null?null:(b=a[Number(N)])!=null?b:"";else if(P==="inlineStr")B=be($,"t").map(z=>{var W;return(W=z.textContent)!=null?W:""}).join("");else if(P==="b")B=N==="1";else if(P==="str"||P==="e")B=N;else if(N!==null&&N!==""){let z=Number(N);B=u[Number((v=$.getAttribute("s"))!=null?v:0)]?$a(z):z}A[O]=B}for(let $=0;$<A.length;$++)A[$]===void 0&&(A[$]=null);R[T]=A}for(let M=0;M<R.length;M++)R[M]||(R[M]=[])}f.push({name:(S=x.getAttribute("name"))!=null?S:`Sheet${f.length+1}`,rows:R})}return f}function xn(o,e){return Array.isArray(e)?e.flatMap(t=>{var r,i;let n=o.columns.getNode(t);return!n||n.children||G(t)?(V(`export: unknown column "${t}"`),[]):[{id:t,def:n.def,node:n,width:(i=(r=o.columns.getColumn(t))==null?void 0:r.width)!=null?i:n.width}]}):o.columns.displayed().filter(t=>!G(t.id)).map(t=>({id:t.id,def:t.def,node:t.node,width:t.width}))}function Cn(o,e){return e==="selected"?o.selectedRows():e==="all"?o.rowModel.server?o.rowModel.dataRows().map(t=>t.data):o.viewRows():o.rowModel.dataRows().map(t=>t.data)}var qe=(o,e)=>{var t,n;return(n=(t=o.header)!=null?t:o.field)!=null?n:e},qa=["left","center","right"],Wa=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,ve=o=>String(o!=null?o:"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e]),ja=["A4","A3","A5","B4","B5","letter","legal"],Ua=760,Ka=o=>`"${o.replace(/[\\"<\n\r]/g,e=>e===`
26
+ `?"\\A ":e==="\r"?"":`\\${e.charCodeAt(0).toString(16)} `)}"`,si=o=>o?`#${o.slice(2)}`:"";function _a(o,e,t){let n=[],r=0,i=o.store.state.sort,s=o.collator(),a=(l,c)=>{var h,g;if(c>=t.length){for(let w of l)n.push({kind:"row",row:w,n:++r});return}let d=t[c],u=(h=o.columns.getNode(d))==null?void 0:h.def;if(!u)return a(l,c+1);let f=new Map;for(let w of l){let m=j(u,w),y=K(m)?"":ne(m),b=f.get(y);b||f.set(y,b={value:m,rows:[]}),b.rows.push(w)}let p=((g=i.find(w=>w.colId===d))==null?void 0:g.dir)==="desc"?-1:1;for(let w of[...f.values()].sort((m,y)=>pn(m.value,y.value,s,p)))n.push({kind:"group",colId:d,value:w.value,rows:w.rows,level:c}),a(w.rows,c+1)};return a(e,0),n}var Xa=`
27
27
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
28
28
  body { font: 10.5px/1.45 system-ui, 'Pretendard', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; color: #111827; margin: 0; }
29
29
  header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid #111827; }
@@ -43,11 +43,11 @@ tr.group td { background: #eef2f7; font-weight: 600; border-top: 1px solid #cbd5
43
43
  tr.group.level-0 td { background: #e2e8f0; }
44
44
  tr.title td { border: 0; padding: 0 0 4px; background: none; }
45
45
  tr.total td { font-weight: 700; background: #f3f4f6; border-top: 1.5px solid #111827; border-bottom: 0; }
46
- `,wn=o=>typeof o=="string"&&/^(#[0-9a-f]{3,8}|[a-z]+|rgba?\([\d\s.,%]+\)|hsla?\([\d\s.,%deg]+\))$/i.test(o.trim())?o.trim():void 0,Ka=1e3;function Cn(o,e={}){var L,F,$,D,N;let t=vn(o,e.columns),n=o.store.state.locale,r=n.code,i=t.map(P=>ee(P.def,r)),s=ke(r),a=(L=e.rowNumbers)!=null?L:!!o.options.rowNumbers,l=P=>Ga.includes(P.align)?P.align:P.type==="number"?"right":P.type==="boolean"?"center":"left",c=t.map(P=>{let B=[];for(let O=P.node;O;O=O.parent)B.unshift(O);return B}),d=Math.max(1,...c.map(P=>P.length)),u=[];if(e.headers!==!1)for(let P=0;P<d;P++){let B=P===0&&a?[{text:"#",align:"right",num:!0,rowspan:d}]:[];for(let O=0;O<t.length;O++){let z=c[O],V=z.length-1;if(P<V){let _=z[P];if(O>0&&c[O-1][P]===_)continue;let J=1;for(;O+J<t.length&&c[O+J][P]===_;)J++;B.push({text:Ve(_.def,_.id),align:J>1?"center":"left",span:J,group:!0})}else P===V&&B.push({text:Ve(t[O].def,t[O].id),align:l(t[O].def),span:1,rowspan:d-P})}u.push(B)}let f=(P,B,O,z)=>{var _;if(O==null||O==="")return"";if(z==="count")return s.format(O);let V=(_=P.def.type)!=null?_:typeof O=="number"?"number":O instanceof Date?"date":void 0;return V===P.def.type?i[B](O):at(P.def,V,r)(O)},h=(P,B,O,z=0)=>{var J;let V=0;for(;V<t.length-1&&!O[V];)V++;V=Math.max(1,V);let _=a?[{text:"",align:"right",num:!0}]:[];_.push({text:B,align:"left",span:V,indent:z});for(let I=V;I<t.length;I++)_.push({text:(J=O[I])!=null?J:"",align:l(t[I].def)});return{kind:P,level:z,cells:_}},p=xn(o,e.rows),g=e.groups!==!1&&!o.rowModel.server&&!o.options.treeData?o.getGroupBy():[],w=e.styles!==!1&&t.some(P=>P.def.cellClass)?di(o):null,m=[],y=typeof e.maxRows=="number"&&e.maxRows>=1?Math.floor(e.maxRows):Ka,b=0;try{for(let P of ja(o,p,g)){if(P.kind==="row"&&b>=y)break;if(P.kind==="group"){let z=(F=o.columns.getNode(P.colId))==null?void 0:F.def,V=U(P.value)?n.blanks:z?ee(z,r)(P.value):String(P.value),_=`${z?Ve(z,P.colId):P.colId}: ${V} (${s.format(P.rows.length)})`,J=t.map((I,G)=>{if(!(!I.def.aggFunc||g.includes(I.id)))try{return f(I,G,Te(I.def.aggFunc,P.rows.map(X=>j(I.def,X)),P.rows),I.def.aggFunc)||void 0}catch{return}});m.push(h("group",_,J,P.level));continue}let B=P.row,O=a?[{text:String(P.n),align:"right",num:!0}]:[];t.forEach((z,V)=>{let _=j(z.def,B),J=U(_)?"":i[V](_),I={text:J,align:l(z.def)};if(w&&z.def.cellClass){let X;try{X=typeof z.def.cellClass=="function"?z.def.cellClass({value:_,formatted:J,row:B,rowIndex:P.n-1,column:z.def}):z.def.cellClass}catch{X=void 0}if(X){let Y=w.of(X);Y.color&&(I.color=si(Y.color)),Y.fill&&(I.fill=si(Y.fill)),Y.bold&&(I.bold=!0)}}let G=e.styles!==!1?o.cellFormat(B,z.id,_):null;if(G){let X=G.style;wn(X.color)&&(I.color=wn(X.color)),wn(X.background)&&(I.fill=wn(X.background)),X.bold&&(I.bold=!0),X.italic&&(I.italic=!0),X.strike&&(I.strike=!0),G.bar&&(I.bar={from:G.bar.from,to:G.bar.to,color:/^#[0-9a-f]{3,8}$/i.test(G.bar.color)?G.bar.color:"#93c5fd"}),G.icon&&(I.icon={char:G.icon.char,color:G.icon.color})}O.push(I)}),m.push({kind:"row",cells:O}),b++}}finally{w==null||w.dispose()}let v=[],S=e.summary!==!1?o.summary():null;S&&S.opts.rows.forEach((P,B)=>{var z;let O=t.map((V,_)=>{var I,G;let J=(I=P.columns)==null?void 0:I[V.id];return J===void 0?void 0:f(V,_,(G=S.values[B])==null?void 0:G[V.id],ft(J).agg)||void 0});v.push(h("total",(z=P.label)!=null?z:"",O))});let C=t.map(P=>Math.max(1,P.width)),R=C.reduce((P,B)=>P+B,0),A=Va.includes(e.paper)?e.paper:"A4",x=e.orientation==="portrait"||e.orientation==="landscape"?e.orientation:R+(a?40:0)>qa?"landscape":"portrait",M=e.printedAt!==!1?new Intl.DateTimeFormat(r,{dateStyle:"medium",timeStyle:"short"}).format(new Date):"",T=Number.isInteger(e.repeatRows)&&e.repeatRows>0?Math.min(e.repeatRows,m.length):0,E=p.length>b?n.printLimited.replace("{n}",s.format(b)).replace("{total}",s.format(p.length)):"";return E&&v.push({kind:"total",cells:[{text:E,align:"left",span:t.length+(a?1:0),italic:!0}]}),{lang:r,limited:E,title:($=e.title)!=null?$:"",subtitle:(D=e.subtitle)!=null?D:"",printed:M,footer:(N=e.footer)!=null?N:"",paper:A,orientation:x,fit:e.fitToWidth!==!1,numbered:a,widths:a?[40,...C]:C,head:u,body:m,foot:v,striped:e.striped!==!1,pageNumbers:e.pageNumbers!==!1,repeatHeader:e.repeatHeader!==!1,repeatTitle:!!e.repeatTitle,repeatRows:T}}function _a(o,e=!1){let t=e?o.align==="left"||o.group?"":`text-align:${o.align}`:`text-align:${o.align}`,n=r=>{t+=t?`;${r}`:r};if(o.indent&&n(`padding-left:${7+o.indent*14}px`),o.color&&n(`color:${o.color}`),o.fill&&n(`background:${o.fill}`),o.bold&&n("font-weight:600"),o.italic&&n("font-style:italic"),o.strike&&n("text-decoration:line-through"),o.bar){let r=(o.bar.from*100).toFixed(1),i=(o.bar.to*100).toFixed(1);n(`background-image:linear-gradient(to right,transparent ${r}%,${o.bar.color}66 ${r}%,${o.bar.color}66 ${i}%,transparent ${i}%)`)}return t}function ai(o,e){var i;let t=[o.num?' class="num"':o.group&&((i=o.span)!=null?i:1)>1?' class="span"':"",o.span!==void 0&&(e==="th"||o.span>1)?` colspan="${o.span}"`:"",o.rowspan!==void 0&&e==="th"?` rowspan="${o.rowspan}"`:""].join("");if(o.num)return`<${e}${t}>${ve(o.text)}</${e}>`;let n=_a(o,e==="th"),r=o.icon?`<span style="color:${ve(o.icon.color)};margin-right:5px">${ve(o.icon.char)}</span>`:"";return`<${e}${t}${n?` style="${ve(n)}"`:""}>${r}${ve(o.text)}</${e}>`}var po=o=>{var e;return`<tr${o.kind==="group"?` class="group level-${Math.min((e=o.level)!=null?e:0,5)}"`:o.kind==="total"?' class="total"':""}>${o.cells.map(t=>ai(t,"td")).join("")}</tr>`};function ho(o,e={}){let t=Cn(o,e),n=t.widths.slice(t.numbered?1:0).reduce((y,b)=>y+b,0),r=t.fit?`<colgroup>${t.numbered?'<col style="width:40px">':""}${t.widths.slice(t.numbered?1:0).map(y=>`<col style="width:${Math.round(y/n*1e3)/10}%">`).join("")}</colgroup>`:"",i=ve(t.title||(typeof document!="undefined"?document.title:"")||""),s=t.title||t.subtitle?`<div>${t.title?`<h1>${i}</h1>`:""}${t.subtitle?`<p class="sub">${ve(t.subtitle)}</p>`:""}</div>`:"<div></div>",a=t.title||t.subtitle||t.printed?`<header>${s}${t.printed?`<p class="printed">${ve(t.printed)}</p>`:""}</header>`:"",l="font: 8.5px system-ui, sans-serif; color: #6b7280;",c=[`size: ${t.paper} ${t.orientation}; margin: 12mm 12mm 14mm;`,t.footer?`@bottom-left { content: ${Wa(t.footer)}; ${l} }`:"",t.pageNumbers?`@bottom-right { content: counter(page) " / " counter(pages); ${l} }`:""].join(" "),d=t.striped?"tbody tr:not(.group):nth-child(even) td { background: #f9fafb; }":"",u=t.head.map(y=>`<tr>${y.map(b=>ai(b,"th")).join("")}</tr>`).join(""),f=t.body.slice(0,t.repeatRows).map(po).join(""),h=Math.max(1,t.widths.length),p=t.repeatTitle&&a?`<tr class="title"><td colspan="${h}">${a}</td></tr>`:"",g=t.repeatHeader?`${p}${u}${f}`:`${p}${f}`,w=(t.repeatHeader?"":u)+t.body.slice(t.repeatRows).map(po).join(""),m=t.foot.map(po).join("");return`<!doctype html><html lang="${ve(t.lang)}"><head><meta charset="utf-8"><title>${i}</title><style>
47
- @page { ${c} }${Ua}${d}
48
- </style></head><body>${t.repeatTitle?"":a}<table${t.fit?' class="fit"':""}>${r}<thead>${g}</thead><tbody>${w}</tbody>${m?`<tfoot>${m}</tfoot>`:""}</table></body></html>`}function li(o){if(typeof document=="undefined")return;let e=document.createElement("iframe");e.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0",document.body.append(e);let t=e.contentDocument;if(!t||!e.contentWindow){e.remove(),q("printing is not supported in this environment");return}t.open(),t.write(o),t.close();let n=e.contentWindow,r=()=>setTimeout(()=>e.remove(),1e3);n.addEventListener("afterprint",r),setTimeout(()=>{try{n.focus(),n.print()}catch{q("printing is not supported in this environment")}r()},50)}function mo(o,e={}){let t=vn(o,e.columns),n=o.store.state.locale.code,r=typeof e.separator=="string"&&e.separator.length===1?e.separator:",",i=xn(o,e.rows).map(s=>t.map(a=>{let l=j(a.def,s),c=a.def.type,d=en(a.def,l,n);return{value:d,text:typeof l!="number"&&(!(c==="number"||c==="date"||c==="boolean")||typeof l=="string"&&!za.test(d))}}));return e.headers!==!1&&i.unshift(t.map(s=>({value:Ve(s.def,s.id),text:!0}))),Qr(i,r)}function go(o,e={}){let t=vn(o,e.columns),n=o.store.state.locale.code,r=e.formatted?t.map(l=>ee(l.def,n)):null,i=t.map(l=>e.keys==="header"?Ve(l.def,l.id):l.id),s=xn(o,e.rows).map(l=>{let c={};return t.forEach((d,u)=>{let f=j(d.def,l);c[i[u]]=r?U(f)?"":r[u](f):f===void 0?null:f}),c}),a=typeof e.space=="number"&&e.space>=0?Math.min(10,e.space):2;return JSON.stringify(s,null,a)}function Xa(o){var i;let e=o.format;if(o.type==="date")return e==="datetime"?"yyyy-mm-dd hh:mm":e==="time"?"hh:mm":"yyyy-mm-dd";if(o.type!=="number"||e==null)return null;if(typeof e=="string")return e==="integer"?"#,##0":e==="percent"?"0%":e.startsWith("currency:")?"#,##0.##":/^[#0,.%]+$/.test(e)?e:null;let t=e,n=(i=t.maximumFractionDigits)!=null?i:t.minimumFractionDigits,r=n?`.${"0".repeat(Math.min(10,n))}`:"";return t.style==="percent"?`0${r}%`:`${t.useGrouping===!1?"0":"#,##0"}${r}`}function yn(o){let e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());if(e)return`FF${(e[1].length===3?[...e[1]].map(i=>i+i).join(""):e[1]).toUpperCase()}`;let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i.exec(o.trim());return!t||!((t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))>0)?"":`FF${[t[1],t[2],t[3]].map(r=>Math.min(255,Number(r)).toString(16).padStart(2,"0")).join("").toUpperCase()}`}function di(o){let e=o.renderer.root;if(typeof getComputedStyle!="function"||!e.isConnected)return{of:()=>({}),dispose:()=>{}};let t=document.createElement("div");t.className="fg-row",t.style.cssText="position:absolute;left:-9999px;top:0;visibility:hidden;pointer-events:none";let n=document.createElement("div");t.append(n),e.append(t);let r=a=>{n.className=a?`fg-cell ${a}`:"fg-cell";let l=getComputedStyle(n),c=l.fontWeight;return{color:l.color,fill:l.backgroundColor,bold:c==="bold"||Number(c)>=600}},i=r(""),s=new Map;return{of(a){let l=s.get(a);if(!l){let c=r(a);l={},c.color!==i.color&&yn(c.color)&&(l.color=yn(c.color)),c.fill!==i.fill&&yn(c.fill)&&(l.fill=yn(c.fill)),c.bold&&!i.bold&&(l.bold=!0),s.set(a,l)}return l},dispose:()=>t.remove()}}function wo(o,e={}){return ze([yo(o,e)])}function yo(o,e={}){var w;let t=vn(o,e.columns),n=o.store.state.locale.code,r=[],i=[],s=0;if(e.headers!==!1){let m=t.map(b=>{let v=[];for(let S=b.node;S;S=S.parent)v.unshift(S);return v});s=Math.max(1,...m.map(b=>b.length));let y=b=>{let v="";for(let S=b+1;S>0;S=Math.floor((S-1)/26))v=String.fromCharCode(65+(S-1)%26)+v;return v};for(let b=0;b<s;b++){let v=[];for(let S=0;S<t.length;S++){let C=m[S],R=C.length-1;if(b<R){let A=C[b],x=S>0?m[S-1][b]:null;if(v.push({v:x===A?null:Ve(A.def,A.id),header:!0}),x!==A){let M=S;for(;M+1<t.length&&m[M+1][b]===A;)M++;M>S&&i.push(`${y(S)}${b+1}:${y(M)}${b+1}`)}}else b===R?(v.push({v:Ve(t[S].def,t[S].id),header:!0}),s-1>b&&i.push(`${y(S)}${b+1}:${y(S)}${s}`)):v.push({v:null,header:!0})}r.push(v)}}let a=t.map(m=>Xa(m.def)),l=t.map(m=>ee(m.def,n)),c=xn(o,e.rows),d=e.styles!==!1,u=d&&t.some(m=>m.def.cellClass)?di(o):null,f=(m,y,b)=>{var S;if(U(b))return null;let v=(S=a[y])!=null?S:void 0;switch(m.def.type){case"number":{let C=typeof b=="number"?b:Number(b);return Number.isFinite(C)?{v:C,fmt:v}:String(b)}case"date":{let C=me(b);return C?{v:C,fmt:v}:String(b)}case"boolean":return typeof b=="boolean"?b:String(b);default:return l[y](b)}};try{c.forEach((m,y)=>{r.push(t.map((b,v)=>{let S=j(b.def,m),C=f(b,v,S);if(!d)return C;let R=b.def.align?{align:b.def.align}:{};if(u&&b.def.cellClass){let x;try{x=typeof b.def.cellClass=="function"?b.def.cellClass({value:S,formatted:l[v](S),row:m,rowIndex:y,column:b.def}):b.def.cellClass}catch{x=void 0}x&&(R={...R,...u.of(x)})}let A=o.cellFormat(m,b.id,S);if(A){let x=ao(A.style.color),M=ao(A.style.background);x&&(R.color=x),M&&(R.fill=M),A.style.bold&&(R.bold=!0)}return Object.keys(R).length?C!==null&&typeof C=="object"&&!(C instanceof Date)?{...C,...R}:{v:C,...R}:C}))})}finally{u==null||u.dispose()}let h=new Set,p=m=>{let y="";for(let b=m+1;b>0;b=Math.floor((b-1)/26))y=String.fromCharCode(65+(b-1)%26)+y;return y},g=(m,y,b,v)=>{for(let S=m;S<=b;S++)for(let C=y;C<=v;C++)if(h.has(`${S},${C}`))return;for(let S=m;S<=b;S++)for(let C=y;C<=v;C++)h.add(`${S},${C}`);i.push(`${p(y)}${s+m+1}:${p(v)}${s+b+1}`)};return c.forEach((m,y)=>t.forEach((b,v)=>{let S=b.def.colSpan?pt(b.def.colSpan,b.def,m,y,t.length-v):1;S>1&&g(y,v,y,v+S-1)})),t.forEach((m,y)=>{if(!m.def.merge&&!m.def.rowSpan)return;let b=Ht(c,m.def);for(let v=0;v<c.length;v++)b.start[v]===v&&b.end[v]>v&&g(v,y,b.end[v],y)}),{name:(w=e.sheetName)!=null?w:"Sheet1",rows:r,widths:t.map(m=>Math.round(m.width/7)),merges:i,freezeRows:s,printTitleRows:e.repeatHeader===!1?0:s+(Number.isInteger(e.repeatRows)&&e.repeatRows>0?e.repeatRows:0),autoFilter:s>0}}function qe(o,e,t){if(typeof URL=="undefined"||typeof URL.createObjectURL!="function"||typeof document=="undefined"){q("downloads are not supported in this environment");return}let n=URL.createObjectURL(new Blob(e,{type:t})),r=document.createElement("a");r.href=n,r.download=o,r.style.display="none",document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var bn=o=>String(o!=null?o:"").trim().toLowerCase();function Ja(o){var e;return o==null?"":o instanceof Date?o.getHours()||o.getMinutes()||o.getSeconds()?o.toISOString():(e=se(o))!=null?e:"":String(o)}async function ci(o,e,t={}){var g;let n=e instanceof Uint8Array?e:new Uint8Array(e instanceof ArrayBuffer?e:await e.arrayBuffer()),r;if(hn(n)){let w=await gn(n),m=typeof t.sheet=="string"?w.find(y=>y.name===t.sheet):w[typeof t.sheet=="number"?t.sheet:0];if(!m)throw new Error(`Sheet ${String(t.sheet)} not found`);r=m.rows}else{let w=new TextDecoder().decode(n);r=pn(w,co(w))}if(!r.length)return{rows:[],skipped:0};let i=[],s=w=>w.forEach(m=>m.children?s(m.children):!H(m.id)&&m.def.field&&i.push(m));s(o.columns.roots());let a=w=>{var y,b;let m=bn(w);return m&&(b=(y=i.find(v=>bn(v.def.header)===m))!=null?y:i.find(v=>bn(v.def.field)===m||bn(v.id)===m))!=null?b:null},l=1,c=new Set(r[0].map(a).filter(Boolean));for(;l<Math.min(r.length,5);){let m=((g=r[l])!=null?g:[]).filter(b=>b!=null&&String(b).trim()!==""),y=m.map(a).filter(b=>b&&!c.has(b));if(!m.length||!m.every(b=>typeof b=="string")||!y.length)break;y.forEach(b=>c.add(b)),l++}let d=Math.max(...r.slice(0,l).map(w=>{var m;return(m=w==null?void 0:w.length)!=null?m:0})),u=Array.from({length:d},(w,m)=>{var y;for(let b=l-1;b>=0;b--){let v=(y=r[b])==null?void 0:y[m];if(v!=null&&String(v).trim()!=="")return a(v)}return null}),f=o.store.state.data[0],h=0,p=[];for(let w of r.slice(l)){if(!w||w.every(y=>y==null||String(y).trim()===""))continue;let m={};u.forEach((y,b)=>{if(!y)return;let v=y.def,S=Ja(w[b]),C=o.acceptText(v,m,S,f==null?void 0:f[v.field]);C.ok?S===""&&(C.value===null||C.value==="")||(m[v.field]=C.value):h++}),p.push(m)}return t.mode==="replace"?o.setData(p):o.addRows(p),{rows:p,skipped:h}}var Ya="http://www.w3.org/2000/svg";var bo=["var(--fg-accent, #2563eb)","#f59e0b","#10b981","#ef4444","#8b5cf6","#06b6d4","#ec4899","#84cc16","#f97316","#64748b","#14b8a6","#a855f7"],Le=o=>bo[o%bo.length];function te(o,e={},t=""){let n=document.createElementNS(Ya,o);t&&n.setAttribute("class",t);for(let[r,i]of Object.entries(e))n.setAttribute(r,String(i));return n}function xt(o,e){let t=te("title");t.textContent=e,o.append(t)}function vo(o,e,t=5){let n=Math.min(0,o),r=Math.max(0,e);n===r&&(r=n+1);let i=(r-n)/t,s=10**Math.floor(Math.log10(i)),a=[1,2,5,10].map(c=>c*s).find(c=>c>=i);n=Math.floor(n/a)*a,r=Math.ceil(r/a)*a;let l=[];for(let c=n;c<=r+a/2;c+=a)l.push(Math.round(c/a)*a);return l}function kn(o,e){var T,E;let t=new Intl.NumberFormat(e.locale,{maximumFractionDigits:2}),n=new Intl.NumberFormat(e.locale,{notation:"compact",maximumFractionDigits:1}),r=te("svg",{viewBox:"0 0 640 360",role:"img",preserveAspectRatio:"xMidYMid meet"},`fg-chart fg-chart-is-${e.type}`);e.title&&r.setAttribute("aria-label",e.title);let i=e.series.slice(0,bo.length),s=e.categories,a=16;if(e.title){let L=te("text",{x:320,y:22,"text-anchor":"middle"},"fg-chart-title");L.textContent=e.title,r.append(L),a=36}let l=te("g",{},"fg-chart-legend"),c=e.type==="pie"||e.type==="donut",d=c?s:e.type==="scatter"?i.slice(1).map(L=>L.name):i.map(L=>L.name),u=16;d.forEach((L,F)=>{let $=te("g",{transform:`translate(${u},350)`},"fg-chart-legend-item");$.append(te("rect",{x:0,y:-9,width:10,height:10,rx:2,fill:Le(F)}));let D=te("text",{x:14,y:0});D.textContent=L,$.append(D),l.append($),u+=24+Math.min(140,L.length*7)});let f=308;if(e.type==="scatter"){Za(r,e,i,a,f,t,n),r.append(l),o.replaceChildren(r);return}if(c){let L=((E=(T=i[0])==null?void 0:T.values)!=null?E:[]).map(B=>B!==null&&B>0?B:0),F=L.reduce((B,O)=>B+O,0),$=640/2,D=(a+f)/2,N=Math.max(10,(f-a)/2-6),P=-Math.PI/2;L.forEach((B,O)=>{if(!B||!F)return;let z=P+B/F*Math.PI*2,V=z-P>Math.PI?1:0,_=G=>`${$+N*Math.cos(G)},${D+N*Math.sin(G)}`,J=B===F?`M${$-N},${D}a${N},${N} 0 1,0 ${2*N},0a${N},${N} 0 1,0 ${-2*N},0`:`M${$},${D}L${_(P)}A${N},${N} 0 ${V} 1 ${_(z)}Z`,I=te("path",{d:J,fill:Le(O)},"fg-chart-slice");xt(I,`${s[O]}: ${t.format(B)} (${Math.round(B/F*1e3)/10}%)`),r.append(I),P=z}),e.type==="donut"&&r.append(te("circle",{cx:$,cy:D,r:N*.58,fill:"var(--fg-bg, #fff)"},"fg-chart-donut-hole")),r.append(l),o.replaceChildren(r);return}let h=e.type==="stackedBar",p=0,g=0;s.forEach((L,F)=>{let $=0,D=0;for(let N of i){let P=N.values[F];P==null||!Number.isFinite(P)||(h?P>=0?$+=P:D+=P:(g=Math.max(g,P),p=Math.min(p,P)))}h&&(g=Math.max(g,$),p=Math.min(p,D))});let w=vo(p,g),m=w[0],y=w[w.length-1],b=56,v=624,S=L=>f-(L-m)/(y-m)*(f-a),C=te("g",{},"fg-chart-axis");for(let L of w){C.append(te("line",{x1:b,x2:v,y1:S(L),y2:S(L)},L===0?"fg-chart-zero":"fg-chart-grid"));let F=te("text",{x:b-6,y:S(L)+4,"text-anchor":"end"});F.textContent=n.format(L),C.append(F)}let R=(v-b)/Math.max(1,s.length),A=Math.max(1,Math.ceil(s.length/Math.floor((v-b)/56)));s.forEach((L,F)=>{if(F%A)return;let $=te("text",{x:b+R*(F+.5),y:f+16,"text-anchor":"middle"}),D=Math.max(3,Math.min(12,Math.floor(R*A/10)));$.textContent=L.length>D?`${L.slice(0,D-1)}\u2026`:L,C.append($)}),r.append(C);let x=te("g",{},"fg-chart-plot"),M=e.type==="combo";if(M){let L=R*.6,F=i[0];s.forEach(($,D)=>{let N=F==null?void 0:F.values[D];if(N==null||!Number.isFinite(N))return;let P=b+R*D+(R-L)/2,B=te("rect",{x:P,y:Math.min(S(0),S(N)),width:Math.max(1,L-2),height:Math.max(.5,Math.abs(S(N)-S(0))),fill:Le(0),rx:2},"fg-chart-bar");xt(B,`${F.name} \xB7 ${$}: ${t.format(N)}`),x.append(B)})}if(e.type==="bar"||h){let L=R*.72,F=h?L:L/Math.max(1,i.length);s.forEach(($,D)=>{let N=0,P=0;i.forEach((B,O)=>{let z=B.values[D];if(z==null||!Number.isFinite(z))return;let V=0,_=z;h&&(V=z>=0?N:P,_=V+z,z>=0?N=_:P=_);let J=b+R*D+(R-L)/2+(h?0:F*O),I=te("rect",{x:J,y:Math.min(S(V),S(_)),width:Math.max(1,F-2),height:Math.max(.5,Math.abs(S(_)-S(V))),fill:Le(O),rx:2},"fg-chart-bar");xt(I,`${B.name} \xB7 ${$}: ${t.format(z)}`),x.append(I)})})}else i.forEach((L,F)=>{if(M&&F===0)return;let $=L.values.map((P,B)=>P==null||!Number.isFinite(P)?null:[b+R*(B+.5),S(P),P]),D="",N=!1;for(let P of $){if(!P){N=!1;continue}D+=`${N?"L":"M"}${P[0]},${P[1]}`,N=!0}if(e.type==="area"){let P=$.filter(B=>!!B);if(P.length){let B=`M${P[0][0]},${S(0)}${P.map(O=>`L${O[0]},${O[1]}`).join("")}L${P[P.length-1][0]},${S(0)}Z`;x.append(te("path",{d:B,fill:Le(F),"fill-opacity":.18},"fg-chart-area"))}}x.append(te("path",{d:D,fill:"none",stroke:Le(F),"stroke-width":2.2,"stroke-linejoin":"round"},"fg-chart-line")),$.forEach((P,B)=>{if(!P)return;let O=te("circle",{cx:P[0],cy:P[1],r:3.5,fill:Le(F)},"fg-chart-point");xt(O,`${L.name} \xB7 ${s[B]}: ${t.format(P[2])}`),x.append(O)})});r.append(x,l),o.replaceChildren(r)}function Za(o,e,t,n,r,i,s){var R,A,x,M;let a=(A=(R=t[0])==null?void 0:R.values)!=null?A:[],l=t.slice(1),c=T=>T!=null&&Number.isFinite(T),d=a.filter(c),u=l.flatMap(T=>T.values.filter(c));if(!d.length||!u.length)return;let f=T=>T.reduce((E,L)=>Math.min(E,L)),h=T=>T.reduce((E,L)=>Math.max(E,L)),p=vo(f(d),h(d)),g=vo(f(u),h(u)),w=56,m=624,y=T=>w+(T-p[0])/(p[p.length-1]-p[0])*(m-w),b=T=>r-(T-g[0])/(g[g.length-1]-g[0])*(r-n),v=te("g",{},"fg-chart-axis");for(let T of g){v.append(te("line",{x1:w,x2:m,y1:b(T),y2:b(T)},T===0?"fg-chart-zero":"fg-chart-grid"));let E=te("text",{x:w-6,y:b(T)+4,"text-anchor":"end"});E.textContent=s.format(T),v.append(E)}p.forEach((T,E)=>{let L=E===0?"start":E===p.length-1?"end":"middle",F=te("text",{x:y(T),y:r+16,"text-anchor":L});F.textContent=s.format(T),v.append(F)});let S=te("text",{x:m,y:r+32,"text-anchor":"end"},"fg-chart-axis-name");S.textContent=`${(M=(x=t[0])==null?void 0:x.name)!=null?M:""} \u2192`,v.append(S),o.append(v);let C=te("g",{},"fg-chart-plot");a.forEach((T,E)=>{c(T)&&l.forEach((L,F)=>{var N;let $=L.values[E];if(!c($))return;let D=te("circle",{cx:y(T),cy:b($),r:4,fill:Le(F),"fill-opacity":.8},"fg-chart-point");xt(D,`${(N=e.categories[E])!=null?N:""}: ${t[0].name} ${i.format(T)}, ${L.name} ${i.format($)}`),C.append(D)})}),o.append(C)}var Qa=12,ui=500,xo=["bar","stackedBar","line","area","combo","pie","donut","scatter"],Rn=class{constructor(e){this.grid=e;this.handles=new Set}create(e={}){var g,w;let{grid:t}=this,n=xo.includes(e.type)?e.type:"bar",r=()=>t.store.state.locale,i=(g=e.range)!=null?g:t.store.state.range,s=null;if(i){let m=t.columns.getColumn(i.start.colId),y=t.columns.getColumn(i.end.colId);if(m&&y){let b=gt({start:{rowIndex:i.start.rowIndex,colIndex:m.index},end:{rowIndex:i.end.rowIndex,colIndex:y.index}}),v=[];for(let S=b.r1;S<=b.r2&&v.length<ui;S++){let C=t.rowModel.getRow(S);C&&!C.kind&&v.push(C.data)}s={rows:v,colIds:t.columns.displayed().slice(b.c1,b.c2+1).filter(S=>!H(S.id)).map(S=>S.id)}}}let a=()=>{var A;let m=s?s.rows:t.rowModel.dataRows().slice(0,ui).map(x=>x.data),y=(s?s.colIds.map(x=>t.columns.getColumn(x)):t.columns.displayed().filter(x=>!H(x.id))).filter(x=>!!x),b=y[0]&&y[0].def.type!=="number"?y[0]:s?null:(A=y.find(x=>x.def.type!=="number"))!=null?A:null,v=x=>!!x.node.parent&&x.node.parent.id==="pivotgroup|total",S=y.filter(x=>x!==b&&x.def.type==="number"&&(s||!v(x))).slice(0,Qa),C=x=>{var T,E,L;let M=[];for(let F=x.node.parent;F;F=F.parent)M.unshift((T=F.def.header)!=null?T:F.id);return M.push((L=(E=x.def.header)!=null?E:x.def.field)!=null?L:x.id),M.join(" \xB7 ")},R=b?ee(b.def,r().code):null;return{categories:m.map((x,M)=>b&&R?R(j(b.def,x)):String(M+1)),series:S.map(x=>({name:C(x),values:m.map(M=>{let T=j(x.def,M),E=typeof T=="number"?T:T==null||T===""?NaN:Number(T);return Number.isFinite(E)?E:null})}))}},l=k("div","fg-chart-body"),c=null,d=()=>kn(l,{type:n,title:e.title,locale:r().code,...a()}),u=m=>({bar:r().chartBar,stackedBar:r().chartStacked,line:r().chartLine,area:r().chartArea,pie:r().chartPie,donut:r().chartDonut,combo:r().chartCombo,scatter:r().chartScatter})[m],f=()=>c==null?void 0:c.querySelectorAll(".fg-chart-type").forEach(m=>m.setAttribute("aria-pressed",String(m.dataset.type===n)));if(e.container)e.container.append(l);else{c=k("div","fg-chart-panel",{role:"dialog","aria-label":(w=e.title)!=null?w:u(n)});let m=k("div","fg-chart-head");for(let b of xo){let v=k("button","fg-chart-type",{type:"button",title:u(b)});v.dataset.type=b,v.textContent=u(b),v.addEventListener("click",()=>p.setType(b)),m.append(v)}let y=k("button","fg-chooser-close",{type:"button","aria-label":r().close});y.textContent="\xD7",y.addEventListener("click",()=>p.destroy()),m.append(k("span","fg-chart-spacer"),y),c.append(m,l),t.renderer.root.append(c)}let h=[t.events.on("cellValueChanged",()=>d()),t.events.on("rowsAdded",()=>d()),t.events.on("rowsRemoved",()=>d())];s||h.push(t.events.on("sortChange",()=>d()),t.events.on("filterChange",()=>d()));let p={el:l,setType:m=>{xo.includes(m)&&(n=m,f(),d())},update:()=>d(),destroy:()=>{h.forEach(m=>m()),(c!=null?c:l).remove(),this.handles.delete(p)}};return this.handles.add(p),f(),d(),p}destroy(){for(let e of[...this.handles])e.destroy()}};var fi=new WeakMap,el=o=>typeof o=="function"?"custom":o;function Co(o,e){var t,n,r;return{rows:((t=o.rows)!=null?t:[]).filter(e),columns:((n=o.columns)!=null?n:[]).filter(e),values:((r=o.values)!=null?r:[]).filter(i=>i&&e(i.colId)).map(i=>{var s;return{colId:i.colId,aggFunc:(s=i.aggFunc)!=null?s:"sum"}}),totals:o.totals!==!1}}function pi(o,e){let t=(n,r)=>n.length===r.length&&n.every((i,s)=>i===r[s]);return o.totals===e.totals&&t(o.rows,e.rows)&&t(o.columns,e.columns)&&o.values.length===e.values.length&&o.values.every((n,r)=>n.colId===e.values[r].colId&&n.aggFunc===e.values[r].aggFunc)}function hi(o,e,t,n,r){let i=Co(e,C=>!!t(C)),s=new Intl.Collator(r,{numeric:!0,sensitivity:"base"}),a=C=>t(C),l=(C,R)=>C.map(A=>ne(j(a(A),R))).join(""),c=new Map,d=new WeakMap;for(let C of o){let R=l(i.columns,C);d.set(C,R),c.has(R)||c.set(R,i.columns.map(A=>j(a(A),C)))}let u=new WeakMap,f=C=>{var A;let R=u.get(C);if(!R){let x=C.flatMap(T=>{var E;return(E=fi.get(T))!=null?E:[]}),M=new Map;for(let T of x){let E=(A=d.get(T))!=null?A:l(i.columns,T),L=M.get(E);L||M.set(E,L=[]),L.push(T)}u.set(C,R={all:x,byCombo:M})}return R},h=[...c.entries()].sort((C,R)=>{for(let A=0;A<i.columns.length;A++){let x=bt(C[1][A],R[1][A],s);if(x)return x}return 0});i.columns.length||h.splice(0,h.length,["",[]]);let p=[],g=(C,R,A)=>{var L,F;let x=i.values[R],M=a(x.colId),T=`pivot|${A}|${R}`;p.push({id:T,comboKey:C,valueIndex:R});let E=x.aggFunc;return{id:T,field:T,header:`${(F=(L=M.header)!=null?L:M.field)!=null?F:x.colId} (${n.agg(el(E))})`,type:"number",format:E==="count"?"integer":M.format,width:130,aggFunc:($,D)=>{var B;let N=f(D),P=C===null?N.all:(B=N.byCombo.get(C))!=null?B:[];return P.length?Te(E,P.map(O=>j(M,O)),P):null}}},w=[],m=(C,R)=>{if(U(R))return n.blank;let A=a(C);return A.type==="number"&&!A.format?String(R):ee(A,r)(R)};if(!i.columns.length)i.values.forEach((C,R)=>w.push(g("",R,0)));else{let C=(R,A,x)=>{let M=[],T=0;for(;T<R.length;){let E=R[T][1][A],L=ne(E),F=T;for(;F<R.length&&ne(R[F][1][A])===L;)F++;let $=R.slice(T,F),D=A===i.columns.length-1?i.values.map((N,P)=>g($[0][0],P,x+T)):C($,A+1,x+T);M.push({id:`pivotgroup|${A}|${x+T}`,header:m(i.columns[A],E),children:D}),T=F}return M};w.push(...C(h,0,0)),i.totals&&i.values.length&&w.push({id:"pivotgroup|total",header:n.total,children:i.values.map((R,A)=>g(null,A,"total"))})}let y=new Map;for(let C of o){let R=l(i.rows,C),A=y.get(R);A||y.set(R,A={values:i.rows.map(x=>j(a(x),C)),src:[]}),A.src.push(C)}let v=[...y.values()].sort((C,R)=>{for(let A=0;A<i.rows.length;A++){let x=bt(C.values[A],R.values[A],s);if(x)return x}return 0}).map(C=>{var x;let R={};i.rows.forEach((M,T)=>{var E;R[(E=a(M).field)!=null?E:M]=C.values[T]});let A=new Map;if(i.columns.length)for(let M of C.src){let T=l(i.columns,M),E=A.get(T);E||A.set(T,E=[]),E.push(M)}for(let M of p){let T=i.values[M.valueIndex],E=M.comboKey===null||!i.columns.length?C.src:(x=A.get(M.comboKey))!=null?x:[],L=a(T.colId);R[M.id]=E.length?Te(T.aggFunc,E.map(F=>j(L,F)),E):null}return fi.set(R,C.src),R});return{columns:[...i.rows.map(C=>{var A,x,M,T;let R=a(C);return{id:C,field:(A=R.field)!=null?A:C,header:(M=(x=R.header)!=null?x:R.field)!=null?M:C,type:R.type,format:R.format,width:(T=R.width)!=null?T:140}}),...w],rows:v,groupBy:i.rows.slice(0,-1)}}var mi={grouping:{en:"Row grouping and aggregation",ko:"\uD589 \uADF8\uB8F9\xB7\uC9D1\uACC4"},pivot:{en:"Pivot",ko:"\uD53C\uBC97"},charts:{en:"Charts",ko:"\uCC28\uD2B8"},range:{en:"Cell range selection",ko:"\uC140 \uBC94\uC704 \uC120\uD0DD"},clipboard:{en:"Range copy and paste",ko:"\uBC94\uC704 \uBCF5\uC0AC\xB7\uBD99\uC5EC\uB123\uAE30"},fill:{en:"Fill handle",ko:"\uCC44\uC6B0\uAE30 \uD578\uB4E4"},excel:{en:"Excel export",ko:"\uC5D1\uC140 \uB0B4\uBCF4\uB0B4\uAE30"},pdf:{en:"PDF export",ko:"PDF \uB0B4\uBCF4\uB0B4\uAE30"},serverGroups:{en:"Server-side groups",ko:"\uC11C\uBC84 \uADF8\uB8F9"},advancedFilter:{en:"Advanced filter",ko:"\uACE0\uAE09 \uD544\uD130"},sideBar:{en:"Side bar panels",ko:"\uC0AC\uC774\uB4DC\uBC14 \uD328\uB110"},contextMenu:{en:"Context menu",ko:"\uCEE8\uD14D\uC2A4\uD2B8 \uBA54\uB274"},summary:{en:"Summary rows",ko:"\uD569\uACC4 \uD589"},formulas:{en:"Formulas",ko:"\uC218\uC2DD"},find:{en:"Find",ko:"\uCC3E\uAE30"},conditional:{en:"Conditional formatting",ko:"\uC870\uAC74\uBD80 \uC11C\uC2DD"},assistant:{en:"AI assistant",ko:"AI \uC5B4\uC2DC\uC2A4\uD134\uD2B8"},merge:{en:"Merged cells",ko:"\uC140 \uBCD1\uD569"},workbook:{en:"Workbook",ko:"\uC6CC\uD06C\uBD81"}};var We="1.9.0";var tl={kty:"EC",crv:"P-256",x:"sUTKkglZmk-HMKPNub8p7AeLBKesHCU8irIkw9rJlbE",y:"j0U_aKRDR7iApY9UpaD3hUemhBLZJwDv9-QiT_hUyw8"},je="https://freegrid.app/pricing/",nt="https://freegrid.app/license/personal/",gi="https://freegrid.app/api/usage",nl="https://freegrid.app/api/domain-status",ol=o=>Number.parseInt(String(o).split(".")[0],10),wi=o=>{let e=atob(o.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-o.length%4)%4));return Uint8Array.from(e,t=>t.charCodeAt(0))};function Mn(o){let e=o.toLowerCase().replace(/^\[|\]$/g,"");return!e||e==="localhost"||e==="127.0.0.1"||e==="::1"||e==="0.0.0.0"||e.endsWith(".localhost")||e.endsWith(".test")||e.endsWith(".local")||/^(10|192\.168|172\.(1[6-9]|2\d|3[01]))\./.test(e)}function rl(o,e){let t=o.toLowerCase().replace(/\.$/,"");return e.some(n=>{let r=n.toLowerCase().replace(/\.$/,""),i=r.startsWith("*.")?r.slice(2):r;return i?t===i||t.endsWith(`.${i}`):!1})}var So=o=>{let e=typeof o=="string"?/^(\d{4})-(\d{2})-(\d{2})$/.exec(o):null;if(!e)return!1;let t=new Date(Date.UTC(Number(e[1]),Number(e[2])-1,Number(e[3])));return t.getUTCMonth()===Number(e[2])-1&&t.getUTCDate()===Number(e[3])},il=o=>`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`;async function Mo(o,e,t={}){var s,a,l;let n=typeof o=="string"?o.trim().split("."):[];if(n.length!==3||n[0]!=="FG1")return{ok:!1,reason:"format"};let r;try{if(r=JSON.parse(new TextDecoder().decode(wi(n[1]))),!Array.isArray(r.domains)||!So(r.expires))return{ok:!1,reason:"format"};if(r.major!==void 0&&!(Number.isInteger(r.major)&&r.major>0))return{ok:!1,reason:"format"};if(r.plan!==void 0&&r.plan!=="company"&&r.plan!=="personal")return{ok:!1,reason:"format"}}catch{return{ok:!1,reason:"format"}}let i=typeof crypto!="undefined"?crypto.subtle:void 0;if(!i)return{ok:!1,reason:"unsupported",info:r};try{let c=await i.importKey("jwk",(s=t.publicKey)!=null?s:tl,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]),d=new TextEncoder().encode(`${n[0]}.${n[1]}`);if(!await i.verify({name:"ECDSA",hash:"SHA-256"},c,wi(n[2]),d))return{ok:!1,reason:"signature",info:r}}catch{return{ok:!1,reason:"signature",info:r}}return il((a=t.now)!=null?a:new Date)>r.expires?{ok:!1,reason:"expired",info:r}:rl(e,r.domains)?r.major!==void 0&&ol((l=t.version)!=null?l:We)>r.major?{ok:!1,reason:"version",info:r}:{ok:!0,info:r}:{ok:!1,reason:"domain",info:r}}var Ct,yi=new Map,ko=new Map,bi=new Set,vi=new Set;function Ri(o){Ct=o}var Sn={missing:`FreeGrid: every feature is free for 30 days on a domain. After that, paid features need a free personal key (${nt}) or a company key: ${je}
49
- FreeGrid: \uB3C4\uBA54\uC778\uB9C8\uB2E4 30\uC77C \uB3D9\uC548 \uBAA8\uB4E0 \uAE30\uB2A5\uC744 \uBB34\uB8CC\uB85C \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uADF8 \uB4A4 \uC720\uB8CC \uAE30\uB2A5\uC5D0\uB294 \uBB34\uB8CC \uAC1C\uC778 \uD0A4(${nt}) \uB610\uB294 \uD68C\uC0AC \uD0A4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4: ${je}`,trial:o=>`FreeGrid: the 30-day trial of paid features on this domain ends ${o}. / \uC774 \uB3C4\uBA54\uC778\uC758 \uC720\uB8CC \uAE30\uB2A5 30\uC77C \uCCB4\uD5D8\uC740 ${o}\uC5D0 \uB05D\uB0A9\uB2C8\uB2E4.`,ended:`FreeGrid: the 30-day trial on this domain has ended, so paid features are now off. Get a free personal key (${nt}) or a company key: ${je}
50
- FreeGrid: \uC774 \uB3C4\uBA54\uC778\uC758 30\uC77C \uCCB4\uD5D8\uC774 \uB05D\uB098 \uC720\uB8CC \uAE30\uB2A5\uC774 \uAEBC\uC84C\uC2B5\uB2C8\uB2E4. \uBB34\uB8CC \uAC1C\uC778 \uD0A4(${nt}) \uB610\uB294 \uD68C\uC0AC \uD0A4\uB97C \uBC1B\uC73C\uC138\uC694: ${je}`,format:"FreeGrid: the license key is not in the right format. / \uB77C\uC774\uC120\uC2A4 \uD0A4 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",signature:"FreeGrid: the license key could not be verified. / \uB77C\uC774\uC120\uC2A4 \uD0A4\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",expired:"FreeGrid: the license key has expired. / \uB77C\uC774\uC120\uC2A4 \uAE30\uAC04\uC774 \uB05D\uB0AC\uC2B5\uB2C8\uB2E4.",domain:"FreeGrid: the license key is for a different domain. / \uB2E4\uB978 \uB3C4\uBA54\uC778\uC6A9 \uB77C\uC774\uC120\uC2A4 \uD0A4\uC785\uB2C8\uB2E4.",version:`FreeGrid ${We}: this perpetual license covers an earlier major version. / \uC774 \uC601\uAD6C \uB77C\uC774\uC120\uC2A4\uB294 \uC774\uC804 \uBA54\uC774\uC800 \uBC84\uC804\uC6A9\uC785\uB2C8\uB2E4.`};function xi(o,e=typeof location!="undefined"?location.hostname:""){try{if(Mn(e)||typeof navigator=="undefined")return;let t=new Date().toISOString().slice(0,10),n=`${e}|${t}|${o.licensed?1:0}`,r=typeof localStorage!="undefined"?localStorage:null;if((r==null?void 0:r.getItem("freegrid:usage"))===n)return;r==null||r.setItem("freegrid:usage",n);let i=JSON.stringify({version:o.version,licensed:o.licensed,company:o.company,url:`${location.origin}${location.pathname}`});typeof navigator.sendBeacon=="function"?navigator.sendBeacon(gi,i):typeof fetch=="function"&&fetch(gi,{method:"POST",body:i,mode:"no-cors",keepalive:!0}).catch(()=>{})}catch{}}function Si(o=Ct,e=typeof location!="undefined"?location.hostname:""){if(Mn(e))return Promise.resolve(!0);let t=o!=null?o:Ct,n=`${t!=null?t:""}@${e}`,r=yi.get(n);return r||(t?r=Mo(t,e).then(i=>{if(xi({version:We,licensed:i.ok,company:i.ok?i.info.company:void 0},e),i.ok||i.reason==="unsupported")return i.ok||i.reason==="unsupported";let s=i.info?` (${i.info.domains.join(", ")}, ${i.info.major?`${i.info.major}.x`:i.info.expires})`:"";return console.warn(`${Sn[i.reason]}${s}
51
- ${je}`),!1},()=>!1):(console.info(Sn.missing),xi({version:We,licensed:!1},e),r=Promise.resolve(!1)),yi.set(n,r),r)}var Ro;var kt=()=>Ro!=null?Ro:typeof location!="undefined"?location.hostname:"",Ci=o=>{if(!o||typeof o!="object")return null;let{badge:e,trial:t}=o,n=!!t&&typeof t=="object"&&So(t.started)&&So(t.ends)&&typeof t.active=="boolean";return{badge:e===!0,trial:n?{started:t.started,ends:t.ends,active:t.active}:null}};function Mi(o=kt()){var i;if(Mn(o)||typeof fetch!="function")return Promise.resolve(null);let e=ko.get(o);if(e)return e;let t=new Date().toISOString().slice(0,10),n=null;try{n=typeof localStorage!="undefined"?localStorage:null;let s=JSON.parse((i=n==null?void 0:n.getItem("freegrid:status"))!=null?i:"null"),a=s&&s.host===o&&s.day===t?Ci(s.status):null;if(a){let l=Promise.resolve(a);return ko.set(o,l),l}}catch{}let r=fetch(nl,{mode:"cors",credentials:"omit"}).then(s=>s.ok?s.json():null).then(s=>{let a=Ci(s);if(a)try{n==null||n.setItem("freegrid:status",JSON.stringify({host:o,day:t,status:a}))}catch{}return a}).catch(()=>null);return ko.set(o,r),r}function sl(o=kt()){return Mi(o).then(e=>(e==null?void 0:e.badge)===!0)}async function Ei(o,e=kt()){return await Si(o,e)?!1:sl(e)}var Ai="freegrid:gate",Ti=o=>{if(!o)return"";let e=o.trim().split(".");return e[e.length-1].slice(-16)};function Li(o,e=kt()){var t;if(Mn(e))return!0;try{let n=JSON.parse((t=localStorage.getItem(Ai))!=null?t:"null");return!n||n.host!==e||n.keyId!==Ti(o!=null?o:Ct)?!0:n.paid!==!1}catch{return!0}}var ki=o=>{try{localStorage.setItem(Ai,JSON.stringify(o))}catch{}};async function Pi(o,e=kt()){var s;let t=o!=null?o:Ct,n=Ti(t);if(await Si(t,e))return ki({host:e,keyId:n,paid:!0}),!0;let r=(s=await Mi(e))==null?void 0:s.trial;if(!r)return!0;ki({host:e,keyId:n,paid:r.active,trialEnds:r.ends});let i=`${r.active?"trial":"ended"}@${e}`;return bi.has(i)||(bi.add(i),r.active?console.info(Sn.trial(r.ends)):console.warn(Sn.ended)),r.active}function Fi(o){var t;if(vi.has(o))return;vi.add(o);let e=(t=mi[o])!=null?t:{en:o,ko:o};console.warn(`FreeGrid: ${e.en} is a paid feature and is off on this domain. Get a free personal key (${nt}) or a company key: ${je}
52
- FreeGrid: ${e.ko}\uC740(\uB294) \uC720\uB8CC \uAE30\uB2A5\uC774\uB77C \uC774 \uB3C4\uBA54\uC778\uC5D0\uC11C \uAEBC\uC838 \uC788\uC2B5\uB2C8\uB2E4. \uBB34\uB8CC \uAC1C\uC778 \uD0A4(${nt}) \uB610\uB294 \uD68C\uC0AC \uD0A4\uB97C \uBC1B\uC73C\uC138\uC694: ${je}`)}var Rt={text:["contains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["eq","ne","lt","lte","gt","gte","between","blank","notBlank"],date:["equals","before","after","between","blank","notBlank"]},Ii=["blank","notBlank"],Eo=500,En=class{constructor(e){this.grid=e;this.popup=null;this.colId=null;this.off=[]}get openColumn(){return this.colId}toggle(e,t){this.colId===e?this.close():this.open(e,t)}open(e,t){var g;this.close();let n=this.grid.columns.getNode(e);if(!n||n.children||H(e))return;let r=this.grid.store.state.locale,i=n.def,s=k("div",`fg-menu fg-theme-${this.grid.store.state.theme}`,{role:"dialog","aria-label":r.columnMenu});this.grid.applyFontTo(s),Ie(i)&&s.append(this.section([[r.sortAsc,()=>this.grid.setSort([{colId:e,dir:"asc"}])],[r.sortDesc,()=>this.grid.setSort([{colId:e,dir:"desc"}])],[r.clearSort,()=>this.grid.setSort(this.grid.store.state.sort.filter(w=>w.colId!==e))]])),s.append(this.section([[r.pinLeft,()=>this.grid.setPinned(e,"left")],[r.pinRight,()=>this.grid.setPinned(e,"right")],[r.unpin,()=>this.grid.setPinned(e,null)]]));let a=this.grid.getGroupBy();if(!this.grid.options.treeData&&this.grid.paid&&(this.grid.options.groupPanel||a.length)){let w=a.includes(e)?[[r.ungroup,()=>this.grid.setGroupBy(a.filter(m=>m!==e))]]:[[r.groupByThis,()=>this.grid.setGroupBy([...a,e])]];a.length&&w.push([r.expandAll,()=>this.grid.expandAll(!0)],[r.collapseAll,()=>this.grid.expandAll(!1)]),s.append(this.section(w))}let l=[[r.autosizeThis,()=>this.grid.autoSize([e])],[r.autosizeAll,()=>this.grid.autoSize()]];i.lockVisible||l.push([r.hideColumn,()=>this.grid.setColumnsVisible([e],!1)]),l.push([r.chooseColumns,()=>this.grid.chooser.open()],[r.resetColumns,()=>this.grid.resetColumns()]),this.grid.options.conditionalFormatMenu!==!1&&this.grid.paid&&l.push([`${r.cf.title}\u2026`,()=>this.grid.formatDialog.open(e)]),s.append(this.section(l));let c=this.filterSection(e,()=>this.close());c&&s.append(c),oe(this.grid.renderer.root).append(s);let d=t.getBoundingClientRect(),u=s.offsetWidth||248;s.style.left=`${Math.max(4,Math.min(d.right-u,window.innerWidth-u-4))}px`;let f=Math.max(4,Math.min(d.bottom+4,window.innerHeight-240));s.style.top=`${f}px`,s.style.maxHeight=`${Math.max(160,window.innerHeight-f-8)}px`,this.popup=s,this.colId=e;let h=w=>{ce(w,s,t)||this.close()},p=w=>{w.key==="Escape"&&(this.close(),this.grid.renderer.gridEl.focus())};document.addEventListener("pointerdown",h,!0),document.addEventListener("keydown",p,!0),this.off.push(()=>document.removeEventListener("pointerdown",h,!0),()=>document.removeEventListener("keydown",p,!0)),(g=s.querySelector(".fg-filter-value:not([hidden]), .fg-set-search, .fg-menu-item"))==null||g.focus()}filterSection(e,t){let n=this.grid.columns.getNode(e);if(!n||n.children)return null;let r=this.grid.store.state.locale,i=ue(n.def);return i==="set"?this.setFilter(e,r,t):i?this.conditionFilter(e,i,r,t):null}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null,this.colId=null}section(e){let t=k("div","fg-menu-section");for(let[n,r]of e){let i=k("button","fg-menu-item",{type:"button"});i.textContent=n,i.addEventListener("click",()=>{r(),this.close()}),t.append(i)}return t}actions(e,t,n,r){let i=k("div","fg-menu-actions"),s=k("button","fg-btn",{type:"button"});s.textContent=t.reset,s.addEventListener("click",()=>{this.grid.setFilter(e,null),r()});let a=k("button","fg-btn fg-btn-primary",{type:"button"});return a.textContent=t.apply,a.addEventListener("click",n),i.append(s,a),i}title(e){let t=k("div","fg-menu-title");return t.textContent=e.filter,t}conditionRow(e,t,n,r,i){var h;let s=k("div","fg-filter-cond"),a=k("select","fg-filter-op",{"aria-label":t.filter});if(r){let p=k("option");p.value="",p.textContent="\u2014",a.append(p)}for(let p of Rt[e]){let g=k("option");g.value=p,g.textContent=t.ops[p],a.append(g)}a.value=(h=n==null?void 0:n.op)!=null?h:r?"":Rt[e][0];let l=e==="text"?"text":e,c=k("input","fg-input fg-filter-value",{type:l,placeholder:t.value,"aria-label":t.value}),d=k("input","fg-input fg-filter-value-to",{type:l,placeholder:t.valueTo,"aria-label":t.valueTo});n&&(c.value=n.value!=null?String(n.value):"",d.value="valueTo"in n&&n.valueTo!=null?String(n.valueTo):"");let u=()=>{c.hidden=!a.value||Ii.includes(a.value),d.hidden=a.value!=="between"};a.addEventListener("change",u),u();for(let p of[c,d])p.addEventListener("keydown",g=>g.key==="Enter"&&i());return s.append(a,c,d),{row:s,read:()=>{let p=a.value;if(!p)return null;let g=!Ii.includes(p);if(e==="number"){let w=c.value===""?void 0:Number(c.value),m=d.value===""?void 0:Number(d.value);return!g||w!==void 0?{type:e,op:p,value:w,valueTo:m}:null}return e==="date"?!g||c.value?{type:e,op:p,value:c.value||void 0,valueTo:d.value||void 0}:null:!g||c.value?{type:e,op:p,value:c.value}:null}}}conditionFilter(e,t,n,r){var g,w;let i=this.grid.store.state.filters[e],s=(i==null?void 0:i.type)==="combined"?i.conditions:i?[i]:[],a=((g=s[0])==null?void 0:g.type)===t?s[0]:void 0,l=((w=s[1])==null?void 0:w.type)===t?s[1]:void 0,c=k("div","fg-menu-section fg-filter"),d=()=>{var S;let m=u.read(),y=f.read(),b=((S=h.querySelector("input:checked"))==null?void 0:S.value)==="or"?"or":"and",v=m&&y?{type:"combined",operator:b,conditions:[m,y]}:m!=null?m:y;this.grid.setFilter(e,v),r()},u=this.conditionRow(t,n,a,!1,d),f=this.conditionRow(t,n,l,!0,d),h=k("div","fg-filter-join",{role:"radiogroup"}),p=`fg-join-${e}-${Math.random().toString(36).slice(2,7)}`;for(let m of["and","or"]){let y=k("label"),b=k("input","",{type:"radio",name:p,value:m});b.checked=((i==null?void 0:i.type)==="combined"?i.operator:"and")===m,y.append(b,` ${n[m]}`),h.append(y)}return c.append(this.title(n),u.row,h,f.row,this.actions(e,n,d,r)),c}setFilter(e,t,n){let{grid:r}=this,i=r.columns.getNode(e).def,s=ee(i,t.code),a=r.collator(),l=new Map;for(let C of r.rowModel.allNodes()){let R=j(i,C.data),A=ne(R);l.has(A)||l.set(A,R)}let c=[...l.entries()].sort((C,R)=>bt(C[1],R[1],a)),d=r.store.state.filters[e],u=new Set((d==null?void 0:d.type)==="set"?d.values.map(ne).filter(C=>l.has(C)):l.keys()),f=(C,R)=>C===""?t.blanks:s(R),h=k("div","fg-menu-section fg-filter fg-set-filter"),p=k("input","fg-input fg-set-search",{type:"search",placeholder:t.search,"aria-label":t.search}),g=k("label","fg-set-item fg-set-all"),w=k("input","fg-checkbox",{type:"checkbox"});g.append(w,document.createTextNode(t.selectAll));let m=k("div","fg-set-list"),y=()=>{let C=p.value.trim().toLowerCase();return C?c.filter(([R,A])=>f(R,A).toLowerCase().includes(C)):c},b=()=>{let C=y(),R=C.filter(([A])=>u.has(A)).length;w.checked=R>0&&R===C.length,w.indeterminate=R>0&&R<C.length},v=()=>{let C=y();if(m.replaceChildren(...C.slice(0,Eo).map(([R,A])=>{let x=k("label","fg-set-item"),M=k("input","fg-checkbox",{type:"checkbox"});return M.checked=u.has(R),M.addEventListener("change",()=>{M.checked?u.add(R):u.delete(R),b()}),x.append(M,document.createTextNode(f(R,A))),x})),C.length>Eo){let R=k("div","fg-set-more");R.textContent=`\u2026 +${C.length-Eo}`,m.append(R)}b()};w.addEventListener("change",()=>{for(let[C]of y())w.checked?u.add(C):u.delete(C);v()}),p.addEventListener("input",v);let S=()=>{r.setFilter(e,u.size===l.size?null:{type:"set",values:c.filter(([C])=>u.has(C)).map(([,C])=>C)}),n()};return p.addEventListener("keydown",C=>C.key==="Enter"&&S()),v(),h.append(this.title(t),p,g,m,this.actions(e,t,S,n)),h}};var Di=new WeakMap,al=0;function Ue(o){let e=Di.get(o);return e||Di.set(o,e=`r${++al}`),e}var An=class{constructor(e){this.deps=e;this.stats={filterRuns:0,sortRuns:0};this.server=!1;this.full=[];this.last={};this.nodes=[];this.filtered=[];this.sorted=[];this.display=[];this.indexById=null;this.layoutCache=null;this.quickCache=null}update(e){var u,f,h,p;let t=this.deps.collator(),n=e.display,r=!!(n!=null&&n.getParentId)!=!!((u=this.last.display)!=null&&u.getParentId),i=e.data!==this.last.data,s=i||r||e.filters!==this.last.filters||e.quickFilter!==this.last.quickFilter||e.advancedFilter!==this.last.advancedFilter,a=s||e.sort!==this.last.sort||t!==this.last.collator,l=a||(n==null?void 0:n.version)!==this.last.displayVersion||(n==null?void 0:n.groupBy)!==((f=this.last.display)==null?void 0:f.groupBy);if(i){let g=this.deps.getRowId;this.nodes=e.data.map((w,m)=>({id:g?String(g(w)):Ue(w),data:w,sourceIndex:m}))}s&&(this.filtered=this.filter(e),this.stats.filterRuns++),a&&(this.sorted=Zr(this.filtered,e.sort,g=>this.deps.columnDef(g),t),this.stats.sortRuns++),l&&(this.full=n?this.buildDisplay(n,e.sort,t):this.sorted);let c=(h=e.page)!=null?h:null,d=(p=this.last.page)!=null?p:null;(l||(c==null?void 0:c.index)!==(d==null?void 0:d.index)||(c==null?void 0:c.size)!==(d==null?void 0:d.size))&&(this.display=c?this.full.slice(c.index*c.size,(c.index+1)*c.size):this.full,this.indexById=null,this.layoutCache=null),this.last={...e,collator:t,displayVersion:n==null?void 0:n.version}}invalidate(){this.last={}}fullCount(){return this.full.length}dataCount(){return this.sorted.length}loading(){return!1}getRowCount(){return this.display.length}getRow(e){return this.display[e]}rows(){return this.display}dataRows(){return this.sorted}allNodes(){return this.nodes}idOf(e){return this.deps.getRowId?String(this.deps.getRowId(e)):Ue(e)}indexOfId(e){var t;return this.indexById||(this.indexById=new Map(this.display.map((n,r)=>[n.id,r]))),(t=this.indexById.get(e))!=null?t:-1}layout(e,t,n,r=0,i){var u;let s=this.layoutCache;if(s&&s.rows===this.display&&s.rh===e&&s.dh===t&&s.hv===r)return s;let a=this.display.length,l=new Float64Array(a+1),c=!0,d=n&&n.size?n:null;for(let f=0;f<a;f++){let h=this.display[f],p=e;if(h.kind==="detail")p=t;else if(!h.kind){d&&(p=(u=d.get(h.id))!=null?u:e);let g=i==null?void 0:i(h.data);typeof g=="number"&&g>0&&(p=d?Math.max(p,g):g)}p!==e&&(c=!1),l[f+1]=l[f]+p}return this.layoutCache={rows:this.display,rh:e,dh:t,hv:r,offsets:l,uniform:c},this.layoutCache}quickTexts(e){var r,i,s;let t=[this.nodes,(s=(i=(r=this.deps).textVersion)==null?void 0:i.call(r))!=null?s:"",...e],n=this.quickCache;return n&&n.key.length===t.length&&n.key.every((a,l)=>a===t[l])?n.texts:(this.quickCache={key:t,texts:new WeakMap},this.quickCache.texts)}filter(e){var u;let t=Object.entries(e.filters).map(([f,h])=>({def:this.deps.columnDef(f),pred:Et(h)})).filter(f=>!!f.def),n=rr(e.quickFilter),r=n.length?this.deps.quickColumns():[],i=e.advancedFilter?Bn(e.advancedFilter,f=>this.deps.columnDef(f),j):null;if(!t.length&&!n.length&&!i)return this.nodes;let s=n.length?this.quickTexts(r):null,a=this.nodes.filter(f=>{for(let h of t)if(!h.pred(j(h.def,f.data)))return!1;if(i&&!i(f.data))return!1;if(s){let h=s.get(f.data);if(h===void 0&&(h=r.map(p=>this.deps.format(p,j(p,f.data))).join("").toLowerCase(),s.set(f.data,h)),!ir(n,h))return!1}return!0}),l=(u=e.display)==null?void 0:u.getParentId;if(!l)return a;let c=new Map(this.nodes.map(f=>[f.id,f])),d=new Set(a);for(let f of a){let h=l(f.data),p=new Set;for(;h!=null&&!p.has(h);){p.add(h);let g=c.get(String(h));if(!g)break;d.add(g),h=l(g.data)}}return this.nodes.filter(f=>d.has(f))}isOpen(e,t,n){let r=e.expanded.get(t);return r!==void 0?r:e.defaultExpanded===-1||n<e.defaultExpanded}withDetails(e,t,n){for(let r of t)n.push(r),e.detailOpen.has(r.id)&&(!e.isMaster||e.isMaster(r.data))&&n.push({id:`detail:${r.id}`,data:{},sourceIndex:-1,kind:"detail",detailOf:r})}buildDisplay(e,t,n){let r=[];if(e.getParentId)return this.buildTree(e,r),r;let i=e.groupBy.filter(a=>this.deps.columnDef(a));if(!i.length)return e.detailOpen.size?(this.withDetails(e,this.sorted,r),r):this.sorted;let s=(a,l,c)=>{var g;let d=i[l],u=this.deps.columnDef(d),f=new Map;for(let w of a){let m=j(u,w.data),y=U(m)?"":ne(m),b=f.get(y);b||f.set(y,b={value:m,nodes:[]}),b.nodes.push(w)}let h=((g=t.find(w=>w.colId===d))==null?void 0:g.dir)==="desc"?-1:1,p=[...f.entries()].sort((w,m)=>fn(w[1].value,m[1].value,n,h));for(let[w,m]of p){let y=`${c}${d}:${w}`,b=this.isOpen(e,y,l);r.push({id:`group:${y}`,data:{},sourceIndex:-1,kind:"group",level:l,group:{key:y,colId:d,value:m.value,rows:m.nodes.map(v=>v.data),expanded:b}}),b&&(l+1<i.length?s(m.nodes,l+1,`${y}|`):this.withDetails(e,m.nodes.map(v=>({...v,level:l+1})),r))}};return s(this.sorted,0,""),r}buildTree(e,t){let n=new Set(this.sorted.map(c=>c.id)),r=new Map,i=[];for(let c of this.sorted){let d=e.getParentId(c.data),u=d==null?null:String(d);if(u!==null&&n.has(u)&&u!==c.id){let f=r.get(u);f||r.set(u,f=[]),f.push(c)}else i.push(c)}let s=new Set,a=c=>{var u;let d=[c];for(;d.length;){let f=d.pop();if(!s.has(f.id)){s.add(f.id);for(let h of(u=r.get(f.id))!=null?u:[])d.push(h)}}};for(let c of i)a(c);for(let c of this.sorted){if(s.has(c.id))continue;let d=r.get(String(e.getParentId(c.data))),u=d?d.indexOf(c):-1;u>=0&&d.splice(u,1),i.push(c),a(c)}let l=(c,d,u)=>{var f,h,p;for(let g of c){if(u.has(g.id))continue;let w=(f=r.get(g.id))!=null?f:[],m=!w.length&&!!((h=e.lazyChildren)!=null&&h.call(e,g.id,g.data)),y=w.length>0&&this.isOpen(e,g.id,d),b={...g,level:d,hasChildren:w.length>0||m,expanded:y};m&&((p=e.loading)!=null&&p.has(g.id))&&(b.loading=!0),this.withDetails(e,[b],t),y&&l(w,d+1,new Set([...u,g.id]))}};l(i,0,new Set)}};var ll=1e4,Ao=1e5,dl=4,To=3e3,Tn=class{constructor(e,t,n,r,i,s){this.datasource=e;this.getRowId=t;this.groupBy=n;this.query=r;this.onChange=i;this.onFailed=s;this.levels=new Map;this.gen=0;this.display=null;this.ids=null;this.queue=[];this.inFlight=0;this.retryAt=0;this.version=0;this.builtFor=-1}matches(e,t){return e.join("")===this.groupBy.join("")&&t.sort===this.query.sort&&t.filters===this.query.filters&&t.quickFilter===this.query.quickFilter&&t.advancedFilter===this.query.advancedFilter}purge(){this.gen++,this.queue=[],this.levels.clear(),this.touch()}dispose(){this.gen++,this.queue=[]}touch(){this.version++,this.display=null,this.ids=null}load(e,t,n){this.levels.has(e)||(this.levels.set(e,{state:"loading",nodes:[]}),this.fetch({path:e,keys:t,level:n,start:0,gen:this.gen}))}fetch(e){this.queue.push(e),this.pump()}pump(){for(;this.inFlight<dl&&this.queue.length;){let e=this.queue.shift();e.gen===this.gen&&(this.inFlight++,this.request(e).finally(()=>{this.inFlight--,this.pump()}))}}request({path:e,keys:t,level:n,start:r,gen:i}){let s=n>=this.groupBy.length,a=this.query,l=r+ll,c;try{c=Promise.resolve(this.datasource.getRows({start:r,end:l,sort:[...a.sort],filters:{...a.filters},quickFilter:a.quickFilter,advancedFilter:a.advancedFilter,groupBy:[...this.groupBy],groupKeys:[...t]}))}catch(d){c=Promise.reject(d)}return c.then(d=>{var w,m;if(i!==this.gen)return;let u=Array.isArray(d==null?void 0:d.rows)?d.rows.filter(y=>y!==null&&typeof y=="object"):[];Array.isArray(d==null?void 0:d.rows)||q("datasource.getRows must resolve to { rows: Row[] }");let f=s?u.map((y,b)=>({id:this.getRowId?String(this.getRowId(y)):Ue(y),data:y,sourceIndex:r+b,level:n})):u.map(y=>{let b=this.groupBy[n],v=y[b],S=`${e?`${e}|`:""}${b}:${ne(v)}`,C=typeof y.count=="number"?y.count:typeof y.childCount=="number"?y.childCount:void 0;return{id:`group:${S}`,data:{},sourceIndex:-1,kind:"group",level:n,group:{key:S,colId:b,value:v,rows:[],expanded:!1,count:C,aggregates:y,keys:[...t,v]}}}),h=r?[...(m=(w=this.levels.get(e))==null?void 0:w.nodes)!=null?m:[],...f]:f,p=typeof(d==null?void 0:d.total)=="number"&&d.total>=0?d.total:null,g=u.length>0&&(p!==null?h.length<p:u.length>=l-r);g&&h.length<Ao?(this.levels.set(e,{state:"loading",nodes:h}),this.fetch({path:e,keys:t,level:n,start:h.length,gen:i})):(g&&q(`a server group level has more than ${Ao} rows; only the first ${Ao} are shown`),this.levels.set(e,{state:"loaded",nodes:h})),this.touch(),this.onChange()},d=>{i===this.gen&&(this.levels.set(e,{state:"failed",nodes:[],retryAt:Date.now()+To}),this.touch(),this.onFailed(r,l,d))})}isOpen(e,t,n){let r=e.expanded.get(t);return r!==void 0?r:e.defaultExpanded===-1||n<e.defaultExpanded}rows(e,t){let n=Date.now();if(this.display&&this.builtFor===t&&!(this.retryAt&&n>=this.retryAt))return this.display;let r=[],i=0,s=(a,l,c)=>{var u,f,h;let d=this.levels.get(a);if((d==null?void 0:d.state)==="failed"&&n>=((u=d.retryAt)!=null?u:0)&&(this.levels.delete(a),d=void 0),!d){this.load(a,l,c),r.push({id:`loading:${a}`,data:{},sourceIndex:-1,kind:"loading",level:c});return}if(d.state==="failed"){let p=(f=d.retryAt)!=null?f:0;i=i?Math.min(i,p):p;return}for(let p of d.nodes){if(p.kind!=="group"){r.push(p);continue}let g=p.group,w=this.isOpen(e,g.key,c),m={...p,group:{...g,expanded:w}};r.push(m),w&&s(g.key,(h=g.keys)!=null?h:[],c+1)}d.state==="loading"&&r.push({id:`loading:${a}`,data:{},sourceIndex:-1,kind:"loading",level:c})};return s("",[],0),this.retryAt=i,this.display=r,this.builtFor=t,this.ids=null,r}dataRows(){let e=[];for(let t of this.levels.values())for(let n of t.nodes)n.kind||e.push(n);return e}dataCount(){let e=this.levels.get("");return(e==null?void 0:e.state)==="loaded"&&e.nodes.every(t=>{var n;return typeof((n=t.group)==null?void 0:n.count)=="number"})?e.nodes.reduce((t,n)=>{var r,i;return t+((i=(r=n.group)==null?void 0:r.count)!=null?i:0)},0):this.dataRows().length}loading(){for(let e of this.levels.values())if(e.state==="loading")return!0;return!1}indexOf(e){var t;return this.display?(this.ids||(this.ids=new Map,this.display.forEach((n,r)=>this.ids.set(n.id,r))),(t=this.ids.get(e))!=null?t:-1):-1}};var cl=new Float64Array(0),St=class{constructor(e){this.deps=e;this.stats={filterRuns:0,sortRuns:0};this.server=!0;this.blocks=new Map;this.total=null;this.loadedEnd=0;this.gen=0;this.query=null;this.page=null;this.lastBlock=0;this.version=0;this.cache=null;this.groups=null;this.displayIn=null}get bs(){return this.page?this.page.size:this.deps.blockSize}get base(){return this.page?this.page.index*this.page.size:0}update(e){var a,l,c,d,u,f,h,p,g,w,m,y;let t=(l=(a=e.display)==null?void 0:a.groupBy)!=null?l:[];if(t.length&&!((c=e.display)!=null&&c.getParentId)){let b={sort:e.sort,filters:e.filters,quickFilter:e.quickFilter,advancedFilter:(d=e.advancedFilter)!=null?d:null};(!this.groups||!this.groups.matches(t,b))&&((u=this.groups)==null||u.dispose(),this.groups=new Tn(this.deps.datasource,this.deps.getRowId,[...t],b,()=>this.deps.onLoaded(0,0,null),(v,S,C)=>this.deps.onFailed(v,S,C)),this.touch()),this.displayIn=(f=e.display)!=null?f:null,this.query=null;return}this.groups&&(this.groups.dispose(),this.groups=null,this.query=null,this.touch());let n=this.query,r=!n||n.sort!==e.sort||n.filters!==e.filters||n.quickFilter!==e.quickFilter||n.advancedFilter!==((h=e.advancedFilter)!=null?h:null),i=(p=e.page)!=null?p:null,s=((g=i==null?void 0:i.size)!=null?g:0)!==((m=(w=this.page)==null?void 0:w.size)!=null?m:0);this.query={sort:e.sort,filters:e.filters,quickFilter:e.quickFilter,advancedFilter:(y=e.advancedFilter)!=null?y:null},this.page=i?{...i}:null,(r||s)&&this.purge(),this.ensure(Math.floor(this.base/this.bs))}invalidate(){}purge(){if(this.groups){this.groups.purge();return}this.gen++,this.blocks.clear(),this.total=null,this.loadedEnd=0,this.touch(),this.query&&this.ensure(Math.floor(this.base/this.bs))}touch(){this.version++,this.cache=null}fullCount(){if(this.total!==null)return this.total;if(!this.loadedEnd)return 0;let e=this.blocks.get(Math.floor((this.loadedEnd-1)/this.bs));return this.loadedEnd+(e&&e.nodes.length<this.bs?0:this.bs)}getRowCount(){if(this.groups)return this.groupRows().length;let e=this.fullCount();return this.page?Math.max(0,Math.min(this.page.size,e-this.base)):e}dataCount(){return this.groups?this.groups.dataCount():this.fullCount()}loading(){if(this.groups)return this.groups.loading();for(let e of this.blocks.values())if(e.state==="loading")return!0;return!1}placeholder(e){return{id:`loading:${e}`,data:{},sourceIndex:-1,kind:"loading"}}peek(e){var r;let t=Math.floor(e/this.bs),n=this.blocks.get(t);return(n==null?void 0:n.state)==="loaded"&&(r=n.nodes[e-t*this.bs])!=null?r:null}groupRows(){return this.groups.rows(this.displayIn,this.displayIn.version*1e6+this.groups.version)}getRow(e){if(this.groups)return this.groupRows()[e];let t=this.base+e,n=this.peek(t);return n||(e>=0&&e<this.getRowCount()&&this.ensure(Math.floor(t/this.bs)),this.placeholder(t))}ensure(e){var c;let t=this.blocks.get(e);if(t&&(t.state!=="failed"||Date.now()<((c=t.retryAt)!=null?c:0))||this.total!==null&&e*this.bs>=this.total&&e>0)return;let n=e*this.bs,r=n+this.bs,i=this.gen;this.lastBlock=e,this.blocks.set(e,{state:"loading",nodes:[]});let s=this.query,a=d=>{i===this.gen&&(this.blocks.set(e,{state:"failed",nodes:[],retryAt:Date.now()+To}),this.deps.onFailed(n,r,d))},l;try{l=Promise.resolve(this.deps.datasource.getRows({start:n,end:r,sort:[...s.sort],filters:{...s.filters},quickFilter:s.quickFilter,advancedFilter:s.advancedFilter}))}catch(d){l=Promise.reject(d)}l.then(d=>{if(i!==this.gen)return;let u=Array.isArray(d==null?void 0:d.rows)?d.rows.filter(p=>p!==null&&typeof p=="object"):null;if(!u){q("datasource.getRows must resolve to { rows: Row[], total?: number }"),a(new Error("invalid datasource response"));return}let f=this.deps.getRowId,h=u.slice(0,this.bs).map((p,g)=>({id:f?String(f(p)):Ue(p),data:p,sourceIndex:n+g}));this.blocks.set(e,{state:"loaded",nodes:h}),typeof d.total=="number"&&d.total>=0?this.total=d.total:h.length<this.bs&&(this.total=n+h.length),this.loadedEnd=Math.max(this.loadedEnd,n+h.length),this.evict(),this.touch(),this.deps.onLoaded(n,n+h.length,this.total)},a)}evict(){let e=Math.max(2,this.deps.maxBlocks);if(this.blocks.size<=e)return;let t=[...this.blocks.keys()].sort((n,r)=>Math.abs(r-this.lastBlock)-Math.abs(n-this.lastBlock));for(let n of t){if(this.blocks.size<=e)break;this.blocks.get(n).state!=="loading"&&this.blocks.delete(n)}}built(){var n;if(((n=this.cache)==null?void 0:n.ver)===this.version)return this.cache;let e=[];for(let r of[...this.blocks.keys()].sort((i,s)=>i-s)){let i=this.blocks.get(r);i.state==="loaded"&&e.push(...i.nodes)}let t=new Map;for(let r of e)t.set(r.id,r.sourceIndex);return this.cache={ver:this.version,data:e,rows:null,ids:t},this.cache}rows(){var t;if(this.groups)return this.groupRows();let e=this.built();if(!e.rows){let n=this.getRowCount();e.rows=new Array(n);for(let r=0;r<n;r++)e.rows[r]=(t=this.peek(this.base+r))!=null?t:this.placeholder(this.base+r)}return e.rows}dataRows(){return this.groups?this.groups.dataRows():this.built().data}allNodes(){return this.groups?this.groups.dataRows():this.built().data}idOf(e){return this.deps.getRowId?String(this.deps.getRowId(e)):Ue(e)}indexOfId(e){if(this.groups)return this.groupRows(),this.groups.indexOf(e);let t=this.built().ids.get(e);if(t===void 0)return-1;let n=t-this.base;return n>=0&&n<this.getRowCount()?n:-1}layout(){return{offsets:cl,uniform:!0}}};function $i(o){let e=o.idAt(o.index);if(o.mode==="single"){let t=new Set;return o.toggle&&o.selected.has(e)||t.add(e),{selected:t,anchorIndex:o.index}}if(o.range&&o.anchorIndex!=null){let t=o.toggle?new Set(o.selected):new Set,n=Math.min(o.anchorIndex,o.index),r=Math.max(o.anchorIndex,o.index);for(let i=n;i<=r;i++)t.add(o.idAt(i));return{selected:t,anchorIndex:o.anchorIndex}}if(o.toggle){let t=new Set(o.selected);return t.has(e)?t.delete(e):t.add(e),{selected:t,anchorIndex:o.index}}return{selected:new Set([e]),anchorIndex:o.index}}var Ln=class{constructor(e){this.bus=new Ye;this.current=e}get state(){return this.current}set(e){let t=Object.keys(e).filter(n=>e[n]!==this.current[n]);t.length&&(this.current={...this.current,...e},this.bus.emit("change",t))}};var Lo=o=>!!o&&typeof o=="object"&&!Array.isArray(o)&&Object.getPrototypeOf(o)===Object.prototype;function xe(o,e=0,t=new Map){if(e>8||!(Array.isArray(o)||Lo(o)))return o;let n=t.get(o);if(n)return n;if(Array.isArray(o)){let i=[];t.set(o,i);for(let s of o)i.push(xe(s,e+1,t));return i}let r={};t.set(o,r);for(let[i,s]of Object.entries(o))r[i]=xe(s,e+1,t);return r}function ot(o,e,t=0,n=new Map){if(o===e)return!0;if(t>8||!o||!e||typeof o!="object"||typeof e!="object")return!1;let r=n.get(o);if(r!=null&&r.has(e))return!0;if(r?r.add(e):n.set(o,new Set([e])),Array.isArray(o)||Array.isArray(e))return Array.isArray(o)&&Array.isArray(e)&&o.length===e.length&&o.every((s,a)=>ot(s,e[a],t+1,n));if(!Lo(o)||!Lo(e))return!1;let i=Object.keys(o);return i.length===Object.keys(e).length&&i.every(s=>s in e&&ot(o[s],e[s],t+1,n))}function Ni(o){let e=xe(o);return t=>ot(t,e)?!1:(e=xe(t),!0)}var ul=500;function Oi(o){let e=o.renderer.root,t=0,n=null,r=null,i=()=>{clearTimeout(t),n==null||n.remove(),n=null,r=null},s=d=>{var b;let u=d.dataset.col;if(!u||H(u))return null;let f=o.columns.getNode(u);if(!f)return null;if(d.classList.contains("fg-header-cell"))return(b=f.def.headerTooltip)!=null?b:null;let h=d.closest(".fg-row[data-row]");if(!h||!d.closest(".fg-body"))return null;let p=Number(h.dataset.row),g=o.rowModel.getRow(p);if(!g||g.kind)return null;let w=f.def,m=j(w,g.data),y=ee(w,o.store.state.locale.code)(m);if(typeof w.tooltip=="function")try{let v=w.tooltip({value:m,formatted:y,row:g.data,rowIndex:p,column:w});return v?String(v):null}catch{return q(`tooltip of column "${u}" threw`),null}return w.tooltip===!0?y||null:o.options.overflowTooltip!==!1&&w.tooltip!==!1&&d.scrollWidth>d.clientWidth+1&&d.textContent||null},a=(d,u)=>{n==null||n.remove(),n=k("div",`fg-tooltip fg-theme-${o.store.state.theme}`,{role:"tooltip"}),n.textContent=u,o.applyFontTo(n),oe(e).append(n);let f=d.getBoundingClientRect(),h=n.offsetWidth,p=n.offsetHeight,g=window.innerWidth||1024,w=window.innerHeight||768,m=f.bottom+6+p>w?f.top-p-6:f.bottom+6;n.style.left=`${Math.max(4,Math.min(g-h-4,f.left))}px`,n.style.top=`${Math.max(4,m)}px`},l=d=>{var f,h;let u=(h=(f=d.target).closest)==null?void 0:h.call(f,".fg-cell, .fg-header-cell");!u||u===r||!e.contains(u)||(i(),r=u,t=window.setTimeout(()=>{if(r!==u||!u.isConnected)return;let p=s(u);p&&a(u,p)},ul))},c=d=>{let u=d.relatedTarget;r&&u&&r.contains(u)||i()};return e.addEventListener("pointerover",l),e.addEventListener("pointerout",c),e.addEventListener("pointerdown",i),e.addEventListener("keydown",i),e.addEventListener("wheel",i,{passive:!0}),()=>{i(),e.removeEventListener("pointerover",l),e.removeEventListener("pointerout",c),e.removeEventListener("pointerdown",i),e.removeEventListener("keydown",i),e.removeEventListener("wheel",i)}}var Bi=["blank","notBlank"],Pn=class{constructor(e){this.grid=e;this.popup=null;this.off=[]}get isOpen(){return!!this.popup}columns(){return this.grid.columns.getState().map(e=>this.grid.columns.getNode(e.colId)).filter(e=>e&&!e.children&&!H(e.id)&&ue(e.def)).map(e=>{var r,i;let t=ue(e.def),n=t==="number"?"number":t==="date"?"date":"text";return{id:e.id,label:(i=(r=e.def.header)!=null?r:e.def.field)!=null?i:e.id,kind:n}})}open(){var M,T;this.close();let{grid:e}=this,t=e.store.state.locale,n=this.columns(),r=k("div",`fg-menu fg-filter-builder fg-theme-${e.store.state.theme}`,{role:"dialog","aria-label":t.advancedFilter});e.applyFontTo(r);let i=k("div","fg-chooser-head"),s=k("span","fg-menu-title");s.textContent=t.advancedFilter;let a=k("button","fg-chooser-close",{type:"button","aria-label":t.close});a.textContent="\xD7",a.addEventListener("click",()=>this.close()),i.append(s,a);let l=e.store.state.advancedFilter,c=k("div","fg-filter-join",{role:"radiogroup"}),d=`fg-fb-join-${Math.random().toString(36).slice(2,7)}`;for(let E of["and","or"]){let L=k("label"),F=k("input","",{type:"radio",name:d,value:E});F.checked=((M=l==null?void 0:l.operator)!=null?M:"and")===E,L.append(F,` ${t[E]}`),c.append(L)}let u=k("div","fg-fb-list"),f=[],h=E=>{f.splice(f.indexOf(E),1),E.el.remove()},p=E=>{let L=k("div","fg-fb-row"),F=k("select","fg-filter-op fg-fb-col",{"aria-label":t.columns});for(let J of n){let I=k("option");I.value=J.id,I.textContent=J.label,F.append(I)}let $=k("select","fg-filter-op fg-fb-op",{"aria-label":t.filter}),D=k("input","fg-input fg-fb-value",{type:"text",placeholder:t.value,"aria-label":t.value}),N=k("input","fg-input fg-fb-value-to",{type:"text",placeholder:t.valueTo,"aria-label":t.valueTo}),P=k("button","fg-chooser-close fg-fb-remove",{type:"button","aria-label":t.close});P.textContent="\xD7";let B=()=>{var J,I;return(I=(J=n.find(G=>G.id===F.value))==null?void 0:J.kind)!=null?I:"text"},O=J=>{let I=B();$.replaceChildren(...Rt[I].map(X=>{let Y=k("option");return Y.value=X,Y.textContent=t.ops[X],Y})),J&&Rt[I].includes(J)&&($.value=J);let G=I==="text"?"text":I;D.type=N.type=G,z()},z=()=>{D.hidden=Bi.includes($.value),N.hidden=$.value!=="between"};F.addEventListener("change",()=>O($.value)),$.addEventListener("change",z),E&&n.some(J=>J.id===E.colId)&&(F.value=E.colId);let V=E==null?void 0:E.model;O(V==null?void 0:V.op),(V==null?void 0:V.value)!=null&&(D.value=String(V.value)),(V==null?void 0:V.valueTo)!=null&&(N.value=String(V.valueTo)),L.append(F,$,D,N,P);let _={el:L,read:()=>{let J=B(),I=$.value,G=!Bi.includes(I),X=null;if(J==="number"){let Y=D.value===""?void 0:Number(D.value),pe=N.value===""?void 0:Number(N.value);(!G||Y!==void 0&&!Number.isNaN(Y))&&(X=I==="between"?{type:"number",op:I,value:Y,valueTo:pe}:{type:"number",op:I,value:Y})}else J==="date"?(!G||D.value)&&(X=I==="between"?{type:"date",op:I,value:D.value,valueTo:N.value}:{type:"date",op:I,value:D.value||void 0}):(!G||D.value)&&(X={type:"text",op:I,value:D.value});return X?{colId:F.value,model:X}:null}};return P.addEventListener("click",()=>h(_)),_},g=(E,L)=>{let F=k("div","fg-fb-row fg-fb-group"),$=k("span","fg-fb-group-label");$.textContent=L;let D=k("button","fg-chooser-close fg-fb-remove",{type:"button","aria-label":t.close});D.textContent="\xD7",F.append($,D);let N={el:F,read:()=>E};return D.addEventListener("click",()=>h(N)),N},w=E=>{var D;if("conditions"in E)return g(E,`( ${E.conditions.length} \xD7 ${t[E.operator]} )`);let L=n.find(N=>N.id===E.colId),F=E.model;if(L&&F&&(F.type==="text"||F.type==="number"||F.type==="date"))return p(E);let $=(F==null?void 0:F.type)==="set"?F.values.map(String).join(", "):(F==null?void 0:F.type)==="combined"?`( ${F.conditions.length} \xD7 ${t[F.operator]} )`:"";return g(E,`${(D=L==null?void 0:L.label)!=null?D:E.colId}: ${$}`)},m=E=>{f.push(E),u.append(E.el)};for(let E of(T=l==null?void 0:l.conditions)!=null?T:[])m(w(E));let y=k("button","fg-btn fg-fb-add",{type:"button"});y.textContent=`+ ${t.addCondition}`,y.addEventListener("click",()=>{let E=p();m(E),E.el.querySelector(".fg-fb-value").focus()});let b=k("div","fg-menu-actions"),v=k("button","fg-btn",{type:"button"});v.textContent=t.reset,v.addEventListener("click",()=>{e.setAdvancedFilter(null),this.close()});let S=k("button","fg-btn fg-btn-primary",{type:"button"});S.textContent=t.apply,S.addEventListener("click",()=>{var F;let E=f.map($=>$.read()).filter($=>!!$),L=((F=c.querySelector("input:checked"))==null?void 0:F.value)==="or"?"or":"and";e.setAdvancedFilter(E.length?{operator:L,conditions:E}:null),this.close()}),b.append(v,S),r.append(i,c,u,y,b),oe(e.renderer.root).append(r);let C=e.renderer.root.getBoundingClientRect(),R=r.offsetWidth||460;r.style.left=`${Math.max(4,Math.min(C.left+24,(window.innerWidth||1024)-R-4))}px`,r.style.top=`${Math.max(4,C.top+24)}px`,this.popup=r,f.length||y.click();let A=E=>{ce(E,r)||this.close()},x=E=>{E.key==="Escape"&&this.close()};document.addEventListener("pointerdown",A,!0),document.addEventListener("keydown",x,!0),this.off.push(()=>document.removeEventListener("pointerdown",A,!0),()=>document.removeEventListener("keydown",x,!0))}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var Hi=[{key:"red",style:{background:"#ffc7ce",color:"#9c0006"}},{key:"yellow",style:{background:"#ffeb9c",color:"#9c5700"}},{key:"green",style:{background:"#c6efce",color:"#006100"}},{key:"blue",style:{background:"#dbeafe",color:"#1e3a8a"}},{key:"redText",style:{color:"#dc2626"}},{key:"bold",style:{bold:!0}}],fl=["value","formula","top","bottom","aboveAverage","belowAverage","duplicate","unique","dataBar","colorScale","iconSet"],pl=["gt","gte","lt","lte","eq","ne","between","notBetween","contains","notContains","startsWith","endsWith","blank","notBlank"],Po=["blank","notBlank"],Gi=["dataBar","colorScale","iconSet"],Fn=class{constructor(e){this.grid=e;this.popup=null;this.off=[]}get isOpen(){return!!this.popup}open(e){var V,_,J;this.close();let{grid:t}=this,n=t.columns.getNode(e);if(!n||n.children||H(e))return;let r=t.store.state.locale,i=r.cf,s=(_=(V=n.def.header)!=null?V:n.def.field)!=null?_:e,a=k("div",`fg-menu fg-cf-dialog fg-theme-${t.store.state.theme}`,{role:"dialog","aria-label":`${i.title}: ${s}`});t.applyFontTo(a);let l=k("div","fg-chooser-head"),c=k("span","fg-menu-title");c.textContent=`${i.title} \xB7 ${s}`;let d=k("button","fg-chooser-close",{type:"button","aria-label":r.close});d.textContent="\xD7",d.addEventListener("click",()=>this.close()),l.append(c,d);let u=k("div","fg-cf-list"),f=I=>{var G,X;return(X=(G=i.ops[I])!=null?G:r.ops[I])!=null?X:I},h=I=>{var Y,pe,ie,Q,Ke,rt;let G=(Y=I.type)!=null?Y:"value",X=i.types[G];if(G==="value"){let ae=(pe=I.op)!=null?pe:"eq";return Po.includes(ae)?f(ae):`${f(ae)} ${String((ie=I.value)!=null?ie:"")}${ae==="between"||ae==="notBetween"?` \u2013 ${String((Q=I.valueTo)!=null?Q:"")}`:""}`}return G==="formula"?`${X}: ${(Ke=I.formula)!=null?Ke:""}`:G==="top"||G==="bottom"?`${X} ${(rt=I.rank)!=null?rt:10}${I.percent?"%":""}`:X},p=()=>{var X,Y,pe,ie;u.replaceChildren();let G=t.getConditionalFormats().map((Q,Ke)=>({r:Q,i:Ke})).filter(({r:Q})=>Q.columns.includes(e));if(!G.length){let Q=k("div","fg-cf-empty");Q.textContent=i.none,u.append(Q);return}for(let{r:Q,i:Ke}of G){let rt=k("div","fg-cf-rule"),ae=k("span","fg-cf-sample",{"aria-hidden":"true"});ae.textContent=Q.type==="iconSet"?"\u25B2":Q.type==="dataBar"?"\u25AC":"Aa",(X=Q.style)!=null&&X.background&&(ae.style.background=Q.style.background),(Y=Q.style)!=null&&Y.color&&(ae.style.color=Q.style.color),(pe=Q.style)!=null&&pe.bold&&(ae.style.fontWeight="700"),Q.type==="colorScale"&&(ae.style.background=`linear-gradient(to right, ${((ie=Q.colors)!=null?ie:["#f8696b","#ffeb84","#63be7b"]).join(",")})`);let it=k("span","fg-cf-rule-text");it.textContent=`${h(Q)}${Q.row?` \xB7 ${i.wholeRow}`:""}`,it.title=it.textContent;let $n=k("button","fg-chooser-close",{type:"button","aria-label":`${r.close}: ${it.textContent}`});$n.textContent="\xD7",$n.addEventListener("click",()=>{let Go=t.getConditionalFormats(),zo=Go[Ke];zo.columns=zo.columns.filter(Nn=>Nn!==e),t.setConditionalFormats(Go.filter(Nn=>Nn.columns.length)),p()}),rt.append(ae,it,$n),u.append(rt)}};p();let g=k("div","fg-cf-form"),w=k("select","fg-filter-op fg-cf-wide fg-cf-type",{"aria-label":i.type});for(let I of fl){let G=k("option");G.value=I,G.textContent=i.types[I],w.append(G)}let m=k("select","fg-filter-op fg-cf-wide fg-cf-op",{"aria-label":r.filter});for(let I of pl){let G=k("option");G.value=I,G.textContent=f(I),m.append(G)}let y=n.def.type==="number",b=k("input","fg-input fg-cf-value",{type:y?"number":"text",placeholder:r.value,"aria-label":r.value}),v=k("input","fg-input fg-cf-value-to",{type:y?"number":"text",placeholder:r.valueTo,"aria-label":r.valueTo}),S=k("input","fg-input fg-cf-wide fg-cf-formula",{type:"text",placeholder:`=${(J=n.def.field)!=null?J:e} > 100`,"aria-label":i.types.formula,spellcheck:"false"}),C=k("input","fg-input fg-cf-rank",{type:"number",min:"1",value:"10","aria-label":i.count}),R=k("label","fg-cf-pct"),A=k("input","",{type:"checkbox"});R.append(A," %");let x=k("div","fg-cf-swatches fg-cf-wide",{role:"group","aria-label":i.style}),M=0;Hi.forEach((I,G)=>{let X=k("button","fg-cf-swatch",{type:"button","aria-label":i.styles[I.key],title:i.styles[I.key],"aria-pressed":String(G===M)});X.textContent=I.key==="bold"?"B":"Aa",I.style.background&&(X.style.background=I.style.background),I.style.color&&(X.style.color=I.style.color),X.addEventListener("click",()=>{M=G;for(let Y of x.children)Y.setAttribute("aria-pressed",String(Y===X))}),x.append(X)});let T=k("label","fg-cf-wide fg-cf-row"),E=k("input","",{type:"checkbox"});T.append(E,` ${i.wholeRow}`),g.append(w,m,b,v,S,C,R,x,T);let L=()=>{let I=w.value,G=m.value;m.hidden=I!=="value",b.hidden=I!=="value"||Po.includes(G),v.hidden=I!=="value"||G!=="between"&&G!=="notBetween",S.hidden=I!=="formula",C.hidden=R.hidden=I!=="top"&&I!=="bottom",x.hidden=Gi.includes(I),T.hidden=I!=="value"&&I!=="formula"};w.addEventListener("change",L),m.addEventListener("change",L),L();let F=()=>{let I=w.value,G={columns:[e],type:I},X=Y=>y&&Y.value!==""?Number(Y.value):Y.value;if(I==="value"){if(G.op=m.value,!Po.includes(G.op)){if(b.value==="")return null;if(G.value=X(b),G.op==="between"||G.op==="notBetween"){if(v.value==="")return null;G.valueTo=X(v)}}}else if(I==="formula"){let Y=S.value.trim();if(!Y)return null;G.formula=Y.startsWith("=")?Y:`=${Y}`}else(I==="top"||I==="bottom")&&(G.rank=Math.max(1,Math.floor(Number(C.value)||10)),A.checked&&(G.percent=!0));return Gi.includes(I)||(G.style={...Hi[M].style}),E.checked&&(I==="value"||I==="formula")&&(G.row=!0),G},$=k("div","fg-menu-actions"),D=k("button","fg-btn",{type:"button"});D.textContent=i.clear,D.addEventListener("click",()=>{t.setConditionalFormats(t.getConditionalFormats().map(I=>({...I,columns:I.columns.filter(G=>G!==e)})).filter(I=>I.columns.length)),p()});let N=k("button","fg-btn fg-btn-primary",{type:"button"});N.textContent=i.add,N.addEventListener("click",()=>{let I=F();if(!I){(w.value==="formula"?S:b).focus();return}t.setConditionalFormats([...t.getConditionalFormats(),I]),b.value=v.value=S.value="",p()}),$.append(D,N),a.append(l,u,g,$),oe(t.renderer.root).append(a);let P=t.renderer.root.getBoundingClientRect(),B=a.offsetWidth||340;a.style.left=`${Math.max(4,Math.min(P.left+24,(window.innerWidth||1024)-B-4))}px`,a.style.top=`${Math.max(4,P.top+24)}px`,this.popup=a,w.focus();let O=I=>{ce(I,a)||this.close()},z=I=>{I.key==="Escape"&&this.close()};document.addEventListener("pointerdown",O,!0),document.addEventListener("keydown",z,!0),this.off.push(()=>document.removeEventListener("pointerdown",O,!0),()=>document.removeEventListener("keydown",z,!0))}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var hl=["text","number","date","set","combined"],ml=["bar","stackedBar","line","area","pie","donut","combo","scatter"],gl=30;function wl(o,e,t,n){var h,p;let r={id:e,header:(p=(h=t.header)!=null?h:t.field)!=null?p:e};t.type&&(r.type=t.type),t.formula&&(r.formula=t.formula),t.aggFunc&&typeof t.aggFunc=="string"&&(r.aggFunc=t.aggFunc);let i=0,s=new Map,a=1/0,l=-1/0,c=0,d=0,u="",f="";for(let g of n){let w=j(t,g);if(U(w)){i++;continue}if(typeof w=="number"&&Number.isFinite(w))d++,c+=w,w<a&&(a=w),w>l&&(l=w);else if(t.type==="date"){let m=w instanceof Date?w.toISOString().slice(0,10):String(w);(!u||m<u)&&(u=m),(!f||m>f)&&(f=m)}if(s.size<5e3){let m=ne(w),y=s.get(m);y?y.n++:s.set(m,{value:w,n:1})}}return r.blanks=i,r.distinct=s.size,d&&Object.assign(r,{min:a,max:l,avg:Math.round(c/d*1e3)/1e3}),u&&Object.assign(r,{min:u,max:f}),!d&&s.size&&(r.top=[...s.values()].sort((g,w)=>w.n-g.n).slice(0,12).map(g=>({value:String(g.value).slice(0,80),count:g.n}))),r}function yl(o,e,t){let n=o.rowModel.dataRows().map(c=>c.data),r=o.columns.getState().map(c=>o.columns.getNode(c.colId)).filter(c=>c&&!c.children&&!H(c.id)),i=r.map(c=>{var d;return{...wl(o,c.id,c.def,n),hidden:((d=o.columns.getState().find(u=>u.colId===c.id))==null?void 0:d.hide)||void 0}}),s=typeof t.sampleRows=="number"&&t.sampleRows>=0?Math.min(50,t.sampleRows):5,a=n.slice(0,s).map(c=>Object.fromEntries(r.map(d=>[d.id,j(d.def,c)]))),l=o.store.state;return{prompt:String(e).slice(0,2e3),locale:l.locale.code,rowCount:n.length,totalRows:o.rowModel.server?n.length:o.store.state.data.length,columns:i,sample:a,state:{sort:l.sort,filters:l.filters,quickFilter:l.quickFilter,advancedFilter:l.advancedFilter,groupBy:o.getGroupBy(),pivot:o.getPivot(),conditionalFormats:o.getConditionalFormats()},...t.context?{context:t.context()}:{}}}function bl(o,e){var u;let t={state:o.api.getState(),defs:o.columnDefs(),summary:o.summaryOptions()},n=[],r=[],i=[],s=Array.isArray(e)?e.slice(0,gl):[],a=f=>typeof f=="string"&&!!o.columns.getNode(f)&&!o.columns.getNode(f).children&&!H(f),l=f=>n.push(f),c=(f,h)=>r.push({action:f,reason:h});for(let f of s){let h=f;if(!h||typeof h!="object"||typeof h.type!="string"){c(f,"not an action");continue}try{switch(h.type){case"sort":{let p=(Array.isArray(h.sort)?h.sort:[]).filter(g=>!!g&&a(g.colId)&&(g.dir==="asc"||g.dir==="desc"));Array.isArray(h.sort)&&p.length!==h.sort.length&&c(h,"unknown column in sort"),o.setSort(p.map(g=>({colId:g.colId,dir:g.dir}))),l(h);break}case"filter":{if(!a(h.colId)){c(h,"unknown column");break}let p=h.model;if(p!==null&&(!p||typeof p!="object"||!hl.includes(p.type))){c(h,"bad filter model");break}o.setFilter(h.colId,p),l(h);break}case"clearFilters":for(let p of Object.keys(o.store.state.filters))o.setFilter(p,null);o.setAdvancedFilter(null),o.api.setQuickFilter(""),l(h);break;case"quickFilter":o.api.setQuickFilter(typeof h.text=="string"?h.text.slice(0,200):""),l(h);break;case"advancedFilter":{let p=h.filter,g=[],w=m=>{let y=m;Array.isArray(y==null?void 0:y.conditions)?y.conditions.forEach(w):g.push(y==null?void 0:y.colId)};if(p&&w(p),p&&(!Array.isArray(p.conditions)||!g.every(a))){c(h,"unknown column in advanced filter");break}o.setAdvancedFilter(p!=null?p:null),l(h);break}case"groupBy":{let p=Array.isArray(h.colIds)?h.colIds.filter(a):[];o.setGroupBy(p),h.expand&&o.expandAll(!0),l(h);break}case"pivot":{let p=h.pivot;if(p&&(!Array.isArray(p.rows)||!Array.isArray(p.values)||!p.rows.every(a)||!((u=p.columns)!=null?u:[]).every(a)||!p.values.every(g=>g&&a(g.colId)))){c(h,"unknown column in pivot");break}o.setPivot(p!=null?p:null),l(h);break}case"showColumns":case"hideColumns":{let p=Array.isArray(h.colIds)?h.colIds.filter(a):[];p.length&&o.setColumnsVisible(p,h.type==="showColumns"),l(h);break}case"conditionalFormat":{let p=h.format;if(!p||!Array.isArray(p.columns)||!p.columns.length||!p.columns.every(a)){c(h,"unknown column in format");break}o.setConditionalFormats([...o.getConditionalFormats(),p]),l(h);break}case"clearConditionalFormats":o.setConditionalFormats([]),l(h);break;case"addColumn":{let p=h.column;if(!p||typeof p.id!="string"||!/^[\w.-]{1,40}$/.test(p.id)||o.columns.getNode(p.id)){c(h,"bad or taken column id");break}let g=typeof p.formula=="string"?p.formula.startsWith("=")?p.formula:`=${p.formula}`:"";if(!(g?Er(g):null)){c(h,"formula does not parse");break}let m={id:p.id,header:typeof p.header=="string"?p.header.slice(0,80):p.id,formula:g};(p.type==="number"||p.type==="date"||p.type==="text")&&(m.type=p.type),o.api.setColumns([...o.columnDefs(),m]),l(h);break}case"summary":{let p=h.summary;if(p&&(!Array.isArray(p.rows)||!p.rows.every(g=>{var w;return g&&Object.keys((w=g.columns)!=null?w:{}).every(a)}))){c(h,"unknown column in summary");break}o.setSummary(p!=null?p:null),l(h);break}case"chart":{let p=Array.isArray(h.colIds)?h.colIds.filter(a):[],g=o.columns.displayed().map(b=>b.id),w=p.map(b=>g.indexOf(b)).filter(b=>b>=0),m=o.rowModel.getRowCount();if(!w.length||!m){c(h,"nothing to chart");break}let y={start:{rowIndex:0,colId:g[Math.min(...w)]},end:{rowIndex:Math.min(m,200)-1,colId:g[Math.max(...w)]}};i.push(o.api.createChart({type:ml.includes(h.chartType)?h.chartType:"bar",range:y,title:typeof h.title=="string"?h.title.slice(0,80):void 0})),l(h);break}case"message":l(h);break;default:c(h,"unknown action")}}catch{c(h,"failed")}}return{applied:n,skipped:r,undo:()=>{for(let f of i)f.destroy();(o.columnDefs().length!==t.defs.length||o.columnDefs().some((f,h)=>f!==t.defs[h]))&&o.api.setColumns(t.defs),o.setSummary(t.summary),o.api.setState(t.state),t.state.conditionalFormats||o.setConditionalFormats([])}}}async function In(o,e,t,n){var c,d;if(!(t!=null&&t.url))throw new Error("assistant.url is not set");let r=typeof t.headers=="function"?t.headers():(c=t.headers)!=null?c:{},i=await fetch(t.url,{method:"POST",credentials:(d=t.credentials)!=null?d:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json",...r},body:JSON.stringify(yl(o,e,t)),signal:n});if(!i.ok)throw new Error(`HTTP ${i.status} from the assistant`);let s=await i.json(),a=bl(o,Array.isArray(s==null?void 0:s.actions)?s.actions:[]),l=typeof(s==null?void 0:s.message)=="string"?s.message:a.applied.filter(u=>u.type==="message").map(u=>{var f;return(f=u.text)!=null?f:""}).join(`
53
- `);return{...a,message:l.slice(0,4e3)}}var Dn=class{constructor(e){this.grid=e;this.popup=null;this.log=null;this.off=[];this.busy=null}get isOpen(){return!!this.popup}open(){var m,y;if(this.popup){(m=this.popup.querySelector(".fg-ai-input"))==null||m.focus();return}let{grid:e}=this,t=e.store.state.locale,n=e.options.assistant,r=k("div",`fg-menu fg-ai-panel fg-theme-${e.store.state.theme}`,{role:"dialog","aria-label":t.ai.title});e.applyFontTo(r);let i=k("div","fg-chooser-head"),s=k("span","fg-menu-title");s.textContent=t.ai.title;let a=k("button","fg-chooser-close",{type:"button","aria-label":t.close});a.textContent="\xD7",a.addEventListener("click",()=>this.close()),i.append(s,a);let l=k("div","fg-ai-log",{role:"log","aria-live":"polite"});this.log=l;let c=k("form","fg-ai-form"),d=k("textarea","fg-input fg-ai-input",{rows:"2",placeholder:t.ai.placeholder,"aria-label":t.ai.placeholder,maxlength:"2000"}),u=k("button","fg-btn fg-btn-primary fg-ai-send",{type:"submit"});u.textContent=t.ai.send,c.append(d,u);let f=k("div","fg-ai-tips");for(let b of((y=n==null?void 0:n.suggestions)!=null?y:[]).slice(0,6)){let v=k("button","fg-ai-tip",{type:"button"});v.textContent=b,v.addEventListener("click",()=>{d.value=b,d.focus()}),f.append(v)}d.addEventListener("keydown",b=>{var v,S;b.key==="Enter"&&!b.shiftKey&&!b.isComposing&&(b.preventDefault(),(S=(v=c.requestSubmit)==null?void 0:v.call(c))!=null||c.dispatchEvent(new Event("submit",{cancelable:!0})))}),c.addEventListener("submit",b=>{b.preventDefault();let v=d.value.trim();!v||this.busy||(d.value="",this.ask(v,u))}),r.append(i,l,c),f.childElementCount&&r.append(f),oe(e.renderer.root).append(r);let h=e.renderer.root.getBoundingClientRect(),p=r.offsetWidth||360;r.style.left=`${Math.max(4,Math.min(h.right-p-16,(window.innerWidth||1024)-p-4))}px`,r.style.top=`${Math.max(4,h.top+16)}px`,this.popup=r,d.focus();let g=b=>{!ce(b,r)&&!this.busy&&this.close()},w=b=>{b.key==="Escape"&&this.close()};document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",w,!0),this.off.push(()=>document.removeEventListener("pointerdown",g,!0),()=>document.removeEventListener("keydown",w,!0))}say(e,t){var r;let n=k("div",`fg-ai-msg fg-ai-${e}`);return n.textContent=t,(r=this.log)==null||r.append(n),this.log&&(this.log.scrollTop=this.log.scrollHeight),n}async ask(e,t){let n=this.grid.store.state.locale;this.say("user",e);let r=this.say("ai",n.ai.thinking);r.classList.add("fg-ai-wait"),this.busy=new AbortController,t.disabled=!0;try{let i=await In(this.grid,e,this.grid.options.assistant,this.busy.signal);r.classList.remove("fg-ai-wait");let s=i.applied.filter(a=>a.type!=="message").length;if(r.textContent=i.message||(s?n.ai.done:""),i.skipped.length){let a=k("div","fg-ai-note");a.textContent=`${n.ai.skipped}: ${i.skipped.map(l=>l.reason).join(", ")}`,r.append(a)}if(s){let a=k("button","fg-btn fg-ai-undo",{type:"button"});a.textContent=n.ai.undo,a.addEventListener("click",()=>{i.undo(),a.disabled=!0,a.textContent=n.ai.undone}),r.append(a)}this.grid.events.emit("assistantAnswer",{prompt:e,message:i.message,applied:i.applied,skipped:i.skipped})}catch(i){if((i==null?void 0:i.name)==="AbortError")return;r.remove(),this.say("error",n.ai.failed)}finally{this.busy=null,t.disabled=!1}}close(){var e,t;(e=this.busy)==null||e.abort(),this.busy=null;for(let n of this.off)n();this.off=[],(t=this.popup)==null||t.remove(),this.popup=null,this.log=null}};var zi=o=>Math.round(o*2.75),Vi=o=>Math.round(o*3.1),Fo=13,Io={compact:[.8,.85],normal:[1,1],comfortable:[1.25,1.15]},vl=[],xl=100,qi=new Map;function Ce(o){return o.every(e=>e!==null&&typeof e=="object")?o:(q("data contains entries that are not objects; they were skipped"),o.filter(e=>e!==null&&typeof e=="object"))}var Do=class{constructor(e,t){this.options=t;this.events=new Ye;this.pinnedRows={top:[],bottom:[]};this.spanCache=null;this.editVersion=0;this.tracker=new rn;this.history=new on;this.disposers=[];this.collatorCache=null;this.destroyed=!1;this.summaryOpts=null;this.summaryValues=[];this.groupBy=[];this.expanded=new Map;this.defaultExpanded=0;this.detailOpen=new Set;this.displayVersion=0;this.aggCache={ver:-1,map:new WeakMap};this.charts=new Rn(this);this.sourceDefs=[];this.pivotCfg=null;this.pivotData=null;this.savedGroup=null;this.page=0;this.pageSize=xl;this.formulaScope={off:()=>!this.allow("formulas"),rows:()=>this.store.state.data,version:()=>this.editVersion,computed:e=>{var n;let t=(n=this.columns.getNode(e))==null?void 0:n.def;return t&&typeof t.formula=="string"&&t.formula.startsWith("=")?t.formula:void 0}};this.cfRules=[];this.cfRowsSrc=null;this.sourceSnapshot=void 0;this.summarySnapshot=null;this.cfRows=[];this.formats=new cn({rules:()=>this.cfRules,rows:()=>{let e=this.rowModel.dataRows();return this.cfRowsSrc!==e&&(this.cfRowsSrc=e,this.cfRows=e.map(t=>t.data)),this.cfRows},value:(e,t)=>{var r;let n=(r=this.columns.getNode(e))==null?void 0:r.def;return n?j(n,t):void 0},version:()=>this.editVersion,formula:(e,t)=>Ot(e,t,new Set,0,new Map,this.formulaScope)});this.formatDialog=new Fn(this);this.assistantPanel=new Dn(this);this.forcedOverlay=null;this.filterBuilder=new Pn(this);this.flashing=new Map;this.flashTimer=0;this.txQueue=[];this.txTimer=0;this.keepRange=!1;this.rowNumberCache=null;this.treeLoaded=new Set;this.treeLoading=new Set;this.lazyChildren=(e,t)=>{var n,r;if(this.treeLoaded.has(e))return!1;try{return!!((r=(n=this.options.treeData)==null?void 0:n.hasChildren)!=null&&r.call(n,t))}catch{return!1}};this.density="normal";this.aggMemo=null;this.selectionVersion=0;this.selectableCache=null;var s,a,l,c,d,u,f,h,p;this.paid=Li(t.licenseKey),Array.isArray(t.columns)||q("options.columns must be an array"),t.data!=null&&!Array.isArray(t.data)&&q("options.data must be an array"),this.store=new Ln({data:Array.isArray(t.data)?Ce(t.data):[],sort:[],filters:{},quickFilter:"",selected:new Set,anchorId:null,focus:null,range:null,extraRanges:[],advancedFilter:null,locale:st(t.locale),theme:(s=t.theme)!=null?s:"light"}),this.sourceDefs=Array.isArray(t.columns)?t.columns:[],this.sourceSnapshot=xe(this.sourceDefs),this.columns=new Lt(this.withSelect(this.sourceDefs)),this.bindFormulas();let n=t.pagination;n&&typeof n=="object"&&n.pageSize!==void 0&&(Number.isInteger(n.pageSize)&&n.pageSize>0?this.pageSize=n.pageSize:q("pagination.pageSize must be a positive integer")),t.datasource&&typeof t.datasource.getRows!="function"&&q("datasource.getRows must be a function"),this.rowModel=t.datasource&&typeof t.datasource.getRows=="function"?new St({datasource:t.datasource,blockSize:Number.isInteger(t.blockSize)&&t.blockSize>0?t.blockSize:100,maxBlocks:Number.isInteger(t.maxBlocks)&&t.maxBlocks>0?t.maxBlocks:100,getRowId:t.getRowId,onLoaded:(g,w,m)=>this.serverLoaded(g,w,m),onFailed:(g,w,m)=>this.serverFailed(g,w,m)}):new An({getRowId:t.getRowId,columnDef:g=>{var w;return(w=this.columns.getNode(g))==null?void 0:w.def},quickColumns:()=>this.columns.displayed().filter(g=>!H(g.id)).map(g=>g.def),format:(g,w)=>ee(g,this.store.state.locale.code)(w),collator:()=>this.collator(),textVersion:()=>`${this.store.state.locale.code}|${this.editVersion}`}),(a=t.groupBy)!=null&&a.length&&this.allow(this.rowModel.server?"serverGroups":"grouping")&&(this.groupBy=this.validGroupBy(t.groupBy)),Array.isArray(t.conditionalFormats)&&t.conditionalFormats.length&&this.allow("conditional")&&(this.cfRules=t.conditionalFormats.filter(g=>g&&typeof g=="object"&&Array.isArray(g.columns)).map(g=>({...g,columns:[...g.columns]}))),this.defaultExpanded=(t.treeData||this.paid)&&(l=t.groupDefaultExpanded)!=null?l:0,t.treeData&&!t.getRowId&&q("treeData needs getRowId so parent ids can be matched"),this.updateRows(),this.summaryOpts=t.summary&&this.allow("summary")?t.summary:null,this.summarySnapshot=xe(this.summaryOpts),this.refreshSummary();let r=t.fontSize!=null&&t.fontSize>0?t.fontSize:null;t.fontSize!=null&&!(t.fontSize>0)&&q("fontSize must be a positive number"),this.font={size:r,family:(c=t.fontFamily)!=null?c:null};let i=r!=null?r:Fo;if(this.renderer=new zt(e,this,{rowHeight:(d=t.rowHeight)!=null?d:Math.round(zi(i)*Io[this.densityOf(t.density)][0]),headerHeight:(u=t.headerHeight)!=null?u:Math.round(Vi(i)*Io[this.densityOf(t.density)][1])}),this.density=this.densityOf(t.density),this.renderer.applyTheme(),t.flashDuration&&this.renderer.root.style.setProperty("--fg-flash-duration",`${this.flashMs()}ms`),this.renderer.applyFont(this.font.size,this.font.family),this.menu=new En(this),this.chooser=new _t(this),this.contextMenu=new Jt(this),this.editor=new nn(this),this.finder=new Qt(this),this.fillHandle=new Yt(this),this.groupPanel=t.groupPanel&&this.allow("grouping")?new Vt(this):null,this.pinnedRows={top:Ce((f=t.pinnedTopRows)!=null?f:[]),bottom:Ce((h=t.pinnedBottomRows)!=null?h:[])},this.sideBar=t.sideBar&&this.allow("sideBar")?new Xt(this,typeof t.sideBar=="object"&&!!t.sideBar.open,(p=typeof t.sideBar=="object"?t.sideBar.panels:void 0)!=null?p:t.pivot||t.pivotPanel?["columns","filters","pivot"]:void 0):null,this.disposers.push(this.store.bus.on("change",g=>this.onChange(g)),Ur(this),Gr(this),()=>this.menu.close(),()=>this.chooser.close(),()=>this.contextMenu.destroy(),()=>this.editor.destroy(),()=>this.fillHandle.destroy(),()=>{var g;return(g=this.groupPanel)==null?void 0:g.destroy()},()=>this.charts.destroy(),()=>this.filterBuilder.close(),()=>this.formatDialog.close(),()=>this.assistantPanel.close(),Oi(this)),typeof ResizeObserver!="undefined"){let g=new ResizeObserver(()=>this.renderer.schedule());g.observe(this.renderer.main),this.disposers.push(()=>g.disconnect())}t.pivot&&this.setPivot(t.pivot),Ei(t.licenseKey).then(g=>{g&&!this.destroyed&&this.renderer.showFreeBadge()}),this.renderer.render(),this.api=this.createApi(),qt.set(this.renderer.root,this),eo.set(this.api,this),Pi(t.licenseKey)}get valuesVersion(){return this.editVersion}rangesOn(){return this.options.rangeSelection!==!1&&this.paid}allow(e){return this.paid?!0:(Fi(e),!1)}columnDefs(){return[...this.sourceDefs]}summaryOptions(){return this.summaryOpts?JSON.parse(JSON.stringify(this.summaryOpts)):null}setConditionalFormats(e){if(!Array.isArray(e)){q("setConditionalFormats: formats must be an array");return}e.length&&!this.allow("conditional")||(this.cfRules=e.filter(t=>t&&typeof t=="object"&&Array.isArray(t.columns)).map(t=>({...t,columns:[...t.columns]})),this.renderer.invalidate({rows:!0}),this.events.emit("conditionalFormatsChange",{formats:this.getConditionalFormats()}))}getConditionalFormats(){return JSON.parse(JSON.stringify(this.cfRules))}cellFormat(e,t,n){return this.cfRules.length?this.formats.cell(t,e,n):null}bindFormulas(){var n;let e=[],t=r=>{for(let i of r)!i||typeof i!="object"||(e.push(i),Array.isArray(i.children)&&t(i.children))};t(this.sourceDefs);for(let r of this.columns.getState()){let i=(n=this.columns.getNode(r.colId))==null?void 0:n.def;i&&e.push(i)}Sr(e,this.formulaScope)}collator(){var t;let e=this.store.state.locale.code;return((t=this.collatorCache)==null?void 0:t.code)!==e&&(this.collatorCache={code:e,collator:new Intl.Collator(e,{numeric:!0,sensitivity:"base"})}),this.collatorCache.collator}layoutChanged(){this.renderer.invalidateHeights(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}columnsChanged(){this.rowModel.invalidate(),this.updateRows(),this.refreshSummary(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}display(){var e,t;return{groupBy:this.options.treeData?vl:this.groupBy,getParentId:(e=this.options.treeData)==null?void 0:e.getParentId,expanded:this.expanded,defaultExpanded:this.defaultExpanded,detailOpen:this.options.detailRenderer?this.detailOpen:new Set,isMaster:this.options.isRowMaster,lazyChildren:(t=this.options.treeData)!=null&&t.hasChildren?this.lazyChildren:void 0,loading:this.treeLoading,version:this.displayVersion}}updateRows(){var n;let e=!!this.options.pagination,t=(n=this.pivotData)!=null?n:this.store.state.data;this.rowModel.update({...this.store.state,data:t,display:this.display(),page:e?{index:this.page,size:this.pageSize}:null}),e&&this.page>=this.getPageCount()&&(this.page=this.getPageCount()-1,this.rowModel.update({...this.store.state,data:t,display:this.display(),page:{index:this.page,size:this.pageSize}}))}viewRows(){var e;return(e=this.pivotData)!=null?e:this.store.state.data}sourceLeaves(){let e=[],t=n=>{var r,i;for(let s of n)!s||typeof s!="object"||(Array.isArray(s.children)?t(s.children):((r=s.id)!=null?r:s.field)&&e.push({id:(i=s.id)!=null?i:s.field,def:s}))};return t(this.sourceDefs),e}getPivot(){let e=this.pivotCfg;if(!e)return null;let t={rows:[...e.rows],columns:[...e.columns],values:e.values.map(n=>({...n}))};return e.totals||(t.totals=!1),t}setPivot(e){if(e&&!this.allow("pivot")||e&&this.clientOnly("pivot"))return;if(e&&(typeof e!="object"||!Array.isArray(e.rows)||!Array.isArray(e.values))){q("setPivot: expected { rows: string[], values: [...] }");return}if(this.editor.cancel(),!e){if(!this.pivotCfg)return;this.pivotCfg=null,this.pivotData=null,this.columns.setDefs(this.withSelect(this.sourceDefs)),this.savedGroup&&(this.groupBy=this.savedGroup.groupBy,this.expanded=this.savedGroup.expanded,this.defaultExpanded=this.savedGroup.defaultExpanded,this.savedGroup=null),this.afterPivotSwitch();return}let t=new Set(this.sourceLeaves().map(r=>r.id));this.pivotCfg||(this.savedGroup={groupBy:this.groupBy,expanded:this.expanded,defaultExpanded:this.defaultExpanded});let n=Co(e,r=>t.has(r));this.pivotCfg&&pi(n,this.pivotCfg)||(this.pivotCfg=n,this.expanded=new Map,this.defaultExpanded=-1,this.rebuildPivot(!1),this.afterPivotSwitch())}afterPivotSwitch(){var e;this.page=0,this.store.set({sort:[],filters:{},range:null,focus:null}),this.rowModel.invalidate(),this.updateRows(),this.displayVersion++,this.updateRows(),(e=this.groupPanel)==null||e.refresh(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers(),this.events.emit("pivotChange",{pivot:this.getPivot()})}rebuildPivot(e=!0){let t=this.pivotCfg;if(!t)return;let n=this.store.state.locale,r=new Map(this.sourceLeaves().map(c=>[c.id,c.def])),i={sum:n.sum,avg:n.avg,min:n.min,max:n.max,count:n.count},s=hi(this.store.state.data,t,c=>r.get(c),{total:n.total,blank:n.blanks,agg:c=>{var d;return(d=i[c])!=null?d:c}},n.code);if(this.pivotData=s.rows,this.columns.setDefs(this.withSelect(s.columns)),this.groupBy=s.groupBy,!e)return;let a=c=>!!this.columns.getNode(c),l=this.store.state;(l.sort.some(c=>!a(c.colId))||Object.keys(l.filters).some(c=>!a(c)))&&this.store.set({sort:l.sort.filter(c=>a(c.colId)),filters:Object.fromEntries(Object.entries(l.filters).filter(([c])=>a(c)))}),this.rowModel.invalidate(),this.displayVersion++,this.updateRows(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}isFlashing(e,t){return this.flashing.size>0&&this.flashing.has(`${e}\0${t}`)}flashClass(e,t){if(!this.flashing.size)return"";let n=this.flashing.get(`${e}\0${t}`);return n?n.dir?` fg-cell-flash fg-cell-flash-${n.dir}`:" fg-cell-flash":""}flashMs(){let e=this.options.flashDuration;return typeof e=="number"&&e>0?e:1e3}flash(e){let t=this.flashMs(),n=Date.now()+t;for(let[i,s]of e)this.flashing.set(i,{until:n,dir:s});if(this.flashTimer)return;let r=()=>{let i=Date.now(),s=new Set,a=1/0;for(let[l,c]of this.flashing)c.until<=i?(this.flashing.delete(l),s.add(l.slice(0,l.indexOf("\0")))):a=Math.min(a,c.until);s.size&&this.renderer.invalidateRowIds(s),this.flashTimer=this.flashing.size&&!this.destroyed?window.setTimeout(r,Math.max(16,a-i)):0};this.flashTimer=window.setTimeout(r,t)}applyTransaction(e){return!e||typeof e!="object"?{added:[],updated:[],removed:[],notFound:[]}:this.applyTransactions([e])}applyTransactions(e){var c,d;let t={added:[],updated:[],removed:[],notFound:[]};if(this.clientOnly("applyTransaction"))return t;let n=new Map;for(let u of this.columns.getState()){let f=(c=this.columns.getNode(u.colId))==null?void 0:c.def.field;f&&n.set(f,[...(d=n.get(f))!=null?d:[],u.colId])}let r=new Map,i={fields:new Set,ids:new Set},s=this.store.state.data,a=new Set(s),l=new Map(s.map(u=>[this.rowModel.idOf(u),u]));for(let u of e)u&&typeof u=="object"&&(s=this.txStep(u,s,{present:a,byId:l},t,r,n,i));if(!t.added.length&&!t.updated.length&&!t.removed.length)return t.notFound.length&&this.events.emit("transactionApplied",t),t;if(this.editVersion++,s===this.store.state.data&&!this.viewReads(i.fields)){(this.options.autoRowHeight||this.options.getRowHeight)&&this.renderer.invalidateHeights(),this.refreshSummary();let u=this.columns.displayed().some(f=>f.def.formula||f.def.formulas);u?this.finder.refresh():this.finder.refreshRows(i.ids),this.options.getRowHeight||u||this.columns.displayed().some(f=>f.def.merge||f.def.rowSpan)||this.formats.dependsOnOtherRows()?this.renderer.invalidate({rows:!0}):this.renderer.invalidateRowIds(i.ids)}else{this.renderer.invalidateHeights(),this.keepRange=!0;try{this.replaceData(s===this.store.state.data?[...s]:s)}finally{this.keepRange=!1}}return this.editor.sync(),r.size&&this.options.flashCells!==!1&&this.flash(r),this.events.emit("transactionApplied",t),t}viewReads(e){if(!e.size)return!1;let t=this.store.state;return this.pivotCfg||this.options.treeData||t.quickFilter||t.advancedFilter||this.groupBy.length?!0:[...t.sort.map(r=>r.colId),...Object.keys(t.filters)].some(r=>{var s;let i=(s=this.columns.getNode(r))==null?void 0:s.def;return i?i.valueGetter||i.formulas||i.formula?!0:i.field!=null&&e.has(i.field):!1})}txStep(e,t,n,r,i,s,a){var y,b;let l=this.options.getRowId,{present:c,byId:d}=n,u=v=>{if(!v||typeof v!="object")return null;if(c.has(v))return this.rowModel.idOf(v);try{return l?String(l(v)):null}catch{return null}},f=new Set;for(let v of(y=e.remove)!=null?y:[]){let S=u(v),C=S===null?void 0:d.get(S);C&&!f.has(C)?(f.add(C),c.delete(C),d.delete(S),r.removed.push(C),this.tracker.created.delete(C),this.tracker.originals.delete(C)):C||r.notFound.push(v)}let h=(v,S,C)=>{var A;let R=this.tracker.originals.get(C);if(v===C){for(let x of Object.keys(v))R&&(R[x]=v[x]),a.fields.add(x);a.ids.add(S),r.updated.push(C);return}for(let[x,M]of Object.entries(v)){R&&(R[x]=M);let T=C[x];if(Object.is(T,M))continue;C[x]=M,a.fields.add(x),a.ids.add(S);let E=typeof T=="number"&&typeof M=="number"?M>T?"up":"down":"";for(let L of(A=s.get(x))!=null?A:[])i.set(`${S}\0${L}`,E)}r.updated.push(C)};for(let v of(b=e.update)!=null?b:[]){let S=u(v),C=S===null?void 0:d.get(S);if(!C||f.has(C)){r.notFound.push(v);continue}h(v,S,C)}let p=Array.isArray(e.add)?[...e.add]:[];for(let v of Array.isArray(e.upsert)?e.upsert:[]){let S=u(v),C=S===null?void 0:d.get(S);C&&!f.has(C)?h(v,S,C):v&&typeof v=="object"&&p.push(v)}let g=Ce(p);r.added.push(...g);for(let v of g)c.add(v),d.set(this.rowModel.idOf(v),v);if(!f.size&&!g.length)return t;let w=f.size?t.filter(v=>!f.has(v)):[...t],m=typeof e.addIndex=="number"?Math.max(0,Math.min(w.length,Math.floor(e.addIndex))):w.length;return w.splice(m,0,...g),w}applyTransactionAsync(e){if(!e||typeof e!="object"||(this.txQueue.push(e),this.txTimer))return;let t=this.options.asyncTransactionWait;this.txTimer=window.setTimeout(()=>this.flushAsyncTransactions(),typeof t=="number"&&t>=0?t:50)}flushAsyncTransactions(){clearTimeout(this.txTimer),this.txTimer=0;let e=this.txQueue;this.txQueue=[],!(this.destroyed||!e.length)&&this.applyTransactions(e)}setAdvancedFilter(e){let t=e&&typeof e=="object"&&Array.isArray(e.conditions)&&e.conditions.length?e:null;t&&!this.allow("advancedFilter")||t!==this.store.state.advancedFilter&&(this.store.set({advancedFilter:t}),this.events.emit("advancedFilterChange",{advancedFilter:t}))}setColumnGroupOpened(e,t){this.columns.setGroupOpen(e,!!t)&&(this.layoutChanged(),this.events.emit("columnGroupOpened",{groupId:e,open:!!t}))}getState(){var i,s,a,l;let e=this.store.state,t=(s=(i=this.savedGroup)==null?void 0:i.groupBy)!=null?s:this.groupBy,n=(l=(a=this.savedGroup)==null?void 0:a.expanded)!=null?l:this.expanded,r={columns:this.columns.getState(),columnGroups:this.columns.groupOpenState(),advancedFilter:e.advancedFilter?JSON.parse(JSON.stringify(e.advancedFilter)):null,sort:e.sort.map(c=>({...c})),filters:JSON.parse(JSON.stringify(e.filters)),quickFilter:e.quickFilter,groupBy:[...t],pivot:this.pivotCfg?JSON.parse(JSON.stringify(this.pivotCfg)):null,expanded:Object.fromEntries(n),selected:[...e.selected]};return this.cfRules.length&&(r.conditionalFormats=this.getConditionalFormats()),this.options.pagination&&(r.page=this.page,r.pageSize=this.pageSize),r}setState(e,t={}){var i,s;if(!e||typeof e!="object")return;let n=a=>e[a]!==void 0&&(!t.parts||t.parts.includes(a)),r=a=>!!this.columns.getNode(a);if(n("columns")&&Array.isArray(e.columns)&&(this.columns.applyState(e.columns.filter(a=>a&&r(a.colId))),this.columnsChanged()),n("columnGroups")&&e.columnGroups&&typeof e.columnGroups=="object")for(let[a,l]of Object.entries(e.columnGroups))typeof l=="boolean"&&this.setColumnGroupOpened(a,l);if(n("groupBy")&&Array.isArray(e.groupBy)&&this.setGroupBy(e.groupBy.filter(r)),n("pivot")&&this.setPivot((i=e.pivot)!=null?i:null),n("sort")&&Array.isArray(e.sort)&&this.setSort(e.sort.filter(a=>a&&r(a.colId))),n("filters")&&e.filters&&typeof e.filters=="object"){let a=Object.fromEntries(Object.entries(e.filters).filter(([l])=>r(l)));this.store.set({filters:a}),this.events.emit("filterChange",{filters:{...a}})}if(n("advancedFilter")&&this.setAdvancedFilter((s=e.advancedFilter)!=null?s:null),n("quickFilter")&&typeof e.quickFilter=="string"&&this.store.set({quickFilter:e.quickFilter}),n("expanded")&&e.expanded&&typeof e.expanded=="object"){let a=new Map(Object.entries(e.expanded).filter(([,l])=>typeof l=="boolean"));this.savedGroup?this.savedGroup.expanded=a:(this.expanded=a,this.displayChanged())}if(n("pageSize")&&typeof e.pageSize=="number"&&this.setPageSize(e.pageSize),n("page")&&typeof e.page=="number"&&this.setPage(e.page),n("conditionalFormats")&&Array.isArray(e.conditionalFormats)&&this.setConditionalFormats(e.conditionalFormats),n("selected")&&Array.isArray(e.selected)){let a=new Set(this.rowModel.allNodes().map(l=>l.id));this.setSelected(new Set(e.selected.map(String).filter(l=>a.has(l))))}}rowNumber(e){var r;let t=this.rowModel.rows();if(((r=this.rowNumberCache)==null?void 0:r.rows)!==t){let i=new Int32Array(t.length),s=0;t.forEach((a,l)=>{i[l]=a.kind?0:++s}),this.rowNumberCache={rows:t,nums:i}}let n=this.rowNumberCache.nums[e];return n?n+(this.options.pagination&&!this.rowModel.server?this.page*this.pageSize:0):null}getPage(){return this.options.pagination?this.page:0}getPageSize(){return this.options.pagination?this.pageSize:this.rowModel.fullCount()}getPageCount(){return this.options.pagination?Math.max(1,Math.ceil(this.rowModel.fullCount()/this.pageSize)):1}setPage(e){if(!this.options.pagination||!Number.isFinite(e))return;let t=Math.max(0,Math.min(this.getPageCount()-1,Math.floor(e)));t!==this.page&&(this.veto("beforePageChange",{page:t,pageSize:this.pageSize})||(this.page=t,this.pageMoved()))}setPageSize(e){if(!this.options.pagination)return;if(!Number.isInteger(e)||e<=0){q("setPageSize: size must be a positive integer");return}if(e===this.pageSize)return;let t=this.page*this.pageSize;this.veto("beforePageChange",{page:Math.floor(t/e),pageSize:e})||(this.pageSize=e,this.page=Math.floor(t/e),this.pageMoved())}pageMoved(){this.editor.cancel(),this.updateRows(),this.store.state.range&&this.setRange(null);let e=this.rowModel.getRowCount(),t=this.store.state.focus;t&&t.rowIndex>=e&&this.store.set({focus:e?{...t,rowIndex:e-1}:null}),this.renderer.scroller.scrollTop=0,this.finder.refresh(),this.renderer.invalidate({header:!0,rows:!0}),this.emitPage()}emitPage(){this.events.emit("pageChange",{page:this.page,pageSize:this.pageSize,pageCount:this.getPageCount()})}refreshRows(){this.rowModel instanceof St&&(this.rowModel.purge(),this.renderer.invalidate({rows:!0}))}serverLoaded(e,t,n){this.destroyed||(this.renderer.invalidate({header:!0,rows:!0}),this.events.emit("rowsLoaded",n===null?{start:e,end:t}:{start:e,end:t,total:n}))}serverFailed(e,t,n){this.destroyed||(q(`datasource.getRows failed for rows ${e}\u2013${t}`),this.toast(this.store.state.locale.loadFailed),this.renderer.invalidate({rows:!0}),this.events.emit("rowsLoadFailed",{start:e,end:t,error:n}))}syncScroll(e,t){if(!e||typeof e.setScrollPosition!="function"||e===this.api)return()=>{};let n=new Map,r=a=>`${a.top},${a.left}`,i=(a,l)=>a.on("scroll",c=>{if(n.get(a)===r(c)){n.delete(a);return}l.setScrollPosition(t==="vertical"?{top:c.top}:t==="horizontal"?{left:c.left}:c),n.set(l,r(l.getScrollPosition()))}),s=[i(this.api,e),i(e,this.api)];return()=>{for(let a of s)a()}}veto(e,t){let n=!1;return this.events.emit(e,{...t,cancel:()=>{n=!0}}),n}clientOnly(e){return this.rowModel.server?(q(`${e} is not available with a datasource`),!0):!1}displayChanged(){this.displayVersion++,this.updateRows(),this.store.state.range&&this.setRange(null);let e=this.rowModel.getRowCount(),t=this.store.state.focus;t&&t.rowIndex>=e&&this.store.set({focus:e?{...t,rowIndex:e-1}:null}),this.finder.refresh(),this.renderer.invalidate({header:!0,rows:!0})}validGroupBy(e){return Array.isArray(e)?[...new Set(e)].filter(t=>{let n=this.columns.getNode(t);return!n||n.children||H(t)?(q(`groupBy: unknown column "${t}"`),!1):!0}):[]}getGroupBy(){return[...this.groupBy]}setGroupBy(e){var n;if(Array.isArray(e)&&e.length&&!this.allow(this.rowModel.server?"serverGroups":"grouping"))return;let t=this.validGroupBy(e);t.join("")!==this.groupBy.join("")&&(this.groupBy=t,this.page=0,(n=this.groupPanel)==null||n.refresh(),this.displayChanged(),this.events.emit("groupChange",{groupBy:[...t]}))}isExpandable(e){return!!e&&(e.kind==="group"||!!e.hasChildren)}expandKey(e){return e.group?e.group.key:e.id}loadChildren(e){let t=this.options.treeData,n=e.id;if(this.treeLoading.has(n))return;if(typeof t.loadChildren!="function"){q("treeData.hasChildren needs treeData.loadChildren");return}this.treeLoading.add(n),this.displayChanged();let r=()=>(this.treeLoading.delete(n),!this.destroyed&&this.store.state.data.includes(e.data));Promise.resolve().then(()=>t.loadChildren(e.data)).then(i=>{if(!r())return;let s=Ce(Array.isArray(i)?i:[]);this.treeLoaded.add(n),this.expanded.set(n,!0),s.length&&this.replaceData([...this.store.state.data,...s]),this.displayChanged(),this.events.emit("childrenLoaded",{row:e.data,rows:s}),this.events.emit("groupToggle",{key:n,expanded:!0})},i=>{r()&&(q(`treeData.loadChildren failed for row "${n}"`),this.displayChanged(),this.events.emit("childrenLoadFailed",{row:e.data,error:i}))})}setGroupExpanded(e,t){var i,s;let n=this.rowModel.rows().find(a=>this.isExpandable(a)&&this.expandKey(a)===e);if((n?!!((s=(i=n.group)==null?void 0:i.expanded)!=null?s:n.expanded):this.expanded.get(e))!==t){if(t&&n&&!n.group&&this.options.treeData&&this.lazyChildren(n.id,n.data)){this.loadChildren(n);return}this.expanded.set(e,t),this.displayChanged(),this.events.emit("groupToggle",{key:e,expanded:t})}}toggleRow(e){var n,r;let t=this.rowModel.getRow(e);this.isExpandable(t)&&this.setGroupExpanded(this.expandKey(t),!((r=(n=t.group)==null?void 0:n.expanded)!=null?r:t.expanded))}expandAll(e=!0){this.expanded.clear(),this.defaultExpanded=e?-1:0,this.displayChanged()}groupAggregate(e,t){var i,s;let n=(i=this.columns.getNode(t))==null?void 0:i.def;if(!e.group||!(n!=null&&n.aggFunc))return;if(e.group.aggregates)return(s=e.group.aggregates[t])!=null?s:n.field?e.group.aggregates[n.field]:void 0;this.aggCache.ver!==this.editVersion&&(this.aggCache={ver:this.editVersion,map:new WeakMap});let r=this.aggCache.map.get(e.group);if(r||this.aggCache.map.set(e.group,r=new Map),!r.has(t)){let a=e.group.rows;try{r.set(t,Te(n.aggFunc,a.map(l=>j(n,l)),a))}catch{q(`aggFunc of column "${t}" threw`),r.set(t,null)}}return r.get(t)}canExpandDetail(e){if(!this.options.detailRenderer)return!1;try{return!this.options.isRowMaster||!!this.options.isRowMaster(e)}catch{return!1}}isDetailExpanded(e){return!!e&&typeof e=="object"&&this.detailOpen.has(this.rowModel.idOf(e))}setDetailExpanded(e,t){if(!e||typeof e!="object"||t&&!this.canExpandDetail(e))return;let n=this.rowModel.idOf(e);this.detailOpen.has(n)!==t&&(t?this.detailOpen.add(n):(this.detailOpen.delete(n),this.renderer.dropDetail(n)),this.displayChanged(),this.events.emit("detailToggle",{row:e,expanded:t}))}canMoveRows(){let e=this.store.state,t=this.options.treeData;return!this.rowModel.server&&!e.sort.length&&!Object.keys(e.filters).length&&!e.quickFilter.trim()&&!this.groupBy.length&&(!t||typeof t.setParentId=="function")}get dragOptions(){let e=this.options.rowDrag;return e&&typeof e=="object"?e:{}}parentOf(e){let t=null;try{t=this.options.treeData.getParentId(e)}catch{t=null}return t==null?null:String(t)}rawParent(e){var t;try{return(t=this.options.treeData.getParentId(e))!=null?t:null}catch{return null}}idValue(e){let t=this.rowModel.idOf(e);for(let r of this.store.state.data){let i=this.rawParent(r);if(i!==null&&String(i)===t)return i}return this.store.state.data.some(r=>typeof this.rawParent(r)=="number")&&t.trim()!==""&&Number.isFinite(Number(t))?Number(t):t}canDropRow(e,t,n,r=this){if(!this.canMoveRows()||t===e)return!1;if(r===this&&this.options.treeData&&t){let s=this.rowModel.idOf(e),a=new Set;for(let l=this.rowModel.idOf(t);l!==null&&!a.has(l);){if(l===s)return!1;a.add(l);let c=this.rowModel.allNodes().find(d=>d.id===l);l=c?this.parentOf(c.data):null}}let i=this.dragOptions.canDrop;if(!i)return!0;try{return i({row:e,target:t,position:n,fromOtherGrid:r!==this})!==!1}catch{return q("rowDrag.canDrop threw; the drop was refused"),!1}}dropRow(e,t,n="after",r=this){var m,y;if(this.clientOnly("dropRow")||!e||typeof e!="object")return!1;let i=this.options.treeData;!i&&n==="inside"&&(n="after");let s=this.store.state.data,a=r!==this,l=a?-1:s.indexOf(e);if(!a&&l<0||t&&!s.includes(t)||a&&(!r.canMoveRows()||s.includes(e))||!this.canDropRow(e,t,n,r))return!1;let c=i?this.rawParent(e):null,d=!i||!t?null:n==="inside"?t:(m=this.store.state.data.find(b=>this.rowModel.idOf(b)===this.parentOf(t)))!=null?m:null,u=d?this.idValue(d):null,f=s.filter(b=>b!==e),h=!t||n==="inside"?f.length:f.indexOf(t)+(n==="after"?1:0);f.splice(h,0,e);let p=f.some((b,v)=>b!==s[v]);if(!a&&!p&&String(c!=null?c:"")===String(u!=null?u:""))return!1;let g=(b,v)=>{try{i.setParentId(e,b,v)}catch{q("treeData.setParentId threw")}},w=i&&(y=this.store.state.data.find(b=>this.rowModel.idOf(b)===this.parentOf(e)))!=null?y:null;return a?(r.removeRows([e]),i&&g(u,d),this.addRows([e],h)):(i&&g(u,d),this.replaceData(f),this.history.push({undo:()=>{i&&g(c,w),this.replaceData(s)},redo:()=>{i&&g(u,d),this.replaceData(f)}}),this.events.emit("rowDragEnd",{row:e,fromIndex:l,toIndex:h})),this.events.emit("rowDrop",{row:e,target:t,position:n,fromOtherGrid:a,fromGrid:a?r.api:null}),!0}moveRow(e,t,n=!0){if(this.clientOnly("moveRow")||!this.canMoveRows())return!1;let r=this.store.state.data,i=r.indexOf(e);if(i<0||!Number.isFinite(t))return!1;let s=Math.max(0,Math.min(r.length-1,Math.floor(t)));if(s===i)return!1;let a=[...r];return a.splice(i,1),a.splice(s,0,e),this.replaceData(a),n&&this.history.push({undo:()=>this.moveRow(e,i,!1),redo:()=>this.moveRow(e,s,!1)}),this.events.emit("rowDragEnd",{row:e,fromIndex:i,toIndex:s}),!0}setFont(e){let t=this.font.size;e.size!==void 0&&(typeof e.size=="number"&&e.size>0?t=e.size:q("setFont: size must be a positive number"));let n=e.family===void 0?this.font.family:e.family||null;this.font={size:t,family:n};let r=t!=null?t:Fo;this.applyAutoHeights(r),this.renderer.applyFont(t,n),this.renderer.invalidateHeights(),this.menu.close(),this.layoutChanged()}densityOf(e){return e==="compact"||e==="comfortable"?e:"normal"}applyAutoHeights(e){let[t,n]=Io[this.density];this.options.rowHeight==null&&(this.renderer.opts.rowHeight=Math.round(zi(e)*t)),this.options.headerHeight==null&&(this.renderer.opts.headerHeight=Math.round(Vi(e)*n))}setDensity(e){var n;let t=this.densityOf(e);t!==this.density&&(this.density=t,this.renderer.applyTheme(),this.applyAutoHeights((n=this.font.size)!=null?n:Fo),this.renderer.invalidateHeights(),this.layoutChanged())}applyFontTo(e){this.font.size&&e.style.setProperty("--fg-font-size",`${this.font.size}px`),this.font.family&&e.style.setProperty("--fg-font",this.font.family)}summary(){var e;return this.summaryOpts&&((e=this.summaryOpts.rows)!=null&&e.length)?{opts:this.summaryOpts,values:this.summaryValues}:null}setSummary(e){if(e&&!Array.isArray(e.rows)){q("setSummary: summary.rows must be an array");return}if(!(e&&!this.allow("summary"))){if(ot(e,this.summarySnapshot)){this.summaryOpts=e;return}this.summarySnapshot=xe(e),this.summaryOpts=e,this.refreshSummary(),this.renderer.invalidate({header:!0,rows:!0})}}refreshSummary(){var r,i;let e=this.summaryOpts;if(!((r=e==null?void 0:e.rows)!=null&&r.length)){this.summaryValues=[];return}let t=(i=e.scope)!=null?i:"filtered",n=t==="all"?this.rowModel.allNodes().map(s=>s.data):t==="selected"?this.selectedRows():this.rowModel.dataRows().map(s=>s.data);this.summaryValues=Pr(e.rows,n,s=>{var a;return(a=this.columns.getNode(s))==null?void 0:a.def})}dataColumns(){return this.columns.displayed().filter(e=>!H(e.id))}validRange(e){if(!e||!this.rangesOn())return null;let t=this.rowModel.getRowCount(),n=r=>!!r&&!H(r.colId)&&!!this.columns.getColumn(r.colId)&&r.rowIndex>=0&&r.rowIndex<t;return n(e.start)&&n(e.end)?{start:{...e.start},end:{...e.end}}:null}setRange(e,t=!1){var s,a,l,c;if(e&&(((s=e.start)==null?void 0:s.rowIndex)!==((a=e.end)==null?void 0:a.rowIndex)||((l=e.start)==null?void 0:l.colId)!==((c=e.end)==null?void 0:c.colId))&&!this.allow("range"))return;let n=this.validRange(e),r=t||!this.store.state.extraRanges.length?this.store.state.extraRanges:[],i=this.store.state.range;JSON.stringify(i)===JSON.stringify(n)&&r===this.store.state.extraRanges||(this.store.set({range:n,extraRanges:r}),this.events.emit("rangeChange",{range:n&&{start:{...n.start},end:{...n.end}}}))}addRange(e){if(!this.allow("range"))return;let{range:t,focus:n}=this.store.state,r=this.validRange(t!=null?t:n?{start:n,end:n}:null);r&&this.store.set({extraRanges:[...this.store.state.extraRanges,r]}),this.setRange(e,!0)}getRanges(){let e=[...this.store.state.extraRanges];return this.store.state.range&&e.push(this.store.state.range),e.map(t=>({start:{...t.start},end:{...t.end}}))}setRanges(e){var n;if(Array.isArray(e)&&e.length&&!this.allow("range"))return;let t=(Array.isArray(e)?e:[]).map(r=>this.validRange(r)).filter(r=>!!r);this.store.set({extraRanges:t.slice(0,-1)}),this.setRange((n=t[t.length-1])!=null?n:null,!0)}boundsOf(e){if(!e)return null;let t=this.columns.getColumn(e.start.colId),n=this.columns.getColumn(e.end.colId);return!t||!n?null:gt({start:{rowIndex:e.start.rowIndex,colIndex:t.index},end:{rowIndex:e.end.rowIndex,colIndex:n.index}})}rangeBounds(){return this.boundsOf(this.store.state.range)}allRangeBounds(){return[...this.store.state.extraRanges,this.store.state.range].map(e=>this.boundsOf(e)).filter(e=>!!e)}rangeContains(e,t){let n=this.columns.getColumn(t);return!!n&&this.allRangeBounds().some(r=>Wr(r,e,n.index))}selectAllCells(){if(!this.allow("range"))return;let e=this.dataColumns(),t=this.rowModel.getRowCount();!e.length||!t||(this.store.state.focus||this.setFocus(0,e[0].id),this.setRange({start:{rowIndex:0,colId:e[0].id},end:{rowIndex:t-1,colId:e[e.length-1].id}}))}selectionTSV(e,t=!1){if(!t&&this.multiCell()&&!this.allow("clipboard"))return"";let n=this.store.state.locale.code,r=this.columns.displayed(),i=t?null:this.rangeBounds(),s=t,a,l,c=t?[]:this.allRangeBounds();if(c.length>1){let u=c.every(h=>h.c1===c[0].c1&&h.c2===c[0].c2),f=c.every(h=>h.r1===c[0].r1&&h.r2===c[0].r2);if(this.rangesStack(c)){let h=[...c].sort((w,m)=>u?w.r1-m.r1:w.c1-m.c1),p=h.map(w=>this.rangeMatrix(w)),g=u?p.flat():p[0].map((w,m)=>p.flatMap(y=>{var b;return(b=y[m])!=null?b:[]}));return e&&g.unshift((u?h.slice(0,1):h).flatMap(w=>this.rangeHeaders(w))),no(g)}}if(i){a=[];for(let u=i.r1;u<=i.r2;u++){let f=this.rowModel.getRow(u);f.kind||a.push(f.data)}l=r.slice(i.c1,i.c2+1).filter(u=>!H(u.id))}else if(s){let u=this.store.state.selected;a=this.rowModel.dataRows().filter(f=>u.has(f.id)).map(f=>f.data),l=this.dataColumns()}else{let u=this.store.state.focus,f=u&&this.columns.getColumn(u.colId),h=u&&this.rowModel.getRow(u.rowIndex);if(!f||!h||h.kind||H(f.id))return"";a=[h.data],l=[f]}let d=a.map(u=>l.map(f=>this.copyCell(f.def,u,n)));return e&&d.unshift(l.map(u=>{var f,h;return(h=(f=u.def.header)!=null?f:u.def.field)!=null?h:u.id})),no(d)}multiCell(){let e=this.allRangeBounds();return e.length>1||e.some(t=>t.r1!==t.r2||t.c1!==t.c2)}rangesStack(e){return e.length>1&&(e.every(t=>t.c1===e[0].c1&&t.c2===e[0].c2)||e.every(t=>t.r1===e[0].r1&&t.r2===e[0].r2))}rangeHeaders(e){return this.columns.displayed().slice(e.c1,e.c2+1).filter(t=>!H(t.id)).map(t=>{var n,r;return(r=(n=t.def.header)!=null?n:t.def.field)!=null?r:t.id})}rangeMatrix(e){let t=this.columns.displayed().slice(e.c1,e.c2+1).filter(i=>!H(i.id)),n=this.store.state.locale.code,r=[];for(let i=e.r1;i<=e.r2;i++){let s=this.rowModel.getRow(i);s&&!s.kind&&r.push(t.map(a=>this.copyCell(a.def,s.data,n)))}return r}copyCell(e,t,n){return this.copyAllowed(e,t)?en(e,j(e,t),n):""}copyAllowed(e,t){let n=e.copyable;if(typeof n!="function")return n!==!1;try{return n({value:j(e,t),row:t,column:e})!==!1}catch{return!1}}cutToClipboard(){let e=this.copyToClipboard(!1);return e&&this.clearCells(!0),e}copyToClipboard(e,t=!1){var r,i,s;let n=this.selectionTSV(e,t);if(n&&typeof navigator!="undefined"&&((r=navigator.clipboard)!=null&&r.writeText))try{(s=(i=navigator.clipboard.writeText(n))==null?void 0:i.catch)==null||s.call(i,()=>{})}catch{}return n}pasteText(e){var g;let t=Vr(e),n={changed:0,skipped:0};if(!t.length||(t.length>1||t[0].length>1)&&!this.allow("clipboard"))return n;let r=this.columns.displayed(),i=this.rowModel.getRowCount(),s=this.rangeBounds(),a=this.store.state.focus,l=a&&this.columns.getColumn(a.colId),c,d;if(s)c=s.r1,d=s.c1;else if(a&&l&&!H(l.id))c=a.rowIndex,d=l.index;else return n;let u=[],f=t.length===1&&t[0].length===1,h=f&&s?s.r2-s.r1+1:t.length,p=f&&s?s.c2-s.c1+1:Math.max(...t.map(w=>w.length));for(let w=0;w<h;w++){let m=c+w;if(m>=i)break;let y=this.rowModel.getRow(m);if(!y.kind)for(let b=0;b<p;b++){let v=r[d+b];if(!v)break;if(H(v.id))continue;let S=f&&s?t[0][0]:(g=t[w])==null?void 0:g[b];if(S===void 0)continue;let C=v.def;if(!C.field||!ye(C,y.data,m)){n.skipped++;continue}let R=y.data[C.field],A=this.acceptText(C,y.data,S,R);if(!A.ok){n.skipped++;continue}this.writeCell(u,y.data,C.field,v.id,m,A.value)&&n.changed++}}return this.endCellTx(u),this.events.emit("paste",{...n}),n}acceptText(e,t,n,r){var a;let i,s=e.editor;if(s&&typeof s=="object"&&s.type==="select"){let l=(a=typeof s.options=="function"?s.options(t):s.options)!=null?a:[],c=n.trim().toLowerCase(),d=l.map(u=>u!==null&&typeof u=="object"&&"value"in u?u:{value:u,label:String(u),disabled:!1}).find(u=>{var f;return String(u.value).toLowerCase()===c||((f=u.label)!=null?f:"").toLowerCase()===c});if(!d||d.disabled)return{ok:!1};i=d.value}else if(e.formulas&&$e(n.trim()))i=n.trim();else{let l=tn(e,n,r);if(!l.ok)return l;i=l.value}return this.cellError(e,t,i)!==null?{ok:!1}:{ok:!0,value:i}}cellError(e,t,n){let r=this.store.state.locale;if(e.required&&U(n))return r.required;if(e.unique&&e.field&&!U(n)){let i=n instanceof Date?n.getTime():String(n),s=e.field;if(this.store.state.data.some(a=>{if(a===t)return!1;let l=a[s];return!U(l)&&(l instanceof Date?l.getTime():String(l))===i}))return r.duplicate}if(e.validate){let i;try{i=e.validate(n,t)}catch{i=r.invalidValue}if(i!==!0)return typeof i=="string"&&i?i:r.invalidValue}return null}validateAll(){let e=[],t=this.columns.getState().map(n=>({id:n.colId,def:this.columns.getNode(n.colId).def})).filter(n=>n.def.field&&n.def.editable&&(n.def.required||n.def.unique||n.def.validate));return this.store.state.data.forEach((n,r)=>{let i=this.rowModel.idOf(n),s=this.rowModel.indexOfId(i);for(let a of t){if(!ye(a.def,n,s<0?r:s))continue;let l=this.cellError(a.def,n,n[a.def.field]);l!==null&&e.push({row:n,rowIndex:s,colId:a.id,message:l})}}),e}mergeSpans(){if(this.rowModel.server||!this.columns.displayed().some(i=>i.def.merge||i.def.rowSpan)||!this.allow("merge"))return qi;let e=this.rowModel.rows(),t=this.editVersion*1e6+this.columns.displayed().length;if(this.spanCache&&this.spanCache.rows===e&&this.spanCache.ver===t)return this.spanCache.spans;let n=new Map,r=this.columns.displayed().filter(i=>i.def.merge||i.def.rowSpan);if(r.length&&!e.some(i=>i.kind)){let i=e.map(s=>s.data);for(let s of r)n.set(s.id,Ht(i,s.def))}return this.spanCache={rows:e,ver:t,spans:n},n}rangeAggregates(){let e=this.allRangeBounds();if(!e.length||!this.paid)return null;let t=this.columns.displayed(),n=[JSON.stringify(e),this.rowModel.rows(),this.editVersion,...t.map(l=>l.def)],r=this.aggMemo;if(r&&r.key.length===n.length&&r.key.every((l,c)=>l===n[c]))return r.value&&{...r.value};let i={cells:0,count:0,numbers:0,sum:0,min:1/0,max:-1/0},s=e.length>1?new Set:null,a=t.length;for(let l of e){let c=t.slice(l.c1,l.c2+1).filter(d=>!H(d.id));for(let d=l.r1;d<=l.r2;d++){let u=this.rowModel.getRow(d);if(!u||u.kind)continue;let f=u.data;for(let h of c){if(s){let g=d*a+h.index;if(s.has(g))continue;s.add(g)}i.cells++;let p=j(h.def,f);if(!U(p)&&(i.count++,typeof p=="number"||h.def.type==="number"&&!Number.isNaN(Number(p)))){let g=Number(p);i.numbers++,i.sum+=g,g<i.min&&(i.min=g),g>i.max&&(i.max=g)}}}}return this.aggMemo={key:n,value:i},{...i}}fillRange(e){var u;if(!this.allow("fill"))return;let t=(u=this.rangeBounds())!=null?u:(()=>{let f=this.store.state.focus,h=f&&this.columns.getColumn(f.colId);return f&&h&&!H(h.id)?{r1:f.rowIndex,r2:f.rowIndex,c1:h.index,c2:h.index}:null})(),n=this.columns.getColumn(e.start.colId),r=this.columns.getColumn(e.end.colId);if(!t||!n||!r)return;let i=gt({start:{rowIndex:e.start.rowIndex,colIndex:n.index},end:{rowIndex:e.end.rowIndex,colIndex:r.index}}),s=this.rowModel.getRowCount();i.r1=Math.max(0,i.r1),i.r2=Math.min(s-1,i.r2);let a=this.columns.displayed(),l=[],c=(f,h,p)=>{let g=a[h],w=this.rowModel.getRow(f),m=g==null?void 0:g.def;!w||w.kind||!(m!=null&&m.field)||H(g.id)||!ye(m,w.data,f)||this.cellError(m,w.data,p)===null&&this.writeCell(l,w.data,m.field,g.id,f,p)},d=(f,h)=>j(a[h].def,this.rowModel.getRow(f).data);if(i.r1<t.r1||i.r2>t.r2)for(let f=t.c1;f<=t.c2;f++){let h=[],p=[];for(let g=t.r1;g<=t.r2;g++)h.push(d(g,f));for(let g=t.r2;g>=t.r1;g--)p.push(d(g,f));mt(h,i.r2-t.r2).forEach((g,w)=>c(t.r2+1+w,f,g)),mt(p,t.r1-i.r1).forEach((g,w)=>c(t.r1-1-w,f,g))}else if(i.c1<t.c1||i.c2>t.c2)for(let f=t.r1;f<=t.r2;f++){let h=[],p=[];for(let g=t.c1;g<=t.c2;g++)h.push(d(f,g));for(let g=t.c2;g>=t.c1;g--)p.push(d(f,g));mt(h,i.c2-t.c2).forEach((g,w)=>c(f,t.c2+1+w,g)),mt(p,t.c1-i.c1).forEach((g,w)=>c(f,t.c1-1-w,g))}else return;this.endCellTx(l),this.setRange({start:{rowIndex:i.r1,colId:a[i.c1].id},end:{rowIndex:i.r2,colId:a[i.c2].id}})}setPinnedRows(e){e.top&&(this.pinnedRows.top=Ce(e.top)),e.bottom&&(this.pinnedRows.bottom=Ce(e.bottom)),this.renderer.invalidate({rows:!0})}writeCell(e,t,n,r,i,s){let a=t[n];return Object.is(a,s)||this.veto("beforeCellChange",{row:t,rowIndex:i,colId:r,oldValue:a,newValue:s})?!1:(this.tracker.beforeChange(t),t[n]=s,e.push({row:t,field:n,colId:r,rowIndex:i,oldValue:a,newValue:s}),!0)}endCellTx(e){if(!e.length)return;let t=(n,r)=>{let i=n.map(s=>{let a=s.row[s.field];return s.row[s.field]=s[r],{row:s.row,rowIndex:this.rowModel.indexOfId(this.rowModel.idOf(s.row)),colId:s.colId,oldValue:a,newValue:s[r]}});this.afterDataEdit();for(let s of i)this.events.emit("cellValueChanged",s)};this.history.push({undo:()=>t([...e].reverse(),"oldValue"),redo:()=>t(e,"newValue")}),this.afterDataEdit();for(let n of e)this.events.emit("cellValueChanged",{row:n.row,rowIndex:n.rowIndex,colId:n.colId,oldValue:n.oldValue,newValue:n.newValue})}afterDataEdit(){this.renderer.invalidateHeights(),this.editVersion++,this.refreshSummary(),this.renderer.invalidate({rows:!0})}applyEdit(e,t,n){var a;let r=this.rowModel.getRow(e),i=(a=this.columns.getColumn(t))==null?void 0:a.def;if(!r||!(i!=null&&i.field))return;let s=[];this.writeCell(s,r.data,i.field,t,e,n),this.endCellTx(s)}clearCells(e=!1){var l,c;let t=this.columns.displayed(),n=this.allRangeBounds();if(e&&!this.rangesStack(n)){let d=this.rangeBounds();n=d?[d]:[]}let r=this.store.state.focus,i=r?(l=this.columns.getColumn(r.colId))==null?void 0:l.index:void 0,s=n.length?n:r&&i!==void 0?[{r1:r.rowIndex,r2:r.rowIndex,c1:i,c2:i}]:[];if(!s.length)return;let a=[];for(let d of s)for(let u=d.r1;u<=d.r2;u++){let f=this.rowModel.getRow(u);for(let h=d.c1;h<=d.c2;h++){let p=(c=t[h])==null?void 0:c.def;f&&!f.kind&&(p!=null&&p.field)&&ye(p,f.data,u)&&(!e||this.copyAllowed(p,f.data))&&this.writeCell(a,f.data,p.field,t[h].id,u,null)}}this.endCellTx(a)}replaceData(e){this.store.set({data:e});let t=new Set(this.rowModel.allNodes().map(s=>s.id)),n=this.store.state.selected;[...n].some(s=>!t.has(s))&&this.setSelected(new Set([...n].filter(s=>t.has(s))));let r=this.rowModel.getRowCount(),i=this.store.state.focus;i&&i.rowIndex>=r&&this.store.set({focus:r?{...i,rowIndex:r-1}:null})}addRows(e,t,n=!0){if(this.clientOnly("addRows"))return[];let r=Ce(Array.isArray(e)?e:[]);if(!r.length)return[];let i=[...this.store.state.data],s=t===void 0?i.length:Math.max(0,Math.min(i.length,t));i.splice(s,0,...r);for(let a of r)this.tracker.created.add(a);return this.replaceData(i),n&&this.history.push({undo:()=>this.removeRows(r,!1),redo:()=>this.addRows(r,s,!1)}),this.events.emit("rowsAdded",{rows:[...r]}),r}removeRows(e,t=!0){if(this.clientOnly("removeRows"))return[];let n=this.store.state.data,r=typeof e=="function"?e:(l=>c=>l.has(c))(new Set(e)),i=[];if(n.forEach((l,c)=>{let d=!1;try{d=!!r(l)}catch{d=!1}d&&i.push({row:l,index:c})}),!i.length)return[];let s=new Set(i.map(l=>l.row)),a=new Set(i.filter(l=>this.tracker.created.has(l.row)).map(l=>l.row));for(let{row:l,index:c}of i)a.has(l)?this.tracker.created.delete(l):this.tracker.deleted.set(l,c);return this.replaceData(n.filter(l=>!s.has(l))),t&&this.history.push({undo:()=>{let l=[...this.store.state.data];for(let{row:c,index:d}of i)l.splice(Math.min(d,l.length),0,c),this.tracker.deleted.delete(c),a.has(c)&&this.tracker.created.add(c);this.replaceData(l)},redo:()=>this.removeRows([...s],!1)}),this.events.emit("rowsRemoved",{rows:i.map(l=>l.row)}),i.map(l=>l.row)}trackedFields(){let e=[],t=n=>{for(let r of n)r.children?t(r.children):r.def.field&&!H(r.id)&&e.push({field:r.def.field,colId:r.id})};return t(this.columns.roots()),e}getChanges(){let e=this.trackedFields(),t=[];for(let[n,r]of this.tracker.originals)if(!this.tracker.deleted.has(n))for(let i of this.tracker.diff(n,e.map(s=>s.field)))t.push({row:n,colId:e.find(s=>s.field===i).colId,oldValue:r[i],newValue:n[i]});return t}getModifiedRows(){let e=this.trackedFields().map(n=>n.field),t=this.store.state.data;return{created:t.filter(n=>this.tracker.created.has(n)),updated:t.filter(n=>this.tracker.originals.has(n)&&this.tracker.diff(n,e).length>0),deleted:[...this.tracker.deleted.keys()]}}hasChanges(){let e=this.getModifiedRows();return e.created.length+e.updated.length+e.deleted.length>0}commitChanges(e){e&&e.rows instanceof Map?this.tracker.commit(e.rows,Array.isArray(e.deleted)?e.deleted:[]):this.tracker.reset(),this.renderer.invalidate({rows:!0})}revertChanges(){this.editor.cancel();for(let[n,r]of this.tracker.originals)Object.assign(n,r);let e=this.store.state.data.filter(n=>!this.tracker.created.has(n)),t=[...this.tracker.deleted.entries()].sort((n,r)=>n[1]-r[1]);e=[...e];for(let[n,r]of t)e.splice(Math.min(r,e.length),0,n);this.tracker.reset(),this.history.clear(),this.replaceData(e),this.afterDataEdit()}undo(){this.editor.cancel(),this.history.undo()}redo(){this.editor.cancel(),this.history.redo()}toast(e){let t=k("div","fg-toast",{role:"status"});t.textContent=e,this.renderer.root.append(t),setTimeout(()=>t.remove(),3500)}refreshChoosers(){var e;this.chooser.refresh(),(e=this.sideBar)==null||e.refresh()}setColumnsVisible(e,t){let n=[];for(let r of e){let i=this.columns.getNode(r);!i||i.children||i.hide===!t||(this.columns.setHide(r,!t),n.push(r))}if(n.length){this.columnsChanged();for(let r of n)this.events.emit("columnVisible",{colId:r,visible:t})}}autoSize(e){var l,c;let t=(e?e.map(d=>this.columns.getColumn(d)):this.columns.displayed()).filter(d=>!!d&&Pt(d.def)),{first:n,last:r}=this.renderer.renderedRange(),i=this.store.state.locale.code,s=66,a=24;for(let d of t){let u=this.renderer.measureText((c=(l=d.def.header)!=null?l:d.def.field)!=null?c:"",!0)+s,f=ee(d.def,i);for(let p=n;p<=r;p++){let g=this.rowModel.getRow(p);g&&(u=Math.max(u,this.renderer.measureText(f(j(d.def,g.data)),!1)+a))}let h=this.columns.setWidth(d.id,Math.ceil(u));this.events.emit("columnResize",{colId:d.id,width:h})}this.layoutChanged()}resetColumns(){this.columns.reset(),this.columnsChanged()}setSort(e){let t=e.filter(n=>{let r=this.columns.getNode(n.colId);return!r||r.children?(q(`setSort: unknown column "${n.colId}"`),!1):n.dir==="asc"||n.dir==="desc"});this.veto("beforeSort",{sort:t.map(n=>({...n}))})||(this.store.set({sort:t}),this.events.emit("sortChange",{sort:[...t]}))}toggleSort(e,t){let n=this.store.state.sort,r=n.find(a=>a.colId===e),i=r?r.dir==="asc"?"desc":null:"asc",s;t?i?r?s=n.map(a=>a.colId===e?{colId:e,dir:i}:a):s=[...n,{colId:e,dir:i}]:s=n.filter(a=>a.colId!==e):s=i?[{colId:e,dir:i}]:[],this.setSort(s)}setFilter(e,t){let n=this.columns.getNode(e);if(!n||n.children){q(`setFilter: unknown column "${e}"`);return}if(this.veto("beforeFilter",{colId:e,model:t}))return;let r={...this.store.state.filters};t?r[e]=t:delete r[e],this.store.set({filters:r}),this.events.emit("filterChange",{filters:{...r}})}setPinned(e,t){this.columns.setPinned(e,t),this.layoutChanged()}setFocus(e,t){let n=this.store.state.focus;n&&n.rowIndex===e&&n.colId===t||(this.store.set({focus:{rowIndex:e,colId:t}}),this.events.emit("focusChange",{rowIndex:e,colId:t}))}setSelected(e,t=this.store.state.anchorId){this.selectionVersion++,this.store.set({selected:e,anchorId:t}),this.events.emit("selectionChange",{selected:this.selectedRows()})}rowSelectable(e){let t=this.options.isRowSelectable;if(!t)return!0;try{return!!t(e)}catch{return!1}}groupMemberIds(e){var a,l;if(e.group)return e.group.rows.filter(c=>this.rowSelectable(c)).map(c=>this.rowModel.idOf(c));let t=(a=this.options.treeData)==null?void 0:a.getParentId;if(!t)return[];let n=new Map;for(let c of this.store.state.data){let d=null;try{d=t(c)}catch{d=null}if(d==null)continue;let u=String(d),f=n.get(u);f?f.push(c):n.set(u,[c])}let r=[],i=new Set([e.id]),s=[e.id];for(;s.length;)for(let c of(l=n.get(s.shift()))!=null?l:[]){let d=this.rowModel.idOf(c);i.has(d)||(i.add(d),s.push(d),this.rowSelectable(c)&&r.push(d))}return r}groupSelection(e){let t=this.groupMemberIds(e),n=this.store.state.selected,r=t.filter(i=>n.has(i)).length;return r===0?"none":r===t.length?"all":"some"}toggleGroupSelection(e){if(this.options.rowSelection!=="multiple")return;let t=this.groupMemberIds(e),n=new Set(this.store.state.selected),r=t.length>0&&t.every(i=>n.has(i));for(let i of t)r?n.delete(i):n.add(i);this.setSelected(n)}selectFromClick(e,t,n){var a,l;let r=this.options.rowSelection;if(!r||e<0||e>=this.rowModel.getRowCount())return;let i=this.rowModel.getRow(e);if(i.kind||!this.rowSelectable(i.data))return;let s=$i({selected:this.store.state.selected,anchorIndex:this.anchorIndex(),mode:r,index:e,idAt:c=>this.rowModel.getRow(c).id,toggle:t,range:n});if(this.rowModel.rows()!==this.rowModel.dataRows()||this.options.isRowSelectable)for(let c of s.selected){if(this.store.state.selected.has(c))continue;let d=this.rowModel.indexOfId(c),u=d>=0?this.rowModel.getRow(d):null;u&&(u.kind||!this.rowSelectable(u.data))&&s.selected.delete(c)}if(r==="multiple"&&this.options.groupSelectsChildren&&this.options.treeData&&i.hasChildren){let c=s.selected.has(i.id);for(let d of this.groupMemberIds(i))c?s.selected.add(d):s.selected.delete(d)}this.setSelected(s.selected,(l=(a=this.rowModel.getRow(s.anchorIndex))==null?void 0:a.id)!=null?l:null)}anchorIndex(){let e=this.store.state.anchorId;if(e==null)return null;let t=this.rowModel.indexOfId(e);return t<0?null:t}selectableIds(){let e=this.rowModel.dataRows(),t=this.options.isRowSelectable,n=this.selectableCache;if(n&&n.rows===e&&n.fn===t&&n.ver===this.editVersion)return n.ids;let r=new Set(this.selectableRows().map(i=>i.id));return this.selectableCache={rows:e,fn:t,ver:this.editVersion,ids:r},r}selectableRows(){let e=this.rowModel.dataRows();return this.options.isRowSelectable?e.filter(t=>this.rowSelectable(t.data)):e}toggleSelectAll(){let e=this.selectableRows(),t=this.store.state.selected,n=e.length>0&&e.every(i=>t.has(i.id)),r=new Set(t);for(let i of e)n?r.delete(i.id):r.add(i.id);this.setSelected(r)}selectedRows(){let e=this.store.state.selected;return e.size?this.rowModel.allNodes().filter(t=>e.has(t.id)).map(t=>t.data):[]}withSelect(e){let t=[],n=this.options.rowNumbers;if(n){let r=typeof n=="object"?n:{};t.push(ur(typeof r.width=="number"&&r.width>0?r.width:void 0,typeof r.header=="string"?r.header:void 0))}return this.options.rowDrag&&t.push(cr),this.options.rowSelection&&t.push(dr),[...t,...e]}setData(e,t){if(this.clientOnly("setData"))return;if(!Array.isArray(e)){q("setData: rows must be an array");return}this.editor.cancel(),this.tracker.reset(),this.history.clear(),this.detailOpen.clear(),this.treeLoaded.clear(),this.treeLoading.clear(),this.renderer.dropDetail();let n=Ce(e);this.store.set({data:n===this.store.state.data?[...n]:n}),t!=null&&t.scrollToTop&&this.renderer.setScroll({top:0,left:0});let r=this.store.state.selected;if(r.size)if(this.options.getRowId){let a=new Set(this.rowModel.allNodes().map(c=>c.id)),l=new Set([...r].filter(c=>a.has(c)));l.size!==r.size&&this.setSelected(l)}else this.setSelected(new Set,null);let i=this.rowModel.getRowCount(),s=this.store.state.focus;s&&s.rowIndex>=i&&this.store.set({focus:i?{...s,rowIndex:i-1}:null})}setColumns(e){var r;if(!Array.isArray(e)){q("setColumns: columns must be an array");return}if(ot(e,this.sourceSnapshot)){this.sourceDefs=e;return}if(this.menu.close(),this.sourceDefs=e,this.sourceSnapshot=xe(e),this.pivotCfg){this.rebuildPivot();return}this.columns.updateDefs(this.withSelect(e)),this.bindFormulas();let t=i=>!!this.columns.getNode(i),n=this.groupBy.filter(t);n.length!==this.groupBy.length&&(this.groupBy=n,(r=this.groupPanel)==null||r.refresh(),this.events.emit("groupChange",{groupBy:[...n]})),this.store.set({sort:this.store.state.sort.filter(i=>t(i.colId)),filters:Object.fromEntries(Object.entries(this.store.state.filters).filter(([i])=>t(i))),focus:this.store.state.focus&&t(this.store.state.focus.colId)?this.store.state.focus:null}),this.columnsChanged()}onChange(e){var i,s,a,l;let t=(...c)=>c.some(d=>e.includes(d));this.pivotCfg&&t("data","locale")&&this.rebuildPivot(!1),t("locale")&&(this.menu.close(),this.chooser.close(),(i=this.sideBar)==null||i.refresh(),this.rowModel.invalidate());let n=t("sort","filters","quickFilter","advancedFilter")&&this.page!==0;n&&(this.page=0),t("data","sort","filters","quickFilter","advancedFilter","locale")&&this.updateRows(),n&&this.emitPage(),t("data","sort","filters","quickFilter","advancedFilter")&&this.store.state.range&&!this.keepRange&&this.setRange(null),t("data","sort","filters","quickFilter","advancedFilter","locale")&&this.finder.refresh(),(t("data","filters","quickFilter","advancedFilter","locale")||t("selected")&&((s=this.summaryOpts)==null?void 0:s.scope)==="selected")&&this.refreshSummary(),t("locale")&&((a=this.groupPanel)==null||a.refresh()),t("filters")&&((l=this.sideBar)==null||l.refresh()),t("theme")&&this.renderer.applyTheme();let r=t("sort","filters","quickFilter","advancedFilter","locale","data");!r&&t("selected")&&this.renderer.selectionChanged(),this.renderer.invalidate({header:r,rows:t("data","sort","filters","quickFilter","advancedFilter","locale")})}createApi(){let e=t=>((...n)=>{if(this.destroyed){q("API called after destroy()");return}return t(...n)});return{setData:e((t,n)=>this.setData(t,n)),getData:e(()=>this.store.state.data),setColumns:e(t=>this.setColumns(t)),getColumnState:e(()=>this.columns.getState()),applyColumnState:e(t=>{this.columns.applyState(t),this.columnsChanged()}),setSort:e(t=>this.setSort(t)),getSort:e(()=>[...this.store.state.sort]),setFilter:e((t,n)=>this.setFilter(t,n)),getFilterModel:e(()=>({...this.store.state.filters})),setQuickFilter:e(t=>this.store.set({quickFilter:t!=null?t:""})),getSelectedRows:e(()=>this.selectedRows()),selectAll:e(()=>this.setSelected(new Set([...this.store.state.selected,...this.selectableRows().map(t=>t.id)]))),deselectAll:e(()=>this.setSelected(new Set,null)),getDisplayedRowCount:e(()=>this.rowModel.getRowCount()),scrollToRow:e(t=>this.renderer.scrollToRow(t)),validate:e(()=>this.validateAll()),setDensity:e(t=>this.setDensity(t)),getDensity:e(()=>this.density),showOverlay:e(t=>{this.forcedOverlay=t==="loading"||t==="noRows"?t:null,this.renderer.invalidate()}),getXlsxSheet:e(t=>{var n;return this.allow("excel")?yo(this,t):{name:(n=t==null?void 0:t.sheetName)!=null?n:"Sheet1",rows:[]}}),print:e(t=>li(ho(this,t))),getPrintHtml:e(t=>ho(this,t)),getPdf:e(t=>this.allow("pdf")?ro(Cn(this,t),dn,{scale:t==null?void 0:t.resolution,quality:t==null?void 0:t.quality}):null),exportPdf:e((t="export.pdf",n)=>{if(!this.allow("pdf"))return;let r=ro(Cn(this,n),dn,{scale:n==null?void 0:n.resolution,quality:n==null?void 0:n.quality});r?qe(t,[r],"application/pdf"):q("exportPdf: this browser cannot draw on a canvas")}),setColumnGroupOpened:e((t,n)=>this.setColumnGroupOpened(t,n)),setAdvancedFilter:e(t=>this.setAdvancedFilter(t)),getAdvancedFilter:e(()=>this.store.state.advancedFilter?JSON.parse(JSON.stringify(this.store.state.advancedFilter)):null),openFilterBuilder:e(()=>{this.allow("advancedFilter")&&this.filterBuilder.open()}),isColumnGroupOpened:e(t=>{var n;return!!((n=this.columns.getNode(t))!=null&&n.open)}),applyTransaction:e(t=>this.applyTransaction(t)),applyTransactionAsync:e(t=>this.applyTransactionAsync(t)),flushAsyncTransactions:e(()=>this.flushAsyncTransactions()),setConditionalFormats:e(t=>this.setConditionalFormats(t)),getConditionalFormats:e(()=>this.getConditionalFormats()),openConditionalFormats:e(t=>{this.allow("conditional")&&this.formatDialog.open(t)}),askAssistant:e(t=>In(this,t,this.allow("assistant")?this.options.assistant:void 0)),openAssistant:e(()=>{this.allow("assistant")&&this.assistantPanel.open()}),getState:e(()=>this.getState()),setState:e((t,n)=>this.setState(t,n)),getScrollPosition:e(()=>this.renderer.getScroll()),setScrollPosition:e(t=>this.renderer.setScroll(t!=null?t:{})),syncScroll:e((t,n="both")=>this.syncScroll(t,n)),setTheme:e(t=>this.store.set({theme:t})),setLocale:e(t=>this.store.set({locale:st(t)})),setFont:e(t=>this.setFont(t)),setColumnVisible:e((t,n)=>this.setColumnsVisible([t],n)),autoSizeColumns:e(t=>this.autoSize(t)),resetColumnState:e(()=>this.resetColumns()),openColumnChooser:e(()=>this.chooser.open()),closeColumnChooser:e(()=>this.chooser.close()),toggleSideBar:e((t,n)=>{var r;this.allow("sideBar")&&((r=this.sideBar)==null||r.toggle(t,n))}),setSummary:e(t=>this.setSummary(t)),getSummaryValues:e(()=>this.summaryValues.map(t=>({...t}))),getRange:e(()=>{let t=this.store.state.range;return t&&{start:{...t.start},end:{...t.end}}}),setRange:e(t=>this.setRange(t)),getRanges:e(()=>this.getRanges()),setRanges:e(t=>this.setRanges(t)),copySelection:e(t=>this.copyToClipboard(!!(t!=null&&t.headers),!!(t!=null&&t.rows))),pasteText:e(t=>this.pasteText(t)),cutSelection:e(()=>this.cutToClipboard()),stopRowEdit:e(t=>this.editor.endRow(!t)),startEdit:e((t,n)=>this.editor.start(t,n)),stopEdit:e(t=>t?this.editor.cancel():void this.editor.commit(null)),addRows:e((t,n)=>this.addRows(t,n)),removeRows:e(t=>this.removeRows(t)),removeSelectedRows:e(()=>this.removeRows(this.selectedRows())),getModifiedRows:e(()=>this.getModifiedRows()),getChanges:e(()=>this.getChanges()),hasChanges:e(()=>this.hasChanges()),commitChanges:e(t=>this.commitChanges(t)),revertChanges:e(()=>this.revertChanges()),undo:e(()=>this.undo()),redo:e(()=>this.redo()),canUndo:e(()=>this.history.canUndo()),canRedo:e(()=>this.history.canRedo()),fillRange:e(t=>this.fillRange(t)),setPinnedRows:e(t=>this.setPinnedRows(t)),find:e(t=>this.allow("find")?this.finder.find(t):0),findNext:e(()=>this.finder.next()),findPrevious:e(()=>this.finder.previous()),clearFind:e(()=>this.finder.clear()),setGroupBy:e(t=>this.setGroupBy(t)),getGroupBy:e(()=>this.getGroupBy()),setGroupExpanded:e((t,n)=>this.setGroupExpanded(t,n)),expandAll:e(()=>this.expandAll(!0)),collapseAll:e(()=>this.expandAll(!1)),setDetailExpanded:e((t,n)=>this.setDetailExpanded(t,n)),isDetailExpanded:e(t=>this.isDetailExpanded(t)),moveRow:e((t,n)=>this.moveRow(t,n)),dropRow:e((t,n,r)=>this.dropRow(t,n,r)),setPage:e(t=>this.setPage(t)),getPage:e(()=>this.getPage()),getPageCount:e(()=>this.getPageCount()),setPageSize:e(t=>this.setPageSize(t)),getPageSize:e(()=>this.getPageSize()),refreshRows:e(()=>this.refreshRows()),setPivot:e(t=>this.setPivot(t)),getPivot:e(()=>this.getPivot()),createChart:e(t=>this.allow("charts")?this.charts.create(t):{el:k("div","fg-chart-body"),setType:()=>{},update:()=>{},destroy:()=>{}}),getCsv:e(t=>mo(this,t)),getJson:e(t=>go(this,t)),exportJson:e((t="export.json",n)=>qe(t,[go(this,n)],"application/json;charset=utf-8")),exportCsv:e((t="export.csv",n)=>qe(t,["\uFEFF",mo(this,n)],"text/csv;charset=utf-8")),getXlsx:e(t=>this.allow("excel")?wo(this,t):new Uint8Array(0)),exportXlsx:e((t="export.xlsx",n)=>{this.allow("excel")&&qe(t,[wo(this,n)],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}),importFile:e((t,n)=>ci(this,t,n)),on:e((t,n)=>this.events.on(t,n)),destroy:()=>this.destroy()}}destroy(){if(!this.destroyed){this.destroyed=!0,qt.delete(this.renderer.root),clearTimeout(this.flashTimer),clearTimeout(this.txTimer);for(let e of this.disposers)e();this.renderer.destroy(),this.events.clear()}}};function Wi(o,e){return new Do(o,e).api}function $o(o){let e=(Array.isArray(o)?o:[]).filter(t=>t&&t.grid&&typeof t.grid.getXlsxSheet=="function");return e.length?e.some(t=>{var n;return((n=Br(t.grid))==null?void 0:n.allow("workbook"))===!1})?new Uint8Array(0):ze(e.map((t,n)=>{var r,i,s;return t.grid.getXlsxSheet({...t.options,sheetName:(s=(i=t.sheetName)!=null?i:(r=t.options)==null?void 0:r.sheetName)!=null?s:`Sheet${n+1}`})})):(q("buildWorkbook: no grids given; the file has one empty sheet"),ze([{name:"Sheet1",rows:[]}]))}function ji(o,e){let t=$o(e);t.length&&qe(o||"export.xlsx",[t],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}var Cl=o=>typeof o=="function"?o():o!=null?o:{};async function Ui(o,e,t,n){var c;let r=o,i=o.split(/[?#]/)[0],s={method:e,credentials:(c=n.credentials)!=null?c:"same-origin",headers:{Accept:"application/json",...Cl(n.headers)}};if(e==="GET"){let d=new URLSearchParams;for(let[u,f]of Object.entries(t))f!==void 0&&d.set(u,typeof f=="string"?f:JSON.stringify(f));r+=(o.includes("?")?"&":"?")+d.toString()}else s.headers["Content-Type"]="application/json",s.body=JSON.stringify(t);let a=await fetch(r,s);if(!a.ok)throw new Error(`HTTP ${a.status} from ${i}`);let l=await a.text();if(!l)return null;try{return JSON.parse(l)}catch{throw new Error(`HTTP ${a.status} from ${i}: the response is not JSON`)}}function kl(o){if(Array.isArray(o))return{rows:o};let e=o!=null?o:{},t=[e.rows,e.list,e.content,e.data,e.items,e.resultList].find(Array.isArray),n=[e.total,e.totalCount,e.totalElements,e.totCnt,e.count].find(r=>typeof r=="number");return{rows:(t!=null?t:[]).filter(r=>r!==null&&typeof r=="object"),total:n}}function Bo(o,e={}){return{async getRows(t){var s,a,l,c,d;let n=Math.max(1,t.end-t.start),r={start:t.start,end:t.end,page:Math.floor(t.start/n),size:n,sort:t.sort,filters:t.filters,quickFilter:t.quickFilter,advancedFilter:(s=t.advancedFilter)!=null?s:void 0,groupBy:t.groupBy,groupKeys:t.groupKeys,...(l=(a=e.params)==null?void 0:a.call(e))!=null?l:{}},i=await Ui(o,(c=e.method)!=null?c:"POST",r,e);return((d=e.transform)!=null?d:kl)(i)}}}var No=new WeakMap;function Ki(o,e,t={}){let n=No.get(o);if(n)return n;if(!o.hasChanges())return Promise.resolve(null);let{created:r,updated:i,deleted:s}=o.getModifiedRows(),a=new Map([...r,...i].map(c=>[c,{...c}])),l=(async()=>{var d,u;let c=await Ui(e,"POST",{created:r,updated:i,deleted:s,...(u=(d=t.params)==null?void 0:d.call(t))!=null?u:{}},t);return o.commitChanges({rows:a,deleted:s}),c})().finally(()=>No.delete(o));return No.set(o,l),l}var Oo=new WeakMap;async function _i(o,e,t={}){var i,s;let n=((i=Oo.get(o))!=null?i:0)+1;Oo.set(o,n);let{rows:r}=await Bo(e,t).getRows({start:0,end:(s=t.maxRows)!=null?s:1e4,sort:[],filters:{},quickFilter:""});return Oo.get(o)===n&&o.setData(r),r}function Xi(o=document){var n,r;let e=(n=o.querySelector('meta[name="_csrf"]'))==null?void 0:n.content,t=((r=o.querySelector('meta[name="_csrf_header"]'))==null?void 0:r.content)||"X-CSRF-TOKEN";return e?{[t]:e}:{}}var Ji=["add","update","remove","upsert"];function Ho(o){let e=o;if(typeof e=="string"){if(!e.trim())return null;e=JSON.parse(e)}if(Array.isArray(e))return{upsert:e.filter(n=>n&&typeof n=="object")};if(!e||typeof e!="object")return null;let t=e;return Ji.some(n=>Array.isArray(t[n]))?t:Array.isArray(t.rows)?{rows:t.rows}:null}function Yi(o,e){let t=e!=null?e:{},n="connecting",r=!1,i=!1,s=[],a=null,l=0,c=0,d=w=>{var m;if(n!==w){n=w;try{(m=t.onStatus)==null||m.call(t,w)}catch{}}},u=w=>{"rows"in w&&Array.isArray(w.rows)&&!Ji.some(m=>m in w)?(o.flushAsyncTransactions(),o.setData(w.rows)):t.immediate?o.applyTransaction(w):o.applyTransactionAsync(w)},f=w=>{if(r)return;let m;try{m=t.parse?t.parse(w):Ho(w),Array.isArray(m)&&(m={upsert:m})}catch(y){t.onError?t.onError(y):q("connectLive: a message could not be read");return}!m||typeof m!="object"||(i?s.push(m):u(m))},h=()=>{if(r||t.reconnect===!1){d("closed");return}let w=typeof t.maxDelay=="number"&&t.maxDelay>0?t.maxDelay:3e4,m=Math.min(w,500*2**Math.min(c++,10))*(.8+Math.random()*.4);d("connecting"),l=window.setTimeout(p,m)},p=()=>{if(r)return;if(l=0,t.poll){g();return}let w=t.url;if(!w){q("connectLive: give a url or a poll function"),d("error");return}d(i?"paused":"connecting");try{if(/^wss?:/i.test(w)){if(typeof WebSocket=="undefined")throw new Error("no WebSocket");let m=new WebSocket(w,t.protocols);a=m,m.onopen=()=>{c=0,d(i?"paused":"open")},m.onmessage=y=>f(y.data),m.onerror=()=>d("error"),m.onclose=()=>{a===m&&(a=null),r||h()}}else{if(typeof EventSource=="undefined")throw new Error("no EventSource");let m=new EventSource(w,{withCredentials:!!t.withCredentials});a=m,m.onopen=()=>{c=0,d(i?"paused":"open")},m.addEventListener(t.event||"message",y=>f(y.data)),m.onerror=()=>{m.readyState===2?(a===m&&(a=null),r||h()):d("connecting")}}}catch{d("error"),h()}},g=async()=>{if(!r)try{let w=await t.poll();if(r)return;c=0,d(i?"paused":"open"),f(w);let m=typeof t.interval=="number"&&t.interval>0?t.interval:2e3;l=window.setTimeout(g,m)}catch{if(r)return;d("error"),h()}};return p(),{get status(){return n},pause(){r||i||(i=!0,d("paused"))},resume(){if(r||!i)return;i=!1;let w=s;s=[];for(let m of w)u(m);d(a||t.poll?"open":"connecting")},close(){r||(r=!0,clearTimeout(l),a==null||a.close(),a=null,s=[],d("closed"))},send(w){let m=a;return!m||typeof m.send!="function"||m.readyState!==1?!1:(m.send(w),!0)}}}var Zi={en:he,ko:_o,"zh-CN":Xo,"zh-TW":Jo,ja:Ko,es:jo,fr:Uo,de:Wo,vi:Yo,th:Zo,id:Qo,ru:er,"pt-BR":tr,it:nr};for(let o of Object.values(Zi))Mt(o);return rs(Rl);})();
46
+ `,yn=o=>typeof o=="string"&&/^(#[0-9a-f]{3,8}|[a-z]+|rgba?\([\d\s.,%]+\)|hsla?\([\d\s.,%deg]+\))$/i.test(o.trim())?o.trim():void 0,Ja=1e3;function kn(o,e={}){var A,F,$,D,O;let t=xn(o,e.columns),n=o.store.state.locale,r=n.code,i=t.map(P=>ee(P.def,r)),s=Re(r),a=(A=e.rowNumbers)!=null?A:!!o.options.rowNumbers,l=P=>qa.includes(P.align)?P.align:P.type==="number"?"right":P.type==="boolean"?"center":"left",c=t.map(P=>{let N=[];for(let B=P.node;B;B=B.parent)N.unshift(B);return N}),d=Math.max(1,...c.map(P=>P.length)),u=[];if(e.headers!==!1)for(let P=0;P<d;P++){let N=P===0&&a?[{text:"#",align:"right",num:!0,rowspan:d}]:[];for(let B=0;B<t.length;B++){let z=c[B],W=z.length-1;if(P<W){let U=z[P];if(B>0&&c[B-1][P]===U)continue;let X=1;for(;B+X<t.length&&c[B+X][P]===U;)X++;N.push({text:qe(U.def,U.id),align:X>1?"center":"left",span:X,group:!0})}else P===W&&N.push({text:qe(t[B].def,t[B].id),align:l(t[B].def),span:1,rowspan:d-P})}u.push(N)}let f=(P,N,B,z)=>{var U;if(B==null||B==="")return"";if(z==="count")return s.format(B);let W=(U=P.def.type)!=null?U:typeof B=="number"?"number":B instanceof Date?"date":void 0;return W===P.def.type?i[N](B):at(P.def,W,r)(B)},p=(P,N,B,z=0)=>{var X;let W=0;for(;W<t.length-1&&!B[W];)W++;W=Math.max(1,W);let U=a?[{text:"",align:"right",num:!0}]:[];U.push({text:N,align:"left",span:W,indent:z});for(let I=W;I<t.length;I++)U.push({text:(X=B[I])!=null?X:"",align:l(t[I].def)});return{kind:P,level:z,cells:U}},h=Cn(o,e.rows),g=e.groups!==!1&&!o.rowModel.server&&!o.options.treeData?o.getGroupBy():[],w=e.styles!==!1&&t.some(P=>P.def.cellClass)?di(o):null,m=[],y=typeof e.maxRows=="number"&&e.maxRows>=1?Math.floor(e.maxRows):Ja,b=0;try{for(let P of _a(o,h,g)){if(P.kind==="row"&&b>=y)break;if(P.kind==="group"){let z=(F=o.columns.getNode(P.colId))==null?void 0:F.def,W=K(P.value)?n.blanks:z?ee(z,r)(P.value):String(P.value),U=`${z?qe(z,P.colId):P.colId}: ${W} (${s.format(P.rows.length)})`,X=t.map((I,H)=>{if(!(!I.def.aggFunc||g.includes(I.id)))try{return f(I,H,Le(I.def.aggFunc,P.rows.map(J=>j(I.def,J)),P.rows),I.def.aggFunc)||void 0}catch{return}});m.push(p("group",U,X,P.level));continue}let N=P.row,B=a?[{text:String(P.n),align:"right",num:!0}]:[];t.forEach((z,W)=>{let U=j(z.def,N),X=K(U)?"":i[W](U),I={text:X,align:l(z.def)};if(w&&z.def.cellClass){let J;try{J=typeof z.def.cellClass=="function"?z.def.cellClass({value:U,formatted:X,row:N,rowIndex:P.n-1,column:z.def}):z.def.cellClass}catch{J=void 0}if(J){let Y=w.of(J);Y.color&&(I.color=si(Y.color)),Y.fill&&(I.fill=si(Y.fill)),Y.bold&&(I.bold=!0)}}let H=e.styles!==!1?o.cellFormat(N,z.id,U):null;if(H){let J=H.style;yn(J.color)&&(I.color=yn(J.color)),yn(J.background)&&(I.fill=yn(J.background)),J.bold&&(I.bold=!0),J.italic&&(I.italic=!0),J.strike&&(I.strike=!0),H.bar&&(I.bar={from:H.bar.from,to:H.bar.to,color:/^#[0-9a-f]{3,8}$/i.test(H.bar.color)?H.bar.color:"#93c5fd"}),H.icon&&(I.icon={char:H.icon.char,color:H.icon.color})}B.push(I)}),m.push({kind:"row",cells:B}),b++}}finally{w==null||w.dispose()}let v=[],S=e.summary!==!1?o.summary():null;S&&S.opts.rows.forEach((P,N)=>{var z;let B=t.map((W,U)=>{var I,H;let X=(I=P.columns)==null?void 0:I[W.id];return X===void 0?void 0:f(W,U,(H=S.values[N])==null?void 0:H[W.id],ft(X).agg)||void 0});v.push(p("total",(z=P.label)!=null?z:"",B))});let x=t.map(P=>Math.max(1,P.width)),k=x.reduce((P,N)=>P+N,0),E=ja.includes(e.paper)?e.paper:"A4",L=e.orientation==="portrait"||e.orientation==="landscape"?e.orientation:k+(a?40:0)>Ua?"landscape":"portrait",R=e.printedAt!==!1?new Intl.DateTimeFormat(r,{dateStyle:"medium",timeStyle:"short"}).format(new Date):"",M=Number.isInteger(e.repeatRows)&&e.repeatRows>0?Math.min(e.repeatRows,m.length):0,T=h.length>b?n.printLimited.replace("{n}",s.format(b)).replace("{total}",s.format(h.length)):"";return T&&v.push({kind:"total",cells:[{text:T,align:"left",span:t.length+(a?1:0),italic:!0}]}),{lang:r,limited:T,title:($=e.title)!=null?$:"",subtitle:(D=e.subtitle)!=null?D:"",printed:R,footer:(O=e.footer)!=null?O:"",paper:E,orientation:L,fit:e.fitToWidth!==!1,numbered:a,widths:a?[40,...x]:x,head:u,body:m,foot:v,striped:e.striped!==!1,pageNumbers:e.pageNumbers!==!1,repeatHeader:e.repeatHeader!==!1,repeatTitle:!!e.repeatTitle,repeatRows:M}}function Ya(o,e=!1){let t=e?o.align==="left"||o.group?"":`text-align:${o.align}`:`text-align:${o.align}`,n=r=>{t+=t?`;${r}`:r};if(o.indent&&n(`padding-left:${7+o.indent*14}px`),o.color&&n(`color:${o.color}`),o.fill&&n(`background:${o.fill}`),o.bold&&n("font-weight:600"),o.italic&&n("font-style:italic"),o.strike&&n("text-decoration:line-through"),o.bar){let r=(o.bar.from*100).toFixed(1),i=(o.bar.to*100).toFixed(1);n(`background-image:linear-gradient(to right,transparent ${r}%,${o.bar.color}66 ${r}%,${o.bar.color}66 ${i}%,transparent ${i}%)`)}return t}function ai(o,e){var i;let t=[o.num?' class="num"':o.group&&((i=o.span)!=null?i:1)>1?' class="span"':"",o.span!==void 0&&(e==="th"||o.span>1)?` colspan="${o.span}"`:"",o.rowspan!==void 0&&e==="th"?` rowspan="${o.rowspan}"`:""].join("");if(o.num)return`<${e}${t}>${ve(o.text)}</${e}>`;let n=Ya(o,e==="th"),r=o.icon?`<span style="color:${ve(o.icon.color)};margin-right:5px">${ve(o.icon.char)}</span>`:"";return`<${e}${t}${n?` style="${ve(n)}"`:""}>${r}${ve(o.text)}</${e}>`}var po=o=>{var e;return`<tr${o.kind==="group"?` class="group level-${Math.min((e=o.level)!=null?e:0,5)}"`:o.kind==="total"?' class="total"':""}>${o.cells.map(t=>ai(t,"td")).join("")}</tr>`};function ho(o,e={}){let t=kn(o,e),n=t.widths.slice(t.numbered?1:0).reduce((y,b)=>y+b,0),r=t.fit?`<colgroup>${t.numbered?'<col style="width:40px">':""}${t.widths.slice(t.numbered?1:0).map(y=>`<col style="width:${Math.round(y/n*1e3)/10}%">`).join("")}</colgroup>`:"",i=ve(t.title||(typeof document!="undefined"?document.title:"")||""),s=t.title||t.subtitle?`<div>${t.title?`<h1>${i}</h1>`:""}${t.subtitle?`<p class="sub">${ve(t.subtitle)}</p>`:""}</div>`:"<div></div>",a=t.title||t.subtitle||t.printed?`<header>${s}${t.printed?`<p class="printed">${ve(t.printed)}</p>`:""}</header>`:"",l="font: 8.5px system-ui, sans-serif; color: #6b7280;",c=[`size: ${t.paper} ${t.orientation}; margin: 12mm 12mm 14mm;`,t.footer?`@bottom-left { content: ${Ka(t.footer)}; ${l} }`:"",t.pageNumbers?`@bottom-right { content: counter(page) " / " counter(pages); ${l} }`:""].join(" "),d=t.striped?"tbody tr:not(.group):nth-child(even) td { background: #f9fafb; }":"",u=t.head.map(y=>`<tr>${y.map(b=>ai(b,"th")).join("")}</tr>`).join(""),f=t.body.slice(0,t.repeatRows).map(po).join(""),p=Math.max(1,t.widths.length),h=t.repeatTitle&&a?`<tr class="title"><td colspan="${p}">${a}</td></tr>`:"",g=t.repeatHeader?`${h}${u}${f}`:`${h}${f}`,w=(t.repeatHeader?"":u)+t.body.slice(t.repeatRows).map(po).join(""),m=t.foot.map(po).join("");return`<!doctype html><html lang="${ve(t.lang)}"><head><meta charset="utf-8"><title>${i}</title><style>
47
+ @page { ${c} }${Xa}${d}
48
+ </style></head><body>${t.repeatTitle?"":a}<table${t.fit?' class="fit"':""}>${r}<thead>${g}</thead><tbody>${w}</tbody>${m?`<tfoot>${m}</tfoot>`:""}</table></body></html>`}function li(o){if(typeof document=="undefined")return;let e=document.createElement("iframe");e.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0",document.body.append(e);let t=e.contentDocument;if(!t||!e.contentWindow){e.remove(),V("printing is not supported in this environment");return}t.open(),t.write(o),t.close();let n=e.contentWindow,r=()=>setTimeout(()=>e.remove(),1e3);n.addEventListener("afterprint",r),setTimeout(()=>{try{n.focus(),n.print()}catch{V("printing is not supported in this environment")}r()},50)}function mo(o,e={}){let t=xn(o,e.columns),n=o.store.state.locale.code,r=typeof e.separator=="string"&&e.separator.length===1?e.separator:",",i=Cn(o,e.rows).map(s=>t.map(a=>{let l=j(a.def,s),c=a.def.type,d=tn(a.def,l,n);return{value:d,text:typeof l!="number"&&(!(c==="number"||c==="date"||c==="boolean")||typeof l=="string"&&!Wa.test(d))}}));return e.headers!==!1&&i.unshift(t.map(s=>({value:qe(s.def,s.id),text:!0}))),Qr(i,r)}function go(o,e={}){let t=xn(o,e.columns),n=o.store.state.locale.code,r=e.formatted?t.map(l=>ee(l.def,n)):null,i=t.map(l=>e.keys==="header"?qe(l.def,l.id):l.id),s=Cn(o,e.rows).map(l=>{let c={};return t.forEach((d,u)=>{let f=j(d.def,l);c[i[u]]=r?K(f)?"":r[u](f):f===void 0?null:f}),c}),a=typeof e.space=="number"&&e.space>=0?Math.min(10,e.space):2;return JSON.stringify(s,null,a)}function Za(o){var i;let e=o.format;if(o.type==="date")return e==="datetime"?"yyyy-mm-dd hh:mm":e==="time"?"hh:mm":"yyyy-mm-dd";if(o.type!=="number"||e==null)return null;if(typeof e=="string")return e==="integer"?"#,##0":e==="percent"?"0%":e.startsWith("currency:")?"#,##0.##":/^[#0,.%]+$/.test(e)?e:null;let t=e,n=(i=t.maximumFractionDigits)!=null?i:t.minimumFractionDigits,r=n?`.${"0".repeat(Math.min(10,n))}`:"";return t.style==="percent"?`0${r}%`:`${t.useGrouping===!1?"0":"#,##0"}${r}`}function bn(o){let e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());if(e)return`FF${(e[1].length===3?[...e[1]].map(i=>i+i).join(""):e[1]).toUpperCase()}`;let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i.exec(o.trim());return!t||!((t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))>0)?"":`FF${[t[1],t[2],t[3]].map(r=>Math.min(255,Number(r)).toString(16).padStart(2,"0")).join("").toUpperCase()}`}function di(o){let e=o.renderer.root;if(typeof getComputedStyle!="function"||!e.isConnected)return{of:()=>({}),dispose:()=>{}};let t=document.createElement("div");t.className="fg-row",t.style.cssText="position:absolute;left:-9999px;top:0;visibility:hidden;pointer-events:none";let n=document.createElement("div");t.append(n),e.append(t);let r=a=>{n.className=a?`fg-cell ${a}`:"fg-cell";let l=getComputedStyle(n),c=l.fontWeight;return{color:l.color,fill:l.backgroundColor,bold:c==="bold"||Number(c)>=600}},i=r(""),s=new Map;return{of(a){let l=s.get(a);if(!l){let c=r(a);l={},c.color!==i.color&&bn(c.color)&&(l.color=bn(c.color)),c.fill!==i.fill&&bn(c.fill)&&(l.fill=bn(c.fill)),c.bold&&!i.bold&&(l.bold=!0),s.set(a,l)}return l},dispose:()=>t.remove()}}function wo(o,e={}){return Ve([yo(o,e)])}function yo(o,e={}){var w;let t=xn(o,e.columns),n=o.store.state.locale.code,r=[],i=[],s=0;if(e.headers!==!1){let m=t.map(b=>{let v=[];for(let S=b.node;S;S=S.parent)v.unshift(S);return v});s=Math.max(1,...m.map(b=>b.length));let y=b=>{let v="";for(let S=b+1;S>0;S=Math.floor((S-1)/26))v=String.fromCharCode(65+(S-1)%26)+v;return v};for(let b=0;b<s;b++){let v=[];for(let S=0;S<t.length;S++){let x=m[S],k=x.length-1;if(b<k){let E=x[b],L=S>0?m[S-1][b]:null;if(v.push({v:L===E?null:qe(E.def,E.id),header:!0}),L!==E){let R=S;for(;R+1<t.length&&m[R+1][b]===E;)R++;R>S&&i.push(`${y(S)}${b+1}:${y(R)}${b+1}`)}}else b===k?(v.push({v:qe(t[S].def,t[S].id),header:!0}),s-1>b&&i.push(`${y(S)}${b+1}:${y(S)}${s}`)):v.push({v:null,header:!0})}r.push(v)}}let a=t.map(m=>Za(m.def)),l=t.map(m=>ee(m.def,n)),c=Cn(o,e.rows),d=e.styles!==!1,u=d&&t.some(m=>m.def.cellClass)?di(o):null,f=(m,y,b)=>{var S;if(K(b))return null;let v=(S=a[y])!=null?S:void 0;switch(m.def.type){case"number":{let x=typeof b=="number"?b:Number(b);return Number.isFinite(x)?{v:x,fmt:v}:String(b)}case"date":{let x=me(b);return x?{v:x,fmt:v}:String(b)}case"boolean":return typeof b=="boolean"?b:String(b);default:return l[y](b)}};try{c.forEach((m,y)=>{r.push(t.map((b,v)=>{let S=j(b.def,m),x=f(b,v,S);if(!d)return x;let k=b.def.align?{align:b.def.align}:{};if(u&&b.def.cellClass){let L;try{L=typeof b.def.cellClass=="function"?b.def.cellClass({value:S,formatted:l[v](S),row:m,rowIndex:y,column:b.def}):b.def.cellClass}catch{L=void 0}L&&(k={...k,...u.of(L)})}let E=o.cellFormat(m,b.id,S);if(E){let L=ao(E.style.color),R=ao(E.style.background);L&&(k.color=L),R&&(k.fill=R),E.style.bold&&(k.bold=!0)}return Object.keys(k).length?x!==null&&typeof x=="object"&&!(x instanceof Date)?{...x,...k}:{v:x,...k}:x}))})}finally{u==null||u.dispose()}let p=new Set,h=m=>{let y="";for(let b=m+1;b>0;b=Math.floor((b-1)/26))y=String.fromCharCode(65+(b-1)%26)+y;return y},g=(m,y,b,v)=>{for(let S=m;S<=b;S++)for(let x=y;x<=v;x++)if(p.has(`${S},${x}`))return;for(let S=m;S<=b;S++)for(let x=y;x<=v;x++)p.add(`${S},${x}`);i.push(`${h(y)}${s+m+1}:${h(v)}${s+b+1}`)};return c.forEach((m,y)=>t.forEach((b,v)=>{let S=b.def.colSpan?pt(b.def.colSpan,b.def,m,y,t.length-v):1;S>1&&g(y,v,y,v+S-1)})),t.forEach((m,y)=>{if(!m.def.merge&&!m.def.rowSpan)return;let b=Gt(c,m.def);for(let v=0;v<c.length;v++)b.start[v]===v&&b.end[v]>v&&g(v,y,b.end[v],y)}),{name:(w=e.sheetName)!=null?w:"Sheet1",rows:r,widths:t.map(m=>Math.round(m.width/7)),merges:i,freezeRows:s,printTitleRows:e.repeatHeader===!1?0:s+(Number.isInteger(e.repeatRows)&&e.repeatRows>0?e.repeatRows:0),autoFilter:s>0}}function We(o,e,t){if(typeof URL=="undefined"||typeof URL.createObjectURL!="function"||typeof document=="undefined"){V("downloads are not supported in this environment");return}let n=URL.createObjectURL(new Blob(e,{type:t})),r=document.createElement("a");r.href=n,r.download=o,r.style.display="none",document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var vn=o=>String(o!=null?o:"").trim().toLowerCase();function Qa(o){var e;return o==null?"":o instanceof Date?o.getHours()||o.getMinutes()||o.getSeconds()?o.toISOString():(e=ie(o))!=null?e:"":String(o)}async function ci(o,e,t={}){var g;let n=e instanceof Uint8Array?e:new Uint8Array(e instanceof ArrayBuffer?e:await e.arrayBuffer()),r;if(mn(n)){let w=await wn(n),m=typeof t.sheet=="string"?w.find(y=>y.name===t.sheet):w[typeof t.sheet=="number"?t.sheet:0];if(!m)throw new Error(`Sheet ${String(t.sheet)} not found`);r=m.rows}else{let w=new TextDecoder().decode(n);r=hn(w,co(w))}if(!r.length)return{rows:[],skipped:0};let i=[],s=w=>w.forEach(m=>m.children?s(m.children):!G(m.id)&&m.def.field&&i.push(m));s(o.columns.roots());let a=w=>{var y,b;let m=vn(w);return m&&(b=(y=i.find(v=>vn(v.def.header)===m))!=null?y:i.find(v=>vn(v.def.field)===m||vn(v.id)===m))!=null?b:null},l=1,c=new Set(r[0].map(a).filter(Boolean));for(;l<Math.min(r.length,5);){let m=((g=r[l])!=null?g:[]).filter(b=>b!=null&&String(b).trim()!==""),y=m.map(a).filter(b=>b&&!c.has(b));if(!m.length||!m.every(b=>typeof b=="string")||!y.length)break;y.forEach(b=>c.add(b)),l++}let d=Math.max(...r.slice(0,l).map(w=>{var m;return(m=w==null?void 0:w.length)!=null?m:0})),u=Array.from({length:d},(w,m)=>{var y;for(let b=l-1;b>=0;b--){let v=(y=r[b])==null?void 0:y[m];if(v!=null&&String(v).trim()!=="")return a(v)}return null}),f=o.store.state.data[0],p=0,h=[];for(let w of r.slice(l)){if(!w||w.every(y=>y==null||String(y).trim()===""))continue;let m={};u.forEach((y,b)=>{if(!y)return;let v=y.def,S=Qa(w[b]),x=o.acceptText(v,m,S,f==null?void 0:f[v.field]);x.ok?S===""&&(x.value===null||x.value==="")||(m[v.field]=x.value):p++}),h.push(m)}return t.mode==="replace"?o.setData(h):o.addRows(h),{rows:h,skipped:p}}var el="http://www.w3.org/2000/svg";var bo=["var(--fg-accent, #2563eb)","#f59e0b","#10b981","#ef4444","#8b5cf6","#06b6d4","#ec4899","#84cc16","#f97316","#64748b","#14b8a6","#a855f7"],Pe=o=>bo[o%bo.length];function te(o,e={},t=""){let n=document.createElementNS(el,o);t&&n.setAttribute("class",t);for(let[r,i]of Object.entries(e))n.setAttribute(r,String(i));return n}function xt(o,e){let t=te("title");t.textContent=e,o.append(t)}function vo(o,e,t=5){let n=Math.min(0,o),r=Math.max(0,e);n===r&&(r=n+1);let i=(r-n)/t,s=10**Math.floor(Math.log10(i)),a=[1,2,5,10].map(c=>c*s).find(c=>c>=i);n=Math.floor(n/a)*a,r=Math.ceil(r/a)*a;let l=[];for(let c=n;c<=r+a/2;c+=a)l.push(Math.round(c/a)*a);return l}function Rn(o,e){var M,T;let t=new Intl.NumberFormat(e.locale,{maximumFractionDigits:2}),n=new Intl.NumberFormat(e.locale,{notation:"compact",maximumFractionDigits:1}),r=te("svg",{viewBox:"0 0 640 360",role:"img",preserveAspectRatio:"xMidYMid meet"},`fg-chart fg-chart-is-${e.type}`);e.title&&r.setAttribute("aria-label",e.title);let i=e.series.slice(0,bo.length),s=e.categories,a=16;if(e.title){let A=te("text",{x:320,y:22,"text-anchor":"middle"},"fg-chart-title");A.textContent=e.title,r.append(A),a=36}let l=te("g",{},"fg-chart-legend"),c=e.type==="pie"||e.type==="donut",d=c?s:e.type==="scatter"?i.slice(1).map(A=>A.name):i.map(A=>A.name),u=16;d.forEach((A,F)=>{let $=te("g",{transform:`translate(${u},350)`},"fg-chart-legend-item");$.append(te("rect",{x:0,y:-9,width:10,height:10,rx:2,fill:Pe(F)}));let D=te("text",{x:14,y:0});D.textContent=A,$.append(D),l.append($),u+=24+Math.min(140,A.length*7)});let f=308;if(e.type==="scatter"){tl(r,e,i,a,f,t,n),r.append(l),o.replaceChildren(r);return}if(c){let A=((T=(M=i[0])==null?void 0:M.values)!=null?T:[]).map(N=>N!==null&&N>0?N:0),F=A.reduce((N,B)=>N+B,0),$=640/2,D=(a+f)/2,O=Math.max(10,(f-a)/2-6),P=-Math.PI/2;A.forEach((N,B)=>{if(!N||!F)return;let z=P+N/F*Math.PI*2,W=z-P>Math.PI?1:0,U=H=>`${$+O*Math.cos(H)},${D+O*Math.sin(H)}`,X=N===F?`M${$-O},${D}a${O},${O} 0 1,0 ${2*O},0a${O},${O} 0 1,0 ${-2*O},0`:`M${$},${D}L${U(P)}A${O},${O} 0 ${W} 1 ${U(z)}Z`,I=te("path",{d:X,fill:Pe(B)},"fg-chart-slice");xt(I,`${s[B]}: ${t.format(N)} (${Math.round(N/F*1e3)/10}%)`),r.append(I),P=z}),e.type==="donut"&&r.append(te("circle",{cx:$,cy:D,r:O*.58,fill:"var(--fg-bg, #fff)"},"fg-chart-donut-hole")),r.append(l),o.replaceChildren(r);return}let p=e.type==="stackedBar",h=0,g=0;s.forEach((A,F)=>{let $=0,D=0;for(let O of i){let P=O.values[F];P==null||!Number.isFinite(P)||(p?P>=0?$+=P:D+=P:(g=Math.max(g,P),h=Math.min(h,P)))}p&&(g=Math.max(g,$),h=Math.min(h,D))});let w=vo(h,g),m=w[0],y=w[w.length-1],b=56,v=624,S=A=>f-(A-m)/(y-m)*(f-a),x=te("g",{},"fg-chart-axis");for(let A of w){x.append(te("line",{x1:b,x2:v,y1:S(A),y2:S(A)},A===0?"fg-chart-zero":"fg-chart-grid"));let F=te("text",{x:b-6,y:S(A)+4,"text-anchor":"end"});F.textContent=n.format(A),x.append(F)}let k=(v-b)/Math.max(1,s.length),E=Math.max(1,Math.ceil(s.length/Math.floor((v-b)/56)));s.forEach((A,F)=>{if(F%E)return;let $=te("text",{x:b+k*(F+.5),y:f+16,"text-anchor":"middle"}),D=Math.max(3,Math.min(12,Math.floor(k*E/10)));$.textContent=A.length>D?`${A.slice(0,D-1)}\u2026`:A,x.append($)}),r.append(x);let L=te("g",{},"fg-chart-plot"),R=e.type==="combo";if(R){let A=k*.6,F=i[0];s.forEach(($,D)=>{let O=F==null?void 0:F.values[D];if(O==null||!Number.isFinite(O))return;let P=b+k*D+(k-A)/2,N=te("rect",{x:P,y:Math.min(S(0),S(O)),width:Math.max(1,A-2),height:Math.max(.5,Math.abs(S(O)-S(0))),fill:Pe(0),rx:2},"fg-chart-bar");xt(N,`${F.name} \xB7 ${$}: ${t.format(O)}`),L.append(N)})}if(e.type==="bar"||p){let A=k*.72,F=p?A:A/Math.max(1,i.length);s.forEach(($,D)=>{let O=0,P=0;i.forEach((N,B)=>{let z=N.values[D];if(z==null||!Number.isFinite(z))return;let W=0,U=z;p&&(W=z>=0?O:P,U=W+z,z>=0?O=U:P=U);let X=b+k*D+(k-A)/2+(p?0:F*B),I=te("rect",{x:X,y:Math.min(S(W),S(U)),width:Math.max(1,F-2),height:Math.max(.5,Math.abs(S(U)-S(W))),fill:Pe(B),rx:2},"fg-chart-bar");xt(I,`${N.name} \xB7 ${$}: ${t.format(z)}`),L.append(I)})})}else i.forEach((A,F)=>{if(R&&F===0)return;let $=A.values.map((P,N)=>P==null||!Number.isFinite(P)?null:[b+k*(N+.5),S(P),P]),D="",O=!1;for(let P of $){if(!P){O=!1;continue}D+=`${O?"L":"M"}${P[0]},${P[1]}`,O=!0}if(e.type==="area"){let P=$.filter(N=>!!N);if(P.length){let N=`M${P[0][0]},${S(0)}${P.map(B=>`L${B[0]},${B[1]}`).join("")}L${P[P.length-1][0]},${S(0)}Z`;L.append(te("path",{d:N,fill:Pe(F),"fill-opacity":.18},"fg-chart-area"))}}L.append(te("path",{d:D,fill:"none",stroke:Pe(F),"stroke-width":2.2,"stroke-linejoin":"round"},"fg-chart-line")),$.forEach((P,N)=>{if(!P)return;let B=te("circle",{cx:P[0],cy:P[1],r:3.5,fill:Pe(F)},"fg-chart-point");xt(B,`${A.name} \xB7 ${s[N]}: ${t.format(P[2])}`),L.append(B)})});r.append(L,l),o.replaceChildren(r)}function tl(o,e,t,n,r,i,s){var k,E,L,R;let a=(E=(k=t[0])==null?void 0:k.values)!=null?E:[],l=t.slice(1),c=M=>M!=null&&Number.isFinite(M),d=a.filter(c),u=l.flatMap(M=>M.values.filter(c));if(!d.length||!u.length)return;let f=M=>M.reduce((T,A)=>Math.min(T,A)),p=M=>M.reduce((T,A)=>Math.max(T,A)),h=vo(f(d),p(d)),g=vo(f(u),p(u)),w=56,m=624,y=M=>w+(M-h[0])/(h[h.length-1]-h[0])*(m-w),b=M=>r-(M-g[0])/(g[g.length-1]-g[0])*(r-n),v=te("g",{},"fg-chart-axis");for(let M of g){v.append(te("line",{x1:w,x2:m,y1:b(M),y2:b(M)},M===0?"fg-chart-zero":"fg-chart-grid"));let T=te("text",{x:w-6,y:b(M)+4,"text-anchor":"end"});T.textContent=s.format(M),v.append(T)}h.forEach((M,T)=>{let A=T===0?"start":T===h.length-1?"end":"middle",F=te("text",{x:y(M),y:r+16,"text-anchor":A});F.textContent=s.format(M),v.append(F)});let S=te("text",{x:m,y:r+32,"text-anchor":"end"},"fg-chart-axis-name");S.textContent=`${(R=(L=t[0])==null?void 0:L.name)!=null?R:""} \u2192`,v.append(S),o.append(v);let x=te("g",{},"fg-chart-plot");a.forEach((M,T)=>{c(M)&&l.forEach((A,F)=>{var O;let $=A.values[T];if(!c($))return;let D=te("circle",{cx:y(M),cy:b($),r:4,fill:Pe(F),"fill-opacity":.8},"fg-chart-point");xt(D,`${(O=e.categories[T])!=null?O:""}: ${t[0].name} ${i.format(M)}, ${A.name} ${i.format($)}`),x.append(D)})}),o.append(x)}var nl=12,ui=500,xo=["bar","stackedBar","line","area","combo","pie","donut","scatter"],Sn=class{constructor(e){this.grid=e;this.handles=new Set}create(e={}){var g,w;let{grid:t}=this,n=xo.includes(e.type)?e.type:"bar",r=()=>t.store.state.locale,i=(g=e.range)!=null?g:t.store.state.range,s=null;if(i){let m=t.columns.getColumn(i.start.colId),y=t.columns.getColumn(i.end.colId);if(m&&y){let b=gt({start:{rowIndex:i.start.rowIndex,colIndex:m.index},end:{rowIndex:i.end.rowIndex,colIndex:y.index}}),v=[];for(let S=b.r1;S<=b.r2&&v.length<ui;S++){let x=t.rowModel.getRow(S);x&&!x.kind&&v.push(x.data)}s={rows:v,colIds:t.columns.displayed().slice(b.c1,b.c2+1).filter(S=>!G(S.id)).map(S=>S.id)}}}let a=()=>{var E;let m=s?s.rows:t.rowModel.dataRows().slice(0,ui).map(L=>L.data),y=(s?s.colIds.map(L=>t.columns.getColumn(L)):t.columns.displayed().filter(L=>!G(L.id))).filter(L=>!!L),b=y[0]&&y[0].def.type!=="number"?y[0]:s?null:(E=y.find(L=>L.def.type!=="number"))!=null?E:null,v=L=>!!L.node.parent&&L.node.parent.id==="pivotgroup|total",S=y.filter(L=>L!==b&&L.def.type==="number"&&(s||!v(L))).slice(0,nl),x=L=>{var M,T,A;let R=[];for(let F=L.node.parent;F;F=F.parent)R.unshift((M=F.def.header)!=null?M:F.id);return R.push((A=(T=L.def.header)!=null?T:L.def.field)!=null?A:L.id),R.join(" \xB7 ")},k=b?ee(b.def,r().code):null;return{categories:m.map((L,R)=>b&&k?k(j(b.def,L)):String(R+1)),series:S.map(L=>({name:x(L),values:m.map(R=>{let M=j(L.def,R),T=typeof M=="number"?M:M==null||M===""?NaN:Number(M);return Number.isFinite(T)?T:null})}))}},l=C("div","fg-chart-body"),c=null,d=()=>Rn(l,{type:n,title:e.title,locale:r().code,...a()}),u=m=>({bar:r().chartBar,stackedBar:r().chartStacked,line:r().chartLine,area:r().chartArea,pie:r().chartPie,donut:r().chartDonut,combo:r().chartCombo,scatter:r().chartScatter})[m],f=()=>c==null?void 0:c.querySelectorAll(".fg-chart-type").forEach(m=>m.setAttribute("aria-pressed",String(m.dataset.type===n)));if(e.container)e.container.append(l);else{c=C("div","fg-chart-panel",{role:"dialog","aria-label":(w=e.title)!=null?w:u(n)});let m=C("div","fg-chart-head");for(let b of xo){let v=C("button","fg-chart-type",{type:"button",title:u(b)});v.dataset.type=b,v.textContent=u(b),v.addEventListener("click",()=>h.setType(b)),m.append(v)}let y=C("button","fg-chooser-close",{type:"button","aria-label":r().close});y.textContent="\xD7",y.addEventListener("click",()=>h.destroy()),m.append(C("span","fg-chart-spacer"),y),c.append(m,l),t.renderer.root.append(c)}let p=[t.events.on("cellValueChanged",()=>d()),t.events.on("rowsAdded",()=>d()),t.events.on("rowsRemoved",()=>d())];s||p.push(t.events.on("sortChange",()=>d()),t.events.on("filterChange",()=>d()));let h={el:l,setType:m=>{xo.includes(m)&&(n=m,f(),d())},update:()=>d(),destroy:()=>{p.forEach(m=>m()),(c!=null?c:l).remove(),this.handles.delete(h)}};return this.handles.add(h),f(),d(),h}destroy(){for(let e of[...this.handles])e.destroy()}};var fi=new WeakMap,ol=o=>typeof o=="function"?"custom":o;function Co(o,e){var t,n,r;return{rows:((t=o.rows)!=null?t:[]).filter(e),columns:((n=o.columns)!=null?n:[]).filter(e),values:((r=o.values)!=null?r:[]).filter(i=>i&&e(i.colId)).map(i=>{var s;return{colId:i.colId,aggFunc:(s=i.aggFunc)!=null?s:"sum"}}),totals:o.totals!==!1}}function pi(o,e){let t=(n,r)=>n.length===r.length&&n.every((i,s)=>i===r[s]);return o.totals===e.totals&&t(o.rows,e.rows)&&t(o.columns,e.columns)&&o.values.length===e.values.length&&o.values.every((n,r)=>n.colId===e.values[r].colId&&n.aggFunc===e.values[r].aggFunc)}function hi(o,e,t,n,r){let i=Co(e,x=>!!t(x)),s=new Intl.Collator(r,{numeric:!0,sensitivity:"base"}),a=x=>t(x),l=(x,k)=>x.map(E=>ne(j(a(E),k))).join(""),c=new Map,d=new WeakMap;for(let x of o){let k=l(i.columns,x);d.set(x,k),c.has(k)||c.set(k,i.columns.map(E=>j(a(E),x)))}let u=new WeakMap,f=x=>{var E;let k=u.get(x);if(!k){let L=x.flatMap(M=>{var T;return(T=fi.get(M))!=null?T:[]}),R=new Map;for(let M of L){let T=(E=d.get(M))!=null?E:l(i.columns,M),A=R.get(T);A||R.set(T,A=[]),A.push(M)}u.set(x,k={all:L,byCombo:R})}return k},p=[...c.entries()].sort((x,k)=>{for(let E=0;E<i.columns.length;E++){let L=bt(x[1][E],k[1][E],s);if(L)return L}return 0});i.columns.length||p.splice(0,p.length,["",[]]);let h=[],g=(x,k,E)=>{var A,F;let L=i.values[k],R=a(L.colId),M=`pivot|${E}|${k}`;h.push({id:M,comboKey:x,valueIndex:k});let T=L.aggFunc;return{id:M,field:M,header:`${(F=(A=R.header)!=null?A:R.field)!=null?F:L.colId} (${n.agg(ol(T))})`,type:"number",format:T==="count"?"integer":R.format,width:130,aggFunc:($,D)=>{var N;let O=f(D),P=x===null?O.all:(N=O.byCombo.get(x))!=null?N:[];return P.length?Le(T,P.map(B=>j(R,B)),P):null}}},w=[],m=(x,k)=>{if(K(k))return n.blank;let E=a(x);return E.type==="number"&&!E.format?String(k):ee(E,r)(k)};if(!i.columns.length)i.values.forEach((x,k)=>w.push(g("",k,0)));else{let x=(k,E,L)=>{let R=[],M=0;for(;M<k.length;){let T=k[M][1][E],A=ne(T),F=M;for(;F<k.length&&ne(k[F][1][E])===A;)F++;let $=k.slice(M,F),D=E===i.columns.length-1?i.values.map((O,P)=>g($[0][0],P,L+M)):x($,E+1,L+M);R.push({id:`pivotgroup|${E}|${L+M}`,header:m(i.columns[E],T),children:D}),M=F}return R};w.push(...x(p,0,0)),i.totals&&i.values.length&&w.push({id:"pivotgroup|total",header:n.total,children:i.values.map((k,E)=>g(null,E,"total"))})}let y=new Map;for(let x of o){let k=l(i.rows,x),E=y.get(k);E||y.set(k,E={values:i.rows.map(L=>j(a(L),x)),src:[]}),E.src.push(x)}let v=[...y.values()].sort((x,k)=>{for(let E=0;E<i.rows.length;E++){let L=bt(x.values[E],k.values[E],s);if(L)return L}return 0}).map(x=>{var L;let k={};i.rows.forEach((R,M)=>{var T;k[(T=a(R).field)!=null?T:R]=x.values[M]});let E=new Map;if(i.columns.length)for(let R of x.src){let M=l(i.columns,R),T=E.get(M);T||E.set(M,T=[]),T.push(R)}for(let R of h){let M=i.values[R.valueIndex],T=R.comboKey===null||!i.columns.length?x.src:(L=E.get(R.comboKey))!=null?L:[],A=a(M.colId);k[R.id]=T.length?Le(M.aggFunc,T.map(F=>j(A,F)),T):null}return fi.set(k,x.src),k});return{columns:[...i.rows.map(x=>{var E,L,R,M;let k=a(x);return{id:x,field:(E=k.field)!=null?E:x,header:(R=(L=k.header)!=null?L:k.field)!=null?R:x,type:k.type,format:k.format,width:(M=k.width)!=null?M:140}}),...w],rows:v,groupBy:i.rows.slice(0,-1)}}var mi={grouping:{en:"Row grouping and aggregation",ko:"\uD589 \uADF8\uB8F9\xB7\uC9D1\uACC4"},pivot:{en:"Pivot",ko:"\uD53C\uBC97"},charts:{en:"Charts",ko:"\uCC28\uD2B8"},range:{en:"Cell range selection",ko:"\uC140 \uBC94\uC704 \uC120\uD0DD"},clipboard:{en:"Range copy and paste",ko:"\uBC94\uC704 \uBCF5\uC0AC\xB7\uBD99\uC5EC\uB123\uAE30"},fill:{en:"Fill handle",ko:"\uCC44\uC6B0\uAE30 \uD578\uB4E4"},excel:{en:"Excel export",ko:"\uC5D1\uC140 \uB0B4\uBCF4\uB0B4\uAE30"},pdf:{en:"PDF export",ko:"PDF \uB0B4\uBCF4\uB0B4\uAE30"},serverGroups:{en:"Server-side groups",ko:"\uC11C\uBC84 \uADF8\uB8F9"},advancedFilter:{en:"Advanced filter",ko:"\uACE0\uAE09 \uD544\uD130"},sideBar:{en:"Side bar panels",ko:"\uC0AC\uC774\uB4DC\uBC14 \uD328\uB110"},contextMenu:{en:"Context menu",ko:"\uCEE8\uD14D\uC2A4\uD2B8 \uBA54\uB274"},summary:{en:"Summary rows",ko:"\uD569\uACC4 \uD589"},formulas:{en:"Formulas",ko:"\uC218\uC2DD"},find:{en:"Find",ko:"\uCC3E\uAE30"},conditional:{en:"Conditional formatting",ko:"\uC870\uAC74\uBD80 \uC11C\uC2DD"},assistant:{en:"AI assistant",ko:"AI \uC5B4\uC2DC\uC2A4\uD134\uD2B8"},merge:{en:"Merged cells",ko:"\uC140 \uBCD1\uD569"},workbook:{en:"Workbook",ko:"\uC6CC\uD06C\uBD81"}};var je="1.9.2";var rl={kty:"EC",crv:"P-256",x:"sUTKkglZmk-HMKPNub8p7AeLBKesHCU8irIkw9rJlbE",y:"j0U_aKRDR7iApY9UpaD3hUemhBLZJwDv9-QiT_hUyw8"},Ue="https://freegrid.app/pricing/",nt="https://freegrid.app/license/personal/",gi="https://freegrid.app/api/usage",il="https://freegrid.app/api/domain-status",sl=o=>Number.parseInt(String(o).split(".")[0],10),ki=o=>{let e=atob(o.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-o.length%4)%4));return Uint8Array.from(e,t=>t.charCodeAt(0))};function kt(o){let e=o.toLowerCase().replace(/^\[|\]$/g,"");if(!e||e==="localhost"||e==="127.0.0.1"||e==="::1"||e==="0.0.0.0"||e.endsWith(".localhost")||e.endsWith(".test")||e.endsWith(".local"))return!0;let t=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(e);if(!t)return!1;let[n,r,i,s]=t.slice(1).map(Number);return[n,r,i,s].some(a=>a>255)?!1:n===10||n===192&&r===168||n===172&&r>=16&&r<=31}function al(o,e){let t=o.toLowerCase().replace(/\.$/,"");return e.some(n=>{if(typeof n!="string")return!1;let r=n.toLowerCase().replace(/\.$/,""),i=r.startsWith("*.")?r.slice(2):r;return i?t===i||t.endsWith(`.${i}`):!1})}var So=o=>{let e=typeof o=="string"?/^(\d{4})-(\d{2})-(\d{2})$/.exec(o):null;if(!e)return!1;let t=new Date(Date.UTC(Number(e[1]),Number(e[2])-1,Number(e[3])));return t.getUTCMonth()===Number(e[2])-1&&t.getUTCDate()===Number(e[3])},ll=o=>`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`;function Ri(o,e,t={}){var s,a;let n=typeof o=="string"?o.trim().split("."):[];if(n.length!==3||n[0]!=="FG1")return{fail:{ok:!1,reason:"format"}};let r;try{if(r=JSON.parse(new TextDecoder().decode(ki(n[1]))),!r||!Array.isArray(r.domains)||!r.domains.every(l=>typeof l=="string")||!So(r.expires))return{fail:{ok:!1,reason:"format"}};if(r.major!==void 0&&!(Number.isInteger(r.major)&&r.major>0))return{fail:{ok:!1,reason:"format"}};if(r.plan!==void 0&&r.plan!=="company"&&r.plan!=="personal")return{fail:{ok:!1,reason:"format"}}}catch{return{fail:{ok:!1,reason:"format"}}}let i=null;return ll((s=t.now)!=null?s:new Date)>r.expires?i={ok:!1,reason:"expired",info:r}:al(e,r.domains)?r.major!==void 0&&sl((a=t.version)!=null?a:je)>r.major&&(i={ok:!1,reason:"version",info:r}):i={ok:!1,reason:"domain",info:r},{parts:n,info:r,fail:i}}var Si=()=>typeof crypto!="undefined"&&!!crypto.subtle;async function Mo(o,e,t={}){var l,c,d;let n=Ri(o,e,t);if(!("info"in n))return n.fail;let{parts:r,info:i}=n,s=()=>n.fail;if(!Si())return(l=s())!=null?l:{ok:!1,reason:"unsupported",info:i};let a=crypto.subtle;try{let u=await a.importKey("jwk",(c=t.publicKey)!=null?c:rl,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]),f=new TextEncoder().encode(`${r[0]}.${r[1]}`);if(!await a.verify({name:"ECDSA",hash:"SHA-256"},u,ki(r[2]),f))return{ok:!1,reason:"signature",info:i}}catch{return{ok:!1,reason:"signature",info:i}}return(d=s())!=null?d:{ok:!0,info:i}}var Ct,wi=new Map,ko=new Map,yi=new Set,bi=new Set;function Mi(o){Ct=o}var Mn={missing:`FreeGrid: every feature is free for 30 days on a domain. After that, paid features need a free personal key (${nt}) or a company key: ${Ue}
49
+ FreeGrid: \uB3C4\uBA54\uC778\uB9C8\uB2E4 30\uC77C \uB3D9\uC548 \uBAA8\uB4E0 \uAE30\uB2A5\uC744 \uBB34\uB8CC\uB85C \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uADF8 \uB4A4 \uC720\uB8CC \uAE30\uB2A5\uC5D0\uB294 \uBB34\uB8CC \uAC1C\uC778 \uD0A4(${nt}) \uB610\uB294 \uD68C\uC0AC \uD0A4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4: ${Ue}`,trial:o=>`FreeGrid: the 30-day trial of paid features on this domain ends ${o}. / \uC774 \uB3C4\uBA54\uC778\uC758 \uC720\uB8CC \uAE30\uB2A5 30\uC77C \uCCB4\uD5D8\uC740 ${o}\uC5D0 \uB05D\uB0A9\uB2C8\uB2E4.`,ended:`FreeGrid: the 30-day trial on this domain has ended, so paid features are now off. Get a free personal key (${nt}) or a company key: ${Ue}
50
+ FreeGrid: \uC774 \uB3C4\uBA54\uC778\uC758 30\uC77C \uCCB4\uD5D8\uC774 \uB05D\uB098 \uC720\uB8CC \uAE30\uB2A5\uC774 \uAEBC\uC84C\uC2B5\uB2C8\uB2E4. \uBB34\uB8CC \uAC1C\uC778 \uD0A4(${nt}) \uB610\uB294 \uD68C\uC0AC \uD0A4\uB97C \uBC1B\uC73C\uC138\uC694: ${Ue}`,format:"FreeGrid: the license key is not in the right format. / \uB77C\uC774\uC120\uC2A4 \uD0A4 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",signature:"FreeGrid: the license key could not be verified. / \uB77C\uC774\uC120\uC2A4 \uD0A4\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",expired:"FreeGrid: the license key has expired. / \uB77C\uC774\uC120\uC2A4 \uAE30\uAC04\uC774 \uB05D\uB0AC\uC2B5\uB2C8\uB2E4.",domain:"FreeGrid: the license key is for a different domain. / \uB2E4\uB978 \uB3C4\uBA54\uC778\uC6A9 \uB77C\uC774\uC120\uC2A4 \uD0A4\uC785\uB2C8\uB2E4.",version:`FreeGrid ${je}: this perpetual license covers an earlier major version. / \uC774 \uC601\uAD6C \uB77C\uC774\uC120\uC2A4\uB294 \uC774\uC804 \uBA54\uC774\uC800 \uBC84\uC804\uC6A9\uC785\uB2C8\uB2E4.`};function vi(o,e=typeof location!="undefined"?location.hostname:""){try{if(kt(e)||typeof navigator=="undefined")return;let t=new Date().toISOString().slice(0,10),n=`${e}|${t}|${o.licensed?1:0}`,r=typeof localStorage!="undefined"?localStorage:null;if((r==null?void 0:r.getItem("freegrid:usage"))===n)return;r==null||r.setItem("freegrid:usage",n);let i=JSON.stringify({version:o.version,licensed:o.licensed,company:o.company,url:`${location.origin}${location.pathname}`});typeof navigator.sendBeacon=="function"?navigator.sendBeacon(gi,i):typeof fetch=="function"&&fetch(gi,{method:"POST",body:i,mode:"no-cors",keepalive:!0}).catch(()=>{})}catch{}}function dl(o=Ct,e=typeof location!="undefined"?location.hostname:""){return kt(e)?Promise.resolve(!0):Ei(o!=null?o:Ct,e).then(t=>t==="ok"||t==="unsupported")}function Ei(o,e){let t=`${o!=null?o:""}@${e}`,n=wi.get(t);return n||(o?n=Mo(o,e).then(r=>{if(vi({version:je,licensed:r.ok,company:r.ok?r.info.company:void 0},e),r.ok)return"ok";if(r.reason==="unsupported")return"unsupported";let i=r.info?` (${r.info.domains.join(", ")}, ${r.info.major?`${r.info.major}.x`:r.info.expires})`:"";return console.warn(`${Mn[r.reason]}${i}
51
+ ${Ue}`),"bad"},()=>"bad"):(console.info(Mn.missing),vi({version:je,licensed:!1},e),n=Promise.resolve("none")),wi.set(t,n),n)}var Ro;var Rt=()=>Ro!=null?Ro:typeof location!="undefined"?location.hostname:"",xi=o=>{if(!o||typeof o!="object")return null;let{badge:e,trial:t}=o,n=!!t&&typeof t=="object"&&So(t.started)&&So(t.ends)&&typeof t.active=="boolean";return{badge:e===!0,trial:n?{started:t.started,ends:t.ends,active:t.active}:null}};function Ai(o=Rt()){var i;if(kt(o)||typeof fetch!="function")return Promise.resolve(null);let e=ko.get(o);if(e)return e;let t=new Date().toISOString().slice(0,10),n=null;try{n=typeof localStorage!="undefined"?localStorage:null;let s=JSON.parse((i=n==null?void 0:n.getItem("freegrid:status"))!=null?i:"null"),a=s&&s.host===o&&s.day===t?xi(s.status):null;if(a){let l=Promise.resolve(a);return ko.set(o,l),l}}catch{}let r=fetch(il,{mode:"cors",credentials:"omit"}).then(s=>s.ok?s.json():null).then(s=>{let a=xi(s);if(a)try{n==null||n.setItem("freegrid:status",JSON.stringify({host:o,day:t,status:a}))}catch{}return a}).catch(()=>null);return ko.set(o,r),r}function cl(o=Rt()){return Ai(o).then(e=>(e==null?void 0:e.badge)===!0)}async function Ti(o,e=Rt()){return await Promise.resolve(),await dl(o,e)?!1:cl(e)}var Li="freegrid:gate",ul=5,Pi=o=>{if(!o)return"";let e=o.trim().split(".");return e[e.length-1].slice(-16)},Fi=o=>{var t;let e=JSON.parse((t=localStorage.getItem(Li))!=null?t:"null");return!e||typeof e!="object"||e.host!==o||typeof e.trialEnded!="boolean"||!Array.isArray(e.verifiedKeys)||!e.verifiedKeys.every(n=>typeof n=="string")?null:{host:o,trialEnded:e.trialEnded,...typeof e.trialEnds=="string"?{trialEnds:e.trialEnds}:{},verifiedKeys:e.verifiedKeys}};function Ii(o,e=Rt()){if(kt(e))return!0;let t=o!=null?o:Ct;if(t&&!Si()){let n=Ri(t,e);if("info"in n&&!n.fail)return!0}try{let n=Fi(e);if(!n)return!0;let r=Pi(t);return r&&n.verifiedKeys.includes(r)?!0:!n.trialEnded}catch{return!0}}var Ci=(o,e)=>{try{let t=null;try{t=Fi(o)}catch{}localStorage.setItem(Li,JSON.stringify(e(t!=null?t:{host:o,trialEnded:!1,verifiedKeys:[]})))}catch{}};async function Di(o,e=Rt()){var s;if(kt(e))return!0;await Promise.resolve();let t=o!=null?o:Ct,n=await Ei(t,e);if(n==="ok"){let a=Pi(t);return Ci(e,l=>({...l,verifiedKeys:[a,...l.verifiedKeys.filter(c=>c!==a)].slice(0,ul)})),!0}if(n==="unsupported")return!0;let r=(s=await Ai(e))==null?void 0:s.trial;if(!r)return!0;Ci(e,a=>({...a,trialEnded:!r.active,trialEnds:r.ends}));let i=`${r.active?"trial":"ended"}@${e}`;return yi.has(i)||(yi.add(i),r.active?console.info(Mn.trial(r.ends)):console.warn(Mn.ended)),r.active}function $i(o){var t;if(bi.has(o))return;bi.add(o);let e=(t=mi[o])!=null?t:{en:o,ko:o};console.warn(`FreeGrid: ${e.en} is a paid feature and is off on this domain. Get a free personal key (${nt}) or a company key: ${Ue}
52
+ FreeGrid: ${e.ko}\uC740(\uB294) \uC720\uB8CC \uAE30\uB2A5\uC774\uB77C \uC774 \uB3C4\uBA54\uC778\uC5D0\uC11C \uAEBC\uC838 \uC788\uC2B5\uB2C8\uB2E4. \uBB34\uB8CC \uAC1C\uC778 \uD0A4(${nt}) \uB610\uB294 \uD68C\uC0AC \uD0A4\uB97C \uBC1B\uC73C\uC138\uC694: ${Ue}`)}var St={text:["contains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["eq","ne","lt","lte","gt","gte","between","blank","notBlank"],date:["equals","before","after","between","blank","notBlank"]},Ni=["blank","notBlank"],Eo=500,En=class{constructor(e){this.grid=e;this.popup=null;this.colId=null;this.off=[]}get openColumn(){return this.colId}toggle(e,t){this.colId===e?this.close():this.open(e,t)}open(e,t){var g;this.close();let n=this.grid.columns.getNode(e);if(!n||n.children||G(e))return;let r=this.grid.store.state.locale,i=n.def,s=C("div",`fg-menu fg-theme-${this.grid.store.state.theme}`,{role:"dialog","aria-label":r.columnMenu});this.grid.applyFontTo(s),De(i)&&s.append(this.section([[r.sortAsc,()=>this.grid.setSort([{colId:e,dir:"asc"}])],[r.sortDesc,()=>this.grid.setSort([{colId:e,dir:"desc"}])],[r.clearSort,()=>this.grid.setSort(this.grid.store.state.sort.filter(w=>w.colId!==e))]])),s.append(this.section([[r.pinLeft,()=>this.grid.setPinned(e,"left")],[r.pinRight,()=>this.grid.setPinned(e,"right")],[r.unpin,()=>this.grid.setPinned(e,null)]]));let a=this.grid.getGroupBy();if(!this.grid.options.treeData&&this.grid.paid&&(this.grid.options.groupPanel||a.length)){let w=a.includes(e)?[[r.ungroup,()=>this.grid.setGroupBy(a.filter(m=>m!==e))]]:[[r.groupByThis,()=>this.grid.setGroupBy([...a,e])]];a.length&&w.push([r.expandAll,()=>this.grid.expandAll(!0)],[r.collapseAll,()=>this.grid.expandAll(!1)]),s.append(this.section(w))}let l=[[r.autosizeThis,()=>this.grid.autoSize([e])],[r.autosizeAll,()=>this.grid.autoSize()]];i.lockVisible||l.push([r.hideColumn,()=>this.grid.setColumnsVisible([e],!1)]),l.push([r.chooseColumns,()=>this.grid.chooser.open()],[r.resetColumns,()=>this.grid.resetColumns()]),this.grid.options.conditionalFormatMenu!==!1&&this.grid.paid&&l.push([`${r.cf.title}\u2026`,()=>this.grid.formatDialog.open(e)]),s.append(this.section(l));let c=this.filterSection(e,()=>this.close());c&&s.append(c),re(this.grid.renderer.root).append(s);let d=t.getBoundingClientRect(),u=s.offsetWidth||248;s.style.left=`${Math.max(4,Math.min(d.right-u,window.innerWidth-u-4))}px`;let f=Math.max(4,Math.min(d.bottom+4,window.innerHeight-240));s.style.top=`${f}px`,s.style.maxHeight=`${Math.max(160,window.innerHeight-f-8)}px`,this.popup=s,this.colId=e;let p=w=>{ce(w,s,t)||this.close()},h=w=>{w.key==="Escape"&&(this.close(),this.grid.renderer.gridEl.focus())};document.addEventListener("pointerdown",p,!0),document.addEventListener("keydown",h,!0),this.off.push(()=>document.removeEventListener("pointerdown",p,!0),()=>document.removeEventListener("keydown",h,!0)),(g=s.querySelector(".fg-filter-value:not([hidden]), .fg-set-search, .fg-menu-item"))==null||g.focus()}filterSection(e,t){let n=this.grid.columns.getNode(e);if(!n||n.children)return null;let r=this.grid.store.state.locale,i=ue(n.def);return i==="set"?this.setFilter(e,r,t):i?this.conditionFilter(e,i,r,t):null}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null,this.colId=null}section(e){let t=C("div","fg-menu-section");for(let[n,r]of e){let i=C("button","fg-menu-item",{type:"button"});i.textContent=n,i.addEventListener("click",()=>{r(),this.close()}),t.append(i)}return t}actions(e,t,n,r){let i=C("div","fg-menu-actions"),s=C("button","fg-btn",{type:"button"});s.textContent=t.reset,s.addEventListener("click",()=>{this.grid.setFilter(e,null),r()});let a=C("button","fg-btn fg-btn-primary",{type:"button"});return a.textContent=t.apply,a.addEventListener("click",n),i.append(s,a),i}title(e){let t=C("div","fg-menu-title");return t.textContent=e.filter,t}conditionRow(e,t,n,r,i){var p;let s=C("div","fg-filter-cond"),a=C("select","fg-filter-op",{"aria-label":t.filter});if(r){let h=C("option");h.value="",h.textContent="\u2014",a.append(h)}for(let h of St[e]){let g=C("option");g.value=h,g.textContent=t.ops[h],a.append(g)}a.value=(p=n==null?void 0:n.op)!=null?p:r?"":St[e][0];let l=e==="text"?"text":e,c=C("input","fg-input fg-filter-value",{type:l,placeholder:t.value,"aria-label":t.value}),d=C("input","fg-input fg-filter-value-to",{type:l,placeholder:t.valueTo,"aria-label":t.valueTo});n&&(c.value=n.value!=null?String(n.value):"",d.value="valueTo"in n&&n.valueTo!=null?String(n.valueTo):"");let u=()=>{c.hidden=!a.value||Ni.includes(a.value),d.hidden=a.value!=="between"};a.addEventListener("change",u),u();for(let h of[c,d])h.addEventListener("keydown",g=>g.key==="Enter"&&i());return s.append(a,c,d),{row:s,read:()=>{let h=a.value;if(!h)return null;let g=!Ni.includes(h);if(e==="number"){let w=c.value===""?void 0:Number(c.value),m=d.value===""?void 0:Number(d.value);return!g||w!==void 0?{type:e,op:h,value:w,valueTo:m}:null}return e==="date"?!g||c.value?{type:e,op:h,value:c.value||void 0,valueTo:d.value||void 0}:null:!g||c.value?{type:e,op:h,value:c.value}:null}}}conditionFilter(e,t,n,r){var g,w;let i=this.grid.store.state.filters[e],s=(i==null?void 0:i.type)==="combined"?i.conditions:i?[i]:[],a=((g=s[0])==null?void 0:g.type)===t?s[0]:void 0,l=((w=s[1])==null?void 0:w.type)===t?s[1]:void 0,c=C("div","fg-menu-section fg-filter"),d=()=>{var S;let m=u.read(),y=f.read(),b=((S=p.querySelector("input:checked"))==null?void 0:S.value)==="or"?"or":"and",v=m&&y?{type:"combined",operator:b,conditions:[m,y]}:m!=null?m:y;this.grid.setFilter(e,v),r()},u=this.conditionRow(t,n,a,!1,d),f=this.conditionRow(t,n,l,!0,d),p=C("div","fg-filter-join",{role:"radiogroup"}),h=`fg-join-${e}-${Math.random().toString(36).slice(2,7)}`;for(let m of["and","or"]){let y=C("label"),b=C("input","",{type:"radio",name:h,value:m});b.checked=((i==null?void 0:i.type)==="combined"?i.operator:"and")===m,y.append(b,` ${n[m]}`),p.append(y)}return c.append(this.title(n),u.row,p,f.row,this.actions(e,n,d,r)),c}setFilter(e,t,n){let{grid:r}=this,i=r.columns.getNode(e).def,s=ee(i,t.code),a=r.collator(),l=new Map;for(let x of r.rowModel.allNodes()){let k=j(i,x.data),E=ne(k);l.has(E)||l.set(E,k)}let c=[...l.entries()].sort((x,k)=>bt(x[1],k[1],a)),d=r.store.state.filters[e],u=new Set((d==null?void 0:d.type)==="set"?d.values.map(ne).filter(x=>l.has(x)):l.keys()),f=(x,k)=>x===""?t.blanks:s(k),p=C("div","fg-menu-section fg-filter fg-set-filter"),h=C("input","fg-input fg-set-search",{type:"search",placeholder:t.search,"aria-label":t.search}),g=C("label","fg-set-item fg-set-all"),w=C("input","fg-checkbox",{type:"checkbox"});g.append(w,document.createTextNode(t.selectAll));let m=C("div","fg-set-list"),y=()=>{let x=h.value.trim().toLowerCase();return x?c.filter(([k,E])=>f(k,E).toLowerCase().includes(x)):c},b=()=>{let x=y(),k=x.filter(([E])=>u.has(E)).length;w.checked=k>0&&k===x.length,w.indeterminate=k>0&&k<x.length},v=()=>{let x=y();if(m.replaceChildren(...x.slice(0,Eo).map(([k,E])=>{let L=C("label","fg-set-item"),R=C("input","fg-checkbox",{type:"checkbox"});return R.checked=u.has(k),R.addEventListener("change",()=>{R.checked?u.add(k):u.delete(k),b()}),L.append(R,document.createTextNode(f(k,E))),L})),x.length>Eo){let k=C("div","fg-set-more");k.textContent=`\u2026 +${x.length-Eo}`,m.append(k)}b()};w.addEventListener("change",()=>{for(let[x]of y())w.checked?u.add(x):u.delete(x);v()}),h.addEventListener("input",v);let S=()=>{r.setFilter(e,u.size===l.size?null:{type:"set",values:c.filter(([x])=>u.has(x)).map(([,x])=>x)}),n()};return h.addEventListener("keydown",x=>x.key==="Enter"&&S()),v(),p.append(this.title(t),h,g,m,this.actions(e,t,S,n)),p}};var Oi=new WeakMap,fl=0;function Ke(o){let e=Oi.get(o);return e||Oi.set(o,e=`r${++fl}`),e}var An=class{constructor(e){this.deps=e;this.stats={filterRuns:0,sortRuns:0};this.server=!1;this.full=[];this.last={};this.nodes=[];this.filtered=[];this.sorted=[];this.display=[];this.indexById=null;this.layoutCache=null;this.quickCache=null}update(e){var u,f,p,h;let t=this.deps.collator(),n=e.display,r=!!(n!=null&&n.getParentId)!=!!((u=this.last.display)!=null&&u.getParentId),i=e.data!==this.last.data,s=i||r||e.filters!==this.last.filters||e.quickFilter!==this.last.quickFilter||e.advancedFilter!==this.last.advancedFilter,a=s||e.sort!==this.last.sort||t!==this.last.collator,l=a||(n==null?void 0:n.version)!==this.last.displayVersion||(n==null?void 0:n.groupBy)!==((f=this.last.display)==null?void 0:f.groupBy);if(i){let g=this.deps.getRowId;this.nodes=e.data.map((w,m)=>({id:g?String(g(w)):Ke(w),data:w,sourceIndex:m}))}s&&(this.filtered=this.filter(e),this.stats.filterRuns++),a&&(this.sorted=Zr(this.filtered,e.sort,g=>this.deps.columnDef(g),t),this.stats.sortRuns++),l&&(this.full=n?this.buildDisplay(n,e.sort,t):this.sorted);let c=(p=e.page)!=null?p:null,d=(h=this.last.page)!=null?h:null;(l||(c==null?void 0:c.index)!==(d==null?void 0:d.index)||(c==null?void 0:c.size)!==(d==null?void 0:d.size))&&(this.display=c?this.full.slice(c.index*c.size,(c.index+1)*c.size):this.full,this.indexById=null,this.layoutCache=null),this.last={...e,collator:t,displayVersion:n==null?void 0:n.version}}invalidate(){this.last={}}fullCount(){return this.full.length}dataCount(){return this.sorted.length}loading(){return!1}getRowCount(){return this.display.length}getRow(e){return this.display[e]}rows(){return this.display}dataRows(){return this.sorted}allNodes(){return this.nodes}idOf(e){return this.deps.getRowId?String(this.deps.getRowId(e)):Ke(e)}indexOfId(e){var t;return this.indexById||(this.indexById=new Map(this.display.map((n,r)=>[n.id,r]))),(t=this.indexById.get(e))!=null?t:-1}layout(e,t,n,r=0,i){var u;let s=this.layoutCache;if(s&&s.rows===this.display&&s.rh===e&&s.dh===t&&s.hv===r)return s;let a=this.display.length,l=new Float64Array(a+1),c=!0,d=n&&n.size?n:null;for(let f=0;f<a;f++){let p=this.display[f],h=e;if(p.kind==="detail")h=t;else if(!p.kind){d&&(h=(u=d.get(p.id))!=null?u:e);let g=i==null?void 0:i(p.data);typeof g=="number"&&g>0&&(h=d?Math.max(h,g):g)}h!==e&&(c=!1),l[f+1]=l[f]+h}return this.layoutCache={rows:this.display,rh:e,dh:t,hv:r,offsets:l,uniform:c},this.layoutCache}quickTexts(e){var r,i,s;let t=[this.nodes,(s=(i=(r=this.deps).textVersion)==null?void 0:i.call(r))!=null?s:"",...e],n=this.quickCache;return n&&n.key.length===t.length&&n.key.every((a,l)=>a===t[l])?n.texts:(this.quickCache={key:t,texts:new WeakMap},this.quickCache.texts)}filter(e){var u;let t=Object.entries(e.filters).map(([f,p])=>({def:this.deps.columnDef(f),pred:At(p)})).filter(f=>!!f.def),n=rr(e.quickFilter),r=n.length?this.deps.quickColumns():[],i=e.advancedFilter?Bn(e.advancedFilter,f=>this.deps.columnDef(f),j):null;if(!t.length&&!n.length&&!i)return this.nodes;let s=n.length?this.quickTexts(r):null,a=this.nodes.filter(f=>{for(let p of t)if(!p.pred(j(p.def,f.data)))return!1;if(i&&!i(f.data))return!1;if(s){let p=s.get(f.data);if(p===void 0&&(p=r.map(h=>this.deps.format(h,j(h,f.data))).join("").toLowerCase(),s.set(f.data,p)),!ir(n,p))return!1}return!0}),l=(u=e.display)==null?void 0:u.getParentId;if(!l)return a;let c=new Map(this.nodes.map(f=>[f.id,f])),d=new Set(a);for(let f of a){let p=l(f.data),h=new Set;for(;p!=null&&!h.has(p);){h.add(p);let g=c.get(String(p));if(!g)break;d.add(g),p=l(g.data)}}return this.nodes.filter(f=>d.has(f))}isOpen(e,t,n){let r=e.expanded.get(t);return r!==void 0?r:e.defaultExpanded===-1||n<e.defaultExpanded}withDetails(e,t,n){for(let r of t)n.push(r),e.detailOpen.has(r.id)&&(!e.isMaster||e.isMaster(r.data))&&n.push({id:`detail:${r.id}`,data:{},sourceIndex:-1,kind:"detail",detailOf:r})}buildDisplay(e,t,n){let r=[];if(e.getParentId)return this.buildTree(e,r),r;let i=e.groupBy.filter(a=>this.deps.columnDef(a));if(!i.length)return e.detailOpen.size?(this.withDetails(e,this.sorted,r),r):this.sorted;let s=(a,l,c)=>{var g;let d=i[l],u=this.deps.columnDef(d),f=new Map;for(let w of a){let m=j(u,w.data),y=K(m)?"":ne(m),b=f.get(y);b||f.set(y,b={value:m,nodes:[]}),b.nodes.push(w)}let p=((g=t.find(w=>w.colId===d))==null?void 0:g.dir)==="desc"?-1:1,h=[...f.entries()].sort((w,m)=>pn(w[1].value,m[1].value,n,p));for(let[w,m]of h){let y=`${c}${d}:${w}`,b=this.isOpen(e,y,l);r.push({id:`group:${y}`,data:{},sourceIndex:-1,kind:"group",level:l,group:{key:y,colId:d,value:m.value,rows:m.nodes.map(v=>v.data),expanded:b}}),b&&(l+1<i.length?s(m.nodes,l+1,`${y}|`):this.withDetails(e,m.nodes.map(v=>({...v,level:l+1})),r))}};return s(this.sorted,0,""),r}buildTree(e,t){let n=new Set(this.sorted.map(c=>c.id)),r=new Map,i=[];for(let c of this.sorted){let d=e.getParentId(c.data),u=d==null?null:String(d);if(u!==null&&n.has(u)&&u!==c.id){let f=r.get(u);f||r.set(u,f=[]),f.push(c)}else i.push(c)}let s=new Set,a=c=>{var u;let d=[c];for(;d.length;){let f=d.pop();if(!s.has(f.id)){s.add(f.id);for(let p of(u=r.get(f.id))!=null?u:[])d.push(p)}}};for(let c of i)a(c);for(let c of this.sorted){if(s.has(c.id))continue;let d=r.get(String(e.getParentId(c.data))),u=d?d.indexOf(c):-1;u>=0&&d.splice(u,1),i.push(c),a(c)}let l=(c,d,u)=>{var f,p,h;for(let g of c){if(u.has(g.id))continue;let w=(f=r.get(g.id))!=null?f:[],m=!w.length&&!!((p=e.lazyChildren)!=null&&p.call(e,g.id,g.data)),y=w.length>0&&this.isOpen(e,g.id,d),b={...g,level:d,hasChildren:w.length>0||m,expanded:y};m&&((h=e.loading)!=null&&h.has(g.id))&&(b.loading=!0),this.withDetails(e,[b],t),y&&l(w,d+1,new Set([...u,g.id]))}};l(i,0,new Set)}};var pl=1e4,Ao=1e5,hl=4,To=3e3,Tn=class{constructor(e,t,n,r,i,s){this.datasource=e;this.getRowId=t;this.groupBy=n;this.query=r;this.onChange=i;this.onFailed=s;this.levels=new Map;this.gen=0;this.display=null;this.ids=null;this.queue=[];this.inFlight=0;this.retryAt=0;this.version=0;this.builtFor=-1}matches(e,t){return e.join("")===this.groupBy.join("")&&t.sort===this.query.sort&&t.filters===this.query.filters&&t.quickFilter===this.query.quickFilter&&t.advancedFilter===this.query.advancedFilter}purge(){this.gen++,this.queue=[],this.levels.clear(),this.touch()}dispose(){this.gen++,this.queue=[]}touch(){this.version++,this.display=null,this.ids=null}load(e,t,n){this.levels.has(e)||(this.levels.set(e,{state:"loading",nodes:[]}),this.fetch({path:e,keys:t,level:n,start:0,gen:this.gen}))}fetch(e){this.queue.push(e),this.pump()}pump(){for(;this.inFlight<hl&&this.queue.length;){let e=this.queue.shift();e.gen===this.gen&&(this.inFlight++,this.request(e).finally(()=>{this.inFlight--,this.pump()}))}}request({path:e,keys:t,level:n,start:r,gen:i}){let s=n>=this.groupBy.length,a=this.query,l=r+pl,c;try{c=Promise.resolve(this.datasource.getRows({start:r,end:l,sort:[...a.sort],filters:{...a.filters},quickFilter:a.quickFilter,advancedFilter:a.advancedFilter,groupBy:[...this.groupBy],groupKeys:[...t]}))}catch(d){c=Promise.reject(d)}return c.then(d=>{var w,m;if(i!==this.gen)return;let u=Array.isArray(d==null?void 0:d.rows)?d.rows.filter(y=>y!==null&&typeof y=="object"):[];Array.isArray(d==null?void 0:d.rows)||V("datasource.getRows must resolve to { rows: Row[] }");let f=s?u.map((y,b)=>({id:this.getRowId?String(this.getRowId(y)):Ke(y),data:y,sourceIndex:r+b,level:n})):u.map(y=>{let b=this.groupBy[n],v=y[b],S=`${e?`${e}|`:""}${b}:${ne(v)}`,x=typeof y.count=="number"?y.count:typeof y.childCount=="number"?y.childCount:void 0;return{id:`group:${S}`,data:{},sourceIndex:-1,kind:"group",level:n,group:{key:S,colId:b,value:v,rows:[],expanded:!1,count:x,aggregates:y,keys:[...t,v]}}}),p=r?[...(m=(w=this.levels.get(e))==null?void 0:w.nodes)!=null?m:[],...f]:f,h=typeof(d==null?void 0:d.total)=="number"&&d.total>=0?d.total:null,g=u.length>0&&(h!==null?p.length<h:u.length>=l-r);g&&p.length<Ao?(this.levels.set(e,{state:"loading",nodes:p}),this.fetch({path:e,keys:t,level:n,start:p.length,gen:i})):(g&&V(`a server group level has more than ${Ao} rows; only the first ${Ao} are shown`),this.levels.set(e,{state:"loaded",nodes:p})),this.touch(),this.onChange()},d=>{i===this.gen&&(this.levels.set(e,{state:"failed",nodes:[],retryAt:Date.now()+To}),this.touch(),this.onFailed(r,l,d))})}isOpen(e,t,n){let r=e.expanded.get(t);return r!==void 0?r:e.defaultExpanded===-1||n<e.defaultExpanded}rows(e,t){let n=Date.now();if(this.display&&this.builtFor===t&&!(this.retryAt&&n>=this.retryAt))return this.display;let r=[],i=0,s=(a,l,c)=>{var u,f,p;let d=this.levels.get(a);if((d==null?void 0:d.state)==="failed"&&n>=((u=d.retryAt)!=null?u:0)&&(this.levels.delete(a),d=void 0),!d){this.load(a,l,c),r.push({id:`loading:${a}`,data:{},sourceIndex:-1,kind:"loading",level:c});return}if(d.state==="failed"){let h=(f=d.retryAt)!=null?f:0;i=i?Math.min(i,h):h;return}for(let h of d.nodes){if(h.kind!=="group"){r.push(h);continue}let g=h.group,w=this.isOpen(e,g.key,c),m={...h,group:{...g,expanded:w}};r.push(m),w&&s(g.key,(p=g.keys)!=null?p:[],c+1)}d.state==="loading"&&r.push({id:`loading:${a}`,data:{},sourceIndex:-1,kind:"loading",level:c})};return s("",[],0),this.retryAt=i,this.display=r,this.builtFor=t,this.ids=null,r}dataRows(){let e=[];for(let t of this.levels.values())for(let n of t.nodes)n.kind||e.push(n);return e}dataCount(){let e=this.levels.get("");return(e==null?void 0:e.state)==="loaded"&&e.nodes.every(t=>{var n;return typeof((n=t.group)==null?void 0:n.count)=="number"})?e.nodes.reduce((t,n)=>{var r,i;return t+((i=(r=n.group)==null?void 0:r.count)!=null?i:0)},0):this.dataRows().length}loading(){for(let e of this.levels.values())if(e.state==="loading")return!0;return!1}indexOf(e){var t;return this.display?(this.ids||(this.ids=new Map,this.display.forEach((n,r)=>this.ids.set(n.id,r))),(t=this.ids.get(e))!=null?t:-1):-1}};var ml=new Float64Array(0),Mt=class{constructor(e){this.deps=e;this.stats={filterRuns:0,sortRuns:0};this.server=!0;this.blocks=new Map;this.total=null;this.loadedEnd=0;this.gen=0;this.query=null;this.page=null;this.lastBlock=0;this.version=0;this.cache=null;this.groups=null;this.displayIn=null}get bs(){return this.page?this.page.size:this.deps.blockSize}get base(){return this.page?this.page.index*this.page.size:0}update(e){var a,l,c,d,u,f,p,h,g,w,m,y;let t=(l=(a=e.display)==null?void 0:a.groupBy)!=null?l:[];if(t.length&&!((c=e.display)!=null&&c.getParentId)){let b={sort:e.sort,filters:e.filters,quickFilter:e.quickFilter,advancedFilter:(d=e.advancedFilter)!=null?d:null};(!this.groups||!this.groups.matches(t,b))&&((u=this.groups)==null||u.dispose(),this.groups=new Tn(this.deps.datasource,this.deps.getRowId,[...t],b,()=>this.deps.onLoaded(0,0,null),(v,S,x)=>this.deps.onFailed(v,S,x)),this.touch()),this.displayIn=(f=e.display)!=null?f:null,this.query=null;return}this.groups&&(this.groups.dispose(),this.groups=null,this.query=null,this.touch());let n=this.query,r=!n||n.sort!==e.sort||n.filters!==e.filters||n.quickFilter!==e.quickFilter||n.advancedFilter!==((p=e.advancedFilter)!=null?p:null),i=(h=e.page)!=null?h:null,s=((g=i==null?void 0:i.size)!=null?g:0)!==((m=(w=this.page)==null?void 0:w.size)!=null?m:0);this.query={sort:e.sort,filters:e.filters,quickFilter:e.quickFilter,advancedFilter:(y=e.advancedFilter)!=null?y:null},this.page=i?{...i}:null,(r||s)&&this.purge(),this.ensure(Math.floor(this.base/this.bs))}invalidate(){}purge(){if(this.groups){this.groups.purge();return}this.gen++,this.blocks.clear(),this.total=null,this.loadedEnd=0,this.touch(),this.query&&this.ensure(Math.floor(this.base/this.bs))}touch(){this.version++,this.cache=null}fullCount(){if(this.total!==null)return this.total;if(!this.loadedEnd)return 0;let e=this.blocks.get(Math.floor((this.loadedEnd-1)/this.bs));return this.loadedEnd+(e&&e.nodes.length<this.bs?0:this.bs)}getRowCount(){if(this.groups)return this.groupRows().length;let e=this.fullCount();return this.page?Math.max(0,Math.min(this.page.size,e-this.base)):e}dataCount(){return this.groups?this.groups.dataCount():this.fullCount()}loading(){if(this.groups)return this.groups.loading();for(let e of this.blocks.values())if(e.state==="loading")return!0;return!1}placeholder(e){return{id:`loading:${e}`,data:{},sourceIndex:-1,kind:"loading"}}peek(e){var r;let t=Math.floor(e/this.bs),n=this.blocks.get(t);return(n==null?void 0:n.state)==="loaded"&&(r=n.nodes[e-t*this.bs])!=null?r:null}groupRows(){return this.groups.rows(this.displayIn,this.displayIn.version*1e6+this.groups.version)}getRow(e){if(this.groups)return this.groupRows()[e];let t=this.base+e,n=this.peek(t);return n||(e>=0&&e<this.getRowCount()&&this.ensure(Math.floor(t/this.bs)),this.placeholder(t))}ensure(e){var c;let t=this.blocks.get(e);if(t&&(t.state!=="failed"||Date.now()<((c=t.retryAt)!=null?c:0))||this.total!==null&&e*this.bs>=this.total&&e>0)return;let n=e*this.bs,r=n+this.bs,i=this.gen;this.lastBlock=e,this.blocks.set(e,{state:"loading",nodes:[]});let s=this.query,a=d=>{i===this.gen&&(this.blocks.set(e,{state:"failed",nodes:[],retryAt:Date.now()+To}),this.deps.onFailed(n,r,d))},l;try{l=Promise.resolve(this.deps.datasource.getRows({start:n,end:r,sort:[...s.sort],filters:{...s.filters},quickFilter:s.quickFilter,advancedFilter:s.advancedFilter}))}catch(d){l=Promise.reject(d)}l.then(d=>{if(i!==this.gen)return;let u=Array.isArray(d==null?void 0:d.rows)?d.rows.filter(h=>h!==null&&typeof h=="object"):null;if(!u){V("datasource.getRows must resolve to { rows: Row[], total?: number }"),a(new Error("invalid datasource response"));return}let f=this.deps.getRowId,p=u.slice(0,this.bs).map((h,g)=>({id:f?String(f(h)):Ke(h),data:h,sourceIndex:n+g}));this.blocks.set(e,{state:"loaded",nodes:p}),typeof d.total=="number"&&d.total>=0?this.total=d.total:p.length<this.bs&&(this.total=n+p.length),this.loadedEnd=Math.max(this.loadedEnd,n+p.length),this.evict(),this.touch(),this.deps.onLoaded(n,n+p.length,this.total)},a)}evict(){let e=Math.max(2,this.deps.maxBlocks);if(this.blocks.size<=e)return;let t=[...this.blocks.keys()].sort((n,r)=>Math.abs(r-this.lastBlock)-Math.abs(n-this.lastBlock));for(let n of t){if(this.blocks.size<=e)break;this.blocks.get(n).state!=="loading"&&this.blocks.delete(n)}}built(){var n;if(((n=this.cache)==null?void 0:n.ver)===this.version)return this.cache;let e=[];for(let r of[...this.blocks.keys()].sort((i,s)=>i-s)){let i=this.blocks.get(r);i.state==="loaded"&&e.push(...i.nodes)}let t=new Map;for(let r of e)t.set(r.id,r.sourceIndex);return this.cache={ver:this.version,data:e,rows:null,ids:t},this.cache}rows(){var t;if(this.groups)return this.groupRows();let e=this.built();if(!e.rows){let n=this.getRowCount();e.rows=new Array(n);for(let r=0;r<n;r++)e.rows[r]=(t=this.peek(this.base+r))!=null?t:this.placeholder(this.base+r)}return e.rows}dataRows(){return this.groups?this.groups.dataRows():this.built().data}allNodes(){return this.groups?this.groups.dataRows():this.built().data}idOf(e){return this.deps.getRowId?String(this.deps.getRowId(e)):Ke(e)}indexOfId(e){if(this.groups)return this.groupRows(),this.groups.indexOf(e);let t=this.built().ids.get(e);if(t===void 0)return-1;let n=t-this.base;return n>=0&&n<this.getRowCount()?n:-1}layout(){return{offsets:ml,uniform:!0}}};function Bi(o){let e=o.idAt(o.index);if(o.mode==="single"){let t=new Set;return o.toggle&&o.selected.has(e)||t.add(e),{selected:t,anchorIndex:o.index}}if(o.range&&o.anchorIndex!=null){let t=o.toggle?new Set(o.selected):new Set,n=Math.min(o.anchorIndex,o.index),r=Math.max(o.anchorIndex,o.index);for(let i=n;i<=r;i++)t.add(o.idAt(i));return{selected:t,anchorIndex:o.anchorIndex}}if(o.toggle){let t=new Set(o.selected);return t.has(e)?t.delete(e):t.add(e),{selected:t,anchorIndex:o.index}}return{selected:new Set([e]),anchorIndex:o.index}}var Ln=class{constructor(e){this.bus=new Ye;this.current=e}get state(){return this.current}set(e){let t=Object.keys(e).filter(n=>e[n]!==this.current[n]);t.length&&(this.current={...this.current,...e},this.bus.emit("change",t))}};var Lo=o=>!!o&&typeof o=="object"&&!Array.isArray(o)&&Object.getPrototypeOf(o)===Object.prototype;function xe(o,e=0,t=new Map){if(e>8||!(Array.isArray(o)||Lo(o)))return o;let n=t.get(o);if(n)return n;if(Array.isArray(o)){let i=[];t.set(o,i);for(let s of o)i.push(xe(s,e+1,t));return i}let r={};t.set(o,r);for(let[i,s]of Object.entries(o))r[i]=xe(s,e+1,t);return r}function ot(o,e,t=0,n=new Map){if(o===e)return!0;if(t>8||!o||!e||typeof o!="object"||typeof e!="object")return!1;let r=n.get(o);if(r!=null&&r.has(e))return!0;if(r?r.add(e):n.set(o,new Set([e])),Array.isArray(o)||Array.isArray(e))return Array.isArray(o)&&Array.isArray(e)&&o.length===e.length&&o.every((s,a)=>ot(s,e[a],t+1,n));if(!Lo(o)||!Lo(e))return!1;let i=Object.keys(o);return i.length===Object.keys(e).length&&i.every(s=>s in e&&ot(o[s],e[s],t+1,n))}function Hi(o){let e=xe(o);return t=>ot(t,e)?!1:(e=xe(t),!0)}var gl=500;function Gi(o){let e=o.renderer.root,t=0,n=null,r=null,i=()=>{clearTimeout(t),n==null||n.remove(),n=null,r=null},s=d=>{var b;let u=d.dataset.col;if(!u||G(u))return null;let f=o.columns.getNode(u);if(!f)return null;if(d.classList.contains("fg-header-cell"))return(b=f.def.headerTooltip)!=null?b:null;let p=d.closest(".fg-row[data-row]");if(!p||!d.closest(".fg-body"))return null;let h=Number(p.dataset.row),g=o.rowModel.getRow(h);if(!g||g.kind)return null;let w=f.def,m=j(w,g.data),y=ee(w,o.store.state.locale.code)(m);if(typeof w.tooltip=="function")try{let v=w.tooltip({value:m,formatted:y,row:g.data,rowIndex:h,column:w});return v?String(v):null}catch{return V(`tooltip of column "${u}" threw`),null}return w.tooltip===!0?y||null:o.options.overflowTooltip!==!1&&w.tooltip!==!1&&d.scrollWidth>d.clientWidth+1&&d.textContent||null},a=(d,u)=>{n==null||n.remove(),n=C("div",`fg-tooltip fg-theme-${o.store.state.theme}`,{role:"tooltip"}),n.textContent=u,o.applyFontTo(n),re(e).append(n);let f=d.getBoundingClientRect(),p=n.offsetWidth,h=n.offsetHeight,g=window.innerWidth||1024,w=window.innerHeight||768,m=f.bottom+6+h>w?f.top-h-6:f.bottom+6;n.style.left=`${Math.max(4,Math.min(g-p-4,f.left))}px`,n.style.top=`${Math.max(4,m)}px`},l=d=>{var f,p;let u=(p=(f=d.target).closest)==null?void 0:p.call(f,".fg-cell, .fg-header-cell");!u||u===r||!e.contains(u)||(i(),r=u,t=window.setTimeout(()=>{if(r!==u||!u.isConnected)return;let h=s(u);h&&a(u,h)},gl))},c=d=>{let u=d.relatedTarget;r&&u&&r.contains(u)||i()};return e.addEventListener("pointerover",l),e.addEventListener("pointerout",c),e.addEventListener("pointerdown",i),e.addEventListener("keydown",i),e.addEventListener("wheel",i,{passive:!0}),()=>{i(),e.removeEventListener("pointerover",l),e.removeEventListener("pointerout",c),e.removeEventListener("pointerdown",i),e.removeEventListener("keydown",i),e.removeEventListener("wheel",i)}}var zi=["blank","notBlank"],Pn=class{constructor(e){this.grid=e;this.popup=null;this.off=[]}get isOpen(){return!!this.popup}columns(){return this.grid.columns.getState().map(e=>this.grid.columns.getNode(e.colId)).filter(e=>e&&!e.children&&!G(e.id)&&ue(e.def)).map(e=>{var r,i;let t=ue(e.def),n=t==="number"?"number":t==="date"?"date":"text";return{id:e.id,label:(i=(r=e.def.header)!=null?r:e.def.field)!=null?i:e.id,kind:n}})}open(){var R,M;this.close();let{grid:e}=this,t=e.store.state.locale,n=this.columns(),r=C("div",`fg-menu fg-filter-builder fg-theme-${e.store.state.theme}`,{role:"dialog","aria-label":t.advancedFilter});e.applyFontTo(r);let i=C("div","fg-chooser-head"),s=C("span","fg-menu-title");s.textContent=t.advancedFilter;let a=C("button","fg-chooser-close",{type:"button","aria-label":t.close});a.textContent="\xD7",a.addEventListener("click",()=>this.close()),i.append(s,a);let l=e.store.state.advancedFilter,c=C("div","fg-filter-join",{role:"radiogroup"}),d=`fg-fb-join-${Math.random().toString(36).slice(2,7)}`;for(let T of["and","or"]){let A=C("label"),F=C("input","",{type:"radio",name:d,value:T});F.checked=((R=l==null?void 0:l.operator)!=null?R:"and")===T,A.append(F,` ${t[T]}`),c.append(A)}let u=C("div","fg-fb-list"),f=[],p=T=>{f.splice(f.indexOf(T),1),T.el.remove()},h=T=>{let A=C("div","fg-fb-row"),F=C("select","fg-filter-op fg-fb-col",{"aria-label":t.columns});for(let X of n){let I=C("option");I.value=X.id,I.textContent=X.label,F.append(I)}let $=C("select","fg-filter-op fg-fb-op",{"aria-label":t.filter}),D=C("input","fg-input fg-fb-value",{type:"text",placeholder:t.value,"aria-label":t.value}),O=C("input","fg-input fg-fb-value-to",{type:"text",placeholder:t.valueTo,"aria-label":t.valueTo}),P=C("button","fg-chooser-close fg-fb-remove",{type:"button","aria-label":t.close});P.textContent="\xD7";let N=()=>{var X,I;return(I=(X=n.find(H=>H.id===F.value))==null?void 0:X.kind)!=null?I:"text"},B=X=>{let I=N();$.replaceChildren(...St[I].map(J=>{let Y=C("option");return Y.value=J,Y.textContent=t.ops[J],Y})),X&&St[I].includes(X)&&($.value=X);let H=I==="text"?"text":I;D.type=O.type=H,z()},z=()=>{D.hidden=zi.includes($.value),O.hidden=$.value!=="between"};F.addEventListener("change",()=>B($.value)),$.addEventListener("change",z),T&&n.some(X=>X.id===T.colId)&&(F.value=T.colId);let W=T==null?void 0:T.model;B(W==null?void 0:W.op),(W==null?void 0:W.value)!=null&&(D.value=String(W.value)),(W==null?void 0:W.valueTo)!=null&&(O.value=String(W.valueTo)),A.append(F,$,D,O,P);let U={el:A,read:()=>{let X=N(),I=$.value,H=!zi.includes(I),J=null;if(X==="number"){let Y=D.value===""?void 0:Number(D.value),pe=O.value===""?void 0:Number(O.value);(!H||Y!==void 0&&!Number.isNaN(Y))&&(J=I==="between"?{type:"number",op:I,value:Y,valueTo:pe}:{type:"number",op:I,value:Y})}else X==="date"?(!H||D.value)&&(J=I==="between"?{type:"date",op:I,value:D.value,valueTo:O.value}:{type:"date",op:I,value:D.value||void 0}):(!H||D.value)&&(J={type:"text",op:I,value:D.value});return J?{colId:F.value,model:J}:null}};return P.addEventListener("click",()=>p(U)),U},g=(T,A)=>{let F=C("div","fg-fb-row fg-fb-group"),$=C("span","fg-fb-group-label");$.textContent=A;let D=C("button","fg-chooser-close fg-fb-remove",{type:"button","aria-label":t.close});D.textContent="\xD7",F.append($,D);let O={el:F,read:()=>T};return D.addEventListener("click",()=>p(O)),O},w=T=>{var D;if("conditions"in T)return g(T,`( ${T.conditions.length} \xD7 ${t[T.operator]} )`);let A=n.find(O=>O.id===T.colId),F=T.model;if(A&&F&&(F.type==="text"||F.type==="number"||F.type==="date"))return h(T);let $=(F==null?void 0:F.type)==="set"?F.values.map(String).join(", "):(F==null?void 0:F.type)==="combined"?`( ${F.conditions.length} \xD7 ${t[F.operator]} )`:"";return g(T,`${(D=A==null?void 0:A.label)!=null?D:T.colId}: ${$}`)},m=T=>{f.push(T),u.append(T.el)};for(let T of(M=l==null?void 0:l.conditions)!=null?M:[])m(w(T));let y=C("button","fg-btn fg-fb-add",{type:"button"});y.textContent=`+ ${t.addCondition}`,y.addEventListener("click",()=>{let T=h();m(T),T.el.querySelector(".fg-fb-value").focus()});let b=C("div","fg-menu-actions"),v=C("button","fg-btn",{type:"button"});v.textContent=t.reset,v.addEventListener("click",()=>{e.setAdvancedFilter(null),this.close()});let S=C("button","fg-btn fg-btn-primary",{type:"button"});S.textContent=t.apply,S.addEventListener("click",()=>{var F;let T=f.map($=>$.read()).filter($=>!!$),A=((F=c.querySelector("input:checked"))==null?void 0:F.value)==="or"?"or":"and";e.setAdvancedFilter(T.length?{operator:A,conditions:T}:null),this.close()}),b.append(v,S),r.append(i,c,u,y,b),re(e.renderer.root).append(r);let x=e.renderer.root.getBoundingClientRect(),k=r.offsetWidth||460;r.style.left=`${Math.max(4,Math.min(x.left+24,(window.innerWidth||1024)-k-4))}px`,r.style.top=`${Math.max(4,x.top+24)}px`,this.popup=r,f.length||y.click();let E=T=>{ce(T,r)||this.close()},L=T=>{T.key==="Escape"&&this.close()};document.addEventListener("pointerdown",E,!0),document.addEventListener("keydown",L,!0),this.off.push(()=>document.removeEventListener("pointerdown",E,!0),()=>document.removeEventListener("keydown",L,!0))}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var Vi=[{key:"red",style:{background:"#ffc7ce",color:"#9c0006"}},{key:"yellow",style:{background:"#ffeb9c",color:"#9c5700"}},{key:"green",style:{background:"#c6efce",color:"#006100"}},{key:"blue",style:{background:"#dbeafe",color:"#1e3a8a"}},{key:"redText",style:{color:"#dc2626"}},{key:"bold",style:{bold:!0}}],wl=["value","formula","top","bottom","aboveAverage","belowAverage","duplicate","unique","dataBar","colorScale","iconSet"],yl=["gt","gte","lt","lte","eq","ne","between","notBetween","contains","notContains","startsWith","endsWith","blank","notBlank"],Po=["blank","notBlank"],qi=["dataBar","colorScale","iconSet"],Fn=class{constructor(e){this.grid=e;this.popup=null;this.off=[]}get isOpen(){return!!this.popup}open(e){var W,U,X;this.close();let{grid:t}=this,n=t.columns.getNode(e);if(!n||n.children||G(e))return;let r=t.store.state.locale,i=r.cf,s=(U=(W=n.def.header)!=null?W:n.def.field)!=null?U:e,a=C("div",`fg-menu fg-cf-dialog fg-theme-${t.store.state.theme}`,{role:"dialog","aria-label":`${i.title}: ${s}`});t.applyFontTo(a);let l=C("div","fg-chooser-head"),c=C("span","fg-menu-title");c.textContent=`${i.title} \xB7 ${s}`;let d=C("button","fg-chooser-close",{type:"button","aria-label":r.close});d.textContent="\xD7",d.addEventListener("click",()=>this.close()),l.append(c,d);let u=C("div","fg-cf-list"),f=I=>{var H,J;return(J=(H=i.ops[I])!=null?H:r.ops[I])!=null?J:I},p=I=>{var Y,pe,ke,Z,se,rt;let H=(Y=I.type)!=null?Y:"value",J=i.types[H];if(H==="value"){let ae=(pe=I.op)!=null?pe:"eq";return Po.includes(ae)?f(ae):`${f(ae)} ${String((ke=I.value)!=null?ke:"")}${ae==="between"||ae==="notBetween"?` \u2013 ${String((Z=I.valueTo)!=null?Z:"")}`:""}`}return H==="formula"?`${J}: ${(se=I.formula)!=null?se:""}`:H==="top"||H==="bottom"?`${J} ${(rt=I.rank)!=null?rt:10}${I.percent?"%":""}`:J},h=()=>{var J,Y,pe,ke;u.replaceChildren();let H=t.getConditionalFormats().map((Z,se)=>({r:Z,i:se})).filter(({r:Z})=>Z.columns.includes(e));if(!H.length){let Z=C("div","fg-cf-empty");Z.textContent=i.none,u.append(Z);return}for(let{r:Z,i:se}of H){let rt=C("div","fg-cf-rule"),ae=C("span","fg-cf-sample",{"aria-hidden":"true"});ae.textContent=Z.type==="iconSet"?"\u25B2":Z.type==="dataBar"?"\u25AC":"Aa",(J=Z.style)!=null&&J.background&&(ae.style.background=Z.style.background),(Y=Z.style)!=null&&Y.color&&(ae.style.color=Z.style.color),(pe=Z.style)!=null&&pe.bold&&(ae.style.fontWeight="700"),Z.type==="colorScale"&&(ae.style.background=`linear-gradient(to right, ${((ke=Z.colors)!=null?ke:["#f8696b","#ffeb84","#63be7b"]).join(",")})`);let it=C("span","fg-cf-rule-text");it.textContent=`${p(Z)}${Z.row?` \xB7 ${i.wholeRow}`:""}`,it.title=it.textContent;let $n=C("button","fg-chooser-close",{type:"button","aria-label":`${r.close}: ${it.textContent}`});$n.textContent="\xD7",$n.addEventListener("click",()=>{let Go=t.getConditionalFormats(),zo=Go[se];zo.columns=zo.columns.filter(Nn=>Nn!==e),t.setConditionalFormats(Go.filter(Nn=>Nn.columns.length)),h()}),rt.append(ae,it,$n),u.append(rt)}};h();let g=C("div","fg-cf-form"),w=C("select","fg-filter-op fg-cf-wide fg-cf-type",{"aria-label":i.type});for(let I of wl){let H=C("option");H.value=I,H.textContent=i.types[I],w.append(H)}let m=C("select","fg-filter-op fg-cf-wide fg-cf-op",{"aria-label":r.filter});for(let I of yl){let H=C("option");H.value=I,H.textContent=f(I),m.append(H)}let y=n.def.type==="number",b=C("input","fg-input fg-cf-value",{type:y?"number":"text",placeholder:r.value,"aria-label":r.value}),v=C("input","fg-input fg-cf-value-to",{type:y?"number":"text",placeholder:r.valueTo,"aria-label":r.valueTo}),S=C("input","fg-input fg-cf-wide fg-cf-formula",{type:"text",placeholder:`=${(X=n.def.field)!=null?X:e} > 100`,"aria-label":i.types.formula,spellcheck:"false"}),x=C("input","fg-input fg-cf-rank",{type:"number",min:"1",value:"10","aria-label":i.count}),k=C("label","fg-cf-pct"),E=C("input","",{type:"checkbox"});k.append(E," %");let L=C("div","fg-cf-swatches fg-cf-wide",{role:"group","aria-label":i.style}),R=0;Vi.forEach((I,H)=>{let J=C("button","fg-cf-swatch",{type:"button","aria-label":i.styles[I.key],title:i.styles[I.key],"aria-pressed":String(H===R)});J.textContent=I.key==="bold"?"B":"Aa",I.style.background&&(J.style.background=I.style.background),I.style.color&&(J.style.color=I.style.color),J.addEventListener("click",()=>{R=H;for(let Y of L.children)Y.setAttribute("aria-pressed",String(Y===J))}),L.append(J)});let M=C("label","fg-cf-wide fg-cf-row"),T=C("input","",{type:"checkbox"});M.append(T,` ${i.wholeRow}`),g.append(w,m,b,v,S,x,k,L,M);let A=()=>{let I=w.value,H=m.value;m.hidden=I!=="value",b.hidden=I!=="value"||Po.includes(H),v.hidden=I!=="value"||H!=="between"&&H!=="notBetween",S.hidden=I!=="formula",x.hidden=k.hidden=I!=="top"&&I!=="bottom",L.hidden=qi.includes(I),M.hidden=I!=="value"&&I!=="formula"};w.addEventListener("change",A),m.addEventListener("change",A),A();let F=()=>{let I=w.value,H={columns:[e],type:I},J=Y=>y&&Y.value!==""?Number(Y.value):Y.value;if(I==="value"){if(H.op=m.value,!Po.includes(H.op)){if(b.value==="")return null;if(H.value=J(b),H.op==="between"||H.op==="notBetween"){if(v.value==="")return null;H.valueTo=J(v)}}}else if(I==="formula"){let Y=S.value.trim();if(!Y)return null;H.formula=Y.startsWith("=")?Y:`=${Y}`}else(I==="top"||I==="bottom")&&(H.rank=Math.max(1,Math.floor(Number(x.value)||10)),E.checked&&(H.percent=!0));return qi.includes(I)||(H.style={...Vi[R].style}),T.checked&&(I==="value"||I==="formula")&&(H.row=!0),H},$=C("div","fg-menu-actions"),D=C("button","fg-btn",{type:"button"});D.textContent=i.clear,D.addEventListener("click",()=>{t.setConditionalFormats(t.getConditionalFormats().map(I=>({...I,columns:I.columns.filter(H=>H!==e)})).filter(I=>I.columns.length)),h()});let O=C("button","fg-btn fg-btn-primary",{type:"button"});O.textContent=i.add,O.addEventListener("click",()=>{let I=F();if(!I){(w.value==="formula"?S:b).focus();return}t.setConditionalFormats([...t.getConditionalFormats(),I]),b.value=v.value=S.value="",h()}),$.append(D,O),a.append(l,u,g,$),re(t.renderer.root).append(a);let P=t.renderer.root.getBoundingClientRect(),N=a.offsetWidth||340;a.style.left=`${Math.max(4,Math.min(P.left+24,(window.innerWidth||1024)-N-4))}px`,a.style.top=`${Math.max(4,P.top+24)}px`,this.popup=a,w.focus();let B=I=>{ce(I,a)||this.close()},z=I=>{I.key==="Escape"&&this.close()};document.addEventListener("pointerdown",B,!0),document.addEventListener("keydown",z,!0),this.off.push(()=>document.removeEventListener("pointerdown",B,!0),()=>document.removeEventListener("keydown",z,!0))}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var bl=["text","number","date","set","combined"],vl=["bar","stackedBar","line","area","pie","donut","combo","scatter"],xl=30;function Cl(o,e,t,n){var p,h;let r={id:e,header:(h=(p=t.header)!=null?p:t.field)!=null?h:e};t.type&&(r.type=t.type),t.formula&&(r.formula=t.formula),t.aggFunc&&typeof t.aggFunc=="string"&&(r.aggFunc=t.aggFunc);let i=0,s=new Map,a=1/0,l=-1/0,c=0,d=0,u="",f="";for(let g of n){let w=j(t,g);if(K(w)){i++;continue}if(typeof w=="number"&&Number.isFinite(w))d++,c+=w,w<a&&(a=w),w>l&&(l=w);else if(t.type==="date"){let m=w instanceof Date?w.toISOString().slice(0,10):String(w);(!u||m<u)&&(u=m),(!f||m>f)&&(f=m)}if(s.size<5e3){let m=ne(w),y=s.get(m);y?y.n++:s.set(m,{value:w,n:1})}}return r.blanks=i,r.distinct=s.size,d&&Object.assign(r,{min:a,max:l,avg:Math.round(c/d*1e3)/1e3}),u&&Object.assign(r,{min:u,max:f}),!d&&s.size&&(r.top=[...s.values()].sort((g,w)=>w.n-g.n).slice(0,12).map(g=>({value:String(g.value).slice(0,80),count:g.n}))),r}function kl(o,e,t){let n=o.rowModel.dataRows().map(c=>c.data),r=o.columns.getState().map(c=>o.columns.getNode(c.colId)).filter(c=>c&&!c.children&&!G(c.id)),i=r.map(c=>{var d;return{...Cl(o,c.id,c.def,n),hidden:((d=o.columns.getState().find(u=>u.colId===c.id))==null?void 0:d.hide)||void 0}}),s=typeof t.sampleRows=="number"&&t.sampleRows>=0?Math.min(50,t.sampleRows):5,a=n.slice(0,s).map(c=>Object.fromEntries(r.map(d=>[d.id,j(d.def,c)]))),l=o.store.state;return{prompt:String(e).slice(0,2e3),locale:l.locale.code,rowCount:n.length,totalRows:o.rowModel.server?n.length:o.store.state.data.length,columns:i,sample:a,state:{sort:l.sort,filters:l.filters,quickFilter:l.quickFilter,advancedFilter:l.advancedFilter,groupBy:o.getGroupBy(),pivot:o.getPivot(),conditionalFormats:o.getConditionalFormats()},...t.context?{context:t.context()}:{}}}function Rl(o,e){var u;let t={state:o.api.getState(),defs:o.columnDefs(),summary:o.summaryOptions()},n=[],r=[],i=[],s=Array.isArray(e)?e.slice(0,xl):[],a=f=>typeof f=="string"&&!!o.columns.getNode(f)&&!o.columns.getNode(f).children&&!G(f),l=f=>n.push(f),c=(f,p)=>r.push({action:f,reason:p});for(let f of s){let p=f;if(!p||typeof p!="object"||typeof p.type!="string"){c(f,"not an action");continue}try{switch(p.type){case"sort":{let h=(Array.isArray(p.sort)?p.sort:[]).filter(g=>!!g&&a(g.colId)&&(g.dir==="asc"||g.dir==="desc"));Array.isArray(p.sort)&&h.length!==p.sort.length&&c(p,"unknown column in sort"),o.setSort(h.map(g=>({colId:g.colId,dir:g.dir}))),l(p);break}case"filter":{if(!a(p.colId)){c(p,"unknown column");break}let h=p.model;if(h!==null&&(!h||typeof h!="object"||!bl.includes(h.type))){c(p,"bad filter model");break}o.setFilter(p.colId,h),l(p);break}case"clearFilters":for(let h of Object.keys(o.store.state.filters))o.setFilter(h,null);o.setAdvancedFilter(null),o.api.setQuickFilter(""),l(p);break;case"quickFilter":o.api.setQuickFilter(typeof p.text=="string"?p.text.slice(0,200):""),l(p);break;case"advancedFilter":{let h=p.filter,g=[],w=m=>{let y=m;Array.isArray(y==null?void 0:y.conditions)?y.conditions.forEach(w):g.push(y==null?void 0:y.colId)};if(h&&w(h),h&&(!Array.isArray(h.conditions)||!g.every(a))){c(p,"unknown column in advanced filter");break}o.setAdvancedFilter(h!=null?h:null),l(p);break}case"groupBy":{let h=Array.isArray(p.colIds)?p.colIds.filter(a):[];o.setGroupBy(h),p.expand&&o.expandAll(!0),l(p);break}case"pivot":{let h=p.pivot;if(h&&(!Array.isArray(h.rows)||!Array.isArray(h.values)||!h.rows.every(a)||!((u=h.columns)!=null?u:[]).every(a)||!h.values.every(g=>g&&a(g.colId)))){c(p,"unknown column in pivot");break}o.setPivot(h!=null?h:null),l(p);break}case"showColumns":case"hideColumns":{let h=Array.isArray(p.colIds)?p.colIds.filter(a):[];h.length&&o.setColumnsVisible(h,p.type==="showColumns"),l(p);break}case"conditionalFormat":{let h=p.format;if(!h||!Array.isArray(h.columns)||!h.columns.length||!h.columns.every(a)){c(p,"unknown column in format");break}o.setConditionalFormats([...o.getConditionalFormats(),h]),l(p);break}case"clearConditionalFormats":o.setConditionalFormats([]),l(p);break;case"addColumn":{let h=p.column;if(!h||typeof h.id!="string"||!/^[\w.-]{1,40}$/.test(h.id)||o.columns.getNode(h.id)){c(p,"bad or taken column id");break}let g=typeof h.formula=="string"?h.formula.startsWith("=")?h.formula:`=${h.formula}`:"";if(!(g?Er(g):null)){c(p,"formula does not parse");break}let m={id:h.id,header:typeof h.header=="string"?h.header.slice(0,80):h.id,formula:g};(h.type==="number"||h.type==="date"||h.type==="text")&&(m.type=h.type),o.api.setColumns([...o.columnDefs(),m]),l(p);break}case"summary":{let h=p.summary;if(h&&(!Array.isArray(h.rows)||!h.rows.every(g=>{var w;return g&&Object.keys((w=g.columns)!=null?w:{}).every(a)}))){c(p,"unknown column in summary");break}o.setSummary(h!=null?h:null),l(p);break}case"chart":{let h=Array.isArray(p.colIds)?p.colIds.filter(a):[],g=o.columns.displayed().map(b=>b.id),w=h.map(b=>g.indexOf(b)).filter(b=>b>=0),m=o.rowModel.getRowCount();if(!w.length||!m){c(p,"nothing to chart");break}let y={start:{rowIndex:0,colId:g[Math.min(...w)]},end:{rowIndex:Math.min(m,200)-1,colId:g[Math.max(...w)]}};i.push(o.api.createChart({type:vl.includes(p.chartType)?p.chartType:"bar",range:y,title:typeof p.title=="string"?p.title.slice(0,80):void 0})),l(p);break}case"message":l(p);break;default:c(p,"unknown action")}}catch{c(p,"failed")}}return{applied:n,skipped:r,undo:()=>{for(let f of i)f.destroy();(o.columnDefs().length!==t.defs.length||o.columnDefs().some((f,p)=>f!==t.defs[p]))&&o.api.setColumns(t.defs),o.setSummary(t.summary),o.api.setState(t.state),t.state.conditionalFormats||o.setConditionalFormats([])}}}async function In(o,e,t,n){var c,d;if(!(t!=null&&t.url))throw new Error("assistant.url is not set");let r=typeof t.headers=="function"?t.headers():(c=t.headers)!=null?c:{},i=await fetch(t.url,{method:"POST",credentials:(d=t.credentials)!=null?d:"same-origin",headers:{"Content-Type":"application/json",Accept:"application/json",...r},body:JSON.stringify(kl(o,e,t)),signal:n});if(!i.ok)throw new Error(`HTTP ${i.status} from the assistant`);let s=await i.json(),a=Rl(o,Array.isArray(s==null?void 0:s.actions)?s.actions:[]),l=typeof(s==null?void 0:s.message)=="string"?s.message:a.applied.filter(u=>u.type==="message").map(u=>{var f;return(f=u.text)!=null?f:""}).join(`
53
+ `);return{...a,message:l.slice(0,4e3)}}var Dn=class{constructor(e){this.grid=e;this.popup=null;this.log=null;this.off=[];this.busy=null}get isOpen(){return!!this.popup}open(){var m,y;if(this.popup){(m=this.popup.querySelector(".fg-ai-input"))==null||m.focus();return}let{grid:e}=this,t=e.store.state.locale,n=e.options.assistant,r=C("div",`fg-menu fg-ai-panel fg-theme-${e.store.state.theme}`,{role:"dialog","aria-label":t.ai.title});e.applyFontTo(r);let i=C("div","fg-chooser-head"),s=C("span","fg-menu-title");s.textContent=t.ai.title;let a=C("button","fg-chooser-close",{type:"button","aria-label":t.close});a.textContent="\xD7",a.addEventListener("click",()=>this.close()),i.append(s,a);let l=C("div","fg-ai-log",{role:"log","aria-live":"polite"});this.log=l;let c=C("form","fg-ai-form"),d=C("textarea","fg-input fg-ai-input",{rows:"2",placeholder:t.ai.placeholder,"aria-label":t.ai.placeholder,maxlength:"2000"}),u=C("button","fg-btn fg-btn-primary fg-ai-send",{type:"submit"});u.textContent=t.ai.send,c.append(d,u);let f=C("div","fg-ai-tips");for(let b of((y=n==null?void 0:n.suggestions)!=null?y:[]).slice(0,6)){let v=C("button","fg-ai-tip",{type:"button"});v.textContent=b,v.addEventListener("click",()=>{d.value=b,d.focus()}),f.append(v)}d.addEventListener("keydown",b=>{var v,S;b.key==="Enter"&&!b.shiftKey&&!b.isComposing&&(b.preventDefault(),(S=(v=c.requestSubmit)==null?void 0:v.call(c))!=null||c.dispatchEvent(new Event("submit",{cancelable:!0})))}),c.addEventListener("submit",b=>{b.preventDefault();let v=d.value.trim();!v||this.busy||(d.value="",this.ask(v,u))}),r.append(i,l,c),f.childElementCount&&r.append(f),re(e.renderer.root).append(r);let p=e.renderer.root.getBoundingClientRect(),h=r.offsetWidth||360;r.style.left=`${Math.max(4,Math.min(p.right-h-16,(window.innerWidth||1024)-h-4))}px`,r.style.top=`${Math.max(4,p.top+16)}px`,this.popup=r,d.focus();let g=b=>{!ce(b,r)&&!this.busy&&this.close()},w=b=>{b.key==="Escape"&&this.close()};document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",w,!0),this.off.push(()=>document.removeEventListener("pointerdown",g,!0),()=>document.removeEventListener("keydown",w,!0))}say(e,t){var r;let n=C("div",`fg-ai-msg fg-ai-${e}`);return n.textContent=t,(r=this.log)==null||r.append(n),this.log&&(this.log.scrollTop=this.log.scrollHeight),n}async ask(e,t){let n=this.grid.store.state.locale;this.say("user",e);let r=this.say("ai",n.ai.thinking);r.classList.add("fg-ai-wait"),this.busy=new AbortController,t.disabled=!0;try{let i=await In(this.grid,e,this.grid.options.assistant,this.busy.signal);r.classList.remove("fg-ai-wait");let s=i.applied.filter(a=>a.type!=="message").length;if(r.textContent=i.message||(s?n.ai.done:""),i.skipped.length){let a=C("div","fg-ai-note");a.textContent=`${n.ai.skipped}: ${i.skipped.map(l=>l.reason).join(", ")}`,r.append(a)}if(s){let a=C("button","fg-btn fg-ai-undo",{type:"button"});a.textContent=n.ai.undo,a.addEventListener("click",()=>{i.undo(),a.disabled=!0,a.textContent=n.ai.undone}),r.append(a)}this.grid.events.emit("assistantAnswer",{prompt:e,message:i.message,applied:i.applied,skipped:i.skipped})}catch(i){if((i==null?void 0:i.name)==="AbortError")return;r.remove(),this.say("error",n.ai.failed)}finally{this.busy=null,t.disabled=!1}}close(){var e,t;(e=this.busy)==null||e.abort(),this.busy=null;for(let n of this.off)n();this.off=[],(t=this.popup)==null||t.remove(),this.popup=null,this.log=null}};var Wi=o=>Math.round(o*2.75),ji=o=>Math.round(o*3.1),Fo=13,Io={compact:[.8,.85],normal:[1,1],comfortable:[1.25,1.15]},Sl=[],Ml=100,Ui=new Map;function Ce(o){return o.every(e=>e!==null&&typeof e=="object")?o:(V("data contains entries that are not objects; they were skipped"),o.filter(e=>e!==null&&typeof e=="object"))}var Do=class{constructor(e,t){this.options=t;this.events=new Ye;this.pinnedRows={top:[],bottom:[]};this.spanCache=null;this.editVersion=0;this.tracker=new sn;this.history=new rn;this.disposers=[];this.collatorCache=null;this.destroyed=!1;this.summaryOpts=null;this.summaryValues=[];this.groupBy=[];this.expanded=new Map;this.defaultExpanded=0;this.detailOpen=new Set;this.displayVersion=0;this.aggCache={ver:-1,map:new WeakMap};this.charts=new Sn(this);this.sourceDefs=[];this.pivotCfg=null;this.pivotData=null;this.savedGroup=null;this.page=0;this.pageSize=Ml;this.formulaScope={off:()=>!this.allow("formulas"),rows:()=>this.store.state.data,version:()=>this.editVersion,computed:e=>{var n;let t=(n=this.columns.getNode(e))==null?void 0:n.def;return t&&typeof t.formula=="string"&&t.formula.startsWith("=")?t.formula:void 0}};this.cfRules=[];this.cfRowsSrc=null;this.sourceSnapshot=void 0;this.summarySnapshot=null;this.cfRows=[];this.formats=new un({rules:()=>this.cfRules,rows:()=>{let e=this.rowModel.dataRows();return this.cfRowsSrc!==e&&(this.cfRowsSrc=e,this.cfRows=e.map(t=>t.data)),this.cfRows},value:(e,t)=>{var r;let n=(r=this.columns.getNode(e))==null?void 0:r.def;return n?j(n,t):void 0},version:()=>this.editVersion,formula:(e,t)=>Bt(e,t,new Set,0,new Map,this.formulaScope)});this.formatDialog=new Fn(this);this.assistantPanel=new Dn(this);this.forcedOverlay=null;this.filterBuilder=new Pn(this);this.flashing=new Map;this.flashTimer=0;this.txQueue=[];this.txTimer=0;this.keepRange=!1;this.rowNumberCache=null;this.treeLoaded=new Set;this.treeLoading=new Set;this.lazyChildren=(e,t)=>{var n,r;if(this.treeLoaded.has(e))return!1;try{return!!((r=(n=this.options.treeData)==null?void 0:n.hasChildren)!=null&&r.call(n,t))}catch{return!1}};this.density="normal";this.aggMemo=null;this.selectionVersion=0;this.selectableCache=null;var s,a,l,c,d,u,f,p,h;this.paid=Ii(t.licenseKey),Array.isArray(t.columns)||V("options.columns must be an array"),t.data!=null&&!Array.isArray(t.data)&&V("options.data must be an array"),this.store=new Ln({data:Array.isArray(t.data)?Ce(t.data):[],sort:[],filters:{},quickFilter:"",selected:new Set,anchorId:null,focus:null,range:null,extraRanges:[],advancedFilter:null,locale:st(t.locale),theme:(s=t.theme)!=null?s:"light"}),this.sourceDefs=Array.isArray(t.columns)?t.columns:[],this.sourceSnapshot=xe(this.sourceDefs),this.columns=new Pt(this.withSelect(this.sourceDefs)),this.bindFormulas();let n=t.pagination;n&&typeof n=="object"&&n.pageSize!==void 0&&(Number.isInteger(n.pageSize)&&n.pageSize>0?this.pageSize=n.pageSize:V("pagination.pageSize must be a positive integer")),t.datasource&&typeof t.datasource.getRows!="function"&&V("datasource.getRows must be a function"),this.rowModel=t.datasource&&typeof t.datasource.getRows=="function"?new Mt({datasource:t.datasource,blockSize:Number.isInteger(t.blockSize)&&t.blockSize>0?t.blockSize:100,maxBlocks:Number.isInteger(t.maxBlocks)&&t.maxBlocks>0?t.maxBlocks:100,getRowId:t.getRowId,onLoaded:(g,w,m)=>this.serverLoaded(g,w,m),onFailed:(g,w,m)=>this.serverFailed(g,w,m)}):new An({getRowId:t.getRowId,columnDef:g=>{var w;return(w=this.columns.getNode(g))==null?void 0:w.def},quickColumns:()=>this.columns.displayed().filter(g=>!G(g.id)).map(g=>g.def),format:(g,w)=>ee(g,this.store.state.locale.code)(w),collator:()=>this.collator(),textVersion:()=>`${this.store.state.locale.code}|${this.editVersion}`}),(a=t.groupBy)!=null&&a.length&&this.allow(this.rowModel.server?"serverGroups":"grouping")&&(this.groupBy=this.validGroupBy(t.groupBy)),Array.isArray(t.conditionalFormats)&&t.conditionalFormats.length&&this.allow("conditional")&&(this.cfRules=t.conditionalFormats.filter(g=>g&&typeof g=="object"&&Array.isArray(g.columns)).map(g=>({...g,columns:[...g.columns]}))),this.defaultExpanded=(t.treeData||this.paid)&&(l=t.groupDefaultExpanded)!=null?l:0,t.treeData&&!t.getRowId&&V("treeData needs getRowId so parent ids can be matched"),this.updateRows(),this.summaryOpts=t.summary&&this.allow("summary")?t.summary:null,this.summarySnapshot=xe(this.summaryOpts),this.refreshSummary();let r=t.fontSize!=null&&t.fontSize>0?t.fontSize:null;t.fontSize!=null&&!(t.fontSize>0)&&V("fontSize must be a positive number"),this.font={size:r,family:(c=t.fontFamily)!=null?c:null};let i=r!=null?r:Fo;if(this.renderer=new Vt(e,this,{rowHeight:(d=t.rowHeight)!=null?d:Math.round(Wi(i)*Io[this.densityOf(t.density)][0]),headerHeight:(u=t.headerHeight)!=null?u:Math.round(ji(i)*Io[this.densityOf(t.density)][1])}),this.density=this.densityOf(t.density),this.renderer.applyTheme(),t.flashDuration&&this.renderer.root.style.setProperty("--fg-flash-duration",`${this.flashMs()}ms`),this.renderer.applyFont(this.font.size,this.font.family),this.menu=new En(this),this.chooser=new Xt(this),this.contextMenu=new Yt(this),this.editor=new on(this),this.finder=new en(this),this.fillHandle=new Zt(this),this.groupPanel=t.groupPanel&&this.allow("grouping")?new qt(this):null,this.pinnedRows={top:Ce((f=t.pinnedTopRows)!=null?f:[]),bottom:Ce((p=t.pinnedBottomRows)!=null?p:[])},this.sideBar=t.sideBar&&this.allow("sideBar")?new Jt(this,typeof t.sideBar=="object"&&!!t.sideBar.open,(h=typeof t.sideBar=="object"?t.sideBar.panels:void 0)!=null?h:t.pivot||t.pivotPanel?["columns","filters","pivot"]:void 0):null,this.disposers.push(this.store.bus.on("change",g=>this.onChange(g)),Ur(this),Gr(this),()=>this.menu.close(),()=>this.chooser.close(),()=>this.contextMenu.destroy(),()=>this.editor.destroy(),()=>this.fillHandle.destroy(),()=>{var g;return(g=this.groupPanel)==null?void 0:g.destroy()},()=>this.charts.destroy(),()=>this.filterBuilder.close(),()=>this.formatDialog.close(),()=>this.assistantPanel.close(),Gi(this)),typeof ResizeObserver!="undefined"){let g=new ResizeObserver(()=>this.renderer.schedule());g.observe(this.renderer.main),this.disposers.push(()=>g.disconnect())}t.pivot&&this.setPivot(t.pivot),Ti(t.licenseKey).then(g=>{g&&!this.destroyed&&this.renderer.showFreeBadge()}),this.renderer.render(),this.api=this.createApi(),Wt.set(this.renderer.root,this),eo.set(this.api,this),Di(t.licenseKey)}get valuesVersion(){return this.editVersion}rangesOn(){return this.options.rangeSelection!==!1&&this.paid}allow(e){return this.paid?!0:($i(e),!1)}columnDefs(){return[...this.sourceDefs]}summaryOptions(){return this.summaryOpts?JSON.parse(JSON.stringify(this.summaryOpts)):null}setConditionalFormats(e){if(!Array.isArray(e)){V("setConditionalFormats: formats must be an array");return}e.length&&!this.allow("conditional")||(this.cfRules=e.filter(t=>t&&typeof t=="object"&&Array.isArray(t.columns)).map(t=>({...t,columns:[...t.columns]})),this.renderer.invalidate({rows:!0}),this.events.emit("conditionalFormatsChange",{formats:this.getConditionalFormats()}))}getConditionalFormats(){return JSON.parse(JSON.stringify(this.cfRules))}cellFormat(e,t,n){return this.cfRules.length?this.formats.cell(t,e,n):null}bindFormulas(){var n;let e=[],t=r=>{for(let i of r)!i||typeof i!="object"||(e.push(i),Array.isArray(i.children)&&t(i.children))};t(this.sourceDefs);for(let r of this.columns.getState()){let i=(n=this.columns.getNode(r.colId))==null?void 0:n.def;i&&e.push(i)}Sr(e,this.formulaScope)}collator(){var t;let e=this.store.state.locale.code;return((t=this.collatorCache)==null?void 0:t.code)!==e&&(this.collatorCache={code:e,collator:new Intl.Collator(e,{numeric:!0,sensitivity:"base"})}),this.collatorCache.collator}layoutChanged(){this.renderer.invalidateHeights(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}columnsChanged(){this.rowModel.invalidate(),this.updateRows(),this.refreshSummary(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}display(){var e,t;return{groupBy:this.options.treeData?Sl:this.groupBy,getParentId:(e=this.options.treeData)==null?void 0:e.getParentId,expanded:this.expanded,defaultExpanded:this.defaultExpanded,detailOpen:this.options.detailRenderer?this.detailOpen:new Set,isMaster:this.options.isRowMaster,lazyChildren:(t=this.options.treeData)!=null&&t.hasChildren?this.lazyChildren:void 0,loading:this.treeLoading,version:this.displayVersion}}updateRows(){var n;let e=!!this.options.pagination,t=(n=this.pivotData)!=null?n:this.store.state.data;this.rowModel.update({...this.store.state,data:t,display:this.display(),page:e?{index:this.page,size:this.pageSize}:null}),e&&this.page>=this.getPageCount()&&(this.page=this.getPageCount()-1,this.rowModel.update({...this.store.state,data:t,display:this.display(),page:{index:this.page,size:this.pageSize}}))}viewRows(){var e;return(e=this.pivotData)!=null?e:this.store.state.data}sourceLeaves(){let e=[],t=n=>{var r,i;for(let s of n)!s||typeof s!="object"||(Array.isArray(s.children)?t(s.children):((r=s.id)!=null?r:s.field)&&e.push({id:(i=s.id)!=null?i:s.field,def:s}))};return t(this.sourceDefs),e}getPivot(){let e=this.pivotCfg;if(!e)return null;let t={rows:[...e.rows],columns:[...e.columns],values:e.values.map(n=>({...n}))};return e.totals||(t.totals=!1),t}setPivot(e){if(e&&!this.allow("pivot")||e&&this.clientOnly("pivot"))return;if(e&&(typeof e!="object"||!Array.isArray(e.rows)||!Array.isArray(e.values))){V("setPivot: expected { rows: string[], values: [...] }");return}if(this.editor.cancel(),!e){if(!this.pivotCfg)return;this.pivotCfg=null,this.pivotData=null,this.columns.setDefs(this.withSelect(this.sourceDefs)),this.savedGroup&&(this.groupBy=this.savedGroup.groupBy,this.expanded=this.savedGroup.expanded,this.defaultExpanded=this.savedGroup.defaultExpanded,this.savedGroup=null),this.afterPivotSwitch();return}let t=new Set(this.sourceLeaves().map(r=>r.id));this.pivotCfg||(this.savedGroup={groupBy:this.groupBy,expanded:this.expanded,defaultExpanded:this.defaultExpanded});let n=Co(e,r=>t.has(r));this.pivotCfg&&pi(n,this.pivotCfg)||(this.pivotCfg=n,this.expanded=new Map,this.defaultExpanded=-1,this.rebuildPivot(!1),this.afterPivotSwitch())}afterPivotSwitch(){var e;this.page=0,this.store.set({sort:[],filters:{},range:null,focus:null}),this.rowModel.invalidate(),this.updateRows(),this.displayVersion++,this.updateRows(),(e=this.groupPanel)==null||e.refresh(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers(),this.events.emit("pivotChange",{pivot:this.getPivot()})}rebuildPivot(e=!0){let t=this.pivotCfg;if(!t)return;let n=this.store.state.locale,r=new Map(this.sourceLeaves().map(c=>[c.id,c.def])),i={sum:n.sum,avg:n.avg,min:n.min,max:n.max,count:n.count},s=hi(this.store.state.data,t,c=>r.get(c),{total:n.total,blank:n.blanks,agg:c=>{var d;return(d=i[c])!=null?d:c}},n.code);if(this.pivotData=s.rows,this.columns.setDefs(this.withSelect(s.columns)),this.groupBy=s.groupBy,!e)return;let a=c=>!!this.columns.getNode(c),l=this.store.state;(l.sort.some(c=>!a(c.colId))||Object.keys(l.filters).some(c=>!a(c)))&&this.store.set({sort:l.sort.filter(c=>a(c.colId)),filters:Object.fromEntries(Object.entries(l.filters).filter(([c])=>a(c)))}),this.rowModel.invalidate(),this.displayVersion++,this.updateRows(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}isFlashing(e,t){return this.flashing.size>0&&this.flashing.has(`${e}\0${t}`)}flashClass(e,t){if(!this.flashing.size)return"";let n=this.flashing.get(`${e}\0${t}`);return n?n.dir?` fg-cell-flash fg-cell-flash-${n.dir}`:" fg-cell-flash":""}flashMs(){let e=this.options.flashDuration;return typeof e=="number"&&e>0?e:1e3}flash(e){let t=this.flashMs(),n=Date.now()+t;for(let[i,s]of e)this.flashing.set(i,{until:n,dir:s});if(this.flashTimer)return;let r=()=>{let i=Date.now(),s=new Set,a=1/0;for(let[l,c]of this.flashing)c.until<=i?(this.flashing.delete(l),s.add(l.slice(0,l.indexOf("\0")))):a=Math.min(a,c.until);s.size&&this.renderer.invalidateRowIds(s),this.flashTimer=this.flashing.size&&!this.destroyed?window.setTimeout(r,Math.max(16,a-i)):0};this.flashTimer=window.setTimeout(r,t)}applyTransaction(e){return!e||typeof e!="object"?{added:[],updated:[],removed:[],notFound:[]}:this.applyTransactions([e])}applyTransactions(e){var c,d;let t={added:[],updated:[],removed:[],notFound:[]};if(this.clientOnly("applyTransaction"))return t;let n=new Map;for(let u of this.columns.getState()){let f=(c=this.columns.getNode(u.colId))==null?void 0:c.def.field;f&&n.set(f,[...(d=n.get(f))!=null?d:[],u.colId])}let r=new Map,i={fields:new Set,ids:new Set},s=this.store.state.data,a=new Set(s),l=new Map(s.map(u=>[this.rowModel.idOf(u),u]));for(let u of e)u&&typeof u=="object"&&(s=this.txStep(u,s,{present:a,byId:l},t,r,n,i));if(!t.added.length&&!t.updated.length&&!t.removed.length)return t.notFound.length&&this.events.emit("transactionApplied",t),t;if(this.editVersion++,s===this.store.state.data&&!this.viewReads(i.fields)){(this.options.autoRowHeight||this.options.getRowHeight)&&this.renderer.invalidateHeights(),this.refreshSummary();let u=this.columns.displayed().some(f=>f.def.formula||f.def.formulas);u?this.finder.refresh():this.finder.refreshRows(i.ids),this.options.getRowHeight||u||this.columns.displayed().some(f=>f.def.merge||f.def.rowSpan)||this.formats.dependsOnOtherRows()?this.renderer.invalidate({rows:!0}):this.renderer.invalidateRowIds(i.ids)}else{this.renderer.invalidateHeights(),this.keepRange=!0;try{this.replaceData(s===this.store.state.data?[...s]:s)}finally{this.keepRange=!1}}return this.editor.sync(),r.size&&this.options.flashCells!==!1&&this.flash(r),this.events.emit("transactionApplied",t),t}viewReads(e){if(!e.size)return!1;let t=this.store.state;return this.pivotCfg||this.options.treeData||t.quickFilter||t.advancedFilter||this.groupBy.length?!0:[...t.sort.map(r=>r.colId),...Object.keys(t.filters)].some(r=>{var s;let i=(s=this.columns.getNode(r))==null?void 0:s.def;return i?i.valueGetter||i.formulas||i.formula?!0:i.field!=null&&e.has(i.field):!1})}txStep(e,t,n,r,i,s,a){var y,b;let l=this.options.getRowId,{present:c,byId:d}=n,u=v=>{if(!v||typeof v!="object")return null;if(c.has(v))return this.rowModel.idOf(v);try{return l?String(l(v)):null}catch{return null}},f=new Set;for(let v of(y=e.remove)!=null?y:[]){let S=u(v),x=S===null?void 0:d.get(S);x&&!f.has(x)?(f.add(x),c.delete(x),d.delete(S),r.removed.push(x),this.tracker.created.delete(x),this.tracker.originals.delete(x)):x||r.notFound.push(v)}let p=(v,S,x)=>{var E;let k=this.tracker.originals.get(x);if(v===x){for(let L of Object.keys(v))k&&(k[L]=v[L]),a.fields.add(L);a.ids.add(S),r.updated.push(x);return}for(let[L,R]of Object.entries(v)){k&&(k[L]=R);let M=x[L];if(Object.is(M,R))continue;x[L]=R,a.fields.add(L),a.ids.add(S);let T=typeof M=="number"&&typeof R=="number"?R>M?"up":"down":"";for(let A of(E=s.get(L))!=null?E:[])i.set(`${S}\0${A}`,T)}r.updated.push(x)};for(let v of(b=e.update)!=null?b:[]){let S=u(v),x=S===null?void 0:d.get(S);if(!x||f.has(x)){r.notFound.push(v);continue}p(v,S,x)}let h=Array.isArray(e.add)?[...e.add]:[];for(let v of Array.isArray(e.upsert)?e.upsert:[]){let S=u(v),x=S===null?void 0:d.get(S);x&&!f.has(x)?p(v,S,x):v&&typeof v=="object"&&h.push(v)}let g=Ce(h);r.added.push(...g);for(let v of g)c.add(v),d.set(this.rowModel.idOf(v),v);if(!f.size&&!g.length)return t;let w=f.size?t.filter(v=>!f.has(v)):[...t],m=typeof e.addIndex=="number"?Math.max(0,Math.min(w.length,Math.floor(e.addIndex))):w.length;return w.splice(m,0,...g),w}applyTransactionAsync(e){if(!e||typeof e!="object"||(this.txQueue.push(e),this.txTimer))return;let t=this.options.asyncTransactionWait;this.txTimer=window.setTimeout(()=>this.flushAsyncTransactions(),typeof t=="number"&&t>=0?t:50)}flushAsyncTransactions(){clearTimeout(this.txTimer),this.txTimer=0;let e=this.txQueue;this.txQueue=[],!(this.destroyed||!e.length)&&this.applyTransactions(e)}setAdvancedFilter(e){let t=e&&typeof e=="object"&&Array.isArray(e.conditions)&&e.conditions.length?e:null;t&&!this.allow("advancedFilter")||t!==this.store.state.advancedFilter&&(this.store.set({advancedFilter:t}),this.events.emit("advancedFilterChange",{advancedFilter:t}))}setColumnGroupOpened(e,t){this.columns.setGroupOpen(e,!!t)&&(this.layoutChanged(),this.events.emit("columnGroupOpened",{groupId:e,open:!!t}))}getState(){var i,s,a,l;let e=this.store.state,t=(s=(i=this.savedGroup)==null?void 0:i.groupBy)!=null?s:this.groupBy,n=(l=(a=this.savedGroup)==null?void 0:a.expanded)!=null?l:this.expanded,r={columns:this.columns.getState(),columnGroups:this.columns.groupOpenState(),advancedFilter:e.advancedFilter?JSON.parse(JSON.stringify(e.advancedFilter)):null,sort:e.sort.map(c=>({...c})),filters:JSON.parse(JSON.stringify(e.filters)),quickFilter:e.quickFilter,groupBy:[...t],pivot:this.pivotCfg?JSON.parse(JSON.stringify(this.pivotCfg)):null,expanded:Object.fromEntries(n),selected:[...e.selected]};return this.cfRules.length&&(r.conditionalFormats=this.getConditionalFormats()),this.options.pagination&&(r.page=this.page,r.pageSize=this.pageSize),r}setState(e,t={}){var i,s;if(!e||typeof e!="object")return;let n=a=>e[a]!==void 0&&(!t.parts||t.parts.includes(a)),r=a=>!!this.columns.getNode(a);if(n("columns")&&Array.isArray(e.columns)&&(this.columns.applyState(e.columns.filter(a=>a&&r(a.colId))),this.columnsChanged()),n("columnGroups")&&e.columnGroups&&typeof e.columnGroups=="object")for(let[a,l]of Object.entries(e.columnGroups))typeof l=="boolean"&&this.setColumnGroupOpened(a,l);if(n("groupBy")&&Array.isArray(e.groupBy)&&this.setGroupBy(e.groupBy.filter(r)),n("pivot")&&this.setPivot((i=e.pivot)!=null?i:null),n("sort")&&Array.isArray(e.sort)&&this.setSort(e.sort.filter(a=>a&&r(a.colId))),n("filters")&&e.filters&&typeof e.filters=="object"){let a=Object.fromEntries(Object.entries(e.filters).filter(([l])=>r(l)));this.store.set({filters:a}),this.events.emit("filterChange",{filters:{...a}})}if(n("advancedFilter")&&this.setAdvancedFilter((s=e.advancedFilter)!=null?s:null),n("quickFilter")&&typeof e.quickFilter=="string"&&this.store.set({quickFilter:e.quickFilter}),n("expanded")&&e.expanded&&typeof e.expanded=="object"){let a=new Map(Object.entries(e.expanded).filter(([,l])=>typeof l=="boolean"));this.savedGroup?this.savedGroup.expanded=a:(this.expanded=a,this.displayChanged())}if(n("pageSize")&&typeof e.pageSize=="number"&&this.setPageSize(e.pageSize),n("page")&&typeof e.page=="number"&&this.setPage(e.page),n("conditionalFormats")&&Array.isArray(e.conditionalFormats)&&this.setConditionalFormats(e.conditionalFormats),n("selected")&&Array.isArray(e.selected)){let a=new Set(this.rowModel.allNodes().map(l=>l.id));this.setSelected(new Set(e.selected.map(String).filter(l=>a.has(l))))}}rowNumber(e){var r;let t=this.rowModel.rows();if(((r=this.rowNumberCache)==null?void 0:r.rows)!==t){let i=new Int32Array(t.length),s=0;t.forEach((a,l)=>{i[l]=a.kind?0:++s}),this.rowNumberCache={rows:t,nums:i}}let n=this.rowNumberCache.nums[e];return n?n+(this.options.pagination&&!this.rowModel.server?this.page*this.pageSize:0):null}getPage(){return this.options.pagination?this.page:0}getPageSize(){return this.options.pagination?this.pageSize:this.rowModel.fullCount()}getPageCount(){return this.options.pagination?Math.max(1,Math.ceil(this.rowModel.fullCount()/this.pageSize)):1}setPage(e){if(!this.options.pagination||!Number.isFinite(e))return;let t=Math.max(0,Math.min(this.getPageCount()-1,Math.floor(e)));t!==this.page&&(this.veto("beforePageChange",{page:t,pageSize:this.pageSize})||(this.page=t,this.pageMoved()))}setPageSize(e){if(!this.options.pagination)return;if(!Number.isInteger(e)||e<=0){V("setPageSize: size must be a positive integer");return}if(e===this.pageSize)return;let t=this.page*this.pageSize;this.veto("beforePageChange",{page:Math.floor(t/e),pageSize:e})||(this.pageSize=e,this.page=Math.floor(t/e),this.pageMoved())}pageMoved(){this.editor.cancel(),this.updateRows(),this.store.state.range&&this.setRange(null);let e=this.rowModel.getRowCount(),t=this.store.state.focus;t&&t.rowIndex>=e&&this.store.set({focus:e?{...t,rowIndex:e-1}:null}),this.renderer.scroller.scrollTop=0,this.finder.refresh(),this.renderer.invalidate({header:!0,rows:!0}),this.emitPage()}emitPage(){this.events.emit("pageChange",{page:this.page,pageSize:this.pageSize,pageCount:this.getPageCount()})}refreshRows(){this.rowModel instanceof Mt&&(this.rowModel.purge(),this.renderer.invalidate({rows:!0}))}serverLoaded(e,t,n){this.destroyed||(this.renderer.invalidate({header:!0,rows:!0}),this.events.emit("rowsLoaded",n===null?{start:e,end:t}:{start:e,end:t,total:n}))}serverFailed(e,t,n){this.destroyed||(V(`datasource.getRows failed for rows ${e}\u2013${t}`),this.toast(this.store.state.locale.loadFailed),this.renderer.invalidate({rows:!0}),this.events.emit("rowsLoadFailed",{start:e,end:t,error:n}))}syncScroll(e,t){if(!e||typeof e.setScrollPosition!="function"||e===this.api)return()=>{};let n=new Map,r=a=>`${a.top},${a.left}`,i=(a,l)=>a.on("scroll",c=>{if(n.get(a)===r(c)){n.delete(a);return}l.setScrollPosition(t==="vertical"?{top:c.top}:t==="horizontal"?{left:c.left}:c),n.set(l,r(l.getScrollPosition()))}),s=[i(this.api,e),i(e,this.api)];return()=>{for(let a of s)a()}}veto(e,t){let n=!1;return this.events.emit(e,{...t,cancel:()=>{n=!0}}),n}clientOnly(e){return this.rowModel.server?(V(`${e} is not available with a datasource`),!0):!1}displayChanged(){this.displayVersion++,this.updateRows(),this.store.state.range&&this.setRange(null);let e=this.rowModel.getRowCount(),t=this.store.state.focus;t&&t.rowIndex>=e&&this.store.set({focus:e?{...t,rowIndex:e-1}:null}),this.finder.refresh(),this.renderer.invalidate({header:!0,rows:!0})}validGroupBy(e){return Array.isArray(e)?[...new Set(e)].filter(t=>{let n=this.columns.getNode(t);return!n||n.children||G(t)?(V(`groupBy: unknown column "${t}"`),!1):!0}):[]}getGroupBy(){return[...this.groupBy]}setGroupBy(e){var n;if(Array.isArray(e)&&e.length&&!this.allow(this.rowModel.server?"serverGroups":"grouping"))return;let t=this.validGroupBy(e);t.join("")!==this.groupBy.join("")&&(this.groupBy=t,this.page=0,(n=this.groupPanel)==null||n.refresh(),this.displayChanged(),this.events.emit("groupChange",{groupBy:[...t]}))}isExpandable(e){return!!e&&(e.kind==="group"||!!e.hasChildren)}expandKey(e){return e.group?e.group.key:e.id}loadChildren(e){let t=this.options.treeData,n=e.id;if(this.treeLoading.has(n))return;if(typeof t.loadChildren!="function"){V("treeData.hasChildren needs treeData.loadChildren");return}this.treeLoading.add(n),this.displayChanged();let r=()=>(this.treeLoading.delete(n),!this.destroyed&&this.store.state.data.includes(e.data));Promise.resolve().then(()=>t.loadChildren(e.data)).then(i=>{if(!r())return;let s=Ce(Array.isArray(i)?i:[]);this.treeLoaded.add(n),this.expanded.set(n,!0),s.length&&this.replaceData([...this.store.state.data,...s]),this.displayChanged(),this.events.emit("childrenLoaded",{row:e.data,rows:s}),this.events.emit("groupToggle",{key:n,expanded:!0})},i=>{r()&&(V(`treeData.loadChildren failed for row "${n}"`),this.displayChanged(),this.events.emit("childrenLoadFailed",{row:e.data,error:i}))})}setGroupExpanded(e,t){var i,s;let n=this.rowModel.rows().find(a=>this.isExpandable(a)&&this.expandKey(a)===e);if((n?!!((s=(i=n.group)==null?void 0:i.expanded)!=null?s:n.expanded):this.expanded.get(e))!==t){if(t&&n&&!n.group&&this.options.treeData&&this.lazyChildren(n.id,n.data)){this.loadChildren(n);return}this.expanded.set(e,t),this.displayChanged(),this.events.emit("groupToggle",{key:e,expanded:t})}}toggleRow(e){var n,r;let t=this.rowModel.getRow(e);this.isExpandable(t)&&this.setGroupExpanded(this.expandKey(t),!((r=(n=t.group)==null?void 0:n.expanded)!=null?r:t.expanded))}expandAll(e=!0){this.expanded.clear(),this.defaultExpanded=e?-1:0,this.displayChanged()}groupAggregate(e,t){var i,s;let n=(i=this.columns.getNode(t))==null?void 0:i.def;if(!e.group||!(n!=null&&n.aggFunc))return;if(e.group.aggregates)return(s=e.group.aggregates[t])!=null?s:n.field?e.group.aggregates[n.field]:void 0;this.aggCache.ver!==this.editVersion&&(this.aggCache={ver:this.editVersion,map:new WeakMap});let r=this.aggCache.map.get(e.group);if(r||this.aggCache.map.set(e.group,r=new Map),!r.has(t)){let a=e.group.rows;try{r.set(t,Le(n.aggFunc,a.map(l=>j(n,l)),a))}catch{V(`aggFunc of column "${t}" threw`),r.set(t,null)}}return r.get(t)}canExpandDetail(e){if(!this.options.detailRenderer)return!1;try{return!this.options.isRowMaster||!!this.options.isRowMaster(e)}catch{return!1}}isDetailExpanded(e){return!!e&&typeof e=="object"&&this.detailOpen.has(this.rowModel.idOf(e))}setDetailExpanded(e,t){if(!e||typeof e!="object"||t&&!this.canExpandDetail(e))return;let n=this.rowModel.idOf(e);this.detailOpen.has(n)!==t&&(t?this.detailOpen.add(n):(this.detailOpen.delete(n),this.renderer.dropDetail(n)),this.displayChanged(),this.events.emit("detailToggle",{row:e,expanded:t}))}canMoveRows(){let e=this.store.state,t=this.options.treeData;return!this.rowModel.server&&!e.sort.length&&!Object.keys(e.filters).length&&!e.quickFilter.trim()&&!this.groupBy.length&&(!t||typeof t.setParentId=="function")}get dragOptions(){let e=this.options.rowDrag;return e&&typeof e=="object"?e:{}}parentOf(e){let t=null;try{t=this.options.treeData.getParentId(e)}catch{t=null}return t==null?null:String(t)}rawParent(e){var t;try{return(t=this.options.treeData.getParentId(e))!=null?t:null}catch{return null}}idValue(e){let t=this.rowModel.idOf(e);for(let r of this.store.state.data){let i=this.rawParent(r);if(i!==null&&String(i)===t)return i}return this.store.state.data.some(r=>typeof this.rawParent(r)=="number")&&t.trim()!==""&&Number.isFinite(Number(t))?Number(t):t}canDropRow(e,t,n,r=this){if(!this.canMoveRows()||t===e)return!1;if(r===this&&this.options.treeData&&t){let s=this.rowModel.idOf(e),a=new Set;for(let l=this.rowModel.idOf(t);l!==null&&!a.has(l);){if(l===s)return!1;a.add(l);let c=this.rowModel.allNodes().find(d=>d.id===l);l=c?this.parentOf(c.data):null}}let i=this.dragOptions.canDrop;if(!i)return!0;try{return i({row:e,target:t,position:n,fromOtherGrid:r!==this})!==!1}catch{return V("rowDrag.canDrop threw; the drop was refused"),!1}}dropRow(e,t,n="after",r=this){var m,y;if(this.clientOnly("dropRow")||!e||typeof e!="object")return!1;let i=this.options.treeData;!i&&n==="inside"&&(n="after");let s=this.store.state.data,a=r!==this,l=a?-1:s.indexOf(e);if(!a&&l<0||t&&!s.includes(t)||a&&(!r.canMoveRows()||s.includes(e))||!this.canDropRow(e,t,n,r))return!1;let c=i?this.rawParent(e):null,d=!i||!t?null:n==="inside"?t:(m=this.store.state.data.find(b=>this.rowModel.idOf(b)===this.parentOf(t)))!=null?m:null,u=d?this.idValue(d):null,f=s.filter(b=>b!==e),p=!t||n==="inside"?f.length:f.indexOf(t)+(n==="after"?1:0);f.splice(p,0,e);let h=f.some((b,v)=>b!==s[v]);if(!a&&!h&&String(c!=null?c:"")===String(u!=null?u:""))return!1;let g=(b,v)=>{try{i.setParentId(e,b,v)}catch{V("treeData.setParentId threw")}},w=i&&(y=this.store.state.data.find(b=>this.rowModel.idOf(b)===this.parentOf(e)))!=null?y:null;return a?(r.removeRows([e]),i&&g(u,d),this.addRows([e],p)):(i&&g(u,d),this.replaceData(f),this.history.push({undo:()=>{i&&g(c,w),this.replaceData(s)},redo:()=>{i&&g(u,d),this.replaceData(f)}}),this.events.emit("rowDragEnd",{row:e,fromIndex:l,toIndex:p})),this.events.emit("rowDrop",{row:e,target:t,position:n,fromOtherGrid:a,fromGrid:a?r.api:null}),!0}moveRow(e,t,n=!0){if(this.clientOnly("moveRow")||!this.canMoveRows())return!1;let r=this.store.state.data,i=r.indexOf(e);if(i<0||!Number.isFinite(t))return!1;let s=Math.max(0,Math.min(r.length-1,Math.floor(t)));if(s===i)return!1;let a=[...r];return a.splice(i,1),a.splice(s,0,e),this.replaceData(a),n&&this.history.push({undo:()=>this.moveRow(e,i,!1),redo:()=>this.moveRow(e,s,!1)}),this.events.emit("rowDragEnd",{row:e,fromIndex:i,toIndex:s}),!0}setFont(e){let t=this.font.size;e.size!==void 0&&(typeof e.size=="number"&&e.size>0?t=e.size:V("setFont: size must be a positive number"));let n=e.family===void 0?this.font.family:e.family||null;this.font={size:t,family:n};let r=t!=null?t:Fo;this.applyAutoHeights(r),this.renderer.applyFont(t,n),this.renderer.invalidateHeights(),this.menu.close(),this.layoutChanged()}densityOf(e){return e==="compact"||e==="comfortable"?e:"normal"}applyAutoHeights(e){let[t,n]=Io[this.density];this.options.rowHeight==null&&(this.renderer.opts.rowHeight=Math.round(Wi(e)*t)),this.options.headerHeight==null&&(this.renderer.opts.headerHeight=Math.round(ji(e)*n))}setDensity(e){var n;let t=this.densityOf(e);t!==this.density&&(this.density=t,this.renderer.applyTheme(),this.applyAutoHeights((n=this.font.size)!=null?n:Fo),this.renderer.invalidateHeights(),this.layoutChanged())}applyFontTo(e){this.font.size&&e.style.setProperty("--fg-font-size",`${this.font.size}px`),this.font.family&&e.style.setProperty("--fg-font",this.font.family)}summary(){var e;return this.summaryOpts&&((e=this.summaryOpts.rows)!=null&&e.length)?{opts:this.summaryOpts,values:this.summaryValues}:null}setSummary(e){if(e&&!Array.isArray(e.rows)){V("setSummary: summary.rows must be an array");return}if(!(e&&!this.allow("summary"))){if(ot(e,this.summarySnapshot)){this.summaryOpts=e;return}this.summarySnapshot=xe(e),this.summaryOpts=e,this.refreshSummary(),this.renderer.invalidate({header:!0,rows:!0})}}refreshSummary(){var r,i;let e=this.summaryOpts;if(!((r=e==null?void 0:e.rows)!=null&&r.length)){this.summaryValues=[];return}let t=(i=e.scope)!=null?i:"filtered",n=t==="all"?this.rowModel.allNodes().map(s=>s.data):t==="selected"?this.selectedRows():this.rowModel.dataRows().map(s=>s.data);this.summaryValues=Pr(e.rows,n,s=>{var a;return(a=this.columns.getNode(s))==null?void 0:a.def})}dataColumns(){return this.columns.displayed().filter(e=>!G(e.id))}validRange(e){if(!e||!this.rangesOn())return null;let t=this.rowModel.getRowCount(),n=r=>!!r&&!G(r.colId)&&!!this.columns.getColumn(r.colId)&&r.rowIndex>=0&&r.rowIndex<t;return n(e.start)&&n(e.end)?{start:{...e.start},end:{...e.end}}:null}setRange(e,t=!1){var s,a,l,c;if(e&&(((s=e.start)==null?void 0:s.rowIndex)!==((a=e.end)==null?void 0:a.rowIndex)||((l=e.start)==null?void 0:l.colId)!==((c=e.end)==null?void 0:c.colId))&&!this.allow("range"))return;let n=this.validRange(e),r=t||!this.store.state.extraRanges.length?this.store.state.extraRanges:[],i=this.store.state.range;JSON.stringify(i)===JSON.stringify(n)&&r===this.store.state.extraRanges||(this.store.set({range:n,extraRanges:r}),this.events.emit("rangeChange",{range:n&&{start:{...n.start},end:{...n.end}}}))}addRange(e){if(!this.allow("range"))return;let{range:t,focus:n}=this.store.state,r=this.validRange(t!=null?t:n?{start:n,end:n}:null);r&&this.store.set({extraRanges:[...this.store.state.extraRanges,r]}),this.setRange(e,!0)}getRanges(){let e=[...this.store.state.extraRanges];return this.store.state.range&&e.push(this.store.state.range),e.map(t=>({start:{...t.start},end:{...t.end}}))}setRanges(e){var n;if(Array.isArray(e)&&e.length&&!this.allow("range"))return;let t=(Array.isArray(e)?e:[]).map(r=>this.validRange(r)).filter(r=>!!r);this.store.set({extraRanges:t.slice(0,-1)}),this.setRange((n=t[t.length-1])!=null?n:null,!0)}boundsOf(e){if(!e)return null;let t=this.columns.getColumn(e.start.colId),n=this.columns.getColumn(e.end.colId);return!t||!n?null:gt({start:{rowIndex:e.start.rowIndex,colIndex:t.index},end:{rowIndex:e.end.rowIndex,colIndex:n.index}})}rangeBounds(){return this.boundsOf(this.store.state.range)}allRangeBounds(){return[...this.store.state.extraRanges,this.store.state.range].map(e=>this.boundsOf(e)).filter(e=>!!e)}rangeContains(e,t){let n=this.columns.getColumn(t);return!!n&&this.allRangeBounds().some(r=>Wr(r,e,n.index))}selectAllCells(){if(!this.allow("range"))return;let e=this.dataColumns(),t=this.rowModel.getRowCount();!e.length||!t||(this.store.state.focus||this.setFocus(0,e[0].id),this.setRange({start:{rowIndex:0,colId:e[0].id},end:{rowIndex:t-1,colId:e[e.length-1].id}}))}selectionTSV(e,t=!1){if(!t&&this.multiCell()&&!this.allow("clipboard"))return"";let n=this.store.state.locale.code,r=this.columns.displayed(),i=t?null:this.rangeBounds(),s=t,a,l,c=t?[]:this.allRangeBounds();if(c.length>1){let u=c.every(p=>p.c1===c[0].c1&&p.c2===c[0].c2),f=c.every(p=>p.r1===c[0].r1&&p.r2===c[0].r2);if(this.rangesStack(c)){let p=[...c].sort((w,m)=>u?w.r1-m.r1:w.c1-m.c1),h=p.map(w=>this.rangeMatrix(w)),g=u?h.flat():h[0].map((w,m)=>h.flatMap(y=>{var b;return(b=y[m])!=null?b:[]}));return e&&g.unshift((u?p.slice(0,1):p).flatMap(w=>this.rangeHeaders(w))),no(g)}}if(i){a=[];for(let u=i.r1;u<=i.r2;u++){let f=this.rowModel.getRow(u);f.kind||a.push(f.data)}l=r.slice(i.c1,i.c2+1).filter(u=>!G(u.id))}else if(s){let u=this.store.state.selected;a=this.rowModel.dataRows().filter(f=>u.has(f.id)).map(f=>f.data),l=this.dataColumns()}else{let u=this.store.state.focus,f=u&&this.columns.getColumn(u.colId),p=u&&this.rowModel.getRow(u.rowIndex);if(!f||!p||p.kind||G(f.id))return"";a=[p.data],l=[f]}let d=a.map(u=>l.map(f=>this.copyCell(f.def,u,n)));return e&&d.unshift(l.map(u=>{var f,p;return(p=(f=u.def.header)!=null?f:u.def.field)!=null?p:u.id})),no(d)}multiCell(){let e=this.allRangeBounds();return e.length>1||e.some(t=>t.r1!==t.r2||t.c1!==t.c2)}rangesStack(e){return e.length>1&&(e.every(t=>t.c1===e[0].c1&&t.c2===e[0].c2)||e.every(t=>t.r1===e[0].r1&&t.r2===e[0].r2))}rangeHeaders(e){return this.columns.displayed().slice(e.c1,e.c2+1).filter(t=>!G(t.id)).map(t=>{var n,r;return(r=(n=t.def.header)!=null?n:t.def.field)!=null?r:t.id})}rangeMatrix(e){let t=this.columns.displayed().slice(e.c1,e.c2+1).filter(i=>!G(i.id)),n=this.store.state.locale.code,r=[];for(let i=e.r1;i<=e.r2;i++){let s=this.rowModel.getRow(i);s&&!s.kind&&r.push(t.map(a=>this.copyCell(a.def,s.data,n)))}return r}copyCell(e,t,n){return this.copyAllowed(e,t)?tn(e,j(e,t),n):""}copyAllowed(e,t){let n=e.copyable;if(typeof n!="function")return n!==!1;try{return n({value:j(e,t),row:t,column:e})!==!1}catch{return!1}}cutToClipboard(){let e=this.copyToClipboard(!1);return e&&this.clearCells(!0),e}copyToClipboard(e,t=!1){var r,i,s;let n=this.selectionTSV(e,t);if(n&&typeof navigator!="undefined"&&((r=navigator.clipboard)!=null&&r.writeText))try{(s=(i=navigator.clipboard.writeText(n))==null?void 0:i.catch)==null||s.call(i,()=>{})}catch{}return n}pasteText(e){var g;let t=Vr(e),n={changed:0,skipped:0};if(!t.length||(t.length>1||t[0].length>1)&&!this.allow("clipboard"))return n;let r=this.columns.displayed(),i=this.rowModel.getRowCount(),s=this.rangeBounds(),a=this.store.state.focus,l=a&&this.columns.getColumn(a.colId),c,d;if(s)c=s.r1,d=s.c1;else if(a&&l&&!G(l.id))c=a.rowIndex,d=l.index;else return n;let u=[],f=t.length===1&&t[0].length===1,p=f&&s?s.r2-s.r1+1:t.length,h=f&&s?s.c2-s.c1+1:Math.max(...t.map(w=>w.length));for(let w=0;w<p;w++){let m=c+w;if(m>=i)break;let y=this.rowModel.getRow(m);if(!y.kind)for(let b=0;b<h;b++){let v=r[d+b];if(!v)break;if(G(v.id))continue;let S=f&&s?t[0][0]:(g=t[w])==null?void 0:g[b];if(S===void 0)continue;let x=v.def;if(!x.field||!ye(x,y.data,m)){n.skipped++;continue}let k=y.data[x.field],E=this.acceptText(x,y.data,S,k);if(!E.ok){n.skipped++;continue}this.writeCell(u,y.data,x.field,v.id,m,E.value)&&n.changed++}}return this.endCellTx(u),this.events.emit("paste",{...n}),n}acceptText(e,t,n,r){var a;let i,s=e.editor;if(s&&typeof s=="object"&&s.type==="select"){let l=(a=typeof s.options=="function"?s.options(t):s.options)!=null?a:[],c=n.trim().toLowerCase(),d=l.map(u=>u!==null&&typeof u=="object"&&"value"in u?u:{value:u,label:String(u),disabled:!1}).find(u=>{var f;return String(u.value).toLowerCase()===c||((f=u.label)!=null?f:"").toLowerCase()===c});if(!d||d.disabled)return{ok:!1};i=d.value}else if(e.formulas&&Ne(n.trim()))i=n.trim();else{let l=nn(e,n,r);if(!l.ok)return l;i=l.value}return this.cellError(e,t,i)!==null?{ok:!1}:{ok:!0,value:i}}cellError(e,t,n){let r=this.store.state.locale;if(e.required&&K(n))return r.required;if(e.unique&&e.field&&!K(n)){let i=n instanceof Date?n.getTime():String(n),s=e.field;if(this.store.state.data.some(a=>{if(a===t)return!1;let l=a[s];return!K(l)&&(l instanceof Date?l.getTime():String(l))===i}))return r.duplicate}if(e.validate){let i;try{i=e.validate(n,t)}catch{i=r.invalidValue}if(i!==!0)return typeof i=="string"&&i?i:r.invalidValue}return null}validateAll(){let e=[],t=this.columns.getState().map(n=>({id:n.colId,def:this.columns.getNode(n.colId).def})).filter(n=>n.def.field&&n.def.editable&&(n.def.required||n.def.unique||n.def.validate));return this.store.state.data.forEach((n,r)=>{let i=this.rowModel.idOf(n),s=this.rowModel.indexOfId(i);for(let a of t){if(!ye(a.def,n,s<0?r:s))continue;let l=this.cellError(a.def,n,n[a.def.field]);l!==null&&e.push({row:n,rowIndex:s,colId:a.id,message:l})}}),e}mergeSpans(){if(this.rowModel.server||!this.columns.displayed().some(i=>i.def.merge||i.def.rowSpan)||!this.allow("merge"))return Ui;let e=this.rowModel.rows(),t=this.editVersion*1e6+this.columns.displayed().length;if(this.spanCache&&this.spanCache.rows===e&&this.spanCache.ver===t)return this.spanCache.spans;let n=new Map,r=this.columns.displayed().filter(i=>i.def.merge||i.def.rowSpan);if(r.length&&!e.some(i=>i.kind)){let i=e.map(s=>s.data);for(let s of r)n.set(s.id,Gt(i,s.def))}return this.spanCache={rows:e,ver:t,spans:n},n}rangeAggregates(){let e=this.allRangeBounds();if(!e.length||!this.paid)return null;let t=this.columns.displayed(),n=[JSON.stringify(e),this.rowModel.rows(),this.editVersion,...t.map(l=>l.def)],r=this.aggMemo;if(r&&r.key.length===n.length&&r.key.every((l,c)=>l===n[c]))return r.value&&{...r.value};let i={cells:0,count:0,numbers:0,sum:0,min:1/0,max:-1/0},s=e.length>1?new Set:null,a=t.length;for(let l of e){let c=t.slice(l.c1,l.c2+1).filter(d=>!G(d.id));for(let d=l.r1;d<=l.r2;d++){let u=this.rowModel.getRow(d);if(!u||u.kind)continue;let f=u.data;for(let p of c){if(s){let g=d*a+p.index;if(s.has(g))continue;s.add(g)}i.cells++;let h=j(p.def,f);if(!K(h)&&(i.count++,typeof h=="number"||p.def.type==="number"&&!Number.isNaN(Number(h)))){let g=Number(h);i.numbers++,i.sum+=g,g<i.min&&(i.min=g),g>i.max&&(i.max=g)}}}}return this.aggMemo={key:n,value:i},{...i}}fillRange(e){var u;if(!this.allow("fill"))return;let t=(u=this.rangeBounds())!=null?u:(()=>{let f=this.store.state.focus,p=f&&this.columns.getColumn(f.colId);return f&&p&&!G(p.id)?{r1:f.rowIndex,r2:f.rowIndex,c1:p.index,c2:p.index}:null})(),n=this.columns.getColumn(e.start.colId),r=this.columns.getColumn(e.end.colId);if(!t||!n||!r)return;let i=gt({start:{rowIndex:e.start.rowIndex,colIndex:n.index},end:{rowIndex:e.end.rowIndex,colIndex:r.index}}),s=this.rowModel.getRowCount();i.r1=Math.max(0,i.r1),i.r2=Math.min(s-1,i.r2);let a=this.columns.displayed(),l=[],c=(f,p,h)=>{let g=a[p],w=this.rowModel.getRow(f),m=g==null?void 0:g.def;!w||w.kind||!(m!=null&&m.field)||G(g.id)||!ye(m,w.data,f)||this.cellError(m,w.data,h)===null&&this.writeCell(l,w.data,m.field,g.id,f,h)},d=(f,p)=>j(a[p].def,this.rowModel.getRow(f).data);if(i.r1<t.r1||i.r2>t.r2)for(let f=t.c1;f<=t.c2;f++){let p=[],h=[];for(let g=t.r1;g<=t.r2;g++)p.push(d(g,f));for(let g=t.r2;g>=t.r1;g--)h.push(d(g,f));mt(p,i.r2-t.r2).forEach((g,w)=>c(t.r2+1+w,f,g)),mt(h,t.r1-i.r1).forEach((g,w)=>c(t.r1-1-w,f,g))}else if(i.c1<t.c1||i.c2>t.c2)for(let f=t.r1;f<=t.r2;f++){let p=[],h=[];for(let g=t.c1;g<=t.c2;g++)p.push(d(f,g));for(let g=t.c2;g>=t.c1;g--)h.push(d(f,g));mt(p,i.c2-t.c2).forEach((g,w)=>c(f,t.c2+1+w,g)),mt(h,t.c1-i.c1).forEach((g,w)=>c(f,t.c1-1-w,g))}else return;this.endCellTx(l),this.setRange({start:{rowIndex:i.r1,colId:a[i.c1].id},end:{rowIndex:i.r2,colId:a[i.c2].id}})}setPinnedRows(e){e.top&&(this.pinnedRows.top=Ce(e.top)),e.bottom&&(this.pinnedRows.bottom=Ce(e.bottom)),this.renderer.invalidate({rows:!0})}writeCell(e,t,n,r,i,s){let a=t[n];return Object.is(a,s)||this.veto("beforeCellChange",{row:t,rowIndex:i,colId:r,oldValue:a,newValue:s})?!1:(this.tracker.beforeChange(t),t[n]=s,e.push({row:t,field:n,colId:r,rowIndex:i,oldValue:a,newValue:s}),!0)}endCellTx(e){if(!e.length)return;let t=(n,r)=>{let i=n.map(s=>{let a=s.row[s.field];return s.row[s.field]=s[r],{row:s.row,rowIndex:this.rowModel.indexOfId(this.rowModel.idOf(s.row)),colId:s.colId,oldValue:a,newValue:s[r]}});this.afterDataEdit();for(let s of i)this.events.emit("cellValueChanged",s)};this.history.push({undo:()=>t([...e].reverse(),"oldValue"),redo:()=>t(e,"newValue")}),this.afterDataEdit();for(let n of e)this.events.emit("cellValueChanged",{row:n.row,rowIndex:n.rowIndex,colId:n.colId,oldValue:n.oldValue,newValue:n.newValue})}afterDataEdit(){this.renderer.invalidateHeights(),this.editVersion++,this.refreshSummary(),this.renderer.invalidate({rows:!0})}applyEdit(e,t,n){var a;let r=this.rowModel.getRow(e),i=(a=this.columns.getColumn(t))==null?void 0:a.def;if(!r||!(i!=null&&i.field))return;let s=[];this.writeCell(s,r.data,i.field,t,e,n),this.endCellTx(s)}clearCells(e=!1){var l,c;let t=this.columns.displayed(),n=this.allRangeBounds();if(e&&!this.rangesStack(n)){let d=this.rangeBounds();n=d?[d]:[]}let r=this.store.state.focus,i=r?(l=this.columns.getColumn(r.colId))==null?void 0:l.index:void 0,s=n.length?n:r&&i!==void 0?[{r1:r.rowIndex,r2:r.rowIndex,c1:i,c2:i}]:[];if(!s.length)return;let a=[];for(let d of s)for(let u=d.r1;u<=d.r2;u++){let f=this.rowModel.getRow(u);for(let p=d.c1;p<=d.c2;p++){let h=(c=t[p])==null?void 0:c.def;f&&!f.kind&&(h!=null&&h.field)&&ye(h,f.data,u)&&(!e||this.copyAllowed(h,f.data))&&this.writeCell(a,f.data,h.field,t[p].id,u,null)}}this.endCellTx(a)}replaceData(e){this.store.set({data:e});let t=new Set(this.rowModel.allNodes().map(s=>s.id)),n=this.store.state.selected;[...n].some(s=>!t.has(s))&&this.setSelected(new Set([...n].filter(s=>t.has(s))));let r=this.rowModel.getRowCount(),i=this.store.state.focus;i&&i.rowIndex>=r&&this.store.set({focus:r?{...i,rowIndex:r-1}:null})}addRows(e,t,n=!0){if(this.clientOnly("addRows"))return[];let r=Ce(Array.isArray(e)?e:[]);if(!r.length)return[];let i=[...this.store.state.data],s=t===void 0?i.length:Math.max(0,Math.min(i.length,t));i.splice(s,0,...r);for(let a of r)this.tracker.created.add(a);return this.replaceData(i),n&&this.history.push({undo:()=>this.removeRows(r,!1),redo:()=>this.addRows(r,s,!1)}),this.events.emit("rowsAdded",{rows:[...r]}),r}removeRows(e,t=!0){if(this.clientOnly("removeRows"))return[];let n=this.store.state.data,r=typeof e=="function"?e:(l=>c=>l.has(c))(new Set(e)),i=[];if(n.forEach((l,c)=>{let d=!1;try{d=!!r(l)}catch{d=!1}d&&i.push({row:l,index:c})}),!i.length)return[];let s=new Set(i.map(l=>l.row)),a=new Set(i.filter(l=>this.tracker.created.has(l.row)).map(l=>l.row));for(let{row:l,index:c}of i)a.has(l)?this.tracker.created.delete(l):this.tracker.deleted.set(l,c);return this.replaceData(n.filter(l=>!s.has(l))),t&&this.history.push({undo:()=>{let l=[...this.store.state.data];for(let{row:c,index:d}of i)l.splice(Math.min(d,l.length),0,c),this.tracker.deleted.delete(c),a.has(c)&&this.tracker.created.add(c);this.replaceData(l)},redo:()=>this.removeRows([...s],!1)}),this.events.emit("rowsRemoved",{rows:i.map(l=>l.row)}),i.map(l=>l.row)}trackedFields(){let e=[],t=n=>{for(let r of n)r.children?t(r.children):r.def.field&&!G(r.id)&&e.push({field:r.def.field,colId:r.id})};return t(this.columns.roots()),e}getChanges(){let e=this.trackedFields(),t=[];for(let[n,r]of this.tracker.originals)if(!this.tracker.deleted.has(n))for(let i of this.tracker.diff(n,e.map(s=>s.field)))t.push({row:n,colId:e.find(s=>s.field===i).colId,oldValue:r[i],newValue:n[i]});return t}getModifiedRows(){let e=this.trackedFields().map(n=>n.field),t=this.store.state.data;return{created:t.filter(n=>this.tracker.created.has(n)),updated:t.filter(n=>this.tracker.originals.has(n)&&this.tracker.diff(n,e).length>0),deleted:[...this.tracker.deleted.keys()]}}hasChanges(){let e=this.getModifiedRows();return e.created.length+e.updated.length+e.deleted.length>0}commitChanges(e){e&&e.rows instanceof Map?this.tracker.commit(e.rows,Array.isArray(e.deleted)?e.deleted:[]):this.tracker.reset(),this.renderer.invalidate({rows:!0})}revertChanges(){this.editor.cancel();for(let[n,r]of this.tracker.originals)Object.assign(n,r);let e=this.store.state.data.filter(n=>!this.tracker.created.has(n)),t=[...this.tracker.deleted.entries()].sort((n,r)=>n[1]-r[1]);e=[...e];for(let[n,r]of t)e.splice(Math.min(r,e.length),0,n);this.tracker.reset(),this.history.clear(),this.replaceData(e),this.afterDataEdit()}undo(){this.editor.cancel(),this.history.undo()}redo(){this.editor.cancel(),this.history.redo()}toast(e){let t=C("div","fg-toast",{role:"status"});t.textContent=e,this.renderer.root.append(t),setTimeout(()=>t.remove(),3500)}refreshChoosers(){var e;this.chooser.refresh(),(e=this.sideBar)==null||e.refresh()}setColumnsVisible(e,t){let n=[];for(let r of e){let i=this.columns.getNode(r);!i||i.children||i.hide===!t||(this.columns.setHide(r,!t),n.push(r))}if(n.length){this.columnsChanged();for(let r of n)this.events.emit("columnVisible",{colId:r,visible:t})}}autoSize(e){var l,c;let t=(e?e.map(d=>this.columns.getColumn(d)):this.columns.displayed()).filter(d=>!!d&&Ft(d.def)),{first:n,last:r}=this.renderer.renderedRange(),i=this.store.state.locale.code,s=66,a=24;for(let d of t){let u=this.renderer.measureText((c=(l=d.def.header)!=null?l:d.def.field)!=null?c:"",!0)+s,f=ee(d.def,i);for(let h=n;h<=r;h++){let g=this.rowModel.getRow(h);g&&(u=Math.max(u,this.renderer.measureText(f(j(d.def,g.data)),!1)+a))}let p=this.columns.setWidth(d.id,Math.ceil(u));this.events.emit("columnResize",{colId:d.id,width:p})}this.layoutChanged()}resetColumns(){this.columns.reset(),this.columnsChanged()}setSort(e){let t=e.filter(n=>{let r=this.columns.getNode(n.colId);return!r||r.children?(V(`setSort: unknown column "${n.colId}"`),!1):n.dir==="asc"||n.dir==="desc"});this.veto("beforeSort",{sort:t.map(n=>({...n}))})||(this.store.set({sort:t}),this.events.emit("sortChange",{sort:[...t]}))}toggleSort(e,t){let n=this.store.state.sort,r=n.find(a=>a.colId===e),i=r?r.dir==="asc"?"desc":null:"asc",s;t?i?r?s=n.map(a=>a.colId===e?{colId:e,dir:i}:a):s=[...n,{colId:e,dir:i}]:s=n.filter(a=>a.colId!==e):s=i?[{colId:e,dir:i}]:[],this.setSort(s)}setFilter(e,t){let n=this.columns.getNode(e);if(!n||n.children){V(`setFilter: unknown column "${e}"`);return}if(this.veto("beforeFilter",{colId:e,model:t}))return;let r={...this.store.state.filters};t?r[e]=t:delete r[e],this.store.set({filters:r}),this.events.emit("filterChange",{filters:{...r}})}setPinned(e,t){this.columns.setPinned(e,t),this.layoutChanged()}setFocus(e,t){let n=this.store.state.focus;n&&n.rowIndex===e&&n.colId===t||(this.store.set({focus:{rowIndex:e,colId:t}}),this.events.emit("focusChange",{rowIndex:e,colId:t}))}setSelected(e,t=this.store.state.anchorId){this.selectionVersion++,this.store.set({selected:e,anchorId:t}),this.events.emit("selectionChange",{selected:this.selectedRows()})}rowSelectable(e){let t=this.options.isRowSelectable;if(!t)return!0;try{return!!t(e)}catch{return!1}}groupMemberIds(e){var a,l;if(e.group)return e.group.rows.filter(c=>this.rowSelectable(c)).map(c=>this.rowModel.idOf(c));let t=(a=this.options.treeData)==null?void 0:a.getParentId;if(!t)return[];let n=new Map;for(let c of this.store.state.data){let d=null;try{d=t(c)}catch{d=null}if(d==null)continue;let u=String(d),f=n.get(u);f?f.push(c):n.set(u,[c])}let r=[],i=new Set([e.id]),s=[e.id];for(;s.length;)for(let c of(l=n.get(s.shift()))!=null?l:[]){let d=this.rowModel.idOf(c);i.has(d)||(i.add(d),s.push(d),this.rowSelectable(c)&&r.push(d))}return r}groupSelection(e){let t=this.groupMemberIds(e),n=this.store.state.selected,r=t.filter(i=>n.has(i)).length;return r===0?"none":r===t.length?"all":"some"}toggleGroupSelection(e){if(this.options.rowSelection!=="multiple")return;let t=this.groupMemberIds(e),n=new Set(this.store.state.selected),r=t.length>0&&t.every(i=>n.has(i));for(let i of t)r?n.delete(i):n.add(i);this.setSelected(n)}selectFromClick(e,t,n){var a,l;let r=this.options.rowSelection;if(!r||e<0||e>=this.rowModel.getRowCount())return;let i=this.rowModel.getRow(e);if(i.kind||!this.rowSelectable(i.data))return;let s=Bi({selected:this.store.state.selected,anchorIndex:this.anchorIndex(),mode:r,index:e,idAt:c=>this.rowModel.getRow(c).id,toggle:t,range:n});if(this.rowModel.rows()!==this.rowModel.dataRows()||this.options.isRowSelectable)for(let c of s.selected){if(this.store.state.selected.has(c))continue;let d=this.rowModel.indexOfId(c),u=d>=0?this.rowModel.getRow(d):null;u&&(u.kind||!this.rowSelectable(u.data))&&s.selected.delete(c)}if(r==="multiple"&&this.options.groupSelectsChildren&&this.options.treeData&&i.hasChildren){let c=s.selected.has(i.id);for(let d of this.groupMemberIds(i))c?s.selected.add(d):s.selected.delete(d)}this.setSelected(s.selected,(l=(a=this.rowModel.getRow(s.anchorIndex))==null?void 0:a.id)!=null?l:null)}anchorIndex(){let e=this.store.state.anchorId;if(e==null)return null;let t=this.rowModel.indexOfId(e);return t<0?null:t}selectableIds(){let e=this.rowModel.dataRows(),t=this.options.isRowSelectable,n=this.selectableCache;if(n&&n.rows===e&&n.fn===t&&n.ver===this.editVersion)return n.ids;let r=new Set(this.selectableRows().map(i=>i.id));return this.selectableCache={rows:e,fn:t,ver:this.editVersion,ids:r},r}selectableRows(){let e=this.rowModel.dataRows();return this.options.isRowSelectable?e.filter(t=>this.rowSelectable(t.data)):e}toggleSelectAll(){let e=this.selectableRows(),t=this.store.state.selected,n=e.length>0&&e.every(i=>t.has(i.id)),r=new Set(t);for(let i of e)n?r.delete(i.id):r.add(i.id);this.setSelected(r)}selectedRows(){let e=this.store.state.selected;return e.size?this.rowModel.allNodes().filter(t=>e.has(t.id)).map(t=>t.data):[]}withSelect(e){let t=[],n=this.options.rowNumbers;if(n){let r=typeof n=="object"?n:{};t.push(ur(typeof r.width=="number"&&r.width>0?r.width:void 0,typeof r.header=="string"?r.header:void 0))}return this.options.rowDrag&&t.push(cr),this.options.rowSelection&&t.push(dr),[...t,...e]}setData(e,t){if(this.clientOnly("setData"))return;if(!Array.isArray(e)){V("setData: rows must be an array");return}this.editor.cancel(),this.tracker.reset(),this.history.clear(),this.detailOpen.clear(),this.treeLoaded.clear(),this.treeLoading.clear(),this.renderer.dropDetail();let n=Ce(e);this.store.set({data:n===this.store.state.data?[...n]:n}),t!=null&&t.scrollToTop&&this.renderer.setScroll({top:0,left:0});let r=this.store.state.selected;if(r.size)if(this.options.getRowId){let a=new Set(this.rowModel.allNodes().map(c=>c.id)),l=new Set([...r].filter(c=>a.has(c)));l.size!==r.size&&this.setSelected(l)}else this.setSelected(new Set,null);let i=this.rowModel.getRowCount(),s=this.store.state.focus;s&&s.rowIndex>=i&&this.store.set({focus:i?{...s,rowIndex:i-1}:null})}setColumns(e){var r;if(!Array.isArray(e)){V("setColumns: columns must be an array");return}if(ot(e,this.sourceSnapshot)){this.sourceDefs=e;return}if(this.menu.close(),this.sourceDefs=e,this.sourceSnapshot=xe(e),this.pivotCfg){this.rebuildPivot();return}this.columns.updateDefs(this.withSelect(e)),this.bindFormulas();let t=i=>!!this.columns.getNode(i),n=this.groupBy.filter(t);n.length!==this.groupBy.length&&(this.groupBy=n,(r=this.groupPanel)==null||r.refresh(),this.events.emit("groupChange",{groupBy:[...n]})),this.store.set({sort:this.store.state.sort.filter(i=>t(i.colId)),filters:Object.fromEntries(Object.entries(this.store.state.filters).filter(([i])=>t(i))),focus:this.store.state.focus&&t(this.store.state.focus.colId)?this.store.state.focus:null}),this.columnsChanged()}onChange(e){var i,s,a,l;let t=(...c)=>c.some(d=>e.includes(d));this.pivotCfg&&t("data","locale")&&this.rebuildPivot(!1),t("locale")&&(this.menu.close(),this.chooser.close(),(i=this.sideBar)==null||i.refresh(),this.rowModel.invalidate());let n=t("sort","filters","quickFilter","advancedFilter")&&this.page!==0;n&&(this.page=0),t("data","sort","filters","quickFilter","advancedFilter","locale")&&this.updateRows(),n&&this.emitPage(),t("data","sort","filters","quickFilter","advancedFilter")&&this.store.state.range&&!this.keepRange&&this.setRange(null),t("data","sort","filters","quickFilter","advancedFilter","locale")&&this.finder.refresh(),(t("data","filters","quickFilter","advancedFilter","locale")||t("selected")&&((s=this.summaryOpts)==null?void 0:s.scope)==="selected")&&this.refreshSummary(),t("locale")&&((a=this.groupPanel)==null||a.refresh()),t("filters")&&((l=this.sideBar)==null||l.refresh()),t("theme")&&this.renderer.applyTheme();let r=t("sort","filters","quickFilter","advancedFilter","locale","data");!r&&t("selected")&&this.renderer.selectionChanged(),this.renderer.invalidate({header:r,rows:t("data","sort","filters","quickFilter","advancedFilter","locale")})}createApi(){let e=t=>((...n)=>{if(this.destroyed){V("API called after destroy()");return}return t(...n)});return{setData:e((t,n)=>this.setData(t,n)),getData:e(()=>this.store.state.data),setColumns:e(t=>this.setColumns(t)),getColumnState:e(()=>this.columns.getState()),applyColumnState:e(t=>{this.columns.applyState(t),this.columnsChanged()}),setSort:e(t=>this.setSort(t)),getSort:e(()=>[...this.store.state.sort]),setFilter:e((t,n)=>this.setFilter(t,n)),getFilterModel:e(()=>({...this.store.state.filters})),setQuickFilter:e(t=>this.store.set({quickFilter:t!=null?t:""})),getSelectedRows:e(()=>this.selectedRows()),selectAll:e(()=>this.setSelected(new Set([...this.store.state.selected,...this.selectableRows().map(t=>t.id)]))),deselectAll:e(()=>this.setSelected(new Set,null)),getDisplayedRowCount:e(()=>this.rowModel.getRowCount()),scrollToRow:e(t=>this.renderer.scrollToRow(t)),validate:e(()=>this.validateAll()),setDensity:e(t=>this.setDensity(t)),getDensity:e(()=>this.density),showOverlay:e(t=>{this.forcedOverlay=t==="loading"||t==="noRows"?t:null,this.renderer.invalidate()}),getXlsxSheet:e(t=>{var n;return this.allow("excel")?yo(this,t):{name:(n=t==null?void 0:t.sheetName)!=null?n:"Sheet1",rows:[]}}),print:e(t=>li(ho(this,t))),getPrintHtml:e(t=>ho(this,t)),getPdf:e(t=>this.allow("pdf")?ro(kn(this,t),cn,{scale:t==null?void 0:t.resolution,quality:t==null?void 0:t.quality}):null),exportPdf:e((t="export.pdf",n)=>{if(!this.allow("pdf"))return;let r=ro(kn(this,n),cn,{scale:n==null?void 0:n.resolution,quality:n==null?void 0:n.quality});r?We(t,[r],"application/pdf"):V("exportPdf: this browser cannot draw on a canvas")}),setColumnGroupOpened:e((t,n)=>this.setColumnGroupOpened(t,n)),setAdvancedFilter:e(t=>this.setAdvancedFilter(t)),getAdvancedFilter:e(()=>this.store.state.advancedFilter?JSON.parse(JSON.stringify(this.store.state.advancedFilter)):null),openFilterBuilder:e(()=>{this.allow("advancedFilter")&&this.filterBuilder.open()}),isColumnGroupOpened:e(t=>{var n;return!!((n=this.columns.getNode(t))!=null&&n.open)}),applyTransaction:e(t=>this.applyTransaction(t)),applyTransactionAsync:e(t=>this.applyTransactionAsync(t)),flushAsyncTransactions:e(()=>this.flushAsyncTransactions()),setConditionalFormats:e(t=>this.setConditionalFormats(t)),getConditionalFormats:e(()=>this.getConditionalFormats()),openConditionalFormats:e(t=>{this.allow("conditional")&&this.formatDialog.open(t)}),askAssistant:e(t=>In(this,t,this.allow("assistant")?this.options.assistant:void 0)),openAssistant:e(()=>{this.allow("assistant")&&this.assistantPanel.open()}),getState:e(()=>this.getState()),setState:e((t,n)=>this.setState(t,n)),getScrollPosition:e(()=>this.renderer.getScroll()),setScrollPosition:e(t=>this.renderer.setScroll(t!=null?t:{})),syncScroll:e((t,n="both")=>this.syncScroll(t,n)),setTheme:e(t=>this.store.set({theme:t})),setLocale:e(t=>this.store.set({locale:st(t)})),setFont:e(t=>this.setFont(t)),setColumnVisible:e((t,n)=>this.setColumnsVisible([t],n)),autoSizeColumns:e(t=>this.autoSize(t)),resetColumnState:e(()=>this.resetColumns()),openColumnChooser:e(()=>this.chooser.open()),closeColumnChooser:e(()=>this.chooser.close()),toggleSideBar:e((t,n)=>{var r;this.allow("sideBar")&&((r=this.sideBar)==null||r.toggle(t,n))}),setSummary:e(t=>this.setSummary(t)),getSummaryValues:e(()=>this.summaryValues.map(t=>({...t}))),getRange:e(()=>{let t=this.store.state.range;return t&&{start:{...t.start},end:{...t.end}}}),setRange:e(t=>this.setRange(t)),getRanges:e(()=>this.getRanges()),setRanges:e(t=>this.setRanges(t)),copySelection:e(t=>this.copyToClipboard(!!(t!=null&&t.headers),!!(t!=null&&t.rows))),pasteText:e(t=>this.pasteText(t)),cutSelection:e(()=>this.cutToClipboard()),stopRowEdit:e(t=>this.editor.endRow(!t)),startEdit:e((t,n)=>this.editor.start(t,n)),stopEdit:e(t=>t?this.editor.cancel():void this.editor.commit(null)),addRows:e((t,n)=>this.addRows(t,n)),removeRows:e(t=>this.removeRows(t)),removeSelectedRows:e(()=>this.removeRows(this.selectedRows())),getModifiedRows:e(()=>this.getModifiedRows()),getChanges:e(()=>this.getChanges()),hasChanges:e(()=>this.hasChanges()),commitChanges:e(t=>this.commitChanges(t)),revertChanges:e(()=>this.revertChanges()),undo:e(()=>this.undo()),redo:e(()=>this.redo()),canUndo:e(()=>this.history.canUndo()),canRedo:e(()=>this.history.canRedo()),fillRange:e(t=>this.fillRange(t)),setPinnedRows:e(t=>this.setPinnedRows(t)),find:e(t=>this.allow("find")?this.finder.find(t):0),findNext:e(()=>this.finder.next()),findPrevious:e(()=>this.finder.previous()),clearFind:e(()=>this.finder.clear()),setGroupBy:e(t=>this.setGroupBy(t)),getGroupBy:e(()=>this.getGroupBy()),setGroupExpanded:e((t,n)=>this.setGroupExpanded(t,n)),expandAll:e(()=>this.expandAll(!0)),collapseAll:e(()=>this.expandAll(!1)),setDetailExpanded:e((t,n)=>this.setDetailExpanded(t,n)),isDetailExpanded:e(t=>this.isDetailExpanded(t)),moveRow:e((t,n)=>this.moveRow(t,n)),dropRow:e((t,n,r)=>this.dropRow(t,n,r)),setPage:e(t=>this.setPage(t)),getPage:e(()=>this.getPage()),getPageCount:e(()=>this.getPageCount()),setPageSize:e(t=>this.setPageSize(t)),getPageSize:e(()=>this.getPageSize()),refreshRows:e(()=>this.refreshRows()),setPivot:e(t=>this.setPivot(t)),getPivot:e(()=>this.getPivot()),createChart:e(t=>this.allow("charts")?this.charts.create(t):{el:C("div","fg-chart-body"),setType:()=>{},update:()=>{},destroy:()=>{}}),getCsv:e(t=>mo(this,t)),getJson:e(t=>go(this,t)),exportJson:e((t="export.json",n)=>We(t,[go(this,n)],"application/json;charset=utf-8")),exportCsv:e((t="export.csv",n)=>We(t,["\uFEFF",mo(this,n)],"text/csv;charset=utf-8")),getXlsx:e(t=>this.allow("excel")?wo(this,t):new Uint8Array(0)),exportXlsx:e((t="export.xlsx",n)=>{this.allow("excel")&&We(t,[wo(this,n)],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}),importFile:e((t,n)=>ci(this,t,n)),on:e((t,n)=>this.events.on(t,n)),destroy:()=>this.destroy()}}destroy(){if(!this.destroyed){this.destroyed=!0,Wt.delete(this.renderer.root),clearTimeout(this.flashTimer),clearTimeout(this.txTimer);for(let e of this.disposers)e();this.renderer.destroy(),this.events.clear()}}};function Ki(o,e){return new Do(o,e).api}function $o(o){let e=(Array.isArray(o)?o:[]).filter(t=>t&&t.grid&&typeof t.grid.getXlsxSheet=="function");return e.length?e.some(t=>{var n;return((n=Br(t.grid))==null?void 0:n.allow("workbook"))===!1})?new Uint8Array(0):Ve(e.map((t,n)=>{var r,i,s;return t.grid.getXlsxSheet({...t.options,sheetName:(s=(i=t.sheetName)!=null?i:(r=t.options)==null?void 0:r.sheetName)!=null?s:`Sheet${n+1}`})})):(V("buildWorkbook: no grids given; the file has one empty sheet"),Ve([{name:"Sheet1",rows:[]}]))}function _i(o,e){let t=$o(e);t.length&&We(o||"export.xlsx",[t],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}var El=o=>typeof o=="function"?o():o!=null?o:{};async function Xi(o,e,t,n){var c;let r=o,i=o.split(/[?#]/)[0],s={method:e,credentials:(c=n.credentials)!=null?c:"same-origin",headers:{Accept:"application/json",...El(n.headers)}};if(e==="GET"){let d=new URLSearchParams;for(let[u,f]of Object.entries(t))f!==void 0&&d.set(u,typeof f=="string"?f:JSON.stringify(f));r+=(o.includes("?")?"&":"?")+d.toString()}else s.headers["Content-Type"]="application/json",s.body=JSON.stringify(t);let a=await fetch(r,s);if(!a.ok)throw new Error(`HTTP ${a.status} from ${i}`);let l=await a.text();if(!l)return null;try{return JSON.parse(l)}catch{throw new Error(`HTTP ${a.status} from ${i}: the response is not JSON`)}}function Al(o){if(Array.isArray(o))return{rows:o};let e=o!=null?o:{},t=[e.rows,e.list,e.content,e.data,e.items,e.resultList].find(Array.isArray),n=[e.total,e.totalCount,e.totalElements,e.totCnt,e.count].find(r=>typeof r=="number");return{rows:(t!=null?t:[]).filter(r=>r!==null&&typeof r=="object"),total:n}}function Bo(o,e={}){return{async getRows(t){var s,a,l,c,d;let n=Math.max(1,t.end-t.start),r={start:t.start,end:t.end,page:Math.floor(t.start/n),size:n,sort:t.sort,filters:t.filters,quickFilter:t.quickFilter,advancedFilter:(s=t.advancedFilter)!=null?s:void 0,groupBy:t.groupBy,groupKeys:t.groupKeys,...(l=(a=e.params)==null?void 0:a.call(e))!=null?l:{}},i=await Xi(o,(c=e.method)!=null?c:"POST",r,e);return((d=e.transform)!=null?d:Al)(i)}}}var No=new WeakMap;function Ji(o,e,t={}){let n=No.get(o);if(n)return n;if(!o.hasChanges())return Promise.resolve(null);let{created:r,updated:i,deleted:s}=o.getModifiedRows(),a=new Map([...r,...i].map(c=>[c,{...c}])),l=(async()=>{var d,u;let c=await Xi(e,"POST",{created:r,updated:i,deleted:s,...(u=(d=t.params)==null?void 0:d.call(t))!=null?u:{}},t);return o.commitChanges({rows:a,deleted:s}),c})().finally(()=>No.delete(o));return No.set(o,l),l}var Oo=new WeakMap;async function Yi(o,e,t={}){var i,s;let n=((i=Oo.get(o))!=null?i:0)+1;Oo.set(o,n);let{rows:r}=await Bo(e,t).getRows({start:0,end:(s=t.maxRows)!=null?s:1e4,sort:[],filters:{},quickFilter:""});return Oo.get(o)===n&&o.setData(r),r}function Zi(o=document){var n,r;let e=(n=o.querySelector('meta[name="_csrf"]'))==null?void 0:n.content,t=((r=o.querySelector('meta[name="_csrf_header"]'))==null?void 0:r.content)||"X-CSRF-TOKEN";return e?{[t]:e}:{}}var Qi=["add","update","remove","upsert"];function Ho(o){let e=o;if(typeof e=="string"){if(!e.trim())return null;e=JSON.parse(e)}if(Array.isArray(e))return{upsert:e.filter(n=>n&&typeof n=="object")};if(!e||typeof e!="object")return null;let t=e;return Qi.some(n=>Array.isArray(t[n]))?t:Array.isArray(t.rows)?{rows:t.rows}:null}function es(o,e){let t=e!=null?e:{},n="connecting",r=!1,i=!1,s=[],a=null,l=0,c=0,d=w=>{var m;if(n!==w){n=w;try{(m=t.onStatus)==null||m.call(t,w)}catch{}}},u=w=>{"rows"in w&&Array.isArray(w.rows)&&!Qi.some(m=>m in w)?(o.flushAsyncTransactions(),o.setData(w.rows)):t.immediate?o.applyTransaction(w):o.applyTransactionAsync(w)},f=w=>{if(r)return;let m;try{m=t.parse?t.parse(w):Ho(w),Array.isArray(m)&&(m={upsert:m})}catch(y){t.onError?t.onError(y):V("connectLive: a message could not be read");return}!m||typeof m!="object"||(i?s.push(m):u(m))},p=()=>{if(r||t.reconnect===!1){d("closed");return}let w=typeof t.maxDelay=="number"&&t.maxDelay>0?t.maxDelay:3e4,m=Math.min(w,500*2**Math.min(c++,10))*(.8+Math.random()*.4);d("connecting"),l=window.setTimeout(h,m)},h=()=>{if(r)return;if(l=0,t.poll){g();return}let w=t.url;if(!w){V("connectLive: give a url or a poll function"),d("error");return}d(i?"paused":"connecting");try{if(/^wss?:/i.test(w)){if(typeof WebSocket=="undefined")throw new Error("no WebSocket");let m=new WebSocket(w,t.protocols);a=m,m.onopen=()=>{c=0,d(i?"paused":"open")},m.onmessage=y=>f(y.data),m.onerror=()=>d("error"),m.onclose=()=>{a===m&&(a=null),r||p()}}else{if(typeof EventSource=="undefined")throw new Error("no EventSource");let m=new EventSource(w,{withCredentials:!!t.withCredentials});a=m,m.onopen=()=>{c=0,d(i?"paused":"open")},m.addEventListener(t.event||"message",y=>f(y.data)),m.onerror=()=>{m.readyState===2?(a===m&&(a=null),r||p()):d("connecting")}}}catch{d("error"),p()}},g=async()=>{if(!r)try{let w=await t.poll();if(r)return;c=0,d(i?"paused":"open"),f(w);let m=typeof t.interval=="number"&&t.interval>0?t.interval:2e3;l=window.setTimeout(g,m)}catch{if(r)return;d("error"),p()}};return h(),{get status(){return n},pause(){r||i||(i=!0,d("paused"))},resume(){if(r||!i)return;i=!1;let w=s;s=[];for(let m of w)u(m);d(a||t.poll?"open":"connecting")},close(){r||(r=!0,clearTimeout(l),a==null||a.close(),a=null,s=[],d("closed"))},send(w){let m=a;return!m||typeof m.send!="function"||m.readyState!==1?!1:(m.send(w),!0)}}}var ts={en:he,ko:_o,"zh-CN":Xo,"zh-TW":Jo,ja:Ko,es:jo,fr:Uo,de:Wo,vi:Yo,th:Zo,id:Qo,ru:er,"pt-BR":tr,it:nr};for(let o of Object.values(ts))Et(o);return as(Tl);})();