@sd-angular/core 19.0.9 → 19.0.10

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 (104) hide show
  1. package/README.md +1 -1
  2. package/assets/scss/core/utilities/_grid.scss +149 -143
  3. package/components/form-generic/src/components/form-builder/components/attribute-table/attribute-table.component.d.ts +2 -4
  4. package/components/form-generic/src/components/form-builder/components/attribute-template/attribute-template.component.d.ts +2 -4
  5. package/components/form-generic/src/components/form-builder/components/configure-validation/configure-validation.component.d.ts +5 -6
  6. package/components/form-generic/src/components/form-render/form-render.component.d.ts +4 -6
  7. package/components/form-generic/src/services/form-generic.service.d.ts +1 -3
  8. package/components/modal/src/modal.component.d.ts +1 -1
  9. package/components/tab-router/src/models/tab-router.model.d.ts +2 -1
  10. package/components/tab-router/src/services/tab-router.service.d.ts +0 -1
  11. package/components/table/src/components/command/desktop-command.component.d.ts +7 -7
  12. package/components/table/src/components/command/pipes/command.pipe.d.ts +1 -12
  13. package/components/table/src/components/command/pipes/filter.pipe.d.ts +1 -8
  14. package/components/table/src/components/filter/column-filter/column-filter.component.d.ts +1 -0
  15. package/components/table/src/models/table-column.model.d.ts +3 -2
  16. package/components/table/src/pipes/selection-disabled.pipe.d.ts +1 -1
  17. package/components/table/src/services/config.service.d.ts +4 -5
  18. package/fesm2022/sd-angular-core-components-anchor.mjs +14 -14
  19. package/fesm2022/sd-angular-core-components-anchor.mjs.map +1 -1
  20. package/fesm2022/sd-angular-core-components-autoid-inspector.mjs.map +1 -1
  21. package/fesm2022/sd-angular-core-components-avatar.mjs.map +1 -1
  22. package/fesm2022/sd-angular-core-components-badge.mjs.map +1 -1
  23. package/fesm2022/sd-angular-core-components-button.mjs.map +1 -1
  24. package/fesm2022/sd-angular-core-components-ckeditor-styles.mjs.map +1 -1
  25. package/fesm2022/sd-angular-core-components-code-editor.mjs.map +1 -1
  26. package/fesm2022/sd-angular-core-components-document-builder.mjs +0 -1
  27. package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
  28. package/fesm2022/sd-angular-core-components-form-generic.mjs +37 -66
  29. package/fesm2022/sd-angular-core-components-form-generic.mjs.map +1 -1
  30. package/fesm2022/sd-angular-core-components-import-excel.mjs.map +1 -1
  31. package/fesm2022/sd-angular-core-components-inform.mjs.map +1 -1
  32. package/fesm2022/sd-angular-core-components-mini-editor.mjs.map +1 -1
  33. package/fesm2022/sd-angular-core-components-modal-resizable.mjs.map +1 -1
  34. package/fesm2022/sd-angular-core-components-modal.mjs.map +1 -1
  35. package/fesm2022/sd-angular-core-components-operator.mjs.map +1 -1
  36. package/fesm2022/sd-angular-core-components-org-chart.mjs.map +1 -1
  37. package/fesm2022/sd-angular-core-components-query-builder.mjs.map +1 -1
  38. package/fesm2022/sd-angular-core-components-quick-action.mjs.map +1 -1
  39. package/fesm2022/sd-angular-core-components-section.mjs.map +1 -1
  40. package/fesm2022/sd-angular-core-components-side-drawer.mjs.map +1 -1
  41. package/fesm2022/sd-angular-core-components-splitter.mjs.map +1 -1
  42. package/fesm2022/sd-angular-core-components-stepper.mjs.map +1 -1
  43. package/fesm2022/sd-angular-core-components-tab-router.mjs +31 -26
  44. package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
  45. package/fesm2022/sd-angular-core-components-tab.mjs.map +1 -1
  46. package/fesm2022/sd-angular-core-components-table.mjs +47 -58
  47. package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
  48. package/fesm2022/sd-angular-core-components-tree.mjs.map +1 -1
  49. package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
  50. package/fesm2022/sd-angular-core-directives.mjs +0 -1
  51. package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
  52. package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
  53. package/fesm2022/sd-angular-core-forms-chip-calendar.mjs.map +1 -1
  54. package/fesm2022/sd-angular-core-forms-chip.mjs.map +1 -1
  55. package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
  56. package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
  57. package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
  58. package/fesm2022/sd-angular-core-forms-input-color.mjs.map +1 -1
  59. package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
  60. package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
  61. package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
  62. package/fesm2022/sd-angular-core-forms-select.mjs +45 -12
  63. package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
  64. package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
  65. package/fesm2022/sd-angular-core-interceptors.mjs +0 -2
  66. package/fesm2022/sd-angular-core-interceptors.mjs.map +1 -1
  67. package/fesm2022/sd-angular-core-modules-auth.mjs +14 -38
  68. package/fesm2022/sd-angular-core-modules-auth.mjs.map +1 -1
  69. package/fesm2022/sd-angular-core-modules-layout.mjs +5 -12
  70. package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
  71. package/fesm2022/sd-angular-core-modules-permission.mjs +5 -12
  72. package/fesm2022/sd-angular-core-modules-permission.mjs.map +1 -1
  73. package/fesm2022/sd-angular-core-pipes.mjs +4 -12
  74. package/fesm2022/sd-angular-core-pipes.mjs.map +1 -1
  75. package/fesm2022/sd-angular-core-services-confirm.mjs +16 -21
  76. package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
  77. package/fesm2022/sd-angular-core-services-docx.mjs +1 -8
  78. package/fesm2022/sd-angular-core-services-docx.mjs.map +1 -1
  79. package/fesm2022/sd-angular-core-services-license.mjs +5 -12
  80. package/fesm2022/sd-angular-core-services-license.mjs.map +1 -1
  81. package/fesm2022/sd-angular-core-services-notify.mjs +70 -87
  82. package/fesm2022/sd-angular-core-services-notify.mjs.map +1 -1
  83. package/fesm2022/sd-angular-core-services-storage.mjs +4 -12
  84. package/fesm2022/sd-angular-core-services-storage.mjs.map +1 -1
  85. package/fesm2022/sd-angular-core-utilities-extensions.mjs +43 -1
  86. package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
  87. package/forms/select/src/select-footer-action.directive.d.ts +5 -1
  88. package/forms/select/src/select.component.d.ts +4 -0
  89. package/modules/auth/guards/auth.guard.d.ts +2 -4
  90. package/modules/auth/guards/portal.guard.d.ts +2 -4
  91. package/modules/auth/services/auth.service.d.ts +3 -4
  92. package/modules/layout/modules/home/guards/home-redirect.guard.d.ts +3 -5
  93. package/modules/permission/src/guards/permission.guard.d.ts +2 -5
  94. package/package.json +66 -66
  95. package/pipes/src/format-number.pipe.d.ts +1 -3
  96. package/sd-angular-core-19.0.10.tgz +0 -0
  97. package/services/confirm/src/lib/components/dialog-confirm/dialog-confirm.component.d.ts +3 -3
  98. package/services/license/src/license.service.d.ts +2 -3
  99. package/services/notify/src/components/toast/toast.component.d.ts +9 -13
  100. package/services/notify/src/notify.service.d.ts +4 -5
  101. package/services/storage/src/storage.service.d.ts +3 -4
  102. package/utilities/extensions/index.d.ts +1 -0
  103. package/utilities/extensions/src/object.extension.d.ts +8 -0
  104. package/sd-angular-core-19.0.9.tgz +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-services-docx.mjs","sources":["../../../projects/sd-angular/services/docx/src/lib/pandoc-core.ts","../../../projects/sd-angular/services/docx/src/lib/docx.service.ts","../../../projects/sd-angular/services/docx/sd-angular-core-services-docx.ts"],"sourcesContent":["/* Pandoc WASM core logic — adapted from pandoc-wasm/src/core.js\r\n *\r\n * This file is a local copy of the environment-agnostic pandoc core.\r\n * It imports @bjorn3/browser_wasi_shim directly, avoiding the pandoc-wasm\r\n * package entry points which use top-level await (incompatible with\r\n * Angular's esbuild/Vite build pipeline).\r\n *\r\n * Source: https://github.com/pandoc/pandoc-wasm (GPL-2.0-or-later)\r\n */\r\n\r\n// @ts-nocheck\r\nimport {\r\n ConsoleStdout,\r\n File,\r\n OpenFile,\r\n PreopenDirectory,\r\n WASI,\r\n} from '@bjorn3/browser_wasi_shim';\r\n\r\nexport interface PandocConvertResult {\r\n stdout: string;\r\n stderr: string;\r\n warnings: any[];\r\n files: Record<string, any>;\r\n mediaFiles: Record<string, any>;\r\n}\r\n\r\nexport interface PandocInstance {\r\n convert(\r\n options: Record<string, any>,\r\n stdin: string | null,\r\n files: Record<string, Blob | string>\r\n ): Promise<PandocConvertResult>;\r\n}\r\n\r\nexport function createPandocInstance(wasmBinary: ArrayBuffer): Promise<PandocInstance> {\r\n const args = ['pandoc.wasm', '+RTS', '-H64m', '-RTS'];\r\n const env: string[] = [];\r\n const fileSystem = new Map();\r\n const fds = [\r\n new OpenFile(new File(new Uint8Array(), { readonly: true })),\r\n ConsoleStdout.lineBuffered((msg: string) => console.log(`[WASI stdout] ${msg}`)),\r\n ConsoleStdout.lineBuffered((msg: string) => console.warn(`[WASI stderr] ${msg}`)),\r\n new PreopenDirectory('/', fileSystem),\r\n ];\r\n const options = { debug: false };\r\n const wasi = new WASI(args, env, fds, options);\r\n\r\n return WebAssembly.instantiate(wasmBinary, {\r\n wasi_snapshot_preview1: wasi.wasiImport,\r\n }).then(({ instance }: any) => {\r\n wasi.initialize(instance);\r\n instance.exports.__wasm_call_ctors();\r\n\r\n function memory_data_view() {\r\n return new DataView(instance.exports.memory.buffer);\r\n }\r\n\r\n const argc_ptr = instance.exports.malloc(4);\r\n memory_data_view().setUint32(argc_ptr, args.length, true);\r\n const argv = instance.exports.malloc(4 * (args.length + 1));\r\n for (let i = 0; i < args.length; ++i) {\r\n const arg = instance.exports.malloc(args[i].length + 1);\r\n new TextEncoder().encodeInto(\r\n args[i],\r\n new Uint8Array(instance.exports.memory.buffer, arg, args[i].length)\r\n );\r\n memory_data_view().setUint8(arg + args[i].length, 0);\r\n memory_data_view().setUint32(argv + 4 * i, arg, true);\r\n }\r\n memory_data_view().setUint32(argv + 4 * args.length, 0, true);\r\n const argv_ptr = instance.exports.malloc(4);\r\n memory_data_view().setUint32(argv_ptr, argv, true);\r\n\r\n instance.exports.hs_init_with_rtsopts(argc_ptr, argv_ptr);\r\n\r\n async function addFile(filename: string, data: Blob | string, readonly: boolean) {\r\n let uint8Array: Uint8Array;\r\n if (typeof data === 'string') {\r\n uint8Array = new TextEncoder().encode(data);\r\n } else {\r\n const buffer = await data.arrayBuffer();\r\n uint8Array = new Uint8Array(buffer);\r\n }\r\n const file = new File(uint8Array, { readonly });\r\n fileSystem.set(filename, file);\r\n }\r\n\r\n async function convert(\r\n options: Record<string, any>,\r\n stdin: string | null,\r\n files: Record<string, Blob | string>\r\n ): Promise<PandocConvertResult> {\r\n const opts_str = JSON.stringify(options);\r\n const encoded = new TextEncoder().encode(opts_str);\r\n const opts_ptr = instance.exports.malloc(encoded.length);\r\n new TextEncoder().encodeInto(\r\n opts_str,\r\n new Uint8Array(instance.exports.memory.buffer, opts_ptr, encoded.length)\r\n );\r\n\r\n files = { ...files };\r\n\r\n fileSystem.clear();\r\n const in_file = new File(new Uint8Array(), { readonly: true });\r\n const out_file = new File(new Uint8Array(), { readonly: false });\r\n const err_file = new File(new Uint8Array(), { readonly: false });\r\n const warnings_file = new File(new Uint8Array(), { readonly: false });\r\n fileSystem.set('stdin', in_file);\r\n fileSystem.set('stdout', out_file);\r\n fileSystem.set('stderr', err_file);\r\n fileSystem.set('warnings', warnings_file);\r\n\r\n const knownFiles = new Set(['stdin', 'stdout', 'stderr', 'warnings']);\r\n\r\n for (const filename in files) {\r\n await addFile(filename, files[filename], true);\r\n knownFiles.add(filename);\r\n }\r\n\r\n const outputFileName = options['output-file'] || null;\r\n const extractMediaPath = options['extract-media'] || null;\r\n\r\n if (outputFileName) {\r\n await addFile(outputFileName, new Blob(), false);\r\n knownFiles.add(outputFileName);\r\n }\r\n\r\n if (extractMediaPath) {\r\n await addFile(extractMediaPath, new Blob(), false);\r\n if (extractMediaPath.endsWith('.zip')) {\r\n knownFiles.add(extractMediaPath);\r\n }\r\n }\r\n\r\n if (stdin) {\r\n in_file.data = new TextEncoder().encode(stdin);\r\n }\r\n\r\n instance.exports.convert(opts_ptr, encoded.length);\r\n\r\n if (options['output-file']) {\r\n const outputFile = fileSystem.get(options['output-file']);\r\n if (outputFile && outputFile.data && outputFile.data.length > 0) {\r\n files[options['output-file']] = new Blob([outputFile.data]);\r\n }\r\n }\r\n\r\n if (options['extract-media']) {\r\n const mediaFile = fileSystem.get(options['extract-media']);\r\n if (mediaFile && mediaFile.data && mediaFile.data.length > 0) {\r\n files[options['extract-media']] = new Blob([mediaFile.data], { type: 'application/zip' });\r\n }\r\n }\r\n\r\n const mediaFiles: Record<string, Blob> = {};\r\n for (const [name, fileData] of fileSystem.entries()) {\r\n if (!knownFiles.has(name) && fileData && fileData.data && fileData.data.length > 0) {\r\n const blob = new Blob([fileData.data]);\r\n files[name] = blob;\r\n if (name !== outputFileName && name !== extractMediaPath) {\r\n mediaFiles[name] = blob;\r\n }\r\n }\r\n }\r\n\r\n const rawWarnings = new TextDecoder('utf-8', { fatal: true }).decode(warnings_file.data);\r\n let warnings: any[] = [];\r\n if (rawWarnings) {\r\n try {\r\n warnings = JSON.parse(rawWarnings);\r\n } catch (e) {\r\n console.warn('Failed to parse warnings:', e);\r\n }\r\n }\r\n\r\n return {\r\n stdout: new TextDecoder('utf-8', { fatal: true }).decode(out_file.data),\r\n stderr: new TextDecoder('utf-8', { fatal: true }).decode(err_file.data),\r\n warnings,\r\n files,\r\n mediaFiles,\r\n };\r\n }\r\n\r\n return { convert } as PandocInstance;\r\n });\r\n}\r\n","import { inject, Injectable } from '@angular/core';\r\nimport { SdNotifyService } from '@sd-angular/core/services/notify';\r\nimport { SdLoadingService } from '@sd-angular/core/services/loading';\r\nimport { I18nService } from '@sd-angular/core/i18n';\r\n\r\nimport { SdDocxConvertOptions, SdDocxConvertResult } from './docx.model';\r\nimport { createPandocInstance, PandocInstance } from './pandoc-core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SdDocxService {\r\n readonly #i18n = inject(I18nService);\r\n\r\n readonly #DEFAULT_MAX_SIZE_MB = 50;\r\n readonly #VALID_EXTENSIONS = ['.doc', '.docx'];\r\n\r\n readonly #PANDOC_WASM_URL = 'https://pandoc.github.io/pandoc-wasm/pandoc.wasm';\r\n\r\n #fileInput: HTMLInputElement | null = null;\r\n #pandocInstance: PandocInstance | null = null;\r\n\r\n constructor(\r\n private notifyService: SdNotifyService,\r\n private loadingService: SdLoadingService\r\n ) {}\r\n\r\n async open(options?: SdDocxConvertOptions): Promise<SdDocxConvertResult | null> {\r\n return new Promise(resolve => {\r\n this.#createFileInput();\r\n if (!this.#fileInput) {\r\n resolve(null);\r\n return;\r\n }\r\n\r\n const handleChange = async (event: Event) => {\r\n const input = event.target as HTMLInputElement;\r\n const file = input.files?.[0];\r\n\r\n if (!file) {\r\n resolve(null);\r\n return;\r\n }\r\n\r\n this.loadingService.start();\r\n try {\r\n const result = await this.convertToHtml(file, options);\r\n resolve(result);\r\n } catch (error) {\r\n console.error('[SdDocxService] DocX conversion error:', error);\r\n this.notifyService.error(this.#i18n.t('core.docx.convert-error'));\r\n resolve(null);\r\n } finally {\r\n input.value = '';\r\n input.removeEventListener('change', handleChange);\r\n this.loadingService.stop();\r\n }\r\n };\r\n\r\n this.#fileInput.addEventListener('change', handleChange, { once: true });\r\n this.#fileInput.click();\r\n });\r\n }\r\n\r\n #createFileInput(): void {\r\n if (this.#fileInput) {\r\n return;\r\n }\r\n\r\n this.#fileInput = document.createElement('input');\r\n this.#fileInput.type = 'file';\r\n this.#fileInput.accept = '.doc,.docx';\r\n this.#fileInput.style.display = 'none';\r\n document.body.appendChild(this.#fileInput);\r\n }\r\n\r\n async #getPandocInstance(): Promise<PandocInstance> {\r\n if (this.#pandocInstance) {\r\n return this.#pandocInstance;\r\n }\r\n\r\n console.log('[SdDocxService] Fetching WASM binary from:', this.#PANDOC_WASM_URL);\r\n const wasmResponse = await fetch(this.#PANDOC_WASM_URL);\r\n if (!wasmResponse.ok) {\r\n throw new Error(`Failed to fetch pandoc.wasm: ${wasmResponse.status} ${wasmResponse.statusText}`);\r\n }\r\n console.log('[SdDocxService] WASM fetched, size:', wasmResponse.headers.get('content-length'));\r\n const wasmBinary = await wasmResponse.arrayBuffer();\r\n console.log('[SdDocxService] WASM binary loaded, bytes:', wasmBinary.byteLength);\r\n this.#pandocInstance = await createPandocInstance(wasmBinary);\r\n console.log('[SdDocxService] Pandoc instance created successfully');\r\n return this.#pandocInstance;\r\n }\r\n\r\n async convertToHtml(input: File | Blob | ArrayBuffer, options?: SdDocxConvertOptions): Promise<SdDocxConvertResult | null> {\r\n const opts = {\r\n validateFormat: true,\r\n validateSize: true,\r\n maxSizeInMb: this.#DEFAULT_MAX_SIZE_MB,\r\n ...options,\r\n };\r\n\r\n try {\r\n let fileName: string | undefined;\r\n let fileSize: number | undefined;\r\n let blob: Blob;\r\n\r\n if (input instanceof File) {\r\n fileName = input.name;\r\n fileSize = input.size;\r\n blob = input;\r\n } else if (input instanceof Blob) {\r\n fileSize = input.size;\r\n blob = input;\r\n } else {\r\n blob = new Blob([input], {\r\n type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\r\n });\r\n }\r\n\r\n if (opts.validateFormat && fileName) {\r\n if (!this.#isValidFormat(fileName)) {\r\n this.notifyService.error(this.#i18n.t('core.docx.invalid-format'));\r\n return null;\r\n }\r\n }\r\n\r\n if (opts.validateSize && fileSize !== undefined) {\r\n const maxSizeInBytes = opts.maxSizeInMb! * 1024 * 1024;\r\n if (fileSize > maxSizeInBytes) {\r\n this.notifyService.error(this.#i18n.t('core.docx.size-exceeded'));\r\n return null;\r\n }\r\n }\r\n\r\n console.log('[SdDocxService] Getting pandoc instance...');\r\n const pandoc = await this.#getPandocInstance();\r\n console.log('[SdDocxService] Converting DOCX, blob size:', blob.size);\r\n\r\n const pandocOpts: Record<string, any> = {\r\n from: 'docx',\r\n to: 'html',\r\n 'input-files': ['document.docx'],\r\n standalone: true,\r\n 'embed-resources': true,\r\n };\r\n\r\n const result = await pandoc.convert(pandocOpts, null, { 'document.docx': blob });\r\n console.log('[SdDocxService] Conversion done, stdout length:', result.stdout?.length, 'stderr:', result.stderr);\r\n\r\n return {\r\n html: result.stdout,\r\n messages: result.warnings.map((w: any) => String(w)),\r\n };\r\n } catch (error) {\r\n console.error('[SdDocxService] DocX conversion error:', error);\r\n this.notifyService.error(this.#i18n.t('core.docx.convert-error'));\r\n return null;\r\n }\r\n }\r\n\r\n async convertToHtmlString(input: File | Blob | ArrayBuffer, options?: SdDocxConvertOptions): Promise<string | null> {\r\n const result = await this.convertToHtml(input, options);\r\n return result?.html ?? null;\r\n }\r\n\r\n #isValidFormat(fileName: string): boolean {\r\n const lowerCaseName = fileName.toLowerCase();\r\n return this.#VALID_EXTENSIONS.some(ext => lowerCaseName.endsWith(ext));\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["File"],"mappings":";;;;;;;AAAA;;;;;;;;AAQG;AAEH;AAyBM,SAAU,oBAAoB,CAAC,UAAuB,EAAA;IAC1D,MAAM,IAAI,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC;IACrD,MAAM,GAAG,GAAa,EAAE;AACxB,IAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE;AAC5B,IAAA,MAAM,GAAG,GAAG;AACV,QAAA,IAAI,QAAQ,CAAC,IAAIA,MAAI,CAAC,IAAI,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5D,QAAA,aAAa,CAAC,YAAY,CAAC,CAAC,GAAW,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA,cAAA,EAAiB,GAAG,CAAA,CAAE,CAAC,CAAC;AAChF,QAAA,aAAa,CAAC,YAAY,CAAC,CAAC,GAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA,cAAA,EAAiB,GAAG,CAAA,CAAE,CAAC,CAAC;AACjF,QAAA,IAAI,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC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AAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;4FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"sd-angular-core-services-docx.mjs","sources":["../../../projects/sd-angular/services/docx/src/lib/pandoc-core.ts","../../../projects/sd-angular/services/docx/src/lib/docx.service.ts","../../../projects/sd-angular/services/docx/sd-angular-core-services-docx.ts"],"sourcesContent":["/* Pandoc WASM core logic — adapted from pandoc-wasm/src/core.js\r\n *\r\n * This file is a local copy of the environment-agnostic pandoc core.\r\n * It imports @bjorn3/browser_wasi_shim directly, avoiding the pandoc-wasm\r\n * package entry points which use top-level await (incompatible with\r\n * Angular's esbuild/Vite build pipeline).\r\n *\r\n * Source: https://github.com/pandoc/pandoc-wasm (GPL-2.0-or-later)\r\n */\r\n\r\n// @ts-nocheck\r\nimport {\r\n ConsoleStdout,\r\n File,\r\n OpenFile,\r\n PreopenDirectory,\r\n WASI,\r\n} from '@bjorn3/browser_wasi_shim';\r\n\r\nexport interface PandocConvertResult {\r\n stdout: string;\r\n stderr: string;\r\n warnings: any[];\r\n files: Record<string, any>;\r\n mediaFiles: Record<string, any>;\r\n}\r\n\r\nexport interface PandocInstance {\r\n convert(\r\n options: Record<string, any>,\r\n stdin: string | null,\r\n files: Record<string, Blob | string>\r\n ): Promise<PandocConvertResult>;\r\n}\r\n\r\nexport function createPandocInstance(wasmBinary: ArrayBuffer): Promise<PandocInstance> {\r\n const args = ['pandoc.wasm', '+RTS', '-H64m', '-RTS'];\r\n const env: string[] = [];\r\n const fileSystem = new Map();\r\n const fds = [\r\n new OpenFile(new File(new Uint8Array(), { readonly: true })),\r\n ConsoleStdout.lineBuffered(() => undefined),\r\n ConsoleStdout.lineBuffered((msg: string) => console.warn(`[WASI stderr] ${msg}`)),\r\n new PreopenDirectory('/', fileSystem),\r\n ];\r\n const options = { debug: false };\r\n const wasi = new WASI(args, env, fds, options);\r\n\r\n return WebAssembly.instantiate(wasmBinary, {\r\n wasi_snapshot_preview1: wasi.wasiImport,\r\n }).then(({ instance }: any) => {\r\n wasi.initialize(instance);\r\n instance.exports.__wasm_call_ctors();\r\n\r\n function memory_data_view() {\r\n return new DataView(instance.exports.memory.buffer);\r\n }\r\n\r\n const argc_ptr = instance.exports.malloc(4);\r\n memory_data_view().setUint32(argc_ptr, args.length, true);\r\n const argv = instance.exports.malloc(4 * (args.length + 1));\r\n for (let i = 0; i < args.length; ++i) {\r\n const arg = instance.exports.malloc(args[i].length + 1);\r\n new TextEncoder().encodeInto(\r\n args[i],\r\n new Uint8Array(instance.exports.memory.buffer, arg, args[i].length)\r\n );\r\n memory_data_view().setUint8(arg + args[i].length, 0);\r\n memory_data_view().setUint32(argv + 4 * i, arg, true);\r\n }\r\n memory_data_view().setUint32(argv + 4 * args.length, 0, true);\r\n const argv_ptr = instance.exports.malloc(4);\r\n memory_data_view().setUint32(argv_ptr, argv, true);\r\n\r\n instance.exports.hs_init_with_rtsopts(argc_ptr, argv_ptr);\r\n\r\n async function addFile(filename: string, data: Blob | string, readonly: boolean) {\r\n let uint8Array: Uint8Array;\r\n if (typeof data === 'string') {\r\n uint8Array = new TextEncoder().encode(data);\r\n } else {\r\n const buffer = await data.arrayBuffer();\r\n uint8Array = new Uint8Array(buffer);\r\n }\r\n const file = new File(uint8Array, { readonly });\r\n fileSystem.set(filename, file);\r\n }\r\n\r\n async function convert(\r\n options: Record<string, any>,\r\n stdin: string | null,\r\n files: Record<string, Blob | string>\r\n ): Promise<PandocConvertResult> {\r\n const opts_str = JSON.stringify(options);\r\n const encoded = new TextEncoder().encode(opts_str);\r\n const opts_ptr = instance.exports.malloc(encoded.length);\r\n new TextEncoder().encodeInto(\r\n opts_str,\r\n new Uint8Array(instance.exports.memory.buffer, opts_ptr, encoded.length)\r\n );\r\n\r\n files = { ...files };\r\n\r\n fileSystem.clear();\r\n const in_file = new File(new Uint8Array(), { readonly: true });\r\n const out_file = new File(new Uint8Array(), { readonly: false });\r\n const err_file = new File(new Uint8Array(), { readonly: false });\r\n const warnings_file = new File(new Uint8Array(), { readonly: false });\r\n fileSystem.set('stdin', in_file);\r\n fileSystem.set('stdout', out_file);\r\n fileSystem.set('stderr', err_file);\r\n fileSystem.set('warnings', warnings_file);\r\n\r\n const knownFiles = new Set(['stdin', 'stdout', 'stderr', 'warnings']);\r\n\r\n for (const filename in files) {\r\n await addFile(filename, files[filename], true);\r\n knownFiles.add(filename);\r\n }\r\n\r\n const outputFileName = options['output-file'] || null;\r\n const extractMediaPath = options['extract-media'] || null;\r\n\r\n if (outputFileName) {\r\n await addFile(outputFileName, new Blob(), false);\r\n knownFiles.add(outputFileName);\r\n }\r\n\r\n if (extractMediaPath) {\r\n await addFile(extractMediaPath, new Blob(), false);\r\n if (extractMediaPath.endsWith('.zip')) {\r\n knownFiles.add(extractMediaPath);\r\n }\r\n }\r\n\r\n if (stdin) {\r\n in_file.data = new TextEncoder().encode(stdin);\r\n }\r\n\r\n instance.exports.convert(opts_ptr, encoded.length);\r\n\r\n if (options['output-file']) {\r\n const outputFile = fileSystem.get(options['output-file']);\r\n if (outputFile && outputFile.data && outputFile.data.length > 0) {\r\n files[options['output-file']] = new Blob([outputFile.data]);\r\n }\r\n }\r\n\r\n if (options['extract-media']) {\r\n const mediaFile = fileSystem.get(options['extract-media']);\r\n if (mediaFile && mediaFile.data && mediaFile.data.length > 0) {\r\n files[options['extract-media']] = new Blob([mediaFile.data], { type: 'application/zip' });\r\n }\r\n }\r\n\r\n const mediaFiles: Record<string, Blob> = {};\r\n for (const [name, fileData] of fileSystem.entries()) {\r\n if (!knownFiles.has(name) && fileData && fileData.data && fileData.data.length > 0) {\r\n const blob = new Blob([fileData.data]);\r\n files[name] = blob;\r\n if (name !== outputFileName && name !== extractMediaPath) {\r\n mediaFiles[name] = blob;\r\n }\r\n }\r\n }\r\n\r\n const rawWarnings = new TextDecoder('utf-8', { fatal: true }).decode(warnings_file.data);\r\n let warnings: any[] = [];\r\n if (rawWarnings) {\r\n try {\r\n warnings = JSON.parse(rawWarnings);\r\n } catch (e) {\r\n console.warn('Failed to parse warnings:', e);\r\n }\r\n }\r\n\r\n return {\r\n stdout: new TextDecoder('utf-8', { fatal: true }).decode(out_file.data),\r\n stderr: new TextDecoder('utf-8', { fatal: true }).decode(err_file.data),\r\n warnings,\r\n files,\r\n mediaFiles,\r\n };\r\n }\r\n\r\n return { convert } as PandocInstance;\r\n });\r\n}\r\n","import { inject, Injectable } from '@angular/core';\r\nimport { SdNotifyService } from '@sd-angular/core/services/notify';\r\nimport { SdLoadingService } from '@sd-angular/core/services/loading';\r\nimport { I18nService } from '@sd-angular/core/i18n';\r\n\r\nimport { SdDocxConvertOptions, SdDocxConvertResult } from './docx.model';\r\nimport { createPandocInstance, PandocInstance } from './pandoc-core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SdDocxService {\r\n readonly #i18n = inject(I18nService);\r\n\r\n readonly #DEFAULT_MAX_SIZE_MB = 50;\r\n readonly #VALID_EXTENSIONS = ['.doc', '.docx'];\r\n\r\n readonly #PANDOC_WASM_URL = 'https://pandoc.github.io/pandoc-wasm/pandoc.wasm';\r\n\r\n #fileInput: HTMLInputElement | null = null;\r\n #pandocInstance: PandocInstance | null = null;\r\n\r\n constructor(\r\n private notifyService: SdNotifyService,\r\n private loadingService: SdLoadingService\r\n ) {}\r\n\r\n async open(options?: SdDocxConvertOptions): Promise<SdDocxConvertResult | null> {\r\n return new Promise(resolve => {\r\n this.#createFileInput();\r\n if (!this.#fileInput) {\r\n resolve(null);\r\n return;\r\n }\r\n\r\n const handleChange = async (event: Event) => {\r\n const input = event.target as HTMLInputElement;\r\n const file = input.files?.[0];\r\n\r\n if (!file) {\r\n resolve(null);\r\n return;\r\n }\r\n\r\n this.loadingService.start();\r\n try {\r\n const result = await this.convertToHtml(file, options);\r\n resolve(result);\r\n } catch (error) {\r\n console.error('[SdDocxService] DocX conversion error:', error);\r\n this.notifyService.error(this.#i18n.t('core.docx.convert-error'));\r\n resolve(null);\r\n } finally {\r\n input.value = '';\r\n input.removeEventListener('change', handleChange);\r\n this.loadingService.stop();\r\n }\r\n };\r\n\r\n this.#fileInput.addEventListener('change', handleChange, { once: true });\r\n this.#fileInput.click();\r\n });\r\n }\r\n\r\n #createFileInput(): void {\r\n if (this.#fileInput) {\r\n return;\r\n }\r\n\r\n this.#fileInput = document.createElement('input');\r\n this.#fileInput.type = 'file';\r\n this.#fileInput.accept = '.doc,.docx';\r\n this.#fileInput.style.display = 'none';\r\n document.body.appendChild(this.#fileInput);\r\n }\r\n\r\n async #getPandocInstance(): Promise<PandocInstance> {\r\n if (this.#pandocInstance) {\r\n return this.#pandocInstance;\r\n }\r\n\r\n const wasmResponse = await fetch(this.#PANDOC_WASM_URL);\r\n if (!wasmResponse.ok) {\r\n throw new Error(`Failed to fetch pandoc.wasm: ${wasmResponse.status} ${wasmResponse.statusText}`);\r\n }\r\n const wasmBinary = await wasmResponse.arrayBuffer();\r\n this.#pandocInstance = await createPandocInstance(wasmBinary);\r\n return this.#pandocInstance;\r\n }\r\n\r\n async convertToHtml(input: File | Blob | ArrayBuffer, options?: SdDocxConvertOptions): Promise<SdDocxConvertResult | null> {\r\n const opts = {\r\n validateFormat: true,\r\n validateSize: true,\r\n maxSizeInMb: this.#DEFAULT_MAX_SIZE_MB,\r\n ...options,\r\n };\r\n\r\n try {\r\n let fileName: string | undefined;\r\n let fileSize: number | undefined;\r\n let blob: Blob;\r\n\r\n if (input instanceof File) {\r\n fileName = input.name;\r\n fileSize = input.size;\r\n blob = input;\r\n } else if (input instanceof Blob) {\r\n fileSize = input.size;\r\n blob = input;\r\n } else {\r\n blob = new Blob([input], {\r\n type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\r\n });\r\n }\r\n\r\n if (opts.validateFormat && fileName) {\r\n if (!this.#isValidFormat(fileName)) {\r\n this.notifyService.error(this.#i18n.t('core.docx.invalid-format'));\r\n return null;\r\n }\r\n }\r\n\r\n if (opts.validateSize && fileSize !== undefined) {\r\n const maxSizeInBytes = opts.maxSizeInMb! * 1024 * 1024;\r\n if (fileSize > maxSizeInBytes) {\r\n this.notifyService.error(this.#i18n.t('core.docx.size-exceeded'));\r\n return null;\r\n }\r\n }\r\n\r\n const pandoc = await this.#getPandocInstance();\r\n\r\n const pandocOpts: Record<string, any> = {\r\n from: 'docx',\r\n to: 'html',\r\n 'input-files': ['document.docx'],\r\n standalone: true,\r\n 'embed-resources': true,\r\n };\r\n\r\n const result = await pandoc.convert(pandocOpts, null, { 'document.docx': blob });\r\n\r\n return {\r\n html: result.stdout,\r\n messages: result.warnings.map((w: any) => String(w)),\r\n };\r\n } catch (error) {\r\n console.error('[SdDocxService] DocX conversion error:', error);\r\n this.notifyService.error(this.#i18n.t('core.docx.convert-error'));\r\n return null;\r\n }\r\n }\r\n\r\n async convertToHtmlString(input: File | Blob | ArrayBuffer, options?: SdDocxConvertOptions): Promise<string | null> {\r\n const result = await this.convertToHtml(input, options);\r\n return result?.html ?? null;\r\n }\r\n\r\n #isValidFormat(fileName: string): boolean {\r\n const lowerCaseName = fileName.toLowerCase();\r\n return this.#VALID_EXTENSIONS.some(ext => lowerCaseName.endsWith(ext));\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["File"],"mappings":";;;;;;;AAAA;;;;;;;;AAQG;AAEH;AAyBM,SAAU,oBAAoB,CAAC,UAAuB,EAAA;IAC1D,MAAM,IAAI,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAA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AAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA;;4FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -1,13 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Inject, Optional, Injectable } from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
