@8sheets/data-grid 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/README.md +1 -1
  2. package/a11y/cell-alt-text.js +1 -1
  3. package/api/serialize.js +1 -1
  4. package/api/style-refs.js +1 -1
  5. package/calc/adjust.js +1 -1
  6. package/calc/compile.js +1 -1
  7. package/calc/engine.js +1 -1
  8. package/calc/functions/array.js +1 -1
  9. package/calc/functions/database.js +1 -1
  10. package/calc/functions/date.js +1 -1
  11. package/calc/functions/engineering.js +1 -1
  12. package/calc/functions/financial.js +1 -1
  13. package/calc/functions/helpers.js +1 -1
  14. package/calc/functions/index.js +3 -2
  15. package/calc/functions/info.js +1 -1
  16. package/calc/functions/logical.js +1 -1
  17. package/calc/functions/lookup.js +1 -1
  18. package/calc/functions/math.js +1 -1
  19. package/calc/functions/stat.js +1 -1
  20. package/calc/functions/text.js +1 -1
  21. package/calc/parser.js +2 -2
  22. package/calc/shown-refs.js +1 -0
  23. package/calc/values.js +1 -1
  24. package/calcx/calc-control.js +1 -0
  25. package/calcx/external-read.js +1 -1
  26. package/calcx/external.js +1 -1
  27. package/calcx/lang/convert.js +1 -1
  28. package/cells/axis-ops.js +1 -1
  29. package/cells/book-css.js +7 -2
  30. package/cells/cell-styles-xml.js +1 -1
  31. package/cells/cf-engine.js +1 -1
  32. package/cells/cf-file.js +1 -1
  33. package/cells/docprops-xml.js +2 -2
  34. package/cells/filter-eval.js +1 -0
  35. package/cells/filter-file.js +1 -1
  36. package/cells/find-engine.js +2 -2
  37. package/cells/find.js +1 -1
  38. package/cells/goto.js +1 -1
  39. package/cells/link-model.js +1 -0
  40. package/cells/name-box.js +1 -1
  41. package/cells/note-box.js +3 -0
  42. package/cells/options.js +1 -1
  43. package/cells/outline-column.js +1 -1
  44. package/cells/protected-menu.js +1 -0
  45. package/cells/rich-data-xml.js +1 -1
  46. package/cells/selection-modes.js +1 -1
  47. package/cells/sheet-views-file.js +2 -0
  48. package/cells/shift-check.js +1 -1
  49. package/cells/sort-compare.js +1 -0
  50. package/cells/ui-kit.js +1 -1
  51. package/cells/undo-group.js +1 -1
  52. package/celltypes/dropdowns.js +2 -2
  53. package/core/address.js +1 -1
  54. package/core/autofill.js +1 -1
  55. package/core/axis.js +1 -1
  56. package/core/cond-format.js +1 -1
  57. package/core/culture.js +5 -1
  58. package/core/custom-views.js +1 -1
  59. package/core/data-tools.js +1 -0
  60. package/core/date-codes.js +1 -0
  61. package/core/default-names.js +1 -1
  62. package/core/edit-ranges.js +1 -0
  63. package/core/formula-refs.js +1 -1
  64. package/core/host-rules.js +1 -0
  65. package/core/input.js +1 -1
  66. package/core/numfmt.js +1 -1
  67. package/core/precision.js +1 -0
  68. package/core/protection.js +1 -1
  69. package/core/region-input.js +1 -1
  70. package/core/rule-refs.js +1 -0
  71. package/core/shared-view.js +1 -0
  72. package/core/sheet.js +1 -1
  73. package/core/sparklines.js +1 -1
  74. package/core/sparse.js +1 -1
  75. package/core/spills.js +1 -0
  76. package/core/strings.js +1 -1
  77. package/core/structure.js +1 -1
  78. package/core/table-columns.js +1 -0
  79. package/core/tables.js +2 -2
  80. package/core/validation-ranges.js +1 -1
  81. package/core/whatif.js +1 -1
  82. package/core/workbook.js +1 -1
  83. package/datasheets/formula.js +1 -1
  84. package/datasheets/manager.js +1 -1
  85. package/datasheets/path-binding.js +1 -1
  86. package/datasheets/persist-writer.js +1 -1
  87. package/datasheets/persist.js +1 -1
  88. package/datasheets/report.js +1 -1
  89. package/extras/getdata/persist.js +2 -2
  90. package/extras/getdata/rows.js +1 -1
  91. package/extras/getdata/shared-steps.js +1 -0
  92. package/extras/getdata/steps-formula.js +1 -0
  93. package/extras/getdata/steps-more.js +1 -0
  94. package/extras/getdata/steps-tables.js +1 -0
  95. package/extras/getdata/steps.js +1 -1
  96. package/i18n/de/a11y.js +1 -0
  97. package/i18n/de/cells.js +2 -0
  98. package/i18n/de/charts.js +1 -0
  99. package/i18n/de/common.js +1 -0
  100. package/i18n/de/datasheets.js +1 -0
  101. package/i18n/de/format.js +1 -0
  102. package/i18n/de/misc.js +1 -0
  103. package/i18n/de/pivot.js +1 -0
  104. package/i18n/de/proofing.js +1 -0
  105. package/i18n/de/ribbon.js +1 -0
  106. package/i18n/de/shapes.js +1 -0
  107. package/i18n/de/shell.js +3 -0
  108. package/i18n/de/touch.js +1 -0
  109. package/i18n/de.js +1 -0
  110. package/i18n/en/cells.js +2 -1
  111. package/i18n/en/charts.js +1 -1
  112. package/i18n/en/format.js +1 -1
  113. package/i18n/en/misc.js +1 -1
  114. package/i18n/en/pivot.js +1 -1
  115. package/i18n/en/proofing.js +1 -1
  116. package/i18n/en/ribbon.js +1 -1
  117. package/i18n/en/shapes.js +1 -1
  118. package/i18n/en/shell.js +3 -2
  119. package/i18n/en/touch.js +1 -1
  120. package/i18n/es/a11y.js +1 -0
  121. package/i18n/es/cells.js +2 -0
  122. package/i18n/es/charts.js +1 -0
  123. package/i18n/es/common.js +1 -0
  124. package/i18n/es/datasheets.js +1 -0
  125. package/i18n/es/format.js +1 -0
  126. package/i18n/es/misc.js +1 -0
  127. package/i18n/es/pivot.js +1 -0
  128. package/i18n/es/proofing.js +1 -0
  129. package/i18n/es/ribbon.js +1 -0
  130. package/i18n/es/shapes.js +1 -0
  131. package/i18n/es/shell.js +3 -0
  132. package/i18n/es/touch.js +1 -0
  133. package/i18n/es.js +1 -0
  134. package/i18n/fr/a11y.js +1 -0
  135. package/i18n/fr/cells.js +2 -0
  136. package/i18n/fr/charts.js +1 -0
  137. package/i18n/fr/common.js +1 -0
  138. package/i18n/fr/datasheets.js +1 -0
  139. package/i18n/fr/format.js +1 -0
  140. package/i18n/fr/misc.js +1 -0
  141. package/i18n/fr/pivot.js +1 -0
  142. package/i18n/fr/proofing.js +1 -0
  143. package/i18n/fr/ribbon.js +1 -0
  144. package/i18n/fr/shapes.js +1 -0
  145. package/i18n/fr/shell.js +3 -0
  146. package/i18n/fr/touch.js +1 -0
  147. package/i18n/fr.js +1 -0
  148. package/i18n/index.js +1 -1
  149. package/i18n/languages.js +1 -1
  150. package/i18n/pl/cells.js +2 -1
  151. package/i18n/pl/charts.js +1 -1
  152. package/i18n/pl/format.js +1 -1
  153. package/i18n/pl/misc.js +1 -1
  154. package/i18n/pl/pivot.js +1 -1
  155. package/i18n/pl/proofing.js +1 -1
  156. package/i18n/pl/ribbon.js +1 -1
  157. package/i18n/pl/shapes.js +1 -1
  158. package/i18n/pl/shell.js +3 -2
  159. package/i18n/pl/touch.js +1 -1
  160. package/io/blob-sink.js +1 -0
  161. package/io/canonical-xml.js +1 -0
  162. package/io/client.js +1 -1
  163. package/io/crypto/cfb-build.js +1 -0
  164. package/io/crypto/cfb-read.js +1 -1
  165. package/io/crypto/cfb-write.js +1 -1
  166. package/io/crypto/errors.js +1 -1
  167. package/io/csv.js +8 -8
  168. package/io/encoding.js +1 -0
  169. package/io/foreign-sheets.js +2 -2
  170. package/io/io.worker.js +1 -1
  171. package/io/open-package.js +1 -0
  172. package/io/package-paths.js +1 -1
  173. package/io/plan.js +1 -1
  174. package/io/text-split.js +3 -3
  175. package/io/xls/chart-sheet.js +1 -0
  176. package/io/xls/chart.js +1 -0
  177. package/io/xls/crypt.js +1 -0
  178. package/io/xls/dml-color.js +1 -0
  179. package/io/xls/drawing.js +1 -0
  180. package/io/xls/formula.js +1 -0
  181. package/io/xls/geometry.js +1 -0
  182. package/io/xls/index.js +1 -0
  183. package/io/xls/pictures.js +1 -0
  184. package/io/xls/pivot.js +1 -0
  185. package/io/xls/props.js +1 -0
  186. package/io/xls/records.js +1 -0
  187. package/io/xls/shapes.js +1 -0
  188. package/io/xls/sheet-ext.js +1 -0
  189. package/io/xls/sheet.js +1 -0
  190. package/io/xls/styles.js +1 -0
  191. package/io/xls/vba.js +1 -0
  192. package/io/xls/workbook.js +1 -0
  193. package/io/xlsb/filter.js +1 -0
  194. package/io/xlsb/formula.js +2 -0
  195. package/io/xlsb/functions.js +1 -0
  196. package/io/xlsb/index.js +1 -0
  197. package/io/xlsb/parts.js +1 -0
  198. package/io/xlsb/pivot.js +1 -0
  199. package/io/xlsb/records.js +1 -0
  200. package/io/xlsb/sheet-ext.js +1 -0
  201. package/io/xlsb/sheet.js +1 -0
  202. package/io/xlsb/slicer.js +1 -0
  203. package/io/xlsb/styles.js +1 -0
  204. package/io/xlsb/workbook.js +1 -0
  205. package/io/xlsb/xml.js +2 -0
  206. package/io/xlsx-read.js +1 -1
  207. package/io/xlsx-styles.js +2 -2
  208. package/io/xlsx-tail.js +1 -1
  209. package/io/xlsx-write.js +2 -2
  210. package/io/xml-escape.js +1 -1
  211. package/io/xml-scan.js +2 -2
  212. package/io/zip-reader.js +1 -1
  213. package/objects/chart-model.js +1 -1
  214. package/objects/drawing-xml.js +1 -1
  215. package/package.json +1 -1
  216. package/pivot/calc-items.js +1 -0
  217. package/pivot/engine.js +1 -1
  218. package/pivot/xml.js +2 -2
  219. package/print/note-pages.js +2 -0
  220. package/print/page-setup.js +1 -1
  221. package/print/paginate.js +1 -1
  222. package/print/pdf-crypt.js +1 -0
  223. package/print/pdf-links.js +1 -0
  224. package/print/pdf-tags.js +1 -0
  225. package/print/pdf.js +24 -13
  226. package/print/render-page.js +3 -3
  227. package/print/shown-notes.js +1 -0
  228. package/shapes/form-xml.js +1 -1
  229. package/slicers/custom-styles.js +1 -1
  230. package/slicers/format.js +1 -1
  231. package/slicers/structured.js +1 -1
  232. package/slicers/write.js +1 -1
  233. package/table-view/files.js +1 -1
  234. package/table-view/mount.js +1 -1
  235. package/table-view/version.js +1 -1
  236. package/ui/dialogs.js +3 -3
  237. package/ui/icons.js +1 -1
  238. package/ui/menu-base.js +1 -1
  239. package/ui/protection-ui.js +1 -1
