@sdcorejs/angular 20.2.14 → 20.3.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 (205) hide show
  1. package/README.md +7 -5
  2. package/assets/STYLE-GUIDE.md +6 -3
  3. package/assets/THEME.md +166 -0
  4. package/assets/fonts/fonts.scss +1 -1
  5. package/assets/scss/ckeditor5.scss +2 -2
  6. package/assets/scss/core/_inline-edit.scss +3 -3
  7. package/assets/scss/core/_read-state-panel.scss +2 -2
  8. package/assets/scss/core/color.scss +4 -2
  9. package/assets/scss/core/form.scss +35 -12
  10. package/assets/scss/core/scrollbar.scss +3 -3
  11. package/assets/scss/core/utilities/_base.scss +5 -5
  12. package/assets/scss/core/utilities/_typography.scss +22 -22
  13. package/assets/scss/sd-core.scss +12 -0
  14. package/assets/scss/themes/_component-tokens.scss +261 -0
  15. package/assets/scss/themes/_presets.scss +3 -0
  16. package/assets/scss/themes/_ramps.scss +56 -0
  17. package/assets/scss/themes/_scales.scss +90 -0
  18. package/assets/scss/themes/_semantic.scss +22 -0
  19. package/assets/scss/themes/default.scss +113 -10
  20. package/assets/scss/themes/material-theme.scss +3 -0
  21. package/components/breadcrumb/index.d.ts +2 -1
  22. package/components/button/index.d.ts +5 -0
  23. package/components/data-state/index.d.ts +6 -2
  24. package/components/file-explorer/index.d.ts +503 -0
  25. package/components/form-generic/index.d.ts +897 -835
  26. package/components/highlight/index.d.ts +27 -0
  27. package/components/image-editor/index.d.ts +478 -0
  28. package/components/index.d.ts +3 -0
  29. package/components/inform/index.d.ts +5 -2
  30. package/components/mini-editor/index.d.ts +1 -1
  31. package/components/preview/index.d.ts +51 -2
  32. package/components/query-builder/index.d.ts +1 -1
  33. package/components/section/index.d.ts +5 -1
  34. package/components/side-drawer/index.d.ts +13 -2
  35. package/components/table/index.d.ts +6 -0
  36. package/directives/index.d.ts +8 -0
  37. package/fesm2022/sdcorejs-angular-components-anchor.mjs +2 -2
  38. package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
  39. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +6 -6
  40. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  41. package/fesm2022/sdcorejs-angular-components-audit-diff.mjs +2 -2
  42. package/fesm2022/sdcorejs-angular-components-audit-diff.mjs.map +1 -1
  43. package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs +2 -2
  44. package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs.map +1 -1
  45. package/fesm2022/sdcorejs-angular-components-avatar.mjs +34 -27
  46. package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
  47. package/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
  48. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  49. package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs +35 -5
  50. package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs.map +1 -1
  51. package/fesm2022/sdcorejs-angular-components-button.mjs +23 -11
  52. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  53. package/fesm2022/sdcorejs-angular-components-card.mjs +2 -2
  54. package/fesm2022/sdcorejs-angular-components-card.mjs.map +1 -1
  55. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +2 -2
  56. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
  57. package/fesm2022/sdcorejs-angular-components-code-editor.mjs +2 -2
  58. package/fesm2022/sdcorejs-angular-components-code-editor.mjs.map +1 -1
  59. package/fesm2022/sdcorejs-angular-components-data-state.mjs +8 -4
  60. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  61. package/fesm2022/sdcorejs-angular-components-editor.mjs +12 -4
  62. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  63. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2637 -0
  64. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -0
  65. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +5846 -6504
  66. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  67. package/fesm2022/sdcorejs-angular-components-highlight.mjs +63 -0
  68. package/fesm2022/sdcorejs-angular-components-highlight.mjs.map +1 -0
  69. package/fesm2022/sdcorejs-angular-components-history.mjs +2 -2
  70. package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
  71. package/fesm2022/sdcorejs-angular-components-image-editor.mjs +2088 -0
  72. package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -0
  73. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +2 -2
  74. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  75. package/fesm2022/sdcorejs-angular-components-inform.mjs +9 -5
  76. package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
  77. package/fesm2022/sdcorejs-angular-components-job-progress.mjs +2 -2
  78. package/fesm2022/sdcorejs-angular-components-job-progress.mjs.map +1 -1
  79. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +40 -22
  80. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  81. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +2 -2
  82. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
  83. package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
  84. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  85. package/fesm2022/sdcorejs-angular-components-operator.mjs +2 -2
  86. package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
  87. package/fesm2022/sdcorejs-angular-components-org-chart.mjs +2 -2
  88. package/fesm2022/sdcorejs-angular-components-org-chart.mjs.map +1 -1
  89. package/fesm2022/sdcorejs-angular-components-preview.mjs +129 -7
  90. package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
  91. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +33 -24
  92. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  93. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +2 -2
  94. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  95. package/fesm2022/sdcorejs-angular-components-quick-action.mjs +2 -2
  96. package/fesm2022/sdcorejs-angular-components-quick-action.mjs.map +1 -1
  97. package/fesm2022/sdcorejs-angular-components-section.mjs +11 -7
  98. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  99. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +118 -9
  100. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  101. package/fesm2022/sdcorejs-angular-components-splitter.mjs +2 -2
  102. package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
  103. package/fesm2022/sdcorejs-angular-components-stepper.mjs +2 -2
  104. package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
  105. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +4 -4
  106. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  107. package/fesm2022/sdcorejs-angular-components-tab.mjs +2 -2
  108. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  109. package/fesm2022/sdcorejs-angular-components-table.mjs +308 -113
  110. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  111. package/fesm2022/sdcorejs-angular-components-tree.mjs +2 -2
  112. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  113. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +14 -5
  114. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  115. package/fesm2022/sdcorejs-angular-components.mjs +3 -0
  116. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  117. package/fesm2022/sdcorejs-angular-directives.mjs +99 -13
  118. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  119. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +149 -6
  120. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  121. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +19 -4
  122. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  123. package/fesm2022/sdcorejs-angular-forms-chip.mjs +19 -4
  124. package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
  125. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +2 -2
  126. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  127. package/fesm2022/sdcorejs-angular-forms-date.mjs +17 -7
  128. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  129. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +17 -7
  130. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  131. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
  132. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  133. package/fesm2022/sdcorejs-angular-forms-inline-text.mjs +3 -3
  134. package/fesm2022/sdcorejs-angular-forms-inline-text.mjs.map +1 -1
  135. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +2 -2
  136. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  137. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +18 -4
  138. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  139. package/fesm2022/sdcorejs-angular-forms-input.mjs +29 -5
  140. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  141. package/fesm2022/sdcorejs-angular-forms-label.mjs +27 -2
  142. package/fesm2022/sdcorejs-angular-forms-label.mjs.map +1 -1
  143. package/fesm2022/sdcorejs-angular-forms-radio.mjs +1 -1
  144. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  145. package/fesm2022/sdcorejs-angular-forms-select.mjs +498 -7
  146. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  147. package/fesm2022/sdcorejs-angular-forms-switch.mjs +1 -1
  148. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  149. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +22 -4
  150. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  151. package/fesm2022/sdcorejs-angular-forms-time-range.mjs +2 -2
  152. package/fesm2022/sdcorejs-angular-forms-time-range.mjs.map +1 -1
  153. package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
  154. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
  155. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  156. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  157. package/fesm2022/sdcorejs-angular-i18n.mjs +1859 -271
  158. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  159. package/fesm2022/sdcorejs-angular-modules-auth.mjs +35 -3
  160. package/fesm2022/sdcorejs-angular-modules-auth.mjs.map +1 -1
  161. package/fesm2022/sdcorejs-angular-modules-icon.mjs +25 -0
  162. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  163. package/fesm2022/sdcorejs-angular-modules-layout.mjs +39 -48
  164. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  165. package/fesm2022/sdcorejs-angular-modules-permission.mjs.map +1 -1
  166. package/fesm2022/sdcorejs-angular-services-api.mjs +196 -8
  167. package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
  168. package/fesm2022/sdcorejs-angular-services-confirm.mjs +10 -3
  169. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  170. package/fesm2022/sdcorejs-angular-services-excel.mjs +5 -0
  171. package/fesm2022/sdcorejs-angular-services-excel.mjs.map +1 -1
  172. package/fesm2022/sdcorejs-angular-services-loading.mjs +1 -1
  173. package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
  174. package/fesm2022/sdcorejs-angular-services-notify.mjs +107 -7
  175. package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
  176. package/fesm2022/sdcorejs-angular-utilities-extensions.mjs +458 -1
  177. package/fesm2022/sdcorejs-angular-utilities-extensions.mjs.map +1 -1
  178. package/fesm2022/sdcorejs-angular-utilities-theme.mjs +169 -0
  179. package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -0
  180. package/fesm2022/sdcorejs-angular-utilities.mjs +1 -0
  181. package/fesm2022/sdcorejs-angular-utilities.mjs.map +1 -1
  182. package/forms/autocomplete/index.d.ts +19 -1
  183. package/forms/chip/index.d.ts +13 -2
  184. package/forms/chip-calendar/index.d.ts +13 -2
  185. package/forms/date/index.d.ts +7 -2
  186. package/forms/datetime/index.d.ts +7 -2
  187. package/forms/inline-text/index.d.ts +1 -1
  188. package/forms/input/index.d.ts +21 -5
  189. package/forms/input-number/index.d.ts +12 -2
  190. package/forms/label/index.d.ts +16 -1
  191. package/forms/models/index.d.ts +16 -1
  192. package/forms/select/index.d.ts +66 -4
  193. package/forms/textarea/index.d.ts +9 -2
  194. package/i18n/index.d.ts +370 -54
  195. package/modules/auth/index.d.ts +3 -3
  196. package/modules/icon/index.d.ts +11 -1
  197. package/modules/layout/index.d.ts +2 -2
  198. package/modules/permission/index.d.ts +3 -2
  199. package/package.json +18 -2
  200. package/services/api/index.d.ts +49 -2
  201. package/services/confirm/index.d.ts +15 -0
  202. package/services/notify/index.d.ts +8 -0
  203. package/utilities/extensions/index.d.ts +68 -1
  204. package/utilities/index.d.ts +1 -0
  205. package/utilities/theme/index.d.ts +25 -0