3
  import { SD_CORE_CONFIGURATION } from '@sd-angular/core/configurations';
4
4
 
5
5
  class SdLicenseService {
6
- coreConfiguration;
7
6
  #SALT = 'angular-core-976e2fa6f8b44dadbc63f87b057a331f';
8
7
  #isValid = false;
9
- constructor(coreConfiguration) {
10
- this.coreConfiguration = coreConfiguration;
8
+ coreConfiguration = inject(SD_CORE_CONFIGURATION, { optional: true });
9
+ constructor() {
11
10
  this.#verify();
12
11
  }
13
12
  enforceLicense = () => {
@@ -19,7 +18,6 @@ class SdLicenseService {
19
18
  const hostname = window.location.hostname; // Ví dụ: store.uat.nexa.mobi
20
19
  // 1. Bypass Localhost
21
20
  if (this.#isLocalhost(hostname)) {
22
- console.log('%c [SdAngularCore] Dev Mode ', 'background: #222; color: #bada55');
23
21
  this.#isValid = true;
24
22
  return;
25
23
  }
@@ -81,7 +79,7 @@ class SdLicenseService {
81
79
  #throwSecurityError = () => {
82
80
  throw new Error(`[Security] Unauthorized usage of UI Lib on domain: ${window.location.hostname}`);
83
81
  };
84
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdLicenseService, deps: [{ token: SD_CORE_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
82
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdLicenseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
85
83
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdLicenseService, providedIn: 'root' });
86
84
  }
87
85
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdLicenseService, decorators: [{
@@ -89,12 +87,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
89
87
  args: [{
90
88
  providedIn: 'root',
91
89
  }]
92
- }], ctorParameters: () => [{ type: undefined, decorators: [{
93
- type: Inject,
94
- args: [SD_CORE_CONFIGURATION]
95
- }, {
96
- type: Optional
97
- }] }] });
90
+ }], ctorParameters: () => [] });
98
91
 
