@anzusystems/common-admin 2.0.0-rc.11 → 2.0.0-rc.12

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 (457) hide show
  1. package/dist/domains/anzuUser/components/AAnzuUserDatatable.js.map +1 -1
  2. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  3. package/dist/domains/anzuUser/components/AAnzuUserFilter.js.map +1 -1
  4. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  5. package/dist/domains/anzuUser/components/AAnzuUserForm.js.map +1 -1
  6. package/dist/domains/anzuUser/components/AAnzuUserForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.js.map +1 -1
  8. package/dist/domains/anzuUser/components/AUserBulkActionDialog.js.map +1 -1
  9. package/dist/domains/anzuUser/components/AUserBulkActionDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.js.map +1 -1
  11. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.js.map +1 -1
  13. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/domains/anzuUser/components/AUserEnabledSwitch.js.map +1 -1
  15. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/domains/anzuUser/components/AUserManageButton.js.map +1 -1
  17. package/dist/domains/anzuUser/components/AUserMetadataForm.js.map +1 -1
  18. package/dist/domains/anzuUser/components/AUserMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.js.map +1 -1
  20. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.js.map +1 -1
  22. package/dist/domains/anzuUser/components/AUserSystemOverview.js.map +1 -1
  23. package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/domains/anzuUser/components/AUserSystemPanel.js.map +1 -1
  25. package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/dist/domains/anzuUser/components/AUserSystemStatusChip.js.map +1 -1
  27. package/dist/domains/anzuUser/components/AUserTabsShell.js.map +1 -1
  28. package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  29. package/dist/domains/auth/components/Acl.js.map +1 -1
  30. package/dist/domains/auth/components/Acl.vue_vue_type_script_setup_true_lang.js.map +1 -1
  31. package/dist/domains/cached/components/ACachedChip.js.map +1 -1
  32. package/dist/domains/cached/components/ACachedChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/domains/cached/components/ACachedUserChip.js.map +1 -1
  34. package/dist/domains/cached/components/ACachedUserChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/domains/collab/components/ACollabCountdown.js.map +1 -1
  36. package/dist/domains/collab/components/ACollabCountdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
  37. package/dist/domains/collab/components/ACollabLockedByUser.js.map +1 -1
  38. package/dist/domains/collab/components/ACollabManagement.js.map +1 -1
  39. package/dist/domains/collab/components/ACollabManagement.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/domains/customDataForm/components/ACustomDataForm.js.map +1 -1
  41. package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  42. package/dist/domains/customDataForm/components/ACustomDataFormElement.js.map +1 -1
  43. package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
  44. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.js.map +1 -1
  45. package/dist/domains/dam/assetDetail/components/AColorBox.js.map +1 -1
  46. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.js.map +1 -1
  47. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  48. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.js.map +1 -1
  49. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  50. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.js.map +1 -1
  51. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  52. package/dist/domains/dam/assetDetail/components/AssetDetailDialogLoader.js.map +1 -1
  53. package/dist/domains/dam/assetDetail/components/AssetDetailDialogSidebar.js.map +1 -1
  54. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarActionsTeleportTarget.js.map +1 -1
  55. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarActionsWrapper.js.map +1 -1
  56. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarActionsWrapper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  57. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.js.map +1 -1
  58. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.js.map +1 -1
  60. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  61. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.js.map +1 -1
  62. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/domains/dam/assetDetail/components/AssetFileFailReasonChip.js.map +1 -1
  64. package/dist/domains/dam/assetDetail/components/AssetFileFailReasonChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  65. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.js.map +1 -1
  66. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/domains/dam/assetDetail/components/AssetFileRotate.js.map +1 -1
  68. package/dist/domains/dam/assetDetail/components/AssetFileRotate.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/domains/dam/assetDetail/components/AssetImage.js.map +1 -1
  70. package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  71. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.js.map +1 -1
  72. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js.map +1 -1
  73. package/dist/domains/dam/assetDetail/components/AssetInfobox.js.map +1 -1
  74. package/dist/domains/dam/assetDetail/components/AssetInfobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  75. package/dist/domains/dam/assetDetail/components/AssetMetadata.js.map +1 -1
  76. package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  77. package/dist/domains/dam/assetDetail/components/AssetMetadataImageAttributes.js.map +1 -1
  78. package/dist/domains/dam/assetDetail/components/AssetMetadataImageAttributes.vue_vue_type_script_setup_true_lang.js.map +1 -1
  79. package/dist/domains/dam/assetSelect/components/AAssetListInner.js.map +1 -1
  80. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  81. package/dist/domains/dam/assetSelect/components/AAssetSelect.js.map +1 -1
  82. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  83. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.js.map +1 -1
  84. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
  85. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.js.map +1 -1
  86. package/dist/domains/dam/assetSelect/components/AssetImagePreview.js.map +1 -1
  87. package/dist/domains/dam/assetSelect/components/AssetImagePreview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/domains/dam/assetSelect/components/AssetSelectFilter.js.map +1 -1
  89. package/dist/domains/dam/assetSelect/components/AssetSelectFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/domains/dam/assetSelect/components/AssetSelectFilterForm.js.map +1 -1
  91. package/dist/domains/dam/assetSelect/components/AssetSelectFilterForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  92. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.js.map +1 -1
  93. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  94. package/dist/domains/dam/assetSelect/components/AssetSelectListTable.js.map +1 -1
  95. package/dist/domains/dam/assetSelect/components/AssetSelectListTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  96. package/dist/domains/dam/assetSelect/components/AssetSelectListTiles.js.map +1 -1
  97. package/dist/domains/dam/assetSelect/components/AssetSelectListTiles.vue_vue_type_script_setup_true_lang.js.map +1 -1
  98. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.js.map +1 -1
  99. package/dist/domains/dam/assetSelect/components/AssetSelectTilesItem.js.map +1 -1
  100. package/dist/domains/dam/assetSelect/components/AssetSelectTilesItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  101. package/dist/domains/dam/assetSelect/components/FilterPodcastRemoteAutocomplete.js.map +1 -1
  102. package/dist/domains/dam/author/components/AuthorCreateButton.js.map +1 -1
  103. package/dist/domains/dam/author/components/AuthorCreateButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  104. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.js.map +1 -1
  105. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.js.map +1 -1
  107. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  108. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js.map +1 -1
  109. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.js.map +1 -1
  111. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  112. package/dist/domains/dam/components/DamAdminAssetLink.js.map +1 -1
  113. package/dist/domains/dam/cropper/components/ACropper.js.map +1 -1
  114. package/dist/domains/dam/cropper/components/ACropper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.js.map +1 -1
  116. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  117. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelectLazy.js.map +1 -1
  118. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelectLazy.vue_vue_type_script_setup_true_lang.js.map +1 -1
  119. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.js.map +1 -1
  120. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  121. package/dist/domains/dam/imageWidget/components/AImagePublicInput.js.map +1 -1
  122. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  123. package/dist/domains/dam/imageWidget/components/AImageWidget.js.map +1 -1
  124. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  125. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.js.map +1 -1
  126. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  127. package/dist/domains/dam/imageWidget/components/AImageWidgetMultipleSimple.js.map +1 -1
  128. package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.js.map +1 -1
  129. package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  130. package/dist/domains/dam/imageWidget/components/AMediaWidgetSimple.js.map +1 -1
  131. package/dist/domains/dam/imageWidget/components/AMediaWidgetSimple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  132. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.js.map +1 -1
  133. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  134. package/dist/domains/dam/imageWidget/components/ImageMassOperations.js.map +1 -1
  135. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  136. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.js.map +1 -1
  137. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.js.map +1 -1
  139. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  140. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.js.map +1 -1
  141. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  142. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.js.map +1 -1
  143. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  144. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.js.map +1 -1
  145. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  146. package/dist/domains/dam/imageWidget/components/MediaWidgetSimpleDialog.js.map +1 -1
  147. package/dist/domains/dam/imageWidget/components/MediaWidgetSimpleDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  148. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.js.map +1 -1
  149. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.js.map +1 -1
  150. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  151. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js.map +1 -1
  152. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  153. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.js.map +1 -1
  154. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.js.map +1 -1
  156. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  157. package/dist/domains/dam/uploadQueue/components/UploadQueueButtonStop.js.map +1 -1
  158. package/dist/domains/dam/uploadQueue/components/UploadQueueButtonStop.vue_vue_type_script_setup_true_lang.js.map +1 -1
  159. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.js.map +1 -1
  160. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  161. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.js.map +1 -1
  162. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  163. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.js.map +1 -1
  164. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.js.map +1 -1
  165. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  166. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.js.map +1 -1
  167. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  168. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.js.map +1 -1
  169. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  170. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.js.map +1 -1
  171. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  172. package/dist/domains/dam/uploadQueue/components/UploadQueueItemErrorOverlay.js.map +1 -1
  173. package/dist/domains/dam/user/components/DamAssetLicenceGroupRemoteAutocomplete.js.map +1 -1
  174. package/dist/domains/dam/user/components/DamAssetLicenceRemoteAutocomplete.js.map +1 -1
  175. package/dist/domains/dam/user/components/DamDistributionServiceSelect.js.map +1 -1
  176. package/dist/domains/dam/user/components/DamExtSystemRemoteAutocomplete.js.map +1 -1
  177. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.js.map +1 -1
  178. package/dist/domains/dam/user/components/DamUserFilterRemoteAutocomplete.js.map +1 -1
  179. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.js.map +1 -1
  180. package/dist/domains/filters/bookmarks/components/AFilterBookmarkButton.js.map +1 -1
  181. package/dist/domains/filters/bookmarks/components/AFilterBookmarkButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  182. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.js.map +1 -1
  183. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  184. package/dist/domains/filters/bookmarks/components/FilterBookmarks.js.map +1 -1
  185. package/dist/domains/filters/bookmarks/components/FilterBookmarks.vue_vue_type_script_setup_true_lang.js.map +1 -1
  186. package/dist/domains/filters/components/AFilterAdvancedButton.js.map +1 -1
  187. package/dist/domains/filters/components/AFilterBooleanSelect.js.map +1 -1
  188. package/dist/domains/filters/components/AFilterDatetimePicker.js.map +1 -1
  189. package/dist/domains/filters/components/AFilterEmpty.js.map +1 -1
  190. package/dist/domains/filters/components/AFilterInteger.js.map +1 -1
  191. package/dist/domains/filters/components/AFilterResetButton.js.map +1 -1
  192. package/dist/domains/filters/components/AFilterString.js.map +1 -1
  193. package/dist/domains/filters/components/AFilterString.vue.d.ts +3 -0
  194. package/dist/domains/filters/components/AFilterString.vue_vue_type_script_setup_true_lang.js +8 -2
  195. package/dist/domains/filters/components/AFilterString.vue_vue_type_script_setup_true_lang.js.map +1 -1
  196. package/dist/domains/filters/components/AFilterSubmitButton.js.map +1 -1
  197. package/dist/domains/filters/components/AFilterTimeInterval.js.map +1 -1
  198. package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js.map +1 -1
  199. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.js.map +1 -1
  200. package/dist/domains/filters/components/AFilterWrapper.js.map +1 -1
  201. package/dist/domains/filters/components/AFilterWrapper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  202. package/dist/domains/filters/components/AFilterWrapperSidebar.js.map +1 -1
  203. package/dist/domains/filters/components/FilterDetailItem.js.map +1 -1
  204. package/dist/domains/filters/components/FiltersSelected.js.map +1 -1
  205. package/dist/domains/filters/datatable/components/ADatatableConfigButton.js.map +1 -1
  206. package/dist/domains/filters/datatable/components/ADatatableOrdering.js.map +1 -1
  207. package/dist/domains/filters/datatable/components/ADatatablePagination.js.map +1 -1
  208. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  209. package/dist/domains/form/components/AFormDatetimePicker.js.map +1 -1
  210. package/dist/domains/form/components/AFormDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  211. package/dist/domains/form/components/AFormFlagDatetimePicker.js.map +1 -1
  212. package/dist/domains/form/components/AFormFlagDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  213. package/dist/domains/form/components/AFormRemoteCheckbox.js.map +1 -1
  214. package/dist/domains/form/components/AFormRemoteCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  215. package/dist/domains/form/components/AFormRemoteSwitch.js.map +1 -1
  216. package/dist/domains/form/components/AFormRemoteSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  217. package/dist/domains/form/components/AFormSwitch.js.map +1 -1
  218. package/dist/domains/form/components/AFormSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  219. package/dist/domains/form/components/AFormTextField.js.map +1 -1
  220. package/dist/domains/form/components/AFormTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  221. package/dist/domains/form/components/AFormTextarea.js.map +1 -1
  222. package/dist/domains/form/components/AFormTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  223. package/dist/domains/form/components/AFormValueObjectOptionsSelect.js.map +1 -1
  224. package/dist/domains/form/components/AFormValueObjectOptionsSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  225. package/dist/domains/form/components/ASystemEntityScope.js.map +1 -1
  226. package/dist/domains/job/components/AJobBaseCreateForm.js.map +1 -1
  227. package/dist/domains/job/components/AJobBaseCreateForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/domains/job/components/AJobDetailCommon.js.map +1 -1
  229. package/dist/domains/job/components/AJobPriorityChip.js.map +1 -1
  230. package/dist/domains/job/components/AJobStatusChip.js.map +1 -1
  231. package/dist/domains/listEditor/components/AListEditor.js.map +1 -1
  232. package/dist/domains/listEditor/components/AListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/domains/listEditor/components/ANestedSortableListEditor.js.map +1 -1
  234. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  235. package/dist/domains/listEditor/components/ASortableListEditor.js.map +1 -1
  236. package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  237. package/dist/domains/listEditor/components/internal/LeChangeParentDialog.js.map +1 -1
  238. package/dist/domains/listEditor/components/internal/LeChangeParentDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  239. package/dist/domains/listEditor/components/internal/LeDeleteDialog.js.map +1 -1
  240. package/dist/domains/listEditor/components/internal/LeDeleteDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  241. package/dist/domains/listEditor/components/internal/LeDragHandle.js.map +1 -1
  242. package/dist/domains/listEditor/components/internal/LeEmptyState.js.map +1 -1
  243. package/dist/domains/listEditor/components/internal/LeEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  244. package/dist/domains/listEditor/components/internal/LeMoveToPositionDialog.js.map +1 -1
  245. package/dist/domains/listEditor/components/internal/LeMoveToPositionDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  246. package/dist/domains/listEditor/components/internal/LeNestedRow.js.map +1 -1
  247. package/dist/domains/listEditor/components/internal/LeNestedRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  248. package/dist/domains/listEditor/components/internal/LeStatus.js.map +1 -1
  249. package/dist/domains/listEditor/components/internal/LeStatus.vue_vue_type_script_setup_true_lang.js.map +1 -1
  250. package/dist/domains/listEditor/components/internal/LeUnsavedLabel.js.map +1 -1
  251. package/dist/domains/listEditor/components/internal/LeUnsavedLabel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  252. package/dist/domains/log/components/ALogDatatable.js.map +1 -1
  253. package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  254. package/dist/domains/log/components/ALogDetail.js.map +1 -1
  255. package/dist/domains/log/components/ALogDetailView.js.map +1 -1
  256. package/dist/domains/log/components/ALogDetailView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  257. package/dist/domains/log/components/ALogFilter.js.map +1 -1
  258. package/dist/domains/log/components/ALogLevelChip.js.map +1 -1
  259. package/dist/domains/log/components/ALogLevelChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  260. package/dist/domains/log/components/ALogListView.js.map +1 -1
  261. package/dist/domains/permission/components/APermissionEditor.js.map +1 -1
  262. package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  263. package/dist/domains/permission/components/APermissionGrantEditor.js.map +1 -1
  264. package/dist/domains/permission/components/APermissionValueChip.js.map +1 -1
  265. package/dist/domains/permission/components/APermissionValueChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  266. package/dist/domains/permission/group/components/APermissionGroupDatatable.js.map +1 -1
  267. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  268. package/dist/domains/permission/group/components/APermissionGroupDetail.js.map +1 -1
  269. package/dist/domains/permission/group/components/APermissionGroupFilter.js.map +1 -1
  270. package/dist/domains/permission/group/components/APermissionGroupManage.js.map +1 -1
  271. package/dist/domains/permission/group/components/APermissionGroupManage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/domains/permission/group/components/APermissionGroupRemoteAutocomplete.js.map +1 -1
  273. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.js.map +1 -1
  274. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  275. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.js.map +1 -1
  276. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.js.map +1 -1
  277. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  278. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.js.map +1 -1
  279. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  280. package/dist/domains/subjectSelect/components/AFilterWrapperSubjectSelect.js.map +1 -1
  281. package/dist/domains/subjectSelect/components/AFilterWrapperSubjectSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/domains/subjectSelect/components/ASubjectSelect.js.map +1 -1
  283. package/dist/domains/subjectSelect/components/ASubjectSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  284. package/dist/domains/system/appShell/components/AActionbar.js.map +1 -1
  285. package/dist/domains/system/appShell/components/AActionbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  286. package/dist/domains/system/appShell/components/AActionbarTarget.js.map +1 -1
  287. package/dist/domains/system/appShell/components/ALayoutLoader.js.map +1 -1
  288. package/dist/domains/system/appShell/components/ALayoutSwitch.js.map +1 -1
  289. package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  290. package/dist/domains/system/components/AAdminSwitcher.js.map +1 -1
  291. package/dist/domains/system/components/AAdminSwitcher.vue_vue_type_script_setup_true_lang.js.map +1 -1
  292. package/dist/domains/system/components/AAlerts.js.map +1 -1
  293. package/dist/domains/system/components/ALanguageSelect.js.map +1 -1
  294. package/dist/domains/system/components/AThemeSelect.js.map +1 -1
  295. package/dist/domains/system/components/AThemeSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  296. package/dist/domains/system/flags/components/FlagCountry.js.map +1 -1
  297. package/dist/domains/system/flags/components/FlagEn.js.map +1 -1
  298. package/dist/domains/system/flags/components/FlagSk.js.map +1 -1
  299. package/dist/domains/system/systemBar/components/ASystemBar.js.map +1 -1
  300. package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  301. package/dist/domains/system/systemBar/components/ASystemBarNewVersion.js.map +1 -1
  302. package/dist/domains/system/systemBar/components/ASystemBarNewVersion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  303. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.js.map +1 -1
  304. package/dist/domains/ui/buttons/action/components/AActionCreateButton.js.map +1 -1
  305. package/dist/domains/ui/buttons/action/components/AActionCreateButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  306. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.js.map +1 -1
  307. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  308. package/dist/domains/ui/buttons/action/components/AActionEditButton.js.map +1 -1
  309. package/dist/domains/ui/buttons/action/components/AActionEditButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  310. package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.js.map +1 -1
  311. package/dist/domains/ui/buttons/action/components/AActionSaveAndCloseButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  312. package/dist/domains/ui/buttons/action/components/AActionSaveButton.js.map +1 -1
  313. package/dist/domains/ui/buttons/action/components/AActionSaveButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  314. package/dist/domains/ui/buttons/components/ABtnSplit.js.map +1 -1
  315. package/dist/domains/ui/buttons/components/ABtnSplit.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/domains/ui/buttons/table/components/ATableCopyIdButton.js.map +1 -1
  317. package/dist/domains/ui/buttons/table/components/ATableCopyIdButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  318. package/dist/domains/ui/buttons/table/components/ATableDetailButton.js.map +1 -1
  319. package/dist/domains/ui/buttons/table/components/ATableDetailButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  320. package/dist/domains/ui/buttons/table/components/ATableEditButton.js.map +1 -1
  321. package/dist/domains/ui/buttons/table/components/ATableEditButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  322. package/dist/domains/ui/components/AAnzuUserAvatar.js.map +1 -1
  323. package/dist/domains/ui/components/AAnzuUserAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  324. package/dist/domains/ui/components/AAvatarColorPicker.js.map +1 -1
  325. package/dist/domains/ui/components/AAvatarColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  326. package/dist/domains/ui/components/ABooleanSelect.js.map +1 -1
  327. package/dist/domains/ui/components/ABooleanValue.js.map +1 -1
  328. package/dist/domains/ui/components/ACard.js.map +1 -1
  329. package/dist/domains/ui/components/ACardLoader.js.map +1 -1
  330. package/dist/domains/ui/components/AChipNoLink.js.map +1 -1
  331. package/dist/domains/ui/components/ACopyText.js.map +1 -1
  332. package/dist/domains/ui/components/ACopyText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  333. package/dist/domains/ui/components/ACreateDialog.js.map +1 -1
  334. package/dist/domains/ui/components/ACreateDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  335. package/dist/domains/ui/components/ACurrentUserDropdown.js.map +1 -1
  336. package/dist/domains/ui/components/ACurrentUserDropdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
  337. package/dist/domains/ui/components/ADialogToolbar.js.map +1 -1
  338. package/dist/domains/ui/components/AIconGroup.js.map +1 -1
  339. package/dist/domains/ui/components/AProgress.js.map +1 -1
  340. package/dist/domains/ui/components/ARow.js.map +1 -1
  341. package/dist/domains/ui/components/ARow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/domains/ui/components/ATimeTrackingFields.js.map +1 -1
  343. package/dist/domains/ui/components/ATimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  344. package/dist/domains/ui/components/AUserAndTimeTrackingFields.js.map +1 -1
  345. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  346. package/dist/domains/ui/datetime/components/ADatetime.js.map +1 -1
  347. package/dist/domains/ui/datetime/components/ADatetimePicker.js.map +1 -1
  348. package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  349. package/dist/domains/ui/datetime/components/TimePicker.js.map +1 -1
  350. package/dist/domains/ui/file/components/AFileDropzone.js.map +1 -1
  351. package/dist/domains/ui/file/components/AFileInput.js.map +1 -1
  352. package/dist/domains/ui/file/components/AFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  353. package/dist/domains/ui/file/components/AFileInputDialog.js.map +1 -1
  354. package/dist/domains/ui/file/components/AFileInputDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  355. package/dist/domains/ui/view/components/AGenericView.js.map +1 -1
  356. package/dist/domains/ui/view/components/AGenericView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  357. package/dist/domains/ui/view/components/ALoginView.js.map +1 -1
  358. package/dist/domains/ui/view/components/ALoginView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  359. package/dist/domains/ui/view/components/ALogoutView.js.map +1 -1
  360. package/dist/domains/ui/view/components/ANotFoundView.js.map +1 -1
  361. package/dist/domains/ui/view/components/AUnauthorizedView.js.map +1 -1
  362. package/dist/domains/ui/view/components/AUnauthorizedView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  363. package/dist/domains/unsavedGuard/components/AUnsavedConfirmDialog.js.map +1 -1
  364. package/dist/locales/cs/common/alert.js.map +1 -1
  365. package/dist/locales/cs/common/anzuUser.js.map +1 -1
  366. package/dist/locales/cs/common/assetSelect.js.map +1 -1
  367. package/dist/locales/cs/common/button.js.map +1 -1
  368. package/dist/locales/cs/common/collab.js.map +1 -1
  369. package/dist/locales/cs/common/confirmDialog.js.map +1 -1
  370. package/dist/locales/cs/common/customForm.js.map +1 -1
  371. package/dist/locales/cs/common/customFormElement.js.map +1 -1
  372. package/dist/locales/cs/common/damImage.js.map +1 -1
  373. package/dist/locales/cs/common/dayOfWeek.js.map +1 -1
  374. package/dist/locales/cs/common/filter.js.map +1 -1
  375. package/dist/locales/cs/common/job.js.map +1 -1
  376. package/dist/locales/cs/common/linkDto.js.map +1 -1
  377. package/dist/locales/cs/common/listItemDto.js.map +1 -1
  378. package/dist/locales/cs/common/log.js.map +1 -1
  379. package/dist/locales/cs/common/model.js.map +1 -1
  380. package/dist/locales/cs/common/permission.js.map +1 -1
  381. package/dist/locales/cs/common/permissionEditor.js.map +1 -1
  382. package/dist/locales/cs/common/permissionGroup.js.map +1 -1
  383. package/dist/locales/cs/common/routeSettings.js.map +1 -1
  384. package/dist/locales/cs/common/sortable.js.map +1 -1
  385. package/dist/locales/cs/common/subjectSelect.js.map +1 -1
  386. package/dist/locales/cs/common/system.js.map +1 -1
  387. package/dist/locales/cs/common/time.js.map +1 -1
  388. package/dist/locales/cs/common/userSystem.js.map +1 -1
  389. package/dist/locales/cs/error/apiDependencyExists.js.map +1 -1
  390. package/dist/locales/cs/error/apiForbiddenOperation.js.map +1 -1
  391. package/dist/locales/cs/error/apiTimedOut.js.map +1 -1
  392. package/dist/locales/cs/error/apiValidation.js.map +1 -1
  393. package/dist/locales/cs/error/jsValidation.js.map +1 -1
  394. package/dist/locales/cs/vuetify.js.map +1 -1
  395. package/dist/locales/en/common/alert.js.map +1 -1
  396. package/dist/locales/en/common/anzuUser.js.map +1 -1
  397. package/dist/locales/en/common/assetSelect.js.map +1 -1
  398. package/dist/locales/en/common/button.js.map +1 -1
  399. package/dist/locales/en/common/collab.js.map +1 -1
  400. package/dist/locales/en/common/confirmDialog.js.map +1 -1
  401. package/dist/locales/en/common/customForm.js.map +1 -1
  402. package/dist/locales/en/common/customFormElement.js.map +1 -1
  403. package/dist/locales/en/common/damImage.js.map +1 -1
  404. package/dist/locales/en/common/dayOfWeek.js.map +1 -1
  405. package/dist/locales/en/common/filter.js.map +1 -1
  406. package/dist/locales/en/common/job.js.map +1 -1
  407. package/dist/locales/en/common/linkDto.js.map +1 -1
  408. package/dist/locales/en/common/listItemDto.js.map +1 -1
  409. package/dist/locales/en/common/log.js.map +1 -1
  410. package/dist/locales/en/common/model.js.map +1 -1
  411. package/dist/locales/en/common/permission.js.map +1 -1
  412. package/dist/locales/en/common/permissionEditor.js.map +1 -1
  413. package/dist/locales/en/common/permissionGroup.js.map +1 -1
  414. package/dist/locales/en/common/routeSettings.js.map +1 -1
  415. package/dist/locales/en/common/sortable.js.map +1 -1
  416. package/dist/locales/en/common/subjectSelect.js.map +1 -1
  417. package/dist/locales/en/common/system.js.map +1 -1
  418. package/dist/locales/en/common/time.js.map +1 -1
  419. package/dist/locales/en/common/userSystem.js.map +1 -1
  420. package/dist/locales/en/error/apiDependencyExists.js.map +1 -1
  421. package/dist/locales/en/error/apiForbiddenOperation.js.map +1 -1
  422. package/dist/locales/en/error/apiTimedOut.js.map +1 -1
  423. package/dist/locales/en/error/apiValidation.js.map +1 -1
  424. package/dist/locales/en/error/jsValidation.js.map +1 -1
  425. package/dist/locales/en/vuetify.js.map +1 -1
  426. package/dist/locales/sk/common/alert.js.map +1 -1
  427. package/dist/locales/sk/common/anzuUser.js.map +1 -1
  428. package/dist/locales/sk/common/assetSelect.js.map +1 -1
  429. package/dist/locales/sk/common/button.js.map +1 -1
  430. package/dist/locales/sk/common/collab.js.map +1 -1
  431. package/dist/locales/sk/common/confirmDialog.js.map +1 -1
  432. package/dist/locales/sk/common/customForm.js.map +1 -1
  433. package/dist/locales/sk/common/customFormElement.js.map +1 -1
  434. package/dist/locales/sk/common/damImage.js.map +1 -1
  435. package/dist/locales/sk/common/dayOfWeek.js.map +1 -1
  436. package/dist/locales/sk/common/filter.js.map +1 -1
  437. package/dist/locales/sk/common/job.js.map +1 -1
  438. package/dist/locales/sk/common/linkDto.js.map +1 -1
  439. package/dist/locales/sk/common/listItemDto.js.map +1 -1
  440. package/dist/locales/sk/common/log.js.map +1 -1
  441. package/dist/locales/sk/common/model.js.map +1 -1
  442. package/dist/locales/sk/common/permission.js.map +1 -1
  443. package/dist/locales/sk/common/permissionEditor.js.map +1 -1
  444. package/dist/locales/sk/common/permissionGroup.js.map +1 -1
  445. package/dist/locales/sk/common/routeSettings.js.map +1 -1
  446. package/dist/locales/sk/common/sortable.js.map +1 -1
  447. package/dist/locales/sk/common/subjectSelect.js.map +1 -1
  448. package/dist/locales/sk/common/system.js.map +1 -1
  449. package/dist/locales/sk/common/time.js.map +1 -1
  450. package/dist/locales/sk/common/userSystem.js.map +1 -1
  451. package/dist/locales/sk/error/apiDependencyExists.js.map +1 -1
  452. package/dist/locales/sk/error/apiForbiddenOperation.js.map +1 -1
  453. package/dist/locales/sk/error/apiTimedOut.js.map +1 -1
  454. package/dist/locales/sk/error/apiValidation.js.map +1 -1
  455. package/dist/locales/sk/error/jsValidation.js.map +1 -1
  456. package/dist/locales/sk/vuetify.js.map +1 -1
  457. package/package.json +15 -15