package/i18n/pl/shell.js CHANGED
@@ -1,2 +1,3 @@
1
- var e={"Excel Workbook":"Skoroszyt programu Excel","Excel Macro-Enabled Workbook":"Skoroszyt programu Excel z obsługą makr","Text files":"Pliki tekstowe","Circular reference: the formula refers to its own cell":"Odwołanie cykliczne: formuła odwołuje się do własnej komórki","Preparing formulas…":"Przygotowywanie formuł…","Calculating: {pct}%":"Obliczanie: {pct}%",'Recovered "{name}" from {when}.':"Odzyskano plik „{name}” (stan z {when}).",Restore:"Przywróć",Discard:"Odrzuć","The file was not loaded completely because it exceeds the size of a worksheet.":"Plik nie został załadowany w całości, ponieważ przekracza rozmiar arkusza.","Opening {name}…":"Otwieranie pliku {name}…","Opening… {count} cells":"Otwieranie… (komórki: {count})","Ready (opened {count} cells in {secs} s)":"Gotowy (otwarte komórki: {count}, czas: {secs} s)","The file reader didn't start. Check the connection and try again.":"Nie udało się uruchomić czytnika plików. Sprawdź połączenie i spróbuj ponownie.","Couldn't open {name}: {error}":"Nie można otworzyć pliku {name}: {error}","Saved {name}":"Zapisano plik {name}","Couldn't save: {error}":"Nie można zapisać: {error}",'"{text}" is not a valid reference':"„{text}” nie jest prawidłowym odwołaniem","Couldn't open the file: {error}":"Nie można otworzyć pliku: {error}","Unsaved Changes":"Niezapisane zmiany","Discard unsaved changes in this workbook?":"Czy odrzucić niezapisane zmiany w tym skoroszycie?","Formulas in This File":"Formuły w tym pliku","{count} cells in this file start with = and are shown as text. Calculate them as formulas?\nCalculate only files from a source you trust: formulas can read web addresses or open links.":`Komórki w tym pliku zaczynające się od = (liczba: {count}) są wyświetlane jako tekst. Czy obliczyć je jako formuły?
2
- Obliczaj tylko pliki z zaufanego źródła: formuły mogą odczytywać adresy internetowe i otwierać łącza.`,Calculate:"Oblicz","Keep as Text":"Zostaw jako tekst",'That password is not correct. "{name}" is protected. Enter its password.':"Hasło jest nieprawidłowe. Plik „{name}” jest chroniony. Wprowadź jego hasło.",'"{name}" is protected. Enter its password.':"Plik „{name}” jest chroniony. Wprowadź jego hasło.","Didn't open {name}":"Nie otwarto pliku {name}","Couldn't open {name}":"Nie udało się otworzyć pliku {name}","The file couldn't be downloaded ({reason}).":"Nie udało się pobrać pliku ({reason}).","The file couldn't be read.":"Nie udało się odczytać pliku.","Try again":"Spróbuj ponownie","Use an empty workbook":"Użyj pustego skoroszytu","Password to Open":"Hasło do otwarcia","Enter a new password, or leave it empty to remove the password.":"Wprowadź nowe hasło lub pozostaw pole puste, aby usunąć hasło.","Enter a password. If you lose it, the workbook cannot be recovered.":"Wprowadź hasło. Jeśli je zgubisz, nie będzie można odzyskać skoroszytu.","Enter the password again.":"Wprowadź ponownie hasło.","The password was not changed":"Hasło nie zostało zmienione","The passwords did not match, so it was not changed":"Hasła nie są zgodne, więc hasło nie zostało zmienione","The password applies from the next save":"Hasło będzie obowiązywać od następnego zapisu","The password is removed from the next save":"Hasło zostanie usunięte przy następnym zapisie","Saving…":"Zapisywanie…","Saving… {pct}%":"Zapisywanie… {pct}%","Saved ({size} MB in {secs} s)":"Zapisano ({size} MB w {secs} s)","The browser blocked clipboard access. Press ⌘V to paste.":"Przeglądarka zablokowała dostęp do schowka. Naciśnij ⌘V, aby wkleić.","Clear All":"Wyczyść wszystko","Clear Formats":"Wyczyść formaty","Clear Contents":"Wyczyść zawartość","Clear Comments and Notes":"Wyczyść komentarze i notatki","Clear Hyperlinks":"Wyczyść hiperlinki","Remove Hyperlinks":"Usuń hiperlinki","Clear Series":"Wyczyść serię","Find Next":"Znajdź następny","Find Previous":"Znajdź poprzedni","Rename Sheet":"Zmień nazwę arkusza","Hide Sheet":"Ukryj arkusz","Unhide Sheet…":"Odkryj arkusz…","Background…":"Tło…","About 8sheets":"8sheets — informacje","A spreadsheet that runs in the browser and keeps your files on your computer.":"Arkusz kalkulacyjny, który działa w przeglądarce i przechowuje pliki na Twoim komputerze.","What's new in this version":"Co nowego w tej wersji","Excel is a trademark of Microsoft. This app isn't made by or connected to Microsoft.":"Excel jest znakiem towarowym firmy Microsoft. Ta aplikacja nie została utworzona przez firmę Microsoft ani nie jest z nią powiązana.","View…":"Widok…","Calculation…":"Obliczanie…","AutoCorrect…":"Autokorekta…","Custom Lists…":"Listy niestandardowe…","Keyboard…":"Klawiatura…","The document is renamed. Save puts it under the new name; the old file stays where it was.":"Zmieniono nazwę dokumentu. Polecenie Zapisz zapisze go pod nową nazwą; stary plik pozostanie na swoim miejscu.","This browser has no share sheet, so {name} was downloaded to attach yourself.":"Ta przeglądarka nie ma arkusza udostępniania, więc plik {name} został pobrany, aby można go było samodzielnie załączyć.","From the next save, this workbook suggests opening read-only.":"Od następnego zapisu ten skoroszyt będzie sugerować otwieranie tylko do odczytu.","The workbook no longer suggests opening read-only.":"Skoroszyt nie sugeruje już otwierania tylko do odczytu.","Password to modify":"Hasło ochrony przed zmianami","Password to modify:":"Hasło ochrony przed zmianami:",Unchanged:"Bez zmian","Read-only recommended":"Zalecane tylko do odczytu","Remove the password to modify":"Usuń hasło ochrony przed zmianami",Passwords:"Hasła","Password to Open…":"Hasło do otwarcia…","Passwords and sharing apply from the next save.":"Hasła i ustawienia udostępniania będą obowiązywać od następnego zapisu.","{name} is reserved by {user}. Enter the password for write access, or leave it empty and open read-only.":"Plik {name} jest zastrzeżony przez użytkownika {user}. Wprowadź hasło, aby uzyskać prawo zapisu, lub pozostaw pole puste i otwórz plik tylko do odczytu.","{name} is reserved by its author. Enter the password for write access, or leave it empty and open read-only.":"Plik {name} jest zastrzeżony przez autora. Wprowadź hasło, aby uzyskać prawo zapisu, lub pozostaw pole puste i otwórz plik tylko do odczytu.","Opened read-only: Save asks for a new file.":"Otwarto tylko do odczytu: polecenie Zapisz poprosi o nowy plik.",'The author would like you to open "{name}" as read-only unless you need to make changes. Open as read-only?':"Autor chciałby, aby plik „{name}” był otwierany tylko do odczytu, chyba że musisz wprowadzić zmiany. Czy otworzyć tylko do odczytu?","Read-Only":"Tylko do odczytu","Set Print Area":"Ustaw obszar wydruku","Add to Print Area":"Dodaj do obszaru wydruku","Clear Print Area":"Wyczyść obszar wydruku","Excel Template":"Szablon programu Excel","New from Template…":"Nowy z szablonu…","Open Recent":"Otwórz ostatnie","Save As…":"Zapisz jako…","Save as Template…":"Zapisz jako szablon…","Export Sheet as CSV…":"Eksportuj arkusz jako CSV…","Move…":"Przenieś…","Choose the new place. A browser can't remove the old file, so delete it yourself if you want it gone.":"Wybierz nowe miejsce. Przeglądarka nie może usunąć starego pliku, więc usuń go samodzielnie, jeśli nie jest już potrzebny.",Import:"Importuj","Share…":"Udostępnij…","Send Workbook":"Wyślij skoroszyt","Send PDF":"Wyślij plik PDF","Always Open Read-Only":"Zawsze otwieraj tylko do odczytu","Passwords…":"Hasła…","Reduce File Size…":"Zmniejsz rozmiar pliku…","Page Setup…":"Ustawienia strony…","Print Area":"Obszar wydruku","About 8sheets…":"8sheets — informacje…","That file has no tables to import.":"Ten plik nie zawiera tabel do zaimportowania.","Imported {count} rows from {name}.":{one:"Zaimportowano {count} wiersz z pliku {name}.",few:"Zaimportowano {count} wiersze z pliku {name}.",many:"Zaimportowano {count} wierszy z pliku {name}.",other:"Zaimportowano {count} wiersza z pliku {name}."},"Table {n}: {caption}":"Tabela {n}: {caption}","From HTML":"Z pliku HTML","Choose a table:":"Wybierz tabelę:","From HTML…":"Z pliku HTML…","Bring to Front":"Przesuń na wierzch","Bring Forward":"Przesuń do przodu","Send Backward":"Przesuń do tyłu","Send to Back":"Przesuń na spód","Paste Special…":"Wklej specjalnie…","Insert Rows":"Wstaw wiersze","Insert Columns":"Wstaw kolumny","Delete Rows":"Usuń wiersze","Delete Columns":"Usuń kolumny","Column Width…":"Szerokość kolumny…","Row Height…":"Wysokość wiersza…","Rich Text…":"Tekst sformatowany…","Default Value…":"Wartość domyślna…","No recent files":"Brak ostatnio używanych plików","Clear Recent":"Wyczyść ostatnio używane","Freeze Panes isn't available in Page Layout view.":"Polecenie Zablokuj okienka jest niedostępne w widoku układu strony.","There is no room: data would be pushed off the end of the sheet.":"Brak miejsca: dane zostałyby wypchnięte poza koniec arkusza.","AutoSum needs empty cells next to the selection for the totals.":"Autosumowanie potrzebuje pustych komórek obok zaznaczenia na sumy.","The number must be between 1 and 409.":"Liczba musi należeć do zakresu od 1 do 409.","Type a font name.":"Wpisz nazwę czcionki.","Replace the existing definition of {names}?":"Zastąpić istniejącą definicję nazwy {names}?","This can't be applied to the selected range. Select a single cell in a range and try again.":"Nie można zastosować tego do zaznaczonego zakresu. Zaznacz jedną komórkę w zakresie i spróbuj ponownie.","Copy cells in this workbook first, then use Paste Special.":"Najpierw skopiuj komórki w tym skoroszycie, a następnie użyj polecenia Wklej specjalnie.","(No items)":"(Brak elementów)","This cell doesn't allow editing.":"Ta komórka nie zezwala na edycję.","You can't change part of a data table.":"Nie można zmienić części tabeli danych.","There's a problem with this formula. Fix it or press Esc to cancel.":"Wystąpił problem z tą formułą. Popraw ją lub naciśnij Esc, aby anulować.","{rows}R x {cols}C":"{rows}W x {cols}K","That selection is too large to copy to the clipboard":"To zaznaczenie jest zbyt duże, aby skopiować je do schowka",Allow:"Dozwolone","Any value":"Dowolna wartość","Whole number":"Pełna liczba",Decimal:"Dziesiętne",List:"Lista","Text length":"Długość tekstu",Custom:"Niestandardowe","dv|Data":"Wartości",between:"między","not between":"nie między","equal to":"równa","not equal to":"różna od","greater than":"większa niż","less than":"mniejsza niż","greater than or equal to":"większa lub równa","less than or equal to":"mniejsza lub równa","Minimum, source or formula":"Minimum, źródło lub formuła","Maximum:":"Maksimum:","Ignore blank":"Ignoruj puste","In-cell dropdown":"Rozwinięcie w komórce","Apply these changes to all other cells with the same settings":"Zastosuj te zmiany do wszystkich innych komórek z tymi samymi ustawieniami","Show input message when cell is selected":"Pokaż komunikat wejściowy, jeśli komórka jest zaznaczona","Input title":"Tytuł komunikatu wejściowego","Input message":"Komunikat wejściowy","Show error alert after invalid data is entered":"Pokazuj alerty o błędach po wprowadzeniu nieprawidłowych danych","Error style":"Styl błędu",Stop:"Zatrzymaj","Error title":"Tytuł błędu","Error message":"Komunikat o błędzie","Source:":"Źródło:","Formula:":"Formuła:","Minimum:":"Minimum:","Value:":"Wartość:","Validation criteria":"Kryteria poprawności","Allow:":"Dozwolone:","Data:":"Wartości:","When cell is selected, show this input message:":"Po zaznaczeniu komórki pokaż ten komunikat wejściowy:","Title:":"Tytuł:","Input message:":"Komunikat wejściowy:","When user enters invalid data, show this error alert:":"Po wprowadzeniu nieprawidłowych danych pokaż ten alert o błędzie:","Style:":"Styl:","Error message:":"Komunikat o błędzie:","Input Message":"Komunikat wejściowy","Error Alert":"Alert o błędzie","window|Data Validation":"Sprawdzanie poprawności danych","This sheet is protected with a password, which this app can't check yet.":"Ten arkusz jest chroniony hasłem, którego ta aplikacja nie może jeszcze sprawdzić.","Sheet unprotected.":"Usunięto ochronę arkusza.","Sheet protected. Locked cells can't be changed.":"Arkusz jest chroniony. Nie można zmieniać zablokowanych komórek.","The active cell has no formula to trace.":"Aktywna komórka nie zawiera formuły do śledzenia.","Data Range":"Zakres danych","Location Range":"Zakres lokalizacji","Data Range:":"Zakres danych:","Location Range:":"Zakres lokalizacji:","Choose the data that you want":"Wybierz odpowiednie dane","Choose where you want the sparklines to be placed":"Wybierz, gdzie mają zostać umieszczone wykresy przebiegu w czasie","Create Sparklines":"Tworzenie wykresów przebiegu w czasie","Data Reference is not valid.":"Odwołanie do danych jest nieprawidłowe.","Location reference is not valid because the cells are not all in the same column or same row. Select cells that are all in a single column or row.":"Odwołanie do lokalizacji jest nieprawidłowe, ponieważ komórki nie znajdują się w tej samej kolumnie lub w tym samym wierszu. Zaznacz komórki znajdujące się w jednej kolumnie lub w jednym wierszu.","Data Reference is not valid because the dimensions of the data range and the location range don't match.":"Odwołanie do danych jest nieprawidłowe, ponieważ wymiary zakresu danych i zakresu lokalizacji nie są zgodne.","A table can't overlap another table.":"Tabela nie może nakładać się na inną tabelę.","Light Style {n}":"Jasny styl {n}","Medium Style {n}":"Średni styl {n}","Dark Style {n}":"Ciemny styl {n}",Light:"Jasny",Medium:"Średni",Dark:"Ciemny","New Table Style…":"Nowy styl tabeli…","Set As Default":"Ustaw jako domyślny","Set as default table style for this document":"Ustaw jako domyślny styl tabeli dla tego dokumentu","Flash Fill needs data in the column to the left.":"Wypełnianie błyskawiczne wymaga danych w kolumnie po lewej stronie.","Type an example of the pattern first, then use Flash Fill.":"Najpierw wpisz przykład wzorca, a następnie użyj wypełniania błyskawicznego.","Flash Fill couldn't find a pattern. Type another example.":"Wypełnianie błyskawiczne nie znalazło wzorca. Wpisz inny przykład.","Flash Fill filled {count} cells.":"Wypełnianie błyskawiczne wypełniło komórki: {count}.","Set cell":"Ustaw komórkę","To value":"Wartość docelowa","By changing cell":"Zmieniając komórkę","Set cell:":"Ustaw komórkę:","To value:":"Wartość docelowa:","By changing cell:":"Zmieniając komórkę:","Goal Seek":"Szukanie wyniku","Goal Seek needs a formula cell, a target value and an input cell.":"Szukanie wyniku wymaga komórki z formułą, wartości docelowej i komórki wejściowej.","Goal Seek Status":"Stan szukania wyniku","Goal Seeking with Cell {name} found a solution.":"Szukanie wyniku dla komórki {name} pozwoliło znaleźć rozwiązanie.","Goal Seeking with Cell {name} may not have found a solution.":"Szukanie wyniku dla komórki {name} mogło nie znaleźć rozwiązania.","Target value:":"Wartość docelowa:","Current value:":"Wartość bieżąca:","Removed {count} duplicate rows.":"Usunięte zduplikowane wiersze: {count}.","No duplicate values found.":"Nie znaleziono zduplikowanych wartości.","Text to Columns can only convert one column at a time.":"Funkcja Tekst jako kolumny może konwertować tylko jedną kolumnę naraz.","Choose the file type that best describes your data:":"Wybierz typ pliku, który najlepiej opisuje dane:",Delimited:"Rozdzielany","Fixed width":"Stała szerokość",Delimiters:"Ograniczniki","delimiter|Tab":"Tabulator",Semicolon:"Średnik",Comma:"Przecinek",Space:"Spacja","Other delimiter":"Inny ogranicznik","Other:":"Inny:","Treat consecutive delimiters as one":"Traktuj kolejne ograniczniki jako jeden","Text qualifier":"Kwalifikator tekstu","Text qualifier:":"Kwalifikator tekstu:","qualifier|none":"brak","Break lines":"Linie podziału","e.g. 5, 12":"np. 5, 12","Break lines after character:":"Linie podziału po znaku:","Column data format":"Format danych w kolumnie","Do not import column (skip)":"Nie importuj kolumny (pomiń)",Destination:"Miejsce docelowe","Destination:":"Miejsce docelowe:","Decimal separator:":"Separator dziesiętny:","Thousands separator:":"Separator tysięcy:","separator|none":"brak","Step {step} of {count}":"Krok {step} z {count}","Preview of selected data:":"Podgląd zaznaczonych danych:","Convert Text to Columns Wizard":"Kreator konwersji tekstu na kolumny","My data has headers":"Moje dane mają nagłówki","Column {name}":"Kolumna {name}","To delete duplicate values, select one or more columns that contain duplicates.":"Aby usunąć zduplikowane wartości, zaznacz co najmniej jedną kolumnę zawierającą duplikaty.","Unselect All":"Usuń zaznaczenie wszystkich","Remove Duplicates":"Usuń duplikaty","{removed} duplicate values found and removed; {left} unique values remain.":"Znalezione i usunięte zduplikowane wartości: {removed}; pozostałe wartości unikatowe: {left}.","The name that you entered is not valid. Use letters, numbers, periods and underscores, start with a letter or underscore, and don't use a cell reference.":"Wprowadzona nazwa jest nieprawidłowa. Użyj liter, cyfr, kropek i podkreśleń, zacznij od litery lub podkreślenia i nie używaj odwołania do komórki.",Scope:"Zakres","Refers to":"Odwołuje się do","Edit Name":"Edytowanie nazwy","New Name":"Nowa nazwa","Scope:":"Zakres:","Comment:":"Komentarz:","Refers to:":"Odwołuje się do:","Enter what the name refers to.":"Wprowadź, do czego odwołuje się nazwa.","The name already exists. Enter a unique name.":"Nazwa już istnieje. Wprowadź unikatową nazwę.","Changed {name}.":"Zmieniono nazwę {name}.","Defined {name}.":"Zdefiniowano nazwę {name}.","Name Manager":"Menedżer nazw","Refers To":"Odwołuje się do","Paste name":"Wklej nazwę","Paste List":"Wklej listę","Paste Name":"Wklejanie nazwy","Apply names":"Zastosuj nazwy","Ignore Relative/Absolute":"Ignoruj względne/bezwzględne","Names of whole rows and columns are applied only when they match exactly":"Nazwy całych wierszy i kolumn są stosowane tylko wtedy, gdy są dokładnie dopasowane","Use row and column names":"Użyj nazw wierszy i kolumn","Apply Names":"Stosowanie nazw","Names applied in {count} formulas.":"Zastosowano nazwy w formułach: {count}.","No references matched the names.":"Żadne odwołanie nie pasuje do nazw.","No formula on this sheet reads the active cell.":"Żadna formuła w tym arkuszu nie odczytuje aktywnej komórki.","{count} dependent cells.":"Komórki zależne: {count}.","The active cell has no formula to evaluate.":"Aktywna komórka nie zawiera formuły do oszacowania.","Next: {piece}":"Następny krok: {piece}","This step can't be shown: {error}":"Nie można pokazać tego kroku: {error}",Evaluate:"Szacuj",Restart:"Uruchom ponownie","That is the final result.":"To jest wynik końcowy.","Evaluate Formula":"Szacowanie formuły","No formula errors on this sheet.":"W tym arkuszu nie ma błędów formuł.","Error {n} of {count} in {cell}: {code}":"Błąd {n} z {count} w komórce {cell}: {code}","Error Checking":"Sprawdzanie błędów",Previous:"Poprzedni","Add Watch":"Dodaj czujkę","Watch Window":"Okno czujki","Remove watch on {cell}":"Usuń czujkę komórki {cell}","calc|Automatic":"Automatyczne","calc|Automatic Except for Data Tables":"Automatyczne z wyjątkiem tabel danych","calc|Manual":"Ręczne","Top row":"Górnym wierszu","Left column":"Lewej kolumnie","Bottom row":"Dolnym wierszu","Right column":"Prawej kolumnie","Create Names from Selection":"Tworzenie nazw z zaznaczenia","Created {count} names.":"Utworzone nazwy: {count}.","No names defined":"Brak zdefiniowanych nazw","Page {n}":"Strona {n}",Percent:"Procent","Sheet name":"Nazwa arkusza","Merged cells":"Scalone komórki","Missing alternative text":"Brak tekstu alternatywnego","Check Accessibility":"Sprawdzanie ułatwień dostępu","{count} things to review.":"Elementy do przejrzenia: {count}.","Row input cell":"Komórka wejściowa wiersza","Column input cell":"Komórka wejściowa kolumny","Row input cell:":"Komórka wejściowa wiersza:","Column input cell:":"Komórka wejściowa kolumny:","Data Table":"Tabela danych","Enter a row input cell, a column input cell, or both.":"Wprowadź komórkę wejściową wiersza, komórkę wejściową kolumny lub obie.","Select the whole table first, with its input values and formulas.":"Najpierw zaznacz całą tabelę z wartościami wejściowymi i formułami.","Data table created.":"Utworzono tabelę danych.","Scenario name":"Nazwa scenariusza","Changing cells":"Komórki zmieniane","Edit Scenario":"Edytowanie scenariusza","Add Scenario":"Dodawanie scenariusza","Scenario name:":"Nazwa scenariusza:","Changing cells:":"Komórki zmieniane:","Ctrl+click cells to select non-adjacent changing cells.":"Aby zaznaczyć nieprzylegające komórki zmieniane, klikaj je z naciśniętym klawiszem Ctrl.",Protection:"Ochrona","Prevent changes":"Zapobiegaj zmianom","Type a name for the scenario.":"Wpisz nazwę scenariusza.","Scenario name already exists. Type a different name for the scenario.":"Nazwa scenariusza już istnieje. Wpisz inną nazwę scenariusza.","The changing cells reference isn't valid.":"Odwołanie do komórek zmienianych jest nieprawidłowe.","Value of {cell}":"Wartość komórki {cell}","Scenario Values":"Wartości scenariusza","Enter values for each of the changing cells.":"Wprowadź wartości dla każdej z komórek zmienianych.",Scenarios:"Scenariusze","No Scenarios defined. Choose Add to add scenarios.":"Nie zdefiniowano scenariuszy. Wybierz przycisk Dodaj, aby dodać scenariusze.","Summary…":"Podsumowanie…","Scenario Manager":"Menedżer scenariuszy","Scenarios:":"Scenariusze:","Result cells":"Komórki wynikowe","A scenario PivotTable report isn't available here":"Raport tabeli przestawnej scenariusza nie jest tu dostępny","Scenario Summary":"Podsumowanie scenariusza","Report type":"Typ raportu","Scenario summary":"Podsumowanie scenariusza","Scenario PivotTable report":"Raport tabeli przestawnej scenariusza","Result cells:":"Komórki wynikowe:","fn|Sum":"Suma","fn|Count":"Licznik","fn|Average":"Średnia","fn|Max":"Maksimum","fn|Min":"Minimum","fn|Product":"Iloczyn","fn|Count Numbers":"Licznik liczb","fn|StdDev":"Odch.Std","fn|StdDevp":"Odch.StdPopul","fn|Var":"Wariancja","fn|Varp":"WariancjaPopul",Reference:"Odwołanie","All references":"Wszystkie odwołania","Reference isn't valid.":"Odwołanie jest nieprawidłowe.","window|Consolidate":"Konsolidowanie","Select…":"Zaznacz…","Create links to source data":"Utwórz łącza z danymi źródłowymi","Function:":"Funkcja:","Reference:":"Odwołanie:","All references:":"Wszystkie odwołania:","Use labels in:":"Użyj etykiet w:","Consolidated with links into {cell}: {rows} rows, {cols} columns.":"Skonsolidowano z łączami do komórki {cell} (wiersze: {rows}, kolumny: {cols}).","Consolidated into {cell}: {rows} rows, {cols} columns.":"Skonsolidowano do komórki {cell} (wiersze: {rows}, kolumny: {cols}).","The cell or chart you're trying to change is on a protected sheet. To make a change, unprotect the sheet.":"Komórka lub wykres, który próbujesz zmienić, znajduje się w chronionym arkuszu. Aby wprowadzić zmianę, usuń ochronę arkusza.",Protected:"Chronione","The workbook is protected, so sheets can't be added, moved, renamed, hidden or deleted.":"Skoroszyt jest chroniony, więc nie można dodawać, przenosić, ukrywać ani usuwać arkuszy ani zmieniać ich nazw.","Confirm password":"Potwierdź hasło","Confirm password:":"Potwierdź hasło:","The passwords don't match.":"Hasła nie są zgodne.","Unprotect Sheet":"Nie chroń arkusza","The password you supplied is not correct.":"Podane hasło jest nieprawidłowe.","Password to unprotect (optional):":"Hasło do usunięcia ochrony (opcjonalne):","protect|Select locked cells":"Zaznaczanie zablokowanych komórek","protect|Select unlocked cells":"Zaznaczanie odblokowanych komórek","protect|Format cells":"Formatowanie komórek","protect|Format columns":"Formatowanie kolumn","protect|Format rows":"Formatowanie wierszy","protect|Insert columns":"Wstawianie kolumn","protect|Insert rows":"Wstawianie wierszy","protect|Insert hyperlinks":"Wstawianie hiperlinków","protect|Delete columns":"Usuwanie kolumn","protect|Delete rows":"Usuwanie wierszy","protect|Sort":"Sortowanie","protect|Use AutoFilter":"Używanie autofiltru","protect|Use PivotTable reports":"Używanie raportów tabeli przestawnej","protect|Edit objects":"Edytowanie obiektów","protect|Edit scenarios":"Edytowanie scenariuszy","Protect Sheet":"Chroń arkusz","Allow all users of this worksheet to:":"Zezwalaj wszystkim użytkownikom tego arkusza na:","Sheet protected.":"Arkusz jest chroniony.","Workbook unprotected.":"Usunięto ochronę skoroszytu.","Unprotect Workbook":"Nie chroń skoroszytu","Password (optional):":"Hasło (opcjonalne):","Protect Workbook":"Chroń skoroszyt","Protects the structure: sheets can't be added, moved, renamed, hidden or deleted.":"Chroni strukturę: nie można dodawać, przenosić, ukrywać ani usuwać arkuszy ani zmieniać ich nazw.","Workbook protected.":"Skoroszyt jest chroniony.","{shown} of {count} records found":"Znalezione rekordy: {shown} z {count}","{copied} of {count} records copied":"Skopiowane rekordy: {copied} z {count}","The extract range is full: the rest of the records were not copied.":"Zakres wyodrębniania jest pełny: pozostałe rekordy nie zostały skopiowane.","The extract range has a missing or invalid field name.":"W zakresie wyodrębniania brakuje nazwy pola lub jest ona nieprawidłowa.","Filter the list, in-place":"Filtruj listę na miejscu","Copy to another location":"Kopiuj w inne miejsce","List range":"Zakres listy","Criteria range":"Zakres kryteriów","Copy to":"Kopiuj do","Unique records only":"Tylko unikatowe rekordy","Copy to:":"Kopiuj do:","List range:":"Zakres listy:","Criteria range:":"Zakres kryteriów:","The list range isn't valid.":"Zakres listy jest nieprawidłowy.","The list range needs a row of field names and at least one row of data.":"Zakres listy wymaga wiersza nazw pól i co najmniej jednego wiersza danych.","The criteria range isn't valid.":"Zakres kryteriów jest nieprawidłowy.","Enter where to copy to.":"Wprowadź miejsce, do którego chcesz kopiować.","The Copy to range isn't valid.":"Zakres „Kopiuj do” jest nieprawidłowy.","You can only copy filtered data to the active sheet.":"Przefiltrowane dane można kopiować tylko do aktywnego arkusza.","The Copy to range can't overlap the list.":"Zakres „Kopiuj do” nie może nakładać się na listę.","To filter in place, the list must be on the active sheet.":"Aby filtrować na miejscu, lista musi znajdować się w aktywnym arkuszu.","Advanced Filter":"Filtr zaawansowany","This workbook has no links to other workbooks.":"Ten skoroszyt nie zawiera linków do innych skoroszytów.","Edit Links":"Edytuj linki","(unknown)":"(nieznany)",Worksheet:"Arkusz",Unknown:"Nieznany","Error: Source not found":"Błąd: nie znaleziono źródła","Error: Sheet not found":"Błąd: nie znaleziono arkusza","links|Source":"Źródło","links|Type":"Typ","links|Update":"Aktualizacja","links|Status":"Stan","A browser can't open a path by itself, so Update Values, Change Source, Open Source and Check Status ask you for the file.":"Przeglądarka nie może sama otworzyć ścieżki, dlatego polecenia Aktualizuj wartości, Zmień źródło, Otwórz źródło i Sprawdź stan proszą o wskazanie pliku.","Update Values":"Aktualizuj wartości","Change Source…":"Zmień źródło…","Open Source":"Otwórz źródło","Break Link":"Przerwij link","Breaking links permanently converts formulas and external references to their existing values. Break the link?":"Przerwanie linków trwale konwertuje formuły i odwołania zewnętrzne na ich bieżące wartości. Czy przerwać link?","Break Links":"Przerwij linki","Check Status":"Sprawdź stan","Print settings":"Ustawienia wydruku","Hidden rows, columns and filter settings":"Ukryte wiersze, kolumny i ustawienia filtru","Add View":"Dodawanie widoku","Include in view":"Uwzględnij w widoku","Enter a name for the view.":"Wprowadź nazwę widoku.",Views:"Widoki","Custom Views":"Widoki niestandardowe","Views:":"Widoki:","Delete the view {name}?":"Czy usunąć widok {name}?","Bad cell reference: {ref}":"Nieprawidłowe odwołanie do komórki: {ref}","Bad range: {ref}":"Nieprawidłowy zakres: {ref}","No sheet named {name}":"Brak arkusza o nazwie {name}","Script finished.":"Skrypt zakończył działanie.","Script error: {error}":"Błąd skryptu: {error}",Scripts:"Skrypty","Script name":"Nazwa skryptu","Script code":"Kod skryptu","Script {n}":"Skrypt {n}",Run:"Uruchom","Error: {error}":"Błąd: {error}","Finished.":"Zakończono.","Recording stopped.":"Zatrzymano rejestrowanie.","Recorded {time}":"Zarejestrowano {time}","Recording. Edits and formats are written to a script.":"Rejestrowanie. Zmiany i formaty są zapisywane w skrypcie.","Cells with data":"Komórki z danymi",Tables:"Tabele","Defined names":"Nazwy zdefiniowane","Last cell on this sheet":"Ostatnia komórka w tym arkuszu","Merged areas on this sheet":"Scalone obszary w tym arkuszu","Notes on this sheet":"Notatki w tym arkuszu","Workbook Statistics":"Statystyki skoroszytu","block|Punctuation":"Interpunkcja ogólna","block|Latin-1 Supplement":"Łaciński-1 — uzupełnienie","block|Latin Extended-A":"Łaciński rozszerzony-A","block|Greek":"Grecki","block|Currency":"Symbole walut","block|Letterlike":"Symbole literopodobne","block|Number Forms":"Formy liczbowe","block|Arrows":"Strzałki","block|Mathematical Operators":"Operatory matematyczne","block|Box Drawing":"Elementy ramek","block|Geometric Shapes":"Kształty geometryczne","block|Miscellaneous Symbols":"Różne symbole","block|Dingbats":"Dingbaty",Subset:"Podzbiór","Subset:":"Podzbiór:",Symbols:"Symbole","Character code: {code}":"Kod znaku: {code}",Symbol:"Symbol","(None yet)":"(Jeszcze brak)","Search for a function":"Wyszukaj funkcję",Category:"Kategoria","Category:":"Kategoria:","fncat|Financial":"Finansowe","fncat|Logical":"Logiczne","fncat|Text":"Tekstowe","fncat|Date & Time":"Daty i godziny","fncat|Lookup & Reference":"Wyszukiwanie i odwołania","fncat|Math & Trig":"Matematyczne i trygonometryczne","fncat|Statistical":"Statystyczne","fncat|Engineering":"Inżynierskie","fncat|Information":"Informacyjne","fncat|Database":"Bazy danych","fncat|Barcode":"Kody kreskowe","fncat|Sparkline":"Wykresy przebiegu w czasie","No functions match.":"Brak pasujących funkcji.","window|Insert Function":"Wstawianie funkcji","Your Name":"Twoje imię i nazwisko","Name shown on your comments:":"Nazwa wyświetlana przy Twoich komentarzach:","This cell has no comment.":"Ta komórka nie zawiera komentarza.","This sheet has no comments.":"Ten arkusz nie zawiera komentarzy.","Start a conversation":"Rozpocznij konwersację","New comment":"Nowy komentarz",Post:"Opublikuj","Edit comment":"Edytuj komentarz",Reply:"Odpowiedz","Reply on {cell}":"Odpowiedz w komórce {cell}",Reopen:"Otwórz ponownie",Resolve:"Rozwiąż","Today, {time}":"Dzisiaj, {time}","Comments are read-only in this workbook.":"Komentarze w tym skoroszycie są tylko do odczytu.","This cell has a note. A cell has either a note or a comment; delete the note to add a comment.":"Ta komórka zawiera notatkę. Komórka może zawierać notatkę albo komentarz; usuń notatkę, aby dodać komentarz.","Comment on {cell}":"Komentarz w komórce {cell}",Resolved:"Rozwiązany","Resolve thread":"Rozwiąż wątek","More thread actions":"Więcej akcji wątku","More actions":"Więcej akcji","Reopen Thread":"Otwórz ponownie wątek","Resolve Thread":"Rozwiąż wątek","Delete Thread":"Usuń wątek","Reply…":"Odpowiedz…","New comment on {cell}":"Nowy komentarz w komórce {cell}","Post (⌘Enter)":"Opublikuj (⌘Enter)",You:"Ty","Chart data range":"Zakres danych wykresu","Legend entries (Series)":"Wpisy legendy (serie)","Y values":"Wartości Y","Horizontal (Category) axis labels":"Etykiety osi poziomej (kategorii)","Series{n}":"Seria{n}","The Y values reference isn't valid.":"Odwołanie do wartości Y jest nieprawidłowe.","Switch Row/Column":"Przełącz wiersz/kolumnę","Show empty cells as":"Pokaż puste komórki jako",Gaps:"Przerwy",Zero:"Zero","Connect data points with line":"Połącz punkty danych linią","Select Data Source":"Wybieranie źródła danych","Chart data range:":"Zakres danych wykresu:","Legend entries (Series):":"Wpisy legendy (serie):","Y values:":"Wartości Y:","Horizontal (Category) axis labels:":"Etykiety osi poziomej (kategorii):","Hidden and Empty Cells":"Ukryte i puste komórki","Show empty cells as:":"Pokaż puste komórki jako:","Show data in hidden rows and columns":"Pokaż dane w ukrytych wierszach i kolumnach","The chart data range isn't valid.":"Zakres danych wykresu jest nieprawidłowy.","A chart needs at least one series.":"Wykres wymaga co najmniej jednej serii.","Range:":"Zakres:","window|Add Data":"Dodawanie danych","That range isn't valid.":"Ten zakres jest nieprawidłowy.","Save as Template":"Zapisz jako szablon","Template name:":"Nazwa szablonu:","Chart Template":"Szablon wykresu","Saved the chart template {name}.":"Zapisano szablon wykresu {name}.","Apply Template":"Zastosuj szablon","No templates":"Brak szablonów","Manage Templates…":"Zarządzaj szablonami…","Chart templates":"Szablony wykresów","Chart Templates":"Szablony wykresów","Templates are kept in this browser.":"Szablony są przechowywane w tej przeglądarce.","No more precedents to trace.":"Brak kolejnych poprzedników do śledzenia.","The active cell doesn't show an error.":"Aktywna komórka nie zawiera błędu.","The error doesn't come from another cell on this sheet.":"Błąd nie pochodzi z innej komórki w tym arkuszu.","English (United States)":"Angielski (Stany Zjednoczone)","English (United Kingdom)":"Angielski (Wielka Brytania)","Polish (Poland)":"Polski (Polska)","German (Germany)":"Niemiecki (Niemcy)","French (France)":"Francuski (Francja)","Spanish (Spain)":"Hiszpański (Hiszpania)","Italian (Italy)":"Włoski (Włochy)","Dutch (Netherlands)":"Holenderski (Holandia)","Portuguese (Brazil)":"Portugalski (Brazylia)","Czech (Czechia)":"Czeski (Czechy)","Swedish (Sweden)":"Szwedzki (Szwecja)","Ukrainian (Ukraine)":"Ukraiński (Ukraina)","Turkish (Türkiye)":"Turecki (Turcja)","Japanese (Japan)":"Japoński (Japonia)","Chinese (China)":"Chiński (Chiny)","Korean (Korea)":"Koreański (Korea)","Arabic (Saudi Arabia)":"Arabski (Arabia Saudyjska)","Hebrew (Israel)":"Hebrajski (Izrael)","Number: {number} Date: {date} List separator: {separator}":"Liczba: {number} Data: {date} Separator listy: {separator}","Text/Background - Dark 1":"Tekst/tło — ciemny 1","Text/Background - Light 1":"Tekst/tło — jasny 1","Text/Background - Dark 2":"Tekst/tło — ciemny 2","Text/Background - Light 2":"Tekst/tło — jasny 2","Accent 1":"Akcent 1","Accent 2":"Akcent 2","Accent 3":"Akcent 3","Accent 4":"Akcent 4","Accent 5":"Akcent 5","Accent 6":"Akcent 6","Followed Hyperlink":"Użyty hiperlink","Custom Theme…":"Motyw niestandardowy…","Custom Theme":"Motyw niestandardowy","Heading font":"Czcionka nagłówków","Body font":"Czcionka tekstu podstawowego","Theme name":"Nazwa motywu","Table Rows Above":"Wiersze tabeli powyżej","Table Rows Below":"Wiersze tabeli poniżej","Table Columns to the Left":"Kolumny tabeli z lewej","Table Columns to the Right":"Kolumny tabeli z prawej","Table Rows":"Wiersze tabeli","Table Columns":"Kolumny tabeli","Tables can't be sorted left to right.":"Tabel nie można sortować od lewej do prawej.","Export Sheet as Text (Tab delimited)…":"Eksportuj arkusz jako tekst (rozdzielany znakami tabulacji)…","Saved {name}: only the active sheet goes in this format.":"Zapisano {name}: w tym formacie zapisuje się tylko aktywny arkusz.","Start date:":"Data rozpoczęcia:","End date:":"Data zakończenia:","Start time:":"Godzina rozpoczęcia:","End time:":"Godzina zakończenia:","Time:":"Godzina:","Length:":"Długość:","Always show the ribbon":"Zawsze pokazuj wstążkę","Quick Access Toolbar":"Pasek narzędzi Szybki dostęp","Customize Quick Access Toolbar":"Dostosuj pasek narzędzi Szybki dostęp","That command isn't available here.":"To polecenie nie jest tu dostępne.","Remove from Quick Access Toolbar":"Usuń z paska narzędzi Szybki dostęp","Add to Quick Access Toolbar":"Dodaj do paska narzędzi Szybki dostęp","Customize the Ribbon…":"Dostosuj wstążkę…","Customize the Ribbon":"Dostosowywanie wstążki","Right-click a ribbon command to add it here":"Kliknij polecenie wstążki prawym przyciskiem, aby je tu dodać","Reset Quick Access Toolbar":"Resetuj pasek narzędzi Szybki dostęp","Collapse the Ribbon":"Zwiń wstążkę","Main Tabs":"Karty główne","The choice is kept in this browser. Right-click a command to add it to the Quick Access Toolbar.":"Wybór jest zapamiętywany w tej przeglądarce. Kliknij polecenie prawym przyciskiem, aby dodać je do paska narzędzi Szybki dostęp.","That command can't be used now.":"Tego polecenia nie można teraz użyć.","Keep at least one tab.":"Zostaw co najmniej jedną kartę.","A new version of 8sheets is ready.":"Nowa wersja 8sheets jest gotowa.",Later:"Później","8sheets was updated in another tab. Save your work, then reload to use the new version.":"Aplikacja 8sheets została zaktualizowana w innej karcie. Zapisz pracę, a potem wczytaj stronę ponownie, aby użyć nowej wersji."};export{e as default};
1
+ var e={"Excel Workbook":"Skoroszyt programu Excel","Excel Macro-Enabled Workbook":"Skoroszyt programu Excel z obsługą makr","Text files":"Pliki tekstowe","Preparing formulas…":"Przygotowywanie formuł…","Calculating: {pct}%":"Obliczanie: {pct}%",'Recovered "{name}" from {when}.':"Odzyskano plik „{name}” (stan z {when}).",Restore:"Przywróć",Discard:"Odrzuć","The file was not loaded completely because it exceeds the size of a worksheet.":"Plik nie został załadowany w całości, ponieważ przekracza rozmiar arkusza.","Opening {name}…":"Otwieranie pliku {name}…","Opening… {count} cells":"Otwieranie… (komórki: {count})","Ready (opened {count} cells in {secs} s)":"Gotowy (otwarte komórki: {count}, czas: {secs} s)","The file reader didn't start. Check the connection and try again.":"Nie udało się uruchomić czytnika plików. Sprawdź połączenie i spróbuj ponownie.","Couldn't open {name}: {error}":"Nie można otworzyć pliku {name}: {error}","Saved {name}":"Zapisano plik {name}","Couldn't save: {error}":"Nie można zapisać: {error}",'"{text}" is not a valid reference':"„{text}” nie jest prawidłowym odwołaniem","Couldn't open the file: {error}":"Nie można otworzyć pliku: {error}","Unsaved Changes":"Niezapisane zmiany","Discard unsaved changes in this workbook?":"Czy odrzucić niezapisane zmiany w tym skoroszycie?","Formulas in This File":"Formuły w tym pliku","{count} cells in this file start with = and are shown as text. Calculate them as formulas?\nCalculate only files from a source you trust: formulas can read web addresses or open links.":`Komórki w tym pliku zaczynające się od = (liczba: {count}) są wyświetlane jako tekst. Czy obliczyć je jako formuły?
2
+ Obliczaj tylko pliki z zaufanego źródła: formuły mogą odczytywać adresy internetowe i otwierać łącza.`,Calculate:"Oblicz","Keep as Text":"Zostaw jako tekst",'That password is not correct. "{name}" is protected. Enter its password.':"Hasło jest nieprawidłowe. Plik „{name}” jest chroniony. Wprowadź jego hasło.",'"{name}" is protected. Enter its password.':"Plik „{name}” jest chroniony. Wprowadź jego hasło.","Didn't open {name}":"Nie otwarto pliku {name}","Couldn't open {name}":"Nie udało się otworzyć pliku {name}","The file couldn't be downloaded ({reason}).":"Nie udało się pobrać pliku ({reason}).","The file couldn't be read.":"Nie udało się odczytać pliku.","Try again":"Spróbuj ponownie","Use an empty workbook":"Użyj pustego skoroszytu","Password to Open":"Hasło do otwarcia","Enter a new password, or leave it empty to remove the password.":"Wprowadź nowe hasło lub pozostaw pole puste, aby usunąć hasło.","Enter a password. If you lose it, the workbook cannot be recovered.":"Wprowadź hasło. Jeśli je zgubisz, nie będzie można odzyskać skoroszytu.","Enter the password again.":"Wprowadź ponownie hasło.","The password was not changed":"Hasło nie zostało zmienione","The passwords did not match, so it was not changed":"Hasła nie są zgodne, więc hasło nie zostało zmienione","The password applies from the next save":"Hasło będzie obowiązywać od następnego zapisu","The password is removed from the next save":"Hasło zostanie usunięte przy następnym zapisie","Saving…":"Zapisywanie…","Saving… {pct}%":"Zapisywanie… {pct}%","Saved ({size} MB in {secs} s)":"Zapisano ({size} MB w {secs} s)","The browser blocked clipboard access. Press ⌘V to paste.":"Przeglądarka zablokowała dostęp do schowka. Naciśnij ⌘V, aby wkleić.","Clear All":"Wyczyść wszystko","Clear Formats":"Wyczyść formaty","Clear Contents":"Wyczyść zawartość","Clear Comments and Notes":"Wyczyść komentarze i notatki","Clear Hyperlinks":"Wyczyść hiperlinki","Remove Hyperlinks":"Usuń hiperlinki","Clear Series":"Wyczyść serię","Find Next":"Znajdź następny","Find Previous":"Znajdź poprzedni","Rename Sheet":"Zmień nazwę arkusza","Hide Sheet":"Ukryj arkusz","Unhide Sheet…":"Odkryj arkusz…","Background…":"Tło…","About 8sheets":"8sheets — informacje","A spreadsheet that runs in the browser and keeps your files on your computer.":"Arkusz kalkulacyjny, który działa w przeglądarce i przechowuje pliki na Twoim komputerze.","What's new in this version":"Co nowego w tej wersji","Excel is a trademark of Microsoft. This app isn't made by or connected to Microsoft.":"Excel jest znakiem towarowym firmy Microsoft. Ta aplikacja nie została utworzona przez firmę Microsoft ani nie jest z nią powiązana.","View…":"Widok…","Calculation…":"Obliczanie…","AutoCorrect…":"Autokorekta…","Custom Lists…":"Listy niestandardowe…","Keyboard…":"Klawiatura…","The document is renamed. Save puts it under the new name; the old file stays where it was.":"Zmieniono nazwę dokumentu. Polecenie Zapisz zapisze go pod nową nazwą; stary plik pozostanie na swoim miejscu.","This browser has no share sheet, so {name} was downloaded to attach yourself.":"Ta przeglądarka nie ma arkusza udostępniania, więc plik {name} został pobrany, aby można go było samodzielnie załączyć.","From the next save, this workbook suggests opening read-only.":"Od następnego zapisu ten skoroszyt będzie sugerować otwieranie tylko do odczytu.","The workbook no longer suggests opening read-only.":"Skoroszyt nie sugeruje już otwierania tylko do odczytu.","Password to modify":"Hasło ochrony przed zmianami","Password to modify:":"Hasło ochrony przed zmianami:",Unchanged:"Bez zmian","Read-only recommended":"Zalecane tylko do odczytu","Remove the password to modify":"Usuń hasło ochrony przed zmianami",Passwords:"Hasła","Password to Open…":"Hasło do otwarcia…","Passwords and sharing apply from the next save.":"Hasła i ustawienia udostępniania będą obowiązywać od następnego zapisu.","{name} is reserved by {user}. Enter the password for write access, or leave it empty and open read-only.":"Plik {name} jest zastrzeżony przez użytkownika {user}. Wprowadź hasło, aby uzyskać prawo zapisu, lub pozostaw pole puste i otwórz plik tylko do odczytu.","{name} is reserved by its author. Enter the password for write access, or leave it empty and open read-only.":"Plik {name} jest zastrzeżony przez autora. Wprowadź hasło, aby uzyskać prawo zapisu, lub pozostaw pole puste i otwórz plik tylko do odczytu.","Opened read-only: Save asks for a new file.":"Otwarto tylko do odczytu: polecenie Zapisz poprosi o nowy plik.",'The author would like you to open "{name}" as read-only unless you need to make changes. Open as read-only?':"Autor chciałby, aby plik „{name}” był otwierany tylko do odczytu, chyba że musisz wprowadzić zmiany. Czy otworzyć tylko do odczytu?","Read-Only":"Tylko do odczytu","Set Print Area":"Ustaw obszar wydruku","Add to Print Area":"Dodaj do obszaru wydruku","Clear Print Area":"Wyczyść obszar wydruku","Excel Template":"Szablon programu Excel","New from Template…":"Nowy z szablonu…","Open Recent":"Otwórz ostatnie","Save As…":"Zapisz jako…","Save as Template…":"Zapisz jako szablon…","Export Sheet as CSV…":"Eksportuj arkusz jako CSV…","Export Sheet as Web Page…":"Eksportuj arkusz jako stronę internetową…","Export Sheet as Picture…":"Eksportuj arkusz jako obraz…","Export Sheet as Picture":"Eksport arkusza jako obrazu","Web Page":"Strona internetowa","Whole sheet":"Cały arkusz","The picture would be too large. Choose fewer cells or a smaller scale.":"Obraz byłby za duży. Wybierz mniej komórek lub mniejszą skalę.","Cells:":"Komórki:","Format:":"Format:","Move…":"Przenieś…","Choose the new place. A browser can't remove the old file, so delete it yourself if you want it gone.":"Wybierz nowe miejsce. Przeglądarka nie może usunąć starego pliku, więc usuń go samodzielnie, jeśli nie jest już potrzebny.",Import:"Importuj","Share…":"Udostępnij…","Send Workbook":"Wyślij skoroszyt","Send PDF":"Wyślij plik PDF","Always Open Read-Only":"Zawsze otwieraj tylko do odczytu","Passwords…":"Hasła…","Reduce File Size…":"Zmniejsz rozmiar pliku…","Page Setup…":"Ustawienia strony…","Print Area":"Obszar wydruku","About 8sheets…":"8sheets — informacje…","That file has no tables to import.":"Ten plik nie zawiera tabel do zaimportowania.","Imported {count} rows from {name}.":{one:"Zaimportowano {count} wiersz z pliku {name}.",few:"Zaimportowano {count} wiersze z pliku {name}.",many:"Zaimportowano {count} wierszy z pliku {name}.",other:"Zaimportowano {count} wiersza z pliku {name}."},"Table {n}: {caption}":"Tabela {n}: {caption}","From HTML":"Z pliku HTML","Choose a table:":"Wybierz tabelę:","From HTML…":"Z pliku HTML…","Bring to Front":"Przesuń na wierzch","Bring Forward":"Przesuń do przodu","Send Backward":"Przesuń do tyłu","Send to Back":"Przesuń na spód","Paste Special…":"Wklej specjalnie…","Insert Rows":"Wstaw wiersze","Insert Columns":"Wstaw kolumny","Delete Rows":"Usuń wiersze","Delete Columns":"Usuń kolumny","Column Width…":"Szerokość kolumny…","Row Height…":"Wysokość wiersza…","Rich Text…":"Tekst sformatowany…","Default Value…":"Wartość domyślna…","No recent files":"Brak ostatnio używanych plików","Clear Recent":"Wyczyść ostatnio używane","Freeze Panes isn't available in Page Layout view.":"Polecenie Zablokuj okienka jest niedostępne w widoku układu strony.","There is no room: data would be pushed off the end of the sheet.":"Brak miejsca: dane zostałyby wypchnięte poza koniec arkusza.","AutoSum needs empty cells next to the selection for the totals.":"Autosumowanie potrzebuje pustych komórek obok zaznaczenia na sumy.","The number must be between 1 and 409.":"Liczba musi należeć do zakresu od 1 do 409.","Type a font name.":"Wpisz nazwę czcionki.","Replace the existing definition of {names}?":"Zastąpić istniejącą definicję nazwy {names}?","This can't be applied to the selected range. Select a single cell in a range and try again.":"Nie można zastosować tego do zaznaczonego zakresu. Zaznacz jedną komórkę w zakresie i spróbuj ponownie.","Copy cells in this workbook first, then use Paste Special.":"Najpierw skopiuj komórki w tym skoroszycie, a następnie użyj polecenia Wklej specjalnie.","(No items)":"(Brak elementów)","This cell doesn't allow editing.":"Ta komórka nie zezwala na edycję.","You can't change part of a data table.":"Nie można zmienić części tabeli danych.","{rows}R x {cols}C":"{rows}W x {cols}K","That selection is too large to copy to the clipboard":"To zaznaczenie jest zbyt duże, aby skopiować je do schowka",Allow:"Dozwolone","Any value":"Dowolna wartość","Whole number":"Pełna liczba",Decimal:"Dziesiętne",List:"Lista","Text length":"Długość tekstu",Custom:"Niestandardowe","dv|Data":"Wartości",between:"między","not between":"nie między","equal to":"równa","not equal to":"różna od","greater than":"większa niż","less than":"mniejsza niż","greater than or equal to":"większa lub równa","less than or equal to":"mniejsza lub równa","Minimum, source or formula":"Minimum, źródło lub formuła","Maximum:":"Maksimum:","Ignore blank":"Ignoruj puste","In-cell dropdown":"Rozwinięcie w komórce","Apply these changes to all other cells with the same settings":"Zastosuj te zmiany do wszystkich innych komórek z tymi samymi ustawieniami","Show input message when cell is selected":"Pokaż komunikat wejściowy, jeśli komórka jest zaznaczona","Input title":"Tytuł komunikatu wejściowego","Input message":"Komunikat wejściowy","Show error alert after invalid data is entered":"Pokazuj alerty o błędach po wprowadzeniu nieprawidłowych danych","Error style":"Styl błędu",Stop:"Zatrzymaj","Error title":"Tytuł błędu","Error message":"Komunikat o błędzie","Source:":"Źródło:","Formula:":"Formuła:","Minimum:":"Minimum:","Value:":"Wartość:","Validation criteria":"Kryteria poprawności","Allow:":"Dozwolone:","Data:":"Wartości:","When cell is selected, show this input message:":"Po zaznaczeniu komórki pokaż ten komunikat wejściowy:","Title:":"Tytuł:","Input message:":"Komunikat wejściowy:","When user enters invalid data, show this error alert:":"Po wprowadzeniu nieprawidłowych danych pokaż ten alert o błędzie:","Style:":"Styl:","Error message:":"Komunikat o błędzie:","Input Message":"Komunikat wejściowy","Error Alert":"Alert o błędzie","window|Data Validation":"Sprawdzanie poprawności danych","This sheet is protected with a password, which this app can't check yet.":"Ten arkusz jest chroniony hasłem, którego ta aplikacja nie może jeszcze sprawdzić.","Sheet unprotected.":"Usunięto ochronę arkusza.","Sheet protected. Locked cells can't be changed.":"Arkusz jest chroniony. Nie można zmieniać zablokowanych komórek.","The active cell has no formula to trace.":"Aktywna komórka nie zawiera formuły do śledzenia.","Data Range":"Zakres danych","Location Range":"Zakres lokalizacji","Data Range:":"Zakres danych:","Location Range:":"Zakres lokalizacji:","Choose the data that you want":"Wybierz odpowiednie dane","Choose where you want the sparklines to be placed":"Wybierz, gdzie mają zostać umieszczone wykresy przebiegu w czasie","Create Sparklines":"Tworzenie wykresów przebiegu w czasie","Data Reference is not valid.":"Odwołanie do danych jest nieprawidłowe.","Location reference is not valid because the cells are not all in the same column or same row. Select cells that are all in a single column or row.":"Odwołanie do lokalizacji jest nieprawidłowe, ponieważ komórki nie znajdują się w tej samej kolumnie lub w tym samym wierszu. Zaznacz komórki znajdujące się w jednej kolumnie lub w jednym wierszu.","Data Reference is not valid because the dimensions of the data range and the location range don't match.":"Odwołanie do danych jest nieprawidłowe, ponieważ wymiary zakresu danych i zakresu lokalizacji nie są zgodne.","A table can't overlap another table.":"Tabela nie może nakładać się na inną tabelę.","Light Style {n}":"Jasny styl {n}","Medium Style {n}":"Średni styl {n}","Dark Style {n}":"Ciemny styl {n}",Light:"Jasny",Medium:"Średni",Dark:"Ciemny","New Table Style…":"Nowy styl tabeli…","Set As Default":"Ustaw jako domyślny","Set as default table style for this document":"Ustaw jako domyślny styl tabeli dla tego dokumentu","Flash Fill needs data in the column to the left.":"Wypełnianie błyskawiczne wymaga danych w kolumnie po lewej stronie.","Type an example of the pattern first, then use Flash Fill.":"Najpierw wpisz przykład wzorca, a następnie użyj wypełniania błyskawicznego.","Flash Fill couldn't find a pattern. Type another example.":"Wypełnianie błyskawiczne nie znalazło wzorca. Wpisz inny przykład.","Flash Fill filled {count} cells.":"Wypełnianie błyskawiczne wypełniło komórki: {count}.","Set cell":"Ustaw komórkę","To value":"Wartość docelowa","By changing cell":"Zmieniając komórkę","Set cell:":"Ustaw komórkę:","To value:":"Wartość docelowa:","By changing cell:":"Zmieniając komórkę:","Goal Seek":"Szukanie wyniku","Goal Seek needs a formula cell, a target value and an input cell.":"Szukanie wyniku wymaga komórki z formułą, wartości docelowej i komórki wejściowej.","Goal Seek Status":"Stan szukania wyniku","Goal Seeking with Cell {name} found a solution.":"Szukanie wyniku dla komórki {name} pozwoliło znaleźć rozwiązanie.","Goal Seeking with Cell {name} may not have found a solution.":"Szukanie wyniku dla komórki {name} mogło nie znaleźć rozwiązania.","Target value:":"Wartość docelowa:","Current value:":"Wartość bieżąca:","Removed {count} duplicate rows.":"Usunięte zduplikowane wiersze: {count}.","No duplicate values found.":"Nie znaleziono zduplikowanych wartości.","Text to Columns can only convert one column at a time.":"Funkcja Tekst jako kolumny może konwertować tylko jedną kolumnę naraz.","Choose the file type that best describes your data:":"Wybierz typ pliku, który najlepiej opisuje dane:",Delimited:"Rozdzielany","Fixed width":"Stała szerokość",Delimiters:"Ograniczniki","delimiter|Tab":"Tabulator",Semicolon:"Średnik",Comma:"Przecinek",Space:"Spacja","Other delimiter":"Inny ogranicznik","Other:":"Inny:","Treat consecutive delimiters as one":"Traktuj kolejne ograniczniki jako jeden","Text qualifier":"Kwalifikator tekstu","Text qualifier:":"Kwalifikator tekstu:","qualifier|none":"brak","Break lines":"Linie podziału","e.g. 5, 12":"np. 5, 12","Break lines after character:":"Linie podziału po znaku:","Column data format":"Format danych w kolumnie","Do not import column (skip)":"Nie importuj kolumny (pomiń)",Destination:"Miejsce docelowe","Destination:":"Miejsce docelowe:","Decimal separator:":"Separator dziesiętny:","Thousands separator:":"Separator tysięcy:","separator|none":"brak","Step {step} of {count}":"Krok {step} z {count}","Preview of selected data:":"Podgląd zaznaczonych danych:","Convert Text to Columns Wizard":"Kreator konwersji tekstu na kolumny","My data has headers":"Moje dane mają nagłówki","Column {name}":"Kolumna {name}","To delete duplicate values, select one or more columns that contain duplicates.":"Aby usunąć zduplikowane wartości, zaznacz co najmniej jedną kolumnę zawierającą duplikaty.","Unselect All":"Usuń zaznaczenie wszystkich","Remove Duplicates":"Usuń duplikaty","{removed} duplicate values found and removed; {left} unique values remain.":"Znalezione i usunięte zduplikowane wartości: {removed}; pozostałe wartości unikatowe: {left}.","The name that you entered is not valid. Use letters, numbers, periods and underscores, start with a letter or underscore, and don't use a cell reference.":"Wprowadzona nazwa jest nieprawidłowa. Użyj liter, cyfr, kropek i podkreśleń, zacznij od litery lub podkreślenia i nie używaj odwołania do komórki.",Scope:"Zakres","Refers to":"Odwołuje się do","Edit Name":"Edytowanie nazwy","New Name":"Nowa nazwa","Scope:":"Zakres:","Comment:":"Komentarz:","Refers to:":"Odwołuje się do:","Enter what the name refers to.":"Wprowadź, do czego odwołuje się nazwa.","The name already exists. Enter a unique name.":"Nazwa już istnieje. Wprowadź unikatową nazwę.","Changed {name}.":"Zmieniono nazwę {name}.","Defined {name}.":"Zdefiniowano nazwę {name}.","Name Manager":"Menedżer nazw","Refers To":"Odwołuje się do","Paste name":"Wklej nazwę","Paste List":"Wklej listę","Paste Name":"Wklejanie nazwy","Apply names":"Zastosuj nazwy","Ignore Relative/Absolute":"Ignoruj względne/bezwzględne","Names of whole rows and columns are applied only when they match exactly":"Nazwy całych wierszy i kolumn są stosowane tylko wtedy, gdy są dokładnie dopasowane","Use row and column names":"Użyj nazw wierszy i kolumn","Apply Names":"Stosowanie nazw","Names applied in {count} formulas.":"Zastosowano nazwy w formułach: {count}.","No references matched the names.":"Żadne odwołanie nie pasuje do nazw.","No formula on this sheet reads the active cell.":"Żadna formuła w tym arkuszu nie odczytuje aktywnej komórki.","{count} dependent cells.":"Komórki zależne: {count}.","The active cell has no formula to evaluate.":"Aktywna komórka nie zawiera formuły do oszacowania.","Next: {piece}":"Następny krok: {piece}","This step can't be shown: {error}":"Nie można pokazać tego kroku: {error}",Evaluate:"Szacuj",Restart:"Uruchom ponownie","That is the final result.":"To jest wynik końcowy.","Evaluate Formula":"Szacowanie formuły","The error check is complete for the entire sheet.":"Sprawdzanie błędów całego arkusza zostało zakończone.","Error {n} of {count} in {cell}: {code}":"Błąd {n} z {count} w komórce {cell}: {code}","Error Checking":"Sprawdzanie błędów",Previous:"Poprzedni","Add Watch":"Dodaj czujkę","Watch Window":"Okno czujki","Remove watch on {cell}":"Usuń czujkę komórki {cell}","calc|Automatic":"Automatyczne","calc|Automatic Except for Data Tables":"Automatyczne z wyjątkiem tabel danych","calc|Manual":"Ręczne","Top row":"Górnym wierszu","Left column":"Lewej kolumnie","Bottom row":"Dolnym wierszu","Right column":"Prawej kolumnie","Create Names from Selection":"Tworzenie nazw z zaznaczenia","Created {count} names.":"Utworzone nazwy: {count}.","No names defined":"Brak zdefiniowanych nazw","Page {n}":"Strona {n}",Percent:"Procent","Sheet name":"Nazwa arkusza","Merged cells":"Scalone komórki","Missing alternative text":"Brak tekstu alternatywnego","Check Accessibility":"Sprawdzanie ułatwień dostępu","{count} things to review.":"Elementy do przejrzenia: {count}.","Row input cell":"Komórka wejściowa wiersza","Column input cell":"Komórka wejściowa kolumny","Row input cell:":"Komórka wejściowa wiersza:","Column input cell:":"Komórka wejściowa kolumny:","Data Table":"Tabela danych","Enter a row input cell, a column input cell, or both.":"Wprowadź komórkę wejściową wiersza, komórkę wejściową kolumny lub obie.","Select the whole table first, with its input values and formulas.":"Najpierw zaznacz całą tabelę z wartościami wejściowymi i formułami.","Data table created.":"Utworzono tabelę danych.","Scenario name":"Nazwa scenariusza","Changing cells":"Komórki zmieniane","Edit Scenario":"Edytowanie scenariusza","Add Scenario":"Dodawanie scenariusza","Scenario name:":"Nazwa scenariusza:","Changing cells:":"Komórki zmieniane:","Ctrl+click cells to select non-adjacent changing cells.":"Aby zaznaczyć nieprzylegające komórki zmieniane, klikaj je z naciśniętym klawiszem Ctrl.",Protection:"Ochrona","Prevent changes":"Zapobiegaj zmianom","Type a name for the scenario.":"Wpisz nazwę scenariusza.","Scenario name already exists. Type a different name for the scenario.":"Nazwa scenariusza już istnieje. Wpisz inną nazwę scenariusza.","The changing cells reference isn't valid.":"Odwołanie do komórek zmienianych jest nieprawidłowe.","Value of {cell}":"Wartość komórki {cell}","Scenario Values":"Wartości scenariusza","Enter values for each of the changing cells.":"Wprowadź wartości dla każdej z komórek zmienianych.",Scenarios:"Scenariusze","No Scenarios defined. Choose Add to add scenarios.":"Nie zdefiniowano scenariuszy. Wybierz przycisk Dodaj, aby dodać scenariusze.","Summary…":"Podsumowanie…","Scenario Manager":"Menedżer scenariuszy","Scenarios:":"Scenariusze:","Result cells":"Komórki wynikowe","A scenario PivotTable report isn't available here":"Raport tabeli przestawnej scenariusza nie jest tu dostępny","Scenario Summary":"Podsumowanie scenariusza","Report type":"Typ raportu","Scenario summary":"Podsumowanie scenariusza","Scenario PivotTable report":"Raport tabeli przestawnej scenariusza","Result cells:":"Komórki wynikowe:","fn|Sum":"Suma","fn|Count":"Licznik","fn|Average":"Średnia","fn|Max":"Maksimum","fn|Min":"Minimum","fn|Product":"Iloczyn","fn|Count Numbers":"Licznik liczb","fn|StdDev":"Odch.Std","fn|StdDevp":"Odch.StdPopul","fn|Var":"Wariancja","fn|Varp":"WariancjaPopul",Reference:"Odwołanie","All references":"Wszystkie odwołania","Reference isn't valid.":"Odwołanie jest nieprawidłowe.","window|Consolidate":"Konsolidowanie","Select…":"Zaznacz…","Create links to source data":"Utwórz łącza z danymi źródłowymi","Function:":"Funkcja:","Reference:":"Odwołanie:","All references:":"Wszystkie odwołania:","Use labels in:":"Użyj etykiet w:","Consolidated with links into {cell}: {rows} rows, {cols} columns.":"Skonsolidowano z łączami do komórki {cell} (wiersze: {rows}, kolumny: {cols}).","Consolidated into {cell}: {rows} rows, {cols} columns.":"Skonsolidowano do komórki {cell} (wiersze: {rows}, kolumny: {cols}).","The cell or chart you're trying to change is on a protected sheet. To make a change, unprotect the sheet.":"Komórka lub wykres, który próbujesz zmienić, znajduje się w chronionym arkuszu. Aby wprowadzić zmianę, usuń ochronę arkusza.",Protected:"Chronione","The workbook is protected, so sheets can't be added, moved, renamed, hidden or deleted.":"Skoroszyt jest chroniony, więc nie można dodawać, przenosić, ukrywać ani usuwać arkuszy ani zmieniać ich nazw.","Confirm password":"Potwierdź hasło","Confirm password:":"Potwierdź hasło:","The passwords don't match.":"Hasła nie są zgodne.","Unprotect Sheet":"Nie chroń arkusza","The password you supplied is not correct.":"Podane hasło jest nieprawidłowe.","Password to unprotect (optional):":"Hasło do usunięcia ochrony (opcjonalne):","protect|Select locked cells":"Zaznaczanie zablokowanych komórek","protect|Select unlocked cells":"Zaznaczanie odblokowanych komórek","protect|Format cells":"Formatowanie komórek","protect|Format columns":"Formatowanie kolumn","protect|Format rows":"Formatowanie wierszy","protect|Insert columns":"Wstawianie kolumn","protect|Insert rows":"Wstawianie wierszy","protect|Insert hyperlinks":"Wstawianie hiperlinków","protect|Delete columns":"Usuwanie kolumn","protect|Delete rows":"Usuwanie wierszy","protect|Sort":"Sortowanie","protect|Use AutoFilter":"Używanie autofiltru","protect|Use PivotTable reports":"Używanie raportów tabeli przestawnej","protect|Edit objects":"Edytowanie obiektów","protect|Edit scenarios":"Edytowanie scenariuszy","Protect Sheet":"Chroń arkusz","Allow all users of this worksheet to:":"Zezwalaj wszystkim użytkownikom tego arkusza na:","Sheet protected.":"Arkusz jest chroniony.","Workbook unprotected.":"Usunięto ochronę skoroszytu.","Unprotect Workbook":"Nie chroń skoroszytu","Password (optional):":"Hasło (opcjonalne):","Protect Workbook":"Chroń skoroszyt","Protects the structure: sheets can't be added, moved, renamed, hidden or deleted.":"Chroni strukturę: nie można dodawać, przenosić, ukrywać ani usuwać arkuszy ani zmieniać ich nazw.","Workbook protected.":"Skoroszyt jest chroniony.","{shown} of {count} records found":"Znalezione rekordy: {shown} z {count}","{copied} of {count} records copied":"Skopiowane rekordy: {copied} z {count}","The extract range is full: the rest of the records were not copied.":"Zakres wyodrębniania jest pełny: pozostałe rekordy nie zostały skopiowane.","The extract range has a missing or invalid field name.":"W zakresie wyodrębniania brakuje nazwy pola lub jest ona nieprawidłowa.","Filter the list, in-place":"Filtruj listę na miejscu","Copy to another location":"Kopiuj w inne miejsce","List range":"Zakres listy","Criteria range":"Zakres kryteriów","Copy to":"Kopiuj do","Unique records only":"Tylko unikatowe rekordy","Copy to:":"Kopiuj do:","List range:":"Zakres listy:","Criteria range:":"Zakres kryteriów:","The list range isn't valid.":"Zakres listy jest nieprawidłowy.","The list range needs a row of field names and at least one row of data.":"Zakres listy wymaga wiersza nazw pól i co najmniej jednego wiersza danych.","The criteria range isn't valid.":"Zakres kryteriów jest nieprawidłowy.","Enter where to copy to.":"Wprowadź miejsce, do którego chcesz kopiować.","The Copy to range isn't valid.":"Zakres „Kopiuj do” jest nieprawidłowy.","You can only copy filtered data to the active sheet.":"Przefiltrowane dane można kopiować tylko do aktywnego arkusza.","The Copy to range can't overlap the list.":"Zakres „Kopiuj do” nie może nakładać się na listę.","To filter in place, the list must be on the active sheet.":"Aby filtrować na miejscu, lista musi znajdować się w aktywnym arkuszu.","Advanced Filter":"Filtr zaawansowany","This workbook has no links to other workbooks.":"Ten skoroszyt nie zawiera linków do innych skoroszytów.","Edit Links":"Edytuj linki","(unknown)":"(nieznany)",Worksheet:"Arkusz",Unknown:"Nieznany","Error: Source not found":"Błąd: nie znaleziono źródła","Error: Sheet not found":"Błąd: nie znaleziono arkusza","links|Source":"Źródło","links|Type":"Typ","links|Update":"Aktualizacja","links|Status":"Stan","A browser can't open a path by itself, so Update Values, Change Source, Open Source and Check Status ask you for the file.":"Przeglądarka nie może sama otworzyć ścieżki, dlatego polecenia Aktualizuj wartości, Zmień źródło, Otwórz źródło i Sprawdź stan proszą o wskazanie pliku.","Update Values":"Aktualizuj wartości","Change Source…":"Zmień źródło…","Open Source":"Otwórz źródło","Break Link":"Przerwij link","Breaking links permanently converts formulas and external references to their existing values. Break the link?":"Przerwanie linków trwale konwertuje formuły i odwołania zewnętrzne na ich bieżące wartości. Czy przerwać link?","Break Links":"Przerwij linki","Check Status":"Sprawdź stan","Print settings":"Ustawienia wydruku","Hidden rows, columns and filter settings":"Ukryte wiersze, kolumny i ustawienia filtru","Add View":"Dodawanie widoku","Include in view":"Uwzględnij w widoku","Enter a name for the view.":"Wprowadź nazwę widoku.",Views:"Widoki","Custom Views":"Widoki niestandardowe","Views:":"Widoki:","Delete the view {name}?":"Czy usunąć widok {name}?","Bad cell reference: {ref}":"Nieprawidłowe odwołanie do komórki: {ref}","Bad range: {ref}":"Nieprawidłowy zakres: {ref}","No sheet named {name}":"Brak arkusza o nazwie {name}","Script finished.":"Skrypt zakończył działanie.","Script error: {error}":"Błąd skryptu: {error}",Scripts:"Skrypty","Script name":"Nazwa skryptu","Script code":"Kod skryptu","Script {n}":"Skrypt {n}",Run:"Uruchom","Error: {error}":"Błąd: {error}","Finished.":"Zakończono.","Recording stopped.":"Zatrzymano rejestrowanie.","Recorded {time}":"Zarejestrowano {time}","Recording. Edits and formats are written to a script.":"Rejestrowanie. Zmiany i formaty są zapisywane w skrypcie.","Cells with data":"Komórki z danymi",Tables:"Tabele","Defined names":"Nazwy zdefiniowane","Last cell on this sheet":"Ostatnia komórka w tym arkuszu","Merged areas on this sheet":"Scalone obszary w tym arkuszu","Notes on this sheet":"Notatki w tym arkuszu","Workbook Statistics":"Statystyki skoroszytu","block|Punctuation":"Interpunkcja ogólna","block|Latin-1 Supplement":"Łaciński-1 — uzupełnienie","block|Latin Extended-A":"Łaciński rozszerzony-A","block|Greek":"Grecki","block|Currency":"Symbole walut","block|Letterlike":"Symbole literopodobne","block|Number Forms":"Formy liczbowe","block|Arrows":"Strzałki","block|Mathematical Operators":"Operatory matematyczne","block|Box Drawing":"Elementy ramek","block|Geometric Shapes":"Kształty geometryczne","block|Miscellaneous Symbols":"Różne symbole","block|Dingbats":"Dingbaty",Subset:"Podzbiór","Subset:":"Podzbiór:",Symbols:"Symbole","Character code: {code}":"Kod znaku: {code}",Symbol:"Symbol","(None yet)":"(Jeszcze brak)","Search for a function":"Wyszukaj funkcję",Category:"Kategoria","Category:":"Kategoria:","fncat|Financial":"Finansowe","fncat|Logical":"Logiczne","fncat|Text":"Tekstowe","fncat|Date & Time":"Daty i godziny","fncat|Lookup & Reference":"Wyszukiwanie i odwołania","fncat|Math & Trig":"Matematyczne i trygonometryczne","fncat|Statistical":"Statystyczne","fncat|Engineering":"Inżynierskie","fncat|Information":"Informacyjne","fncat|Database":"Bazy danych","fncat|Barcode":"Kody kreskowe","fncat|Sparkline":"Wykresy przebiegu w czasie","No functions match.":"Brak pasujących funkcji.","window|Insert Function":"Wstawianie funkcji","Your Name":"Twoje imię i nazwisko","Name shown on your comments:":"Nazwa wyświetlana przy Twoich komentarzach:","This cell has no comment.":"Ta komórka nie zawiera komentarza.","This sheet has no comments.":"Ten arkusz nie zawiera komentarzy.","Start a conversation":"Rozpocznij konwersację","New comment":"Nowy komentarz",Post:"Opublikuj","Edit comment":"Edytuj komentarz",Reply:"Odpowiedz","Reply on {cell}":"Odpowiedz w komórce {cell}",Reopen:"Otwórz ponownie",Resolve:"Rozwiąż","Today, {time}":"Dzisiaj, {time}","Comments are read-only in this workbook.":"Komentarze w tym skoroszycie są tylko do odczytu.","This cell has a note. A cell has either a note or a comment; delete the note to add a comment.":"Ta komórka zawiera notatkę. Komórka może zawierać notatkę albo komentarz; usuń notatkę, aby dodać komentarz.","Comment on {cell}":"Komentarz w komórce {cell}",Resolved:"Rozwiązany","Resolve thread":"Rozwiąż wątek","More thread actions":"Więcej akcji wątku","More actions":"Więcej akcji","Reopen Thread":"Otwórz ponownie wątek","Resolve Thread":"Rozwiąż wątek","Delete Thread":"Usuń wątek","Reply…":"Odpowiedz…","New comment on {cell}":"Nowy komentarz w komórce {cell}","Post (⌘Enter)":"Opublikuj (⌘Enter)",You:"Ty","Chart data range":"Zakres danych wykresu","Legend entries (Series)":"Wpisy legendy (serie)","Y values":"Wartości Y","Horizontal (Category) axis labels":"Etykiety osi poziomej (kategorii)","Series{n}":"Seria{n}","The Y values reference isn't valid.":"Odwołanie do wartości Y jest nieprawidłowe.","Switch Row/Column":"Przełącz wiersz/kolumnę","Show empty cells as":"Pokaż puste komórki jako",Gaps:"Przerwy",Zero:"Zero","Connect data points with line":"Połącz punkty danych linią","Select Data Source":"Wybieranie źródła danych","Chart data range:":"Zakres danych wykresu:","Legend entries (Series):":"Wpisy legendy (serie):","Y values:":"Wartości Y:","Horizontal (Category) axis labels:":"Etykiety osi poziomej (kategorii):","Hidden and Empty Cells":"Ukryte i puste komórki","Show empty cells as:":"Pokaż puste komórki jako:","Show data in hidden rows and columns":"Pokaż dane w ukrytych wierszach i kolumnach","The chart data range isn't valid.":"Zakres danych wykresu jest nieprawidłowy.","A chart needs at least one series.":"Wykres wymaga co najmniej jednej serii.","Range:":"Zakres:","window|Add Data":"Dodawanie danych","That range isn't valid.":"Ten zakres jest nieprawidłowy.","Save as Template":"Zapisz jako szablon","Template name:":"Nazwa szablonu:","Chart Template":"Szablon wykresu","Saved the chart template {name}.":"Zapisano szablon wykresu {name}.","Apply Template":"Zastosuj szablon","No templates":"Brak szablonów","Manage Templates…":"Zarządzaj szablonami…","Chart templates":"Szablony wykresów","Chart Templates":"Szablony wykresów","Templates are kept in this browser.":"Szablony są przechowywane w tej przeglądarce.","No more precedents to trace.":"Brak kolejnych poprzedników do śledzenia.","The active cell doesn't show an error.":"Aktywna komórka nie zawiera błędu.","The error doesn't come from another cell on this sheet.":"Błąd nie pochodzi z innej komórki w tym arkuszu.","English (United States)":"Angielski (Stany Zjednoczone)","English (United Kingdom)":"Angielski (Wielka Brytania)","Number: {number} Date: {date} List separator: {separator}":"Liczba: {number} Data: {date} Separator listy: {separator}","Text/Background - Dark 1":"Tekst/tło — ciemny 1","Text/Background - Light 1":"Tekst/tło — jasny 1","Text/Background - Dark 2":"Tekst/tło — ciemny 2","Text/Background - Light 2":"Tekst/tło — jasny 2","Accent 1":"Akcent 1","Accent 2":"Akcent 2","Accent 3":"Akcent 3","Accent 4":"Akcent 4","Accent 5":"Akcent 5","Accent 6":"Akcent 6","Followed Hyperlink":"Użyty hiperlink","Custom Theme…":"Motyw niestandardowy…","Custom Theme":"Motyw niestandardowy","Heading font":"Czcionka nagłówków","Body font":"Czcionka tekstu podstawowego","Theme name":"Nazwa motywu","Table Rows Above":"Wiersze tabeli powyżej","Table Rows Below":"Wiersze tabeli poniżej","Table Columns to the Left":"Kolumny tabeli z lewej","Table Columns to the Right":"Kolumny tabeli z prawej","Table Rows":"Wiersze tabeli","Table Columns":"Kolumny tabeli","Tables can't be sorted left to right.":"Tabel nie można sortować od lewej do prawej.","Export Sheet as Text (Tab delimited)…":"Eksportuj arkusz jako tekst (rozdzielany znakami tabulacji)…","Saved {name}: only the active sheet goes in this format.":"Zapisano {name}: w tym formacie zapisuje się tylko aktywny arkusz.","Start date:":"Data rozpoczęcia:","End date:":"Data zakończenia:","Start time:":"Godzina rozpoczęcia:","End time:":"Godzina zakończenia:","Time:":"Godzina:","Length:":"Długość:","Always show the ribbon":"Zawsze pokazuj wstążkę","Quick Access Toolbar":"Pasek narzędzi Szybki dostęp","Customize Quick Access Toolbar":"Dostosuj pasek narzędzi Szybki dostęp","That command isn't available here.":"To polecenie nie jest tu dostępne.","Remove from Quick Access Toolbar":"Usuń z paska narzędzi Szybki dostęp","Add to Quick Access Toolbar":"Dodaj do paska narzędzi Szybki dostęp","Customize the Ribbon…":"Dostosuj wstążkę…","Customize the Ribbon":"Dostosowywanie wstążki","Right-click a ribbon command to add it here":"Kliknij polecenie wstążki prawym przyciskiem, aby je tu dodać","Reset Quick Access Toolbar":"Resetuj pasek narzędzi Szybki dostęp","Collapse the Ribbon":"Zwiń wstążkę","Main Tabs":"Karty główne","The choice is kept in this browser. Right-click a command to add it to the Quick Access Toolbar.":"Wybór jest zapamiętywany w tej przeglądarce. Kliknij polecenie prawym przyciskiem, aby dodać je do paska narzędzi Szybki dostęp.","That command can't be used now.":"Tego polecenia nie można teraz użyć.","Keep at least one tab.":"Zostaw co najmniej jedną kartę.","A new version of 8sheets is ready.":"Nowa wersja 8sheets jest gotowa.",Later:"Później","8sheets was updated in another tab. Save your work, then reload to use the new version.":"Aplikacja 8sheets została zaktualizowana w innej karcie. Zapisz pracę, a potem wczytaj stronę ponownie, aby użyć nowej wersji.","The browser blocked the new window. Allow pop-ups for this page and try again.":"Przeglądarka zablokowała nowe okno. Zezwól tej stronie na wyskakujące okna i spróbuj ponownie.","The workbook's other window isn't there any more.":"Drugiego okna skoroszytu już nie ma.",Window:"Okno","Undo starts again in each window.":"Cofanie zaczyna się od nowa w każdym oknie.","The window with the file was closed. Saving from here makes a file with no password.":"Okno z plikiem zostało zamknięte. Zapis stąd utworzy plik bez hasła.","The window with the file doesn't answer.":"Okno z plikiem nie odpowiada.","Save the workbook in its first window, which can ask where.":"Zapisz skoroszyt w pierwszym oknie, które może zapytać, gdzie.","Close the other windows of this workbook first, then share it.":"Najpierw zamknij inne okna tego skoroszytu, a potem go udostępnij.","The window with the file was closed. Saving from here asks where.":"Okno z plikiem zostało zamknięte. Zapis stąd zapyta, gdzie.","Set the password in the workbook's first window, which has the file.":"Ustaw hasło w pierwszym oknie skoroszytu, które ma plik.","Save the workbook first, then share it.":"Najpierw zapisz skoroszyt, a potem go udostępnij.","There's a problem with this formula. To type text that starts with an equal sign, put an apostrophe (') before it.":"Jest problem z tą formułą. Aby wpisać tekst zaczynający się od znaku równości, poprzedź go apostrofem (').","There are one or more circular references where a formula refers to its own cell either directly or indirectly. This might cause them to calculate incorrectly.\nTry removing or changing these references, or moving the formulas to different cells.":`Co najmniej jedno odwołanie jest cykliczne: formuła odwołuje się do własnej komórki bezpośrednio lub pośrednio. Wyniki mogą być nieprawidłowe.
3
+ Spróbuj usunąć lub zmienić te odwołania albo przenieść formuły do innych komórek.`,"Circular References: {cell}":"Odwołania cykliczne: {cell}","Formula result = {value}":"Wynik formuły = {value}","This function takes no arguments.":"Ta funkcja nie ma argumentów.","window|Function Arguments":"Argumenty funkcji","A workbook with slicers made by code opens in one window.":"Skoroszyt z fragmentatorami utworzonymi przez kod otwiera się w jednym oknie."};export{e as default};
package/i18n/pl/touch.js CHANGED
@@ -1 +1 @@
1
- var e={"Touch menu":"Menu dotykowe","Previous commands":"Poprzednie polecenia","Next commands":"Następne polecenia","Show or Hide the Ribbon":"Pokaż lub ukryj wstążkę","Drag the fill handle to fill the cells":"Przeciągnij uchwyt wypełniania, aby wypełnić komórki"};export{e as default};
1
+ var e={"Touch menu":"Menu dotykowe","Previous commands":"Poprzednie polecenia","Next commands":"Następne polecenia","Show or Hide the Ribbon":"Pokaż lub ukryj wstążkę","Drag the fill handle to fill the cells":"Przeciągnij uchwyt wypełniania, aby wypełnić komórki","touch|Clear":"Wyczyść","touch|Insert":"Wstaw","touch|Delete":"Usuń"};export{e as default};
@@ -0,0 +1 @@
1
+ class i{constructor(){this.blobs=[],this.parts=[],this.pending=0}write(s){this.parts.push(s.slice()),this.pending+=s.length,this.pending>=1<<26&&this.flush()}flush(){this.blobs.push(new Blob(this.parts)),this.parts=[],this.pending=0}close(s){return this.flush(),new Blob(this.blobs,{type:s})}}export{i as BlobSink};
@@ -0,0 +1 @@
1
+ const C=/^(?:http:\/\/schemas\.openxmlformats\.org\/(?:spreadsheetml\/2006\/main|package\/2006\/(?:relationships|content-types))|http:\/\/purl\.oclc\.org\/ooxml\/spreadsheetml\/main)$/,E=/^(?:http:\/\/schemas\.openxmlformats\.org\/officeDocument\/2006\/relationships|http:\/\/purl\.oclc\.org\/ooxml\/officeDocument\/relationships)$/,N="http://schemas.openxmlformats.org/officeDocument/2006/relationships",W=/<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<\?[\s\S]*?\?>|<!DOCTYPE[^>]*>|<(\/?)([^\s/>]+)((?:[^>"']|"[^"]*"|'[^']*')*?)(\/?)>/g,b=/([^\s=]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;function _(s){for(const t of s.matchAll(W))if(t[2]!==void 0)return{at:t.index,end:t.index+t[0].length,name:t[2],attrs:t[3]};return null}const y=s=>[...s.matchAll(b)].filter(t=>t[1]==="xmlns"||t[1].startsWith("xmlns:")).map(t=>[t[1]==="xmlns"?"":t[1].slice(6),t[2]??t[3]]);function P(s){const t=_(s);if(!t)return null;const e=t.name.indexOf(":"),r=e<0?"":t.name.slice(0,e),f=y(t.attrs);return C.test(f.find(([o])=>o===r)?.[1]??"")?{prefix:r,rels:new Set(f.filter(([,o])=>E.test(o)).map(([o])=>o))}:null}const Y=/<\w[^<>]*=\s*'|<\w[^<>]*\s=|<\w[^<>]*=\s+"|<!--|<!DOCTYPE|<([^\s<>/]+)(?:\s[^<>]*)?><\/\1\s*>/,k=/xmlns:(?!r=)[\w.-]+\s*=\s*["'](?:http:\/\/schemas\.openxmlformats\.org\/officeDocument\/2006\/relationships|http:\/\/purl\.oclc\.org\/ooxml\/officeDocument\/relationships)["']/,q=/xmlns:r\s*=/g;function v(s,t,e){return t.prefix||[...t.rels].some(r=>r!=="r")||Y.test(s)||k.test(s)?!0:(s.match(q)?.length??0)>(e&&t.rels.has("r")?1:0)}function z(s,t,{hasRoot:e=!0}={}){if(!t||(e&&(s=s.replace(/<([\w.-]+:)?Relationships\b([^<>]*?)\s*\/>\s*$/,(n,d="",x)=>`<${d}Relationships${x}></${d}Relationships>`)),!v(s,t,e)))return s;const{prefix:r}=t,f=new Set(t.rels);for(const n of s.matchAll(/xmlns:([\w.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g))E.test(n[2]??n[3])&&f.add(n[1]);const o=r?`${r}:`:null;let u=e,p=0,h=-1,i=null,D=0,c="";const $=()=>{i!==null&&(c+=`${i}>`),i=null},R=n=>o&&h<0&&n.startsWith(o)?n.slice(o.length):n;for(const n of s.matchAll(W)){const d=s.slice(D,n.index);D=n.index+n[0].length,d&&($(),c+=d);const[x,I,g,S,T]=n;if(g===void 0){if(x.startsWith("<!--")||x.startsWith("<!D"))continue;$(),c+=x;continue}if(I){p--,i!==null&&!(p===0&&e)?(c+=`${i}/>`,i=null):($(),c+=`</${R(g)}>`),p===h&&(h=-1);continue}$();let m="",w=!1;for(const l of S.matchAll(b)){const a=l[2]??l[3].replace(/"/g,"&quot;"),A=l[1].indexOf(":"),O=A<0?"":l[1].slice(0,A);if(O==="xmlns"&&E.test(a)){u&&(t.uri=a);continue}l[1]==="xmlns"&&o&&!u&&(w=!C.test(a)),!(u&&o&&l[1]==="xmlns")&&(m+=` ${O&&f.has(O)?`r:${l[1].slice(A+1)}`:l[1]}="${a}"`)}w&&h<0&&!T&&(h=p);let L=w?g:R(g);if(u){const l=y(S).find(([a])=>a===r)[1];m=`${o?` xmlns="${l}"`:""}${m}`,(f.size>0||/\br:[\w.-]+=/.test(s))&&(m+=` xmlns:r="${t.uri??N}"`),u=!1}T?c+=`<${L}${m}/>`:(i=`<${L}${m}`,p++)}return $(),c+s.slice(D)}const F=s=>z(s,P(s));function G(s){const t=_(s);if(!t||/\sxmlns:r\s*=/.test(t.attrs))return s;const e=t.end-(s[t.end-2]==="/"?2:1);return`${s.slice(0,e)} xmlns:r="${N}"${s.slice(e)}`}export{F as canonicalXml,G as declareRelationships,z as respell,P as xmlSpelling};
package/io/client.js CHANGED
@@ -1 +1 @@
1
- import{getDataPackage as S}from"../extras/getdata/persist.js";import{cellTypesPackage as k}from"../celltypes/cell-types.js";import{Sheet as v}from"../core/sheet.js";import{Workbook as P}from"../core/workbook.js";import{buildBlock as x,newBlockBuffers as C}from"./export-blocks.js";import{buildPlan as b}from"./plan.js";import{applySheetFilter as I}from"../cells/filter-file.js";import{applySheetViewInfo as M}from"../cells/view-xml.js";import{docPropsCommitted as R}from"../cells/docprops-xml.js";import{namedStylesCommitted as E}from"../cells/cell-styles-xml.js";import{buildPivotPackage as _}from"../pivot/xml.js";import{resolveColor as z}from"./xlsx-styles.js";import{applyPrintNames as F}from"../print/page-setup.js";import{MAX_COLS as T,parseCellRef as N}from"../core/address.js";const q="The file reader didn't start. Check the connection and try again.";class Z{constructor(){this.worker=new Worker(new URL("./io.worker.js",import.meta.url),{type:"module"}),this.worker.onmessage=e=>this._on(e.data),this.worker.onerror=e=>this._fail(new Error(e.message||q)),this.book=null,this.onProgress=null,this.opening=null,this.saving=null,this.queue=Promise.resolve(),this.retired=!1,this.closed=!1,this.cellsRead=0,this.sourceStrings=0,this.sourceStyles=0,this.sheetSourceCount=0,this.unlockState=null,this.hasPassword=!1,this.onIntegrityFailed=null,this.partNames=new Set,this.nextPivotCacheId=1,this.numFmtIds=new Map}async packageOf(e){if(!this.unlockState)return e;const{openUnlocked:s}=await import("./crypto/index.js");return(await s(e,this.unlockState)).package}setPassword(e){this.hasPassword=!!e,this.worker.postMessage({op:"setPassword",password:e||null})}_enqueue(e){if(this.retired)return Promise.reject(new Error("This file's Worker was closed."));const s=()=>this.closed?Promise.reject(new Error("The workbook was destroyed.")):e(),t=this.queue.then(s,s);return this.queue=t.catch(()=>{}),t}retire(){this.retired=!0,this.queue.then(()=>this.worker.terminate())}close(){this.retired=!0,this.closed=!0,this.worker.terminate(),(this.opening||this.saving||this.uploading)&&this._fail(new Error("The workbook was destroyed."))}open(e,s={}){return this._enqueue(()=>this._open(e,s))}_open(e,{onReady:s,onProgress:t,password:r}={}){const l=new P;return this.book=l,this.cellsRead=0,this.onProgress=t,this.onReady=s,new Promise((o,u)=>{this.opening={resolve:o,reject:u},this.worker.postMessage({op:"open",file:e,password:r})})}save(e,s,t={}){return this._enqueue(()=>this._save(e,s,t))}async _save(e,s,{onProgress:t,objects:r,pivots:l,slicers:o,dataSheets:u,chartExtras:g,commit:c=s!==null,markSaved:h=!0}={}){this.book=e;const n=e.edits;this.onProgress=t,await r?.prepareSave?.(e),u?.prepareSave();const a=b(e,{strings:this.sourceStrings,styles:this.sourceStyles,sheets:this.sheetSourceCount}),f={edits:e.edits,strings:e.strings.size,styles:e.styles.list.length,dxfs:e.dxfs?.length??0,sheets:[...e.sheets],tables:[...e.engine?.tables.values()??[]]};a.sheets.forEach((d,m)=>{d.objects=r?.serialize(e.sheets[m])??null}),a.cellTypes=[...r?.extrasPackage?.(e)??[],...k(e),...S(e),...g??[]],a.cellTypes.some(d=>d.path==="xl/metadata.xml")&&(a.dynamicArrays=!1),a.errorVms=e.errorVms??null;const p=l?this._pivotPlan(e,l,a):null,w=o?.savePlan(a)??null;a.dataSheets=await u?.savePackage()??null,a.foreign=e.source===null&&e.collabPackage&&e.packageInfo?.kept===!0?{...e.collabPackage,expected:!0}:null;let y;try{y=await new Promise((d,m)=>{this.saving={resolve:d,reject:m,edits:f.edits},this.worker.postMessage({op:"save",plan:a,handle:s,commit:c})})}catch(d){throw p?.restore(),w?.restore(),d}finally{u?.finishSave()}if(h&&e.edits===n&&(e.dirty=!1),c){const d=e.edits===f.edits;this._commit(e,f,a,d),R(e,a.docProps,d),E(e,a.namedStyles,d),p?.commit(d),w?.commit(d)}else p?.restore(),w?.restore();return y}uploadPackage({url:e,key:s}){return this._enqueue(()=>new Promise(t=>{this.uploading=t,this.worker.postMessage({op:"uploadPackage",url:e,key:s})}))}_pivotPlan(e,s,t){const r=s.pivots,l=s.removedParts??[];if(r.length===0&&l.length===0)return null;const o=r.map(h=>[h,h.part,h.cache,h.cache.part,h.cache.id]),u=new Map;let g=Math.max(163,...this.numFmtIds.values())+1;const c=_(r,{existing:[...this.partNames],saveRecords:!1,firstCacheId:this.nextPivotCacheId,numFmtId:h=>{const n=this.numFmtIds.get(h)??u.get(h);return n!==void 0?n:(u.set(h,g),g++)}});if(t.pivotNumFmts=[...u].map(([h,n])=>({id:n,code:h})),c.parts.length>0||l.length>0){const h=n=>`rIdPivotCache${n.cacheId}`;t.pivots={parts:c.parts.map(({name:n,contentType:a,xml:f})=>({name:n,contentType:a,xml:f})),contentTypes:c.contentTypes,replaced:[...c.replaced,...l],relationships:c.relationships.map(({from:n,id:a,type:f,target:p,sheet:w})=>({from:n,id:a,type:f,target:p,sheetIndex:n===null?e.sheets.indexOf(w):-1})),caches:c.workbook.pivotCaches.map(n=>({cacheId:n.cacheId,type:n.type,target:n.target,relId:h(n)}))}}return{restore:()=>{for(const[h,n,a,f,p]of o)h.part=n,a.part=f,a.id=p},commit:h=>{h&&(s.removedParts=[]);for(const n of c.parts)this.partNames.add(n.name);if(this.nextPivotCacheId+=c.workbook.pivotCaches.length,h)for(const n of r)n.dirty=!1;for(const n of c.relationships){if(n.from===null||!/\/pivotCacheDefinition$/.test(n.type))continue;const a=r.find(f=>f.part===n.from);a&&(a.cache.part=n.target.replace(/^\//,""))}}}}_commit(e,s,t,r){e.source={},this.sourceStrings=s.strings,this.sourceStyles=s.styles,this.sheetSourceCount=s.sheets.length,e.sourceDxfs=s.dxfs;const l=new Set(t.removedTables);e.removedTables=(e.removedTables??[]).filter(o=>!l.has(o)),r&&(e.protectionChanged=!1,e.calcModeChanged=!1,e.personsChanged=!1,e.formulasEdited=!1,e.namesChanged=!1),s.sheets.forEach((o,u)=>{o.sourceIndex=u;const g=new Set(t.sheets[u].structureOps);o.structureOps=(o.structureOps??[]).filter(c=>!g.has(c)),r&&(o.colsChanged=!1,o.viewChanged=!1,o.defaultsChanged=!1,o.filterChanged=!1,o.cfChanged=!1,o.validationsChanged=!1,o.hyperlinksChanged=!1,o.protectionChanged=!1,o.scenariosChanged=!1,o.threadsChanged=!1,o.commentsChanged=!1,o.sparklinesChanged=!1,o.pageSetupChanged=!1,o.tabColorChanged=!1)});for(const o of s.tables)o.isNew=!1,o.source=!0,r&&(o.dirty=!1,o.columnsChanged=!1)}_on(e){const s=this.book;switch(e.op){case"meta":{s.date1904=e.info.date1904===!0,s.sheets=e.info.sheets.map((t,r)=>{const l=new v(t.name);return l.hidden=t.hidden,t.veryHidden&&(l.veryHidden=!0),l.sourceIndex=r,l}),s.sheets.length===0&&(s.sheets=[new v("Sheet1")]),s.activeSheet=Math.min(e.info.activeTab,s.sheets.length-1),s.styles.load(e.info.styles),this.sourceStyles=e.info.styles.length,this.sheetSourceCount=e.info.sheets.length,this.meta=e.info,s.protection=e.info.workbookProtection,s.persons=e.info.persons??[],this.nextPivotCacheId=(e.info.maxPivotCacheId??0)+1,this.numFmtIds=new Map(Object.entries(e.info.numFmts??{}).map(([t,r])=>[r,Number(t)])),s.theme=e.info.theme,s.themeName=e.info.themeName??null,s.dxfs=e.info.dxfs,s.sourceDxfs=e.info.dxfs.length,s.source={},this.onReady?.(s);break}case"strings":if(s.strings.addPage(e.bytes,e.offsets),e.rich){s.strings.rich??=new Map;for(const[t,r]of e.rich){for(const l of r)l.color&&(l.color=z({a:l.color},s.theme??[]));s.strings.rich.set(t,r)}}break;case"stringsEnd":this.sourceStrings=e.count;break;case"sheetStart":if(D(s.sheets[e.index],e.info),e.info.chartSheet){const t=s.sheets[e.index];t.isChartSheet=!0,t.hideHeadings=!0,t.showGridlines=!1}break;case"cells":{const t=s.sheets[e.index],r=e.batch;t.applyBatch(r),r.rowMeta!==null&&A(t,r.rowMeta),this.cellsRead+=r.count,this.onProgress?.({cells:this.cellsRead,sheet:e.index,sheets:s.sheets.length}),r.formulas=null,r.valueMeta=null,this.worker.postMessage({op:"ack",batch:r},[r.rows.buffer,r.cols.buffer,r.kinds.buffer,r.values.buffer,r.styles.buffer]);break}case"sheetEnd":{const t=s.sheets[e.index];t.merges=e.merges,t.mergeIndex=null,O(t,e.features,e.comments),e.pageSetup&&(t.pageSetup=F(e.pageSetup,this.meta.printNames,e.index)),t.revision++,this.onProgress?.({cells:this.cellsRead,sheet:e.index,sheets:s.sheets.length,sheetDone:!0});break}case"opened":{s.dirty=!1;const t=this.opening;this.opening=null,t?.resolve(s);break}case"blockRequest":{if(s.edits!==this.saving?.edits){this.worker.postMessage({op:"block",id:e.id,error:"The workbook changed during the save. Save again to include your edits."});break}const t=e.recycled??C(),r=x(s.sheets[e.sheet],s.strings,e.from,t);this.worker.postMessage({op:"block",id:e.id,block:r},[r.rows.buffer,r.cols.buffer,r.kinds.buffer,r.values.buffer,r.styles.buffer]),this.onProgress?.({saving:!0,sheet:e.sheet,row:e.from,sheets:s.sheets.length,maxRow:s.sheets[e.sheet].maxRow});break}case"uploaded":{const t=this.uploading;this.uploading=null,t?.(e.status);break}case"saved":{for(const[l,o]of e.numFmts??[])this.numFmtIds.set(l,o);const t=s.source===null,r=this.saving;this.saving=null,r?.resolve({size:e.size,blob:e.blob??null,hadNoSource:t});break}case"unlocked":this.unlockState=e.state,this.hasPassword=e.state!==null;break;case"integrity":this.onIntegrityFailed?.(e.message);break;case"error":this._fail(Object.assign(new Error(e.message),{code:e.code}));break;default:}}_fail(e){const s=this.opening??this.saving,t=this.uploading;this.opening=null,this.saving=null,this.uploading=null,s?s.reject(e):t?t(`failed: ${e.message}`):console.error(e)}}function O(i,e,s){e&&(e.pictureRid&&(i.backgroundRid=e.pictureRid),e.headerPictureRid&&(i.headerPictureRid=e.headerPictureRid),I(i,e.filter),e.cf.length&&(i.cf=e.cf),e.validations.length&&(i.validations=e.validations),e.hyperlinks.length&&(i.hyperlinks=e.hyperlinks),e.protection&&(i.protection=e.protection),e.customSheetViews&&(i.fileSheetViews=e.customSheetViews),e.scenarios&&(i.scenarios=e.scenarios),e.ignoredErrors&&(i.ignoredErrors=e.ignoredErrors),e.threads?.length&&(i.threads=e.threads),e.sparklines?.length&&(i.sparklines=e.sparklines)),s?.length&&(i.comments=new Map(s.map(t=>{const r=N(t.ref);return[r.row*T+r.col,t]})))}function D(i,e){i.summaryAbove=e.summaryAbove===!0,i.outlineAutoStyles=e.outlineAutoStyles===!0,i.summaryLeft=e.summaryLeft===!0,i.rows.setDefaultSize(e.defaultHeight),i.cols.setDefaultSize(e.defaultWidth),i.tabColor=e.tabColor,i.frozenRows=e.frozenRows,i.frozenCols=e.frozenCols,i.showGridlines=e.showGridlines,i.zoom=e.zoom,i.rtl=e.rtl===!0,M(i,e);for(const s of e.cols)for(let t=s.min;t<=s.max;t++)s.width>=0&&s.width!==e.defaultWidth&&i.cols.setSize(t,s.width),s.hidden&&i.cols.setHidden(t,!0),s.style&&(i.colStyles===null&&(i.colStyles=new Map),i.colStyles.set(t,s.style)),s.extra&&(i.colExtras===null&&(i.colExtras=new Map),i.colExtras.set(t,s.extra))}function A(i,e){for(let s=0;s<e.length;s+=6){const t=e[s];e[s+1]>=0&&i.rows.setSize(t,e[s+1],e[s+4]===0),e[s+2]&&i.rows.setHidden(t,!0),e[s+3]&&(i.rowStyles===null&&(i.rowStyles=new Map),i.rowStyles.set(t,e[s+3])),e[s+5]&&(i.rowExtras===null&&(i.rowExtras=new Map),i.rowExtras.set(t,e[s+5]))}}export{Z as IoClient,q as WORKER_FAILED};
1
+ import{getDataPackage as S}from"../extras/getdata/persist.js";import{cellTypesPackage as P}from"../celltypes/cell-types.js";import{Sheet as k}from"../core/sheet.js";import{Workbook as x}from"../core/workbook.js";import{buildBlock as C,newBlockBuffers as b}from"./export-blocks.js";import{buildPlan as I}from"./plan.js";import{withShared as v,withSharedValues as R}from"../core/shared-view.js";import{applySheetFilter as M}from"../cells/filter-file.js";import{applySheetViewInfo as E}from"../cells/view-xml.js";import{docPropsCommitted as _}from"../cells/docprops-xml.js";import{namedStylesCommitted as z}from"../cells/cell-styles-xml.js";import{buildPivotPackage as T,partBlob as F}from"../pivot/xml.js";import{resolveColor as N}from"./xlsx-styles.js";import{applyPrintNames as V,printAreaFormula as q}from"../print/page-setup.js";import{MAX_COLS as A,parseCellRef as O}from"../core/address.js";const D="The file reader didn't start. Check the connection and try again.";class ie{constructor(){this.worker=new Worker(new URL("./io.worker.js",import.meta.url),{type:"module"}),this.worker.onmessage=e=>this._on(e.data),this.worker.onerror=e=>this._fail(new Error(e.message||D)),this.book=null,this.onProgress=null,this.opening=null,this.saving=null,this.queue=Promise.resolve(),this.retired=!1,this.closed=!1,this.cellsRead=0,this.sourceStrings=0,this.sourceStyles=0,this.sheetSourceCount=0,this.unlockState=null,this.converted=null,this.hasPassword=!1,this.onIntegrityFailed=null,this.partNames=new Set,this.nextPivotCacheId=1,this.numFmtIds=new Map}async packageOf(e){if(this.converted)return this.converted.blob;if(!this.unlockState)return e;const{openUnlocked:t}=await import("./crypto/index.js");return(await t(e,this.unlockState)).package}setPassword(e){this.hasPassword=!!e,this.worker.postMessage({op:"setPassword",password:e||null})}_enqueue(e){if(this.retired)return Promise.reject(new Error("This file's Worker was closed."));const t=()=>this.closed?Promise.reject(new Error("The workbook was destroyed.")):e(),s=this.queue.then(t,t);return this.queue=s.catch(()=>{}),s}retire(){this.retired=!0,this.queue.then(()=>this.worker.terminate())}close(){this.retired=!0,this.closed=!0,this.worker.terminate(),(this.opening||this.saving||this.uploading||this.packaging)&&this._fail(new Error("The workbook was destroyed."))}open(e,t={}){return this._enqueue(()=>this._open(e,t))}_open(e,{onReady:t,onProgress:s,password:r}={}){const l=new x;return this.book=l,this.cellsRead=0,this.onProgress=s,this.onReady=t,new Promise((n,u)=>{this.opening={resolve:n,reject:u},this.worker.postMessage({op:"open",file:e,password:r})})}save(e,t,s={}){return this._enqueue(()=>R(e,()=>this._save(e,t,s)))}async _save(e,t,{onProgress:s,objects:r,pivots:l,slicers:n,dataSheets:u,chartExtras:w,commit:d=t!==null,markSaved:y=!0}={}){this.book=e;const c=e.edits;this.onProgress=s,await r?.prepareSave?.(e),u?.prepareSave();const a=v(e,()=>I(e,{strings:this.sourceStrings,styles:this.sourceStyles,sheets:this.sheetSourceCount})),o={edits:e.edits,strings:e.strings.size,styles:e.styles.list.length,dxfs:e.dxfs?.length??0,sheets:[...e.sheets],tables:[...e.engine?.tables.values()??[]]};a.sheets.forEach((h,m)=>{h.objects=r?v(e,()=>r.serialize(e.sheets[m]),e.sheets[m])??null:null}),a.cellTypes=[...r?.extrasPackage?.(e)??[],...P(e),...S(e),...w??[]],a.cellTypes.some(h=>h.path==="xl/metadata.xml")&&(a.dynamicArrays=!1),a.errorVms=e.errorVms??null;const f=l?await this._pivotPlan(e,l,a):null,p=n?.savePlan(a)??null;a.dataSheets=await u?.savePackage()??null,a.foreign=e.source===null&&e.collabPackage&&e.packageInfo?.kept===!0?{...e.collabPackage,expected:!0}:null;let g;try{g=await new Promise((h,m)=>{this.saving={resolve:h,reject:m,edits:o.edits},this.worker.postMessage({op:"save",plan:a,handle:t,commit:d})})}catch(h){throw f?.restore(),p?.restore(),h}finally{u?.finishSave()}if(y&&e.edits===c&&(e.dirty=!1),d){const h=e.edits===o.edits;this._commit(e,o,a,h),_(e,a.docProps,h),z(e,a.namedStyles,h),f?.commit(h),p?.commit(h)}else f?.restore(),p?.restore();return g}uploadPackage({url:e,key:t}){return this._enqueue(()=>new Promise(s=>{this.uploading=s,this.worker.postMessage({op:"uploadPackage",url:e,key:t})}))}packageBlob(){return this._enqueue(()=>new Promise(e=>{this.packaging=e,this.worker.postMessage({op:"package"})}))}async _pivotPlan(e,t,s){const r=t.pivots,l=t.removedParts??[];if(r.length===0&&l.length===0)return null;const n=r.map(c=>[c,c.part,c.cache,c.cache.part,c.cache.id,c.cache.recordsPart]),u=new Map;let w=Math.max(163,...this.numFmtIds.values())+1;const d=T(r,{existing:[...this.partNames],saveRecords:!1,firstCacheId:this.nextPivotCacheId,numFmtId:c=>{const a=this.numFmtIds.get(c)??u.get(c);return a!==void 0?a:(u.set(c,w),w++)}}),y=()=>{for(const[c,a,o,f,p,g]of n)c.part=a,o.part=f,o.id=p,o.recordsPart=g};if(s.pivotNumFmts=[...u].map(([c,a])=>({id:a,code:c})),d.parts.length>0||l.length>0){const c=o=>`rIdPivotCache${o.cacheId}`,a=[];try{for(const{name:o,contentType:f,xml:p,produce:g}of d.parts)a.push(g?{name:o,contentType:f,blob:await F(g)}:{name:o,contentType:f,xml:p})}catch(o){throw y(),o}s.pivots={parts:a,contentTypes:d.contentTypes,replaced:[...d.replaced,...l],relationships:d.relationships.map(({from:o,id:f,type:p,target:g,sheet:h,external:m})=>({from:o,id:f,type:p,target:g,external:m,sheetIndex:o===null?e.sheets.indexOf(h):-1})),caches:d.workbook.pivotCaches.map(o=>({cacheId:o.cacheId,type:o.type,target:o.target,relId:c(o)}))}}return{restore:y,commit:c=>{c&&(t.removedParts=[]);for(const a of d.parts)this.partNames.add(a.name);if(this.nextPivotCacheId+=d.workbook.pivotCaches.length,c)for(const a of r)a.dirty=!1;for(const a of d.relationships){if(a.from===null||!/\/pivotCacheDefinition$/.test(a.type))continue;const o=r.find(f=>f.part===a.from);o&&(o.cache.part=a.target.replace(/^\//,""))}}}}_commit(e,t,s,r){e.source={},this.sourceStrings=t.strings,this.sourceStyles=t.styles,this.sheetSourceCount=t.sheets.length,e.sourceDxfs=t.dxfs;const l=new Set(s.removedTables);e.removedTables=(e.removedTables??[]).filter(n=>!l.has(n)),r&&(e.protectionChanged=!1,e.calcModeChanged=!1,e.personsChanged=!1,e.formulasEdited=!1,e.namesChanged=!1),t.sheets.forEach((n,u)=>{n.sourceIndex=u;const w=new Set(s.sheets[u].structureOps);n.structureOps=(n.structureOps??[]).filter(d=>!w.has(d)),r&&(n.colsChanged=!1,n.viewChanged=!1,n.defaultsChanged=!1,n.filterChanged=!1,n.cfChanged=!1,n.validationsChanged=!1,n.hyperlinksChanged=!1,n.protectionChanged=!1,n.scenariosChanged=!1,n.threadsChanged=!1,n.namedViewsChanged=!1,n.commentsChanged=!1,n.sparklinesChanged=!1,n.pageSetupChanged=!1,n.tabColorChanged=!1)});for(const n of t.tables)n.isNew=!1,n.source=!0,r&&(n.dirty=!1,n.columnsChanged=!1)}_on(e){const t=this.book;switch(e.op){case"meta":{t.date1904=e.info.date1904===!0,t.sheets=e.info.sheets.map((s,r)=>{const l=new k(s.name);return l.hidden=s.hidden,s.veryHidden&&(l.veryHidden=!0),l.sourceIndex=r,l}),t.sheets.length===0&&(t.sheets=[new k("Sheet1")]),t.activeSheet=Math.min(e.info.activeTab,t.sheets.length-1),t.styles.load(e.info.styles),this.sourceStyles=e.info.styles.length,this.sheetSourceCount=e.info.sheets.length,this.meta=e.info,t.protection=e.info.workbookProtection,t.persons=e.info.persons??[],this.nextPivotCacheId=(e.info.maxPivotCacheId??0)+1,this.numFmtIds=new Map(Object.entries(e.info.numFmts??{}).map(([s,r])=>[r,Number(s)])),t.theme=e.info.theme,t.themeName=e.info.themeName??null,t.dxfs=e.info.dxfs,t.sourceDxfs=e.info.dxfs.length,t.source={},this.onReady?.(t);break}case"strings":if(t.strings.addPage(e.bytes,e.offsets),e.rich){t.strings.rich??=new Map;for(const[s,r]of e.rich){for(const l of r)l.color&&(l.color=N({a:l.color},t.theme??[]));t.strings.rich.set(s,r)}}break;case"stringsEnd":this.sourceStrings=e.count;break;case"sheetStart":if(L(t.sheets[e.index],e.info),e.info.chartSheet){const s=t.sheets[e.index];s.isChartSheet=!0,s.hideHeadings=!0,s.showGridlines=!1}break;case"cells":{const s=t.sheets[e.index],r=e.batch;s.applyBatch(r),r.rowMeta!==null&&H(s,r.rowMeta),this.cellsRead+=r.count,this.onProgress?.({cells:this.cellsRead,sheet:e.index,sheets:t.sheets.length}),r.formulas=null,r.valueMeta=null,this.worker.postMessage({op:"ack",batch:r},[r.rows.buffer,r.cols.buffer,r.kinds.buffer,r.values.buffer,r.styles.buffer]);break}case"sheetEnd":{const s=t.sheets[e.index];s.merges=e.merges,s.mergeIndex=null,B(s,e.features,e.comments),e.namedViews?.length&&(s.namedViews=e.namedViews),e.pageSetup&&(s.pageSetup=V(e.pageSetup,this.meta.printNames,e.index)),s.printAreaFormula=q(this.meta.printNames,e.index),s.revision++,this.onProgress?.({cells:this.cellsRead,sheet:e.index,sheets:t.sheets.length,sheetDone:!0});break}case"opened":{t.dirty=!1;const s=this.opening;this.opening=null,s?.resolve(t);break}case"blockRequest":{if(t.edits!==this.saving?.edits){this.worker.postMessage({op:"block",id:e.id,error:"The workbook changed during the save. Save again to include your edits."});break}const s=e.recycled??b(),r=v(t,()=>C(t.sheets[e.sheet],t.strings,e.from,s),t.sheets[e.sheet]);this.worker.postMessage({op:"block",id:e.id,block:r},[r.rows.buffer,r.cols.buffer,r.kinds.buffer,r.values.buffer,r.styles.buffer]),this.onProgress?.({saving:!0,sheet:e.sheet,row:e.from,sheets:t.sheets.length,maxRow:t.sheets[e.sheet].maxRow});break}case"package":{const s=this.packaging;this.packaging=null,s?.(e.value);break}case"uploaded":{const s=this.uploading;this.uploading=null,s?.(e.status);break}case"saved":{for(const[l,n]of e.numFmts??[])this.numFmtIds.set(l,n);const s=t.source===null,r=this.saving;this.saving=null,r?.resolve({size:e.size,blob:e.blob??null,hadNoSource:s});break}case"unlocked":this.unlockState=e.state,this.hasPassword=e.state!==null;break;case"converted":this.converted=e.made,e.made?.protected&&(this.hasPassword=!0);break;case"integrity":this.onIntegrityFailed?.(e.message);break;case"error":this._fail(Object.assign(new Error(e.message),{code:e.code}));break;default:}}_fail(e){const t=this.opening??this.saving,s=this.uploading;this.packaging?.(null),this.packaging=null,this.opening=null,this.saving=null,this.uploading=null,t?t.reject(e):s?s(`failed: ${e.message}`):console.error(e)}}function B(i,e,t){e&&(e.pictureRid&&(i.backgroundRid=e.pictureRid),e.headerPictureRid&&(i.headerPictureRid=e.headerPictureRid),M(i,e.filter),e.cf.length&&(i.cf=e.cf),e.validations.length&&(i.validations=e.validations),e.hyperlinks.length&&(i.hyperlinks=e.hyperlinks),e.protection&&(i.protection=e.protection),e.customSheetViews&&(i.fileSheetViews=e.customSheetViews),e.scenarios&&(i.scenarios=e.scenarios),e.ignoredErrors&&(i.ignoredErrors=e.ignoredErrors),e.protectedRanges&&(i.protectedRanges=e.protectedRanges),e.threads?.length&&(i.threads=e.threads),e.sparklines?.length&&(i.sparklines=e.sparklines)),t?.length&&(i.comments=new Map(t.map(s=>{const r=O(s.ref);return[r.row*A+r.col,s]})))}function L(i,e){i.summaryAbove=e.summaryAbove===!0,i.outlineAutoStyles=e.outlineAutoStyles===!0,i.summaryLeft=e.summaryLeft===!0,i.rows.setDefaultSize(e.defaultHeight),i.cols.setDefaultSize(e.defaultWidth),i.tabColor=e.tabColor,i.frozenRows=e.frozenRows,i.frozenCols=e.frozenCols,i.frozenTop=e.frozenTop??0,i.frozenLeft=e.frozenLeft??0,i.showGridlines=e.showGridlines,i.zoom=e.zoom,i.rtl=e.rtl===!0,E(i,e);for(const t of e.cols)for(let s=t.min;s<=t.max;s++)t.width>=0&&t.width!==e.defaultWidth&&i.cols.setSize(s,t.width),t.hidden&&i.cols.setHidden(s,!0),t.style&&(i.colStyles===null&&(i.colStyles=new Map),i.colStyles.set(s,t.style)),t.extra&&(i.colExtras===null&&(i.colExtras=new Map),i.colExtras.set(s,t.extra))}function H(i,e){for(let t=0;t<e.length;t+=6){const s=e[t];e[t+1]>=0&&i.rows.setSize(s,e[t+1],e[t+4]===0),e[t+2]&&i.rows.setHidden(s,!0),e[t+3]&&(i.rowStyles===null&&(i.rowStyles=new Map),i.rowStyles.set(s,e[t+3])),e[t+5]&&(i.rowExtras===null&&(i.rowExtras=new Map),i.rowExtras.set(s,e[t+5]))}}export{ie as IoClient,D as WORKER_FAILED};
@@ -0,0 +1 @@
1
+ import{linkSiblings as V}from"./cfb-write.js";const u=4294967294,A=4294967295,v=4294967293,b=4294967295,H=4294967292,o=512,S=109,E=o/4-1,C=64,N=4096;function P(g){const h=(t,e,n)=>({id:t,name:e,type:n,children:new Map,left:b,right:b,child:b,color:1,start:n===2?u:0,size:0}),l=[h(0,"Root Entry",5)],T=(t,e,n)=>{if(!t.children.has(e)){const r=h(l.length,e,n);l.push(r),t.children.set(e,r)}return t.children.get(e)},z=[],_=[],p=t=>Math.ceil(t/o);let f=0;const w=t=>{const e=f,n=p(t.length);return n===0?u:(_.push([e,t]),z.push([e,n]),f+=n,e)},F=[];let U=0;for(const t of g){let e=l[0];for(const r of t.path.slice(0,-1))e=T(e,r,1);const n=T(e,t.path.at(-1),2);n.size=t.bytes.length,n.size>=N?n.start=w(t.bytes):n.size>0&&(n.start=U,F.push([U,t.bytes]),U+=Math.ceil(n.size/C))}for(const t of l)t.children.size&&(t.child=V([...t.children.values()].sort(j)));const M=new Uint8Array(U*C),R=new Uint32Array(p(U*4)*(o/4)).fill(A);for(const[t,e]of F){M.set(e,t*C);const n=Math.ceil(e.length/C);for(let r=0;r<n;r++)R[t+r]=r+1<n?t+r+1:u}const[O]=l;O.size=M.length,O.start=w(M);const d=new Uint8Array(p(l.length*128)*o),c=new DataView(d.buffer);for(let t=0;t<d.length/128;t++)for(const e of[68,72,76])c.setUint32(t*128+e,b,!0);for(const t of l){const e=t.id*128;for(let n=0;n<t.name.length;n++)c.setUint16(e+n*2,t.name.charCodeAt(n),!0);c.setUint16(e+64,t.name.length*2+2,!0),d[e+66]=t.type,d[e+67]=t.color,c.setUint32(e+68,t.left,!0),c.setUint32(e+72,t.right,!0),c.setUint32(e+76,t.child,!0),c.setUint32(e+116,t.start,!0),c.setUint32(e+120,t.size,!0)}const D=w(d),L=w(new Uint8Array(R.buffer));let i=0;const I=()=>Math.ceil(Math.max(0,i-S)/E);for(;p((f+i+I())*4)>i;)i++;const a=I(),m=new Uint32Array(i*(o/4)).fill(A);for(const[t,e]of z)for(let n=0;n<e;n++)m[t+n]=n+1<e?t+n+1:u;for(let t=0;t<i;t++)m[f+t]=v;const y=f+i;for(let t=0;t<a;t++)m[y+t]=H;const x=new Uint8Array(o*(1+f+i+a)),s=new DataView(x.buffer);x.set([208,207,17,224,161,177,26,225]),s.setUint16(24,62,!0),s.setUint16(26,3,!0),s.setUint16(28,65534,!0),s.setUint16(30,9,!0),s.setUint16(32,6,!0),s.setUint32(44,i,!0),s.setUint32(48,D,!0),s.setUint32(56,N,!0),s.setUint32(60,L,!0),s.setUint32(64,R.length/(o/4),!0),s.setUint32(68,a?y:u,!0),s.setUint32(72,a,!0);for(let t=0;t<a;t++){const e=(y+t+1)*o;for(let n=0;n<E;n++){const r=S+t*E+n;s.setUint32(e+n*4,r<i?f+r:A,!0)}s.setUint32(e+E*4,t+1<a?y+t+1:u,!0)}for(let t=0;t<S;t++)s.setUint32(76+t*4,t<i?f+t:A,!0);for(const[t,e]of _)x.set(e,(t+1)*o);return x.set(new Uint8Array(m.buffer),(f+1)*o),x}const j=(g,h)=>g.name.length-h.name.length||(g.name.toUpperCase()<h.name.toUpperCase()?-1:1);export{P as buildCfb};
@@ -1 +1 @@
1
- import{corrupt as l,notEncrypted as F}from"./errors.js";const E=[208,207,17,224,161,177,26,225],p=4294967290,M=4294967294,x=4294967295,D=109,S=128,R=65536,T=1<<24,O=2,C=5;async function I(a){if(a.size<8)return!1;const t=new Uint8Array(await a.slice(0,8).arrayBuffer());return E.every((e,i)=>t[i]===e)}async function z(a,t,e){if(e>a.size)throw l("the file is shorter than its structure says");const i=new Uint8Array(await a.slice(t,e).arrayBuffer());if(i.length!==e-t)throw l("the file could not be read completely");return i}class N{constructor(t,e,i){this.logical=t,this.physical=e,this.count=i}find(t){let e=0,i=this.count-1;for(;e<i;){const r=e+i+1>>>1;this.logical[r]<=t?e=r:i=r-1}return e}}class A{constructor(t,e,i){this.file=t,this.runs=e,this.size=i}async read(t,e){if(t<0||e>this.size||t>e)throw new RangeError("Read outside the stream");if(t===e)return new Uint8Array(0);const{file:i,runs:r}=this,{sectorSize:n}=i,s=[];let o=t,h=r.find(Math.floor(o/n));for(;o<e;){const w=r.logical[h],f=h+1<r.count?r.logical[h+1]:1/0,u=Math.min(f*n,e),d=i.sectorOffset(r.physical[h])+(o-w*n);s.push(z(i.blob,d,d+(u-o))),o=u,h++}if(s.length===1)return s[0];const c=await Promise.all(s),m=new Uint8Array(e-t);let g=0;for(const w of c)m.set(w,g),g+=w.length;return m}}class _{constructor(t){this.bytes=t,this.size=t.length}async read(t,e){if(t<0||e>this.size||t>e)throw new RangeError("Read outside the stream");return this.bytes.subarray(t,e)}}class v{constructor(t,e){Object.assign(this,e),this.blob=t,this.fat=null,this.miniFat=null,this.miniStream=null,this.entries=[]}sectorOffset(t){return(t+1)*this.sectorSize}async _readSectors(t){const e=new Uint8Array(t.length*this.sectorSize),i=[];for(let r=0;r<t.length;){let n=r+1;for(;n<t.length&&t[n]===t[n-1]+1;)n++;const s=this.sectorOffset(t[r]),o=r*this.sectorSize;i.push(z(this.blob,s,s+(n-r)*this.sectorSize).then(h=>e.set(h,o))),r=n}return await Promise.all(i),e}_chain(t,e){const{fat:i}=this,r=[];let n=t;for(;n!==M;){if(n>p||n>=i.length)throw l(`bad sector number in the ${e}`);if(r.length>=i.length)throw l(`loop in the ${e}`);r.push(n),n=i[n]}return r}_runs(t,e,i,r){const n=new Uint8Array(Math.ceil(t.length/8)),s=f=>{if(f>=t.length||f>p)throw l(`the ${r} chain is broken`);if(n[f>>3]&1<<(f&7))throw l(`loop in the ${r} chain`);n[f>>3]|=1<<(f&7)};let o=0,h=-2,c=e;for(let f=0;f<i;f++)s(c),c!==h+1&&o++,h=c,c=t[c];const m=new Uint32Array(o),g=new Uint32Array(o);let w=0;h=-2,c=e;for(let f=0;f<i;f++)c!==h+1&&(m[w]=f,g[w]=c,w++),h=c,c=t[c];return new N(m,g,o)}find(...t){let e=this.entries[0];for(const i of t)if(e=this._childNamed(e,i),!e)return null;return e}_childNamed(t,e){const i=e.toUpperCase(),r=new Set,n=[t.child];for(;n.length>0;){const s=n.pop();if(s===x)continue;const o=this.entries[s];if(!o||r.has(s))throw l("the directory tree is broken");if(r.add(s),o.name.toUpperCase()===i)return o;n.push(o.left,o.right)}return null}async _loadMini(){if(this.miniFat)return;const t=this.numMiniFat===0?[]:this._chain(this.firstMiniFat,"mini FAT"),e=await this._readSectors(t);this.miniFat=new Uint32Array(e.length/4);const i=new DataView(e.buffer);for(let s=0;s<this.miniFat.length;s++)this.miniFat[s]=i.getUint32(s*4,!0);const r=this.entries[0],n=Math.ceil(r.size/this.sectorSize);this.miniStream=new A(this,this._runs(this.fat,r.start,n,"mini stream"),n*this.sectorSize)}async open(t){if(t.type!==O)throw l(`${t.name} is not a stream`);if(t.size<this.miniCutoff){if(t.size===0)return new _(new Uint8Array(0));await this._loadMini();const s=Math.ceil(t.size/64),o=this._runs(this.miniFat,t.start,s,t.name),h=new Uint8Array(t.size);for(let c=0;c<o.count;c++){const m=o.logical[c]*64,g=Math.min(c+1<o.count?o.logical[c+1]*64:t.size,t.size),w=o.physical[c]*64,f=w+(g-m);if(f>this.miniStream.size)throw l(`${t.name} runs past the mini stream`);h.set(await this.miniStream.read(w,f),m)}return new _(h)}const e=Math.ceil(t.size/this.sectorSize),i=this._runs(this.fat,t.start,e,t.name);let r=0;for(let s=0;s<i.count;s++){const o=(s+1<i.count?i.logical[s+1]:e)-i.logical[s];r=Math.max(r,this.sectorOffset(i.physical[s]+o-1)+this.sectorSize)}const n=t.size%this.sectorSize;if(r-(n?this.sectorSize-n:0)>this.blob.size)throw l(`${t.name} runs past the end of the file`);return new A(this,i,t.size)}async read(t){if(t.size>T)throw l(`${t.name} is too large`);const e=await this.open(t);return e.read(0,e.size)}releaseTables(){this.fat=null,this.miniFat=null}}function $(a){const t=new DataView(a.buffer,a.byteOffset,a.byteLength),e=t.getUint16(26,!0),i=t.getUint16(30,!0);if(t.getUint16(28,!0)!==65534)throw l("bad byte order mark");if(!(e===3&&i===9||e===4&&i===12))throw l("bad version or sector size");if(t.getUint16(32,!0)!==6)throw l("bad mini sector size");if(t.getUint32(56,!0)!==4096)throw l("bad mini stream cutoff");return{major:e,sectorShift:i,sectorSize:1<<i,numFat:t.getUint32(44,!0),firstDir:t.getUint32(48,!0),miniCutoff:4096,firstMiniFat:t.getUint32(60,!0),numMiniFat:t.getUint32(64,!0),firstDifat:t.getUint32(68,!0),numDifat:t.getUint32(72,!0)}}async function V(a,t){const{blob:e,numFat:i,numDifat:r,sectorSize:n}=a;if(i===0||i*n>e.size)throw l("bad FAT size");const s=n/4,o=new Uint32Array(i),h=new DataView(t.buffer,t.byteOffset,t.byteLength);let c=0;for(let u=0;u<D&&c<i;u++)o[c++]=h.getUint32(76+u*4,!0);let m=a.firstDifat;for(let u=0;c<i;u++){if(u>=r||m>p)throw l("the DIFAT is shorter than the FAT");const d=a.sectorOffset(m),b=await z(e,d,d+n),y=new DataView(b.buffer);for(let U=0;U<s-1&&c<i;U++)o[c++]=y.getUint32(U*4,!0);m=y.getUint32((s-1)*4,!0)}for(let u=0;u<i;u++)if(o[u]>p||a.sectorOffset(o[u])+n>e.size)throw l("a FAT sector lies outside the file");const g=await a._readSectors(o),w=new Uint32Array(i*s),f=new DataView(g.buffer);for(let u=0;u<w.length;u++)w[u]=f.getUint32(u*4,!0);a.fat=w}function k(a,t){const e=new DataView(t.buffer),i=Math.min(t.length/S,R),r=new TextDecoder("utf-16le");for(let n=0;n<i;n++){const s=n*S,o=e.getUint16(s+64,!0),h=t[s+66],c=e.getUint32(s+120,!0),m=e.getUint32(s+124,!0),g=a.major===3?c:c+m*2**32;a.entries.push({id:n,type:h,name:h===0||o<2||o>64?"":r.decode(t.subarray(s,s+o-2)),left:e.getUint32(s+68,!0),right:e.getUint32(s+72,!0),child:e.getUint32(s+76,!0),start:e.getUint32(s+116,!0),size:g})}if(a.entries[0]?.type!==C)throw l("the directory has no root entry")}async function j(a){if(!await I(a))throw F("Not a compound file");if(a.size<512)throw l("the file is too short");const t=await z(a,0,512),e=new v(a,$(t));return await V(e,t),k(e,await e._readSectors(e._chain(e.firstDir,"directory"))),e}export{v as CfbFile,A as CfbStream,_ as MemoryStream,I as isCompoundFile,j as openCfb};
1
+ import{corrupt as l,notEncrypted as F}from"./errors.js";const E=[208,207,17,224,161,177,26,225],p=4294967290,M=4294967294,x=4294967295,D=109,S=128,R=65536,T=1<<24,O=2,C=5;async function I(a){if(a.size<8)return!1;const t=new Uint8Array(await a.slice(0,8).arrayBuffer());return E.every((e,i)=>t[i]===e)}async function z(a,t,e){if(e>a.size)throw l("the file is shorter than its structure says");const i=new Uint8Array(await a.slice(t,e).arrayBuffer());if(i.length!==e-t)throw l("the file could not be read completely");return i}class N{constructor(t,e,i){this.logical=t,this.physical=e,this.count=i}find(t){let e=0,i=this.count-1;for(;e<i;){const s=e+i+1>>>1;this.logical[s]<=t?e=s:i=s-1}return e}}class A{constructor(t,e,i){this.file=t,this.runs=e,this.size=i}async read(t,e){if(t<0||e>this.size||t>e)throw new RangeError("Read outside the stream");if(t===e)return new Uint8Array(0);const{file:i,runs:s}=this,{sectorSize:n}=i,r=[];let o=t,h=s.find(Math.floor(o/n));for(;o<e;){const w=s.logical[h],f=h+1<s.count?s.logical[h+1]:1/0,u=Math.min(f*n,e),d=i.sectorOffset(s.physical[h])+(o-w*n);r.push(z(i.blob,d,d+(u-o))),o=u,h++}if(r.length===1)return r[0];const c=await Promise.all(r),m=new Uint8Array(e-t);let g=0;for(const w of c)m.set(w,g),g+=w.length;return m}}class _{constructor(t){this.bytes=t,this.size=t.length}async read(t,e){if(t<0||e>this.size||t>e)throw new RangeError("Read outside the stream");return this.bytes.subarray(t,e)}}class v{constructor(t,e){Object.assign(this,e),this.blob=t,this.fat=null,this.miniFat=null,this.miniStream=null,this.entries=[]}sectorOffset(t){return(t+1)*this.sectorSize}async _readSectors(t){const e=new Uint8Array(t.length*this.sectorSize),i=[];for(let s=0;s<t.length;){let n=s+1;for(;n<t.length&&t[n]===t[n-1]+1;)n++;const r=this.sectorOffset(t[s]),o=s*this.sectorSize;i.push(z(this.blob,r,r+(n-s)*this.sectorSize).then(h=>e.set(h,o))),s=n}return await Promise.all(i),e}_chain(t,e){const{fat:i}=this,s=[];let n=t;for(;n!==M;){if(n>p||n>=i.length)throw l(`bad sector number in the ${e}`);if(s.length>=i.length)throw l(`loop in the ${e}`);s.push(n),n=i[n]}return s}_runs(t,e,i,s){const n=new Uint8Array(Math.ceil(t.length/8)),r=f=>{if(f>=t.length||f>p)throw l(`the ${s} chain is broken`);if(n[f>>3]&1<<(f&7))throw l(`loop in the ${s} chain`);n[f>>3]|=1<<(f&7)};let o=0,h=-2,c=e;for(let f=0;f<i;f++)r(c),c!==h+1&&o++,h=c,c=t[c];const m=new Uint32Array(o),g=new Uint32Array(o);let w=0;h=-2,c=e;for(let f=0;f<i;f++)c!==h+1&&(m[w]=f,g[w]=c,w++),h=c,c=t[c];return new N(m,g,o)}find(...t){let e=this.entries[0];for(const i of t)if(e=this._childNamed(e,i),!e)return null;return e}_childNamed(t,e){const i=e.toUpperCase();for(const s of this.childrenOf(t))if(s.name.toUpperCase()===i)return s;return null}*childrenOf(t){const e=new Set,i=[t.child];for(;i.length>0;){const s=i.pop();if(s===x)continue;const n=this.entries[s];if(!n||e.has(s))throw l("the directory tree is broken");e.add(s),yield n,i.push(n.left,n.right)}}async _loadMini(){if(this.miniFat)return;const t=this.numMiniFat===0?[]:this._chain(this.firstMiniFat,"mini FAT"),e=await this._readSectors(t);this.miniFat=new Uint32Array(e.length/4);const i=new DataView(e.buffer);for(let r=0;r<this.miniFat.length;r++)this.miniFat[r]=i.getUint32(r*4,!0);const s=this.entries[0],n=Math.ceil(s.size/this.sectorSize);this.miniStream=new A(this,this._runs(this.fat,s.start,n,"mini stream"),n*this.sectorSize)}async open(t){if(t.type!==O)throw l(`${t.name} is not a stream`);if(t.size<this.miniCutoff){if(t.size===0)return new _(new Uint8Array(0));await this._loadMini();const r=Math.ceil(t.size/64),o=this._runs(this.miniFat,t.start,r,t.name),h=new Uint8Array(t.size);for(let c=0;c<o.count;c++){const m=o.logical[c]*64,g=Math.min(c+1<o.count?o.logical[c+1]*64:t.size,t.size),w=o.physical[c]*64,f=w+(g-m);if(f>this.miniStream.size)throw l(`${t.name} runs past the mini stream`);h.set(await this.miniStream.read(w,f),m)}return new _(h)}const e=Math.ceil(t.size/this.sectorSize),i=this._runs(this.fat,t.start,e,t.name);let s=0;for(let r=0;r<i.count;r++){const o=(r+1<i.count?i.logical[r+1]:e)-i.logical[r];s=Math.max(s,this.sectorOffset(i.physical[r]+o-1)+this.sectorSize)}const n=t.size%this.sectorSize;if(s-(n?this.sectorSize-n:0)>this.blob.size)throw l(`${t.name} runs past the end of the file`);return new A(this,i,t.size)}async read(t){if(t.size>T)throw l(`${t.name} is too large`);const e=await this.open(t);return e.read(0,e.size)}releaseTables(){this.fat=null,this.miniFat=null}}function $(a){const t=new DataView(a.buffer,a.byteOffset,a.byteLength),e=t.getUint16(26,!0),i=t.getUint16(30,!0);if(t.getUint16(28,!0)!==65534)throw l("bad byte order mark");if(!(e===3&&i===9||e===4&&i===12))throw l("bad version or sector size");if(t.getUint16(32,!0)!==6)throw l("bad mini sector size");if(t.getUint32(56,!0)!==4096)throw l("bad mini stream cutoff");return{major:e,sectorShift:i,sectorSize:1<<i,numFat:t.getUint32(44,!0),firstDir:t.getUint32(48,!0),miniCutoff:4096,firstMiniFat:t.getUint32(60,!0),numMiniFat:t.getUint32(64,!0),firstDifat:t.getUint32(68,!0),numDifat:t.getUint32(72,!0)}}async function V(a,t){const{blob:e,numFat:i,numDifat:s,sectorSize:n}=a;if(i===0||i*n>e.size)throw l("bad FAT size");const r=n/4,o=new Uint32Array(i),h=new DataView(t.buffer,t.byteOffset,t.byteLength);let c=0;for(let u=0;u<D&&c<i;u++)o[c++]=h.getUint32(76+u*4,!0);let m=a.firstDifat;for(let u=0;c<i;u++){if(u>=s||m>p)throw l("the DIFAT is shorter than the FAT");const d=a.sectorOffset(m),b=await z(e,d,d+n),y=new DataView(b.buffer);for(let U=0;U<r-1&&c<i;U++)o[c++]=y.getUint32(U*4,!0);m=y.getUint32((r-1)*4,!0)}for(let u=0;u<i;u++)if(o[u]>p||a.sectorOffset(o[u])+n>e.size)throw l("a FAT sector lies outside the file");const g=await a._readSectors(o),w=new Uint32Array(i*r),f=new DataView(g.buffer);for(let u=0;u<w.length;u++)w[u]=f.getUint32(u*4,!0);a.fat=w}function k(a,t){const e=new DataView(t.buffer),i=Math.min(t.length/S,R),s=new TextDecoder("utf-16le");for(let n=0;n<i;n++){const r=n*S,o=e.getUint16(r+64,!0),h=t[r+66],c=e.getUint32(r+120,!0),m=e.getUint32(r+124,!0),g=a.major===3?c:c+m*2**32;a.entries.push({id:n,type:h,name:h===0||o<2||o>64?"":s.decode(t.subarray(r,r+o-2)),left:e.getUint32(r+68,!0),right:e.getUint32(r+72,!0),child:e.getUint32(r+76,!0),start:e.getUint32(r+116,!0),size:g})}if(a.entries[0]?.type!==C)throw l("the directory has no root entry")}async function j(a){if(!await I(a))throw F("Not a compound file");if(a.size<512)throw l("the file is too short");const t=await z(a,0,512),e=new v(a,$(t));return await V(e,t),k(e,await e._readSectors(e._chain(e.firstDir,"directory"))),e}export{v as CfbFile,A as CfbStream,_ as MemoryStream,I as isCompoundFile,j as openCfb};
@@ -1 +1 @@
1
- import{setU64 as U}from"../zip-writer.js";const f=4294967294,w=4294967295,b=4294967293,z=4294967292,c=4294967295,u=4096,S=64,d=109,F=128,_=2147483648,y=0,g=1,E=1,m=2,M=5;function D(a,i){if(a.length!==i.length)return a.length-i.length;const t=a.toUpperCase(),r=i.toUpperCase();return t<r?-1:t>r?1:0}function x(a){const i=Math.ceil(Math.log2(a.length+1)),t=(r,n,e)=>{if(r>n)return c;const s=r+n>>>1,o=a[s];return o.color=e>1&&e===i?y:g,o.left=t(r,s-1,e+1),o.right=t(s+1,n,e+1),o.id};return t(0,a.length-1,1)}class T{constructor(i,t,{version:r}={}){this.sink=i;const n=t.filter(s=>s.size>=u);if(n.length>1)throw new Error("Only one stream can be at or over the mini stream cutoff");this.big=n[0]??null;const e=this.big!==null&&this.big.size>_;if(this.version=r??(e?4:3),this.version===3&&e)throw new Error("A stream over 2 GiB needs a version 4 file");this.sectorSize=this.version===3?512:4096,this.small=t.filter(s=>s.size<u),this._planDirectory(t),this._planSectors(),this.bigWritten=0}_planDirectory(i){const t={id:0,name:"Root Entry",type:M,children:new Map,left:c,right:c,child:c,color:g,start:f,size:0},r=[t],n=(s,o,h)=>{let l=s.children.get(o);return l||(l={id:r.length,name:o,type:h,children:new Map,left:c,right:c,child:c,color:g,start:h===m?f:0,size:0},r.push(l),s.children.set(o,l)),l};let e=0;for(const s of i){let o=t;for(const l of s.path.slice(0,-1))o=n(o,l,E);const h=n(o,s.path[s.path.length-1],m);h.size=s.size,s.size>=u?h.start=0:s.size>0&&(h.start=e,e+=Math.ceil(s.size/S)),s.node=h}for(const s of r)s.children.size>0&&(s.child=x([...s.children.values()].sort((o,h)=>D(o.name,h.name))));this.nodes=r,this.miniSectors=e,t.size=e*S}_planSectors(){const{sectorSize:i}=this,t=i/4;this.bigSectors=this.big?Math.ceil(this.big.size/i):0,this.miniStreamSectors=Math.ceil(this.miniSectors*S/i),this.dirSectors=Math.ceil(this.nodes.length*128/i),this.miniFatSectors=Math.ceil(this.miniSectors/t);const r=this.bigSectors+this.miniStreamSectors+this.dirSectors+this.miniFatSectors;let n=0,e=0;for(;;){const s=Math.ceil((r+n+e)/t),o=s>d?Math.ceil((s-d)/(t-1)):0;if(s===n&&o===e)break;n=s,e=o}this.fatSectors=n,this.difatSectors=e,this.firstMiniStream=this.bigSectors,this.firstDir=this.firstMiniStream+this.miniStreamSectors,this.firstMiniFat=this.firstDir+this.dirSectors,this.firstFat=this.firstMiniFat+this.miniFatSectors,this.firstDifat=this.firstFat+this.fatSectors,this.totalSectors=this.firstDifat+this.difatSectors,this.nodes[0].start=this.miniStreamSectors>0?this.firstMiniStream:f}get fileSize(){return this.sectorSize+this.totalSectors*this.sectorSize}async writeHeader(){const i=new Uint8Array(this.sectorSize),t=new DataView(i.buffer);i.set([208,207,17,224,161,177,26,225]),t.setUint16(24,62,!0),t.setUint16(26,this.version,!0),t.setUint16(28,65534,!0),t.setUint16(30,this.version===3?9:12,!0),t.setUint16(32,6,!0),t.setUint32(40,this.version===3?0:this.dirSectors,!0),t.setUint32(44,this.fatSectors,!0),t.setUint32(48,this.firstDir,!0),t.setUint32(56,u,!0),t.setUint32(60,this.miniFatSectors>0?this.firstMiniFat:f,!0),t.setUint32(64,this.miniFatSectors,!0),t.setUint32(68,this.difatSectors>0?this.firstDifat:f,!0),t.setUint32(72,this.difatSectors,!0);for(let r=0;r<d;r++)t.setUint32(76+r*4,r<this.fatSectors?this.firstFat+r:w,!0);await this.sink.write(i)}async writeBig(i){this.bigWritten+=i.length,i.length>0&&await this.sink.write(i)}_fatEntry(i){return i<this.bigSectors?i+1===this.bigSectors?f:i+1:i<this.firstDir?i+1===this.firstDir?f:i+1:i<this.firstMiniFat?i+1===this.firstMiniFat?f:i+1:i<this.firstFat?i+1===this.firstFat?f:i+1:i<this.firstDifat?b:i<this.totalSectors?z:w}_directoryBytes(){const i=new Uint8Array(this.dirSectors*this.sectorSize),t=new DataView(i.buffer),r=i.length/128;for(let n=0;n<r;n++){const e=n*128,s=this.nodes[n];if(!s){t.setUint32(e+68,c,!0),t.setUint32(e+72,c,!0),t.setUint32(e+76,c,!0);continue}for(let o=0;o<s.name.length;o++)t.setUint16(e+o*2,s.name.charCodeAt(o),!0);t.setUint16(e+64,(s.name.length+1)*2,!0),i[e+66]=s.type,i[e+67]=s.color,t.setUint32(e+68,s.left,!0),t.setUint32(e+72,s.right,!0),t.setUint32(e+76,s.child,!0),t.setUint32(e+116,s.start,!0),U(t,e+120,s.size)}return i}_miniFatBytes(){const i=new Uint8Array(this.miniFatSectors*this.sectorSize).fill(255),t=new DataView(i.buffer);for(const r of this.small){if(r.size===0)continue;const n=r.node.start,e=Math.ceil(r.size/S);for(let s=0;s<e;s++)t.setUint32((n+s)*4,s+1===e?f:n+s+1,!0)}return i}async _writeFat(){const{sectorSize:i}=this,t=i/4;let r=0;for(let n=0;n<this.fatSectors;){const e=Math.min(F,this.fatSectors-n),s=new Uint8Array(e*i),o=new DataView(s.buffer);for(let h=0;h<e*t;h++)o.setUint32(h*4,this._fatEntry(r++),!0);await this.sink.write(s),n+=e}}async _writeDifat(){const{sectorSize:i}=this,t=i/4;let r=d;for(let n=0;n<this.difatSectors;n++){const e=new Uint8Array(i),s=new DataView(e.buffer);for(let o=0;o<t-1;o++)s.setUint32(o*4,r<this.fatSectors?this.firstFat+r:w,!0),r++;s.setUint32((t-1)*4,n+1<this.difatSectors?this.firstDifat+n+1:f,!0),await this.sink.write(e)}}async finish(i){const{sectorSize:t}=this;if(this.big){if(this.bigWritten!==this.big.size)throw new Error(`The large stream got ${this.bigWritten} bytes, expected ${this.big.size}`);const r=this.big.size%t;r>0&&await this.sink.write(new Uint8Array(t-r))}if(this.miniStreamSectors>0){const r=new Uint8Array(this.miniStreamSectors*t);for(const n of this.small){const e=i.get(n);if(e===void 0||e.length!==n.size)throw new Error(`Stream ${n.path.join("/")} must be ${n.size} bytes`);n.size>0&&r.set(e,n.node.start*S)}await this.sink.write(r)}await this.sink.write(this._directoryBytes()),this.miniFatSectors>0&&await this.sink.write(this._miniFatBytes()),await this._writeFat(),await this._writeDifat()}}export{T as CfbWriter,_ as MAX_V3_STREAM};
1
+ import{setU64 as U}from"../zip-writer.js";const f=4294967294,w=4294967295,b=4294967293,z=4294967292,c=4294967295,u=4096,S=64,d=109,F=128,_=2147483648,y=0,g=1,E=1,m=2,M=5;function x(a,i){if(a.length!==i.length)return a.length-i.length;const t=a.toUpperCase(),r=i.toUpperCase();return t<r?-1:t>r?1:0}function D(a){const i=Math.ceil(Math.log2(a.length+1)),t=(r,n,e)=>{if(r>n)return c;const s=r+n>>>1,o=a[s];return o.color=e>1&&e===i?y:g,o.left=t(r,s-1,e+1),o.right=t(s+1,n,e+1),o.id};return t(0,a.length-1,1)}class T{constructor(i,t,{version:r}={}){this.sink=i;const n=t.filter(s=>s.size>=u);if(n.length>1)throw new Error("Only one stream can be at or over the mini stream cutoff");this.big=n[0]??null;const e=this.big!==null&&this.big.size>_;if(this.version=r??(e?4:3),this.version===3&&e)throw new Error("A stream over 2 GiB needs a version 4 file");this.sectorSize=this.version===3?512:4096,this.small=t.filter(s=>s.size<u),this._planDirectory(t),this._planSectors(),this.bigWritten=0}_planDirectory(i){const t={id:0,name:"Root Entry",type:M,children:new Map,left:c,right:c,child:c,color:g,start:f,size:0},r=[t],n=(s,o,h)=>{let l=s.children.get(o);return l||(l={id:r.length,name:o,type:h,children:new Map,left:c,right:c,child:c,color:g,start:h===m?f:0,size:0},r.push(l),s.children.set(o,l)),l};let e=0;for(const s of i){let o=t;for(const l of s.path.slice(0,-1))o=n(o,l,E);const h=n(o,s.path[s.path.length-1],m);h.size=s.size,s.size>=u?h.start=0:s.size>0&&(h.start=e,e+=Math.ceil(s.size/S)),s.node=h}for(const s of r)s.children.size>0&&(s.child=D([...s.children.values()].sort((o,h)=>x(o.name,h.name))));this.nodes=r,this.miniSectors=e,t.size=e*S}_planSectors(){const{sectorSize:i}=this,t=i/4;this.bigSectors=this.big?Math.ceil(this.big.size/i):0,this.miniStreamSectors=Math.ceil(this.miniSectors*S/i),this.dirSectors=Math.ceil(this.nodes.length*128/i),this.miniFatSectors=Math.ceil(this.miniSectors/t);const r=this.bigSectors+this.miniStreamSectors+this.dirSectors+this.miniFatSectors;let n=0,e=0;for(;;){const s=Math.ceil((r+n+e)/t),o=s>d?Math.ceil((s-d)/(t-1)):0;if(s===n&&o===e)break;n=s,e=o}this.fatSectors=n,this.difatSectors=e,this.firstMiniStream=this.bigSectors,this.firstDir=this.firstMiniStream+this.miniStreamSectors,this.firstMiniFat=this.firstDir+this.dirSectors,this.firstFat=this.firstMiniFat+this.miniFatSectors,this.firstDifat=this.firstFat+this.fatSectors,this.totalSectors=this.firstDifat+this.difatSectors,this.nodes[0].start=this.miniStreamSectors>0?this.firstMiniStream:f}get fileSize(){return this.sectorSize+this.totalSectors*this.sectorSize}async writeHeader(){const i=new Uint8Array(this.sectorSize),t=new DataView(i.buffer);i.set([208,207,17,224,161,177,26,225]),t.setUint16(24,62,!0),t.setUint16(26,this.version,!0),t.setUint16(28,65534,!0),t.setUint16(30,this.version===3?9:12,!0),t.setUint16(32,6,!0),t.setUint32(40,this.version===3?0:this.dirSectors,!0),t.setUint32(44,this.fatSectors,!0),t.setUint32(48,this.firstDir,!0),t.setUint32(56,u,!0),t.setUint32(60,this.miniFatSectors>0?this.firstMiniFat:f,!0),t.setUint32(64,this.miniFatSectors,!0),t.setUint32(68,this.difatSectors>0?this.firstDifat:f,!0),t.setUint32(72,this.difatSectors,!0);for(let r=0;r<d;r++)t.setUint32(76+r*4,r<this.fatSectors?this.firstFat+r:w,!0);await this.sink.write(i)}async writeBig(i){this.bigWritten+=i.length,i.length>0&&await this.sink.write(i)}_fatEntry(i){return i<this.bigSectors?i+1===this.bigSectors?f:i+1:i<this.firstDir?i+1===this.firstDir?f:i+1:i<this.firstMiniFat?i+1===this.firstMiniFat?f:i+1:i<this.firstFat?i+1===this.firstFat?f:i+1:i<this.firstDifat?b:i<this.totalSectors?z:w}_directoryBytes(){const i=new Uint8Array(this.dirSectors*this.sectorSize),t=new DataView(i.buffer),r=i.length/128;for(let n=0;n<r;n++){const e=n*128,s=this.nodes[n];if(!s){t.setUint32(e+68,c,!0),t.setUint32(e+72,c,!0),t.setUint32(e+76,c,!0);continue}for(let o=0;o<s.name.length;o++)t.setUint16(e+o*2,s.name.charCodeAt(o),!0);t.setUint16(e+64,(s.name.length+1)*2,!0),i[e+66]=s.type,i[e+67]=s.color,t.setUint32(e+68,s.left,!0),t.setUint32(e+72,s.right,!0),t.setUint32(e+76,s.child,!0),t.setUint32(e+116,s.start,!0),U(t,e+120,s.size)}return i}_miniFatBytes(){const i=new Uint8Array(this.miniFatSectors*this.sectorSize).fill(255),t=new DataView(i.buffer);for(const r of this.small){if(r.size===0)continue;const n=r.node.start,e=Math.ceil(r.size/S);for(let s=0;s<e;s++)t.setUint32((n+s)*4,s+1===e?f:n+s+1,!0)}return i}async _writeFat(){const{sectorSize:i}=this,t=i/4;let r=0;for(let n=0;n<this.fatSectors;){const e=Math.min(F,this.fatSectors-n),s=new Uint8Array(e*i),o=new DataView(s.buffer);for(let h=0;h<e*t;h++)o.setUint32(h*4,this._fatEntry(r++),!0);await this.sink.write(s),n+=e}}async _writeDifat(){const{sectorSize:i}=this,t=i/4;let r=d;for(let n=0;n<this.difatSectors;n++){const e=new Uint8Array(i),s=new DataView(e.buffer);for(let o=0;o<t-1;o++)s.setUint32(o*4,r<this.fatSectors?this.firstFat+r:w,!0),r++;s.setUint32((t-1)*4,n+1<this.difatSectors?this.firstDifat+n+1:f,!0),await this.sink.write(e)}}async finish(i){const{sectorSize:t}=this;if(this.big){if(this.bigWritten!==this.big.size)throw new Error(`The large stream got ${this.bigWritten} bytes, expected ${this.big.size}`);const r=this.big.size%t;r>0&&await this.sink.write(new Uint8Array(t-r))}if(this.miniStreamSectors>0){const r=new Uint8Array(this.miniStreamSectors*t);for(const n of this.small){const e=i.get(n);if(e===void 0||e.length!==n.size)throw new Error(`Stream ${n.path.join("/")} must be ${n.size} bytes`);n.size>0&&r.set(e,n.node.start*S)}await this.sink.write(r)}await this.sink.write(this._directoryBytes()),this.miniFatSectors>0&&await this.sink.write(this._miniFatBytes()),await this._writeFat(),await this._writeDifat()}}export{T as CfbWriter,_ as MAX_V3_STREAM,D as linkSiblings};
@@ -1 +1 @@
1
- const n="wrong-password",s="corrupt",p="unsupported",c="not-encrypted";class o extends Error{constructor(t,e){super(e),this.name="EncryptedFileError",this.code=t}}const d=()=>new o(n,"The password is not correct"),i=r=>new o(s,`The encrypted file is damaged: ${r}`),x=r=>new o(p,`This kind of encryption is not supported: ${r}`),u=r=>new o(c,r);export{s as CORRUPT,o as EncryptedFileError,c as NOT_ENCRYPTED,p as UNSUPPORTED,n as WRONG_PASSWORD,i as corrupt,u as notEncrypted,x as unsupported,d as wrongPassword};
1
+ const n="wrong-password",s="corrupt",p="unsupported",c="not-encrypted";class r extends Error{constructor(t,e){super(e),this.name="EncryptedFileError",this.code=t}}const d=()=>new r(n,"The password is not correct"),i=o=>new r(s,`The file is damaged: ${o}`),x=o=>new r(p,`This kind of encryption is not supported: ${o}`),u=o=>new r(c,o);export{s as CORRUPT,r as EncryptedFileError,c as NOT_ENCRYPTED,p as UNSUPPORTED,n as WRONG_PASSWORD,i as corrupt,u as notEncrypted,x as unsupported,d as wrongPassword};
package/io/csv.js CHANGED
@@ -1,8 +1,8 @@
1
- import{MAX_COLS as W,MAX_ROWS as et}from"../core/address.js";import{BATCH_CELLS as v}from"./xlsx-read.js";import{BOOL as Z,CHUNK_BITS as it,CHUNK_SIZE as j,EMPTY as st,NUM as X,STR as nt}from"../core/sheet.js";import{parseInput as at}from"../core/input.js";import{regionInput as lt}from"../core/region-input.js";import{dateSerial as ot,formatGeneral as rt}from"../core/numfmt.js";import{cutFixed as ct,fixedCuts as ft,sniffDelimiter as G}from"./text-split.js";function J(){return{count:0,rows:new Uint32Array(v),cols:new Uint16Array(v),kinds:new Uint8Array(v),values:new Float64Array(v),styles:new Uint16Array(v),formulas:null,valueMeta:null,rowMeta:null}}async function gt(u,{delimiter:l,addString:i,styleFor:r,onBatch:h,onProgress:m,preserveIdentifiers:b=!1,textColumns:A,delimiters:k,consecutive:D=!1,qualifier:d='"',fixed:y=null,startRow:C=0,skipColumns:M=null,dateColumns:L=null,region:T=null,maxRows:H=et}){const P=T?lt(T):a=>a;k?.length&&(l=k[0]),y&&(l=`
2
- `);const V=new Set((k?.length?k:[]).map(a=>a.charCodeAt(0))),I=d?d.charCodeAt(0):-1;let Y=a=>a;if(M?.size){const a=Math.max(...M),e=new Int32Array(a+1);let s=0;for(let t=0;t<=a;t++)M.has(t)?(e[t]=-1,s++):e[t]=t-s;Y=t=>t<=a?e[t]:t-s}const N=u.stream().pipeThrough(new TextDecoderStream).getReader();let c=J(),p=0,R=!1,_=0,g=new Uint32Array(0);const q=(a,e)=>{if(_*2>=g.length){const s=new Uint32Array(Math.max(64,g.length*2));s.set(g),g=s}g[_*2]=a,g[_*2+1]=e,_++};let x=0,f="",B=!1,z=!1,F=l,S=!1;F===void 0&&u.slice&&(F=G(await u.slice(0,65536).text(),T?.listSep));let $=!0,U="";if(F===void 0){for(;U.length<65536;){const{done:a,value:e}=await N.read();if(a)break;U+=e}F=G(U.slice(0,65536),T?.listSep)}const E=async()=>{c.count>0&&(await h(c),c=J())},O=()=>{const a=p>=C?Y(x):-1,e=a>=0&&f!=="";if(e&&(p-C>=H||a>=W))R=!0;else if(e){const s=f[0]==="="&&!A?.has(x);s&&q(p-C,a);const t=A?.has(x)||s||b&&/^0\d+$/.test(f),n=L?.has(x)?ot(f,L.get(x)):null,w=n!==null?{kind:X,value:n,format:"m/d/yyyy"}:at(t?`'${f}`:P(f),T?.currency),o=c.count++;c.rows[o]=p-C,c.cols[o]=a,w.kind===X?(c.kinds[o]=X,c.values[o]=w.value,c.styles[o]=w.format?r(w.format):0):w.kind===Z?(c.kinds[o]=Z,c.values[o]=w.value,c.styles[o]=0):w.kind===st?c.count--:(c.kinds[o]=nt,c.values[o]=i(w.text??f),c.styles[o]=0)}f="",x++};if(y)return tt();let K=!1;for(;;){const a=U?{value:U}:await N.read();if(U="",a.done)break;let e=a.value;$&&e.charCodeAt(0)===65279&&(e=e.slice(1)),$=!1,S&&e.length&&(e[0]===`
3
- `&&(e=e.slice(1)),S=!1);let s=0;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(B){n===I&&(f+=e.slice(s,t),e.charCodeAt(t+1)===I?(f+=d,t++,s=t+1):t+1>=e.length?(z=!0,B=!1,s=t+1):(B=!1,s=t+1));continue}if(z&&(z=!1,n===I)){f+=d,B=!0,s=t+1;continue}if(n===I&&f===""&&s===t)B=!0,s=t+1;else if(n===F.charCodeAt(0)||V.has(n)){if(D&&K&&f===""&&s===t){s=t+1;continue}f+=e.slice(s,t),O(),s=t+1,K=!0}else(n===10||n===13)&&(K=!1,f+=e.slice(s,t),O(),n===13&&(e.charCodeAt(t+1)===10?t++:t+1===e.length&&(S=!0)),p++,x=0,s=t+1,c.count>=v-W&&await E())}f+=e.slice(s),m?.(p)}return(f!==""||x>0)&&(O(),p++),await E(),{rows:Math.min(H,Math.max(0,p-C)),truncated:R,formulas:_,formulaCells:g.slice(0,_*2)};async function tt(){const a=ft(y);let e="";const s=async()=>{for(const t of ct(e,a))f=t,O();p++,x=0,e="",c.count>=v-W&&await E()};for(;;){const t=await N.read();if(t.done)break;let n=t.value;$&&n.charCodeAt(0)===65279&&(n=n.slice(1)),$=!1,S&&n.length&&(n[0]===`
4
- `&&(n=n.slice(1)),S=!1);let w=0;for(let o=0;o<n.length;o++){const Q=n.charCodeAt(o);Q!==10&&Q!==13||(e+=n.slice(w,o),await s(),Q===13&&(n.charCodeAt(o+1)===10?o++:o+1===n.length&&(S=!0)),w=o+1)}e+=n.slice(w),m?.(p)}return e!==""&&await s(),await E(),{rows:Math.min(H,Math.max(0,p-C)),truncated:R,formulas:_,formulaCells:g.slice(0,_*2)}}}const ht=(u,l)=>u.includes(l)||u.includes('"')||u.includes(`
5
- `)||u.includes("\r");function*ut(u,l){let i=[],r=0;const{maxRow:h,maxCol:m,columns:b}=u;for(let A=0;A<=h;A+=j){const k=[];for(let d=0;d<=m;d++){const y=b[d]?.[A>>>it];y&&k.push([d,y])}const D=Math.min(j,h-A+1);for(let d=0;d<D;d++)for(const[y,C]of k){if(!C.kinds[d])continue;const M=A+d,L=l(u,M,y);i.push([M,y,L]),r+=L.length,(i.length>=2048||r>=262144)&&(yield i,i=[],r=0)}yield i,i=[],r=0}}class dt{constructor(l,i=",",{bom:r=!1,width:h=0}={}){this.sink=l,this.delimiter=i,this.row=0,this.col=0,this.encoder=new TextEncoder,this.bom=r,this.width=h,this.emptyRow=i.repeat(Math.max(0,h-1))}_pad(){return this.delimiter.repeat(Math.max(0,this.width-1-this.col))}async _write(l){this.bom&&(l=`\uFEFF${l}`,this.bom=!1),await this.sink.write(this.encoder.encode(l))}async batch(l){let i="";for(const[r,h,m]of l)r>this.row&&(i+=this._pad(),r-this.row>1&&(await this._write(i),i="",await this._emptyRows(r-this.row-1)),i+=`\r
6
- `,this.row=r,this.col=0),i+=this.delimiter.repeat(h-this.col),i+=ht(m,this.delimiter)?`"${m.replace(/"/g,'""')}"`:m,this.col=h,i.length>=1<<20&&(await this._write(i),i="");i&&await this._write(i)}async _emptyRows(l){const i=`\r
7
- ${this.emptyRow}`,r=Math.max(1,Math.floor((1<<20)/i.length));for(let h=l;h>0;h-=r)await this._write(i.repeat(Math.min(h,r)))}async finish(l){if(l<this.row){this.bom&&await this._write("");return}await this._write(this._pad()),await this._emptyRows(l-this.row),await this._write(`\r
8
- `)}}async function kt(u,l,i,r=",",h={}){const m=new dt(i,r,h);for(const b of ut(u,l))await m.batch(b);await m.finish(u.maxRow)}export{dt as CsvWriter,ut as csvBatches,rt as formatGeneral,gt as readCsv,G as sniffDelimiter,kt as writeCsv};
1
+ import{MAX_COLS as X,MAX_ROWS as ot}from"../core/address.js";import{BATCH_CELLS as k}from"./xlsx-read.js";import{BOOL as j,CHUNK_BITS as rt,CHUNK_SIZE as J,EMPTY as ct,NUM as G,STR as ft}from"../core/sheet.js";import{parseInput as ht}from"../core/input.js";import{regionInput as ut}from"../core/region-input.js";import{dateSerial as dt,formatGeneral as wt}from"../core/numfmt.js";import{decodeText as mt,sampleText as pt}from"./encoding.js";import{cutFixed as yt,fixedCuts as xt,namedDelimiter as At,sniffDelimiter as P}from"./text-split.js";function V(){return{count:0,rows:new Uint32Array(k),cols:new Uint16Array(k),kinds:new Uint8Array(k),values:new Float64Array(k),styles:new Uint16Array(k),formulas:null,valueMeta:null,rowMeta:null}}async function Bt(u,{delimiter:l,addString:i,styleFor:c,onBatch:h,onProgress:m,preserveIdentifiers:T=!1,textColumns:C,delimiters:_,consecutive:D=!1,qualifier:d='"',fixed:x=null,startRow:y=0,skipColumns:v=null,dateColumns:b=null,region:L=null,encoding:q,fallback:tt=L?.ansi,onEncoding:et,maxRows:H=ot,sepLine:it=!1}){const st=L?ut(L):n=>n;_?.length&&(l=_[0]),x&&(l=`
2
+ `);const nt=new Set((_?.length?_:[]).map(n=>n.charCodeAt(0))),I=d?d.charCodeAt(0):-1;let R=n=>n;if(v?.size){const n=Math.max(...v),e=new Int32Array(n+1);let s=0;for(let t=0;t<=n;t++)v.has(t)?(e[t]=-1,s++):e[t]=t-s;R=t=>t<=n?e[t]:t-s}const Y={encoding:q,fallback:tt},N=u.stream().pipeThrough(mt({...Y,onEncoding:et})).getReader();let f=V(),p=0,z=!1,g=0,M=new Uint32Array(0);const at=(n,e)=>{if(g*2>=M.length){const s=new Uint32Array(Math.max(64,M.length*2));s.set(M),M=s}M[g*2]=n,M[g*2+1]=e,g++};let A=0,r="",B=!1,K=!1,F=l,S=!1;const Z=n=>{const e=it?At(n):null;return e===null?P(n,L?.listSep):(y=Math.max(y,1),e)};F===void 0&&u.slice&&(F=Z((await pt(u,Y)).text));let $=!0,U="";if(F===void 0){for(;U.length<65536;){const{done:n,value:e}=await N.read();if(n)break;U+=e}F=Z(U.slice(0,65536))}const E=async()=>{f.count>0&&(await h(f),f=V())},O=()=>{const n=p>=y?R(A):-1,e=n>=0&&r!=="";if(e&&(p-y>=H||n>=X))z=!0;else if(e){const s=r[0]==="="&&!C?.has(A);s&&at(p-y,n);const t=C?.has(A)||s||r[0]==="'"||T&&/^0\d+$/.test(r),a=b?.has(A)?dt(r,b.get(A)):null,w=a!==null?{kind:G,value:a,format:"m/d/yyyy"}:ht(t?`'${r}`:st(r),L?.currency),o=f.count++;f.rows[o]=p-y,f.cols[o]=n,w.kind===G?(f.kinds[o]=G,f.values[o]=w.value,f.styles[o]=w.format?c(w.format):0):w.kind===j?(f.kinds[o]=j,f.values[o]=w.value,f.styles[o]=0):w.kind===ct?f.count--:(f.kinds[o]=ft,f.values[o]=i(w.text??r),f.styles[o]=0)}r="",A++};if(x)return lt();let Q=!1;for(;;){const n=U?{value:U}:await N.read();if(U="",n.done)break;let e=n.value;$&&e.charCodeAt(0)===65279&&(e=e.slice(1)),$=!1,S&&e.length&&(e[0]===`
3
+ `&&(e=e.slice(1)),S=!1);let s=0;for(let t=0;t<e.length;t++){const a=e.charCodeAt(t);if(B){a===I&&(r+=e.slice(s,t),e.charCodeAt(t+1)===I?(r+=d,t++,s=t+1):t+1>=e.length?(K=!0,B=!1,s=t+1):(B=!1,s=t+1));continue}if(K&&(K=!1,a===I)){r+=d,B=!0,s=t+1;continue}if(a===I&&r===""&&s===t)B=!0,s=t+1;else if(a===F.charCodeAt(0)||nt.has(a)){if(D&&Q&&r===""&&s===t){s=t+1;continue}r+=e.slice(s,t),O(),s=t+1,Q=!0}else(a===10||a===13)&&(Q=!1,r+=e.slice(s,t),O(),a===13&&(e.charCodeAt(t+1)===10?t++:t+1===e.length&&(S=!0)),p++,A=0,s=t+1,f.count>=k-X&&await E())}r+=e.slice(s),m?.(p)}return(r!==""||A>0)&&(O(),p++),await E(),{rows:Math.min(H,Math.max(0,p-y)),truncated:z,formulas:g,formulaCells:M.slice(0,g*2)};async function lt(){const n=xt(x);let e="";const s=async()=>{for(const t of yt(e,n))r=t,O();p++,A=0,e="",f.count>=k-X&&await E()};for(;;){const t=await N.read();if(t.done)break;let a=t.value;$&&a.charCodeAt(0)===65279&&(a=a.slice(1)),$=!1,S&&a.length&&(a[0]===`
4
+ `&&(a=a.slice(1)),S=!1);let w=0;for(let o=0;o<a.length;o++){const W=a.charCodeAt(o);W!==10&&W!==13||(e+=a.slice(w,o),await s(),W===13&&(a.charCodeAt(o+1)===10?o++:o+1===a.length&&(S=!0)),w=o+1)}e+=a.slice(w),m?.(p)}return e!==""&&await s(),await E(),{rows:Math.min(H,Math.max(0,p-y)),truncated:z,formulas:g,formulaCells:M.slice(0,g*2)}}}const Ct=(u,l)=>u.includes(l)||u.includes('"')||u.includes(`
5
+ `)||u.includes("\r");function*gt(u,l){let i=[],c=0;const{maxRow:h,maxCol:m,columns:T}=u;for(let C=0;C<=h;C+=J){const _=[];for(let d=0;d<=m;d++){const x=T[d]?.[C>>>rt];x&&_.push([d,x])}const D=Math.min(J,h-C+1);for(let d=0;d<D;d++)for(const[x,y]of _){if(!y.kinds[d])continue;const v=C+d,b=l(u,v,x);i.push([v,x,b]),c+=b.length,(i.length>=2048||c>=262144)&&(yield i,i=[],c=0)}yield i,i=[],c=0}}class Mt{constructor(l,i=",",{bom:c=!1,width:h=0}={}){this.sink=l,this.delimiter=i,this.row=0,this.col=0,this.encoder=new TextEncoder,this.bom=c,this.width=h,this.emptyRow=i.repeat(Math.max(0,h-1))}_pad(){return this.delimiter.repeat(Math.max(0,this.width-1-this.col))}async _write(l){this.bom&&(l=`\uFEFF${l}`,this.bom=!1),await this.sink.write(this.encoder.encode(l))}async batch(l){let i="";for(const[c,h,m]of l)c>this.row&&(i+=this._pad(),c-this.row>1&&(await this._write(i),i="",await this._emptyRows(c-this.row-1)),i+=`\r
6
+ `,this.row=c,this.col=0),i+=this.delimiter.repeat(h-this.col),i+=Ct(m,this.delimiter)?`"${m.replace(/"/g,'""')}"`:m,this.col=h,i.length>=1<<20&&(await this._write(i),i="");i&&await this._write(i)}async _emptyRows(l){const i=`\r
7
+ ${this.emptyRow}`,c=Math.max(1,Math.floor((1<<20)/i.length));for(let h=l;h>0;h-=c)await this._write(i.repeat(Math.min(h,c)))}async finish(l){if(l<this.row){this.bom&&await this._write("");return}await this._write(this._pad()),await this._emptyRows(l-this.row),await this._write(`\r
8
+ `)}}async function Ft(u,l,i,c=",",h={}){const m=new Mt(i,c,h);for(const T of gt(u,l))await m.batch(T);await m.finish(u.maxRow)}export{Mt as CsvWriter,gt as csvBatches,wt as formatGeneral,Bt as readCsv,P as sniffDelimiter,Ft as writeCsv};
package/io/encoding.js ADDED
@@ -0,0 +1 @@
1
+ const U={"utf-8":"UTF-8","utf-16le":"UTF-16","windows-1250":"Central European (Windows-1250)","iso-8859-2":"Central European (ISO-8859-2)","windows-1251":"Cyrillic (Windows-1251)","windows-1252":"Western European (Windows-1252)","windows-1253":"Greek (Windows-1253)","windows-1254":"Turkish (Windows-1254)","windows-1255":"Hebrew (Windows-1255)","windows-1256":"Arabic (Windows-1256)","windows-1257":"Baltic (Windows-1257)","windows-1258":"Vietnamese (Windows-1258)","windows-874":"Thai (Windows-874)",ibm866:"Cyrillic (DOS 866)",shift_jis:"Japanese (Shift-JIS)","euc-jp":"Japanese (EUC)",gb18030:"Chinese Simplified (GB18030)",big5:"Chinese Traditional (Big5)","euc-kr":"Korean (EUC)"},p={"windows-1250":"pl cs sk hu sl hr ro sq bs","windows-1251":"ru uk be bg sr mk kk ky mn tt","windows-1253":"el","windows-1254":"tr az uz","windows-1255":"he","windows-1256":"ar fa ur","windows-1257":"lt lv et","windows-1258":"vi","windows-874":"th",shift_jis:"ja","euc-kr":"ko"},m=new Map(Object.entries(p).flatMap(([i,n])=>n.split(" ").map(f=>[f,i])));function W(i){let n;try{n=new Intl.Locale(i||"en-US").maximize()}catch{return"windows-1252"}return n.language==="zh"?n.script==="Hant"?"big5":"gb18030":n.script==="Cyrl"?"windows-1251":n.script==="Latn"&&n.language==="sr"?"windows-1250":m.get(n.language)??"windows-1252"}const b=[[[239,187,191],"utf-8"],[[255,254],"utf-16le"],[[254,255],"utf-16be"]];function x(i){for(const[n,f]of b)if(i.length>=n.length&&n.every((r,t)=>i[t]===r))return f;return null}function g(i,n){let f=0,r=0;for(let t=n;t<i.length;){const s=i[t];if(s<128){t++;continue}const d=s>=194&&s<=223?1:s>=224&&s<=239?2:s>=240&&s<=244?3:0;if(d===0){r++,t++;continue}let l=1;for(;l<=d&&t+l<i.length;){const a=i[t+l],o=l>1?128:s===224?160:s===240?144:128,u=l>1?191:s===237?159:s===244?143:191;if(a<o||a>u)break;l++}l>d?f++:t+l<i.length&&r++,t+=l}return f===0&&r===0?null:f>r?"utf-8":"other"}function T(i){const n=Math.min(i.length&-2,64);if(n<4)return null;let f=0,r=0;for(let t=0;t<n;t+=2)i[t]===0&&f++,i[t+1]===0&&r++;return r*2>=n*.7&&f===0?"utf-16le":f*2>=n*.7&&r===0?"utf-16be":null}function E({encoding:i,fallback:n="windows-1252",onEncoding:f}={}){let r=null,t=null,s=!1;const d=o=>{r=new TextDecoder(o),f?.(o)};i&&d(i);const l=(o,u)=>{const e=new Uint8Array(o.length+u.length);return e.set(o),e.set(u,o.length),e},a=(o,u)=>{const e=r.decode(o,{stream:!0});e&&u.enqueue(e)};return new TransformStream({transform(o,u){let e=o instanceof Uint8Array?o:new Uint8Array(o.buffer??o,o.byteOffset??0,o.byteLength);if(r){a(e,u);return}if(t&&(e=l(t,e)),t=null,!s){if(e.length<4){t=e.slice();return}const w=x(e)??T(e);s=!0,w&&d(w)}if(!r){let w=0;for(;w<e.length&&e[w]<128;)w++;if(w===e.length){u.enqueue(h(e));return}const c=g(e,w);if(c===null){w>0&&u.enqueue(h(e.subarray(0,w))),t=e.slice(w);return}d(c==="utf-8"?"utf-8":n)}a(e,u)},flush(o){if(!r){const e=t??new Uint8Array(0);d(x(e)??(g(e,0)==="utf-8"||e.every(w=>w<128)?"utf-8":n)),a(e,o)}const u=r.decode();u&&o.enqueue(u)}})}const C=new TextDecoder,h=i=>C.decode(i);async function y(i,n={},f=65536){let r=n.encoding??"utf-8",t="";const s=i.slice(0,f).stream().pipeThrough(E({...n,onEncoding:d=>{r=d}})).getReader();for(;;){const{done:d,value:l}=await s.read();if(d)return{text:t,encoding:r};t+=l}}export{U as TEXT_ENCODINGS,W as ansiEncoding,E as decodeText,y as sampleText};
@@ -1,2 +1,2 @@
1
- import{relativeTarget as z,relsPathOf as S,resolveTarget as N,sheetPartsByName as ee}from"./package-paths.js";import{unescapeXml as F}from"./xml-scan.js";import{escapeMarkup as R}from"./xml-escape.js";const A="http://schemas.openxmlformats.org/officeDocument/2006/relationships",_="http://schemas.openxmlformats.org/markup-compatibility/2006",te=`${A}/ctrlProp`,V=`${A}/queryTable`,ne=`${A}/vmlDrawing`,se="application/vnd.openxmlformats-officedocument.vmlDrawing",oe=new Set(["{78C0D931-6437-407D-A8EE-F0AAD7539E65}","{05C60535-1F16-4FD2-B633-F4F36F0B64E0}","{A8765BA9-456A-4DAB-B4F3-ACF838C121DE}","{3A4CF648-6AED-40F4-86FF-DC5316D8AED3}","{7E03D99C-DC04-49D9-9315-930204A7B6E9}"]),j=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
- `,X=["sheetCalcPr","sheetProtection","protectedRanges","scenarios","autoFilter","sortState","dataConsolidate","customSheetViews","mergeCells","phoneticPr","conditionalFormatting","dataValidations","hyperlinks","printOptions","pageMargins","pageSetup","headerFooter","rowBreaks","colBreaks","customProperties","cellWatches","ignoredErrors","smartTags","drawing","legacyDrawing","legacyDrawingHF","drawingHF","picture","oleObjects","controls","webPublishItems","tableParts","extLst"],ae=new Set(["sheetCalcPr","protectedRanges","dataConsolidate","phoneticPr","customProperties","cellWatches","ignoredErrors","smartTags","legacyDrawing","oleObjects","controls","webPublishItems"]),I=(e,n)=>{const t=new RegExp(`\\s${n.replace(/[.:]/g,"\\$&")}="([^"]*)"`).exec(e);return t?F(t[1]):void 0},q=e=>[...e.matchAll(/<Relationship\b[^>]*\/>/g)].map(n=>({id:I(n[0],"Id"),type:I(n[0],"Type"),target:I(n[0],"Target"),mode:I(n[0],"TargetMode")})),K=e=>e.slice(e.indexOf(":")+1),P=/<[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/y;function B(e){const n=K(/^<([\w.:-]+)/.exec(e)[1]);if(n!=="AlternateContent")return n;for(const t of e.matchAll(/<([\w.:-]+)/g)){const s=K(t[1]);if(s!=="AlternateContent"&&s!=="Choice"&&s!=="Fallback")return s}return n}function C(e){const n=[];let t=0,s=-1;for(let r=e.indexOf("<");r>=0;r=e.indexOf("<",r)){P.lastIndex=r;const a=P.exec(e);if(!a)break;const o=a[0],i=r;if(r=P.lastIndex,!(o[1]==="?"||o[1]==="!"))if(o[1]==="/"){if(t===0)break;--t===0&&n.push({name:B(e.slice(s,r)),start:s,end:r})}else t===0?o.endsWith("/>")?n.push({name:B(o),start:i,end:r}):(t=1,s=i):o.endsWith("/>")||t++}return n}async function re(e,n,t){const s=(await e.stream(n)).pipeThrough(new TextDecoderStream).getReader(),r=[];let a=null,o="",i=0,l=0,f=0,m=-1;const w=async()=>{const{done:g,value:$}=await s.read();return g?!1:(o+=$,!0)};try{for(;;){if(i===0){const y=/<(?:[\w.-]+:)?sheetData\b[^>]*?(\/?)>/.exec(o);if(y){a=/<(?:[\w.-]+:)?worksheet\b[^>]*>/.exec(o)?.[0]??"",i=y[1]?2:1,o=o.slice(y.index+y[0].length);continue}if(!await w())break;continue}if(i===1){const y=/<\/(?:[\w.-]+:)?sheetData\s*>/.exec(o);if(y){i=2,o=o.slice(y.index+y[0].length);continue}if(o=o.slice(-32),!await w())break;continue}const g=o.indexOf("<",l);P.lastIndex=g;const $=g>=0?P.exec(o):null;if(!$){if(m<0&&(o=g>=0?o.slice(g):"",l=0),!await w())break;continue}const b=$[0];if(l=P.lastIndex,!(b[1]==="?"||b[1]==="!")){if(b[1]==="/"){if(f===0)break;--f===0&&m>=0&&(r.push(o.slice(m,l)),m=-1)}else if(f===0){const y=K(/^<([\w.:-]+)/.exec(b)[1]),k=t.has(y)||y==="AlternateContent";b.endsWith("/>")?k&&r.push(b):(f=1,k&&(m=g))}else b.endsWith("/>")||f++;m<0&&(o=o.slice(l),l=0)}}}finally{s.cancel().catch(()=>{})}return{root:a??"",elements:r.filter(g=>t.has(B(g)))}}function W(e){const n={};for(const t of e.matchAll(/\sxmlns(?::([\w.-]+))?="([^"]*)"/g))n[t[1]??""]=t[2];return n}function H(e){const n=/^<(?:[\w.-]+:)?extLst\b[^>]*>/.exec(e);if(!n||n[0].endsWith("/>"))return[];const t=e.slice(n[0].length,e.search(/<\/(?:[\w.-]+:)?extLst\s*>\s*$/));return C(`${t}</x>`).map(s=>t.slice(s.start,s.end)).map(s=>({uri:I(/^<[^>]*>/.exec(s)[0],"uri")??"",xml:s})).filter(s=>/^<(?:[\w.-]+:)?ext\b/.test(s.xml))}function G(e){const n=new Set;for(const t of e.matchAll(/<\/?([\w.-]+):[\w.-]+|\s([\w.-]+):[\w.-]+=/g))n.add(t[1]??t[2]);for(const t of e.matchAll(/\s(?:[\w.-]+:)?(?:Requires|Ignorable|ProcessContent|PreserveElements|PreserveAttributes)="([^"]*)"/g))for(const s of t[1].split(/\s+/))s&&n.add(s.split(":")[0]);return n.delete("xmlns"),n.delete("xml"),n}const le=e=>[...e.fragments.flatMap(n=>[n.pre??"",n.xml,n.post??""]),...e.exts.map(n=>n.xml)];async function he(e,n){const t={sheets:{},tables:{},parts:{}},s=async a=>{if(t.parts[a]||!e.has(a)||n.skip(a))return;const o=e.has(S(a))?q(await e.text(S(a))):[];t.parts[a]={contentType:n.contentTypeOf(a),rels:o.map(i=>({...i,target:i.mode==="External"?i.target:N(a,i.target)}))};for(const i of t.parts[a].rels)i.mode!=="External"&&await s(i.target)};let r;try{r=await ee(e)}catch{return t}for(const[a,o]of r){if(!e.has(o)||o.includes("/chartsheets/"))continue;const i=S(o),l=e.has(i)?q(await e.text(i)):[],f=new Map(l.map(p=>[p.id,p])),{root:m,elements:w}=await re(e,o,new Set([...ae,"pageSetup","extLst"])),g=W(m),$=Object.keys(g).find(p=>p&&g[p]===A)??"r",b=Object.keys(g).find(p=>p&&g[p]===_),y=b&&I(m,`${b}:Ignorable`)?.split(/\s+/).filter(Boolean)||[],k=new RegExp(`\\s${$}:[\\w.-]+="([^"]*)"`,"g"),c={decls:g,rPrefix:$,ignorable:y,fragments:[],exts:[],printer:null,vml:null,shapeIds:[],rels:{},bare:[]},h=async p=>{const u=f.get(p);if(!u||c.rels[p])return!!u;const x=u.mode==="External"?u.target:N(o,u.target);return c.rels[p]={type:u.type,target:x,mode:u.mode},u.mode!=="External"&&await s(x),!0};for(const p of w){const u=B(p);if(u==="pageSetup"){const d=I(p,`${$}:id`);d&&await h(d)&&(c.printer=d);continue}if(u==="extLst"){for(const d of H(p))if(!oe.has(d.uri.toUpperCase())){for(const T of d.xml.matchAll(k))await h(F(T[1]));c.exts.push(d)}continue}let x={name:u,xml:p};if(u==="controls"){const d=ce(p,T=>f.get(T)?.type!==te,$);if(!d)continue;x={name:u,...d}}if(u==="legacyDrawing"){const d=I(p,`${$}:id`);if(!d||!await h(d))continue;c.vml=d}for(const d of x.xml.matchAll(k))await h(F(d[1]));if(u==="oleObjects"||u==="controls")for(const d of x.xml.matchAll(/\sshapeId="(\d+)"/g))c.shapeIds.includes(Number(d[1]))||c.shapeIds.push(Number(d[1]));c.fragments.push(x)}for(const p of l)p.type===V&&p.mode!=="External"&&await h(p.id)&&c.bare.push(p.id);c.vml&&c.shapeIds.length===0&&(delete c.rels[c.vml],c.fragments=c.fragments.filter(p=>p.name!=="legacyDrawing"),c.vml=null),(c.fragments.length||c.exts.length||c.printer||c.bare.length)&&(t.sheets[a]=c);for(const p of l){if(p.type!==`${A}/table`||p.mode==="External")continue;const u=N(o,p.target);if(!e.has(u))continue;const x=await e.text(u),d=/<(?:[\w.-]+:)?table\b[^>]*>/.exec(x)?.[0]??"";if(I(d,"tableType")!=="queryTable")continue;const E=(e.has(S(u))?q(await e.text(S(u))):[]).filter(D=>D.type===V&&D.mode!=="External");if(E.length===0)continue;const v=[];for(const D of E){const U=N(u,D.target);await s(U),v.push({id:D.id,type:D.type,target:U})}const Z=[...x.matchAll(/<(?:[\w.-]+:)?tableColumn\b[^>]*>/g)].map(D=>({id:I(D[0],"id"),name:I(D[0],"name"),uniqueName:I(D[0],"uniqueName"),queryTableFieldId:I(D[0],"queryTableFieldId")}));t.tables[(I(d,"name")??"").toUpperCase()]={columns:Z,rels:v}}}return t}function ce(e,n,t){const s=/<(?:[\w.-]+:)?controls\b[^>]*>/.exec(e);if(!s||(e.match(/<(?:[\w.-]+:)?controls\b/g)??[]).length!==1)return null;const r=e.search(/<\/(?:[\w.-]+:)?controls\s*>/);if(r<0)return null;const a=e.slice(s.index+s[0].length,r),o=C(`${a}</x>`).map(i=>a.slice(i.start,i.end)).filter(i=>{const l=/<(?:[\w.-]+:)?control\b[^>]*>/.exec(i)?.[0],f=l&&I(l,`${t}:id`);return f?n(f):!1});return o.length===0?null:{xml:o.join(""),units:o,pre:e.slice(0,s.index+s[0].length),post:e.slice(r)}}function Y(e,n){const t=e.lastIndexOf("/"),s=e.lastIndexOf("."),r=s>t?e.slice(0,s):e,a=s>t?e.slice(s):"";if(/-kept\d*$/.test(r)&&!n.has(e))return e;let o=`${r}-kept${a}`;for(let i=2;n.has(o);i++)o=`${r}-kept${i}${a}`;return o}const ie=(e,n)=>!!(n&&!n.existing&&e.comments?.length||e.objects?.controls&&(e.objects.controls.items?.length||e.objects.controls.cameras?.length));function ge(e,n){const t=e?.kept;if(!t)return null;const s=new Map,r=new Set(Object.keys(t.parts)),a=m=>{if(s.has(m)||!t.parts[m])return;const w=Y(m,r);r.add(w),s.set(m,w);for(const g of t.parts[m].rels)g.mode!=="External"&&a(g.target)},o=new Map,i=[];n.sheets.forEach((m,w)=>{const g=m.chartSheet?null:t.sheets[m.name];if(!g)return;const $=!!g.vml&&ie(m,n.noteParts?.[w]);for(const[y,k]of Object.entries(g.rels))if(k.mode!=="External")if(y===g.vml)for(const c of t.parts[k.target]?.rels??[])c.mode!=="External"&&a(c.target);else a(k.target);let b=null;g.vml&&!$&&(b=Y(g.rels[g.vml].target,r),r.add(b),i.push({partName:`/${b}`,contentType:se})),o.set(w,{...g,merge:$,vmlName:b})});const l=new Map;for(const m of n.tables??[]){const w=m.xml!==null?t.tables[m.patch.name.toUpperCase()]:null;if(!w)continue;const g=[...m.xml.matchAll(/<tableColumn\b[^>]*>/g)].map(b=>I(b[0],"name")),$=new Map(w.columns.map(b=>[b.name?.toLowerCase(),b]));if(!(g.length!==w.columns.length||g.some(b=>!$.has(b?.toLowerCase())))){for(const b of w.rels)a(b.target);l.set(m.part,{...w,byName:$})}}if(o.size===0&&l.size===0)return null;const f=[...[...s].map(([m,w])=>({partName:`/${w}`,contentType:t.parts[m].contentType})),...i];return{sheets:o,tables:l,names:s,types:f,kept:t}}function O(e,n,t){return e.map(s=>{const r=s.mode==="External"?s.target:z(n,t.get(s.target)??s.target);return`<Relationship Id="${R(s.id)}" Type="${R(s.type)}" Target="${R(r)}"${s.mode?` TargetMode="${R(s.mode)}"`:""}/>`}).join("")}function M(e,n,t={}){const s=G(e),r=/^<[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/.exec(e)[0],a=W(r),o=[...s].filter(l=>!(l in a)&&n[l]&&t[l]!==n[l]&&!(l==="r"&&n[l]===A)).map(l=>` xmlns:${l}="${R(n[l])}"`).join("");if(!o)return e;const i=r.endsWith("/>")?r.length-2:r.length-1;return e.slice(0,i)+o+e.slice(i)}function xe(e,n){const t=/<(?:[\w.-]+:)?worksheet\b[^>]*>/.exec(e);if(!t)return e;const s=W(t[0]),r=new Set;for(const l of le(n))for(const f of G(l))r.add(f);let a=t[0];const o=[];for(const l of r)!l||!n.decls[l]||l in s||(o.push(` xmlns:${l}="${R(n.decls[l])}"`),s[l]=n.decls[l]);const i=n.ignorable.filter(l=>r.has(l)&&s[l]===n.decls[l]);if(i.length){let l=Object.keys(s).find(f=>f&&s[f]===_);if(!l&&!("mc"in s)&&(l="mc",o.push(` xmlns:mc="${_}"`),s.mc=_),l){const f=new RegExp(`(\\s${l}:Ignorable=")([^"]*)(")`),m=f.exec(a)?.[2].split(/\s+/).filter(Boolean)??[],w=[...new Set([...m,...i])].join(" ");a=f.test(a)?a.replace(f,`$1${w}$3`):a.replace(/(\/?)>$/,` ${l}:Ignorable="${w}"$1>`)}}return o.length&&(a=a.replace(/(\/?)>$/,`${o.join("")}$1>`)),n.rootDecls=s,e.replace(t[0],a)}function we(e,n){const t=e?.controls;if(!t||!n?.shapeIds.length)return;const s=new Set(n.shapeIds),r=[...t.items??[],...t.cameras??[]];if(!r.some(m=>s.has(m.shapeId)))return;let a=typeof e.xml=="string"?e.xml:e.xml?new TextDecoder().decode(e.xml):"";const o=[...a.matchAll(/<(?:[\w.-]+:)?cNvPr\b[^>]*?\sid="(\d+)"|_x0000_s(\d+)"/g)].map(m=>Number(m[1]??m[2]));let i=Math.max(1024,...n.shapeIds,...r.map(m=>m.shapeId),...o);const l=new Set(String(t.idmap??"").split(",").map(m=>m.trim()).filter(Boolean)),f=new Set(t.items??[]);for(const m of r){if(!s.has(m.shapeId))continue;const w=m.shapeId,g=++i;m.shapeId=g,l.add(String(Math.floor(g/1024))),f.has(m)&&(a=a.replace(new RegExp(`(<(?:[\\w.-]+:)?cNvPr\\b[^>]*?\\sid=")${w}(")`),`$1${g}$2`)),a=a.replace(new RegExp(`_x0000_s${w}"`,"g"),`_x0000_s${g}"`)}t.idmap=[...l].join(","),e.xml&&(e.xml=a)}function L(e,n,t){const s=X.indexOf(n),r=C(e).find(o=>X.indexOf(o.name)>s),a=r?r.start:e.search(/<\/(?:[\w.-]+:)?worksheet\s*>/);return a<0?e+t:e.slice(0,a)+t+e.slice(a)}const Q=e=>[...e.matchAll(/<v:(shape|rect|roundrect|oval|line|polyline|arc|group|image)\b(?:(?!<\/v:\1>)[\s\S])*?<\/v:\1>/g)].map(n=>n[0]);async function be(e,n){const{group:t,part:s,pending:r,extraParts:a,foreignZip:o,names:i}=n,{kept:l}=n;let f=e,m=0;const w=new Map,g=h=>{if(!w.has(h)){const p=`rIdKept${++m}`;w.set(h,p);const u=t.rels[h];r.push(O([{id:p,type:u.type,target:u.target,mode:u.mode}],s,i))}return w.get(h)},$=new RegExp(`(\\s${t.rPrefix}:[\\w.-]+=")([^"]*)(")`,"g"),b=h=>h.replace($,(p,u,x,d)=>t.rels[F(x)]?`${u}${g(F(x))}${d}`:p);if(t.printer){const h=g(t.printer),p=/<pageSetup\b[^>]*?\/>/.exec(f);f=p?f.replace(p[0],p[0].replace(/\/>$/,` r:id="${h}"/>`)):L(f,"pageSetup",`<pageSetup r:id="${h}"/>`)}for(const h of t.bare)g(h);const y=new Set(C(f).map(h=>h.name)),k=t.rootDecls??{};let c=t.fragments;if(t.vml){const h=/<legacyDrawing\b[^>]*\br:id="([^"]+)"/.exec(f)?.[1],p=await o.text(t.rels[t.vml].target),u=l.parts[t.rels[t.vml].target]?.rels??[];let x=!1;if(t.merge&&h){const d=r.map(v=>v.includes(`Id="${h}"`)?/Target="([^"]+)"/.exec(v)?.[1]:null).find(Boolean),T=d?N(s,d):null,E=T?a.find(v=>v.path===T):null;x=E?J(E,p,t,u,a,i):!1,x&&(c=c.filter(v=>v.name!=="legacyDrawing"))}else if(!t.merge&&!h){const d={path:t.vmlName,xml:pe(p)};if(x=J(d,p,t,u,a,i),x){a.push(d);const T=`rIdKept${++m}`;r.push(O([{id:T,type:ne,target:t.vmlName}],s,i)),c=c.map(E=>E.name==="legacyDrawing"?{name:E.name,xml:`<legacyDrawing r:id="${T}"/>`}:E)}}x||(c=c.filter(d=>!["legacyDrawing","oleObjects","controls"].includes(d.name)))}for(const h of c){if(h.name==="controls"){const p=h.units.map(x=>M(b(x),t.decls,k)),u=C(f).find(x=>x.name==="controls");if(u){const x=f.slice(u.start,u.end),d=x.search(/<\/(?:[\w.-]+:)?controls\s*>/);f=f.slice(0,u.start)+x.slice(0,d)+p.join("")+x.slice(d)+f.slice(u.end)}else f=L(f,"controls",M(`${b(h.pre)}${p.join("")}${h.post}`,t.decls,k));continue}y.has(h.name)||(f=L(f,h.name,M(b(h.xml),t.decls,k)))}if(t.exts.length){const h=C(f).find(d=>d.name==="extLst"),p=h?f.slice(h.start,h.end):"",u=new Set(H(p).map(d=>d.uri.toUpperCase())),x=t.exts.filter(d=>!u.has(d.uri.toUpperCase())).map(d=>M(b(d.xml),t.decls,k)).join("");if(x&&h){const d=p.search(/<\/(?:[\w.-]+:)?extLst\s*>\s*$/);f=f.slice(0,h.start)+p.slice(0,d)+x+p.slice(d)+f.slice(h.end)}else x&&(f=L(f,"extLst",`<extLst>${x}</extLst>`))}return f}function pe(e){const n=/<xml\b[^>]*>/.exec(e)?.[0]??'<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">',t=/<o:shapelayout\b[\s\S]*?<\/o:shapelayout>/.exec(e)?.[0]??"";return`${n}${t}</xml>`}function fe(e,n){return e.replace(/(<o:idmap\b[^>]*?\sdata=")([^"]*)(")/,(t,s,r,a)=>{const o=new Set(r.split(",").map(i=>i.trim()).filter(Boolean));for(const i of n)o.add(String(Math.floor(i/1024)));return`${s}${[...o].join(",")}${a}`})}function J(e,n,t,s,r,a){let o=typeof e.xml=="string"?e.xml:new TextDecoder().decode(e.xml);const i=new Set(t.shapeIds),l=Q(n).filter(c=>i.has(Number(/\bid="_x0000_s(\d+)"/.exec(c)?.[1])));if(l.length===0)return!1;let f=Math.max(1024,...[...o.matchAll(/_x0000_s(\d+)/g)].map(c=>Number(c[1])),...t.shapeIds);for(const c of Q(o)){const h=Number(/\bid="_x0000_s(\d+)"/.exec(c)?.[1]);i.has(h)&&/ObjectType="Note"/.test(c)&&(o=o.replace(c,c.replace(`id="_x0000_s${h}"`,`id="_x0000_s${++f}"`)))}if([...o.matchAll(/\bid="_x0000_s(\d+)"/g)].some(c=>i.has(Number(c[1]))))return!1;o=fe(o,t.shapeIds);const m=new Map,w=[],g=S(e.path),$=r.find(c=>c.path===g);let b=0;const y=l.map(c=>c.replace(/(\so:relid=")([^"]*)(")/g,(h,p,u,x)=>{const d=s.find(T=>T.id===u);return d?(m.has(u)||(m.set(u,`rIdKeptV${++b}`),w.push({...d,id:m.get(u)})),`${p}${m.get(u)}${x}`):h})),k=[...new Set(y.map(c=>/\btype="#([^"]+)"/.exec(c)?.[1]).filter(Boolean))].filter(c=>!o.includes(`id="${c}"`)).map(c=>new RegExp(`<v:shapetype\\b[^>]*\\bid="${c}"(?:(?!</v:shapetype>)[\\s\\S])*?</v:shapetype>`).exec(n)?.[0]??"").join("");if(e.xml=o.replace(/<\/xml>\s*$/,`${k}${y.join("")}</xml>`),w.length){const c=O(w,e.path,a);$?$.xml=String($.xml).replace("</Relationships>",`${c}</Relationships>`):r.push({path:g,xml:`${j}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${c}</Relationships>`})}return!0}function $e(e,n){let t=e.replace(/<table\b[^>]*?(\/?)>/,s=>/\stableType=/.test(s)?s:s.replace(/(\/?)>$/,' tableType="queryTable"$1>'));return t=t.replace(/<tableColumn\b[^>]*?(\/?)>/g,s=>{const r=n.byName.get(I(s,"name")?.toLowerCase());if(!r)return s;let a=s.replace(/\s(?:uniqueName|queryTableFieldId)="[^"]*"/g,"").replace(/\sid="[^"]*"/,` id="${R(r.id)}"`);const o=`${r.uniqueName!==void 0?` uniqueName="${R(r.uniqueName)}"`:""}${r.queryTableFieldId!==void 0?` queryTableFieldId="${R(r.queryTableFieldId)}"`:""}`;return a=a.replace(/(\/?)>$/,`${o}$1>`),a}),t}const ye=(e,n,t)=>({path:S(e),xml:`${j}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${O(n.rels,e,t)}</Relationships>`});async function Ie(e,n,t,s){for(const[r,a]of n.names){const o=t.entries.get(r);if(!o||s.has(a))continue;await e.copyRaw(t,o,a),s.add(a);const i=n.kept.parts[r].rels;if(i.length){const l=S(a);s.has(l)||(await e.addBytes(l,`${j}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${O(i,a,n.names)}</Relationships>`),s.add(l))}}}export{be as applyKeptSheet,we as clearKeptShapeIds,xe as declareKeptNamespaces,ye as keptTableRels,$e as keptTableXml,ge as planKeptParts,he as readKeptSheets,Ie as writeKeptParts};
1
+ import{relativeTarget as z,relsPathOf as R,resolveTarget as N,sheetPartsByName as ee}from"./package-paths.js";import{unescapeXml as F}from"./xml-scan.js";import{escapeMarkup as C}from"./xml-escape.js";const S="http://schemas.openxmlformats.org/officeDocument/2006/relationships",O="http://schemas.openxmlformats.org/markup-compatibility/2006",te=`${S}/ctrlProp`,V=`${S}/queryTable`,ne=`${S}/vmlDrawing`,se="application/vnd.openxmlformats-officedocument.vmlDrawing",oe=new Set(["{78C0D931-6437-407D-A8EE-F0AAD7539E65}","{05C60535-1F16-4FD2-B633-F4F36F0B64E0}","{CCE6A557-97BC-4B89-ADB6-D9C93CAAB3DF}","{A8765BA9-456A-4DAB-B4F3-ACF838C121DE}","{3A4CF648-6AED-40F4-86FF-DC5316D8AED3}","{7E03D99C-DC04-49D9-9315-930204A7B6E9}"]),j=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ `,X=["sheetCalcPr","sheetProtection","protectedRanges","scenarios","autoFilter","sortState","dataConsolidate","customSheetViews","mergeCells","phoneticPr","conditionalFormatting","dataValidations","hyperlinks","printOptions","pageMargins","pageSetup","headerFooter","rowBreaks","colBreaks","customProperties","cellWatches","ignoredErrors","smartTags","drawing","legacyDrawing","legacyDrawingHF","drawingHF","picture","oleObjects","controls","webPublishItems","tableParts","extLst"],ae=new Set(["sheetCalcPr","protectedRanges","dataConsolidate","phoneticPr","customProperties","cellWatches","ignoredErrors","smartTags","legacyDrawing","oleObjects","controls","webPublishItems"]),I=(e,n)=>{const t=new RegExp(`\\s${n.replace(/[.:]/g,"\\$&")}="([^"]*)"`).exec(e);return t?F(t[1]):void 0},q=e=>[...e.matchAll(/<Relationship\b[^>]*\/>/g)].map(n=>({id:I(n[0],"Id"),type:I(n[0],"Type"),target:I(n[0],"Target"),mode:I(n[0],"TargetMode")})),K=e=>e.slice(e.indexOf(":")+1),v=/<[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/y;function _(e){const n=K(/^<([\w.:-]+)/.exec(e)[1]);if(n!=="AlternateContent")return n;for(const t of e.matchAll(/<([\w.:-]+)/g)){const s=K(t[1]);if(s!=="AlternateContent"&&s!=="Choice"&&s!=="Fallback")return s}return n}function P(e){const n=[];let t=0,s=-1;for(let r=e.indexOf("<");r>=0;r=e.indexOf("<",r)){v.lastIndex=r;const a=v.exec(e);if(!a)break;const o=a[0],i=r;if(r=v.lastIndex,!(o[1]==="?"||o[1]==="!"))if(o[1]==="/"){if(t===0)break;--t===0&&n.push({name:_(e.slice(s,r)),start:s,end:r})}else t===0?o.endsWith("/>")?n.push({name:_(o),start:i,end:r}):(t=1,s=i):o.endsWith("/>")||t++}return n}async function re(e,n,t){const s=(await e.stream(n)).pipeThrough(new TextDecoderStream).getReader(),r=[];let a=null,o="",i=0,l=0,f=0,m=-1;const w=async()=>{const{done:g,value:$}=await s.read();return g?!1:(o+=$,!0)};try{for(;;){if(i===0){const y=/<(?:[\w.-]+:)?sheetData\b[^>]*?(\/?)>/.exec(o);if(y){a=/<(?:[\w.-]+:)?worksheet\b[^>]*>/.exec(o)?.[0]??"",i=y[1]?2:1,o=o.slice(y.index+y[0].length);continue}if(!await w())break;continue}if(i===1){const y=/<\/(?:[\w.-]+:)?sheetData\s*>/.exec(o);if(y){i=2,o=o.slice(y.index+y[0].length);continue}if(o=o.slice(-32),!await w())break;continue}const g=o.indexOf("<",l);v.lastIndex=g;const $=g>=0?v.exec(o):null;if(!$){if(m<0&&(o=g>=0?o.slice(g):"",l=0),!await w())break;continue}const b=$[0];if(l=v.lastIndex,!(b[1]==="?"||b[1]==="!")){if(b[1]==="/"){if(f===0)break;--f===0&&m>=0&&(r.push(o.slice(m,l)),m=-1)}else if(f===0){const y=K(/^<([\w.:-]+)/.exec(b)[1]),k=t.has(y)||y==="AlternateContent";b.endsWith("/>")?k&&r.push(b):(f=1,k&&(m=g))}else b.endsWith("/>")||f++;m<0&&(o=o.slice(l),l=0)}}}finally{s.cancel().catch(()=>{})}return{root:a??"",elements:r.filter(g=>t.has(_(g)))}}function W(e){const n={};for(const t of e.matchAll(/\sxmlns(?::([\w.-]+))?="([^"]*)"/g))n[t[1]??""]=t[2];return n}function H(e){const n=/^<(?:[\w.-]+:)?extLst\b[^>]*>/.exec(e);if(!n||n[0].endsWith("/>"))return[];const t=e.slice(n[0].length,e.search(/<\/(?:[\w.-]+:)?extLst\s*>\s*$/));return P(`${t}</x>`).map(s=>t.slice(s.start,s.end)).map(s=>({uri:I(/^<[^>]*>/.exec(s)[0],"uri")??"",xml:s})).filter(s=>/^<(?:[\w.-]+:)?ext\b/.test(s.xml))}function G(e){const n=new Set;for(const t of e.matchAll(/<\/?([\w.-]+):[\w.-]+|\s([\w.-]+):[\w.-]+=/g))n.add(t[1]??t[2]);for(const t of e.matchAll(/\s(?:[\w.-]+:)?(?:Requires|Ignorable|ProcessContent|PreserveElements|PreserveAttributes)="([^"]*)"/g))for(const s of t[1].split(/\s+/))s&&n.add(s.split(":")[0]);return n.delete("xmlns"),n.delete("xml"),n}const le=e=>[...e.fragments.flatMap(n=>[n.pre??"",n.xml,n.post??""]),...e.exts.map(n=>n.xml)];async function he(e,n){const t={sheets:{},tables:{},parts:{}},s=async a=>{if(t.parts[a]||!e.has(a)||n.skip(a))return;const o=e.has(R(a))?q(await e.text(R(a))):[];t.parts[a]={contentType:n.contentTypeOf(a),rels:o.map(i=>({...i,target:i.mode==="External"?i.target:N(a,i.target)}))};for(const i of t.parts[a].rels)i.mode!=="External"&&await s(i.target)};let r;try{r=await ee(e)}catch{return t}for(const[a,o]of r){if(!e.has(o)||o.includes("/chartsheets/"))continue;const i=R(o),l=e.has(i)?q(await e.text(i)):[],f=new Map(l.map(p=>[p.id,p])),{root:m,elements:w}=await re(e,o,new Set([...ae,"pageSetup","extLst"])),g=W(m),$=Object.keys(g).find(p=>p&&g[p]===S)??"r",b=Object.keys(g).find(p=>p&&g[p]===O),y=b&&I(m,`${b}:Ignorable`)?.split(/\s+/).filter(Boolean)||[],k=new RegExp(`\\s${$}:[\\w.-]+="([^"]*)"`,"g"),c={decls:g,rPrefix:$,ignorable:y,fragments:[],exts:[],printer:null,vml:null,shapeIds:[],rels:{},bare:[]},h=async p=>{const u=f.get(p);if(!u||c.rels[p])return!!u;const x=u.mode==="External"?u.target:N(o,u.target);return c.rels[p]={type:u.type,target:x,mode:u.mode},u.mode!=="External"&&await s(x),!0};for(const p of w){const u=_(p);if(u==="pageSetup"){const d=I(p,`${$}:id`);d&&await h(d)&&(c.printer=d);continue}if(u==="extLst"){for(const d of H(p))if(!oe.has(d.uri.toUpperCase())){for(const T of d.xml.matchAll(k))await h(F(T[1]));c.exts.push(d)}continue}let x={name:u,xml:p};if(u==="controls"){const d=ce(p,T=>f.get(T)?.type!==te,$);if(!d)continue;x={name:u,...d}}if(u==="legacyDrawing"){const d=I(p,`${$}:id`);if(!d||!await h(d))continue;c.vml=d}for(const d of x.xml.matchAll(k))await h(F(d[1]));if(u==="oleObjects"||u==="controls")for(const d of x.xml.matchAll(/\sshapeId="(\d+)"/g))c.shapeIds.includes(Number(d[1]))||c.shapeIds.push(Number(d[1]));c.fragments.push(x)}for(const p of l)p.type===V&&p.mode!=="External"&&await h(p.id)&&c.bare.push(p.id);c.vml&&c.shapeIds.length===0&&(delete c.rels[c.vml],c.fragments=c.fragments.filter(p=>p.name!=="legacyDrawing"),c.vml=null),(c.fragments.length||c.exts.length||c.printer||c.bare.length)&&(t.sheets[a]=c);for(const p of l){if(p.type!==`${S}/table`||p.mode==="External")continue;const u=N(o,p.target);if(!e.has(u))continue;const x=await e.text(u),d=/<(?:[\w.-]+:)?table\b[^>]*>/.exec(x)?.[0]??"";if(I(d,"tableType")!=="queryTable")continue;const E=(e.has(R(u))?q(await e.text(R(u))):[]).filter(D=>D.type===V&&D.mode!=="External");if(E.length===0)continue;const A=[];for(const D of E){const U=N(u,D.target);await s(U),A.push({id:D.id,type:D.type,target:U})}const Z=[...x.matchAll(/<(?:[\w.-]+:)?tableColumn\b[^>]*>/g)].map(D=>({id:I(D[0],"id"),name:I(D[0],"name"),uniqueName:I(D[0],"uniqueName"),queryTableFieldId:I(D[0],"queryTableFieldId")}));t.tables[(I(d,"name")??"").toUpperCase()]={columns:Z,rels:A}}}return t}function ce(e,n,t){const s=/<(?:[\w.-]+:)?controls\b[^>]*>/.exec(e);if(!s||(e.match(/<(?:[\w.-]+:)?controls\b/g)??[]).length!==1)return null;const r=e.search(/<\/(?:[\w.-]+:)?controls\s*>/);if(r<0)return null;const a=e.slice(s.index+s[0].length,r),o=P(`${a}</x>`).map(i=>a.slice(i.start,i.end)).filter(i=>{const l=/<(?:[\w.-]+:)?control\b[^>]*>/.exec(i)?.[0],f=l&&I(l,`${t}:id`);return f?n(f):!1});return o.length===0?null:{xml:o.join(""),units:o,pre:e.slice(0,s.index+s[0].length),post:e.slice(r)}}function Y(e,n){const t=e.lastIndexOf("/"),s=e.lastIndexOf("."),r=s>t?e.slice(0,s):e,a=s>t?e.slice(s):"";if(/-kept\d*$/.test(r)&&!n.has(e))return e;let o=`${r}-kept${a}`;for(let i=2;n.has(o);i++)o=`${r}-kept${i}${a}`;return o}const ie=(e,n)=>!!(n&&!n.existing&&e.comments?.length||e.objects?.controls&&(e.objects.controls.items?.length||e.objects.controls.cameras?.length));function ge(e,n){const t=e?.kept;if(!t)return null;const s=new Map,r=new Set(Object.keys(t.parts)),a=m=>{if(s.has(m)||!t.parts[m])return;const w=Y(m,r);r.add(w),s.set(m,w);for(const g of t.parts[m].rels)g.mode!=="External"&&a(g.target)},o=new Map,i=[];n.sheets.forEach((m,w)=>{const g=m.chartSheet?null:t.sheets[m.name];if(!g)return;const $=!!g.vml&&ie(m,n.noteParts?.[w]);for(const[y,k]of Object.entries(g.rels))if(k.mode!=="External")if(y===g.vml)for(const c of t.parts[k.target]?.rels??[])c.mode!=="External"&&a(c.target);else a(k.target);let b=null;g.vml&&!$&&(b=Y(g.rels[g.vml].target,r),r.add(b),i.push({partName:`/${b}`,contentType:se})),o.set(w,{...g,merge:$,vmlName:b})});const l=new Map;for(const m of n.tables??[]){const w=m.xml!==null?t.tables[m.patch.name.toUpperCase()]:null;if(!w)continue;const g=[...m.xml.matchAll(/<tableColumn\b[^>]*>/g)].map(b=>I(b[0],"name")),$=new Map(w.columns.map(b=>[b.name?.toLowerCase(),b]));if(!(g.length!==w.columns.length||g.some(b=>!$.has(b?.toLowerCase())))){for(const b of w.rels)a(b.target);l.set(m.part,{...w,byName:$})}}if(o.size===0&&l.size===0)return null;const f=[...[...s].map(([m,w])=>({partName:`/${w}`,contentType:t.parts[m].contentType})),...i];return{sheets:o,tables:l,names:s,types:f,kept:t}}function B(e,n,t){return e.map(s=>{const r=s.mode==="External"?s.target:z(n,t.get(s.target)??s.target);return`<Relationship Id="${C(s.id)}" Type="${C(s.type)}" Target="${C(r)}"${s.mode?` TargetMode="${C(s.mode)}"`:""}/>`}).join("")}function M(e,n,t={}){const s=G(e),r=/^<[^>"']*(?:(?:"[^"]*"|'[^']*')[^>"']*)*>/.exec(e)[0],a=W(r),o=[...s].filter(l=>!(l in a)&&n[l]&&t[l]!==n[l]&&!(l==="r"&&n[l]===S)).map(l=>` xmlns:${l}="${C(n[l])}"`).join("");if(!o)return e;const i=r.endsWith("/>")?r.length-2:r.length-1;return e.slice(0,i)+o+e.slice(i)}function xe(e,n){const t=/<(?:[\w.-]+:)?worksheet\b[^>]*>/.exec(e);if(!t)return e;const s=W(t[0]),r=new Set;for(const l of le(n))for(const f of G(l))r.add(f);let a=t[0];const o=[];for(const l of r)!l||!n.decls[l]||l in s||(o.push(` xmlns:${l}="${C(n.decls[l])}"`),s[l]=n.decls[l]);const i=n.ignorable.filter(l=>r.has(l)&&s[l]===n.decls[l]);if(i.length){let l=Object.keys(s).find(f=>f&&s[f]===O);if(!l&&!("mc"in s)&&(l="mc",o.push(` xmlns:mc="${O}"`),s.mc=O),l){const f=new RegExp(`(\\s${l}:Ignorable=")([^"]*)(")`),m=f.exec(a)?.[2].split(/\s+/).filter(Boolean)??[],w=[...new Set([...m,...i])].join(" ");a=f.test(a)?a.replace(f,`$1${w}$3`):a.replace(/(\/?)>$/,` ${l}:Ignorable="${w}"$1>`)}}return o.length&&(a=a.replace(/(\/?)>$/,`${o.join("")}$1>`)),n.rootDecls=s,e.replace(t[0],()=>a)}function we(e,n){const t=e?.controls;if(!t||!n?.shapeIds.length)return;const s=new Set(n.shapeIds),r=[...t.items??[],...t.cameras??[]];if(!r.some(m=>s.has(m.shapeId)))return;let a=typeof e.xml=="string"?e.xml:e.xml?new TextDecoder().decode(e.xml):"";const o=[...a.matchAll(/<(?:[\w.-]+:)?cNvPr\b[^>]*?\sid="(\d+)"|_x0000_s(\d+)"/g)].map(m=>Number(m[1]??m[2]));let i=Math.max(1024,...n.shapeIds,...r.map(m=>m.shapeId),...o);const l=new Set(String(t.idmap??"").split(",").map(m=>m.trim()).filter(Boolean)),f=new Set(t.items??[]);for(const m of r){if(!s.has(m.shapeId))continue;const w=m.shapeId,g=++i;m.shapeId=g,l.add(String(Math.floor(g/1024))),f.has(m)&&(a=a.replace(new RegExp(`(<(?:[\\w.-]+:)?cNvPr\\b[^>]*?\\sid=")${w}(")`),`$1${g}$2`)),a=a.replace(new RegExp(`_x0000_s${w}"`,"g"),()=>`_x0000_s${g}"`)}t.idmap=[...l].join(","),e.xml&&(e.xml=a)}function L(e,n,t){const s=X.indexOf(n),r=P(e).find(o=>X.indexOf(o.name)>s),a=r?r.start:e.search(/<\/(?:[\w.-]+:)?worksheet\s*>/);return a<0?e+t:e.slice(0,a)+t+e.slice(a)}const Q=e=>[...e.matchAll(/<v:(shape|rect|roundrect|oval|line|polyline|arc|group|image)\b(?:(?!<\/v:\1>)[\s\S])*?<\/v:\1>/g)].map(n=>n[0]);async function be(e,n){const{group:t,part:s,pending:r,extraParts:a,foreignZip:o,names:i}=n,{kept:l}=n;let f=e,m=0;const w=new Map,g=h=>{if(!w.has(h)){const p=`rIdKept${++m}`;w.set(h,p);const u=t.rels[h];r.push(B([{id:p,type:u.type,target:u.target,mode:u.mode}],s,i))}return w.get(h)},$=new RegExp(`(\\s${t.rPrefix}:[\\w.-]+=")([^"]*)(")`,"g"),b=h=>h.replace($,(p,u,x,d)=>t.rels[F(x)]?`${u}${g(F(x))}${d}`:p);if(t.printer){const h=g(t.printer),p=/<pageSetup\b[^>]*?\/>/.exec(f);f=p?f.replace(p[0],()=>p[0].replace(/\/>$/,()=>` r:id="${h}"/>`)):L(f,"pageSetup",`<pageSetup r:id="${h}"/>`)}for(const h of t.bare)g(h);const y=new Set(P(f).map(h=>h.name)),k=t.rootDecls??{};let c=t.fragments;if(t.vml){const h=/<legacyDrawing\b[^>]*\br:id="([^"]+)"/.exec(f)?.[1],p=await o.text(t.rels[t.vml].target),u=l.parts[t.rels[t.vml].target]?.rels??[];let x=!1;if(t.merge&&h){const d=r.map(A=>A.includes(`Id="${h}"`)?/Target="([^"]+)"/.exec(A)?.[1]:null).find(Boolean),T=d?N(s,d):null,E=T?a.find(A=>A.path===T):null;x=E?J(E,p,t,u,a,i):!1,x&&(c=c.filter(A=>A.name!=="legacyDrawing"))}else if(!t.merge&&!h){const d={path:t.vmlName,xml:pe(p)};if(x=J(d,p,t,u,a,i),x){a.push(d);const T=`rIdKept${++m}`;r.push(B([{id:T,type:ne,target:t.vmlName}],s,i)),c=c.map(E=>E.name==="legacyDrawing"?{name:E.name,xml:`<legacyDrawing r:id="${T}"/>`}:E)}}x||(c=c.filter(d=>!["legacyDrawing","oleObjects","controls"].includes(d.name)))}for(const h of c){if(h.name==="controls"){const p=h.units.map(x=>M(b(x),t.decls,k)),u=P(f).find(x=>x.name==="controls");if(u){const x=f.slice(u.start,u.end),d=x.search(/<\/(?:[\w.-]+:)?controls\s*>/);f=f.slice(0,u.start)+x.slice(0,d)+p.join("")+x.slice(d)+f.slice(u.end)}else f=L(f,"controls",M(`${b(h.pre)}${p.join("")}${h.post}`,t.decls,k));continue}n.written?.includes(h.name)||y.has(h.name)||(f=L(f,h.name,M(b(h.xml),t.decls,k)))}if(t.exts.length){const h=P(f).find(d=>d.name==="extLst"),p=h?f.slice(h.start,h.end):"",u=new Set(H(p).map(d=>d.uri.toUpperCase())),x=t.exts.filter(d=>!u.has(d.uri.toUpperCase())).map(d=>M(b(d.xml),t.decls,k)).join("");if(x&&h){const d=p.search(/<\/(?:[\w.-]+:)?extLst\s*>\s*$/);f=f.slice(0,h.start)+p.slice(0,d)+x+p.slice(d)+f.slice(h.end)}else x&&(f=L(f,"extLst",`<extLst>${x}</extLst>`))}return f}function pe(e){const n=/<xml\b[^>]*>/.exec(e)?.[0]??'<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">',t=/<o:shapelayout\b[\s\S]*?<\/o:shapelayout>/.exec(e)?.[0]??"";return`${n}${t}</xml>`}function fe(e,n){return e.replace(/(<o:idmap\b[^>]*?\sdata=")([^"]*)(")/,(t,s,r,a)=>{const o=new Set(r.split(",").map(i=>i.trim()).filter(Boolean));for(const i of n)o.add(String(Math.floor(i/1024)));return`${s}${[...o].join(",")}${a}`})}function J(e,n,t,s,r,a){let o=typeof e.xml=="string"?e.xml:new TextDecoder().decode(e.xml);const i=new Set(t.shapeIds),l=Q(n).filter(c=>i.has(Number(/\bid="_x0000_s(\d+)"/.exec(c)?.[1])));if(l.length===0)return!1;let f=Math.max(1024,...[...o.matchAll(/_x0000_s(\d+)/g)].map(c=>Number(c[1])),...t.shapeIds);for(const c of Q(o)){const h=Number(/\bid="_x0000_s(\d+)"/.exec(c)?.[1]);i.has(h)&&/ObjectType="Note"/.test(c)&&(o=o.replace(c,()=>c.replace(`id="_x0000_s${h}"`,()=>`id="_x0000_s${++f}"`)))}if([...o.matchAll(/\bid="_x0000_s(\d+)"/g)].some(c=>i.has(Number(c[1]))))return!1;o=fe(o,t.shapeIds);const m=new Map,w=[],g=R(e.path),$=r.find(c=>c.path===g);let b=0;const y=l.map(c=>c.replace(/(\so:relid=")([^"]*)(")/g,(h,p,u,x)=>{const d=s.find(T=>T.id===u);return d?(m.has(u)||(m.set(u,`rIdKeptV${++b}`),w.push({...d,id:m.get(u)})),`${p}${m.get(u)}${x}`):h})),k=[...new Set(y.map(c=>/\btype="#([^"]+)"/.exec(c)?.[1]).filter(Boolean))].filter(c=>!o.includes(`id="${c}"`)).map(c=>new RegExp(`<v:shapetype\\b[^>]*\\bid="${c}"(?:(?!</v:shapetype>)[\\s\\S])*?</v:shapetype>`).exec(n)?.[0]??"").join("");if(e.xml=o.replace(/<\/xml>\s*$/,()=>`${k}${y.join("")}</xml>`),w.length){const c=B(w,e.path,a);$?$.xml=String($.xml).replace("</Relationships>",()=>`${c}</Relationships>`):r.push({path:g,xml:`${j}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${c}</Relationships>`})}return!0}function $e(e,n){let t=e.replace(/<table\b[^>]*?(\/?)>/,s=>/\stableType=/.test(s)?s:s.replace(/(\/?)>$/,' tableType="queryTable"$1>'));return t=t.replace(/<tableColumn\b[^>]*?(\/?)>/g,s=>{const r=n.byName.get(I(s,"name")?.toLowerCase());if(!r)return s;let a=s.replace(/\s(?:uniqueName|queryTableFieldId)="[^"]*"/g,"").replace(/\sid="[^"]*"/,()=>` id="${C(r.id)}"`);const o=`${r.uniqueName!==void 0?` uniqueName="${C(r.uniqueName)}"`:""}${r.queryTableFieldId!==void 0?` queryTableFieldId="${C(r.queryTableFieldId)}"`:""}`;return a=a.replace(/(\/?)>$/,i=>o+i),a}),t}const ye=(e,n,t)=>({path:R(e),xml:`${j}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${B(n.rels,e,t)}</Relationships>`});async function Ie(e,n,t,s){for(const[r,a]of n.names){const o=t.entries.get(r);if(!o||s.has(a))continue;await e.copyRaw(t,o,a),s.add(a);const i=n.kept.parts[r].rels;if(i.length){const l=R(a);s.has(l)||(await e.addBytes(l,`${j}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${B(i,a,n.names)}</Relationships>`),s.add(l))}}}export{be as applyKeptSheet,we as clearKeptShapeIds,xe as declareKeptNamespaces,ye as keptTableRels,$e as keptTableXml,ge as planKeptParts,he as readKeptSheets,Ie as writeKeptParts};