99
92
  /**
100
93
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-services-license.mjs","sources":["../../../projects/sd-angular/services/license/src/license.service.ts","../../../projects/sd-angular/services/license/sd-angular-core-services-license.ts"],"sourcesContent":["import { Inject, Injectable, Optional } from '@angular/core';\nimport { ISdCoreConfiguration, SD_CORE_CONFIGURATION } from '@sd-angular/core/configurations';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdLicenseService {\n readonly #SALT = 'angular-core-976e2fa6f8b44dadbc63f87b057a331f';\n #isValid = false;\n\n constructor(\n @Inject(SD_CORE_CONFIGURATION)\n @Optional()\n private readonly coreConfiguration: ISdCoreConfiguration | undefined\n ) {\n this.#verify();\n }\n\n enforceLicense = () => {\n if (!this.#isValid) {\n this.#throwSecurityError();\n }\n };\n\n #verify = () => {\n const hostname = window.location.hostname; // Ví dụ: store.uat.nexa.mobi\n\n // 1. Bypass Localhost\n if (this.#isLocalhost(hostname)) {\n console.log('%c [SdAngularCore] Dev Mode ', 'background: #222; color: #bada55');\n this.#isValid = true;\n return;\n }\n\n const configKeys = this.#getConfiguredKeys();\n if (configKeys.length === 0) {\n this.#isValid = false;\n this.#throwSecurityError();\n return;\n }\n\n // 2. CHECK EXACT MATCH (Ưu tiên khớp chính xác 100%)\n // Hash chuỗi: \"store.uat.nexa.mobi\" + SALT\n if (this.#checkMatch(hostname, configKeys)) {\n this.#isValid = true;\n return;\n }\n\n // 3. CHECK WILDCARD MATCH (Thử các trường hợp có dấu *)\n const parts = hostname.split('.'); // [\"store\", \"uat\", \"nexa\", \"mobi\"]\n\n // Lặp để cắt dần subdomain bên trái và thêm \"*.\" vào\n // Điều kiện > 2 để đảm bảo không check các case vô nghĩa như *.mobi hay *.com\n while (parts.length > 2) {\n parts.shift(); // Bỏ phần đầu: [\"uat\", \"nexa\", \"mobi\"]\n \n // Tạo domain wildcard: \"*.uat.nexa.mobi\"\n const wildcardDomain = '*.' + parts.join('.'); \n \n // Hash chuỗi: \"*.uat.nexa.mobi\" + SALT\n if (this.#checkMatch(wildcardDomain, configKeys)) {\n this.#isValid = true;\n return;\n }\n }\n\n // Nếu chạy hết vòng lặp mà không khớp cái nào\n this.#isValid = false;\n this.#throwSecurityError();\n };\n\n // Helper để check xem hash của input có nằm trong list key không\n #checkMatch = (inputString: string, validKeys: string[]): boolean => {\n const hash = this.#generateHash(inputString + this.#SALT);\n return validKeys.includes(hash);\n };\n\n #getConfiguredKeys = (): string[] => {\n const keyOrKeys = this.coreConfiguration?.licenseKey;\n if (!keyOrKeys) return [];\n return Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];\n };\n\n #isLocalhost = (domain: string) => {\n return domain === 'localhost' || domain === '127.0.0.1' || domain.includes('localhost');\n };\n\n #generateHash = (input: string): string => {\n let hash = 0;\n if (input.length === 0) return hash.toString();\n for (let i = 0; i < input.length; i++) {\n const char = input.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash;\n }\n return btoa(hash.toString() + 'signed');\n };\n\n #throwSecurityError = () => {\n throw new Error(`[Security] Unauthorized usage of UI Lib on domain: ${window.location.hostname}`);\n };\n}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,CAAC,IAAI,IAAI,GAAG,IAAI;AAChC,YAAA,IAAI,GAAG,IAAI,GAAG,IAAI;QACpB;QACA,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,QAAQ,CAAC;AACzC,IAAA,CAAC;IAED,mBAAmB,GAAG,MAAK;QACzB,MAAM,IAAI,KAAK,CAAC,CAAA,mDAAA,EAAsD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAA,CAAE,CAAC;AACnG,IAAA,CAAC;AA9FU,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,kBAKjB,qBAAqB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AALpB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA;;4FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAMI,MAAM;2BAAC,qBAAqB;;0BAC5B;;;ACZL;;AAEG;;;;"}
1
+ {"version":3,"file":"sd-angular-core-services-license.mjs","sources":["../../../projects/sd-angular/services/license/src/license.service.ts","../../../projects/sd-angular/services/license/sd-angular-core-services-license.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\r\nimport { ISdCoreConfiguration, SD_CORE_CONFIGURATION } from '@sd-angular/core/configurations';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class SdLicenseService {\r\n readonly #SALT = 'angular-core-976e2fa6f8b44dadbc63f87b057a331f';\r\n #isValid = false;\r\n private readonly coreConfiguration: ISdCoreConfiguration | null = inject(SD_CORE_CONFIGURATION, { optional: true });\r\n\r\n constructor() {\r\n this.#verify();\r\n }\r\n\r\n enforceLicense = () => {\r\n if (!this.#isValid) {\r\n this.#throwSecurityError();\r\n }\r\n };\r\n\r\n #verify = () => {\r\n const hostname = window.location.hostname; // Ví dụ: store.uat.nexa.mobi\r\n\r\n // 1. Bypass Localhost\r\n if (this.#isLocalhost(hostname)) {\r\n this.#isValid = true;\r\n return;\r\n }\r\n\r\n const configKeys = this.#getConfiguredKeys();\r\n if (configKeys.length === 0) {\r\n this.#isValid = false;\r\n this.#throwSecurityError();\r\n return;\r\n }\r\n\r\n // 2. CHECK EXACT MATCH (Ưu tiên khớp chính xác 100%)\r\n // Hash chuỗi: \"store.uat.nexa.mobi\" + SALT\r\n if (this.#checkMatch(hostname, configKeys)) {\r\n this.#isValid = true;\r\n return;\r\n }\r\n\r\n // 3. CHECK WILDCARD MATCH (Thử các trường hợp có dấu *)\r\n const parts = hostname.split('.'); // [\"store\", \"uat\", \"nexa\", \"mobi\"]\r\n\r\n // Lặp để cắt dần subdomain bên trái và thêm \"*.\" vào\r\n // Điều kiện > 2 để đảm bảo không check các case vô nghĩa như *.mobi hay *.com\r\n while (parts.length > 2) {\r\n parts.shift(); // Bỏ phần đầu: [\"uat\", \"nexa\", \"mobi\"]\r\n \r\n // Tạo domain wildcard: \"*.uat.nexa.mobi\"\r\n const wildcardDomain = '*.' + parts.join('.'); \r\n \r\n // Hash chuỗi: \"*.uat.nexa.mobi\" + SALT\r\n if (this.#checkMatch(wildcardDomain, configKeys)) {\r\n this.#isValid = true;\r\n return;\r\n }\r\n }\r\n\r\n // Nếu chạy hết vòng lặp mà không khớp cái nào\r\n this.#isValid = false;\r\n this.#throwSecurityError();\r\n };\r\n\r\n // Helper để check xem hash của input có nằm trong list key không\r\n #checkMatch = (inputString: string, validKeys: string[]): boolean => {\r\n const hash = this.#generateHash(inputString + this.#SALT);\r\n return validKeys.includes(hash);\r\n };\r\n\r\n #getConfiguredKeys = (): string[] => {\r\n const keyOrKeys = this.coreConfiguration?.licenseKey;\r\n if (!keyOrKeys) return [];\r\n return Array.isArray(keyOrKeys) ? keyOrKeys : [keyOrKeys];\r\n };\r\n\r\n #isLocalhost = (domain: string) => {\r\n return domain === 'localhost' || domain === '127.0.0.1' || domain.includes('localhost');\r\n };\r\n\r\n #generateHash = (input: string): string => {\r\n let hash = 0;\r\n if (input.length === 0) return hash.toString();\r\n for (let i = 0; i < input.length; i++) {\r\n const char = input.charCodeAt(i);\r\n hash = (hash << 5) - hash + char;\r\n hash = hash & hash;\r\n }\r\n return btoa(hash.toString() + 'signed');\r\n };\r\n\r\n #throwSecurityError = () => {\r\n throw new Error(`[Security] Unauthorized usage of UI Lib on domain: ${window.location.hostname}`);\r\n };\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,gBAAgB,CAAA;IAClB,KAAK,GAAG,+CAA+C;IAChE,QAAQ,GAAG,KAAK;IACC,iBAAiB,GAAgC,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAEnH,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,OAAO,EAAE;IAChB;IAEA,cAAc,GAAG,MAAK;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,mBAAmB,EAAE;QAC5B;AACF,IAAA,CAAC;IAED,OAAO,GAAG,MAAK;QACb,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;;AAG1C,QAAA,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE;AAC/B,YAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;YACpB;QACF;AAEA,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,EAAE;AAC5C,QAA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@@ -1,69 +1,62 @@
1
1
  import { CommonModule, DOCUMENT } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { signal, SecurityContext, HostListener, Input, Component, createComponent, Inject, Injectable } from '@angular/core';
3
+ import { signal, computed, SecurityContext, HostListener, Input, ChangeDetectionStrategy, Component, inject, ApplicationRef, EnvironmentInjector, createComponent, Injectable } from '@angular/core';
4
4
  import { Utilities } from '@sdcorejs/utils/fns';
5
- import { trigger, transition, style, animate } from '@angular/animations';
6
- import { TranslatePipe } from '@sd-angular/core/i18n';
5
+ import { TranslatePipe, I18nService } from '@sd-angular/core/i18n';
7
6
  import * as i2 from '@angular/platform-browser';
8
7
 
8
+ const TOAST_EXIT_ANIMATION_MS = 200;
9
9
  class ToastComponent {
10
10
  notifyService;
11
11
  sanitizer;
12
12
  data;
13
13
  isExpanded = signal(false);
14
+ isClosing = signal(false);
15
+ hostClasses = computed(() => (this.isClosing() ? 'bg-white sd-toast sd-toast--closing' : 'bg-white sd-toast'));
14
16
  MAX_SHOW = 2;
15
- // --- Logic Timer ---
16
- timer;
17
- start;
18
- remaining;
17
+ timer = null;
18
+ closeTimer = null;
19
+ start = 0;
20
+ remaining = 0;
19
21
  constructor(notifyService, sanitizer) {
20
22
  this.notifyService = notifyService;
21
23
  this.sanitizer = sanitizer;
22
24
  }
23
- /**
24
- * Sanitize HTML tường minh trước khi render qua `[innerHTML]` — strip
25
- * `<script>`, event handler (`on*`), `javascript:` URL. Chỉ chạy ở nhánh
26
- * `data.html === true`; nhánh mặc định render text (auto-escape) nên không
27
- * có sink này. // why: phơi rõ việc sanitize cho review/scanner bảo mật.
28
- */
29
- sanitizeHtml(value) {
30
- return this.sanitizer.sanitize(SecurityContext.HTML, value) ?? '';
31
- }
32
- /** Message ở dạng chuỗi đơn (chỉ dùng khi !isMultiMessage). */
33
- get singleMessage() {
34
- return this.data.message;
35
- }
36
25
  ngOnInit() {
37
- // Khởi tạo thời gian còn lại bằng duration ban đầu
38
26
  this.remaining = this.data.duration;
39
- // Bắt đầu đếm ngược ngay khi hiện ra
40
27
  this.resumeTimer();
41
28
  }