@@ -0,0 +1,2637 @@
1
+ import { NgComponentOutlet, NgTemplateOutlet, DOCUMENT } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, computed, ChangeDetectionStrategy, Component, inject, ElementRef, output, signal, viewChild, effect, untracked, Injector, NgZone, afterNextRender, DestroyRef } from '@angular/core';
4
+ import { SdBreadcrumb } from '@sdcorejs/angular/components/breadcrumb';
5
+ import { SdButton } from '@sdcorejs/angular/components/button';
6
+ import { SdDataState } from '@sdcorejs/angular/components/data-state';
7
+ import { I18nService, SdTranslatePipe } from '@sdcorejs/angular/i18n';
8
+ import { SdIcon } from '@sdcorejs/angular/modules/icon';
9
+ import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
10
+
11
+ // AUTO-GENERATED by scripts/generate-file-explorer-icons.mjs from ./assets/icons. DO NOT EDIT.
12
+ // Run `npm run generate:file-explorer-icons` at the repo root after changing the SVG files or manifest.json.
13
+ /** Icon markup (64 × 64 viewBox), without title / ARIA / fixed size — rendered decoratively. */
14
+ const SD_FILE_EXPLORER_ICON_SVGS = {
15
+ 'file-3d': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#2A8495" opacity=".17"/><g fill="none" stroke="#2A8495" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m32 20 11 6v11l-11 6-11-6V26zm0 12 11-6m-11 6-11-6m11 6v11"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#2A8495"/><g fill="#FFF"><path d="M29.03 47.27Q29.77 47.46 30.15 47.93Q30.53 48.4 30.53 49.13Q30.53 50.21 29.7 50.78Q28.87 51.34 27.28 51.34Q26.72 51.34 26.16 51.25Q25.59 51.16 25.04 50.98V49.53Q25.57 49.79 26.09 49.93Q26.61 50.06 27.11 50.06Q27.86 50.06 28.25 49.8Q28.65 49.54 28.65 49.06Q28.65 48.56 28.25 48.31Q27.84 48.05 27.04 48.05H26.29V46.84H27.08Q27.79 46.84 28.14 46.62Q28.48 46.4 28.48 45.94Q28.48 45.52 28.15 45.29Q27.81 45.06 27.19 45.06Q26.74 45.06 26.27 45.16Q25.81 45.27 25.35 45.47V44.09Q25.91 43.93 26.46 43.86Q27 43.78 27.53 43.78Q28.95 43.78 29.66 44.24Q30.36 44.71 30.36 45.65Q30.36 46.29 30.02 46.7Q29.69 47.1 29.03 47.27Z"/><path d="M34.13 45.33V49.78H34.8Q35.95 49.78 36.56 49.21Q37.17 48.64 37.17 47.55Q37.17 46.46 36.56 45.9Q35.96 45.33 34.8 45.33ZM32.25 43.91H34.23Q35.89 43.91 36.7 44.15Q37.52 44.38 38.1 44.95Q38.61 45.44 38.86 46.09Q39.11 46.73 39.11 47.55Q39.11 48.37 38.86 49.02Q38.61 49.67 38.1 50.16Q37.51 50.73 36.69 50.96Q35.87 51.2 34.23 51.2H32.25Z"/></g></svg>',
16
+ 'file-7z': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M25.56 43.91H31.06V44.97L28.22 51.2H26.38L29.08 45.29H25.56Z"/><path d="M32.42 43.91H38.54V45.05L34.63 49.78H38.66V51.2H32.3V50.06L36.21 45.33H32.42Z"/></g></svg>',
17
+ 'file-ai': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#BA622F" opacity=".17"/><g fill="none" stroke="#BA622F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m32 20 9 9-9 9-9-9zm0 0v18m-4-4 4-4 4 4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#BA622F"/><g fill="#FFF"><path d="M31.61 49.87H28.67L28.21 51.2H26.32L29.02 43.91H31.26L33.96 51.2H32.07ZM29.14 48.52H31.14L30.14 45.62Z"/><path d="M34.93 43.91H36.81V51.2H34.93Z"/></g></svg>',
18
+ 'file-app': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#5E7186" opacity=".17"/><g fill="none" stroke="#5E7186" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="23" y="22" width="18" height="15" rx="3"/><path d="M28 19v3m8-3v3m-8 15v3m8-3v3m-16-13h3m-3 6h3m18-6h3m-3 6h3"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#5E7186"/><g fill="#FFF"><path d="M26.14 49.87H23.2L22.74 51.2H20.85L23.55 43.91H25.79L28.49 51.2H26.6ZM23.67 48.52H25.67L24.67 45.62Z"/><path d="M29.46 43.91H32.58Q33.97 43.91 34.71 44.53Q35.46 45.15 35.46 46.29Q35.46 47.44 34.71 48.05Q33.97 48.67 32.58 48.67H31.34V51.2H29.46ZM31.34 45.27V47.31H32.38Q32.93 47.31 33.22 47.04Q33.52 46.78 33.52 46.29Q33.52 45.8 33.22 45.54Q32.93 45.27 32.38 45.27Z"/><path d="M36.79 43.91H39.91Q41.3 43.91 42.04 44.53Q42.79 45.15 42.79 46.29Q42.79 47.44 42.04 48.05Q41.3 48.67 39.91 48.67H38.67V51.2H36.79ZM38.67 45.27V47.31H39.71Q40.25 47.31 40.55 47.04Q40.85 46.78 40.85 46.29Q40.85 45.8 40.55 45.54Q40.25 45.27 39.71 45.27Z"/></g></svg>',
19
+ 'file-archive': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M25.95 49.87H23.01L22.55 51.2H20.66L23.36 43.91H25.6L28.3 51.2H26.41ZM23.48 48.52H25.48L24.48 45.62Z"/><path d="M31.94 47.14Q32.53 47.14 32.79 46.92Q33.04 46.7 33.04 46.2Q33.04 45.7 32.79 45.49Q32.53 45.27 31.94 45.27H31.15V47.14ZM31.15 48.44V51.2H29.27V43.91H32.14Q33.58 43.91 34.25 44.39Q34.92 44.88 34.92 45.92Q34.92 46.64 34.57 47.11Q34.22 47.57 33.52 47.79Q33.91 47.88 34.21 48.19Q34.52 48.5 34.83 49.13L35.85 51.2H33.85L32.96 49.39Q32.69 48.84 32.42 48.64Q32.14 48.44 31.68 48.44Z"/><path d="M42.75 50.8Q42.23 51.07 41.67 51.2Q41.11 51.34 40.5 51.34Q38.68 51.34 37.61 50.32Q36.55 49.31 36.55 47.56Q36.55 45.81 37.61 44.8Q38.68 43.78 40.5 43.78Q41.11 43.78 41.67 43.91Q42.23 44.05 42.75 44.32V45.83Q42.23 45.47 41.72 45.31Q41.21 45.14 40.65 45.14Q39.64 45.14 39.07 45.78Q38.49 46.43 38.49 47.56Q38.49 48.69 39.07 49.33Q39.64 49.98 40.65 49.98Q41.21 49.98 41.72 49.81Q42.23 49.65 42.75 49.29Z"/></g></svg>',
20
+ 'file-audio': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B84C89" opacity=".17"/><g fill="none" stroke="#B84C89" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M31 22v12m0-10 10-3v11M26 36c-3 0-4-3-1-4 2-1 6-1 6 1s-2 3-5 3zm10-2c-3 0-4-3-1-4 2-1 6-1 6 1s-2 3-5 3z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B84C89"/><g fill="#FFF"><path d="M25.26 49.87H22.32L21.86 51.2H19.97L22.67 43.91H24.91L27.61 51.2H25.72ZM22.79 48.52H24.79L23.79 45.62Z"/><path d="M28.58 43.91H30.46V48.28Q30.46 49.18 30.75 49.57Q31.05 49.96 31.72 49.96Q32.39 49.96 32.69 49.57Q32.98 49.18 32.98 48.28V43.91H34.86V48.28Q34.86 49.83 34.08 50.58Q33.31 51.34 31.72 51.34Q30.13 51.34 29.35 50.58Q28.58 49.83 28.58 48.28Z"/><path d="M38.58 45.33V49.78H39.25Q40.4 49.78 41.01 49.21Q41.62 48.64 41.62 47.55Q41.62 46.46 41.01 45.9Q40.41 45.33 39.25 45.33ZM36.7 43.91H38.68Q40.34 43.91 41.15 44.15Q41.97 44.38 42.55 44.95Q43.06 45.44 43.31 46.09Q43.56 46.73 43.56 47.55Q43.56 48.37 43.31 49.02Q43.06 49.67 42.55 50.16Q41.96 50.73 41.14 50.96Q40.32 51.2 38.68 51.2H36.7Z"/></g></svg>',
21
+ 'file-book': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#A15D63" opacity=".17"/><g fill="none" stroke="#A15D63" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M32 24c-4-3-8-3-12-2v14c4-1 8-1 12 2 4-3 8-3 12-2V22c-4-1-8-1-12 2zm0 0v14"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#A15D63"/><g fill="#FFF"><path d="M21.13 47.27Q21.52 47.27 21.73 47.1Q21.93 46.92 21.93 46.59Q21.93 46.26 21.73 46.08Q21.52 45.91 21.13 45.91H20.22V47.27ZM21.19 50.07Q21.69 50.07 21.94 49.86Q22.19 49.65 22.19 49.23Q22.19 48.81 21.94 48.6Q21.69 48.39 21.19 48.39H20.22V50.07ZM22.73 47.77Q23.26 47.92 23.55 48.34Q23.84 48.76 23.84 49.36Q23.84 50.29 23.22 50.74Q22.59 51.2 21.31 51.2H18.56V44.78H21.05Q22.38 44.78 22.98 45.19Q23.58 45.59 23.58 46.48Q23.58 46.95 23.36 47.28Q23.14 47.61 22.73 47.77Z"/><path d="M28.2 45.87Q27.45 45.87 27.03 46.43Q26.61 46.98 26.61 48Q26.61 49.01 27.03 49.57Q27.45 50.13 28.2 50.13Q28.96 50.13 29.38 49.57Q29.8 49.01 29.8 48Q29.8 46.98 29.38 46.43Q28.96 45.87 28.2 45.87ZM28.2 44.67Q29.75 44.67 30.62 45.55Q31.5 46.44 31.5 48Q31.5 49.55 30.62 50.44Q29.75 51.32 28.2 51.32Q26.66 51.32 25.78 50.44Q24.9 49.55 24.9 48Q24.9 46.44 25.78 45.55Q26.66 44.67 28.2 44.67Z"/><path d="M35.68 45.87Q34.93 45.87 34.51 46.43Q34.09 46.98 34.09 48Q34.09 49.01 34.51 49.57Q34.93 50.13 35.68 50.13Q36.44 50.13 36.86 49.57Q37.28 49.01 37.28 48Q37.28 46.98 36.86 46.43Q36.44 45.87 35.68 45.87ZM35.68 44.67Q37.23 44.67 38.11 45.55Q38.98 46.44 38.98 48Q38.98 49.55 38.11 50.44Q37.23 51.32 35.68 51.32Q34.14 51.32 33.26 50.44Q32.38 49.55 32.38 48Q32.38 46.44 33.26 45.55Q34.14 44.67 35.68 44.67Z"/><path d="M40.23 44.78H41.89V47.13L44.27 44.78H46.19L43.1 47.82L46.51 51.2H44.44L41.89 48.67V51.2H40.23Z"/></g></svg>',
22
+ 'file-code': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M24.27 50.85Q23.81 51.08 23.32 51.2Q22.82 51.32 22.29 51.32Q20.68 51.32 19.75 50.43Q18.81 49.53 18.81 48Q18.81 46.46 19.75 45.56Q20.68 44.67 22.29 44.67Q22.82 44.67 23.32 44.79Q23.81 44.91 24.27 45.15V46.47Q23.81 46.16 23.36 46.01Q22.91 45.87 22.42 45.87Q21.53 45.87 21.03 46.43Q20.52 47 20.52 48Q20.52 48.99 21.03 49.56Q21.53 50.13 22.42 50.13Q22.91 50.13 23.36 49.98Q23.81 49.83 24.27 49.52Z"/><path d="M28.57 45.87Q27.81 45.87 27.4 46.43Q26.98 46.98 26.98 48Q26.98 49.01 27.4 49.57Q27.81 50.13 28.57 50.13Q29.33 50.13 29.75 49.57Q30.16 49.01 30.16 48Q30.16 46.98 29.75 46.43Q29.33 45.87 28.57 45.87ZM28.57 44.67Q30.12 44.67 30.99 45.55Q31.87 46.44 31.87 48Q31.87 49.55 30.99 50.44Q30.12 51.32 28.57 51.32Q27.03 51.32 26.15 50.44Q25.27 49.55 25.27 48Q25.27 46.44 26.15 45.55Q27.03 44.67 28.57 44.67Z"/><path d="M34.77 46.04V49.95H35.37Q36.38 49.95 36.92 49.45Q37.45 48.94 37.45 47.99Q37.45 47.03 36.92 46.53Q36.38 46.04 35.37 46.04ZM33.12 44.78H34.86Q36.32 44.78 37.04 44.99Q37.76 45.2 38.27 45.7Q38.72 46.13 38.94 46.7Q39.16 47.27 39.16 47.99Q39.16 48.71 38.94 49.28Q38.72 49.85 38.27 50.28Q37.75 50.78 37.03 50.99Q36.31 51.2 34.86 51.2H33.12Z"/><path d="M40.42 44.78H44.89V46.04H42.08V47.23H44.72V48.48H42.08V49.95H44.98V51.2H40.42Z"/></g></svg>',
23
+ 'file-css': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#3973BB" opacity=".17"/><g fill="none" stroke="#3973BB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#3973BB"/><g fill="#FFF"><path d="M27.83 50.8Q27.31 51.07 26.75 51.2Q26.19 51.34 25.58 51.34Q23.76 51.34 22.69 50.32Q21.63 49.31 21.63 47.56Q21.63 45.81 22.69 44.8Q23.76 43.78 25.58 43.78Q26.19 43.78 26.75 43.91Q27.31 44.05 27.83 44.32V45.83Q27.31 45.47 26.8 45.31Q26.29 45.14 25.73 45.14Q24.72 45.14 24.15 45.78Q23.57 46.43 23.57 47.56Q23.57 48.69 24.15 49.33Q24.72 49.98 25.73 49.98Q26.29 49.98 26.8 49.81Q27.31 49.65 27.83 49.29Z"/><path d="M34.46 44.14V45.68Q33.86 45.41 33.29 45.28Q32.72 45.14 32.21 45.14Q31.53 45.14 31.21 45.33Q30.89 45.51 30.89 45.9Q30.89 46.2 31.11 46.36Q31.32 46.52 31.9 46.64L32.7 46.8Q33.91 47.04 34.42 47.54Q34.94 48.04 34.94 48.96Q34.94 50.16 34.22 50.75Q33.51 51.34 32.04 51.34Q31.34 51.34 30.65 51.21Q29.95 51.08 29.25 50.82V49.23Q29.95 49.6 30.6 49.79Q31.25 49.98 31.86 49.98Q32.47 49.98 32.8 49.77Q33.13 49.57 33.13 49.19Q33.13 48.85 32.9 48.66Q32.68 48.48 32.02 48.33L31.29 48.17Q30.2 47.93 29.69 47.42Q29.19 46.91 29.19 46.04Q29.19 44.95 29.89 44.36Q30.59 43.78 31.91 43.78Q32.51 43.78 33.15 43.87Q33.78 43.96 34.46 44.14Z"/><path d="M41.66 44.14V45.68Q41.06 45.41 40.49 45.28Q39.92 45.14 39.41 45.14Q38.74 45.14 38.41 45.33Q38.09 45.51 38.09 45.9Q38.09 46.2 38.31 46.36Q38.53 46.52 39.1 46.64L39.9 46.8Q41.11 47.04 41.63 47.54Q42.14 48.04 42.14 48.96Q42.14 50.16 41.42 50.75Q40.71 51.34 39.24 51.34Q38.55 51.34 37.85 51.21Q37.15 51.08 36.45 50.82V49.23Q37.15 49.6 37.8 49.79Q38.45 49.98 39.06 49.98Q39.67 49.98 40 49.77Q40.33 49.57 40.33 49.19Q40.33 48.85 40.11 48.66Q39.88 48.48 39.22 48.33L38.49 48.17Q37.4 47.93 36.89 47.42Q36.39 46.91 36.39 46.04Q36.39 44.95 37.09 44.36Q37.79 43.78 39.11 43.78Q39.71 43.78 40.35 43.87Q40.98 43.96 41.66 44.14Z"/></g></svg>',
24
+ 'file-csv': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#198360" opacity=".17"/><g fill="none" stroke="#198360" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="21" width="20" height="15" rx="1.5"/><path d="M22 26h20M22 31h20M29 21v15M36 21v15"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#198360"/><g fill="#FFF"><path d="M27.56 50.8Q27.04 51.07 26.48 51.2Q25.92 51.34 25.31 51.34Q23.49 51.34 22.42 50.32Q21.36 49.31 21.36 47.56Q21.36 45.81 22.42 44.8Q23.49 43.78 25.31 43.78Q25.92 43.78 26.48 43.91Q27.04 44.05 27.56 44.32V45.83Q27.04 45.47 26.53 45.31Q26.02 45.14 25.46 45.14Q24.45 45.14 23.88 45.78Q23.3 46.43 23.3 47.56Q23.3 48.69 23.88 49.33Q24.45 49.98 25.46 49.98Q26.02 49.98 26.53 49.81Q27.04 49.65 27.56 49.29Z"/><path d="M34.19 44.14V45.68Q33.59 45.41 33.02 45.28Q32.45 45.14 31.94 45.14Q31.27 45.14 30.94 45.33Q30.62 45.51 30.62 45.9Q30.62 46.2 30.84 46.36Q31.06 46.52 31.63 46.64L32.43 46.8Q33.64 47.04 34.16 47.54Q34.67 48.04 34.67 48.96Q34.67 50.16 33.95 50.75Q33.24 51.34 31.77 51.34Q31.07 51.34 30.38 51.21Q29.68 51.08 28.98 50.82V49.23Q29.68 49.6 30.33 49.79Q30.98 49.98 31.59 49.98Q32.2 49.98 32.53 49.77Q32.86 49.57 32.86 49.19Q32.86 48.85 32.63 48.66Q32.41 48.48 31.75 48.33L31.02 48.17Q29.93 47.93 29.42 47.42Q28.92 46.91 28.92 46.04Q28.92 44.95 29.62 44.36Q30.32 43.78 31.64 43.78Q32.24 43.78 32.88 43.87Q33.51 43.96 34.19 44.14Z"/><path d="M35.45 43.91H37.34L39.27 49.29L41.2 43.91H43.09L40.39 51.2H38.15Z"/></g></svg>',
25
+ 'file-design': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m32 21 11 6-11 6-11-6zm-11 11 11 6 11-6"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M23.63 45.33V49.78H24.3Q25.46 49.78 26.06 49.21Q26.67 48.64 26.67 47.55Q26.67 46.46 26.07 45.9Q25.46 45.33 24.3 45.33ZM21.75 43.91H23.73Q25.39 43.91 26.21 44.15Q27.02 44.38 27.6 44.95Q28.11 45.44 28.36 46.09Q28.61 46.73 28.61 47.55Q28.61 48.37 28.36 49.02Q28.11 49.67 27.6 50.16Q27.01 50.73 26.19 50.96Q25.37 51.2 23.73 51.2H21.75Z"/><path d="M30.05 43.91H35.12V45.33H31.93V46.69H34.93V48.11H31.93V49.78H35.23V51.2H30.05Z"/><path d="M41.96 44.14V45.68Q41.36 45.41 40.78 45.28Q40.21 45.14 39.71 45.14Q39.03 45.14 38.71 45.33Q38.39 45.51 38.39 45.9Q38.39 46.2 38.6 46.36Q38.82 46.52 39.39 46.64L40.19 46.8Q41.41 47.04 41.92 47.54Q42.43 48.04 42.43 48.96Q42.43 50.16 41.72 50.75Q41 51.34 39.53 51.34Q38.84 51.34 38.14 51.21Q37.44 51.08 36.75 50.82V49.23Q37.44 49.6 38.1 49.79Q38.75 49.98 39.35 49.98Q39.97 49.98 40.3 49.77Q40.62 49.57 40.62 49.19Q40.62 48.85 40.4 48.66Q40.18 48.48 39.51 48.33L38.79 48.17Q37.69 47.93 37.19 47.42Q36.68 46.91 36.68 46.04Q36.68 44.95 37.39 44.36Q38.09 43.78 39.41 43.78Q40.01 43.78 40.64 43.87Q41.28 43.96 41.96 44.14Z"/></g></svg>',
26
+ 'file-document': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#3477BE" opacity=".17"/><g fill="none" stroke="#3477BE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 21h17M23 26h17M23 31h12M23 36h16"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#3477BE"/><g fill="#FFF"><path d="M22.73 45.33V49.78H23.4Q24.55 49.78 25.16 49.21Q25.77 48.64 25.77 47.55Q25.77 46.46 25.16 45.9Q24.56 45.33 23.4 45.33ZM20.85 43.91H22.83Q24.49 43.91 25.3 44.15Q26.12 44.38 26.7 44.95Q27.21 45.44 27.46 46.09Q27.71 46.73 27.71 47.55Q27.71 48.37 27.46 49.02Q27.21 49.67 26.7 50.16Q26.11 50.73 25.29 50.96Q24.47 51.2 22.83 51.2H20.85Z"/><path d="M32.48 45.14Q31.62 45.14 31.15 45.78Q30.67 46.41 30.67 47.56Q30.67 48.71 31.15 49.34Q31.62 49.98 32.48 49.98Q33.34 49.98 33.82 49.34Q34.29 48.71 34.29 47.56Q34.29 46.41 33.82 45.78Q33.34 45.14 32.48 45.14ZM32.48 43.78Q34.24 43.78 35.23 44.78Q36.23 45.79 36.23 47.56Q36.23 49.33 35.23 50.34Q34.24 51.34 32.48 51.34Q30.73 51.34 29.73 50.34Q28.73 49.33 28.73 47.56Q28.73 45.79 29.73 44.78Q30.73 43.78 32.48 43.78Z"/><path d="M43.43 50.8Q42.91 51.07 42.35 51.2Q41.79 51.34 41.18 51.34Q39.36 51.34 38.29 50.32Q37.23 49.31 37.23 47.56Q37.23 45.81 38.29 44.8Q39.36 43.78 41.18 43.78Q41.79 43.78 42.35 43.91Q42.91 44.05 43.43 44.32V45.83Q42.91 45.47 42.4 45.31Q41.89 45.14 41.33 45.14Q40.33 45.14 39.75 45.78Q39.17 46.43 39.17 47.56Q39.17 48.69 39.75 49.33Q40.33 49.98 41.33 49.98Q41.89 49.98 42.4 49.81Q42.91 49.65 43.43 49.29Z"/></g></svg>',
27
+ 'file-figma': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="28" cy="24" r="3"/><circle cx="35" cy="24" r="3"/><circle cx="28" cy="31" r="3"/><circle cx="35" cy="31" r="3"/><circle cx="28" cy="38" r="3"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M23.54 43.91H28.61V45.33H25.42V46.69H28.42V48.11H25.42V51.2H23.54Z"/><path d="M30.37 43.91H32.25V51.2H30.37Z"/><path d="M40.64 50.66Q39.94 51 39.18 51.17Q38.43 51.34 37.62 51.34Q35.8 51.34 34.73 50.32Q33.67 49.31 33.67 47.56Q33.67 45.8 34.75 44.79Q35.84 43.78 37.72 43.78Q38.45 43.78 39.12 43.91Q39.78 44.05 40.37 44.32V45.83Q39.76 45.48 39.16 45.31Q38.56 45.14 37.95 45.14Q36.83 45.14 36.22 45.77Q35.61 46.4 35.61 47.56Q35.61 48.72 36.2 49.35Q36.79 49.98 37.86 49.98Q38.16 49.98 38.41 49.94Q38.66 49.91 38.86 49.83V48.41H37.71V47.15H40.64Z"/></g></svg>',
28
+ 'file-font': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#5E7186" opacity=".17"/><g fill="none" stroke="#5E7186" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m24 37 8-16 8 16m-13-6h10"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#5E7186"/><g fill="#FFF"><path d="M19.38 44.78H23.84V46.04H21.03V47.23H23.67V48.48H21.03V51.2H19.38Z"/><path d="M28.32 45.87Q27.56 45.87 27.15 46.43Q26.73 46.98 26.73 48Q26.73 49.01 27.15 49.57Q27.56 50.13 28.32 50.13Q29.08 50.13 29.5 49.57Q29.91 49.01 29.91 48Q29.91 46.98 29.5 46.43Q29.08 45.87 28.32 45.87ZM28.32 44.67Q29.87 44.67 30.74 45.55Q31.62 46.44 31.62 48Q31.62 49.55 30.74 50.44Q29.87 51.32 28.32 51.32Q26.78 51.32 25.9 50.44Q25.02 49.55 25.02 48Q25.02 46.44 25.9 45.55Q26.78 44.67 28.32 44.67Z"/><path d="M32.87 44.78H34.72L37.05 49.18V44.78H38.62V51.2H36.77L34.44 46.8V51.2H32.87Z"/><path d="M39.47 44.78H45.38V46.04H43.26V51.2H41.6V46.04H39.47Z"/></g></svg>',
29
+ 'file-generic': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#61758F" opacity=".17"/><g fill="none" stroke="#61758F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 23h18M23 28h18M23 33h11"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#61758F"/><g fill="#FFF"><path d="M22.36 44.78H26.82V46.04H24.01V47.23H26.65V48.48H24.01V51.2H22.36Z"/><path d="M28.37 44.78H30.02V51.2H28.37Z"/><path d="M31.64 44.78H33.3V49.95H36.2V51.2H31.64Z"/><path d="M37.25 44.78H41.71V46.04H38.9V47.23H41.55V48.48H38.9V49.95H41.81V51.2H37.25Z"/></g></svg>',
30
+ 'file-gif': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M30.09 50.66Q29.39 51 28.63 51.17Q27.87 51.34 27.07 51.34Q25.25 51.34 24.18 50.32Q23.12 49.31 23.12 47.56Q23.12 45.8 24.2 44.79Q25.29 43.78 27.17 43.78Q27.9 43.78 28.56 43.91Q29.23 44.05 29.82 44.32V45.83Q29.21 45.48 28.61 45.31Q28.01 45.14 27.4 45.14Q26.28 45.14 25.67 45.77Q25.06 46.4 25.06 47.56Q25.06 48.72 25.65 49.35Q26.23 49.98 27.31 49.98Q27.61 49.98 27.86 49.94Q28.11 49.91 28.31 49.83V48.41H27.16V47.15H30.09Z"/><path d="M31.75 43.91H33.63V51.2H31.75Z"/><path d="M35.47 43.91H40.54V45.33H37.35V46.69H40.35V48.11H37.35V51.2H35.47Z"/></g></svg>',
31
+ 'file-html': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B35A32" opacity=".17"/><g fill="none" stroke="#B35A32" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B35A32"/><g fill="#FFF"><path d="M18.94 44.78H20.6V47.23H23.04V44.78H24.69V51.2H23.04V48.48H20.6V51.2H18.94Z"/><path d="M25.54 44.78H31.45V46.04H29.33V51.2H27.67V46.04H25.54Z"/><path d="M32.31 44.78H34.41L35.88 48.22L37.35 44.78H39.45V51.2H37.88V46.51L36.4 49.97H35.36L33.88 46.51V51.2H32.31Z"/><path d="M41.07 44.78H42.72V49.95H45.63V51.2H41.07Z"/></g></svg>',
32
+ 'file-image': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M21.98 43.91H23.86V51.2H21.98Z"/><path d="M25.7 43.91H28.09L29.75 47.81L31.42 43.91H33.81V51.2H32.03V45.87L30.35 49.8H29.16L27.48 45.87V51.2H25.7Z"/><path d="M42.2 50.66Q41.5 51 40.74 51.17Q39.99 51.34 39.18 51.34Q37.36 51.34 36.29 50.32Q35.23 49.31 35.23 47.56Q35.23 45.8 36.31 44.79Q37.4 43.78 39.28 43.78Q40.01 43.78 40.68 43.91Q41.34 44.05 41.93 44.32V45.83Q41.32 45.48 40.72 45.31Q40.12 45.14 39.51 45.14Q38.39 45.14 37.78 45.77Q37.17 46.4 37.17 47.56Q37.17 48.72 37.76 49.35Q38.35 49.98 39.42 49.98Q39.72 49.98 39.97 49.94Q40.22 49.91 40.42 49.83V48.41H39.27V47.15H42.2Z"/></g></svg>',
33
+ 'file-jpg': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M23.29 43.91H25.17V50.49Q25.17 51.85 24.43 52.53Q23.69 53.2 22.19 53.2H21.81V51.78H22.1Q22.69 51.78 22.99 51.45Q23.29 51.13 23.29 50.49Z"/><path d="M27.01 43.91H30.13Q31.52 43.91 32.27 44.53Q33.01 45.15 33.01 46.29Q33.01 47.44 32.27 48.05Q31.52 48.67 30.13 48.67H28.89V51.2H27.01ZM28.89 45.27V47.31H29.93Q30.48 47.31 30.77 47.04Q31.07 46.78 31.07 46.29Q31.07 45.8 30.77 45.54Q30.48 45.27 29.93 45.27Z"/><path d="M40.89 50.66Q40.19 51 39.43 51.17Q38.67 51.34 37.87 51.34Q36.05 51.34 34.98 50.32Q33.92 49.31 33.92 47.56Q33.92 45.8 35 44.79Q36.09 43.78 37.97 43.78Q38.7 43.78 39.37 43.91Q40.03 44.05 40.62 44.32V45.83Q40.01 45.48 39.41 45.31Q38.81 45.14 38.2 45.14Q37.08 45.14 36.47 45.77Q35.86 46.4 35.86 47.56Q35.86 48.72 36.45 49.35Q37.03 49.98 38.11 49.98Q38.41 49.98 38.66 49.94Q38.91 49.91 39.11 49.83V48.41H37.96V47.15H40.89Z"/></g></svg>',
34
+ 'file-js': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#92731D" opacity=".17"/><g fill="none" stroke="#92731D" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#92731D"/><g fill="#FFF"><path d="M27.46 43.91H29.34V50.49Q29.34 51.85 28.6 52.53Q27.86 53.2 26.36 53.2H25.98V51.78H26.27Q26.86 51.78 27.16 51.45Q27.46 51.13 27.46 50.49Z"/><path d="M36.25 44.14V45.68Q35.65 45.41 35.08 45.28Q34.51 45.14 34 45.14Q33.33 45.14 33 45.33Q32.68 45.51 32.68 45.9Q32.68 46.2 32.9 46.36Q33.12 46.52 33.69 46.64L34.49 46.8Q35.7 47.04 36.22 47.54Q36.73 48.04 36.73 48.96Q36.73 50.16 36.01 50.75Q35.3 51.34 33.83 51.34Q33.14 51.34 32.44 51.21Q31.74 51.08 31.04 50.82V49.23Q31.74 49.6 32.39 49.79Q33.04 49.98 33.65 49.98Q34.26 49.98 34.59 49.77Q34.92 49.57 34.92 49.19Q34.92 48.85 34.7 48.66Q34.47 48.48 33.81 48.33L33.08 48.17Q31.99 47.93 31.48 47.42Q30.98 46.91 30.98 46.04Q30.98 44.95 31.68 44.36Q32.38 43.78 33.7 43.78Q34.3 43.78 34.94 43.87Q35.57 43.96 36.25 44.14Z"/></g></svg>',
35
+ 'file-json': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M27 21c-3 0-3 2-3 4v2c0 2-1 2-3 2 2 0 3 1 3 3v2c0 3 0 4 3 4m10-17c3 0 3 2 3 4v2c0 2 1 2 3 2-2 0-3 1-3 3v2c0 3 0 4-3 4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M20.58 44.78H22.23V50.58Q22.23 51.78 21.58 52.37Q20.93 52.96 19.61 52.96H19.28V51.71H19.53Q20.05 51.71 20.31 51.42Q20.58 51.14 20.58 50.58Z"/><path d="M28.32 44.99V46.34Q27.79 46.11 27.29 45.99Q26.78 45.87 26.34 45.87Q25.74 45.87 25.46 46.03Q25.18 46.19 25.18 46.54Q25.18 46.8 25.37 46.94Q25.56 47.08 26.06 47.19L26.77 47.33Q27.84 47.54 28.29 47.98Q28.74 48.42 28.74 49.23Q28.74 50.29 28.11 50.81Q27.48 51.32 26.19 51.32Q25.58 51.32 24.96 51.21Q24.35 51.09 23.73 50.86V49.47Q24.35 49.79 24.92 49.96Q25.49 50.13 26.03 50.13Q26.57 50.13 26.86 49.95Q27.14 49.76 27.14 49.43Q27.14 49.13 26.95 48.97Q26.75 48.8 26.17 48.67L25.53 48.53Q24.57 48.33 24.12 47.87Q23.68 47.42 23.68 46.66Q23.68 45.7 24.3 45.18Q24.91 44.67 26.07 44.67Q26.6 44.67 27.16 44.75Q27.72 44.83 28.32 44.99Z"/><path d="M33.12 45.87Q32.37 45.87 31.95 46.43Q31.53 46.98 31.53 48Q31.53 49.01 31.95 49.57Q32.37 50.13 33.12 50.13Q33.88 50.13 34.3 49.57Q34.72 49.01 34.72 48Q34.72 46.98 34.3 46.43Q33.88 45.87 33.12 45.87ZM33.12 44.67Q34.67 44.67 35.54 45.55Q36.42 46.44 36.42 48Q36.42 49.55 35.54 50.44Q34.67 51.32 33.12 51.32Q31.58 51.32 30.7 50.44Q29.82 49.55 29.82 48Q29.82 46.44 30.7 45.55Q31.58 44.67 33.12 44.67Z"/><path d="M37.67 44.78H39.52L41.85 49.18V44.78H43.42V51.2H41.57L39.24 46.8V51.2H37.67Z"/></g></svg>',
36
+ 'file-markdown': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#3477BE" opacity=".17"/><g fill="none" stroke="#3477BE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 23v12m0-12 5 7 5-7v12m5-11v10m0 0 4-4m-4 4-4-4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#3477BE"/><g fill="#FFF"><path d="M23.79 43.91H26.18L27.84 47.81L29.51 43.91H31.9V51.2H30.12V45.87L28.45 49.8H27.25L25.57 45.87V51.2H23.79Z"/><path d="M35.62 45.33V49.78H36.3Q37.45 49.78 38.06 49.21Q38.67 48.64 38.67 47.55Q38.67 46.46 38.06 45.9Q37.45 45.33 36.3 45.33ZM33.74 43.91H35.73Q37.39 43.91 38.2 44.15Q39.01 44.38 39.59 44.95Q40.11 45.44 40.35 46.09Q40.6 46.73 40.6 47.55Q40.6 48.37 40.35 49.02Q40.11 49.67 39.59 50.16Q39.01 50.73 38.19 50.96Q37.37 51.2 35.73 51.2H33.74Z"/></g></svg>',
37
+ 'file-mov': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B74068" opacity=".17"/><g fill="none" stroke="#B74068" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="3"/><path d="m29 25 8 4-8 4z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B74068"/><g fill="#FFF"><path d="M19.82 43.91H22.21L23.88 47.81L25.54 43.91H27.93V51.2H26.16V45.87L24.48 49.8H23.28L21.6 45.87V51.2H19.82Z"/><path d="M33.1 45.14Q32.24 45.14 31.77 45.78Q31.3 46.41 31.3 47.56Q31.3 48.71 31.77 49.34Q32.24 49.98 33.1 49.98Q33.97 49.98 34.44 49.34Q34.92 48.71 34.92 47.56Q34.92 46.41 34.44 45.78Q33.97 45.14 33.1 45.14ZM33.1 43.78Q34.86 43.78 35.86 44.78Q36.85 45.79 36.85 47.56Q36.85 49.33 35.86 50.34Q34.86 51.34 33.1 51.34Q31.35 51.34 30.35 50.34Q29.35 49.33 29.35 47.56Q29.35 45.79 30.35 44.78Q31.35 43.78 33.1 43.78Z"/><path d="M37.41 43.91H39.29L41.23 49.29L43.16 43.91H45.05L42.35 51.2H40.11Z"/></g></svg>',
38
+ 'file-mp3': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B84C89" opacity=".17"/><g fill="none" stroke="#B84C89" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M31 22v12m0-10 10-3v11M26 36c-3 0-4-3-1-4 2-1 6-1 6 1s-2 3-5 3zm10-2c-3 0-4-3-1-4 2-1 6-1 6 1s-2 3-5 3z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B84C89"/><g fill="#FFF"><path d="M20.8 43.91H23.19L24.85 47.81L26.52 43.91H28.91V51.2H27.13V45.87L25.45 49.8H24.26L22.58 45.87V51.2H20.8Z"/><path d="M30.75 43.91H33.87Q35.26 43.91 36.01 44.53Q36.75 45.15 36.75 46.29Q36.75 47.44 36.01 48.05Q35.26 48.67 33.87 48.67H32.63V51.2H30.75ZM32.63 45.27V47.31H33.67Q34.22 47.31 34.51 47.04Q34.81 46.78 34.81 46.29Q34.81 45.8 34.51 45.54Q34.22 45.27 33.67 45.27Z"/><path d="M41.82 47.27Q42.56 47.46 42.94 47.93Q43.32 48.4 43.32 49.13Q43.32 50.21 42.49 50.78Q41.66 51.34 40.07 51.34Q39.51 51.34 38.95 51.25Q38.38 51.16 37.83 50.98V49.53Q38.36 49.79 38.88 49.93Q39.4 50.06 39.9 50.06Q40.65 50.06 41.05 49.8Q41.44 49.54 41.44 49.06Q41.44 48.56 41.04 48.31Q40.63 48.05 39.83 48.05H39.08V46.84H39.87Q40.58 46.84 40.93 46.62Q41.27 46.4 41.27 45.94Q41.27 45.52 40.94 45.29Q40.6 45.06 39.98 45.06Q39.53 45.06 39.07 45.16Q38.6 45.27 38.14 45.47V44.09Q38.7 43.93 39.25 43.86Q39.79 43.78 40.32 43.78Q41.74 43.78 42.45 44.24Q43.15 44.71 43.15 45.65Q43.15 46.29 42.82 46.7Q42.48 47.1 41.82 47.27Z"/></g></svg>',
39
+ 'file-mp4': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B74068" opacity=".17"/><g fill="none" stroke="#B74068" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="3"/><path d="m29 25 8 4-8 4z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B74068"/><g fill="#FFF"><path d="M20.8 43.91H23.19L24.85 47.81L26.52 43.91H28.91V51.2H27.13V45.87L25.45 49.8H24.26L22.58 45.87V51.2H20.8Z"/><path d="M30.75 43.91H33.87Q35.26 43.91 36.01 44.53Q36.75 45.15 36.75 46.29Q36.75 47.44 36.01 48.05Q35.26 48.67 33.87 48.67H32.63V51.2H30.75ZM32.63 45.27V47.31H33.67Q34.22 47.31 34.51 47.04Q34.81 46.78 34.81 46.29Q34.81 45.8 34.51 45.54Q34.22 45.27 33.67 45.27Z"/><path d="M40.84 45.46 38.78 48.51H40.84ZM40.53 43.91H42.62V48.51H43.66V49.87H42.62V51.2H40.84V49.87H37.61V48.26Z"/></g></svg>',
40
+ 'file-pdf': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#C7494A" opacity=".17"/><g fill="none" stroke="#C7494A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m26 35 6-15 6 15m-10-5h8"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#C7494A"/><g fill="#FFF"><path d="M21.69 43.91H24.81Q26.2 43.91 26.94 44.53Q27.69 45.15 27.69 46.29Q27.69 47.44 26.94 48.05Q26.2 48.67 24.81 48.67H23.57V51.2H21.69ZM23.57 45.27V47.31H24.61Q25.15 47.31 25.45 47.04Q25.75 46.78 25.75 46.29Q25.75 45.8 25.45 45.54Q25.15 45.27 24.61 45.27Z"/><path d="M30.9 45.33V49.78H31.57Q32.72 49.78 33.33 49.21Q33.94 48.64 33.94 47.55Q33.94 46.46 33.33 45.9Q32.73 45.33 31.57 45.33ZM29.02 43.91H31Q32.66 43.91 33.47 44.15Q34.29 44.38 34.87 44.95Q35.38 45.44 35.63 46.09Q35.88 46.73 35.88 47.55Q35.88 48.37 35.63 49.02Q35.38 49.67 34.87 50.16Q34.28 50.73 33.46 50.96Q32.64 51.2 31 51.2H29.02Z"/><path d="M37.32 43.91H42.39V45.33H39.2V46.69H42.2V48.11H39.2V51.2H37.32Z"/></g></svg>',
41
+ 'file-png': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M20.96 43.91H24.08Q25.48 43.91 26.22 44.53Q26.97 45.15 26.97 46.29Q26.97 47.44 26.22 48.05Q25.48 48.67 24.08 48.67H22.84V51.2H20.96ZM22.84 45.27V47.31H23.88Q24.43 47.31 24.73 47.04Q25.03 46.78 25.03 46.29Q25.03 45.8 24.73 45.54Q24.43 45.27 23.88 45.27Z"/><path d="M28.29 43.91H30.39L33.04 48.91V43.91H34.83V51.2H32.73L30.08 46.2V51.2H28.29Z"/><path d="M43.22 50.66Q42.51 51 41.76 51.17Q41 51.34 40.19 51.34Q38.37 51.34 37.31 50.32Q36.24 49.31 36.24 47.56Q36.24 45.8 37.33 44.79Q38.41 43.78 40.3 43.78Q41.02 43.78 41.69 43.91Q42.36 44.05 42.95 44.32V45.83Q42.34 45.48 41.73 45.31Q41.13 45.14 40.53 45.14Q39.4 45.14 38.79 45.77Q38.19 46.4 38.19 47.56Q38.19 48.72 38.77 49.35Q39.36 49.98 40.44 49.98Q40.73 49.98 40.98 49.94Q41.23 49.91 41.43 49.83V48.41H40.29V47.15H43.22Z"/></g></svg>',
42
+ 'file-presentation': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#BA622F" opacity=".17"/><g fill="none" stroke="#BA622F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="14" rx="2"/><path d="m29 24 7 4-7 4zM32 35v3m-6 0h12"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#BA622F"/><g fill="#FFF"><path d="M22.18 43.91H25.3Q26.69 43.91 27.43 44.53Q28.18 45.15 28.18 46.29Q28.18 47.44 27.43 48.05Q26.69 48.67 25.3 48.67H24.06V51.2H22.18ZM24.06 45.27V47.31H25.1Q25.65 47.31 25.94 47.04Q26.24 46.78 26.24 46.29Q26.24 45.8 25.94 45.54Q25.65 45.27 25.1 45.27Z"/><path d="M29.51 43.91H32.63Q34.02 43.91 34.76 44.53Q35.51 45.15 35.51 46.29Q35.51 47.44 34.76 48.05Q34.02 48.67 32.63 48.67H31.39V51.2H29.51ZM31.39 45.27V47.31H32.43Q32.97 47.31 33.27 47.04Q33.57 46.78 33.57 46.29Q33.57 45.8 33.27 45.54Q32.97 45.27 32.43 45.27Z"/><path d="M35.97 43.91H42.69V45.33H40.27V51.2H38.39V45.33H35.97Z"/></g></svg>',
43
+ 'file-psd': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m32 21 11 6-11 6-11-6zm-11 11 11 6 11-6"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M21.5 43.91H24.62Q26.01 43.91 26.76 44.53Q27.5 45.15 27.5 46.29Q27.5 47.44 26.76 48.05Q26.01 48.67 24.62 48.67H23.38V51.2H21.5ZM23.38 45.27V47.31H24.42Q24.97 47.31 25.27 47.04Q25.56 46.78 25.56 46.29Q25.56 45.8 25.27 45.54Q24.97 45.27 24.42 45.27Z"/><path d="M33.9 44.14V45.68Q33.3 45.41 32.73 45.28Q32.16 45.14 31.65 45.14Q30.98 45.14 30.66 45.33Q30.33 45.51 30.33 45.9Q30.33 46.2 30.55 46.36Q30.77 46.52 31.34 46.64L32.14 46.8Q33.36 47.04 33.87 47.54Q34.38 48.04 34.38 48.96Q34.38 50.16 33.67 50.75Q32.95 51.34 31.48 51.34Q30.79 51.34 30.09 51.21Q29.39 51.08 28.69 50.82V49.23Q29.39 49.6 30.04 49.79Q30.7 49.98 31.3 49.98Q31.92 49.98 32.24 49.77Q32.57 49.57 32.57 49.19Q32.57 48.85 32.35 48.66Q32.13 48.48 31.46 48.33L30.74 48.17Q29.64 47.93 29.14 47.42Q28.63 46.91 28.63 46.04Q28.63 44.95 29.33 44.36Q30.04 43.78 31.36 43.78Q31.96 43.78 32.59 43.87Q33.23 43.96 33.9 44.14Z"/><path d="M37.91 45.33V49.78H38.59Q39.74 49.78 40.35 49.21Q40.96 48.64 40.96 47.55Q40.96 46.46 40.35 45.9Q39.74 45.33 38.59 45.33ZM36.03 43.91H38.02Q39.68 43.91 40.49 44.15Q41.3 44.38 41.88 44.95Q42.4 45.44 42.64 46.09Q42.89 46.73 42.89 47.55Q42.89 48.37 42.64 49.02Q42.4 49.67 41.88 50.16Q41.3 50.73 40.48 50.96Q39.66 51.2 38.02 51.2H36.03Z"/></g></svg>',
44
+ 'file-python': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M27 21c-3 0-3 2-3 4v2c0 2-1 2-3 2 2 0 3 1 3 3v2c0 3 0 4 3 4m10-17c3 0 3 2 3 4v2c0 2 1 2 3 2-2 0-3 1-3 3v2c0 3 0 4-3 4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M25.63 43.91H28.75Q30.14 43.91 30.89 44.53Q31.63 45.15 31.63 46.29Q31.63 47.44 30.89 48.05Q30.14 48.67 28.75 48.67H27.51V51.2H25.63ZM27.51 45.27V47.31H28.55Q29.1 47.31 29.4 47.04Q29.7 46.78 29.7 46.29Q29.7 45.8 29.4 45.54Q29.1 45.27 28.55 45.27Z"/><path d="M31.95 43.91H34L35.66 46.51L37.32 43.91H39.38L36.6 48.13V51.2H34.72V48.13Z"/></g></svg>',
45
+ 'file-rar': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M24.02 47.14Q24.61 47.14 24.87 46.92Q25.12 46.7 25.12 46.2Q25.12 45.7 24.87 45.49Q24.61 45.27 24.02 45.27H23.23V47.14ZM23.23 48.44V51.2H21.35V43.91H24.22Q25.66 43.91 26.33 44.39Q27 44.88 27 45.92Q27 46.64 26.65 47.11Q26.3 47.57 25.6 47.79Q25.99 47.88 26.29 48.19Q26.6 48.5 26.91 49.13L27.93 51.2H25.93L25.04 49.39Q24.77 48.84 24.5 48.64Q24.22 48.44 23.76 48.44Z"/><path d="M33.47 49.87H30.53L30.07 51.2H28.18L30.88 43.91H33.12L35.82 51.2H33.93ZM31 48.52H33L32 45.62Z"/><path d="M39.46 47.14Q40.05 47.14 40.31 46.92Q40.56 46.7 40.56 46.2Q40.56 45.7 40.31 45.49Q40.05 45.27 39.46 45.27H38.67V47.14ZM38.67 48.44V51.2H36.79V43.91H39.66Q41.1 43.91 41.77 44.39Q42.44 44.88 42.44 45.92Q42.44 46.64 42.09 47.11Q41.74 47.57 41.04 47.79Q41.43 47.88 41.73 48.19Q42.04 48.5 42.35 49.13L43.37 51.2H41.37L40.48 49.39Q40.21 48.84 39.93 48.64Q39.66 48.44 39.2 48.44Z"/></g></svg>',
46
+ 'file-spreadsheet': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#198360" opacity=".17"/><g fill="none" stroke="#198360" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="21" width="20" height="15" rx="1.5"/><path d="M22 26h20M22 31h20M29 21v15M36 21v15"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#198360"/><g fill="#FFF"><path d="M26.34 47.48 28.87 51.2H26.91L25.21 48.71L23.52 51.2H21.55L24.08 47.48L21.65 43.91H23.61L25.21 46.26L26.8 43.91H28.77Z"/><path d="M29.99 43.91H31.87V49.78H35.17V51.2H29.99Z"/><path d="M41.43 44.14V45.68Q40.83 45.41 40.26 45.28Q39.69 45.14 39.18 45.14Q38.51 45.14 38.18 45.33Q37.86 45.51 37.86 45.9Q37.86 46.2 38.08 46.36Q38.3 46.52 38.87 46.64L39.67 46.8Q40.88 47.04 41.4 47.54Q41.91 48.04 41.91 48.96Q41.91 50.16 41.19 50.75Q40.48 51.34 39.01 51.34Q38.32 51.34 37.62 51.21Q36.92 51.08 36.22 50.82V49.23Q36.92 49.6 37.57 49.79Q38.22 49.98 38.83 49.98Q39.44 49.98 39.77 49.77Q40.1 49.57 40.1 49.19Q40.1 48.85 39.88 48.66Q39.65 48.48 38.99 48.33L38.26 48.17Q37.17 47.93 36.66 47.42Q36.16 46.91 36.16 46.04Q36.16 44.95 36.86 44.36Q37.56 43.78 38.88 43.78Q39.48 43.78 40.12 43.87Q40.75 43.96 41.43 44.14Z"/></g></svg>',
47
+ 'file-sql': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#397994" opacity=".17"/><g fill="none" stroke="#397994" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="32" cy="23" rx="10" ry="3.5"/><path d="M22 23v11c0 5 20 5 20 0V23m-20 6c0 5 20 5 20 0"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#397994"/><g fill="#FFF"><path d="M26.95 44.14V45.68Q26.35 45.41 25.78 45.28Q25.21 45.14 24.7 45.14Q24.03 45.14 23.71 45.33Q23.38 45.51 23.38 45.9Q23.38 46.2 23.6 46.36Q23.82 46.52 24.39 46.64L25.19 46.8Q26.41 47.04 26.92 47.54Q27.43 48.04 27.43 48.96Q27.43 50.16 26.72 50.75Q26 51.34 24.53 51.34Q23.84 51.34 23.14 51.21Q22.44 51.08 21.74 50.82V49.23Q22.44 49.6 23.09 49.79Q23.75 49.98 24.35 49.98Q24.97 49.98 25.29 49.77Q25.62 49.57 25.62 49.19Q25.62 48.85 25.4 48.66Q25.18 48.48 24.51 48.33L23.78 48.17Q22.69 47.93 22.19 47.42Q21.68 46.91 21.68 46.04Q21.68 44.95 22.38 44.36Q23.09 43.78 24.4 43.78Q25.01 43.78 25.64 43.87Q26.27 43.96 26.95 44.14Z"/><path d="M32.61 51.33H32.47Q30.66 51.33 29.66 50.34Q28.66 49.34 28.66 47.56Q28.66 45.79 29.66 44.78Q30.66 43.78 32.41 43.78Q34.19 43.78 35.17 44.77Q36.16 45.77 36.16 47.56Q36.16 48.79 35.64 49.68Q35.11 50.57 34.13 51.02L35.6 52.66H33.8ZM32.41 45.14Q31.55 45.14 31.08 45.78Q30.61 46.41 30.61 47.56Q30.61 48.73 31.07 49.36Q31.53 49.98 32.41 49.98Q33.28 49.98 33.75 49.34Q34.22 48.71 34.22 47.56Q34.22 46.41 33.75 45.78Q33.28 45.14 32.41 45.14Z"/><path d="M37.58 43.91H39.46V49.78H42.76V51.2H37.58Z"/></g></svg>',
48
+ 'file-svg': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 35c4-13 14-13 18 0M24 35h16"/><rect x="20" y="32" width="5" height="5" rx=".8"/><rect x="39" y="32" width="5" height="5" rx=".8"/><circle cx="32" cy="24" r="2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M26.42 44.14V45.68Q25.82 45.41 25.24 45.28Q24.67 45.14 24.17 45.14Q23.49 45.14 23.17 45.33Q22.85 45.51 22.85 45.9Q22.85 46.2 23.06 46.36Q23.28 46.52 23.85 46.64L24.65 46.8Q25.87 47.04 26.38 47.54Q26.9 48.04 26.9 48.96Q26.9 50.16 26.18 50.75Q25.46 51.34 23.99 51.34Q23.3 51.34 22.6 51.21Q21.9 51.08 21.21 50.82V49.23Q21.9 49.6 22.56 49.79Q23.21 49.98 23.81 49.98Q24.43 49.98 24.76 49.77Q25.08 49.57 25.08 49.19Q25.08 48.85 24.86 48.66Q24.64 48.48 23.98 48.33L23.25 48.17Q22.15 47.93 21.65 47.42Q21.14 46.91 21.14 46.04Q21.14 44.95 21.85 44.36Q22.55 43.78 23.87 43.78Q24.47 43.78 25.1 43.87Q25.74 43.96 26.42 44.14Z"/><path d="M27.68 43.91H29.57L31.5 49.29L33.43 43.91H35.32L32.62 51.2H30.38Z"/><path d="M42.84 50.66Q42.13 51 41.38 51.17Q40.62 51.34 39.81 51.34Q37.99 51.34 36.93 50.32Q35.86 49.31 35.86 47.56Q35.86 45.8 36.95 44.79Q38.03 43.78 39.92 43.78Q40.65 43.78 41.31 43.91Q41.98 44.05 42.57 44.32V45.83Q41.96 45.48 41.36 45.31Q40.75 45.14 40.15 45.14Q39.02 45.14 38.42 45.77Q37.81 46.4 37.81 47.56Q37.81 48.72 38.39 49.35Q38.98 49.98 40.06 49.98Q40.35 49.98 40.6 49.94Q40.85 49.91 41.06 49.83V48.41H39.91V47.15H42.84Z"/></g></svg>',
49
+ 'file-tar': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M20.92 43.91H27.64V45.33H25.22V51.2H23.34V45.33H20.92Z"/><path d="M33.03 49.87H30.09L29.63 51.2H27.74L30.44 43.91H32.68L35.38 51.2H33.49ZM30.56 48.52H32.56L31.56 45.62Z"/><path d="M39.02 47.14Q39.61 47.14 39.87 46.92Q40.12 46.7 40.12 46.2Q40.12 45.7 39.87 45.49Q39.61 45.27 39.02 45.27H38.23V47.14ZM38.23 48.44V51.2H36.35V43.91H39.22Q40.66 43.91 41.33 44.39Q42 44.88 42 45.92Q42 46.64 41.65 47.11Q41.3 47.57 40.6 47.79Q40.99 47.88 41.29 48.19Q41.6 48.5 41.91 49.13L42.93 51.2H40.93L40.04 49.39Q39.77 48.84 39.5 48.64Q39.22 48.44 38.76 48.44Z"/></g></svg>',
50
+ 'file-text': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#61758F" opacity=".17"/><g fill="none" stroke="#61758F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 21h17M23 26h17M23 31h12M23 36h16"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#61758F"/><g fill="#FFF"><path d="M21.37 43.91H28.09V45.33H25.67V51.2H23.79V45.33H21.37Z"/><path d="M33.13 47.48 35.65 51.2H33.7L31.99 48.71L30.3 51.2H28.34L30.86 47.48L28.43 43.91H30.4L31.99 46.26L33.58 43.91H35.56Z"/><path d="M35.9 43.91H42.62V45.33H40.21V51.2H38.33V45.33H35.9Z"/></g></svg>',
51
+ 'file-ts': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M25.04 43.91H31.76V45.33H29.34V51.2H27.46V45.33H25.04Z"/><path d="M37.8 44.14V45.68Q37.2 45.41 36.63 45.28Q36.06 45.14 35.55 45.14Q34.88 45.14 34.55 45.33Q34.23 45.51 34.23 45.9Q34.23 46.2 34.45 46.36Q34.67 46.52 35.24 46.64L36.04 46.8Q37.25 47.04 37.77 47.54Q38.28 48.04 38.28 48.96Q38.28 50.16 37.56 50.75Q36.85 51.34 35.38 51.34Q34.69 51.34 33.99 51.21Q33.29 51.08 32.59 50.82V49.23Q33.29 49.6 33.94 49.79Q34.59 49.98 35.2 49.98Q35.81 49.98 36.14 49.77Q36.47 49.57 36.47 49.19Q36.47 48.85 36.25 48.66Q36.02 48.48 35.36 48.33L34.63 48.17Q33.54 47.93 33.03 47.42Q32.53 46.91 32.53 46.04Q32.53 44.95 33.23 44.36Q33.93 43.78 35.25 43.78Q35.85 43.78 36.49 43.87Q37.12 43.96 37.8 44.14Z"/></g></svg>',
52
+ 'file-video': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B74068" opacity=".17"/><g fill="none" stroke="#B74068" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="3"/><path d="m29 25 8 4-8 4z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B74068"/><g fill="#FFF"><path d="M22.17 43.91H24.06L25.99 49.29L27.92 43.91H29.81L27.11 51.2H24.87Z"/><path d="M30.78 43.91H32.66V51.2H30.78Z"/><path d="M36.38 45.33V49.78H37.05Q38.2 49.78 38.81 49.21Q39.42 48.64 39.42 47.55Q39.42 46.46 38.81 45.9Q38.21 45.33 37.05 45.33ZM34.5 43.91H36.48Q38.14 43.91 38.95 44.15Q39.77 44.38 40.35 44.95Q40.86 45.44 41.11 46.09Q41.36 46.73 41.36 47.55Q41.36 48.37 41.11 49.02Q40.86 49.67 40.35 50.16Q39.76 50.73 38.94 50.96Q38.12 51.2 36.48 51.2H34.5Z"/></g></svg>',
53
+ 'file-wav': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B84C89" opacity=".17"/><g fill="none" stroke="#B84C89" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 30v-4m4 9V22m4 15V21m4 12v-7m4 9V23m4 7v-5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B84C89"/><g fill="#FFF"><path d="M19.04 43.91H20.85L22.1 49.21L23.35 43.91H25.17L26.42 49.21L27.68 43.91H29.46L27.74 51.2H25.58L24.25 45.66L22.94 51.2H20.78Z"/><path d="M35.12 49.87H32.18L31.71 51.2H29.82L32.52 43.91H34.77L37.47 51.2H35.58ZM32.65 48.52H34.64L33.65 45.62Z"/><path d="M37.56 43.91H39.45L41.39 49.29L43.32 43.91H45.21L42.51 51.2H40.26Z"/></g></svg>',
54
+ 'file-webp': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M17.82 44.78H19.41L20.52 49.45L21.62 44.78H23.21L24.31 49.45L25.42 44.78H26.99L25.48 51.2H23.57L22.41 46.32L21.26 51.2H19.35Z"/><path d="M28.08 44.78H32.54V46.04H29.73V47.23H32.37V48.48H29.73V49.95H32.64V51.2H28.08Z"/><path d="M36.66 47.27Q37.05 47.27 37.25 47.1Q37.45 46.92 37.45 46.59Q37.45 46.26 37.25 46.08Q37.05 45.91 36.66 45.91H35.74V47.27ZM36.71 50.07Q37.21 50.07 37.46 49.86Q37.71 49.65 37.71 49.23Q37.71 48.81 37.47 48.6Q37.22 48.39 36.71 48.39H35.74V50.07ZM38.25 47.77Q38.78 47.92 39.08 48.34Q39.37 48.76 39.37 49.36Q39.37 50.29 38.74 50.74Q38.11 51.2 36.83 51.2H34.09V44.78H36.57Q37.91 44.78 38.51 45.19Q39.11 45.59 39.11 46.48Q39.11 46.95 38.89 47.28Q38.67 47.61 38.25 47.77Z"/><path d="M40.8 44.78H43.54Q44.77 44.78 45.42 45.33Q46.08 45.87 46.08 46.88Q46.08 47.89 45.42 48.43Q44.77 48.97 43.54 48.97H42.45V51.2H40.8ZM42.45 45.98V47.78H43.37Q43.85 47.78 44.11 47.54Q44.37 47.31 44.37 46.88Q44.37 46.45 44.11 46.22Q43.85 45.98 43.37 45.98Z"/></g></svg>',
55
+ 'file-xml': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M24.96 47.48 27.49 51.2H25.54L23.83 48.71L22.14 51.2H20.17L22.7 47.48L20.27 43.91H22.23L23.83 46.26L25.42 43.91H27.4Z"/><path d="M28.61 43.91H31L32.66 47.81L34.33 43.91H36.72V51.2H34.94V45.87L33.26 49.8H32.07L30.39 45.87V51.2H28.61Z"/><path d="M38.56 43.91H40.44V49.78H43.74V51.2H38.56Z"/></g></svg>',
56
+ 'file-yaml': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M27 21c-3 0-3 2-3 4v2c0 2-1 2-3 2 2 0 3 1 3 3v2c0 3 0 4 3 4m10-17c3 0 3 2 3 4v2c0 2 1 2 3 2-2 0-3 1-3 3v2c0 3 0 4-3 4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M18.14 44.78H19.95L21.41 47.07L22.87 44.78H24.68L22.24 48.5V51.2H20.59V48.5Z"/><path d="M29.3 50.03H26.71L26.3 51.2H24.64L27.02 44.78H28.99L31.37 51.2H29.7ZM27.13 48.84H28.88L28.01 46.29Z"/><path d="M32.22 44.78H34.32L35.78 48.22L37.25 44.78H39.35V51.2H37.79V46.51L36.31 49.97H35.26L33.79 46.51V51.2H32.22Z"/><path d="M40.97 44.78H42.63V49.95H45.53V51.2H40.97Z"/></g></svg>',
57
+ 'file-zip': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M23.41 43.91H29.54V45.05L25.63 49.78H29.65V51.2H23.3V50.06L27.21 45.33H23.41Z"/><path d="M31.02 43.91H32.9V51.2H31.02Z"/><path d="M34.74 43.91H37.86Q39.25 43.91 40 44.53Q40.74 45.15 40.74 46.29Q40.74 47.44 40 48.05Q39.25 48.67 37.86 48.67H36.62V51.2H34.74ZM36.62 45.27V47.31H37.66Q38.21 47.31 38.5 47.04Q38.8 46.78 38.8 46.29Q38.8 45.8 38.5 45.54Q38.21 45.27 37.66 45.27Z"/></g></svg>',
58
+ 'folder-closed': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M7 20a5 5 0 0 1 5-5h14l6 6h20a5 5 0 0 1 5 5v26a5 5 0 0 1-5 5H12a5 5 0 0 1-5-5Z" fill="#DFA041" stroke="#B87E28" stroke-width="1.5"/><path d="M8 30a4 4 0 0 1 4-4h40a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H12a4 4 0 0 1-4-4Z" fill="#F3C36B"/><path d="M12 29h39" stroke="#FFE5A8" stroke-width="1.5" stroke-linecap="round"/></svg>',
59
+ 'folder-open': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M7 23a5 5 0 0 1 5-5h13l6 6h21a5 5 0 0 1 5 5v23H7Z" fill="#DCA044" stroke="#B87E28" stroke-width="1.5"/><path d="M10 29h40v22H10Z" fill="#FFE2A2"/><path d="M5 35a5 5 0 0 1 5-5h14l5-5h26c4 0 5 2 4 5l-6 22a6 6 0 0 1-6 5H12a6 6 0 0 1-6-5Z" fill="#F3C36B" stroke="#B87E28" stroke-width="1.5"/><path d="M12 34h38" stroke="#FFE7AE" stroke-width="1.5" stroke-linecap="round"/></svg>',
60
+ };
61
+ /** Lower-case extension (including compound ones such as `tar.gz`) → icon. */
62
+ const SD_FILE_EXPLORER_ICON_EXTENSIONS = {
63
+ '7z': 'file-7z',
64
+ aac: 'file-audio',
65
+ ai: 'file-ai',
66
+ aiff: 'file-audio',
67
+ apk: 'file-app',
68
+ apng: 'file-png',
69
+ avi: 'file-video',
70
+ avif: 'file-image',
71
+ azw3: 'file-book',
72
+ blend: 'file-3d',
73
+ bmp: 'file-image',
74
+ bz2: 'file-archive',
75
+ c: 'file-code',
76
+ cjs: 'file-js',
77
+ cpp: 'file-code',
78
+ cs: 'file-code',
79
+ css: 'file-css',
80
+ csv: 'file-csv',
81
+ cts: 'file-ts',
82
+ 'd.ts': 'file-ts',
83
+ db: 'file-sql',
84
+ deb: 'file-app',
85
+ dmg: 'file-app',
86
+ doc: 'file-document',
87
+ docx: 'file-document',
88
+ dwg: 'file-3d',
89
+ dxf: 'file-3d',
90
+ env: 'file-code',
91
+ eps: 'file-design',
92
+ epub: 'file-book',
93
+ exe: 'file-app',
94
+ fbx: 'file-3d',
95
+ fig: 'file-figma',
96
+ flac: 'file-audio',
97
+ gif: 'file-gif',
98
+ gitignore: 'file-code',
99
+ glb: 'file-3d',
100
+ gltf: 'file-3d',
101
+ go: 'file-code',
102
+ gz: 'file-archive',
103
+ h: 'file-code',
104
+ heic: 'file-image',
105
+ heif: 'file-image',
106
+ htm: 'file-html',
107
+ html: 'file-html',
108
+ ico: 'file-image',
109
+ indd: 'file-design',
110
+ ipa: 'file-app',
111
+ ipynb: 'file-python',
112
+ java: 'file-code',
113
+ jpe: 'file-jpg',
114
+ jpeg: 'file-jpg',
115
+ jpg: 'file-jpg',
116
+ js: 'file-js',
117
+ json: 'file-json',
118
+ json5: 'file-json',
119
+ jsonl: 'file-json',
120
+ jsx: 'file-js',
121
+ key: 'file-presentation',
122
+ kt: 'file-code',
123
+ less: 'file-css',
124
+ log: 'file-text',
125
+ m4a: 'file-audio',
126
+ m4v: 'file-mp4',
127
+ markdown: 'file-markdown',
128
+ md: 'file-markdown',
129
+ mjs: 'file-js',
130
+ mkv: 'file-video',
131
+ mobi: 'file-book',
132
+ mov: 'file-mov',
133
+ mp3: 'file-mp3',
134
+ mp4: 'file-mp4',
135
+ mpeg: 'file-video',
136
+ mpg: 'file-video',
137
+ msi: 'file-app',
138
+ mts: 'file-ts',
139
+ numbers: 'file-spreadsheet',
140
+ obj: 'file-3d',
141
+ odp: 'file-presentation',
142
+ ods: 'file-spreadsheet',
143
+ odt: 'file-document',
144
+ ogg: 'file-audio',
145
+ opus: 'file-audio',
146
+ otf: 'file-font',
147
+ pages: 'file-document',
148
+ pdf: 'file-pdf',
149
+ php: 'file-code',
150
+ png: 'file-png',
151
+ ppt: 'file-presentation',
152
+ pptx: 'file-presentation',
153
+ psd: 'file-psd',
154
+ py: 'file-python',
155
+ rar: 'file-rar',
156
+ raw: 'file-image',
157
+ rb: 'file-code',
158
+ rpm: 'file-app',
159
+ rs: 'file-code',
160
+ rtf: 'file-document',
161
+ scss: 'file-css',
162
+ sh: 'file-code',
163
+ sketch: 'file-design',
164
+ sql: 'file-sql',
165
+ sqlite: 'file-sql',
166
+ stl: 'file-3d',
167
+ svelte: 'file-code',
168
+ svg: 'file-svg',
169
+ swift: 'file-code',
170
+ tar: 'file-tar',
171
+ 'tar.bz2': 'file-tar',
172
+ 'tar.gz': 'file-tar',
173
+ 'tar.xz': 'file-tar',
174
+ tgz: 'file-tar',
175
+ tif: 'file-image',
176
+ tiff: 'file-image',
177
+ ts: 'file-ts',
178
+ tsv: 'file-csv',
179
+ tsx: 'file-ts',
180
+ ttf: 'file-font',
181
+ txt: 'file-text',
182
+ vue: 'file-code',
183
+ wav: 'file-wav',
184
+ webm: 'file-video',
185
+ webp: 'file-webp',
186
+ wmv: 'file-video',
187
+ woff: 'file-font',
188
+ woff2: 'file-font',
189
+ xd: 'file-design',
190
+ xls: 'file-spreadsheet',
191
+ xlsx: 'file-spreadsheet',
192
+ xml: 'file-xml',
193
+ xsd: 'file-xml',
194
+ xz: 'file-archive',
195
+ yaml: 'file-yaml',
196
+ yml: 'file-yaml',
197
+ zip: 'file-zip',
198
+ zst: 'file-archive',
199
+ };
200
+ /** Exact MIME type, or a family prefix ending with `/`, → icon. Used when the extension is unknown. */
201
+ const SD_FILE_EXPLORER_ICON_MIME = {
202
+ 'application/epub+zip': 'file-book',
203
+ 'application/json': 'file-json',
204
+ 'application/msword': 'file-document',
205
+ 'application/pdf': 'file-pdf',
206
+ 'application/vnd.ms-excel': 'file-spreadsheet',
207
+ 'application/vnd.ms-powerpoint': 'file-presentation',
208
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'file-presentation',
209
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'file-spreadsheet',
210
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'file-document',
211
+ 'application/x-7z-compressed': 'file-7z',
212
+ 'application/x-rar-compressed': 'file-rar',
213
+ 'application/xml': 'file-xml',
214
+ 'application/zip': 'file-archive',
215
+ 'audio/': 'file-audio',
216
+ 'font/': 'file-font',
217
+ 'image/': 'file-image',
218
+ 'model/': 'file-3d',
219
+ 'text/': 'file-text',
220
+ 'text/css': 'file-css',
221
+ 'text/csv': 'file-csv',
222
+ 'text/html': 'file-html',
223
+ 'text/javascript': 'file-js',
224
+ 'video/': 'file-video',
225
+ };
226
+
227
+ const EXTENSIONS = {
228
+ image: ['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'bmp', 'avif', 'ico', 'heic'],
229
+ pdf: ['pdf'],
230
+ spreadsheet: ['xls', 'xlsx', 'xlsm', 'csv', 'ods', 'numbers'],
231
+ document: ['doc', 'docx', 'odt', 'rtf', 'pages'],
232
+ presentation: ['ppt', 'pptx', 'odp', 'key'],
233
+ video: ['mp4', 'mov', 'avi', 'mkv', 'webm', 'm4v'],
234
+ audio: ['mp3', 'wav', 'ogg', 'flac', 'm4a', 'aac'],
235
+ archive: ['zip', 'rar', '7z', 'tar', 'gz', 'tgz', 'bz2'],
236
+ text: ['txt', 'md', 'json', 'xml', 'log', 'yml', 'yaml', 'html', 'css', 'js', 'ts'],
237
+ };
238
+ /** Lower-cased extension of a file name, without the dot; empty when there is none. */
239
+ function sdFileExplorerExtension(name) {
240
+ const dot = name.lastIndexOf('.');
241
+ return dot > 0 && dot < name.length - 1 ? name.slice(dot + 1).toLowerCase() : '';
242
+ }
243
+ /** Resolves the visual family of an item from its MIME type, falling back to the extension of its name. */
244
+ function sdFileExplorerFileType(item) {
245
+ if (item.kind === 'folder')
246
+ return 'folder';
247
+ const mime = (item.mimeType ?? '').toLowerCase();
248
+ if (mime) {
249
+ if (mime.startsWith('image/'))
250
+ return 'image';
251
+ if (mime === 'application/pdf')
252
+ return 'pdf';
253
+ if (mime.includes('spreadsheet') || mime.includes('excel') || mime === 'text/csv')
254
+ return 'spreadsheet';
255
+ if (mime.includes('presentation') || mime.includes('powerpoint'))
256
+ return 'presentation';
257
+ if (mime.includes('wordprocessing') || mime.includes('msword') || mime.includes('opendocument.text') || mime === 'application/rtf') {
258
+ return 'document';
259
+ }
260
+ if (mime.startsWith('video/'))
261
+ return 'video';
262
+ if (mime.startsWith('audio/'))
263
+ return 'audio';
264
+ if (/(zip|rar|7z|tar|gzip|compressed)/.test(mime))
265
+ return 'archive';
266
+ if (mime.startsWith('text/') || mime.endsWith('json') || mime.endsWith('xml'))
267
+ return 'text';
268
+ }
269
+ const ext = sdFileExplorerExtension(item.name);
270
+ for (const [type, extensions] of Object.entries(EXTENSIONS)) {
271
+ if (extensions.includes(ext))
272
+ return type;
273
+ }
274
+ return 'other';
275
+ }
276
+ function lookup(map, key) {
277
+ // why: tra bằng hasOwnProperty — tên như "x.constructor" không được trả về hàm của Object.prototype.
278
+ return Object.prototype.hasOwnProperty.call(map, key) ? map[key] : undefined;
279
+ }
280
+ /**
281
+ * Built-in icon for an item. Folders use `folder-open` / `folder-closed`. Files resolve the longest known
282
+ * extension first (`report.tar.gz`, `types.d.ts`), then dot-files (`.env`), then the MIME type (exact match,
283
+ * then family such as `image/`), and finally `file-generic`.
284
+ */
285
+ function sdFileExplorerIconName(item, options = {}) {
286
+ if (item.kind === 'folder')
287
+ return options.open ? 'folder-open' : 'folder-closed';
288
+ const basename = (item.name.split(/[\\/]/).pop() ?? '').toLowerCase();
289
+ const suffixes = basename.split('.').slice(1);
290
+ for (let i = 0; i < suffixes.length; i++) {
291
+ const icon = lookup(SD_FILE_EXPLORER_ICON_EXTENSIONS, suffixes.slice(i).join('.'));
292
+ if (icon)
293
+ return icon;
294
+ }
295
+ const dotfile = basename.startsWith('.') ? lookup(SD_FILE_EXPLORER_ICON_EXTENSIONS, basename.slice(1)) : undefined;
296
+ if (dotfile)
297
+ return dotfile;
298
+ if (basename.startsWith('.env.'))
299
+ return 'file-code';
300
+ const mime = (item.mimeType ?? '').toLowerCase().split(';', 1)[0].trim();
301
+ const exact = mime ? lookup(SD_FILE_EXPLORER_ICON_MIME, mime) : undefined;
302
+ if (exact)
303
+ return exact;
304
+ const family = Object.keys(SD_FILE_EXPLORER_ICON_MIME).find(prefix => prefix.endsWith('/') && mime.startsWith(prefix));
305
+ return (family && SD_FILE_EXPLORER_ICON_MIME[family]) || 'file-generic';
306
+ }
307
+ const ICON_URLS = new Map();
308
+ /** `data:` URL of a built-in icon, encoded once and cached (the SVGs keep their own colours, so `<img>` is enough). */
309
+ function sdFileExplorerIconUrl(name) {
310
+ let url = ICON_URLS.get(name);
311
+ if (!url) {
312
+ const svg = SD_FILE_EXPLORER_ICON_SVGS[name] ?? SD_FILE_EXPLORER_ICON_SVGS['file-generic'];
313
+ url = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
314
+ ICON_URLS.set(name, url);
315
+ }
316
+ return url;
317
+ }
318
+ /** Preview renderer for a file type. */
319
+ function sdFileExplorerPreviewKind(type) {
320
+ if (type === 'image')
321
+ return 'image';
322
+ if (type === 'pdf')
323
+ return 'pdf';
324
+ if (type === 'video')
325
+ return 'video';
326
+ return 'none';
327
+ }
328
+ /**
329
+ * Human-readable size: `846 KB`, `2,4 MB` (vi) / `2.4 MB` (en).
330
+ * One decimal below 10 units, none above — the precision users expect from file managers.
331
+ */
332
+ function sdFileExplorerFormatSize(bytes, locale) {
333
+ if (typeof bytes !== 'number' || !Number.isFinite(bytes) || bytes < 0)
334
+ return '';
335
+ if (bytes < 1024)
336
+ return `${bytes} B`;
337
+ const units = ['KB', 'MB', 'GB', 'TB'];
338
+ let value = bytes / 1024;
339
+ let unit = 0;
340
+ while (value >= 1024 && unit < units.length - 1) {
341
+ value /= 1024;
342
+ unit++;
343
+ }
344
+ const digits = value < 10 ? 1 : 0;
345
+ return `${new Intl.NumberFormat(locale, { maximumFractionDigits: digits }).format(value)} ${units[unit]}`;
346
+ }
347
+ /** Parses `SdFileExplorerItem.modifiedAt`; `null` when missing or invalid. */
348
+ function sdFileExplorerParseDate(value) {
349
+ if (value === null || value === undefined || value === '')
350
+ return null;
351
+ const date = value instanceof Date ? value : new Date(value);
352
+ return Number.isNaN(date.getTime()) ? null : date;
353
+ }
354
+ /**
355
+ * Compact modification date: "today" / "yesterday" labels, day + month within the current year,
356
+ * full date otherwise. Order of day and month follows the locale.
357
+ */
358
+ function sdFileExplorerFormatDate(value, now, locale, labels) {
359
+ const date = sdFileExplorerParseDate(value);
360
+ if (!date)
361
+ return '';
362
+ const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
363
+ const day = new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
364
+ // why: so sánh theo mốc 0h local (không trừ 86 400 000 ms) để ngày chuyển giờ DST vẫn đúng "hôm qua".
365
+ if (day === startOfToday)
366
+ return labels.today;
367
+ if (day === new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1).getTime())
368
+ return labels.yesterday;
369
+ const options = date.getFullYear() === now.getFullYear() ? { day: '2-digit', month: '2-digit' } : { day: '2-digit', month: '2-digit', year: 'numeric' };
370
+ // why: lấy THỨ TỰ ngày/tháng theo locale nhưng luôn nối bằng "/" — Chrome format vi-VN ngày+tháng thành "21-09".
371
+ return new Intl.DateTimeFormat(locale, options)
372
+ .formatToParts(date)
373
+ .filter(part => part.type === 'day' || part.type === 'month' || part.type === 'year')
374
+ .map(part => part.value)
375
+ .join('/');
376
+ }
377
+ /** Full date and time, used as tooltip and in the preview metadata. */
378
+ function sdFileExplorerFormatDateTime(value, locale) {
379
+ const date = sdFileExplorerParseDate(value);
380
+ if (!date)
381
+ return '';
382
+ return new Intl.DateTimeFormat(locale, {
383
+ day: '2-digit',
384
+ month: '2-digit',
385
+ year: 'numeric',
386
+ hour: '2-digit',
387
+ minute: '2-digit',
388
+ }).format(date);
389
+ }
390
+ /** Lower-cases and strips Vietnamese accents so "tai lieu" matches "Tài liệu". */
391
+ function sdFileExplorerNormalize(value) {
392
+ return value
393
+ .normalize('NFD')
394
+ .replace(/[\u0300-\u036f]/g, '')
395
+ .replace(/[\u0111\u0110]/g, match => (match === '\u0110' ? 'D' : 'd'))
396
+ .toLowerCase()
397
+ .trim();
398
+ }
399
+ /** Readable reason from whatever a callback threw. */
400
+ function sdFileExplorerErrorMessage(error) {
401
+ if (typeof error === 'string')
402
+ return error;
403
+ if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string')
404
+ return error.message;
405
+ return '';
406
+ }
407
+ /** `true` for errors produced by an aborted `AbortSignal`. */
408
+ function sdFileExplorerIsAbort(error) {
409
+ return !!error && typeof error === 'object' && 'name' in error && error.name === 'AbortError';
410
+ }
411
+ /**
412
+ * Folders first, then files. Within each group the order returned by the callback is kept, so the
413
+ * consumer (or its API) decides how items are sorted.
414
+ */
415
+ function sdFileExplorerFoldersFirst(items) {
416
+ return [...items.filter(item => item.kind === 'folder'), ...items.filter(item => item.kind !== 'folder')];
417
+ }
418
+ /** Element-safe id fragment for `autoId` / DOM ids. */
419
+ function sdFileExplorerSafeId(value) {
420
+ return value.replace(/[^a-zA-Z0-9_-]/g, '-');
421
+ }
422
+
423
+ /**
424
+ * Built-in file-type icon (folder, PDF, spreadsheet, image, code…), drawn from the embedded SVG set.
425
+ * Decorative: always `aria-hidden` with an empty `alt`, the item name next to it carries the meaning.
426
+ */
427
+ class SdFileExplorerFileIcon {
428
+ /** Icon to draw. */
429
+ icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : []));
430
+ /** Rendered size in pixels (the SVGs use a 64 × 64 canvas with built-in padding). */
431
+ size = input(32, ...(ngDevMode ? [{ debugName: "size" }] : []));
432
+ src = computed(() => sdFileExplorerIconUrl(this.icon()), ...(ngDevMode ? [{ debugName: "src" }] : []));
433
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerFileIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
434
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: SdFileExplorerFileIcon, isStandalone: true, selector: "sd-file-explorer-file-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "attr.data-icon": "icon()", "style.--sd-file-explorer-icon-size": "size() + \"px\"" }, classAttribute: "sd-file-explorer-file-icon" }, ngImport: i0, template: `<img [src]="src()" alt="" draggable="false" />`, isInline: true, styles: [":host{display:inline-flex;flex:none;width:var(--sd-file-explorer-icon-size, 32px);height:var(--sd-file-explorer-icon-size, 32px)}img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
435
+ }
436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerFileIcon, decorators: [{
437
+ type: Component,
438
+ args: [{ selector: 'sd-file-explorer-file-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
439
+ class: 'sd-file-explorer-file-icon',
440
+ 'aria-hidden': 'true',
441
+ '[attr.data-icon]': 'icon()',
442
+ '[style.--sd-file-explorer-icon-size]': 'size() + "px"',
443
+ }, template: `<img [src]="src()" alt="" draggable="false" />`, styles: [":host{display:inline-flex;flex:none;width:var(--sd-file-explorer-icon-size, 32px);height:var(--sd-file-explorer-icon-size, 32px)}img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }]
444
+ }], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
445
+
446
+ /**
447
+ * Folder tree of the explorer (internal). Rendered as a flat `role="tree"` list whose depth is carried by
448
+ * `aria-level`, with a roving tabindex and the WAI-ARIA tree keyboard model.
449
+ */
450
+ class SdFileExplorerFolderTree {
451
+ #host = inject(ElementRef);
452
+ #i18n = inject(I18nService);
453
+ /** Visible nodes in display order. */
454
+ nodes = input.required(...(ngDevMode ? [{ debugName: "nodes" }] : []));
455
+ /** Accessible name of the tree. */
456
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
457
+ /** A node was activated (click, Enter, Space). */
458
+ select = output();
459
+ /** Expand / collapse requested. */
460
+ toggle = output();
461
+ /** Retry loading the children of a node whose listing failed. */
462
+ retry = output();
463
+ focusedKey = signal(null, ...(ngDevMode ? [{ debugName: "focusedKey" }] : []));
464
+ retryLabel = computed(() => this.#i18n.t('core.component.file-explorer.retry'), ...(ngDevMode ? [{ debugName: "retryLabel" }] : []));
465
+ /** Node owning the roving tabindex: the focused node if still visible, else the selected one. */
466
+ activeKey = computed(() => {
467
+ const nodes = this.nodes();
468
+ const focused = this.focusedKey();
469
+ if (focused && nodes.some(node => node.key === focused))
470
+ return focused;
471
+ return nodes.find(node => node.selected)?.key ?? nodes[0]?.key ?? null;
472
+ }, ...(ngDevMode ? [{ debugName: "activeKey" }] : []));
473
+ toggleLabel(node) {
474
+ const key = node.expanded ? 'core.component.file-explorer.collapse' : 'core.component.file-explorer.expand';
475
+ return this.#i18n.t(key, { name: node.name });
476
+ }
477
+ onToggle(event, node) {
478
+ // why: nút toggle nằm trong treeitem — chặn bubble để bấm mũi tên không đồng thời điều hướng vào thư mục.
479
+ event.stopPropagation();
480
+ this.toggle.emit(node);
481
+ }
482
+ onRetry(event, node) {
483
+ event.stopPropagation();
484
+ this.retry.emit(node);
485
+ }
486
+ onKeydown(event, index) {
487
+ const nodes = this.nodes();
488
+ const node = nodes[index];
489
+ if (!node)
490
+ return;
491
+ switch (event.key) {
492
+ case 'ArrowDown':
493
+ this.#focusIndex(Math.min(index + 1, nodes.length - 1));
494
+ break;
495
+ case 'ArrowUp':
496
+ this.#focusIndex(Math.max(index - 1, 0));
497
+ break;
498
+ case 'Home':
499
+ this.#focusIndex(0);
500
+ break;
501
+ case 'End':
502
+ this.#focusIndex(nodes.length - 1);
503
+ break;
504
+ case 'ArrowRight':
505
+ if (node.expandable && !node.expanded)
506
+ this.toggle.emit(node);
507
+ else if (node.expanded || node.level === 1)
508
+ this.#focusIndex(Math.min(index + 1, nodes.length - 1));
509
+ break;
510
+ case 'ArrowLeft':
511
+ if (node.expandable && node.expanded) {
512
+ this.toggle.emit(node);
513
+ }
514
+ else {
515
+ for (let i = index - 1; i >= 0; i--) {
516
+ if (nodes[i].level < node.level) {
517
+ this.#focusIndex(i);
518
+ break;
519
+ }
520
+ }
521
+ }
522
+ break;
523
+ case 'Enter':
524
+ case ' ':
525
+ this.select.emit(node);
526
+ break;
527
+ default:
528
+ return;
529
+ }
530
+ event.preventDefault();
531
+ }
532
+ #focusIndex(index) {
533
+ const node = this.nodes()[index];
534
+ if (!node)
535
+ return;
536
+ this.focusedKey.set(node.key);
537
+ const element = this.#host.nativeElement.querySelectorAll('[role="treeitem"]')[index];
538
+ element?.focus();
539
+ }
540
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerFolderTree, deps: [], target: i0.ɵɵFactoryTarget.Component });
541
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdFileExplorerFolderTree, isStandalone: true, selector: "sd-file-explorer-folder-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { select: "select", toggle: "toggle", retry: "retry" }, host: { classAttribute: "sd-file-explorer-folder-tree" }, ngImport: i0, template: `
542
+ @let _nodes = nodes();
543
+ @let _active = activeKey();
544
+ <ul class="tree" role="tree" [attr.aria-label]="label()">
545
+ @for (node of _nodes; track node.key; let i = $index) {
546
+ <li
547
+ class="node"
548
+ role="treeitem"
549
+ [class.node--selected]="node.selected"
550
+ [attr.aria-level]="node.level"
551
+ [attr.aria-selected]="node.selected"
552
+ [attr.aria-expanded]="node.expandable ? node.expanded : null"
553
+ [attr.aria-busy]="node.status === 'loading' ? true : null"
554
+ [attr.tabindex]="node.key === _active ? 0 : -1"
555
+ [attr.data-autoid]="node.autoId"
556
+ [style.--sd-file-explorer-tree-indent]="(node.level > 1 ? node.level - 2 : 0) * 22 + 'px'"
557
+ (click)="select.emit(node)"
558
+ (keydown)="onKeydown($event, i)"
559
+ (focus)="focusedKey.set(node.key)">
560
+ @if (node.level > 1) {
561
+ <span class="indent"></span>
562
+ @if (node.expandable) {
563
+ <button
564
+ type="button"
565
+ class="toggle"
566
+ tabindex="-1"
567
+ [attr.aria-label]="toggleLabel(node)"
568
+ [attr.data-autoid]="node.autoId ? node.autoId + '-toggle' : null"
569
+ (click)="onToggle($event, node)">
570
+ <sd-icon [name]="node.expanded ? 'expand_more' : 'chevron_right'" size="16px" />
571
+ </button>
572
+ } @else {
573
+ <span class="toggle toggle--placeholder"></span>
574
+ }
575
+ }
576
+ <sd-file-explorer-file-icon [icon]="node.expanded ? 'folder-open' : 'folder-closed'" [size]="28" />
577
+ <span class="label" [title]="node.name">{{ node.name }}</span>
578
+ @if (node.status === 'loading') {
579
+ <span class="spinner" aria-hidden="true"></span>
580
+ } @else if (node.status === 'error') {
581
+ <button
582
+ type="button"
583
+ class="retry"
584
+ tabindex="-1"
585
+ [attr.aria-label]="retryLabel()"
586
+ [title]="retryLabel()"
587
+ (click)="onRetry($event, node)">
588
+ <sd-icon name="refresh" size="16px" />
589
+ </button>
590
+ }
591
+ </li>
592
+ }
593
+ </ul>
594
+ `, isInline: true, styles: [":host{display:block}.tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.node{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:var(--sd-radius-8, 8px);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);line-height:var(--sd-line-height-20, 20px);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.node:hover{background:var(--sd-fe-hover)}.node:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.node--selected{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent);font-weight:var(--sd-font-weight-semibold, 600)}.node--selected:hover{background:var(--sd-fe-accent-soft)}.indent{flex:none;width:var(--sd-file-explorer-tree-indent, 0);margin-right:-8px}.toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:24px;margin-right:-1px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.toggle:hover{color:var(--sd-fe-text)}.label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.retry{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:var(--sd-radius-6, 6px);background:transparent;color:var(--sd-fe-error);cursor:pointer}.retry:hover{background:color-mix(in srgb,var(--sd-fe-error) 10%,transparent)}.spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 25%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-tree-spin .8s linear infinite}@keyframes sd-file-explorer-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
595
+ }
596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerFolderTree, decorators: [{
597
+ type: Component,
598
+ args: [{ selector: 'sd-file-explorer-folder-tree', standalone: true, imports: [SdIcon, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'sd-file-explorer-folder-tree' }, template: `
599
+ @let _nodes = nodes();
600
+ @let _active = activeKey();
601
+ <ul class="tree" role="tree" [attr.aria-label]="label()">
602
+ @for (node of _nodes; track node.key; let i = $index) {
603
+ <li
604
+ class="node"
605
+ role="treeitem"
606
+ [class.node--selected]="node.selected"
607
+ [attr.aria-level]="node.level"
608
+ [attr.aria-selected]="node.selected"
609
+ [attr.aria-expanded]="node.expandable ? node.expanded : null"
610
+ [attr.aria-busy]="node.status === 'loading' ? true : null"
611
+ [attr.tabindex]="node.key === _active ? 0 : -1"
612
+ [attr.data-autoid]="node.autoId"
613
+ [style.--sd-file-explorer-tree-indent]="(node.level > 1 ? node.level - 2 : 0) * 22 + 'px'"
614
+ (click)="select.emit(node)"
615
+ (keydown)="onKeydown($event, i)"
616
+ (focus)="focusedKey.set(node.key)">
617
+ @if (node.level > 1) {
618
+ <span class="indent"></span>
619
+ @if (node.expandable) {
620
+ <button
621
+ type="button"
622
+ class="toggle"
623
+ tabindex="-1"
624
+ [attr.aria-label]="toggleLabel(node)"
625
+ [attr.data-autoid]="node.autoId ? node.autoId + '-toggle' : null"
626
+ (click)="onToggle($event, node)">
627
+ <sd-icon [name]="node.expanded ? 'expand_more' : 'chevron_right'" size="16px" />
628
+ </button>
629
+ } @else {
630
+ <span class="toggle toggle--placeholder"></span>
631
+ }
632
+ }
633
+ <sd-file-explorer-file-icon [icon]="node.expanded ? 'folder-open' : 'folder-closed'" [size]="28" />
634
+ <span class="label" [title]="node.name">{{ node.name }}</span>
635
+ @if (node.status === 'loading') {
636
+ <span class="spinner" aria-hidden="true"></span>
637
+ } @else if (node.status === 'error') {
638
+ <button
639
+ type="button"
640
+ class="retry"
641
+ tabindex="-1"
642
+ [attr.aria-label]="retryLabel()"
643
+ [title]="retryLabel()"
644
+ (click)="onRetry($event, node)">
645
+ <sd-icon name="refresh" size="16px" />
646
+ </button>
647
+ }
648
+ </li>
649
+ }
650
+ </ul>
651
+ `, styles: [":host{display:block}.tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.node{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:var(--sd-radius-8, 8px);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);line-height:var(--sd-line-height-20, 20px);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.node:hover{background:var(--sd-fe-hover)}.node:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.node--selected{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent);font-weight:var(--sd-font-weight-semibold, 600)}.node--selected:hover{background:var(--sd-fe-accent-soft)}.indent{flex:none;width:var(--sd-file-explorer-tree-indent, 0);margin-right:-8px}.toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:24px;margin-right:-1px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.toggle:hover{color:var(--sd-fe-text)}.label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.retry{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:var(--sd-radius-6, 6px);background:transparent;color:var(--sd-fe-error);cursor:pointer}.retry:hover{background:color-mix(in srgb,var(--sd-fe-error) 10%,transparent)}.spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 25%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-tree-spin .8s linear infinite}@keyframes sd-file-explorer-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
652
+ }], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], select: [{ type: i0.Output, args: ["select"] }], toggle: [{ type: i0.Output, args: ["toggle"] }], retry: [{ type: i0.Output, args: ["retry"] }] } });
653
+
654
+ /**
655
+ * Items of the current folder (or search results) as a list or a grid (internal).
656
+ * Rows and cards are focusable; `Enter` / `Space` activate them like a click.
657
+ */
658
+ class SdFileExplorerItemList {
659
+ /** Items to render, already formatted. */
660
+ items = input.required(...(ngDevMode ? [{ debugName: "items" }] : []));
661
+ /** `list` or `grid`. */
662
+ view = input('list', ...(ngDevMode ? [{ debugName: "view" }] : []));
663
+ /** Show download buttons for files. */
664
+ canDownload = input(false, ...(ngDevMode ? [{ debugName: "canDownload" }] : []));
665
+ /** Show share buttons for files. */
666
+ canShare = input(false, ...(ngDevMode ? [{ debugName: "canShare" }] : []));
667
+ /** Narrow layout: hides the modified column. */
668
+ compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : []));
669
+ /** Id of the file currently shown in the preview panel. */
670
+ activeId = input(null, ...(ngDevMode ? [{ debugName: "activeId" }] : []));
671
+ /** Accessible name of the list. */
672
+ label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
673
+ /** Row / card activated. */
674
+ activate = output();
675
+ /** Download button pressed. */
676
+ download = output();
677
+ /** Share button pressed. */
678
+ share = output();
679
+ /** Width of the row action column: one 32 px icon button per enabled action. */
680
+ actionsWidth = computed(() => {
681
+ const count = (this.canDownload() ? 1 : 0) + (this.canShare() ? 1 : 0);
682
+ if (!count)
683
+ return null;
684
+ return `${count * 32 + (count - 1) * 2 + (this.compact() ? 4 : 12)}px`;
685
+ }, ...(ngDevMode ? [{ debugName: "actionsWidth" }] : []));
686
+ onKeydown(event, view) {
687
+ if (event.key !== 'Enter' && event.key !== ' ')
688
+ return;
689
+ event.preventDefault();
690
+ this.activate.emit(view);
691
+ }
692
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerItemList, deps: [], target: i0.ɵɵFactoryTarget.Component });
693
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdFileExplorerItemList, isStandalone: true, selector: "sd-file-explorer-item-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, canDownload: { classPropertyName: "canDownload", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canShare: { classPropertyName: "canShare", publicName: "canShare", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, activeId: { classPropertyName: "activeId", publicName: "activeId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activate: "activate", download: "download", share: "share" }, host: { properties: { "class.sd-file-explorer-item-list--compact": "compact()", "style.--sd-fe-actions-width": "actionsWidth()" }, classAttribute: "sd-file-explorer-item-list" }, ngImport: i0, template: `
694
+ @let _items = items();
695
+ @let _canDownload = canDownload();
696
+ @let _canShare = canShare();
697
+ @let _hasActions = _canDownload || _canShare;
698
+ @let _compact = compact();
699
+ @let _activeId = activeId();
700
+ @if (view() === 'list') {
701
+ <div class="list" role="table" [attr.aria-label]="label()">
702
+ <div class="list-head" role="rowgroup">
703
+ <div class="row row--head" role="row">
704
+ <span class="cell cell--name" role="columnheader">{{ 'core.component.file-explorer.column.name' | sdTranslate }}</span>
705
+ @if (!_compact) {
706
+ <span class="cell cell--modified" role="columnheader">{{
707
+ 'core.component.file-explorer.column.modified' | sdTranslate
708
+ }}</span>
709
+ }
710
+ <span class="cell cell--size" role="columnheader">{{ 'core.component.file-explorer.column.size' | sdTranslate }}</span>
711
+ @if (_hasActions) {
712
+ <span class="cell cell--action" role="columnheader"></span>
713
+ }
714
+ </div>
715
+ </div>
716
+ <div role="rowgroup">
717
+ @for (view of _items; track view.item.id) {
718
+ <div
719
+ class="row"
720
+ role="row"
721
+ tabindex="0"
722
+ [class.row--active]="view.item.id === _activeId"
723
+ [attr.data-item-id]="view.item.id"
724
+ [attr.data-autoid]="view.autoId"
725
+ (click)="activate.emit(view)"
726
+ (keydown)="onKeydown($event, view)">
727
+ <span class="cell cell--name" role="cell">
728
+ <sd-file-explorer-file-icon [icon]="view.icon" [size]="32" />
729
+ <span class="name" [title]="view.item.name">{{ view.item.name }}</span>
730
+ </span>
731
+ @if (!_compact) {
732
+ <span class="cell cell--modified" role="cell" [title]="view.modifiedTitle">{{ view.modifiedLabel || '—' }}</span>
733
+ }
734
+ <span class="cell cell--size" role="cell">{{ view.sizeLabel || '—' }}</span>
735
+ @if (_hasActions) {
736
+ <!-- why: sd-button already keeps its click from reaching the row; Enter/Space are stopped here so the key does not open the file too. -->
737
+ <span class="cell cell--action" role="cell">
738
+ @if (view.item.kind === 'file') {
739
+ @if (_canShare) {
740
+ <sd-button
741
+ class="row-action row-share"
742
+ type="text"
743
+ color="secondary"
744
+ size="sm"
745
+ prefixIcon="share"
746
+ [tooltip]="view.shareLabel"
747
+ [attr.data-autoid]="view.autoId ? view.autoId + '-share' : null"
748
+ (click)="share.emit(view)"
749
+ (keydown.enter)="$event.stopPropagation()"
750
+ (keydown.space)="$event.stopPropagation()" />
751
+ }
752
+ @if (_canDownload) {
753
+ <sd-button
754
+ class="row-action row-download"
755
+ type="text"
756
+ color="secondary"
757
+ size="sm"
758
+ prefixIcon="file_download"
759
+ [tooltip]="view.downloadLabel"
760
+ [attr.data-autoid]="view.autoId ? view.autoId + '-download' : null"
761
+ (click)="download.emit(view)"
762
+ (keydown.enter)="$event.stopPropagation()"
763
+ (keydown.space)="$event.stopPropagation()" />
764
+ }
765
+ }
766
+ </span>
767
+ }
768
+ </div>
769
+ }
770
+ </div>
771
+ </div>
772
+ } @else {
773
+ <ul class="grid" [attr.aria-label]="label()">
774
+ @for (view of _items; track view.item.id) {
775
+ <li
776
+ class="card"
777
+ tabindex="0"
778
+ [class.card--active]="view.item.id === _activeId"
779
+ [attr.data-item-id]="view.item.id"
780
+ [attr.data-autoid]="view.autoId"
781
+ [attr.aria-label]="view.item.name + ', ' + view.typeLabel"
782
+ (click)="activate.emit(view)"
783
+ (keydown)="onKeydown($event, view)">
784
+ <span class="thumb">
785
+ @if (view.item.thumbnailUrl) {
786
+ <img [src]="view.item.thumbnailUrl" alt="" loading="lazy" />
787
+ } @else {
788
+ <sd-file-explorer-file-icon [icon]="view.icon" [size]="48" />
789
+ }
790
+ </span>
791
+ <span class="card-name" [title]="view.item.name">{{ view.item.name }}</span>
792
+ </li>
793
+ }
794
+ </ul>
795
+ }
796
+ `, isInline: true, styles: [":host{display:block}.list{width:100%}.row{display:grid;grid-template-columns:minmax(0,1fr) 128px 88px var(--sd-fe-actions-width, 44px);align-items:center;min-height:62px;border-bottom:1px solid var(--sd-fe-border);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);cursor:pointer;outline:none;transition:background-color var(--sd-duration-fast, .12s) ease}.row:hover{background:var(--sd-fe-hover)}.row:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 128px 88px}.row--head{min-height:34px;color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px);cursor:default}.row--head:hover{background:transparent}.row--active,.row--active:hover{background:var(--sd-fe-accent-soft)}.cell{min-width:0;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell--name{display:flex;align-items:center;gap:16px}.row:not(.row--head) .cell--modified,.row:not(.row--head) .cell--size{color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px)}.cell--action{display:flex;align-items:center;justify-content:flex-end;gap:2px;padding:0 4px 0 0;overflow:visible}.name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .row{grid-template-columns:minmax(0,1fr) 66px var(--sd-fe-actions-width, 36px);min-height:55px;font-size:var(--sd-font-size-14, 14px)}:host(.sd-file-explorer-item-list--compact) .list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 66px}:host(.sd-file-explorer-item-list--compact) .row--head{min-height:30px;font-size:var(--sd-font-size-12, 12px)}:host(.sd-file-explorer-item-list--compact) .cell--name{gap:12px}:host(.sd-file-explorer-item-list--compact) .cell{padding:0 4px}:host(.sd-file-explorer-item-list--compact) .cell--action{padding:0}.grid{list-style:none;margin:0;padding:4px 0 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px 20px}.card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:12px 12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-surface);color:var(--sd-fe-text);cursor:pointer;outline:none;transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.card:hover{border-color:var(--sd-fe-border-strong);box-shadow:0 2px 8px #0f172a0f}.card:focus-visible{box-shadow:0 0 0 2px var(--sd-fe-accent)}.card--active{border-color:var(--sd-fe-accent)}.thumb{display:flex;align-items:center;justify-content:center;height:104px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-muted-surface)}.thumb img{width:100%;height:100%;object-fit:cover}.card-name{padding:0 2px;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}@media(prefers-reduced-motion:reduce){.row,.card{transition:none}}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
797
+ }
798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerItemList, decorators: [{
799
+ type: Component,
800
+ args: [{ selector: 'sd-file-explorer-item-list', standalone: true, imports: [SdButton, SdTranslatePipe, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
801
+ class: 'sd-file-explorer-item-list',
802
+ '[class.sd-file-explorer-item-list--compact]': 'compact()',
803
+ '[style.--sd-fe-actions-width]': 'actionsWidth()',
804
+ }, template: `
805
+ @let _items = items();
806
+ @let _canDownload = canDownload();
807
+ @let _canShare = canShare();
808
+ @let _hasActions = _canDownload || _canShare;
809
+ @let _compact = compact();
810
+ @let _activeId = activeId();
811
+ @if (view() === 'list') {
812
+ <div class="list" role="table" [attr.aria-label]="label()">
813
+ <div class="list-head" role="rowgroup">
814
+ <div class="row row--head" role="row">
815
+ <span class="cell cell--name" role="columnheader">{{ 'core.component.file-explorer.column.name' | sdTranslate }}</span>
816
+ @if (!_compact) {
817
+ <span class="cell cell--modified" role="columnheader">{{
818
+ 'core.component.file-explorer.column.modified' | sdTranslate
819
+ }}</span>
820
+ }
821
+ <span class="cell cell--size" role="columnheader">{{ 'core.component.file-explorer.column.size' | sdTranslate }}</span>
822
+ @if (_hasActions) {
823
+ <span class="cell cell--action" role="columnheader"></span>
824
+ }
825
+ </div>
826
+ </div>
827
+ <div role="rowgroup">
828
+ @for (view of _items; track view.item.id) {
829
+ <div
830
+ class="row"
831
+ role="row"
832
+ tabindex="0"
833
+ [class.row--active]="view.item.id === _activeId"
834
+ [attr.data-item-id]="view.item.id"
835
+ [attr.data-autoid]="view.autoId"
836
+ (click)="activate.emit(view)"
837
+ (keydown)="onKeydown($event, view)">
838
+ <span class="cell cell--name" role="cell">
839
+ <sd-file-explorer-file-icon [icon]="view.icon" [size]="32" />
840
+ <span class="name" [title]="view.item.name">{{ view.item.name }}</span>
841
+ </span>
842
+ @if (!_compact) {
843
+ <span class="cell cell--modified" role="cell" [title]="view.modifiedTitle">{{ view.modifiedLabel || '—' }}</span>
844
+ }
845
+ <span class="cell cell--size" role="cell">{{ view.sizeLabel || '—' }}</span>
846
+ @if (_hasActions) {
847
+ <!-- why: sd-button already keeps its click from reaching the row; Enter/Space are stopped here so the key does not open the file too. -->
848
+ <span class="cell cell--action" role="cell">
849
+ @if (view.item.kind === 'file') {
850
+ @if (_canShare) {
851
+ <sd-button
852
+ class="row-action row-share"
853
+ type="text"
854
+ color="secondary"
855
+ size="sm"
856
+ prefixIcon="share"
857
+ [tooltip]="view.shareLabel"
858
+ [attr.data-autoid]="view.autoId ? view.autoId + '-share' : null"
859
+ (click)="share.emit(view)"
860
+ (keydown.enter)="$event.stopPropagation()"
861
+ (keydown.space)="$event.stopPropagation()" />
862
+ }
863
+ @if (_canDownload) {
864
+ <sd-button
865
+ class="row-action row-download"
866
+ type="text"
867
+ color="secondary"
868
+ size="sm"
869
+ prefixIcon="file_download"
870
+ [tooltip]="view.downloadLabel"
871
+ [attr.data-autoid]="view.autoId ? view.autoId + '-download' : null"
872
+ (click)="download.emit(view)"
873
+ (keydown.enter)="$event.stopPropagation()"
874
+ (keydown.space)="$event.stopPropagation()" />
875
+ }
876
+ }
877
+ </span>
878
+ }
879
+ </div>
880
+ }
881
+ </div>
882
+ </div>
883
+ } @else {
884
+ <ul class="grid" [attr.aria-label]="label()">
885
+ @for (view of _items; track view.item.id) {
886
+ <li
887
+ class="card"
888
+ tabindex="0"
889
+ [class.card--active]="view.item.id === _activeId"
890
+ [attr.data-item-id]="view.item.id"
891
+ [attr.data-autoid]="view.autoId"
892
+ [attr.aria-label]="view.item.name + ', ' + view.typeLabel"
893
+ (click)="activate.emit(view)"
894
+ (keydown)="onKeydown($event, view)">
895
+ <span class="thumb">
896
+ @if (view.item.thumbnailUrl) {
897
+ <img [src]="view.item.thumbnailUrl" alt="" loading="lazy" />
898
+ } @else {
899
+ <sd-file-explorer-file-icon [icon]="view.icon" [size]="48" />
900
+ }
901
+ </span>
902
+ <span class="card-name" [title]="view.item.name">{{ view.item.name }}</span>
903
+ </li>
904
+ }
905
+ </ul>
906
+ }
907
+ `, styles: [":host{display:block}.list{width:100%}.row{display:grid;grid-template-columns:minmax(0,1fr) 128px 88px var(--sd-fe-actions-width, 44px);align-items:center;min-height:62px;border-bottom:1px solid var(--sd-fe-border);color:var(--sd-fe-text);font-size:var(--sd-font-size-15, 15px);cursor:pointer;outline:none;transition:background-color var(--sd-duration-fast, .12s) ease}.row:hover{background:var(--sd-fe-hover)}.row:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 128px 88px}.row--head{min-height:34px;color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px);cursor:default}.row--head:hover{background:transparent}.row--active,.row--active:hover{background:var(--sd-fe-accent-soft)}.cell{min-width:0;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell--name{display:flex;align-items:center;gap:16px}.row:not(.row--head) .cell--modified,.row:not(.row--head) .cell--size{color:var(--sd-fe-text-secondary);font-size:var(--sd-font-size-13, 13px)}.cell--action{display:flex;align-items:center;justify-content:flex-end;gap:2px;padding:0 4px 0 0;overflow:visible}.name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .row{grid-template-columns:minmax(0,1fr) 66px var(--sd-fe-actions-width, 36px);min-height:55px;font-size:var(--sd-font-size-14, 14px)}:host(.sd-file-explorer-item-list--compact) .list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 66px}:host(.sd-file-explorer-item-list--compact) .row--head{min-height:30px;font-size:var(--sd-font-size-12, 12px)}:host(.sd-file-explorer-item-list--compact) .cell--name{gap:12px}:host(.sd-file-explorer-item-list--compact) .cell{padding:0 4px}:host(.sd-file-explorer-item-list--compact) .cell--action{padding:0}.grid{list-style:none;margin:0;padding:4px 0 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px 20px}.card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:12px 12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-surface);color:var(--sd-fe-text);cursor:pointer;outline:none;transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.card:hover{border-color:var(--sd-fe-border-strong);box-shadow:0 2px 8px #0f172a0f}.card:focus-visible{box-shadow:0 0 0 2px var(--sd-fe-accent)}.card--active{border-color:var(--sd-fe-accent)}.thumb{display:flex;align-items:center;justify-content:center;height:104px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-muted-surface)}.thumb img{width:100%;height:100%;object-fit:cover}.card-name{padding:0 2px;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}@media(prefers-reduced-motion:reduce){.row,.card{transition:none}}\n"] }]
908
+ }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], canDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "canShare", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], activate: [{ type: i0.Output, args: ["activate"] }], download: [{ type: i0.Output, args: ["download"] }], share: [{ type: i0.Output, args: ["share"] }] } });
909
+
910
+ /**
911
+ * File detail of the explorer (internal): an `<sd-side-drawer>` opened in the explorer's item area (right of the
912
+ * folder tree, below the header) through the drawer's `container` input, with the preview stage and metadata in its
913
+ * body and share / download in its footer.
914
+ *
915
+ * The explorer owns the open file: a non-null `view` opens the drawer, `null` closes it. When the user closes
916
+ * the drawer (close button, `Escape`, backdrop) the panel emits `close`.
917
+ *
918
+ * PDFs render with `<sd-preview-pdf>` and videos with `<sd-preview-video>`. Both come from
919
+ * `@sdcorejs/angular/components/preview`, imported on demand: that chunk (PDF.js included) is only fetched the
920
+ * first time a PDF or a video is previewed.
921
+ */
922
+ class SdFileExplorerPreviewPanel {
923
+ /** File shown in the drawer; `null` closes the drawer. */
924
+ view = input(null, ...(ngDevMode ? [{ debugName: "view" }] : []));
925
+ /** What the stage renders. */
926
+ state = input.required(...(ngDevMode ? [{ debugName: "state" }] : []));
927
+ /** Metadata rows (name, type, size, modified). */
928
+ meta = input([], ...(ngDevMode ? [{ debugName: "meta" }] : []));
929
+ /** Show the download button. */
930
+ canDownload = input(false, ...(ngDevMode ? [{ debugName: "canDownload" }] : []));
931
+ /** Show the share button. */
932
+ canShare = input(false, ...(ngDevMode ? [{ debugName: "canShare" }] : []));
933
+ /** Element the drawer opens inside: the explorer's item area, right of the folder tree. */
934
+ container = input(null, ...(ngDevMode ? [{ debugName: "container" }] : []));
935
+ /** E2E scope of the detail content and its buttons. */
936
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : []));
937
+ /** The user closed the drawer (close button, `Escape` or backdrop). */
938
+ close = output();
939
+ /** Download button pressed. */
940
+ download = output();
941
+ /** Share button pressed. */
942
+ share = output();
943
+ /** Retry button of the error state pressed. */
944
+ retry = output();
945
+ /** The `<img>` failed to load. */
946
+ imageError = output();
947
+ drawer = viewChild(SdSideDrawer, ...(ngDevMode ? [{ debugName: "drawer" }] : []));
948
+ drawerTitle = computed(() => this.view()?.item.name ?? '', ...(ngDevMode ? [{ debugName: "drawerTitle" }] : []));
949
+ // why: sd-side-drawer tự thêm tiền tố `components-side-drawer-`; bỏ `components-` của autoId explorer cho khỏi lặp.
950
+ drawerAutoId = computed(() => this.autoId()?.replace(/^components-/, ''), ...(ngDevMode ? [{ debugName: "drawerAutoId" }] : []));
951
+ pdfComponent = signal(null, ...(ngDevMode ? [{ debugName: "pdfComponent" }] : []));
952
+ videoComponent = signal(null, ...(ngDevMode ? [{ debugName: "videoComponent" }] : []));
953
+ viewerFailed = signal(false, ...(ngDevMode ? [{ debugName: "viewerFailed" }] : []));
954
+ #viewersRequested = false;
955
+ pdfInputs = computed(() => {
956
+ const state = this.state();
957
+ if (state.status !== 'pdf')
958
+ return {};
959
+ return {
960
+ source: state.source,
961
+ title: this.view()?.item.name ?? '',
962
+ theme: 'light',
963
+ sidebar: 'none',
964
+ sidebarOpen: false,
965
+ // why: toolbar nổi (trang/zoom) tràn ngang trong panel ~350px; header của viewer vẫn giữ tìm kiếm/in/toàn màn hình.
966
+ showToolbar: false,
967
+ downloadable: false,
968
+ initialZoom: 'page-width',
969
+ };
970
+ }, ...(ngDevMode ? [{ debugName: "pdfInputs" }] : []));
971
+ videoInputs = computed(() => {
972
+ const state = this.state();
973
+ if (state.status !== 'video')
974
+ return {};
975
+ return {
976
+ source: state.source,
977
+ fileName: this.view()?.item.name ?? '',
978
+ // why: the drawer footer already downloads through option.download, so the player hides its own button.
979
+ downloadable: false,
980
+ autoId: this.drawerAutoId(),
981
+ };
982
+ }, ...(ngDevMode ? [{ debugName: "videoInputs" }] : []));
983
+ constructor() {
984
+ effect(() => {
985
+ const drawer = this.drawer();
986
+ const open = this.view() !== null;
987
+ if (!drawer)
988
+ return;
989
+ untracked(() => {
990
+ if (open && !drawer.isOpened())
991
+ drawer.open();
992
+ else if (!open && drawer.isOpened())
993
+ drawer.forceClose();
994
+ });
995
+ });
996
+ effect(() => {
997
+ const status = this.state().status;
998
+ if (status !== 'pdf' && status !== 'video')
999
+ return;
1000
+ untracked(() => this.#loadViewers());
1001
+ });
1002
+ }
1003
+ onDrawerClosed() {
1004
+ // Explorer tự đóng (view đã là null) thì không báo lại; chỉ báo khi người dùng đóng drawer.
1005
+ if (this.view())
1006
+ this.close.emit();
1007
+ }
1008
+ async #loadViewers() {
1009
+ if (this.#viewersRequested)
1010
+ return;
1011
+ this.#viewersRequested = true;
1012
+ try {
1013
+ // why: import động để PDF.js (+ worker inline ~1.4 MB) tách chunk riêng — consumer không xem PDF/video thì không tải.
1014
+ const module = await import('@sdcorejs/angular/components/preview');
1015
+ this.pdfComponent.set(module.SdPreviewPdf);
1016
+ this.videoComponent.set(module.SdPreviewVideo);
1017
+ }
1018
+ catch {
1019
+ this.#viewersRequested = false;
1020
+ this.viewerFailed.set(true);
1021
+ }
1022
+ }
1023
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerPreviewPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
1024
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdFileExplorerPreviewPanel, isStandalone: true, selector: "sd-file-explorer-preview-panel", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, canDownload: { classPropertyName: "canDownload", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canShare: { classPropertyName: "canShare", publicName: "canShare", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", download: "download", share: "share", retry: "retry", imageError: "imageError" }, host: { classAttribute: "sd-file-explorer-preview-panel" }, viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }], ngImport: i0, template: `
1025
+ @let _view = view();
1026
+ @let _state = state();
1027
+ @let _autoId = autoId();
1028
+ @let _canDownload = canDownload();
1029
+ @let _canShare = canShare();
1030
+ <sd-side-drawer width="420px" [container]="container()" [title]="drawerTitle()" [autoId]="drawerAutoId()" (sdClosed)="onDrawerClosed()">
1031
+ @if (_view) {
1032
+ <div class="detail" [attr.data-autoid]="_autoId ?? null">
1033
+ <div
1034
+ class="stage"
1035
+ [class.stage--pdf]="_state.status === 'pdf'"
1036
+ [class.stage--video]="_state.status === 'video'"
1037
+ [attr.aria-busy]="_state.status === 'loading' ? true : null">
1038
+ @switch (_state.status) {
1039
+ @case ('image') {
1040
+ <img class="image" [src]="_state.url" [alt]="_view.item.name" (error)="imageError.emit()" />
1041
+ }
1042
+ @case ('pdf') {
1043
+ @let _pdf = pdfComponent();
1044
+ @if (_pdf) {
1045
+ <ng-container *ngComponentOutlet="_pdf; inputs: pdfInputs()" />
1046
+ } @else {
1047
+ <ng-container [ngTemplateOutlet]="viewerPending" />
1048
+ }
1049
+ }
1050
+ @case ('video') {
1051
+ @let _video = videoComponent();
1052
+ @if (_video) {
1053
+ <ng-container *ngComponentOutlet="_video; inputs: videoInputs()" />
1054
+ } @else {
1055
+ <ng-container [ngTemplateOutlet]="viewerPending" />
1056
+ }
1057
+ }
1058
+ @case ('loading') {
1059
+ <div class="placeholder">
1060
+ <span class="spinner" aria-hidden="true"></span>
1061
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.loading' | sdTranslate }}</p>
1062
+ </div>
1063
+ }
1064
+ @case ('error') {
1065
+ <div class="placeholder placeholder--error" role="alert">
1066
+ <sd-icon name="error_outline" size="32px" />
1067
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.error' | sdTranslate }}</p>
1068
+ @if (_state.message) {
1069
+ <p class="placeholder-hint">{{ _state.message }}</p>
1070
+ }
1071
+ <sd-button
1072
+ class="retry-button"
1073
+ type="outline"
1074
+ color="secondary"
1075
+ size="sm"
1076
+ prefixIcon="refresh"
1077
+ [title]="'core.component.file-explorer.retry' | sdTranslate"
1078
+ [attr.data-autoid]="_autoId ? _autoId + '-retry' : null"
1079
+ (click)="retry.emit()" />
1080
+ </div>
1081
+ }
1082
+ @default {
1083
+ <div class="placeholder">
1084
+ <sd-file-explorer-file-icon [icon]="_view.icon" [size]="64" />
1085
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.unavailable' | sdTranslate }}</p>
1086
+ @if (_canDownload) {
1087
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.unavailable-hint' | sdTranslate }}</p>
1088
+ }
1089
+ </div>
1090
+ }
1091
+ }
1092
+ </div>
1093
+
1094
+ <dl class="meta">
1095
+ @for (row of meta(); track row.label) {
1096
+ <div class="meta-row">
1097
+ <dt>{{ row.label }}</dt>
1098
+ <dd [title]="row.value">{{ row.value }}</dd>
1099
+ </div>
1100
+ }
1101
+ </dl>
1102
+ </div>
1103
+ }
1104
+ <!-- why: each @if has a single root element carrying sdFooterRight, so Angular projects it into the drawer right footer slot. -->
1105
+ @if (_view && _canShare) {
1106
+ <sd-button
1107
+ sdFooterRight
1108
+ class="share-button"
1109
+ [type]="_canDownload ? 'outline' : 'fill'"
1110
+ [color]="_canDownload ? 'secondary' : 'primary'"
1111
+ prefixIcon="share"
1112
+ [title]="'core.component.file-explorer.share' | sdTranslate"
1113
+ [attr.data-autoid]="_autoId ? _autoId + '-share' : null"
1114
+ (click)="share.emit()" />
1115
+ }
1116
+ @if (_view && _canDownload) {
1117
+ <sd-button
1118
+ sdFooterRight
1119
+ class="download-button"
1120
+ type="fill"
1121
+ color="primary"
1122
+ prefixIcon="file_download"
1123
+ [title]="'core.component.file-explorer.download' | sdTranslate"
1124
+ [attr.data-autoid]="_autoId ? _autoId + '-download' : null"
1125
+ (click)="download.emit()" />
1126
+ }
1127
+ </sd-side-drawer>
1128
+
1129
+ <!-- Stage of a PDF or video while its viewer chunk loads, or when that import failed. -->
1130
+ <ng-template #viewerPending>
1131
+ @if (viewerFailed()) {
1132
+ <div class="placeholder placeholder--error">
1133
+ <sd-icon name="error_outline" size="32px" />
1134
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.error' | sdTranslate }}</p>
1135
+ </div>
1136
+ } @else {
1137
+ <div class="placeholder">
1138
+ <span class="spinner" aria-hidden="true"></span>
1139
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.loading' | sdTranslate }}</p>
1140
+ </div>
1141
+ }
1142
+ </ng-template>
1143
+ `, isInline: true, styles: [":host{display:none}.detail{display:flex;flex-direction:column;height:100%}.stage{display:flex;flex:0 1 216px;align-items:center;justify-content:center;min-height:140px;padding:14px;overflow:hidden;border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-preview-bg)}.stage--pdf{flex-basis:380px;min-height:240px;padding:0;background:var(--sd-fe-muted-surface)}.stage--pdf>*{width:100%;height:100%;min-height:0}.stage--video{flex:none;min-height:216px;padding:0;background:var(--sd-fe-muted-surface)}.stage--video>*{width:100%}.image{display:block;max-width:100%;max-height:100%;border-radius:var(--sd-radius-6, 6px);object-fit:contain}.placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:var(--sd-fe-text-secondary)}.placeholder--error{color:var(--sd-fe-error)}.placeholder--error sd-button{margin-top:4px}.placeholder-title{margin:4px 0 0;color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600)}.placeholder-hint{margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-text-secondary)}.spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-preview-spin .8s linear infinite}.meta{flex:none;margin:20px 0 0;padding:4px 0 0;border-top:1px solid var(--sd-fe-border)}.meta-row{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:baseline;gap:12px;padding:10px 0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.meta-row dt{color:var(--sd-fe-text-secondary)}.meta-row dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes sd-file-explorer-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1144
+ }
1145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerPreviewPanel, decorators: [{
1146
+ type: Component,
1147
+ args: [{ selector: 'sd-file-explorer-preview-panel', standalone: true, imports: [NgComponentOutlet, NgTemplateOutlet, SdButton, SdIcon, SdSideDrawer, SdTranslatePipe, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1148
+ class: 'sd-file-explorer-preview-panel',
1149
+ }, template: `
1150
+ @let _view = view();
1151
+ @let _state = state();
1152
+ @let _autoId = autoId();
1153
+ @let _canDownload = canDownload();
1154
+ @let _canShare = canShare();
1155
+ <sd-side-drawer width="420px" [container]="container()" [title]="drawerTitle()" [autoId]="drawerAutoId()" (sdClosed)="onDrawerClosed()">
1156
+ @if (_view) {
1157
+ <div class="detail" [attr.data-autoid]="_autoId ?? null">
1158
+ <div
1159
+ class="stage"
1160
+ [class.stage--pdf]="_state.status === 'pdf'"
1161
+ [class.stage--video]="_state.status === 'video'"
1162
+ [attr.aria-busy]="_state.status === 'loading' ? true : null">
1163
+ @switch (_state.status) {
1164
+ @case ('image') {
1165
+ <img class="image" [src]="_state.url" [alt]="_view.item.name" (error)="imageError.emit()" />
1166
+ }
1167
+ @case ('pdf') {
1168
+ @let _pdf = pdfComponent();
1169
+ @if (_pdf) {
1170
+ <ng-container *ngComponentOutlet="_pdf; inputs: pdfInputs()" />
1171
+ } @else {
1172
+ <ng-container [ngTemplateOutlet]="viewerPending" />
1173
+ }
1174
+ }
1175
+ @case ('video') {
1176
+ @let _video = videoComponent();
1177
+ @if (_video) {
1178
+ <ng-container *ngComponentOutlet="_video; inputs: videoInputs()" />
1179
+ } @else {
1180
+ <ng-container [ngTemplateOutlet]="viewerPending" />
1181
+ }
1182
+ }
1183
+ @case ('loading') {
1184
+ <div class="placeholder">
1185
+ <span class="spinner" aria-hidden="true"></span>
1186
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.loading' | sdTranslate }}</p>
1187
+ </div>
1188
+ }
1189
+ @case ('error') {
1190
+ <div class="placeholder placeholder--error" role="alert">
1191
+ <sd-icon name="error_outline" size="32px" />
1192
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.error' | sdTranslate }}</p>
1193
+ @if (_state.message) {
1194
+ <p class="placeholder-hint">{{ _state.message }}</p>
1195
+ }
1196
+ <sd-button
1197
+ class="retry-button"
1198
+ type="outline"
1199
+ color="secondary"
1200
+ size="sm"
1201
+ prefixIcon="refresh"
1202
+ [title]="'core.component.file-explorer.retry' | sdTranslate"
1203
+ [attr.data-autoid]="_autoId ? _autoId + '-retry' : null"
1204
+ (click)="retry.emit()" />
1205
+ </div>
1206
+ }
1207
+ @default {
1208
+ <div class="placeholder">
1209
+ <sd-file-explorer-file-icon [icon]="_view.icon" [size]="64" />
1210
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.unavailable' | sdTranslate }}</p>
1211
+ @if (_canDownload) {
1212
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.unavailable-hint' | sdTranslate }}</p>
1213
+ }
1214
+ </div>
1215
+ }
1216
+ }
1217
+ </div>
1218
+
1219
+ <dl class="meta">
1220
+ @for (row of meta(); track row.label) {
1221
+ <div class="meta-row">
1222
+ <dt>{{ row.label }}</dt>
1223
+ <dd [title]="row.value">{{ row.value }}</dd>
1224
+ </div>
1225
+ }
1226
+ </dl>
1227
+ </div>
1228
+ }
1229
+ <!-- why: each @if has a single root element carrying sdFooterRight, so Angular projects it into the drawer right footer slot. -->
1230
+ @if (_view && _canShare) {
1231
+ <sd-button
1232
+ sdFooterRight
1233
+ class="share-button"
1234
+ [type]="_canDownload ? 'outline' : 'fill'"
1235
+ [color]="_canDownload ? 'secondary' : 'primary'"
1236
+ prefixIcon="share"
1237
+ [title]="'core.component.file-explorer.share' | sdTranslate"
1238
+ [attr.data-autoid]="_autoId ? _autoId + '-share' : null"
1239
+ (click)="share.emit()" />
1240
+ }
1241
+ @if (_view && _canDownload) {
1242
+ <sd-button
1243
+ sdFooterRight
1244
+ class="download-button"
1245
+ type="fill"
1246
+ color="primary"
1247
+ prefixIcon="file_download"
1248
+ [title]="'core.component.file-explorer.download' | sdTranslate"
1249
+ [attr.data-autoid]="_autoId ? _autoId + '-download' : null"
1250
+ (click)="download.emit()" />
1251
+ }
1252
+ </sd-side-drawer>
1253
+
1254
+ <!-- Stage of a PDF or video while its viewer chunk loads, or when that import failed. -->
1255
+ <ng-template #viewerPending>
1256
+ @if (viewerFailed()) {
1257
+ <div class="placeholder placeholder--error">
1258
+ <sd-icon name="error_outline" size="32px" />
1259
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.error' | sdTranslate }}</p>
1260
+ </div>
1261
+ } @else {
1262
+ <div class="placeholder">
1263
+ <span class="spinner" aria-hidden="true"></span>
1264
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.loading' | sdTranslate }}</p>
1265
+ </div>
1266
+ }
1267
+ </ng-template>
1268
+ `, styles: [":host{display:none}.detail{display:flex;flex-direction:column;height:100%}.stage{display:flex;flex:0 1 216px;align-items:center;justify-content:center;min-height:140px;padding:14px;overflow:hidden;border-radius:var(--sd-radius-12, 12px);background:var(--sd-fe-preview-bg)}.stage--pdf{flex-basis:380px;min-height:240px;padding:0;background:var(--sd-fe-muted-surface)}.stage--pdf>*{width:100%;height:100%;min-height:0}.stage--video{flex:none;min-height:216px;padding:0;background:var(--sd-fe-muted-surface)}.stage--video>*{width:100%}.image{display:block;max-width:100%;max-height:100%;border-radius:var(--sd-radius-6, 6px);object-fit:contain}.placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:var(--sd-fe-text-secondary)}.placeholder--error{color:var(--sd-fe-error)}.placeholder--error sd-button{margin-top:4px}.placeholder-title{margin:4px 0 0;color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600)}.placeholder-hint{margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-text-secondary)}.spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-preview-spin .8s linear infinite}.meta{flex:none;margin:20px 0 0;padding:4px 0 0;border-top:1px solid var(--sd-fe-border)}.meta-row{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:baseline;gap:12px;padding:10px 0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.meta-row dt{color:var(--sd-fe-text-secondary)}.meta-row dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes sd-file-explorer-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
1269
+ }], ctorParameters: () => [], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], canDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "canShare", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], download: [{ type: i0.Output, args: ["download"] }], share: [{ type: i0.Output, args: ["share"] }], retry: [{ type: i0.Output, args: ["retry"] }], imageError: [{ type: i0.Output, args: ["imageError"] }], drawer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdSideDrawer), { isSignal: true }] }] } });
1270
+
1271
+ let nextTransferPanelId = 0;
1272
+ /**
1273
+ * Transfer queue docked at the bottom of the explorer (internal). Shows one card per upload / download with
1274
+ * its status, a progress bar and the cancel / retry / dismiss actions allowed by its state.
1275
+ */
1276
+ class SdFileExplorerTransferPanel {
1277
+ /** Cards to render, newest last. */
1278
+ transfers = input.required(...(ngDevMode ? [{ debugName: "transfers" }] : []));
1279
+ /** Header text ("Transfers · 2 items"). */
1280
+ title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
1281
+ /** Hide the cards, keep the header. */
1282
+ collapsed = input(false, ...(ngDevMode ? [{ debugName: "collapsed" }] : []));
1283
+ /** Show the "Clear finished" button. */
1284
+ canClear = input(false, ...(ngDevMode ? [{ debugName: "canClear" }] : []));
1285
+ /** Narrow layout: "Clear finished" becomes an icon button so the header stays on one line. */
1286
+ compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : []));
1287
+ /** E2E scope of the panel. */
1288
+ autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : []));
1289
+ toggleCollapsed = output();
1290
+ clear = output();
1291
+ cancel = output();
1292
+ retry = output();
1293
+ dismiss = output();
1294
+ titleId = `sd-file-explorer-transfers-title-${nextTransferPanelId}`;
1295
+ listId = `sd-file-explorer-transfers-list-${nextTransferPanelId++}`;
1296
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerTransferPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
1297
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdFileExplorerTransferPanel, isStandalone: true, selector: "sd-file-explorer-transfer-panel", inputs: { transfers: { classPropertyName: "transfers", publicName: "transfers", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, canClear: { classPropertyName: "canClear", publicName: "canClear", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleCollapsed: "toggleCollapsed", clear: "clear", cancel: "cancel", retry: "retry", dismiss: "dismiss" }, host: { properties: { "class.sd-file-explorer-transfer-panel--compact": "compact()" }, classAttribute: "sd-file-explorer-transfer-panel" }, ngImport: i0, template: `
1298
+ @let _collapsed = collapsed();
1299
+ @let _autoId = autoId();
1300
+ @let _compact = compact();
1301
+ @let _clearLabel = 'core.component.file-explorer.transfers.clear' | sdTranslate;
1302
+ <section class="panel" [attr.aria-labelledby]="titleId">
1303
+ <header class="head">
1304
+ <svg class="head-icon" viewBox="0 0 24 24" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
1305
+ <path
1306
+ d="M12 4v16M7.5 8.5 12 4l4.5 4.5M7.5 15.5 12 20l4.5-4.5"
1307
+ fill="none"
1308
+ stroke="currentColor"
1309
+ stroke-width="2"
1310
+ stroke-linecap="round"
1311
+ stroke-linejoin="round" />
1312
+ </svg>
1313
+ <h3 class="title" [id]="titleId" [title]="title()">{{ title() }}</h3>
1314
+ @if (canClear()) {
1315
+ <sd-button
1316
+ class="clear-button"
1317
+ type="text"
1318
+ color="primary"
1319
+ size="sm"
1320
+ [prefixIcon]="_compact ? 'delete_sweep' : undefined"
1321
+ [title]="_compact ? undefined : _clearLabel"
1322
+ [tooltip]="_compact ? _clearLabel : undefined"
1323
+ [attr.data-autoid]="_autoId ? _autoId + '-clear' : null"
1324
+ (click)="clear.emit()" />
1325
+ }
1326
+ <button
1327
+ type="button"
1328
+ class="icon-button"
1329
+ [attr.aria-expanded]="!_collapsed"
1330
+ [attr.aria-controls]="listId"
1331
+ [attr.aria-label]="
1332
+ (_collapsed ? 'core.component.file-explorer.transfers.expand' : 'core.component.file-explorer.transfers.collapse') | sdTranslate
1333
+ "
1334
+ [attr.data-autoid]="_autoId ? _autoId + '-toggle' : null"
1335
+ (click)="toggleCollapsed.emit()">
1336
+ <sd-icon [name]="_collapsed ? 'expand_less' : 'expand_more'" size="22px" />
1337
+ </button>
1338
+ </header>
1339
+ <ul class="cards" [id]="listId" [hidden]="_collapsed" [attr.aria-label]="'core.component.file-explorer.transfers.list' | sdTranslate">
1340
+ @for (view of transfers(); track view.transfer.id) {
1341
+ <li class="card" [class]="'card--' + view.tone" [attr.data-autoid]="view.autoId">
1342
+ <div class="card-row">
1343
+ <sd-icon
1344
+ class="direction"
1345
+ [name]="view.transfer.direction === 'upload' ? 'file_upload' : 'file_download'"
1346
+ size="22px"
1347
+ [ariaLabel]="view.directionLabel" />
1348
+ <span class="name" [title]="view.transfer.name">{{ view.transfer.name }}</span>
1349
+ <span class="status">{{ view.statusLabel }}</span>
1350
+ @if (view.canCancel) {
1351
+ <sd-button
1352
+ class="card-action"
1353
+ type="text"
1354
+ color="secondary"
1355
+ size="sm"
1356
+ prefixIcon="close"
1357
+ [tooltip]="view.cancelLabel"
1358
+ [attr.data-autoid]="view.autoId ? view.autoId + '-cancel' : null"
1359
+ (click)="cancel.emit(view.transfer.id)" />
1360
+ }
1361
+ @if (view.canRetry) {
1362
+ <sd-button
1363
+ class="card-action"
1364
+ type="text"
1365
+ color="secondary"
1366
+ size="sm"
1367
+ prefixIcon="refresh"
1368
+ [tooltip]="view.retryLabel"
1369
+ [attr.data-autoid]="view.autoId ? view.autoId + '-retry' : null"
1370
+ (click)="retry.emit(view.transfer.id)" />
1371
+ }
1372
+ @if (view.canDismiss) {
1373
+ <sd-button
1374
+ class="card-action"
1375
+ type="text"
1376
+ color="secondary"
1377
+ size="sm"
1378
+ prefixIcon="close"
1379
+ [tooltip]="view.dismissLabel"
1380
+ [attr.data-autoid]="view.autoId ? view.autoId + '-dismiss' : null"
1381
+ (click)="dismiss.emit(view.transfer.id)" />
1382
+ }
1383
+ </div>
1384
+ <div
1385
+ class="bar"
1386
+ role="progressbar"
1387
+ aria-valuemin="0"
1388
+ aria-valuemax="100"
1389
+ [class.bar--indeterminate]="view.progress === 'indeterminate'"
1390
+ [attr.aria-valuenow]="view.progress === 'determinate' ? view.percent : view.progress === 'full' ? 100 : null"
1391
+ [attr.aria-label]="view.transfer.name + ': ' + view.statusLabel">
1392
+ <span
1393
+ class="bar-fill"
1394
+ [style.width.%]="view.progress === 'determinate' ? view.percent : view.progress === 'none' ? 0 : 100"></span>
1395
+ </div>
1396
+ @if (view.errorMessage) {
1397
+ <p class="error" [title]="view.errorMessage">{{ view.errorMessage }}</p>
1398
+ }
1399
+ </li>
1400
+ }
1401
+ </ul>
1402
+ </section>
1403
+ `, isInline: true, styles: [":host{display:block}.panel{padding:12px 20px 18px}:host(.sd-file-explorer-transfer-panel--compact) .panel{padding:10px 14px 14px}.head{display:flex;align-items:center;gap:10px;min-height:32px}.head-icon{flex:none;width:22px;height:22px;color:var(--sd-fe-accent)}.title{flex:1;min-width:0;margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.cards{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:12px 20px;max-height:188px;overflow-y:auto}.cards[hidden]{display:none}.card{display:flex;flex-direction:column;gap:11px;min-width:0;padding:12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-10, 10px);background:var(--sd-fe-surface)}.card-row{display:flex;align-items:center;gap:10px;min-height:22px}.direction{flex:none;color:var(--sd-fe-accent)}.name{flex:1;min-width:0;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.status{flex:none;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary);font-variant-numeric:tabular-nums}.bar{position:relative;height:6px;overflow:hidden;border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-track)}.bar-fill{position:absolute;inset:0 auto 0 0;border-radius:inherit;background:var(--sd-fe-accent);transition:width var(--sd-duration-base, .2s) ease}.bar--indeterminate .bar-fill{width:36%!important;animation:sd-file-explorer-indeterminate 1.3s ease-in-out infinite}.card--success .bar-fill{background:var(--sd-fe-success)}.card--error{border-color:color-mix(in srgb,var(--sd-fe-error) 35%,var(--sd-fe-border))}.card--error .bar-fill{background:var(--sd-fe-error)}.card--error .status{color:var(--sd-fe-error);font-weight:var(--sd-font-weight-semibold, 600)}.card--muted .bar-fill{background:var(--sd-fe-border-strong)}.error{margin:-4px 0 0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);color:var(--sd-fe-error);text-overflow:ellipsis;white-space:nowrap}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.card-action{flex:none;margin:-5px -6px -5px -2px}.clear-button{flex:none}@keyframes sd-file-explorer-indeterminate{0%{left:-36%}to{left:100%}}@media(prefers-reduced-motion:reduce){.bar--indeterminate .bar-fill{animation-duration:3s}.bar-fill{transition:none}}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1404
+ }
1405
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorerTransferPanel, decorators: [{
1406
+ type: Component,
1407
+ args: [{ selector: 'sd-file-explorer-transfer-panel', standalone: true, imports: [SdButton, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'sd-file-explorer-transfer-panel', '[class.sd-file-explorer-transfer-panel--compact]': 'compact()' }, template: `
1408
+ @let _collapsed = collapsed();
1409
+ @let _autoId = autoId();
1410
+ @let _compact = compact();
1411
+ @let _clearLabel = 'core.component.file-explorer.transfers.clear' | sdTranslate;
1412
+ <section class="panel" [attr.aria-labelledby]="titleId">
1413
+ <header class="head">
1414
+ <svg class="head-icon" viewBox="0 0 24 24" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
1415
+ <path
1416
+ d="M12 4v16M7.5 8.5 12 4l4.5 4.5M7.5 15.5 12 20l4.5-4.5"
1417
+ fill="none"
1418
+ stroke="currentColor"
1419
+ stroke-width="2"
1420
+ stroke-linecap="round"
1421
+ stroke-linejoin="round" />
1422
+ </svg>
1423
+ <h3 class="title" [id]="titleId" [title]="title()">{{ title() }}</h3>
1424
+ @if (canClear()) {
1425
+ <sd-button
1426
+ class="clear-button"
1427
+ type="text"
1428
+ color="primary"
1429
+ size="sm"
1430
+ [prefixIcon]="_compact ? 'delete_sweep' : undefined"
1431
+ [title]="_compact ? undefined : _clearLabel"
1432
+ [tooltip]="_compact ? _clearLabel : undefined"
1433
+ [attr.data-autoid]="_autoId ? _autoId + '-clear' : null"
1434
+ (click)="clear.emit()" />
1435
+ }
1436
+ <button
1437
+ type="button"
1438
+ class="icon-button"
1439
+ [attr.aria-expanded]="!_collapsed"
1440
+ [attr.aria-controls]="listId"
1441
+ [attr.aria-label]="
1442
+ (_collapsed ? 'core.component.file-explorer.transfers.expand' : 'core.component.file-explorer.transfers.collapse') | sdTranslate
1443
+ "
1444
+ [attr.data-autoid]="_autoId ? _autoId + '-toggle' : null"
1445
+ (click)="toggleCollapsed.emit()">
1446
+ <sd-icon [name]="_collapsed ? 'expand_less' : 'expand_more'" size="22px" />
1447
+ </button>
1448
+ </header>
1449
+ <ul class="cards" [id]="listId" [hidden]="_collapsed" [attr.aria-label]="'core.component.file-explorer.transfers.list' | sdTranslate">
1450
+ @for (view of transfers(); track view.transfer.id) {
1451
+ <li class="card" [class]="'card--' + view.tone" [attr.data-autoid]="view.autoId">
1452
+ <div class="card-row">
1453
+ <sd-icon
1454
+ class="direction"
1455
+ [name]="view.transfer.direction === 'upload' ? 'file_upload' : 'file_download'"
1456
+ size="22px"
1457
+ [ariaLabel]="view.directionLabel" />
1458
+ <span class="name" [title]="view.transfer.name">{{ view.transfer.name }}</span>
1459
+ <span class="status">{{ view.statusLabel }}</span>
1460
+ @if (view.canCancel) {
1461
+ <sd-button
1462
+ class="card-action"
1463
+ type="text"
1464
+ color="secondary"
1465
+ size="sm"
1466
+ prefixIcon="close"
1467
+ [tooltip]="view.cancelLabel"
1468
+ [attr.data-autoid]="view.autoId ? view.autoId + '-cancel' : null"
1469
+ (click)="cancel.emit(view.transfer.id)" />
1470
+ }
1471
+ @if (view.canRetry) {
1472
+ <sd-button
1473
+ class="card-action"
1474
+ type="text"
1475
+ color="secondary"
1476
+ size="sm"
1477
+ prefixIcon="refresh"
1478
+ [tooltip]="view.retryLabel"
1479
+ [attr.data-autoid]="view.autoId ? view.autoId + '-retry' : null"
1480
+ (click)="retry.emit(view.transfer.id)" />
1481
+ }
1482
+ @if (view.canDismiss) {
1483
+ <sd-button
1484
+ class="card-action"
1485
+ type="text"
1486
+ color="secondary"
1487
+ size="sm"
1488
+ prefixIcon="close"
1489
+ [tooltip]="view.dismissLabel"
1490
+ [attr.data-autoid]="view.autoId ? view.autoId + '-dismiss' : null"
1491
+ (click)="dismiss.emit(view.transfer.id)" />
1492
+ }
1493
+ </div>
1494
+ <div
1495
+ class="bar"
1496
+ role="progressbar"
1497
+ aria-valuemin="0"
1498
+ aria-valuemax="100"
1499
+ [class.bar--indeterminate]="view.progress === 'indeterminate'"
1500
+ [attr.aria-valuenow]="view.progress === 'determinate' ? view.percent : view.progress === 'full' ? 100 : null"
1501
+ [attr.aria-label]="view.transfer.name + ': ' + view.statusLabel">
1502
+ <span
1503
+ class="bar-fill"
1504
+ [style.width.%]="view.progress === 'determinate' ? view.percent : view.progress === 'none' ? 0 : 100"></span>
1505
+ </div>
1506
+ @if (view.errorMessage) {
1507
+ <p class="error" [title]="view.errorMessage">{{ view.errorMessage }}</p>
1508
+ }
1509
+ </li>
1510
+ }
1511
+ </ul>
1512
+ </section>
1513
+ `, styles: [":host{display:block}.panel{padding:12px 20px 18px}:host(.sd-file-explorer-transfer-panel--compact) .panel{padding:10px 14px 14px}.head{display:flex;align-items:center;gap:10px;min-height:32px}.head-icon{flex:none;width:22px;height:22px;color:var(--sd-fe-accent)}.title{flex:1;min-width:0;margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.cards{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:12px 20px;max-height:188px;overflow-y:auto}.cards[hidden]{display:none}.card{display:flex;flex-direction:column;gap:11px;min-width:0;padding:12px 14px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-10, 10px);background:var(--sd-fe-surface)}.card-row{display:flex;align-items:center;gap:10px;min-height:22px}.direction{flex:none;color:var(--sd-fe-accent)}.name{flex:1;min-width:0;overflow:hidden;font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.status{flex:none;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary);font-variant-numeric:tabular-nums}.bar{position:relative;height:6px;overflow:hidden;border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-track)}.bar-fill{position:absolute;inset:0 auto 0 0;border-radius:inherit;background:var(--sd-fe-accent);transition:width var(--sd-duration-base, .2s) ease}.bar--indeterminate .bar-fill{width:36%!important;animation:sd-file-explorer-indeterminate 1.3s ease-in-out infinite}.card--success .bar-fill{background:var(--sd-fe-success)}.card--error{border-color:color-mix(in srgb,var(--sd-fe-error) 35%,var(--sd-fe-border))}.card--error .bar-fill{background:var(--sd-fe-error)}.card--error .status{color:var(--sd-fe-error);font-weight:var(--sd-font-weight-semibold, 600)}.card--muted .bar-fill{background:var(--sd-fe-border-strong)}.error{margin:-4px 0 0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);color:var(--sd-fe-error);text-overflow:ellipsis;white-space:nowrap}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.card-action{flex:none;margin:-5px -6px -5px -2px}.clear-button{flex:none}@keyframes sd-file-explorer-indeterminate{0%{left:-36%}to{left:100%}}@media(prefers-reduced-motion:reduce){.bar--indeterminate .bar-fill{animation-duration:3s}.bar-fill{transition:none}}\n"] }]
1514
+ }], propDecorators: { transfers: [{ type: i0.Input, args: [{ isSignal: true, alias: "transfers", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], canClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "canClear", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], toggleCollapsed: [{ type: i0.Output, args: ["toggleCollapsed"] }], clear: [{ type: i0.Output, args: ["clear"] }], cancel: [{ type: i0.Output, args: ["cancel"] }], retry: [{ type: i0.Output, args: ["retry"] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }] } });
1515
+
1516
+ /** Delay between the last keystroke and the `search` callback. */
1517
+ const SEARCH_DEBOUNCE_MS = 300;
1518
+ /** Uploads running at the same time; extra files wait as `queued`. */
1519
+ const MAX_PARALLEL_UPLOADS = 3;
1520
+ /** Below this host width the explorer switches to the compact (mobile) layout. */
1521
+ const COMPACT_MAX_WIDTH = 720;
1522
+ /** How long a saved download's object URL stays alive before it is revoked. */
1523
+ const DOWNLOAD_URL_TTL_MS = 40_000;
1524
+ const ACTIVE_STATUSES = new Set(['queued', 'preparing', 'transferring']);
1525
+ const FINISHED_STATUSES = new Set(['done', 'error', 'cancelled']);
1526
+ let nextExplorerId = 0;
1527
+ /**
1528
+ * Google-Drive-like file browser: folder tree, breadcrumb, list / grid, search, file detail drawer, uploads with
1529
+ * drag-and-drop, downloads and a transfer queue — all inside one element.
1530
+ *
1531
+ * Storage-agnostic: every read and write goes through the callbacks of `SdFileExplorerOption`.
1532
+ *
1533
+ * @example
1534
+ * ```html
1535
+ * <sd-file-explorer [option]="option" (open)="onOpen($event)" />
1536
+ * ```
1537
+ */
1538
+ class SdFileExplorer {
1539
+ #i18n = inject(I18nService);
1540
+ #host = inject(ElementRef);
1541
+ #document = inject(DOCUMENT);
1542
+ #injector = inject(Injector);
1543
+ #zone = inject(NgZone);
1544
+ /** Data callbacks and display settings. See `SdFileExplorerOption`. */
1545
+ option = input.required(...(ngDevMode ? [{ debugName: "option" }] : []));
1546
+ /**
1547
+ * Emitted exactly once each time the user opens a file (click, `Enter` or `Space` on a file in the list,
1548
+ * grid or search results), right before the detail drawer starts loading. Never emitted for folders.
1549
+ */
1550
+ open = output();
1551
+ // ---- State ----
1552
+ #folders = signal(new Map(), ...(ngDevMode ? [{ debugName: "#folders" }] : []));
1553
+ #currentId = signal(null, ...(ngDevMode ? [{ debugName: "#currentId" }] : []));
1554
+ #path = signal([], ...(ngDevMode ? [{ debugName: "#path" }] : []));
1555
+ #expanded = signal(new Set(), ...(ngDevMode ? [{ debugName: "#expanded" }] : []));
1556
+ #search = signal(null, ...(ngDevMode ? [{ debugName: "#search" }] : []));
1557
+ #previewItem = signal(null, ...(ngDevMode ? [{ debugName: "#previewItem" }] : []));
1558
+ #transfers = signal([], ...(ngDevMode ? [{ debugName: "#transfers" }] : []));
1559
+ #width = signal(0, ...(ngDevMode ? [{ debugName: "#width" }] : []));
1560
+ view = signal('list', ...(ngDevMode ? [{ debugName: "view" }] : []));
1561
+ keyword = signal('', ...(ngDevMode ? [{ debugName: "keyword" }] : []));
1562
+ previewState = signal({ status: 'idle' }, ...(ngDevMode ? [{ debugName: "previewState" }] : []));
1563
+ transfersCollapsed = signal(false, ...(ngDevMode ? [{ debugName: "transfersCollapsed" }] : []));
1564
+ sidebarOpen = signal(false, ...(ngDevMode ? [{ debugName: "sidebarOpen" }] : []));
1565
+ dragActive = signal(false, ...(ngDevMode ? [{ debugName: "dragActive" }] : []));
1566
+ folderDialogOpen = signal(false, ...(ngDevMode ? [{ debugName: "folderDialogOpen" }] : []));
1567
+ folderName = signal('', ...(ngDevMode ? [{ debugName: "folderName" }] : []));
1568
+ folderSubmitting = signal(false, ...(ngDevMode ? [{ debugName: "folderSubmitting" }] : []));
1569
+ folderError = signal('', ...(ngDevMode ? [{ debugName: "folderError" }] : []));
1570
+ /** File whose share dialog is open. */
1571
+ shareItem = signal(null, ...(ngDevMode ? [{ debugName: "shareItem" }] : []));
1572
+ shareState = signal({ status: 'loading' }, ...(ngDevMode ? [{ debugName: "shareState" }] : []));
1573
+ /** Result of the last copy attempt: copied to the clipboard, or selected for a manual Ctrl+C. */
1574
+ // why: kiểu khai báo tường minh bằng alias — union tự suy ra được in vào d.ts theo thứ tự nội bộ của TypeScript,
1575
+ // thứ tự này đổi theo máy build (v22/TS 6 in khác nhau giữa checkout LF và CRLF) làm lệch snapshot release.
1576
+ shareFeedback = signal('', ...(ngDevMode ? [{ debugName: "shareFeedback" }] : []));
1577
+ /**
1578
+ * Uploads and downloads started in this explorer, oldest first. Read-only; use it for example to warn
1579
+ * before leaving the page while `status` is `queued`, `preparing` or `transferring`.
1580
+ */
1581
+ transfers = this.#transfers.asReadonly();
1582
+ searchInput = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "searchInput" }] : []));
1583
+ folderInput = viewChild('folderInput', ...(ngDevMode ? [{ debugName: "folderInput" }] : []));
1584
+ // why: đọc ElementRef của host <sd-button> — focus phải đặt vào <button> bên trong, không phải host.
1585
+ newFolderButton = viewChild('newFolderButton', ...(ngDevMode ? [{ debugName: "newFolderButton", read: ElementRef }] : [{ read: ElementRef }]));
1586
+ copyButton = viewChild('copyButton', ...(ngDevMode ? [{ debugName: "copyButton", read: ElementRef }] : [{ read: ElementRef }]));
1587
+ shareInput = viewChild('shareInput', ...(ngDevMode ? [{ debugName: "shareInput" }] : []));
1588
+ shareDialog = viewChild('shareDialog', ...(ngDevMode ? [{ debugName: "shareDialog" }] : []));
1589
+ sidebar = viewChild('sidebar', ...(ngDevMode ? [{ debugName: "sidebar" }] : []));
1590
+ // ---- Non-reactive bookkeeping ----
1591
+ #listControllers = new Map();
1592
+ #jobs = new Map();
1593
+ #uploadQueue = [];
1594
+ #downloadUrls = new Map();
1595
+ #activeUploads = 0;
1596
+ #transferSeq = 0;
1597
+ #searchTimer = null;
1598
+ #searchController = null;
1599
+ #previewController = null;
1600
+ #previewObjectUrl = null;
1601
+ #shareController = null;
1602
+ #shareReturnFocus = null;
1603
+ #dragDepth = 0;
1604
+ #listFn = null;
1605
+ #resizeObserver = null;
1606
+ #destroyed = false;
1607
+ instanceId = `sd-file-explorer-${nextExplorerId++}`;
1608
+ // ---- Derived ----
1609
+ compact = computed(() => {
1610
+ const width = this.#width();
1611
+ return width > 0 && width < COMPACT_MAX_WIDTH;
1612
+ }, ...(ngDevMode ? [{ debugName: "compact" }] : []));
1613
+ autoId = computed(() => {
1614
+ const scope = this.option().autoId;
1615
+ return scope ? `components-file-explorer-${scope}` : undefined;
1616
+ }, ...(ngDevMode ? [{ debugName: "autoId" }] : []));
1617
+ locale = this.#i18n.locale;
1618
+ rootLabel = computed(() => this.option().rootLabel || this.#i18n.t('core.component.file-explorer.root'), ...(ngDevMode ? [{ debugName: "rootLabel" }] : []));
1619
+ canUpload = computed(() => typeof this.option().upload === 'function', ...(ngDevMode ? [{ debugName: "canUpload" }] : []));
1620
+ canDownload = computed(() => typeof this.option().download === 'function', ...(ngDevMode ? [{ debugName: "canDownload" }] : []));
1621
+ canCreateFolder = computed(() => typeof this.option().createFolder === 'function', ...(ngDevMode ? [{ debugName: "canCreateFolder" }] : []));
1622
+ canShare = computed(() => typeof this.option().share === 'function', ...(ngDevMode ? [{ debugName: "canShare" }] : []));
1623
+ #serverSearch = computed(() => typeof this.option().search === 'function', ...(ngDevMode ? [{ debugName: "#serverSearch" }] : []));
1624
+ currentName = computed(() => {
1625
+ const path = this.#path();
1626
+ return path.length ? path[path.length - 1].name : this.rootLabel();
1627
+ }, ...(ngDevMode ? [{ debugName: "currentName" }] : []));
1628
+ #itemById = computed(() => {
1629
+ const map = new Map();
1630
+ for (const state of this.#folders().values()) {
1631
+ for (const item of state.items)
1632
+ map.set(item.id, item);
1633
+ }
1634
+ for (const folder of this.#path())
1635
+ if (!map.has(folder.id))
1636
+ map.set(folder.id, folder);
1637
+ return map;
1638
+ }, ...(ngDevMode ? [{ debugName: "#itemById" }] : []));
1639
+ #currentFolder = computed(() => this.#folders().get(this.#currentId()), ...(ngDevMode ? [{ debugName: "#currentFolder" }] : []));
1640
+ #trimmedKeyword = computed(() => this.keyword().trim(), ...(ngDevMode ? [{ debugName: "#trimmedKeyword" }] : []));
1641
+ searching = computed(() => this.#trimmedKeyword().length > 0, ...(ngDevMode ? [{ debugName: "searching" }] : []));
1642
+ #visibleItems = computed(() => {
1643
+ const keyword = this.#trimmedKeyword();
1644
+ const items = this.#currentFolder()?.items ?? [];
1645
+ if (!keyword)
1646
+ return items;
1647
+ if (this.#serverSearch()) {
1648
+ const search = this.#search();
1649
+ return search && search.keyword === keyword && search.status === 'loaded' ? search.items : [];
1650
+ }
1651
+ const needle = sdFileExplorerNormalize(keyword);
1652
+ return items.filter(item => sdFileExplorerNormalize(item.name).includes(needle));
1653
+ }, ...(ngDevMode ? [{ debugName: "#visibleItems" }] : []));
1654
+ itemViews = computed(() => {
1655
+ const format = this.#itemFormatter();
1656
+ return sdFileExplorerFoldersFirst(this.#visibleItems()).map(format);
1657
+ }, ...(ngDevMode ? [{ debugName: "itemViews" }] : []));
1658
+ // why: như shareFeedback — kiểu tường minh để d.ts ổn định giữa các máy build.
1659
+ contentState = computed(() => {
1660
+ const keyword = this.#trimmedKeyword();
1661
+ if (keyword && this.#serverSearch()) {
1662
+ const search = this.#search();
1663
+ if (!search || search.keyword !== keyword || search.status === 'loading')
1664
+ return 'loading';
1665
+ if (search.status === 'error')
1666
+ return 'error';
1667
+ return search.items.length ? 'items' : 'empty';
1668
+ }
1669
+ const folder = this.#currentFolder();
1670
+ if (!folder || (folder.status === 'loading' && !folder.loaded))
1671
+ return 'loading';
1672
+ if (folder.status === 'error')
1673
+ return 'error';
1674
+ return this.#visibleItems().length ? 'items' : 'empty';
1675
+ }, ...(ngDevMode ? [{ debugName: "contentState" }] : []));
1676
+ refreshing = computed(() => {
1677
+ const folder = this.#currentFolder();
1678
+ return !!folder && folder.status === 'loading' && folder.loaded && !this.searching();
1679
+ }, ...(ngDevMode ? [{ debugName: "refreshing" }] : []));
1680
+ errorMessage = computed(() => {
1681
+ const error = this.searching() && this.#serverSearch() ? this.#search()?.error : this.#currentFolder()?.error;
1682
+ return sdFileExplorerErrorMessage(error);
1683
+ }, ...(ngDevMode ? [{ debugName: "errorMessage" }] : []));
1684
+ heading = computed(() => this.searching() ? this.#i18n.t('core.component.file-explorer.search-results') : this.currentName(), ...(ngDevMode ? [{ debugName: "heading" }] : []));
1685
+ itemCountLabel = computed(() => this.#i18n.t('core.component.file-explorer.item-count', { count: this.#visibleItems().length }), ...(ngDevMode ? [{ debugName: "itemCountLabel" }] : []));
1686
+ emptyTitle = computed(() => this.searching()
1687
+ ? this.#i18n.t('core.component.file-explorer.search-empty', { keyword: this.#trimmedKeyword() })
1688
+ : this.#i18n.t('core.component.file-explorer.empty'), ...(ngDevMode ? [{ debugName: "emptyTitle" }] : []));
1689
+ emptyMessage = computed(() => !this.searching() && this.canUpload() ? this.#i18n.t('core.component.file-explorer.empty-upload-hint') : '', ...(ngDevMode ? [{ debugName: "emptyMessage" }] : []));
1690
+ dropTitle = computed(() => this.#i18n.t('core.component.file-explorer.drop-title', { folder: this.currentName() }), ...(ngDevMode ? [{ debugName: "dropTitle" }] : []));
1691
+ shareTitle = computed(() => this.#i18n.t('core.component.file-explorer.share.title', { name: this.shareItem()?.name ?? '' }), ...(ngDevMode ? [{ debugName: "shareTitle" }] : []));
1692
+ shareFeedbackLabel = computed(() => {
1693
+ const feedback = this.shareFeedback();
1694
+ if (feedback === 'copied')
1695
+ return this.#i18n.t('core.component.file-explorer.share.copied');
1696
+ if (feedback === 'manual')
1697
+ return this.#i18n.t('core.component.file-explorer.share.copy-manual');
1698
+ return '';
1699
+ }, ...(ngDevMode ? [{ debugName: "shareFeedbackLabel" }] : []));
1700
+ folderDialogTitle = computed(() => this.#i18n.t('core.component.file-explorer.new-folder-title', { folder: this.currentName() }), ...(ngDevMode ? [{ debugName: "folderDialogTitle" }] : []));
1701
+ /** Breadcrumb trail plus the folder each entry navigates to. */
1702
+ breadcrumb = computed(() => {
1703
+ const targets = new Map();
1704
+ const items = [];
1705
+ const root = { label: this.rootLabel(), clickable: true };
1706
+ targets.set(root, null);
1707
+ items.push(root);
1708
+ for (const folder of this.#path()) {
1709
+ const entry = { label: folder.name, clickable: true };
1710
+ targets.set(entry, folder);
1711
+ items.push(entry);
1712
+ }
1713
+ return { items, targets };
1714
+ }, ...(ngDevMode ? [{ debugName: "breadcrumb" }] : []));
1715
+ treeNodes = computed(() => {
1716
+ const folders = this.#folders();
1717
+ const expanded = this.#expanded();
1718
+ const current = this.#currentId();
1719
+ const autoId = this.autoId();
1720
+ const rootState = folders.get(null);
1721
+ const nodes = [
1722
+ {
1723
+ key: 'root',
1724
+ id: null,
1725
+ item: null,
1726
+ name: this.rootLabel(),
1727
+ level: 1,
1728
+ expandable: false,
1729
+ expanded: true,
1730
+ status: rootState?.status === 'error' ? 'error' : rootState?.status === 'loading' && !rootState.loaded ? 'loading' : 'idle',
1731
+ selected: current === null,
1732
+ autoId: autoId ? `${autoId}-tree-root` : undefined,
1733
+ },
1734
+ ];
1735
+ const visit = (parentId, level, ancestors) => {
1736
+ const state = folders.get(parentId);
1737
+ if (!state)
1738
+ return;
1739
+ const children = state.items.filter(item => item.kind === 'folder');
1740
+ for (const folder of children) {
1741
+ // why: dữ liệu consumer có thể lỗi (thư mục là con của chính nó) — chặn vòng lặp vô hạn khi dựng cây.
1742
+ if (ancestors.has(folder.id))
1743
+ continue;
1744
+ const childState = folders.get(folder.id);
1745
+ const isExpanded = expanded.has(folder.id);
1746
+ const hasSubfolders = childState?.loaded ? childState.items.some(item => item.kind === 'folder') : folder.hasChildren !== false;
1747
+ const open = isExpanded && hasSubfolders;
1748
+ let status = 'idle';
1749
+ if (isExpanded && childState?.status === 'error')
1750
+ status = 'error';
1751
+ else if (isExpanded && childState?.status === 'loading' && !childState.loaded)
1752
+ status = 'loading';
1753
+ nodes.push({
1754
+ key: `f:${folder.id}`,
1755
+ id: folder.id,
1756
+ item: folder,
1757
+ name: folder.name,
1758
+ level,
1759
+ expandable: hasSubfolders,
1760
+ expanded: open,
1761
+ status,
1762
+ selected: current === folder.id,
1763
+ autoId: autoId ? `${autoId}-tree-${sdFileExplorerSafeId(folder.id)}` : undefined,
1764
+ });
1765
+ if (open)
1766
+ visit(folder.id, level + 1, new Set([...ancestors, folder.id]));
1767
+ }
1768
+ };
1769
+ visit(null, 2, new Set());
1770
+ return nodes;
1771
+ }, ...(ngDevMode ? [{ debugName: "treeNodes" }] : []));
1772
+ previewView = computed(() => {
1773
+ const item = this.#previewItem();
1774
+ return item ? this.#itemFormatter()(item) : null;
1775
+ }, ...(ngDevMode ? [{ debugName: "previewView" }] : []));
1776
+ previewMeta = computed(() => {
1777
+ const view = this.previewView();
1778
+ if (!view)
1779
+ return [];
1780
+ const t = (key) => this.#i18n.t(`core.component.file-explorer.meta.${key}`);
1781
+ const rows = [
1782
+ { label: t('name'), value: view.item.name },
1783
+ { label: t('type'), value: view.typeLabel },
1784
+ ];
1785
+ if (view.sizeLabel)
1786
+ rows.push({ label: t('size'), value: view.sizeLabel });
1787
+ if (view.modifiedLabel)
1788
+ rows.push({ label: t('modified'), value: view.modifiedLabel });
1789
+ return rows;
1790
+ }, ...(ngDevMode ? [{ debugName: "previewMeta" }] : []));
1791
+ transferViews = computed(() => {
1792
+ const t = (key, params) => this.#i18n.t(`core.component.file-explorer.${key}`, params);
1793
+ const autoId = this.autoId();
1794
+ return this.#transfers().map(transfer => {
1795
+ const known = transfer.percent !== undefined;
1796
+ let statusLabel;
1797
+ let progress;
1798
+ let tone;
1799
+ switch (transfer.status) {
1800
+ case 'queued':
1801
+ statusLabel = t('transfers.status.queued');
1802
+ progress = 'none';
1803
+ tone = 'muted';
1804
+ break;
1805
+ case 'preparing':
1806
+ statusLabel = t('transfers.status.preparing');
1807
+ progress = 'indeterminate';
1808
+ tone = 'active';
1809
+ break;
1810
+ case 'transferring':
1811
+ statusLabel = known
1812
+ ? `${transfer.percent}%`
1813
+ : t(transfer.direction === 'upload' ? 'transfers.status.uploading' : 'transfers.status.downloading');
1814
+ progress = known ? 'determinate' : 'indeterminate';
1815
+ tone = 'active';
1816
+ break;
1817
+ case 'done':
1818
+ statusLabel = t(transfer.handedOff ? 'transfers.status.handed-off' : 'transfers.status.done');
1819
+ progress = 'full';
1820
+ tone = 'success';
1821
+ break;
1822
+ case 'error':
1823
+ statusLabel = t('transfers.status.error');
1824
+ progress = known ? 'determinate' : 'full';
1825
+ tone = 'error';
1826
+ break;
1827
+ default:
1828
+ statusLabel = t('transfers.status.cancelled');
1829
+ progress = known ? 'determinate' : 'none';
1830
+ tone = 'muted';
1831
+ }
1832
+ const name = transfer.name;
1833
+ return {
1834
+ transfer,
1835
+ statusLabel,
1836
+ progress,
1837
+ percent: transfer.percent ?? 0,
1838
+ tone,
1839
+ canCancel: ACTIVE_STATUSES.has(transfer.status),
1840
+ canRetry: transfer.status === 'error' || transfer.status === 'cancelled',
1841
+ canDismiss: FINISHED_STATUSES.has(transfer.status),
1842
+ cancelLabel: t('transfers.cancel', { name }),
1843
+ retryLabel: t('transfers.retry', { name }),
1844
+ dismissLabel: t('transfers.dismiss', { name }),
1845
+ directionLabel: t(`transfers.direction.${transfer.direction}`),
1846
+ errorMessage: transfer.status === 'error' ? sdFileExplorerErrorMessage(transfer.error) : '',
1847
+ autoId: autoId ? `${autoId}-transfer-${transfer.id}` : undefined,
1848
+ };
1849
+ });
1850
+ }, ...(ngDevMode ? [{ debugName: "transferViews" }] : []));
1851
+ transfersTitle = computed(() => this.#i18n.t('core.component.file-explorer.transfers.title', { count: this.#transfers().length }), ...(ngDevMode ? [{ debugName: "transfersTitle" }] : []));
1852
+ canClearTransfers = computed(() => this.#transfers().some(transfer => FINISHED_STATUSES.has(transfer.status)), ...(ngDevMode ? [{ debugName: "canClearTransfers" }] : []));
1853
+ /** Formats items with the current language; rebuilt when the language changes. */
1854
+ #itemFormatter = computed(() => {
1855
+ const locale = this.locale();
1856
+ const autoId = this.autoId();
1857
+ const t = (key, params) => this.#i18n.t(`core.component.file-explorer.${key}`, params);
1858
+ const labels = { today: t('today'), yesterday: t('yesterday') };
1859
+ const now = new Date();
1860
+ return (item) => {
1861
+ const type = sdFileExplorerFileType(item);
1862
+ return {
1863
+ item,
1864
+ type,
1865
+ icon: sdFileExplorerIconName(item),
1866
+ typeLabel: t(`type.${type}`),
1867
+ sizeLabel: item.kind === 'file' ? sdFileExplorerFormatSize(item.size, locale) : '',
1868
+ modifiedLabel: sdFileExplorerFormatDate(item.modifiedAt, now, locale, labels),
1869
+ modifiedTitle: sdFileExplorerFormatDateTime(item.modifiedAt, locale),
1870
+ downloadLabel: t('download-item', { name: item.name }),
1871
+ shareLabel: t('share-item', { name: item.name }),
1872
+ autoId: autoId ? `${autoId}-item-${sdFileExplorerSafeId(item.id)}` : undefined,
1873
+ };
1874
+ };
1875
+ }, ...(ngDevMode ? [{ debugName: "#itemFormatter" }] : []));
1876
+ constructor() {
1877
+ // why: chỉ reset khi hàm `list` đổi (đổi nguồn lưu trữ). Consumer tạo lại object option với cùng callback
1878
+ // (ví dụ đổi title) không được xoá cache/điều hướng của người dùng.
1879
+ effect(() => {
1880
+ const option = this.option();
1881
+ untracked(() => {
1882
+ if (this.#listFn === option.list)
1883
+ return;
1884
+ const firstRun = this.#listFn === null;
1885
+ this.#listFn = option.list;
1886
+ if (firstRun)
1887
+ this.view.set(option.defaultView ?? 'list');
1888
+ this.#resetNavigation();
1889
+ this.#ensureLoaded(null);
1890
+ });
1891
+ });
1892
+ afterNextRender(() => {
1893
+ const host = this.#host.nativeElement;
1894
+ this.#width.set(host.getBoundingClientRect().width);
1895
+ if (typeof ResizeObserver === 'undefined')
1896
+ return;
1897
+ this.#resizeObserver = new ResizeObserver(entries => {
1898
+ const width = entries[entries.length - 1]?.contentRect.width;
1899
+ if (typeof width === 'number')
1900
+ this.#width.set(width);
1901
+ });
1902
+ this.#resizeObserver.observe(host);
1903
+ });
1904
+ // why: rời khỏi layout compact thì drawer không còn ý nghĩa — đóng để lần thu nhỏ sau không bật lại scrim.
1905
+ effect(() => {
1906
+ if (!this.compact())
1907
+ untracked(() => this.sidebarOpen.set(false));
1908
+ });
1909
+ inject(DestroyRef).onDestroy(() => this.#teardown());
1910
+ }
1911
+ // ---- Public API ----
1912
+ /**
1913
+ * Lists the current folder again and drops the cached children of folders that are neither open in the
1914
+ * tree nor on the current path. Re-runs the active search, if any.
1915
+ */
1916
+ reload() {
1917
+ const keep = new Set([null, this.#currentId(), ...this.#expanded(), ...this.#path().map(folder => folder.id)]);
1918
+ const folders = new Map(this.#folders());
1919
+ for (const key of [...folders.keys()]) {
1920
+ if (!keep.has(key)) {
1921
+ this.#listControllers.get(key)?.abort();
1922
+ this.#listControllers.delete(key);
1923
+ folders.delete(key);
1924
+ }
1925
+ }
1926
+ this.#folders.set(folders);
1927
+ for (const key of folders.keys())
1928
+ this.#load(key);
1929
+ this.#ensureLoaded(this.#currentId());
1930
+ if (this.searching())
1931
+ this.#scheduleSearch(true);
1932
+ }
1933
+ // ---- Navigation ----
1934
+ navigate(folder) {
1935
+ const id = folder?.id ?? null;
1936
+ const path = folder ? this.#buildPath(folder) : [];
1937
+ this.#currentId.set(id);
1938
+ this.#path.set(path);
1939
+ this.#expanded.update(expanded => {
1940
+ const next = new Set(expanded);
1941
+ for (const entry of path)
1942
+ next.add(entry.id);
1943
+ return next;
1944
+ });
1945
+ this.#clearSearch();
1946
+ this.closePreview();
1947
+ if (this.compact())
1948
+ this.sidebarOpen.set(false);
1949
+ this.#ensureLoaded(null);
1950
+ for (const entry of path)
1951
+ this.#ensureLoaded(entry.parentId);
1952
+ this.#ensureLoaded(id);
1953
+ }
1954
+ onBreadcrumb(entry) {
1955
+ const { targets } = this.breadcrumb();
1956
+ if (targets.has(entry))
1957
+ this.navigate(targets.get(entry) ?? null);
1958
+ }
1959
+ onTreeSelect(node) {
1960
+ this.navigate(node.item);
1961
+ }
1962
+ onTreeToggle(node) {
1963
+ if (node.id === null)
1964
+ return;
1965
+ const id = node.id;
1966
+ const expand = !this.#expanded().has(id);
1967
+ this.#expanded.update(expanded => {
1968
+ const next = new Set(expanded);
1969
+ if (expand)
1970
+ next.add(id);
1971
+ else
1972
+ next.delete(id);
1973
+ return next;
1974
+ });
1975
+ if (expand)
1976
+ this.#ensureLoaded(id);
1977
+ }
1978
+ onTreeRetry(node) {
1979
+ this.#load(node.id);
1980
+ }
1981
+ retryContent() {
1982
+ if (this.searching() && this.#serverSearch())
1983
+ this.#scheduleSearch(true);
1984
+ else
1985
+ this.#load(this.#currentId());
1986
+ }
1987
+ toggleSidebar() {
1988
+ const open = !this.sidebarOpen();
1989
+ this.sidebarOpen.set(open);
1990
+ if (open) {
1991
+ afterNextRender(() => this.sidebar()?.nativeElement.querySelector('[tabindex="0"]')?.focus(), {
1992
+ injector: this.#injector,
1993
+ });
1994
+ }
1995
+ }
1996
+ setView(view) {
1997
+ this.view.set(view);
1998
+ }
1999
+ // ---- Items / preview ----
2000
+ onActivate(view) {
2001
+ if (view.item.kind === 'folder')
2002
+ this.navigate(view.item);
2003
+ else
2004
+ this.openFile(view.item);
2005
+ }
2006
+ openFile(item) {
2007
+ this.open.emit({ item, path: this.#path() });
2008
+ this.#previewItem.set(item);
2009
+ void this.#loadPreview(item);
2010
+ }
2011
+ /**
2012
+ * Closes the detail drawer. Focus goes back to the row / card that opened it: `sd-side-drawer` restores the
2013
+ * previously focused element when its focus trap closes.
2014
+ */
2015
+ closePreview() {
2016
+ if (!this.#previewItem())
2017
+ return;
2018
+ this.#releasePreview();
2019
+ this.#previewItem.set(null);
2020
+ this.previewState.set({ status: 'idle' });
2021
+ }
2022
+ retryPreview() {
2023
+ const item = this.#previewItem();
2024
+ if (item)
2025
+ void this.#loadPreview(item);
2026
+ }
2027
+ onPreviewImageError() {
2028
+ this.previewState.set({ status: 'error', message: '' });
2029
+ }
2030
+ downloadItem(item) {
2031
+ const download = this.option().download;
2032
+ if (!download)
2033
+ return;
2034
+ this.#enqueue('download', item.name, item.parentId, args => download({ item, ...args }));
2035
+ this.transfersCollapsed.set(false);
2036
+ }
2037
+ downloadPreview() {
2038
+ const item = this.#previewItem();
2039
+ if (item)
2040
+ this.downloadItem(item);
2041
+ }
2042
+ sharePreview() {
2043
+ const item = this.#previewItem();
2044
+ if (item)
2045
+ this.openShare(item);
2046
+ }
2047
+ // ---- Search ----
2048
+ onKeywordInput(value) {
2049
+ this.keyword.set(value);
2050
+ this.#scheduleSearch(false);
2051
+ }
2052
+ clearSearch() {
2053
+ this.#clearSearch();
2054
+ this.searchInput()?.nativeElement.focus();
2055
+ }
2056
+ // ---- Upload ----
2057
+ onFilesPicked(input) {
2058
+ const files = Array.from(input.files ?? []);
2059
+ // why: reset value để chọn lại đúng file đó lần nữa vẫn bắn sự kiện change.
2060
+ input.value = '';
2061
+ this.uploadFiles(files);
2062
+ }
2063
+ uploadFiles(files) {
2064
+ const upload = this.option().upload;
2065
+ if (!upload || files.length === 0)
2066
+ return;
2067
+ const parentId = this.#currentId();
2068
+ for (const file of files) {
2069
+ this.#enqueue('upload', file.name, parentId, args => upload({ file, parentId, ...args }));
2070
+ }
2071
+ this.transfersCollapsed.set(false);
2072
+ }
2073
+ onDragEnter(event) {
2074
+ if (!this.#acceptsDrag(event))
2075
+ return;
2076
+ event.preventDefault();
2077
+ this.#dragDepth++;
2078
+ this.dragActive.set(true);
2079
+ }
2080
+ onDragOver(event) {
2081
+ if (!this.#acceptsDrag(event))
2082
+ return;
2083
+ event.preventDefault();
2084
+ if (event.dataTransfer)
2085
+ event.dataTransfer.dropEffect = 'copy';
2086
+ }
2087
+ onDragLeave() {
2088
+ if (!this.dragActive())
2089
+ return;
2090
+ // why: dragenter/dragleave bắn cho từng phần tử con — đếm độ sâu để overlay không nhấp nháy khi rê qua con.
2091
+ this.#dragDepth = Math.max(0, this.#dragDepth - 1);
2092
+ if (this.#dragDepth === 0)
2093
+ this.dragActive.set(false);
2094
+ }
2095
+ onDrop(event) {
2096
+ if (!this.#acceptsDrag(event))
2097
+ return;
2098
+ event.preventDefault();
2099
+ this.#dragDepth = 0;
2100
+ this.dragActive.set(false);
2101
+ this.uploadFiles(this.#droppedFiles(event.dataTransfer));
2102
+ }
2103
+ // ---- Transfers ----
2104
+ cancelTransfer(id) {
2105
+ const job = this.#jobs.get(id);
2106
+ const status = this.#statusOf(id);
2107
+ if (!job || !status || !ACTIVE_STATUSES.has(status))
2108
+ return;
2109
+ if (status !== 'queued' && job.attempt) {
2110
+ job.attempt.controller.abort();
2111
+ this.#releaseSlot(job.attempt);
2112
+ }
2113
+ this.#patch(id, { status: 'cancelled' });
2114
+ }
2115
+ retryTransfer(id) {
2116
+ const job = this.#jobs.get(id);
2117
+ const status = this.#statusOf(id);
2118
+ if (!job || (status !== 'error' && status !== 'cancelled'))
2119
+ return;
2120
+ this.#patch(id, { status: 'queued', loaded: undefined, total: undefined, percent: undefined, error: undefined, handedOff: undefined });
2121
+ this.#schedule(job);
2122
+ }
2123
+ dismissTransfer(id) {
2124
+ const status = this.#statusOf(id);
2125
+ if (!status || !FINISHED_STATUSES.has(status))
2126
+ return;
2127
+ this.#jobs.delete(id);
2128
+ this.#transfers.update(list => list.filter(transfer => transfer.id !== id));
2129
+ }
2130
+ clearFinishedTransfers() {
2131
+ const finished = new Set(this.#transfers()
2132
+ .filter(transfer => FINISHED_STATUSES.has(transfer.status))
2133
+ .map(transfer => transfer.id));
2134
+ for (const id of finished)
2135
+ this.#jobs.delete(id);
2136
+ this.#transfers.update(list => list.filter(transfer => !finished.has(transfer.id)));
2137
+ }
2138
+ // ---- New folder ----
2139
+ openFolderDialog() {
2140
+ this.folderName.set('');
2141
+ this.folderError.set('');
2142
+ this.folderDialogOpen.set(true);
2143
+ afterNextRender(() => this.folderInput()?.nativeElement.focus(), { injector: this.#injector });
2144
+ }
2145
+ closeFolderDialog() {
2146
+ if (!this.folderDialogOpen())
2147
+ return;
2148
+ this.folderDialogOpen.set(false);
2149
+ afterNextRender(() => this.newFolderButton()?.nativeElement.querySelector('button')?.focus(), { injector: this.#injector });
2150
+ }
2151
+ // ---- Share ----
2152
+ openShare(item) {
2153
+ if (!this.option().share)
2154
+ return;
2155
+ const active = this.#document.activeElement;
2156
+ this.#shareReturnFocus = active instanceof HTMLElement && this.#host.nativeElement.contains(active) ? active : null;
2157
+ this.shareItem.set(item);
2158
+ void this.#loadShareLink(item);
2159
+ // why: trong lúc tạo link, focus vào chính dialog để trình đọc màn hình đọc tiêu đề; link xong thì chuyển sang nút Sao chép.
2160
+ afterNextRender(() => {
2161
+ if (this.shareState().status !== 'ready')
2162
+ this.shareDialog()?.nativeElement.focus();
2163
+ }, { injector: this.#injector });
2164
+ }
2165
+ retryShare() {
2166
+ const item = this.shareItem();
2167
+ if (item)
2168
+ void this.#loadShareLink(item);
2169
+ }
2170
+ closeShare() {
2171
+ if (!this.shareItem())
2172
+ return;
2173
+ this.#shareController?.abort();
2174
+ this.#shareController = null;
2175
+ this.shareItem.set(null);
2176
+ this.shareFeedback.set('');
2177
+ const target = this.#shareReturnFocus;
2178
+ this.#shareReturnFocus = null;
2179
+ if (target?.isConnected)
2180
+ afterNextRender(() => target.focus({ preventScroll: true }), { injector: this.#injector });
2181
+ }
2182
+ async copyShareLink() {
2183
+ const state = this.shareState();
2184
+ if (state.status !== 'ready')
2185
+ return;
2186
+ const clipboard = this.#document.defaultView?.navigator?.clipboard;
2187
+ try {
2188
+ if (typeof clipboard?.writeText !== 'function')
2189
+ throw new Error('Clipboard API unavailable');
2190
+ await clipboard.writeText(state.url);
2191
+ this.shareFeedback.set('copied');
2192
+ }
2193
+ catch {
2194
+ // why: Clipboard API bị chặn (không phải secure context, thiếu quyền, iframe) → chọn sẵn link rồi thử
2195
+ // execCommand; nếu vẫn không được thì hướng dẫn người dùng tự bấm Ctrl+C.
2196
+ const input = this.shareInput()?.nativeElement;
2197
+ input?.focus();
2198
+ input?.select();
2199
+ this.shareFeedback.set(this.#execCopy() ? 'copied' : 'manual');
2200
+ }
2201
+ }
2202
+ async #loadShareLink(item) {
2203
+ const share = this.option().share;
2204
+ if (!share)
2205
+ return;
2206
+ this.#shareController?.abort();
2207
+ const controller = new AbortController();
2208
+ this.#shareController = controller;
2209
+ this.shareFeedback.set('');
2210
+ this.shareState.set({ status: 'loading' });
2211
+ const fallbackError = () => this.#i18n.t('core.component.file-explorer.share.error');
2212
+ try {
2213
+ const url = await share({ item, signal: controller.signal });
2214
+ if (controller.signal.aborted || this.#destroyed)
2215
+ return;
2216
+ if (typeof url !== 'string' || !url.trim()) {
2217
+ this.shareState.set({ status: 'error', message: fallbackError() });
2218
+ return;
2219
+ }
2220
+ this.shareState.set({ status: 'ready', url: url.trim() });
2221
+ afterNextRender(() => this.copyButton()?.nativeElement.querySelector('button')?.focus(), { injector: this.#injector });
2222
+ }
2223
+ catch (error) {
2224
+ if (controller.signal.aborted || this.#destroyed)
2225
+ return;
2226
+ this.shareState.set({ status: 'error', message: sdFileExplorerErrorMessage(error) || fallbackError() });
2227
+ }
2228
+ finally {
2229
+ if (this.#shareController === controller)
2230
+ this.#shareController = null;
2231
+ }
2232
+ }
2233
+ #execCopy() {
2234
+ try {
2235
+ return this.#document.execCommand('copy');
2236
+ }
2237
+ catch {
2238
+ return false;
2239
+ }
2240
+ }
2241
+ async submitFolder(event) {
2242
+ event.preventDefault();
2243
+ const create = this.option().createFolder;
2244
+ const name = this.folderName().trim();
2245
+ if (!create || !name || this.folderSubmitting())
2246
+ return;
2247
+ const parentId = this.#currentId();
2248
+ this.folderSubmitting.set(true);
2249
+ this.folderError.set('');
2250
+ try {
2251
+ await create({ parentId, name });
2252
+ if (this.#destroyed)
2253
+ return;
2254
+ this.closeFolderDialog();
2255
+ if (parentId !== null)
2256
+ this.#expanded.update(expanded => new Set([...expanded, parentId]));
2257
+ this.#refresh(parentId);
2258
+ }
2259
+ catch (error) {
2260
+ if (this.#destroyed)
2261
+ return;
2262
+ this.folderError.set(sdFileExplorerErrorMessage(error) || this.#i18n.t('core.component.file-explorer.create-folder-error'));
2263
+ }
2264
+ finally {
2265
+ this.folderSubmitting.set(false);
2266
+ }
2267
+ }
2268
+ // ---- Keyboard ----
2269
+ onEscape(event) {
2270
+ if (event.defaultPrevented)
2271
+ return;
2272
+ if (this.folderDialogOpen())
2273
+ this.closeFolderDialog();
2274
+ else if (this.shareItem())
2275
+ this.closeShare();
2276
+ // why: header vẫn dùng được khi drawer chi tiết mở — Esc trong ô tìm kiếm xoá từ khoá trước, chưa đóng drawer.
2277
+ else if (this.keyword() && event.target === this.searchInput()?.nativeElement)
2278
+ this.clearSearch();
2279
+ else if (this.#previewItem())
2280
+ this.closePreview();
2281
+ else if (this.sidebarOpen())
2282
+ this.sidebarOpen.set(false);
2283
+ else if (this.keyword())
2284
+ this.clearSearch();
2285
+ else
2286
+ return;
2287
+ event.preventDefault();
2288
+ }
2289
+ // ---- Internals: folders ----
2290
+ #resetNavigation() {
2291
+ for (const controller of this.#listControllers.values())
2292
+ controller.abort();
2293
+ this.#listControllers.clear();
2294
+ this.#folders.set(new Map());
2295
+ this.#currentId.set(null);
2296
+ this.#path.set([]);
2297
+ this.#expanded.set(new Set());
2298
+ this.#clearSearch();
2299
+ this.closePreview();
2300
+ }
2301
+ #ensureLoaded(parentId) {
2302
+ const state = this.#folders().get(parentId);
2303
+ if (state && state.status !== 'error')
2304
+ return;
2305
+ void this.#load(parentId);
2306
+ }
2307
+ /** Re-lists a folder only if it is cached (someone has seen it); otherwise the next visit lists it anyway. */
2308
+ #refresh(parentId) {
2309
+ if (this.#folders().has(parentId))
2310
+ void this.#load(parentId);
2311
+ }
2312
+ async #load(parentId) {
2313
+ this.#listControllers.get(parentId)?.abort();
2314
+ const controller = new AbortController();
2315
+ this.#listControllers.set(parentId, controller);
2316
+ const previous = this.#folders().get(parentId);
2317
+ this.#setFolder(parentId, { status: 'loading', items: previous?.loaded ? previous.items : [], loaded: !!previous?.loaded });
2318
+ try {
2319
+ const items = await this.option().list({ parentId, signal: controller.signal });
2320
+ if (controller.signal.aborted || this.#destroyed)
2321
+ return;
2322
+ this.#setFolder(parentId, { status: 'loaded', items: Array.isArray(items) ? items : [], loaded: true });
2323
+ }
2324
+ catch (error) {
2325
+ if (controller.signal.aborted || this.#destroyed)
2326
+ return;
2327
+ this.#setFolder(parentId, { status: 'error', items: [], loaded: false, error });
2328
+ }
2329
+ finally {
2330
+ if (this.#listControllers.get(parentId) === controller)
2331
+ this.#listControllers.delete(parentId);
2332
+ }
2333
+ }
2334
+ #setFolder(parentId, state) {
2335
+ this.#folders.update(folders => new Map(folders).set(parentId, state));
2336
+ }
2337
+ #buildPath(folder) {
2338
+ const byId = this.#itemById();
2339
+ const chain = [folder];
2340
+ const seen = new Set([folder.id]);
2341
+ let parentId = folder.parentId;
2342
+ while (parentId !== null) {
2343
+ const parent = byId.get(parentId);
2344
+ if (!parent || seen.has(parent.id)) {
2345
+ // why: chuỗi cha bị đứt (kết quả search nằm sâu, cha chưa từng được list) — nối vào đường dẫn hiện tại
2346
+ // để breadcrumb vẫn quay về được thư mục đang xem.
2347
+ const current = this.#path().filter(entry => !seen.has(entry.id));
2348
+ return [...current, folder];
2349
+ }
2350
+ chain.push(parent);
2351
+ seen.add(parent.id);
2352
+ parentId = parent.parentId;
2353
+ }
2354
+ return chain.reverse();
2355
+ }
2356
+ // ---- Internals: search ----
2357
+ #scheduleSearch(immediate) {
2358
+ if (this.#searchTimer)
2359
+ clearTimeout(this.#searchTimer);
2360
+ this.#searchTimer = null;
2361
+ this.#searchController?.abort();
2362
+ this.#searchController = null;
2363
+ const keyword = this.#trimmedKeyword();
2364
+ const search = this.option().search;
2365
+ if (!keyword || !search) {
2366
+ this.#search.set(null);
2367
+ return;
2368
+ }
2369
+ const parentId = this.#currentId();
2370
+ this.#search.set({ keyword, parentId, status: 'loading', items: [] });
2371
+ if (immediate)
2372
+ void this.#runSearch(keyword, parentId);
2373
+ else
2374
+ this.#searchTimer = setTimeout(() => void this.#runSearch(keyword, parentId), SEARCH_DEBOUNCE_MS);
2375
+ }
2376
+ async #runSearch(keyword, parentId) {
2377
+ this.#searchTimer = null;
2378
+ const search = this.option().search;
2379
+ if (!search)
2380
+ return;
2381
+ const controller = new AbortController();
2382
+ this.#searchController = controller;
2383
+ try {
2384
+ const items = await search({ parentId, keyword, signal: controller.signal });
2385
+ if (controller.signal.aborted || this.#destroyed)
2386
+ return;
2387
+ this.#search.set({ keyword, parentId, status: 'loaded', items: Array.isArray(items) ? items : [] });
2388
+ }
2389
+ catch (error) {
2390
+ if (controller.signal.aborted || this.#destroyed)
2391
+ return;
2392
+ this.#search.set({ keyword, parentId, status: 'error', items: [], error });
2393
+ }
2394
+ finally {
2395
+ if (this.#searchController === controller)
2396
+ this.#searchController = null;
2397
+ }
2398
+ }
2399
+ #clearSearch() {
2400
+ this.keyword.set('');
2401
+ this.#scheduleSearch(false);
2402
+ }
2403
+ // ---- Internals: preview ----
2404
+ async #loadPreview(item) {
2405
+ this.#releasePreview();
2406
+ const kind = sdFileExplorerPreviewKind(sdFileExplorerFileType(item));
2407
+ const fallback = () => kind === 'image' && item.thumbnailUrl ? { status: 'image', url: item.thumbnailUrl } : { status: 'unavailable' };
2408
+ const preview = this.option().preview;
2409
+ // why: định dạng không có renderer thì KHÔNG gọi callback — tránh tải cả file chỉ để hiện fallback.
2410
+ if (kind === 'none' || !preview) {
2411
+ this.previewState.set(kind === 'none' ? { status: 'unavailable' } : fallback());
2412
+ return;
2413
+ }
2414
+ const controller = new AbortController();
2415
+ this.#previewController = controller;
2416
+ this.previewState.set({ status: 'loading' });
2417
+ try {
2418
+ const source = await preview({ item, signal: controller.signal });
2419
+ if (controller.signal.aborted || this.#destroyed)
2420
+ return;
2421
+ if (source === null || source === undefined || source === '') {
2422
+ this.previewState.set(fallback());
2423
+ }
2424
+ else if (kind === 'pdf') {
2425
+ this.previewState.set({ status: 'pdf', source });
2426
+ }
2427
+ else if (kind === 'video') {
2428
+ // why: sd-preview-video owns the object URL of a Blob and refuses unsafe URL schemes itself.
2429
+ this.previewState.set({ status: 'video', source });
2430
+ }
2431
+ else if (typeof source === 'string') {
2432
+ this.previewState.set({ status: 'image', url: source });
2433
+ }
2434
+ else {
2435
+ const url = this.#createObjectUrl(source);
2436
+ this.#previewObjectUrl = url;
2437
+ this.previewState.set(url ? { status: 'image', url } : { status: 'unavailable' });
2438
+ }
2439
+ }
2440
+ catch (error) {
2441
+ if (controller.signal.aborted || this.#destroyed)
2442
+ return;
2443
+ this.previewState.set({ status: 'error', message: sdFileExplorerErrorMessage(error) });
2444
+ }
2445
+ finally {
2446
+ if (this.#previewController === controller)
2447
+ this.#previewController = null;
2448
+ }
2449
+ }
2450
+ #releasePreview() {
2451
+ this.#previewController?.abort();
2452
+ this.#previewController = null;
2453
+ if (this.#previewObjectUrl)
2454
+ this.#revokeObjectUrl(this.#previewObjectUrl);
2455
+ this.#previewObjectUrl = null;
2456
+ }
2457
+ // ---- Internals: transfers ----
2458
+ #enqueue(direction, name, parentId, run) {
2459
+ const id = `t${++this.#transferSeq}`;
2460
+ const job = { id, direction, name, parentId, run, attempt: null };
2461
+ this.#jobs.set(id, job);
2462
+ this.#transfers.update(list => [...list, { id, direction, name, status: 'queued' }]);
2463
+ this.#schedule(job);
2464
+ }
2465
+ #schedule(job) {
2466
+ if (job.direction === 'upload') {
2467
+ this.#uploadQueue.push(job.id);
2468
+ this.#pumpUploads();
2469
+ }
2470
+ else {
2471
+ void this.#start(job, false);
2472
+ }
2473
+ }
2474
+ #pumpUploads() {
2475
+ while (this.#activeUploads < MAX_PARALLEL_UPLOADS && this.#uploadQueue.length > 0) {
2476
+ const job = this.#jobs.get(this.#uploadQueue.shift());
2477
+ if (!job || this.#statusOf(job.id) !== 'queued')
2478
+ continue;
2479
+ this.#activeUploads++;
2480
+ void this.#start(job, true);
2481
+ }
2482
+ }
2483
+ #releaseSlot(attempt) {
2484
+ if (!attempt.holdsSlot)
2485
+ return;
2486
+ attempt.holdsSlot = false;
2487
+ this.#activeUploads = Math.max(0, this.#activeUploads - 1);
2488
+ if (!this.#destroyed)
2489
+ this.#pumpUploads();
2490
+ }
2491
+ async #start(job, holdsSlot) {
2492
+ const attempt = { controller: new AbortController(), holdsSlot };
2493
+ job.attempt = attempt;
2494
+ const { signal } = attempt.controller;
2495
+ const current = () => job.attempt === attempt && !signal.aborted && !this.#destroyed;
2496
+ this.#patch(job.id, { status: 'preparing' });
2497
+ const progress = (loaded, total) => {
2498
+ if (!current())
2499
+ return;
2500
+ const safeLoaded = Number.isFinite(loaded) && loaded > 0 ? loaded : 0;
2501
+ const safeTotal = typeof total === 'number' && Number.isFinite(total) && total > 0 ? total : undefined;
2502
+ const percent = safeTotal ? Math.min(100, Math.round((safeLoaded / safeTotal) * 100)) : undefined;
2503
+ this.#patch(job.id, { status: 'transferring', loaded: safeLoaded, total: safeTotal, percent });
2504
+ };
2505
+ try {
2506
+ const result = await job.run({ progress, signal });
2507
+ if (!current())
2508
+ return;
2509
+ const known = this.#transfers().find(transfer => transfer.id === job.id)?.total !== undefined;
2510
+ if (job.direction === 'download') {
2511
+ const blob = this.#isBlob(result) ? result : null;
2512
+ if (blob)
2513
+ this.#saveBlob(blob, job.name);
2514
+ this.#patch(job.id, { status: 'done', handedOff: !blob, percent: known ? 100 : undefined });
2515
+ }
2516
+ else {
2517
+ this.#patch(job.id, { status: 'done', percent: known ? 100 : undefined });
2518
+ this.#refresh(job.parentId);
2519
+ }
2520
+ }
2521
+ catch (error) {
2522
+ if (!current())
2523
+ return;
2524
+ this.#patch(job.id, { status: 'error', error });
2525
+ }
2526
+ finally {
2527
+ this.#releaseSlot(attempt);
2528
+ }
2529
+ }
2530
+ #statusOf(id) {
2531
+ return this.#transfers().find(transfer => transfer.id === id)?.status;
2532
+ }
2533
+ #patch(id, changes) {
2534
+ this.#transfers.update(list => list.map(transfer => (transfer.id === id ? { ...transfer, ...changes } : transfer)));
2535
+ }
2536
+ #saveBlob(blob, name) {
2537
+ const url = this.#createObjectUrl(blob);
2538
+ const body = this.#document.body;
2539
+ if (!url || !body)
2540
+ return;
2541
+ const anchor = this.#document.createElement('a');
2542
+ anchor.href = url;
2543
+ anchor.download = name;
2544
+ anchor.rel = 'noopener';
2545
+ anchor.hidden = true;
2546
+ body.appendChild(anchor);
2547
+ anchor.click();
2548
+ anchor.remove();
2549
+ // why: thu hồi URL ngay sau click có thể cắt ngang việc trình duyệt đọc blob (Firefox/Safari) — giữ một lúc rồi mới revoke.
2550
+ // Timer chạy ngoài zone để 40 giây chờ không giữ ứng dụng ở trạng thái "chưa ổn định" (whenStable, SSR, e2e).
2551
+ const timer = this.#zone.runOutsideAngular(() => setTimeout(() => {
2552
+ this.#downloadUrls.delete(url);
2553
+ this.#revokeObjectUrl(url);
2554
+ }, DOWNLOAD_URL_TTL_MS));
2555
+ this.#downloadUrls.set(url, timer);
2556
+ }
2557
+ // ---- Internals: DOM helpers ----
2558
+ #acceptsDrag(event) {
2559
+ const types = event.dataTransfer?.types;
2560
+ return this.canUpload() && !!types && Array.from(types).includes('Files');
2561
+ }
2562
+ #droppedFiles(transfer) {
2563
+ if (!transfer)
2564
+ return [];
2565
+ const items = transfer.items ? Array.from(transfer.items) : [];
2566
+ if (items.length > 0 && typeof items[0].webkitGetAsEntry === 'function') {
2567
+ // why: thả một thư mục cho ra File rỗng không đọc được — bỏ qua thư mục thay vì tạo transfer chắc chắn lỗi.
2568
+ return items
2569
+ .filter(item => item.kind === 'file' && !item.webkitGetAsEntry()?.isDirectory)
2570
+ .map(item => item.getAsFile())
2571
+ .filter((file) => !!file);
2572
+ }
2573
+ return Array.from(transfer.files ?? []);
2574
+ }
2575
+ #isBlob(value) {
2576
+ return typeof Blob !== 'undefined' && value instanceof Blob;
2577
+ }
2578
+ #createObjectUrl(blob) {
2579
+ const urlApi = this.#document.defaultView?.URL;
2580
+ return typeof urlApi?.createObjectURL === 'function' ? urlApi.createObjectURL(blob) : null;
2581
+ }
2582
+ #revokeObjectUrl(url) {
2583
+ this.#document.defaultView?.URL?.revokeObjectURL?.(url);
2584
+ }
2585
+ #teardown() {
2586
+ this.#destroyed = true;
2587
+ this.#resizeObserver?.disconnect();
2588
+ for (const controller of this.#listControllers.values())
2589
+ controller.abort();
2590
+ this.#listControllers.clear();
2591
+ if (this.#searchTimer)
2592
+ clearTimeout(this.#searchTimer);
2593
+ this.#searchController?.abort();
2594
+ this.#releasePreview();
2595
+ for (const job of this.#jobs.values())
2596
+ job.attempt?.controller.abort();
2597
+ for (const [url, timer] of this.#downloadUrls) {
2598
+ clearTimeout(timer);
2599
+ this.#revokeObjectUrl(url);
2600
+ }
2601
+ this.#downloadUrls.clear();
2602
+ this.#shareController?.abort();
2603
+ }
2604
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorer, deps: [], target: i0.ɵɵFactoryTarget.Component });
2605
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdFileExplorer, isStandalone: true, selector: "sd-file-explorer", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "open" }, host: { listeners: { "dragenter": "onDragEnter($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave()", "drop": "onDrop($event)", "keydown.escape": "onEscape($event)" }, properties: { "class.sd-file-explorer--compact": "compact()", "class.sd-file-explorer--dragging": "dragActive()", "attr.data-autoid": "autoId()" }, classAttribute: "sd-file-explorer" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "folderInput", first: true, predicate: ["folderInput"], descendants: true, isSignal: true }, { propertyName: "newFolderButton", first: true, predicate: ["newFolderButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "copyButton", first: true, predicate: ["copyButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "shareInput", first: true, predicate: ["shareInput"], descendants: true, isSignal: true }, { propertyName: "shareDialog", first: true, predicate: ["shareDialog"], descendants: true, isSignal: true }, { propertyName: "sidebar", first: true, predicate: ["sidebar"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _option = option();\n@let _compact = compact();\n@let _autoId = autoId();\n@let _canUpload = canUpload();\n@let _canDownload = canDownload();\n@let _view = view();\n@let _state = contentState();\n@let _keyword = keyword();\n@let _sidebarOpen = sidebarOpen();\n@let _preview = previewView();\n@let _transfers = transferViews();\n@let _heading = heading();\n@let _searching = searching();\n@let _collapsed = transfersCollapsed();\n@let _dialogOpen = folderDialogOpen();\n@let _shareItem = shareItem();\n@let _canShare = canShare();\n@let _modalOpen = _dialogOpen || !!_shareItem;\n\n<header class=\"header\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_option.title) {\n <div class=\"brand\">\n <span class=\"brand-icon\" aria-hidden=\"true\">\n <sd-icon name=\"folder\" size=\"20px\" />\n </span>\n <div class=\"brand-text\">\n <h2 class=\"brand-title\" [title]=\"_option.title\">{{ _option.title }}</h2>\n @if (_option.description) {\n <p class=\"brand-description\">{{ _option.description }}</p>\n }\n </div>\n </div>\n }\n\n <div class=\"search\" role=\"search\">\n <sd-icon class=\"search-icon\" name=\"search\" size=\"20px\" />\n <input\n #searchInput\n type=\"search\"\n class=\"search-input\"\n autocomplete=\"off\"\n [value]=\"_keyword\"\n [placeholder]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.aria-label]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n (input)=\"onKeywordInput(searchInput.value)\" />\n @if (_keyword) {\n <button\n type=\"button\"\n class=\"search-clear\"\n [attr.aria-label]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n [title]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\" />\n </button>\n }\n </div>\n\n @if (_canUpload) {\n <sd-button\n class=\"upload-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"file_upload\"\n [title]=\"_compact ? undefined : ('core.component.file-explorer.upload' | sdTranslate)\"\n [tooltip]=\"_compact ? ('core.component.file-explorer.upload' | sdTranslate) : undefined\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-upload' : null\"\n (click)=\"fileInput.click()\" />\n <input\n #fileInput\n type=\"file\"\n class=\"file-input\"\n multiple\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-file-input' : null\"\n (change)=\"onFilesPicked(fileInput)\" />\n }\n</header>\n\n<!-- why: dialog ph\u1EE7 c\u1EA3 explorer n\u00EAn l\u00E0m inert c\u1EA3 v\u00F9ng n\u00E0y, k\u1EC3 c\u1EA3 drawer chi ti\u1EBFt \u0111ang n\u1EB1m trong .main. -->\n<div class=\"body\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_compact && _sidebarOpen) {\n <div class=\"scrim scrim--sidebar\" aria-hidden=\"true\" (click)=\"sidebarOpen.set(false)\"></div>\n }\n <aside\n #sidebar\n class=\"sidebar\"\n [class.sidebar--open]=\"_sidebarOpen\"\n [id]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [attr.inert]=\"_compact && !_sidebarOpen ? '' : null\">\n <p class=\"sidebar-label\">{{ 'core.component.file-explorer.folders' | sdTranslate }}</p>\n <div class=\"sidebar-tree\">\n <sd-file-explorer-folder-tree\n [nodes]=\"treeNodes()\"\n [label]=\"'core.component.file-explorer.tree-label' | sdTranslate\"\n (select)=\"onTreeSelect($event)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\" />\n </div>\n @if (canCreateFolder()) {\n <div class=\"sidebar-footer\">\n <sd-button\n #newFolderButton\n class=\"new-folder-button\"\n type=\"outline\"\n color=\"secondary\"\n size=\"md\"\n prefixIcon=\"add\"\n block\n [title]=\"'core.component.file-explorer.new-folder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-new-folder' : null\"\n (click)=\"openFolderDialog()\" />\n </div>\n }\n </aside>\n\n <!-- why: .main l\u00E0 [container] c\u1EE7a drawer chi ti\u1EBFt \u2014 backdrop ch\u1EC9 ph\u1EE7 v\u00F9ng b\u00EAn ph\u1EA3i, c\u00E2y th\u01B0 m\u1EE5c v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c.\n Drawer n\u1EB1m TRONG ph\u1EA7n t\u1EED n\u00E0y n\u00EAn inert \u0111\u1EB7t tr\u00EAn t\u1EEBng kh\u1ED1i con, kh\u00F4ng \u0111\u1EB7t tr\u00EAn .main. -->\n <section #mainRegion class=\"main\" [attr.aria-label]=\"_heading\">\n @if (refreshing()) {\n <div class=\"refresh-bar\" aria-hidden=\"true\"></div>\n }\n <div class=\"toolbar\" [attr.inert]=\"_preview ? '' : null\">\n @if (_compact) {\n <button\n type=\"button\"\n class=\"icon-button\"\n [attr.aria-expanded]=\"_sidebarOpen\"\n [attr.aria-controls]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"\n (_sidebarOpen ? 'core.component.file-explorer.close-folders' : 'core.component.file-explorer.open-folders') | sdTranslate\n \"\n [attr.data-autoid]=\"_autoId ? _autoId + '-menu' : null\"\n (click)=\"toggleSidebar()\">\n <sd-icon name=\"menu\" size=\"24px\" />\n </button>\n }\n <sd-breadcrumb\n class=\"breadcrumb\"\n [items]=\"breadcrumb().items\"\n [maxItems]=\"_compact ? 3 : 5\"\n [ariaLabel]=\"'core.component.file-explorer.breadcrumb' | sdTranslate\"\n (sdItemActivate)=\"onBreadcrumb($event)\" />\n <div class=\"view-toggle\" role=\"group\" [attr.aria-label]=\"'core.component.file-explorer.view' | sdTranslate\">\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'list'\"\n [attr.aria-pressed]=\"_view === 'list'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-list' : null\"\n (click)=\"setView('list')\">\n <sd-icon name=\"format_list_bulleted\" size=\"24px\" />\n </button>\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'grid'\"\n [attr.aria-pressed]=\"_view === 'grid'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-grid' : null\"\n (click)=\"setView('grid')\">\n <sd-icon name=\"grid_view\" size=\"24px\" />\n </button>\n </div>\n </div>\n\n <div class=\"heading-row\" [attr.inert]=\"_preview ? '' : null\">\n <h3 class=\"heading\" [title]=\"_heading\">{{ _heading }}</h3>\n @if (_state === 'items') {\n <span class=\"count\">{{ itemCountLabel() }}</span>\n }\n </div>\n\n <div class=\"scroller\" [attr.inert]=\"_preview ? '' : null\">\n @switch (_state) {\n @case ('loading') {\n <sd-data-state\n state=\"loading\"\n compact\n [title]=\"(_searching ? 'core.component.file-explorer.search-loading' : 'core.component.file-explorer.loading') | sdTranslate\" />\n }\n @case ('error') {\n <sd-data-state\n state=\"error\"\n retryable\n [title]=\"(_searching ? 'core.component.file-explorer.search-error' : 'core.component.file-explorer.load-error') | sdTranslate\"\n [message]=\"errorMessage()\"\n [retryLabel]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (sdRetry)=\"retryContent()\" />\n }\n @case ('empty') {\n <sd-data-state\n state=\"empty\"\n [icon]=\"_searching ? 'search_off' : 'folder_open'\"\n [title]=\"emptyTitle()\"\n [message]=\"emptyMessage()\" />\n }\n @default {\n <sd-file-explorer-item-list\n [items]=\"itemViews()\"\n [view]=\"_view\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [compact]=\"_compact\"\n [activeId]=\"_preview ? _preview.item.id : null\"\n [label]=\"_heading\"\n (activate)=\"onActivate($event)\"\n (download)=\"downloadItem($event.item)\"\n (share)=\"openShare($event.item)\" />\n }\n }\n </div>\n </section>\n</div>\n\n@if (_transfers.length) {\n <sd-file-explorer-transfer-panel\n class=\"transfers\"\n [attr.inert]=\"_modalOpen ? '' : null\"\n [transfers]=\"_transfers\"\n [title]=\"transfersTitle()\"\n [collapsed]=\"_collapsed\"\n [canClear]=\"canClearTransfers()\"\n [compact]=\"_compact\"\n [autoId]=\"_autoId ? _autoId + '-transfers' : undefined\"\n (toggleCollapsed)=\"transfersCollapsed.set(!_collapsed)\"\n (clear)=\"clearFinishedTransfers()\"\n (cancel)=\"cancelTransfer($event)\"\n (retry)=\"retryTransfer($event)\"\n (dismiss)=\"dismissTransfer($event)\" />\n}\n\n<!-- why: chi ti\u1EBFt file l\u00E0 sd-side-drawer th\u1EADt, m\u1EDF g\u1ECDn trong v\u00F9ng danh s\u00E1ch b\u00EAn ph\u1EA3i nh\u1EDD [container]:\n header (t\u00ECm ki\u1EBFm, t\u1EA3i l\u00EAn), c\u00E2y th\u01B0 m\u1EE5c v\u00E0 h\u00E0ng ch\u1EDD truy\u1EC1n t\u1EA3i v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c khi drawer m\u1EDF. -->\n<sd-file-explorer-preview-panel\n [view]=\"_preview\"\n [state]=\"previewState()\"\n [meta]=\"previewMeta()\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [container]=\"mainRegion\"\n [autoId]=\"_autoId ? _autoId + '-preview' : undefined\"\n (close)=\"closePreview()\"\n (download)=\"downloadPreview()\"\n (share)=\"sharePreview()\"\n (retry)=\"retryPreview()\"\n (imageError)=\"onPreviewImageError()\" />\n\n@if (dragActive()) {\n <div class=\"drop-overlay\" aria-hidden=\"true\">\n <div class=\"drop-card\">\n <sd-icon name=\"file_upload\" size=\"40px\" />\n <p class=\"drop-title\">{{ dropTitle() }}</p>\n </div>\n </div>\n}\n\n@if (_dialogOpen) {\n @let _folderName = folderName();\n @let _folderError = folderError();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeFolderDialog()\"></div>\n <form\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n novalidate\n [attr.aria-labelledby]=\"instanceId + '-folder-title'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-dialog' : null\"\n (submit)=\"submitFolder($event)\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-folder-title'\">{{ folderDialogTitle() }}</h3>\n <label class=\"field-label\" [for]=\"instanceId + '-folder-name'\">{{\n 'core.component.file-explorer.new-folder-name' | sdTranslate\n }}</label>\n <input\n #folderInput\n class=\"field-input\"\n autocomplete=\"off\"\n maxlength=\"255\"\n [id]=\"instanceId + '-folder-name'\"\n [value]=\"_folderName\"\n [attr.aria-invalid]=\"_folderError ? true : null\"\n [attr.aria-describedby]=\"_folderError ? instanceId + '-folder-error' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-name' : null\"\n (input)=\"folderName.set(folderInput.value)\" />\n @if (_folderError) {\n <p class=\"field-error\" role=\"alert\" [id]=\"instanceId + '-folder-error'\">{{ _folderError }}</p>\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"cancel-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeFolderDialog()\" />\n <sd-button\n class=\"submit-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n htmlType=\"submit\"\n [title]=\"'core.component.file-explorer.create' | sdTranslate\"\n [disabled]=\"!_folderName.trim()\"\n [loading]=\"folderSubmitting()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-submit' : null\" />\n </div>\n </form>\n}\n\n@if (_shareItem) {\n @let _shareState = shareState();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeShare()\"></div>\n <div\n #shareDialog\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"instanceId + '-share-title'\"\n [attr.aria-busy]=\"_shareState.status === 'loading' ? true : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-dialog' : null\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-share-title'\" [title]=\"_shareItem.name\">{{ shareTitle() }}</h3>\n @switch (_shareState.status) {\n @case ('loading') {\n <p class=\"share-status\" role=\"status\">\n <span class=\"spinner\" aria-hidden=\"true\"></span>\n {{ 'core.component.file-explorer.share.loading' | sdTranslate }}\n </p>\n }\n @case ('error') {\n <p class=\"field-error\" role=\"alert\">{{ _shareState.message }}</p>\n }\n @case ('ready') {\n <label class=\"field-label\" [for]=\"instanceId + '-share-link'\">{{ 'core.component.file-explorer.share.link' | sdTranslate }}</label>\n <input\n #shareInput\n class=\"field-input\"\n readonly\n [id]=\"instanceId + '-share-link'\"\n [value]=\"_shareState.url\"\n [attr.aria-describedby]=\"instanceId + '-share-feedback'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-link' : null\"\n (focus)=\"shareInput.select()\" />\n <p class=\"share-feedback\" role=\"status\" aria-live=\"polite\" [id]=\"instanceId + '-share-feedback'\">{{ shareFeedbackLabel() }}</p>\n }\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"close-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.close' | sdTranslate\"\n (click)=\"closeShare()\" />\n @if (_shareState.status === 'error') {\n <sd-button\n class=\"retry-button\"\n type=\"outline\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"refresh\"\n [title]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (click)=\"retryShare()\" />\n } @else {\n <sd-button\n #copyButton\n class=\"copy-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"content_copy\"\n [title]=\"\n (shareFeedback() === 'copied' ? 'core.component.file-explorer.share.copied' : 'core.component.file-explorer.share.copy')\n | sdTranslate\n \"\n [disabled]=\"_shareState.status !== 'ready'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-copy' : null\"\n (click)=\"copyShareLink()\" />\n }\n </div>\n </div>\n}\n", styles: [":host{--sd-fe-accent: var(--sd-file-explorer-accent, var(--sd-primary, #005cbb));--sd-fe-accent-strong: var(--sd-file-explorer-accent-strong, color-mix(in srgb, var(--sd-fe-accent) 84%, var(--sd-file-explorer-mix-shade, #000000)));--sd-fe-accent-contrast: var(--sd-file-explorer-accent-contrast, var(--sd-primary-contrast, #ffffff));--sd-fe-accent-soft: var(--sd-file-explorer-accent-soft, color-mix(in srgb, var(--sd-fe-accent) 10%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-surface: var(--sd-file-explorer-surface, #ffffff);--sd-fe-sidebar-bg: var(--sd-file-explorer-sidebar-bg, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 26%, var(--sd-fe-surface)));--sd-fe-muted-surface: var( --sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-fe-surface)) );--sd-fe-preview-bg: var(--sd-file-explorer-preview-bg, color-mix(in srgb, var(--sd-fe-accent) 9%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-border: var(--sd-file-explorer-border, color-mix(in srgb, var(--sd-border, #c4c6d0) 55%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-border-strong: var(--sd-file-explorer-border-strong, var(--sd-border, #c4c6d0));--sd-fe-text: var(--sd-file-explorer-text, var(--sd-text, #1a1b1f));--sd-fe-text-secondary: var(--sd-file-explorer-text-secondary, color-mix(in srgb, var(--sd-text-secondary, #44474f) 84%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-hover: color-mix(in srgb, var(--sd-fe-text) 4%, transparent);--sd-fe-hover-strong: color-mix(in srgb, var(--sd-fe-text) 8%, transparent);--sd-fe-track: color-mix(in srgb, var(--sd-fe-text) 7%, var(--sd-fe-surface));--sd-fe-success: var(--sd-file-explorer-success, var(--sd-success, #2e7d32));--sd-fe-error: var(--sd-file-explorer-error, var(--sd-error, #ba1a1a));--sd-fe-radius: var(--sd-file-explorer-radius, 16px);--sd-fe-scrim: var(--sd-file-explorer-scrim, rgba(0, 0, 0, .4));--sd-side-drawer-contained-z-index: 9;position:relative;display:flex;flex-direction:column;height:100%;min-height:480px;overflow:hidden;border:1px solid var(--sd-fe-border);border-radius:var(--sd-fe-radius);background:var(--sd-fe-surface);color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.header{display:grid;grid-template-columns:fit-content(320px) minmax(0,1fr) auto;align-items:center;gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--sd-fe-border)}.brand{grid-column:1;display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--sd-fe-accent) 14%,var(--sd-file-explorer-mix-tint, #ffffff));color:var(--sd-fe-accent)}.brand-text{min-width:0}.brand-title{margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);text-overflow:ellipsis;white-space:nowrap}.brand-description{margin:0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);color:var(--sd-fe-text-secondary);text-overflow:ellipsis;white-space:nowrap}.search{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;width:100%;max-width:520px;height:36px;padding:0 6px 0 12px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-muted-surface);transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.search:focus-within{border-color:var(--sd-fe-accent);background:var(--sd-fe-surface);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.search-icon{flex:none;color:var(--sd-fe-text-secondary)}.search-input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:none;background:transparent;color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-14, 14px)}.search-input::placeholder{color:var(--sd-fe-text-secondary)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.search-clear:hover{background:var(--sd-fe-hover-strong)}.upload-button{grid-column:3;justify-self:end}.file-input{display:none}.body{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:238px minmax(0,1fr)}.sidebar{display:flex;flex-direction:column;min-height:0;padding:22px 14px 32px 12px;border-right:1px solid var(--sd-fe-border);background:var(--sd-fe-sidebar-bg)}.sidebar-label{margin:0 0 6px 10px;font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-16, 16px);letter-spacing:.04em;text-transform:uppercase;color:var(--sd-fe-text-secondary)}.sidebar-tree{flex:1;min-height:0;margin:0 -4px;padding:2px 4px;overflow-y:auto}.sidebar-footer{margin:12px 4px 0;padding-top:18px;border-top:1px solid var(--sd-fe-border)}.new-folder-button{display:block}.main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:14px}.refresh-bar{position:absolute;top:0;left:0;right:0;height:2px;overflow:hidden;background:var(--sd-fe-accent-soft)}.refresh-bar:after{content:\"\";position:absolute;top:0;bottom:0;width:30%;background:var(--sd-fe-accent);animation:sd-file-explorer-refresh 1.2s ease-in-out infinite}.toolbar{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 32px}.breadcrumb{flex:1;min-width:0;margin-left:-4px;font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-semibold, 600)}.view-toggle{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-surface)}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.icon-button--toggle{width:40px;height:32px}.icon-button--active,.icon-button--active:hover{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent)}.heading-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:10px;padding:0 32px}.heading{min-width:0;margin:0;overflow:hidden;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-bold, 700);line-height:26px;text-overflow:ellipsis;white-space:nowrap}.count{flex:none;padding-bottom:12px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.scroller{flex:1;min-height:0;padding:8px 28px 16px;overflow-y:auto}.scrim{position:absolute;inset:0;background:var(--sd-fe-scrim);animation:sd-file-explorer-fade .18s ease}.transfers{flex:none;border-top:1px solid var(--sd-fe-border);background:var(--sd-fe-surface)}.drop-overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;border:2px dashed var(--sd-fe-accent);border-radius:var(--sd-fe-radius);background:color-mix(in srgb,var(--sd-fe-accent) 8%,rgba(255,255,255,.86));pointer-events:none}.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--sd-fe-accent);text-align:center}.drop-title{margin:0;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600)}.dialog-backdrop{position:absolute;inset:0;z-index:20;background:var(--sd-fe-scrim)}.dialog{position:absolute;top:50%;left:50%;z-index:21;display:flex;flex-direction:column;gap:8px;width:min(400px,100% - 32px);padding:20px;border-radius:14px;background:var(--sd-fe-surface);box-shadow:0 18px 48px #0f172a2e;transform:translate(-50%,-50%)}.dialog:focus{outline:none}.dialog-title{margin:0 0 8px;font-size:17px;font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-24, 24px)}.field-label{font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.field-input{height:40px;padding:0 12px;border:1px solid var(--sd-fe-border-strong);border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-surface);color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-15, 15px);outline:none}.field-input:focus{border-color:var(--sd-fe-accent);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.field-input[aria-invalid=true]{border-color:var(--sd-fe-error)}.field-error{margin:0;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-error)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.share-status{display:flex;align-items:center;gap:10px;margin:4px 0;font-size:var(--sd-font-size-14, 14px);color:var(--sd-fe-text-secondary)}.share-feedback{min-height:18px;margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-success)}.spinner{flex:none;width:18px;height:18px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-spin .8s linear infinite}:host(.sd-file-explorer--compact) .header{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:12px 14px}:host(.sd-file-explorer--compact) .brand{grid-row:1;gap:10px}:host(.sd-file-explorer--compact) .upload-button{grid-column:2;grid-row:1}:host(.sd-file-explorer--compact) .search{grid-column:1/-1;grid-row:2;max-width:none}:host(.sd-file-explorer--compact) .header:not(:has(.brand)) .search{grid-column:1;grid-row:1}:host(.sd-file-explorer--compact) .body{grid-template-columns:minmax(0,1fr)}:host(.sd-file-explorer--compact) .sidebar{position:absolute;top:0;bottom:0;left:0;z-index:5;width:min(300px,86%);border-right:1px solid var(--sd-fe-border);box-shadow:12px 0 32px #0f172a1f;visibility:hidden;transform:translate(-100%);transition:transform var(--sd-duration-base, .2s) ease,visibility var(--sd-duration-base, .2s)}:host(.sd-file-explorer--compact) .sidebar--open{visibility:visible;transform:none}:host(.sd-file-explorer--compact) .scrim--sidebar{z-index:4}:host(.sd-file-explorer--compact) .main{padding-top:8px}:host(.sd-file-explorer--compact) .toolbar{gap:6px;min-height:36px;padding:0 12px 0 10px}:host(.sd-file-explorer--compact) .breadcrumb{margin-left:0}:host(.sd-file-explorer--compact) .icon-button--toggle{width:36px}:host(.sd-file-explorer--compact) .heading-row{margin-top:13px;padding:0 14px}:host(.sd-file-explorer--compact) .count{padding-bottom:8px}:host(.sd-file-explorer--compact) .scroller{padding:0 12px 12px}@keyframes sd-file-explorer-spin{to{transform:rotate(360deg)}}@keyframes sd-file-explorer-fade{0%{opacity:0}}@keyframes sd-file-explorer-refresh{0%{left:-30%}to{left:100%}}@media(prefers-reduced-motion:reduce){.scrim{animation:none}.search,:host(.sd-file-explorer--compact) .sidebar{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdBreadcrumb, selector: "sd-breadcrumb", inputs: ["items", "maxItems", "ariaLabel", "separator"], outputs: ["sdItemActivate"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "iconShape", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "component", type: SdFileExplorerFolderTree, selector: "sd-file-explorer-folder-tree", inputs: ["nodes", "label"], outputs: ["select", "toggle", "retry"] }, { kind: "component", type: SdFileExplorerItemList, selector: "sd-file-explorer-item-list", inputs: ["items", "view", "canDownload", "canShare", "compact", "activeId", "label"], outputs: ["activate", "download", "share"] }, { kind: "component", type: SdFileExplorerPreviewPanel, selector: "sd-file-explorer-preview-panel", inputs: ["view", "state", "meta", "canDownload", "canShare", "container", "autoId"], outputs: ["close", "download", "share", "retry", "imageError"] }, { kind: "component", type: SdFileExplorerTransferPanel, selector: "sd-file-explorer-transfer-panel", inputs: ["transfers", "title", "collapsed", "canClear", "compact", "autoId"], outputs: ["toggleCollapsed", "clear", "cancel", "retry", "dismiss"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2606
+ }
2607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdFileExplorer, decorators: [{
2608
+ type: Component,
2609
+ args: [{ selector: 'sd-file-explorer', standalone: true, imports: [
2610
+ SdIcon,
2611
+ SdTranslatePipe,
2612
+ SdBreadcrumb,
2613
+ SdButton,
2614
+ SdDataState,
2615
+ SdFileExplorerFolderTree,
2616
+ SdFileExplorerItemList,
2617
+ SdFileExplorerPreviewPanel,
2618
+ SdFileExplorerTransferPanel,
2619
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
2620
+ class: 'sd-file-explorer',
2621
+ '[class.sd-file-explorer--compact]': 'compact()',
2622
+ '[class.sd-file-explorer--dragging]': 'dragActive()',
2623
+ '[attr.data-autoid]': 'autoId()',
2624
+ '(dragenter)': 'onDragEnter($event)',
2625
+ '(dragover)': 'onDragOver($event)',
2626
+ '(dragleave)': 'onDragLeave()',
2627
+ '(drop)': 'onDrop($event)',
2628
+ '(keydown.escape)': 'onEscape($event)',
2629
+ }, template: "@let _option = option();\n@let _compact = compact();\n@let _autoId = autoId();\n@let _canUpload = canUpload();\n@let _canDownload = canDownload();\n@let _view = view();\n@let _state = contentState();\n@let _keyword = keyword();\n@let _sidebarOpen = sidebarOpen();\n@let _preview = previewView();\n@let _transfers = transferViews();\n@let _heading = heading();\n@let _searching = searching();\n@let _collapsed = transfersCollapsed();\n@let _dialogOpen = folderDialogOpen();\n@let _shareItem = shareItem();\n@let _canShare = canShare();\n@let _modalOpen = _dialogOpen || !!_shareItem;\n\n<header class=\"header\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_option.title) {\n <div class=\"brand\">\n <span class=\"brand-icon\" aria-hidden=\"true\">\n <sd-icon name=\"folder\" size=\"20px\" />\n </span>\n <div class=\"brand-text\">\n <h2 class=\"brand-title\" [title]=\"_option.title\">{{ _option.title }}</h2>\n @if (_option.description) {\n <p class=\"brand-description\">{{ _option.description }}</p>\n }\n </div>\n </div>\n }\n\n <div class=\"search\" role=\"search\">\n <sd-icon class=\"search-icon\" name=\"search\" size=\"20px\" />\n <input\n #searchInput\n type=\"search\"\n class=\"search-input\"\n autocomplete=\"off\"\n [value]=\"_keyword\"\n [placeholder]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.aria-label]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n (input)=\"onKeywordInput(searchInput.value)\" />\n @if (_keyword) {\n <button\n type=\"button\"\n class=\"search-clear\"\n [attr.aria-label]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n [title]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\" />\n </button>\n }\n </div>\n\n @if (_canUpload) {\n <sd-button\n class=\"upload-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"file_upload\"\n [title]=\"_compact ? undefined : ('core.component.file-explorer.upload' | sdTranslate)\"\n [tooltip]=\"_compact ? ('core.component.file-explorer.upload' | sdTranslate) : undefined\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-upload' : null\"\n (click)=\"fileInput.click()\" />\n <input\n #fileInput\n type=\"file\"\n class=\"file-input\"\n multiple\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-file-input' : null\"\n (change)=\"onFilesPicked(fileInput)\" />\n }\n</header>\n\n<!-- why: dialog ph\u1EE7 c\u1EA3 explorer n\u00EAn l\u00E0m inert c\u1EA3 v\u00F9ng n\u00E0y, k\u1EC3 c\u1EA3 drawer chi ti\u1EBFt \u0111ang n\u1EB1m trong .main. -->\n<div class=\"body\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_compact && _sidebarOpen) {\n <div class=\"scrim scrim--sidebar\" aria-hidden=\"true\" (click)=\"sidebarOpen.set(false)\"></div>\n }\n <aside\n #sidebar\n class=\"sidebar\"\n [class.sidebar--open]=\"_sidebarOpen\"\n [id]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [attr.inert]=\"_compact && !_sidebarOpen ? '' : null\">\n <p class=\"sidebar-label\">{{ 'core.component.file-explorer.folders' | sdTranslate }}</p>\n <div class=\"sidebar-tree\">\n <sd-file-explorer-folder-tree\n [nodes]=\"treeNodes()\"\n [label]=\"'core.component.file-explorer.tree-label' | sdTranslate\"\n (select)=\"onTreeSelect($event)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\" />\n </div>\n @if (canCreateFolder()) {\n <div class=\"sidebar-footer\">\n <sd-button\n #newFolderButton\n class=\"new-folder-button\"\n type=\"outline\"\n color=\"secondary\"\n size=\"md\"\n prefixIcon=\"add\"\n block\n [title]=\"'core.component.file-explorer.new-folder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-new-folder' : null\"\n (click)=\"openFolderDialog()\" />\n </div>\n }\n </aside>\n\n <!-- why: .main l\u00E0 [container] c\u1EE7a drawer chi ti\u1EBFt \u2014 backdrop ch\u1EC9 ph\u1EE7 v\u00F9ng b\u00EAn ph\u1EA3i, c\u00E2y th\u01B0 m\u1EE5c v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c.\n Drawer n\u1EB1m TRONG ph\u1EA7n t\u1EED n\u00E0y n\u00EAn inert \u0111\u1EB7t tr\u00EAn t\u1EEBng kh\u1ED1i con, kh\u00F4ng \u0111\u1EB7t tr\u00EAn .main. -->\n <section #mainRegion class=\"main\" [attr.aria-label]=\"_heading\">\n @if (refreshing()) {\n <div class=\"refresh-bar\" aria-hidden=\"true\"></div>\n }\n <div class=\"toolbar\" [attr.inert]=\"_preview ? '' : null\">\n @if (_compact) {\n <button\n type=\"button\"\n class=\"icon-button\"\n [attr.aria-expanded]=\"_sidebarOpen\"\n [attr.aria-controls]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"\n (_sidebarOpen ? 'core.component.file-explorer.close-folders' : 'core.component.file-explorer.open-folders') | sdTranslate\n \"\n [attr.data-autoid]=\"_autoId ? _autoId + '-menu' : null\"\n (click)=\"toggleSidebar()\">\n <sd-icon name=\"menu\" size=\"24px\" />\n </button>\n }\n <sd-breadcrumb\n class=\"breadcrumb\"\n [items]=\"breadcrumb().items\"\n [maxItems]=\"_compact ? 3 : 5\"\n [ariaLabel]=\"'core.component.file-explorer.breadcrumb' | sdTranslate\"\n (sdItemActivate)=\"onBreadcrumb($event)\" />\n <div class=\"view-toggle\" role=\"group\" [attr.aria-label]=\"'core.component.file-explorer.view' | sdTranslate\">\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'list'\"\n [attr.aria-pressed]=\"_view === 'list'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-list' : null\"\n (click)=\"setView('list')\">\n <sd-icon name=\"format_list_bulleted\" size=\"24px\" />\n </button>\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'grid'\"\n [attr.aria-pressed]=\"_view === 'grid'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-grid' : null\"\n (click)=\"setView('grid')\">\n <sd-icon name=\"grid_view\" size=\"24px\" />\n </button>\n </div>\n </div>\n\n <div class=\"heading-row\" [attr.inert]=\"_preview ? '' : null\">\n <h3 class=\"heading\" [title]=\"_heading\">{{ _heading }}</h3>\n @if (_state === 'items') {\n <span class=\"count\">{{ itemCountLabel() }}</span>\n }\n </div>\n\n <div class=\"scroller\" [attr.inert]=\"_preview ? '' : null\">\n @switch (_state) {\n @case ('loading') {\n <sd-data-state\n state=\"loading\"\n compact\n [title]=\"(_searching ? 'core.component.file-explorer.search-loading' : 'core.component.file-explorer.loading') | sdTranslate\" />\n }\n @case ('error') {\n <sd-data-state\n state=\"error\"\n retryable\n [title]=\"(_searching ? 'core.component.file-explorer.search-error' : 'core.component.file-explorer.load-error') | sdTranslate\"\n [message]=\"errorMessage()\"\n [retryLabel]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (sdRetry)=\"retryContent()\" />\n }\n @case ('empty') {\n <sd-data-state\n state=\"empty\"\n [icon]=\"_searching ? 'search_off' : 'folder_open'\"\n [title]=\"emptyTitle()\"\n [message]=\"emptyMessage()\" />\n }\n @default {\n <sd-file-explorer-item-list\n [items]=\"itemViews()\"\n [view]=\"_view\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [compact]=\"_compact\"\n [activeId]=\"_preview ? _preview.item.id : null\"\n [label]=\"_heading\"\n (activate)=\"onActivate($event)\"\n (download)=\"downloadItem($event.item)\"\n (share)=\"openShare($event.item)\" />\n }\n }\n </div>\n </section>\n</div>\n\n@if (_transfers.length) {\n <sd-file-explorer-transfer-panel\n class=\"transfers\"\n [attr.inert]=\"_modalOpen ? '' : null\"\n [transfers]=\"_transfers\"\n [title]=\"transfersTitle()\"\n [collapsed]=\"_collapsed\"\n [canClear]=\"canClearTransfers()\"\n [compact]=\"_compact\"\n [autoId]=\"_autoId ? _autoId + '-transfers' : undefined\"\n (toggleCollapsed)=\"transfersCollapsed.set(!_collapsed)\"\n (clear)=\"clearFinishedTransfers()\"\n (cancel)=\"cancelTransfer($event)\"\n (retry)=\"retryTransfer($event)\"\n (dismiss)=\"dismissTransfer($event)\" />\n}\n\n<!-- why: chi ti\u1EBFt file l\u00E0 sd-side-drawer th\u1EADt, m\u1EDF g\u1ECDn trong v\u00F9ng danh s\u00E1ch b\u00EAn ph\u1EA3i nh\u1EDD [container]:\n header (t\u00ECm ki\u1EBFm, t\u1EA3i l\u00EAn), c\u00E2y th\u01B0 m\u1EE5c v\u00E0 h\u00E0ng ch\u1EDD truy\u1EC1n t\u1EA3i v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c khi drawer m\u1EDF. -->\n<sd-file-explorer-preview-panel\n [view]=\"_preview\"\n [state]=\"previewState()\"\n [meta]=\"previewMeta()\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [container]=\"mainRegion\"\n [autoId]=\"_autoId ? _autoId + '-preview' : undefined\"\n (close)=\"closePreview()\"\n (download)=\"downloadPreview()\"\n (share)=\"sharePreview()\"\n (retry)=\"retryPreview()\"\n (imageError)=\"onPreviewImageError()\" />\n\n@if (dragActive()) {\n <div class=\"drop-overlay\" aria-hidden=\"true\">\n <div class=\"drop-card\">\n <sd-icon name=\"file_upload\" size=\"40px\" />\n <p class=\"drop-title\">{{ dropTitle() }}</p>\n </div>\n </div>\n}\n\n@if (_dialogOpen) {\n @let _folderName = folderName();\n @let _folderError = folderError();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeFolderDialog()\"></div>\n <form\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n novalidate\n [attr.aria-labelledby]=\"instanceId + '-folder-title'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-dialog' : null\"\n (submit)=\"submitFolder($event)\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-folder-title'\">{{ folderDialogTitle() }}</h3>\n <label class=\"field-label\" [for]=\"instanceId + '-folder-name'\">{{\n 'core.component.file-explorer.new-folder-name' | sdTranslate\n }}</label>\n <input\n #folderInput\n class=\"field-input\"\n autocomplete=\"off\"\n maxlength=\"255\"\n [id]=\"instanceId + '-folder-name'\"\n [value]=\"_folderName\"\n [attr.aria-invalid]=\"_folderError ? true : null\"\n [attr.aria-describedby]=\"_folderError ? instanceId + '-folder-error' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-name' : null\"\n (input)=\"folderName.set(folderInput.value)\" />\n @if (_folderError) {\n <p class=\"field-error\" role=\"alert\" [id]=\"instanceId + '-folder-error'\">{{ _folderError }}</p>\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"cancel-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeFolderDialog()\" />\n <sd-button\n class=\"submit-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n htmlType=\"submit\"\n [title]=\"'core.component.file-explorer.create' | sdTranslate\"\n [disabled]=\"!_folderName.trim()\"\n [loading]=\"folderSubmitting()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-submit' : null\" />\n </div>\n </form>\n}\n\n@if (_shareItem) {\n @let _shareState = shareState();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeShare()\"></div>\n <div\n #shareDialog\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"instanceId + '-share-title'\"\n [attr.aria-busy]=\"_shareState.status === 'loading' ? true : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-dialog' : null\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-share-title'\" [title]=\"_shareItem.name\">{{ shareTitle() }}</h3>\n @switch (_shareState.status) {\n @case ('loading') {\n <p class=\"share-status\" role=\"status\">\n <span class=\"spinner\" aria-hidden=\"true\"></span>\n {{ 'core.component.file-explorer.share.loading' | sdTranslate }}\n </p>\n }\n @case ('error') {\n <p class=\"field-error\" role=\"alert\">{{ _shareState.message }}</p>\n }\n @case ('ready') {\n <label class=\"field-label\" [for]=\"instanceId + '-share-link'\">{{ 'core.component.file-explorer.share.link' | sdTranslate }}</label>\n <input\n #shareInput\n class=\"field-input\"\n readonly\n [id]=\"instanceId + '-share-link'\"\n [value]=\"_shareState.url\"\n [attr.aria-describedby]=\"instanceId + '-share-feedback'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-link' : null\"\n (focus)=\"shareInput.select()\" />\n <p class=\"share-feedback\" role=\"status\" aria-live=\"polite\" [id]=\"instanceId + '-share-feedback'\">{{ shareFeedbackLabel() }}</p>\n }\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"close-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.close' | sdTranslate\"\n (click)=\"closeShare()\" />\n @if (_shareState.status === 'error') {\n <sd-button\n class=\"retry-button\"\n type=\"outline\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"refresh\"\n [title]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (click)=\"retryShare()\" />\n } @else {\n <sd-button\n #copyButton\n class=\"copy-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"content_copy\"\n [title]=\"\n (shareFeedback() === 'copied' ? 'core.component.file-explorer.share.copied' : 'core.component.file-explorer.share.copy')\n | sdTranslate\n \"\n [disabled]=\"_shareState.status !== 'ready'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-copy' : null\"\n (click)=\"copyShareLink()\" />\n }\n </div>\n </div>\n}\n", styles: [":host{--sd-fe-accent: var(--sd-file-explorer-accent, var(--sd-primary, #005cbb));--sd-fe-accent-strong: var(--sd-file-explorer-accent-strong, color-mix(in srgb, var(--sd-fe-accent) 84%, var(--sd-file-explorer-mix-shade, #000000)));--sd-fe-accent-contrast: var(--sd-file-explorer-accent-contrast, var(--sd-primary-contrast, #ffffff));--sd-fe-accent-soft: var(--sd-file-explorer-accent-soft, color-mix(in srgb, var(--sd-fe-accent) 10%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-surface: var(--sd-file-explorer-surface, #ffffff);--sd-fe-sidebar-bg: var(--sd-file-explorer-sidebar-bg, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 26%, var(--sd-fe-surface)));--sd-fe-muted-surface: var( --sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-fe-surface)) );--sd-fe-preview-bg: var(--sd-file-explorer-preview-bg, color-mix(in srgb, var(--sd-fe-accent) 9%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-border: var(--sd-file-explorer-border, color-mix(in srgb, var(--sd-border, #c4c6d0) 55%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-border-strong: var(--sd-file-explorer-border-strong, var(--sd-border, #c4c6d0));--sd-fe-text: var(--sd-file-explorer-text, var(--sd-text, #1a1b1f));--sd-fe-text-secondary: var(--sd-file-explorer-text-secondary, color-mix(in srgb, var(--sd-text-secondary, #44474f) 84%, var(--sd-file-explorer-mix-tint, #ffffff)));--sd-fe-hover: color-mix(in srgb, var(--sd-fe-text) 4%, transparent);--sd-fe-hover-strong: color-mix(in srgb, var(--sd-fe-text) 8%, transparent);--sd-fe-track: color-mix(in srgb, var(--sd-fe-text) 7%, var(--sd-fe-surface));--sd-fe-success: var(--sd-file-explorer-success, var(--sd-success, #2e7d32));--sd-fe-error: var(--sd-file-explorer-error, var(--sd-error, #ba1a1a));--sd-fe-radius: var(--sd-file-explorer-radius, 16px);--sd-fe-scrim: var(--sd-file-explorer-scrim, rgba(0, 0, 0, .4));--sd-side-drawer-contained-z-index: 9;position:relative;display:flex;flex-direction:column;height:100%;min-height:480px;overflow:hidden;border:1px solid var(--sd-fe-border);border-radius:var(--sd-fe-radius);background:var(--sd-fe-surface);color:var(--sd-fe-text);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.header{display:grid;grid-template-columns:fit-content(320px) minmax(0,1fr) auto;align-items:center;gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--sd-fe-border)}.brand{grid-column:1;display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--sd-fe-accent) 14%,var(--sd-file-explorer-mix-tint, #ffffff));color:var(--sd-fe-accent)}.brand-text{min-width:0}.brand-title{margin:0;overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);text-overflow:ellipsis;white-space:nowrap}.brand-description{margin:0;overflow:hidden;font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);color:var(--sd-fe-text-secondary);text-overflow:ellipsis;white-space:nowrap}.search{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;width:100%;max-width:520px;height:36px;padding:0 6px 0 12px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-muted-surface);transition:border-color var(--sd-duration-fast, .12s) ease,box-shadow var(--sd-duration-fast, .12s) ease}.search:focus-within{border-color:var(--sd-fe-accent);background:var(--sd-fe-surface);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.search-icon{flex:none;color:var(--sd-fe-text-secondary)}.search-input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:none;background:transparent;color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-14, 14px)}.search-input::placeholder{color:var(--sd-fe-text-secondary)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.search-clear:hover{background:var(--sd-fe-hover-strong)}.upload-button{grid-column:3;justify-self:end}.file-input{display:none}.body{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:238px minmax(0,1fr)}.sidebar{display:flex;flex-direction:column;min-height:0;padding:22px 14px 32px 12px;border-right:1px solid var(--sd-fe-border);background:var(--sd-fe-sidebar-bg)}.sidebar-label{margin:0 0 6px 10px;font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-16, 16px);letter-spacing:.04em;text-transform:uppercase;color:var(--sd-fe-text-secondary)}.sidebar-tree{flex:1;min-height:0;margin:0 -4px;padding:2px 4px;overflow-y:auto}.sidebar-footer{margin:12px 4px 0;padding-top:18px;border-top:1px solid var(--sd-fe-border)}.new-folder-button{display:block}.main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:14px}.refresh-bar{position:absolute;top:0;left:0;right:0;height:2px;overflow:hidden;background:var(--sd-fe-accent-soft)}.refresh-bar:after{content:\"\";position:absolute;top:0;bottom:0;width:30%;background:var(--sd-fe-accent);animation:sd-file-explorer-refresh 1.2s ease-in-out infinite}.toolbar{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 32px}.breadcrumb{flex:1;min-width:0;margin-left:-4px;font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-semibold, 600)}.view-toggle{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--sd-fe-border);border-radius:var(--sd-radius-999, 999px);background:var(--sd-fe-surface)}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-file-explorer-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.icon-button--toggle{width:40px;height:32px}.icon-button--active,.icon-button--active:hover{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent)}.heading-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:10px;padding:0 32px}.heading{min-width:0;margin:0;overflow:hidden;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-bold, 700);line-height:26px;text-overflow:ellipsis;white-space:nowrap}.count{flex:none;padding-bottom:12px;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.scroller{flex:1;min-height:0;padding:8px 28px 16px;overflow-y:auto}.scrim{position:absolute;inset:0;background:var(--sd-fe-scrim);animation:sd-file-explorer-fade .18s ease}.transfers{flex:none;border-top:1px solid var(--sd-fe-border);background:var(--sd-fe-surface)}.drop-overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;border:2px dashed var(--sd-fe-accent);border-radius:var(--sd-fe-radius);background:color-mix(in srgb,var(--sd-fe-accent) 8%,rgba(255,255,255,.86));pointer-events:none}.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--sd-fe-accent);text-align:center}.drop-title{margin:0;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600)}.dialog-backdrop{position:absolute;inset:0;z-index:20;background:var(--sd-fe-scrim)}.dialog{position:absolute;top:50%;left:50%;z-index:21;display:flex;flex-direction:column;gap:8px;width:min(400px,100% - 32px);padding:20px;border-radius:14px;background:var(--sd-fe-surface);box-shadow:0 18px 48px #0f172a2e;transform:translate(-50%,-50%)}.dialog:focus{outline:none}.dialog-title{margin:0 0 8px;font-size:17px;font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-24, 24px)}.field-label{font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-text-secondary)}.field-input{height:40px;padding:0 12px;border:1px solid var(--sd-fe-border-strong);border-radius:var(--sd-radius-8, 8px);background:var(--sd-fe-surface);color:var(--sd-fe-text);font:inherit;font-size:var(--sd-font-size-15, 15px);outline:none}.field-input:focus{border-color:var(--sd-fe-accent);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.field-input[aria-invalid=true]{border-color:var(--sd-fe-error)}.field-error{margin:0;font-size:var(--sd-font-size-13, 13px);color:var(--sd-fe-error)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.share-status{display:flex;align-items:center;gap:10px;margin:4px 0;font-size:var(--sd-font-size-14, 14px);color:var(--sd-fe-text-secondary)}.share-feedback{min-height:18px;margin:0;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);color:var(--sd-fe-success)}.spinner{flex:none;width:18px;height:18px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-spin .8s linear infinite}:host(.sd-file-explorer--compact) .header{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:12px 14px}:host(.sd-file-explorer--compact) .brand{grid-row:1;gap:10px}:host(.sd-file-explorer--compact) .upload-button{grid-column:2;grid-row:1}:host(.sd-file-explorer--compact) .search{grid-column:1/-1;grid-row:2;max-width:none}:host(.sd-file-explorer--compact) .header:not(:has(.brand)) .search{grid-column:1;grid-row:1}:host(.sd-file-explorer--compact) .body{grid-template-columns:minmax(0,1fr)}:host(.sd-file-explorer--compact) .sidebar{position:absolute;top:0;bottom:0;left:0;z-index:5;width:min(300px,86%);border-right:1px solid var(--sd-fe-border);box-shadow:12px 0 32px #0f172a1f;visibility:hidden;transform:translate(-100%);transition:transform var(--sd-duration-base, .2s) ease,visibility var(--sd-duration-base, .2s)}:host(.sd-file-explorer--compact) .sidebar--open{visibility:visible;transform:none}:host(.sd-file-explorer--compact) .scrim--sidebar{z-index:4}:host(.sd-file-explorer--compact) .main{padding-top:8px}:host(.sd-file-explorer--compact) .toolbar{gap:6px;min-height:36px;padding:0 12px 0 10px}:host(.sd-file-explorer--compact) .breadcrumb{margin-left:0}:host(.sd-file-explorer--compact) .icon-button--toggle{width:36px}:host(.sd-file-explorer--compact) .heading-row{margin-top:13px;padding:0 14px}:host(.sd-file-explorer--compact) .count{padding-bottom:8px}:host(.sd-file-explorer--compact) .scroller{padding:0 12px 12px}@keyframes sd-file-explorer-spin{to{transform:rotate(360deg)}}@keyframes sd-file-explorer-fade{0%{opacity:0}}@keyframes sd-file-explorer-refresh{0%{left:-30%}to{left:100%}}@media(prefers-reduced-motion:reduce){.scrim{animation:none}.search,:host(.sd-file-explorer--compact) .sidebar{transition:none}}\n"] }]
2630
+ }], ctorParameters: () => [], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], open: [{ type: i0.Output, args: ["open"] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], folderInput: [{ type: i0.ViewChild, args: ['folderInput', { isSignal: true }] }], newFolderButton: [{ type: i0.ViewChild, args: ['newFolderButton', { ...{ read: ElementRef }, isSignal: true }] }], copyButton: [{ type: i0.ViewChild, args: ['copyButton', { ...{ read: ElementRef }, isSignal: true }] }], shareInput: [{ type: i0.ViewChild, args: ['shareInput', { isSignal: true }] }], shareDialog: [{ type: i0.ViewChild, args: ['shareDialog', { isSignal: true }] }], sidebar: [{ type: i0.ViewChild, args: ['sidebar', { isSignal: true }] }] } });
2631
+
2632
+ /**
2633
+ * Generated bundle index. Do not edit.
2634
+ */
2635
+
2636
+ export { SdFileExplorer };
2637
+ //# sourceMappingURL=sdcorejs-angular-components-file-explorer.mjs.map