@@ -1 +1 @@
1
- {"version":3,"file":"ImageWidgetMultipleInner.js","names":["_sfc_main","ImageWidgetMultipleInner_vue_vue_type_script_setup_true_lang_default","ImageWidgetMultipleInner_default"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { computed, inject, onBeforeUnmount, onMounted, ref, type ShallowRef, toRaw, watch } from 'vue'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport type { UploadQueueKey } from '@/domains/dam/types/UploadQueue'\nimport type { DamConfigLicenceExtSystemReturnType } from '@/domains/dam/types/DamConfig'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport ImageWidgetMultipleItem from '@/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue'\nimport { storeToRefs } from 'pinia'\nimport { useCommonAdminImageOptions } from '@/domains/dam/imageWidget/composables/commonAdminImageOptions'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport {\n type AssetDetailItemDto,\n type AssetSearchListItemDto,\n DamAssetType,\n type DamImageCopyToLicenceResponse,\n} from '@/domains/dam/types/Asset'\nimport AAssetSelect from '@/domains/dam/assetSelect/components/AAssetSelect.vue'\nimport AFileInput from '@/domains/ui/file/components/AFileInput.vue'\nimport AImageDropzone from '@/domains/ui/file/components/AFileDropzone.vue'\nimport { useDamAcceptTypeAndSizeHelper } from '@/domains/dam/config/composables/acceptTypeAndSizeHelper'\nimport { useUploadQueuesStore } from '@/domains/dam/uploadQueue/store/uploadQueuesStore'\nimport type { AssetSelectReturnData } from '@/domains/dam/types/AssetSelect'\nimport UploadQueueDialog from '@/domains/dam/uploadQueue/components/UploadQueueDialog.vue'\nimport { useUploadQueueDialog } from '@/domains/dam/uploadQueue/composables/useUploadQueueDialog'\nimport AssetDetailDialog from '@/domains/dam/assetDetail/components/AssetDetailDialog.vue'\nimport {\n type AssetAuthorsItems,\n bulkUpdateAssetsAuthors,\n fetchAsset,\n fetchAssetByFileId,\n fetchAssetListByIds,\n type IdsGroupedByLicences,\n showMetadataSaveError,\n} from '@/domains/dam/api/damAssetApi'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { loadAssetDetailExtSystem } from '@/domains/dam/assetDetail/composables/assetDetailExtSystem'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport type { ImageStoreItem } from '@/domains/dam/types/ImageAware'\nimport { generateUUIDv1 } from '@/shared/utils/generator'\nimport ASortableListEditor from '@/domains/listEditor/components/ASortableListEditor.vue'\nimport AImageWidgetSimple from '@/domains/dam/imageWidget/components/AImageWidgetSimple.vue'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useI18n } from 'vue-i18n'\nimport useVuelidate from '@vuelidate/core'\nimport { AImageMetadataValidationScopeSymbol } from '@/domains/dam/composables/uploadValidations'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useAssetSelectStore } from '@/domains/dam/assetSelect/store/assetSelectStore'\nimport ImageWidgetMultipleLimitDialog from '@/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue'\nimport { ImageWidgetUploadConfigKey } from '@/domains/dam/imageWidget/utils/imageWidgetInkectionKeys'\nimport { fetchAssetListByFileIdsMultipleLicences } from '@/domains/dam/api/damfetchAssetListByFileIdsMultipleLicences'\nimport { copyToLicence } from '@/domains/dam/api/damImageApi'\nimport { createDamImage, imageFieldsOf } from '@/domains/dam/imageWidget/utils/damImage'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport {\n holdImages,\n imageSavedSince,\n imageSavesOfOthersOver,\n noteImagesSave,\n} from '@/domains/dam/imageWidget/utils/imageSaves'\nimport { WAIT_RAN_OUT, withinWaitLimit } from '@/domains/dam/imageWidget/utils/waitLimit'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: IntegerId[]\n queueKey: UploadQueueKey\n uploadLicence: IntegerId\n selectLicences: IntegerId[]\n configName?: string\n label?: string | undefined\n readonly?: boolean\n dataCy?: string | undefined\n width?: number | undefined\n disableDraggable?: boolean\n widgetIdentifierId?: string | undefined\n callDeleteApiOnRemove?: boolean\n skipCurrentUserCheck?: boolean\n }>(),\n {\n configName: undefined,\n label: undefined,\n image: undefined,\n readonly: false,\n lockable: false,\n lockedById: undefined,\n dataCy: undefined,\n width: undefined,\n disableDraggable: false,\n widgetIdentifierId: undefined,\n callDeleteApiOnRemove: false,\n skipCurrentUserCheck: false,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', data: IntegerId[]): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst assetSelectDialog = ref(false)\n\nconst imageWidgetUploadConfig = inject<ShallowRef<DamConfigLicenceExtSystemReturnType | undefined> | undefined>(\n ImageWidgetUploadConfigKey,\n undefined\n)\n\nif (isUndefined(imageWidgetUploadConfig) || isUndefined(imageWidgetUploadConfig.value)) {\n throw new Error(\"Fatal error, parent component doesn't provide necessary config ext system config.\")\n}\n\nconst imageOptions = useCommonAdminImageOptions(damConfigName)\nconst { imageClient, imageApi } = imageOptions\nconst { showErrorsDefault, showValidationError, showErrorT, showWarningT, showUnknownError } = useAlerts()\nconst uploadButtonComponent = ref<InstanceType<any> | null>(null)\n\nconst { uploadSizes, uploadAccept } = useDamAcceptTypeAndSizeHelper(\n DamAssetType.Image,\n imageWidgetUploadConfig.value.extSystemConfig\n)\n\nconst { t } = useI18n()\n\nconst imagesLoading = ref(false)\nconst imagesLoadFailed = ref(false)\n\n// Editor must not mount before the fetch lands: its dirty baseline is captured once, so rows\n// arriving later would read as \"added\". One-shot, like the fetch.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst imagesReady = ref(props.modelValue.length === 0)\n\nconst listEditor = ref<{ commit: (rows?: ImageStoreItem[]) => void; cancelReorderMode: () => void } | null>(null)\n\nconst imageStore = useImageStore()\n// The store is shared by all widgets. Leftovers from the previous one do not belong to this entity.\nimageStore.reset()\nwatch(\n () => props.readonly,\n (value) => {\n imageStore.readonly = value\n },\n { immediate: true }\n)\nconst { images, maxPosition } = storeToRefs(imageStore)\n\n// Identity of this widget among the image-saving widgets (`imageSaves.ts`), and marks of its own pending saves.\nconst thisWidget = Symbol('image widget multiple')\nconst ownImageSaves = new Set<symbol>()\n// Cancels waiting on other widgets' saves when this widget unmounts.\nlet cancelSaveWaits: (() => void) | null = null\n\n/**\n * Resolves once no other widget has a pending save of any of `ids`, such as the\n * widget this one replaced. On timeout the user is told the request timed out.\n */\nconst savesOfOthersOver = async (ids: IntegerId[]) => {\n const waits = ids\n .map((id) => imageSavesOfOthersOver(damConfigName, id, ownImageSaves))\n .filter((wait) => !isNull(wait))\n if (waits.length === 0) return\n cancelSaveWaits = () => waits.forEach((wait) => wait.cancel())\n const over = await withinWaitLimit(Promise.all(waits.map((wait) => wait.over)), 1, damConfigName)\n cancelSaveWaits = null\n if (over !== WAIT_RAN_OUT) return\n waits.forEach((wait) => wait.cancel())\n if (!unmounted) showErrorT('error.apiTimedOut.message')\n}\n\n// Rows added while the entity images load wait for the load and\n// come after them. Otherwise the load replaced them silently.\nlet imagesLoaded: Promise<void> = Promise.resolve()\n\nconst fetchImagesOnLoad = async () => {\n if (props.modelValue.length === 0) {\n return\n }\n try {\n imagesLoading.value = true\n // Counted when the read is sent: a save answered later may have taken effect after the read.\n const readAt = holdImages(damConfigName, thisWidget, props.modelValue)\n const read = await imageApi.fetchImageListByIds(imageClient, props.modelValue)\n // Rows wait until other widgets' saves of these images are over, using the latest saved state.\n // Otherwise a row had old texts and this widget's save wrote them back over the saved ones.\n await savesOfOthersOver(read.map((image) => image.id))\n if (unmounted) return\n const imagesRes = read\n .map((image) => {\n const saved = imageSavedSince(damConfigName, image.id, readAt.get(image.id) ?? 0)\n return saved ? { ...image, ...saved, id: image.id, position: saved.position ?? image.position } : image\n })\n .sort((a, b) => (a.position ?? 0) - (b.position ?? 0))\n const groupedIds: IdsGroupedByLicences = new Map()\n imagesRes.forEach((image) => {\n const group = groupedIds.get(image.dam.licenceId)\n if (group) {\n group.push(image.dam.damId)\n } else {\n groupedIds.set(image.dam.licenceId, [image.dam.damId])\n }\n })\n\n let assetsRes: Awaited<ReturnType<typeof fetchAssetListByFileIdsMultipleLicences>> = []\n try {\n assetsRes = await fetchAssetListByFileIdsMultipleLicences(damClient, endPointAsset, groupedIds)\n } catch (e) {\n // Read-only shows images without DAM authors. A user without upload rights is often refused the assets.\n if (!props.readonly) throw e\n }\n\n imageStore.setImages(\n imagesRes.map((imageRes) => {\n if (isUndefined(imageRes.position)) throw new Error('Image object needs position field!')\n imageStore.updateMaxPositionIfGreater(imageRes.position)\n const found = assetsRes.find((asset) => asset.mainFile?.id === imageRes.dam.damId)\n return {\n key: generateUUIDv1(),\n ...imageRes,\n // Each row gets its own copy. Rows of the same asset shared the array.\n damAuthors: found ? [...found.authors] : [],\n showDamAuthors: found ? found.authors.length === 0 : false,\n assetId: found ? found.id : undefined,\n }\n })\n )\n // Displaying a read-only widget must not rewrite the form's value with the stored order.\n if (!props.readonly) {\n emit('update:modelValue', images.value.map((image) => image.id).filter((id) => id !== undefined) as IntegerId[])\n }\n } catch (e) {\n imagesLoadFailed.value = true\n showErrorsDefault(e)\n } finally {\n imagesLoading.value = false\n imagesReady.value = true\n }\n}\n\nconst uploadQueuesStore = useUploadQueuesStore()\n\nconst uploadQueue = computed(() => {\n return uploadQueuesStore.getQueue(props.queueKey)\n})\n\nconst { cachedExtSystemId } = useExtSystemIdForCached(damConfigName)\n\nconst { uploadQueueDialog, stopQueueLeftBehind } = useUploadQueueDialog()\n\nconst onFileInput = (files: File[]) => {\n if (props.readonly) return\n // The input rejected every file and reported it. Opening the queue dialog would show nothing new.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n // `afterLimitDialogAdd` opens the queue dialog once files are\n // queued. Over the limit nothing is queued until the user agrees.\n // Rows of a queue no dialog shows are not counted. They go first.\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onDrop = (files: File[]) => {\n if (props.readonly) return\n // Same as the input: the dropzone rejected every file and reported it.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onCopyToLicence = (data: DamImageCopyToLicenceResponse) => {\n if (props.readonly) return\n if (data.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n let refused = 0\n data.forEach((item) => {\n if (item.result === 'copy') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n } else if (item.result === 'exists') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n uploadQueuesStore.queueItemDuplicate(item.targetAsset, item.targetMainFile, DamAssetType.Image, damConfigName)\n } else {\n refused++\n }\n })\n if (refused > 0) showErrorT('common.damImage.queueItem.errorUnableToCopyToLicence')\n if (refused === data.length) return\n uploadQueueDialog.value = props.queueKey\n}\n\nconst afterLimitDialogAdd = () => {\n uploadQueueDialog.value = props.queueKey\n}\n\n/**\n * Images of picked assets, without position. Each asset is read under\n * its own licence, and its authors under that licence's ext system.\n * The browsed licence can change after picking, and the DAM silently omits assets of another licence.\n * `readUnder`: the licence of all assets and its ext system, when the caller knows them.\n */\nconst assetSelectConfirmMap = async (\n items: AssetSearchListItemDto[],\n readUnder?: { licence: IntegerId; extSystem: IntegerId }\n): Promise<ImageStoreItem[]> => {\n const assetSelectStore = useAssetSelectStore()\n const assetMetadataMap = new Map<DocId, { description: string; authorIds: DocId[] }>()\n const authorsMap = new Map<DocId, string>()\n const idsByLicence: IdsGroupedByLicences = new Map()\n items.forEach((item) => {\n const licence = readUnder ? readUnder.licence : item.licence\n const group = idsByLicence.get(licence)\n if (group) {\n group.push(item.id)\n } else {\n idsByLicence.set(licence, [item.id])\n }\n })\n // A licence that fails to read does not stop the others.\n const failures: unknown[] = []\n for (const [licence, ids] of idsByLicence) {\n try {\n const assetDetails = await fetchAssetListByIds(damClient, endPointAsset, ids, licence)\n if (customAssetSelectMetadataToImageMap) {\n assetDetails.forEach((assetDetail) => {\n const mapped = customAssetSelectMetadataToImageMap(assetDetail)\n assetMetadataMap.set(assetDetail.id, {\n description: mapped.description,\n authorIds: [],\n })\n authorsMap.set(assetDetail.id, mapped.source)\n })\n continue\n }\n const authorIdsToFetch = new Set<DocId>()\n assetDetails.forEach((assetDetail) => {\n assetMetadataMap.set(assetDetail.id, {\n description: isString(assetDetail.metadata.customData?.description)\n ? assetDetail.metadata.customData.description.trim()\n : '',\n authorIds: assetDetail.authors,\n })\n assetDetail.authors.forEach((authorId) => {\n authorIdsToFetch.add(authorId)\n })\n })\n if (authorIdsToFetch.size > 0) {\n const licenceConfig = assetSelectStore.selectConfig.find((config) => config.licence === licence)\n // Uses the licence's ext system, as for every DAM author name the widgets\n // write. Falls back to the picker's when the licence does not tell.\n const authorsRes = await fetchAuthorListByIds(\n damClient,\n endPointAuthor,\n readUnder\n ? readUnder.extSystem\n : ((await getExtSystemByLicence(licence)) ??\n (licenceConfig ?? assetSelectStore.requireSelectedSelectConfig()).extSystem),\n [...authorIdsToFetch]\n )\n authorsRes.forEach((author) => {\n authorsMap.set(author.id, author.name)\n })\n }\n } catch (e) {\n failures.push(e)\n }\n }\n // Reported once for all failures. A DAM refusal arrives as a bare axios error that the default handler ignores.\n if (failures.length > 0 && !showErrorsDefault(failures[0])) showUnknownError()\n\n return items.map((asset) => {\n const authorIds = assetMetadataMap.get(asset.id)?.authorIds || []\n const description = assetMetadataMap.get(asset.id)?.description ?? ''\n\n if (customAssetSelectMetadataToImageMap) {\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: authorsMap.get(asset.id) ?? '' },\n { position: 0 }\n ),\n damAuthors: [],\n showDamAuthors: false,\n assetId: asset.id,\n }\n }\n\n const authorNames: string[] = []\n assetMetadataMap.get(asset.id)?.authorIds.forEach((authorId) => {\n const name = authorsMap.get(authorId)\n if (!isUndefined(name) && name.trim().length > 0) {\n authorNames.push(name)\n }\n })\n\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: authorNames.join(', ') },\n { position: 0 }\n ),\n damAuthors: authorIds,\n // Only for assets that were read. For an unread asset its authors are unknown, and authors\n // picked in the row would replace them in the DAM. Its row shows the source instead.\n showDamAuthors: assetMetadataMap.has(asset.id) && authorIds.length === 0,\n assetId: asset.id,\n }\n })\n}\n\nconst positioned = (items: ImageStoreItem[]) =>\n items.map((item) => {\n maxPosition.value++\n return { ...item, position: maxPosition.value }\n })\n\nconst onAssetSelectConfirm = async (data: AssetSelectReturnData) => {\n if (props.readonly) return\n if (data.type !== 'asset' || data.value.length === 0) return\n const picked = data.value.filter((asset) => !isNull(asset.mainFile))\n // Picked assets from a licence other than the upload licence are copied. Assets\n // already in it are used at once. Copies are added when the queue dialog is used.\n const toCopy =\n copyToLicenceEnabled !== false && !isUndefined(data.copyToLicence)\n ? picked.filter((asset) => asset.licence !== data.copyToLicence)\n : []\n // A widget that unmounted or became read-only adds nothing. The image store belongs to the next widget by then.\n const addingIsOver = () => unmounted || props.readonly\n if (toCopy.length === 0) {\n const images = await assetSelectConfirmMap(picked)\n await imagesLoaded\n if (!addingIsOver()) imageStore.addImages(positioned(images))\n return\n }\n const copying = copyToLicence(\n damClient,\n endPointImage,\n toCopy.map((asset) => ({ asset: asset.id, targetAssetLicence: data.copyToLicence! }))\n )\n // Read during the copy under their own licence (the upload's) and its ext system, not the browsed one.\n // Added before the queue dialog opens. Otherwise using the dialog first put the copies before them.\n const asTheyAre = picked.filter((asset) => !toCopy.includes(asset))\n const config = imageWidgetUploadConfig.value\n const imagesAsTheyAre =\n asTheyAre.length === 0\n ? Promise.resolve([])\n : assetSelectConfirmMap(\n asTheyAre,\n config ? { licence: data.copyToLicence!, extSystem: config.extSystem } : undefined\n )\n let copyRes: DamImageCopyToLicenceResponse | null = null\n try {\n copyRes = await copying\n } catch (e) {\n showErrorsDefault(e)\n }\n const images = await imagesAsTheyAre\n await imagesLoaded\n if (addingIsOver()) return\n imageStore.addImages(positioned(images))\n if (copyRes) onCopyToLicence(copyRes)\n}\n\nconst assetDetailStore = useAssetDetailStore()\nconst { dialog: assetDialog } = storeToRefs(assetDetailStore)\nconst {\n damClient,\n endPointAsset,\n endPointImage,\n endPointAuthor,\n copyToLicenceEnabled,\n showSourceEnabled,\n sourceLabel,\n editAssetLabel,\n addFromDamLabel,\n customAssetSelectMetadataToImageMap,\n} = useCommonAdminCoreDamOptions(damConfigName)\n\n// True while the detail was opened by \"edit asset\" of a row. Not for the detail\n// opened from the queue dialog, which is drawn here too and reads nothing on close.\nlet detailOfRow = false\n// Reads of assets whose detail closed, keyed by asset. The widget save waits for them.\n// Reads of other assets do not wait on these. Otherwise closing one detail waited for another asset's save and read.\nconst detailAssetReads = new Map<DocId, Promise<void>>()\n// Such a read may finish after unmount, when the store belongs to the next widget.\nlet unmounted = false\nonBeforeUnmount(() => {\n unmounted = true\n holdImages(damConfigName, thisWidget, [])\n cancelSaveWaits?.()\n})\n\nconst onEditAsset = async (assetFileId: DocId) => {\n detailOfRow = true\n let extSystem: IntegerId | null = null\n try {\n await assetDetailStore.open(\n props.queueKey,\n async () => {\n const asset = await fetchAssetByFileId(damClient, endPointAsset, assetFileId)\n // Falls back to the ext system of the widget's upload licence,\n // loaded by its root, when the licence cannot be resolved.\n const shownUnder = (await getExtSystemByLicence(asset.licence)) ?? imageWidgetUploadConfig.value!.extSystem\n // Must load before the detail shows the asset: it reads the ext\n // system configuration while rendering and threw without it.\n await loadAssetDetailExtSystem(damClient, shownUnder, asset.attributes.assetType, damConfigName)\n extSystem = shownUnder\n return asset\n },\n // Only for the asset the detail still shows: a stale answer must not change the ext system used for name lookups.\n () => {\n if (extSystem) cachedExtSystemId.value = extSystem\n }\n )\n } catch (e) {\n showErrorsDefault(e)\n }\n}\n\n// An upload applied during the entity image load waits with its dialog and\n// queue intact. Its rows come after the loaded images, then the dialog closes.\n// If the widget is read-only or gone by then, the dialog and queue stay as for\n// read-only, so nothing is lost. Before, the dialog and rows were dropped.\n// Applying again while waiting is ignored, or rows would be added twice.\nlet uploadWaitsForLoad = false\nconst onAssetUploadConfirm = async (items: ImageStoreItem[]) => {\n if (props.readonly) return\n if (items.length === 0) return\n if (imagesLoading.value) {\n if (uploadWaitsForLoad) return\n uploadWaitsForLoad = true\n await imagesLoaded\n uploadWaitsForLoad = false\n if (unmounted || props.readonly) return\n }\n addUploadedRows(items)\n uploadQueueDialog.value = null\n uploadQueuesStore.stopUpload(props.queueKey)\n}\n\nconst addUploadedRows = (items: ImageStoreItem[]) => {\n // A duplicate file becomes the asset of the existing image, and the dialog has just saved its authors. Rows of that\n // asset offering the pick take them, as after closing the detail. Otherwise their pick would overwrite those authors.\n // Names go into a row's source only if it has none. Before, they always overwrote it.\n if (authorEnabled.value) {\n items.forEach((item) => {\n if (isUndefined(item.assetId) || item.damAuthors.length === 0) return\n images.value.forEach((image) => {\n if (image.assetId !== item.assetId || !image.showDamAuthors) return\n takeAuthorsGiven(image, item.damAuthors, item.texts.source)\n })\n })\n }\n imageStore.addImages(positioned(items))\n}\n\nconst actionLibrary = () => {\n assetSelectDialog.value = true\n}\n\nconst v$ = useVuelidate({ $scope: AImageMetadataValidationScopeSymbol })\n\nconst { getDamConfigExtSystem, getExtSystemByLicence } = useDamConfigState(damClient, damConfigName)\nconst damConfigStore = useDamConfigStoreOf(damConfigName)\n\nconst authorEnabled = computed(() => {\n return !!getDamConfigExtSystem(cachedExtSystemId.value)?.[DamAssetType.Image]?.authors?.enabled\n})\n\n/**\n * Author names of an asset, in order, under its licence's ext system.\n * Falls back to `pageExtSystem` when the licence does not tell.\n */\nconst authorNamesOf = async (asset: AssetDetailItemDto, pageExtSystem: IntegerId) => {\n const extSystem = (await getExtSystemByLicence(asset.licence)) ?? pageExtSystem\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, asset.authors)\n const authorNames: string[] = []\n asset.authors.forEach((authorId) => {\n const name = authorsRes.find((author) => author.id === authorId)?.name\n if (!isUndefined(name) && name.trim().length > 0) {\n authorNames.push(name)\n }\n })\n return authorNames.join(', ')\n}\n\n/**\n * Once the asset turns out to have authors, a row offering the\n * author pick takes them, drops the pick and shows its source.\n * The source takes their names if empty or if it holds a hidden \"fill empty\"\n * pick from mass operations. An image's own source stays for the user to check.\n */\nconst takeAuthorsGiven = (row: ImageStoreItem, authors: DocId[], names: string) => {\n row.damAuthors = [...authors]\n if (row.texts.source.trim().length === 0 || imageStore.hasSourceOfPick(row)) row.texts.source = names\n imageStore.forgetSourceOfPick(row)\n row.showDamAuthors = false\n}\n\n/**\n * The detail may have given authors to an asset whose row offers the pick.\n * Otherwise the widget save overwrote them, or saved the image without a source.\n * So the asset is read again, and its offering rows take its authors with names under the asset\n * licence's ext system (see `takeAuthorsGiven`). Rows showing their source are left alone.\n * `detailSave`: the detail save pending at close. `pageExtSystem`: the ext system configured at that time.\n */\nconst takeAuthorsOfDetailAsset = async (assetId: DocId, detailSave: Promise<void> | null, pageExtSystem: IntegerId) => {\n try {\n // Read before the DAM answers that save, the asset would be stale.\n await detailSave\n const asset = await fetchAsset(damClient, endPointAsset, assetId)\n if (asset.authors.length === 0) return\n const source = await authorNamesOf(asset, pageExtSystem)\n if (unmounted || props.readonly) return\n images.value.forEach((image) => {\n // Uses the row's own flag. Whether the page shows the pick depends\n // on an ext system that another asset's detail may have changed.\n if (image.assetId !== asset.id || !image.showDamAuthors) return\n takeAuthorsGiven(image, asset.authors, source)\n })\n } catch (e) {\n if (!unmounted && !showErrorsDefault(e)) showUnknownError()\n }\n}\n\n/**\n * `shown`: the asset the detail showed. None if it closed from its loader or after a failed read.\n * Captured before any await: whether a row of that asset offers the\n * pick, the pending detail save, and the configured ext system.\n */\nconst onAssetDetailClose = (shown: AssetDetailItemDto | null) => {\n const ofRow = detailOfRow\n detailOfRow = false\n if (!ofRow || isNull(shown) || props.readonly || !authorEnabled.value) return\n const assetId = shown.id\n if (!images.value.some((image) => image.assetId === assetId && image.showDamAuthors)) return\n const detailSave = assetDetailStore.savingOf(assetId, damConfigName)\n const pageExtSystem = cachedExtSystemId.value\n const read = (detailAssetReads.get(assetId) ?? Promise.resolve()).then(() =>\n takeAuthorsOfDetailAsset(assetId, detailSave, pageExtSystem)\n )\n detailAssetReads.set(assetId, read)\n void read.then(() => {\n if (detailAssetReads.get(assetId) === read) detailAssetReads.delete(assetId)\n })\n}\n\nconst saveImages = async () => {\n // Nothing of the user's to write. The images stay as loaded.\n if (props.readonly) return true\n // An empty store here means the fetch is pending or failed, not a\n // user deletion. The empty path below would detach every image.\n if (imagesLoading.value || imagesLoadFailed.value) {\n showUnknownError()\n return false\n }\n // A closed detail's asset is still being read. Its rows are not written until they have its authors.\n await Promise.all(detailAssetReads.values())\n if (unmounted) return false\n v$.value.$touch()\n if (v$.value.$invalid) {\n showValidationError()\n return false\n }\n try {\n const assetUpdateItems: AssetAuthorsItems = []\n const imagesRaw = toRaw(images.value)\n // Rows offering the author pick, grouped by asset. An entity may have\n // an image twice, and a queue duplicate is a second row of its asset.\n // Per row, authors went out once per row and the last won, and a row with no pick was saved without a source.\n // The asset gets the union of picks in its rows, each author once,\n // and each row gets the authors and names after the DAM accepts them.\n const offering = new Map<DocId, { assetId: DocId | undefined; rows: ImageStoreItem[]; authors: DocId[] }>()\n if (authorEnabled.value) {\n images.value.forEach((image) => {\n if (!image.showDamAuthors) return\n // A row offering the pick has an asset. One without would be grouped alone.\n const of = image.assetId ?? image.key\n const asset = offering.get(of) ?? { assetId: image.assetId, rows: [], authors: [] }\n offering.set(of, asset)\n asset.rows.push(image)\n image.damAuthors.forEach((author) => {\n if (!asset.authors.includes(author)) asset.authors.push(author)\n })\n })\n }\n const named: Array<{ assetId: DocId | undefined; rows: ImageStoreItem[]; authors: DocId[]; source: string }> = []\n for (const { assetId, rows, authors } of offering.values()) {\n if (authors.length === 0) continue\n if (assetId) assetUpdateItems.push({ id: assetId, authors })\n // Uses the ext system of the rows' asset licence, as the pre-write read does. Falls back to the configured\n // one when the page does not know the licence. It is not fetched, since entity rows can be of any licence.\n const extSystem =\n damConfigStore.damConfigLicenceExtSystem.get(rows[0]!.dam.licenceId)?.extSystem ?? cachedExtSystemId.value\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, authors)\n named.push({ assetId, rows, authors, source: authorsRes.map((author) => author.name).join(', ') })\n }\n // Unmounted while authors loaded: write nothing. Turned read-only: nothing of the user's is written.\n if (unmounted) return false\n if (props.readonly) return true\n // Assets may have received authors elsewhere since their rows loaded, and the write would\n // replace them. So each asset with picked authors is re-read right before the write.\n // If any asset already has authors, nothing is written. Its offering rows take those\n // authors (`takeAuthorsGiven`), a message stays until closed, and the user saves again.\n const picked = [...offering.values()].filter(({ assetId, authors }) => !isUndefined(assetId) && authors.length > 0)\n if (picked.length > 0) {\n const readAgain = await Promise.all(picked.map(({ assetId }) => fetchAsset(damClient, endPointAsset, assetId!)))\n // Unmounted or made read-only while the assets were read: write nothing.\n if (unmounted || props.readonly) return false\n const givenMeanwhile = picked\n .map(({ rows }, index) => ({ rows, asset: readAgain[index]! }))\n .filter(({ asset }) => asset.authors.length > 0)\n if (givenMeanwhile.length > 0) {\n const pageExtSystem = cachedExtSystemId.value\n const names = await Promise.all(givenMeanwhile.map(({ asset }) => authorNamesOf(asset, pageExtSystem)))\n if (unmounted || props.readonly) return false\n givenMeanwhile.forEach(({ rows, asset }, index) => {\n rows.forEach((row) => {\n if (row.showDamAuthors) takeAuthorsGiven(row, asset.authors, names[index]!)\n })\n })\n showWarningT('common.damImage.image.meta.galleryAuthorsGivenMeanwhile', -1)\n return false\n }\n }\n if (assetUpdateItems.length) {\n await bulkUpdateAssetsAuthors(damClient, endPointAsset, assetUpdateItems)\n // Unmounted while the authors were written: save no image. A widget mounted meanwhile\n // for the same images read them before this save, which is noted only once sent.\n if (unmounted) return false\n }\n // The DAM now has these authors even if the images are not saved, so the rows show the source as after a save.\n // If the rows kept offering the pick, the next save would send them as picks,\n // the pre-write read would find these authors, and nothing would be written.\n named.forEach(({ assetId, rows, authors, source }) => {\n rows.forEach((row) => {\n row.damAuthors = [...authors]\n row.texts.source = source\n if (isUndefined(assetId)) return\n row.showDamAuthors = false\n imageStore.forgetSourceOfPick(row)\n })\n })\n const sentRows = [...imagesRaw]\n // Note the saved images for the page's other widgets, one by one.\n // This runs even if this widget unmounted before the response.\n const resItems = await noteImagesSave(\n damConfigName,\n sentRows.map((row) => row.id).filter((id) => !isUndefined(id)),\n ownImageSaves,\n imageApi.bulkUpdateImages(imageClient, sentRows.map(imageFieldsOf))\n )\n // If unmounted before the response, write nothing to the image store. By then it belongs to the next widget.\n if (unmounted) return true\n holdImages(\n damConfigName,\n thisWidget,\n resItems.map((resItem) => resItem.id)\n )\n const ids: IntegerId[] = []\n const items = resItems.map((resItem) => {\n ids.push(resItem.id)\n\n return {\n key: generateUUIDv1(),\n ...resItem,\n damAuthors: [],\n showDamAuthors: false,\n assetId: undefined,\n }\n })\n if (imageStore.images.length === 0) {\n listEditor.value?.commit([])\n // Emptying is a change too. Without this emit the parent keeps its old ids.\n emit('update:modelValue', ids)\n return true\n }\n\n // Match each returned image to its own sent row. Rows of the same file are matched one by one in send order.\n // Matching by file alone gave every row of a file the values of the first one.\n const getUpdatedItem = (item: ImageStoreItem): ImageStoreItem => {\n const index = sentRows.findIndex((row) => row.dam.damId === item.dam.damId)\n const matchedImage = index < 0 ? undefined : sentRows.splice(index, 1)[0]\n\n return {\n ...item,\n damAuthors: matchedImage ? matchedImage.damAuthors : item.damAuthors,\n // Only a row that offered DAM authors keeps offering them.\n // A row whose asset the DAM did not return has no asset to save them into, so it keeps its source.\n showDamAuthors: matchedImage ? matchedImage.showDamAuthors && matchedImage.damAuthors.length === 0 : false,\n assetId: matchedImage ? matchedImage.assetId : item.assetId,\n }\n }\n\n const updatedItems = items.map(getUpdatedItem)\n imageStore.setImages(updatedItems)\n // Pass the rows explicitly. `setImages` just replaced their keys,\n // so a bare `commit()` would read the not-yet-rerendered prop.\n listEditor.value?.commit(updatedItems)\n emit('update:modelValue', ids)\n return true\n } catch (e) {\n // Authors refused by validation are named as the forms name them. Other errors are shown as before.\n showMetadataSaveError(e, cachedExtSystemId.value, damConfigName)\n return false\n }\n}\n\n// Renumber the remaining images as after a move. Otherwise the backend gets positions with a gap.\nconst removeImage = (index: number) => {\n imageStore.removeImageByIndex(index)\n updateAllPositions()\n}\n\nconst removeItem = async (index: number) => {\n const image = images.value[index]\n if (!image) return\n if (isUndefined(image.id)) {\n removeImage(index)\n return\n }\n if (props.callDeleteApiOnRemove) {\n try {\n await imageApi.deleteImage(imageClient, image.id)\n removeImage(index)\n } catch (e) {\n showErrorsDefault(e)\n }\n return\n }\n removeImage(index)\n}\n\nconst limitDialogComponent = ref<InstanceType<typeof ImageWidgetMultipleLimitDialog> | null>(null)\n\nconst editorMode = ref<'view' | 'reorder'>('view')\n// A reorder under way would keep moving rows a read-only widget does not save.\nwatch(\n () => props.readonly,\n (value) => {\n if (value && editorMode.value === 'reorder') listEditor.value?.cancelReorderMode()\n }\n)\n\n// Required by the editor but never called. Adds go through the\n// upload and asset-select flow; the editor's add button is hidden.\nconst createImageStoreItem = (): ImageStoreItem => ({\n key: generateUUIDv1(),\n ...createDamImage({ fileId: '', licenceId: 0 }, {}, { position: 0 }),\n damAuthors: [],\n showDamAuthors: false,\n assetId: undefined,\n})\n\nconst updateAllPositions = () => {\n let pos = 0\n images.value.forEach((image) => {\n pos++\n image.position = pos\n })\n imageStore.maxPosition = pos\n}\n\nconst onReorderApplied = () => {\n updateAllPositions()\n}\n\ndefineExpose({\n saveImages,\n})\n\nonMounted(() => {\n imagesLoaded = fetchImagesOnLoad()\n})\n</script>\n\n<template>\n <div>\n <h4\n v-if=\"label\"\n class=\"font-weight-bold text-label-large\"\n >\n {{ label }}\n </h4>\n <div\n v-if=\"!readonly\"\n class=\"pb-2\"\n >\n <AFileInput\n :file-input-key=\"uploadQueue?.fileInputKey\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @files-input=\"onFileInput\"\n >\n <template #activator=\"{ props: fileInputProps }\">\n <VBtn\n ref=\"uploadButtonComponent\"\n v-bind=\"fileInputProps\"\n >\n {{ t('common.damImage.image.button.upload') }}\n </VBtn>\n </template>\n </AFileInput>\n <VBtn\n class=\"mr-2\"\n @click=\"actionLibrary\"\n >\n {{ addFromDamLabel }}\n </VBtn>\n </div>\n <AAssetSelect\n v-model=\"assetSelectDialog\"\n :select-licences=\"selectLicences\"\n :upload-licence=\"uploadLicence\"\n :min-count=\"1\"\n :max-count=\"50\"\n :asset-type=\"DamAssetType.Image\"\n :skip-current-user-check=\"skipCurrentUserCheck\"\n :config-name=\"damConfigName\"\n return-type=\"asset\"\n @confirm=\"onAssetSelectConfirm\"\n >\n <template\n v-if=\"$slots['asset-select-sidebar-prepend']\"\n #sidebar-prepend=\"slotProps\"\n >\n <slot\n name=\"asset-select-sidebar-prepend\"\n v-bind=\"slotProps\"\n />\n </template>\n </AAssetSelect>\n <div\n v-if=\"imagesLoading\"\n class=\"w-100 d-flex align-center justify-center\"\n >\n <VProgressCircular\n indeterminate\n color=\"primary\"\n />\n </div>\n <div\n class=\"position-relative w-100\"\n style=\"min-height: 140px\"\n >\n <ASortableListEditor\n v-if=\"imagesReady\"\n ref=\"listEditor\"\n v-model=\"images\"\n v-model:mode=\"editorMode\"\n :factory=\"createImageStoreItem\"\n get-key=\"key\"\n position=\"position\"\n :show-add-button=\"false\"\n :show-delete-button=\"false\"\n :show-edit-button=\"false\"\n :disable-drag=\"disableDraggable || readonly\"\n :readonly=\"readonly\"\n @reorder-applied=\"onReorderApplied\"\n >\n <template #view-body>\n <div class=\"asset-list-tiles asset-list-tiles--thumbnail a-sortable-widget__group\">\n <ImageWidgetMultipleItem\n v-for=\"(image, index) in images\"\n :key=\"image.key\"\n :index=\"index\"\n :show-source-enabled=\"showSourceEnabled\"\n :source-label=\"sourceLabel\"\n :edit-asset-label=\"editAssetLabel\"\n :author-enabled=\"authorEnabled\"\n :readonly=\"readonly\"\n :config-name=\"damConfigName\"\n @edit-asset=\"onEditAsset\"\n @remove-item=\"removeItem\"\n />\n </div>\n </template>\n <template #item-compact=\"{ raw }\">\n <div class=\"image-widget-multiple-reorder\">\n <div class=\"image-widget-multiple-reorder__thumb\">\n <AImageWidgetSimple\n :model-value=\"raw.id\"\n :image=\"raw\"\n :config-name=\"damConfigName\"\n />\n </div>\n <div class=\"image-widget-multiple-reorder__meta\">\n <div class=\"image-widget-multiple-reorder__title\">\n {{ raw.texts?.description?.trim() || '—' }}\n </div>\n <div\n v-if=\"raw.texts?.source\"\n class=\"image-widget-multiple-reorder__source\"\n >\n {{ raw.texts.source }}\n </div>\n </div>\n </div>\n </template>\n </ASortableListEditor>\n <AImageDropzone\n v-if=\"editorMode === 'view' && !readonly\"\n variant=\"fill\"\n :hover-only=\"modelValue.length > 0 || images.length > 0\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n @drop=\"onDrop\"\n @click=\"uploadButtonComponent?.$el.click()\"\n />\n </div>\n <UploadQueueDialog\n v-if=\"uploadQueueDialog === queueKey && imageWidgetUploadConfig\"\n :queue-key=\"queueKey\"\n :ext-system=\"imageWidgetUploadConfig.extSystem\"\n :licence-id=\"imageWidgetUploadConfig.licence\"\n :file-input-key=\"uploadQueue?.fileInputKey ?? -1\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @apply=\"onAssetUploadConfirm\"\n @files-input=\"onFileInput\"\n @drop=\"onFileInput\"\n />\n <AssetDetailDialog\n v-if=\"assetDialog === queueKey\"\n :queue-key=\"queueKey\"\n :config-name=\"damConfigName\"\n :ext-system=\"cachedExtSystemId\"\n @close=\"onAssetDetailClose\"\n />\n <ImageWidgetMultipleLimitDialog\n ref=\"limitDialogComponent\"\n :queue-key=\"queueKey\"\n @after-add=\"afterLimitDialogAdd\"\n />\n </div>\n</template>\n\n<style lang=\"scss\">\n.image-widget-multiple-reorder {\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n min-height: 100px;\n padding: 4px 0;\n\n &__thumb {\n flex: 0 0 auto;\n width: 200px;\n border-radius: 4px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n\n img {\n width: 100%;\n height: auto;\n display: block;\n }\n }\n\n &__meta {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n &__title {\n font-size: 0.95rem;\n font-weight: 500;\n color: rgb(var(--v-theme-on-surface));\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n &__source {\n font-size: 0.82rem;\n color: rgb(var(--v-theme-on-surface) / 70%);\n margin-top: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n @media (width <= 600px) {\n gap: 8px;\n min-height: 72px;\n\n &__thumb {\n width: 80px;\n }\n\n &__source {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ImageWidgetMultipleInner.js","names":["ImageWidgetMultipleInner_vue_vue_type_script_setup_true_lang_default","ImageWidgetMultipleInner_default"],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_toDisplayString","_createCommentVNode","_createVNode","AFileInput","_unref","_withCtx","_component_VBtn","_mergeProps","_createTextVNode","AAssetSelect","_createSlots","_renderSlot","_normalizeProps","_guardReactiveProps","_component_VProgressCircular","_createElementVNode","_createBlock","ASortableListEditor","_isRef","_Fragment","_renderList","ImageWidgetMultipleItem","AImageWidgetSimple","AImageDropzone","UploadQueueDialog","AssetDetailDialog","ImageWidgetMultipleLimitDialog","ImageWidgetMultipleItem_default","AAssetSelect_default","AFileInput_default","AFileDropzone_default","UploadQueueDialog_default","AssetDetailDialog_default","ASortableListEditor_default","AImageWidgetSimple_default","ImageWidgetMultipleLimitDialog_default","useVuelidate","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","ImageWidgetMultipleInner_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","damConfigName","useDamConfigName","assetSelectDialog","ref","imageWidgetUploadConfig","inject","ImageWidgetUploadConfigKey","isUndefined","useCommonAdminImageOptions","useAlerts","uploadButtonComponent","useDamAcceptTypeAndSizeHelper","DamAssetType","useI18n","imagesLoading","imagesLoadFailed","imagesReady","listEditor","imageStore","useImageStore","watch","value","storeToRefs","thisWidget","ownImageSaves","cancelSaveWaits","savesOfOthersOver","waits","ids","imageSavesOfOthersOver","id","isNull","wait","over","withinWaitLimit","WAIT_RAN_OUT","unmounted","showErrorT","imagesLoaded","fetchImagesOnLoad","readAt","holdImages","read","imageApi","imageClient","image","imagesRes","saved","imageSavedSince","a","b","groupedIds","group","assetsRes","fetchAssetListByFileIdsMultipleLicences","damClient","endPointAsset","imageRes","found","asset","generateUUIDv1","images","showErrorsDefault","uploadQueuesStore","useUploadQueuesStore","uploadQueue","computed","useExtSystemIdForCached","useUploadQueueDialog","onFileInput","files","config","stopQueueLeftBehind","limitDialogComponent","onDrop","onCopyToLicence","data","refused","item","afterLimitDialogAdd","assetSelectConfirmMap","assetSelectStore","useAssetSelectStore","assetMetadataMap","authorsMap","idsByLicence","licence","readUnder","failures","assetDetails","fetchAssetListByIds","customAssetSelectMetadataToImageMap","mapped","assetDetail","authorIdsToFetch","isString","authorId","licenceConfig","fetchAuthorListByIds","endPointAuthor","getExtSystemByLicence","author","showUnknownError","items","authorIds","description","createDamImage","authorNames","name","positioned","maxPosition","onAssetSelectConfirm","picked","toCopy","copyToLicenceEnabled","addingIsOver","copying","copyToLicence","endPointImage","asTheyAre","imagesAsTheyAre","copyRes","assetDetailStore","useAssetDetailStore","assetDialog","useCommonAdminCoreDamOptions","detailOfRow","detailAssetReads","onEditAsset","extSystem","fetchAssetByFileId","assetFileId","shownUnder","loadAssetDetailExtSystem","uploadWaitsForLoad","onAssetUploadConfirm","addUploadedRows","authorEnabled","takeAuthorsGiven","actionLibrary","v$","AImageMetadataValidationScopeSymbol","useDamConfigState","damConfigStore","useDamConfigStoreOf","getDamConfigExtSystem","cachedExtSystemId","authorNamesOf","pageExtSystem","authorsRes","authors","row","names","takeAuthorsOfDetailAsset","detailSave","fetchAsset","assetId","source","onAssetDetailClose","ofRow","shown","saveImages","showValidationError","assetUpdateItems","imagesRaw","toRaw","offering","of","named","rows","readAgain","givenMeanwhile","index","showWarningT","bulkUpdateAssetsAuthors","sentRows","resItems","noteImagesSave","imageFieldsOf","resItem","updatedItems","matchedImage","showMetadataSaveError","removeImage","updateAllPositions","removeItem","editorMode","createImageStoreItem","pos","onReorderApplied","onMounted","openBlock","createElementBlock","toDisplayString","createCommentVNode","createVNode","unref","uploadAccept","uploadSizes","withCtx","fileInputProps","VBtn","mergeProps","createTextVNode","t","addFromDamLabel","_cache","$event","createSlots","_ctx","renderSlot","normalizeProps","guardReactiveProps","slotProps","VProgressCircular","createElementVNode","createBlock","isRef","Fragment","renderList","showSourceEnabled","sourceLabel","editAssetLabel","raw","uploadQueueDialog"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { computed, inject, onBeforeUnmount, onMounted, ref, type ShallowRef, toRaw, watch } from 'vue'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport type { UploadQueueKey } from '@/domains/dam/types/UploadQueue'\nimport type { DamConfigLicenceExtSystemReturnType } from '@/domains/dam/types/DamConfig'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport ImageWidgetMultipleItem from '@/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue'\nimport { storeToRefs } from 'pinia'\nimport { useCommonAdminImageOptions } from '@/domains/dam/imageWidget/composables/commonAdminImageOptions'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport {\n type AssetDetailItemDto,\n type AssetSearchListItemDto,\n DamAssetType,\n type DamImageCopyToLicenceResponse,\n} from '@/domains/dam/types/Asset'\nimport AAssetSelect from '@/domains/dam/assetSelect/components/AAssetSelect.vue'\nimport AFileInput from '@/domains/ui/file/components/AFileInput.vue'\nimport AImageDropzone from '@/domains/ui/file/components/AFileDropzone.vue'\nimport { useDamAcceptTypeAndSizeHelper } from '@/domains/dam/config/composables/acceptTypeAndSizeHelper'\nimport { useUploadQueuesStore } from '@/domains/dam/uploadQueue/store/uploadQueuesStore'\nimport type { AssetSelectReturnData } from '@/domains/dam/types/AssetSelect'\nimport UploadQueueDialog from '@/domains/dam/uploadQueue/components/UploadQueueDialog.vue'\nimport { useUploadQueueDialog } from '@/domains/dam/uploadQueue/composables/useUploadQueueDialog'\nimport AssetDetailDialog from '@/domains/dam/assetDetail/components/AssetDetailDialog.vue'\nimport {\n type AssetAuthorsItems,\n bulkUpdateAssetsAuthors,\n fetchAsset,\n fetchAssetByFileId,\n fetchAssetListByIds,\n type IdsGroupedByLicences,\n showMetadataSaveError,\n} from '@/domains/dam/api/damAssetApi'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { loadAssetDetailExtSystem } from '@/domains/dam/assetDetail/composables/assetDetailExtSystem'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport type { ImageStoreItem } from '@/domains/dam/types/ImageAware'\nimport { generateUUIDv1 } from '@/shared/utils/generator'\nimport ASortableListEditor from '@/domains/listEditor/components/ASortableListEditor.vue'\nimport AImageWidgetSimple from '@/domains/dam/imageWidget/components/AImageWidgetSimple.vue'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useI18n } from 'vue-i18n'\nimport useVuelidate from '@vuelidate/core'\nimport { AImageMetadataValidationScopeSymbol } from '@/domains/dam/composables/uploadValidations'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useAssetSelectStore } from '@/domains/dam/assetSelect/store/assetSelectStore'\nimport ImageWidgetMultipleLimitDialog from '@/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue'\nimport { ImageWidgetUploadConfigKey } from '@/domains/dam/imageWidget/utils/imageWidgetInkectionKeys'\nimport { fetchAssetListByFileIdsMultipleLicences } from '@/domains/dam/api/damfetchAssetListByFileIdsMultipleLicences'\nimport { copyToLicence } from '@/domains/dam/api/damImageApi'\nimport { createDamImage, imageFieldsOf } from '@/domains/dam/imageWidget/utils/damImage'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport {\n holdImages,\n imageSavedSince,\n imageSavesOfOthersOver,\n noteImagesSave,\n} from '@/domains/dam/imageWidget/utils/imageSaves'\nimport { WAIT_RAN_OUT, withinWaitLimit } from '@/domains/dam/imageWidget/utils/waitLimit'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: IntegerId[]\n queueKey: UploadQueueKey\n uploadLicence: IntegerId\n selectLicences: IntegerId[]\n configName?: string\n label?: string | undefined\n readonly?: boolean\n dataCy?: string | undefined\n width?: number | undefined\n disableDraggable?: boolean\n widgetIdentifierId?: string | undefined\n callDeleteApiOnRemove?: boolean\n skipCurrentUserCheck?: boolean\n }>(),\n {\n configName: undefined,\n label: undefined,\n image: undefined,\n readonly: false,\n lockable: false,\n lockedById: undefined,\n dataCy: undefined,\n width: undefined,\n disableDraggable: false,\n widgetIdentifierId: undefined,\n callDeleteApiOnRemove: false,\n skipCurrentUserCheck: false,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', data: IntegerId[]): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst assetSelectDialog = ref(false)\n\nconst imageWidgetUploadConfig = inject<ShallowRef<DamConfigLicenceExtSystemReturnType | undefined> | undefined>(\n ImageWidgetUploadConfigKey,\n undefined\n)\n\nif (isUndefined(imageWidgetUploadConfig) || isUndefined(imageWidgetUploadConfig.value)) {\n throw new Error(\"Fatal error, parent component doesn't provide necessary config ext system config.\")\n}\n\nconst imageOptions = useCommonAdminImageOptions(damConfigName)\nconst { imageClient, imageApi } = imageOptions\nconst { showErrorsDefault, showValidationError, showErrorT, showWarningT, showUnknownError } = useAlerts()\nconst uploadButtonComponent = ref<InstanceType<any> | null>(null)\n\nconst { uploadSizes, uploadAccept } = useDamAcceptTypeAndSizeHelper(\n DamAssetType.Image,\n imageWidgetUploadConfig.value.extSystemConfig\n)\n\nconst { t } = useI18n()\n\nconst imagesLoading = ref(false)\nconst imagesLoadFailed = ref(false)\n\n// Editor must not mount before the fetch lands: its dirty baseline is captured once, so rows\n// arriving later would read as \"added\". One-shot, like the fetch.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst imagesReady = ref(props.modelValue.length === 0)\n\nconst listEditor = ref<{ commit: (rows?: ImageStoreItem[]) => void; cancelReorderMode: () => void } | null>(null)\n\nconst imageStore = useImageStore()\n// The store is shared by all widgets. Leftovers from the previous one do not belong to this entity.\nimageStore.reset()\nwatch(\n () => props.readonly,\n (value) => {\n imageStore.readonly = value\n },\n { immediate: true }\n)\nconst { images, maxPosition } = storeToRefs(imageStore)\n\n// Identity of this widget among the image-saving widgets (`imageSaves.ts`), and marks of its own pending saves.\nconst thisWidget = Symbol('image widget multiple')\nconst ownImageSaves = new Set<symbol>()\n// Cancels waiting on other widgets' saves when this widget unmounts.\nlet cancelSaveWaits: (() => void) | null = null\n\n/**\n * Resolves once no other widget has a pending save of any of `ids`, such as the\n * widget this one replaced. On timeout the user is told the request timed out.\n */\nconst savesOfOthersOver = async (ids: IntegerId[]) => {\n const waits = ids\n .map((id) => imageSavesOfOthersOver(damConfigName, id, ownImageSaves))\n .filter((wait) => !isNull(wait))\n if (waits.length === 0) return\n cancelSaveWaits = () => waits.forEach((wait) => wait.cancel())\n const over = await withinWaitLimit(Promise.all(waits.map((wait) => wait.over)), 1, damConfigName)\n cancelSaveWaits = null\n if (over !== WAIT_RAN_OUT) return\n waits.forEach((wait) => wait.cancel())\n if (!unmounted) showErrorT('error.apiTimedOut.message')\n}\n\n// Rows added while the entity images load wait for the load and\n// come after them. Otherwise the load replaced them silently.\nlet imagesLoaded: Promise<void> = Promise.resolve()\n\nconst fetchImagesOnLoad = async () => {\n if (props.modelValue.length === 0) {\n return\n }\n try {\n imagesLoading.value = true\n // Counted when the read is sent: a save answered later may have taken effect after the read.\n const readAt = holdImages(damConfigName, thisWidget, props.modelValue)\n const read = await imageApi.fetchImageListByIds(imageClient, props.modelValue)\n // Rows wait until other widgets' saves of these images are over, using the latest saved state.\n // Otherwise a row had old texts and this widget's save wrote them back over the saved ones.\n await savesOfOthersOver(read.map((image) => image.id))\n if (unmounted) return\n const imagesRes = read\n .map((image) => {\n const saved = imageSavedSince(damConfigName, image.id, readAt.get(image.id) ?? 0)\n return saved ? { ...image, ...saved, id: image.id, position: saved.position ?? image.position } : image\n })\n .sort((a, b) => (a.position ?? 0) - (b.position ?? 0))\n const groupedIds: IdsGroupedByLicences = new Map()\n imagesRes.forEach((image) => {\n const group = groupedIds.get(image.dam.licenceId)\n if (group) {\n group.push(image.dam.damId)\n } else {\n groupedIds.set(image.dam.licenceId, [image.dam.damId])\n }\n })\n\n let assetsRes: Awaited<ReturnType<typeof fetchAssetListByFileIdsMultipleLicences>> = []\n try {\n assetsRes = await fetchAssetListByFileIdsMultipleLicences(damClient, endPointAsset, groupedIds)\n } catch (e) {\n // Read-only shows images without DAM authors. A user without upload rights is often refused the assets.\n if (!props.readonly) throw e\n }\n\n imageStore.setImages(\n imagesRes.map((imageRes) => {\n if (isUndefined(imageRes.position)) throw new Error('Image object needs position field!')\n imageStore.updateMaxPositionIfGreater(imageRes.position)\n const found = assetsRes.find((asset) => asset.mainFile?.id === imageRes.dam.damId)\n return {\n key: generateUUIDv1(),\n ...imageRes,\n // Each row gets its own copy. Rows of the same asset shared the array.\n damAuthors: found ? [...found.authors] : [],\n showDamAuthors: found ? found.authors.length === 0 : false,\n assetId: found ? found.id : undefined,\n }\n })\n )\n // Displaying a read-only widget must not rewrite the form's value with the stored order.\n if (!props.readonly) {\n emit('update:modelValue', images.value.map((image) => image.id).filter((id) => id !== undefined) as IntegerId[])\n }\n } catch (e) {\n imagesLoadFailed.value = true\n showErrorsDefault(e)\n } finally {\n imagesLoading.value = false\n imagesReady.value = true\n }\n}\n\nconst uploadQueuesStore = useUploadQueuesStore()\n\nconst uploadQueue = computed(() => {\n return uploadQueuesStore.getQueue(props.queueKey)\n})\n\nconst { cachedExtSystemId } = useExtSystemIdForCached(damConfigName)\n\nconst { uploadQueueDialog, stopQueueLeftBehind } = useUploadQueueDialog()\n\nconst onFileInput = (files: File[]) => {\n if (props.readonly) return\n // The input rejected every file and reported it. Opening the queue dialog would show nothing new.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n // `afterLimitDialogAdd` opens the queue dialog once files are\n // queued. Over the limit nothing is queued until the user agrees.\n // Rows of a queue no dialog shows are not counted. They go first.\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onDrop = (files: File[]) => {\n if (props.readonly) return\n // Same as the input: the dropzone rejected every file and reported it.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onCopyToLicence = (data: DamImageCopyToLicenceResponse) => {\n if (props.readonly) return\n if (data.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n let refused = 0\n data.forEach((item) => {\n if (item.result === 'copy') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n } else if (item.result === 'exists') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n uploadQueuesStore.queueItemDuplicate(item.targetAsset, item.targetMainFile, DamAssetType.Image, damConfigName)\n } else {\n refused++\n }\n })\n if (refused > 0) showErrorT('common.damImage.queueItem.errorUnableToCopyToLicence')\n if (refused === data.length) return\n uploadQueueDialog.value = props.queueKey\n}\n\nconst afterLimitDialogAdd = () => {\n uploadQueueDialog.value = props.queueKey\n}\n\n/**\n * Images of picked assets, without position. Each asset is read under\n * its own licence, and its authors under that licence's ext system.\n * The browsed licence can change after picking, and the DAM silently omits assets of another licence.\n * `readUnder`: the licence of all assets and its ext system, when the caller knows them.\n */\nconst assetSelectConfirmMap = async (\n items: AssetSearchListItemDto[],\n readUnder?: { licence: IntegerId; extSystem: IntegerId }\n): Promise<ImageStoreItem[]> => {\n const assetSelectStore = useAssetSelectStore()\n const assetMetadataMap = new Map<DocId, { description: string; authorIds: DocId[] }>()\n const authorsMap = new Map<DocId, string>()\n const idsByLicence: IdsGroupedByLicences = new Map()\n items.forEach((item) => {\n const licence = readUnder ? readUnder.licence : item.licence\n const group = idsByLicence.get(licence)\n if (group) {\n group.push(item.id)\n } else {\n idsByLicence.set(licence, [item.id])\n }\n })\n // A licence that fails to read does not stop the others.\n const failures: unknown[] = []\n for (const [licence, ids] of idsByLicence) {\n try {\n const assetDetails = await fetchAssetListByIds(damClient, endPointAsset, ids, licence)\n if (customAssetSelectMetadataToImageMap) {\n assetDetails.forEach((assetDetail) => {\n const mapped = customAssetSelectMetadataToImageMap(assetDetail)\n assetMetadataMap.set(assetDetail.id, {\n description: mapped.description,\n authorIds: [],\n })\n authorsMap.set(assetDetail.id, mapped.source)\n })\n continue\n }\n const authorIdsToFetch = new Set<DocId>()\n assetDetails.forEach((assetDetail) => {\n assetMetadataMap.set(assetDetail.id, {\n description: isString(assetDetail.metadata.customData?.description)\n ? assetDetail.metadata.customData.description.trim()\n : '',\n authorIds: assetDetail.authors,\n })\n assetDetail.authors.forEach((authorId) => {\n authorIdsToFetch.add(authorId)\n })\n })\n if (authorIdsToFetch.size > 0) {\n const licenceConfig = assetSelectStore.selectConfig.find((config) => config.licence === licence)\n // Uses the licence's ext system, as for every DAM author name the widgets\n // write. Falls back to the picker's when the licence does not tell.\n const authorsRes = await fetchAuthorListByIds(\n damClient,\n endPointAuthor,\n readUnder\n ? readUnder.extSystem\n : ((await getExtSystemByLicence(licence)) ??\n (licenceConfig ?? assetSelectStore.requireSelectedSelectConfig()).extSystem),\n [...authorIdsToFetch]\n )\n authorsRes.forEach((author) => {\n authorsMap.set(author.id, author.name)\n })\n }\n } catch (e) {\n failures.push(e)\n }\n }\n // Reported once for all failures. A DAM refusal arrives as a bare axios error that the default handler ignores.\n if (failures.length > 0 && !showErrorsDefault(failures[0])) showUnknownError()\n\n return items.map((asset) => {\n const authorIds = assetMetadataMap.get(asset.id)?.authorIds || []\n const description = assetMetadataMap.get(asset.id)?.description ?? ''\n\n if (customAssetSelectMetadataToImageMap) {\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: authorsMap.get(asset.id) ?? '' },\n { position: 0 }\n ),\n damAuthors: [],\n showDamAuthors: false,\n assetId: asset.id,\n }\n }\n\n const authorNames: string[] = []\n assetMetadataMap.get(asset.id)?.authorIds.forEach((authorId) => {\n const name = authorsMap.get(authorId)\n if (!isUndefined(name) && name.trim().length > 0) {\n authorNames.push(name)\n }\n })\n\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: authorNames.join(', ') },\n { position: 0 }\n ),\n damAuthors: authorIds,\n // Only for assets that were read. For an unread asset its authors are unknown, and authors\n // picked in the row would replace them in the DAM. Its row shows the source instead.\n showDamAuthors: assetMetadataMap.has(asset.id) && authorIds.length === 0,\n assetId: asset.id,\n }\n })\n}\n\nconst positioned = (items: ImageStoreItem[]) =>\n items.map((item) => {\n maxPosition.value++\n return { ...item, position: maxPosition.value }\n })\n\nconst onAssetSelectConfirm = async (data: AssetSelectReturnData) => {\n if (props.readonly) return\n if (data.type !== 'asset' || data.value.length === 0) return\n const picked = data.value.filter((asset) => !isNull(asset.mainFile))\n // Picked assets from a licence other than the upload licence are copied. Assets\n // already in it are used at once. Copies are added when the queue dialog is used.\n const toCopy =\n copyToLicenceEnabled !== false && !isUndefined(data.copyToLicence)\n ? picked.filter((asset) => asset.licence !== data.copyToLicence)\n : []\n // A widget that unmounted or became read-only adds nothing. The image store belongs to the next widget by then.\n const addingIsOver = () => unmounted || props.readonly\n if (toCopy.length === 0) {\n const images = await assetSelectConfirmMap(picked)\n await imagesLoaded\n if (!addingIsOver()) imageStore.addImages(positioned(images))\n return\n }\n const copying = copyToLicence(\n damClient,\n endPointImage,\n toCopy.map((asset) => ({ asset: asset.id, targetAssetLicence: data.copyToLicence! }))\n )\n // Read during the copy under their own licence (the upload's) and its ext system, not the browsed one.\n // Added before the queue dialog opens. Otherwise using the dialog first put the copies before them.\n const asTheyAre = picked.filter((asset) => !toCopy.includes(asset))\n const config = imageWidgetUploadConfig.value\n const imagesAsTheyAre =\n asTheyAre.length === 0\n ? Promise.resolve([])\n : assetSelectConfirmMap(\n asTheyAre,\n config ? { licence: data.copyToLicence!, extSystem: config.extSystem } : undefined\n )\n let copyRes: DamImageCopyToLicenceResponse | null = null\n try {\n copyRes = await copying\n } catch (e) {\n showErrorsDefault(e)\n }\n const images = await imagesAsTheyAre\n await imagesLoaded\n if (addingIsOver()) return\n imageStore.addImages(positioned(images))\n if (copyRes) onCopyToLicence(copyRes)\n}\n\nconst assetDetailStore = useAssetDetailStore()\nconst { dialog: assetDialog } = storeToRefs(assetDetailStore)\nconst {\n damClient,\n endPointAsset,\n endPointImage,\n endPointAuthor,\n copyToLicenceEnabled,\n showSourceEnabled,\n sourceLabel,\n editAssetLabel,\n addFromDamLabel,\n customAssetSelectMetadataToImageMap,\n} = useCommonAdminCoreDamOptions(damConfigName)\n\n// True while the detail was opened by \"edit asset\" of a row. Not for the detail\n// opened from the queue dialog, which is drawn here too and reads nothing on close.\nlet detailOfRow = false\n// Reads of assets whose detail closed, keyed by asset. The widget save waits for them.\n// Reads of other assets do not wait on these. Otherwise closing one detail waited for another asset's save and read.\nconst detailAssetReads = new Map<DocId, Promise<void>>()\n// Such a read may finish after unmount, when the store belongs to the next widget.\nlet unmounted = false\nonBeforeUnmount(() => {\n unmounted = true\n holdImages(damConfigName, thisWidget, [])\n cancelSaveWaits?.()\n})\n\nconst onEditAsset = async (assetFileId: DocId) => {\n detailOfRow = true\n let extSystem: IntegerId | null = null\n try {\n await assetDetailStore.open(\n props.queueKey,\n async () => {\n const asset = await fetchAssetByFileId(damClient, endPointAsset, assetFileId)\n // Falls back to the ext system of the widget's upload licence,\n // loaded by its root, when the licence cannot be resolved.\n const shownUnder = (await getExtSystemByLicence(asset.licence)) ?? imageWidgetUploadConfig.value!.extSystem\n // Must load before the detail shows the asset: it reads the ext\n // system configuration while rendering and threw without it.\n await loadAssetDetailExtSystem(damClient, shownUnder, asset.attributes.assetType, damConfigName)\n extSystem = shownUnder\n return asset\n },\n // Only for the asset the detail still shows: a stale answer must not change the ext system used for name lookups.\n () => {\n if (extSystem) cachedExtSystemId.value = extSystem\n }\n )\n } catch (e) {\n showErrorsDefault(e)\n }\n}\n\n// An upload applied during the entity image load waits with its dialog and\n// queue intact. Its rows come after the loaded images, then the dialog closes.\n// If the widget is read-only or gone by then, the dialog and queue stay as for\n// read-only, so nothing is lost. Before, the dialog and rows were dropped.\n// Applying again while waiting is ignored, or rows would be added twice.\nlet uploadWaitsForLoad = false\nconst onAssetUploadConfirm = async (items: ImageStoreItem[]) => {\n if (props.readonly) return\n if (items.length === 0) return\n if (imagesLoading.value) {\n if (uploadWaitsForLoad) return\n uploadWaitsForLoad = true\n await imagesLoaded\n uploadWaitsForLoad = false\n if (unmounted || props.readonly) return\n }\n addUploadedRows(items)\n uploadQueueDialog.value = null\n uploadQueuesStore.stopUpload(props.queueKey)\n}\n\nconst addUploadedRows = (items: ImageStoreItem[]) => {\n // A duplicate file becomes the asset of the existing image, and the dialog has just saved its authors. Rows of that\n // asset offering the pick take them, as after closing the detail. Otherwise their pick would overwrite those authors.\n // Names go into a row's source only if it has none. Before, they always overwrote it.\n if (authorEnabled.value) {\n items.forEach((item) => {\n if (isUndefined(item.assetId) || item.damAuthors.length === 0) return\n images.value.forEach((image) => {\n if (image.assetId !== item.assetId || !image.showDamAuthors) return\n takeAuthorsGiven(image, item.damAuthors, item.texts.source)\n })\n })\n }\n imageStore.addImages(positioned(items))\n}\n\nconst actionLibrary = () => {\n assetSelectDialog.value = true\n}\n\nconst v$ = useVuelidate({ $scope: AImageMetadataValidationScopeSymbol })\n\nconst { getDamConfigExtSystem, getExtSystemByLicence } = useDamConfigState(damClient, damConfigName)\nconst damConfigStore = useDamConfigStoreOf(damConfigName)\n\nconst authorEnabled = computed(() => {\n return !!getDamConfigExtSystem(cachedExtSystemId.value)?.[DamAssetType.Image]?.authors?.enabled\n})\n\n/**\n * Author names of an asset, in order, under its licence's ext system.\n * Falls back to `pageExtSystem` when the licence does not tell.\n */\nconst authorNamesOf = async (asset: AssetDetailItemDto, pageExtSystem: IntegerId) => {\n const extSystem = (await getExtSystemByLicence(asset.licence)) ?? pageExtSystem\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, asset.authors)\n const authorNames: string[] = []\n asset.authors.forEach((authorId) => {\n const name = authorsRes.find((author) => author.id === authorId)?.name\n if (!isUndefined(name) && name.trim().length > 0) {\n authorNames.push(name)\n }\n })\n return authorNames.join(', ')\n}\n\n/**\n * Once the asset turns out to have authors, a row offering the\n * author pick takes them, drops the pick and shows its source.\n * The source takes their names if empty or if it holds a hidden \"fill empty\"\n * pick from mass operations. An image's own source stays for the user to check.\n */\nconst takeAuthorsGiven = (row: ImageStoreItem, authors: DocId[], names: string) => {\n row.damAuthors = [...authors]\n if (row.texts.source.trim().length === 0 || imageStore.hasSourceOfPick(row)) row.texts.source = names\n imageStore.forgetSourceOfPick(row)\n row.showDamAuthors = false\n}\n\n/**\n * The detail may have given authors to an asset whose row offers the pick.\n * Otherwise the widget save overwrote them, or saved the image without a source.\n * So the asset is read again, and its offering rows take its authors with names under the asset\n * licence's ext system (see `takeAuthorsGiven`). Rows showing their source are left alone.\n * `detailSave`: the detail save pending at close. `pageExtSystem`: the ext system configured at that time.\n */\nconst takeAuthorsOfDetailAsset = async (assetId: DocId, detailSave: Promise<void> | null, pageExtSystem: IntegerId) => {\n try {\n // Read before the DAM answers that save, the asset would be stale.\n await detailSave\n const asset = await fetchAsset(damClient, endPointAsset, assetId)\n if (asset.authors.length === 0) return\n const source = await authorNamesOf(asset, pageExtSystem)\n if (unmounted || props.readonly) return\n images.value.forEach((image) => {\n // Uses the row's own flag. Whether the page shows the pick depends\n // on an ext system that another asset's detail may have changed.\n if (image.assetId !== asset.id || !image.showDamAuthors) return\n takeAuthorsGiven(image, asset.authors, source)\n })\n } catch (e) {\n if (!unmounted && !showErrorsDefault(e)) showUnknownError()\n }\n}\n\n/**\n * `shown`: the asset the detail showed. None if it closed from its loader or after a failed read.\n * Captured before any await: whether a row of that asset offers the\n * pick, the pending detail save, and the configured ext system.\n */\nconst onAssetDetailClose = (shown: AssetDetailItemDto | null) => {\n const ofRow = detailOfRow\n detailOfRow = false\n if (!ofRow || isNull(shown) || props.readonly || !authorEnabled.value) return\n const assetId = shown.id\n if (!images.value.some((image) => image.assetId === assetId && image.showDamAuthors)) return\n const detailSave = assetDetailStore.savingOf(assetId, damConfigName)\n const pageExtSystem = cachedExtSystemId.value\n const read = (detailAssetReads.get(assetId) ?? Promise.resolve()).then(() =>\n takeAuthorsOfDetailAsset(assetId, detailSave, pageExtSystem)\n )\n detailAssetReads.set(assetId, read)\n void read.then(() => {\n if (detailAssetReads.get(assetId) === read) detailAssetReads.delete(assetId)\n })\n}\n\nconst saveImages = async () => {\n // Nothing of the user's to write. The images stay as loaded.\n if (props.readonly) return true\n // An empty store here means the fetch is pending or failed, not a\n // user deletion. The empty path below would detach every image.\n if (imagesLoading.value || imagesLoadFailed.value) {\n showUnknownError()\n return false\n }\n // A closed detail's asset is still being read. Its rows are not written until they have its authors.\n await Promise.all(detailAssetReads.values())\n if (unmounted) return false\n v$.value.$touch()\n if (v$.value.$invalid) {\n showValidationError()\n return false\n }\n try {\n const assetUpdateItems: AssetAuthorsItems = []\n const imagesRaw = toRaw(images.value)\n // Rows offering the author pick, grouped by asset. An entity may have\n // an image twice, and a queue duplicate is a second row of its asset.\n // Per row, authors went out once per row and the last won, and a row with no pick was saved without a source.\n // The asset gets the union of picks in its rows, each author once,\n // and each row gets the authors and names after the DAM accepts them.\n const offering = new Map<DocId, { assetId: DocId | undefined; rows: ImageStoreItem[]; authors: DocId[] }>()\n if (authorEnabled.value) {\n images.value.forEach((image) => {\n if (!image.showDamAuthors) return\n // A row offering the pick has an asset. One without would be grouped alone.\n const of = image.assetId ?? image.key\n const asset = offering.get(of) ?? { assetId: image.assetId, rows: [], authors: [] }\n offering.set(of, asset)\n asset.rows.push(image)\n image.damAuthors.forEach((author) => {\n if (!asset.authors.includes(author)) asset.authors.push(author)\n })\n })\n }\n const named: Array<{ assetId: DocId | undefined; rows: ImageStoreItem[]; authors: DocId[]; source: string }> = []\n for (const { assetId, rows, authors } of offering.values()) {\n if (authors.length === 0) continue\n if (assetId) assetUpdateItems.push({ id: assetId, authors })\n // Uses the ext system of the rows' asset licence, as the pre-write read does. Falls back to the configured\n // one when the page does not know the licence. It is not fetched, since entity rows can be of any licence.\n const extSystem =\n damConfigStore.damConfigLicenceExtSystem.get(rows[0]!.dam.licenceId)?.extSystem ?? cachedExtSystemId.value\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, authors)\n named.push({ assetId, rows, authors, source: authorsRes.map((author) => author.name).join(', ') })\n }\n // Unmounted while authors loaded: write nothing. Turned read-only: nothing of the user's is written.\n if (unmounted) return false\n if (props.readonly) return true\n // Assets may have received authors elsewhere since their rows loaded, and the write would\n // replace them. So each asset with picked authors is re-read right before the write.\n // If any asset already has authors, nothing is written. Its offering rows take those\n // authors (`takeAuthorsGiven`), a message stays until closed, and the user saves again.\n const picked = [...offering.values()].filter(({ assetId, authors }) => !isUndefined(assetId) && authors.length > 0)\n if (picked.length > 0) {\n const readAgain = await Promise.all(picked.map(({ assetId }) => fetchAsset(damClient, endPointAsset, assetId!)))\n // Unmounted or made read-only while the assets were read: write nothing.\n if (unmounted || props.readonly) return false\n const givenMeanwhile = picked\n .map(({ rows }, index) => ({ rows, asset: readAgain[index]! }))\n .filter(({ asset }) => asset.authors.length > 0)\n if (givenMeanwhile.length > 0) {\n const pageExtSystem = cachedExtSystemId.value\n const names = await Promise.all(givenMeanwhile.map(({ asset }) => authorNamesOf(asset, pageExtSystem)))\n if (unmounted || props.readonly) return false\n givenMeanwhile.forEach(({ rows, asset }, index) => {\n rows.forEach((row) => {\n if (row.showDamAuthors) takeAuthorsGiven(row, asset.authors, names[index]!)\n })\n })\n showWarningT('common.damImage.image.meta.galleryAuthorsGivenMeanwhile', -1)\n return false\n }\n }\n if (assetUpdateItems.length) {\n await bulkUpdateAssetsAuthors(damClient, endPointAsset, assetUpdateItems)\n // Unmounted while the authors were written: save no image. A widget mounted meanwhile\n // for the same images read them before this save, which is noted only once sent.\n if (unmounted) return false\n }\n // The DAM now has these authors even if the images are not saved, so the rows show the source as after a save.\n // If the rows kept offering the pick, the next save would send them as picks,\n // the pre-write read would find these authors, and nothing would be written.\n named.forEach(({ assetId, rows, authors, source }) => {\n rows.forEach((row) => {\n row.damAuthors = [...authors]\n row.texts.source = source\n if (isUndefined(assetId)) return\n row.showDamAuthors = false\n imageStore.forgetSourceOfPick(row)\n })\n })\n const sentRows = [...imagesRaw]\n // Note the saved images for the page's other widgets, one by one.\n // This runs even if this widget unmounted before the response.\n const resItems = await noteImagesSave(\n damConfigName,\n sentRows.map((row) => row.id).filter((id) => !isUndefined(id)),\n ownImageSaves,\n imageApi.bulkUpdateImages(imageClient, sentRows.map(imageFieldsOf))\n )\n // If unmounted before the response, write nothing to the image store. By then it belongs to the next widget.\n if (unmounted) return true\n holdImages(\n damConfigName,\n thisWidget,\n resItems.map((resItem) => resItem.id)\n )\n const ids: IntegerId[] = []\n const items = resItems.map((resItem) => {\n ids.push(resItem.id)\n\n return {\n key: generateUUIDv1(),\n ...resItem,\n damAuthors: [],\n showDamAuthors: false,\n assetId: undefined,\n }\n })\n if (imageStore.images.length === 0) {\n listEditor.value?.commit([])\n // Emptying is a change too. Without this emit the parent keeps its old ids.\n emit('update:modelValue', ids)\n return true\n }\n\n // Match each returned image to its own sent row. Rows of the same file are matched one by one in send order.\n // Matching by file alone gave every row of a file the values of the first one.\n const getUpdatedItem = (item: ImageStoreItem): ImageStoreItem => {\n const index = sentRows.findIndex((row) => row.dam.damId === item.dam.damId)\n const matchedImage = index < 0 ? undefined : sentRows.splice(index, 1)[0]\n\n return {\n ...item,\n damAuthors: matchedImage ? matchedImage.damAuthors : item.damAuthors,\n // Only a row that offered DAM authors keeps offering them.\n // A row whose asset the DAM did not return has no asset to save them into, so it keeps its source.\n showDamAuthors: matchedImage ? matchedImage.showDamAuthors && matchedImage.damAuthors.length === 0 : false,\n assetId: matchedImage ? matchedImage.assetId : item.assetId,\n }\n }\n\n const updatedItems = items.map(getUpdatedItem)\n imageStore.setImages(updatedItems)\n // Pass the rows explicitly. `setImages` just replaced their keys,\n // so a bare `commit()` would read the not-yet-rerendered prop.\n listEditor.value?.commit(updatedItems)\n emit('update:modelValue', ids)\n return true\n } catch (e) {\n // Authors refused by validation are named as the forms name them. Other errors are shown as before.\n showMetadataSaveError(e, cachedExtSystemId.value, damConfigName)\n return false\n }\n}\n\n// Renumber the remaining images as after a move. Otherwise the backend gets positions with a gap.\nconst removeImage = (index: number) => {\n imageStore.removeImageByIndex(index)\n updateAllPositions()\n}\n\nconst removeItem = async (index: number) => {\n const image = images.value[index]\n if (!image) return\n if (isUndefined(image.id)) {\n removeImage(index)\n return\n }\n if (props.callDeleteApiOnRemove) {\n try {\n await imageApi.deleteImage(imageClient, image.id)\n removeImage(index)\n } catch (e) {\n showErrorsDefault(e)\n }\n return\n }\n removeImage(index)\n}\n\nconst limitDialogComponent = ref<InstanceType<typeof ImageWidgetMultipleLimitDialog> | null>(null)\n\nconst editorMode = ref<'view' | 'reorder'>('view')\n// A reorder under way would keep moving rows a read-only widget does not save.\nwatch(\n () => props.readonly,\n (value) => {\n if (value && editorMode.value === 'reorder') listEditor.value?.cancelReorderMode()\n }\n)\n\n// Required by the editor but never called. Adds go through the\n// upload and asset-select flow; the editor's add button is hidden.\nconst createImageStoreItem = (): ImageStoreItem => ({\n key: generateUUIDv1(),\n ...createDamImage({ fileId: '', licenceId: 0 }, {}, { position: 0 }),\n damAuthors: [],\n showDamAuthors: false,\n assetId: undefined,\n})\n\nconst updateAllPositions = () => {\n let pos = 0\n images.value.forEach((image) => {\n pos++\n image.position = pos\n })\n imageStore.maxPosition = pos\n}\n\nconst onReorderApplied = () => {\n updateAllPositions()\n}\n\ndefineExpose({\n saveImages,\n})\n\nonMounted(() => {\n imagesLoaded = fetchImagesOnLoad()\n})\n</script>\n\n<template>\n <div>\n <h4\n v-if=\"label\"\n class=\"font-weight-bold text-label-large\"\n >\n {{ label }}\n </h4>\n <div\n v-if=\"!readonly\"\n class=\"pb-2\"\n >\n <AFileInput\n :file-input-key=\"uploadQueue?.fileInputKey\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @files-input=\"onFileInput\"\n >\n <template #activator=\"{ props: fileInputProps }\">\n <VBtn\n ref=\"uploadButtonComponent\"\n v-bind=\"fileInputProps\"\n >\n {{ t('common.damImage.image.button.upload') }}\n </VBtn>\n </template>\n </AFileInput>\n <VBtn\n class=\"mr-2\"\n @click=\"actionLibrary\"\n >\n {{ addFromDamLabel }}\n </VBtn>\n </div>\n <AAssetSelect\n v-model=\"assetSelectDialog\"\n :select-licences=\"selectLicences\"\n :upload-licence=\"uploadLicence\"\n :min-count=\"1\"\n :max-count=\"50\"\n :asset-type=\"DamAssetType.Image\"\n :skip-current-user-check=\"skipCurrentUserCheck\"\n :config-name=\"damConfigName\"\n return-type=\"asset\"\n @confirm=\"onAssetSelectConfirm\"\n >\n <template\n v-if=\"$slots['asset-select-sidebar-prepend']\"\n #sidebar-prepend=\"slotProps\"\n >\n <slot\n name=\"asset-select-sidebar-prepend\"\n v-bind=\"slotProps\"\n />\n </template>\n </AAssetSelect>\n <div\n v-if=\"imagesLoading\"\n class=\"w-100 d-flex align-center justify-center\"\n >\n <VProgressCircular\n indeterminate\n color=\"primary\"\n />\n </div>\n <div\n class=\"position-relative w-100\"\n style=\"min-height: 140px\"\n >\n <ASortableListEditor\n v-if=\"imagesReady\"\n ref=\"listEditor\"\n v-model=\"images\"\n v-model:mode=\"editorMode\"\n :factory=\"createImageStoreItem\"\n get-key=\"key\"\n position=\"position\"\n :show-add-button=\"false\"\n :show-delete-button=\"false\"\n :show-edit-button=\"false\"\n :disable-drag=\"disableDraggable || readonly\"\n :readonly=\"readonly\"\n @reorder-applied=\"onReorderApplied\"\n >\n <template #view-body>\n <div class=\"asset-list-tiles asset-list-tiles--thumbnail a-sortable-widget__group\">\n <ImageWidgetMultipleItem\n v-for=\"(image, index) in images\"\n :key=\"image.key\"\n :index=\"index\"\n :show-source-enabled=\"showSourceEnabled\"\n :source-label=\"sourceLabel\"\n :edit-asset-label=\"editAssetLabel\"\n :author-enabled=\"authorEnabled\"\n :readonly=\"readonly\"\n :config-name=\"damConfigName\"\n @edit-asset=\"onEditAsset\"\n @remove-item=\"removeItem\"\n />\n </div>\n </template>\n <template #item-compact=\"{ raw }\">\n <div class=\"image-widget-multiple-reorder\">\n <div class=\"image-widget-multiple-reorder__thumb\">\n <AImageWidgetSimple\n :model-value=\"raw.id\"\n :image=\"raw\"\n :config-name=\"damConfigName\"\n />\n </div>\n <div class=\"image-widget-multiple-reorder__meta\">\n <div class=\"image-widget-multiple-reorder__title\">\n {{ raw.texts?.description?.trim() || '—' }}\n </div>\n <div\n v-if=\"raw.texts?.source\"\n class=\"image-widget-multiple-reorder__source\"\n >\n {{ raw.texts.source }}\n </div>\n </div>\n </div>\n </template>\n </ASortableListEditor>\n <AImageDropzone\n v-if=\"editorMode === 'view' && !readonly\"\n variant=\"fill\"\n :hover-only=\"modelValue.length > 0 || images.length > 0\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n @drop=\"onDrop\"\n @click=\"uploadButtonComponent?.$el.click()\"\n />\n </div>\n <UploadQueueDialog\n v-if=\"uploadQueueDialog === queueKey && imageWidgetUploadConfig\"\n :queue-key=\"queueKey\"\n :ext-system=\"imageWidgetUploadConfig.extSystem\"\n :licence-id=\"imageWidgetUploadConfig.licence\"\n :file-input-key=\"uploadQueue?.fileInputKey ?? -1\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @apply=\"onAssetUploadConfirm\"\n @files-input=\"onFileInput\"\n @drop=\"onFileInput\"\n />\n <AssetDetailDialog\n v-if=\"assetDialog === queueKey\"\n :queue-key=\"queueKey\"\n :config-name=\"damConfigName\"\n :ext-system=\"cachedExtSystemId\"\n @close=\"onAssetDetailClose\"\n />\n <ImageWidgetMultipleLimitDialog\n ref=\"limitDialogComponent\"\n :queue-key=\"queueKey\"\n @after-add=\"afterLimitDialogAdd\"\n />\n </div>\n</template>\n\n<style lang=\"scss\">\n.image-widget-multiple-reorder {\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n min-height: 100px;\n padding: 4px 0;\n\n &__thumb {\n flex: 0 0 auto;\n width: 200px;\n border-radius: 4px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n\n img {\n width: 100%;\n height: auto;\n display: block;\n }\n }\n\n &__meta {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n &__title {\n font-size: 0.95rem;\n font-weight: 500;\n color: rgb(var(--v-theme-on-surface));\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n &__source {\n font-size: 0.82rem;\n color: rgb(var(--v-theme-on-surface) / 70%);\n margin-top: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n @media (width <= 600px)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CAAA;IACb,cAAYjD,EAAAmM,CAAA;IACZ,SAAOY;;;;;;GAEVjN,EAIEwB,IAAA;IAHI,SAAA;IAAJ,KAAIoG;IACH,aAAW3E,EAAA;IACX,YAAWiF"}
1
+ {"version":3,"file":"ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_toDisplayString","_createVNode","AFileInput","_unref","_withCtx","_component_VBtn","_mergeProps","_createTextVNode","AAssetSelect","_renderSlot","_normalizeProps","_guardReactiveProps","_component_VProgressCircular","_createElementVNode","_createBlock","ASortableListEditor","_isRef","_Fragment","_renderList","ImageWidgetMultipleItem","AImageWidgetSimple","AImageDropzone","UploadQueueDialog","AssetDetailDialog","ImageWidgetMultipleLimitDialog","ImageWidgetMultipleItem_default","AAssetSelect_default","AFileInput_default","AFileDropzone_default","UploadQueueDialog_default","AssetDetailDialog_default","ASortableListEditor_default","AImageWidgetSimple_default","ImageWidgetMultipleLimitDialog_default","useVuelidate","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","ImageWidgetMultipleInner_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","damConfigName","useDamConfigName","assetSelectDialog","ref","imageWidgetUploadConfig","inject","ImageWidgetUploadConfigKey","isUndefined","useCommonAdminImageOptions","useAlerts","uploadButtonComponent","useDamAcceptTypeAndSizeHelper","DamAssetType","useI18n","imagesLoading","imagesLoadFailed","imagesReady","listEditor","imageStore","useImageStore","watch","value","storeToRefs","thisWidget","ownImageSaves","cancelSaveWaits","savesOfOthersOver","waits","ids","imageSavesOfOthersOver","id","isNull","wait","over","withinWaitLimit","WAIT_RAN_OUT","unmounted","showErrorT","imagesLoaded","fetchImagesOnLoad","readAt","holdImages","read","imageApi","imageClient","image","imagesRes","saved","imageSavedSince","a","b","groupedIds","group","assetsRes","fetchAssetListByFileIdsMultipleLicences","damClient","endPointAsset","imageRes","found","asset","generateUUIDv1","images","showErrorsDefault","uploadQueuesStore","useUploadQueuesStore","uploadQueue","computed","useExtSystemIdForCached","useUploadQueueDialog","onFileInput","files","config","stopQueueLeftBehind","limitDialogComponent","onDrop","onCopyToLicence","data","refused","item","afterLimitDialogAdd","assetSelectConfirmMap","assetSelectStore","useAssetSelectStore","assetMetadataMap","authorsMap","idsByLicence","licence","readUnder","failures","assetDetails","fetchAssetListByIds","customAssetSelectMetadataToImageMap","mapped","assetDetail","authorIdsToFetch","isString","authorId","licenceConfig","fetchAuthorListByIds","endPointAuthor","getExtSystemByLicence","author","showUnknownError","items","authorIds","description","createDamImage","authorNames","name","positioned","maxPosition","onAssetSelectConfirm","picked","toCopy","copyToLicenceEnabled","addingIsOver","copying","copyToLicence","endPointImage","asTheyAre","imagesAsTheyAre","copyRes","assetDetailStore","useAssetDetailStore","assetDialog","useCommonAdminCoreDamOptions","detailOfRow","detailAssetReads","onEditAsset","extSystem","fetchAssetByFileId","assetFileId","shownUnder","loadAssetDetailExtSystem","uploadWaitsForLoad","onAssetUploadConfirm","addUploadedRows","authorEnabled","takeAuthorsGiven","actionLibrary","v$","AImageMetadataValidationScopeSymbol","useDamConfigState","damConfigStore","useDamConfigStoreOf","getDamConfigExtSystem","cachedExtSystemId","authorNamesOf","pageExtSystem","authorsRes","authors","row","names","takeAuthorsOfDetailAsset","detailSave","fetchAsset","assetId","source","onAssetDetailClose","ofRow","shown","saveImages","showValidationError","assetUpdateItems","imagesRaw","toRaw","offering","of","named","rows","readAgain","givenMeanwhile","index","showWarningT","bulkUpdateAssetsAuthors","sentRows","resItems","noteImagesSave","imageFieldsOf","resItem","updatedItems","matchedImage","showMetadataSaveError","removeImage","updateAllPositions","removeItem","editorMode","createImageStoreItem","pos","onReorderApplied","onMounted","openBlock","createElementBlock","toDisplayString","createCommentVNode","createVNode","unref","uploadAccept","uploadSizes","withCtx","fileInputProps","VBtn","mergeProps","createTextVNode","t","addFromDamLabel","_cache","$event","createSlots","_ctx","renderSlot","normalizeProps","guardReactiveProps","slotProps","VProgressCircular","createElementVNode","createBlock","isRef","Fragment","renderList","showSourceEnabled","sourceLabel","editAssetLabel","raw","uploadQueueDialog"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { computed, inject, onBeforeUnmount, onMounted, ref, type ShallowRef, toRaw, watch } from 'vue'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport type { UploadQueueKey } from '@/domains/dam/types/UploadQueue'\nimport type { DamConfigLicenceExtSystemReturnType } from '@/domains/dam/types/DamConfig'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport ImageWidgetMultipleItem from '@/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue'\nimport { storeToRefs } from 'pinia'\nimport { useCommonAdminImageOptions } from '@/domains/dam/imageWidget/composables/commonAdminImageOptions'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport {\n type AssetDetailItemDto,\n type AssetSearchListItemDto,\n DamAssetType,\n type DamImageCopyToLicenceResponse,\n} from '@/domains/dam/types/Asset'\nimport AAssetSelect from '@/domains/dam/assetSelect/components/AAssetSelect.vue'\nimport AFileInput from '@/domains/ui/file/components/AFileInput.vue'\nimport AImageDropzone from '@/domains/ui/file/components/AFileDropzone.vue'\nimport { useDamAcceptTypeAndSizeHelper } from '@/domains/dam/config/composables/acceptTypeAndSizeHelper'\nimport { useUploadQueuesStore } from '@/domains/dam/uploadQueue/store/uploadQueuesStore'\nimport type { AssetSelectReturnData } from '@/domains/dam/types/AssetSelect'\nimport UploadQueueDialog from '@/domains/dam/uploadQueue/components/UploadQueueDialog.vue'\nimport { useUploadQueueDialog } from '@/domains/dam/uploadQueue/composables/useUploadQueueDialog'\nimport AssetDetailDialog from '@/domains/dam/assetDetail/components/AssetDetailDialog.vue'\nimport {\n type AssetAuthorsItems,\n bulkUpdateAssetsAuthors,\n fetchAsset,\n fetchAssetByFileId,\n fetchAssetListByIds,\n type IdsGroupedByLicences,\n showMetadataSaveError,\n} from '@/domains/dam/api/damAssetApi'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { loadAssetDetailExtSystem } from '@/domains/dam/assetDetail/composables/assetDetailExtSystem'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport type { ImageStoreItem } from '@/domains/dam/types/ImageAware'\nimport { generateUUIDv1 } from '@/shared/utils/generator'\nimport ASortableListEditor from '@/domains/listEditor/components/ASortableListEditor.vue'\nimport AImageWidgetSimple from '@/domains/dam/imageWidget/components/AImageWidgetSimple.vue'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useI18n } from 'vue-i18n'\nimport useVuelidate from '@vuelidate/core'\nimport { AImageMetadataValidationScopeSymbol } from '@/domains/dam/composables/uploadValidations'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useAssetSelectStore } from '@/domains/dam/assetSelect/store/assetSelectStore'\nimport ImageWidgetMultipleLimitDialog from '@/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue'\nimport { ImageWidgetUploadConfigKey } from '@/domains/dam/imageWidget/utils/imageWidgetInkectionKeys'\nimport { fetchAssetListByFileIdsMultipleLicences } from '@/domains/dam/api/damfetchAssetListByFileIdsMultipleLicences'\nimport { copyToLicence } from '@/domains/dam/api/damImageApi'\nimport { createDamImage, imageFieldsOf } from '@/domains/dam/imageWidget/utils/damImage'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport {\n holdImages,\n imageSavedSince,\n imageSavesOfOthersOver,\n noteImagesSave,\n} from '@/domains/dam/imageWidget/utils/imageSaves'\nimport { WAIT_RAN_OUT, withinWaitLimit } from '@/domains/dam/imageWidget/utils/waitLimit'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: IntegerId[]\n queueKey: UploadQueueKey\n uploadLicence: IntegerId\n selectLicences: IntegerId[]\n configName?: string\n label?: string | undefined\n readonly?: boolean\n dataCy?: string | undefined\n width?: number | undefined\n disableDraggable?: boolean\n widgetIdentifierId?: string | undefined\n callDeleteApiOnRemove?: boolean\n skipCurrentUserCheck?: boolean\n }>(),\n {\n configName: undefined,\n label: undefined,\n image: undefined,\n readonly: false,\n lockable: false,\n lockedById: undefined,\n dataCy: undefined,\n width: undefined,\n disableDraggable: false,\n widgetIdentifierId: undefined,\n callDeleteApiOnRemove: false,\n skipCurrentUserCheck: false,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', data: IntegerId[]): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst assetSelectDialog = ref(false)\n\nconst imageWidgetUploadConfig = inject<ShallowRef<DamConfigLicenceExtSystemReturnType | undefined> | undefined>(\n ImageWidgetUploadConfigKey,\n undefined\n)\n\nif (isUndefined(imageWidgetUploadConfig) || isUndefined(imageWidgetUploadConfig.value)) {\n throw new Error(\"Fatal error, parent component doesn't provide necessary config ext system config.\")\n}\n\nconst imageOptions = useCommonAdminImageOptions(damConfigName)\nconst { imageClient, imageApi } = imageOptions\nconst { showErrorsDefault, showValidationError, showErrorT, showWarningT, showUnknownError } = useAlerts()\nconst uploadButtonComponent = ref<InstanceType<any> | null>(null)\n\nconst { uploadSizes, uploadAccept } = useDamAcceptTypeAndSizeHelper(\n DamAssetType.Image,\n imageWidgetUploadConfig.value.extSystemConfig\n)\n\nconst { t } = useI18n()\n\nconst imagesLoading = ref(false)\nconst imagesLoadFailed = ref(false)\n\n// Editor must not mount before the fetch lands: its dirty baseline is captured once, so rows\n// arriving later would read as \"added\". One-shot, like the fetch.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst imagesReady = ref(props.modelValue.length === 0)\n\nconst listEditor = ref<{ commit: (rows?: ImageStoreItem[]) => void; cancelReorderMode: () => void } | null>(null)\n\nconst imageStore = useImageStore()\n// The store is shared by all widgets. Leftovers from the previous one do not belong to this entity.\nimageStore.reset()\nwatch(\n () => props.readonly,\n (value) => {\n imageStore.readonly = value\n },\n { immediate: true }\n)\nconst { images, maxPosition } = storeToRefs(imageStore)\n\n// Identity of this widget among the image-saving widgets (`imageSaves.ts`), and marks of its own pending saves.\nconst thisWidget = Symbol('image widget multiple')\nconst ownImageSaves = new Set<symbol>()\n// Cancels waiting on other widgets' saves when this widget unmounts.\nlet cancelSaveWaits: (() => void) | null = null\n\n/**\n * Resolves once no other widget has a pending save of any of `ids`, such as the\n * widget this one replaced. On timeout the user is told the request timed out.\n */\nconst savesOfOthersOver = async (ids: IntegerId[]) => {\n const waits = ids\n .map((id) => imageSavesOfOthersOver(damConfigName, id, ownImageSaves))\n .filter((wait) => !isNull(wait))\n if (waits.length === 0) return\n cancelSaveWaits = () => waits.forEach((wait) => wait.cancel())\n const over = await withinWaitLimit(Promise.all(waits.map((wait) => wait.over)), 1, damConfigName)\n cancelSaveWaits = null\n if (over !== WAIT_RAN_OUT) return\n waits.forEach((wait) => wait.cancel())\n if (!unmounted) showErrorT('error.apiTimedOut.message')\n}\n\n// Rows added while the entity images load wait for the load and\n// come after them. Otherwise the load replaced them silently.\nlet imagesLoaded: Promise<void> = Promise.resolve()\n\nconst fetchImagesOnLoad = async () => {\n if (props.modelValue.length === 0) {\n return\n }\n try {\n imagesLoading.value = true\n // Counted when the read is sent: a save answered later may have taken effect after the read.\n const readAt = holdImages(damConfigName, thisWidget, props.modelValue)\n const read = await imageApi.fetchImageListByIds(imageClient, props.modelValue)\n // Rows wait until other widgets' saves of these images are over, using the latest saved state.\n // Otherwise a row had old texts and this widget's save wrote them back over the saved ones.\n await savesOfOthersOver(read.map((image) => image.id))\n if (unmounted) return\n const imagesRes = read\n .map((image) => {\n const saved = imageSavedSince(damConfigName, image.id, readAt.get(image.id) ?? 0)\n return saved ? { ...image, ...saved, id: image.id, position: saved.position ?? image.position } : image\n })\n .sort((a, b) => (a.position ?? 0) - (b.position ?? 0))\n const groupedIds: IdsGroupedByLicences = new Map()\n imagesRes.forEach((image) => {\n const group = groupedIds.get(image.dam.licenceId)\n if (group) {\n group.push(image.dam.damId)\n } else {\n groupedIds.set(image.dam.licenceId, [image.dam.damId])\n }\n })\n\n let assetsRes: Awaited<ReturnType<typeof fetchAssetListByFileIdsMultipleLicences>> = []\n try {\n assetsRes = await fetchAssetListByFileIdsMultipleLicences(damClient, endPointAsset, groupedIds)\n } catch (e) {\n // Read-only shows images without DAM authors. A user without upload rights is often refused the assets.\n if (!props.readonly) throw e\n }\n\n imageStore.setImages(\n imagesRes.map((imageRes) => {\n if (isUndefined(imageRes.position)) throw new Error('Image object needs position field!')\n imageStore.updateMaxPositionIfGreater(imageRes.position)\n const found = assetsRes.find((asset) => asset.mainFile?.id === imageRes.dam.damId)\n return {\n key: generateUUIDv1(),\n ...imageRes,\n // Each row gets its own copy. Rows of the same asset shared the array.\n damAuthors: found ? [...found.authors] : [],\n showDamAuthors: found ? found.authors.length === 0 : false,\n assetId: found ? found.id : undefined,\n }\n })\n )\n // Displaying a read-only widget must not rewrite the form's value with the stored order.\n if (!props.readonly) {\n emit('update:modelValue', images.value.map((image) => image.id).filter((id) => id !== undefined) as IntegerId[])\n }\n } catch (e) {\n imagesLoadFailed.value = true\n showErrorsDefault(e)\n } finally {\n imagesLoading.value = false\n imagesReady.value = true\n }\n}\n\nconst uploadQueuesStore = useUploadQueuesStore()\n\nconst uploadQueue = computed(() => {\n return uploadQueuesStore.getQueue(props.queueKey)\n})\n\nconst { cachedExtSystemId } = useExtSystemIdForCached(damConfigName)\n\nconst { uploadQueueDialog, stopQueueLeftBehind } = useUploadQueueDialog()\n\nconst onFileInput = (files: File[]) => {\n if (props.readonly) return\n // The input rejected every file and reported it. Opening the queue dialog would show nothing new.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n // `afterLimitDialogAdd` opens the queue dialog once files are\n // queued. Over the limit nothing is queued until the user agrees.\n // Rows of a queue no dialog shows are not counted. They go first.\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onDrop = (files: File[]) => {\n if (props.readonly) return\n // Same as the input: the dropzone rejected every file and reported it.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onCopyToLicence = (data: DamImageCopyToLicenceResponse) => {\n if (props.readonly) return\n if (data.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n let refused = 0\n data.forEach((item) => {\n if (item.result === 'copy') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n } else if (item.result === 'exists') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n uploadQueuesStore.queueItemDuplicate(item.targetAsset, item.targetMainFile, DamAssetType.Image, damConfigName)\n } else {\n refused++\n }\n })\n if (refused > 0) showErrorT('common.damImage.queueItem.errorUnableToCopyToLicence')\n if (refused === data.length) return\n uploadQueueDialog.value = props.queueKey\n}\n\nconst afterLimitDialogAdd = () => {\n uploadQueueDialog.value = props.queueKey\n}\n\n/**\n * Images of picked assets, without position. Each asset is read under\n * its own licence, and its authors under that licence's ext system.\n * The browsed licence can change after picking, and the DAM silently omits assets of another licence.\n * `readUnder`: the licence of all assets and its ext system, when the caller knows them.\n */\nconst assetSelectConfirmMap = async (\n items: AssetSearchListItemDto[],\n readUnder?: { licence: IntegerId; extSystem: IntegerId }\n): Promise<ImageStoreItem[]> => {\n const assetSelectStore = useAssetSelectStore()\n const assetMetadataMap = new Map<DocId, { description: string; authorIds: DocId[] }>()\n const authorsMap = new Map<DocId, string>()\n const idsByLicence: IdsGroupedByLicences = new Map()\n items.forEach((item) => {\n const licence = readUnder ? readUnder.licence : item.licence\n const group = idsByLicence.get(licence)\n if (group) {\n group.push(item.id)\n } else {\n idsByLicence.set(licence, [item.id])\n }\n })\n // A licence that fails to read does not stop the others.\n const failures: unknown[] = []\n for (const [licence, ids] of idsByLicence) {\n try {\n const assetDetails = await fetchAssetListByIds(damClient, endPointAsset, ids, licence)\n if (customAssetSelectMetadataToImageMap) {\n assetDetails.forEach((assetDetail) => {\n const mapped = customAssetSelectMetadataToImageMap(assetDetail)\n assetMetadataMap.set(assetDetail.id, {\n description: mapped.description,\n authorIds: [],\n })\n authorsMap.set(assetDetail.id, mapped.source)\n })\n continue\n }\n const authorIdsToFetch = new Set<DocId>()\n assetDetails.forEach((assetDetail) => {\n assetMetadataMap.set(assetDetail.id, {\n description: isString(assetDetail.metadata.customData?.description)\n ? assetDetail.metadata.customData.description.trim()\n : '',\n authorIds: assetDetail.authors,\n })\n assetDetail.authors.forEach((authorId) => {\n authorIdsToFetch.add(authorId)\n })\n })\n if (authorIdsToFetch.size > 0) {\n const licenceConfig = assetSelectStore.selectConfig.find((config) => config.licence === licence)\n // Uses the licence's ext system, as for every DAM author name the widgets\n // write. Falls back to the picker's when the licence does not tell.\n const authorsRes = await fetchAuthorListByIds(\n damClient,\n endPointAuthor,\n readUnder\n ? readUnder.extSystem\n : ((await getExtSystemByLicence(licence)) ??\n (licenceConfig ?? assetSelectStore.requireSelectedSelectConfig()).extSystem),\n [...authorIdsToFetch]\n )\n authorsRes.forEach((author) => {\n authorsMap.set(author.id, author.name)\n })\n }\n } catch (e) {\n failures.push(e)\n }\n }\n // Reported once for all failures. A DAM refusal arrives as a bare axios error that the default handler ignores.\n if (failures.length > 0 && !showErrorsDefault(failures[0])) showUnknownError()\n\n return items.map((asset) => {\n const authorIds = assetMetadataMap.get(asset.id)?.authorIds || []\n const description = assetMetadataMap.get(asset.id)?.description ?? ''\n\n if (customAssetSelectMetadataToImageMap) {\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: authorsMap.get(asset.id) ?? '' },\n { position: 0 }\n ),\n damAuthors: [],\n showDamAuthors: false,\n assetId: asset.id,\n }\n }\n\n const authorNames: string[] = []\n assetMetadataMap.get(asset.id)?.authorIds.forEach((authorId) => {\n const name = authorsMap.get(authorId)\n if (!isUndefined(name) && name.trim().length > 0) {\n authorNames.push(name)\n }\n })\n\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: authorNames.join(', ') },\n { position: 0 }\n ),\n damAuthors: authorIds,\n // Only for assets that were read. For an unread asset its authors are unknown, and authors\n // picked in the row would replace them in the DAM. Its row shows the source instead.\n showDamAuthors: assetMetadataMap.has(asset.id) && authorIds.length === 0,\n assetId: asset.id,\n }\n })\n}\n\nconst positioned = (items: ImageStoreItem[]) =>\n items.map((item) => {\n maxPosition.value++\n return { ...item, position: maxPosition.value }\n })\n\nconst onAssetSelectConfirm = async (data: AssetSelectReturnData) => {\n if (props.readonly) return\n if (data.type !== 'asset' || data.value.length === 0) return\n const picked = data.value.filter((asset) => !isNull(asset.mainFile))\n // Picked assets from a licence other than the upload licence are copied. Assets\n // already in it are used at once. Copies are added when the queue dialog is used.\n const toCopy =\n copyToLicenceEnabled !== false && !isUndefined(data.copyToLicence)\n ? picked.filter((asset) => asset.licence !== data.copyToLicence)\n : []\n // A widget that unmounted or became read-only adds nothing. The image store belongs to the next widget by then.\n const addingIsOver = () => unmounted || props.readonly\n if (toCopy.length === 0) {\n const images = await assetSelectConfirmMap(picked)\n await imagesLoaded\n if (!addingIsOver()) imageStore.addImages(positioned(images))\n return\n }\n const copying = copyToLicence(\n damClient,\n endPointImage,\n toCopy.map((asset) => ({ asset: asset.id, targetAssetLicence: data.copyToLicence! }))\n )\n // Read during the copy under their own licence (the upload's) and its ext system, not the browsed one.\n // Added before the queue dialog opens. Otherwise using the dialog first put the copies before them.\n const asTheyAre = picked.filter((asset) => !toCopy.includes(asset))\n const config = imageWidgetUploadConfig.value\n const imagesAsTheyAre =\n asTheyAre.length === 0\n ? Promise.resolve([])\n : assetSelectConfirmMap(\n asTheyAre,\n config ? { licence: data.copyToLicence!, extSystem: config.extSystem } : undefined\n )\n let copyRes: DamImageCopyToLicenceResponse | null = null\n try {\n copyRes = await copying\n } catch (e) {\n showErrorsDefault(e)\n }\n const images = await imagesAsTheyAre\n await imagesLoaded\n if (addingIsOver()) return\n imageStore.addImages(positioned(images))\n if (copyRes) onCopyToLicence(copyRes)\n}\n\nconst assetDetailStore = useAssetDetailStore()\nconst { dialog: assetDialog } = storeToRefs(assetDetailStore)\nconst {\n damClient,\n endPointAsset,\n endPointImage,\n endPointAuthor,\n copyToLicenceEnabled,\n showSourceEnabled,\n sourceLabel,\n editAssetLabel,\n addFromDamLabel,\n customAssetSelectMetadataToImageMap,\n} = useCommonAdminCoreDamOptions(damConfigName)\n\n// True while the detail was opened by \"edit asset\" of a row. Not for the detail\n// opened from the queue dialog, which is drawn here too and reads nothing on close.\nlet detailOfRow = false\n// Reads of assets whose detail closed, keyed by asset. The widget save waits for them.\n// Reads of other assets do not wait on these. Otherwise closing one detail waited for another asset's save and read.\nconst detailAssetReads = new Map<DocId, Promise<void>>()\n// Such a read may finish after unmount, when the store belongs to the next widget.\nlet unmounted = false\nonBeforeUnmount(() => {\n unmounted = true\n holdImages(damConfigName, thisWidget, [])\n cancelSaveWaits?.()\n})\n\nconst onEditAsset = async (assetFileId: DocId) => {\n detailOfRow = true\n let extSystem: IntegerId | null = null\n try {\n await assetDetailStore.open(\n props.queueKey,\n async () => {\n const asset = await fetchAssetByFileId(damClient, endPointAsset, assetFileId)\n // Falls back to the ext system of the widget's upload licence,\n // loaded by its root, when the licence cannot be resolved.\n const shownUnder = (await getExtSystemByLicence(asset.licence)) ?? imageWidgetUploadConfig.value!.extSystem\n // Must load before the detail shows the asset: it reads the ext\n // system configuration while rendering and threw without it.\n await loadAssetDetailExtSystem(damClient, shownUnder, asset.attributes.assetType, damConfigName)\n extSystem = shownUnder\n return asset\n },\n // Only for the asset the detail still shows: a stale answer must not change the ext system used for name lookups.\n () => {\n if (extSystem) cachedExtSystemId.value = extSystem\n }\n )\n } catch (e) {\n showErrorsDefault(e)\n }\n}\n\n// An upload applied during the entity image load waits with its dialog and\n// queue intact. Its rows come after the loaded images, then the dialog closes.\n// If the widget is read-only or gone by then, the dialog and queue stay as for\n// read-only, so nothing is lost. Before, the dialog and rows were dropped.\n// Applying again while waiting is ignored, or rows would be added twice.\nlet uploadWaitsForLoad = false\nconst onAssetUploadConfirm = async (items: ImageStoreItem[]) => {\n if (props.readonly) return\n if (items.length === 0) return\n if (imagesLoading.value) {\n if (uploadWaitsForLoad) return\n uploadWaitsForLoad = true\n await imagesLoaded\n uploadWaitsForLoad = false\n if (unmounted || props.readonly) return\n }\n addUploadedRows(items)\n uploadQueueDialog.value = null\n uploadQueuesStore.stopUpload(props.queueKey)\n}\n\nconst addUploadedRows = (items: ImageStoreItem[]) => {\n // A duplicate file becomes the asset of the existing image, and the dialog has just saved its authors. Rows of that\n // asset offering the pick take them, as after closing the detail. Otherwise their pick would overwrite those authors.\n // Names go into a row's source only if it has none. Before, they always overwrote it.\n if (authorEnabled.value) {\n items.forEach((item) => {\n if (isUndefined(item.assetId) || item.damAuthors.length === 0) return\n images.value.forEach((image) => {\n if (image.assetId !== item.assetId || !image.showDamAuthors) return\n takeAuthorsGiven(image, item.damAuthors, item.texts.source)\n })\n })\n }\n imageStore.addImages(positioned(items))\n}\n\nconst actionLibrary = () => {\n assetSelectDialog.value = true\n}\n\nconst v$ = useVuelidate({ $scope: AImageMetadataValidationScopeSymbol })\n\nconst { getDamConfigExtSystem, getExtSystemByLicence } = useDamConfigState(damClient, damConfigName)\nconst damConfigStore = useDamConfigStoreOf(damConfigName)\n\nconst authorEnabled = computed(() => {\n return !!getDamConfigExtSystem(cachedExtSystemId.value)?.[DamAssetType.Image]?.authors?.enabled\n})\n\n/**\n * Author names of an asset, in order, under its licence's ext system.\n * Falls back to `pageExtSystem` when the licence does not tell.\n */\nconst authorNamesOf = async (asset: AssetDetailItemDto, pageExtSystem: IntegerId) => {\n const extSystem = (await getExtSystemByLicence(asset.licence)) ?? pageExtSystem\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, asset.authors)\n const authorNames: string[] = []\n asset.authors.forEach((authorId) => {\n const name = authorsRes.find((author) => author.id === authorId)?.name\n if (!isUndefined(name) && name.trim().length > 0) {\n authorNames.push(name)\n }\n })\n return authorNames.join(', ')\n}\n\n/**\n * Once the asset turns out to have authors, a row offering the\n * author pick takes them, drops the pick and shows its source.\n * The source takes their names if empty or if it holds a hidden \"fill empty\"\n * pick from mass operations. An image's own source stays for the user to check.\n */\nconst takeAuthorsGiven = (row: ImageStoreItem, authors: DocId[], names: string) => {\n row.damAuthors = [...authors]\n if (row.texts.source.trim().length === 0 || imageStore.hasSourceOfPick(row)) row.texts.source = names\n imageStore.forgetSourceOfPick(row)\n row.showDamAuthors = false\n}\n\n/**\n * The detail may have given authors to an asset whose row offers the pick.\n * Otherwise the widget save overwrote them, or saved the image without a source.\n * So the asset is read again, and its offering rows take its authors with names under the asset\n * licence's ext system (see `takeAuthorsGiven`). Rows showing their source are left alone.\n * `detailSave`: the detail save pending at close. `pageExtSystem`: the ext system configured at that time.\n */\nconst takeAuthorsOfDetailAsset = async (assetId: DocId, detailSave: Promise<void> | null, pageExtSystem: IntegerId) => {\n try {\n // Read before the DAM answers that save, the asset would be stale.\n await detailSave\n const asset = await fetchAsset(damClient, endPointAsset, assetId)\n if (asset.authors.length === 0) return\n const source = await authorNamesOf(asset, pageExtSystem)\n if (unmounted || props.readonly) return\n images.value.forEach((image) => {\n // Uses the row's own flag. Whether the page shows the pick depends\n // on an ext system that another asset's detail may have changed.\n if (image.assetId !== asset.id || !image.showDamAuthors) return\n takeAuthorsGiven(image, asset.authors, source)\n })\n } catch (e) {\n if (!unmounted && !showErrorsDefault(e)) showUnknownError()\n }\n}\n\n/**\n * `shown`: the asset the detail showed. None if it closed from its loader or after a failed read.\n * Captured before any await: whether a row of that asset offers the\n * pick, the pending detail save, and the configured ext system.\n */\nconst onAssetDetailClose = (shown: AssetDetailItemDto | null) => {\n const ofRow = detailOfRow\n detailOfRow = false\n if (!ofRow || isNull(shown) || props.readonly || !authorEnabled.value) return\n const assetId = shown.id\n if (!images.value.some((image) => image.assetId === assetId && image.showDamAuthors)) return\n const detailSave = assetDetailStore.savingOf(assetId, damConfigName)\n const pageExtSystem = cachedExtSystemId.value\n const read = (detailAssetReads.get(assetId) ?? Promise.resolve()).then(() =>\n takeAuthorsOfDetailAsset(assetId, detailSave, pageExtSystem)\n )\n detailAssetReads.set(assetId, read)\n void read.then(() => {\n if (detailAssetReads.get(assetId) === read) detailAssetReads.delete(assetId)\n })\n}\n\nconst saveImages = async () => {\n // Nothing of the user's to write. The images stay as loaded.\n if (props.readonly) return true\n // An empty store here means the fetch is pending or failed, not a\n // user deletion. The empty path below would detach every image.\n if (imagesLoading.value || imagesLoadFailed.value) {\n showUnknownError()\n return false\n }\n // A closed detail's asset is still being read. Its rows are not written until they have its authors.\n await Promise.all(detailAssetReads.values())\n if (unmounted) return false\n v$.value.$touch()\n if (v$.value.$invalid) {\n showValidationError()\n return false\n }\n try {\n const assetUpdateItems: AssetAuthorsItems = []\n const imagesRaw = toRaw(images.value)\n // Rows offering the author pick, grouped by asset. An entity may have\n // an image twice, and a queue duplicate is a second row of its asset.\n // Per row, authors went out once per row and the last won, and a row with no pick was saved without a source.\n // The asset gets the union of picks in its rows, each author once,\n // and each row gets the authors and names after the DAM accepts them.\n const offering = new Map<DocId, { assetId: DocId | undefined; rows: ImageStoreItem[]; authors: DocId[] }>()\n if (authorEnabled.value) {\n images.value.forEach((image) => {\n if (!image.showDamAuthors) return\n // A row offering the pick has an asset. One without would be grouped alone.\n const of = image.assetId ?? image.key\n const asset = offering.get(of) ?? { assetId: image.assetId, rows: [], authors: [] }\n offering.set(of, asset)\n asset.rows.push(image)\n image.damAuthors.forEach((author) => {\n if (!asset.authors.includes(author)) asset.authors.push(author)\n })\n })\n }\n const named: Array<{ assetId: DocId | undefined; rows: ImageStoreItem[]; authors: DocId[]; source: string }> = []\n for (const { assetId, rows, authors } of offering.values()) {\n if (authors.length === 0) continue\n if (assetId) assetUpdateItems.push({ id: assetId, authors })\n // Uses the ext system of the rows' asset licence, as the pre-write read does. Falls back to the configured\n // one when the page does not know the licence. It is not fetched, since entity rows can be of any licence.\n const extSystem =\n damConfigStore.damConfigLicenceExtSystem.get(rows[0]!.dam.licenceId)?.extSystem ?? cachedExtSystemId.value\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, authors)\n named.push({ assetId, rows, authors, source: authorsRes.map((author) => author.name).join(', ') })\n }\n // Unmounted while authors loaded: write nothing. Turned read-only: nothing of the user's is written.\n if (unmounted) return false\n if (props.readonly) return true\n // Assets may have received authors elsewhere since their rows loaded, and the write would\n // replace them. So each asset with picked authors is re-read right before the write.\n // If any asset already has authors, nothing is written. Its offering rows take those\n // authors (`takeAuthorsGiven`), a message stays until closed, and the user saves again.\n const picked = [...offering.values()].filter(({ assetId, authors }) => !isUndefined(assetId) && authors.length > 0)\n if (picked.length > 0) {\n const readAgain = await Promise.all(picked.map(({ assetId }) => fetchAsset(damClient, endPointAsset, assetId!)))\n // Unmounted or made read-only while the assets were read: write nothing.\n if (unmounted || props.readonly) return false\n const givenMeanwhile = picked\n .map(({ rows }, index) => ({ rows, asset: readAgain[index]! }))\n .filter(({ asset }) => asset.authors.length > 0)\n if (givenMeanwhile.length > 0) {\n const pageExtSystem = cachedExtSystemId.value\n const names = await Promise.all(givenMeanwhile.map(({ asset }) => authorNamesOf(asset, pageExtSystem)))\n if (unmounted || props.readonly) return false\n givenMeanwhile.forEach(({ rows, asset }, index) => {\n rows.forEach((row) => {\n if (row.showDamAuthors) takeAuthorsGiven(row, asset.authors, names[index]!)\n })\n })\n showWarningT('common.damImage.image.meta.galleryAuthorsGivenMeanwhile', -1)\n return false\n }\n }\n if (assetUpdateItems.length) {\n await bulkUpdateAssetsAuthors(damClient, endPointAsset, assetUpdateItems)\n // Unmounted while the authors were written: save no image. A widget mounted meanwhile\n // for the same images read them before this save, which is noted only once sent.\n if (unmounted) return false\n }\n // The DAM now has these authors even if the images are not saved, so the rows show the source as after a save.\n // If the rows kept offering the pick, the next save would send them as picks,\n // the pre-write read would find these authors, and nothing would be written.\n named.forEach(({ assetId, rows, authors, source }) => {\n rows.forEach((row) => {\n row.damAuthors = [...authors]\n row.texts.source = source\n if (isUndefined(assetId)) return\n row.showDamAuthors = false\n imageStore.forgetSourceOfPick(row)\n })\n })\n const sentRows = [...imagesRaw]\n // Note the saved images for the page's other widgets, one by one.\n // This runs even if this widget unmounted before the response.\n const resItems = await noteImagesSave(\n damConfigName,\n sentRows.map((row) => row.id).filter((id) => !isUndefined(id)),\n ownImageSaves,\n imageApi.bulkUpdateImages(imageClient, sentRows.map(imageFieldsOf))\n )\n // If unmounted before the response, write nothing to the image store. By then it belongs to the next widget.\n if (unmounted) return true\n holdImages(\n damConfigName,\n thisWidget,\n resItems.map((resItem) => resItem.id)\n )\n const ids: IntegerId[] = []\n const items = resItems.map((resItem) => {\n ids.push(resItem.id)\n\n return {\n key: generateUUIDv1(),\n ...resItem,\n damAuthors: [],\n showDamAuthors: false,\n assetId: undefined,\n }\n })\n if (imageStore.images.length === 0) {\n listEditor.value?.commit([])\n // Emptying is a change too. Without this emit the parent keeps its old ids.\n emit('update:modelValue', ids)\n return true\n }\n\n // Match each returned image to its own sent row. Rows of the same file are matched one by one in send order.\n // Matching by file alone gave every row of a file the values of the first one.\n const getUpdatedItem = (item: ImageStoreItem): ImageStoreItem => {\n const index = sentRows.findIndex((row) => row.dam.damId === item.dam.damId)\n const matchedImage = index < 0 ? undefined : sentRows.splice(index, 1)[0]\n\n return {\n ...item,\n damAuthors: matchedImage ? matchedImage.damAuthors : item.damAuthors,\n // Only a row that offered DAM authors keeps offering them.\n // A row whose asset the DAM did not return has no asset to save them into, so it keeps its source.\n showDamAuthors: matchedImage ? matchedImage.showDamAuthors && matchedImage.damAuthors.length === 0 : false,\n assetId: matchedImage ? matchedImage.assetId : item.assetId,\n }\n }\n\n const updatedItems = items.map(getUpdatedItem)\n imageStore.setImages(updatedItems)\n // Pass the rows explicitly. `setImages` just replaced their keys,\n // so a bare `commit()` would read the not-yet-rerendered prop.\n listEditor.value?.commit(updatedItems)\n emit('update:modelValue', ids)\n return true\n } catch (e) {\n // Authors refused by validation are named as the forms name them. Other errors are shown as before.\n showMetadataSaveError(e, cachedExtSystemId.value, damConfigName)\n return false\n }\n}\n\n// Renumber the remaining images as after a move. Otherwise the backend gets positions with a gap.\nconst removeImage = (index: number) => {\n imageStore.removeImageByIndex(index)\n updateAllPositions()\n}\n\nconst removeItem = async (index: number) => {\n const image = images.value[index]\n if (!image) return\n if (isUndefined(image.id)) {\n removeImage(index)\n return\n }\n if (props.callDeleteApiOnRemove) {\n try {\n await imageApi.deleteImage(imageClient, image.id)\n removeImage(index)\n } catch (e) {\n showErrorsDefault(e)\n }\n return\n }\n removeImage(index)\n}\n\nconst limitDialogComponent = ref<InstanceType<typeof ImageWidgetMultipleLimitDialog> | null>(null)\n\nconst editorMode = ref<'view' | 'reorder'>('view')\n// A reorder under way would keep moving rows a read-only widget does not save.\nwatch(\n () => props.readonly,\n (value) => {\n if (value && editorMode.value === 'reorder') listEditor.value?.cancelReorderMode()\n }\n)\n\n// Required by the editor but never called. Adds go through the\n// upload and asset-select flow; the editor's add button is hidden.\nconst createImageStoreItem = (): ImageStoreItem => ({\n key: generateUUIDv1(),\n ...createDamImage({ fileId: '', licenceId: 0 }, {}, { position: 0 }),\n damAuthors: [],\n showDamAuthors: false,\n assetId: undefined,\n})\n\nconst updateAllPositions = () => {\n let pos = 0\n images.value.forEach((image) => {\n pos++\n image.position = pos\n })\n imageStore.maxPosition = pos\n}\n\nconst onReorderApplied = () => {\n updateAllPositions()\n}\n\ndefineExpose({\n saveImages,\n})\n\nonMounted(() => {\n imagesLoaded = fetchImagesOnLoad()\n})\n</script>\n\n<template>\n <div>\n <h4\n v-if=\"label\"\n class=\"font-weight-bold text-label-large\"\n >\n {{ label }}\n </h4>\n <div\n v-if=\"!readonly\"\n class=\"pb-2\"\n >\n <AFileInput\n :file-input-key=\"uploadQueue?.fileInputKey\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @files-input=\"onFileInput\"\n >\n <template #activator=\"{ props: fileInputProps }\">\n <VBtn\n ref=\"uploadButtonComponent\"\n v-bind=\"fileInputProps\"\n >\n {{ t('common.damImage.image.button.upload') }}\n </VBtn>\n </template>\n </AFileInput>\n <VBtn\n class=\"mr-2\"\n @click=\"actionLibrary\"\n >\n {{ addFromDamLabel }}\n </VBtn>\n </div>\n <AAssetSelect\n v-model=\"assetSelectDialog\"\n :select-licences=\"selectLicences\"\n :upload-licence=\"uploadLicence\"\n :min-count=\"1\"\n :max-count=\"50\"\n :asset-type=\"DamAssetType.Image\"\n :skip-current-user-check=\"skipCurrentUserCheck\"\n :config-name=\"damConfigName\"\n return-type=\"asset\"\n @confirm=\"onAssetSelectConfirm\"\n >\n <template\n v-if=\"$slots['asset-select-sidebar-prepend']\"\n #sidebar-prepend=\"slotProps\"\n >\n <slot\n name=\"asset-select-sidebar-prepend\"\n v-bind=\"slotProps\"\n />\n </template>\n </AAssetSelect>\n <div\n v-if=\"imagesLoading\"\n class=\"w-100 d-flex align-center justify-center\"\n >\n <VProgressCircular\n indeterminate\n color=\"primary\"\n />\n </div>\n <div\n class=\"position-relative w-100\"\n style=\"min-height: 140px\"\n >\n <ASortableListEditor\n v-if=\"imagesReady\"\n ref=\"listEditor\"\n v-model=\"images\"\n v-model:mode=\"editorMode\"\n :factory=\"createImageStoreItem\"\n get-key=\"key\"\n position=\"position\"\n :show-add-button=\"false\"\n :show-delete-button=\"false\"\n :show-edit-button=\"false\"\n :disable-drag=\"disableDraggable || readonly\"\n :readonly=\"readonly\"\n @reorder-applied=\"onReorderApplied\"\n >\n <template #view-body>\n <div class=\"asset-list-tiles asset-list-tiles--thumbnail a-sortable-widget__group\">\n <ImageWidgetMultipleItem\n v-for=\"(image, index) in images\"\n :key=\"image.key\"\n :index=\"index\"\n :show-source-enabled=\"showSourceEnabled\"\n :source-label=\"sourceLabel\"\n :edit-asset-label=\"editAssetLabel\"\n :author-enabled=\"authorEnabled\"\n :readonly=\"readonly\"\n :config-name=\"damConfigName\"\n @edit-asset=\"onEditAsset\"\n @remove-item=\"removeItem\"\n />\n </div>\n </template>\n <template #item-compact=\"{ raw }\">\n <div class=\"image-widget-multiple-reorder\">\n <div class=\"image-widget-multiple-reorder__thumb\">\n <AImageWidgetSimple\n :model-value=\"raw.id\"\n :image=\"raw\"\n :config-name=\"damConfigName\"\n />\n </div>\n <div class=\"image-widget-multiple-reorder__meta\">\n <div class=\"image-widget-multiple-reorder__title\">\n {{ raw.texts?.description?.trim() || '—' }}\n </div>\n <div\n v-if=\"raw.texts?.source\"\n class=\"image-widget-multiple-reorder__source\"\n >\n {{ raw.texts.source }}\n </div>\n </div>\n </div>\n </template>\n </ASortableListEditor>\n <AImageDropzone\n v-if=\"editorMode === 'view' && !readonly\"\n variant=\"fill\"\n :hover-only=\"modelValue.length > 0 || images.length > 0\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n @drop=\"onDrop\"\n @click=\"uploadButtonComponent?.$el.click()\"\n />\n </div>\n <UploadQueueDialog\n v-if=\"uploadQueueDialog === queueKey && imageWidgetUploadConfig\"\n :queue-key=\"queueKey\"\n :ext-system=\"imageWidgetUploadConfig.extSystem\"\n :licence-id=\"imageWidgetUploadConfig.licence\"\n :file-input-key=\"uploadQueue?.fileInputKey ?? -1\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @apply=\"onAssetUploadConfirm\"\n @files-input=\"onFileInput\"\n @drop=\"onFileInput\"\n />\n <AssetDetailDialog\n v-if=\"assetDialog === queueKey\"\n :queue-key=\"queueKey\"\n :config-name=\"damConfigName\"\n :ext-system=\"cachedExtSystemId\"\n @close=\"onAssetDetailClose\"\n />\n <ImageWidgetMultipleLimitDialog\n ref=\"limitDialogComponent\"\n :queue-key=\"queueKey\"\n @after-add=\"afterLimitDialogAdd\"\n />\n </div>\n</template>\n\n<style lang=\"scss\">\n.image-widget-multiple-reorder {\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n min-height: 100px;\n padding: 4px 0;\n\n &__thumb {\n flex: 0 0 auto;\n width: 200px;\n border-radius: 4px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n\n img {\n width: 100%;\n height: auto;\n display: block;\n }\n }\n\n &__meta {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n &__title {\n font-size: 0.95rem;\n font-weight: 500;\n color: rgb(var(--v-theme-on-surface));\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n &__source {\n font-size: 0.82rem;\n color: rgb(var(--v-theme-on-surface) / 70%);\n margin-top: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n @media (width <= 600px) {\n gap: 8px;\n min-height: 72px;\n\n &__thumb {\n width: 80px;\n }\n\n &__source {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgEA,IAAMmD,IAAQC,GAgCRC,KAAOH,IAIPI,IAAgBC,GAAiBJ,EAAM,UAAU,GAEjDK,IAAoBC,EAAI,EAA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AO,aAAa,KAAI,KAAA,GAAA,GAAA,CAAA,GAGzBA,EAAI,OAAO,UADnBpR,EAAA,GAAAC,EAKM,OALN6C,IAKM5C,EADDkR,EAAI,MAAM,MAAM,GAAA,CAAA,K;;;;;;;G,iBAOrBrC,EAAA,UAAU,UAAA,CAAgB5L,EAAA,YADlCnD,EAAA,GAAAgB,EAQEO,GAAA;;IANA,SAAQ;IACP,cAAY4B,EAAA,WAAW,SAAM,KAAQ9C,EAAA6G,CAAA,CAAM,CAAC,SAAM;IAClD,QAAQ7G,EAAAqP,CAAA;IACR,aAAWrP,EAAAsP,CAAA;IACL;IACN,SAAK,AAAAQ,EAAA,QAAA,MAAEpM,GAAA,OAAuB,IAAI,MAAK;;;;;;GAIpC1D,EAAAgR,CAAA,MAAsBlO,EAAA,YAAY9C,EAAAoD,CAAA,KAD1CzD,EAAA,GAAAgB,EAYEQ,IAAA;;IAVC,aAAW2B,EAAA;IACX,cAAY9C,EAAAoD,CAAA,CAAuB,CAAC;IACpC,cAAYpD,EAAAoD,CAAA,CAAuB,CAAC;IACpC,kBAAgB6D,GAAA,OAAa,gBAAY;IACzC,QAAQjH,EAAAqP,CAAA;IACR,aAAWrP,EAAAsP,CAAA;IACZ,UAAA;IACC,SAAO/D;IACP,cAAalE;IACb,QAAMA;;;;;;;;;GAGDrH,EAAA4K,EAAA,MAAgB9H,EAAA,YADxBnD,EAAA,GAAAgB,EAMES,IAAA;;IAJC,aAAW0B,EAAA;IACX,eAAa9C,EAAAgD,CAAA;IACb,cAAYhD,EAAAkM,CAAA;IACZ,SAAOY;;;;;;GAEVhN,EAIEuB,IAAA;IAHI,SAAA;IAAJ,KAAIoG;IACH,aAAW3E,EAAA;IACX,YAAWiF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageWidgetMultipleItem.js","names":["_sfc_main","ImageWidgetMultipleItem_vue_vue_type_script_setup_true_lang_default","ImageWidgetMultipleItem_default"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport AImageWidgetSimple from '@/domains/dam/imageWidget/components/AImageWidgetSimple.vue'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport { computed, ref } from 'vue'\nimport AFormTextarea from '@/domains/form/components/AFormTextarea.vue'\nimport type { DocId } from '@/shared/types/common'\nimport { isNull, isUndefined } from '@/shared/utils/common'\nimport AActionDeleteButton from '@/domains/ui/buttons/action/components/AActionDeleteButton.vue'\nimport { useI18n } from 'vue-i18n'\nimport { AImageMetadataValidationScopeSymbol, useImageValidation } from '@/domains/dam/composables/uploadValidations'\nimport AuthorRemoteAutocompleteWithCached from '@/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue'\nimport ASystemEntityScope from '@/domains/form/components/ASystemEntityScope.vue'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst props = withDefaults(\n defineProps<{\n index: number\n authorEnabled: boolean\n showSourceEnabled?: boolean\n sourceLabel?: string\n editAssetLabel?: string\n readonly?: boolean\n configName?: string\n }>(),\n {\n readonly: false,\n configName: undefined,\n showSourceEnabled: true,\n sourceLabel: undefined,\n editAssetLabel: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'editAsset', data: DocId): void\n (e: 'removeItem', index: number): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst imageStore = useImageStore()\nconst { t } = useI18n()\n\nconst { cachedExtSystemId } = useExtSystemIdForCached(damConfigName)\nconst authorConflicts = ref<DocId[]>([])\n// `index` comes from the parent's v-for over these same images.\nconst image = computed(() => imageStore.images[props.index]!)\n\nconst imageSourceRequired = computed(() => {\n if (isNull(image.value) || isUndefined(image.value)) return true\n return !(image.value.showDamAuthors && props.authorEnabled)\n})\n\nconst { v$ } = useImageValidation(image, imageSourceRequired, damConfigName)\n\nconst onEditAsset = () => {\n if (isNull(image.value) || isUndefined(image.value)) return\n emit('editAsset', image.value.dam.damId)\n}\n\nconst removeItem = () => {\n emit('removeItem', props.index)\n}\n\n// A typed source belongs to the user, not to a pick. This holds even when the text equals the names a pick wrote.\nconst onSourceTyped = () => {\n if (isNull(image.value) || isUndefined(image.value)) return\n imageStore.forgetSourceOfPick(image.value)\n}\n</script>\n\n<template>\n <div class=\"asset-list-tiles__item\">\n <div class=\"asset-list-tiles__item-card\">\n <div class=\"ma-2\">\n <!-- No reorder controls here: the grid is `#view-body`, which SortableJS never binds to.\n Reordering lives in reorder mode. -->\n <AImageWidgetSimple\n :model-value=\"image.id\"\n :image=\"image\"\n :config-name=\"damConfigName\"\n />\n <VRow density=\"compact\">\n <VCol class=\"d-flex justify-space-between mt-1\">\n <VBtn\n v-if=\"!readonly\"\n variant=\"text\"\n size=\"small\"\n class=\"mb-2\"\n @click.stop=\"onEditAsset\"\n >\n {{ editAssetLabel }}\n </VBtn>\n <AActionDeleteButton\n v-if=\"!readonly\"\n variant=\"icon\"\n :size=\"30\"\n button-class=\"\"\n @delete-record=\"removeItem\"\n />\n </VCol>\n </VRow>\n <!-- `undefined`, not `false`, when editable: the fields then still follow a parent form's readonly and disabled. -->\n <VRow density=\"compact\">\n <VCol>\n <AFormTextarea\n v-model=\"image.texts.description\"\n :readonly=\"readonly || undefined\"\n :label=\"t('common.damImage.image.model.texts.description')\"\n :help=\"t('common.damImage.image.help.texts.description')\"\n :v=\"v$.image?.texts.description\"\n />\n </VCol>\n </VRow>\n <VRow\n v-if=\"image.showDamAuthors && authorEnabled\"\n density=\"compact\"\n >\n <VCol>\n <ASystemEntityScope\n subject=\"author\"\n system=\"dam\"\n >\n <AuthorRemoteAutocompleteWithCached\n v-model=\"image.damAuthors\"\n :disabled=\"readonly || undefined\"\n :ext-system=\"cachedExtSystemId\"\n :label=\"t('common.damImage.asset.model.authors')\"\n :author-conflicts=\"authorConflicts\"\n data-cy=\"custom-field-authors\"\n clearable\n multiple\n :validation-scope=\"AImageMetadataValidationScopeSymbol\"\n />\n </ASystemEntityScope>\n </VCol>\n </VRow>\n <VRow\n v-else\n density=\"compact\"\n >\n <VCol>\n <AFormTextarea\n v-model=\"image.texts.source\"\n :readonly=\"readonly || undefined\"\n :label=\"sourceLabel\"\n :v=\"v$.image?.texts.source\"\n @update:model-value=\"onSourceTyped\"\n />\n </VCol>\n </VRow>\n <VRow v-if=\"showSourceEnabled\">\n <VCol>\n <VSwitch\n v-model=\"image.flags.showSource\"\n :disabled=\"readonly || undefined\"\n :label=\"t('common.damImage.image.model.flags.showSource')\"\n density=\"compact\"\n hide-details\n />\n </VCol>\n </VRow>\n </div>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n.asset-list-tiles--thumbnail.a-sortable-widget__group {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n\n .asset-list-tiles__item {\n flex: 1 1 260px;\n min-width: 260px;\n max-width: 400px;\n\n img:not(.img-svg) {\n padding: 0;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ImageWidgetMultipleItem.js","names":["ImageWidgetMultipleItem_vue_vue_type_script_setup_true_lang_default","ImageWidgetMultipleItem_default"],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createVNode","AImageWidgetSimple","_unref","_component_VRow","_withCtx","_component_VCol","_createBlock","_component_VBtn","_withModifiers","_createTextVNode","_toDisplayString","_createCommentVNode","AActionDeleteButton","AFormTextarea","ASystemEntityScope","AuthorRemoteAutocompleteWithCached","_component_VSwitch","AImageWidgetSimple_default","AFormTextarea_default","AActionDeleteButton_default","AuthorRemoteAutocompleteWithCached_default","ASystemEntityScope_default","_hoisted_1","_hoisted_2","_hoisted_3","ImageWidgetMultipleItem_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","damConfigName","useDamConfigName","imageStore","useImageStore","useI18n","useExtSystemIdForCached","authorConflicts","ref","image","computed","imageSourceRequired","isNull","isUndefined","useImageValidation","onEditAsset","removeItem","onSourceTyped","openBlock","createElementBlock","createElementVNode","createVNode","unref","VRow","withCtx","VCol","createCommentVNode","createBlock","VBtn","withModifiers","createTextVNode","toDisplayString","_cache","$event","t","v$","cachedExtSystemId","AImageMetadataValidationScopeSymbol","VSwitch"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport AImageWidgetSimple from '@/domains/dam/imageWidget/components/AImageWidgetSimple.vue'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport { computed, ref } from 'vue'\nimport AFormTextarea from '@/domains/form/components/AFormTextarea.vue'\nimport type { DocId } from '@/shared/types/common'\nimport { isNull, isUndefined } from '@/shared/utils/common'\nimport AActionDeleteButton from '@/domains/ui/buttons/action/components/AActionDeleteButton.vue'\nimport { useI18n } from 'vue-i18n'\nimport { AImageMetadataValidationScopeSymbol, useImageValidation } from '@/domains/dam/composables/uploadValidations'\nimport AuthorRemoteAutocompleteWithCached from '@/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue'\nimport ASystemEntityScope from '@/domains/form/components/ASystemEntityScope.vue'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst props = withDefaults(\n defineProps<{\n index: number\n authorEnabled: boolean\n showSourceEnabled?: boolean\n sourceLabel?: string\n editAssetLabel?: string\n readonly?: boolean\n configName?: string\n }>(),\n {\n readonly: false,\n configName: undefined,\n showSourceEnabled: true,\n sourceLabel: undefined,\n editAssetLabel: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'editAsset', data: DocId): void\n (e: 'removeItem', index: number): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst imageStore = useImageStore()\nconst { t } = useI18n()\n\nconst { cachedExtSystemId } = useExtSystemIdForCached(damConfigName)\nconst authorConflicts = ref<DocId[]>([])\n// `index` comes from the parent's v-for over these same images.\nconst image = computed(() => imageStore.images[props.index]!)\n\nconst imageSourceRequired = computed(() => {\n if (isNull(image.value) || isUndefined(image.value)) return true\n return !(image.value.showDamAuthors && props.authorEnabled)\n})\n\nconst { v$ } = useImageValidation(image, imageSourceRequired, damConfigName)\n\nconst onEditAsset = () => {\n if (isNull(image.value) || isUndefined(image.value)) return\n emit('editAsset', image.value.dam.damId)\n}\n\nconst removeItem = () => {\n emit('removeItem', props.index)\n}\n\n// A typed source belongs to the user, not to a pick. This holds even when the text equals the names a pick wrote.\nconst onSourceTyped = () => {\n if (isNull(image.value) || isUndefined(image.value)) return\n imageStore.forgetSourceOfPick(image.value)\n}\n</script>\n\n<template>\n <div class=\"asset-list-tiles__item\">\n <div class=\"asset-list-tiles__item-card\">\n <div class=\"ma-2\">\n <!-- No reorder controls here: the grid is `#view-body`, which SortableJS never binds to.\n Reordering lives in reorder mode. -->\n <AImageWidgetSimple\n :model-value=\"image.id\"\n :image=\"image\"\n :config-name=\"damConfigName\"\n />\n <VRow density=\"compact\">\n <VCol class=\"d-flex justify-space-between mt-1\">\n <VBtn\n v-if=\"!readonly\"\n variant=\"text\"\n size=\"small\"\n class=\"mb-2\"\n @click.stop=\"onEditAsset\"\n >\n {{ editAssetLabel }}\n </VBtn>\n <AActionDeleteButton\n v-if=\"!readonly\"\n variant=\"icon\"\n :size=\"30\"\n button-class=\"\"\n @delete-record=\"removeItem\"\n />\n </VCol>\n </VRow>\n <!-- `undefined`, not `false`, when editable: the fields then still follow a parent form's readonly and disabled. -->\n <VRow density=\"compact\">\n <VCol>\n <AFormTextarea\n v-model=\"image.texts.description\"\n :readonly=\"readonly || undefined\"\n :label=\"t('common.damImage.image.model.texts.description')\"\n :help=\"t('common.damImage.image.help.texts.description')\"\n :v=\"v$.image?.texts.description\"\n />\n </VCol>\n </VRow>\n <VRow\n v-if=\"image.showDamAuthors && authorEnabled\"\n density=\"compact\"\n >\n <VCol>\n <ASystemEntityScope\n subject=\"author\"\n system=\"dam\"\n >\n <AuthorRemoteAutocompleteWithCached\n v-model=\"image.damAuthors\"\n :disabled=\"readonly || undefined\"\n :ext-system=\"cachedExtSystemId\"\n :label=\"t('common.damImage.asset.model.authors')\"\n :author-conflicts=\"authorConflicts\"\n data-cy=\"custom-field-authors\"\n clearable\n multiple\n :validation-scope=\"AImageMetadataValidationScopeSymbol\"\n />\n </ASystemEntityScope>\n </VCol>\n </VRow>\n <VRow\n v-else\n density=\"compact\"\n >\n <VCol>\n <AFormTextarea\n v-model=\"image.texts.source\"\n :readonly=\"readonly || undefined\"\n :label=\"sourceLabel\"\n :v=\"v$.image?.texts.source\"\n @update:model-value=\"onSourceTyped\"\n />\n </VCol>\n </VRow>\n <VRow v-if=\"showSourceEnabled\">\n <VCol>\n <VSwitch\n v-model=\"image.flags.showSource\"\n :disabled=\"readonly || undefined\"\n :label=\"t('common.damImage.image.model.flags.showSource')\"\n density=\"compact\"\n hide-details\n />\n </VCol>\n </VRow>\n </div>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n.asset-list-tiles--thumbnail.a-sortable-widget__group {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n\n .asset-list-tiles__item {\n flex: 1 1 260px;\n min-width: 260px;\n max-width: 400px;\n\n img:not(.img-svg) {\n padding: 0;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,IAAM8B,IAAQC,GAmBRC,IAAOH,GAKPI,IAAgBC,EAAiBJ,EAAM,UAAU,GAEjDK,IAAaC,EAAc,GAC3B,EAAE,SAAMC,EAAQ,GAEhB,EAAE,yBAAsBC,EAAwBL,CAAa,GAC7DM,IAAkBC,EAAa,CAAC,CAAC,GAEjCC,IAAQC,QAAeP,EAAW,OAAOL,EAAM,MAAO,GAEtDa,IAAsBD,QACtBE,EAAOH,EA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/B,EAAA,GAAAS,EAUOH,GAAA,EAAA,KAAA,EAAA,GAAA;IATL,SAAAC,QAQO,CARPJ,EAQOK,GAAA,MAAA;KAPL,SAAAD,QAME,CANFJ,EAMEgB,GAAA;MALS,YAAAsB,EAAA,MAAM,MAAM;MAAZ,uBAAA,AAAAuB,EAAA,QAAA,MAAA,EAAA,MAAM,MAAM,aAAUC;MAC9B,UAAUlC,EAAA,YAAY,KAAA;MACtB,OAAO1B,EAAA6D,CAAA,CAAC,CAAA,8CAAA;MACT,SAAQ;MACR,gBAAA"}
1
+ {"version":3,"file":"ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createVNode","AImageWidgetSimple","_unref","_component_VRow","_withCtx","_component_VCol","_createBlock","_component_VBtn","_withModifiers","_createTextVNode","_toDisplayString","AActionDeleteButton","AFormTextarea","ASystemEntityScope","AuthorRemoteAutocompleteWithCached","_component_VSwitch","AImageWidgetSimple_default","AFormTextarea_default","AActionDeleteButton_default","AuthorRemoteAutocompleteWithCached_default","ASystemEntityScope_default","_hoisted_1","_hoisted_2","_hoisted_3","ImageWidgetMultipleItem_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","damConfigName","useDamConfigName","imageStore","useImageStore","useI18n","useExtSystemIdForCached","authorConflicts","ref","image","computed","imageSourceRequired","isNull","isUndefined","useImageValidation","onEditAsset","removeItem","onSourceTyped","openBlock","createElementBlock","createElementVNode","createVNode","unref","VRow","withCtx","VCol","createCommentVNode","createBlock","VBtn","withModifiers","createTextVNode","toDisplayString","_cache","$event","t","v$","cachedExtSystemId","AImageMetadataValidationScopeSymbol","VSwitch"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport AImageWidgetSimple from '@/domains/dam/imageWidget/components/AImageWidgetSimple.vue'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport { computed, ref } from 'vue'\nimport AFormTextarea from '@/domains/form/components/AFormTextarea.vue'\nimport type { DocId } from '@/shared/types/common'\nimport { isNull, isUndefined } from '@/shared/utils/common'\nimport AActionDeleteButton from '@/domains/ui/buttons/action/components/AActionDeleteButton.vue'\nimport { useI18n } from 'vue-i18n'\nimport { AImageMetadataValidationScopeSymbol, useImageValidation } from '@/domains/dam/composables/uploadValidations'\nimport AuthorRemoteAutocompleteWithCached from '@/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue'\nimport ASystemEntityScope from '@/domains/form/components/ASystemEntityScope.vue'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst props = withDefaults(\n defineProps<{\n index: number\n authorEnabled: boolean\n showSourceEnabled?: boolean\n sourceLabel?: string\n editAssetLabel?: string\n readonly?: boolean\n configName?: string\n }>(),\n {\n readonly: false,\n configName: undefined,\n showSourceEnabled: true,\n sourceLabel: undefined,\n editAssetLabel: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'editAsset', data: DocId): void\n (e: 'removeItem', index: number): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst imageStore = useImageStore()\nconst { t } = useI18n()\n\nconst { cachedExtSystemId } = useExtSystemIdForCached(damConfigName)\nconst authorConflicts = ref<DocId[]>([])\n// `index` comes from the parent's v-for over these same images.\nconst image = computed(() => imageStore.images[props.index]!)\n\nconst imageSourceRequired = computed(() => {\n if (isNull(image.value) || isUndefined(image.value)) return true\n return !(image.value.showDamAuthors && props.authorEnabled)\n})\n\nconst { v$ } = useImageValidation(image, imageSourceRequired, damConfigName)\n\nconst onEditAsset = () => {\n if (isNull(image.value) || isUndefined(image.value)) return\n emit('editAsset', image.value.dam.damId)\n}\n\nconst removeItem = () => {\n emit('removeItem', props.index)\n}\n\n// A typed source belongs to the user, not to a pick. This holds even when the text equals the names a pick wrote.\nconst onSourceTyped = () => {\n if (isNull(image.value) || isUndefined(image.value)) return\n imageStore.forgetSourceOfPick(image.value)\n}\n</script>\n\n<template>\n <div class=\"asset-list-tiles__item\">\n <div class=\"asset-list-tiles__item-card\">\n <div class=\"ma-2\">\n <!-- No reorder controls here: the grid is `#view-body`, which SortableJS never binds to.\n Reordering lives in reorder mode. -->\n <AImageWidgetSimple\n :model-value=\"image.id\"\n :image=\"image\"\n :config-name=\"damConfigName\"\n />\n <VRow density=\"compact\">\n <VCol class=\"d-flex justify-space-between mt-1\">\n <VBtn\n v-if=\"!readonly\"\n variant=\"text\"\n size=\"small\"\n class=\"mb-2\"\n @click.stop=\"onEditAsset\"\n >\n {{ editAssetLabel }}\n </VBtn>\n <AActionDeleteButton\n v-if=\"!readonly\"\n variant=\"icon\"\n :size=\"30\"\n button-class=\"\"\n @delete-record=\"removeItem\"\n />\n </VCol>\n </VRow>\n <!-- `undefined`, not `false`, when editable: the fields then still follow a parent form's readonly and disabled. -->\n <VRow density=\"compact\">\n <VCol>\n <AFormTextarea\n v-model=\"image.texts.description\"\n :readonly=\"readonly || undefined\"\n :label=\"t('common.damImage.image.model.texts.description')\"\n :help=\"t('common.damImage.image.help.texts.description')\"\n :v=\"v$.image?.texts.description\"\n />\n </VCol>\n </VRow>\n <VRow\n v-if=\"image.showDamAuthors && authorEnabled\"\n density=\"compact\"\n >\n <VCol>\n <ASystemEntityScope\n subject=\"author\"\n system=\"dam\"\n >\n <AuthorRemoteAutocompleteWithCached\n v-model=\"image.damAuthors\"\n :disabled=\"readonly || undefined\"\n :ext-system=\"cachedExtSystemId\"\n :label=\"t('common.damImage.asset.model.authors')\"\n :author-conflicts=\"authorConflicts\"\n data-cy=\"custom-field-authors\"\n clearable\n multiple\n :validation-scope=\"AImageMetadataValidationScopeSymbol\"\n />\n </ASystemEntityScope>\n </VCol>\n </VRow>\n <VRow\n v-else\n density=\"compact\"\n >\n <VCol>\n <AFormTextarea\n v-model=\"image.texts.source\"\n :readonly=\"readonly || undefined\"\n :label=\"sourceLabel\"\n :v=\"v$.image?.texts.source\"\n @update:model-value=\"onSourceTyped\"\n />\n </VCol>\n </VRow>\n <VRow v-if=\"showSourceEnabled\">\n <VCol>\n <VSwitch\n v-model=\"image.flags.showSource\"\n :disabled=\"readonly || undefined\"\n :label=\"t('common.damImage.image.model.flags.showSource')\"\n density=\"compact\"\n hide-details\n />\n </VCol>\n </VRow>\n </div>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n.asset-list-tiles--thumbnail.a-sortable-widget__group {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n\n .asset-list-tiles__item {\n flex: 1 1 260px;\n min-width: 260px;\n max-width: 400px;\n\n img:not(.img-svg) {\n padding: 0;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,IAAM6B,IAAQC,GAmBRC,IAAOH,GAKPI,IAAgBC,EAAiBJ,EAAM,UAAU,GAEjDK,IAAaC,EAAc,GAC3B,EAAE,SAAMC,EAAQ,GAEhB,EAAE,yBAAsBC,EAAwBL,CAAa,GAC7DM,IAAkBC,EAAa,CAAC,CAAC,GAEjCC,IAAQC,QAAeP,EAAW,OAAOL,EAAM,MAAO,GAEtDa,IAAsBD,QACtBE,EAAOH,EAAM,KAAK,KAAKI,EAAYJ,EAAM,KAAK,IAAU,KACrD,EAAEA,EAAM,MAAM,kBAAkBX,EAAM,cAC9C,GAEK,EAAE,UAAOgB,EAAmBL,GAAOE,GAAqBV,CAAa,GAErEc,UAAoB;GACxB,AAAIH,EAAOH,EAAM,KAAK,KAAKI,EAAYJ,EAAM,KAAK,KAClDT,EAAK,aAAaS,EAAM,MAAM,IAAI,KAAK;EACzC,GAEMO,UAAmB;GACvB,EAAK,cAAclB,EAAM,KAAK;EAChC,GAGMmB,UAAsB;GAC1B,AAAIL,EAAOH,EAAM,KAAK,KAAKI,EAAYJ,EAAM,KAAK,KAClDN,EAAW,mBAAmBM,EAAM,KAAK;EAC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ue_type_script_setup_true_lang_default","ImageWidgetMultipleLimitDialog_default"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport ADialogToolbar from '@/domains/ui/components/ADialogToolbar.vue'\nimport { useI18n } from 'vue-i18n'\nimport { computed, inject, ref, type ShallowRef } from 'vue'\nimport { useUploadQueuesStore } from '@/domains/dam/uploadQueue/store/uploadQueuesStore'\nimport type { UploadQueueKey } from '@/domains/dam/types/UploadQueue'\nimport type { DamConfigLicenceExtSystemReturnType } from '@/domains/dam/types/DamConfig'\nimport { isUndefined } from '@/shared/utils/common'\nimport { ImageWidgetUploadConfigKey } from '@/domains/dam/imageWidget/utils/imageWidgetInkectionKeys'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst props = withDefaults(\n defineProps<{\n queueKey: UploadQueueKey\n }>(),\n {}\n)\n\nconst emit = defineEmits<{\n (e: 'afterAdd'): void\n}>()\n\nconst MAX_UPLOAD_ITEMS = 50\nconst dialog = ref(false)\nconst uploadDialogLoader = ref(false)\nconst fileCache = ref<File[]>([])\n\nconst { t } = useI18n()\n\nconst imageWidgetUploadConfig = inject<ShallowRef<DamConfigLicenceExtSystemReturnType | undefined> | undefined>(\n ImageWidgetUploadConfigKey,\n undefined\n)\n\nif (isUndefined(imageWidgetUploadConfig) || isUndefined(imageWidgetUploadConfig.value)) {\n throw new Error(\"Fatal error, parent component doesn't provide necessary config ext system config.\")\n}\n\nconst uploadQueuesStore = useUploadQueuesStore()\n// Uses the queue of this dialog's widget, so its files go where the widget's own files go.\nconst damConfigName = useDamConfigName()\n\nconst uploadQueueTotalCount = computed(() => {\n return uploadQueuesStore.getQueueTotalCount(props.queueKey)\n})\n\nconst alreadyAtUploadLimit = computed(() => {\n return uploadQueueTotalCount.value === MAX_UPLOAD_ITEMS\n})\n\nconst openDialog = () => {\n dialog.value = true\n}\n\nconst onDialogConfirm = async () => {\n if (isUndefined(imageWidgetUploadConfig) || isUndefined(imageWidgetUploadConfig.value)) {\n return\n }\n uploadDialogLoader.value = true\n const files = fileCache.value.slice(0, MAX_UPLOAD_ITEMS - uploadQueueTotalCount.value)\n await uploadQueuesStore.addByFiles(\n props.queueKey,\n imageWidgetUploadConfig.value.extSystem,\n imageWidgetUploadConfig.value.licence,\n files,\n damConfigName\n )\n fileCache.value = []\n uploadDialogLoader.value = false\n dialog.value = false\n emit('afterAdd')\n}\n\nconst onDialogCancel = () => {\n fileCache.value = []\n uploadQueuesStore.forceReloadFileInput(props.queueKey)\n dialog.value = false\n}\n\nconst checkForLimit = (files: File[]) => {\n fileCache.value = files\n if (files.length + uploadQueueTotalCount.value > MAX_UPLOAD_ITEMS) {\n openDialog()\n return\n }\n onDialogConfirm()\n}\n\ndefineExpose({\n check: checkForLimit,\n})\n</script>\n\n<template>\n <VDialog\n v-model=\"dialog\"\n :width=\"500\"\n @keydown.esc=\"onDialogCancel\"\n >\n <VCard\n v-if=\"dialog\"\n data-cy=\"delete-panel\"\n >\n <ADialogToolbar @cancel=\"onDialogCancel\">\n {{ t('common.damImage.upload.limits.uploadWarning') }}\n </ADialogToolbar>\n <VCardText>\n <p v-if=\"alreadyAtUploadLimit\">\n {{ t('common.damImage.upload.limits.onUploadLimit', { limit: MAX_UPLOAD_ITEMS }) }}\n </p>\n <p v-else>\n {{ t('common.damImage.upload.limits.addingOverLimit', { count: fileCache.length }) }}\n <span v-if=\"uploadQueueTotalCount > 0\">{{\n t('common.damImage.upload.limits.countAlreadyInProgress', {\n count: uploadQueueTotalCount,\n })\n }}</span>\n {{ t('common.damImage.upload.limits.onlyAllowedAtOnce', { count: MAX_UPLOAD_ITEMS }) }}<br /><br />\n {{\n t('common.damImage.upload.limits.cancelOrUploadFirst', {\n count: MAX_UPLOAD_ITEMS - uploadQueueTotalCount,\n })\n }}\n </p>\n </VCardText>\n <VCardActions>\n <VSpacer />\n <ABtnTertiary @click.stop=\"onDialogCancel\">\n {{ t('common.button.cancel') }}\n </ABtnTertiary>\n <ABtnPrimary\n v-if=\"!alreadyAtUploadLimit\"\n :loading=\"uploadDialogLoader\"\n @click.stop=\"onDialogConfirm\"\n >\n {{\n t('common.damImage.upload.limits.actionAddFirstItems', {\n count: MAX_UPLOAD_ITEMS - uploadQueueTotalCount,\n })\n }}\n </ABtnPrimary>\n </VCardActions>\n </VCard>\n </VDialog>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ImageWidgetMultipleLimitDialog.js","names":["ImageWidgetMultipleLimitDialog_vue_vue_type_script_setup_true_lang_default","ImageWidgetMultipleLimitDialog_default"],"sources":[],"mappings":""}