efficient-shell 13.25.0 → 14.1.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 (273) hide show
  1. package/README.md +31 -4
  2. package/dist/{Browser-W2WVSAEN.js → Browser-L2NP7DLM.js} +14 -14
  3. package/dist/Calculator-7CY2CRGB.js +29 -0
  4. package/dist/{CurrencyConverter-VH4UVYLO.js → CurrencyConverter-FXWM3DBQ.js} +9 -9
  5. package/dist/{Files-6QZFFGSH.js → Files-5S6UFGST.js} +82 -82
  6. package/dist/{Notepad-YU4HIJD2.js → Notepad-HC46LWV5.js} +8 -8
  7. package/dist/PomodoroTimer-RPGWT26T.js +91 -0
  8. package/dist/{Preview-H7N2MMAI.js → Preview-L6FJXBAE.js} +37 -37
  9. package/dist/Sidebar-2TYZENQL.js +44 -0
  10. package/dist/{Stock-YL732PKW.js → Stock-TUPZORQN.js} +4 -4
  11. package/dist/{Weather-3CBRXNNM.js → Weather-URCO6JML.js} +23 -23
  12. package/dist/{WorldClock-LONNWCRG.js → WorldClock-EBBUWG5L.js} +6 -6
  13. package/dist/ai/index.js +92 -92
  14. package/dist/apps/index.js +1 -1
  15. package/dist/bin/browser-check.js +1 -1
  16. package/dist/bin/media-host-check.js +1 -1
  17. package/dist/bin/ui-check.js +1 -1
  18. package/dist/charts/ChordChart.js +1 -1
  19. package/dist/charts/FlowChart.js +1 -1
  20. package/dist/charts/RadarChart.js +1 -1
  21. package/dist/charts/SankeyChart.js +1 -1
  22. package/dist/charts/SpecChart.js +1 -1
  23. package/dist/charts/SunburstChart.js +1 -1
  24. package/dist/charts/TreemapChart.js +1 -1
  25. package/dist/{chunk-XVMCSUAV.js → chunk-22SVN2ZM.js} +1 -1
  26. package/dist/{chunk-ZDFMYAQB.js → chunk-24BF22NF.js} +1 -1
  27. package/dist/{chunk-JIJZBM25.js → chunk-2RLWGWOU.js} +13 -13
  28. package/dist/{chunk-VP2IQJUD.js → chunk-2SOGTOUQ.js} +4 -4
  29. package/dist/{chunk-4VFEPP2W.js → chunk-2XDO7FZC.js} +13 -13
  30. package/dist/{chunk-SLEA47VA.js → chunk-3L7BEEBW.js} +1 -1
  31. package/dist/{chunk-GZRNOIEE.js → chunk-3ZJAQSFS.js} +3 -3
  32. package/dist/{chunk-BQQEQCSK.js → chunk-47BGAQWD.js} +1 -1
  33. package/dist/{chunk-7AVPMO4F.js → chunk-4BRVZAIW.js} +1 -1
  34. package/dist/chunk-4DNPUG3T.js +7 -0
  35. package/dist/chunk-5F3HPOBH.js +1 -0
  36. package/dist/{chunk-VKZC3NPM.js → chunk-5O4HMXPQ.js} +2 -2
  37. package/dist/{chunk-JLSXDYS4.js → chunk-5SQHRDFC.js} +2 -2
  38. package/dist/{chunk-LQIHBIXG.js → chunk-6AYAB5FN.js} +5 -5
  39. package/dist/{chunk-VGUB7LPF.js → chunk-6IP4Q3AT.js} +52 -52
  40. package/dist/{chunk-527WMFTR.js → chunk-6RU2PGQK.js} +1 -1
  41. package/dist/{chunk-UVPDEGIA.js → chunk-6X32SWQI.js} +1 -1
  42. package/dist/{chunk-A5FC4LR7.js → chunk-7D2QZ6JA.js} +1 -1
  43. package/dist/{chunk-2YHS5E27.js → chunk-7OVMWXFM.js} +1 -1
  44. package/dist/{chunk-LC2UF3AA.js → chunk-7WF6LFOJ.js} +1 -1
  45. package/dist/{chunk-IJG4UEKF.js → chunk-A3VLZZHJ.js} +8 -8
  46. package/dist/{chunk-LG6NDTHZ.js → chunk-AH5MLH54.js} +1 -1
  47. package/dist/chunk-AJPQJ7TC.js +6 -0
  48. package/dist/{chunk-TNALBYLY.js → chunk-ALZHFQRX.js} +1 -1
  49. package/dist/{chunk-S5MTTJ3F.js → chunk-AZZ4NO2D.js} +12 -12
  50. package/dist/{chunk-P4VOUPRF.js → chunk-CHDGSJLV.js} +6 -6
  51. package/dist/{chunk-VY6OQRZA.js → chunk-CJ4OEY3T.js} +1 -1
  52. package/dist/{chunk-Q36KB5RQ.js → chunk-CXEELIRW.js} +11 -11
  53. package/dist/{chunk-MZ3JADHG.js → chunk-DBBOD5QW.js} +1 -1
  54. package/dist/chunk-DBQNYJZ6.js +1 -0
  55. package/dist/{chunk-65BW43PF.js → chunk-DNPAYNNU.js} +1 -1
  56. package/dist/{chunk-TTRLYWP4.js → chunk-DO6P6LYU.js} +1 -1
  57. package/dist/chunk-DOJSWVBX.js +6 -0
  58. package/dist/chunk-DTFX624I.js +8 -0
  59. package/dist/chunk-E57C7NBA.js +2 -0
  60. package/dist/{chunk-D5PXRJHA.js → chunk-EBODRYXS.js} +14 -14
  61. package/dist/{chunk-YDJ5IZOU.js → chunk-EDRELF6L.js} +1 -1
  62. package/dist/{chunk-M3HTP2N6.js → chunk-EHNW3UNC.js} +6 -6
  63. package/dist/{chunk-AH2NEKEN.js → chunk-EHSK43WG.js} +8 -8
  64. package/dist/{chunk-VMAIZU5S.js → chunk-EN3GYSCE.js} +1 -1
  65. package/dist/{chunk-TTYTOLVV.js → chunk-EOYKUV2U.js} +1 -1
  66. package/dist/chunk-FFPIT2LB.js +3 -0
  67. package/dist/{chunk-TD3ZQD5R.js → chunk-G3TC2GIA.js} +1 -1
  68. package/dist/{chunk-AAJSE5HA.js → chunk-GTBOJ5Q5.js} +1 -1
  69. package/dist/{chunk-UQV4TSWB.js → chunk-GTZML3V3.js} +1 -1
  70. package/dist/{chunk-JYR4V4AG.js → chunk-GUUBFQ6L.js} +2 -2
  71. package/dist/{chunk-K42FXX7J.js → chunk-GVAVIYE6.js} +1 -1
  72. package/dist/{chunk-2Y4AH7NC.js → chunk-GY7MJTIZ.js} +1 -1
  73. package/dist/{chunk-XYXCZIJY.js → chunk-HAEZUUDT.js} +3 -3
  74. package/dist/{chunk-J5W63XNR.js → chunk-HTBACICQ.js} +6 -6
  75. package/dist/{chunk-5URXJCNC.js → chunk-HX5QSQ2C.js} +1 -1
  76. package/dist/{chunk-VLBLDSA6.js → chunk-I7WAOKU2.js} +2 -2
  77. package/dist/{chunk-LLDGRPLF.js → chunk-ION3XGLN.js} +1 -1
  78. package/dist/{chunk-EXDSYFHB.js → chunk-ISWTJBOA.js} +1 -1
  79. package/dist/{chunk-BUFAJJDZ.js → chunk-IVEM2BPC.js} +1 -1
  80. package/dist/{chunk-D4432YRW.js → chunk-IZ6D4KGR.js} +1 -1
  81. package/dist/{chunk-KC2EQCBE.js → chunk-JPVD3VS7.js} +6 -6
  82. package/dist/{chunk-C7Z3ZMJH.js → chunk-KE7P74XM.js} +13 -13
  83. package/dist/chunk-KEFNQEXZ.js +1 -0
  84. package/dist/{chunk-DUEEAP4Y.js → chunk-LPL7BWGG.js} +1 -1
  85. package/dist/{chunk-JVENCUUG.js → chunk-LRMDLZMM.js} +4 -4
  86. package/dist/chunk-M5IZ7QLQ.js +7 -0
  87. package/dist/{chunk-MCLVTQSF.js → chunk-MEDOESQD.js} +8 -8
  88. package/dist/chunk-MEP6CZJ3.js +2 -0
  89. package/dist/{chunk-ZYKY4Z7R.js → chunk-MKHOXO5O.js} +1 -1
  90. package/dist/chunk-MNZAAQLH.js +15 -0
  91. package/dist/{chunk-DTRJLQWO.js → chunk-MPC3CHAO.js} +1 -1
  92. package/dist/{chunk-7PAZO65L.js → chunk-MXRF5YVN.js} +5 -5
  93. package/dist/{chunk-NWS5G7FE.js → chunk-MYH5H43C.js} +1 -1
  94. package/dist/{chunk-5OHFBS2B.js → chunk-NC5FIFAY.js} +1 -1
  95. package/dist/chunk-NDCS4COQ.js +11 -0
  96. package/dist/{chunk-IJ4JX6WP.js → chunk-NHALP3MW.js} +4 -4
  97. package/dist/{chunk-R5WBDXI2.js → chunk-OYQWBJ37.js} +1 -1
  98. package/dist/{chunk-77N3REYY.js → chunk-P2HZ2V3U.js} +2 -2
  99. package/dist/{chunk-UU42O5ON.js → chunk-P3XXFQG5.js} +1 -1
  100. package/dist/{chunk-YBE66FBR.js → chunk-P5J7G7OV.js} +1 -1
  101. package/dist/{chunk-4L5YRMJ4.js → chunk-PEA5Y6DD.js} +9 -9
  102. package/dist/{chunk-DPFEQQQU.js → chunk-POBVGDZP.js} +1 -1
  103. package/dist/{chunk-RFWBNKKB.js → chunk-PPHGBEJA.js} +10 -10
  104. package/dist/{chunk-IMH5H47S.js → chunk-PTLVNC3V.js} +6 -6
  105. package/dist/chunk-PU2GJVMG.js +1 -0
  106. package/dist/{chunk-TJG76Y7I.js → chunk-PWERFHOU.js} +9 -9
  107. package/dist/{chunk-ZFWCTHR4.js → chunk-PWON7O3N.js} +6 -6
  108. package/dist/{chunk-6MFKKTCE.js → chunk-Q7FPGOUY.js} +24 -24
  109. package/dist/{chunk-M4REKOGO.js → chunk-QCLKRFL4.js} +5 -5
  110. package/dist/{chunk-N4LMFGRI.js → chunk-R36VZ35L.js} +6 -6
  111. package/dist/{chunk-CCZHSISF.js → chunk-REFPTKRD.js} +2 -2
  112. package/dist/{chunk-THAPVKEJ.js → chunk-RTK77DMP.js} +11 -11
  113. package/dist/{chunk-PWOVSR7N.js → chunk-RXCBSQA2.js} +2 -2
  114. package/dist/{chunk-JDLJ7DHV.js → chunk-S4RFJTGR.js} +1 -1
  115. package/dist/{chunk-D5HFWOW7.js → chunk-SP4S4HUJ.js} +16 -16
  116. package/dist/{chunk-P73ZJ6QR.js → chunk-T46I4YOI.js} +1 -1
  117. package/dist/{chunk-VY3UA6AR.js → chunk-TAHHZGRH.js} +1 -1
  118. package/dist/{chunk-FBZUEZK7.js → chunk-TTD2M6RF.js} +1 -1
  119. package/dist/{chunk-RB3BMRNA.js → chunk-U75MSD4F.js} +1 -1
  120. package/dist/{chunk-XC2GUCTG.js → chunk-UGA5NGW4.js} +1 -1
  121. package/dist/chunk-VUBDHFG5.js +4 -0
  122. package/dist/{chunk-K4KUGKWP.js → chunk-W4IH3BE3.js} +21 -21
  123. package/dist/{chunk-B5KX7PDG.js → chunk-W6REY3SV.js} +3 -3
  124. package/dist/{chunk-WZWSFYXJ.js → chunk-WBUAO7T7.js} +1 -1
  125. package/dist/{chunk-P6H2B635.js → chunk-WNFZYTWW.js} +9 -9
  126. package/dist/{chunk-HPKQYUQT.js → chunk-WYAKASF3.js} +1 -1
  127. package/dist/{chunk-C5OPAULN.js → chunk-XGEN76DG.js} +1 -1
  128. package/dist/{chunk-ZKILZFUI.js → chunk-XIX72C7K.js} +1 -1
  129. package/dist/{chunk-3AUN7JSM.js → chunk-XJK6VNXV.js} +1 -1
  130. package/dist/{chunk-26KHYLJN.js → chunk-XLPUIGMO.js} +1 -1
  131. package/dist/{chunk-VQBKRBBR.js → chunk-XNKNX5L3.js} +1 -1
  132. package/dist/chunk-Y2M5PP2C.js +28 -0
  133. package/dist/{chunk-66NJCU4W.js → chunk-Y5RTVKMB.js} +8 -8
  134. package/dist/{chunk-JXJNQHPY.js → chunk-Y5YVKUM4.js} +19 -19
  135. package/dist/{chunk-5CHJA4RL.js → chunk-Y6FULJWJ.js} +7 -7
  136. package/dist/chunk-Y7D2CZ4H.js +13 -0
  137. package/dist/chunk-YTLUSBDY.js +14 -0
  138. package/dist/{chunk-2YUAR2EH.js → chunk-YX3JD6PA.js} +5 -5
  139. package/dist/{chunk-3WUVYXCF.js → chunk-ZA6ANC2D.js} +5 -5
  140. package/dist/{chunk-5ZOYYL46.js → chunk-ZEGCKIAL.js} +3 -3
  141. package/dist/chunk-ZSVU44OB.js +6 -0
  142. package/dist/data/DataTable.js +1 -1
  143. package/dist/data/EntityList.js +1 -1
  144. package/dist/data/Gantt.js +1 -1
  145. package/dist/data/Kanban.js +1 -1
  146. package/dist/data/ListLoadError.js +1 -1
  147. package/dist/data/ResizableTable.js +1 -1
  148. package/dist/data/statusColumn.js +1 -1
  149. package/dist/data/useColumnConfig.js +1 -1
  150. package/dist/data/useSort.js +1 -1
  151. package/dist/format/index.js +1 -1
  152. package/dist/forms/AlignmentGrid.js +1 -1
  153. package/dist/forms/BorderInput.js +1 -1
  154. package/dist/forms/BrandAssetEditor.js +1 -1
  155. package/dist/forms/Button.js +1 -1
  156. package/dist/forms/Calendar.js +1 -1
  157. package/dist/forms/ColorPicker.js +1 -1
  158. package/dist/forms/ComposerAttachments.js +1 -1
  159. package/dist/forms/CornersInput.js +1 -1
  160. package/dist/forms/DatePicker.js +1 -1
  161. package/dist/forms/DateRangePicker.js +1 -1
  162. package/dist/forms/DisplayChips.js +1 -1
  163. package/dist/forms/FilePicker.js +1 -1
  164. package/dist/forms/IconButton.js +1 -1
  165. package/dist/forms/IconPicker.js +1 -1
  166. package/dist/forms/Input.js +1 -1
  167. package/dist/forms/InputNumber.js +1 -1
  168. package/dist/forms/LinkPicker.js +1 -1
  169. package/dist/forms/MediaLibrary.js +1 -1
  170. package/dist/forms/MediaUploadField.js +1 -1
  171. package/dist/forms/MediaUploadGrid.js +1 -1
  172. package/dist/forms/MediaUsedInList.js +1 -1
  173. package/dist/forms/NumericKeypad.js +1 -1
  174. package/dist/forms/PictureTiles.js +1 -1
  175. package/dist/forms/PositionInput.js +1 -1
  176. package/dist/forms/RenameField.js +1 -1
  177. package/dist/forms/Segmented.js +1 -1
  178. package/dist/forms/Select.js +1 -1
  179. package/dist/forms/SidesInput.js +1 -1
  180. package/dist/forms/Slider.js +1 -1
  181. package/dist/forms/Snippet.js +1 -1
  182. package/dist/forms/SplitButton.js +1 -1
  183. package/dist/forms/TagInput.js +1 -1
  184. package/dist/forms/TextToolbar.js +1 -1
  185. package/dist/forms/UnitMenu.js +1 -1
  186. package/dist/forms/WidthsBar.js +1 -1
  187. package/dist/forms/dropdownPosition.js +1 -1
  188. package/dist/hooks/index.d.ts +15 -14
  189. package/dist/hooks/index.js +1 -1
  190. package/dist/hooks/useTheme.d.ts +1 -1
  191. package/dist/hooks/useTheme.js +1 -1
  192. package/dist/icons/index.js +1 -1
  193. package/dist/index.d.ts +43 -2
  194. package/dist/index.js +125 -125
  195. package/dist/map/index.js +5 -5
  196. package/dist/markdown/index.js +1 -1
  197. package/dist/page-tabs/index.js +5 -5
  198. package/dist/routine-index.json +1 -0
  199. package/dist/shell/AppUpdateBanner.js +1 -1
  200. package/dist/shell/ColoredBadge.js +1 -1
  201. package/dist/shell/ConfirmDialog.js +1 -1
  202. package/dist/shell/ContextMenu.js +1 -1
  203. package/dist/shell/Dialog.js +1 -1
  204. package/dist/shell/Drawer.js +1 -1
  205. package/dist/shell/DropdownMenu.js +1 -1
  206. package/dist/shell/EditableGrid.js +1 -1
  207. package/dist/shell/FloatingBar.js +1 -1
  208. package/dist/shell/GlobalSearch.js +1 -1
  209. package/dist/shell/HelpCenter.js +1 -1
  210. package/dist/shell/IconRail.js +1 -1
  211. package/dist/shell/ImageLightbox.js +1 -1
  212. package/dist/shell/ItemCount.js +1 -1
  213. package/dist/shell/Kbd.js +1 -1
  214. package/dist/shell/LanguageSelect.js +1 -1
  215. package/dist/shell/Markdown.js +1 -1
  216. package/dist/shell/MilestoneTimeline.js +1 -1
  217. package/dist/shell/Popover.js +1 -1
  218. package/dist/shell/PopupMenu.js +1 -1
  219. package/dist/shell/ProductionTimeline.js +1 -1
  220. package/dist/shell/ResizeHandle.js +1 -1
  221. package/dist/shell/SearchableSelect.js +1 -1
  222. package/dist/shell/SettingReset.js +1 -1
  223. package/dist/shell/SettingRow.js +1 -1
  224. package/dist/shell/ShellPrefs.js +1 -1
  225. package/dist/shell/SidebarLayout.js +1 -1
  226. package/dist/shell/SidebarNav.js +1 -1
  227. package/dist/shell/SortableList.js +1 -1
  228. package/dist/shell/StatusBadge.js +1 -1
  229. package/dist/shell/Tabs.js +1 -1
  230. package/dist/shell/TimelineTrack.js +1 -1
  231. package/dist/shell/Tooltip.js +1 -1
  232. package/dist/shell/TopNav.js +1 -1
  233. package/dist/shell/TransferProgress.js +1 -1
  234. package/dist/shell/Tree.js +1 -1
  235. package/dist/shell/discardGuard.js +1 -1
  236. package/dist/telemetry/index.js +1 -1
  237. package/dist/templates/AuthScreen.js +1 -1
  238. package/dist/templates/ChatTemplate.js +1 -1
  239. package/dist/templates/CheckoutTemplate.js +1 -1
  240. package/dist/templates/DashboardTemplate.js +1 -1
  241. package/dist/templates/DataTablePage.js +1 -1
  242. package/dist/templates/EmailTemplate.js +1 -1
  243. package/dist/templates/ErrorBoundary.js +1 -1
  244. package/dist/templates/FormLayoutPage.js +1 -1
  245. package/dist/templates/GalleryTemplate.js +1 -1
  246. package/dist/tokens/colour.d.ts +2 -2
  247. package/dist/ui/index.js +1 -1
  248. package/dist/value-index.json +1 -0
  249. package/dist/version.js +1 -1
  250. package/package.json +4 -3
  251. package/dist/Calculator-PKAM5ERT.js +0 -29
  252. package/dist/PomodoroTimer-PBSAKRX5.js +0 -91
  253. package/dist/Sidebar-HAIHWIJD.js +0 -44
  254. package/dist/chunk-2AEYVQ2R.js +0 -2
  255. package/dist/chunk-3GJVTK4H.js +0 -11
  256. package/dist/chunk-3TD3GH53.js +0 -7
  257. package/dist/chunk-44ERJYNW.js +0 -6
  258. package/dist/chunk-AAFPAQXH.js +0 -13
  259. package/dist/chunk-EX3DARI3.js +0 -7
  260. package/dist/chunk-F2RAIGCG.js +0 -6
  261. package/dist/chunk-FLQXMCB3.js +0 -8
  262. package/dist/chunk-N6PMH6DU.js +0 -6
  263. package/dist/chunk-O5ZBRG2G.js +0 -1
  264. package/dist/chunk-PP3WUT2G.js +0 -15
  265. package/dist/chunk-PWX64YBI.js +0 -28
  266. package/dist/chunk-RJVIKGHJ.js +0 -4
  267. package/dist/chunk-SRI2D23Y.js +0 -14
  268. package/dist/chunk-UTISUEO4.js +0 -2
  269. package/dist/chunk-UVHXVSB2.js +0 -1
  270. package/dist/chunk-WCCS4VFE.js +0 -1
  271. package/dist/chunk-ZDXRSY2Y.js +0 -1
  272. package/dist/chunk-ZISKHQZY.js +0 -3
  273. /package/dist/{chunk-4BYJABCX.js → chunk-5YTZBYG4.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{FILES_ROUTE,chooseInFiles,openFilesInTrashMode,setFilesDemoTree,withdrawFilesChoice}from"../chunk-CUNYWXUT.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-77N3REYY.js";import{setSpreadsheetPreview as e}from"../chunk-KGRJSTPM.js";export{FILES_OFFICE_EXTENSIONS,FILES_ROLE_LABELS,FilesQuotaError,SPREADSHEET_PREVIEW_UPDATE_EVENT,claimSpreadsheetPreviewStage,createFileServerStore,filesRoleWrites,peekSpreadsheetPreviewStage,setFilesStore,setSpreadsheetPreview}from"../chunk-KGRJSTPM.js";import{setPdfPreview as t}from"../chunk-I4RJAMLJ.js";export{setPdfPreview}from"../chunk-I4RJAMLJ.js";import"../chunk-VGUB7LPF.js";import"../chunk-4LXCCZDM.js";import"../chunk-KNUR2UEG.js";import"../chunk-JDCM2VHG.js";import"../chunk-YI4T5I5D.js";import"../chunk-PSVGB7KT.js";import"../chunk-FBZUEZK7.js";import"../chunk-5A7MWTXX.js";import"../chunk-TJ5YMXVB.js";import"../chunk-4VFEPP2W.js";import"../chunk-44ERJYNW.js";import"../chunk-EIFNESXS.js";import"../chunk-LC2UF3AA.js";import"../chunk-VY6OQRZA.js";import"../chunk-LG6NDTHZ.js";import"../chunk-4BYJABCX.js";import"../chunk-VWGWZY7A.js";import"../chunk-UVHXVSB2.js";import"../chunk-UVPDEGIA.js";import"../chunk-4PJFL26P.js";import"../chunk-F3ZOO23R.js";import"../chunk-2QY5BJLA.js";import"../chunk-UGTRSRIW.js";import"../chunk-DPFEQQQU.js";import"../chunk-AW7TOB6N.js";import"../chunk-O5ZBRG2G.js";import"../chunk-EX3DARI3.js";import"../chunk-VQBKRBBR.js";import"../chunk-DWGYC7OD.js";import"../chunk-NWS5G7FE.js";import"../chunk-THAPVKEJ.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-YDJ5IZOU.js";import"../chunk-UTISUEO4.js";import"../chunk-BUFAJJDZ.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-TD3ZQD5R.js";import"../chunk-F2RAIGCG.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-VY3UA6AR.js";import"../chunk-WCCS4VFE.js";import"../chunk-ZDXRSY2Y.js";import"../chunk-STKJA4PV.js";import"../chunk-M6UKCZHT.js";import{toast_default as o}from"../chunk-I2NVBDKH.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import{currentShellStrings as n}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{lazy as i}from"react";function r(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var s=/* @__PURE__ */new Set(["csv","tsv"]),c=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),m=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),a=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function l(e){const t=r(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":s.has(t)?"csv":m.has(t)?"image":a.has(t)?"3d":null}function u(e){window.open(e,"_blank","noopener,noreferrer")}async function p(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const n=await fetch(e);if(!n.ok)throw new Error(`fetch failed: ${n.status}`);return n.text()}function h(e,t){return(e instanceof Error?e.message:"")||t}async function k(i,s,m={}){const a=n().attachment,k=i?.url||"",j=i?.filename||a.fallbackName;if(!k&&!m.fetchBlob)return void o.error(a.noLink);const f=l(j)??l(k);if("csv"===f){try{e({csv:await p(k,m,i),filename:j}),s("/spreadsheet")}catch{o.error(a.spreadsheetFailed),k&&u(k)}return}if(c.has(r(j)||r(k)))return o.error(a.workbookUnavailable),void(k&&u(k));if(!f)return k?(o.info(a.noViewer),void u(k)):void o.error(a.noLink);if(!m.fetchBlob)return t({url:k,filename:j,kind:f}),void s("/preview");const d=t({filename:j,kind:f,converting:!0,convertingMessage:m.loadingMessage||a.loading});s("/preview");try{const e=await m.fetchBlob(i);d.update({url:URL.createObjectURL(e),filename:j,kind:f})}catch(e){d.update({filename:j,kind:f,converting:!1,convertingMessage:h(e,a.loadFailed)})}}function j(e,t,o={}){const i=n().attachment,s=[];let m=-1;return e.forEach((e,n)=>{const a=e?.url||"";if(!a&&!o.fetchBlob)return;const u=e?.filename||i.fallbackName;if(c.has(r(u)||r(a)))return;const p=l(u)??l(a);p&&"csv"!==p&&(n===t&&(m=s.length),s.push({att:e,sourceIndex:n,filename:u,url:a,kind:p}))}),{items:s,start:m}}async function f(e,o,i,r={}){const{items:s,start:c}=j(e,o,r);if(c<0||s.length<2){const t=e[o];return void(t&&await k(t,i,r))}const m=n().attachment,a=s.length;let l=null,u=-1;const p=e=>({position:{index:e,count:a},onPrevious:e>0?()=>{d(e-1)}:void 0,onNext:e<a-1?()=>{d(e+1)}:void 0}),f=e=>{l?l.update(e):(l=t(e),i("/preview"))};async function d(e){u=e;const{att:t,filename:o,url:n,kind:i}=s[e];if(r.fetchBlob){f({filename:o,kind:i,converting:!0,convertingMessage:r.loadingMessage||m.loading,...p(e)});try{const n=await r.fetchBlob(t),s=URL.createObjectURL(n);if(u!==e)return void URL.revokeObjectURL(s);f({url:s,filename:o,kind:i,...p(e)})}catch(t){if(u!==e)return;f({filename:o,kind:i,converting:!1,convertingMessage:h(t,m.loadFailed),...p(e)})}}else f({url:n,filename:o,kind:i,...p(e)})}await d(c)}var d=i(()=>import("../Calculator-PKAM5ERT.js")),w=i(()=>import("../Weather-3CBRXNNM.js")),g=i(()=>import("../CurrencyConverter-VH4UVYLO.js")),v=i(()=>import("../PomodoroTimer-PBSAKRX5.js")),S=i(()=>import("../Notepad-YU4HIJD2.js")),R=i(()=>import("../WorldClock-LONNWCRG.js")),E=i(()=>import("../Stock-YL732PKW.js")),F=i(()=>import("../Preview-H7N2MMAI.js")),P=i(()=>import("../PdfViewer-FWGHFO4N.js")),U=i(()=>import("../Files-6QZFFGSH.js")),B=i(()=>import("../Browser-W2WVSAEN.js")),N={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/notepad":{component:S,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:w,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:g,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:v,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:R,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:E,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},T={"/preview":{component:F,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/files":{component:U,label:"Files",size:"xl",appStyle:!0}},b={"/browser":{component:B,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},L={...N,...T,...b};export{B as Browser,d as Calculator,g as CurrencyConverter,U as Files,S as Notepad,P as PdfViewer,v as PomodoroTimer,F as Preview,E as Stock,w as Weather,R as WorldClock,l as attachmentKind,L as bundledApps,T as documentApps,k as openAttachment,f as openAttachments,N as utilityApps,j as viewableAttachments,b as webApps};
2
+ export{FILES_ROUTE,chooseInFiles,openFilesInTrashMode,setFilesDemoTree,withdrawFilesChoice}from"../chunk-CUNYWXUT.js";export{setBrowserStartUrl}from"../chunk-LWLCNQY7.js";export{BUILTIN_APP_INFO}from"../chunk-P2HZ2V3U.js";import{setSpreadsheetPreview as e}from"../chunk-KGRJSTPM.js";export{FILES_OFFICE_EXTENSIONS,FILES_ROLE_LABELS,FilesQuotaError,SPREADSHEET_PREVIEW_UPDATE_EVENT,claimSpreadsheetPreviewStage,createFileServerStore,filesRoleWrites,peekSpreadsheetPreviewStage,setFilesStore,setSpreadsheetPreview}from"../chunk-KGRJSTPM.js";import{setPdfPreview as t}from"../chunk-I4RJAMLJ.js";export{setPdfPreview}from"../chunk-I4RJAMLJ.js";import"../chunk-6IP4Q3AT.js";import"../chunk-4LXCCZDM.js";import"../chunk-KNUR2UEG.js";import"../chunk-JDCM2VHG.js";import"../chunk-YI4T5I5D.js";import"../chunk-PSVGB7KT.js";import"../chunk-TTD2M6RF.js";import"../chunk-5A7MWTXX.js";import"../chunk-TJ5YMXVB.js";import"../chunk-2XDO7FZC.js";import"../chunk-ZSVU44OB.js";import"../chunk-EIFNESXS.js";import"../chunk-7WF6LFOJ.js";import"../chunk-CJ4OEY3T.js";import"../chunk-AH5MLH54.js";import"../chunk-5YTZBYG4.js";import"../chunk-VWGWZY7A.js";import"../chunk-DBQNYJZ6.js";import"../chunk-6X32SWQI.js";import"../chunk-4PJFL26P.js";import"../chunk-F3ZOO23R.js";import"../chunk-2QY5BJLA.js";import"../chunk-UGTRSRIW.js";import"../chunk-POBVGDZP.js";import"../chunk-AW7TOB6N.js";import"../chunk-5F3HPOBH.js";import"../chunk-M5IZ7QLQ.js";import"../chunk-XNKNX5L3.js";import"../chunk-DWGYC7OD.js";import"../chunk-MYH5H43C.js";import"../chunk-RTK77DMP.js";import"../chunk-URHGHXDN.js";import"../chunk-5QFPTDQF.js";import"../chunk-EDRELF6L.js";import"../chunk-MEP6CZJ3.js";import"../chunk-IVEM2BPC.js";import"../chunk-ISVODSRP.js";import"../chunk-J75ZT2JQ.js";import"../chunk-R2VKEMZH.js";import"../chunk-BWJZTHZ6.js";import"../chunk-G3TC2GIA.js";import"../chunk-AJPQJ7TC.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-TAHHZGRH.js";import"../chunk-KEFNQEXZ.js";import"../chunk-PU2GJVMG.js";import"../chunk-STKJA4PV.js";import"../chunk-M6UKCZHT.js";import{toast_default as o}from"../chunk-I2NVBDKH.js";import"../chunk-UQYNPYF4.js";import"../chunk-MRJKZWWV.js";import"../chunk-TWVUQUUD.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import{currentShellStrings as n}from"../chunk-NRHG4R2Q.js";import"../chunk-C3QOHMR6.js";import{lazy as i}from"react";function r(e){const t=/\.([a-z0-9]+)(?:[?#].*)?$/i.exec((e||"").trim());return t?t[1].toLowerCase():""}var s=/* @__PURE__ */new Set(["csv","tsv"]),c=/* @__PURE__ */new Set(["xlsx","xls","xlsm","ods"]),m=/* @__PURE__ */new Set(["png","jpg","jpeg","gif","webp","bmp","svg","avif"]),a=/* @__PURE__ */new Set(["step","stp","stl","obj","gltf","glb","3mf","iges","igs"]);function l(e){const t=r(e);return"pdf"===t?"pdf":"dxf"===t?"dxf":s.has(t)?"csv":m.has(t)?"image":a.has(t)?"3d":null}function u(e){window.open(e,"_blank","noopener,noreferrer")}async function p(e,t,o){if(t.fetchBlob)return(await t.fetchBlob(o)).text();const n=await fetch(e);if(!n.ok)throw new Error(`fetch failed: ${n.status}`);return n.text()}function h(e,t){return(e instanceof Error?e.message:"")||t}async function k(i,s,m={}){const a=n().attachment,k=i?.url||"",j=i?.filename||a.fallbackName;if(!k&&!m.fetchBlob)return void o.error(a.noLink);const f=l(j)??l(k);if("csv"===f){try{e({csv:await p(k,m,i),filename:j}),s("/spreadsheet")}catch{o.error(a.spreadsheetFailed),k&&u(k)}return}if(c.has(r(j)||r(k)))return o.error(a.workbookUnavailable),void(k&&u(k));if(!f)return k?(o.info(a.noViewer),void u(k)):void o.error(a.noLink);if(!m.fetchBlob)return t({url:k,filename:j,kind:f}),void s("/preview");const d=t({filename:j,kind:f,converting:!0,convertingMessage:m.loadingMessage||a.loading});s("/preview");try{const e=await m.fetchBlob(i);d.update({url:URL.createObjectURL(e),filename:j,kind:f})}catch(e){d.update({filename:j,kind:f,converting:!1,convertingMessage:h(e,a.loadFailed)})}}function j(e,t,o={}){const i=n().attachment,s=[];let m=-1;return e.forEach((e,n)=>{const a=e?.url||"";if(!a&&!o.fetchBlob)return;const u=e?.filename||i.fallbackName;if(c.has(r(u)||r(a)))return;const p=l(u)??l(a);p&&"csv"!==p&&(n===t&&(m=s.length),s.push({att:e,sourceIndex:n,filename:u,url:a,kind:p}))}),{items:s,start:m}}async function f(e,o,i,r={}){const{items:s,start:c}=j(e,o,r);if(c<0||s.length<2){const t=e[o];return void(t&&await k(t,i,r))}const m=n().attachment,a=s.length;let l=null,u=-1;const p=e=>({position:{index:e,count:a},onPrevious:e>0?()=>{d(e-1)}:void 0,onNext:e<a-1?()=>{d(e+1)}:void 0}),f=e=>{l?l.update(e):(l=t(e),i("/preview"))};async function d(e){u=e;const{att:t,filename:o,url:n,kind:i}=s[e];if(r.fetchBlob){f({filename:o,kind:i,converting:!0,convertingMessage:r.loadingMessage||m.loading,...p(e)});try{const n=await r.fetchBlob(t),s=URL.createObjectURL(n);if(u!==e)return void URL.revokeObjectURL(s);f({url:s,filename:o,kind:i,...p(e)})}catch(t){if(u!==e)return;f({filename:o,kind:i,converting:!1,convertingMessage:h(t,m.loadFailed),...p(e)})}}else f({url:n,filename:o,kind:i,...p(e)})}await d(c)}var d=i(()=>import("../Calculator-7CY2CRGB.js")),w=i(()=>import("../Weather-URCO6JML.js")),g=i(()=>import("../CurrencyConverter-FXWM3DBQ.js")),v=i(()=>import("../PomodoroTimer-RPGWT26T.js")),P=i(()=>import("../Notepad-HC46LWV5.js")),T=i(()=>import("../WorldClock-EBBUWG5L.js")),S=i(()=>import("../Stock-TUPZORQN.js")),F=i(()=>import("../Preview-L6FJXBAE.js")),L=i(()=>import("../PdfViewer-FWGHFO4N.js")),E=i(()=>import("../Files-5S6UFGST.js")),R=i(()=>import("../Browser-L2NP7DLM.js")),B={"/calculator":{component:d,label:"Calculator",size:"sm",allowPinOnTop:!0,utility:!0,widget:!0,dimensions:[280,420]},"/notepad":{component:P,label:"Notepad",size:"lg",allowPinOnTop:!0,flushBody:!0},"/weather":{component:w,label:"Weather",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,400]},"/currency":{component:g,label:"Currency Converter",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/pomodoro":{component:v,label:"Pomodoro Timer",size:"sm",utility:!0,widget:!0,dimensions:[320,600]},"/world-clock":{component:T,label:"World Clock",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,480]},"/stock":{component:S,label:"Stocks",size:"sm",utility:!0,widget:!0,autoHeight:!0,dimensions:[320,360]}},M={"/preview":{component:F,label:"Preview",size:"2xl",appStyle:!0,multiInstance:!0},"/files":{component:E,label:"Files",size:"xl",appStyle:!0}},b={"/browser":{component:R,label:"Browser",size:"2xl",appStyle:!0,multiInstance:!0}},C={...B,...M,...b};export{R as Browser,d as Calculator,g as CurrencyConverter,E as Files,P as Notepad,L as PdfViewer,v as PomodoroTimer,F as Preview,S as Stock,w as Weather,T as WorldClock,l as attachmentKind,C as bundledApps,M as documentApps,k as openAttachment,f as openAttachments,B as utilityApps,j as viewableAttachments,b as webApps};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as e}from"module";import{extname as t,isAbsolute as r,join as s,resolve as n}from"path";import{readFileSync as i,existsSync as o,statSync as c,readdirSync as a,mkdtempSync as l,rmSync as d}from"fs";import{execFileSync as h}from"child_process";import{tmpdir as f}from"os";import u from"assert/strict";import{createServer as w}from"http";import{pathToFileURL as p}from"url";function m(t,r){for(const n of[s(process.cwd(),"package.json"),r])try{return e(n)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}var g=class extends Error{};var y="efficient-shell-browser-check",v=`${y}: run real-browser checks, one <name>.entry.tsx page and one <name>.check.mjs check per scenario.\n\n ${y} [--dir tests/browser] [--css <file>]... [--tailwind <entry.css>]... [--serve <urlPath>=<file>]... [--define KEY=JSON]...\n\n --dir <folder> the scenario folder (default tests/browser)\n --css <file> a stylesheet every page links, in the order given\n --tailwind <entry.css> a Tailwind entry, compiled with this repository's @tailwindcss/cli,\n linked like a --css sheet, in the order given\n --serve <urlPath>=<file> a file the page can fetch at urlPath (starts with /)\n --define KEY=JSON replace KEY in the bundle with the JSON value\n --version, --help\n\nesbuild and playwright come from this repository's devDependencies.\nBROWSER_SHARD=<i>/<n> runs one shard. Exits 1 when a check fails.`,b={".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".html":"text/html; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".pdf":"application/pdf",".wasm":"application/wasm",".woff2":"font/woff2",".glb":"model/gltf-binary"},$=class extends Error{};function x(e,t,n){const i=r(t)?t:s(e,t);if(!o(i)||!c(i).isFile())throw new $(`${n} ${t}: no such file`);return i}function E(e,t,r){return i(x(e,t,r))}async function j(e){const{dir:t,root:r=process.cwd(),esbuild:i,chromium:o,stylesheets:c=[],serve:l={},define:d={},shard:h,reactDir:f,out:m=e=>console.log(e),err:g=(...e)=>console.error(...e)}=e,y=a(t).filter(e=>e.endsWith(".entry.tsx")).map(e=>e.replace(/\.entry\.tsx$/,"")).sort();if(0===y.length)throw new Error(`no *.entry.tsx found in ${t}`);const v=function(e,t){if(!t)return e;const r=/^(\d+)\/(\d+)$/.exec(t);if(!r)throw new Error(`BROWSER_SHARD must look like 1/3, got ${JSON.stringify(t)}`);const[s,n]=[Number(r[1]),Number(r[2])];if(!(n>=1&&s>=1&&s<=n))throw new Error(`BROWSER_SHARD ${t} is out of range`);return e.filter((e,t)=>t%n===s-1)}(y,h);h&&m(`shard ${h}: ${v.length} of ${y.length} scenarios`);const b=c.map((e,t)=>`/styles-${t+1}.css`),$=new Map(Object.entries(l));c.forEach((e,t)=>$.set(b[t],{contentType:"text/css; charset=utf-8",body:e}));const x=await o.launch({headless:!0});let E=!1;try{for(const e of v){const{default:o,describe:c,viewport:a}=await(import(p(s(t,`${e}.check.mjs`)).href)),l=await i.build({entryPoints:[s(t,`${e}.entry.tsx`)],bundle:!0,write:!1,outdir:s(r,"node_modules",".cache","efficient-shell-browser"),entryNames:"bundle",format:"esm",platform:"browser",target:"chrome120",jsx:"automatic",define:d,logLevel:"warning",...f&&{alias:{react:s(n(f),"react"),"react-dom":s(n(f),"react-dom")}}}),h=l.outputFiles.find(e=>e.path.endsWith(".js")).text,y=l.outputFiles.find(e=>e.path.endsWith(".css"))?.text??null,v=w((e,t)=>{const r=e.url??"/";if("/bundle.js"===r)return t.writeHead(200,{"content-type":"text/javascript; charset=utf-8"}),void t.end(h);if("/bundle.css"===r&&null!==y)return t.writeHead(200,{"content-type":"text/css; charset=utf-8"}),void t.end(y);const s=$.get(r);if(s)return t.writeHead(200,{"content-type":s.contentType}),void t.end(s.body);t.writeHead(200,{"content-type":"text/html; charset=utf-8"}),t.end("<!doctype html><html><head>"+b.map(e=>`<link rel="stylesheet" href="${e}">`).join("")+(null!==y?'<link rel="stylesheet" href="/bundle.css">':"")+'</head><body><div id="root"></div><script type="module" src="/bundle.js"><\/script></body></html>')});await new Promise((e,t)=>{v.once("error",t),v.listen(0,"127.0.0.1",e)});const j=v.address();u.ok(j&&"object"==typeof j);const R=`http://127.0.0.1:${j.port}`,S=await x.newPage({viewport:a??{width:1280,height:720}}),k=(e="")=>S.goto(`${R}/${e}`,{waitUntil:"networkidle"});S.setDefaultTimeout(15e3);const O=[];S.on("pageerror",e=>O.push(e));try{await k(),await o(S,{pageErrors:O,baseUrl:R,open:k}),m(`✔ ${c??e}`)}catch(t){E=!0,g(`✖ ${c??e}`),g(t);for(const e of O)g(" page error:",e.message)}finally{await S.close(),await new Promise(e=>v.close(e))}}}finally{await x.close()}return!E}var R=import.meta.url;process.exitCode=await async function(e,n){let i;try{i=function(e,n,i){let o="tests/browser";const c=[],a={},l={};for(let r=0;r<e.length;r++){const s=e[r];if("--help"===s||"-h"===s)return"help";if("--version"===s||"-v"===s)return"version";const d=s.indexOf("="),h=s.startsWith("--")&&d>0?s.slice(0,d):s;if(!["--dir","--css","--tailwind","--serve","--define"].includes(h))throw new $(`unknown argument "${s}"`);let f;if(h!==s)f=s.slice(d+1);else{if(r+1>=e.length)throw new $(`${h} needs a value`);f=e[++r]}if("--dir"===h)o=f;else if("--css"===h)c.push(E(n,f,h).toString("utf8"));else if("--tailwind"===h){const e=x(n,f,h);try{c.push(i(e))}catch(e){if(e instanceof g)throw new $(e.message);throw e}}else if("--serve"===h){const e=f.indexOf("=");if(e<=0)throw new $(`--serve ${f}: expected <urlPath>=<file>`);const r=f.slice(0,e);if(!r.startsWith("/"))throw new $(`--serve ${f}: the URL path must start with /`);const s=f.slice(e+1);a[r]={contentType:b[t(s).toLowerCase()]??"application/octet-stream",body:E(n,s,h)}}else{const e=f.indexOf("=");if(e<=0)throw new $(`--define ${f}: expected KEY=JSON`);const t=f.slice(0,e),r=f.slice(e+1);try{JSON.parse(r)}catch{throw new $(`--define ${t}: ${JSON.stringify(r)} is not JSON (a string needs its quotes: KEY='"text"')`)}l[t]=r}}return{dir:r(o)?o:s(n,o),stylesheets:c,serve:a,define:l}}(e,n.cwd,n.compileTailwind)}catch(e){if(!(e instanceof $))throw e;return n.err(`${y}: ${e.message}\n\n${v}`),1}if("help"===i)return n.out(v),0;if("version"===i)return n.out(n.version),0;n.env.BROWSER_SHARD&&(i.shard=n.env.BROWSER_SHARD),n.env.REACT_DIR&&(i.reactDir=n.env.REACT_DIR),i.root=n.cwd;try{return await n.runLane(i)?0:1}catch(e){return n.err(`${y}: ${e instanceof Error?e.message:String(e)}`),1}}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),version:"13.25.0",compileTailwind:e=>function(e,t){if(!o(e)||!c(e).isFile())throw new g(`--tailwind ${e}: no such file`);const r=s(t,"node_modules",".bin","tailwindcss");if(!o(r))throw new g("--tailwind needs the Tailwind CLI: add @tailwindcss/cli to this repository's devDependencies");const n=l(s(f(),"browser-check-css-"));try{const o=s(n,"styles.css");return h(r,["-i",e,"-o",o],{cwd:t,stdio:["ignore","ignore","inherit"]}),i(o,"utf8")}finally{d(n,{recursive:!0,force:!0})}}(e,process.cwd()),runLane:e=>j({...e,esbuild:m("esbuild",R),chromium:m("playwright",R).chromium})});
2
+ import{createRequire as e}from"module";import{extname as t,isAbsolute as r,join as s,resolve as n}from"path";import{readFileSync as i,existsSync as o,statSync as c,readdirSync as a,mkdtempSync as l,rmSync as d}from"fs";import{execFileSync as h}from"child_process";import{tmpdir as f}from"os";import u from"assert/strict";import{createServer as w}from"http";import{pathToFileURL as p}from"url";function m(t,r){for(const n of[s(process.cwd(),"package.json"),r])try{return e(n)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}var g=class extends Error{};var y="efficient-shell-browser-check",v=`${y}: run real-browser checks, one <name>.entry.tsx page and one <name>.check.mjs check per scenario.\n\n ${y} [--dir tests/browser] [--css <file>]... [--tailwind <entry.css>]... [--serve <urlPath>=<file>]... [--define KEY=JSON]...\n\n --dir <folder> the scenario folder (default tests/browser)\n --css <file> a stylesheet every page links, in the order given\n --tailwind <entry.css> a Tailwind entry, compiled with this repository's @tailwindcss/cli,\n linked like a --css sheet, in the order given\n --serve <urlPath>=<file> a file the page can fetch at urlPath (starts with /)\n --define KEY=JSON replace KEY in the bundle with the JSON value\n --version, --help\n\nesbuild and playwright come from this repository's devDependencies.\nBROWSER_SHARD=<i>/<n> runs one shard. Exits 1 when a check fails.`,b={".js":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".css":"text/css; charset=utf-8",".html":"text/html; charset=utf-8",".json":"application/json; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".pdf":"application/pdf",".wasm":"application/wasm",".woff2":"font/woff2",".glb":"model/gltf-binary"},$=class extends Error{};function x(e,t,n){const i=r(t)?t:s(e,t);if(!o(i)||!c(i).isFile())throw new $(`${n} ${t}: no such file`);return i}function E(e,t,r){return i(x(e,t,r))}async function j(e){const{dir:t,root:r=process.cwd(),esbuild:i,chromium:o,stylesheets:c=[],serve:l={},define:d={},shard:h,reactDir:f,out:m=e=>console.log(e),err:g=(...e)=>console.error(...e)}=e,y=a(t).filter(e=>e.endsWith(".entry.tsx")).map(e=>e.replace(/\.entry\.tsx$/,"")).sort();if(0===y.length)throw new Error(`no *.entry.tsx found in ${t}`);const v=function(e,t){if(!t)return e;const r=/^(\d+)\/(\d+)$/.exec(t);if(!r)throw new Error(`BROWSER_SHARD must look like 1/3, got ${JSON.stringify(t)}`);const[s,n]=[Number(r[1]),Number(r[2])];if(!(n>=1&&s>=1&&s<=n))throw new Error(`BROWSER_SHARD ${t} is out of range`);return e.filter((e,t)=>t%n===s-1)}(y,h);h&&m(`shard ${h}: ${v.length} of ${y.length} scenarios`);const b=c.map((e,t)=>`/styles-${t+1}.css`),$=new Map(Object.entries(l));c.forEach((e,t)=>$.set(b[t],{contentType:"text/css; charset=utf-8",body:e}));const x=await o.launch({headless:!0});let E=!1;try{for(const e of v){const{default:o,describe:c,viewport:a}=await(import(p(s(t,`${e}.check.mjs`)).href)),l=await i.build({entryPoints:[s(t,`${e}.entry.tsx`)],bundle:!0,write:!1,outdir:s(r,"node_modules",".cache","efficient-shell-browser"),entryNames:"bundle",format:"esm",platform:"browser",target:"chrome120",jsx:"automatic",define:d,logLevel:"warning",...f&&{alias:{react:s(n(f),"react"),"react-dom":s(n(f),"react-dom")}}}),h=l.outputFiles.find(e=>e.path.endsWith(".js")).text,y=l.outputFiles.find(e=>e.path.endsWith(".css"))?.text??null,v=w((e,t)=>{const r=e.url??"/";if("/bundle.js"===r)return t.writeHead(200,{"content-type":"text/javascript; charset=utf-8"}),void t.end(h);if("/bundle.css"===r&&null!==y)return t.writeHead(200,{"content-type":"text/css; charset=utf-8"}),void t.end(y);const s=$.get(r);if(s)return t.writeHead(200,{"content-type":s.contentType}),void t.end(s.body);t.writeHead(200,{"content-type":"text/html; charset=utf-8"}),t.end("<!doctype html><html><head>"+b.map(e=>`<link rel="stylesheet" href="${e}">`).join("")+(null!==y?'<link rel="stylesheet" href="/bundle.css">':"")+'</head><body><div id="root"></div><script type="module" src="/bundle.js"><\/script></body></html>')});await new Promise((e,t)=>{v.once("error",t),v.listen(0,"127.0.0.1",e)});const j=v.address();u.ok(j&&"object"==typeof j);const R=`http://127.0.0.1:${j.port}`,S=await x.newPage({viewport:a??{width:1280,height:720}}),k=(e="")=>S.goto(`${R}/${e}`,{waitUntil:"networkidle"});S.setDefaultTimeout(15e3);const O=[];S.on("pageerror",e=>O.push(e));try{await k(),await o(S,{pageErrors:O,baseUrl:R,open:k}),m(`✔ ${c??e}`)}catch(t){E=!0,g(`✖ ${c??e}`),g(t);for(const e of O)g(" page error:",e.message)}finally{await S.close(),await new Promise(e=>v.close(e))}}}finally{await x.close()}return!E}var R=import.meta.url;process.exitCode=await async function(e,n){let i;try{i=function(e,n,i){let o="tests/browser";const c=[],a={},l={};for(let r=0;r<e.length;r++){const s=e[r];if("--help"===s||"-h"===s)return"help";if("--version"===s||"-v"===s)return"version";const d=s.indexOf("="),h=s.startsWith("--")&&d>0?s.slice(0,d):s;if(!["--dir","--css","--tailwind","--serve","--define"].includes(h))throw new $(`unknown argument "${s}"`);let f;if(h!==s)f=s.slice(d+1);else{if(r+1>=e.length)throw new $(`${h} needs a value`);f=e[++r]}if("--dir"===h)o=f;else if("--css"===h)c.push(E(n,f,h).toString("utf8"));else if("--tailwind"===h){const e=x(n,f,h);try{c.push(i(e))}catch(e){if(e instanceof g)throw new $(e.message);throw e}}else if("--serve"===h){const e=f.indexOf("=");if(e<=0)throw new $(`--serve ${f}: expected <urlPath>=<file>`);const r=f.slice(0,e);if(!r.startsWith("/"))throw new $(`--serve ${f}: the URL path must start with /`);const s=f.slice(e+1);a[r]={contentType:b[t(s).toLowerCase()]??"application/octet-stream",body:E(n,s,h)}}else{const e=f.indexOf("=");if(e<=0)throw new $(`--define ${f}: expected KEY=JSON`);const t=f.slice(0,e),r=f.slice(e+1);try{JSON.parse(r)}catch{throw new $(`--define ${t}: ${JSON.stringify(r)} is not JSON (a string needs its quotes: KEY='"text"')`)}l[t]=r}}return{dir:r(o)?o:s(n,o),stylesheets:c,serve:a,define:l}}(e,n.cwd,n.compileTailwind)}catch(e){if(!(e instanceof $))throw e;return n.err(`${y}: ${e.message}\n\n${v}`),1}if("help"===i)return n.out(v),0;if("version"===i)return n.out(n.version),0;n.env.BROWSER_SHARD&&(i.shard=n.env.BROWSER_SHARD),n.env.REACT_DIR&&(i.reactDir=n.env.REACT_DIR),i.root=n.cwd;try{return await n.runLane(i)?0:1}catch(e){return n.err(`${y}: ${e instanceof Error?e.message:String(e)}`),1}}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),version:"14.1.0",compileTailwind:e=>function(e,t){if(!o(e)||!c(e).isFile())throw new g(`--tailwind ${e}: no such file`);const r=s(t,"node_modules",".bin","tailwindcss");if(!o(r))throw new g("--tailwind needs the Tailwind CLI: add @tailwindcss/cli to this repository's devDependencies");const n=l(s(f(),"browser-check-css-"));try{const o=s(n,"styles.css");return h(r,["-i",e,"-o",o],{cwd:t,stdio:["ignore","ignore","inherit"]}),i(o,"utf8")}finally{d(n,{recursive:!0,force:!0})}}(e,process.cwd()),runLane:e=>j({...e,esbuild:m("esbuild",R),chromium:m("playwright",R).chromium})});
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as e}from"module";import{join as n}from"path";import{existsSync as t,readFileSync as i,readdirSync as r}from"fs";function o(t){return function(t,i){for(const r of[n(process.cwd(),"package.json"),i])try{return e(r)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}("typescript",t)}var s=/[.+^$()|[\]\\]/g;function a(e){let n="",t=0;for(let i=0;i<e.length;i++){const r=e[i];"*"===r?"*"===e[i+1]?"/"===e[i+2]?(n+="(?:[^/]+/)*",i+=2):(n+=".*",i+=1):n+="[^/]*":"?"===r?n+="[^/]":"{"===r?(n+="(?:",t+=1):"}"===r&&t>0?(n+=")",t-=1):n+=","===r&&t>0?"|":r.replace(s,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function g(e){const n=e.map(a);return e=>n.some(n=>n.test(e))}var c=new Set(["node_modules",".git"]),l=new Set(["dist","coverage",".next",".turbo"]);function d(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function h(e,t){const i=g(t),o=[...new Set(t.map(d))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),a=new Set,h=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?c.has(e.name)||""===t&&l.has(e.name)||h(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)h(e);return[...a].sort(u)}var u=(e,n)=>e<n?-1:e>n?1:0;Object.keys({fast:120,base:160}).map(e=>`--motion-${e}`).join(", "),Object.keys({body:400,control:500,heading:600,figure:700}).map(e=>`--weight-${e}`).join(", "),Object.keys({hairline:1,strong:2,accent:4}).map(e=>`--border-${e}`).join(", "),[2,4,8,12,16,20,24,32,40,48].join("/");var p=(...e)=>["origin",...e].join("-");new RegExp(["(?:transformOrigin|transform-origin)\\s*[:=]\\s*[\"'`]?\\s*(?:top left|left top|0 0|0% 0%|0px 0px)(?![\\w%-])",`(?<![\\w-])!?${p("top","left")}(?![\\w-])`,`(?<![\\w-])!?${p("\\[0_0\\]")}`].join("|"));var f=(...e)=>e.join(""),m="3xs|2xs|xs|sm|base|lg|xl|[2-9]xl";new RegExp(`(?<![\\w-])!?(?:${f("te","xt-")}(?:(?:${m})(?:\\/[\\w.()-]+)?|\\[(?:length:)?[\\d.]+(?:px|rem|em)\\])|${f("fo","nt-")}(?:thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\\[\\d+\\]))(?![\\w-])`),new RegExp(`(?<![\\w-])${f("round","ed")}(?:-(?:full|sm|md|lg|xl|[23]xl|[trblse]|tl|tr|br|bl|\\([^)]*\\)|\\[[^\\]]*\\]))*(?![\\w-])`);new RegExp(`(?<![\\w-])${f("b","g-")}(?!(?:none|transparent|current|inherit|cover|contain|auto|fixed|local|scroll|center|top|bottom|left|right|repeat|no-repeat|clip|origin|blend|linear|radial|conic|gradient|position|size|image)(?![\\w]))[\\w\\[(#][^\\s'"\`]*`);var w=`${m}|left|center|right|justify|start|end|wrap|nowrap|balance|pretty|ellipsis|clip|transparent|current|inherit|shadow`;new RegExp(`(?<![\\w-])${f("te","xt-")}(?!(?:${w})(?![\\w]))(?!\\[[\\d.]+(?:px|rem|em)\\])(?!\\[length:)[\\w\\[(#][^\\s'"\`]*`),new RegExp(`(?<![\\w-])${f("p","[xs]?-")}(?:\\d|\\[|\\()`),new RegExp(`(?<![\\w-])${f("p","y-")}(?:0|px|0\\.5|\\[[0-3](?:\\.\\d+)?px\\])(?![\\w.-])`),new RegExp(`(?<![\\w-])${f("round","ed-full")}(?![\\w-])`),new RegExp(`(?<![\\w-])${f("te","xt-")}(?:xs|2xs|3xs|\\[(?:9|10|11|12)px\\])(?![\\w-])`),new RegExp(`(?<![\\w-])${f("p","y-")}`),new RegExp(`(?<![\\w-])!?(?:${f("dura","tion-")}|${f("del","ay-")})(?:\\d+|\\[[^\\]]+\\])(?![\\w-])|(?<![\\w-])!?${f("fo","nt-")}\\[\\d+\\](?![\\w-])|(?<![\\w-])!?${f("bor","der")}(?:-[xytrblse])?-\\[[\\d.]+px\\](?![\\w-])`,"g");var $={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"]}};new Set(($.busy?.words??[]).map(e=>e.toLowerCase()));var x=(...e)=>e.join("-");x("p[xytrblse]?",""),x("max","[wh]",""),x("h",""),x("w",""),x("[wh]",""),x("min","h","");var y=class extends Error{},b=new Set(["$schema","schema","include","exclude","allow"]),R=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),S=e=>"string"==typeof e&&""!==e.trim();var v="d3as2htf4hwbtr.cloudfront.net",k={dealer:{bucket:"inovit-dealer-portal-assets",hosts:["d201q0i87q901p.cloudfront.net"],key_pattern:"^marketing/"},media:{bucket:"regis-media-production",hosts:["media.regis.design","d21nnr9ivf9hcc.cloudfront.net"],key_pattern:"^[a-z0-9_]+/storefront/(?!uploads/thumbs/)"},site:{bucket:"inovit-ecommerce-media",hosts:["cdn.inovit.com","dhxlibd8r3td0.cloudfront.net"],key_pattern:"^images/"}},j=Object.values(k),C=Object.freeze([...new Set([...j.flatMap(e=>e.hosts),v,...j.map(e=>e.bucket)])].sort()),A=new RegExp([...C.map(e=>{return`(?<![\\w-])${n=e,n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`;var n}),"(?<![\\w-])[a-z0-9]+\\.cloudfront\\.net(?![\\w-])","(?<![\\w-])(?:[a-z0-9-]+\\.)*s3(?:[.-][a-z0-9-]+)*\\.amazonaws\\.com(?![\\w-])","s3://"].join("|"),"gi");function E(e,n,t){const i=e.createSourceFile(n,t,e.ScriptTarget.Latest,!0,function(e,n){return n.endsWith(".tsx")?e.ScriptKind.TSX:n.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(n)?e.ScriptKind.JS:e.ScriptKind.TS}(e,n)),r=[],o=(e,n)=>{const t=i.getLineAndCharacterOfPosition(e.getStart(i)).line+1;for(const e of function(e){return[...e.matchAll(A)].map(e=>({match:e[0],index:e.index??0}))}(n)){const i=n.slice(0,e.index);r.push({line:t+(i.match(/\n/g)?.length??0),match:e.match})}},s=n=>{e.isStringLiteral(n)||e.isNoSubstitutionTemplateLiteral(n)||e.isTemplateHead(n)||e.isTemplateMiddle(n)||e.isTemplateTail(n)?o(n,n.text):e.isRegularExpressionLiteral(n)&&o(n,n.text.replace(/\\(.)/g,"$1")),e.forEachChild(n,s)};return s(i),r}var O="media-host-check.config.json",T="efficient-shell-media-host-check",P=`${T}: no code writes a media origin; files are reached through the storage backend, the API's URL, media() or imageCopyUrl() (harness API-15, SSOT-2).\n\n ${T} check this repository; exits 1 on a finding\n ${T} --json print the result as JSON\n\nRefused in any string, template or regular expression: every host and bucket in\nthe image-copies contract, any *.cloudfront.net host, any S3 endpoint, and s3://.\nReads ${O} in the current directory.`;function L(e,t,r){const o=[],s=g(r.exclude);for(const e of r.include)0===h(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const a=h(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),c=[];for(const r of a)for(const o of E(e,r,i(n(t,r),"utf8")))c.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)c.some(n=>n.file===e.file&&l(e.match,n.match))||o.push(`allow ${e.file} "${e.match}" matches nothing any more; delete it`);return{files:a.length,findings:c.filter(e=>!(e=>r.allow.some(n=>n.file===e.file&&l(n.match,e.match)))(e)),problems:o}}process.exitCode=function(e,r){let o=!1;for(const n of e){if("--help"===n||"-h"===n)return r.out(P),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${T}: unknown argument "${n}"\n\n${P}`),2;o=!0}const s=n(r.cwd,O);if(!t(s))return r.err(`${T}: no ${O} in ${r.cwd}. Run it from the repository root.`),2;let a;try{const e=function(e,n="media-host-check.config.json"){const t=[];if(!R(e))throw new y(`${n}: expected an object`);for(const n of Object.keys(e))b.has(n)||t.push(`unknown key "${n}"`);1!==e.schema&&t.push('"schema" must be 1');const i=(n,i)=>{const r=e[n];return void 0!==r||i?!Array.isArray(r)||!r.every(S)||i&&0===r.length?(t.push(`"${n}" must be ${i?"a non-empty":"an"} array of globs`),[]):r:[]},r=i("include",!0),o=i("exclude",!1),s=[];void 0===e.allow||Array.isArray(e.allow)||t.push('"allow" must be an array');for(const[n,i]of(Array.isArray(e.allow)?e.allow:[]).entries()){if(!(R(i)&&S(i.file)&&S(i.match)&&S(i.reason))){t.push(`allow[${n}] needs "file", "match" and "reason", each a non-empty string`);continue}const e=Object.keys(i).filter(e=>!["file","match","reason"].includes(e));e.length&&t.push(`allow[${n}] has unknown keys: ${e.join(", ")}`),s.push({file:i.file,match:i.match,reason:i.reason})}if(t.length)throw new y(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),O);a=L(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${T}: ${e instanceof y||e instanceof SyntaxError?e.message:String(e)}`),2}const g=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!g,...a},null,2)),g?1:0;if(!g)return r.out(`${T}: ${a.files} files, no media origin written in code (harness API-15, SSOT-2).`),0;for(const e of a.findings)r.err(`${e.file}:${e.line} "${e.match}" is a media origin written in code.`);for(const e of a.problems)r.err(`${O}: ${e}`);return a.findings.length&&r.err(`\nReach the file through the storage backend, the URL the API returns, media() or imageCopyUrl() (harness API-15, SSOT-2). An origin that must stay goes in "allow" in ${O}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>o(import.meta.url),version:"13.25.0"});
2
+ import{createRequire as e}from"module";import{join as n}from"path";import{existsSync as t,readFileSync as i,readdirSync as r}from"fs";function o(t){return function(t,i){for(const r of[n(process.cwd(),"package.json"),i])try{return e(r)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}("typescript",t)}var s=/[.+^$()|[\]\\]/g;function a(e){let n="",t=0;for(let i=0;i<e.length;i++){const r=e[i];"*"===r?"*"===e[i+1]?"/"===e[i+2]?(n+="(?:[^/]+/)*",i+=2):(n+=".*",i+=1):n+="[^/]*":"?"===r?n+="[^/]":"{"===r?(n+="(?:",t+=1):"}"===r&&t>0?(n+=")",t-=1):n+=","===r&&t>0?"|":r.replace(s,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function g(e){const n=e.map(a);return e=>n.some(n=>n.test(e))}var c=new Set(["node_modules",".git"]),l=new Set(["dist","coverage",".next",".turbo"]);function d(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function h(e,t){const i=g(t),o=[...new Set(t.map(d))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),a=new Set,h=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?c.has(e.name)||""===t&&l.has(e.name)||h(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)h(e);return[...a].sort(u)}var u=(e,n)=>e<n?-1:e>n?1:0;Object.keys({fast:120,base:160}).map(e=>`--motion-${e}`).join(", "),Object.keys({body:400,control:500,heading:600,figure:700}).map(e=>`--weight-${e}`).join(", "),Object.keys({hairline:1,strong:2,accent:4}).map(e=>`--border-${e}`).join(", "),[2,4,8,12,16,20,24,32,40,48].join("/");var p=(...e)=>["origin",...e].join("-");new RegExp(["(?:transformOrigin|transform-origin)\\s*[:=]\\s*[\"'`]?\\s*(?:top left|left top|0 0|0% 0%|0px 0px)(?![\\w%-])",`(?<![\\w-])!?${p("top","left")}(?![\\w-])`,`(?<![\\w-])!?${p("\\[0_0\\]")}`].join("|"));var f=(...e)=>e.join(""),m="3xs|2xs|xs|sm|base|lg|xl|[2-9]xl";new RegExp(`(?<![\\w-])!?(?:${f("te","xt-")}(?:(?:${m})(?:\\/[\\w.()-]+)?|\\[(?:length:)?[\\d.]+(?:px|rem|em)\\])|${f("fo","nt-")}(?:thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\\[\\d+\\]))(?![\\w-])`),new RegExp(`(?<![\\w-])${f("round","ed")}(?:-(?:full|sm|md|lg|xl|[23]xl|[trblse]|tl|tr|br|bl|\\([^)]*\\)|\\[[^\\]]*\\]))*(?![\\w-])`);new RegExp(`(?<![\\w-])${f("b","g-")}(?!(?:none|transparent|current|inherit|cover|contain|auto|fixed|local|scroll|center|top|bottom|left|right|repeat|no-repeat|clip|origin|blend|linear|radial|conic|gradient|position|size|image)(?![\\w]))[\\w\\[(#][^\\s'"\`]*`);var w=`${m}|left|center|right|justify|start|end|wrap|nowrap|balance|pretty|ellipsis|clip|transparent|current|inherit|shadow`;new RegExp(`(?<![\\w-])${f("te","xt-")}(?!(?:${w})(?![\\w]))(?!\\[[\\d.]+(?:px|rem|em)\\])(?!\\[length:)[\\w\\[(#][^\\s'"\`]*`),new RegExp(`(?<![\\w-])${f("p","[xs]?-")}(?:\\d|\\[|\\()`),new RegExp(`(?<![\\w-])${f("p","y-")}(?:0|px|0\\.5|\\[[0-3](?:\\.\\d+)?px\\])(?![\\w.-])`),new RegExp(`(?<![\\w-])${f("round","ed-full")}(?![\\w-])`),new RegExp(`(?<![\\w-])${f("te","xt-")}(?:xs|2xs|3xs|\\[(?:9|10|11|12)px\\])(?![\\w-])`),new RegExp(`(?<![\\w-])${f("p","y-")}`),new RegExp(`(?<![\\w-])!?(?:${f("dura","tion-")}|${f("del","ay-")})(?:\\d+|\\[[^\\]]+\\])(?![\\w-])|(?<![\\w-])!?${f("fo","nt-")}\\[\\d+\\](?![\\w-])|(?<![\\w-])!?${f("bor","der")}(?:-[xytrblse])?-\\[[\\d.]+px\\](?![\\w-])`,"g");var $={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"]}};new Set(($.busy?.words??[]).map(e=>e.toLowerCase()));var x=(...e)=>e.join("-");x("p[xytrblse]?",""),x("max","[wh]",""),x("h",""),x("w",""),x("[wh]",""),x("min","h","");var y=class extends Error{},b=new Set(["$schema","schema","include","exclude","allow"]),R=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),S=e=>"string"==typeof e&&""!==e.trim();var v="d3as2htf4hwbtr.cloudfront.net",k={dealer:{bucket:"inovit-dealer-portal-assets",hosts:["d201q0i87q901p.cloudfront.net"],key_pattern:"^marketing/"},media:{bucket:"regis-media-production",hosts:["media.regis.design","d21nnr9ivf9hcc.cloudfront.net"],key_pattern:"^[a-z0-9_]+/storefront/(?!uploads/thumbs/)"},site:{bucket:"inovit-ecommerce-media",hosts:["cdn.inovit.com","dhxlibd8r3td0.cloudfront.net"],key_pattern:"^images/"}},j=Object.values(k),C=Object.freeze([...new Set([...j.flatMap(e=>e.hosts),v,...j.map(e=>e.bucket)])].sort()),A=new RegExp([...C.map(e=>{return`(?<![\\w-])${n=e,n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`;var n}),"(?<![\\w-])[a-z0-9]+\\.cloudfront\\.net(?![\\w-])","(?<![\\w-])(?:[a-z0-9-]+\\.)*s3(?:[.-][a-z0-9-]+)*\\.amazonaws\\.com(?![\\w-])","s3://"].join("|"),"gi");function E(e,n,t){const i=e.createSourceFile(n,t,e.ScriptTarget.Latest,!0,function(e,n){return n.endsWith(".tsx")?e.ScriptKind.TSX:n.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(n)?e.ScriptKind.JS:e.ScriptKind.TS}(e,n)),r=[],o=(e,n)=>{const t=i.getLineAndCharacterOfPosition(e.getStart(i)).line+1;for(const e of function(e){return[...e.matchAll(A)].map(e=>({match:e[0],index:e.index??0}))}(n)){const i=n.slice(0,e.index);r.push({line:t+(i.match(/\n/g)?.length??0),match:e.match})}},s=n=>{e.isStringLiteral(n)||e.isNoSubstitutionTemplateLiteral(n)||e.isTemplateHead(n)||e.isTemplateMiddle(n)||e.isTemplateTail(n)?o(n,n.text):e.isRegularExpressionLiteral(n)&&o(n,n.text.replace(/\\(.)/g,"$1")),e.forEachChild(n,s)};return s(i),r}var O="media-host-check.config.json",T="efficient-shell-media-host-check",P=`${T}: no code writes a media origin; files are reached through the storage backend, the API's URL, media() or imageCopyUrl() (harness API-15, SSOT-2).\n\n ${T} check this repository; exits 1 on a finding\n ${T} --json print the result as JSON\n\nRefused in any string, template or regular expression: every host and bucket in\nthe image-copies contract, any *.cloudfront.net host, any S3 endpoint, and s3://.\nReads ${O} in the current directory.`;function L(e,t,r){const o=[],s=g(r.exclude);for(const e of r.include)0===h(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const a=h(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),c=[];for(const r of a)for(const o of E(e,r,i(n(t,r),"utf8")))c.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)c.some(n=>n.file===e.file&&l(e.match,n.match))||o.push(`allow ${e.file} "${e.match}" matches nothing any more; delete it`);return{files:a.length,findings:c.filter(e=>!(e=>r.allow.some(n=>n.file===e.file&&l(n.match,e.match)))(e)),problems:o}}process.exitCode=function(e,r){let o=!1;for(const n of e){if("--help"===n||"-h"===n)return r.out(P),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${T}: unknown argument "${n}"\n\n${P}`),2;o=!0}const s=n(r.cwd,O);if(!t(s))return r.err(`${T}: no ${O} in ${r.cwd}. Run it from the repository root.`),2;let a;try{const e=function(e,n="media-host-check.config.json"){const t=[];if(!R(e))throw new y(`${n}: expected an object`);for(const n of Object.keys(e))b.has(n)||t.push(`unknown key "${n}"`);1!==e.schema&&t.push('"schema" must be 1');const i=(n,i)=>{const r=e[n];return void 0!==r||i?!Array.isArray(r)||!r.every(S)||i&&0===r.length?(t.push(`"${n}" must be ${i?"a non-empty":"an"} array of globs`),[]):r:[]},r=i("include",!0),o=i("exclude",!1),s=[];void 0===e.allow||Array.isArray(e.allow)||t.push('"allow" must be an array');for(const[n,i]of(Array.isArray(e.allow)?e.allow:[]).entries()){if(!(R(i)&&S(i.file)&&S(i.match)&&S(i.reason))){t.push(`allow[${n}] needs "file", "match" and "reason", each a non-empty string`);continue}const e=Object.keys(i).filter(e=>!["file","match","reason"].includes(e));e.length&&t.push(`allow[${n}] has unknown keys: ${e.join(", ")}`),s.push({file:i.file,match:i.match,reason:i.reason})}if(t.length)throw new y(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),O);a=L(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${T}: ${e instanceof y||e instanceof SyntaxError?e.message:String(e)}`),2}const g=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!g,...a},null,2)),g?1:0;if(!g)return r.out(`${T}: ${a.files} files, no media origin written in code (harness API-15, SSOT-2).`),0;for(const e of a.findings)r.err(`${e.file}:${e.line} "${e.match}" is a media origin written in code.`);for(const e of a.problems)r.err(`${O}: ${e}`);return a.findings.length&&r.err(`\nReach the file through the storage backend, the URL the API returns, media() or imageCopyUrl() (harness API-15, SSOT-2). An origin that must stay goes in "allow" in ${O}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>o(import.meta.url),version:"14.1.0"});