42
29
  ngOnDestroy() {
43
- clearTimeout(this.timer);
30
+ this.clearAutoDismissTimer();
31
+ this.clearCloseTimer();
44
32
  }
45
- // --- Logic Pause/Resume ---
46
33
  pauseTimer() {
47
- if (this.timer) {
48
- // Xóa timer hiện tại
49
- clearTimeout(this.timer);
50
- this.timer = null;
51
- // Tính toán thời gian đã trôi qua để trừ đi
52
- this.remaining -= Date.now() - this.start;
34
+ if (!this.timer || this.isClosing()) {
35
+ return;
53
36
  }
37
+ clearTimeout(this.timer);
38
+ this.timer = null;
39
+ this.remaining = Math.max(this.remaining - (Date.now() - this.start), 0);
54
40
  }
55
41
  resumeTimer() {
56
- // Chỉ chạy tiếp nếu còn thời gian và timer chưa chạy
57
- if (this.remaining > 0 && !this.timer) {
58
- this.start = Date.now();
59
- this.timer = setTimeout(() => {
60
- this.close();
61
- }, this.remaining);
42
+ if (this.remaining <= 0 || this.timer || this.isClosing()) {
43
+ return;
62
44
  }
45
+ this.start = Date.now();
46
+ this.timer = setTimeout(() => {
47
+ this.close();
48
+ }, this.remaining);
63
49
  }
64
- // --- Logic cũ ---
65
50
  close() {
66
- this.notifyService.remove(this.data.id);
51
+ if (this.isClosing()) {
52
+ return;
53
+ }
54
+ this.clearAutoDismissTimer();
55
+ this.isClosing.set(true);
56
+ this.closeTimer = setTimeout(() => {
57
+ this.closeTimer = null;
58
+ this.notifyService.remove(this.data.id);
59
+ }, TOAST_EXIT_ANIMATION_MS);
67
60
  }
68
61
  onActionClick() {
69
62
  this.data.onAction?.();
@@ -71,6 +64,12 @@ class ToastComponent {
71
64
  toggleExpand() {
72
65
  this.isExpanded.update(v => !v);
73
66
  }
67
+ sanitizeHtml(value) {
68
+ return this.sanitizer.sanitize(SecurityContext.HTML, value) ?? '';
69
+ }
70
+ get singleMessage() {
71
+ return this.data.message;
72
+ }
74
73
  get isMultiMessage() {
75
74
  return Array.isArray(this.data.message);
76
75
  }
@@ -89,48 +88,38 @@ class ToastComponent {
89
88
  get hasMore() {
90
89
  return this.isMultiMessage && this.messages.length > this.MAX_SHOW;
91
90
  }
92
- /** autoid theo loại toast để E2E chọn trực tiếp, vd `services-notify-toast-success`. */
93
91
  get autoId() {
94
92
  return `services-notify-toast-${this.data.type}`;
95
93
  }
96
- /** Gộp message (mảng nối ' | ') để phơi ra data-message cho E2E. */
97
94
  get dataMessage() {
98
95
  return Array.isArray(this.data.message) ? this.data.message.join(' | ') : this.data.message;
99
96
  }
97
+ clearAutoDismissTimer() {
98
+ if (!this.timer) {
99
+ return;
100
+ }
101
+ clearTimeout(this.timer);
102
+ this.timer = null;
103
+ }
104
+ clearCloseTimer() {
105
+ if (!this.closeTimer) {
106
+ return;
107
+ }
108
+ clearTimeout(this.closeTimer);
109
+ this.closeTimer = null;
110
+ }
100
111
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: ToastComponent, deps: [{ token: SdNotifyService }, { token: i2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
101
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: ToastComponent, isStandalone: true, selector: "toast", inputs: { data: "data" }, host: { listeners: { "mouseenter": "pauseTimer()", "mouseleave": "resumeTimer()" }, properties: { "@toastAnimation": "true", "class": "\"bg-white sd-toast\"", "attr.data-autoid": "autoId", "attr.data-type": "data.type", "attr.data-title": "data.title ?? null", "attr.data-message": "dataMessage" } }, ngImport: i0, template: "<div class=\"sd-toast__bar\" [class]=\"'bg-' + data.type\"></div>\r\n\r\n<div class=\"sd-toast__icon\" [class]=\"'text-' + data.type\">\r\n @switch (data.type) {\r\n @case ('success') {\r\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>\r\n }\r\n @case ('info') {\r\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"/></svg>\r\n }\r\n @case ('warning') {\r\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\"/></svg>\r\n }\r\n @case ('error') {\r\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"/></svg>\r\n }\r\n }\r\n</div>\r\n\r\n<div class=\"sd-toast__content\">\r\n <div class=\"sd-toast__header\">\r\n <strong class=\"sd-toast__title\">{{ data.title || ('core.notify.type.' + data.type | translate) }}</strong>\r\n <button class=\"sd-toast__close\" (click)=\"close()\">\u2715</button>\r\n </div>\r\n\r\n <div class=\"sd-toast__body\">\r\n @if (!isMultiMessage) {\r\n <!-- why: m\u1EB7c \u0111\u1ECBnh render TEXT (auto-escape) \u2014 an to\u00E0n. Ch\u1EC9 render HTML\r\n (\u0111\u00E3 sanitize) khi data.html=true. -->\r\n @if (data.html) {\r\n <div [innerHTML]=\"sanitizeHtml(singleMessage)\"></div>\r\n } @else {\r\n <div>{{ singleMessage }}</div>\r\n }\r\n }\r\n @else {\r\n <ul class=\"msg-list\">\r\n @for (msg of displayMessages; track msg) {\r\n @if (data.html) {\r\n <li [innerHTML]=\"sanitizeHtml('- ' + msg)\"></li>\r\n } @else {\r\n <li>{{ '- ' + msg }}</li>\r\n }\r\n }\r\n </ul>\r\n\r\n @if (hasMore) {\r\n <button type=\"button\" \r\n class=\"toggle-more btn-link\" \r\n [class]=\"'text-' + data.type\" \r\n (click)=\"toggleExpand()\">\r\n {{ isExpanded() ? ('core.notify.show-less' | translate) : ('core.notify.show-more' | translate: { count: restCount }) }}\r\n </button>\r\n }\r\n }\r\n </div>\r\n\r\n @if (data.actionLabel) {\r\n <div class=\"sd-toast__actions\">\r\n <button class=\"btn-action\" \r\n [class]=\"'bg-' + data.type + '-light text-' + data.type\"\r\n (click)=\"onActionClick()\">\r\n {{ data.actionLabel }}\r\n </button>\r\n </div>\r\n }\r\n</div>", styles: ["@charset \"UTF-8\";:host{display:flex;width:350px;border-radius:8px;box-shadow:0 4px 12px #00000026;margin-bottom:12px;overflow:hidden;position:relative;font-family:Roboto,sans-serif;pointer-events:auto}.sd-toast__bar{width:6px;flex-shrink:0}.sd-toast__icon{padding:12px 0 0 12px;flex-shrink:0}.sd-toast__icon svg{width:24px;height:24px}.sd-toast__content{flex-grow:1;padding:12px;display:flex;flex-direction:column}.sd-toast__header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:4px}.sd-toast__title{font-size:16px;font-weight:600}.sd-toast__close{background:none;border:none;font-size:16px;cursor:pointer;line-height:1;padding:0;opacity:.5;transition:opacity .2s}.sd-toast__close:hover{opacity:1}.sd-toast__body{font-size:14px;line-height:1.4;word-break:break-word}.sd-toast__actions{display:flex;justify-content:flex-end;margin-top:8px}.msg-list{padding-left:0;list-style:none;margin:0}.toggle-more{background:none;border:none;padding:0;font:inherit;cursor:pointer;font-size:13px;margin-top:4px;font-weight:500;text-align:left}.toggle-more:hover{text-decoration:underline}.toggle-more:focus-visible{outline:2px solid currentColor;outline-offset:2px}.btn-action{border:none;padding:6px 12px;border-radius:4px;font-weight:600;cursor:pointer;font-size:13px;transition:filter .2s}.btn-action:hover{filter:brightness(.95)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }], animations: [
102
- trigger('toastAnimation', [
103
- transition(':enter', [
104
- style({ transform: 'translateX(100%)', opacity: 0 }),
105
- animate('300ms ease-out', style({ transform: 'translateX(0)', opacity: 1 }))
106
- ]),
107
- transition(':leave', [
108
- animate('200ms ease-in', style({ transform: 'translateX(100%)', opacity: 0 }))
109
- ])
110
- ])
111
- ] });
112
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: ToastComponent, isStandalone: true, selector: "toast", inputs: { data: "data" }, host: { listeners: { "mouseenter": "pauseTimer()", "mouseleave": "resumeTimer()" }, properties: { "class": "hostClasses()", "attr.data-autoid": "autoId", "attr.data-type": "data.type", "attr.data-title": "data.title ?? null", "attr.data-message": "dataMessage" } }, ngImport: i0, template: "<div class=\"sd-toast__bar\" [class]=\"'bg-' + data.type\"></div>\n\n<div class=\"sd-toast__icon\" [class]=\"'text-' + data.type\">\n @switch (data.type) {\n @case ('success') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>\n }\n @case ('info') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"/></svg>\n }\n @case ('warning') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\"/></svg>\n }\n @case ('error') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"/></svg>\n }\n }\n</div>\n\n<div class=\"sd-toast__content\">\n <div class=\"sd-toast__header\">\n <strong class=\"sd-toast__title\">{{ data.title || ('core.notify.type.' + data.type | translate) }}</strong>\n <button class=\"sd-toast__close\" (click)=\"close()\">&times;</button>\n </div>\n\n <div class=\"sd-toast__body\">\n @if (!isMultiMessage) {\n <!-- Text rendering is the default safe path; HTML is opt-in and sanitized. -->\n @if (data.html) {\n <div [innerHTML]=\"sanitizeHtml(singleMessage)\"></div>\n } @else {\n <div>{{ singleMessage }}</div>\n }\n } @else {\n <ul class=\"msg-list\">\n @for (msg of displayMessages; track msg) {\n @if (data.html) {\n <li [innerHTML]=\"sanitizeHtml('- ' + msg)\"></li>\n } @else {\n <li>{{ '- ' + msg }}</li>\n }\n }\n </ul>\n\n @if (hasMore) {\n <button\n type=\"button\"\n class=\"toggle-more btn-link\"\n [class]=\"'text-' + data.type\"\n (click)=\"toggleExpand()\">\n {{ isExpanded() ? ('core.notify.show-less' | translate) : ('core.notify.show-more' | translate: { count: restCount }) }}\n </button>\n }\n }\n </div>\n\n @if (data.actionLabel) {\n <div class=\"sd-toast__actions\">\n <button\n class=\"btn-action\"\n [class]=\"'bg-' + data.type + '-light text-' + data.type\"\n (click)=\"onActionClick()\">\n {{ data.actionLabel }}\n </button>\n </div>\n }\n</div>\n", styles: [":host{display:flex;width:350px;border-radius:8px;box-shadow:0 4px 12px #00000026;margin-bottom:12px;overflow:hidden;position:relative;font-family:Roboto,sans-serif;pointer-events:auto;animation:sd-toast-enter .3s ease-out}:host(.sd-toast--closing){pointer-events:none;animation:sd-toast-leave .2s ease-in forwards}@keyframes sd-toast-enter{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes sd-toast-leave{0%{transform:translate(0);opacity:1}to{transform:translate(100%);opacity:0}}@media(prefers-reduced-motion:reduce){:host,:host(.sd-toast--closing){animation:none}}.sd-toast__bar{width:6px;flex-shrink:0}.sd-toast__icon{padding:12px 0 0 12px;flex-shrink:0}.sd-toast__icon svg{width:24px;height:24px}.sd-toast__content{flex-grow:1;padding:12px;display:flex;flex-direction:column}.sd-toast__header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:4px}.sd-toast__title{font-size:16px;font-weight:600}.sd-toast__close{background:none;border:none;font-size:16px;cursor:pointer;line-height:1;padding:0;opacity:.5;transition:opacity .2s}.sd-toast__close:hover{opacity:1}.sd-toast__body{font-size:14px;line-height:1.4;word-break:break-word}.sd-toast__actions{display:flex;justify-content:flex-end;margin-top:8px}.msg-list{padding-left:0;list-style:none;margin:0}.toggle-more{background:none;border:none;padding:0;font:inherit;cursor:pointer;font-size:13px;margin-top:4px;font-weight:500;text-align:left}.toggle-more:hover{text-decoration:underline}.toggle-more:focus-visible{outline:2px solid currentColor;outline-offset:2px}.btn-action{border:none;padding:6px 12px;border-radius:4px;font-weight:600;cursor:pointer;font-size:13px;transition:filter .2s}.btn-action:hover{filter:brightness(.95)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
112
113
  }
