@protobase/ui 0.33.0 → 0.33.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.
Files changed (46) hide show
  1. package/dist/app/embedded-list/embedded-list.js +3 -3
  2. package/dist/app/pages/blocks/record-cards.js +40 -0
  3. package/dist/app/pages/render-node.js +2 -0
  4. package/dist/app/record-row/record-row-body.js +1 -1
  5. package/dist/app/related-cards/related-cards.js +1 -1
  6. package/dist/app/related-section.js +1 -1
  7. package/dist/package.js +1 -1
  8. package/dist/record-view/section.d.ts +6 -3
  9. package/dist/record-view/section.js +30 -23
  10. package/dist/shell/assets/app-X2Wyy7W8.js +70 -0
  11. package/dist/shell/assets/cn-Bi0ZEjD9.js +2 -1
  12. package/dist/shell/assets/export-worker-ClACk00b.js +2 -1
  13. package/dist/shell/assets/{index-CmfQ3unE.js → index-BCtzf5Eb.js} +3 -2
  14. package/dist/shell/assets/jsx-runtime-NZYk81nU.js +2 -1
  15. package/dist/shell/assets/maplibre-DUTS_eJM.js +2 -1
  16. package/dist/shell/assets/maplibre-gl-worker-Bh1S--WG.js +2 -1
  17. package/dist/shell/assets/markdown-content-CtGUP4W6.js +2 -1
  18. package/dist/shell/assets/parse-worker-UhbwEjS0.js +2 -1
  19. package/dist/shell/assets/preload-helper-BZ3hrQDD.js +2 -1
  20. package/dist/shell/assets/prod-YZ9ZMG1O.js +2 -1
  21. package/dist/shell/assets/react-Cvdyeg_0.js +2 -1
  22. package/dist/shell/assets/react-dom-B-VxWsjA.js +2 -1
  23. package/dist/shell/assets/record-map-DFy7sJEU.js +2 -1
  24. package/dist/shell/assets/{records-map-NbikCL0c.js → records-map-DGUs88l5.js} +2 -1
  25. package/dist/shell/assets/{shared-protobase-ui-DF9YzkJs.js → shared-protobase-ui-CPW_DMX5.js} +2 -1
  26. package/dist/shell/index.html +3 -3
  27. package/dist/shell/protobase.shell.json +1 -1
  28. package/dist/shell/protobase.sw.js +2 -2
  29. package/dist/shell-source-maps/assets/app-X2Wyy7W8.js.map +1 -0
  30. package/dist/shell-source-maps/assets/cn-Bi0ZEjD9.js.map +1 -0
  31. package/dist/shell-source-maps/assets/export-worker-ClACk00b.js.map +1 -0
  32. package/dist/shell-source-maps/assets/index-BCtzf5Eb.js.map +1 -0
  33. package/dist/shell-source-maps/assets/jsx-runtime-NZYk81nU.js.map +1 -0
  34. package/dist/shell-source-maps/assets/maplibre-DUTS_eJM.js.map +1 -0
  35. package/dist/shell-source-maps/assets/maplibre-gl-worker-Bh1S--WG.js.map +1 -0
  36. package/dist/shell-source-maps/assets/markdown-content-CtGUP4W6.js.map +1 -0
  37. package/dist/shell-source-maps/assets/parse-worker-UhbwEjS0.js.map +1 -0
  38. package/dist/shell-source-maps/assets/preload-helper-BZ3hrQDD.js.map +1 -0
  39. package/dist/shell-source-maps/assets/prod-YZ9ZMG1O.js.map +1 -0
  40. package/dist/shell-source-maps/assets/react-Cvdyeg_0.js.map +1 -0
  41. package/dist/shell-source-maps/assets/react-dom-B-VxWsjA.js.map +1 -0
  42. package/dist/shell-source-maps/assets/record-map-DFy7sJEU.js.map +1 -0
  43. package/dist/shell-source-maps/assets/records-map-DGUs88l5.js.map +1 -0
  44. package/dist/shell-source-maps/assets/shared-protobase-ui-CPW_DMX5.js.map +1 -0
  45. package/package.json +6 -6
  46. package/dist/shell/assets/app-s0iA9x1p.js +0 -69
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-worker-UhbwEjS0.js","names":["message","message","fallback","activeLocale","setFallbackLocale","locale","delimiters","detectDelimiter","counts","delimiter","quoted","char","headerLine","entry","best","firstLine","index","text","createCsvParser","given","pending","started","field","row","quoteSeen","crSeen","rowStarted","endField","endRow","rows","consume","push","chunk","header","values","message","catalogue","id","plural","count","name","fields","line","size","cell","dayFirst","singular","named","found","part","method","letters","entities","decodeXml","whole","attributes","match","runsText","xml","run","sharedStrings","workbookSheets","targets","relsXml","Id","Target","sheets","workbookXml","path","pr","builtInDates","isDateFormat","code","dateStyles","custom","numFmtId","formatCode","cellXfs","styles","pad","value","serialDate","days","date1904","serial","at","date","columnIndex","ref","cellValue","type","attrs","body","raw","context","number","parseRow","open","previous","cells","column","createRowScanner","buffer","end","bytesOf","blob","start","notZip","endRecordAt","view","zipEntries","tailStart","tail","directory","decoder","entries","nameLength","extraLength","commentLength","zipEntryStream","local","dataStart","zipTextChunks","reader","done","zipText","parts","openWorkbook","sheetContext","sheet","candidate","shared","scan","startsAsZip","head","file","sheetFormat","extension","sheetNames","notText","csvRows","parser","decode","bytes","error","numbered","sheetRows","workbook","scope","reply","next","read","request","asked","resolve","handle","event"],"sources":["../../src/locale/active-locale.ts","../../src/app/import/csv-parser.ts","../../src/locale/messages.ts","../../src/app/import/messages.ts","../../src/app/import/xlsx-xml.ts","../../src/app/import/zip-reader.ts","../../src/app/import/xlsx-reader.ts","../../src/app/import/sheet-file.ts","../../src/app/import/parse-worker.ts"],"sourcesContent":["import { pickLocale, type Locale } from '@protobase/schema/internal'\n\n// The built-in screens read one locale, so plain functions (formats, messages) need no context: the app's when its\n// `/meta` names one, else the fallback the app starts with, the browser's language unless given. Both only ever get\n// set to what the app decides on each render, so a part of the tree that renders later never sees another one.\nlet fallback: Locale = 'en'\nlet app: Locale | undefined\n\n/** The language the screens are in now. */\nexport const activeLocale = (): Locale => app ?? fallback\n\n/** The language the screens are in when the app sets none: the browser's, or the one the app was given. */\nexport const setFallbackLocale = (locale: Locale) => {\n fallback = locale\n}\n\n/** The language the app sets for everyone, from its `/meta`; undefined when it sets none. */\nexport const setAppLocale = (locale: Locale | undefined) => {\n app = locale\n}\n\n/** The browser's language when the screens come in it, else English. */\nexport const browserLocale = (languages = globalThis.navigator?.languages ?? []) => pickLocale(languages)\n\n// The language tag numbers and dates are written with: English as in Ireland and Britain (`6 Oct 2026`, `1,234.5`).\nconst formatTags: Record<Locale, string> = { en: 'en-GB', nl: 'nl-NL' }\n\n/** The language tag `Intl` formats numbers and dates with, for the active locale. */\nexport const formatTag = () => formatTags[activeLocale()]\n","const delimiters = [',', ';', '\\t'] as const\n\n/**\n * The delimiter of a CSV's header line: whichever of comma, semicolon and tab it holds most often outside quotes, a\n * comma when it holds none (a file of one column).\n */\nexport const detectDelimiter = (headerLine: string) => {\n const counts = new Map<string, number>(delimiters.map((delimiter) => [delimiter, 0]))\n let quoted = false\n for (const char of headerLine) {\n if (char === '\"') quoted = !quoted\n else if (!quoted && counts.has(char)) counts.set(char, counts.get(char)! + 1)\n }\n return [...counts].reduce((best, entry) => (entry[1] > best[1] ? entry : best), [',', 0] as [string, number])[0]\n}\n\n// The header line of the text so far, up to its first line break outside quotes; undefined while it has none.\nconst firstLine = (text: string) => {\n let quoted = false\n for (let index = 0; index < text.length; index++) {\n const char = text[index]\n if (char === '\"') quoted = !quoted\n else if (!quoted && (char === '\\n' || char === '\\r')) return text.slice(0, index)\n }\n return undefined\n}\n\n/**\n * A CSV parser fed text a chunk at a time (RFC 4180: quoted fields with `\"\"` for a quote and line breaks inside, CRLF,\n * LF or CR between rows), so a large file is read without holding it whole. `push` returns the rows completed by the\n * chunk, `end` the last one. The delimiter is the header line's (`detectDelimiter`) unless given; a byte order mark at\n * the start is dropped.\n */\nexport const createCsvParser = (given?: string) => {\n let delimiter = given\n let pending = ''\n let started = false\n let field = ''\n let row: string[] = []\n let quoted = false\n // A quote inside a quoted field: the field's end, or the first of a `\"\"` pair\n let quoteSeen = false\n // A CR ended the row: an LF straight after it belongs to the same line break\n let crSeen = false\n // Whether the current row has anything yet, so the line break ending the file makes no row of its own\n let rowStarted = false\n\n const endField = () => {\n row.push(field)\n field = ''\n }\n const endRow = (rows: string[][]) => {\n endField()\n rows.push(row)\n row = []\n rowStarted = false\n }\n\n const consume = (text: string) => {\n const rows: string[][] = []\n for (const char of text) {\n if (crSeen) {\n crSeen = false\n if (char === '\\n') continue\n }\n if (quoted) {\n if (quoteSeen) {\n quoteSeen = false\n if (char === '\"') {\n field += '\"'\n continue\n }\n quoted = false\n } else if (char === '\"') {\n quoteSeen = true\n continue\n } else {\n field += char\n continue\n }\n }\n if (char === '\"' && field === '') {\n quoted = true\n rowStarted = true\n } else if (char === delimiter) {\n endField()\n rowStarted = true\n } else if (char === '\\n' || char === '\\r') {\n crSeen = char === '\\r'\n endRow(rows)\n } else {\n field += char\n rowStarted = true\n }\n }\n return rows\n }\n\n const push = (chunk: string) => {\n if (started) return consume(chunk)\n pending += chunk\n if (pending.charCodeAt(0) === 0xfeff) pending = pending.slice(1)\n const header = firstLine(pending)\n if (header === undefined) return []\n started = true\n delimiter ??= detectDelimiter(header)\n const text = pending\n pending = ''\n return consume(text)\n }\n\n const end = () => {\n const rows = started ? [] : push('\\n')\n if (quoteSeen) {\n quoteSeen = false\n quoted = false\n }\n if (rowStarted || field !== '') endRow(rows)\n return rows\n }\n\n return { push, end, delimiter: () => delimiter }\n}\n","import type { Locale } from '@protobase/schema/internal'\nimport { activeLocale } from './active-locale'\n\n/** A built-in text: fixed, or made from the values it names, such as a count. */\ntype Message = string | ((...values: never[]) => string)\n\n/** A translation of `M`: every message of it, taking the same values. */\nexport type Translation<M extends Record<string, Message>> = { [K in keyof M]: M[K] extends string ? string : M[K] }\n\ntype Values<T> = T extends (...values: infer V) => string ? V : []\n\n/**\n * An area's built-in texts in every language the screens come in, keyed by id: the lookup returns the one for the\n * active locale, `text('search')` or `text('rows', 3)`. Dutch must translate every English text, which the types check.\n */\nexport const defineMessages = <M extends Record<string, Message>>(catalogue: { en: M } & Record<Exclude<Locale, 'en'>, Translation<M>>) =>\n <K extends keyof M>(id: K, ...values: Values<M[K]>): string => {\n const message = (catalogue[activeLocale()] as M)[id]\n return typeof message === 'function' ? (message as (...values: unknown[]) => string)(...values) : (message as string)\n }\n","import { defineMessages } from '../../locale/messages'\n\nexport const text = defineMessages({\n en: {\n import: 'Import',\n importPlural: (plural: string) => `Import ${plural.toLowerCase()}`,\n couldNotReadFile: 'Could not read the file',\n couldNotCheck: 'Could not check the rows',\n cancel: 'Cancel',\n next: 'Next',\n checkRows: 'Check rows',\n back: 'Back',\n checking: 'Checking',\n importRows: (count: string, rows: number) => `Import ${count} ${rows === 1 ? 'row' : 'rows'}`,\n cancelImport: 'Cancel import',\n done: 'Done',\n file: 'File',\n fileHint: 'An Excel workbook (.xlsx) or a CSV file saved as UTF-8. Its first row names the columns.',\n reading: (name: string) => `Reading ${name}…`,\n theFile: 'the file',\n sheet: 'Sheet',\n create: 'Create',\n update: 'Update',\n upsert: 'Create or update',\n createHint: 'Each row creates a record.',\n updateHint: 'Each row updates the record its value finds; a row that finds none is not imported.',\n upsertHint: 'Each row updates the record its value finds, or creates one when it finds none.',\n doNotImport: 'Do not import',\n rows: 'Rows',\n whatEachRowDoes: 'What each row does',\n findBy: 'Find records by',\n chooseField: 'Choose a field',\n findByHint: 'A field no two records share, such as the key or an email.',\n foundInColumn: 'Found in column',\n chooseColumn: 'Choose a column',\n numbers: 'Numbers',\n dates: 'Dates',\n dayFirst: 'Day first (31/12/2026)',\n monthFirst: 'Month first (12/31/2026)',\n datesHint: 'Dates written as 2026-12-31 read the same either way. Times without a zone are your own time.',\n requiredMarked: 'New records need the fields marked *.',\n columns: 'Columns',\n emptyInFirstRows: 'Empty in the first rows',\n field: 'Field',\n fieldFor: (name: string) => `Field for ${name}`,\n foundBy: 'Found by',\n pluralFoundBy: (plural: string) => `${plural} found by`,\n noColumnFills: (fields: string) => `No column fills ${fields}, which new records need.`,\n rowsNotImported: 'Rows not imported',\n rowProblems: (line: number) => `Row ${line}:`,\n andMore: (count: string) => `And ${count} more rows, all in the file.`,\n checkingRows: (count: string) => `Checking rows… ${count} read`,\n check: 'Check',\n toCreate: 'To create',\n toUpdate: 'To update',\n withProblems: 'With problems',\n firstRows: 'First rows',\n row: 'Row',\n problemRows: 'Rows with problems, which are skipped',\n download: 'Download',\n batches: (size: number) => `Rows are saved in batches of ${size}. Cancelling, or an error, keeps the batches already saved; a row the server refuses is listed and the others are saved.`,\n stopping: 'Stopping after this batch…',\n saving: 'Saving rows…',\n rowsSaved: 'Rows saved',\n stopped: 'The import stopped. The rows counted below were saved.',\n cancelled: 'Cancelled. The rows counted below were saved.',\n summary: 'Import summary',\n created: 'Created',\n updated: 'Updated',\n skipped: 'Skipped',\n failed: 'Failed',\n notWrittenHint: 'Skipped rows had problems in the file; the server refused the failed ones. The file holds each with the reason, to fix and import again.',\n notImportedFile: (name: string) => `${name} - not imported.csv`,\n line: 'Line',\n problems: 'Problems',\n notNumber: (cell: string) => `${cell} is not a number`,\n notWholeNumber: (cell: string) => `${cell} is not a whole number`,\n tooLarge: (cell: string) => `${cell} is too large`,\n notBoolean: (cell: string) => `${cell} is not true or false (true, false, yes, no, 1 or 0)`,\n notDate: (cell: string, dayFirst: boolean) => `${cell} is not a date (2026-04-03 or ${dayFirst ? 'day/month/year' : 'month/day/year'})`,\n hasTime: (cell: string) => `${cell} has a time of day; the field holds a date`,\n severalValues: (cell: string, values: string) => `${cell} matches more than one value: ${values}`,\n notOneOf: (cell: string, values: string) => `${cell} is not one of ${values}`,\n notText: (cell: string) => `${cell} is true or false, not text`,\n emptyRequired: 'is empty, and it is required',\n noneHas: (singular: string, named: string) => `no ${singular.toLowerCase()} has ${named}`,\n severalHave: (count: number, plural: string, named: string) => `${count} ${plural.toLowerCase()} have ${named}`,\n notOneRecord: (found: string) => `Not one record: ${found}`,\n nothingToUpdate: (found: string) => `Nothing to update: ${found}`,\n fileNotUtf8: 'The file is not UTF-8 text. Save it as \"CSV UTF-8\" and choose it again.',\n noSheets: 'The workbook has no sheets',\n missingSheetPart: 'The workbook names a sheet it does not hold',\n notZip: 'The file is not an Excel workbook (.xlsx): it is no ZIP archive',\n zip64: 'The workbook is too large to read: it is a ZIP64 archive',\n compression: (part: string, method: number) => `The workbook's part ${part} is compressed in a way that cannot be read (method ${method})`,\n notWorkbook: (part: string) => `The file is not an Excel workbook (.xlsx): it has no ${part}`,\n noSheetCalled: (name: string) => `The workbook has no sheet called ${name}`,\n unreadable: 'The file could not be read',\n column: (letters: string) => `Column ${letters}`,\n },\n nl: {\n import: 'Importeren',\n importPlural: (plural: string) => `${plural} importeren`,\n couldNotReadFile: 'Kon het bestand niet lezen',\n couldNotCheck: 'Kon de rijen niet controleren',\n cancel: 'Annuleren',\n next: 'Volgende',\n checkRows: 'Rijen controleren',\n back: 'Terug',\n checking: 'Controleren',\n importRows: (count: string, rows: number) => `${count} ${rows === 1 ? 'rij' : 'rijen'} importeren`,\n cancelImport: 'Import annuleren',\n done: 'Klaar',\n file: 'Bestand',\n fileHint: 'Een Excel-werkmap (.xlsx) of een CSV-bestand bewaard als UTF-8. De eerste rij noemt de kolommen.',\n reading: (name: string) => `${name} lezen…`,\n theFile: 'het bestand',\n sheet: 'Werkblad',\n create: 'Maken',\n update: 'Bijwerken',\n upsert: 'Maken of bijwerken',\n createHint: 'Elke rij maakt een record.',\n updateHint: 'Elke rij werkt het record bij dat haar waarde vindt; een rij die er geen vindt, wordt niet geïmporteerd.',\n upsertHint: 'Elke rij werkt het record bij dat haar waarde vindt, of maakt er een als ze er geen vindt.',\n doNotImport: 'Niet importeren',\n rows: 'Rijen',\n whatEachRowDoes: 'Wat elke rij doet',\n findBy: 'Records vinden op',\n chooseField: 'Kies een veld',\n findByHint: 'Een veld dat geen twee records delen, zoals de sleutel of een e-mailadres.',\n foundInColumn: 'Gevonden in kolom',\n chooseColumn: 'Kies een kolom',\n numbers: 'Getallen',\n dates: 'Datums',\n dayFirst: 'Dag eerst (31/12/2026)',\n monthFirst: 'Maand eerst (12/31/2026)',\n datesHint: 'Datums geschreven als 2026-12-31 lezen hoe dan ook hetzelfde. Tijden zonder zone zijn in je eigen tijd.',\n requiredMarked: 'Nieuwe records hebben de velden met * nodig.',\n columns: 'Kolommen',\n emptyInFirstRows: 'Leeg in de eerste rijen',\n field: 'Veld',\n fieldFor: (name: string) => `Veld voor ${name}`,\n foundBy: 'Gevonden op',\n pluralFoundBy: (plural: string) => `${plural} gevonden op`,\n noColumnFills: (fields: string) => `Geen kolom vult ${fields}, wat nieuwe records nodig hebben.`,\n rowsNotImported: 'Niet geïmporteerde rijen',\n rowProblems: (line: number) => `Rij ${line}:`,\n andMore: (count: string) => `En nog ${count} rijen, allemaal in het bestand.`,\n checkingRows: (count: string) => `Rijen controleren… ${count} gelezen`,\n check: 'Controle',\n toCreate: 'Te maken',\n toUpdate: 'Bij te werken',\n withProblems: 'Met problemen',\n firstRows: 'Eerste rijen',\n row: 'Rij',\n problemRows: 'Rijen met problemen, die worden overgeslagen',\n download: 'Downloaden',\n batches: (size: number) => `Rijen worden bewaard in groepen van ${size}. Annuleren, of een fout, houdt de groepen die al bewaard zijn; een rij die de server weigert, wordt vermeld en de andere worden bewaard.`,\n stopping: 'Stoppen na deze groep…',\n saving: 'Rijen bewaren…',\n rowsSaved: 'Bewaarde rijen',\n stopped: 'De import is gestopt. De rijen die hieronder zijn geteld, zijn bewaard.',\n cancelled: 'Geannuleerd. De rijen die hieronder zijn geteld, zijn bewaard.',\n summary: 'Samenvatting van de import',\n created: 'Gemaakt',\n updated: 'Bijgewerkt',\n skipped: 'Overgeslagen',\n failed: 'Mislukt',\n notWrittenHint: 'Overgeslagen rijen hadden problemen in het bestand; de mislukte weigerde de server. Het bestand bevat elke rij met de reden, om te verbeteren en opnieuw te importeren.',\n notImportedFile: (name: string) => `${name} - niet geïmporteerd.csv`,\n line: 'Regel',\n problems: 'Problemen',\n notNumber: (cell: string) => `${cell} is geen getal`,\n notWholeNumber: (cell: string) => `${cell} is geen geheel getal`,\n tooLarge: (cell: string) => `${cell} is te groot`,\n notBoolean: (cell: string) => `${cell} is niet waar of onwaar (true, false, yes, no, 1 of 0)`,\n notDate: (cell: string, dayFirst: boolean) => `${cell} is geen datum (2026-04-03 of ${dayFirst ? 'dag/maand/jaar' : 'maand/dag/jaar'})`,\n hasTime: (cell: string) => `${cell} heeft een tijd van de dag; het veld bevat een datum`,\n severalValues: (cell: string, values: string) => `${cell} past bij meer dan één waarde: ${values}`,\n notOneOf: (cell: string, values: string) => `${cell} is niet een van ${values}`,\n notText: (cell: string) => `${cell} is waar of onwaar, geen tekst`,\n emptyRequired: 'is leeg, en is verplicht',\n noneHas: (singular: string, named: string) => `geen ${singular.toLowerCase()} heeft ${named}`,\n severalHave: (count: number, plural: string, named: string) => `${count} ${plural.toLowerCase()} hebben ${named}`,\n notOneRecord: (found: string) => `Niet één record: ${found}`,\n nothingToUpdate: (found: string) => `Niets om bij te werken: ${found}`,\n fileNotUtf8: 'Het bestand is geen UTF-8-tekst. Bewaar het als \"CSV UTF-8\" en kies het opnieuw.',\n noSheets: 'De werkmap heeft geen werkbladen',\n missingSheetPart: 'De werkmap noemt een werkblad dat er niet in zit',\n notZip: 'Het bestand is geen Excel-werkmap (.xlsx): het is geen ZIP-archief',\n zip64: 'De werkmap is te groot om te lezen: het is een ZIP64-archief',\n compression: (part: string, method: number) => `Het deel ${part} van de werkmap is gecomprimeerd op een manier die niet kan worden gelezen (methode ${method})`,\n notWorkbook: (part: string) => `Het bestand is geen Excel-werkmap (.xlsx): het heeft geen ${part}`,\n noSheetCalled: (name: string) => `De werkmap heeft geen werkblad met de naam ${name}`,\n unreadable: 'Het bestand kon niet worden gelezen',\n column: (letters: string) => `Kolom ${letters}`,\n },\n})\n","import type { SheetCell, SheetRow } from './sheet-cell'\nimport { text as message } from './messages'\n\n// The parts of an .xlsx's XML that an import reads: the sheets' names and files, the shared strings, which cell styles\n// are dates, and the rows of a sheet, read with patterns over the text since a Web Worker has no DOMParser.\n\nconst entities: Record<string, string> = { amp: '&', lt: '<', gt: '>', quot: '\"', apos: \"'\" }\n\n/** The text with XML's entities and character references replaced by what they stand for. */\nexport const decodeXml = (text: string) =>\n text.replace(/&(#x[0-9a-f]+|#\\d+|amp|lt|gt|quot|apos);/gi, (whole, name: string) => {\n if (name[0] !== '#') return entities[name.toLowerCase()] ?? whole\n return String.fromCodePoint(name[1] === 'x' || name[1] === 'X' ? parseInt(name.slice(2), 16) : Number(name.slice(1)))\n })\n\n/** An element's attributes, by name without their namespace prefix. */\nexport const attributes = (text: string) => {\n const found: Record<string, string> = {}\n for (const match of text.matchAll(/([\\w:.-]+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')/g)) {\n const name = match[1]!.slice(match[1]!.indexOf(':') + 1)\n found[name] = decodeXml(match[2] ?? match[3] ?? '')\n }\n return found\n}\n\n// The text of every <t> in a string item or inline string, without the phonetic runs (<rPh>) shown above the text\nconst runsText = (xml: string) =>\n xml\n .replace(/<rPh\\b[\\s\\S]*?<\\/rPh>/g, '')\n .match(/<t\\b[^>]*>[\\s\\S]*?<\\/t>/g)\n ?.map((run) => decodeXml(run.replace(/^<t\\b[^>]*>|<\\/t>$/g, '')))\n .join('') ?? ''\n\n/** The workbook's shared strings (xl/sharedStrings.xml), which text cells point at by index. */\nexport const sharedStrings = (xml: string) => [...xml.matchAll(/<si\\b[^>]*?(?:\\/>|>([\\s\\S]*?)<\\/si>)/g)].map((match) => runsText(match[1] ?? ''))\n\nexport type WorkbookSheet = { name: string; path: string }\n\n/**\n * The workbook's sheets in order, each with the path of its part in the archive, from xl/workbook.xml and its\n * relationships (xl/_rels/workbook.xml.rels); `date1904` when its dates count from 1904, as old Mac workbooks do.\n */\nexport const workbookSheets = (workbookXml: string, relsXml: string) => {\n const targets = new Map(\n [...relsXml.matchAll(/<Relationship\\b([^>]*)>/g)].map((match) => {\n const { Id, Target } = attributes(match[1]!)\n return [Id, Target!.startsWith('/') ? Target!.slice(1) : `xl/${Target}`] as const\n }),\n )\n const sheets: WorkbookSheet[] = [...workbookXml.matchAll(/<sheet\\b([^>]*)>/g)].map((match) => {\n const { name, id } = attributes(match[1]!)\n const path = targets.get(id)\n if (!name || !path) throw new Error(message('missingSheetPart'))\n return { name, path }\n })\n const pr = /<workbookPr\\b([^>]*)>/.exec(workbookXml)\n const date1904 = pr ? ['1', 'true'].includes(attributes(pr[1]!).date1904 ?? '') : false\n return { sheets, date1904 }\n}\n\n// Excel's built-in number formats that show dates and times\nconst builtInDates = new Set([14, 15, 16, 17, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58])\n\n/** Whether a number format shows a date or time: it has d, m, y, h or s outside quoted text, colours and escapes. */\nexport const isDateFormat = (code: string) => /[dmyhs]/i.test(code.replace(/\"[^\"]*\"|\\[[^\\]]*\\]|\\\\.|_.|\\*./g, ''))\n\n/** The indexes of the cell styles (xl/styles.xml's cellXfs) whose number format is a date or time. */\nexport const dateStyles = (xml: string) => {\n const custom = new Map([...xml.matchAll(/<numFmt\\b([^>]*)>/g)].map((match) => {\n const { numFmtId, formatCode } = attributes(match[1]!)\n return [Number(numFmtId), formatCode ?? ''] as const\n }))\n const cellXfs = /<cellXfs\\b[^>]*>([\\s\\S]*?)<\\/cellXfs>/.exec(xml)?.[1] ?? ''\n const styles = new Set<number>()\n ;[...cellXfs.matchAll(/<xf\\b([^>]*)>/g)].forEach((match, index) => {\n const id = Number(attributes(match[1]!).numFmtId ?? 0)\n if (builtInDates.has(id) || (custom.has(id) && isDateFormat(custom.get(id)!))) styles.add(index)\n })\n return styles\n}\n\nconst pad = (value: number) => String(value).padStart(2, '0')\n\n/**\n * A date cell's wall-clock time from its serial number, the days since the workbook's epoch: a date when it has no time\n * of day (`2026-03-01`), else to the second (`2026-03-01T14:30:00`). Excel's 1900 calendar counts a 29 February 1900\n * that never was, so serials before it are a day ahead.\n */\nexport const serialDate = (serial: number, date1904 = false) => {\n const days = date1904 ? serial + 1462 : serial < 60 ? serial + 1 : serial\n const at = new Date(Date.UTC(1899, 11, 30) + Math.round(days * 86400) * 1000)\n const date = `${at.getUTCFullYear()}-${pad(at.getUTCMonth() + 1)}-${pad(at.getUTCDate())}`\n const seconds = at.getUTCHours() * 3600 + at.getUTCMinutes() * 60 + at.getUTCSeconds()\n return seconds === 0 ? date : `${date}T${pad(at.getUTCHours())}:${pad(at.getUTCMinutes())}:${pad(at.getUTCSeconds())}`\n}\n\n/** The 0-based column of a cell reference: `A1` is 0, `AB7` is 27. */\nexport const columnIndex = (ref: string) => {\n let index = 0\n for (const char of ref.toUpperCase()) {\n const code = char.charCodeAt(0)\n if (code < 65 || code > 90) break\n index = index * 26 + (code - 64)\n }\n return index - 1\n}\n\nexport type SheetContext = { strings: string[]; dates: Set<number>; date1904: boolean }\n\nconst cellValue = (attrs: Record<string, string>, body: string, context: SheetContext): SheetCell => {\n const type = attrs.t ?? 'n'\n if (type === 'inlineStr') return runsText(body)\n const raw = /<v\\b[^>]*>([\\s\\S]*?)<\\/v>/.exec(body)?.[1]\n if (raw === undefined) return null\n const value = decodeXml(raw)\n if (type === 's') return context.strings[Number(value)] ?? null\n if (type === 'b') return value === '1'\n if (type === 'str' || type === 'e') return value\n if (type === 'd') return { date: value.replace(/Z$/, '') }\n const number = Number(value)\n return context.dates.has(Number(attrs.s ?? 0)) ? { date: serialDate(number, context.date1904) } : number\n}\n\n/** One `<row>` element as a row of cells, each at its column; a row without a number follows `previous`. */\nexport const parseRow = (xml: string, context: SheetContext, previous: number): SheetRow => {\n const open = /^<row\\b([^>]*)>/.exec(xml)\n const line = Number(attributes(open?.[1] ?? '').r ?? previous + 1)\n const cells: SheetCell[] = []\n for (const match of xml.matchAll(/<c\\b([^>]*?)(?:\\/>|>([\\s\\S]*?)<\\/c>)/g)) {\n const attrs = attributes(match[1]!)\n const column = attrs.r ? columnIndex(attrs.r) : cells.length\n while (cells.length < column) cells.push(null)\n cells[column] = cellValue(attrs, match[2] ?? '', context)\n }\n return { line, cells }\n}\n\n/**\n * A scanner fed a sheet's XML a chunk at a time, which returns the `<row>` elements each chunk completes, so a large\n * sheet is read without holding its text whole.\n */\nexport const createRowScanner = () => {\n let buffer = ''\n return (chunk: string) => {\n buffer += chunk\n const rows: string[] = []\n let end = 0\n for (const match of buffer.matchAll(/<row\\b[^>]*?(?:\\/>|>[\\s\\S]*?<\\/row>)/g)) {\n rows.push(match[0])\n end = match.index + match[0].length\n }\n buffer = buffer.slice(end)\n return rows\n }\n}\n","\nimport { text as message } from './messages'\n\n// A reader of ZIP archives (an .xlsx is one) that reads the parts of the file it needs, so a large workbook is never\n// held whole: the central directory at the end, then each entry's bytes, inflated as they stream with the platform's\n// DecompressionStream.\n\nexport type ZipEntry = { name: string; method: number; offset: number; size: number }\n\nconst endSignature = 0x06054b50\nconst entrySignature = 0x02014b50\nconst localSignature = 0x04034b50\n// The end record is 22 bytes, followed by a comment of at most 65,535\nconst endSearch = 22 + 0xffff\n\nconst bytesOf = async (blob: Blob, start: number, end: number) => new DataView(await blob.slice(start, end).arrayBuffer())\n\nconst notZip = () => new Error(message('notZip'))\n\n// The offset of the end of central directory record in `view`, searching back from the end.\nconst endRecordAt = (view: DataView) => {\n for (let at = view.byteLength - 22; at >= 0; at--) if (view.getUint32(at, true) === endSignature) return at\n return -1\n}\n\n/** The archive's entries by name, from its central directory. A ZIP64 archive (over 4 GB) is refused. */\nexport const zipEntries = async (blob: Blob) => {\n const tailStart = Math.max(0, blob.size - endSearch)\n const tail = await bytesOf(blob, tailStart, blob.size)\n const end = endRecordAt(tail)\n if (end < 0) throw notZip()\n const count = tail.getUint16(end + 10, true)\n const size = tail.getUint32(end + 12, true)\n const start = tail.getUint32(end + 16, true)\n if (count === 0xffff || size === 0xffffffff || start === 0xffffffff) throw new Error(message('zip64'))\n const directory = await bytesOf(blob, start, start + size)\n const decoder = new TextDecoder()\n const entries = new Map<string, ZipEntry>()\n let at = 0\n for (let index = 0; index < count; index++) {\n if (directory.getUint32(at, true) !== entrySignature) throw notZip()\n const nameLength = directory.getUint16(at + 28, true)\n const extraLength = directory.getUint16(at + 30, true)\n const commentLength = directory.getUint16(at + 32, true)\n const name = decoder.decode(new Uint8Array(directory.buffer, directory.byteOffset + at + 46, nameLength))\n entries.set(name, { name, method: directory.getUint16(at + 10, true), size: directory.getUint32(at + 20, true), offset: directory.getUint32(at + 42, true) })\n at += 46 + nameLength + extraLength + commentLength\n }\n return entries\n}\n\n/** The entry's content as a stream of bytes: stored as it is, or inflated (deflate). */\nexport const zipEntryStream = async (blob: Blob, entry: ZipEntry): Promise<ReadableStream<BufferSource>> => {\n const local = await bytesOf(blob, entry.offset, entry.offset + 30)\n if (local.getUint32(0, true) !== localSignature) throw notZip()\n const dataStart = entry.offset + 30 + local.getUint16(26, true) + local.getUint16(28, true)\n const raw = blob.slice(dataStart, dataStart + entry.size).stream()\n if (entry.method === 0) return raw\n if (entry.method === 8) return raw.pipeThrough(new DecompressionStream('deflate-raw'))\n throw new Error(message('compression', entry.name, entry.method))\n}\n\n/** The entry's content as text, decoded as UTF-8 a chunk at a time. */\nexport async function* zipTextChunks(blob: Blob, entry: ZipEntry) {\n const reader = (await zipEntryStream(blob, entry)).pipeThrough(new TextDecoderStream()).getReader()\n try {\n for (;;) {\n const { done, value } = await reader.read()\n if (done) return\n yield value\n }\n } finally {\n await reader.cancel()\n }\n}\n\n/** The entry's whole content as text, for the small parts of a workbook. */\nexport const zipText = async (blob: Blob, entry: ZipEntry) => {\n const parts: string[] = []\n for await (const text of zipTextChunks(blob, entry)) parts.push(text)\n return parts.join('')\n}\n","import type { SheetRow } from './sheet-cell'\nimport { createRowScanner, dateStyles, parseRow, sharedStrings, workbookSheets, type SheetContext } from './xlsx-xml'\nimport { zipEntries, zipText, zipTextChunks, type ZipEntry } from './zip-reader'\nimport { text } from './messages'\n\nconst part = (entries: Map<string, ZipEntry>, name: string) => {\n const entry = entries.get(name)\n if (!entry) throw new Error(text('notWorkbook', name))\n return entry\n}\n\n/**\n * An .xlsx workbook: the names of its sheets, and each sheet's rows read as its XML streams in. The shared strings and\n * the styles are read whole, since cells point into them; the sheets are not.\n */\nexport const openWorkbook = async (blob: Blob) => {\n const entries = await zipEntries(blob)\n const { sheets, date1904 } = workbookSheets(await zipText(blob, part(entries, 'xl/workbook.xml')), await zipText(blob, part(entries, 'xl/_rels/workbook.xml.rels')))\n let context: SheetContext | undefined\n const sheetContext = async () => {\n const strings = entries.has('xl/sharedStrings.xml') ? sharedStrings(await zipText(blob, entries.get('xl/sharedStrings.xml')!)) : []\n const dates = entries.has('xl/styles.xml') ? dateStyles(await zipText(blob, entries.get('xl/styles.xml')!)) : new Set<number>()\n context = { strings, dates, date1904 }\n return context\n }\n\n async function* rows(name: string): AsyncGenerator<SheetRow> {\n const sheet = sheets.find((candidate) => candidate.name === name)\n if (!sheet) throw new Error(text('noSheetCalled', name))\n const shared = context ?? (await sheetContext())\n const scan = createRowScanner()\n let line = 0\n for await (const chunk of zipTextChunks(blob, part(entries, sheet.path))) {\n for (const xml of scan(chunk)) {\n const row = parseRow(xml, shared, line)\n line = row.line\n yield row\n }\n }\n }\n\n return { sheets: sheets.map((sheet) => sheet.name), rows }\n}\n","import { createCsvParser } from './csv-parser'\nimport type { SheetRow } from './sheet-cell'\nimport { openWorkbook } from './xlsx-reader'\nimport { text } from './messages'\n\n/** The file kinds an import reads. */\nexport type SheetFormat = 'xlsx' | 'csv'\n\n// An .xlsx is a ZIP archive, which starts with \"PK\"\nconst startsAsZip = async (file: Blob) => {\n const head = new Uint8Array(await file.slice(0, 2).arrayBuffer())\n return head[0] === 0x50 && head[1] === 0x4b\n}\n\n/** Whether the file is a workbook or CSV text: by its name's extension, else by whether it is a ZIP archive. */\nexport const sheetFormat = async (file: File): Promise<SheetFormat> => {\n const extension = /\\.([^.]+)$/.exec(file.name)?.[1]?.toLowerCase()\n if (extension === 'xlsx') return 'xlsx'\n if (extension === 'csv' || extension === 'tsv' || extension === 'txt') return 'csv'\n return (await startsAsZip(file)) ? 'xlsx' : 'csv'\n}\n\n/** The workbook's sheet names, in order; a CSV has none. */\nexport const sheetNames = async (file: File) => ((await sheetFormat(file)) === 'xlsx' ? (await openWorkbook(file)).sheets : [])\n\nconst notText = () => new Error(text('fileNotUtf8'))\n\nasync function* csvRows(file: Blob): AsyncGenerator<SheetRow> {\n const parser = createCsvParser()\n // Fatal, so a file in another encoding is refused rather than read with replacement characters\n const decoder = new TextDecoder('utf-8', { fatal: true })\n const decode = (bytes?: Uint8Array) => {\n try {\n return bytes ? decoder.decode(bytes, { stream: true }) : decoder.decode()\n } catch (error) {\n if (error instanceof TypeError) throw notText()\n throw error\n }\n }\n const reader = file.stream().getReader()\n let line = 0\n const numbered = (rows: string[][]) => rows.map((cells) => ({ line: ++line, cells }))\n try {\n for (;;) {\n const { done, value } = await reader.read()\n if (done) break\n yield* numbered(parser.push(decode(value)))\n }\n yield* numbered([...parser.push(decode()), ...parser.end()])\n } finally {\n await reader.cancel()\n }\n}\n\n/**\n * The rows of the file, the header first, read as the file streams in: a CSV's (UTF-8, with its delimiter found from\n * the header line), or the named sheet of a workbook.\n */\nexport async function* sheetRows(file: File, sheet?: string): AsyncGenerator<SheetRow> {\n if ((await sheetFormat(file)) === 'csv') return yield* csvRows(file)\n const workbook = await openWorkbook(file)\n const name = sheet ?? workbook.sheets[0]\n if (name === undefined) throw new Error(text('noSheets'))\n yield* workbook.rows(name)\n}\n","/// <reference lib=\"webworker\" />\nimport type { ParseReply, ParseRequest } from './parse-messages'\nimport { setFallbackLocale } from '../../locale/active-locale'\nimport { sheetNames, sheetRows } from './sheet-file'\n\n// Reads a chosen file off the main thread: its sheet names, or its rows a chunk at a time, the next chunk once the\n// page asks for it, so a large file is never read faster than the page uses it.\n\nconst scope = self as unknown as DedicatedWorkerGlobalScope\nconst reply = (message: ParseReply) => scope.postMessage(message)\nlet next: (() => void) | undefined\n\nconst read = async (request: Extract<ParseRequest, { type: 'read' }>) => {\n let chunk = []\n for await (const row of sheetRows(request.file, request.sheet)) {\n chunk.push(row)\n if (chunk.length < request.chunk) continue\n const asked = new Promise<void>((resolve) => (next = resolve))\n reply({ type: 'rows', rows: chunk })\n chunk = []\n await asked\n }\n reply({ type: 'rows', rows: chunk })\n reply({ type: 'end' })\n}\n\nconst handle = async (request: ParseRequest) => {\n if (request.type === 'next') return next?.()\n setFallbackLocale(request.locale)\n if (request.type === 'sheets') return reply({ type: 'sheets', sheets: await sheetNames(request.file) })\n await read(request)\n}\n\nscope.onmessage = (event: MessageEvent<ParseRequest>) => {\n handle(event.data).catch((error: unknown) => reply({ type: 'error', message: error instanceof Error ? error.message : String(error) }))\n}\n"],"mappings":"YAKA,IAAIE,EAAmB,KAIVC,MAAoCD,EAGpCE,EAAqB,GAAmB,CACnD,EAAWC,CACb,ECdMC,EAAa,CAAC,IAAK,IAAK,GAAI,EAMrBC,EAAmB,GAAuB,CACrD,IAAMC,EAAS,IAAI,IAAoBF,EAAW,IAAK,GAAc,CAACG,EAAW,CAAC,CAAC,CAAC,EAChFC,EAAS,GACb,IAAK,IAAMC,KAAQC,EACbD,IAAS,IAAK,EAAS,CAACD,EACnB,CAACA,GAAUF,EAAO,IAAIG,CAAI,GAAGH,EAAO,IAAIG,EAAMH,EAAO,IAAIG,CAAI,EAAK,CAAC,EAE9E,MAAO,CAAC,GAAGH,CAAM,CAAC,CAAC,QAAQ,EAAM,IAAWK,EAAM,GAAKC,EAAK,GAAKD,EAAQC,EAAO,CAAC,IAAK,CAAC,CAAqB,CAAC,CAAC,EAChH,EAGMC,EAAa,GAAiB,CAClC,IAAIL,EAAS,GACb,IAAK,IAAIM,EAAQ,EAAGA,EAAQC,EAAK,OAAQ,IAAS,CAChD,IAAMN,EAAOM,EAAKD,GAClB,GAAIL,IAAS,IAAK,EAAS,CAACD,OACvB,GAAI,CAACA,IAAWC,IAAS;GAAQA,IAAS,MAAO,OAAOM,EAAK,MAAM,EAAGD,CAAK,CAClF,CAEF,EAQaE,EAAmB,GAAmB,CACjD,IAAIT,EAAYU,EACZC,EAAU,GACVC,EAAU,GACVC,EAAQ,GACRC,EAAgB,CAAC,EACjBb,EAAS,GAETc,EAAY,GAEZC,EAAS,GAETC,EAAa,GAEXC,MAAiB,CACrBJ,EAAI,KAAKD,CAAK,EACd,EAAQ,EACV,EACMM,EAAU,GAAqB,CACnCD,EAAS,EACTE,EAAK,KAAKN,CAAG,EACb,EAAM,CAAC,EACP,EAAa,EACf,EAEMO,EAAW,GAAiB,CAChC,IAAMD,EAAmB,CAAC,EAC1B,IAAK,IAA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C,EAAM,IAAI,CAAC,CAAC,MAAO,GAAmBP,EAAM,CAAE,KAAM,QAAS,QAASL,aAAiB,MAAQA,EAAM,QAAU,OAAOA,CAAK,CAAE,CAAC,CAAC,CACxI","debugId":"1485bc04-8d2d-4d50-ac83-b2ff357905cb"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preload-helper-BZ3hrQDD.js","names":["createContext","useContext","forwardRef","createElement","forwardRef","createElement","__toESM","cn","require_jsx_runtime","locales","isLocale","value","pickLocale","preferred","tag","import_react","require_react","fallback","app","activeLocale","setFallbackLocale","locale","setAppLocale","browserLocale","languages","formatTags","formatTag","toKebabCase","string","toLucideIconData","iconNode","iconName","aliases","toCamelCase","out","upperNext","ch","toPascalCase","camelCase","mergeClasses","classes","className","array","index","defaultAttributes","isDefined","buildLucideIconNode","attributeNames","params","getAttributeName","attributeName","viewBoxWidth","icon","\"width\"","viewBoxHeight","\"height\"","aliasClassNames","alias","iconClassNames","classNamesFromClassName","calculatedStrokeWidth","attrName","attrs","name","children","child","nextAttrs","buildLucideIconForReact","hasA11yProp","prop","props","LucideContext","useLucideContext","Icon","rest","contextSize","contextStrokeWidth","contextAbsoluteStrokeWidth","contextNonScalingStroke","contextColor","contextClass","hasAccessibleProp","svgAttributes","builtIconNode","color","width","size","height","strokeWidth","absoluteStrokeWidth","nonScalingStroke","createLucideIcon","iconData","iconDataOrName","Component","defineMessages","values","message","catalogue","id","import_jsx_runtime","sizes","segmentedClass","active","Segmented","label","options","option","iconOnly","onChange","guarded","action","error","scriptRel","assetsURL","dep","seen","isCssPreloadUrl","url","__vitePreload","promise","deps","preloadedHrefs","cspNonceMeta","cspNonce","allSettled","promises","p","importMetaResolve","specifier","depString","importerUrl","isCss","links","i","link","res","rej","handlePreloadError","e","err","item","baseModule"],"sources":["../../../../schema/src/locale.ts","../../../src/locale/active-locale.ts","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/context.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/Icon.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/createLucideIcon.mjs","../../../src/locale/messages.ts","../../../src/primitives/segmented.tsx","../../../src/lib/guarded.ts"],"sourcesContent":["/** The languages Protobase's built-in screens come in. */\nexport const locales = ['en', 'nl'] as const\n\nexport type Locale = (typeof locales)[number]\n\nexport const isLocale = (value: unknown): value is Locale => locales.includes(value as Locale)\n\n/**\n * The first of `preferred`, language tags such as the browser's `nl-BE` or `en`, whose language the screens come in;\n * English when none is.\n */\nexport const pickLocale = (preferred: readonly string[]): Locale => {\n const language = preferred.map((tag) => tag.split('-')[0]!.toLowerCase()).find(isLocale)\n return language ?? 'en'\n}\n","import { pickLocale, type Locale } from '@protobase/schema/internal'\n\n// The built-in screens read one locale, so plain functions (formats, messages) need no context: the app's when its\n// `/meta` names one, else the fallback the app starts with, the browser's language unless given. Both only ever get\n// set to what the app decides on each render, so a part of the tree that renders later never sees another one.\nlet fallback: Locale = 'en'\nlet app: Locale | undefined\n\n/** The language the screens are in now. */\nexport const activeLocale = (): Locale => app ?? fallback\n\n/** The language the screens are in when the app sets none: the browser's, or the one the app was given. */\nexport const setFallbackLocale = (locale: Locale) => {\n fallback = locale\n}\n\n/** The language the app sets for everyone, from its `/meta`; undefined when it sets none. */\nexport const setAppLocale = (locale: Locale | undefined) => {\n app = locale\n}\n\n/** The browser's language when the screens come in it, else English. */\nexport const browserLocale = (languages = globalThis.navigator?.languages ?? []) => pickLocale(languages)\n\n// The language tag numbers and dates are written with: English as in Ireland and Britain (`6 Oct 2026`, `1,234.5`).\nconst formatTags: Record<Locale, string> = { en: 'en-GB', nl: 'nl-NL' }\n\n/** The language tag `Intl` formats numbers and dates with, for the active locale. */\nexport const formatTag = () => formatTags[activeLocale()]\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string?.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\nexport { toKebabCase };\n//# sourceMappingURL=toKebabCase.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { toKebabCase } from './toKebabCase.mjs';\n\nfunction toLucideIconData(iconName, iconNode, aliases = []) {\n if (iconNode == null) {\n throw new Error(\"[lucide]: iconNode is required when icon name is used\");\n }\n return {\n name: toKebabCase(iconName),\n size: 24,\n node: iconNode,\n ...aliases.length > 0 ? { aliases } : {}\n };\n}\n\nexport { toLucideIconData };\n//# sourceMappingURL=toLucideIconData.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toCamelCase = (string) => {\n let out = \"\";\n let upperNext = false;\n for (const ch of string) {\n if (ch === \"-\" || ch === \"_\" || ch <= \" \") {\n upperNext = out.length > 0;\n continue;\n }\n if (out.length === 0) {\n out += ch.toLowerCase();\n } else {\n out += upperNext ? ch.toUpperCase() : ch;\n }\n upperNext = false;\n }\n return out;\n};\n\nexport { toCamelCase };\n//# sourceMappingURL=toCamelCase.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { toCamelCase } from './toCamelCase.mjs';\n\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\n\nexport { toPascalCase };\n//# sourceMappingURL=toPascalCase.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\n\nexport { mergeClasses };\n//# sourceMappingURL=mergeClasses.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": 2,\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport defaultAttributes from './defaultAttributes.mjs';\nimport { mergeClasses } from '../utils/mergeClasses.mjs';\n\nfunction isDefined(value) {\n return value !== null && value !== void 0;\n}\nfunction buildLucideIconNode(icon, params = {}) {\n const attributeNames = params.attributeNames ?? {};\n const getAttributeName = (attributeName) => attributeNames[attributeName] ?? attributeName;\n const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes[\"width\"];\n const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes[\"height\"];\n const aliasClassNames = icon.aliases?.filter((alias) => typeof alias === \"string\" && alias.trim() !== \"\").map((alias) => `lucide-${alias}`) ?? [];\n const iconClassNames = [...icon.name ? [`lucide-${icon.name}`] : [], ...aliasClassNames];\n const classNamesFromClassName = params.className?.split(\" \").filter(Boolean) ?? [];\n const className = params.includeDefaultClasses === false ? mergeClasses(...classNamesFromClassName) : mergeClasses(\"lucide\", ...iconClassNames, ...classNamesFromClassName);\n const calculatedStrokeWidth = params.absoluteStrokeWidth ? Number(params.strokeWidth ?? defaultAttributes[\"stroke-width\"]) * Number(icon.size ?? icon.width ?? defaultAttributes[\"width\"]) / Number(params.size ?? params.width ?? defaultAttributes[\"width\"]) : params.strokeWidth ?? defaultAttributes[\"stroke-width\"];\n const attributes = {\n ...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {\n attrs[getAttributeName(attrName)] = value;\n return attrs;\n }, {}),\n ...\"color\" in params && params.color && {\n [getAttributeName(\"stroke\")]: params.color\n },\n ...\"size\" in params && isDefined(params.size) && {\n [getAttributeName(\"width\")]: params.size,\n [getAttributeName(\"height\")]: params.size\n },\n ...\"width\" in params && isDefined(params.width) && {\n [getAttributeName(\"width\")]: params.width\n },\n ...\"height\" in params && isDefined(params.height) && {\n [getAttributeName(\"height\")]: params.height\n },\n [getAttributeName(\"stroke-width\")]: calculatedStrokeWidth,\n ...className && {\n [getAttributeName(\"class\")]: className\n },\n [getAttributeName(\"viewBox\")]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,\n ...params.hasA11yProp === false ? {\n [getAttributeName(\"aria-hidden\")]: \"true\"\n } : {},\n ...\"attributes\" in params && params.attributes\n };\n return [\n \"svg\",\n attributes,\n icon.node.map((child) => {\n const [name, attrs, children] = child;\n const nextAttrs = params.nonScalingStroke ? { [getAttributeName(\"vector-effect\")]: \"non-scaling-stroke\", ...attrs } : attrs;\n return children ? [name, nextAttrs, children] : [name, nextAttrs];\n })\n ];\n}\n\nexport { buildLucideIconNode as default };\n//# sourceMappingURL=buildLucideIconNode.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport buildLucideIconNode from './buildLucideIconNode.mjs';\n\nfunction buildLucideIconForReact(icon, params = {}) {\n return buildLucideIconNode(icon, {\n ...params,\n attributeNames: {\n ...params.attributeNames,\n class: \"className\",\n \"stroke-width\": \"strokeWidth\",\n \"stroke-linecap\": \"strokeLinecap\",\n \"stroke-linejoin\": \"strokeLinejoin\",\n \"vector-effect\": \"vectorEffect\"\n }\n });\n}\n\nexport { buildLucideIconForReact as default };\n//# sourceMappingURL=buildLucideIconForReact.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n return false;\n};\n\nexport { hasA11yProp };\n//# sourceMappingURL=hasA11yProp.mjs.map\n","\"use strict\";\n\"use client\";\n/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { createContext, useContext, useMemo, createElement } from 'react';\n\nconst LucideContext = createContext({});\nfunction LucideProvider({\n children,\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className\n}) {\n const value = useMemo(\n () => ({\n size,\n color,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className\n }),\n [size, color, strokeWidth, absoluteStrokeWidth, nonScalingStroke, className]\n );\n return createElement(LucideContext.Provider, { value }, children);\n}\nconst useLucideContext = () => useContext(LucideContext);\n\nexport { LucideProvider, useLucideContext };\n//# sourceMappingURL=context.mjs.map\n","\"use strict\";\n\"use client\";\n/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses } from './shared/src/utils/mergeClasses.mjs';\nimport buildLucideIconForReact from './shared/src/build/buildLucideIconForReact.mjs';\nimport { hasA11yProp } from './shared/src/utils/hasA11yProp.mjs';\nimport { useLucideContext } from './context.mjs';\n\nconst Icon = forwardRef(\n ({\n color,\n size,\n width,\n height,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n className = \"\",\n children,\n iconNode = [],\n icon = {\n node: iconNode,\n aliases: [],\n size: 24\n },\n ...rest\n }, ref) => {\n const {\n size: contextSize = 24,\n strokeWidth: contextStrokeWidth = 2,\n absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,\n nonScalingStroke: contextNonScalingStroke = false,\n color: contextColor = \"currentColor\",\n className: contextClass = \"\"\n } = useLucideContext() ?? {};\n const hasAccessibleProp = Boolean(children) || hasA11yProp(rest);\n const [name, svgAttributes, builtIconNode = []] = buildLucideIconForReact(icon, {\n color: color ?? contextColor,\n width: width ?? size ?? contextSize,\n height: height ?? size ?? contextSize,\n strokeWidth: strokeWidth ?? contextStrokeWidth,\n absoluteStrokeWidth: absoluteStrokeWidth ?? contextAbsoluteStrokeWidth,\n nonScalingStroke: nonScalingStroke ?? contextNonScalingStroke,\n className: mergeClasses(contextClass, className),\n hasA11yProp: hasAccessibleProp,\n attributes: rest\n });\n return createElement(\n name,\n {\n ref,\n ...svgAttributes\n },\n [\n ...builtIconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { toLucideIconData } from './shared/src/utils/toLucideIconData.mjs';\nimport { toPascalCase } from './shared/src/utils/toPascalCase.mjs';\nimport Icon from './Icon.mjs';\n\nfunction createLucideIcon(iconDataOrName, iconNode = [], aliases = []) {\n const iconData = typeof iconDataOrName === \"string\" ? toLucideIconData(iconDataOrName, iconNode, aliases) : iconDataOrName;\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n icon: iconData,\n className,\n ...props\n })\n );\n if (iconData.name) {\n Component.displayName = toPascalCase(iconData.name);\n }\n return Component;\n}\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.mjs.map\n","import type { Locale } from '@protobase/schema/internal'\nimport { activeLocale } from './active-locale'\n\n/** A built-in text: fixed, or made from the values it names, such as a count. */\ntype Message = string | ((...values: never[]) => string)\n\n/** A translation of `M`: every message of it, taking the same values. */\nexport type Translation<M extends Record<string, Message>> = { [K in keyof M]: M[K] extends string ? string : M[K] }\n\ntype Values<T> = T extends (...values: infer V) => string ? V : []\n\n/**\n * An area's built-in texts in every language the screens come in, keyed by id: the lookup returns the one for the\n * active locale, `text('search')` or `text('rows', 3)`. Dutch must translate every English text, which the types check.\n */\nexport const defineMessages = <M extends Record<string, Message>>(catalogue: { en: M } & Record<Exclude<Locale, 'en'>, Translation<M>>) =>\n <K extends keyof M>(id: K, ...values: Values<M[K]>): string => {\n const message = (catalogue[activeLocale()] as M)[id]\n return typeof message === 'function' ? (message as (...values: unknown[]) => string)(...values) : (message as string)\n }\n","import type { ComponentType } from 'react'\nimport { cn } from '../lib/cn'\n\nexport type SegmentedOption<T extends string> = { value: T; label: string; icon?: ComponentType<{ className?: string }> }\n\n/**\n * `md` matches a medium Button, for a switch that sits among buttons. `iconOnly` draws each option as its icon alone,\n * its label the button's name, for a row without room for the words.\n */\nexport type SegmentedProps<T extends string> = { value: T; options: Array<SegmentedOption<T>>; onChange: (value: T) => void; label?: string; size?: 'sm' | 'md'; iconOnly?: boolean }\n\nconst sizes = { sm: { group: 'h-7', option: 'px-2.5 text-body' }, md: { group: 'h-8', option: 'px-3 text-body' } }\n\n/** A segmented switch's classes, for a row of links that looks like one: the group, and each option, `active` the chosen. */\nexport const segmentedClass = {\n group: (size: 'sm' | 'md' = 'sm') => cn('inline-flex', sizes[size].group, 'rounded-md bg-muted p-0.5'),\n option: (active: boolean, size: 'sm' | 'md' = 'sm') =>\n cn('inline-flex items-center gap-1.5 rounded', sizes[size].option, 'font-medium transition-colors', active ? 'bg-background text-foreground shadow-sm' : 'text-muted-foreground hover:text-foreground'),\n}\n\nexport const Segmented = <T extends string>({ value, options, onChange, label, size = 'sm', iconOnly = false }: SegmentedProps<T>) => (\n <span role=\"group\" aria-label={label} className={segmentedClass.group(size)}>\n {options.map((option) => (\n <button\n key={option.value}\n type=\"button\"\n aria-pressed={option.value === value}\n {...(iconOnly && { 'aria-label': option.label, title: option.label })}\n onClick={() => onChange(option.value)}\n className={segmentedClass.option(option.value === value, size)}\n >\n {option.icon && <option.icon className=\"size-3.5\" />}\n {!iconOnly && option.label}\n </button>\n ))}\n </span>\n)\n","/** Runs a storage access; storage can be unavailable (private windows, blocked site data), which is a DOMException. Anything else is a bug. */\nexport const guarded = <T>(action: () => T, fallback: T) => {\n try {\n return action()\n } catch (error) {\n if (!(error instanceof DOMException)) throw error\n return fallback\n }\n}\n"],"ignoreList":[2,3,4,5,6,7,8,9,10,11,12,13],"mappings":"yKACA,IAAaS,EAAU,CAAC,KAAM,IAAI,EAIrBC,EAAY,GAAoCD,EAAQ,SAASE,CAAe,EAMhFC,EAAc,GACRC,EAAU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