113
114
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: ToastComponent, decorators: [{
114
115
  type: Component,
115
- args: [{ selector: 'toast', standalone: true, imports: [CommonModule, TranslatePipe], animations: [
116
- trigger('toastAnimation', [
117
- transition(':enter', [
118
- style({ transform: 'translateX(100%)', opacity: 0 }),
119
- animate('300ms ease-out', style({ transform: 'translateX(0)', opacity: 1 }))
120
- ]),
121
- transition(':leave', [
122
- animate('200ms ease-in', style({ transform: 'translateX(100%)', opacity: 0 }))
123
- ])
124
- ])
125
- ], host: {
126
- '[@toastAnimation]': 'true',
127
- '[class]': '"bg-white sd-toast"',
128
- // E2E hooks đọc bởi sd-autoid-inspector: autoid theo loại + state type/title/message.
116
+ args: [{ selector: 'toast', standalone: true, imports: [CommonModule, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
117
+ '[class]': 'hostClasses()',
129
118
  '[attr.data-autoid]': 'autoId',
130
119
  '[attr.data-type]': 'data.type',
131
120
  '[attr.data-title]': 'data.title ?? null',
132
- '[attr.data-message]': 'dataMessage'
133
- }, template: "<div class=\"sd-toast__bar\" [class]=\"'bg-' + data.type\"></div>\r\n\r\n<div class=\"sd-toast__icon\" [class]=\"'text-' + data.type\">\r\n @switch (data.type) {\r\n @case ('success') {\r\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>\r\n }\r\n @case ('info') {\r\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"/></svg>\r\n }\r\n @case ('warning') {\r\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\"/></svg>\r\n }\r\n @case ('error') {\r\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"/></svg>\r\n }\r\n }\r\n</div>\r\n\r\n<div class=\"sd-toast__content\">\r\n <div class=\"sd-toast__header\">\r\n <strong class=\"sd-toast__title\">{{ data.title || ('core.notify.type.' + data.type | translate) }}</strong>\r\n <button class=\"sd-toast__close\" (click)=\"close()\">\u2715</button>\r\n </div>\r\n\r\n <div class=\"sd-toast__body\">\r\n @if (!isMultiMessage) {\r\n <!-- why: m\u1EB7c \u0111\u1ECBnh render TEXT (auto-escape) \u2014 an to\u00E0n. Ch\u1EC9 render HTML\r\n (\u0111\u00E3 sanitize) khi data.html=true. -->\r\n @if (data.html) {\r\n <div [innerHTML]=\"sanitizeHtml(singleMessage)\"></div>\r\n } @else {\r\n <div>{{ singleMessage }}</div>\r\n }\r\n }\r\n @else {\r\n <ul class=\"msg-list\">\r\n @for (msg of displayMessages; track msg) {\r\n @if (data.html) {\r\n <li [innerHTML]=\"sanitizeHtml('- ' + msg)\"></li>\r\n } @else {\r\n <li>{{ '- ' + msg }}</li>\r\n }\r\n }\r\n </ul>\r\n\r\n @if (hasMore) {\r\n <button type=\"button\" \r\n class=\"toggle-more btn-link\" \r\n [class]=\"'text-' + data.type\" \r\n (click)=\"toggleExpand()\">\r\n {{ isExpanded() ? ('core.notify.show-less' | translate) : ('core.notify.show-more' | translate: { count: restCount }) }}\r\n </button>\r\n }\r\n }\r\n </div>\r\n\r\n @if (data.actionLabel) {\r\n <div class=\"sd-toast__actions\">\r\n <button class=\"btn-action\" \r\n [class]=\"'bg-' + data.type + '-light text-' + data.type\"\r\n (click)=\"onActionClick()\">\r\n {{ data.actionLabel }}\r\n </button>\r\n </div>\r\n }\r\n</div>", styles: ["@charset \"UTF-8\";:host{display:flex;width:350px;border-radius:8px;box-shadow:0 4px 12px #00000026;margin-bottom:12px;overflow:hidden;position:relative;font-family:Roboto,sans-serif;pointer-events:auto}.sd-toast__bar{width:6px;flex-shrink:0}.sd-toast__icon{padding:12px 0 0 12px;flex-shrink:0}.sd-toast__icon svg{width:24px;height:24px}.sd-toast__content{flex-grow:1;padding:12px;display:flex;flex-direction:column}.sd-toast__header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:4px}.sd-toast__title{font-size:16px;font-weight:600}.sd-toast__close{background:none;border:none;font-size:16px;cursor:pointer;line-height:1;padding:0;opacity:.5;transition:opacity .2s}.sd-toast__close:hover{opacity:1}.sd-toast__body{font-size:14px;line-height:1.4;word-break:break-word}.sd-toast__actions{display:flex;justify-content:flex-end;margin-top:8px}.msg-list{padding-left:0;list-style:none;margin:0}.toggle-more{background:none;border:none;padding:0;font:inherit;cursor:pointer;font-size:13px;margin-top:4px;font-weight:500;text-align:left}.toggle-more:hover{text-decoration:underline}.toggle-more:focus-visible{outline:2px solid currentColor;outline-offset:2px}.btn-action{border:none;padding:6px 12px;border-radius:4px;font-weight:600;cursor:pointer;font-size:13px;transition:filter .2s}.btn-action:hover{filter:brightness(.95)}\n"] }]
121
+ '[attr.data-message]': 'dataMessage',
122
+ }, template: "<div class=\"sd-toast__bar\" [class]=\"'bg-' + data.type\"></div>\n\n<div class=\"sd-toast__icon\" [class]=\"'text-' + data.type\">\n @switch (data.type) {\n @case ('success') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>\n }\n @case ('info') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"/></svg>\n }\n @case ('warning') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\"/></svg>\n }\n @case ('error') {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"/></svg>\n }\n }\n</div>\n\n<div class=\"sd-toast__content\">\n <div class=\"sd-toast__header\">\n <strong class=\"sd-toast__title\">{{ data.title || ('core.notify.type.' + data.type | translate) }}</strong>\n <button class=\"sd-toast__close\" (click)=\"close()\">&times;</button>\n </div>\n\n <div class=\"sd-toast__body\">\n @if (!isMultiMessage) {\n <!-- Text rendering is the default safe path; HTML is opt-in and sanitized. -->\n @if (data.html) {\n <div [innerHTML]=\"sanitizeHtml(singleMessage)\"></div>\n } @else {\n <div>{{ singleMessage }}</div>\n }\n } @else {\n <ul class=\"msg-list\">\n @for (msg of displayMessages; track msg) {\n @if (data.html) {\n <li [innerHTML]=\"sanitizeHtml('- ' + msg)\"></li>\n } @else {\n <li>{{ '- ' + msg }}</li>\n }\n }\n </ul>\n\n @if (hasMore) {\n <button\n type=\"button\"\n class=\"toggle-more btn-link\"\n [class]=\"'text-' + data.type\"\n (click)=\"toggleExpand()\">\n {{ isExpanded() ? ('core.notify.show-less' | translate) : ('core.notify.show-more' | translate: { count: restCount }) }}\n </button>\n }\n }\n </div>\n\n @if (data.actionLabel) {\n <div class=\"sd-toast__actions\">\n <button\n class=\"btn-action\"\n [class]=\"'bg-' + data.type + '-light text-' + data.type\"\n (click)=\"onActionClick()\">\n {{ data.actionLabel }}\n </button>\n </div>\n }\n</div>\n", styles: [":host{display:flex;width:350px;border-radius:8px;box-shadow:0 4px 12px #00000026;margin-bottom:12px;overflow:hidden;position:relative;font-family:Roboto,sans-serif;pointer-events:auto;animation:sd-toast-enter .3s ease-out}:host(.sd-toast--closing){pointer-events:none;animation:sd-toast-leave .2s ease-in forwards}@keyframes sd-toast-enter{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes sd-toast-leave{0%{transform:translate(0);opacity:1}to{transform:translate(100%);opacity:0}}@media(prefers-reduced-motion:reduce){:host,:host(.sd-toast--closing){animation:none}}.sd-toast__bar{width:6px;flex-shrink:0}.sd-toast__icon{padding:12px 0 0 12px;flex-shrink:0}.sd-toast__icon svg{width:24px;height:24px}.sd-toast__content{flex-grow:1;padding:12px;display:flex;flex-direction:column}.sd-toast__header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:4px}.sd-toast__title{font-size:16px;font-weight:600}.sd-toast__close{background:none;border:none;font-size:16px;cursor:pointer;line-height:1;padding:0;opacity:.5;transition:opacity .2s}.sd-toast__close:hover{opacity:1}.sd-toast__body{font-size:14px;line-height:1.4;word-break:break-word}.sd-toast__actions{display:flex;justify-content:flex-end;margin-top:8px}.msg-list{padding-left:0;list-style:none;margin:0}.toggle-more{background:none;border:none;padding:0;font:inherit;cursor:pointer;font-size:13px;margin-top:4px;font-weight:500;text-align:left}.toggle-more:hover{text-decoration:underline}.toggle-more:focus-visible{outline:2px solid currentColor;outline-offset:2px}.btn-action{border:none;padding:6px 12px;border-radius:4px;font-weight:600;cursor:pointer;font-size:13px;transition:filter .2s}.btn-action:hover{filter:brightness(.95)}\n"] }]
134
123
  }], ctorParameters: () => [{ type: SdNotifyService }, { type: i2.DomSanitizer }], propDecorators: { data: [{
135
124
  type: Input,
136
125
  args: [{ required: true }]
@@ -165,9 +154,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
165
154
  }] });
166
155
 
167
156
  class SdNotifyService {
168
- appRef;
169
- injector;
170
- document;
171
157
  toasts = signal([]);
172
158
  // Constants
173
159
  #DEBOUNCE_TIME = 500;
@@ -177,10 +163,11 @@ class SdNotifyService {
177
163
  // State
178
164
  #buffer = {};
179
165
  #timers = {};
180
- constructor(appRef, injector, document) {
181
- this.appRef = appRef;
182
- this.injector = injector;
183
- this.document = document;
166
+ appRef = inject(ApplicationRef);
167
+ injector = inject(EnvironmentInjector);
168
+ document = inject(DOCUMENT);
169
+ #i18n = inject(I18nService);
170
+ constructor() {
184
171
  this.#initContainer();
185
172
  }
186
173
  #initContainer() {
@@ -206,14 +193,14 @@ class SdNotifyService {
206
193
  this.#addToBuffer('error', message, option);
207
194
  }
208
195
  remove(id) {
209
- this.toasts.update((current) => current.filter((t) => t.id !== id));
196
+ this.toasts.update(current => current.filter(t => t.id !== id));
210
197
  }
211
198
  clearAll() {
212
199
  this.toasts.set([]);
213
200
  this.#clearAllTimers();
214
201
  }
215
202
  clearByType(type) {
216
- this.toasts.update((current) => current.filter((t) => t.type !== type));
203
+ this.toasts.update(current => current.filter(t => t.type !== type));
217
204
  }
218
205
  // Private helpers
219
206
  #addImmediate(type, message, option) {
@@ -225,9 +212,9 @@ class SdNotifyService {
225
212
  duration: option?.duration ?? this.#DEFAULT_SUCCESS_DURATION,
226
213
  actionLabel: option?.actionLabel,
227
214
  onAction: option?.onAction,
228
- html: option?.html
215
+ html: option?.html,
229
216
  };
230
- this.toasts.update((current) => {
217
+ this.toasts.update(current => {
231
218
  const updated = [newToast, ...current];
232
219
  return updated.slice(0, this.#MAX_TOASTS);
233
220
  });
@@ -253,8 +240,7 @@ class SdNotifyService {
253
240
  this.#timers[type] = null;
254
241
  if (messages.length === 0)
255
242
  return;
256
- const typeLabel = type === 'error' ? 'Error' : 'Warning';
257
- const title = option?.title ?? typeLabel;
243
+ const title = option?.title ?? this.#i18n.t(`core.notify.type.${type}`);
258
244
  const finalTitle = messages.length > 1 ? `${title} (${messages.length})` : title;
259
245
  const newToast = {
260
246
  id: Utilities.generateUuid(),
@@ -264,9 +250,9 @@ class SdNotifyService {
264
250
  duration: option?.duration ?? this.#DEFAULT_BUFFERED_DURATION,
265
251
  actionLabel: option?.actionLabel,
266
252
  onAction: option?.onAction,
267
- html: option?.html
253
+ html: option?.html,
268
254
  };
269
- this.toasts.update((current) => {
255
+ this.toasts.update(current => {
270
256
  const updated = [newToast, ...current];
271
257
  return updated.slice(0, this.#MAX_TOASTS);
272
258
  });
@@ -278,7 +264,7 @@ class SdNotifyService {
278
264
  });
279
265
  this.#timers = {};
280
266
  }
281
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdNotifyService, deps: [{ token: i0.ApplicationRef }, { token: i0.EnvironmentInjector }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
267
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdNotifyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
282
268
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdNotifyService, providedIn: 'root' });
283
269
  }
284
270
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdNotifyService, decorators: [{
@@ -286,10 +272,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
286
272
  args: [{
287
273
  providedIn: 'root',
288
274
  }]
289
- }], ctorParameters: () => [{ type: i0.ApplicationRef }, { type: i0.EnvironmentInjector }, { type: Document, decorators: [{
290
- type: Inject,
291
- args: [DOCUMENT]
292
- }] }] });
275
+ }], ctorParameters: () => [] });
293
276
 
294
277
  /**
295
278
  * Generated bundle index. Do not edit.