@vidispine/vdt-materialui 23.2.0-pre.2 → 23.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (743) hide show
  1. package/dist/cjs/ConfirmationDialog.js +1 -0
  2. package/dist/cjs/LayoutButtonGroup.js +1 -0
  3. package/dist/cjs/SplitButton.js +1 -0
  4. package/dist/cjs/Theme.js +1 -0
  5. package/dist/cjs/TreeItemDraggable.js +1 -0
  6. package/dist/cjs/analyze/BatonAnalysisDialog.js +1 -0
  7. package/dist/cjs/analyze/BatonAnalysisForm.js +1 -0
  8. package/dist/cjs/collection/AddToCollectionDialog/AddToCollectionDialog.js +1 -0
  9. package/dist/cjs/collection/AddToCollectionDialog/index.js +1 -0
  10. package/dist/cjs/collection/CollectionAccessTab.js +1 -0
  11. package/dist/cjs/collection/CollectionCard/CollectionCard.js +1 -0
  12. package/dist/cjs/collection/CollectionCard/components/CollectionAvatar.js +1 -0
  13. package/dist/cjs/collection/CollectionCard/index.js +1 -0
  14. package/dist/cjs/collection/CollectionCardThumbnail/CollectionCardThumbnail.js +1 -0
  15. package/dist/cjs/collection/CollectionCardThumbnail/index.js +1 -0
  16. package/dist/cjs/collection/CollectionContent/CollectionContent.js +1 -0
  17. package/dist/cjs/collection/CollectionContent/components/CollectionContentCollection.js +1 -0
  18. package/dist/cjs/collection/CollectionContent/components/CollectionContentEntity.js +1 -0
  19. package/dist/cjs/collection/CollectionContent/components/CollectionContentItem.js +1 -0
  20. package/dist/cjs/collection/CollectionContent/components/CollectionContentSkeleton.js +1 -0
  21. package/dist/cjs/collection/CollectionContent/index.js +1 -0
  22. package/dist/cjs/collection/CollectionCreateDialog/CollectionCreateDialog.js +1 -0
  23. package/dist/cjs/collection/CollectionCreateDialog/index.js +1 -0
  24. package/dist/cjs/collection/CollectionGrid/CollectionGrid.js +1 -0
  25. package/dist/cjs/collection/CollectionGrid/index.js +1 -0
  26. package/dist/cjs/collection/CollectionLabel.js +1 -0
  27. package/dist/cjs/collection/CollectionList/CollectionList.js +1 -0
  28. package/dist/cjs/collection/CollectionList/index.js +1 -0
  29. package/dist/cjs/collection/CollectionListItem/CollectionListItem.js +1 -0
  30. package/dist/cjs/collection/CollectionListItem/index.js +1 -0
  31. package/dist/cjs/collection/CollectionMetadataEdit.js +1 -0
  32. package/dist/cjs/collection/CollectionMetadataTab.js +1 -0
  33. package/dist/cjs/collection/CollectionRow/CollectionRow.js +1 -0
  34. package/dist/cjs/collection/CollectionRow/index.js +1 -0
  35. package/dist/cjs/collection/CollectionSearchPicker/CollectionSearchPicker.js +1 -0
  36. package/dist/cjs/collection/CollectionSearchPicker/index.js +1 -0
  37. package/dist/cjs/collection/CollectionTable/CollectionTable.js +1 -0
  38. package/dist/cjs/collection/CollectionTable/index.js +1 -0
  39. package/dist/cjs/collection/CollectionTreeList/CollectionTreeList.js +1 -0
  40. package/dist/cjs/collection/CollectionTreeList/components/CollectionLabelDroppable.js +1 -0
  41. package/dist/cjs/collection/CollectionTreeList/index.js +1 -0
  42. package/dist/cjs/collection/RemoveFromCollectionDialog/RemoveFromCollectionDialog.js +1 -0
  43. package/dist/cjs/collection/RemoveFromCollectionDialog/index.js +1 -0
  44. package/dist/cjs/contexts/MediaCardContext.js +1 -0
  45. package/dist/cjs/dnd/components/DragLayer.js +1 -0
  46. package/dist/cjs/dnd/contexts/DragAndDropContext.js +1 -0
  47. package/dist/cjs/dnd/hoc/withDrag.js +1 -0
  48. package/dist/cjs/dnd/hoc/withDrop.js +1 -0
  49. package/dist/cjs/dnd/hooks/useDragOffsetDiff.js +1 -0
  50. package/dist/cjs/dnd/utils/extractEntityInfo.js +1 -0
  51. package/dist/cjs/entity/BinList/BinList.js +1 -0
  52. package/dist/cjs/entity/BinList/index.js +1 -0
  53. package/dist/cjs/entity/BinListMenu/BinListMenu.js +1 -0
  54. package/dist/cjs/entity/BinListMenu/index.js +1 -0
  55. package/dist/cjs/entity/EntityAccessAdd.js +1 -0
  56. package/dist/cjs/entity/EntityAccessTable.js +1 -0
  57. package/dist/cjs/entity/EntityCard/EntityCard.js +1 -0
  58. package/dist/cjs/entity/EntityCard/index.js +1 -0
  59. package/dist/cjs/entity/EntityComment.js +1 -0
  60. package/dist/cjs/entity/EntityCommentCard.js +1 -0
  61. package/dist/cjs/entity/EntityDeleteDialog/EntityDeleteDialog.js +1 -0
  62. package/dist/cjs/entity/EntityDeleteDialog/index.js +1 -0
  63. package/dist/cjs/entity/EntityGrid.js +1 -0
  64. package/dist/cjs/entity/EntityGridItem.js +1 -0
  65. package/dist/cjs/entity/EntityGridItemDraggable.js +1 -0
  66. package/dist/cjs/entity/EntityTable.js +1 -0
  67. package/dist/cjs/entity/EntityTableRow.js +1 -0
  68. package/dist/cjs/entity/EntityTableRowDraggable.js +1 -0
  69. package/dist/cjs/entity/EntityTree.js +2 -0
  70. package/dist/cjs/entity/EntityTreeConsts.js +1 -0
  71. package/dist/cjs/entity/EntityTreeContext.js +1 -0
  72. package/dist/cjs/entity/EntityTreeList.js +1 -0
  73. package/dist/cjs/events/Event/Event.js +1 -0
  74. package/dist/cjs/events/Event/index.js +1 -0
  75. package/dist/cjs/events/EventContainer/EventContainer.js +1 -0
  76. package/dist/cjs/events/EventContainer/index.js +1 -0
  77. package/dist/cjs/events/EventMarker/EventMarker.js +1 -0
  78. package/dist/cjs/events/EventMarker/index.js +1 -0
  79. package/dist/cjs/events/EventMarkerThumbnail/EventMarkerThumbnail.js +1 -0
  80. package/dist/cjs/events/EventMarkerThumbnail/index.js +1 -0
  81. package/dist/cjs/events/EventMarkerTimeline/EventMarkerTimeline.js +1 -0
  82. package/dist/cjs/events/EventMarkerTimeline/index.js +1 -0
  83. package/dist/cjs/events/EventTimeline/EventTimeline.js +1 -0
  84. package/dist/cjs/events/EventTimeline/index.js +1 -0
  85. package/dist/cjs/fieldgroup/Editor.js +1 -0
  86. package/dist/cjs/fieldgroup/FieldGroupDesigner.js +1 -0
  87. package/dist/cjs/fieldgroup/FieldIcon.js +1 -0
  88. package/dist/cjs/fieldgroup/MyField.js +1 -0
  89. package/dist/cjs/fieldgroup/MyFieldList.js +1 -0
  90. package/dist/cjs/fields/AutocompleteConstraintField.js +1 -0
  91. package/dist/cjs/fields/AutocompleteField.js +1 -0
  92. package/dist/cjs/fields/CheckboxField.js +1 -0
  93. package/dist/cjs/fields/CheckboxGroupField.js +1 -0
  94. package/dist/cjs/fields/DateField.js +1 -0
  95. package/dist/cjs/fields/Field.js +1 -0
  96. package/dist/cjs/fields/RadioField.js +1 -0
  97. package/dist/cjs/fields/SelectField.js +1 -0
  98. package/dist/cjs/fields/SliderField.js +1 -0
  99. package/dist/cjs/fields/SwitchField.js +1 -0
  100. package/dist/cjs/fields/TagField.js +1 -0
  101. package/dist/cjs/fields/TextField.js +1 -0
  102. package/dist/cjs/filter/FilterCard.js +1 -0
  103. package/dist/cjs/filter/FilterForm.js +1 -0
  104. package/dist/cjs/filter/FilterFormLabel.js +1 -0
  105. package/dist/cjs/forms/ExpandedFormControlLabel.js +1 -0
  106. package/dist/cjs/forms/LoginForm/LoginForm.js +1 -0
  107. package/dist/cjs/forms/LoginForm/index.js +1 -0
  108. package/dist/cjs/forms/SubmitButton.js +1 -0
  109. package/dist/cjs/forms/onGetToken.js +1 -0
  110. package/dist/cjs/general/DragScroll/DragScroll.js +1 -0
  111. package/dist/cjs/general/DragScroll/index.js +1 -0
  112. package/dist/cjs/general/ImageCollage/ImageCollage.js +1 -0
  113. package/dist/cjs/general/ImageCollage/index.js +1 -0
  114. package/dist/cjs/general/MimeTypeIcon/MimeTypeIcon.js +1 -0
  115. package/dist/cjs/general/MimeTypeIcon/index.js +1 -0
  116. package/dist/cjs/general/SelectedToolbar/SelectedToolbar.js +1 -0
  117. package/dist/cjs/general/SelectedToolbar/index.js +1 -0
  118. package/dist/cjs/group/CreateGroupDialog/CreateGroupDialog.js +1 -0
  119. package/dist/cjs/group/CreateGroupDialog/components/CreateGroupForm.js +1 -0
  120. package/dist/cjs/group/CreateGroupDialog/index.js +1 -0
  121. package/dist/cjs/group/EditGroupDialog/EditGroupDialog.js +1 -0
  122. package/dist/cjs/group/EditGroupDialog/components/EditGroupForm.js +1 -0
  123. package/dist/cjs/group/EditGroupDialog/index.js +1 -0
  124. package/dist/cjs/group/GroupDetails/GroupDetails.js +1 -0
  125. package/dist/cjs/group/GroupDetails/components/GroupData.js +1 -0
  126. package/dist/cjs/group/GroupDetails/components/GroupMenu.js +1 -0
  127. package/dist/cjs/group/GroupDetails/index.js +1 -0
  128. package/dist/cjs/group/GroupRelationList/GroupRelationList.js +1 -0
  129. package/dist/cjs/group/GroupRelationList/index.js +1 -0
  130. package/dist/cjs/group/GroupTable/GroupTable.js +1 -0
  131. package/dist/cjs/group/GroupTable/components/GroupRow.js +1 -0
  132. package/dist/cjs/group/GroupTable/index.js +1 -0
  133. package/dist/cjs/hooks/useComments.js +1 -0
  134. package/dist/cjs/hooks/useConfirmationDialog.js +1 -0
  135. package/dist/cjs/hooks/useExpand.js +1 -0
  136. package/dist/cjs/hooks/useMenu.js +1 -0
  137. package/dist/cjs/hooks/useSnackbarAlert.js +1 -0
  138. package/dist/cjs/icons/BitmovinIcon.js +1 -0
  139. package/dist/cjs/icons/FolderMultipleIcon.js +1 -0
  140. package/dist/cjs/icons/MediaConvertIcon.js +1 -0
  141. package/dist/cjs/icons/VidispineIcon.js +1 -0
  142. package/dist/cjs/icons/bitmovin_24.svg.js +1 -0
  143. package/dist/cjs/icons/foldermultiple_24.svg.js +1 -0
  144. package/dist/cjs/icons/mediaconvert_24.svg.js +1 -0
  145. package/dist/cjs/icons/vidispine_24.svg.js +1 -0
  146. package/dist/cjs/item/AddRelationDialog.js +1 -0
  147. package/dist/cjs/item/ItemAccessTab.js +1 -0
  148. package/dist/cjs/item/ItemCard.js +1 -0
  149. package/dist/cjs/item/ItemCompoundMetadataTab.js +1 -0
  150. package/dist/cjs/item/ItemCompoundMetadataTable.js +1 -0
  151. package/dist/cjs/item/ItemFieldGroupTab.js +1 -0
  152. package/dist/cjs/item/ItemFileShareDialog.js +2 -0
  153. package/dist/cjs/item/ItemGrid.js +1 -0
  154. package/dist/cjs/item/ItemGridDroppable.js +1 -0
  155. package/dist/cjs/item/ItemLabel.js +1 -0
  156. package/dist/cjs/item/ItemLabelDroppable.js +1 -0
  157. package/dist/cjs/item/ItemList/ItemList.js +1 -0
  158. package/dist/cjs/item/ItemList/index.js +1 -0
  159. package/dist/cjs/item/ItemListItem/ItemListItem.js +1 -0
  160. package/dist/cjs/item/ItemListItem/index.js +1 -0
  161. package/dist/cjs/item/ItemMetadataEdit.js +1 -0
  162. package/dist/cjs/item/ItemMetadataFieldRow.js +1 -0
  163. package/dist/cjs/item/ItemMetadataForm.js +1 -0
  164. package/dist/cjs/item/ItemMetadataFormTable.js +1 -0
  165. package/dist/cjs/item/ItemMetadataList.js +1 -0
  166. package/dist/cjs/item/ItemMetadataListFieldGroupItem.js +1 -0
  167. package/dist/cjs/item/ItemMetadataListFieldItem.js +1 -0
  168. package/dist/cjs/item/ItemMetadataTab.js +1 -0
  169. package/dist/cjs/item/ItemMetadataTable.js +1 -0
  170. package/dist/cjs/item/ItemParentsTab.js +1 -0
  171. package/dist/cjs/item/ItemPoster.js +1 -0
  172. package/dist/cjs/item/ItemPosterDialog.js +1 -0
  173. package/dist/cjs/item/ItemPosterList.js +1 -0
  174. package/dist/cjs/item/ItemPosterTab.js +1 -0
  175. package/dist/cjs/item/ItemRelationRemoveDialog.js +2 -0
  176. package/dist/cjs/item/ItemRelationsTab.js +1 -0
  177. package/dist/cjs/item/ItemRow.js +1 -0
  178. package/dist/cjs/item/ItemSearchPicker.js +1 -0
  179. package/dist/cjs/item/ItemShapeTab.js +1 -0
  180. package/dist/cjs/item/ItemShapeTable/ItemShapeTable.js +1 -0
  181. package/dist/cjs/item/ItemShapeTable/components/ItemShapeMenu.js +1 -0
  182. package/dist/cjs/item/ItemShapeTable/components/ItemShapeRow.js +1 -0
  183. package/dist/cjs/item/ItemShapeTable/index.js +1 -0
  184. package/dist/cjs/item/ItemSidecarDialog/ItemSidecarDialog.js +1 -0
  185. package/dist/cjs/item/ItemSidecarDialog/index.js +1 -0
  186. package/dist/cjs/item/ItemSidecarDownload/ItemSidecarDownload.js +1 -0
  187. package/dist/cjs/item/ItemSidecarDownload/index.js +1 -0
  188. package/dist/cjs/item/ItemSidecarUpload/ItemSidecarUpload.js +1 -0
  189. package/dist/cjs/item/ItemSidecarUpload/index.js +1 -0
  190. package/dist/cjs/item/ItemSourceTab.js +1 -0
  191. package/dist/cjs/item/ItemSourceTable/ItemSourceTable.js +1 -0
  192. package/dist/cjs/item/ItemSourceTable/components/AudioComponentTypeTableBody.js +1 -0
  193. package/dist/cjs/item/ItemSourceTable/components/ContainerComponentTypeTableBody.js +1 -0
  194. package/dist/cjs/item/ItemSourceTable/components/FileTypeTableBody.js +1 -0
  195. package/dist/cjs/item/ItemSourceTable/components/ImageTypeTableBody.js +1 -0
  196. package/dist/cjs/item/ItemSourceTable/components/MetadataTypeTableBody.js +1 -0
  197. package/dist/cjs/item/ItemSourceTable/components/PdfTypeTableBody.js +1 -0
  198. package/dist/cjs/item/ItemSourceTable/components/ShapeTypeTableBody.js +1 -0
  199. package/dist/cjs/item/ItemSourceTable/components/TableHead.js +1 -0
  200. package/dist/cjs/item/ItemSourceTable/components/TableRow.js +1 -0
  201. package/dist/cjs/item/ItemSourceTable/components/VideoComponentTypeTableBody.js +1 -0
  202. package/dist/cjs/item/ItemSourceTable/index.js +1 -0
  203. package/dist/cjs/item/ItemTable.js +1 -0
  204. package/dist/cjs/item/ItemTabs/ItemTabs.js +1 -0
  205. package/dist/cjs/item/ItemTabs/components/Tab.js +1 -0
  206. package/dist/cjs/item/ItemTabs/components/TabPanel.js +1 -0
  207. package/dist/cjs/item/ItemTabs/components/Tabs.js +1 -0
  208. package/dist/cjs/item/ItemTabs/index.js +1 -0
  209. package/dist/cjs/item/ItemTimespan/ItemTimespan.js +1 -0
  210. package/dist/cjs/item/ItemTimespan/components/ConfidenceSlider.js +1 -0
  211. package/dist/cjs/item/ItemTimespan/components/EditButton.js +1 -0
  212. package/dist/cjs/item/ItemTimespan/components/ItemTimespanBox.js +1 -0
  213. package/dist/cjs/item/ItemTimespan/components/ItemTimespanEdit.js +1 -0
  214. package/dist/cjs/item/ItemTimespan/components/ItemTimespanForm.js +1 -0
  215. package/dist/cjs/item/ItemTimespan/components/ItemTimespanInterval.js +1 -0
  216. package/dist/cjs/item/ItemTimespan/components/ItemTimespanList.js +1 -0
  217. package/dist/cjs/item/ItemTimespan/components/ItemTimespanSearchInput.js +1 -0
  218. package/dist/cjs/item/ItemTimespan/components/ItemTimespanSelection.js +1 -0
  219. package/dist/cjs/item/ItemTimespan/hooks/useConfidenceSlider.js +1 -0
  220. package/dist/cjs/item/ItemTimespan/hooks/useItemTimespan.js +1 -0
  221. package/dist/cjs/item/ItemTimespan/hooks/useItemTimespanBox.js +1 -0
  222. package/dist/cjs/item/ItemTimespan/hooks/useItemTimespanBoxEdit.js +1 -0
  223. package/dist/cjs/item/ItemTimespan/hooks/useItemTimespanEdit.js +1 -0
  224. package/dist/cjs/item/ItemTimespan/hooks/useItemTimespanInterval.js +1 -0
  225. package/dist/cjs/item/ItemTimespan/hooks/useItemTimespanList.js +1 -0
  226. package/dist/cjs/item/ItemTimespan/index.js +1 -0
  227. package/dist/cjs/item/ItemTimespan/utils/filterTimespanList.js +1 -0
  228. package/dist/cjs/item/ItemTimespan/utils/findActiveTimespanIndex.js +1 -0
  229. package/dist/cjs/item/ItemTimespan/utils/parseTimespanList.js +1 -0
  230. package/dist/cjs/item/ItemTimespanTab.js +1 -0
  231. package/dist/cjs/item/ItemTreeItem.js +1 -0
  232. package/dist/cjs/item/player/ItemAudioPlayer.js +1 -0
  233. package/dist/cjs/item/player/ItemImagePlayer.js +1 -0
  234. package/dist/cjs/item/player/ItemPlayer/ItemPlayer.js +1 -0
  235. package/dist/cjs/item/player/ItemPlayer/index.js +1 -0
  236. package/dist/cjs/item/player/ItemVideoPlayer.js +1 -0
  237. package/dist/cjs/job/JobCard.js +1 -0
  238. package/dist/cjs/job/JobDataTable.js +1 -0
  239. package/dist/cjs/job/JobFooter.js +1 -0
  240. package/dist/cjs/job/JobFooterContext.js +1 -0
  241. package/dist/cjs/job/JobList.js +1 -0
  242. package/dist/cjs/job/JobRow.js +1 -0
  243. package/dist/cjs/job/JobRowButton.js +1 -0
  244. package/dist/cjs/job/JobSelectForm.js +1 -0
  245. package/dist/cjs/job/JobTable.js +1 -0
  246. package/dist/cjs/job/JobTaskTable.js +1 -0
  247. package/dist/cjs/job/const.js +1 -0
  248. package/dist/cjs/mapStringsBooleans.js +1 -0
  249. package/dist/cjs/media/MediaBadge.js +1 -0
  250. package/dist/cjs/media/MediaBadges.js +1 -0
  251. package/dist/cjs/media/MediaCard/MediaCard.js +1 -0
  252. package/dist/cjs/media/MediaCard/index.js +1 -0
  253. package/dist/cjs/media/MediaCardActions.js +1 -0
  254. package/dist/cjs/media/MediaCardAvatar/MediaCardAvatar.js +1 -0
  255. package/dist/cjs/media/MediaCardAvatar/index.js +1 -0
  256. package/dist/cjs/media/MediaCardCard.js +1 -0
  257. package/dist/cjs/media/MediaCardCheckbox.js +1 -0
  258. package/dist/cjs/media/MediaCardContent.js +1 -0
  259. package/dist/cjs/media/MediaCardDurationLabel.js +1 -0
  260. package/dist/cjs/media/MediaCardFullWidth/MediaCardFullWidth.js +1 -0
  261. package/dist/cjs/media/MediaCardFullWidth/components/MediaCardExpand.js +1 -0
  262. package/dist/cjs/media/MediaCardFullWidth/components/MediaCardFullWidthCard.js +1 -0
  263. package/dist/cjs/media/MediaCardFullWidth/components/MediaCardFullWidthContent.js +1 -0
  264. package/dist/cjs/media/MediaCardFullWidth/components/MediaCardFullWidthHeader.js +1 -0
  265. package/dist/cjs/media/MediaCardFullWidth/index.js +1 -0
  266. package/dist/cjs/media/MediaCardHeader.js +1 -0
  267. package/dist/cjs/media/MediaCardMenu.js +1 -0
  268. package/dist/cjs/media/MediaCardThumbnail/MediaCardThumbnail.js +1 -0
  269. package/dist/cjs/media/MediaCardThumbnail/index.js +1 -0
  270. package/dist/cjs/media/MediaCardThumbnailLabel/MediaCardThumbnailLabel.js +1 -0
  271. package/dist/cjs/media/MediaCardThumbnailLabel/index.js +1 -0
  272. package/dist/cjs/search/Pagination.js +1 -0
  273. package/dist/cjs/search/PaginationActions.js +1 -0
  274. package/dist/cjs/search/SavedSearch/SaveSearchForm.js +1 -0
  275. package/dist/cjs/search/SavedSearch/SavedSearch.js +1 -0
  276. package/dist/cjs/search/SavedSearch/SavedSearchAccessList.js +1 -0
  277. package/dist/cjs/search/SavedSearch/SavedSearchList.js +1 -0
  278. package/dist/cjs/search/SavedSearch/SavedSearchRow.js +1 -0
  279. package/dist/cjs/search/SavedSearch/ShareSearch.js +1 -0
  280. package/dist/cjs/search/SavedSearch/index.js +1 -0
  281. package/dist/cjs/search/SavedSearchFolder/AddFolderRow.js +1 -0
  282. package/dist/cjs/search/SavedSearchFolder/FolderRow.js +1 -0
  283. package/dist/cjs/search/SavedSearchFolder/index.js +1 -0
  284. package/dist/cjs/search/SearchField/SearchField.js +1 -0
  285. package/dist/cjs/search/SearchField/index.js +1 -0
  286. package/dist/cjs/search/SearchInput/SearchInput.js +1 -0
  287. package/dist/cjs/search/SearchInput/index.js +1 -0
  288. package/dist/cjs/search/SearchInputFieldSelect.js +1 -0
  289. package/dist/cjs/search/SearchResultRow.js +1 -0
  290. package/dist/cjs/search/SearchResultTable.js +1 -0
  291. package/dist/cjs/search/SearchSuggestions.js +1 -0
  292. package/dist/cjs/search/Sort/Sort.js +1 -0
  293. package/dist/cjs/search/Sort/index.js +1 -0
  294. package/dist/cjs/search/SortMenuItem.js +1 -0
  295. package/dist/cjs/search/SpellCheck/SpellCheck.js +1 -0
  296. package/dist/cjs/search/SpellCheck/index.js +1 -0
  297. package/dist/cjs/search/querybuilder/QueryBetween/QueryBetween.js +1 -0
  298. package/dist/cjs/search/querybuilder/QueryBetween/index.js +1 -0
  299. package/dist/cjs/search/querybuilder/QueryBuilder/QueryBuilder.js +1 -0
  300. package/dist/cjs/search/querybuilder/QueryBuilder/index.js +1 -0
  301. package/dist/cjs/search/querybuilder/QueryBuilderCard/QueryBuilderCard.js +1 -0
  302. package/dist/cjs/search/querybuilder/QueryBuilderCard/index.js +1 -0
  303. package/dist/cjs/search/querybuilder/QueryBuilderContext.js +1 -0
  304. package/dist/cjs/search/querybuilder/QueryContains/QueryContains.js +1 -0
  305. package/dist/cjs/search/querybuilder/QueryContains/index.js +1 -0
  306. package/dist/cjs/search/querybuilder/QueryEntry/QueryEntry.js +1 -0
  307. package/dist/cjs/search/querybuilder/QueryEntry/index.js +1 -0
  308. package/dist/cjs/search/querybuilder/QueryEquals/QueryEquals.js +1 -0
  309. package/dist/cjs/search/querybuilder/QueryEquals/index.js +1 -0
  310. package/dist/cjs/search/querybuilder/QueryField/QueryField.js +1 -0
  311. package/dist/cjs/search/querybuilder/QueryField/index.js +1 -0
  312. package/dist/cjs/search/querybuilder/QueryGroup/QueryGroup.js +1 -0
  313. package/dist/cjs/search/querybuilder/QueryGroup/index.js +1 -0
  314. package/dist/cjs/search/querybuilder/QueryInput/QueryInput.js +1 -0
  315. package/dist/cjs/search/querybuilder/QueryInput/index.js +1 -0
  316. package/dist/cjs/search/querybuilder/QueryOperator/QueryOperator.js +1 -0
  317. package/dist/cjs/search/querybuilder/QueryOperator/index.js +1 -0
  318. package/dist/cjs/storage/StorageListTree.js +1 -0
  319. package/dist/cjs/storage/components/FileTree.js +1 -0
  320. package/dist/cjs/storage/components/FileTreeLabel.js +1 -0
  321. package/dist/cjs/storage/components/FolderTree.js +1 -0
  322. package/dist/cjs/storage/components/FolderTreeLabel.js +1 -0
  323. package/dist/cjs/storage/components/SelectedEntityWrapper.js +1 -0
  324. package/dist/cjs/storage/components/SelectedFile.js +1 -0
  325. package/dist/cjs/storage/components/SelectedFileWrapper.js +1 -0
  326. package/dist/cjs/storage/components/SelectedStorage.js +1 -0
  327. package/dist/cjs/storage/components/SelectedStorageWrapper.js +1 -0
  328. package/dist/cjs/storage/components/Storage.js +1 -0
  329. package/dist/cjs/storage/components/StorageList.js +1 -0
  330. package/dist/cjs/storage/components/StorageTree.js +1 -0
  331. package/dist/cjs/storage/const.js +1 -0
  332. package/dist/cjs/storage/hooks/useFileList.js +1 -0
  333. package/dist/cjs/storage/hooks/useSelectedFile.js +1 -0
  334. package/dist/cjs/storage/hooks/useSelectedStorage.js +1 -0
  335. package/dist/cjs/storage/hooks/useStorageList.js +1 -0
  336. package/dist/cjs/storage/hooks/useTreeView.js +1 -0
  337. package/dist/cjs/transcode/ShapeTagCard.js +1 -0
  338. package/dist/cjs/transcode/ShapeTagListAccordion.js +1 -0
  339. package/dist/cjs/transcode/TranscodeDialog.js +1 -0
  340. package/dist/cjs/upload/FileTree.js +1 -0
  341. package/dist/cjs/upload/Upload.js +1 -0
  342. package/dist/cjs/upload/UploadEditor.js +1 -0
  343. package/dist/cjs/upload/UploadForm.js +1 -0
  344. package/dist/cjs/upload/UploadListFolder.js +1 -0
  345. package/dist/cjs/upload/UploadListItem.js +1 -0
  346. package/dist/cjs/user/ChangePasswordDialog.js +1 -0
  347. package/dist/cjs/user/ChangePasswordForm.js +1 -0
  348. package/dist/cjs/user/ChangeUserPasswordDialog/ChangeUserPasswordDialog.js +1 -0
  349. package/dist/cjs/user/ChangeUserPasswordDialog/components/PasswordField.js +1 -0
  350. package/dist/cjs/user/ChangeUserPasswordDialog/components/UserPasswordForm.js +1 -0
  351. package/dist/cjs/user/ChangeUserPasswordDialog/index.js +1 -0
  352. package/dist/cjs/user/CreateUserDialog/CreateUserDialog.js +1 -0
  353. package/dist/cjs/user/CreateUserDialog/components/CreateUserForm.js +1 -0
  354. package/dist/cjs/user/CreateUserDialog/index.js +1 -0
  355. package/dist/cjs/user/EditUserDialog/EditUserDialog.js +1 -0
  356. package/dist/cjs/user/EditUserDialog/components/EditUserForm.js +1 -0
  357. package/dist/cjs/user/EditUserDialog/index.js +1 -0
  358. package/dist/cjs/user/UserAvatarButton/UserAvatarButton.js +1 -0
  359. package/dist/cjs/user/UserAvatarButton/index.js +1 -0
  360. package/dist/cjs/user/UserDetails/UserDetails.js +1 -0
  361. package/dist/cjs/user/UserDetails/components/UserData.js +1 -0
  362. package/dist/cjs/user/UserDetails/components/UserMenu.js +1 -0
  363. package/dist/cjs/user/UserDetails/index.js +1 -0
  364. package/dist/cjs/user/UserRelationList/UserRelationList.js +1 -0
  365. package/dist/cjs/user/UserRelationList/index.js +1 -0
  366. package/dist/cjs/user/UserTable/UserTable.js +1 -0
  367. package/dist/cjs/user/UserTable/components/UserRow.js +1 -0
  368. package/dist/cjs/user/UserTable/index.js +1 -0
  369. package/dist/cjs/utils.js +1 -0
  370. package/dist/es/ConfirmationDialog.js +24 -0
  371. package/dist/es/LayoutButtonGroup.js +43 -0
  372. package/dist/es/SplitButton.js +54 -0
  373. package/dist/es/Theme.js +56 -0
  374. package/dist/es/TreeItemDraggable.js +15 -0
  375. package/dist/es/analyze/BatonAnalysisDialog.js +256 -0
  376. package/dist/es/analyze/BatonAnalysisForm.js +164 -0
  377. package/dist/es/collection/AddToCollectionDialog/AddToCollectionDialog.js +186 -0
  378. package/dist/es/collection/AddToCollectionDialog/index.js +7 -0
  379. package/dist/es/collection/CollectionAccessTab.js +56 -0
  380. package/dist/es/collection/CollectionCard/CollectionCard.js +87 -0
  381. package/dist/es/collection/CollectionCard/components/CollectionAvatar.js +9 -0
  382. package/dist/es/collection/CollectionCard/index.js +7 -0
  383. package/dist/es/collection/CollectionCardThumbnail/CollectionCardThumbnail.js +107 -0
  384. package/dist/es/collection/CollectionCardThumbnail/index.js +9 -0
  385. package/dist/es/collection/CollectionContent/CollectionContent.js +147 -0
  386. package/dist/es/collection/CollectionContent/components/CollectionContentCollection.js +160 -0
  387. package/dist/es/collection/CollectionContent/components/CollectionContentEntity.js +68 -0
  388. package/dist/es/collection/CollectionContent/components/CollectionContentItem.js +290 -0
  389. package/dist/es/collection/CollectionContent/components/CollectionContentSkeleton.js +104 -0
  390. package/dist/es/collection/CollectionContent/index.js +7 -0
  391. package/dist/es/collection/CollectionCreateDialog/CollectionCreateDialog.js +99 -0
  392. package/dist/es/collection/CollectionCreateDialog/index.js +7 -0
  393. package/dist/es/collection/CollectionGrid/CollectionGrid.js +83 -0
  394. package/dist/es/collection/CollectionGrid/index.js +7 -0
  395. package/dist/es/collection/CollectionLabel.js +28 -0
  396. package/dist/es/collection/CollectionList/CollectionList.js +51 -0
  397. package/dist/es/collection/CollectionList/index.js +7 -0
  398. package/dist/es/collection/CollectionListItem/CollectionListItem.js +163 -0
  399. package/dist/es/collection/CollectionListItem/index.js +7 -0
  400. package/dist/es/collection/CollectionMetadataEdit.js +56 -0
  401. package/dist/es/collection/CollectionMetadataTab.js +69 -0
  402. package/dist/es/collection/CollectionRow/CollectionRow.js +101 -0
  403. package/dist/es/collection/CollectionRow/index.js +7 -0
  404. package/dist/es/collection/CollectionSearchPicker/CollectionSearchPicker.js +134 -0
  405. package/dist/es/collection/CollectionSearchPicker/index.js +7 -0
  406. package/dist/es/collection/CollectionTable/CollectionTable.js +70 -0
  407. package/dist/es/collection/CollectionTable/index.js +7 -0
  408. package/dist/es/collection/CollectionTreeList/CollectionTreeList.js +145 -0
  409. package/dist/es/collection/CollectionTreeList/components/CollectionLabelDroppable.js +21 -0
  410. package/dist/es/collection/CollectionTreeList/index.js +7 -0
  411. package/dist/es/collection/RemoveFromCollectionDialog/RemoveFromCollectionDialog.js +73 -0
  412. package/dist/es/collection/RemoveFromCollectionDialog/index.js +9 -0
  413. package/dist/es/contexts/MediaCardContext.js +16 -0
  414. package/dist/es/dnd/components/DragLayer.js +49 -0
  415. package/dist/es/dnd/contexts/DragAndDropContext.js +42 -0
  416. package/dist/es/dnd/hoc/withDrag.js +90 -0
  417. package/dist/es/dnd/hoc/withDrop.js +100 -0
  418. package/dist/es/dnd/hooks/useDragOffsetDiff.js +16 -0
  419. package/dist/es/dnd/utils/extractEntityInfo.js +78 -0
  420. package/dist/es/entity/BinList/BinList.js +253 -0
  421. package/dist/es/entity/BinList/index.js +7 -0
  422. package/dist/es/entity/BinListMenu/BinListMenu.js +74 -0
  423. package/dist/es/entity/BinListMenu/index.js +7 -0
  424. package/dist/es/entity/EntityAccessAdd.js +243 -0
  425. package/dist/es/entity/EntityAccessTable.js +119 -0
  426. package/dist/es/entity/EntityCard/EntityCard.js +21 -0
  427. package/dist/es/entity/EntityCard/index.js +4 -0
  428. package/dist/es/entity/EntityComment.js +212 -0
  429. package/dist/es/entity/EntityCommentCard.js +144 -0
  430. package/dist/es/entity/EntityDeleteDialog/EntityDeleteDialog.js +149 -0
  431. package/dist/es/entity/EntityDeleteDialog/index.js +7 -0
  432. package/dist/es/entity/EntityGrid.js +42 -0
  433. package/dist/es/entity/EntityGridItem.js +83 -0
  434. package/dist/es/entity/EntityGridItemDraggable.js +37 -0
  435. package/dist/es/entity/EntityTable.js +51 -0
  436. package/dist/es/entity/EntityTableRow.js +93 -0
  437. package/dist/es/entity/EntityTableRowDraggable.js +37 -0
  438. package/dist/es/entity/EntityTree.js +119 -0
  439. package/dist/es/entity/EntityTreeConsts.js +9 -0
  440. package/dist/es/entity/EntityTreeContext.js +131 -0
  441. package/dist/es/entity/EntityTreeList.js +173 -0
  442. package/dist/es/events/Event/Event.js +81 -0
  443. package/dist/es/events/Event/index.js +7 -0
  444. package/dist/es/events/EventContainer/EventContainer.js +53 -0
  445. package/dist/es/events/EventContainer/index.js +7 -0
  446. package/dist/es/events/EventMarker/EventMarker.js +59 -0
  447. package/dist/es/events/EventMarker/index.js +7 -0
  448. package/dist/es/events/EventMarkerThumbnail/EventMarkerThumbnail.js +82 -0
  449. package/dist/es/events/EventMarkerThumbnail/index.js +7 -0
  450. package/dist/es/events/EventMarkerTimeline/EventMarkerTimeline.js +49 -0
  451. package/dist/es/events/EventMarkerTimeline/index.js +7 -0
  452. package/dist/es/events/EventTimeline/EventTimeline.js +365 -0
  453. package/dist/es/events/EventTimeline/index.js +7 -0
  454. package/dist/es/fieldgroup/Editor.js +219 -0
  455. package/dist/es/fieldgroup/FieldGroupDesigner.js +480 -0
  456. package/dist/es/fieldgroup/FieldIcon.js +32 -0
  457. package/dist/es/fieldgroup/MyField.js +97 -0
  458. package/dist/es/fieldgroup/MyFieldList.js +55 -0
  459. package/dist/es/fields/AutocompleteConstraintField.js +39 -0
  460. package/dist/es/fields/AutocompleteField.js +71 -0
  461. package/dist/es/fields/CheckboxField.js +64 -0
  462. package/dist/es/fields/CheckboxGroupField.js +100 -0
  463. package/dist/es/fields/DateField.js +55 -0
  464. package/dist/es/fields/Field.js +9 -0
  465. package/dist/es/fields/RadioField.js +85 -0
  466. package/dist/es/fields/SelectField.js +87 -0
  467. package/dist/es/fields/SliderField.js +96 -0
  468. package/dist/es/fields/SwitchField.js +55 -0
  469. package/dist/es/fields/TagField.js +91 -0
  470. package/dist/es/fields/TextField.js +50 -0
  471. package/dist/es/filter/FilterCard.js +130 -0
  472. package/dist/es/filter/FilterForm.js +60 -0
  473. package/dist/es/filter/FilterFormLabel.js +31 -0
  474. package/dist/es/forms/ExpandedFormControlLabel.js +96 -0
  475. package/dist/es/forms/LoginForm/LoginForm.js +212 -0
  476. package/dist/es/forms/LoginForm/index.js +7 -0
  477. package/dist/es/forms/SubmitButton.js +11 -0
  478. package/dist/es/forms/onGetToken.js +17 -0
  479. package/dist/es/general/DragScroll/DragScroll.js +96 -0
  480. package/dist/es/general/DragScroll/index.js +7 -0
  481. package/dist/es/general/ImageCollage/ImageCollage.js +110 -0
  482. package/dist/es/general/ImageCollage/index.js +7 -0
  483. package/dist/es/general/MimeTypeIcon/MimeTypeIcon.js +57 -0
  484. package/dist/es/general/MimeTypeIcon/index.js +7 -0
  485. package/dist/es/general/SelectedToolbar/SelectedToolbar.js +61 -0
  486. package/dist/es/general/SelectedToolbar/index.js +7 -0
  487. package/dist/es/group/CreateGroupDialog/CreateGroupDialog.js +77 -0
  488. package/dist/es/group/CreateGroupDialog/components/CreateGroupForm.js +114 -0
  489. package/dist/es/group/CreateGroupDialog/index.js +7 -0
  490. package/dist/es/group/EditGroupDialog/EditGroupDialog.js +61 -0
  491. package/dist/es/group/EditGroupDialog/components/EditGroupForm.js +53 -0
  492. package/dist/es/group/EditGroupDialog/index.js +7 -0
  493. package/dist/es/group/GroupDetails/GroupDetails.js +243 -0
  494. package/dist/es/group/GroupDetails/components/GroupData.js +50 -0
  495. package/dist/es/group/GroupDetails/components/GroupMenu.js +18 -0
  496. package/dist/es/group/GroupDetails/index.js +7 -0
  497. package/dist/es/group/GroupRelationList/GroupRelationList.js +300 -0
  498. package/dist/es/group/GroupRelationList/index.js +7 -0
  499. package/dist/es/group/GroupTable/GroupTable.js +78 -0
  500. package/dist/es/group/GroupTable/components/GroupRow.js +22 -0
  501. package/dist/es/group/GroupTable/index.js +7 -0
  502. package/dist/es/hooks/useComments.js +104 -0
  503. package/dist/es/hooks/useConfirmationDialog.js +31 -0
  504. package/dist/es/hooks/useExpand.js +13 -0
  505. package/dist/es/hooks/useMenu.js +18 -0
  506. package/dist/es/hooks/useSnackbarAlert.js +19 -0
  507. package/dist/es/icons/BitmovinIcon.js +9 -0
  508. package/dist/es/icons/FolderMultipleIcon.js +9 -0
  509. package/dist/es/icons/MediaConvertIcon.js +9 -0
  510. package/dist/es/icons/VidispineIcon.js +9 -0
  511. package/dist/es/icons/bitmovin_24.svg.js +4 -0
  512. package/dist/es/icons/foldermultiple_24.svg.js +4 -0
  513. package/dist/es/icons/mediaconvert_24.svg.js +4 -0
  514. package/dist/es/icons/vidispine_24.svg.js +4 -0
  515. package/dist/es/item/AddRelationDialog.js +127 -0
  516. package/dist/es/item/ItemAccessTab.js +56 -0
  517. package/dist/es/item/ItemCard.js +106 -0
  518. package/dist/es/item/ItemCompoundMetadataTab.js +48 -0
  519. package/dist/es/item/ItemCompoundMetadataTable.js +101 -0
  520. package/dist/es/item/ItemFieldGroupTab.js +71 -0
  521. package/dist/es/item/ItemFileShareDialog.js +253 -0
  522. package/dist/es/item/ItemGrid.js +39 -0
  523. package/dist/es/item/ItemGridDroppable.js +75 -0
  524. package/dist/es/item/ItemLabel.js +31 -0
  525. package/dist/es/item/ItemLabelDroppable.js +18 -0
  526. package/dist/es/item/ItemList/ItemList.js +46 -0
  527. package/dist/es/item/ItemList/index.js +7 -0
  528. package/dist/es/item/ItemListItem/ItemListItem.js +141 -0
  529. package/dist/es/item/ItemListItem/index.js +7 -0
  530. package/dist/es/item/ItemMetadataEdit.js +50 -0
  531. package/dist/es/item/ItemMetadataFieldRow.js +81 -0
  532. package/dist/es/item/ItemMetadataForm.js +29 -0
  533. package/dist/es/item/ItemMetadataFormTable.js +190 -0
  534. package/dist/es/item/ItemMetadataList.js +64 -0
  535. package/dist/es/item/ItemMetadataListFieldGroupItem.js +107 -0
  536. package/dist/es/item/ItemMetadataListFieldItem.js +73 -0
  537. package/dist/es/item/ItemMetadataTab.js +66 -0
  538. package/dist/es/item/ItemMetadataTable.js +51 -0
  539. package/dist/es/item/ItemParentsTab.js +160 -0
  540. package/dist/es/item/ItemPoster.js +40 -0
  541. package/dist/es/item/ItemPosterDialog.js +35 -0
  542. package/dist/es/item/ItemPosterList.js +45 -0
  543. package/dist/es/item/ItemPosterTab.js +21 -0
  544. package/dist/es/item/ItemRelationRemoveDialog.js +59 -0
  545. package/dist/es/item/ItemRelationsTab.js +195 -0
  546. package/dist/es/item/ItemRow.js +65 -0
  547. package/dist/es/item/ItemSearchPicker.js +92 -0
  548. package/dist/es/item/ItemShapeTab.js +26 -0
  549. package/dist/es/item/ItemShapeTable/ItemShapeTable.js +108 -0
  550. package/dist/es/item/ItemShapeTable/components/ItemShapeMenu.js +63 -0
  551. package/dist/es/item/ItemShapeTable/components/ItemShapeRow.js +79 -0
  552. package/dist/es/item/ItemShapeTable/index.js +7 -0
  553. package/dist/es/item/ItemSidecarDialog/ItemSidecarDialog.js +140 -0
  554. package/dist/es/item/ItemSidecarDialog/index.js +7 -0
  555. package/dist/es/item/ItemSidecarDownload/ItemSidecarDownload.js +192 -0
  556. package/dist/es/item/ItemSidecarDownload/index.js +6 -0
  557. package/dist/es/item/ItemSidecarUpload/ItemSidecarUpload.js +451 -0
  558. package/dist/es/item/ItemSidecarUpload/index.js +6 -0
  559. package/dist/es/item/ItemSourceTab.js +16 -0
  560. package/dist/es/item/ItemSourceTable/ItemSourceTable.js +40 -0
  561. package/dist/es/item/ItemSourceTable/components/AudioComponentTypeTableBody.js +32 -0
  562. package/dist/es/item/ItemSourceTable/components/ContainerComponentTypeTableBody.js +30 -0
  563. package/dist/es/item/ItemSourceTable/components/FileTypeTableBody.js +78 -0
  564. package/dist/es/item/ItemSourceTable/components/ImageTypeTableBody.js +36 -0
  565. package/dist/es/item/ItemSourceTable/components/MetadataTypeTableBody.js +19 -0
  566. package/dist/es/item/ItemSourceTable/components/PdfTypeTableBody.js +16 -0
  567. package/dist/es/item/ItemSourceTable/components/ShapeTypeTableBody.js +94 -0
  568. package/dist/es/item/ItemSourceTable/components/TableHead.js +8 -0
  569. package/dist/es/item/ItemSourceTable/components/TableRow.js +23 -0
  570. package/dist/es/item/ItemSourceTable/components/VideoComponentTypeTableBody.js +37 -0
  571. package/dist/es/item/ItemSourceTable/index.js +7 -0
  572. package/dist/es/item/ItemTable.js +36 -0
  573. package/dist/es/item/ItemTabs/ItemTabs.js +80 -0
  574. package/dist/es/item/ItemTabs/components/Tab.js +41 -0
  575. package/dist/es/item/ItemTabs/components/TabPanel.js +16 -0
  576. package/dist/es/item/ItemTabs/components/Tabs.js +16 -0
  577. package/dist/es/item/ItemTabs/index.js +7 -0
  578. package/dist/es/item/ItemTimespan/ItemTimespan.js +67 -0
  579. package/dist/es/item/ItemTimespan/components/ConfidenceSlider.js +50 -0
  580. package/dist/es/item/ItemTimespan/components/EditButton.js +24 -0
  581. package/dist/es/item/ItemTimespan/components/ItemTimespanBox.js +168 -0
  582. package/dist/es/item/ItemTimespan/components/ItemTimespanEdit.js +61 -0
  583. package/dist/es/item/ItemTimespan/components/ItemTimespanForm.js +97 -0
  584. package/dist/es/item/ItemTimespan/components/ItemTimespanInterval.js +98 -0
  585. package/dist/es/item/ItemTimespan/components/ItemTimespanList.js +61 -0
  586. package/dist/es/item/ItemTimespan/components/ItemTimespanSearchInput.js +56 -0
  587. package/dist/es/item/ItemTimespan/components/ItemTimespanSelection.js +27 -0
  588. package/dist/es/item/ItemTimespan/hooks/useConfidenceSlider.js +11 -0
  589. package/dist/es/item/ItemTimespan/hooks/useItemTimespan.js +35 -0
  590. package/dist/es/item/ItemTimespan/hooks/useItemTimespanBox.js +47 -0
  591. package/dist/es/item/ItemTimespan/hooks/useItemTimespanBoxEdit.js +24 -0
  592. package/dist/es/item/ItemTimespan/hooks/useItemTimespanEdit.js +46 -0
  593. package/dist/es/item/ItemTimespan/hooks/useItemTimespanInterval.js +69 -0
  594. package/dist/es/item/ItemTimespan/hooks/useItemTimespanList.js +29 -0
  595. package/dist/es/item/ItemTimespan/index.js +6 -0
  596. package/dist/es/item/ItemTimespan/utils/filterTimespanList.js +49 -0
  597. package/dist/es/item/ItemTimespan/utils/findActiveTimespanIndex.js +16 -0
  598. package/dist/es/item/ItemTimespan/utils/parseTimespanList.js +18 -0
  599. package/dist/es/item/ItemTimespanTab.js +4 -0
  600. package/dist/es/item/ItemTreeItem.js +50 -0
  601. package/dist/es/item/player/ItemAudioPlayer.js +57 -0
  602. package/dist/es/item/player/ItemImagePlayer.js +33 -0
  603. package/dist/es/item/player/ItemPlayer/ItemPlayer.js +172 -0
  604. package/dist/es/item/player/ItemPlayer/index.js +7 -0
  605. package/dist/es/item/player/ItemVideoPlayer.js +100 -0
  606. package/dist/es/job/JobCard.js +148 -0
  607. package/dist/es/job/JobDataTable.js +68 -0
  608. package/dist/es/job/JobFooter.js +84 -0
  609. package/dist/es/job/JobFooterContext.js +114 -0
  610. package/dist/es/job/JobList.js +189 -0
  611. package/dist/es/job/JobRow.js +72 -0
  612. package/dist/es/job/JobRowButton.js +8 -0
  613. package/dist/es/job/JobSelectForm.js +67 -0
  614. package/dist/es/job/JobTable.js +58 -0
  615. package/dist/es/job/JobTaskTable.js +133 -0
  616. package/dist/es/job/const.js +36 -0
  617. package/dist/es/mapStringsBooleans.js +27 -0
  618. package/dist/es/media/MediaBadge.js +34 -0
  619. package/dist/es/media/MediaBadges.js +92 -0
  620. package/dist/es/media/MediaCard/MediaCard.js +160 -0
  621. package/dist/es/media/MediaCard/index.js +7 -0
  622. package/dist/es/media/MediaCardActions.js +47 -0
  623. package/dist/es/media/MediaCardAvatar/MediaCardAvatar.js +73 -0
  624. package/dist/es/media/MediaCardAvatar/index.js +7 -0
  625. package/dist/es/media/MediaCardCard.js +63 -0
  626. package/dist/es/media/MediaCardCheckbox.js +18 -0
  627. package/dist/es/media/MediaCardContent.js +17 -0
  628. package/dist/es/media/MediaCardDurationLabel.js +30 -0
  629. package/dist/es/media/MediaCardFullWidth/MediaCardFullWidth.js +196 -0
  630. package/dist/es/media/MediaCardFullWidth/components/MediaCardExpand.js +44 -0
  631. package/dist/es/media/MediaCardFullWidth/components/MediaCardFullWidthCard.js +37 -0
  632. package/dist/es/media/MediaCardFullWidth/components/MediaCardFullWidthContent.js +60 -0
  633. package/dist/es/media/MediaCardFullWidth/components/MediaCardFullWidthHeader.js +43 -0
  634. package/dist/es/media/MediaCardFullWidth/index.js +7 -0
  635. package/dist/es/media/MediaCardHeader.js +77 -0
  636. package/dist/es/media/MediaCardMenu.js +69 -0
  637. package/dist/es/media/MediaCardThumbnail/MediaCardThumbnail.js +284 -0
  638. package/dist/es/media/MediaCardThumbnail/index.js +7 -0
  639. package/dist/es/media/MediaCardThumbnailLabel/MediaCardThumbnailLabel.js +44 -0
  640. package/dist/es/media/MediaCardThumbnailLabel/index.js +9 -0
  641. package/dist/es/search/Pagination.js +32 -0
  642. package/dist/es/search/PaginationActions.js +28 -0
  643. package/dist/es/search/SavedSearch/SaveSearchForm.js +63 -0
  644. package/dist/es/search/SavedSearch/SavedSearch.js +65 -0
  645. package/dist/es/search/SavedSearch/SavedSearchAccessList.js +25 -0
  646. package/dist/es/search/SavedSearch/SavedSearchList.js +49 -0
  647. package/dist/es/search/SavedSearch/SavedSearchRow.js +271 -0
  648. package/dist/es/search/SavedSearch/ShareSearch.js +30 -0
  649. package/dist/es/search/SavedSearch/index.js +4 -0
  650. package/dist/es/search/SavedSearchFolder/AddFolderRow.js +75 -0
  651. package/dist/es/search/SavedSearchFolder/FolderRow.js +231 -0
  652. package/dist/es/search/SavedSearchFolder/index.js +4 -0
  653. package/dist/es/search/SearchField/SearchField.js +406 -0
  654. package/dist/es/search/SearchField/index.js +7 -0
  655. package/dist/es/search/SearchInput/SearchInput.js +246 -0
  656. package/dist/es/search/SearchInput/index.js +7 -0
  657. package/dist/es/search/SearchInputFieldSelect.js +88 -0
  658. package/dist/es/search/SearchResultRow.js +41 -0
  659. package/dist/es/search/SearchResultTable.js +33 -0
  660. package/dist/es/search/SearchSuggestions.js +52 -0
  661. package/dist/es/search/Sort/Sort.js +147 -0
  662. package/dist/es/search/Sort/index.js +7 -0
  663. package/dist/es/search/SortMenuItem.js +58 -0
  664. package/dist/es/search/SpellCheck/SpellCheck.js +94 -0
  665. package/dist/es/search/SpellCheck/index.js +7 -0
  666. package/dist/es/search/querybuilder/QueryBetween/QueryBetween.js +84 -0
  667. package/dist/es/search/querybuilder/QueryBetween/index.js +6 -0
  668. package/dist/es/search/querybuilder/QueryBuilder/QueryBuilder.js +138 -0
  669. package/dist/es/search/querybuilder/QueryBuilder/index.js +7 -0
  670. package/dist/es/search/querybuilder/QueryBuilderCard/QueryBuilderCard.js +150 -0
  671. package/dist/es/search/querybuilder/QueryBuilderCard/index.js +7 -0
  672. package/dist/es/search/querybuilder/QueryBuilderContext.js +50 -0
  673. package/dist/es/search/querybuilder/QueryContains/QueryContains.js +61 -0
  674. package/dist/es/search/querybuilder/QueryContains/index.js +6 -0
  675. package/dist/es/search/querybuilder/QueryEntry/QueryEntry.js +227 -0
  676. package/dist/es/search/querybuilder/QueryEntry/index.js +6 -0
  677. package/dist/es/search/querybuilder/QueryEquals/QueryEquals.js +61 -0
  678. package/dist/es/search/querybuilder/QueryEquals/index.js +6 -0
  679. package/dist/es/search/querybuilder/QueryField/QueryField.js +272 -0
  680. package/dist/es/search/querybuilder/QueryField/index.js +6 -0
  681. package/dist/es/search/querybuilder/QueryGroup/QueryGroup.js +152 -0
  682. package/dist/es/search/querybuilder/QueryGroup/index.js +6 -0
  683. package/dist/es/search/querybuilder/QueryInput/QueryInput.js +121 -0
  684. package/dist/es/search/querybuilder/QueryInput/index.js +6 -0
  685. package/dist/es/search/querybuilder/QueryOperator/QueryOperator.js +160 -0
  686. package/dist/es/search/querybuilder/QueryOperator/index.js +6 -0
  687. package/dist/es/storage/StorageListTree.js +36 -0
  688. package/dist/es/storage/components/FileTree.js +29 -0
  689. package/dist/es/storage/components/FileTreeLabel.js +40 -0
  690. package/dist/es/storage/components/FolderTree.js +77 -0
  691. package/dist/es/storage/components/FolderTreeLabel.js +36 -0
  692. package/dist/es/storage/components/SelectedEntityWrapper.js +21 -0
  693. package/dist/es/storage/components/SelectedFile.js +44 -0
  694. package/dist/es/storage/components/SelectedFileWrapper.js +13 -0
  695. package/dist/es/storage/components/SelectedStorage.js +53 -0
  696. package/dist/es/storage/components/SelectedStorageWrapper.js +17 -0
  697. package/dist/es/storage/components/Storage.js +27 -0
  698. package/dist/es/storage/components/StorageList.js +21 -0
  699. package/dist/es/storage/components/StorageTree.js +69 -0
  700. package/dist/es/storage/const.js +8 -0
  701. package/dist/es/storage/hooks/useFileList.js +36 -0
  702. package/dist/es/storage/hooks/useSelectedFile.js +13 -0
  703. package/dist/es/storage/hooks/useSelectedStorage.js +11 -0
  704. package/dist/es/storage/hooks/useStorageList.js +11 -0
  705. package/dist/es/storage/hooks/useTreeView.js +16 -0
  706. package/dist/es/transcode/ShapeTagCard.js +76 -0
  707. package/dist/es/transcode/ShapeTagListAccordion.js +200 -0
  708. package/dist/es/transcode/TranscodeDialog.js +312 -0
  709. package/dist/es/upload/FileTree.js +105 -0
  710. package/dist/es/upload/Upload.js +323 -0
  711. package/dist/es/upload/UploadEditor.js +45 -0
  712. package/dist/es/upload/UploadForm.js +78 -0
  713. package/dist/es/upload/UploadListFolder.js +19 -0
  714. package/dist/es/upload/UploadListItem.js +143 -0
  715. package/dist/es/user/ChangePasswordDialog.js +48 -0
  716. package/dist/es/user/ChangePasswordForm.js +224 -0
  717. package/dist/es/user/ChangeUserPasswordDialog/ChangeUserPasswordDialog.js +42 -0
  718. package/dist/es/user/ChangeUserPasswordDialog/components/PasswordField.js +20 -0
  719. package/dist/es/user/ChangeUserPasswordDialog/components/UserPasswordForm.js +57 -0
  720. package/dist/es/user/ChangeUserPasswordDialog/index.js +9 -0
  721. package/dist/es/user/CreateUserDialog/CreateUserDialog.js +70 -0
  722. package/dist/es/user/CreateUserDialog/components/CreateUserForm.js +80 -0
  723. package/dist/es/user/CreateUserDialog/index.js +7 -0
  724. package/dist/es/user/EditUserDialog/EditUserDialog.js +47 -0
  725. package/dist/es/user/EditUserDialog/components/EditUserForm.js +65 -0
  726. package/dist/es/user/EditUserDialog/index.js +7 -0
  727. package/dist/es/user/UserAvatarButton/UserAvatarButton.js +184 -0
  728. package/dist/es/user/UserAvatarButton/index.js +7 -0
  729. package/dist/es/user/UserDetails/UserDetails.js +166 -0
  730. package/dist/es/user/UserDetails/components/UserData.js +40 -0
  731. package/dist/es/user/UserDetails/components/UserMenu.js +25 -0
  732. package/dist/es/user/UserDetails/index.js +7 -0
  733. package/dist/es/user/UserRelationList/UserRelationList.js +292 -0
  734. package/dist/es/user/UserRelationList/index.js +7 -0
  735. package/dist/es/user/UserTable/UserTable.js +76 -0
  736. package/dist/es/user/UserTable/components/UserRow.js +17 -0
  737. package/dist/es/user/UserTable/index.js +7 -0
  738. package/dist/es/utils.js +27 -0
  739. package/dist/index.cjs.js +1 -0
  740. package/dist/index.es.js +384 -0
  741. package/package.json +23 -16
  742. package/dist/index.js +0 -26107
  743. package/dist/index.umd.cjs +0 -9
@@ -1,9 +0,0 @@
1
- (function(N,Qt){typeof exports=="object"&&typeof module<"u"?Qt(exports,require("core-js/es/string/replace-all"),require("react/jsx-runtime"),require("react"),require("@material-ui/core"),require("typeface-roboto"),require("clsx"),require("@material-ui/core/colors"),require("@material-ui/icons"),require("@material-ui/lab"),require("react-is"),require("react-final-form"),require("@vidispine/vdt-api"),require("@vidispine/vdt-react"),require("final-form"),require("@vidispine/vdt-js"),require("moment"),require("@material-ui/core/styles"),require("lodash.debounce"),require("lodash.get"),require("lodash.update"),require("lodash.truncate"),require("react-dnd"),require("react-dnd-html5-backend"),require("react-beautiful-dnd"),require("react-dropzone"),require("@vidispine/vdt-videojs-react"),require("react-select/async-creatable"),require("lodash.clonedeep"),require("lodash.constant"),require("lodash.updatewith"),require("lodash.merge"),require("filesize")):typeof define=="function"&&define.amd?define(["exports","core-js/es/string/replace-all","react/jsx-runtime","react","@material-ui/core","typeface-roboto","clsx","@material-ui/core/colors","@material-ui/icons","@material-ui/lab","react-is","react-final-form","@vidispine/vdt-api","@vidispine/vdt-react","final-form","@vidispine/vdt-js","moment","@material-ui/core/styles","lodash.debounce","lodash.get","lodash.update","lodash.truncate","react-dnd","react-dnd-html5-backend","react-beautiful-dnd","react-dropzone","@vidispine/vdt-videojs-react","react-select/async-creatable","lodash.clonedeep","lodash.constant","lodash.updatewith","lodash.merge","filesize"],Qt):(N=typeof globalThis<"u"?globalThis:N||self,Qt(N["@vidispine/vdt-materialui"]={},null,N.jsxRuntime,N.react,N.materialuiCore,null,N.clsx,N.materialuiColors,N.materialuiIcons,N.materialuiLab,N.reactIs,N.reactFinalForm,N.vdtApi,N.vdtReact,N.finalForm,N.vdtJs,N.moment,N.materialuiStyles,N._debounce,N._get,N._update,N._truncate,N.reactDnd,N.reactDndHtml5Backend,N.reactBeautifulDnd,N.reactDropzone,N.vdtVideojsReact,N.reactSelectAsyncCreatable,N.cloneDeep,N.constant,N.updateWith,N.merge,N.filesize))})(this,function(N,Qt,t,C,r,kD,x,Qe,j,oe,as,he,Q,ne,ns,X,Me,He,gg,Be,rs,hg,ct,os,Ht,ss,is,yg,mg,fg,Cg,Tg,bg){"use strict";const Ig=r.createTheme({palette:{type:"light"}}),Mg=r.createTheme({palette:{type:"dark"}}),Aa=C.createContext({theme:void 0,palette:void 0,togglePalette:()=>null});function Lg({themes:a={light:Ig,dark:Mg},defaultPaletteKey:n="light",localStoragePaletteKey:o="DEFAULT_PALETTE",props:s={},children:i}){const l=localStorage.getItem(o)||n,[d,c]=C.useState(l),p=a[l],[u,g]=C.useState(p),h=C.useCallback(T=>{const b=a[T];g(b),c(T),localStorage.setItem(o,T)},[o,a]),m=C.useCallback(()=>{const T=Object.keys(a);let b=T[0];T.length>0&&d===T[0]&&([,b]=T),h(b)},[d,a,h]),y=d===n,I=C.useMemo(()=>({theme:u,palette:d,togglePalette:m,isDefaultPalette:y}),[y,d,u,m]);return t.jsx(Aa.Provider,{value:I,children:t.jsx(r.MuiThemeProvider,{theme:r.createTheme(u,{props:s}),children:t.jsx(r.CssBaseline,{children:i})})})}function Sg(){const a=C.useContext(Aa);if(a===void 0)throw new Error("useThemeContext must be used within a ThemeProvider");return a}const wg=a=>({button:{borderRadius:0,paddingTop:4,paddingBottom:4,borderColor:Qe.grey[400],borderStyle:a.palette.type==="light"?"solid":"none",height:32}});function Ag({className:a,classes:n,onChangeViewLayout:o,viewLayout:s,gridView:i="GRID_VIEW",rowView:l="ROW_VIEW"}){return t.jsxs(oe.ToggleButtonGroup,{className:x(n.root,"VdtLayoutToggleButtonGroup",a),exclusive:!0,onChange:o,value:s,size:"small",children:[t.jsx(oe.ToggleButton,{className:x(n.button,"VdtLayoutToggleButton"),value:i,children:t.jsx(j.ViewModule,{})}),t.jsx(oe.ToggleButton,{className:x(n.button,"VdtLayoutToggleButton"),value:l,children:t.jsx(j.ViewHeadline,{})})]})}const Dg=r.withStyles(wg,{name:"VdtLayoutButtonGroup"})(Ag);function ls({open:a,titleText:n="Confirm",rejectText:o="No",confirmText:s="Yes",onConfirm:i,onReject:l,children:d,...c}){return t.jsxs(r.Dialog,{open:a,onClose:l,children:[t.jsx(r.DialogTitle,{children:n}),typeof d=="function"?d(c):d,t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:l,color:"primary",children:o}),t.jsx(r.Button,{variant:"contained",onClick:i,color:"secondary",children:s})]})]})}function Da({throwOnReject:a=!0,DialogComponent:n=ls}={}){const[o,s]=C.useState(null);return[o,l=>new Promise((d,c)=>{const p=()=>{s(null)},u=()=>{p(),d(!0)},g=()=>{p(),a?c():d(!1)};s(()=>h=>t.jsx(n,{open:!0,onConfirm:u,onReject:g,...h,...l}))})]}const Na=()=>{const[a,n]=C.useState(null),o=d=>{d.stopPropagation&&d.stopPropagation(),d.preventDefault&&d.preventDefault(),n(d.currentTarget)},s=()=>n(null);return{anchorEl:a,onOpen:o,onClose:s,onClick:d=>c=>{c.stopPropagation&&c.stopPropagation(),c.preventDefault&&c.preventDefault(),s(),d(c)},isOpen:!!a}},Ng=()=>({}),ds=()=>()=>t.jsx(t.Fragment,{});function vg(){const[a,n]=C.useState(ds),o=C.useCallback(({severity:s,message:i})=>{n(()=>r.withStyles(Ng)(({AlertProps:l,...d})=>t.jsx(r.Snackbar,{open:!0,autoHideDuration:6e3,onClose:()=>n(ds),...d,children:t.jsx(oe.Alert,{severity:s,...l,children:i.toString?i.toString():i})})))},[]);return[a,o]}var e={},cs={get exports(){return e},set exports(a){e=a}};/*
2
- object-assign
3
- (c) Sindre Sorhus
4
- @license MIT
5
- */var va,ps;function xg(){if(ps)return va;ps=1;var a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(l){if(l==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(l)}function i(){try{if(!Object.assign)return!1;var l=new String("abc");if(l[5]="de",Object.getOwnPropertyNames(l)[0]==="5")return!1;for(var d={},c=0;c<10;c++)d["_"+String.fromCharCode(c)]=c;var p=Object.getOwnPropertyNames(d).map(function(g){return d[g]});if(p.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(g){u[g]=g}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return va=i()?Object.assign:function(l,d){for(var c,p=s(l),u,g=1;g<arguments.length;g++){c=Object(arguments[g]);for(var h in c)n.call(c,h)&&(p[h]=c[h]);if(a){u=a(c);for(var m=0;m<u.length;m++)o.call(c,u[m])&&(p[u[m]]=c[u[m]])}}return p},va}var xa,us;function Oa(){if(us)return xa;us=1;var a="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xa=a,xa}var Ea,gs;function hs(){return gs||(gs=1,Ea=Function.call.bind(Object.prototype.hasOwnProperty)),Ea}var ja,ys;function Og(){if(ys)return ja;ys=1;var a=function(){};if(process.env.NODE_ENV!=="production"){var n=Oa(),o={},s=hs();a=function(l){var d="Warning: "+l;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}}}function i(l,d,c,p,u){if(process.env.NODE_ENV!=="production"){for(var g in l)if(s(l,g)){var h;try{if(typeof l[g]!="function"){var m=Error((p||"React class")+": "+c+" type `"+g+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof l[g]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw m.name="Invariant Violation",m}h=l[g](d,g,p,c,null,n)}catch(I){h=I}if(h&&!(h instanceof Error)&&a((p||"React class")+": type specification of "+c+" `"+g+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in o)){o[h.message]=!0;var y=u?u():"";a("Failed "+c+" type: "+h.message+(y??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(o={})},ja=i,ja}var Pa,ms;function Eg(){if(ms)return Pa;ms=1;var a=as,n=xg(),o=Oa(),s=hs(),i=Og(),l=function(){};process.env.NODE_ENV!=="production"&&(l=function(c){var p="Warning: "+c;typeof console<"u"&&console.error(p);try{throw new Error(p)}catch{}});function d(){return null}return Pa=function(c,p){var u=typeof Symbol=="function"&&Symbol.iterator,g="@@iterator";function h(k){var U=k&&(u&&k[u]||k[g]);if(typeof U=="function")return U}var m="<<anonymous>>",y={array:M("array"),bigint:M("bigint"),bool:M("boolean"),func:M("function"),number:M("number"),object:M("object"),string:M("string"),symbol:M("symbol"),any:L(),arrayOf:S,element:w(),elementType:A(),instanceOf:v,node:F(),objectOf:E,oneOf:O,oneOfType:D,shape:B,exact:$};function I(k,U){return k===U?k!==0||1/k===1/U:k!==k&&U!==U}function T(k,U){this.message=k,this.data=U&&typeof U=="object"?U:{},this.stack=""}T.prototype=Error.prototype;function b(k){if(process.env.NODE_ENV!=="production")var U={},K=0;function Z(q,G,R,ae,te,re,ce){if(ae=ae||m,re=re||R,ce!==o){if(p){var pe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw pe.name="Invariant Violation",pe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var se=ae+":"+R;!U[se]&&K<3&&(l("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+ae+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),U[se]=!0,K++)}}return G[R]==null?q?G[R]===null?new T("The "+te+" `"+re+"` is marked as required "+("in `"+ae+"`, but its value is `null`.")):new T("The "+te+" `"+re+"` is marked as required in "+("`"+ae+"`, but its value is `undefined`.")):null:k(G,R,ae,te,re)}var J=Z.bind(null,!1);return J.isRequired=Z.bind(null,!0),J}function M(k){function U(K,Z,J,q,G,R){var ae=K[Z],te=V(ae);if(te!==k){var re=W(ae);return new T("Invalid "+q+" `"+G+"` of type "+("`"+re+"` supplied to `"+J+"`, expected ")+("`"+k+"`."),{expectedType:k})}return null}return b(U)}function L(){return b(d)}function S(k){function U(K,Z,J,q,G){if(typeof k!="function")return new T("Property `"+G+"` of component `"+J+"` has invalid PropType notation inside arrayOf.");var R=K[Z];if(!Array.isArray(R)){var ae=V(R);return new T("Invalid "+q+" `"+G+"` of type "+("`"+ae+"` supplied to `"+J+"`, expected an array."))}for(var te=0;te<R.length;te++){var re=k(R,te,J,q,G+"["+te+"]",o);if(re instanceof Error)return re}return null}return b(U)}function w(){function k(U,K,Z,J,q){var G=U[K];if(!c(G)){var R=V(G);return new T("Invalid "+J+" `"+q+"` of type "+("`"+R+"` supplied to `"+Z+"`, expected a single ReactElement."))}return null}return b(k)}function A(){function k(U,K,Z,J,q){var G=U[K];if(!a.isValidElementType(G)){var R=V(G);return new T("Invalid "+J+" `"+q+"` of type "+("`"+R+"` supplied to `"+Z+"`, expected a single ReactElement type."))}return null}return b(k)}function v(k){function U(K,Z,J,q,G){if(!(K[Z]instanceof k)){var R=k.name||m,ae=H(K[Z]);return new T("Invalid "+q+" `"+G+"` of type "+("`"+ae+"` supplied to `"+J+"`, expected ")+("instance of `"+R+"`."))}return null}return b(U)}function O(k){if(!Array.isArray(k))return process.env.NODE_ENV!=="production"&&(arguments.length>1?l("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):l("Invalid argument supplied to oneOf, expected an array.")),d;function U(K,Z,J,q,G){for(var R=K[Z],ae=0;ae<k.length;ae++)if(I(R,k[ae]))return null;var te=JSON.stringify(k,function(ce,pe){var se=W(pe);return se==="symbol"?String(pe):pe});return new T("Invalid "+q+" `"+G+"` of value `"+String(R)+"` "+("supplied to `"+J+"`, expected one of "+te+"."))}return b(U)}function E(k){function U(K,Z,J,q,G){if(typeof k!="function")return new T("Property `"+G+"` of component `"+J+"` has invalid PropType notation inside objectOf.");var R=K[Z],ae=V(R);if(ae!=="object")return new T("Invalid "+q+" `"+G+"` of type "+("`"+ae+"` supplied to `"+J+"`, expected an object."));for(var te in R)if(s(R,te)){var re=k(R,te,J,q,G+"."+te,o);if(re instanceof Error)return re}return null}return b(U)}function D(k){if(!Array.isArray(k))return process.env.NODE_ENV!=="production"&&l("Invalid argument supplied to oneOfType, expected an instance of array."),d;for(var U=0;U<k.length;U++){var K=k[U];if(typeof K!="function")return l("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(K)+" at index "+U+"."),d}function Z(J,q,G,R,ae){for(var te=[],re=0;re<k.length;re++){var ce=k[re],pe=ce(J,q,G,R,ae,o);if(pe==null)return null;pe.data&&s(pe.data,"expectedType")&&te.push(pe.data.expectedType)}var se=te.length>0?", expected one of type ["+te.join(", ")+"]":"";return new T("Invalid "+R+" `"+ae+"` supplied to "+("`"+G+"`"+se+"."))}return b(Z)}function F(){function k(U,K,Z,J,q){return Y(U[K])?null:new T("Invalid "+J+" `"+q+"` supplied to "+("`"+Z+"`, expected a ReactNode."))}return b(k)}function z(k,U,K,Z,J){return new T((k||"React class")+": "+U+" type `"+K+"."+Z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+J+"`.")}function B(k){function U(K,Z,J,q,G){var R=K[Z],ae=V(R);if(ae!=="object")return new T("Invalid "+q+" `"+G+"` of type `"+ae+"` "+("supplied to `"+J+"`, expected `object`."));for(var te in k){var re=k[te];if(typeof re!="function")return z(J,q,G,te,W(re));var ce=re(R,te,J,q,G+"."+te,o);if(ce)return ce}return null}return b(U)}function $(k){function U(K,Z,J,q,G){var R=K[Z],ae=V(R);if(ae!=="object")return new T("Invalid "+q+" `"+G+"` of type `"+ae+"` "+("supplied to `"+J+"`, expected `object`."));var te=n({},K[Z],k);for(var re in te){var ce=k[re];if(s(k,re)&&typeof ce!="function")return z(J,q,G,re,W(ce));if(!ce)return new T("Invalid "+q+" `"+G+"` key `"+re+"` supplied to `"+J+"`.\nBad object: "+JSON.stringify(K[Z],null," ")+`
6
- Valid keys: `+JSON.stringify(Object.keys(k),null," "));var pe=ce(R,re,J,q,G+"."+re,o);if(pe)return pe}return null}return b(U)}function Y(k){switch(typeof k){case"number":case"string":case"undefined":return!0;case"boolean":return!k;case"object":if(Array.isArray(k))return k.every(Y);if(k===null||c(k))return!0;var U=h(k);if(U){var K=U.call(k),Z;if(U!==k.entries){for(;!(Z=K.next()).done;)if(!Y(Z.value))return!1}else for(;!(Z=K.next()).done;){var J=Z.value;if(J&&!Y(J[1]))return!1}}else return!1;return!0;default:return!1}}function P(k,U){return k==="symbol"?!0:U?U["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&U instanceof Symbol:!1}function V(k){var U=typeof k;return Array.isArray(k)?"array":k instanceof RegExp?"object":P(U,k)?"symbol":U}function W(k){if(typeof k>"u"||k===null)return""+k;var U=V(k);if(U==="object"){if(k instanceof Date)return"date";if(k instanceof RegExp)return"regexp"}return U}function _(k){var U=W(k);switch(U){case"array":case"object":return"an "+U;case"boolean":case"date":case"regexp":return"a "+U;default:return U}}function H(k){return!k.constructor||!k.constructor.name?m:k.constructor.name}return y.checkPropTypes=i,y.resetWarningCache=i.resetWarningCache,y.PropTypes=y,y},Pa}var ka,fs;function jg(){if(fs)return ka;fs=1;var a=Oa();function n(){}function o(){}return o.resetWarningCache=n,ka=function(){function s(d,c,p,u,g,h){if(h!==a){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}s.isRequired=s;function i(){return s}var l={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:i,element:s,elementType:s,instanceOf:i,node:s,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:o,resetWarningCache:n};return l.PropTypes=l,l},ka}if(process.env.NODE_ENV!=="production"){var Pg=as,kg=!0;cs.exports=Eg()(Pg.isElement,kg)}else cs.exports=jg()();const Fg=a=>({root:{marginTop:a.spacing(1),width:"100%"}});function zg({input:{checked:a,name:n,onChange:o,...s}={},meta:{touched:i,error:l,submitError:d}={},label:c,classes:p,className:u,FormControlProps:g={},FormControlLabelProps:h={},FormControlHelperTextProps:m={},...y}){return t.jsxs(r.FormControl,{error:(l||d)&&i,hiddenLabel:!0,className:x(p.root,"VdtCheckboxField-root",u),...g,children:[t.jsx(r.FormControlLabel,{label:c,control:t.jsx(r.Checkbox,{...y,name:n,inputProps:s,onChange:o,checked:a,className:x(p.checkbox,"VdtCheckboxField-checkbox")}),className:x(p.formControlLabel,"VdtCheckboxField-formControlLabel"),...h}),t.jsx(r.FormHelperText,{margin:"dense",className:x(p.formHelperText,"VdtCheckboxField-formHelperText"),...m,children:l||d})]})}const Zt=r.withStyles(Fg,{name:"VdtCheckboxField"})(zg),Bg=a=>({root:{marginTop:a.spacing(2),width:"100%"}});function qg({label:a,...n}){return t.jsx(r.FormLabel,{component:"legend",...n,children:a})}function Vg({input:{value:a,name:n,onChange:o,...s}={},meta:{touched:i,error:l,submitError:d}={},options:c=[],label:p,classes:u,className:g,selectAllValue:h,FormControlProps:m={},FormLabelComponent:y=qg,FormLabelProps:I={},FormGroupProps:T={},FormControlLabelProps:b={},CheckboxProps:M={},FormHelperTextProps:L={},FormControlLabelComponent:S=r.FormControlLabel}){const[w,A]=C.useState([]),v=O=>{const{value:E}=O.target,D=!a.includes(E),F=z=>h?E===h?D?c.map(B=>B.value):[]:D?[...z,E]:z.filter(B=>![h,E].includes(B)):D?[...z,E]:z.filter(B=>E!==B);o(F(w)),A(z=>F(z))};return C.useEffect(()=>{(!a||!a.length)&&w.length>0?(o([]),A(()=>[])):a&&A(()=>a)},[w.length,a]),t.jsxs(r.FormControl,{component:"fieldset",error:(l||d)&&i,className:x(u.root,"VdtCheckboxGroupField-root",g),...m,children:[t.jsx(y,{className:x(u.formLabel,"VdtCheckboxGroupField-formLabel"),label:p,options:c,onChange:o,...I}),t.jsx(r.FormGroup,{name:n,onChange:v,className:x(u.formGroup,"VdtCheckboxGroupField-formGroup"),...T,children:c.map(({value:O,label:E,...D})=>t.jsx(S,{label:E,control:t.jsx(r.Checkbox,{name:O,value:O,inputProps:s,checked:w.includes(O),className:x(u.checkbox,"VdtCheckboxGroupField-checkbox"),...M}),className:x(u.formControlLabel,"VdtCheckboxGroupField-formControlLabel"),...b,...D},`${n}-${O}`))}),t.jsx(r.FormHelperText,{className:x(u.formHelperText,"VdtCheckboxGroupField-formHelperText"),...L,children:l||d})]})}const Cs=r.withStyles(Bg,{name:"VdtCheckboxGroupField"})(Vg),Gg=a=>({root:{marginTop:a.spacing(2),width:"100%"}});function Ug({input:{value:a,name:n,onChange:o}={},meta:{touched:s,error:i,submitError:l}={},options:d=[],label:c,classes:p,className:u,FormControlProps:g={},FormLabelProps:h={},RadioGroupProps:m={},FormControlLabelProps:y={},RadioProps:I={},FormHelperTextProps:T={},FormControlLabelComponent:b=r.FormControlLabel}){return t.jsxs(r.FormControl,{component:"fieldset",error:(i||l)&&s,className:x(p.root,"VdtRadioField-root",u),...g,children:[t.jsx(r.FormLabel,{component:"legend",className:x(p.formLabel,"VdtRadioField-formLabel"),...h,children:c}),t.jsx(r.RadioGroup,{name:n,value:a,onChange:o,className:x(p.radioGroup,"VdtRadioField-radioGroup"),...m,children:d.map(({value:M,label:L,...S})=>t.jsx(b,{label:L,control:t.jsx(r.Radio,{value:M,className:x(p.radio,"VdtRadioField-radio"),...I}),className:x(p.formControlLabel,"VdtRadioField-formControlLabel"),...y,...S},M))}),t.jsx(r.FormHelperText,{className:x(p.formHelperTextProps,"VdtRadioField-formHelperTextProps"),...T,children:i||l})]})}const Ts=r.withStyles(Gg,{name:"VdtRadioField"})(Ug),$g=a=>({root:{marginTop:a.spacing(1),width:"100%","& .MuiInputBase-root":{fontSize:".75rem"},"& .MuiInputBase-input":{fontWeight:500,fontSize:"0.875rem"}},inputLabel:{},select:{},menuItem:{},formHelperText:{}});function Yg({input:{value:a,name:n,onChange:o,multiple:s}={},meta:{touched:i,error:l,submitError:d}={},options:c=[],label:p,classes:u,className:g,FormControlProps:h={},InputLabelProps:m={},MenuItemProps:y={},FormHelperTextProps:I={},...T}){return t.jsxs(r.FormControl,{error:(l||d)&&i,className:x(u.root,"VdtSelectField-root",g),...h,children:[t.jsx(r.InputLabel,{htmlFor:n,className:x(u.inputLabel,"VdtSelectField-inputLabel"),...m,children:p}),t.jsx(r.Select,{name:n,onChange:o,value:s&&!a?[]:a,multiple:s,className:x(u.select,"VdtSelectField-select"),...T,children:c.map(({value:b,label:M,...L})=>t.jsx(r.MenuItem,{value:b,className:x(u.menuItem,"VdtSelectField-menuItem"),...y,...L,children:M},b))}),t.jsx(r.FormHelperText,{className:x(u.formHelperText,"VdtSelectField-formHelperText"),...I,children:i&&(l||d)?l||d:""})]})}const Ve=r.withStyles($g,{name:"VdtSelectField"})(Yg),Wg=a=>({root:{marginTop:a.spacing(1),width:"100%","& .MuiInputBase-root":{fontSize:".75rem"},"& .MuiInputBase-input":{fontWeight:500,fontSize:"0.875rem"}}});function _g({input:{name:a,onChange:n,value:o,...s}={},meta:{touched:i,error:l,submitError:d}={},helperText:c=" ",classes:p,className:u,FormControlProps:g={},...h}){return t.jsx(r.FormControl,{className:x(p.root,"VdtTextField-root",u),...g,children:t.jsx(r.TextField,{className:x(p.text,"VdtTextField-text"),name:a,helperText:i&&(l||d)?l||d:c,error:(l||d)&&i,inputProps:s,onChange:n,value:o,...h})})}const we=r.withStyles(Wg,{name:"VdtTextField"})(_g),Qg=a=>({root:{marginTop:a.spacing(2),width:"100%"},sliderWithoutThumb:{"& .MuiSlider-thumb":{visibility:"hidden"}}});function Hg({input:{value:a,name:n,onChange:o}={},meta:{touched:s,error:i,submitError:l}={},options:d=[],label:c,min:p,max:u,isRange:g,step:h=null,showMarks:m=!0,classes:y,className:I,FormControlProps:T={},FormLabelProps:b={},FormHelperTextProps:M={},exclude:L,...S}){const w=C.useMemo(()=>d.filter(F=>!Number.isNaN(F.value)).map(F=>({value:Number(F.value),label:m?F.label:void 0})),[m,d]),[A,v]=C.useMemo(()=>{const F=w.map(z=>z.value).sort((z,B)=>z-B);return[F[0],F[F.length-1]]},[w]),O=Number(p)||A,E=Number(u)||v,D=g?[O,E]:null;return t.jsxs(r.FormControl,{error:(i||l)&&s,className:x(y.root,"VdtSliderField-root",I),...T,children:[t.jsx(r.FormLabel,{component:"legend",className:x(y.FormLabel,"VdtSliderField-formLabel"),...b,children:c}),t.jsx(r.Slider,{name:n,value:a||D,min:O,max:E,marks:w,step:h,disabled:!w.length,valueLabelDisplay:w.length>0?"auto":void 0,onChange:(F,z)=>o(z),className:x({[y.slider]:!0,"VdtSliderField-slider":!0,[y.sliderWithoutThumb]:!a}),...S}),t.jsx(r.FormHelperText,{className:x(y.formHelperText,"VdtSliderField-formHelperText"),...M,children:i||l})]})}const Zg=r.withStyles(Qg,{name:"VdtSliderField"})(Hg),Jg=a=>({root:{marginTop:a.spacing(1),width:"100%"}});function Xg({input:{value:a,name:n,onChange:o}={},meta:{touched:s,error:i,submitError:l}={},options:d=[],label:c,classes:p,className:u,FormControlProps:g={},TextFieldProps:h={},InputLabelProps:m={},FormHelperTextProps:y={},AutocompleteProps:I={},...T}){const{freeSolo:b,multiple:M}=I,L=M?[]:null,[S,w]=C.useState(L),A=(v,O)=>{M?b?(w(O.map(E=>E.value?E:{value:E,label:E})),o(O.map(E=>E.value?E.value:E))):(w(O),o(O.map(E=>E.value))):(w(O),o(O.value))};return C.useEffect(()=>{if(M)(!a||!a.length)&&S.length>0?w(()=>L):Array.isArray(a)&&a&&a.length>0&&S.length===0&&s===!1?w(()=>a.map(v=>({value:v,label:v}))):!Array.isArray(a)&&a&&a.length>0&&S.length===0&&s===!1&&w(()=>[{value:a,label:a}]);else if(!a&&S)w(()=>L),o([]);else if(a&&a.length&&!S){const v=a.length?a[0]:a;w(()=>({value:v,label:v}))}},[S,a]),t.jsxs(r.FormControl,{component:"fieldset",className:x(p.root,"VdtTagField-root",u),error:(i||l)&&s,...g,children:[t.jsx(oe.Autocomplete,{className:x(p.root,"VdtTagField-root",u),id:n,value:S,options:d,getOptionLabel:v=>v.label||v.value||"",getOptionSelected:(v,O)=>v.value===O.value,onChange:A,disableClearable:!0,freeSolo:b,multiple:M,renderInput:v=>t.jsx(r.TextField,{label:c,className:x(p.text,"VdtTagField-text"),error:(i||l)&&s,InputLabelProps:m,...v,...h}),...I,...T}),t.jsx(r.FormHelperText,{className:x(p.helperText,"VdtTagField-helperText"),...y,children:i||l})]})}const bs=r.withStyles(Jg,{name:"VdtTagField"})(Xg),Kg=a=>({root:{marginTop:a.spacing(2),width:"100%"},date:{"& ::-webkit-calendar-picker-indicator":{filter:a.palette.type==="dark"&&"invert(1)"}}});function Rg({input:{value:a,name:n,onChange:o}={},meta:{touched:s,error:i,submitError:l}={},label:d,helperText:c,dateType:p="date",classes:u,className:g,FormControlProps:h={},InputLabelProps:m={},...y}){return t.jsx(r.FormControl,{className:x(u.root,"VdtDateField-root",g),error:(i||l)&&s,...h,children:t.jsx(r.TextField,{id:n,label:d,value:a,type:p,onChange:o,helperText:s&&(i||l)?i||l:c,error:(i||l)&&s,InputLabelProps:{shrink:!0,...m},className:x(u.date,"VdtDateField-date"),...y})})}const Is=r.withStyles(Kg,{name:"VdtDateField"})(Rg),eh=a=>({root:{marginTop:a.spacing(1),width:"100%"}});function th({className:a,classes:n,input:{name:o,onChange:s,value:i}={},label:l,checkedValue:d,uncheckedValue:c,FormControlProps:p={},FormControlLabelProps:u={},SwitchProps:g={}}){const h=d&&c?y=>{const{checked:I}=y.target;s(I?d:c)}:s,m=d&&c?d===i:i;return t.jsx(r.FormControl,{className:x(n.root,"VdtSwitchField-root",a),...p,children:t.jsx(r.FormControlLabel,{label:l,className:x(n.label,"VdtSwitchField-FormControlLabel"),control:t.jsx(r.Switch,{type:"checkbox",className:x(n.switch,"VdtSwitchField-Switch"),checked:m,onChange:h,name:o,...g}),...u})})}const Ms=r.withStyles(eh,{name:"VdtSwitchField"})(th),ah=()=>{},nh=a=>a.label||a,rh=(a,n)=>{const{value:o=a}=a,{value:s=n}=n;return s===o},oh=({value:a,multiple:n})=>n&&!Array.isArray(a)?[a]:!n&&Array.isArray(a)?a.join(", "):a;function sh({input:a={},meta:n={},helperText:o=" ",label:s,loading:i,options:l=[],noOptionsText:d,getOptionLabel:c=nh,getOptionSelected:p=rh,getValue:u=oh,FormControlProps:g,clearOnBlur:h=!0,size:m="small",FormHelperTextProps:y,...I}){const{name:T,multiple:b}=a,M=u(a),{touched:L,error:S,submitError:w}=n,A=(v,O)=>{if(!O)return a.onChange(null);const{value:E=O}=O;return a.onChange(E)};return t.jsx(oe.Autocomplete,{onChange:A,options:l,renderInput:v=>t.jsx(we,{label:s,input:{name:T},meta:{touched:L,error:S,submitError:w},helperText:o,FormControlProps:g,...v,InputProps:{...v.InputProps,endAdornment:t.jsxs(t.Fragment,{children:[i?t.jsx(r.CircularProgress,{color:"inherit",size:20}):null,v.InputProps.endAdornment]})}}),loading:i,value:M,getOptionLabel:c,getOptionSelected:p,noOptionsText:d,multiple:b,clearOnBlur:h,size:m,...I})}const Jt=r.withStyles(ah,{name:"VdtAutocompleteField"})(sh),ih=async({name:a,parentField:n,parentValue:o})=>{if(n&&!o)return Promise.resolve([]);const s={constraint:o?[{field:n,value:o}]:[]},{data:{value:i=[]}={}}=await Q.metadatafield.getMetadataFieldAllowedValues({fieldName:a,metadataFieldValueConstraintListDocument:s});return i.map(({value:l})=>l)},lh=C.forwardRef(({options:a=[],getOptionsAsync:n=ih,parentField:o,parentValue:s,constraint:i,input:l,...d},c)=>{const{name:p}=l,[u,g]=C.useState(!!n),[h,m]=C.useState(a),y=C.useRef(s),I=C.useRef(l.onChange);return C.useEffect(()=>{n&&(g(!0),n({name:p,parentField:o,parentValue:s,constraint:i}).then(T=>{g(!1),m(T)}).catch(()=>g(!1)),y.current!==s&&(I.current&&I.current(""),y.current=s))},[n,p,o,s,i]),t.jsx(Jt,{ref:c,input:l,options:h,loading:u,...d})}),Ls=r.withStyles({},{name:"VdtAutocompleteConstraintField"})(lh);function Fa({classes:a,className:n,testplans:o,testplansLabel:s,noTestplansText:i,resources:l,resourcesLabel:d,shapes:c,shapesLabel:p,componentsLabel:u,dynamicParamsLabel:g,validation:h,showDynamicParams:m,FieldProps:y,form:I}){const{values:{shapeId:T,componentId:b}}=he.useFormState(),M=C.useMemo(()=>{const S=c.find(({value:w})=>w===T);return(S==null?void 0:S.components)||[]},[T,c]),L=()=>{b&&I.change("componentId","")};return t.jsxs("form",{className:x(a.root,"VdtBatonAnalysisForm-root",n),children:[t.jsx(he.Field,{name:"shapeId",children:({input:{name:S,value:w,onChange:A}})=>t.jsx(Ve,{name:S,label:p,value:w,options:c,onChange:v=>{L(),A(v)}})}),t.jsx(he.Field,{validate:h,allowNull:!0,name:"componentId",component:Ve,options:M,label:u,disabled:!T,...y}),t.jsx(he.Field,{validate:h,allowNull:!0,name:"preset",component:Jt,label:s,options:o,noOptionsText:i,helperText:"",...y}),t.jsx(he.Field,{name:"resourceId",component:Ve,label:d,options:l,...y}),m&&t.jsx(he.Field,{name:"batonDynamicParams",component:we,label:g,multiline:!0,...y})]})}Fa.propTypes={classes:e.objectOf(e.any),form:e.objectOf(e.any),className:e.string,testplans:e.arrayOf(e.shape({label:e.string,value:e.string})),testplansLabel:e.string,noTestplansText:e.string,resources:e.arrayOf(e.shape({label:e.string,value:e.string})),resourcesLabel:e.string,shapes:e.arrayOf(e.shape({label:e.string,value:e.string,components:e.arrayOf(e.shape({label:e.string,value:e.string}))})),shapesLabel:e.string,componentsLabel:e.string,dynamicParamsLabel:e.string,validation:e.func,showDynamicParams:e.bool,FieldProps:e.objectOf(e.any)},Fa.defaultProps={classes:{},form:{},className:"VdtBatonAnalysisDialog",testplans:[],testplansLabel:"Select testplan",noTestplansText:"No matching testplans",resources:[],resourcesLabel:"Select resource",shapes:[],shapesLabel:"Select shape",componentsLabel:"Select component (optional)",dynamicParamsLabel:"Dynamic parameters",validation:a=>a?void 0:"Required",showDynamicParams:!1,FieldProps:{FormControlProps:{margin:"normal"}}};const Ss=r.withStyles({},{name:"VdtBatonAnalysisForm"})(Fa),dh=()=>{const{request:a,data:{preset:n=[]}={},isLoading:o}=ne.useApi(Q.analyzepreset.listAnalyzePreset);return C.useEffect(()=>{a()},[a]),{presetOptions:C.useMemo(()=>n.map(({name:i})=>({label:i,value:i})),[n]),isLoading:o}},ch=()=>{const{request:a,data:{resource:n=[]}={},isLoading:o}=ne.useApi(Q.resource.listResourceType);return C.useEffect(()=>{a({resourceType:"vidinet"})},[a]),{resourceOptions:C.useMemo(()=>n.map(({id:i,vidinet:l})=>({label:l.name||i,value:i})),[n]),isLoading:o}},ph=a=>{const{request:n,data:{shape:o=[]}={}}=ne.useApi(Q.item.getItem);return C.useEffect(()=>{n({itemId:a,queryParams:{p:["shape.id","shape.tag","shape.containerComponent.id","shape.videoComponent.id","shape.audioComponent.id","shape.binaryComponent.id","shape.subtitleComponent.id","shape.descriptorComponent.id"]}})},[n,a]),{shapeComponentOptions:C.useMemo(()=>o.filter(({tag:[l]})=>{const d=l.toLowerCase();return!d.includes("pdf")&&!d.includes("xml")}).map(({id:l,tag:[d],containerComponent:c={},videoComponent:p=[],audioComponent:u=[],binaryComponent:g=[],subtitleComponent:h=[],descriptorComponent:m=[]})=>{const y=(T,b)=>T.map(({id:M})=>({value:M,label:`${b} component (${M})`})),I=[c.id&&{value:c.id,label:`container component (${c.id})`},...y(p,"video"),...y(u,"audio"),...y(g,"binary"),...y(h,"subtitle"),...y(m,"descriptor")];return{value:l,tag:d,label:`${d} (${l})`,components:I}}),[o])}},uh=a=>({startBatonJob:(o,s,i)=>s?Q.component.createComponentAnalyze({itemId:a,shapeId:o,componentId:s,queryParams:i}):Q.shape.createShapeAnalyze({itemId:a,shapeId:o,queryParams:i})});function gh({itemId:a,FormComponent:n,FormComponentProps:o,handleSubmit:s,submitText:i,costEstimate:l,...d}){const[{value:c,error:p},u]=C.useState({}),[g,h]=C.useState(!1),m=async I=>{const{data:T={}}=await Q.vidinet.getCostEstimate({costEstimateId:I}),{state:b,service:M=[]}=T;if(b!=="FINISHED")return setTimeout(()=>m(I),1e3);const[{cost:L}]=M;return h(!1),u(L)},y=({values:I={}})=>{u({});const{shapeId:T,componentId:b,resourceId:M,preset:L}=I;if(!T||!M||!L)return;(b?Q.component.createComponentAnalyze({itemId:a,shapeId:T,componentId:b,queryParams:{resourceId:M,preset:L},costEstimate:!0}):Q.shape.createShapeAnalyze({itemId:a,shapeId:T,queryParams:{resourceId:M,preset:L},costEstimate:!0})).then(({data:{id:w}={}})=>{h(!0),m(w)}).catch(()=>u({error:"Couldn't get cost estimate, please choose another resource"}))};return t.jsxs(t.Fragment,{children:[t.jsxs(r.DialogContent,{children:[t.jsx(n,{...d,...o}),l&&t.jsx(he.FormSpy,{subscription:{values:!0},onChange:y})]}),g?t.jsx(r.LinearProgress,{}):t.jsx(r.Divider,{light:!0}),t.jsxs(r.DialogActions,{children:[c&&t.jsx(r.Typography,{variant:"caption",children:`Estimated cost: ${c}`}),p&&t.jsx(r.Typography,{variant:"caption",color:"error",children:p}),t.jsx(r.Button,{disabled:l&&(g||!c),onClick:s,color:"primary",variant:"contained",children:i})]})]})}function za({classes:a,className:n,titleText:o,submitText:s,errorText:i,itemId:l,onClose:d,onSuccess:c,onFailure:p,InitialFormValues:u,FormComponent:g,FormComponentProps:h,costEstimate:m,showDynamicParams:y}){const{startBatonJob:I}=uh(l),{presetOptions:T,isLoading:b}=dh(),{shapeComponentOptions:M}=ph(l),{resourceOptions:L}=ch(),S=w=>{const{preset:A,shapeId:v,componentId:O,resourceId:E,batonDynamicParams:D}=w;I(v,O,{preset:A,resourceId:E,jobmetadata:D&&[{key:"batonDynamicParams",value:D}]}).then(c).catch(p)};return t.jsxs("div",{className:x(a.root,"VdtBatonAnalysisDialog-root",n),children:[t.jsxs(r.DialogTitle,{disableTypography:!0,children:[t.jsx(r.Typography,{variant:"h6",children:o}),!b&&!T.length&&t.jsx(r.Typography,{variant:"subtitle1",color:"error",children:i})]}),t.jsx(r.Divider,{}),t.jsx(he.Form,{itemId:l,FormComponent:g,FormComponentProps:h,initialValues:u,onSubmit:S,render:gh,resources:L,testplans:T,onClose:d,shapes:M,submitText:s,subscription:{submitting:!0,pristine:!0},costEstimate:m,showDynamicParams:y})]})}za.propTypes={classes:e.objectOf(e.any),className:e.string,itemId:e.string.isRequired,onClose:e.func,onSuccess:e.func,onFailure:e.func,titleText:e.string,errorText:e.string,submitText:e.string,costEstimate:e.bool,showDynamicParams:e.bool,InitialFormValues:e.objectOf(e.any),FormComponent:e.oneOfType([e.element,e.elementType]),FormComponentProps:e.objectOf(e.any)},za.defaultProps={classes:{},className:"VdtBatonAnalysisDialog",onClose:()=>{},onSuccess:()=>{},onFailure:()=>{},titleText:"Baton QC",errorText:"Please configure testplans",submitText:"Start QC",costEstimate:!0,showDynamicParams:!1,InitialFormValues:{preset:null,shapeId:"",componentId:""},FormComponent:Ss,FormComponentProps:{}};const hh=r.withStyles({},{name:"VdtBatonAnalysisDialog"})(za);function Ba({children:a,submitting:n=!1,disabled:o,...s}){return t.jsx(r.Button,{...s,disabled:o||n,children:t.jsxs(r.Box,{position:"relative",children:[t.jsx(r.Box,{position:"absolute",height:1,width:1,display:n?"inherit":"none",children:t.jsx(r.CircularProgress,{size:24})}),t.jsx(r.Box,{children:a})]})})}const yh=(a="",n="Not a URL")=>{const o=/https?:\/\/[-a-zA-Z0-9@:%._+~#=]{2,256}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/gi,s=new RegExp(o);return a.match(s)?void 0:n},ws=r.withStyles({},{name:"VdtUrlField"})(({name:a="serverUrl",label:n="Vidispine API Server",FieldProps:o={},...s})=>t.jsx(he.Field,{name:a,component:we,type:"text",label:n,validate:yh,fullWidth:!0,...o,...s})),As=r.withStyles({},{name:"VdtUsernameField"})(({name:a="userName",label:n="Username",requiredText:o="Required",FieldProps:s={},...i})=>t.jsx(he.Field,{name:a,component:we,type:"text",label:n,validate:l=>l?void 0:o,fullWidth:!0,...s,...i})),Ds=r.withStyles({},{name:"VdtPasswordField"})(({name:a="password",label:n="Password",requiredText:o="Required",FieldProps:s={},...i})=>t.jsx(he.Field,{name:a,component:we,type:"password",label:n,validate:l=>l?void 0:o,fullWidth:!0,...s,...i})),Ns=r.withStyles({},{name:"VdtRememberMeField"})(({name:a="rememberMe",label:n="Remember Me",FieldProps:o={},...s})=>t.jsx(he.Field,{name:a,label:n,component:Zt,type:"checkbox",...o,...s}));function mh({UrlFieldComponent:a=ws,UrlFieldProps:n={},UsernameFieldComponent:o=As,UsernameFieldProps:s={},PasswordFieldComponent:i=Ds,PasswordFieldProps:l={},RememberMeFieldComponent:d=Ns,RememberMeFieldProps:c={},FieldProps:p}){return t.jsxs(r.Box,{children:[a&&t.jsx(a,{FieldProps:p,...n}),o&&t.jsx(o,{FieldProps:p,...s}),i&&t.jsx(i,{FieldProps:p,...l}),d&&t.jsx(d,{FieldProps:p,...c})]})}function fh({helperText:a,submitError:n}){return t.jsx(r.Box,{py:a||n?0:.8,my:1,children:(a||n)&&t.jsx(r.FormHelperText,{error:!!n,children:n||a})})}const Ch=r.withStyles({},{name:"VdtLoginFormButtons"})(({submitting:a,SubmitButtonProps:n={},loginText:o="Login"})=>t.jsx(r.Box,{children:t.jsx(Ba,{type:"submit",submitting:a,fullWidth:!0,...n,children:o})})),Th=()=>({root:{}});function qa({classes:a,className:n,onSubmit:o,helperText:s,SubmitButtonProps:i,FormProps:l,FieldProps:d,UrlFieldComponent:c,UsernameFieldComponent:p,PasswordFieldComponent:u,RememberMeFieldComponent:g,FormFieldsComponent:h,FormFieldsProps:m,FormTextComponent:y,FormTextProps:I,FormButtonsComponent:T,FormButtonsProps:b}){return t.jsx(he.Form,{className:x(a.root,"VdtLoginForm-root",n),onSubmit:o,...l,render:({handleSubmit:M,submitting:L,submitError:S})=>t.jsxs("form",{onSubmit:M,children:[t.jsx(h,{FieldProps:d,UrlFieldComponent:c,UsernameFieldComponent:p,PasswordFieldComponent:u,RememberMeFieldComponent:g,...m}),t.jsx(y,{helperText:s,submitError:S,...I}),t.jsx(T,{submitting:L,handleSubmit:M,SubmitButtonProps:i,...b})]})})}qa.propTypes={classes:e.objectOf(e.string),className:e.string,onSubmit:e.func,helperText:e.string,SubmitButtonProps:e.objectOf(e.any),FormProps:e.objectOf(e.any),FieldProps:e.objectOf(e.any),UrlFieldComponent:e.elementType,UsernameFieldComponent:e.elementType,PasswordFieldComponent:e.elementType,RememberMeFieldComponent:e.elementType,FormFieldsComponent:e.elementType,FormFieldsProps:e.objectOf(e.any),FormTextComponent:e.elementType,FormTextProps:e.objectOf(e.any),FormButtonsComponent:e.elementType,FormButtonsProps:e.objectOf(e.any)},qa.defaultProps={className:void 0,classes:{},onSubmit:()=>null,helperText:void 0,SubmitButtonProps:{},FormProps:{},FieldProps:{},UrlFieldComponent:ws,UsernameFieldComponent:As,PasswordFieldComponent:Ds,RememberMeFieldComponent:Ns,FormFieldsComponent:mh,FormFieldsProps:{},FormTextComponent:fh,FormTextProps:{},FormButtonsComponent:Ch,FormButtonsProps:{}};const vs=r.withStyles(Th,{name:"VdtLoginForm"})(qa);vs.displayName="LoginForm";const bh=a=>({root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:11,"&$disabled":{cursor:"default"},width:"100%"},disabled:{},label:{"&$disabled":{color:a.palette.text.disabled}},labelText:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},labelCount:{marginLeft:"auto",marginRight:-11}}),Ih=C.forwardRef((a,n)=>{const{checked:o,classes:s,className:i,control:l,disabled:d,inputRef:c,label:p,name:u,onChange:g,value:h,...m}=a,y=r.useFormControl(),I=p?p.split(" "):[],T=I.slice(0,I.length-1).join(" "),b=I.slice(-1);let M=d;typeof M>"u"&&typeof l.props.disabled<"u"&&(M=l.props.disabled),typeof M>"u"&&y&&(M=y.disabled);const L={disabled:M};return["checked","name","onChange","value","inputRef"].forEach(S=>{typeof l.props[S]>"u"&&typeof a[S]<"u"&&(L[S]=a[S])}),t.jsxs("label",{className:x(s.root,{[s.disabled]:M},i),ref:n,...m,children:[C.cloneElement(l,L),t.jsx(r.Typography,{component:"span",className:x(s.label,s.labelText,{[s.disabled]:M}),children:T}),t.jsx(r.Typography,{component:"span",className:x(s.label,s.labelCount,{[s.disabled]:M}),children:b})]})}),Mh=r.withStyles(bh,{name:"VdtExpandedFormControlLabel"})(Ih),Lh=async({userName:a,password:n,serverUrl:o})=>{const s={seconds:2592e3,autoRefresh:"true"},i={password:n,username:a};o&&(Q.utils.defaultClient.defaults.baseURL=o);try{const{data:l}=await Q.user.getToken({userName:a,queryParams:s,headers:i});return l}catch(l){const{response:d={},message:c="Unknown error."}=l;let p={[ns.FORM_ERROR]:c};throw d.status===401&&(p={[ns.FORM_ERROR]:"Incorrect Username/Password"}),p}},Sh=a=>({root:{height:20,lineHeight:"inherit"},icon:{padding:0,marginLeft:a.spacing(2)}});function wh({classes:a,label:n,hidden:o,onClick:s,IconComponent:i=j.Cancel}){return t.jsxs(r.Box,{className:a.root,children:[n,t.jsx(r.IconButton,{className:a.icon,onClick:s,style:{visibility:o?"hidden":"inherit"},children:t.jsx(i,{})})]})}const xs=r.withStyles(Sh,{name:"VdtFilterFormLabel"})(wh),Ah=(a,n)=>Object.entries(a||{}).filter(([,o])=>n===!1||o!==0).map(([o,s])=>({value:o,label:`${o.toUpperCase()}${s!==void 0?` (${s})`:""}`}));function Os({className:a,fields:n,defaultValues:o={},parsedFacet:s,form:i,dirtyFields:l={},handleSubmit:d,hideEmptyFilters:c}){const p=C.useCallback(u=>{const{values:g={}}=i.getState();return g[u]&&Array.isArray(g[u])?g[u].length>0:l[u]},[l,i]);return t.jsx("form",{onSubmit:d,className:a,children:n.map(({value:u,parseOptions:g=Ah,label:h,FacetProps:m={},FilterFormLabelProps:y={},...I})=>{const T=s[u],{count:b}=m,M=g(T,c),L=c===!0&&b===!0&&M.length===0?"none":"inherit";return t.jsx("div",{style:{display:L},children:t.jsx(he.Field,{name:u,FormHelperTextProps:{style:{display:"none"}},defaultValue:o[u],label:t.jsx(xs,{hidden:!p(u),label:h,onClick:()=>i.change(u),...y}),options:M,...I})},u)})})}const Dh=a=>({header:{padding:a.spacing(2),paddingBottom:"0"},form:{paddingLeft:a.spacing(2),paddingRight:a.spacing(2),paddingBottom:a.spacing(2)}}),Es=a=>{const n=new Date(a);return n instanceof Date&&!Number.isNaN(n.getTime())},Nh=a=>typeof a=="string"||a instanceof String,vh=a=>typeof a=="number",js=a=>Nh(a)&&a.startsWith("NOW"),xh=a=>a.every(Es),Oh=a=>a.every(vh),Eh=a=>a.every(js)||a.some(js)&&a.some(Es),jh=a=>{let n;if(xh(a))n=a.sort((o,s)=>new Date(o).getTime()-new Date(s).getTime());else if(Oh(a))n=a.sort((o,s)=>Number(o)-Number(s));else if(Eh(a))n=a.sort((o,s)=>X.parseNowDate(o).getTime()-X.parseNowDate(s).getTime());else return;return[n[0],n[n.length-1]]},Ph=(a,[n,o])=>({name:a,field:[{name:a,range:[{value:[{value:n},{value:o}]}]}]}),kh=(a,n,o)=>({name:a,field:Array.isArray(n)?n.map(s=>({name:a,value:[{value:s}]})):[{name:a,value:[{value:n}]}],operation:o});function Fh(a){return(a||[]).reduce((n,o)=>({[o.name]:(o.field||[]).flatMap(({value:s,range:i})=>{if(s)return s[0].value;if(i)return i[0].value.map(l=>l.value)}),...n}),{})}function zh({className:a,classes:n,itemListType:o={},fields:s=[],initialSearchFilter:i,isLoading:l,onChange:d,headerText:c="Filter",component:p=r.Paper,FormComponent:u=Os,FormProps:g={},HeaderProps:h={},CardProps:m={},operation:y="OR",hideEmptyFilters:I}){const[T,b]=C.useState(!1),{facet:M}=o,L=C.useMemo(()=>Fh(i),[i]),S=C.useMemo(()=>X.parseFacetType(M),[M]),w=C.useCallback(A=>{const v=Object.entries(A);if(v.length===0&&!T)return;T||b(!0);const O=v.filter(([,E])=>E!==null).map(([E,D])=>s.find(z=>z.value===E).isRange&&Array.isArray(D)&&D.length>=2?Ph(E,jh(D)):kh(E,D,y));d(O)},[d,T]);return l?null:t.jsxs(p,{className:a,...m,children:[c&&t.jsx(r.Box,{className:n.header,children:t.jsx(r.Typography,{variant:"button",color:"textSecondary",...h,children:c})}),t.jsx(he.Form,{className:n.form,onSubmit:w,render:u,parsedFacet:S,validate:w,fields:s,defaultValues:L,hideEmptyFilters:I,...g})]})}const Bh=r.withStyles(Dh,{name:"VdtFilterCard"})(zh),qh=(a=!1)=>{const[n,o]=C.useState(a);return{expanded:n,onExpand:()=>o(!0),onClose:()=>o(!1),onToggle:()=>o(!n)}},Vh="all",Ps="READY",ks="STARTED",Fs="VIDINET_JOB",Va="FINISHED",zs="FINISHED_WARNING",Bs="WAITING",qs="ABORT_PENDING",Ga="ABORTED",Ua="FAILED_TOTAL",Gh=["LOWEST","LOW","MEDIUM","HIGH","HIGHEST","IMMEDIATE"],Uh=[Ps,ks,Fs,Va,zs,Bs,qs,Ga,Ua],$a=[Vh],Ya=[Ua,Ga],Wa=[Va],Ze=[Ps,ks,Fs,Bs,qs],Vs=[Va,zs,Ua,Ga];function Xt({job:a,icon:n,tooltip:o,onClick:s,disabled:i}){return t.jsx(r.Tooltip,{placement:"top",title:o,children:t.jsx(r.IconButton,{disabled:i,onClick:()=>s(a),size:"small",children:n})})}function $h({job:a={},columns:n=[],onClick:o,restartJob:s,deleteJob:i,abortJob:l,retryText:d="Retry",deleteText:c="Delete",startedText:p="Started",finishedText:u="Finished"}){const{status:g=""}=a;return t.jsxs(r.TableRow,{onClick:o!==void 0?()=>o(a):void 0,style:{cursor:o!==void 0?"pointer":"initial"},children:[t.jsxs(r.TableCell,{children:[Ze.includes(g)&&t.jsx(r.CircularProgress,{size:20}),Ya.includes(g)&&t.jsx(j.Cancel,{style:{color:Qe.red[500]},size:20}),Wa.includes(g)&&t.jsx(j.CheckCircle,{style:{color:Qe.green[500]},size:20})]}),n.map(({value:h,valueComponent:m})=>t.jsx(r.TableCell,{children:m?m({job:a,value:a[h],startedText:p,finishedText:u}):a[h]},h)),l&&Ze.indexOf(g)>-1&&t.jsx(r.TableCell,{align:"right",children:t.jsx(Xt,{job:a,icon:t.jsx(j.Cancel,{size:20}),tooltip:"Abort",onClick:l,disabled:g==="ABORTED_PENDING"})}),s&&Ya.indexOf(g)>-1&&t.jsx(r.TableCell,{align:"right",children:t.jsx(Xt,{job:a,icon:t.jsx(j.Replay,{size:20}),tooltip:d,onClick:s})}),i&&Wa.indexOf(g)>-1&&t.jsx(r.TableCell,{align:"right",children:t.jsx(Xt,{job:a,icon:t.jsx(j.Cancel,{size:20}),tooltip:c,onClick:i})})]})}const Gs=r.withStyles({},{name:"VdtJobRow"})($h),Us=[{value:"type"},{value:"started",valueComponent:({job:{status:a,started:n,finished:o},startedText:s="Started",finishedText:i="Finished"})=>Ze.includes(a)?`${s} ${n?Me(n).fromNow():""}`:`${i} ${o?Me(o).fromNow():""}`}],Yh={type:"Type",started:"Started"};function Wh({jobs:a=[],columns:n=Us,abortJob:o,deleteJob:s,restartJob:i,hideHeader:l=!1,JobRowComponent:d=Gs,JobRowProps:c={},jobColumnLabels:p=Yh}){return t.jsx(r.TableContainer,{children:t.jsxs(r.Table,{size:"small",children:[!l&&t.jsx(r.TableHead,{children:t.jsxs(r.TableRow,{children:[t.jsx(r.TableCell,{}),n.map(({value:u})=>t.jsx(r.TableCell,{children:p[u]},p[u])),t.jsx(r.TableCell,{})]})}),t.jsx(r.TableBody,{children:a.map(u=>t.jsx(d,{job:u,columns:n,abortJob:o,deleteJob:s,restartJob:i,...c},u.jobId))})]})})}const _a=r.withStyles({},{name:"VdtJobTable"})(Wh),_h=[{label:"All",value:$a},{label:"Running",value:Ze},{label:"Inactive",value:Vs}];function $s({defaultExpanded:a=!1,jobs:n,isLoading:o,hasLoaded:s,onListJob:i,refreshInterval:l=15e3,startTimeFromMinutes:d=10,JobTableComponent:c=_a,showJobList:p,setShowJobList:u}){const{expanded:g,onToggle:h,onClose:m}=qh(a),[y,I]=C.useState({first:1,number:5,sort:"startTime desc",state:$a}),T=({target:{value:L}})=>{I({...y,state:L})},b=C.useCallback(()=>{const L=new Date;L.setMinutes(L.getMinutes()-d);const S={"starttime-from":L.toISOString()};i({matrixParams:y,queryParams:S})},[y,i,d]);C.useEffect(()=>{b();const L=setInterval(b,l);return()=>clearInterval(L)},[b,l]);const M=()=>{m(),u(!1)};return C.useEffect(()=>{u(!0)},[n.length,u]),!s||!p||y.state===$a&&n.length===0?null:t.jsx(r.AppBar,{color:"inherit",position:"fixed",style:{bottom:8,left:8,top:"auto",width:"32em"},children:t.jsxs(r.Accordion,{TransitionProps:{unmountOnExit:!0},expanded:g,children:[t.jsxs(r.AccordionSummary,{expandIcon:o?t.jsx(r.CircularProgress,{size:20}):t.jsx(j.ExpandLess,{}),onClick:h,children:[t.jsx(r.Typography,{variant:"button",style:{display:"flex",alignItems:"center"},children:"Jobs"}),g&&t.jsxs(t.Fragment,{children:[t.jsx(r.Divider,{orientation:"vertical",style:{margin:"0 25px",height:30}}),t.jsx(r.Select,{value:y.state,onChange:T,fullWidth:!0,children:_h.map(({label:L,value:S})=>t.jsx(r.MenuItem,{value:S,children:L},S))})]})]}),t.jsxs(r.AccordionDetails,{style:{flexDirection:"column"},children:[n.length>0?t.jsx(c,{jobs:n,hideHeader:!0}):t.jsx("span",{children:"No jobs found"}),t.jsx(r.Button,{onClick:M,children:"Close"})]})]})})}function Ys({count:a,page:n,rowsPerPage:o,onPageChange:s}){return t.jsxs(t.Fragment,{children:[t.jsx(r.IconButton,{onClick:()=>s({page:0}),disabled:n===0,children:t.jsx(j.FirstPage,{})}),t.jsx(r.IconButton,{onClick:()=>s({page:n-1}),disabled:n===0,children:t.jsx(j.KeyboardArrowLeft,{})}),t.jsx(r.IconButton,{onClick:()=>s({page:n+1}),disabled:n>=Math.ceil(a/o)-1,children:t.jsx(j.KeyboardArrowRight,{})}),t.jsx(r.IconButton,{onClick:()=>s({page:Math.max(0,Math.ceil(a/o)-1)}),disabled:n>=Math.ceil(a/o)-1,children:t.jsx(j.LastPage,{})})]})}function Kt({count:a=0,page:n=0,rowsPerPage:o=10,rowsPerPageOptions:s=[10,25,50,100],onChangePage:i,onChangeRowsPerPage:l,ActionsComponent:d=Ys,TablePaginationProps:c={}}){const p=s.includes(o)?s:[...s,o].sort((u,g)=>u-g);return t.jsx(r.TablePagination,{component:"div",count:a,page:n,rowsPerPage:o,onPageChange:i,onRowsPerPageChange:l,ActionsComponent:d,rowsPerPageOptions:p,...c})}const Qh=a=>({root:{backgroundColor:a.palette.background.paper}});function Hh({classes:a,onSubmit:n,fields:o=[{label:"Item ID",value:"itemId"},{label:"Shape ID",value:"shapeId"},{label:"Tag",value:"tag"}],value:s="",query:i="",fieldPlaceHolder:l="Field",queryPlaceHolder:d="Query",disableReset:c=!1,disableRequired:p=!1,fieldInputRef:u,queryInputRef:g,...h}){const[m,y]=C.useState(s),[I,T]=C.useState(i),[b,M]=C.useState(null);let L=C.useRef();u&&(L=u);let S=C.useRef();g&&(S=g);const w=()=>{T(""),y("")},A=v=>(v.preventDefault(),!p&&!m?L.current.focus():!p&&!I?S.current.focus():(n({field:m,query:I}),c?null:w()));return t.jsxs(r.Box,{className:a.root,component:"form",display:"flex",onSubmit:A,...h,children:[t.jsx(r.InputBase,{className:a.inputBaseField,inputRef:L,placeholder:l,value:m,required:!p,onChange:({target:v})=>y(v.value),startAdornment:t.jsx(r.InputAdornment,{position:"start",children:t.jsx(r.IconButton,{size:"small",onClick:({currentTarget:v})=>M(v),children:t.jsx(j.Label,{})})})}),t.jsx(r.Box,{mx:2,children:t.jsx(r.Divider,{orientation:"vertical"})}),t.jsx(r.InputBase,{className:a.inputBaseQuery,fullWidth:!0,inputRef:S,placeholder:d,value:I,required:!p,onChange:({target:v})=>T(v.value),endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(r.IconButton,{type:"submit",size:"small",children:t.jsx(j.Search,{})})})}),t.jsx(r.Menu,{className:a.menu,anchorEl:b,keepMounted:!0,open:!!b,onClose:()=>M(null),children:o.map(({label:v,value:O})=>t.jsx(r.MenuItem,{onClick:()=>{y(O),M(null)},children:v},O))})]})}const Ws=r.withStyles(Qh,{name:"VdtSearchInputFieldSelect"})(Hh),Zh=a=>He.makeStyles({selected:{"&$selected":{backgroundColor:He.alpha(a,.16),color:a}}}),Rt=C.forwardRef(({primary:a,onClick:n,selected:o,secondaryColor:s,MenuItemProps:i,ListItemTextProps:l},d)=>{const c=Zh(s)();return t.jsx(r.MenuItem,{selected:o,onClick:n,dense:!0,classes:{selected:c.selected},ref:d,...i,children:t.jsx(r.ListItemText,{primary:a,primaryTypographyProps:{variant:"caption"},...l})})});Rt.propTypes={primary:e.string,secondaryColor:e.string,onClick:e.func,selected:e.bool,MenuItemProps:e.objectOf(e.any),ListItemTextProps:e.objectOf(e.any)},Rt.defaultProps={primary:"",secondaryColor:Qe.red.A200,onClick:void 0,selected:!1,MenuItemProps:{},ListItemTextProps:{}};const Jh=a=>({root:{color:a.palette.secondary.main,paddingLeft:9,paddingRight:9,borderRadius:4},indicator:{marginRight:-2,marginLeft:4,color:a.palette.secondary.main,transition:"transform .2s ease-out"},indicatorAsc:{transform:"rotate(180deg)"},menuPaper:{minWidth:150,marginTop:4}});function Qa({classes:a,caption:n,options:o,sortAsc:s,sortDesc:i,IconComponent:l,MenuItemComponent:d,onChange:c,initialSort:p,...u}){const[g,h]=C.useState(null),m=L=>{h(L.currentTarget)},y=()=>{h(null)},[I,T]=C.useState(p||{option:{},direction:i}),b=L=>S=>{let{option:w,direction:A}=I;L.value!==w.value?w=L:A=A===i?s:i,T({option:w,direction:A}),c&&c(S,w.value,A),y()},M=o===void 0||o.length===0;return t.jsxs(t.Fragment,{children:[t.jsxs(r.ButtonBase,{onClick:m,className:a.root,disabled:M,children:[t.jsx(r.Typography,{variant:"caption",color:M?"textSecondary":"textPrimary",className:a.label,children:`${n}: ${I.option.label||""}`}),l&&t.jsx("span",{className:x(a.indicator,{[a.indicatorAsc]:I.direction===s}),children:t.jsx(l,{})})]}),t.jsx(r.Menu,{anchorEl:g,keepMounted:!0,open:!!g,onClose:y,elevation:1,getContentAnchorEl:null,marginThreshold:0,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{className:a.menuPaper},children:o.map(L=>t.jsx(d,{primary:L.label,onClick:b(L),selected:L.value===I.option.value,...u},L.value))})]})}Qa.propTypes={classes:e.objectOf(e.any).isRequired,caption:e.string,sortAsc:e.string,sortDesc:e.string,IconComponent:e.elementType,MenuItemComponent:e.elementType,onChange:e.func,options:e.arrayOf(e.shape({value:e.any,label:e.string})),initialSort:e.shape({option:e.shape({value:e.any,label:e.string}),direction:e.string})},Qa.defaultProps={caption:"Sort by",sortAsc:"ascending",sortDesc:"descending",IconComponent:j.ArrowDropDown,MenuItemComponent:Rt,onChange:void 0,initialSort:void 0,options:[]};const Ha=r.withStyles(Jh,{name:"VdtSort"})(Qa);Ha.displayName="Sort";const Xh=(a,n)=>`${a}${n!==void 0?` (${n})`:""}`;function St({onSubmit:a=()=>null,onChange:n=()=>null,options:o=[],name:s,label:i,...l}){const d=C.useRef(),c=({values:p})=>{if(!d.current){d.current=!0;return}const u={name:s,value:[]};Object.values(p).forEach(h=>{u.value.push({value:h})}),n({field:[u],operation:"OR",name:s})};return t.jsx(he.Form,{onSubmit:a,render:({handleSubmit:p,form:u,dirty:g})=>t.jsxs("form",{onSubmit:p,children:[t.jsx(he.Field,{name:s,label:t.jsxs(r.Box,{height:20,style:{lineHeight:"inherit"},children:[i,t.jsx(r.IconButton,{onClick:u.reset,style:{padding:0,marginLeft:16,visibility:g?"inherit":"hidden"},children:t.jsx(j.Cancel,{})})]}),component:Ve,FormHelperTextProps:{style:{display:"none"}},options:o.map(({value:h,label:m,count:y})=>({value:h,label:Xh(m,y)})),type:"text",FormControlProps:{fullWidth:!0},...l}),t.jsx(he.FormSpy,{subscription:{values:!0},onChange:c})]})})}const _s=Me().subtract(1,"days").format("YYYY-MM-DD"),Qs=Me().subtract(7,"days").format("YYYY-MM-DD"),Kh=[{value:"jobId"},{value:"status"},...Us],Rh=["jobId","type","state","user","startTime","priority"],ey={jobId:"Job ID",type:"Type",state:"State",user:"Created By",startTime:"Started",priority:"Priority",status:"Status",started:"Started",finished:"Finished",yesterday:"Yesterday",thisWeek:"This Week",allTime:"All Time"};function ty({page:a,jobs:{job:n=[],hits:o=0}={},jobMetadata:s=[],rowsPerPage:i,onChangeSort:l,onChangePage:d,onChangeType:c,onChangeState:p,onChangePriority:u,onChangeStarttime:g,onChangeFinishtime:h,onChangeRowsPerPage:m,onChangeJobmetadata:y,onRefresh:I,matrixParams:T,jobColumnLabels:b=ey,JobTableProps:M={}}){const L=ne.useApi(Q.job.abortJob),S=ne.useApi(Q.job.duplicateJob),w=ne.useApi(Q.job.deleteJob),{request:A,data:v={}}=ne.useApi(Q.taskdefinition.listJobType),O=({jobId:P})=>{L.request({jobId:P})},E=({jobId:P})=>{S.request({jobId:P})},D=({jobId:P})=>{w.request({queryParams:{id:P}})},{uri:F=[]}=v;C.useEffect(()=>{A()},[A]),C.useEffect(()=>{I()},[L.isLoading,S.isLoading,w.isLoading]);const z=({query:P,field:V})=>{y([...s,{key:V,value:P}])},B=P=>{const V=[...s];V.splice(P,1),y(V)};let $;const Y=Rh.map(P=>({value:P,label:b[P]}));if(T&&T.sort){const[P,V="asc"]=T.sort.split(" "),W=Y.find(({value:_})=>_===P);W&&($={option:W,direction:V})}return t.jsxs(r.Box,{display:"flex",flexDirection:"column",height:"100%",width:"100%",children:[t.jsxs(r.Box,{height:40,display:"flex",justifyContent:"flex-end",alignItems:"center",children:[t.jsx(Ws,{onSubmit:z,flexGrow:1,py:.5,px:1}),t.jsx(r.Box,{children:s.map(({key:P,value:V},W)=>t.jsx(r.Chip,{size:"small",clickable:!0,label:`${P}: ${V}`,onDelete:()=>B(W)},P+V))}),t.jsx(Ha,{options:Y,initialSort:$,onChange:l,sortAsc:"asc",sortDesc:"desc"}),t.jsx(Kt,{page:a,count:o,rowsPerPage:i,onChangePage:d,onChangeRowsPerPage:m})]}),t.jsx(r.Box,{width:"100%",py:2,children:t.jsxs(r.Grid,{container:!0,alignItems:"flex-start",children:[t.jsx(r.Grid,{item:!0,lg:2,md:3,sm:4,xs:12,children:t.jsxs(r.Box,{mr:4,children:[t.jsx(St,{options:F.map(P=>({value:P,label:P})),label:b.type,name:"type",multiple:!0,onChange:c}),t.jsx(St,{options:Uh.map(P=>({value:P,label:P})),label:b.state,name:"state",multiple:!0,onChange:p}),t.jsx(St,{options:Gh.map(P=>({value:P,label:P})),label:b.priority,name:"priority",multiple:!0,onChange:u}),t.jsx(St,{options:[{value:_s,label:b.yesterday},{value:Qs,label:b.thisWeek},{value:0,label:b.allTime}],label:b.started,name:"starttime-from",onChange:g}),t.jsx(St,{options:[{value:_s,label:b.yesterday},{value:Qs,label:b.thisWeek},{value:0,label:b.allTime}],label:b.finished,name:"finishtime-from",onChange:h})]})}),t.jsx(r.Grid,{item:!0,lg:10,md:9,sm:8,xs:12,children:t.jsx(_a,{jobs:n,columns:Kh,abortJob:O,deleteJob:D,restartJob:E,jobColumnLabels:b,...M})})]})})]})}const ay=r.withStyles({},{name:"VdtJobList"})(ty),ny=r.withStyles(a=>({root:{borderStyle:"none",verticalAlign:"top",paddingRight:"1em",...a.typography.body2}}))(r.TableCell),ry=r.withStyles(a=>({root:{borderStyle:"none",wordBreak:"break-word",verticalAlign:"top",...a.typography.subtitle2}}))(r.TableCell);function oy({label:a,value:n,formatValue:o=d=>d,TableRowProps:s={},TableCellLabelProps:i={},TableCellValueProps:l={}}){return t.jsxs(r.TableRow,{component:"div",...s,children:[t.jsx(ny,{component:"div",...i,children:a}),t.jsx(ry,{component:"div",...l,children:n!==void 0?o(n):""})]})}function Hs({fields:a=[],TableRowComponent:n=oy,TableRowProps:o={},...s}){return t.jsx(r.Table,{size:"small",padding:"none",style:{width:"100%"},component:"div",children:t.jsx(r.TableBody,{component:"div",children:a.map(({label:i,value:l,...d})=>t.jsx(n,{label:i,value:s[l],TableRowProps:o,...o,...d},l))})})}const sy=(a=[])=>{const n=(o,{key:s,value:i})=>({...o,[s]:i});return a.reduce(n,{})},iy=(a,n)=>{const{request:o,data:s={},reset:i}=ne.useApi(Q.job.getJob),l=n.map(T=>typeof T=="string"?{label:T,value:T}:T);C.useEffect(()=>{const T={metadata:!0,field:n.map(b=>b.value?b.value:b)};return o({jobId:a,queryParams:T}),i},[a,o,i,n]);const{data:d=[],user:c,type:p,status:u,started:g,finished:h,priority:m}=s,I={...sy(d),user:c,type:p,status:u,started:g,finished:h,priority:m,jobId:a};return{fields:l,values:I}};function Za({jobId:a,fields:n,TableComponent:o,TableProps:s}){const{fields:i,values:l}=iy(a,n);return t.jsx(o,{fields:i,...s,...l})}Za.propTypes={jobId:e.string.isRequired,fields:e.arrayOf(e.oneOfType([e.string,e.shape({label:e.string,value:e.string,formatValue:e.func})])),TableComponent:e.elementType,TableProps:e.objectOf(e.any)},Za.defaultProps={fields:[{label:"Job ID",value:"jobId"},{label:"Resource ID",value:"vidinetResourceId"},{label:"User",value:"user"},{label:"Type",value:"type"},{label:"Priority",value:"priority"},{label:"Started",value:"started",formatValue:a=>new Date(a).toLocaleString()},{label:"Finished",value:"finished",formatValue:a=>new Date(a).toLocaleString()},{label:"Vidinet ID",value:"vidinetJobId"}],TableComponent:Hs,TableProps:{}};const Zs=r.withStyles({},{name:"VdtJobDataTable"})(Za),ly=(a=0)=>{const{hours:n,minutes:o,seconds:s}=X.formatTimeCodeSeconds(a).toTime(),i=[`${s!==void 0?s:1}s`];return o>0&&i.unshift(`${o}m`),n>0&&i.unshift(`${n}h`),i.join(" ")},dy=(a,n)=>{const{request:o,data:s={}}=ne.useApi(Q.job.getJob),i=()=>{a&&o({jobId:a})};C.useEffect(i,[a]);const l=C.useMemo(()=>s.type,[s]),{request:d,data:c={}}=ne.useApi(Q.taskdefinition.getTaskDefinitionType),p=()=>{l&&d({taskDefinitionType:l})};C.useEffect(p,[l]);const{status:u,log:{task:g=[]}={}}=s,h=C.useMemo(()=>g.map((y,I)=>{if(!g.length)return[];const{timestamp:T,subStep:b,status:M}=y;let L;if(Ze.includes(M))L=Me().add(5,"m");else if(b&&b.length){const{timestamp:w}=b.slice(-1)[0];L=Me(w).add(5,"m")}else if(g[I+1]!==void 0){const{timestamp:w}=g[I+1];L=Me(w)}else return{...y,duration:0};const S=Me(L).diff(T,"s");return{...y,duration:S}}),[g]);return C.useEffect(()=>{if(!u||!n)return()=>null;let y=null;return Ze.includes(u)&&(y=setInterval(i,1e3)),()=>clearInterval(y)},[i,u]),{tasks:C.useMemo(()=>{const{task:y=[]}=c;if(!y.length)return h.reverse();const I=y.filter(({step:T})=>!h.some(({step:b})=>b===T));return h.concat(I).reverse()},[c,h])}};function cy({task:a}){const{status:n,duration:o,description:s,errorMessage:i=""}=a,l=Ze.includes(n),d=Wa.includes(n),c=Ya.includes(n);return t.jsx(r.Tooltip,{title:i,children:t.jsxs(r.TableRow,{component:"div",children:[t.jsxs(r.TableCell,{padding:"checkbox",component:"div",children:[l&&t.jsx(r.CircularProgress,{size:20}),d&&t.jsx(j.CheckCircle,{style:{color:Qe.green[500]}}),c&&t.jsx(j.Cancel,{style:{color:Qe.red[500]}}),!l&&!d&&!c&&"-"]}),t.jsx(r.TableCell,{component:"div",children:s}),t.jsx(r.TableCell,{align:"right",component:"div",style:{fontVariantNumeric:"tabular-nums"},children:o!==void 0?ly(o):"-"})]})})}const py={root:{},TableHead:{},TableBody:{}};function Ja({className:a,classes:n,jobId:o,autoRefresh:s,TableProps:i,statusText:l,stepText:d,durationText:c,JobTaskTableRowComponent:p,JobTaskTableRowProps:u}){const{tasks:g=[]}=dy(o,s);return t.jsxs(r.Table,{className:x(a,n.root,"VdtJobTaskTable-root"),component:"div",...i,children:[t.jsx(r.TableHead,{component:"div",className:n.TableHead,children:t.jsxs(r.TableRow,{component:"div",children:[t.jsx(r.TableCell,{padding:"checkbox",component:"div",children:l}),t.jsx(r.TableCell,{component:"div",children:d}),t.jsx(r.TableCell,{align:"right",component:"div",children:c})]})}),t.jsx(r.TableBody,{component:"div",className:n.TableHead,children:g.map(h=>t.jsx(p,{task:h,...u},h.step))})]})}Ja.propTypes={className:e.string,classes:e.objectOf(e.string),jobId:e.string.isRequired,autoRefresh:e.bool,TableProps:e.objectOf(e.any),statusText:e.string,stepText:e.string,durationText:e.string,JobTaskTableRowComponent:e.elementType,JobTaskTableRowProps:e.objectOf(e.any)},Ja.defaultProps={className:void 0,classes:{},autoRefresh:!1,TableProps:{},statusText:"Status",stepText:"Step",durationText:"Duration",JobTaskTableRowComponent:cy,JobTaskTableRowProps:{}};const Js=r.withStyles(py,{name:"VdtJobTaskTable"})(Ja);function uy({jobType:a,onAbort:n,onDelete:o,onDuplicate:s,IconComponent:i=j.MoreVert}){const{status:l}=a,[d,c]=C.useState(null),p=g=>{c(g.currentTarget)},u=()=>{c(null)};return t.jsxs(t.Fragment,{children:[t.jsx(r.IconButton,{component:r.ButtonBase,onClick:p,disableRipple:!0,children:t.jsx(i,{})}),t.jsxs(r.Menu,{onClick:u,anchorEl:d,keepMounted:!0,open:!!d,onClose:u,elevation:1,PaperProps:{square:!0},getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t.jsxs(r.MenuItem,{disabled:!Vs.includes(l),onClick:o,children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.Delete,{})}),t.jsx(r.ListItemText,{primary:"Delete job"})]}),t.jsxs(r.MenuItem,{disabled:!Ze.includes(l),onClick:n,children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.Block,{})}),t.jsx(r.ListItemText,{primary:"Abort job"})]}),t.jsxs(r.MenuItem,{onClick:s,children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.Replay,{})}),t.jsx(r.ListItemText,{primary:"Duplicate job"})]})]})]})}const gy={root:{},CardContent:{height:"calc(100% - 70px)",overflow:"auto"},Alert:{},CardHeader:{},Collapse:{}};function Xa({className:a,classes:n,jobType:o,onSuccess:s,onError:i,JobMenuComponent:l,JobMenuProps:d}){const[c,p]=C.useState({}),[u,g]=C.useState(!1),h=M=>{g(!0),p(M)},m=()=>g(!1);if(!o)return null;const{jobId:y}=o,I=()=>Q.job.abortJob({jobId:y}).then(M=>{h({severity:"success",children:"Successfully aborted job"}),s&&s(M)}).catch(M=>{h({severity:"error",children:"Failed to abort job"}),i&&i(M)}),T=()=>Q.job.deleteJob({queryParams:{id:y}}).then(M=>{h({severity:"success",children:"Successfully deleted job"}),s&&s(M)}).catch(M=>{h({severity:"error",children:"Failed to deleted job"}),i&&i(M)}),b=()=>Q.job.duplicateJob({jobId:y}).then(M=>{h({severity:"success",children:"Successfully duplicated job"}),s&&s(M)}).catch(M=>{h({severity:"error",children:"Failed to duplicate job"}),i&&i(M)});return t.jsxs(r.Card,{elevation:0,className:x(a,n.root,"VdtJobCard-root"),children:[t.jsx(r.CardHeader,{className:n.CardHeader,title:y,action:t.jsx(ne.HasRole,{roleName:[X.ROLE_NAMES.ITEM_WRITE],allow:t.jsx(l,{jobType:o,onAbort:I,onDelete:T,onDuplicate:b,...d})})}),t.jsx(r.Collapse,{className:n.Collapse,in:u,children:t.jsx(oe.Alert,{className:n.Alert,onClose:m,...c})}),t.jsxs(r.CardContent,{className:n.CardContent,children:[t.jsx(Zs,{jobId:y}),t.jsx(Js,{jobId:y,autoRefresh:!0})]})]})}Xa.propTypes={className:e.string,classes:e.objectOf(e.string),jobType:e.objectOf(e.any),onSuccess:e.func,onError:e.func,JobMenuComponent:e.elementType,JobMenuProps:e.objectOf(e.any)},Xa.defaultProps={className:void 0,classes:{},jobType:void 0,onSuccess:void 0,onError:void 0,JobMenuComponent:uy,JobMenuProps:{}};const hy=r.withStyles(gy,{name:"VdtJobCard"})(Xa),Xs=C.createContext({jobs:[],hits:0,abortJob:null,transcode:null,isLoading:!1,hasLoaded:!1,onRefresh:null,deleteJob:null,shapeTags:null,restartJob:null,queryParams:null,matrixParams:null,setQueryParams:null,setMatrixParams:null}),yy={},my={first:1,number:5,sort:"startTime desc"};function fy({queryParams:a={},matrixParams:n={},JobFooterProps:o={},JobFooterComponent:s=$s,children:i}){const[l,d]=C.useState({...yy,...a}),[c,p]=C.useState({...my,...n}),[u,g]=C.useState(!0),{request:h,data:{hits:m=0,job:y=[]}={},isLoading:I,hasLoaded:T}=ne.useApi(Q.job.listJob),b=ne.useApi(Q.job.abortJob),M=ne.useApi(Q.job.duplicateJob),L=ne.useApi(Q.job.deleteJob),S=C.useCallback(()=>h({queryParams:l,matrixParams:c}),[c,h,l]),w=C.useCallback(({jobId:E})=>{b.request({jobId:E})},[b]),A=C.useCallback(({jobId:E})=>{M.request({jobId:E})},[M]),v=C.useCallback(({jobId:E})=>{L.request({queryParams:{id:E}})},[L]),O=C.useMemo(()=>({jobs:y,hits:m,abortJob:w,onRefresh:S,onListJob:h,isLoading:I,hasLoaded:T,deleteJob:v,restartJob:A,queryParams:l,matrixParams:c,setQueryParams:d,setMatrixParams:p,showJobList:u,setShowJobList:g}),[w,v,T,m,I,y,c,h,S,l,A,u]);return t.jsxs(Xs.Provider,{value:O,children:[i,t.jsx(s,{jobs:y,isLoading:I,hasLoaded:T,onListJob:h,showJobList:u,setShowJobList:g,...o})]})}const Cy="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7ZmlsbDojMkZBQkUxO308L3N0eWxlPgoKIDxnPgogIDx0aXRsZT5iYWNrZ3JvdW5kPC90aXRsZT4KICA8cmVjdCB4PSItMSIgeT0iLTEiIHdpZHRoPSIyNiIgaGVpZ2h0PSIyNiIgaWQ9ImNhbnZhc19iYWNrZ3JvdW5kIiBmaWxsPSJub25lIi8+CiA8L2c+CiA8Zz4KICA8dGl0bGU+aWNvbjwvdGl0bGU+CiAgPGcgc3Ryb2tlPSJudWxsIiBpZD0ic3ZnXzEwIj4KICAgPGcgc3Ryb2tlPSJudWxsIiBpZD0ic3ZnXzExIj4KICAgIDxwYXRoIHN0cm9rZT0ibnVsbCIgY2xhc3M9InN0MCIgZD0ibTE4Ljk2MjM4LDkuMDQ5MzMiIGlkPSJzdmdfMTIiLz4KICAgIDxwYXRoIHN0cm9rZT0ibnVsbCIgY2xhc3M9InN0MCIgZD0ibTUuMTg5NCwxOC42NTQ3IiBpZD0ic3ZnXzEzIi8+CiAgIDwvZz4KICAgPHBhdGggc3Ryb2tlPSJudWxsIiBjbGFzcz0ic3QwIiBkPSJtOC42NDI1NywxLjY2NjdsMCw0LjY4MzYxbDcuMjIzODcsNS4wNDA4M2MwLjI3Nzg0LDAuMTk4NDYgMC4yNzc4NCwwLjYzNTA3IDAsMC44MzM1MmwtNy4yMjM4Nyw1LjA0MDgzbDAsNC42ODM2MWwxMy43NzI5OCwtOS42NDUwNmMwLjM1NzIyLC0wLjIzODE1IDAuMzU3MjIsLTAuNzU0MTQgMCwtMS4wMzE5OGwtMTMuNzcyOTgsLTkuNjA1MzZ6IiBpZD0ic3ZnXzE0Ii8+CiAgIDxwYXRoIHN0cm9rZT0ibnVsbCIgY2xhc3M9InN0MCIgZD0ibTQuNTk0MDIsNS4wODAxOGwwLDMuNTcyMjRsMy45Mjk0NywyLjczODcyYzAuMjc3ODQsMC4xOTg0NiAwLjI3Nzg0LDAuNjM1MDcgMCwwLjgzMzUybC0zLjkyOTQ3LDIuNzM4NzJsMCwzLjU3MjI0bDguOTMwNjEsLTYuMjMxNThjMC4zNTcyMiwtMC4yMzgxNSAwLjM1NzIyLC0wLjc1NDE0IDAsLTEuMDMxOThsLTguOTMwNjEsLTYuMTkxODl6IiBpZD0ic3ZnXzE1Ii8+CiAgIDxwYXRoIHN0cm9rZT0ibnVsbCIgY2xhc3M9InN0MCIgZD0ibTEuNDU4MzksOC4wMTczNWwwLDIuMjYyNDJsMS41ODc2NiwxLjExMTM2YzAuMjc3ODQsMC4xOTg0NiAwLjI3Nzg0LDAuNjM1MDcgMCwwLjgzMzUybC0xLjU4NzY2LDEuMTExMzZsMCwyLjI2MjQybDQuNjgzNjEsLTMuMjk0NGMwLjM1NzIyLC0wLjIzODE1IDAuMzU3MjIsLTAuNzU0MTQgMCwtMC45OTIyOWwtNC42ODM2MSwtMy4yOTQ0eiIgaWQ9InN2Z18xNiIvPgogIDwvZz4KIDwvZz4KPC9zdmc+";function Ty(a){return t.jsx(r.SvgIcon,{component:Cy,...a})}const by="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDY0ICg5MzUzNykgLSBodHRwczovL3NrZXRjaC5jb20gLS0+CiA8dGl0bGU+SWNvbi1BcmNoaXRlY3R1cmUvNDgvQXJjaF9BV1MtRWxlbWVudGFsLU1lZGlhQ29udmVydF80ODwvdGl0bGU+CiA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KIDxkZWZzPgogIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyR3JhZGllbnQtMSIgeTI9IjAlIiB4Mj0iMTAwJSIgeTE9IjEwMCUiIHgxPSIwJSI+CiAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNDODUxMUIiLz4KICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjRkY5OTAwIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KIDwvZGVmcz4KIDxnPgogIDx0aXRsZT5iYWNrZ3JvdW5kPC90aXRsZT4KICA8cmVjdCBmaWxsPSJub25lIiBpZD0iY2FudmFzX2JhY2tncm91bmQiIGhlaWdodD0iMjYiIHdpZHRoPSIyNiIgeT0iLTEiIHg9Ii0xIi8+CiA8L2c+CiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPGcgZmlsbC1ydWxlPSJldmVub2RkIiBmaWxsPSJub25lIiBpZD0iSWNvbi1BcmNoaXRlY3R1cmUvNDgvQXJjaF9BV1MtRWxlbWVudGFsLU1lZGlhQ29udmVydF80OCI+CiAgIDxnIHN0cm9rZT0ibnVsbCIgZmlsbD0idXJsKCNsaW5lYXJHcmFkaWVudC0xKSIgaWQ9Ikljb24tQXJjaGl0ZWN0dXJlLUJHLzQ4L01lZGlhLVNlcnZpY2VzIj4KICAgIDxyZWN0IHN0cm9rZT0ibnVsbCIgaGVpZ2h0PSIyMy45OTk4MiIgd2lkdGg9IjIzLjk5OTgyIiB5PSIwIiB4PSIwIiBpZD0iUmVjdGFuZ2xlIi8+CiAgIDwvZz4KICAgPHBhdGggc3Ryb2tlPSJudWxsIiBmaWxsPSIjRkZGRkZGIiBpZD0iQVdTLUVsZW1lbnRhbC1NZWRpYUNvbnZlcnRfSWNvbl80OF9TcXVpZCIgZD0ibTExLjk5OTkxLDEwLjU0NDk0bC0xLjEyNDk5LDAuNTYyNTZsMCwxLjc4NjY5bDEuMTI0OTksMC41NjI1NmwxLjEyNDk5LC0wLjU2MjU2bDAsLTEuNzg2NjlsLTEuMTI0OTksLTAuNTYyNTZ6bTAuMTY3NjIsLTAuNzU0OTZsMS4zMDUzNywwLjY1Mjk1bDAuOTQzODcsLTAuNjI5MzJsMC40MTYyNSwwLjYyNDA3bC0wLjk1ODEyLDAuNjM4NjlsMCwyLjA0OTU5YzAsMC4xNDIxNCAtMC4wODAyNSwwLjI3MTkgLTAuMjA3MzcsMC4zMzUyOGwtMS4yOTI2MiwwLjY0NjU3bDAsMS4yMjQ1bC0wLjc0OTk5LDBsMCwtMS4yMjQ1bC0xLjI5MjYyLC0wLjY0NjU3Yy0wLjEyNzEyLC0wLjA2MzM4IC0wLjIwNzM3LC0wLjE5MzE1IC0wLjIwNzM3LC0wLjMzNTI4bDAsLTIuMDQ5NTlsLTAuOTU4MTIsLTAuNjM4NjlsMC40MTYyNSwtMC42MjQwN2wwLjk0Mzg3LDAuNjI5MzJsMS4zMDUzNywtMC42NTI5NWMwLjEwNTM3LC0wLjA1MjUxIDAuMjI5ODcsLTAuMDUyNTEgMC4zMzUyNSwwbDAsMHptMy41ODIzNSwtMC4xOTE2NWwtMy43NDk5NywtMi4wNDU4NGwtMy43NDk5NywyLjA0NTg0bDAsNC44MDUwMWwzLjc0OTk3LDIuMDQ1ODRsMy43NDk5NywtMi4wNDU4NGwwLC00LjgwNTAxem0zLjc0OTk3LC0xLjcyMjkzbDAsMi4yNTAyNGwtMC43NDk5OSwwbDAsLTEuNjQzNDJsLTIuMjQ5OTgsMS4xMjUxMmwwLDUuMDE4NzhjMCwwLjEzNzI2IC0wLjA3NSwwLjI2MzI4IC0wLjE5NTM3LDAuMzI5MjhsLTMuOTI5NiwyLjE0MzczbDAsMi4xMzgxbDEuNTYyOTksLTAuODY5MzRsMC4zNjQ4NywwLjY1NTU3bC0yLjEyMDYxLDEuMTc5MTNjLTAuMDU2NjIsMC4wMzE1IC0wLjExOTYyLDAuMDQ3MjUgLTAuMTgyMjUsMC4wNDcyNWMtMC4wNjI2MiwwIC0wLjEyNTYyLC0wLjAxNTc1IC0wLjE4MjI1LC0wLjA0NzI1bC0yLjEyMDYxLC0xLjE3OTEzbDAuMzY0ODcsLTAuNjU1NTdsMS41NjI5OSwwLjg2OTM0bDAsLTIuMTM4MWwtMy45Mjk2LC0yLjE0MzczYy0wLjEyMDM3LC0wLjA2NjAxIC0wLjE5NTM3LC0wLjE5MjAyIC0wLjE5NTM3LC0wLjMyOTI4bDAsLTUuMDE4NzhsLTIuMjQ5OTgsLTEuMTI1MTJsMCwxLjY0MzQybC0wLjc0OTk5LDBsMCwtMi4yNTAyNGMwLC0wLjE0MjE0IDAuMDgwMjUsLTAuMjcxOSAwLjIwNzM3LC0wLjMzNTY2bDIuMjQ5OTgsLTEuMTI1MTJsMC4zMzUyNSwwLjY3MDk0bC0xLjU3OTExLDAuNzg5ODNsMi4xNTM2MSwxLjA3NzEybDMuOTUzMjIsLTIuMTU2NDhjMC4xMTEzNywtMC4wNjExMyAwLjI0Nzg3LC0wLjA2MTEzIDAuMzU5MjUsMGwzLjk1MzIyLDIuMTU2NDhsMi4xNTM2MSwtMS4wNzcxMmwtMS41NzkxMSwtMC43ODk4M2wwLjMzNTI1LC0wLjY3MDk0bDIuMjQ5OTgsMS4xMjUxMmMwLjEyNzEyLDAuMDYzNzYgMC4yMDczNywwLjE5MzUyIDAuMjA3MzcsMC4zMzU2NmwwLDB6bS0wLjc0OTk5LDguMDE5MWwtMi4wNDI2MSwxLjAyMTIzbDAuMzM1MjUsMC42NzA5NGwyLjI0OTk4LC0xLjEyNTEyYzAuMTI3MTIsLTAuMDYzMzggMC4yMDczNywtMC4xOTMxNSAwLjIwNzM3LC0wLjMzNTI4bDAsLTIuMjUwMjRsLTAuNzQ5OTksMGwwLDIuMDE4NDZ6bS02Ljc0OTk1LC0xMS4zNTAybDIuMDgyMzYsMS4wNDExMWwwLjMzNTI1LC0wLjY3MDk1bC0yLjI0OTk4LC0xLjEyNTEyYy0wLjEwNTM3LC0wLjA1MjUgLTAuMjI5ODcsLTAuMDUyNSAtMC4zMzUyNSwwbC0yLjI0OTk4LDEuMTI1MTJsMC4zMzUyNSwwLjY3MDk1bDIuMDgyMzYsLTEuMDQxMTF6bS02Ljc0OTk1LDExLjM1MDJsMi4wNDI2MSwxLjAyMTIzbC0wLjMzNTI1LDAuNjcwOTRsLTIuMjQ5OTgsLTEuMTI1MTJjLTAuMTI3MTIsLTAuMDYzMzggLTAuMjA3MzcsLTAuMTkzMTUgLTAuMjA3MzcsLTAuMzM1MjhsMCwtMi4yNTAyNGwwLjc0OTk5LDBsMCwyLjAxODQ2eiIvPgogIDwvZz4KIDwvZz4KPC9zdmc+";function Iy(a){return t.jsx(r.SvgIcon,{component:by,...a})}const My="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8ZGVmcz4KICA8c3R5bGU+LmNscy0xe2ZpbGw6IzAwNjhhOTt9LmNscy0ye2ZpbGw6I2ZmZjt9LmNscy0ze2ZpbGw6IzdjNzRiZDt9LmNscy00e2ZpbGw6IzZkYzNjNTt9LmNscy01e2ZpbGw6IzQ0YThhYTt9PC9zdHlsZT4KIDwvZGVmcz4KIDx0aXRsZT5WaWRpc3BpbmUtc3RhY2tlZC1SR0I8L3RpdGxlPgogPGc+CiAgPHRpdGxlPmJhY2tncm91bmQ8L3RpdGxlPgogIDxyZWN0IGZpbGw9Im5vbmUiIGlkPSJjYW52YXNfYmFja2dyb3VuZCIgaGVpZ2h0PSIyNiIgd2lkdGg9IjI2IiB5PSItMSIgeD0iLTEiLz4KIDwvZz4KIDxnPgogIDx0aXRsZT5MYXllciAxPC90aXRsZT4KICA8cGF0aCBpZD0ic3ZnXzIiIGQ9Im04My4zNSwyNTEuMDlsLTEuOTEsLTQuODhsLTcuMjUsMGwtMS43Niw0Ljg4bC0yLjU1LDBsNy4xOCwtMTguNzlsMS42MywwbDcuMzEsMTguNzlsLTIuNjUsMHptLTQuNzIsLTEyLjc0Yy0wLjE3LC0wLjQ3IC0wLjMyLC0wLjg5IC0wLjQzLC0xLjI3cy0wLjIyLC0wLjczIC0wLjI5LC0xLjA1bDAsMGMtMC4wOCwwLjM1IC0wLjE4LDAuNyAtMC4zLDEuMDdzLTAuMjYsMC43NyAtMC40MywxLjIybC0yLjEsNS42OGw1LjUxLDBsLTEuOTYsLTUuNjV6IiBjbGFzcz0iY2xzLTIiLz4KICA8cGF0aCBpZD0ic3ZnXzMiIGQ9Im05Ny4xNiwyNTEuMDlsMCwtOC4xNmE5LjE4LDkuMTggMCAwIDAgLTAuMDcsLTEuMTdhMy4zMywzLjMzIDAgMCAwIC0wLjMxLC0xLjA3YTIsMiAwIDAgMCAtMC42NywtMC43OGEyLDIgMCAwIDAgLTEuMTcsLTAuMjlhMy42OSwzLjY5IDAgMCAwIC0xLjA5LDAuMTZhNi4yMiw2LjIyIDAgMCAwIC0xLDAuNDNhNy43Niw3Ljc2IDAgMCAwIC0xLDAuNmMtMC4zLDAuMjIgLTAuNTksMC40NSAtMC44NSwwLjY4bDAsOS42bC0yLjQ4LDBsMCwtMTMuNDVsMi4xLDBsMC4zMSwxLjU1cTAuNTgsLTAuNDQgMS4xNCwtMC43OGE4LDggMCAwIDEgMS4xMiwtMC41OWE2Ljg4LDYuODggMCAwIDEgMS4xOSwtMC4zOGE2LjE2LDYuMTYgMCAwIDEgMS4zMiwtMC4xM2E0LjI3LDQuMjcgMCAwIDEgMS40NSwwLjI2YTMuNTYsMy41NiAwIDAgMSAxLjI4LDAuODRhNC4yOCw0LjI4IDAgMCAxIDAuOTEsMS40N2E2LjI0LDYuMjQgMCAwIDEgMC4zNCwyLjJsMCw5bC0yLjUyLDAuMDF6IiBjbGFzcz0iY2xzLTIiLz4KICA8cGF0aCBpZD0ic3ZnXzQiIGQ9Im0xMjEuNjYsMjUxLjA5bC0xLjkxLC00Ljg4bC03LjI1LDBsLTEuNzYsNC44OGwtMi41NSwwbDcuMTksLTE4Ljc5bDEuNjIsMGw3LjMsMTguNzlsLTIuNjQsMHptLTQuNzIsLTEyLjc0Yy0wLjE3LC0wLjQ3IC0wLjMyLC0wLjg5IC0wLjQzLC0xLjI3cy0wLjIxLC0wLjczIC0wLjI5LC0xLjA1bDAsMGMtMC4wOCwwLjM1IC0wLjE4LDAuNyAtMC4yOSwxLjA3cy0wLjI3LDAuNzcgLTAuNDQsMS4yMmwtMi4xLDUuNjhsNS41MSwwbC0xLjk2LC01LjY1eiIgY2xhc3M9ImNscy0yIi8+CiAgPHBhdGggaWQ9InN2Z181IiBkPSJtMTMzLjU2LDI0MC4wOWEyLjksMi45IDAgMCAwIC0xLjM0LC0wLjMxYTMsMyAwIDAgMCAtMS4zNywwLjM2YTcuODEsNy44MSAwIDAgMCAtMS41MywxLjExbDAsOS44NGwtMi40OSwwbDAsLTEzLjQ1bDIuMDYsMGwwLjM1LDEuNTJhMTAuMzksMTAuMzkgMCAwIDEgMS4xNSwtMC45NWE2LjIxLDYuMjEgMCAwIDEgMSwtMC41NmE0LDQgMCAwIDEgMC44MywtMC4yN2EzLjgxLDMuODEgMCAwIDEgMC43NSwtMC4wN2EzLDMgMCAwIDEgMC45NCwwLjE0YTMuMjMsMy4yMyAwIDAgMSAwLjY5LDAuM2wtMS4wNCwyLjM0eiIgY2xhc3M9ImNscy0yIi8+CiAgPHBhdGggaWQ9InN2Z182IiBkPSJtMTQyLjIsMjUxLjE3bC0xLjkxLDBsLTUuMjksLTEzLjUzbDIuNTYsMGwzLjY3LDEwLjI0bDAsMGw0LC0xMC4yNGwyLjQ3LDBsLTUuNSwxMy41M3oiIGNsYXNzPSJjbHMtMiIvPgogIDxwYXRoIGlkPSJzdmdfNyIgZD0ibTE1Ny41OCwyNTEuMDlsLTAuNTQsLTEuMjhhNi40Miw2LjQyIDAgMCAxIC0wLjczLDAuNThhNS42Myw1LjYzIDAgMCAxIC0wLjkxLDAuNWE2LjQ2LDYuNDYgMCAwIDEgLTEuMSwwLjM1YTYuNzQsNi43NCAwIDAgMSAtMS4zMywwLjEzYTQuNjEsNC42MSAwIDAgMSAtMS42MiwtMC4yOWEzLjg2LDMuODYgMCAwIDEgLTEuMzMsLTAuODJhNCw0IDAgMCAxIC0wLjkxLC0xLjMyYTQuMjcsNC4yNyAwIDAgMSAtMC4zNCwtMS43NWEzLjg1LDMuODUgMCAwIDEgMS40MSwtMy4xN2E2LjcsNi43IDAgMCAxIDQuMDcsLTEuMjNsMi42MiwtMC4wOGwwLC0wLjUxYTMuNTYsMy41NiAwIDAgMCAtMC4yMSwtMS4zMWEyLjA4LDIuMDggMCAwIDAgLTAuNTgsLTAuODdhMi4xMywyLjEzIDAgMCAwIC0wLjg5LC0wLjQ4YTMuOTIsMy45MiAwIDAgMCAtMS4xMSwtMC4xNWE1LjgsNS44IDAgMCAwIC0xLjE0LDAuMTFhNS42NCw1LjY0IDAgMCAwIC0wLjk1LDAuMjdhNS4yNSw1LjI1IDAgMCAwIC0wLjc5LDAuMzdjLTAuMjMsMC4xNCAtMC40NSwwLjI4IC0wLjY0LDAuNDJsLTAuOTQsLTEuNzFhOC41Niw4LjU2IDAgMCAxIDEuMjIsLTAuNzVhNyw3IDAgMCAxIDEuMjEsLTAuNDdhNy4zNCw3LjM0IDAgMCAxIDEuMjIsLTAuMjVhMTAuNTgsMTAuNTggMCAwIDEgMS4yNywtMC4wN2E3LjQyLDcuNDIgMCAwIDEgMS45NCwwLjI0YTQuMDksNC4wOSAwIDAgMSAxLjU0LDAuNzlhMy44MiwzLjgyIDAgMCAxIDEsMS40NGE1LjgyLDUuODIgMCAwIDEgMC4zNywyLjE5bDAsNC41MWMwLDAuOCAwLDEuNDYgMCwyczAsMSAwLjA1LDEuMzNhNi4xNyw2LjE3IDAgMCAwIDAuMDksMC44MWE0LjQ4LDQuNDggMCAwIDAgMC4xMiwwLjQ3bC0yLjA3LDB6bS0wLjcxLC02LjM3bC0yLjQ1LDAuMDhhNC4zNyw0LjM3IDAgMCAwIC0yLjM5LDAuNjNhMS44NSwxLjg1IDAgMCAwIC0wLjc0LDEuNTdhMi41NywyLjU3IDAgMCAwIDAuMTYsMC45YTEuODksMS44OSAwIDAgMCAwLjQ2LDAuNzJhMi4yMSwyLjIxIDAgMCAwIDAuNzgsMC40OWEzLDMgMCAwIDAgMS4wNywwLjE4YTQuMjcsNC4yNyAwIDAgMCAxLjA2LC0wLjEzYTQuOTIsNC45MiAwIDAgMCAwLjg3LC0wLjMxYTMuNDQsMy40NCAwIDAgMCAwLjY4LC0wLjQzYTQuNTksNC41OSAwIDAgMCAwLjUsLTAuNDRsMCwtMy4yNnoiIGNsYXNzPSJjbHMtMiIvPgogIDxwYXRoIGlkPSJzdmdfOCIgZD0ibTE2OS4yNywyNTFhNS45NCw1Ljk0IDAgMCAxIC0yLDAuMzdhMy44MiwzLjgyIDAgMCAxIC0xLjM3LC0wLjIyYTIuNDUsMi40NSAwIDAgMSAtMC45NCwtMC42YTIuNTUsMi41NSAwIDAgMSAtMC41NSwtMC45M2EzLjgsMy44IDAgMCAxIC0wLjE4LC0xLjIxbDAsLTguNzRsLTIuMjMsMGwwLC0ybDIuMjQsMGwwLC0zbDIuNTMsLTAuNzlsMCwzLjhsNC4xNSwwbC0wLjgyLDJsLTMuMzMsMGwwLDcuODlhMS44OSwxLjg5IDAgMCAwIDAuMzIsMS4yM2ExLjE3LDEuMTcgMCAwIDAgMSwwLjRhMy4wOCwzLjA4IDAgMCAwIDAuNjgsLTAuMDhsMC42MywtMC4yMWE0LjIxLDQuMjEgMCAwIDAgMC41NiwtMC4yOWMwLjE3LC0wLjEgMC4zMiwtMC4yMSAwLjQ2LC0wLjMxbDAuNzQsMS43MWE3LjcyLDcuNzIgMCAwIDEgLTEuODksMC45OHoiIGNsYXNzPSJjbHMtMiIvPgogIDxwYXRoIGlkPSJzdmdfOSIgZD0ibTE3OS40LDIzNy4zMWE2LjU5LDYuNTkgMCAwIDEgMi41MywwLjQ3YTUuODIsNS44MiAwIDAgMSAyLDEuMzVhNi4zNSw2LjM1IDAgMCAxIDEuMzgsMi4yN2E4Ljg4LDguODggMCAwIDEgMC40NywzYTguNzEsOC43MSAwIDAgMSAtMC40OSwzYTYuNjMsNi42MyAwIDAgMSAtMS40MSwyLjNhNS43OSw1Ljc5IDAgMCAxIC0yLDEuM2E2LjcyLDYuNzIgMCAwIDEgLTIuNTEsMC40NWE2LDYgMCAwIDEgLTQuMzQsLTEuNjRhNi4xMyw2LjEzIDAgMCAxIC0xLjQ0LC0yLjMzYTguODQsOC44NCAwIDAgMSAtMC40OSwtM2E4LjU2LDguNTYgMCAwIDEgMC40OSwtM2E2LjYzLDYuNjMgMCAwIDEgMS40MSwtMi4zYTUuODYsNS44NiAwIDAgMSAxLjk0LC0xLjMyYTYuMzEsNi4zMSAwIDAgMSAyLjQ2LC0wLjU1em0wLDIuMDhhMy4zOSwzLjM5IDAgMCAwIC0xLjU5LDAuMzZhMy4yNSwzLjI1IDAgMCAwIC0xLjE3LDFhNS4xLDUuMSAwIDAgMCAtMC43MiwxLjU2YTcuOCw3LjggMCAwIDAgLTAuMjQsMmE3LjU5LDcuNTkgMCAwIDAgMC4yNiwyYTQuNjIsNC42MiAwIDAgMCAwLjc1LDEuNTZhMy4zNiwzLjM2IDAgMCAwIDEuMTksMWEzLjQ1LDMuNDUgMCAwIDAgMS41OSwwLjM2YTMuMzEsMy4zMSAwIDAgMCAxLjU3LC0wLjM2YTMuNDMsMy40MyAwIDAgMCAxLjE3LC0xYTQuODQsNC44NCAwIDAgMCAwLjczLC0xLjU3YTguMjksOC4yOSAwIDAgMCAwLC00YTQuNTIsNC41MiAwIDAgMCAtMC43NCwtMS41NmEzLjIzLDMuMjMgMCAwIDAgLTEuMTgsLTFhMy41MSwzLjUxIDAgMCAwIC0xLjY1LC0wLjM1bDAuMDMsMHoiIGNsYXNzPSJjbHMtMiIvPgogIDxwYXRoIGlkPSJzdmdfMTAiIGQ9Im0yMDcuMzMsMjQ2LjM1YTQuNDMsNC40MyAwIDAgMSAtMC40NywyLjA2YTQuNyw0LjcgMCAwIDEgLTEuMjksMS41OGE2LjEzLDYuMTMgMCAwIDEgLTEuOTUsMWE3LjgyLDcuODIgMCAwIDEgLTIuNDIsMC4zNmExMC40LDEwLjQgMCAwIDEgLTEuNzQsLTAuMTRhMTAuNzUsMTAuNzUgMCAwIDEgLTEuNDYsLTAuMzZhOS40Nyw5LjQ3IDAgMCAxIC0xLjE5LC0wLjVhMTAsMTAgMCAwIDEgLTAuOTUsLTAuNTZsMS4xNCwtMS45NWE1LjMzLDUuMzMgMCAwIDAgMC43MiwwLjQ2YTcuMTIsNy4xMiAwIDAgMCAxLDAuNDRhNy4yNyw3LjI3IDAgMCAwIDEuMTQsMC4zMmE2LDYgMCAwIDAgMS4zLDAuMTRhNS4xNyw1LjE3IDAgMCAwIDEuMjMsLTAuMTVhMy44NCwzLjg0IDAgMCAwIDEuMTQsLTAuNDZhMi43MSwyLjcxIDAgMCAwIDAuODMsLTAuODJhMi4xMywyLjEzIDAgMCAwIDAuMzIsLTEuMmEyLjU5LDIuNTkgMCAwIDAgLTAuMzQsLTEuMzRhNC41NCw0LjU0IDAgMCAwIC0wLjkxLC0xLjA2YTkuMTcsOS4xNyAwIDAgMCAtMS4yOSwtMC45bC0xLjQ5LC0wLjg1Yy0wLjUsLTAuMjkgLTEsLTAuNiAtMS40OCwtMC45MmE3LjMxLDcuMzEgMCAwIDEgLTEuMjksLTEuMTJhNS4xOCw1LjE4IDAgMCAxIC0xLC0xLjQ2YTUsNSAwIDAgMSAtMC4zNSwtMS45MmE0Ljg0LDQuODQgMCAwIDEgMC4zNywtMS44N2E0LjI4LDQuMjggMCAwIDEgMS4xLC0xLjUzYTUuMjksNS4yOSAwIDAgMSAxLjc3LC0xYTcuMzEsNy4zMSAwIDAgMSAyLjM5LC0wLjM3YTkuNDcsOS40NyAwIDAgMSAyLjU2LDAuM2ExMC41NSwxMC41NSAwIDAgMSAxLjc2LDAuNjRsMCwyLjVhOS4zNiw5LjM2IDAgMCAwIC0xLjk0LC0wLjg5YTcuMDUsNy4wNSAwIDAgMCAtMi4yNCwtMC4zNmE1LjMsNS4zIDAgMCAwIC0xLjIyLDAuMTRhMy4xMywzLjEzIDAgMCAwIC0xLDAuNDJhMi4xOSwyLjE5IDAgMCAwIC0wLjY5LDAuNzNhMi4xMiwyLjEyIDAgMCAwIC0wLjI2LDEuMDdhMi4zNSwyLjM1IDAgMCAwIDAuMzYsMS4zYTQuMTQsNC4xNCAwIDAgMCAwLjkzLDEuMDVhOS41Myw5LjUzIDAgMCAwIDEuMzIsMC45bDEuNTEsMC44N2MwLjUyLDAuMyAxLDAuNjEgMS41MSwxYTcuMzIsNy4zMiAwIDAgMSAxLjI0LDEuMWE1LjM1LDUuMzUgMCAwIDEgMC45NCwxLjQ3YTQuNjIsNC42MiAwIDAgMSAwLjM5LDEuODh6IiBjbGFzcz0iY2xzLTIiLz4KICA8cGF0aCBpZD0ic3ZnXzExIiBkPSJtMjE2Ljc0LDI1Mi4xMmExNSwxNSAwIDAgMSAtMS4zNywyLjk1YTcuMDYsNy4wNiAwIDAgMSAtMS40OCwxLjczYTQuMzIsNC4zMiAwIDAgMSAtMS41OSwwLjgyYTcuMiw3LjIgMCAwIDEgLTEuNjcsMC4yYTYuNTUsNi41NSAwIDAgMSAtMS41LC0wLjE1YTEwLjU0LDEwLjU0IDAgMCAxIC0xLjIsLTAuMzlsMC42MiwtMS45M2E0LDQgMCAwIDAgMC45MiwwLjM0YTQuNiw0LjYgMCAwIDAgMS4xMSwwLjEyYTIuODUsMi44NSAwIDAgMCAxLjE0LC0wLjI0YTMuMjksMy4yOSAwIDAgMCAxLjA4LC0wLjhhNi4yOCw2LjI4IDAgMCAwIDEsLTEuNDVhMTIuODUsMTIuODUgMCAwIDAgMC44MywtMi4xN2wtNi4wOSwtMTMuNTFsMi42NywwbDQuNjEsMTAuNTJsMC4wOCwwbDMuNTMsLTEwLjUybDIuNSwwbC01LjE5LDE0LjQ4eiIgY2xhc3M9ImNscy0yIi8+CiAgPHBhdGggaWQ9InN2Z18xMiIgZD0ibTIzMi43NywyNDcuMzRhMy43OCwzLjc4IDAgMCAxIC0wLjQxLDEuODVhMy41MSwzLjUxIDAgMCAxIC0xLjExLDEuMjVhNSw1IDAgMCAxIC0xLjY3LDAuNzFhOS41Miw5LjUyIDAgMCAxIC0yLDAuMjJhOS43OSw5Ljc5IDAgMCAxIC0xLjM4LC0wLjA5YTkuMTEsOS4xMSAwIDAgMSAtMS4yLC0wLjI4YTguOCw4LjggMCAwIDEgLTEsLTAuMzZhOC4yNyw4LjI3IDAgMCAxIC0wLjc5LC0wLjQxbDAuODgsLTEuOTFhNi41NCw2LjU0IDAgMCAwIDAuNjYsMC4zNmE1LjM0LDUuMzQgMCAwIDAgMC44LDAuMzRhNS4wNiw1LjA2IDAgMCAwIDAuOTEsMC4yNWE0Ljc3LDQuNzcgMCAwIDAgMSwwLjFhNC41NSw0LjU1IDAgMCAwIDEuMDcsLTAuMTJhMy4xNSwzLjE1IDAgMCAwIDAuODUsLTAuMzZhMS44NiwxLjg2IDAgMCAwIDAuNTUsLTAuNTdhMS40MywxLjQzIDAgMCAwIDAuMiwtMC43N2ExLjY3LDEuNjcgMCAwIDAgLTAuMjYsLTAuOTRhMi44MywyLjgzIDAgMCAwIC0wLjY5LC0wLjY5YTUuMTUsNS4xNSAwIDAgMCAtMSwtMC41M2MtMC4zNywtMC4xNiAtMC43NSwtMC4zMiAtMS4xMywtMC41YTEyLDEyIDAgMCAxIC0xLjEzLC0wLjU3YTQuMzksNC4zOSAwIDAgMSAtMSwtMC43N2EzLjcsMy43IDAgMCAxIC0wLjY5LC0xLjA4YTMuODIsMy44MiAwIDAgMSAtMC4yNiwtMS41MWEzLjQ1LDMuNDUgMCAwIDEgMC4yOSwtMS40M2EzLjIxLDMuMjEgMCAwIDEgMC44NywtMS4xOGE0LjUxLDQuNTEgMCAwIDEgMS40NiwtMC43OWE2LjU2LDYuNTYgMCAwIDEgMiwtMC4yOWE5LjA3LDkuMDcgMCAwIDEgMiwwLjJhMTAuMTEsMTAuMTEgMCAwIDEgMS41OCwwLjUxbDAsMi4xNmwtMC43OCwtMC4zMWMtMC4yNiwtMC4xIC0wLjUzLC0wLjE4IC0wLjgxLC0wLjI2YTcuNzYsNy43NiAwIDAgMCAtMC44OSwtMC4xOWE2LjI0LDYuMjQgMCAwIDAgLTEsLTAuMDdhNC4zOSw0LjM5IDAgMCAwIC0wLjkxLDAuMDlhMi4xOCwyLjE4IDAgMCAwIC0wLjczLDAuMjhhMS4yOCwxLjI4IDAgMCAwIC0wLjY2LDEuMTdhMS40LDEuNCAwIDAgMCAwLjI3LDAuODZhMi43NSwyLjc1IDAgMCAwIDAuNywwLjY1YTcuMTksNy4xOSAwIDAgMCAxLDAuNTJsMS4xNiwwLjUyYzAuMzksMC4xOCAwLjc3LDAuMzggMS4xNSwwLjZhNC40Miw0LjQyIDAgMCAxIDEsMC43OGEzLjYxLDMuNjEgMCAwIDEgMC43LDEuMDdhMy41NCwzLjU0IDAgMCAxIDAuNCwxLjQ5eiIgY2xhc3M9ImNscy0yIi8+CiAgPHBhdGggaWQ9InN2Z18xMyIgZD0ibTI0MS45NCwyNTFhNS45NCw1Ljk0IDAgMCAxIC0yLDAuMzdhMy43OSwzLjc5IDAgMCAxIC0xLjM3LC0wLjIyYTIuMzgsMi4zOCAwIDAgMSAtMC45NCwtMC42YTIuNDIsMi40MiAwIDAgMSAtMC41NSwtMC45M2EzLjgsMy44IDAgMCAxIC0wLjE4LC0xLjIxbDAsLTguNzRsLTIuMjUsMGwwLC0ybDIuMjUsMGwwLC0zbDIuNTMsLTAuNzlsMCwzLjhsNC4xNSwwbC0wLjgyLDJsLTMuMzMsMGwwLDcuODlhMS44OSwxLjg5IDAgMCAwIDAuMzIsMS4yM2ExLjE3LDEuMTcgMCAwIDAgMSwwLjRhMi45MywyLjkzIDAgMCAwIDAuNjcsLTAuMDhjMC4yMiwtMC4wNiAwLjQzLC0wLjEzIDAuNjQsLTAuMjFhNC4yMSw0LjIxIDAgMCAwIDAuNTYsLTAuMjljMC4xNywtMC4xIDAuMzIsLTAuMjEgMC40NiwtMC4zMWwwLjc0LDEuNzFhNy45MSw3LjkxIDAgMCAxIC0xLjg4LDAuOTh6IiBjbGFzcz0iY2xzLTIiLz4KICA8cGF0aCBpZD0ic3ZnXzE0IiBkPSJtMjQ4LjQsMjQ0LjlhNSw1IDAgMCAwIDAuMjksMS43YTQuMTMsNC4xMyAwIDAgMCAwLjgyLDEuMzlhMy44OSwzLjg5IDAgMCAwIDEuMzMsMC45NWE0LjQxLDQuNDEgMCAwIDAgMS44LDAuMzVhNS4xNSw1LjE1IDAgMCAwIDEuNzIsLTAuM2E4Ljg1LDguODUgMCAwIDAgMS41NSwtMC43bDAuNzEsMS43M2E2LjgsNi44IDAgMCAxIC0yLjEsMWE4LjQ5LDguNDkgMCAwIDEgLTIuMzYsMC4zNWE2LjMxLDYuMzEgMCAwIDEgLTIuODUsLTAuNmE1Ljg5LDUuODkgMCAwIDEgLTIsLTEuNTlhNi40NSw2LjQ1IDAgMCAxIC0xLjE3LC0yLjI5YTkuMzQsOS4zNCAwIDAgMSAtMC4zOCwtMi43MWE4Ljc3LDguNzcgMCAwIDEgMC40LC0yLjdhNi44NCw2Ljg0IDAgMCAxIDEuMTQsLTIuMThhNS42Miw1LjYyIDAgMCAxIDEuNzksLTEuNDZhNS4xNiw1LjE2IDAgMCAxIDIuMzQsLTAuNTNhNS41Niw1LjU2IDAgMCAxIDIuMzYsMC40OWE0LjkxLDQuOTEgMCAwIDEgMS43NiwxLjQxYTYuNDUsNi40NSAwIDAgMSAxLjA4LDIuMThhOS43Myw5LjczIDAgMCAxIDAuMzgsMi44NWwwLDAuNjZsLTguNjEsMHptNS43NiwtMy4yNmEzLjUsMy41IDAgMCAwIC0wLjU1LC0xLjE1YTIuODksMi44OSAwIDAgMCAtMC45MSwtMC44M2EyLjY3LDIuNjcgMCAwIDAgLTEuMjksLTAuMzFhMi43MiwyLjcyIDAgMCAwIC0xLjI2LDAuMjlhMy4wNSwzLjA1IDAgMCAwIC0xLDAuNzhhMy4yOCwzLjI4IDAgMCAwIC0wLjYxLDEuMTRhNC43Myw0LjczIDAgMCAwIC0wLjIsMS4zN2w2LDBhNC43OCw0Ljc4IDAgMCAwIC0wLjE4LC0xLjI5eiIgY2xhc3M9ImNscy0yIi8+CiAgPHBhdGggaWQ9InN2Z18xNSIgZD0ibTI3Ny4zMiwyNTEuMDlsMCwtOC42NWE2Ljg4LDYuODggMCAwIDAgLTAuMDksLTEuMTVhMi41NSwyLjU1IDAgMCAwIC0wLjMxLC0wLjkzYTEuNTcsMS41NyAwIDAgMCAtMC42MywtMC42MmEyLjIsMi4yIDAgMCAwIC0xLjA2LC0wLjIyYTQsNCAwIDAgMCAtMS4xNiwwLjE2YTUuNDEsNS40MSAwIDAgMCAtMS4wNSwwLjQ0YTcuMTYsNy4xNiAwIDAgMCAtMC45MSwwLjZjLTAuMjgsMC4yMyAtMC41NSwwLjQ0IC0wLjgsMC42NmExLjcyLDEuNzIgMCAwIDEgMCwwLjMzbDAsOS4zOGwtMi41MiwwbDAsLTguNThhOC43Miw4LjcyIDAgMCAwIC0wLjA4LC0xLjE3YTMuMDksMy4wOSAwIDAgMCAtMC4zMSwtMWExLjY4LDEuNjggMCAwIDAgLTAuNjQsLTAuNjNhMi4xMiwyLjEyIDAgMCAwIC0xLjA3LC0wLjIzYTMuNjgsMy42OCAwIDAgMCAtMS4xNSwwLjE3YTUuODEsNS44MSAwIDAgMCAtMSwwLjQ0YTcuMzQsNy4zNCAwIDAgMCAtMC45MiwwLjYxYy0wLjI5LDAuMjIgLTAuNTUsMC40NCAtMC44LDAuNjdsMCw5LjY4bC0yLjUzLDBsMCwtMTMuNDFsMi4xMSwwbDAuMywxLjU3YTkuOTQsOS45NCAwIDAgMSAyLjQ1LC0xLjQ0YTYuMjcsNi4yNyAwIDAgMSAyLjI5LC0wLjQ2YTMuNjMsMy42MyAwIDAgMSAyLjEyLDAuNmEzLjMyLDMuMzIgMCAwIDEgMS4yNiwxLjU4YTEwLjE1LDEwLjE1IDAgMCAxIDEuMTgsLTAuOTJhMTAuODcsMTAuODcgMCAwIDEgMS4yNCwtMC42OGE4LjgxLDguODEgMCAwIDEgMS4yNSwtMC40M2E1LjA2LDUuMDYgMCAwIDEgMS4yLC0wLjE1YTUuMzgsNS4zOCAwIDAgMSAxLjU1LDAuMjJhMy4zMiwzLjMyIDAgMCAxIDEuMzMsMC43MmEzLjUxLDMuNTEgMCAwIDEgMC45MiwxLjM0YTUuMzksNS4zOSAwIDAgMSAwLjM1LDIuMDdsMCw5LjQzbC0yLjUyLDB6IiBjbGFzcz0iY2xzLTIiLz4KICA8cGF0aCBpZD0ic3ZnXzE2IiBkPSJtMjkyLjEyLDI0Ny4zNGEzLjg5LDMuODkgMCAwIDEgLTAuNDEsMS44NWEzLjY0LDMuNjQgMCAwIDEgLTEuMTIsMS4yNWE1LDUgMCAwIDEgLTEuNjcsMC43MWE5LjM4LDkuMzggMCAwIDEgLTIsMC4yMmExMCwxMCAwIDAgMSAtMS4zOCwtMC4wOWE4LjYsOC42IDAgMCAxIC0xLjE1LC0wLjI0YTguMjcsOC4yNyAwIDAgMSAtMSwtMC4zNmE3LDcgMCAwIDEgLTAuNzgsLTAuNDFsMC44NywtMS45MXEwLjMsMC4xOCAwLjY2LDAuMzZhNS44Myw1LjgzIDAgMCAwIDAuOCwwLjM0YTUuMTcsNS4xNyAwIDAgMCAwLjkyLDAuMjVhNC43NCw0Ljc0IDAgMCAwIDEsMC4xYTQuNDksNC40OSAwIDAgMCAxLjA3LC0wLjEyYTMuMTUsMy4xNSAwIDAgMCAwLjg1LC0wLjM2YTEuODYsMS44NiAwIDAgMCAwLjU1LC0wLjU3YTEuNDMsMS40MyAwIDAgMCAwLjIsLTAuNzdhMS42LDEuNiAwIDAgMCAtMC4yNiwtMC45NGEyLjY2LDIuNjYgMCAwIDAgLTAuNjksLTAuNjlhNS4xNSw1LjE1IDAgMCAwIC0xLC0wLjUzbC0xLjEzLC0wLjVjLTAuMzgsLTAuMTcgLTAuNzYsLTAuMzYgLTEuMTMsLTAuNTdhNC4xMiw0LjEyIDAgMCAxIC0xLC0wLjc3YTMuNTMsMy41MyAwIDAgMSAtMC43LC0xLjA4YTQsNCAwIDAgMSAtMC4yNiwtMS41MWEzLjYyLDMuNjIgMCAwIDEgMC4yOSwtMS40M2EzLjMyLDMuMzIgMCAwIDEgMC44NywtMS4xOGE0LjUxLDQuNTEgMCAwIDEgMS40NiwtMC43OWE2LjU2LDYuNTYgMCAwIDEgMiwtMC4yOWE5LjIzLDkuMjMgMCAwIDEgMiwwLjJhMTAuMzMsMTAuMzMgMCAwIDEgMS41NywwLjUxbDAsMi4xNmwtMC43OCwtMC4zMWMtMC4yNiwtMC4xIC0wLjUzLC0wLjE4IC0wLjgxLC0wLjI2YTcuNzYsNy43NiAwIDAgMCAtMC44OSwtMC4xOWE2LjI0LDYuMjQgMCAwIDAgLTEsLTAuMDdhNC4zOSw0LjM5IDAgMCAwIC0wLjkxLDAuMDlhMi4xOCwyLjE4IDAgMCAwIC0wLjczLDAuMjhhMS4zMywxLjMzIDAgMCAwIC0wLjQ5LDAuNDhhMS4zNiwxLjM2IDAgMCAwIC0wLjE3LDAuNjlhMS40LDEuNCAwIDAgMCAwLjI3LDAuODZhMi42NCwyLjY0IDAgMCAwIDAuNzEsMC42NWE2LjIyLDYuMjIgMCAwIDAgMSwwLjUybDEuMTUsMC41MmMwLjM5LDAuMTggMC43NywwLjM4IDEuMTUsMC42YTQuMjEsNC4yMSAwIDAgMSAxLDAuNzhhMy42MSwzLjYxIDAgMCAxIDAuNywxLjA3YTMuMzgsMy4zOCAwIDAgMSAwLjM3LDEuNDV6IiBjbGFzcz0iY2xzLTIiLz4KICA8cGF0aCBpZD0ic3ZnXzE3IiBkPSJtMzE0Ljg0LDI0NS40NmE2LjQxLDYuNDEgMCAwIDEgLTAuMzQsMmE0LjYzLDQuNjMgMCAwIDEgLTEuMTEsMS44MWE1LjU3LDUuNTcgMCAwIDEgLTIsMS4zMWE4LjM1LDguMzUgMCAwIDEgLTMuMTIsMC41MWwtNS4wOCwwbDAsLTE4LjczbDUuNDYsMGE1LjgxLDUuODEgMCAwIDEgMi4yNiwwLjQxYTQuNjgsNC42OCAwIDAgMSAxLjU4LDEuMDlhNC4zNyw0LjM3IDAgMCAxIDAuOTIsMS40OWE0Ljc5LDQuNzkgMCAwIDEgMC4zLDEuNjRhNC42NCw0LjY0IDAgMCAxIC0wLjYyLDIuNDhhNC4zNSw0LjM1IDAgMCAxIC0xLjc3LDEuNjJsMCwwYTQuMTUsNC4xNSAwIDAgMSAxLjM4LDAuNDVhNC4yLDQuMiAwIDAgMSAxLjE0LDAuOTJhNC4zMyw0LjMzIDAgMCAxIDAuNzYsMS4zMWE0LjgyLDQuODIgMCAwIDEgMC4yNCwxLjY5em0tOS4xNiwtMTAuODVsMCw1Ljc5bDIuMzIsMGEzLjMyLDMuMzIgMCAwIDAgMS4xMSwtMC4xOWEzLDMgMCAwIDAgMSwtMC41N2EzLDMgMCAwIDAgMC43LC0wLjk0YTIuOSwyLjkgMCAwIDAgMC4yNywtMS4yOGEyLjc0LDIuNzQgMCAwIDAgLTAuNzgsLTIuMDZhMy40MiwzLjQyIDAgMCAwIC0yLjQzLC0wLjc1bC0yLjE5LDB6bTYuNDUsMTFhMywzIDAgMCAwIC0wLjIzLC0xLjE3YTIuNTQsMi41NCAwIDAgMCAtMC43LC0wLjkzYTMuMTMsMy4xMyAwIDAgMCAtMS4xNCwtMC42M2E1LDUgMCAwIDAgLTEuNTcsLTAuMjNsLTIuODEsMGwwLDYuMTlsMi41OCwwYTUuMzIsNS4zMiAwIDAgMCAxLjY4LC0wLjI0YTMuNjIsMy42MiAwIDAgMCAxLjIxLC0wLjY3YTIuODIsMi44MiAwIDAgMCAwLjczLC0xYTMuMjcsMy4yNyAwIDAgMCAwLjI1LC0xLjMyeiIgY2xhc3M9ImNscy0yIi8+CiAgPHBhdGggaWQ9InN2Z18xOCIgZD0ibTMyNC44NSwyNDAuMDlhMi44NiwyLjg2IDAgMCAwIC0xLjMzLC0wLjMxYTMsMyAwIDAgMCAtMS4zNywwLjM2YTcuMjYsNy4yNiAwIDAgMCAtMS41MywxLjExbDAsOS44NGwtMi41LDBsMCwtMTMuNDVsMi4wNywwbDAuMzQsMS41MmExMC4zOSwxMC4zOSAwIDAgMSAxLjE1LC0wLjk1YTcuMzEsNy4zMSAwIDAgMSAxLC0wLjU2YTQsNCAwIDAgMSAwLjgzLC0wLjI3YTMuOTEsMy45MSAwIDAgMSAwLjc2LC0wLjA3YTMsMyAwIDAgMSAwLjk0LDAuMTRhMy4xMywzLjEzIDAgMCAxIDAuNjgsMC4zbC0xLjA0LDIuMzR6IiBjbGFzcz0iY2xzLTIiLz4KICA8cGF0aCBpZD0ic3ZnXzE5IiBkPSJtMzM1LjQ5LDI1MS4wOWwtMC41NCwtMS4yOGE2LjQyLDYuNDIgMCAwIDEgLTAuNzMsMC41OGE1LjYzLDUuNjMgMCAwIDEgLTAuOTEsMC41YTYuNDYsNi40NiAwIDAgMSAtMS4xLDAuMzVhNi45LDYuOSAwIDAgMSAtMS4zMywwLjEzYTQuNjEsNC42MSAwIDAgMSAtMS42MiwtMC4yOWEzLjc3LDMuNzcgMCAwIDEgLTEuMzMsLTAuODJhMy44OSwzLjg5IDAgMCAxIC0wLjkxLC0xLjMyYTQuMjcsNC4yNyAwIDAgMSAtMC4zNCwtMS43NWEzLjg1LDMuODUgMCAwIDEgMS40MSwtMy4xN2E2LjY4LDYuNjggMCAwIDEgNC4wNywtMS4yM2wyLjYyLC0wLjA4bDAsLTAuNTFhMy41NiwzLjU2IDAgMCAwIC0wLjIxLC0xLjMxYTIuMTMsMi4xMyAwIDAgMCAtMS40NywtMS4zNWEzLjkyLDMuOTIgMCAwIDAgLTEuMTEsLTAuMTVhNS45MSw1LjkxIDAgMCAwIC0yLjA5LDAuMzhhNS4yNSw1LjI1IDAgMCAwIC0wLjc5LDAuMzdjLTAuMjMsMC4xNCAtMC40NSwwLjI4IC0wLjY0LDAuNDJsLTEsLTEuNzFhOS4yMyw5LjIzIDAgMCAxIDEuMjMsLTAuNzVhNi43MSw2LjcxIDAgMCAxIDEuMjEsLTAuNDdhNy4zNCw3LjM0IDAgMCAxIDEuMjIsLTAuMjVhMTAuNDYsMTAuNDYgMCAwIDEgMS4yNywtMC4wN2E3LjQyLDcuNDIgMCAwIDEgMS45NCwwLjI0YTQsNCAwIDAgMSAxLjUzLDAuNzlhMy44NCwzLjg0IDAgMCAxIDEsMS40NGE1LjgyLDUuODIgMCAwIDEgMC4zNywyLjE5bDAsNC41MWMwLDAuOCAwLDEuNDYgMCwyczAsMSAwLjA1LDEuMzNhNi4xNyw2LjE3IDAgMCAwIDAuMDksMC44MWE0LjQ4LDQuNDggMCAwIDAgMC4xMiwwLjQ3bC0yLjAxLDB6bS0wLjcxLC02LjM3bC0yLjQ2LDAuMDhhNC4zMyw0LjMzIDAgMCAwIC0yLjM4LDAuNjNhMS44NSwxLjg1IDAgMCAwIC0wLjc0LDEuNTdhMi41NywyLjU3IDAgMCAwIDAuMTUsMC45YTIsMiAwIDAgMCAwLjQ3LDAuNzJhMi4yMSwyLjIxIDAgMCAwIDAuNzgsMC40OWEyLjkzLDIuOTMgMCAwIDAgMS4wNywwLjE4YTQuMzMsNC4zMyAwIDAgMCAxLjA2LC0wLjEzYTQuOTIsNC45MiAwIDAgMCAwLjg3LC0wLjMxYTMuNDQsMy40NCAwIDAgMCAwLjY4LC0wLjQzYTUuNzgsNS43OCAwIDAgMCAwLjUsLTAuNDRsMCwtMy4yNnoiIGNsYXNzPSJjbHMtMiIvPgogIDxwYXRoIGlkPSJzdmdfMjAiIGQ9Im0zNDkuNzksMjUxLjA5bDAsLTguMTZhOS4xOCw5LjE4IDAgMCAwIC0wLjA3LC0xLjE3YTMuMzMsMy4zMyAwIDAgMCAtMC4zMSwtMS4wN2EyLDIgMCAwIDAgLTAuNjcsLTAuNzhhMiwyIDAgMCAwIC0xLjE3LC0wLjI5YTMuNjksMy42OSAwIDAgMCAtMS4wOSwwLjE2YTYuMjIsNi4yMiAwIDAgMCAtMSwwLjQzYTcuNzYsNy43NiAwIDAgMCAtMSwwLjZhMTAuMTIsMTAuMTIgMCAwIDAgLTAuODUsMC42OGwwLDkuNmwtMi40OSwwbDAsLTEzLjQ1bDIuMSwwbDAuMzEsMS41NXEwLjU4LC0wLjQ0IDEuMTQsLTAuNzhhOCw4IDAgMCAxIDEuMTIsLTAuNTlhNi44OCw2Ljg4IDAgMCAxIDEuMTksLTAuMzhhNi4xNiw2LjE2IDAgMCAxIDEuMzIsLTAuMTNhNC4yNyw0LjI3IDAgMCAxIDEuNDUsMC4yNmEzLjU2LDMuNTYgMCAwIDEgMS4yOCwwLjg0YTQuMjgsNC4yOCAwIDAgMSAwLjkxLDEuNDdhNi4yNCw2LjI0IDAgMCAxIDAuMzQsMi4ybDAsOWwtMi41MSwwLjAxeiIgY2xhc3M9ImNscy0yIi8+CiAgPHBhdGggaWQ9InN2Z18yMSIgZD0ibTM2NS4zMSwyNTEuMDhhMTEuNDMsMTEuNDMgMCAwIDEgLTIuNjksMC4yOWE4LjQyLDguNDIgMCAwIDEgLTIuNzIsLTAuNDNhNi4yOCw2LjI4IDAgMCAxIC0yLjI0LC0xLjI3YTYsNiAwIDAgMSAtMS41MSwtMi4xM2E3LjM1LDcuMzUgMCAwIDEgLTAuNTcsLTNhNy42NCw3LjY0IDAgMCAxIDAuNTUsLTIuOWE3LDcgMCAwIDEgMS41MSwtMi4yOGE2LjkzLDYuOTMgMCAwIDEgMi4yNSwtMS41YTcuMjQsNy4yNCAwIDAgMSAyLjgsLTAuNTRhOS4yMyw5LjIzIDAgMCAxIDEuMTQsMC4wNmE2LjYsNi42IDAgMCAxIDAuODcsMC4xNGwwLC02LjUybDIuNTMsMGwwLDE5LjQxYTguMjIsOC4yMiAwIDAgMSAtMS45MiwwLjY3em0tMC42MSwtMTEuMzVsLTAuMzgsLTAuMTFsLTAuNDEsLTAuMWEzLjQ2LDMuNDYgMCAwIDAgLTAuNDksLTAuMDZhNS45Miw1LjkyIDAgMCAwIC0wLjYyLDBhNC43OCw0Ljc4IDAgMCAwIC0xLjgxLDAuMzRhNC4yMSw0LjIxIDAgMCAwIC0xLjQ5LDFhNC42Nyw0LjY3IDAgMCAwIC0xLDEuNTZhNS4zNSw1LjM1IDAgMCAwIC0wLjM4LDJhNS45LDUuOSAwIDAgMCAwLjMxLDJhNCw0IDAgMCAwIDAuOTEsMS41NGE0LjMzLDQuMzMgMCAwIDAgMS41MiwxYTUuNzMsNS43MyAwIDAgMCAyLjEyLDAuMzdhNS4xNyw1LjE3IDAgMCAwIDAuOTUsLTAuMDlhMy43MSwzLjcxIDAgMCAwIDAuNzgsLTAuMjNsLTAuMDEsLTkuMjJ6IiBjbGFzcz0iY2xzLTIiLz4KICA8ZyBzdHJva2U9Im51bGwiIGlkPSJzdmdfMzciPgogICA8cmVjdCBzdHJva2U9Im51bGwiIHg9IjAuMTY2NjciIGlkPSJzdmdfMzEiIGhlaWdodD0iNi41MjQwNyIgd2lkdGg9IjYuNTI0MDciIHk9IjAuMjc2NjciIGNsYXNzPSJjbHMtMyIvPgogICA8cmVjdCBzdHJva2U9Im51bGwiIGlkPSJzdmdfMzIiIGhlaWdodD0iNi41MjQwNyIgd2lkdGg9IjYuNTI0MDciIHk9IjAuMjc2NjciIHg9IjE3LjE4MjYzIiBjbGFzcz0iY2xzLTQiLz4KICAgPHJlY3Qgc3Ryb2tlPSJudWxsIiB4PSIwLjE2NjY3IiBpZD0ic3ZnXzMzIiBoZWlnaHQ9IjYuNTI0MDciIHdpZHRoPSI2LjUyNDA3IiB5PSI4Ljc4NDY2IiBjbGFzcz0iY2xzLTEiLz4KICAgPHBhdGggc3Ryb2tlPSJudWxsIiBpZD0ic3ZnXzM0IiBkPSJtMTcuMTgyNjMsMTUuMzA4NzNhNi41MjA1Niw2LjUyMDU2IDAgMCAwIDYuNTIwNTYsLTYuNTI0MDdsLTYuNTIwNTYsMGwwLDYuNTI0MDciIGNsYXNzPSJjbHMtNSIvPgogICA8cmVjdCBzdHJva2U9Im51bGwiIHg9IjAuMTY2NjciIGlkPSJzdmdfMzUiIGhlaWdodD0iNi41MjQwNyIgd2lkdGg9IjYuNTI0MDciIHk9IjE3LjI5MjY0IiBjbGFzcz0iY2xzLTEiLz4KICAgPHBhdGggc3Ryb2tlPSJudWxsIiBpZD0ic3ZnXzM2IiBkPSJtOC42ODUxOCwyMy44MTY3MWE2LjUyMDU2LDYuNTIwNTYgMCAwIDAgNi41MjA1NiwtNi41MjQwN2wtNi41MjA1NiwwbDAsNi41MjQwNyIgY2xhc3M9ImNscy01Ii8+CiAgPC9nPgogPC9nPgo8L3N2Zz4=";function Ly(a){return t.jsx(r.SvgIcon,{component:My,...a})}const Sy=a=>{const n=a.palette.type==="light";return{badge:{height:"1rem",marginRight:6,borderColor:n?"rgba(0, 0, 0, 0.87)":"rgba(255, 255, 255, 0.8)",color:n?"rgba(0, 0, 0, 0.87)":"rgba(255, 255, 255, 0.8)",borderWidth:1.45,borderStyle:"solid",backgroundColor:n?"unset":"rgba(0, 0, 0, .15)",padding:"0 4px",borderRadius:2.5,whiteSpace:"nowrap",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:900,fontSize:"0.7rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:32,textAlign:"center"}}};function wy({className:a,classes:n,children:o}){return t.jsx("span",{className:x(n.badge,"VdtMediaBadge-badge",a),children:o})}const ea=r.withStyles(Sy,{name:"VdtMediaBadge"})(wy),Ay=({shapeType:a,transcodePresetType:n})=>{const o=n||X.parseShapeType(a),s=[];if(o.containerFormat&&s.push(o.containerFormat),o.videoFormat&&s.push(o.videoFormat),o.audioFormat&&s.push(o.audioFormat),o.height){const{fieldOrder:i,height:l}=o,d=`${l}${i?i[0]:"px"}`;switch(l){case 720:s.push("HD Ready");break;case 1080:s.push("Full HD");break;case 1440:s.push("Quad HD");break;case 2160:s.push("4K UHD");break;case 4320:s.push("8K UHD");break}l>0&&l<720&&s.push("SD"),s.push(d)}if(o.audioChannels){const{audioChannels:i}=o;switch(i){case 1:s.push("Mono");break;case 2:s.push("Stereo");break;case 3:s.push("2.1");break;case 6:s.push("5.1");break;case 8:s.push("7.1");break}}if(o.colorPrimaries){const{colorPrimaries:i}=o;switch(i){case"BT.2020":case"REC.2020":s.push("HDR");break;case"BT.709":case"REC.709":s.push("SDR");break}}if(o.textFormat&&s.push("CC"),o.frameRate)try{o.frameRate.match(/\d/)?s.push(`${o.frameRate}fps`):s.push(o.frameRate)}catch{}return o.aspectRatio&&s.push(o.aspectRatio),[...new Set(s)]},Dy=()=>({root:{}});function Ny({classes:a,className:n,generateBadges:o=Ay,shapeType:s,transcodePresetType:i,MediaBadgeComponent:l=ea,MediaBadgeProps:d={}}){const c=C.useMemo(()=>o({shapeType:s,transcodePresetType:i}),[s]);return t.jsx("div",{className:x(a.root,"VdtMediaBadges-root",n),children:c.map(p=>t.jsx(l,{...d,children:p},p))})}const Ks=r.withStyles(Dy,{name:"VdtMediaBadges"})(Ny),vy=a=>({root:{display:"flex"},thumbnail:{marginLeft:a.spacing(2),marginRight:a.spacing(2),width:80,height:40,fontFamily:a.typography.fontFamily,fontSize:a.typography.pxToRem(20),textTransform:"uppercase",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:a.palette.background.default,backgroundColor:a.palette.type==="light"?a.palette.grey[400]:a.palette.grey[600]},detailContainer:{},thumbnailContainer:{},description:{fontStyle:"italic"}});function Ka({className:a,classes:n,transcodePresetType:o,containerFormatText:s,MediaBadgesComponent:i,MediaBadgesProps:l}){const d=X.parseTranscodePreset(o),c=d.containerFormat?d.containerFormat.split("_")[0].split("-")[0]:s;return t.jsxs("div",{className:x(n.root,"VdtShapeTagCard-root",a),children:[t.jsx("div",{className:n.thumbnailContainer,children:t.jsx("div",{className:n.thumbnail,children:c})}),t.jsxs("div",{className:n.detailContainer,children:[t.jsx(i,{transcodePresetType:d,parseShape:!1,...l}),d.description&&t.jsx("div",{className:n.description,children:d.description})]})]})}const Rs=r.withStyles(vy,{name:"VdtShapeTagCard"})(Ka);Ka.propTypes={classes:e.objectOf(e.string),className:e.string,transcodePresetType:e.objectOf(e.any).isRequired,containerFormatText:e.string,MediaBadgesComponent:e.elementType,MediaBadgesProps:e.objectOf(e.any)},Ka.defaultProps={classes:{},className:void 0,containerFormatText:"Source",MediaBadgesComponent:Ks,MediaBadgesProps:{}};const xy=({onEstimate:a})=>{const[n,o]=C.useState({});return{shapeTagDetail:n,onGetShapeTag:i=>Q.shapetag.getShapeTag({tagName:i}).then(({data:l})=>(o(d=>({...d,[i]:l})),a?a(i):Promise.resolve())).then(l=>{if(l){const{data:{service:[{cost:d,state:c,message:p}]}}=l;o(u=>{const g={...u};return g[i].cost=d,g[i].estimateError=c!=="FINISHED"?p:!1,g})}}).catch(l=>{if(l.config&&l.config.url&&l.config.url.includes("/cost/"))o(d=>{const c={...d};return c[i].estimateError="unspecified reason.",c});else throw new Error(l)})}},Oy=a=>{const[n,o]=C.useState(a);return{expanded:n,onChangeExpand:i=>(l,d)=>o(d?i:!1)}},Ey=r.withStyles(a=>({root:{border:a.palette.type==="light"?"1px solid rgba(0, 0, 0, .125)":"1px solid rgba(0, 0, 0, .3)",boxShadow:"none","&:not(:last-child)":{borderBottom:0},"&:before":{display:"none"},"&$expanded":{margin:"auto"}},expanded:{}}))(r.Accordion),jy=r.withStyles(a=>({root:{backgroundColor:a.palette.type==="light"?"rgba(0, 0, 0, .03)":"rgba(0, 0, 0, .1)",borderBottom:a.palette.type==="light"?"1px solid rgba(0, 0, 0, .125)":"1px solid rgba(0, 0, 0, .3)",marginBottom:-1,minHeight:56,"&$expanded":{minHeight:56}},content:{"&$expanded":{margin:"12px 0"}},expanded:{}}))(r.AccordionSummary),Py=r.withStyles(a=>({root:{padding:a.spacing(2)}}))(r.AccordionDetails),ky=a=>({root:{},Accordion:{},AccordionDetails:{},AccordionSummary:{},Button:{},shapeTagList:{height:200,overflowY:"scroll","&::-webkit-scrollbar":{WebkitAppearance:"none"},"&::-webkit-scrollbar:vertical":{width:11},"&::-webkit-scrollbar-thumb":{borderStyle:"solid",borderWidth:2,borderColor:a.palette.divider,backgroundColor:"rgba(0, 0, 0, 0.5)"}},LinearProgress:{width:"100%"},shapeTagDetail:{width:"100%",display:"flex",justifyContent:"space-between"},Typography:{},costEstimateText:{fontStyle:"italic",color:a.palette.primary.main,marginTop:a.spacing(2)},action:{display:"flex",flexDirection:"column",alignItems:"flex-end"}});function Ra({className:a,classes:n,shapeTagNames:o,onTranscode:s,onEstimate:i,transcodeText:l,ShapeTagCardComponent:d,ShapeTagCardProps:c,loadingCostEstimateText:p,costEstimateText:u,failedCostEstimateText:g}){const{shapeTagDetail:h,onGetShapeTag:m}=xy({onEstimate:i}),{expanded:y,onChangeExpand:I}=Oy();return C.useEffect(()=>{!y||h[y]||m(y)},[y]),t.jsx("div",{className:x(n.root,"VdtShapeTagListAccordion-root",a),children:t.jsx("div",{className:n.shapeTagList,children:o.map(T=>t.jsxs(Ey,{className:n.Accordion,square:!0,expanded:y===T,onChange:I(T),children:[t.jsx(jy,{className:n.AccordionSummary,children:t.jsx(r.Typography,{noWrap:!0,className:n.Typography,children:T.replace("__","")})}),y===T&&t.jsx(Py,{className:n.AccordionDetails,children:h[y]?t.jsxs("div",{className:n.shapeTagDetail,children:[t.jsx(d,{transcodePresetType:h[y],...c}),t.jsxs("div",{className:n.action,children:[s&&t.jsx("div",{children:t.jsx(r.Button,{color:"primary",variant:"contained",onClick:()=>s(T),disabled:i&&h[y].estimateError,className:n.Button,children:l})}),i&&t.jsx("div",{className:n.costEstimateText,children:h[y].estimateError?`${g} ${h[y].estimateError}`:h[y].cost?`${u} $${h[y].cost.value}`:p})]})]}):t.jsx(r.LinearProgress,{className:n.LinearProgress})})]},T))})})}const ei=r.withStyles(ky,{name:"VdtShapeTagListAccordion"})(Ra);Ra.propTypes={classes:e.objectOf(e.string),className:e.string,shapeTagNames:e.arrayOf(e.string),onTranscode:e.func,onEstimate:e.func,transcodeText:e.string,ShapeTagCardComponent:e.elementType,ShapeTagCardProps:e.objectOf(e.any),loadingCostEstimateText:e.string,costEstimateText:e.string,failedCostEstimateText:e.string},Ra.defaultProps={classes:{},className:void 0,shapeTagNames:[],onTranscode:void 0,onEstimate:void 0,transcodeText:"Transcode",ShapeTagCardComponent:Rs,ShapeTagCardProps:{},loadingCostEstimateText:"Requesting cost estimate",costEstimateText:"Estimated cost:",failedCostEstimateText:"Failed:"};const en="TRANSCODER",tn="BITMOVIN",an="ELEMENTAL_MEDIACONVERT",Fy=({tabs:a=[]})=>{const n=a.length>0?a[0].value:void 0,[o,s]=C.useState(n);return{currentTab:o,onChangeTab:(l,d)=>d&&s(d)}},zy=({listShapeTagRef:a,initialHideDefault:n,initialSearchValue:o="",tabs:s=[]})=>{const[i,l]=C.useState(n),d=I=>l(I.target.checked),[c,p]=C.useState(o),u=I=>p(I.target.value),g=()=>p(""),{request:h,data:m={}}=ne.useApi(Q.shapetag.listShapeTag,void 0,a);return C.useEffect(()=>{h()},[]),{shapeTagNames:C.useMemo(()=>{const{uri:I=[]}=m,T=I.filter(b=>!(i&&b.startsWith("__"))&&!(c&&!b.toLowerCase().includes(c.toLowerCase())));return s.reduce((b,{value:M,tagNameFilter:L})=>({...b,[M]:L?L(T):T}),{})},[m,i,c]),onChangeShowDefault:d,hideDefault:i,onChangeSearch:u,onClearSearch:g,searchValue:c}},By=({listResourceTypeRef:a,tabs:n})=>{const{request:o,data:s={}}=ne.useApi(Q.resource.listResourceType,void 0,a);return C.useEffect(()=>{o({resourceType:"vidinet"})},[]),{resources:C.useMemo(()=>{const{resource:l=[]}=s;return n.reduce((d,{value:c,resourceFilter:p})=>({...d,[c]:p?p(l):[]}),{})},[s])}},qy=a=>({root:{},noResourceText:{...a.typography.body1,marginTop:a.spacing(2),marginBottom:a.spacing(2),width:"100%",textAlign:"center",fontWeight:"bold",color:a.palette.error.main},shapeTagFilter:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:a.spacing(2)},TextField:{marginLeft:a.spacing(2),marginRight:a.spacing(2)},Tabs:{marginBottom:"10px"},Tab:{},Switch:{}});function nn({className:a,classes:n,itemId:o,onSuccess:s,onError:i,onClose:l,tabs:d,listShapeTagRef:c,listResourceTypeRef:p,noResourceText:u,hideDefault:g,hideDefaultText:h,searchValue:m,searchText:y,ShapeTagListComponent:I,ShapeTagListProps:T}){const{onChangeTab:b,currentTab:M}=Fy({tabs:d}),{resources:L}=By({listResourceTypeRef:p,tabs:d}),{shapeTagNames:S,onChangeShowDefault:w,hideDefault:A,onChangeSearch:v,onClearSearch:O,searchValue:E}=zy({listShapeTagRef:c,initialHideDefault:g,initialSearchValue:m,tabs:d}),D=B=>{const $={tag:B};if(M===an||M===tn){const Y=L[M];if(Y.length===0){const P=new Error(`No ${M} Resources Available`);if(i)i(P);else throw P}$.resourceId=Y[0].id}return new Promise((Y,P)=>{Q.item.createTranscode({itemId:o,queryParams:$}).then(V=>{s&&s(V),l&&l(),Y(V)}).catch(V=>{i&&i(V),P(V)})})},F=C.useRef({}),z=B=>{const $={tag:B},Y=L[M];if(Y.length===0)throw new Error(`No ${M} Resources Available`);return $.resourceId=Y[0].id,new Promise((P,V)=>{Q.item.createTranscode({itemId:o,queryParams:$,costEstimate:!0}).then(({data:{id:W}={}})=>{const _=()=>{Q.vidinet.getCostEstimate({costEstimateId:W}).then(H=>{F.current[W]!==null&&(clearTimeout(F.current[W]),delete F.current[W]);const{data:{state:k}={}}=H;k==="FINISHED"?P(H):F.current[W]=setTimeout(()=>_(),1e3)}).catch(H=>V(H))};_()}).catch(V)})};return C.useEffect(()=>{const B=F.current;return()=>{B!==null&&Object.values(B).forEach($=>clearTimeout($))}},[]),t.jsxs("div",{className:x(n.root,"VdtTranscodeDialog-root",a),children:[t.jsx(r.DialogTitle,{children:"Transcode"}),t.jsx(r.DialogContent,{children:d.length>1?t.jsx(r.Tabs,{className:n.Tabs,value:M,onChange:b,variant:"fullWidth",textColor:"primary",indicatorColor:"primary",children:d.map(({value:B,icon:$,label:Y})=>t.jsx(r.Tab,{className:n.Tab,value:B,label:Y||B,icon:$?t.jsx($,{}):void 0},B))}):null}),t.jsxs(r.DialogContent,{children:[t.jsxs("div",{className:n.shapeTagFilter,children:[t.jsx(r.TextField,{className:n.TextField,label:y,onChange:v,value:E,fullWidth:!0,InputProps:{endAdornment:E?t.jsx(r.InputAdornment,{position:"end",children:t.jsx(r.ButtonBase,{onClick:O,children:t.jsx(j.Clear,{})})}):void 0}}),t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{checked:A,onChange:w,color:"primary",className:n.Switch}),label:h})]}),d.map(({value:B})=>t.jsx("div",{style:{display:B===M?"initial":"none"},children:B!==en&&(!L[B]||L[B].length===0)?t.jsx("div",{className:n.noResourceText,children:u}):t.jsx(I,{onTranscode:D,onEstimate:L[B]&&L[B].length>0?z:void 0,shapeTagNames:S[B],...T})},B))]})]})}const Vy=r.withStyles(qy,{name:"VdtTranscodeDialog"})(nn);nn.propTypes={classes:e.objectOf(e.string),className:e.string,itemId:e.string.isRequired,onSuccess:e.func,onError:e.func,onClose:e.func,tabs:e.arrayOf(e.shape({value:e.string.isRequired,icon:e.elementType,label:e.string,tagNameFilter:e.func,resourceFilter:e.func})),noResourceText:e.string,listShapeTagRef:e.shape({current:e.objectOf(e.any)}),listResourceTypeRef:e.shape({current:e.objectOf(e.any)}),hideDefault:e.bool,hideDefaultText:e.string,searchText:e.string,searchValue:e.string,ShapeTagListComponent:e.elementType,ShapeTagListProps:e.objectOf(e.any)},nn.defaultProps={classes:{},className:void 0,onSuccess:void 0,onError:void 0,onClose:void 0,tabs:[{value:en,icon:Ly,label:"Vidispine",tagNameFilter:a=>a.filter(n=>!n.toLowerCase().includes("mediaconvert")),resourceFilter:a=>a.filter(({vidinet:{type:n}={}})=>n===en)},{value:tn,icon:Ty,label:"Bitmovin",tagNameFilter:a=>a.filter(n=>!n.toLowerCase().includes("mediaconvert")),resourceFilter:a=>a.filter(({vidinet:{type:n}={}})=>n===tn)},{value:an,icon:Iy,label:"AWS MediaConvert",tagNameFilter:a=>a.filter(n=>n.toLowerCase().includes("mediaconvert")),resourceFilter:a=>a.filter(({vidinet:{type:n}={}})=>n===an)}],listShapeTagRef:void 0,listResourceTypeRef:void 0,noResourceText:"No transcode services configured in Vidinet.",hideDefault:!0,hideDefaultText:"Hide Default",searchText:"Search",searchValue:void 0,ShapeTagListComponent:ei,ShapeTagListProps:{}};const Gy=({parsedTimespans:a,filterText:n,filterConfidence:o,fieldGroup:s,field:i,aduGroup:l,aduValue:d,aduConfidence:c})=>{if((o===void 0||o===0)&&(n===void 0||n===""))return a;const p=Array.isArray(i)?i:[i],u=Array.isArray(s)?s:[s],g=n.toLowerCase(),h=[];return a.forEach(m=>{const{group:y=[],start:I,end:T}=m,b=y.filter(({name:M})=>u.includes(M));if(b.length!==0)if(l&&d){const M=[];if(b.forEach(({group:L,...S})=>{const w=[];L.forEach(A=>{if(A.name===l&&d in A){const v=String(A[d].toLowerCase());if(g&&!v.includes(g)||c&&o!==void 0&&A[c]!==void 0&&o>Number(A[c]))return;w.push(A)}}),w.length!==0&&M.push({...S,group:w})}),M.length===0)return;h.push({start:I,end:T,group:M})}else{const M=b.reduce((L,S)=>(Object.entries(S).forEach(([w,A])=>{p.includes(w)&&L.push(A)}),L),[]);if(M.length===0)return;if(g){const L=M.join("");if(L==="")return;L.toLowerCase().includes(g.toLowerCase())&&h.push({start:I,end:T,group:b})}}}),h},Uy=(a,n)=>{const{start:o}=a,{start:s}=n,[i]=o.split("@"),[l]=s.split("@");return Number(i)<Number(l)?-1:Number(i)>Number(l)?1:0},$y=({itemType:a={}})=>{const{metadata:n}=a,o={includeTimespanAttributes:!0,includeGroupAttributes:!0,flat:!0,overrideGroup:!0,groupAsList:!0,joinValue:","},{timespan:s=[]}=n||{};return s.sort(Uy).map(l=>X.parseTimespan(l,o))},Yy=({itemType:a,videoEl:n,field:o,fieldGroup:s,aduGroup:i,aduValue:l,aduConfidence:d})=>{let c;n.current&&(c=n.current.player.videoEl);const[p,u]=C.useState(""),[g,h]=C.useState(),m=C.useMemo(()=>$y({itemType:a}),[a]),y=C.useMemo(()=>Gy({filterText:p,filterConfidence:g,parsedTimespans:m,field:o,fieldGroup:s,aduGroup:i,aduValue:l,aduConfidence:d}),[p,g,m,o,s,i,l,d]);return{video:c,setFilterText:u,filterText:p,setFilterConfidence:h,timespanList:y}},Wy=({onRefresh:a})=>{const[n,o]=C.useState(),[s,i]=C.useState(!1),l=C.useCallback(u=>()=>{o(u),i(!0)},[]),d=C.useCallback(()=>{i(!1),o(),a()},[a]),c=C.useCallback(()=>{i(!1),o()},[]);return{isEditing:s,onOpen:l,onCancel:c,onSuccess:d,initialValues:n,onToggle:s?c:l}},_y=a=>{const n=C.useCallback(gg(a,500),[a]),[o,s]=C.useState(.5);return[o,(l,d)=>{s(d),n(d)}]},Qy=()=>({Typography:{},Slider:{},root:{}});function Hy({className:a,classes:n,onChange:o,confidenceText:s="Confidence",TypographyProps:i={},SliderProps:l={}}){const[d,c]=_y(o);return t.jsxs("div",{className:x(n.root,a),children:[t.jsx(r.Typography,{className:n.Typography,variant:"caption",gutterBottom:!0,...i,children:s}),t.jsx(r.Slider,{className:n.Slider,defaultValue:.9,valueLabelDisplay:"auto",step:.01,marks:!0,min:.9,max:1,value:d,onChange:c,...l})]})}const Zy=r.withStyles(Qy,{name:"VdtConfidenceSlider"})(Hy),Jy={Button:{minWidth:0},Icon:{}};function Xy({className:a,classes:n,isEditing:o,CloseIcon:s=j.NotInterested,OpenIcon:i=j.AddCircleOutline,onClick:l,ButtonProps:d={size:"small"}}){const c=o?s:i;return t.jsx(r.Button,{className:x(n.Button,a),onClick:l,...d,children:t.jsx(c,{})})}const Ky=r.withStyles(Jy)(Xy);function Ry({itemId:a,video:n,sampleRate:o,onSuccess:s,onError:i,sameAsStartText:l,laterThanEndText:d,...c}){const{startText:p,endText:u,uuid:g,timespan:h,...m}=c;if(n&&!m.startSmpte&&!m.endSmpte){const{currentTime:T=0}=n,b=X.createTimeBase(o),M=X.formatTimeCodeSeconds(T,{timeBase:b}).toSmpte();m.startSmpte=M,m.endSmpte=M}return{onSubmit:(T,b)=>{try{const{dirtyFields:M={}}=b.getState(),{startSmpte:L,endSmpte:S}=M,{startSmpte:w,endSmpte:A,...v}=T,O=parseInt(w.replace(/[^\d|]/g,""),10),E=parseInt(A.replace(/[^\d|]/g,""),10);if(O>E)return{startSmpte:d};if(O===E)return{endSmpte:l};const D=L||!p?X.formatTimeCodeSmpte(w,{timeBase:o}).toText():p,F=S||!u?X.formatTimeCodeSmpte(A,{timeBase:o}).toText():u,z=X.createMetadataType({start:D,end:F,...v});return g&&(L||S)?Q.item.updateItemMetadata({itemId:a,metadataDocument:z}).then(()=>Q.metadata.removeMetadata({metadataUuid:g})).then(s).catch(i):Q.item.updateItemMetadata({itemId:a,metadataDocument:z}).then(s).catch(i)}catch(M){return i(M)}},onDelete:()=>Q.metadata.removeMetadata({metadataUuid:g}).then(s).catch(i),metadataUuid:g,initialValues:m,timespan:h}}const ti=(a="")=>{const n=/(^(?:(?:[0-1][0-9]|[0-2][0-3]):)(?:[0-5][0-9]:){2}(?:[0-2][0-9])$)/gi,o=new RegExp(n);return a.match(o)?void 0:"Invalid Timecode"},ai=a=>{if(!a)return a;if(a.length>=11)return a.slice(0,11);if(a.endsWith(":")||a.split(":").length===4)return a;const n=a.replace(/[^\d|]/g,"");return n?n.length<=8?n.match(/.{1,2}/g).join(":"):a.slice(0,11):""};function em({handleSubmit:a,valid:n,onCancel:o,onDelete:s,metadataUuid:i,subtitleGroup:l="stl_subtitle",subtitleField:d="stl_text",startText:c="Start",endText:p="End",textText:u="Text",requiredText:g="Required",saveText:h="Save",deleteText:m="Delete",cancelText:y="Cancel"}){return t.jsx("form",{onSubmit:a,children:t.jsxs(r.Grid,{container:!0,justifyContent:"space-between",children:[t.jsxs(r.Grid,{item:!0,xs:2,children:[t.jsx(he.Field,{name:"startSmpte",component:we,type:"text",label:c,variant:"outlined",fullWidth:!0,margin:"dense",validate:ti,parse:ai}),t.jsx(he.Field,{component:we,name:"endSmpte",label:p,variant:"outlined",fullWidth:!0,margin:"dense",validate:ti,parse:ai})]}),t.jsx(r.Grid,{item:!0,xs:8,children:t.jsx(he.Field,{component:we,name:`${l}.${d}`,label:u,variant:"outlined",fullWidth:!0,margin:"dense",multiline:!0,rows:6,validate:I=>I?void 0:g})}),t.jsx(r.Grid,{item:!0,children:t.jsxs(r.Grid,{container:!0,direction:"column",justifyContent:"space-around",style:{height:"100%"},children:[t.jsx(r.Button,{variant:"outlined",color:"primary",type:"submit",disabled:!n,children:h}),i&&t.jsx(r.Button,{variant:"outlined",color:"secondary",onClick:s,children:m}),t.jsx(r.Button,{variant:"outlined",onClick:o,children:y})]})})]})})}const tm=r.withStyles({},{name:"VdtItemTimespanForm"})(em),am={Form:{}};function nm({className:a,classes:n,itemId:o,sampleRate:s="PAL",onSuccess:i,onError:l,onCancel:d,video:c,initialValues:p={},subtitleGroup:u="stl_subtitle",subtitleField:g="stl_text",aduGroup:h,aduValue:m,sameAsStartText:y="Same as start",laterThanEndText:I="Later than end",FormComponent:T=tm,...b}){const{onSubmit:M,onDelete:L,metadataUuid:S,initialValues:w,timespan:A}=Ry({itemId:o,video:c,sampleRate:s,onSuccess:i,onError:l,sameAsStartText:y,laterThanEndText:I,...p});return t.jsx(he.Form,{className:x(n.Form,a),onSubmit:M,initialValues:w,component:T,onCancel:d,onDelete:L,metadataUuid:S,subtitleGroup:u,subtitleField:g,aduGroup:h,aduValue:m,timespan:A,...b})}const rm=r.withStyles(am,{name:"VdtItemTimespanEdit"})(nm),om=({timespanList:a,video:n={},setActiveTimespanIndex:o,activeTimespanIndex:s})=>{const{currentTime:i=0}=n,l=Number(i.toFixed(3)),d=a.findIndex(({start:c,end:p})=>{const u=X.formatTimeCodeText(c),g=X.formatTimeCodeText(p),h=Number(u.toSeconds().toFixed(3)),m=Number(g.toSeconds().toFixed(3));return l>=h&&l<m});d>-1&&s!==d&&o(d)},sm=({video:a,timespanList:n})=>{const[o,s]=C.useState(),i=C.useCallback(l=>()=>{a&&(a.currentTime=l,a.played.length===0&&a.play())},[a]);return C.useEffect(()=>{if(a&&n.length>0){const l=()=>om({timespanList:n,video:a,activeTimespanIndex:o,setActiveTimespanIndex:s});return a.addEventListener("timeupdate",l),()=>{a.removeEventListener("timeupdate",l)}}},[a,n]),{onSeek:i,activeTimespanIndex:o}},im=(a,n)=>Array.isArray(n)?Object.fromEntries(Object.entries(a).filter(([o])=>n.includes(o))):a[n],lm=({timespan:a,subtitleGroup:n,subtitleField:o,aduGroup:s,aduValue:i,aduConfidence:l,isActive:d,handleOnSeek:c=()=>{},handleOnEdit:p=()=>{}})=>{const u=C.createRef(),{start:g,end:h,duration:m,metadataFieldValue:y,text:I,aduList:T,onSeek:b,onEdit:M}=C.useMemo(()=>{const{start:L,end:S}=a,w=X.formatTimeCodeText(L),A=X.formatTimeCodeText(S),O={samples:A.samples-w.samples,timeBase:A.timeBase},{group:E=[]}=a,D=E.find(({name:B})=>B===n)||{},{group:F=[],uuid:z}=D;return{start:w,end:A,duration:X.formatTimeCodeType(O),text:D[o],metadataFieldValue:im(D,o),aduList:F.filter(({name:B})=>B===s).map(({[i]:B,[l]:$})=>({confidence:Number($),value:B})),onSeek:c(w.toSeconds()),onEdit:p({timespan:a,startText:w.toText(),endText:A.toText(),startSmpte:w.toSmpte(),endSmpte:A.toSmpte(),uuid:z,[n]:{[o]:D[o]}})}},[a,o,c,p,n,s,i,l]);return C.useEffect(()=>{d&&u&&u.current&&u.current.scrollIntoView({behavior:"smooth",block:"nearest"})},[u,d]),{ref:u,start:g,end:h,duration:m,text:I,metadataFieldValue:y,aduList:T,onSeek:b,onEdit:M}},dm=a=>({root:{transition:"background-color 0.3s ease-out","&:hover":{backgroundColor:a.palette.type==="light"?"rgba(0, 0, 0, 0.1)":"rgba(0, 0, 0, 0.2)"},"&:hover $actions":{visibility:"visible"},minHeight:50,paddingTop:a.spacing(1),paddingBottom:a.spacing(1),paddingLeft:a.spacing(1),paddingRight:a.spacing(2)},seek:{cursor:"pointer"},actions:{visibility:"hidden"},active:{backgroundColor:a.palette.type==="light"?"rgba(0, 0, 0, 0.2)":"rgba(0, 0, 0, 0.3)","&:hover":{backgroundColor:a.palette.type==="light"?"rgba(0, 0, 0, 0.3)":"rgba(0, 0, 0, 0.4)"}},chip:{margin:a.spacing(.5)},actionButton:{minWidth:0}});function cm({className:a,classes:n,canEdit:o=!0,timespan:s,onSeek:i,onEdit:l,subtitleGroup:d="stl_subtitle",subtitleField:c="stl_text",isActive:p=!1,aduGroup:u,aduValue:g,aduConfidence:h}){const{ref:m,start:y,end:I,duration:T,text:b,aduList:M,onSeek:L,onEdit:S}=lm({timespan:s,subtitleGroup:d,subtitleField:c,handleOnSeek:i,handleOnEdit:l,isActive:p,aduGroup:u,aduValue:g,aduConfidence:h}),w=M&&M.length>0;return t.jsx("div",{className:x(n.root,{[n.active]:p,[n.seek]:L!==void 0},a),onClick:L,ref:m,children:t.jsxs(r.Grid,{container:!0,alignItems:"flex-start",wrap:"nowrap",children:[t.jsx(r.Grid,{item:!0,children:t.jsxs(r.Grid,{container:!0,direction:"column",children:[t.jsx(r.Typography,{variant:"caption",children:y.toSmpte()}),t.jsx(r.Typography,{variant:"caption",children:I.toSmpte()})]})}),t.jsx(r.Grid,{item:!0,style:{flexGrow:1},children:t.jsx(r.Box,{px:2,children:w?M.map(({value:A,confidence:v})=>t.jsx(r.Tooltip,{title:v,placement:"top",arrow:!0,children:t.jsx(r.Chip,{label:A,variant:"outlined",size:"small",className:n.chip})},A)):t.jsx(r.Typography,{variant:"subtitle2",children:b})})}),t.jsx(r.Grid,{item:!0,children:t.jsxs(r.Grid,{container:!0,direction:"column",children:[t.jsx(r.Typography,{variant:"caption",children:T.toDuration()}),t.jsx(r.Grid,{container:!0,direction:"row",wrap:"nowrap",className:n.actions,children:o&&!w&&S&&t.jsx(r.Button,{onClick:S,size:"small",className:n.actionButton,children:t.jsx(j.Edit,{})})})]})})]})})}const pm=r.withStyles(dm,{name:"VdtItemTimespanInterval"})(cm),um={root:{},ItemTimespanIntervalContainer:{},ItemTimespanInterval:{},Divider:{}};function gm({classes:a,className:n,canEdit:o=!0,timespanList:s,onEdit:i,video:l,subtitleGroup:d="stl_subtitle",subtitleField:c="stl_text",sampleRate:p="PAL",aduGroup:u,aduValue:g,aduConfidence:h,ItemTimespanIntervalCompoent:m=pm,ItemTimespanIntervalProps:y={}}){const{onSeek:I,activeTimespanIndex:T}=sm({video:l,timespanList:s});return t.jsx("div",{className:x(a.root,n),children:s.map((b,M)=>t.jsxs("div",{className:a.ItemTimespanIntervalContainer,children:[t.jsx(m,{className:a.ItemTimespanInterval,timespan:b,onSeek:l?I:void 0,canEdit:o,onEdit:i,isActive:T===M,subtitleGroup:d,subtitleField:c,sampleRate:p,aduGroup:u,aduValue:g,aduConfidence:h,...y}),t.jsx(r.Divider,{className:a.Divider})]},[b.start,b.end].join()))})}const hm=r.withStyles(um,{name:"VdtItemTimespanList"})(gm),ym=()=>({TextField:{"& .MuiInputLabel-marginDense":{left:"unset"}},InputAdornment:{},Button:{minWidth:0},SearchIconComponent:{},CloseIconComponent:{}});function mm({className:a,classes:n,onChange:o,searchText:s="Search",SearchIconComponent:i=j.Search,CloseIconComponent:l=j.Close,inputRef:d,...c}){const p=C.useRef(),u=d||p,[g,h]=C.useState(!1),m=I=>{var b;const T=(b=I==null?void 0:I.target)==null?void 0:b.value;o(I.target.value),h(()=>!!T)},y=()=>{o(""),u.current.value="",h(!1)};return t.jsx(r.TextField,{className:x(n.TextField,a),inputRef:u,label:s,variant:"outlined",onChange:m,fullWidth:!0,margin:"dense",color:"primary",InputProps:{startAdornment:t.jsx(r.InputAdornment,{className:n.InputAdornment,position:"start",children:t.jsx(i,{className:n.SearchIconComponent})}),endAdornment:g?t.jsx(r.InputAdornment,{className:n.InputAdornment,position:"end",children:t.jsx(r.Button,{className:n.Button,onClick:y,size:"small",children:t.jsx(l,{className:n.CloseIconComponent})})}):void 0},...c})}const fm=r.withStyles(ym,{name:"VdtItemTimespanSearchInput"})(mm),Cm=a=>({root:{},header:{display:"flex",alignItems:"baseline",width:"100%"},ItemTimespanList:{overflowY:"scroll",height:`calc(100% - ${a.spacing(6)}px)`,maxHeight:1080/2,"&::-webkit-scrollbar":{WebkitAppearance:"none"},"&::-webkit-scrollbar:vertical":{width:11},"&::-webkit-scrollbar-thumb":{borderStyle:"solid",borderWidth:2,borderColor:a.palette.common.white,backgroundColor:"rgba(0, 0, 0, 0.5)"}},EditButton:{},ConfidenceSlider:{alignSelf:"center",flexGrow:.5,marginLeft:5,marginRight:5},ItemTimespanFilter:{flexGrow:1,paddingLeft:a.spacing(1),paddingRight:a.spacing(1)},ItemTimespanEdit:{},Collapse:{},Divider:{}});function Tm({className:a,classes:n,style:o,itemId:s,itemType:i,onRefresh:l,onError:d,onSuccess:c,videoEl:p={},subtitleGroup:u="stl_subtitle",subtitleField:g="stl_text",aduGroup:h,aduValue:m,aduConfidence:y,sampleRate:I="PAL",canEdit:T=!0,ConfidenceSliderComponent:b=Zy,ConfidenceSliderProps:M={},EditButtonComponent:L=Ky,EditButtonProps:S={},ItemTimespanSearchInputComponent:w=fm,ItemTimespanSearchInputProps:A={},ItemTimespanEditComponent:v=rm,ItemTimespanEditProps:O={},ItemTimespanListComponent:E=hm,ItemTimespanListProps:D={}}){const{video:F,setFilterText:z,setFilterConfidence:B,timespanList:$}=Yy({itemType:i,videoEl:p,onRefresh:l,field:g,fieldGroup:u,aduGroup:h,aduValue:m,aduConfidence:y}),{isEditing:Y,onCancel:P,onToggle:V,onOpen:W,onSuccess:_,initialValues:H}=Wy({onRefresh:l,onSuccess:c});return t.jsxs("div",{className:x(n.root,a),style:o,children:[t.jsxs("div",{className:n.header,children:[w&&t.jsx(w,{className:n.ItemTimespanFilter,onChange:z,...A}),b&&h&&t.jsx(b,{className:n.ConfidenceSlider,onChange:B,...M}),L&&T&&t.jsx(L,{className:n.EditButton,onClick:V,isEditing:Y,...S})]}),t.jsxs(r.Collapse,{in:Y,className:n.Collapse,children:[t.jsx(r.Divider,{className:n.Divider}),v&&T&&Y&&t.jsx(v,{className:n.ItemTimespanEdit,video:F,onSuccess:_,onError:d,onCancel:P,initialValues:H,itemId:s,sampleRate:I,subtitleGroup:u,subtitleField:g,aduGroup:h,aduValue:m,...O}),t.jsx(r.Divider,{})]}),t.jsx(E,{className:n.ItemTimespanList,timespanList:$,video:F,onEdit:W,canEdit:T,subtitleGroup:u,subtitleField:g,sampleRate:I,aduGroup:h,aduValue:m,aduConfidence:y,...D})]})}const bm=r.withStyles(Cm,{name:"VdtItemTimespanBox"})(Tm),Im={FormControl:{},InputLabel:{},Select:{},MenuItem:{}};function Mm({className:a,classes:n={},value:o,handleChange:s,options:i,eventTypeText:l="Event Type",FormControlProps:d={variant:"standard",fullWidth:!0}}){return t.jsxs(r.FormControl,{className:x(n.FormControl,a),...d,children:[t.jsx(r.InputLabel,{className:n.InputLabel,children:l}),t.jsx(r.Select,{className:n.Select,value:o,onChange:s,children:i.map(c=>t.jsx(r.MenuItem,{className:n.MenuItem,value:c,children:c.label},c.label))})]})}const Lm=r.withStyles(Im,{name:"VdtItemTimespanSelection"})(Mm),Sm=({itemId:a,sampleRate:n="PAL",timespanOptions:o=[{}],queryParams:s})=>{const[i,l]=C.useState(o[0]),{value:{subtitleGroup:d="stl_subtitle",subtitleField:c="stl_text",aduGroup:p,aduValue:u,aduConfidence:g}={}}=i,h={content:"metadata",group:Array.isArray(d)?[...d,p]:[d,p],field:Array.isArray(c)?[...c,u,g]:[c,u,g],sampleRate:n,...s},{itemType:m,isLoading:y,isError:I,onRefresh:T}=ne.useGetItem({itemId:a,queryParams:h});return{itemType:m,isLoading:y,isError:I,onRefresh:T,onChangeTimespanOption:M=>l(M.target.value),timespanOption:i}},wm=a=>({root:{},ItemTimespanSelection:{marginBottom:a.spacing(1)},ItemTimespanBox:{}});function Am({className:a,classes:n,style:o,itemId:s,videoEl:i,sampleRate:l="PAL",timespanOptions:d,queryParams:c,onError:p,onSuccess:u,ItemTimespanSelectionComponent:g=Lm,ItemTimespanSelectionProps:h={},ItemTimespanBoxComponent:m=bm,ItemTimespanBoxProps:y={}}){const{onChangeTimespanOption:I,timespanOption:T,itemType:b,onRefresh:M}=Sm({itemId:s,queryParams:c,sampleRate:l,timespanOptions:d}),{value:L={}}=T||{};return t.jsxs("div",{className:x(n.root,a),style:o,children:[g&&d&&d.length>1&&t.jsx(g,{options:d,value:T,handleChange:I,className:n.ItemTimespanSelection,...h}),t.jsx(m,{className:n.ItemTimespanBox,videoEl:i,sampleRate:l,canEdit:!0,onRefresh:M,onError:p,onSuccess:u,itemId:s,itemType:b,...L,...y})]})}const Dm=r.withStyles(wm,{name:"VdtItemTimespan"})(Am),xe={GROUP:"group",USER:"user"},Nm={ALL:"ALL",WRITE:"WRITE",READ:"READ",NONE:"NONE"},vm=a=>({root:{},recipientRoot:{display:"flex",width:"100%"},recipientType:{flexGrow:1},actions:{display:"flex",alignItems:"center",padding:a.spacing(2),justifyContent:"flex-end",flex:"0 0 auto","& > :not(:first-child)":{marginLeft:a.spacing(2)}},actionsSubmit:{}}),xm=(a,n)=>{switch(n.type){case"CHANGE_PERMISSION":return{...a,permission:n.value};case"CHANGE_RECIPIENT":return a[xe.USER]!==void 0?{...a,[xe.USER]:n.value}:a[xe.GROUP]!==void 0?{...a,[xe.GROUP]:n.value}:a;case"CHANGE_RECIPIENTTYPE":{const{[xe.USER]:o,[xe.GROUP]:s,...i}=a;return{...i,[n.value]:null}}default:throw new Error(`Unhandled action type: ${n.type}`)}},Om=a=>{const[n,o]=C.useReducer(xm,a),s=C.useCallback(d=>o({value:d,type:"CHANGE_PERMISSION"}),[]),i=C.useCallback(d=>o({value:d,type:"CHANGE_RECIPIENT"}),[]),l=C.useCallback(d=>o({value:d,type:"CHANGE_RECIPIENTTYPE"}),[]);return{accessControlDocument:n,onChangePermission:s,onChangeRecipient:i,onChangeRecipientType:l}};async function Em({searchText:a,hideDefaultGroups:n}){const{data:{group:o=[]}}=await Q.group.searchGroup({groupSearchDocument:{field:[{name:"groupname",value:a}]}});return n?o.map(s=>({groupName:s.groupName})).filter(s=>!s.groupName.startsWith("_")):o.map(s=>({groupName:s.groupName}))}async function jm({searchText:a,displayRealName:n=!1}){const{data:{user:o=[]}}=await Q.user.searchUser({userSearchDocument:{field:[{name:"username",value:a}]},queryParams:{ignoreCase:!0}});return o.map(s=>({userName:s.userName,...n&&{realName:s.realName}}))}function ni({onSearch:a,onChange:n,displayRealName:o=!1,label:s,hideDefaultGroups:i}){const[l,d]=C.useState([]),[c,p]=C.useState(""),[u,g]=C.useState(null),h=C.useCallback(I=>{a({searchText:I,hideDefaultGroups:i,displayRealName:o}).then(d)},[a,i,o]),m=(I,T,b)=>{p(T),b==="input"&&h(T)},y=(I,T)=>{const{groupName:b,userName:M}=T||{};g(T),n(T?M||b:null)};return C.useEffect(()=>{h("")},[h]),t.jsx(oe.Autocomplete,{value:u,inputValue:c,options:l,onChange:y,onInputChange:m,renderInput:I=>t.jsx(r.TextField,{...I,label:s,variant:"outlined"}),getOptionLabel:({realName:I,userName:T,groupName:b})=>o?I||T:T||b})}function Pm({value:a,label:n,onChange:o,choices:s=Nm,selected:i}){return t.jsxs(r.FormControl,{margin:"normal",fullWidth:!0,children:[t.jsx(r.FormLabel,{children:n}),t.jsx(r.RadioGroup,{value:a,onChange:l=>o(l.target.value),children:Object.entries(s).map(([l,d])=>t.jsx(r.FormControlLabel,{value:l,control:t.jsx(r.Radio,{}),label:d,disabled:!i},l))})]})}function km({onChange:a,value:n,userText:o,groupText:s}){const i=(l,d)=>{d!==null&&a(d)};return t.jsxs(oe.ToggleButtonGroup,{value:n,exclusive:!0,onChange:i,children:[t.jsx(oe.ToggleButton,{value:xe.USER,children:o}),t.jsx(oe.ToggleButton,{value:xe.GROUP,children:s})]})}function Fm({classes:a,entityType:n,entityId:o,onSuccess:s=()=>{},onError:i=()=>{},onSubmit:l=Q.access.createEntityAccess,onCancel:d,initialAccessControlDocument:c={user:null},UserPickerComponent:p=ni,UserPickerProps:u={},GroupPickerComponent:g=ni,GroupPickerProps:h={},PermissionPickerComponent:m=Pm,PermissionPickerProps:y,RecipientTypePickerComponent:I=km,RecipientTypePickerProps:T,permissionText:b="Permission",grantAccessText:M="Grant Access",userText:L="User",groupText:S="Group",searchText:w="Search",cancelText:A="Cancel",hideDefaultGroups:v=!0}){const{accessControlDocument:O,onChangePermission:E,onChangeRecipient:D,onChangeRecipientType:F}=Om(c),z=()=>Promise.resolve(l({entityType:n,entityId:o,accessControlDocument:O})).then(s).catch(i),{permission:B=""}=O,$=C.useMemo(()=>{if(O[xe.USER]!==void 0)return xe.USER;if(O[xe.GROUP]!==void 0)return xe.GROUP},[O]),[Y]=Object.values(O);return t.jsxs("div",{className:a.root,children:[t.jsxs("div",{className:a.recipientRoot,children:[I?t.jsx(I,{value:$,onChange:F,userText:L,groupText:S,...T}):null,t.jsxs("div",{className:a.recipientType,children:[p&&$===xe.USER?t.jsx(p,{onSearch:jm,onChange:D,label:w,...u}):null,g&&$===xe.GROUP?t.jsx(g,{onSearch:Em,onChange:D,label:w,...h,hideDefaultGroups:v}):null]})]}),m?t.jsx(m,{value:B,onChange:E,selected:Y,label:b,...y}):null,t.jsxs("div",{className:a.actions,children:[d?t.jsx(r.Button,{className:a.actionsCancel,onClick:d,children:A}):null,t.jsx(r.Button,{className:a.actionsSubmit,onClick:z,disabled:!O[$]||!B,variant:"outlined",color:"primary",children:M})]})]})}const rn=r.withStyles(vm,{name:"VdtEntityAccessEdit"})(Fm),zm=r.withStyles(a=>({root:{display:"flex",alignItems:"center",borderStyle:"none",...a.typography.body2}}))(r.TableCell),Bm=r.withStyles(a=>({root:{borderStyle:"none",...a.typography.subtitle2}}))(r.TableCell),qm=r.withStyles(()=>({root:{borderStyle:"none"}}))(r.Chip),Vm=a=>`${a[0].toUpperCase()}${a.slice(1).toLowerCase()}`;function Gm({className:a="VdtEntityAccessMenu-root",classes:n={},onRemove:o,accessType:s,entityType:i,entityId:l,entityAccessMenuText:d}){const[c,p]=C.useState(null),u=y=>{p(y.currentTarget)},g=()=>{p(null)},{id:h}=s,m=()=>{o({accessId:h,entityType:i,entityId:l}),g()};return t.jsxs("div",{className:a,children:[t.jsx(r.IconButton,{onClick:u,children:t.jsx(j.MoreVert,{})}),t.jsx(r.Menu,{anchorEl:c,keepMounted:!0,open:!!c,onClose:g,children:t.jsx("div",{className:n.entityAccessMenuContext,children:t.jsxs(r.MenuItem,{onClick:m,children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.Delete,{})}),t.jsx(r.ListItemText,{primary:d,primaryTypographyProps:{color:"secondary"}})]})})})]})}function Um({className:a="VdtEntityAccessRow-root",accessType:n,entityType:o,entityId:s,onRemove:i,EntityAccessMenuComponent:l=Gm,EntityAccessMenuProps:d={},entityAccessMenuText:c,accessTranslate:p,displayRealName:u=!1}){const{user:g,group:h,permission:m,userType:y}=n;let I=g||h;if(u&&y){const{realName:M,userName:L}=y;I=M||L}const T=Vm(p(m));let b=null;return g||y?b=j.Person:h&&(b=j.Group),t.jsxs(r.TableRow,{component:"div",className:a,children:[t.jsxs(zm,{component:"div",children:[i?t.jsx(l,{onRemove:i,entityType:o,entityId:s,accessType:n,entityAccessMenuText:c,...d}):null,t.jsx(qm,{label:I,icon:t.jsx(b,{}),variant:"outlined"})]}),t.jsx(Bm,{component:"div",children:T})]})}function $m({className:a="VdtEntityAccessTable-root",accessControlList:n,entityType:o,entityId:s,onRemove:i,EntityAccessRowComponent:l=Um,EntityAccessRowProps:d={},entityAccessMenuText:c="Delete",accessTranslate:p=u=>u}){const{access:u=[]}=n;return t.jsx(r.Table,{size:"small",component:"div",className:a,children:t.jsx(r.TableBody,{component:"div",children:u.map(g=>t.jsx(l,{accessType:g,entityType:o,entityId:s,onRemove:i,entityAccessMenuText:c,accessTranslate:p,...d},g.id))})})}const on=r.withStyles({},{name:"VdtEntityAccessTable"})($m);function Ym({itemId:a,toggleAddLabelText:n=i=>i?"Cancel":"Add permission",showAddAccess:o=!0,EntityAccessTableProps:s={}}){const[i,l]=C.useState(!1),d=()=>l(!i),{accessControlList:c,onList:p,onRemove:u,onAdd:g}=ne.useEntityAccess({entityId:a,entityType:"item"});C.useEffect(()=>{p()},[a]);const h=y=>u(y).then(p),m=()=>{p(),l(!1)};return t.jsxs(t.Fragment,{children:[o&&t.jsx(r.Box,{display:"flex",justifyContent:"flex-end",children:t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{checked:i,onChange:d}),label:n(i),labelPlacement:"start"})}),o&&i?t.jsx(rn,{entityType:"item",entityId:a,onSuccess:m,onCancel:()=>l(!1),onSubmit:g}):t.jsx(on,{entityType:"item",entityId:a,accessControlList:c,onRemove:h,...s})]})}const Wm=r.withStyles({},{name:"VdtItemAccessTab"})(Ym);function sn(a,[n,o]){return o==="true"?a[n]=!0:o==="false"?a[n]=!1:Array.isArray(o)?a[n]=o.map(s=>s==="true"?!0:s==="false"?!1:s):typeof o=="object"?a[n]=Object.entries(o).reduce(sn,{}):a[n]=o,a}function ln(a,[n,o],s){if(o===void 0)return a;if(o===null)a[n]=null;else if(o===!0)a[n]="true";else if(o===!1)a[n]="false";else if(Array.isArray(o))a[n]=o.map(i=>i===!0?"true":i===!1?"false":i);else if(typeof o=="object")a[n]=Object.entries(o).reduce((i,l)=>ln(i,l,s),{});else if(s){const i=o.split(s);a[n]=i.length>1?i:o}else a[n]=o;return a}function _m({...a}){const{constraint:n={}}=a,{parent:o}=n;return o?t.jsx(he.Field,{name:o,subscription:{value:!0},children:({input:{value:s}})=>t.jsx(he.Field,{parentField:o,parentValue:s,...a})}):t.jsx(he.Field,{...a})}const Qm=a=>({root:{height:"42px",paddingTop:"8px !important"},cell:{borderBottom:"none",fontSize:"14px"},labelCell:{lineHeight:"20px",padding:"10px 0"},fieldCell:{"& .MuiInput-root":{...a.typography.body1,"& .MuiInput-input":{lineHeight:"20px",height:"20px",padding:"7px 0"}},"& .MuiInputBase-multiline":{padding:0}},field:{marginTop:0,"& .MuiFormHelperText-root":{display:"none"},"& .VdtSelectField-select":{marginTop:0},"&.VdtSelectField-root":{height:"34px"}}});function Hm({classes:a,className:n,name:o,label:s,labelText:i=()=>s||o,...l}){return t.jsxs(r.TableRow,{className:x(a.root,"VdtItemMetadataFieldRow-root",n),children:[t.jsx(r.TableCell,{className:x(a.cell,a.labelCell,"VdtItemMetadataFieldRow-labelCell"),colSpan:2,children:i(o,s)}),t.jsx(r.TableCell,{className:x(a.cell,a.fieldCell,"VdtItemMetadataFieldRow-fieldCell"),colSpan:3,children:t.jsx(_m,{name:o,className:x(a.field,"VdtItemMetadataFieldRow-field"),...l})})]})}const dn=r.withStyles(Qm,{name:"VdtItemMetadataFieldRow"})(Hm),Ae={AUTOCOMPLETE:"autocomplete",SELECT:"select",SWITCH:"switch",CHECKBOX:"checkbox",CHECKBOXGROUP:"checkboxGroup",RADIO:"radio",INTEGER:"integer",FLOAT:"float",LONG:"long",TEXTAREA:"textArea",TEXT:"text",TAG:"tag"},Zm=Ae.TEXT,Jm=(a,n)=>{switch(a){case Ae.AUTOCOMPLETE:return n?Ls:Jt;case Ae.TAG:return bs;case Ae.SELECT:return Ve;case Ae.SWITCH:return Ms;case Ae.CHECKBOX:return Zt;case Ae.CHECKBOXGROUP:return Cs;case Ae.RADIO:return Ts;case Ae.DATE:case Ae.INTEGER:case Ae.LONG:case Ae.FLOAT:case Ae.TEXTAREA:case Ae.TEXT:default:return we}},Xm=(a,n)=>a==="boolean"&&n==="checkbox"?"checkbox":["integer","long"].includes(a)?"number":a||Zm,Km=({displayType:a,type:n,constraint:o})=>{const s=Jm(a,o),i=Xm(n,a),l=a===Ae.TEXTAREA||void 0;return{component:s,type:i,multiline:l}},Rm={root:{tableLayout:"fixed"},dividerCell:{height:"20px"}};function ef({classes:a,className:n,groupName:o,fields:s=[],groups:i=[],getFieldProps:l=Km}){const d=C.useMemo(()=>i.map(({name:p,fields:u,groups:g,...h})=>t.jsx(ri,{name:o?`${o}.${p}`:p,fields:u,groups:g,getFieldProps:l,...h},p)),[i]),c=C.useMemo(()=>s.map(p=>{const{name:u,displayType:g,...h}=p;return t.jsx(dn,{name:o?`${o}.${u}`:u,...l(p),...h},u)}),[s]);return t.jsx(r.Table,{size:"small",padding:"none",className:x(a.root,"VdtItemMetadataFormTable-root",n),children:t.jsxs(r.TableBody,{children:[c,t.jsx(r.TableRow,{children:t.jsx(r.TableCell,{className:x(a.dividerCell,"VdtItemMetadataFormTable-dividerCell"),colSpan:5})}),d]})})}const tf={accordion:{backgroundColor:"unset",boxShadow:"unset"},summary:{padding:0,"&.MuiAccordionSummary-root.Mui-expanded":{minHeight:"56px"},"& .MuiAccordionSummary-content":{marginTop:"5px",marginBottom:"5px"}},details:{paddingTop:0}};function af({classes:a,className:n,name:o,label:s,labelText:i=()=>s||o,fields:l,groups:d,getFieldProps:c}){return t.jsx(r.TableRow,{className:x(a.root,"VdtItemMetadataFieldGroupRow-root",n),children:t.jsx(r.TableCell,{colSpan:5,children:t.jsxs(r.Accordion,{className:x(a.accordion,"VdtItemMetadataFieldGroupRow-accordion"),children:[t.jsx(r.AccordionSummary,{className:x(a.summary,"VdtItemMetadataFieldGroupRow-summary"),expandIcon:t.jsx(j.ExpandMore,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:t.jsx(r.Typography,{className:x(a.label,"VdtItemMetadataFieldGroupRow-label"),children:i(o,s)})}),t.jsx(r.AccordionDetails,{className:x(a.details,"VdtItemMetadataFieldGroupRow-details"),children:t.jsx(cn,{groupName:o,fields:l,groups:d,getFieldProps:c})})]})})})}const ri=r.withStyles(tf,{name:"VdtItemMetadataFieldGroupRow"})(af),cn=r.withStyles(Rm,{name:"VdtItemMetadataFormTable"})(ef);function nf({fields:a=[],groups:n=[],handleSubmit:o,handleFormSpy:s,saveText:i="Save",ItemMetadataFormComponent:l=cn,ItemMetadataFormProps:d={}}){return t.jsxs("form",{onSubmit:o,children:[t.jsx(l,{fields:a,groups:n,...d}),s&&t.jsx(he.FormSpy,{subscription:{values:!0,invalid:!0,active:!0},onChange:s}),t.jsx(r.Box,{m:2,children:t.jsx(r.Button,{fullWidth:!0,variant:"outlined",type:"submit",color:"primary",children:i})})]})}const oi=r.withStyles({},{name:"VdtItemMetadataForm"})(nf);function si({itemId:a,onSuccess:n,fields:o,groups:s,itemType:i,onRefresh:l,isLoading:d,joinValue:c,onError:p=u=>console.error(u.message)}){const{metadata:u}=i,g=C.useMemo(()=>{const m=X.parseMetadataType(u,{flat:!0,arrayOnSingleValue:!1});return Object.entries(m).reduce(sn,{})},[u]),h=async m=>{const y=Object.entries(m).reduce((T,b)=>ln(T,b,c),{}),I=X.createMetadataType(y);try{await Q.item.updateItemMetadata({itemId:a,metadataDocument:I}),await l(),n()}catch(T){p(T)}};return!d&&t.jsx(he.Form,{onSubmit:h,component:oi,fields:o,groups:s,initialValues:g})}const rf=a=>({root:{padding:0,margin:"2px 0"},text:{margin:0,"& > .MuiListItemText-primary":{...a.typography.body2}},label:{flexBasis:"30%",marginBottom:"auto","& > .MuiListItemText-primary":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},value:{flexBasis:"70%",display:"flex",alignItems:"flex-end","& > .MuiListItemText-primary":{wordBreak:"break-all",fontWeight:600},"& > .MuiListItemText-secondary":{marginLeft:"6px"}}});function of({classes:a,className:n,name:o,label:s,value:i,formatValue:l=u=>u,options:d,showFieldName:c,showOptionLabel:p=!0}){const u=d&&d.some(g=>g.value===i)?d.find(g=>g.value===i).label:void 0;return t.jsxs(r.ListItem,{className:x(a.root,"VdtItemMetadataListFieldItem-root",n),children:[t.jsx(r.ListItemText,{className:x(a.text,a.label,"VdtItemMetadataListFieldItem-label"),primary:s||o,secondary:c&&o}),t.jsx(r.ListItemText,{className:x(a.text,a.value,"VdtItemMetadataListFieldItem-value"),primary:i!==void 0?l(i):"",secondary:p&&u&&`(${u})`})]})}const ii=r.withStyles(rf,{name:"VdtItemMetadataListFieldItem"})(of),sf=a=>({root:{padding:0},label:{flexBasis:1,margin:"2px","& > .MuiListItemText-primary":{...a.typography.body2}},list:{padding:0,paddingLeft:"1em"}});function li({classes:a,className:n,name:o,label:s,fields:i=[],groups:l=[],values:d,showFieldName:c,showOptionLabel:p,formatValue:u,defaultExpanded:g=!1,...h}){const[m,y]=C.useState(g),I=()=>{y(!m)};return t.jsxs(t.Fragment,{children:[t.jsxs(r.ListItem,{className:x(a.root,"VdtItemMetadataListFieldGroupItem-root",n),button:!0,onClick:I,...h,children:[t.jsx(r.ListItemText,{className:x(a.label,"VdtItemMetadataListFieldGroupItem-label"),primary:s||o,secondary:c&&o}),m?t.jsx(j.ExpandLess,{}):t.jsx(j.ExpandMore,{})]}),t.jsx(r.Collapse,{in:m,timeout:"auto",unmountOnExit:!0,children:t.jsxs(r.List,{component:"div",className:x(a.list,"VdtItemMetadataListFieldGroupItem-list"),children:[i.map(({name:T,...b})=>t.jsx(ii,{name:T,value:d[T],showFieldName:c,showOptionLabel:p,formatValue:u,...b},`${o}-${T}`)),l.map(({name:T,fields:b,groups:M,...L})=>t.jsx(li,{classes:a,className:n,name:T,fields:b,groups:M,values:d[T]?d[T]:{},showFieldName:c,showOptionLabel:p,formatValue:u,...L},`${o}-${T}`))]})})]})}const lf=r.withStyles(sf,{name:"VdtItemMetadataListFieldGroupItem"})(li),df=()=>({root:{width:"100%","& .MuiDivider-root":{marginTop:"10px",marginBottom:"10px"}}});function cf({classes:a,className:n,fields:o=[],groups:s=[],showFieldName:i=!1,showOptionLabel:l=!0,formatValue:d,...c}){return t.jsxs(r.List,{className:x(a.root,"VdtItemMetadataList-root",n),size:"small",padding:"none",component:"div",children:[o.map(({name:p,...u})=>t.jsx(ii,{name:p,value:c[p],showFieldName:i,formatValue:d,...u},p)),t.jsx(r.Divider,{}),s.map(({name:p,...u})=>t.jsx(lf,{name:p,values:c[p]?c[p]:{},showFieldName:i,showOptionLabel:l,formatValue:d,...u},p))]})}const di=r.withStyles(df,{name:"VdtItemMetadataList"})(cf);function pf({itemId:a,fields:n=[],groups:o=[],editingLabel:s=y=>y?"Cancel":"Edit",showEditMetadata:i=!0,onError:l,editJoinValue:d=";",displayJoinValue:c=", ",displayGroupAsList:p=!1,useContentPaths:u=!1,formatValue:g,queryParams:h={},getAttributes:m=!1}){const y=C.useMemo(()=>{const S={...h};if(u){const w=o?o.map(v=>v.name).map(v=>`metadata.timespan[start=-INF][end=+INF].group[name=${v}]`).join(","):void 0,A=n?n.map(v=>v.name).map(v=>`metadata.timespan[start=-INF][end=+INF].field[name=${v}]`).join(","):"metadata.timespan[start=-INF][end=+INF].field";S.p=encodeURIComponent([A,w].join(","))}else S.content="metadata",Array.isArray(n)&&n.length>0&&(S.field=n.map(({name:w})=>w)),Array.isArray(o)&&o.length>0&&(S.group=o.map(({name:w})=>w));return S},[n,o,u,h]),[I,T]=C.useState(!1),b=()=>T(!I),{fieldsWithAttributes:M=[],groupsWithAttributes:L=[]}=ne.useAddMetadataFieldAttributes({fields:n,groups:o,getAttributes:m});return t.jsxs(t.Fragment,{children:[i&&t.jsx(r.Box,{display:"flex",justifyContent:"flex-end",children:t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{checked:I,onChange:b}),label:s(I),labelPlacement:"start"})}),t.jsx(ne.GetItem,{itemId:a,queryParams:y,children:i&&I?t.jsx(si,{fields:M||n,groups:L||o,onSuccess:b,onError:l,joinValue:d}):t.jsx(ne.MetadataType,{joinValue:c,groupAsList:p,children:t.jsx(di,{fields:M||n,groups:L||o,formatValue:g})})})]})}const uf=r.withStyles({},{name:"VdtItemMetadataTab"})(pf);function gf({itemId:a,metadataGroupText:n="Metadata Group",editingLabel:o=s=>s?"Cancel":"Edit"}){const[s,i]=C.useState([]),[l,d]=C.useState([]),[c,p]=C.useState(),[u,g]=C.useState(!1),{request:h,data:{field:m=[]}={}}=ne.useApi(Q.fieldgroup.getFieldGroup),{request:y,data:{group:I=[]}={}}=ne.useApi(Q.fieldgroup.listFieldGroup);C.useEffect(()=>{y()},[]);const T=()=>h({groupName:c});C.useEffect(()=>{const L=I.map(S=>S.name);d(L)},[I]),C.useEffect(()=>{c&&T()},[c]),C.useEffect(()=>{if(m&&m.length){const L=m.map(S=>({value:S.name,label:S.name}));i(L)}},[m]);const b={content:"metadata",interval:"generic",includeTransientMetadata:!1,field:s?s.map(({value:L})=>L):[]},M=()=>g(!u);return t.jsxs(t.Fragment,{children:[t.jsxs(r.Box,{display:"flex",justifyContent:"flex-end",children:[t.jsx(oe.Autocomplete,{options:l,id:"field-group-select",disabled:u,disableClearable:!0,style:{width:"100%",paddingBottom:"1rem"},onChange:(L,S)=>{S&&p(S)},renderInput:L=>t.jsx(r.TextField,{label:n,...L})}),t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{checked:u,onChange:M}),label:o(u),labelPlacement:"start"})]}),t.jsx(ne.GetItem,{itemId:a,queryParams:b,children:u?t.jsx(si,{fields:s,groups:l,onSuccess:M}):t.jsx(ne.MetadataType,{children:t.jsx(Hs,{fields:s,groups:l})})})]})}const hf=r.withStyles({},{name:"VdtItemFieldGroupTab"})(gf);function f(a){return()=>a.apply(this,arguments)}const ci=f(()=>({field:e.arrayOf(e.shape({name:e.string.isRequired,value:e.arrayOf(e.string)})),end:e.string.isRequired,start:e.string.isRequired})),pi=f(()=>({storage:e.arrayOf(e.shape(hl)),asset:e.arrayOf(e.shape(id)),file:e.arrayOf(e.shape(Xi))})),ui=f(()=>e.arrayOf(e.shape(yn),e.shape({track:e.arrayOf(e.shape(Qd))}))),pn=f(()=>e.arrayOf(pa,e.shape({channelCount:e.number.isRequired,frameSize:e.number,channelLayout:e.number,sampleFormat:e.string,mediaInfo:nl,blockAlign:e.number}))),gi=f(()=>({field:e.arrayOf(e.shape(At)),group:e.arrayOf(e.shape(At))})),hi=f(()=>({storage:e.arrayOf(e.shape(na)),data:e.arrayOf(e.shape({value:e.string.isRequired,key:e.string.isRequired})),name:e.string})),un=f(()=>({track:e.number,subClip:e.arrayOf(e.shape(qd)),uri:e.string,stream:e.number,id:e.string})),yi=f(()=>e.arrayOf(e.shape(Ee))),mi=f(()=>({minLength:e.number,pattern:e.string,maxLength:e.number})),ta=f(()=>({resource:e.arrayOf(e.shape(xn)),bulkyMetadataURI:e.string,versionMajor:e.number.isRequired,versionPatch:e.number.isRequired,versionMinor:e.number.isRequired,trackerPlugin:e.string.isRequired,configuration:e.arrayOf(e.shape(de))})),fi=f(()=>({type:e.string,id:e.string,context:e.string})),yf=f(()=>({item:e.arrayOf(e.shape(ga)),library:e.arrayOf(e.shape(ga)),collection:e.arrayOf(e.shape(ga))})),Ci=f(()=>({useStartTLS:e.bool.isRequired,groupSearchFilter:e.string,bindPassword:e.string,bindDN:e.string,url:e.arrayOf(e.string),import:e.shape(On),groupnameAttribute:e.string,usernameFormat:e.string,userDN:e.string.isRequired,sync:tp,realNameAttribute:e.string,userSearchFilter:e.string,usernameAttribute:e.string.isRequired,groupDN:e.string,cacheLifetime:e.number})),Ti=f(()=>({stream:e.arrayOf(e.shape({input:e.arrayOf(e.shape({interval:e.shape(Ue).isRequired,uri:e.string.isRequired,stream:e.number.isRequired}))})),outputUri:e.string.isRequired,containerFormat:e.string.isRequired})),bi=f(()=>({field:e.arrayOf(e.string),expires:e.string.isRequired,id:e.string.isRequired,user:e.string.isRequired})),Ii=f(()=>({itemTrack:e.string,end:e.string,stream:e.number,start:e.string,value:e.string,maps:e.shape(Yc),key:e.string.isRequired,channel:e.number})),Mi=f(()=>e.arrayOf(e.shape(sa))),Li=f(()=>({source:e.arrayOf(e.shape({absoluteAlias:e.string,alias:e.string,setting:e.arrayOf(e.shape(de)),uri:e.string.isRequired})),targetUri:e.string.isRequired})),Si=f(()=>({frameSize:e.number.isRequired,frameCount:e.number.isRequired})),wi=f(()=>e.arrayOf(e.shape(nt),e.shape({script:e.string.isRequired}))),Pe=f(()=>({timespan:e.arrayOf(e.shape({field:e.arrayOf(e.shape(Yn)),end:e.string,group:e.arrayOf(e.shape(ua)),base:e.string,start:e.string})),group:e.arrayOf(e.string),template:e.string,revision:e.string})),Ai=f(()=>({path:e.string.isRequired,createProxiesStorage:e.string,isCollectionStorage:e.string,name:e.string.isRequired,id:e.string.isRequired})),mf=f(()=>({bars:e.shape({threshold:e.number.isRequired,percentage:e.number.isRequired}),freeze:e.shape({threshold:e.number.isRequired,time:e.number.isRequired}),video:e.shape(rc),black:e.shape({threshold:e.number.isRequired,percentage:e.number.isRequired}),audio:e.shape(Ei),channel:e.arrayOf(e.shape(Vn))})),Di=f(()=>({importShapes:e.string,databaseName:e.string.isRequired,url:e.string.isRequired,description:e.string,mxfServerUserId:e.number.isRequired,enforceQuota:e.bool,fileImportPattern:e.string,mxfServerPathToStorage:e.string.isRequired,atomShapes:e.string,userWorkspaceUrl:e.string.isRequired,storageId:e.string.isRequired,mxfServerWorkspacePath:e.string.isRequired,detectAtom:e.bool,workspaceUrl:e.string.isRequired,metadata:e.shape(Le)})),gn=f(()=>({hashRequest:e.shape(Zi),shapeDeductionRequest:e.shape(Jd),transferRequest:e.shape(Bl),xmpRequest:e.shape(xi),queueRequest:e.shape(Fc),timelineRequest:e.shape(Ti),aafGeneratorRequest:e.shape(Ni),movIndexRequest:e.shape(Li),mxfTimecodeExtractionRequest:e.shape(oc),mxfOp1bRequest:e.shape(Rc),durationRequest:e.shape(_d),complexRequest:e.shape(Sc),nleRequest:e.shape(Cl),segmentationRequest:e.shape(fl)})),Ni=f(()=>({xml:e.string,aaf:e.string})),vi=f(()=>e.arrayOf(Bn,e.shape({mix:e.arrayOf(e.shape(Ql)),uri:e.string,sequence:e.arrayOf(e.number)}))),xi=f(()=>({read:e.arrayOf(e.shape(Qc)),write:e.arrayOf(e.shape(kc))})),hn=f(()=>({lang:e.string,id:e.string,value:e.string})),Oi=f(()=>({fieldValue:e.string.isRequired,value:e.number})),Ei=f(()=>({otif:e.arrayOf(e.shape(xt))})),ji=f(()=>({videoCodec:e.string.isRequired,name:e.string.isRequired,description:e.string.isRequired,GUID:e.string.isRequired,displayAspectRatio:e.shape(Ge).isRequired,audioCodec:e.string.isRequired,containerFormat:e.string.isRequired})),Pi=f(()=>({url:e.string.isRequired,username:e.string.isRequired,password:e.string.isRequired,tag:e.string.isRequired,description:e.string})),ki=f(()=>({transition:e.shape(ic),subClip:e.number,effect:e.arrayOf(e.shape(Nn)),fillerLength:e.number})),ff=f(()=>({count:e.number,entry:e.arrayOf(e.shape(Nl))})),Fi=f(()=>({prefix:e.string,destination:e.shape(at).isRequired})),zi=f(()=>({reverse:e.bool,transition:e.string,horizRepeat:e.number,vertRepeat:e.number,duration:e.shape(ue).isRequired,endPercentage:e.number,startPercentage:e.number,border:e.shape(tr),wipe:e.number})),Bi=f(()=>({encode:e.bool,decode:e.bool,name:e.string})),qi=f(()=>({maxInclusive:e.number,minInclusive:e.number})),Vi=f(()=>({endpoint:e.string,name:e.string,url:e.string.isRequired,state:e.string,scheme:e.arrayOf(e.string),type:e.string.isRequired})),Cf=f(()=>({version:e.arrayOf(e.shape({created:e.string,id:e.number.isRequired,uri:e.string.isRequired}))})),Gi=f(()=>({priority:e.string,state:e.string,fileId:e.string,name:e.string,transferred:e.number})),Ui=f(()=>({timestamp:e.string,value:e.string,level:e.string})),Tf=f(()=>({exportLocation:e.arrayOf(e.shape(vc))})),bf=f(()=>({property:e.arrayOf(e.shape(Ul))})),$i=f(()=>({codec:e.string.isRequired,bitrate:e.number,uri:e.string,sequence:e.arrayOf(e.number)})),Yi=f(()=>e.arrayOf(e.shape(Ue))),If=f(()=>({expires:e.string.isRequired,id:e.string.isRequired,user:e.string.isRequired})),Mf=f(()=>({group:e.arrayOf(e.shape(Pt))})),Wi=f(()=>({status:e.string,path:e.string,hash:e.string,id:e.string,file:e.arrayOf(e.shape(mt))})),Lf=f(()=>({inputFilters:e.shape({inputFilter:e.arrayOf(e.oneOf(["oldMetadata","shapeDocument"])),bulkyMetadataKeysRegex:e.string}),step:e.arrayOf(e.shape(ud)),triggers:e.shape({trigger:e.arrayOf(e.oneOf(["shapeMetadata","itemMetadata","bulkyMetadata"]))}),name:e.string,description:e.string})),_i=f(()=>({uri:e.string,video:e.arrayOf(e.shape(rd)),containerFormat:e.string.isRequired,audio:e.arrayOf(e.shape($i)),umid:e.string,clipName:e.string})),Sf=f(()=>({count:e.number,transferLogEntry:e.arrayOf(e.shape($c))})),Qi=f(()=>({interval:e.shape(Qn).isRequired})),wt=f(()=>({origin:e.string,index:e.oneOf(["noindex","index","extend"]),fullText:e.bool,floatRestriction:e.shape(qi),name:e.string,constraint:e.shape({parent:e.string,levelProperty:e.string.isRequired,value:e.string.isRequired,dataset:e.string.isRequired,validationGroup:e.string,levelValue:e.string.isRequired}),data:e.arrayOf(e.shape(de)),defaultValue:e.string,inheritance:e.string,caseSensitiveSorting:e.bool,system:e.string,longRestriction:e.shape(Wl),boost:e.number,values:e.shape(Le),sortable:e.bool,integerRestriction:e.shape(wl),externalId:e.arrayOf(e.string),type:e.oneOf(["date","date-noindex","date-sortable","float","float-noindex","float-sortable","integer","integer-noindex","integer-sortable","long","long-noindex","string","string-sortable","string-exact","string-exact-sortable","string-noindex","boolean","boolean-noindex","timeCode","timeCode-noindex"]),stringRestriction:e.shape(mi),schema:e.shape(At)})),Hi=f(()=>e.arrayOf(e.shape(Ee))),wf=f(()=>({pool:e.shape(hd)})),Af=f(()=>({slaveLicense:e.arrayOf(e.shape(el))})),Df=f(()=>({facet:e.arrayOf(e.shape(yt)),hits:e.number,autocomplete:e.arrayOf(e.shape(ca)),nextCursor:e.string,suggestion:e.arrayOf(e.shape(Nt)),entry:e.arrayOf(e.shape(Od))})),Zi=f(()=>({compute:e.arrayOf(e.shape(xl))})),yn=f(()=>({timestamp:e.shape(bc).isRequired,umid:e.string.isRequired})),Nf=f(()=>({component:e.arrayOf(e.shape(ut))})),vf=f(()=>({access:e.arrayOf(e.shape({rank:e.number,group:e.string.isRequired,permission:e.string.isRequired,extradata:e.string,effectivePermission:e.string,collection:e.string,id:e.string,grantor:e.string,type:e.string.isRequired,originalDisabledGrantor:e.arrayOf(e.string),library:e.string}))})),xf=f(()=>({fieldDefault:e.arrayOf(e.shape({fullText:e.bool.isRequired,name:e.string.isRequired})),autoSoftCommit:e.bool,queryTimeout:e.number,softCommitInterval:e.number,pingTimeout:e.number,commitInterval:e.number,pingAttempts:e.number})),Ji=f(()=>e.arrayOf(e.shape(Et),e.shape({Format_Settings_GOP:e.string,intra_dc_precision:e.number}))),Xi=f(()=>({path:e.string,hash:e.string,id:e.string,timestamp:e.string,size:e.number})),Ki=f(()=>({url:e.string.isRequired,userId:e.string,password:e.string,include:e.arrayOf(e.string),partyId:e.string})),aa=f(()=>e.arrayOf(e.shape(De))),mn=f(()=>({absoluteTime:e.bool,loc:e.string,"merged-access":e.shape(En),name:e.string,project:e.shape(ll),sequence:e.arrayOf(e.shape(Ot)),terse:e.shape({undefined:void 0}),content:e.arrayOf(e.shape(ec)),externalId:e.arrayOf(e.shape(jt)),id:e.string,metadata:e.shape(Pe)})),Ri=f(()=>({cleanup:e.bool,mediaLocation:e.arrayOf(e.shape({storageMethod:e.arrayOf(e.string),name:e.string.isRequired})),address:e.string.isRequired})),el=f(()=>e.arrayOf(e.shape(Dn),e.shape({slaveIdentifier:e.string,masterIdentifier:e.string,slaveInstances:e.number,validityTime:e.string,id:e.string,validityPeriod:e.number}))),tl=f(()=>({url:e.string.isRequired,state:e.string,tag:e.string.isRequired,description:e.string,metadata:e.shape(Le)})),al=f(()=>({priority:e.number,pattern:e.string.isRequired,name:e.string})),Of=f(()=>({value:e.arrayOf(e.shape({itemTrack:e.string,stream:e.number,filePath:e.arrayOf(e.string),data:e.arrayOf(e.number),channel:e.number,fileId:e.arrayOf(e.string)}))})),Ef=f(()=>({status:e.string.isRequired,index:e.string.isRequired,finish:e.string,priority:e.number.isRequired,start:e.string,indexesDone:e.number,indexesTotal:e.number})),pt=f(()=>({group:e.arrayOf(e.shape(Vt)),reference:e.arrayOf(e.string),field:e.arrayOf(e.shape(kt)),text:e.arrayOf(e.shape(zn)),item:oa,shape:vt,file:e.shape(Je),operator:e.arrayOf(e.shape(pt)),operation:e.oneOf(["AND","OR","NOT"]).isRequired})),ut=f(()=>({id:e.string,file:e.arrayOf(e.shape(mt)),metadata:e.arrayOf(e.shape(de))})),jf=f(()=>({namespace:e.arrayOf(e.shape(al))})),nl=f(()=>e.arrayOf(e.shape(Et))),rl=f(()=>({function:e.string.isRequired,error:e.string,hash:e.string,id:e.string.isRequired,uri:e.string.isRequired})),ol=f(()=>({gain:e.number.isRequired,id:e.number.isRequired,stream:e.number.isRequired,channel:e.number.isRequired})),sl=f(()=>({mix:e.arrayOf(e.shape(ol))})),il=f(()=>({alias:e.string.isRequired,fileName:e.string.isRequired})),ll=f(()=>({name:e.string,metadata:e.shape(Pe)})),fn=f(()=>({username:e.string.isRequired,field:e.arrayOf(e.shape(vn)),fieldGroup:e.arrayOf(e.shape(fn)),name:e.string.isRequired,permission:e.string.isRequired})),Ee=f(()=>({type:e.string})),dl=f(()=>({parameter:e.arrayOf(e.shape(de)),message:e.string.isRequired,type:e.string.isRequired,asset:e.string})),cl=f(()=>({otif:e.shape(xt),stream:e.arrayOf(e.number),framerate:Se,noAudio:e.bool,preset:e.arrayOf(e.string),mix:e.arrayOf(e.shape(Hn)),codec:e.string,allChannel:e.bool,output:e.arrayOf(e.shape(pp)),monoFile:e.bool,bitrate:e.number,setting:e.arrayOf(e.shape(de)),channel:e.arrayOf(e.number)})),Pf=f(()=>({username:e.string,updateMode:e.string,updateFrequency:e.number,lastUpdate:e.string,query:e.shape(Dt),id:e.string,autoRefresh:e.bool})),Cn=f(()=>({group:e.arrayOf(e.string),precedence:e.string,appliesTo:e.shape({type:e.string,id:e.string}),storage:e.arrayOf(e.string),priority:e.arrayOf(e.shape({storagecriteriatype:e.oneOf(["bandwidth","capacity"]),level:e.number.isRequired})),storageCount:e.number,inherited:e.bool,not:e.shape({group:e.arrayOf(e.string),storage:e.arrayOf(e.string),any:e.string}),id:e.string,pool:e.shape({group:e.arrayOf(e.string),storage:e.arrayOf(e.string)})})),pl=f(()=>({source:e.shape(pd).isRequired,destination:e.shape(Qi)})),ul=f(()=>({xml:e.string,aaf:e.string})),kf=f(()=>({siteRule:e.arrayOf(e.shape(nc))})),Ff=f(()=>({job:e.shape({type:e.string,value:e.string}).isRequired})),gl=f(()=>({input:e.arrayOf(e.shape(Wn))})),hl=f(()=>({path:e.string.isRequired,id:e.string.isRequired})),zf=f(()=>({group:e.arrayOf(e.shape({name:e.string.isRequired,permission:e.string.isRequired}))})),yl=f(()=>({timeCode:e.shape(ue).isRequired,uri:e.string.isRequired})),Bf=f(()=>({entry:e.arrayOf(e.shape(hc))})),ml=f(()=>({start:e.number.isRequired,length:e.number.isRequired,mediaRate:e.number.isRequired})),fl=f(()=>({segmentUriPostfix:e.string.isRequired,segmentLength:e.shape(ue).isRequired,playlistOutput:e.string.isRequired,input:e.string.isRequired,segmentUriPrefix:e.string.isRequired,containerFormat:e.string.isRequired})),Cl=f(()=>({sequence:e.arrayOf(e.shape(jd)),output2:e.arrayOf(e.shape(Kd)),pauseFrame:e.number,frameRate:aa.isRequired,audioClip:e.arrayOf(e.shape(ap)),videoClip:e.arrayOf(e.shape($d)),height:e.number.isRequired,width:e.number.isRequired,dar:e.shape(Ge).isRequired,output:e.arrayOf(e.shape(_i)),sampleRate:e.number.isRequired,subtitleClip:e.arrayOf(e.shape(Cc))})),qf=f(()=>({entry:e.arrayOf(e.arrayOf(e.shape(Dd)))})),Tl=f(()=>({position:e.number.isRequired,value:e.number.isRequired})),bl=f(()=>({entry:e.arrayOf(e.shape(Ld))})),Vf=f(()=>({shape:e.arrayOf(e.shape(gt)),created:e.string})),Il=f(()=>e.arrayOf(Ft)),Ml=f(()=>e.arrayOf(e.shape(Ee))),Gf=f(()=>({video:e.arrayOf(e.string),audio:e.arrayOf(e.string),container:e.string,binary:e.arrayOf(e.string)})),Ll=f(()=>e.arrayOf(e.shape(Ee))),Tn=f(()=>e.arrayOf(pa,e.shape({dropFrame:e.bool,bitDepth:e.number,colr_primaries:e.number,displayYOffset:e.shape(De),displayWidth:e.shape(De),colorPrimaries:e.string,averageFrameRate:Se,bitsPerPixel:e.number,pixelAspectRatio:e.shape(Ge),startTimecode:e.number,realBaseFrameRate:Se,fieldOrder:e.string,displayXOffset:e.shape(De),colr_matrix:e.number,mediaInfo:Ji,pixelFormat:e.string,codecTimeBase:Se,max_packet_size:e.number,ticks_per_frame:e.number,maxBFrames:e.number,containerSAR:e.shape(Ge),videoStandard:e.shape({type:e.string.isRequired,value:e.string}),colr_transfer_function:e.number,displayHeight:e.shape(De),resolution:e.shape($e)}))),bn=f(()=>({transition:e.shape(zi),setting:e.arrayOf(e.shape(de)),id:e.number.isRequired,stream:e.number.isRequired})),Sl=f(()=>({group:e.arrayOf(e.shape(Vt)),name:e.string,reference:e.arrayOf(e.string),item:oa,field:e.arrayOf(e.shape(kt)),shape:vt,file:e.shape(Je),operator:e.arrayOf(e.shape(pt)),operation:e.oneOf(["AND","OR","NOT"])})),wl=f(()=>({maxInclusive:e.number,minInclusive:e.number})),In=f(()=>({prefix:e.arrayOf(e.string)})),Al=f(()=>({to:e.shape(zt).isRequired,from:e.shape(zt).isRequired,type:e.string})),Dl=f(()=>e.arrayOf(e.shape(nt),e.shape({bean:e.string.isRequired,data:e.arrayOf(e.shape(de)),method:e.string.isRequired}))),Nl=f(()=>({username:e.string.isRequired,body:e.string,contentType:e.string,timestamp:e.string.isRequired,runAs:e.string,matrixParameters:e.string.isRequired,contentLength:e.string,responseCode:e.number,queryParameters:e.string.isRequired,path:e.string.isRequired,method:e.string.isRequired})),Mn=f(()=>({pattern:e.string.isRequired,tag:e.arrayOf(e.string)})),vl=f(()=>e.arrayOf(e.shape($n),e.shape({trackID:e.number.isRequired}))),At=f(()=>({reference:e.bool})),Uf=f(()=>({url:e.string,state:e.string,id:e.string,service:e.arrayOf(e.shape({status:e.string,resource:e.string.isRequired,name:e.string,state:e.string,cost:e.shape(rp),message:e.string,type:e.string}))})),Ge=f(()=>({horizontal:e.number.isRequired,vertical:e.number.isRequired})),xl=f(()=>({function:e.string,setting:e.arrayOf(e.shape(de)),id:e.string,uri:e.string.isRequired})),$f=f(()=>e.arrayOf(e.shape(Dt))),Ol=f(()=>({regex:e.string.isRequired,interval:e.number,destination:e.string.isRequired,source:e.string.isRequired,timeout:e.number,shapeTag:e.string.isRequired,checks:e.number})),El=f(()=>({loc:e.string,name:e.string.isRequired,transcoder:e.arrayOf(e.shape({id:e.string.isRequired})),priority:e.string,job:e.arrayOf(e.shape({priority:e.arrayOf(e.string),group:e.arrayOf(e.string),type:e.arrayOf(e.string),user:e.arrayOf(e.string),data:e.arrayOf(e.shape({value:e.string,key:e.string.isRequired}))})),maxConcurrency:e.number,metadata:e.shape(Le)})),jl=f(()=>({duration:e.shape(ue).isRequired,stream:e.arrayOf(e.shape(Yi))})),Pl=f(()=>({audio:e.bool,segment:e.arrayOf(e.shape(wd)),transition:e.arrayOf(e.shape(Gc))})),Yf=f(()=>({access:e.arrayOf(e.shape(ya)),field:e.arrayOf(e.shape(wt))})),kl=f(()=>({licenseError:e.string})),Fl=f(()=>e.arrayOf(e.shape(Ee))),zl=f(()=>e.arrayOf(e.shape(yn),e.shape({track:e.arrayOf(e.shape(vl))}))),Je=f(()=>({operator:e.shape(pt),field:e.arrayOf(e.shape(kt)),group:e.arrayOf(e.shape(Vt))})),Wf=f(()=>({group:e.arrayOf(e.shape(hi))})),Bl=f(()=>({transfer:e.arrayOf(e.shape(sd))})),ql=f(()=>({gain:e.number.isRequired,sequence:e.number.isRequired})),_f=f(()=>({facet:e.arrayOf(e.shape(yt)),notFound:e.arrayOf(e.shape(fi)),hits:e.number,job:e.arrayOf(e.shape(Zn))})),Ln=f(()=>e.arrayOf(e.shape(sa),e.shape({gopSize:e.number,forceCFR:e.bool,disableFrameDupDrop:e.bool,displayYOffset:e.shape(De),displayWidth:e.shape(De),rcInitialBufferOccupancy:e.number,detectFaces:e.shape({faceDetectorPlugin:e.string.isRequired,metadataUri:e.string.isRequired}),maxBitrate:e.number,generateThumbnails:e.shape({minDelay:e.shape(ue),maxDelay:e.shape(ue),detectorPlugin:e.string,bulkyMetadataURI:e.string,uri:e.arrayOf(e.string),period:e.shape(ue),background:e.string,resolution:e.shape($e)}),imageQuality:e.number,stripParameterSets:e.bool,overlay:e.arrayOf(e.shape(ia)),addParameterSets:e.bool,generatePosters:e.shape({format:e.string,uri:e.arrayOf(e.string),setting:e.arrayOf(e.shape(de)),background:e.string,timeCode:e.arrayOf(e.shape(ue)),resolution:e.shape($e),smallPosters:e.bool}),displayXOffset:e.shape(De),burnTimecode:e.bool,scaling:e.shape(qn),pixelFormat:e.string,parameterSets:e.string,textOverlay:e.arrayOf(e.shape(qt)),level:e.number,maxBFrames:e.number,containerSAR:e.shape(Ge),colorSiting:e.number,minBitrate:e.number,rcBufferSize:e.number,displayHeight:e.shape(De),resolution:e.shape($e)}))),Dt=f(()=>({sort:e.arrayOf(e.shape({field:e.string.isRequired,order:e.oneOf(["ascending","descending"]).isRequired})),facet:e.arrayOf(e.shape({count:e.bool,name:e.string,maxResults:e.number,field:e.string.isRequired,range:e.arrayOf(e.shape(Bt)),exclude:e.arrayOf(e.string),minCount:e.number})),group:e.arrayOf(e.shape(Vt)),suggestion:e.shape(jc),reference:e.arrayOf(e.string),item:e.shape(oa),facetFilter:e.arrayOf(e.shape({field:e.string.isRequired,range:e.shape(Bt),value:e.string})),text:e.arrayOf(e.shape(zn)),version:e.number,filter:e.arrayOf(e.shape(Sl)),field:e.arrayOf(e.shape(kt)),shape:e.shape(vt),intervals:e.oneOf(["all","generic","timed"]),cursor:e.string,file:e.shape(Je),operator:e.shape(pt),highlight:e.shape({field:e.arrayOf(e.string),prefix:e.string,suffix:e.string,matchingOnly:e.bool}),autocomplete:e.arrayOf(e.shape(Ic))})),Sn=f(()=>({files:e.shape(la),"merged-access":e.shape(En),end:e.string,thumbnails:e.shape(la),timespan:e.arrayOf(e.shape({field:e.arrayOf(e.shape({name:e.string.isRequired,value:e.arrayOf(e.string)})),end:e.string.isRequired,start:e.string.isRequired})),terse:e.shape({undefined:void 0}),access:e.arrayOf(e.shape({type:e.string.isRequired,permission:e.string.isRequired})),start:e.string,shape:e.arrayOf(e.shape(gt)),base:e.string,externalId:e.arrayOf(e.shape(jt)),posters:e.shape(la),id:e.string,metadata:e.shape(Pe)})),Vl=f(()=>({type:e.string,target:e.shape(zt).isRequired})),Gl=f(()=>e.arrayOf(e.shape(da),e.shape({stringValue:e.string,hexValue:e.string}))),Ul=f(()=>({lastChange:e.string,value:e.string,key:e.string.isRequired})),Qf=f(()=>({id:e.arrayOf(e.shape(jt))})),Hf=f(()=>({url:e.string.isRequired,username:e.string.isRequired,password:e.string.isRequired,syncPolicy:e.oneOf(["ONDEMAND","ALWAYS"]).isRequired})),$l=f(()=>({userName:e.string.isRequired,loc:e.string,realName:e.string,accessPreserved:e.bool,remove:e.bool,groupList:e.shape(ha),disabled:e.bool,alias:e.arrayOf(e.string),password:e.string,salt:e.string,id:e.string,origin:e.string,metadata:e.shape(Le)})),Yl=f(()=>({codec:e.arrayOf(e.shape(Bi)),codecExtraTags:e.string})),Wl=f(()=>({maxInclusive:e.number,minInclusive:e.number})),_l=f(()=>({regex:e.string.isRequired,numGroup:e.number.isRequired,idGroup:e.number.isRequired,timeout:e.number.isRequired,numFormat:e.string})),Ql=f(()=>({input:e.arrayOf(e.shape(ql))})),Hl=f(()=>({timestamp:e.string.isRequired,user:e.string.isRequired,query:e.shape(Dt).isRequired})),Zl=f(()=>({gopSize:e.number,forceCFR:e.bool,displayYOffset:e.shape(De),displayWidth:e.shape(De),noVideo:e.bool,otif:e.shape(xt),imageQuality:e.number,stripParameterSets:e.bool,addParameterSets:e.bool,codec:e.string,setting:e.arrayOf(e.shape(de)),burnSubtitles:e.bool,profile:e.arrayOf(e.string),displayXOffset:e.shape(De),burnTimecode:e.bool,scaling:e.shape(qn),pixelFormat:e.string,preset:e.arrayOf(e.string),parameterSets:e.string,bitrate:e.number,maxBFrames:e.number,containerSAR:e.shape(Ge),framerate:Se,displayHeight:e.shape(De),resolution:e.shape($e)})),Jl=f(()=>({executed:e.string,created:e.string.isRequired,request:e.shape({body:e.string,uri:e.string,method:e.string}).isRequired,response:e.shape({hasBody:e.bool.isRequired,contentType:e.string,statusCode:e.number.isRequired}).isRequired,state:e.string.isRequired,user:e.string.isRequired,date:e.string.isRequired,id:e.number.isRequired})),Xl=f(()=>e.arrayOf(e.shape(Ee))),Zf=f(()=>({problem:e.arrayOf(e.shape(dl)),mappings:e.shape(pi).isRequired})),Kl=f(()=>e.arrayOf(e.shape(nt),e.shape({endpoint:e.string.isRequired,contentType:e.string,accessKey:e.string,queue:e.string.isRequired,secret:e.string,messageGroupId:e.string}))),Jf=f(()=>({access:e.arrayOf(e.shape(ya))})),Rl=f(()=>({textOverlay:e.arrayOf(e.shape(qt)),timeline:e.shape(Xc).isRequired,timeBase:Se,overlay:e.arrayOf(e.shape(dc))})),Xf=f(()=>({group:e.arrayOf(e.shape(gi))})),na=f(()=>({lowWatermark:e.number,projection:e.string,sequence:e.arrayOf(e.shape(Td)),sequenceTimeout:e.number,bandwidth:e.number,freeCapacity:e.number,id:e.string,capacity:e.number,highWatermark:e.number,autoDetect:e.bool,highWatermarkPercentage:e.number,priority:e.string,state:e.string,showImportables:e.bool,type:e.string,method:e.arrayOf(e.shape(Fn)),lowWatermarkPercentage:e.number,metadata:e.shape(Le),timestamp:e.string,scanInterval:e.number,bean:e.string,archiveScript:e.string})),ed=f(()=>({isExpired:e.bool,entityType:e.string.isRequired,expiryTime:e.string.isRequired,modified:e.string.isRequired,isInherited:e.bool,user:e.string.isRequired,entityId:e.string.isRequired,isEffective:e.bool,id:e.string.isRequired,metadata:e.shape(Le)})),wn=f(()=>({allPrevious:e.bool,step:e.number,previous:e.bool})),An=f(()=>({timeBase:Se,samples:e.number.isRequired})),td=f(()=>({name:e.string.isRequired,value:e.number,point:e.arrayOf(e.shape(Tl))})),Nt=f(()=>({term:e.string.isRequired,suggestion:e.arrayOf(e.string)})),ad=f(()=>({dms1Framework:Ft.isRequired,interval:e.shape(Ue).isRequired})),Kf=f(()=>({loudnessLU:e.number,end:e.string,mix:e.arrayOf(e.shape(cd)),startLoudness:e.string,endLoudness:e.string,start:e.string,shape:e.string,loudnessRangeLU:e.number,startRange:e.string,shapeTag:e.string,id:e.string,endRange:e.string})),Rf=f(()=>({rule:e.arrayOf(e.shape(Hc))})),vt=f(()=>e.arrayOf(e.shape(Je),e.shape({file:e.shape(Je)}))),Dn=f(()=>({endCustomerCompanyContactEmail:e.string,databaseSizeLimit:e.shape(ht),resellerCompanyContactEmail:e.string,licenseType:e.string,licenseErrorStatus:e.shape(kl),expiryDate:e.string,itemNumber:e.shape(ht),fileStatus:e.string,macaddresses:e.shape(Gn),licenseStatus:e.string,endCustomerCompanyname:e.string,storageNumber:e.shape(ht),transcoderNumber:e.shape(ht),userNumber:e.shape(ht),resellerCompanyName:e.string,codecStatus:e.shape(Yl)})),nd=f(()=>({decoderOfferThreads:e.number,logLevel:e.string,dataPath:e.string.isRequired,vp6EncoderPoolSize:e.number,carbonServer:e.arrayOf(e.shape(at)),apiUsername:e.string.isRequired,dataBufferFlushTime:e.number,redDecoderType:e.oneOf(["CPU","CUDA","OPENCL"]),tempPath:e.string,logo:e.string,port:e.number.isRequired,vp6Encoder:e.shape(at),bilinearEffects:e.bool.isRequired,thumbnailResolution:e.shape($e).isRequired,proresDecoder:e.shape(at),faceDetectorPlugin:e.arrayOf(e.shape(il)),encoderThreads:e.number,apiURL:e.shape(at),readBufferLength:e.number,dataBufferWriteSize:e.number,statsd:e.arrayOf(e.shape(Fi)),imagemagick:e.arrayOf(e.shape(de)),dataBufferSize:e.number,carbonPreset:e.arrayOf(e.shape(ji)),address:e.string.isRequired,colorProfilePath:e.arrayOf(e.string),proresEncoder:e.shape(at),thumbnailPeriod:e.shape(ue),apiPassword:e.string.isRequired,presetPath:e.string.isRequired})),rd=f(()=>({gopSize:e.number,sequence:e.number.isRequired,maxBFrames:e.number,uri:e.string,pixelFormat:e.string,preset:e.arrayOf(e.string),bitrate:e.number.isRequired,codec:e.string.isRequired})),od=f(()=>({transferResponse:e.arrayOf(e.shape(Ec)),estimatedTimeLeft:e.number,isRunning:e.bool.isRequired,log:e.arrayOf(e.shape(Ui)),shapeDeductionResponse:e.arrayOf(e.shape(dd)),inputProgress:e.arrayOf(e.shape(pc)),hashResponse:e.arrayOf(e.shape(rl)),request:e.shape(gn),aafGeneratorResponse:e.arrayOf(e.shape(ul)),thumbnail:e.arrayOf(e.shape(yl)),statusUri:e.string.isRequired,isPaused:e.bool.isRequired,xmpResponse:e.arrayOf(e.shape(sc)),durationResponse:e.arrayOf(e.shape(np)),progress:e.number,message:e.string,walltime:e.number.isRequired,id:e.string.isRequired,exitcode:e.number})),sd=f(()=>({destinationUri:e.arrayOf(e.string),setting:e.arrayOf(e.shape(de)),id:e.string,sourceUri:e.arrayOf(e.string)})),xt=f(()=>({resource:e.arrayOf(e.shape(xn)),uuid:e.string.isRequired,versionMajor:e.number.isRequired,versionPatch:e.number.isRequired,versionMinor:e.number.isRequired,configuration:e.arrayOf(e.shape(de))})),Nn=f(()=>({parameter:e.arrayOf(e.shape(td)),name:e.string.isRequired})),id=f(()=>({item:e.string.isRequired,shape:e.string,id:e.string.isRequired})),vn=f(()=>({username:e.string.isRequired,name:e.string.isRequired,permission:e.string.isRequired})),ld=f(()=>({field:e.string,id:e.string,value:e.string})),ra=f(()=>({reverseAddress:e.string,weight:e.number,reverseAddressDetected:e.string,url:e.string.isRequired,job:e.arrayOf(e.shape(od)),transcoder:e.arrayOf(e.shape(ra)),state:e.string,version:e.string,directAccess:e.arrayOf(e.shape(md)),configuration:e.shape(nd),type:e.oneOf(["TRANSCODER","DIRECTORY"]),maxJob:e.number})),Ot=f(()=>({track:e.arrayOf(e.shape(Pl)),id:e.string})),dd=f(()=>({shape:e.shape(gt).isRequired,range:e.arrayOf(e.shape(ft)),id:e.string.isRequired,uri:e.string})),cd=f(()=>({sourceItemTrack:e.string,sourceChannel:e.number,sourceStream:e.number,name:e.string,weightdB:e.number})),pd=f(()=>({interval:e.shape(Qn),id:e.string.isRequired})),ud=f(()=>({script:e.string,order:e.number,xslt:e.string,description:e.string})),gd=f(()=>({netmask:e.string.isRequired,bandwidth:e.number})),hd=f(()=>({minSize:e.number.isRequired,maxSize:e.number,evictionInterval:e.number,minIdleTime:e.number})),eC=f(()=>({certificate:e.string,uploadUri:e.string,clientCertificate:e.arrayOf(e.string),expiryTime:e.number,path:e.string,clientKey:e.string})),gt=f(()=>({mimeType:e.arrayOf(e.string),videoComponent:e.arrayOf(e.shape(Tn)),uuid:e.string,created:e.string,audioComponent:e.arrayOf(e.shape(pn)),descriptorComponent:e.arrayOf(e.shape(Wc)),essenceVersion:e.number,binaryComponent:e.arrayOf(e.shape(ep)),subtitleComponent:e.arrayOf(e.shape(Cd)),item:e.arrayOf(e.shape({id:e.string})),tag:e.arrayOf(e.string),containerComponent:e.shape(Pn),id:e.string,metadata:e.shape(Le)})),tC=f(()=>({slave:e.arrayOf(e.shape(Vc))})),at=f(()=>({host:e.string,port:e.number.isRequired,address:e.string})),yd=f(()=>({value:e.string.isRequired,key:e.string.isRequired})),xn=f(()=>({name:e.string.isRequired,uri:e.string.isRequired})),md=f(()=>({filter:e.string.isRequired,rewrite:e.arrayOf(e.shape({pattern:e.string.isRequired,replacement:e.string.isRequired}))})),fd=f(()=>({excludeFilter:e.arrayOf(e.shape(Mn)),settingsId:e.string,fileNameAsTitle:e.bool,projection:e.string,shapeTagFilter:e.arrayOf(e.shape(Mn)),enabled:e.bool,sequenceDefinition:e.shape(Lc),storage:e.string,disabledSidecarExtensions:e.arrayOf(e.string),ignoreSidecarImport:e.bool,priority:e.string,jobmetadata:e.shape(Le),tag:e.arrayOf(e.string),user:e.string,resourceId:e.string,metadata:e.shape(Pe)})),On=f(()=>({interval:e.number,importOrganizationalUnits:e.bool})),Et=f(()=>({Bit_rate_mode:e.string,property:e.arrayOf(e.shape(de)),Source:e.string})),En=f(()=>({access:e.arrayOf(e.shape({username:e.string,superUser:e.bool,rank:e.number.isRequired,group:e.string,permission:e.string.isRequired,matches:e.bool,extradata:e.string,effectivePermission:e.string,collection:e.string,id:e.string,grantor:e.string,type:e.string.isRequired,originalDisabledGrantor:e.arrayOf(e.string),library:e.string})),query:e.shape({username:e.string.isRequired,item:e.string.isRequired,extradata:e.string,type:e.string.isRequired,permission:e.string.isRequired}),field:e.arrayOf(e.shape(vn)),fieldGroup:e.arrayOf(e.shape(fn))})),Cd=f(()=>e.arrayOf(pa)),Td=f(()=>({regex:e.string.isRequired,numGroup:e.number})),bd=f(()=>({uri:e.string.isRequired,sourcePackageID:e.string})),Id=f(()=>({status:e.string.isRequired,name:e.string,took:e.string,test:e.arrayOf(e.shape(Id)),message:e.arrayOf(e.string),description:e.string})),Md=f(()=>e.arrayOf(e.shape(nt),e.shape({url:e.string.isRequired,contentType:e.string,method:e.string,timeout:e.string.isRequired}))),oa=f(()=>e.arrayOf(e.shape(Je),e.shape({shape:vt,file:e.shape(Je)}))),Ld=f(()=>({key:e.string.isRequired,value:e.string})),sa=f(()=>({objectTracking:e.shape(ta),timeBase:Se,codecTag:e.number,codecName:e.string,setting:e.arrayOf(e.shape(de)),edl:e.shape(Xn),codecTagString:e.string,start:e.shape(ue),codec:e.string,bitrate:e.number,id:e.arrayOf(e.number),preset:e.arrayOf(e.string),metadata:e.arrayOf(e.shape(de))})),Sd=f(()=>({id:e.string.isRequired,value:e.string})),aC=f(()=>({default:e.shape(Cn),tag:e.arrayOf(e.shape(Cn))})),wd=f(()=>({sourceIn:e.shape(ue),effect:e.arrayOf(e.shape(Nn)),sourceTrack:e.number.isRequired,item:e.string.isRequired,in:e.shape(ue),sourceOut:e.shape(ue),out:e.shape(ue)})),Ad=f(()=>({vidinet:e.shape(Vi),externalTranscoder:e.shape(Ol),network:e.shape(gd),unknown:e.string,cerify:e.shape(Ri),mxfserver:e.shape(Di),transcoder:e.shape(ra),cloudconvert:e.shape(Pd),thumbnail:e.shape(Ac),state:e.string,signiant:e.shape(Pi),eidr:e.shape(Ki),ldap:e.shape(Ci),id:e.string,finalcutserver:e.shape(tl)})),nC=f(()=>({lock:e.arrayOf(e.shape(bi))})),rC=f(()=>({action:e.shape({http:Md,sqs:Kl,jms:cc,javascript:wi,ejb:Dl,sns:Wd}).isRequired,trigger:e.shape({group:Hi,deletionLock:Ml,storage:Ll,shape:Xl,collection:lc,quota:Fl,access:tc,item:yi,job:vd,file:Hd,document:_c,metadata:jn}).isRequired})),de=f(()=>({value:e.string.isRequired,key:e.string.isRequired})),ia=f(()=>({opacity:e.number,interval:e.shape(Ue),uri:e.arrayOf(e.string),range:e.arrayOf(e.shape(ft)),y:e.number.isRequired,x:e.number.isRequired,id:e.string})),oC=f(()=>({changeSet:e.arrayOf(e.shape({id:e.string.isRequired,metadata:e.shape(Pe).isRequired}))})),sC=f(()=>({item:e.arrayOf(e.shape({externalId:e.string,id:e.string,uri:e.string})),metadata:e.shape(Pe),id:e.string,sequence:e.arrayOf(e.shape(Ot))})),Dd=f(()=>({field:e.shape(Yn),group:e.shape(ua),value:e.shape(hn),source:e.shape({loc:e.string.isRequired,type:e.string.isRequired,id:e.string.isRequired})})),iC=f(()=>({prefixes:e.shape(In),hits:e.number,nextCursor:e.string,file:e.arrayOf(e.shape(mt))})),lC=f(()=>({hits:e.number.isRequired,group:e.arrayOf(e.shape({definition:e.shape(Pt),end:e.string.isRequired,uuid:e.string.isRequired,source:e.shape({loc:e.string.isRequired,type:e.string.isRequired,id:e.string.isRequired}).isRequired,value:e.shape(ua),start:e.string.isRequired,name:e.string.isRequired}))})),Nd=f(()=>({tag:e.string})),vd=f(()=>e.arrayOf(e.shape(Ee),e.shape({create:e.string,stop:e.string,update:e.string,filter:e.shape({step:e.number,type:e.string,jobdata:e.shape({"value-regex":e.string,"key-regex":e.string,value:e.string,key:e.string})}),finished:e.string,fail:e.string,contentFilters:e.shape({contentFilter:e.arrayOf(e.oneOf(["jobId","jobState","user","startTime","jobType","jobData","errorMessage","itemId","totalSteps","currentStep"]))}),placeholder:e.bool}))),xd=f(()=>({gain:e.number,id:e.number,stream:e.number,channel:e.number.isRequired})),dC=f(()=>({value:e.arrayOf(e.shape(Sd))})),jn=f(()=>e.arrayOf(e.shape(Ee))),Od=f(()=>({end:e.string,start:e.string,timespan:e.arrayOf(e.shape(ci)),parent_type:e.string,collection:e.shape(mn),item:e.shape(Sn),shape:e.shape(gt),base:e.string,parent_id:e.string,file:e.shape(mt),type:e.string,id:e.string})),Ed=f(()=>({barsThresh:e.number,metadataUri:e.string.isRequired,blackPercentage:e.number,freezeThresh:e.number,freezeTime:e.number,video:e.shape(ip),barsPercentage:e.number,blackThresh:e.number,audio:e.shape(dp),channel:e.arrayOf(e.shape(Vn))})),jd=f(()=>({track:e.arrayOf(e.shape(op)),length:e.number.isRequired,id:e.number.isRequired})),Pn=f(()=>e.arrayOf(e.shape(ut),e.shape({roundedTimeBase:e.number,mediaInfo:e.shape(Et),dropFrame:e.bool,format:e.string,startTimestamp:e.shape(ue),timeCodeTimeBase:Se,firstSMPTETimecode:e.string,subFormat:e.string,duration:e.shape(ue),startTimecode:e.number}))),Pd=f(()=>({publicAddress:e.string.isRequired,apiHost:e.string.isRequired,apiKey:e.string.isRequired,inputMethod:e.string.isRequired,script:e.string.isRequired})),jt=f(()=>({externalId:e.string.isRequired,entityId:e.string.isRequired,entityType:e.string.isRequired,namespace:e.string.isRequired})),kd=f(()=>({id:e.number.isRequired,uri:e.string.isRequired})),cC=f(()=>({transfer:e.arrayOf(e.shape(Gi))})),Fd=f(()=>({packet:e.arrayOf(e.shape({stream:e.number,duration:e.number,length:e.number,offset:e.number,dts:e.number,pts:e.number,isKeyFrame:e.bool}))})),pC=f(()=>({access:e.arrayOf(e.shape(kn))})),zd=f(()=>({origin:e.string,loc:e.string,description:e.string,parentGroupList:e.shape(ha),userList:e.shape(zc),remove:e.bool,groupName:e.string,role:e.bool,childGroupList:e.shape(ha),id:e.string,metadata:e.shape(Le)})),uC=f(()=>({statsd:Zd})),kn=f(()=>({loc:e.string,group:e.string,recursive:e.bool,permission:e.string.isRequired,appliesTo:e.arrayOf(e.shape({undefined:void 0})),grantor:e.string,priority:e.number,user:e.string,operation:e.shape({shape:e.shape(Nd),uri:e.shape(uc),metadata:e.shape(Gd)}),id:e.string})),Fn=f(()=>({loc:e.string,read:e.bool.isRequired,lastSuccess:e.string,uri:e.string.isRequired,lastFailure:e.string,write:e.bool.isRequired,browse:e.bool.isRequired,bandwidth:e.number,failureMessage:e.string,type:e.string,id:e.string,metadata:e.shape(Le)})),Bd=f(()=>e.arrayOf(Ln,e.shape({uri:e.string,sequence:e.number.isRequired}))),la=f(()=>({hits:e.number,uri:e.arrayOf(e.string)})),zn=f(()=>({noescape:e.bool,boost:e.number,value:e.string})),qd=f(()=>({start:e.number.isRequired,length:e.number.isRequired,id:e.number.isRequired})),gC=f(()=>({sequence:e.shape(Ot),format:e.string,storage:e.arrayOf(e.shape({path:e.string,id:e.string.isRequired})),content:e.arrayOf(e.string),item:e.arrayOf(e.shape({path:e.string.isRequired,id:e.string.isRequired})),tag:e.string})),Bn=f(()=>e.arrayOf(e.shape(sa),e.shape({thumbnailUri:e.arrayOf(e.string)}))),hC=f(()=>({search:e.arrayOf(e.shape(Hl))})),Ue=f(()=>({start:e.shape(ue),end:e.shape(ue)})),ht=f(()=>({current:e.string,allowed:e.string})),Vd=f(()=>({threadStatus:e.string,exception:e.string,isRunning:e.bool,name:e.string,thread:e.string,exceptionTimestamp:e.string,isEnabled:e.bool,id:e.string,arguments:e.string,load60:e.number,load5:e.number,class:e.string})),yC=f(()=>({constraint:e.arrayOf(e.shape(ld))})),qn=f(()=>({padColor:e.string,right:e.number,bottom:e.number,pixelAspectRatio:e.shape(Ge),top:e.number,height:e.number,width:e.number,rotate:e.string,targetDAR:e.shape(Ge),left:e.number})),Gd=f(()=>({field:e.string})),mC=f(()=>({access:e.arrayOf(e.shape(kn)),id:e.string})),Ud=f(()=>({partition:e.arrayOf(e.shape({materialPackage:e.arrayOf(e.shape({staticTrack:e.arrayOf(e.shape({dms1Framework:Ft.isRequired})),eventTrack:e.arrayOf(e.shape({segment:e.arrayOf(e.shape(ad))}))})),offset:e.number}))})),Vn=f(()=>({thresh:e.number,tone:e.arrayOf(e.number),channel:e.number.isRequired,stream:e.number.isRequired})),$d=f(()=>e.arrayOf(e.shape(un))),Yd=f(()=>({exclude:e.arrayOf(e.string),include:e.arrayOf(e.string)})),Wd=f(()=>e.arrayOf(e.shape(nt),e.shape({topic:e.string.isRequired,secret:e.string,endpoint:e.string.isRequired,contentType:e.string,accessKey:e.string}))),da=f(()=>({ul:e.string.isRequired,name:e.string})),_d=f(()=>({input:e.arrayOf(e.shape({setting:e.arrayOf(e.shape(de)),id:e.string,uri:e.string.isRequired}))})),fC=f(()=>({field:e.arrayOf(e.shape(Ii)),id:e.string})),Qd=f(()=>e.arrayOf(e.shape($n),e.shape({sourcePackageID:e.string.isRequired}))),Hd=f(()=>e.arrayOf(e.shape(Ee),e.shape({hash:e.string,storage:e.string,new:e.string,close:e.string,change:e.string,delete:e.string}))),ca=f(()=>({field:e.string,suggestion:e.arrayOf(e.string)})),Zd=f(()=>e.arrayOf(e.shape(Yd),e.shape({host:e.string,prefix:e.string,port:e.number,tags:e.bool}))),Gn=f(()=>({databaseSize:e.number,macaddress:e.arrayOf(e.string)})),Jd=f(()=>({input:e.arrayOf(e.shape({verbose:e.bool,pageno:e.number,image:e.bool,useMediaInfo:e.bool,uri:e.string,range:e.arrayOf(e.shape(ft)),setting:e.arrayOf(e.shape(de)),id:e.string}))})),Xd=f(()=>({requireFastStart:e.bool,analyzeDuration:e.bool,fastStartDuration:e.arrayOf(e.shape(ue))})),CC=f(()=>({service:e.arrayOf(e.shape(Vd))})),Kd=f(()=>({audio:e.arrayOf(e.shape(vi)),video:e.arrayOf(e.shape(Bd)),format:e.shape(Kn).isRequired})),Rd=f(()=>({allowHeaders:e.arrayOf(e.string),allowOrigin:e.string.isRequired,allowMethods:e.arrayOf(e.string),allowOtherHeader:e.arrayOf(e.shape(de)),allowMaxAge:e.number})),TC=f(()=>({autocomplete:e.arrayOf(e.shape(ca)),hits:e.number,collection:e.arrayOf(e.shape(mn)),facet:e.arrayOf(e.shape(yt)),nextCursor:e.string,suggestion:e.arrayOf(e.shape(Nt))})),Un=f(()=>({verticalBase:e.string,yRel:e.number,font:e.string,size:e.number,outlineSize:e.number,sizeRel:e.number,xRel:e.number,language:e.string,line:e.arrayOf(e.string),a:e.number,b:e.number,outline:e.string,g:e.number,outlineG:e.number,align:e.string,outlineB:e.number,outlineA:e.number,r:e.number,horizontalBase:e.string,y:e.number,x:e.number,outlineR:e.number})),$n=f(()=>({name:e.string.isRequired,isPicture:e.bool.isRequired,frameRate:aa,number:e.number.isRequired,length:e.number.isRequired,is50FPS:e.bool})),bC=f(()=>({sequence:e.arrayOf(e.shape({type:e.string.isRequired,id:e.string.isRequired}))})),ec=f(()=>({addItems:e.bool,after:e.string,uri:e.string,mode:e.oneOf(["add","remove","move"]),metadata:e.shape(Le),type:e.oneOf(["item","library","collection"]),id:e.string,before:e.string})),tc=f(()=>e.arrayOf(e.shape(Ee))),ac=f(()=>({path:e.string.isRequired,size:e.number.isRequired,component:e.arrayOf(e.string),fileId:e.string.isRequired})),IC=f(()=>({relation:e.arrayOf(e.shape(cp))})),nc=f(()=>({files:e.bool,localTargetStorage:e.string,deleted:e.bool,site:e.string,access:e.bool,shape:e.arrayOf(e.string),groups:e.bool,targetStorage:e.string,id:e.string,metadata:e.bool})),Yn=f(()=>({referenced:e.shape(Jn),name:e.string,reference:e.string,inheritance:e.string,track:e.string,data:e.arrayOf(e.shape(de)),value:e.arrayOf(e.shape(hn)),type:e.shape(wt),id:e.arrayOf(e.string)})),rc=f(()=>({otif:e.arrayOf(e.shape(xt))})),oc=f(()=>({targetUri:e.string.isRequired,sourceUri:e.string.isRequired})),sc=f(()=>({xmp:e.string.isRequired,id:e.string.isRequired,uri:e.string.isRequired})),Wn=f(()=>e.arrayOf(e.shape(bn),e.shape({channel:e.number.isRequired}))),MC=f(()=>({hits:e.number,key:e.arrayOf(e.shape(Jc))})),yt=f(()=>({count:e.arrayOf(e.shape(Oi)),field:e.string.isRequired,range:e.arrayOf(e.shape(Bt)),name:e.string})),_n=f(()=>({name:e.string.isRequired,value:e.string.isRequired})),Se=f(()=>e.arrayOf(e.shape(De))),LC=f(()=>({job:e.shape({age:e.number,compress:e.bool,uri:e.string}),transferLog:e.shape({age:e.number,compress:e.bool,uri:e.string,forceAge:e.number,batch:e.number}),auditTrail:e.shape({body:e.bool,age:e.number,compress:e.bool,uri:e.string,batch:e.number}),changeLog:e.shape({age:e.number,forceAge:e.number})})),ic=f(()=>({reverse:e.bool,transition:e.string,horizRepeat:e.number,length:e.number.isRequired,vertRepeat:e.number,delta:e.number,endPercentage:e.number,startPercentage:e.number,border:e.shape(tr),wipe:e.number})),lc=f(()=>e.arrayOf(e.shape(Ee))),dc=f(()=>({y:e.number.isRequired,x:e.number.isRequired,interval:e.shape(Ue),id:e.string.isRequired})),cc=f(()=>e.arrayOf(e.shape(nt),e.shape({queue:e.string.isRequired,username:e.string,password:e.string,contentType:e.string,queueFactory:e.string.isRequired}))),SC=f(()=>({lock:e.arrayOf(e.shape(ed))})),pc=f(()=>({duration:e.shape(ue),mediaTime:e.shape(ue).isRequired})),Pt=f(()=>({origin:e.string,group:e.arrayOf(e.shape(Pt)),name:e.string,inheritance:e.string,access:e.arrayOf(e.shape(ya)),field:e.arrayOf(e.shape(wt)),externalId:e.arrayOf(e.string),data:e.arrayOf(e.shape(de)),schema:e.shape(At)})),Qn=f(()=>({start:e.shape(An).isRequired,end:e.shape(An)})),uc=f(()=>({type:e.string})),mt=f(()=>({range:e.arrayOf(e.shape({count:e.number.isRequired,start:e.string.isRequired})),hash:e.string,sequence:e.bool,timestamp:e.string,storage:e.string,uri:e.arrayOf(e.string),storageDefinition:e.shape(na),item:e.arrayOf(e.shape({shape:e.arrayOf(e.shape({component:e.arrayOf(e.shape({id:e.string})),id:e.string})),id:e.string})),state:e.string.isRequired,type:e.string,path:e.string,metadata:e.shape(Le),refreshFlag:e.number,id:e.string,size:e.number})),wC=f(()=>({migration:e.arrayOf(e.shape(Bc))})),pa=f(()=>e.arrayOf(e.shape(ut),e.shape({numberOfPackets:e.number,profile:e.number,itemTrack:e.string,timeBase:Se,level:e.number,repeatCount:e.number,startTimestamp:e.shape(ue),interval:e.shape(Ue),pid:e.number,edl:e.shape(Xn),codec:e.string,extradata:e.string,segment:e.number,duration:e.shape(ue),trackOrder:e.number,essenceStreamId:e.number,bitrate:e.number}))),AC=f(()=>({rule:e.arrayOf(e.shape(fd))})),ft=f(()=>({count:e.number,start:e.number.isRequired,wildcard:e.string.isRequired,value:e.string,width:e.number})),gc=f(()=>({vsInstance:e.arrayOf(e.shape(mc)),transcoder:e.arrayOf(e.shape(ra)),agentGroup:e.string,lastSeen:e.string,file:e.arrayOf(e.string),forwardService:e.arrayOf(e.shape(kd)),port:e.number,s3CredentialType:e.oneOf(["none","temporary","secretkey"]),uuid:e.string.isRequired,storage:e.arrayOf(e.shape(Ai)),instance:e.string,allStorages:e.bool,externalUri:e.string,status:e.oneOf(["OFFLINE","ONLINE"]),vsClusterAddress:e.string,publicKey:e.string,user:e.string,vxaVersion:e.string.isRequired,name:e.string,transcoderVersion:e.string.isRequired,uri:e.string,mode:e.string})),De=f(()=>({denominator:e.number.isRequired,numerator:e.number.isRequired})),DC=f(()=>({scheduledRequest:e.arrayOf(e.shape(Jl))})),NC=f(()=>({hits:e.number,dataset:e.arrayOf(e.shape({name:e.string.isRequired,uri:e.string.isRequired}))})),hc=f(()=>({request:e.arrayOf(e.shape(yc)),response:e.shape(Rd).isRequired})),yc=f(()=>({origin:e.arrayOf(e.string),pathRegex:e.arrayOf(e.string),originRegex:e.arrayOf(e.string),method:e.arrayOf(e.string),headerRegex:e.arrayOf(e.shape(de))})),vC=f(()=>({federationMetadataInterval:e.number,federationMetadataURI:e.string,validationEndpoint:e.string,publicKey:e.string,x509Certificate:e.string,expectedAudience:e.string,tokenUser:e.string})),mc=f(()=>({status:e.oneOf(["OFFLINE","ONLINE"]),vsClusterAddress:e.string,uri:e.string,lastSeen:e.string})),fc=f(()=>({index:e.shape(Fd),videoStream:e.arrayOf(e.shape(Tn)),dropFrame:e.bool,transcoderVersion:e.string,dvDescriptor:e.shape(Si),label:e.string,containerComponent:Pn,roundedTimeBase:e.number,startTimecode:e.number,audioStream:e.arrayOf(e.shape(pn))})),ue=f(()=>({timeBase:Se.isRequired,samples:e.number.isRequired})),Cc=f(()=>e.arrayOf(e.shape(Un))),Hn=f(()=>({input:e.arrayOf(e.shape(xd)),silence:e.bool})),nt=f(()=>({group:e.string,extradata:e.string,synchronous:e.bool.isRequired,retry:e.number})),Tc=f(()=>({field:e.arrayOf(e.shape(_n)),operation:e.oneOf(["AND","OR","NOT"]).isRequired})),xC=f(()=>({facetFilter:e.arrayOf(e.shape({field:e.string.isRequired,range:e.shape(Bt),value:e.string})),facet:e.arrayOf(e.shape({count:e.bool,name:e.string,exclude:e.arrayOf(e.string),maxResults:e.number,field:e.string.isRequired,maxCount:e.number,minCount:e.number}))})),Le=f(()=>({field:e.arrayOf(e.shape({value:e.string.isRequired,key:e.string.isRequired}))})),kt=f(()=>({range:e.arrayOf(e.shape({exclusiveMaximum:e.bool,exclusiveMinimum:e.bool,value:e.arrayOf(e.shape(er))})),name:e.string.isRequired,value:e.arrayOf(e.shape(er)),target:e.oneOf(["item","shape","file"])})),OC=f(()=>({concurrentJobs:e.number,pool:e.arrayOf(e.shape(xc))})),Zn=f(()=>({status:e.string.isRequired,totalSteps:e.number,log:e.shape({task:e.arrayOf(e.shape(Rn))}),started:e.string,data:e.arrayOf(e.shape({value:e.string.isRequired,key:e.string.isRequired})),waiting:e.shape({resourceType:e.string,resourceId:e.string,requirement:e.string}),currentStep:e.shape({status:e.string.isRequired,description:e.string.isRequired,number:e.number.isRequired}).isRequired,jobId:e.string.isRequired,priority:e.string.isRequired,subJob:e.arrayOf(e.shape(Zn)),finished:e.string,user:e.string,type:e.string.isRequired})),EC=f(()=>({token:e.string.isRequired,user:e.string.isRequired})),jC=f(()=>({group:e.arrayOf(e.shape(El))})),PC=f(()=>({task:e.arrayOf(e.shape(Oc)),metadata:e.shape(Le)})),kC=f(()=>({method:e.arrayOf(e.shape(Fn))})),Jn=f(()=>({type:e.string.isRequired,id:e.string.isRequired,uuid:e.string.isRequired})),bc=f(()=>({hour:e.number.isRequired,min:e.number.isRequired,month:e.number.isRequired,sec:e.number.isRequired,year:e.number.isRequired,qmsec:e.number.isRequired,day:e.number.isRequired})),$e=f(()=>({width:e.number.isRequired,height:e.number.isRequired})),Xn=f(()=>({entry:e.arrayOf(e.shape(ml)),timeBase:Se,timeScale:Se.isRequired})),Ft=f(()=>e.arrayOf(e.shape(da),e.shape({weakReference:e.arrayOf(e.shape(Zc)),strongReference:e.arrayOf(e.shape(Il)),leaf:e.arrayOf(e.shape(Gl)),child:e.arrayOf(e.shape(Ft))}))),Ic=f(()=>({text:e.string.isRequired,maximumSuggestions:e.number,field:e.string})),Mc=f(()=>({regex:e.string.isRequired,idGroup:e.number.isRequired})),Lc=f(()=>({sequenceMetadata:e.shape(Mc),fileSequence:e.shape(_l).isRequired})),ua=f(()=>({referenced:e.shape(Jn),name:e.string,inheritance:e.string,data:e.arrayOf(e.shape(de)),id:e.arrayOf(e.string),cycle:e.bool})),FC=f(()=>({conform:e.shape(Rl).isRequired,metadata:e.shape(Pe)})),zC=f(()=>({type:e.string,location:e.string.isRequired,asset:e.arrayOf(e.shape({status:e.string,name:e.string.isRequired,item:e.arrayOf(e.shape({shape:e.string,id:e.string,match:e.string,permission:e.string})),file:e.arrayOf(e.shape(Wi)),type:e.string.isRequired,id:e.string.isRequired}))})),Kn=f(()=>({dropFrame:e.bool,textOverlay:e.arrayOf(e.shape(qt)),requireFaststart:e.bool,overlay:e.arrayOf(e.shape(ia)),initialSMPTETimecode:e.string,atom:e.arrayOf(e.shape(bd)),uri:e.string,muxrate:e.number,clipName:e.string,roundedTimeBase:e.number,range:e.shape(ft),setting:e.arrayOf(e.shape(de)),maxChunkDuration:e.shape(ue),mxfPackages:e.shape(Uc),dms1Source:e.shape({demuxerId:e.number,metadata:e.shape(Ud)}),startTimecode:e.number,pfdTargetUri:e.string,metadata:e.arrayOf(e.shape(de)),id:e.number.isRequired,containerFormat:e.string.isRequired})),BC=f(()=>({hits:e.number,document:e.arrayOf(e.shape({name:e.string.isRequired,uri:e.string.isRequired}))})),Sc=f(()=>({input:e.arrayOf(e.shape({scanForStartPTS:e.number,bulkyMetadataRequest:e.shape(Pc),dms1TargetUri:e.string,pageno:e.number,interval:e.shape(Ue),uri:e.arrayOf(e.string),partialFile:e.shape(Kc),faststartDuration:e.arrayOf(e.shape(ue)),range:e.arrayOf(e.shape(ft)),demuxerSetting:e.arrayOf(e.shape(de)),intervalIsDts:e.bool,doubleDurationHack:e.number,analyze:e.shape(Ed),id:e.number.isRequired})),connection:e.arrayOf(e.shape({audioChannelMapInput:e.arrayOf(e.shape(Wn)),audioOutput:Bn,videoOutput:Ln,pid:e.number,audioMixInput:e.arrayOf(e.shape(sl)),input:e.arrayOf(e.shape(bn)),subtitleOutput:Mi,audioChannelSequenceInput:e.arrayOf(e.shape(gl))})),output:e.arrayOf(e.arrayOf(e.shape(Kn)))})),wc=f(()=>({total:e.number,unit:e.oneOf(["bytes","percent"]),value:e.number})),Ac=f(()=>({lastSuccess:e.string,failureMessage:e.string,state:e.string.isRequired,mode:e.string,path:e.string.isRequired,lastFailure:e.string})),qC=f(()=>({prefixes:e.shape(In),hits:e.number,element:e.arrayOf(e.shape(Dc))})),Dc=f(()=>({file:e.shape(mt).isRequired,metadata:e.shape(Pe)})),Nc=f(()=>({framerate:Se,preset:e.arrayOf(e.string),mix:e.arrayOf(e.shape(Hn)),codec:e.string,bitrate:e.number,setting:e.arrayOf(e.shape(de)),channel:e.arrayOf(e.number)})),vc=f(()=>({projection:e.string,script:e.string,uri:e.string,tag:e.arrayOf(e.string),uriList:e.arrayOf(e.string),name:e.string})),VC=f(()=>({autocomplete:e.arrayOf(e.shape(ca)),hits:e.number,library:e.string,facet:e.arrayOf(e.shape(yt)),item:e.arrayOf(e.shape(Sn)),nextCursor:e.string,suggestion:e.arrayOf(e.shape(Nt))})),xc=f(()=>({priorityThreshold:e.string.isRequired,size:e.number.isRequired})),Oc=f(()=>({description:e.string,script:e.string,extradata:e.string,dependency:e.shape(wn),step:e.number,cleanup:e.bool,flags:e.number,critical:e.bool,parallelDependency:e.shape(wn),id:e.number,jobType:e.string,metadata:e.shape(Le)})),Rn=f(()=>({status:e.string.isRequired,totalSubTasks:e.number,description:e.string,timestamp:e.string.isRequired,errorMessage:e.string,attempts:e.number.isRequired,id:e.number,step:e.number.isRequired,subStep:e.arrayOf(e.shape({timestamp:e.string.isRequired,description:e.string.isRequired})),progress:e.shape(wc),subTask:e.arrayOf(e.shape(Rn))})),Ec=f(()=>({destinationUri:e.arrayOf(e.string),id:e.string.isRequired,sourceUri:e.arrayOf(e.string),error:e.string})),GC=f(()=>({hits:e.number,vxa:e.arrayOf(e.shape(gc))})),jc=f(()=>({maximumSuggestions:e.number,accuracy:e.number})),er=f(()=>({noescape:e.bool,minimum:e.bool,boost:e.number,maximum:e.bool,value:e.string})),zt=f(()=>({field:e.shape(wt),group:e.shape(Pt)})),Pc=f(()=>({failIfTimecodeNotPresent:e.bool,targetUri:e.string.isRequired})),UC=f(()=>({alias:e.arrayOf(e.string)})),kc=f(()=>({setting:e.arrayOf(e.shape(de)),xmp:e.string.isRequired,id:e.string,uri:e.string.isRequired})),Fc=f(()=>({job:e.arrayOf(e.shape(gn))})),zc=f(()=>({hits:e.number,user:e.arrayOf(e.shape($l))})),Bc=f(()=>({rename:e.arrayOf(e.shape(sp)),move:e.arrayOf(e.shape(Al)),done:e.bool,id:e.number,migrationsLeft:e.number,delete:e.arrayOf(e.shape(Vl))})),tr=f(()=>({a:e.number.isRequired,width:e.number.isRequired,r:e.number.isRequired,b:e.number.isRequired,g:e.number.isRequired})),$C=f(()=>({video:e.shape(Zl),maxChunkDuration:e.shape(ue),sequenceOutput:e.shape({start:e.number,width:e.number}),script:e.string,preferredSourceTag:e.string,posterBackground:e.string,shapeMetadata:e.arrayOf(e.shape(de)),startTimecode:e.string,posterResolution:e.shape($e),metadata:e.shape(Le),description:e.string,format:e.string,faceDetect:e.bool,audioTrack:e.arrayOf(e.shape(Nc)),fastStartSetting:e.shape(Xd),addClipName:e.bool,thumbnailBackground:e.string,textOverlay:e.arrayOf(e.shape(qt)),name:e.string,thumbnailPeriod:e.shape(ue),overlay:e.arrayOf(e.shape(ia)),mediaconvert:e.shape({outputSetting:e.arrayOf(e.string),other:e.arrayOf(e.string),inputSetting:e.string}),thumbnailResolution:e.shape($e),demuxerSetting:e.arrayOf(e.shape(de)),thumbnailPlugin:e.string,audio:e.shape(cl),muxerSetting:e.arrayOf(e.shape(de)),preserveEDL:e.bool})),qc=f(()=>({version:e.string.isRequired,siteId:e.string,name:e.string.isRequired})),Vc=f(()=>({requestSourceIp:e.string,slaveInstanceName:e.string,slaveIp:e.string.isRequired,slaveMac:e.string.isRequired,hostname:e.string,lastUpdated:e.string.isRequired,slaveId:e.string.isRequired,Id:e.string.isRequired})),Gc=f(()=>({borderColor:e.string,reverse:e.bool,transition:e.string.isRequired,horizRepeat:e.number,borderWidth:e.number,vertRepeat:e.number,in:e.shape(ue).isRequired,endPercentage:e.number,startPercentage:e.number,wipe:e.number,out:e.shape(ue).isRequired})),Uc=f(()=>({materialTrackName:e.string.isRequired,tapeTrackName:e.string,materialPackage:ui.isRequired,tapePackage:zl,projectEditRate:aa})),Bt=f(()=>({start:e.string.isRequired,integerorempty:e.string,end:e.string.isRequired})),$c=f(()=>({destinationUri:e.string,status:e.string,sourceUri:e.string,destinationShape:e.string,timestamp:e.string,referredId:e.number,sourceFile:e.string,destinationFile:e.string,method:e.string,job:e.string,sourceShape:e.string,sourceItem:e.string,destinationStorage:e.string,destinationItem:e.string,id:e.number,sourceStorage:e.string})),Yc=f(()=>({map:e.arrayOf(e.shape(bl))})),Wc=f(()=>e.arrayOf(e.shape(ut),e.shape({description:e.arrayOf(e.shape({type:e.string.isRequired,value:e.string}))}))),YC=f(()=>({metadata:e.shape(Pe),sequence:e.shape(Ot).isRequired})),_c=f(()=>e.arrayOf(jn)),WC=f(()=>e.arrayOf(e.shape(Dt))),Qc=f(()=>({setting:e.arrayOf(e.shape(de)),id:e.string,uri:e.string.isRequired})),Hc=f(()=>({updateFrequency:e.number,lastUpdate:e.string,resource:e.arrayOf(e.shape({usage:e.number,limit:e.number.isRequired,name:e.oneOf(["item","storage"]).isRequired})),description:e.string,storageGroup:e.string,storage:e.string,collection:e.string,tag:e.string,externalId:e.arrayOf(e.shape(jt)),user:e.string,group:e.string,id:e.string,library:e.string})),_C=f(()=>({item:e.arrayOf(e.shape({id:e.string,metadata:e.shape(Pe)}))})),Zc=f(()=>e.arrayOf(e.shape(da),e.shape({target:e.string.isRequired}))),Jc=f(()=>({status:e.oneOf(["ACTIVE","INACTIVE"]).isRequired,secret:e.string,created:e.string.isRequired,id:e.string,name:e.string})),Xc=f(()=>({segment:e.arrayOf(e.shape(pl))})),Kc=f(()=>({descriptor:e.shape(fc),descriptorLocation:e.string,byteOffset:e.number,adjustForPTSPredecessors:e.bool})),Rc=f(()=>({output:e.string.isRequired,reference:e.arrayOf(e.shape({source:e.string.isRequired,stream:e.arrayOf(e.number),locator:e.arrayOf(e.string)}))})),ep=f(()=>e.arrayOf(e.shape(ut),e.shape({mediaInfo:e.shape(Et),length:e.number,encoding:e.string,offset:e.number,format:e.string}))),QC=f(()=>({resource:e.arrayOf(e.shape(Ad))})),tp=f(()=>e.arrayOf(e.shape(On),e.shape({createGroups:e.bool,createUsers:e.bool}))),ap=f(()=>e.arrayOf(e.shape(un))),HC=f(()=>({status:e.shape({metadataOnStorage:e.number.isRequired,metadataInDatabase:e.number.isRequired,storageStatus:e.string.isRequired}),storageDisabled:e.bool,uri:e.string})),ZC=f(()=>({hits:e.number,storage:e.arrayOf(e.shape(na))})),JC=f(()=>({resourcetype:e.arrayOf(e.shape({url:e.string,type:e.string.isRequired}))})),ga=f(()=>({after:e.string,id:e.string.isRequired,before:e.string})),np=f(()=>({duration:e.shape(jl).isRequired,id:e.string.isRequired,uri:e.string.isRequired})),rp=f(()=>({unit:e.string,value:e.number})),qt=f(()=>({opacity:e.number,text:e.shape(Un).isRequired,interval:e.shape(Ue)})),op=f(()=>({segment:e.arrayOf(e.shape(ki))})),sp=f(()=>({to:e.string.isRequired,from:e.shape(zt).isRequired})),XC=f(()=>({problem:e.arrayOf(e.shape(lp))})),ha=f(()=>({hits:e.number,group:e.arrayOf(e.shape(zd))})),ya=f(()=>({group:e.string,permission:e.string.isRequired,fieldGroup:e.string,field:e.string,user:e.string,id:e.string})),ip=f(()=>({otif:e.arrayOf(e.shape(ta))})),KC=f(()=>({file:e.arrayOf(e.shape(ac))})),Vt=f(()=>({operator:e.shape(pt),name:e.string})),RC=f(()=>({sort:e.arrayOf(e.shape({field:e.string.isRequired,order:e.oneOf(["ascending","descending"]).isRequired})),field:e.arrayOf(e.shape(_n)),operator:e.shape(Tc)})),lp=f(()=>({data:e.arrayOf(e.shape(yd)),job:e.arrayOf(e.string),type:e.string.isRequired,id:e.number.isRequired})),dp=f(()=>({otif:e.arrayOf(e.shape(ta))})),cp=f(()=>({direction:e.shape({source:e.string,type:e.string,target:e.string}).isRequired,id:e.string.isRequired,value:e.arrayOf(e.shape({key:e.string.isRequired,value:e.string}))})),pp=f(()=>({stream:e.arrayOf(e.number),format:e.string,framerate:Se,codec:e.string,bitrate:e.number,channel:e.arrayOf(e.number)})),eT=f(()=>({systemInfo:e.shape(Gn),component:e.arrayOf(e.shape(qc)),licenseInfo:e.shape(Dn)})),tT=f(()=>({facet:e.arrayOf(e.shape(yt)),hits:e.number,shape:e.arrayOf(e.shape(gt)),suggestion:e.arrayOf(e.shape(Nt))})),ye={SearchResultEntryTimespanType:e.exact(ci()),EssenceMappingsType:e.exact(pi()),MaterialPackageType:e.exact(ui()),AudioComponentType:e.exact(pn()),MetadataSchemaGroupType:e.exact(gi()),StorageGroupType:e.exact(hi()),ClipType:e.exact(un()),NotificationItemTriggerType:e.exact(yi()),MetadataFieldStringType:e.exact(mi()),ComplexJobOTIFType:e.exact(ta()),NotFoundExceptionType:e.exact(fi()),CollectionReorderType:e.exact(yf()),LDAPResourceType:e.exact(Ci()),TimelineJobRequestType:e.exact(Ti()),MetadataLockType:e.exact(bi()),BulkyMetadataPairType:e.exact(Ii()),ComplexJobSubtitleOutputType:e.exact(Mi()),MOVIndexJobType:e.exact(Li()),PartialFileDVDescriptorType:e.exact(Si()),NotificationJavaScriptActionType:e.exact(wi()),MetadataType:e.exact(Pe()),VXAStorageType:e.exact(Ai()),AnalyzeJobType:e.exact(mf()),MXFServerResourceType:e.exact(Di()),JobRequestChoiceType:e.exact(gn()),AAFGeneratorJobType:e.exact(Ni()),NLEJob2AudioOutputType:e.exact(vi()),XMPJobType:e.exact(xi()),MetadataValueType:e.exact(hn()),FacetCountType:e.exact(Oi()),AnalyzeAudioJobType:e.exact(Ei()),CarbonPreset:e.exact(ji()),SigniantType:e.exact(Pi()),TrackSegmentType:e.exact(ki()),AuditLogType:e.exact(ff()),StatsDRecieverType:e.exact(Fi()),TransitionType:e.exact(zi()),CodecType:e.exact(Bi()),MetadataFieldFloatType:e.exact(qi()),VidinetServiceType:e.exact(Vi()),EssenceVersionListType:e.exact(Cf()),TransferType:e.exact(Gi()),JobLogEntryType:e.exact(Ui()),ExportLocationListType:e.exact(Tf()),ConfigurationPropertyListType:e.exact(bf()),NLEJobAudioOutputType:e.exact($i()),StreamIntervalType:e.exact(Yi()),LockType:e.exact(If()),MetadataFieldGroupListType:e.exact(Mf()),FileReferenceType:e.exact(Wi()),AutoProjectionRuleType:e.exact(Lf()),NLEJobOutputType:e.exact(_i()),TransferLogListType:e.exact(Sf()),ConformDestinationType:e.exact(Qi()),MetadataFieldType:e.exact(wt()),NotificationGroupTriggerType:e.exact(Hi()),FtpPoolConfigurationType:e.exact(wf()),SlaveLicenseListType:e.exact(Af()),SearchResultType:e.exact(Df()),HashJobType:e.exact(Zi()),PackageType:e.exact(yn()),ComponentListType:e.exact(Nf()),AccessControlMergedGroupType:e.exact(vf()),IndexingConfigurationType:e.exact(xf()),VideoMediaInfoType:e.exact(Ji()),FileMappingType:e.exact(Xi()),EidrType:e.exact(Ki()),FrameRateType:e.exact(aa()),CollectionType:e.exact(mn()),CerifyType:e.exact(Ri()),SlaveLicenseType:e.exact(el()),FinalCutServerType:e.exact(tl()),ExternalIdentifierNamespaceType:e.exact(al()),WaveformDataType:e.exact(Of()),ReindexRequestType:e.exact(Ef()),SearchOperatorType:e.exact(pt()),ComponentType:e.exact(ut()),ExternalIdentifierNamespaceListType:e.exact(jf()),AudioMediaInfoType:e.exact(nl()),HashResponse:e.exact(rl()),ComplexJobMixType:e.exact(ol()),ComplexJobMixInputType:e.exact(sl()),PluginType:e.exact(il()),ProjectType:e.exact(ll()),MetadataFieldGroupPermissionType:e.exact(fn()),NotificationTriggerType:e.exact(Ee()),ExportProblemType:e.exact(dl()),AudioTranscodePresetType:e.exact(cl()),LibrarySettingsType:e.exact(Pf()),StorageRuleType:e.exact(Cn()),ConformSegmentType:e.exact(pl()),AAFGeneratorResponse:e.exact(ul()),SiteRuleListType:e.exact(kf()),JobPriorityConfigurationType:e.exact(Ff()),ComplexJobAudioChannelSequenceInputType:e.exact(gl()),StorageMappingType:e.exact(hl()),ImportAccessControlListType:e.exact(zf()),ThumbnailInfoType:e.exact(yl()),CORSConfigurationType:e.exact(Bf()),EDLEntryType:e.exact(ml()),SegmentationJobType:e.exact(fl()),NLEJobType:e.exact(Cl()),MetadataEntryListType2:e.exact(qf()),EffectPointType:e.exact(Tl()),BulkyMapType:e.exact(bl()),EssenceVersionType:e.exact(Vf()),MDObjectStrongReference:e.exact(Il()),NotificationDeletionLockTriggerType:e.exact(Ml()),PlaceholderImportRequestType:e.exact(Gf()),NotificationStorageTriggerType:e.exact(Ll()),VideoComponentType:e.exact(Tn()),ComplexJobInputType:e.exact(bn()),SearchFilterType:e.exact(Sl()),MetadataFieldIntegerType:e.exact(wl()),FilePrefixType:e.exact(In()),MetadataSchemaMoveOperationType:e.exact(Al()),NotificationEjbActionType:e.exact(Dl()),AuditLogEntryType:e.exact(Nl()),FilenameFilterType:e.exact(Mn()),TapePackageTrackType:e.exact(vl()),MetadataSchemaElementType:e.exact(At()),CostEstimateType:e.exact(Uf()),AspectRatioType:e.exact(Ge()),HashComputeOperation:e.exact(xl()),FileSearchType:e.exact($f()),ExternalTranscoderType:e.exact(Ol()),TaskGroupType:e.exact(El()),DurationType:e.exact(jl()),SequenceTrackType:e.exact(Pl()),MetadataFieldListType:e.exact(Yf()),LicenseErrorType:e.exact(kl()),NotificationQuotaTriggerType:e.exact(Fl()),TapePackageType:e.exact(zl()),CriterionType:e.exact(Je()),StorageGroupListType:e.exact(Wf()),TransferJobType:e.exact(Bl()),NLEJob2MixTypeInput:e.exact(ql()),JobListType:e.exact(_f()),ComplexJobVideoOutputType:e.exact(Ln()),ItemSearchType:e.exact(Dt()),ItemType:e.exact(Sn()),MetadataSchemaDeleteOperationType:e.exact(Vl()),MDObjectLeaf:e.exact(Gl()),ConfigurationPropertyType:e.exact(Ul()),ExternalIdentifierListType:e.exact(Qf()),SiteDefinitionType:e.exact(Hf()),UserType:e.exact($l()),CodecStatusType:e.exact(Yl()),MetadataFieldLongType:e.exact(Wl()),FileSequestionDefinitionType:e.exact(_l()),NLEJob2MixType:e.exact(Ql()),SearchHistoryType:e.exact(Hl()),VideoTranscodePresetType:e.exact(Zl()),ScheduledRequestType:e.exact(Jl()),NotificationShapeTriggerType:e.exact(Xl()),ExportResponseType:e.exact(Zf()),NotificationSQSActionType:e.exact(Kl()),MetadataFieldAccessControlListType:e.exact(Jf()),ConformType:e.exact(Rl()),MetadataSchemaType:e.exact(Xf()),StorageType:e.exact(na()),DeletionLockType:e.exact(ed()),TaskDefinitionDependency:e.exact(wn()),ConformTimePointType:e.exact(An()),EffectParameterType:e.exact(td()),SuggestionResultType:e.exact(Nt()),MDSegment:e.exact(ad()),LoudnessType:e.exact(Kf()),QuotaRuleListType:e.exact(Rf()),ShapeCriterionType:e.exact(vt()),LicenseType:e.exact(Dn()),TranscoderConfigurationType:e.exact(nd()),NLEJobVideoOutputType:e.exact(rd()),JobStatusType:e.exact(od()),TransferOperation:e.exact(sd()),OtifPresetType:e.exact(xt()),EffectType:e.exact(Nn()),AssetMappingType:e.exact(id()),MetadataFieldPermissionType:e.exact(vn()),MetadataFieldValueConstraintType:e.exact(ld()),TranscoderType:e.exact(ra()),SequenceType:e.exact(Ot()),ShapeDeductionResponse:e.exact(dd()),LoudnessMixType:e.exact(cd()),ConformSourceType:e.exact(pd()),AutoProjectionStepType:e.exact(ud()),NetworkType:e.exact(gd()),ConnectionPoolType:e.exact(hd()),LogReportConfigurationType:e.exact(eC()),ShapeType:e.exact(gt()),SlaveListType:e.exact(tC()),AddressPortType:e.exact(at()),KeyValueType:e.exact(yd()),NameURIPairType:e.exact(xn()),TranscoderDirectAccess:e.exact(md()),AutoImportRuleType:e.exact(fd()),LDAPImportType:e.exact(On()),BaseMediaInfoType:e.exact(Et()),AccessControlMergedType:e.exact(En()),SubtitleComponentType:e.exact(Cd()),StorageFileSequenceType:e.exact(Td()),ComplexJobAtomType:e.exact(bd()),SelfTestType:e.exact(Id()),NotificationHttpActionType:e.exact(Md()),ItemCriterionType:e.exact(oa()),BulkyMapEntryType:e.exact(Ld()),ComplexJobOutputType:e.exact(sa()),ConstraintValueType:e.exact(Sd()),StorageRulesType:e.exact(aC()),SequenceMediaType:e.exact(wd()),ResourceType:e.exact(Ad()),MetadataLockListType:e.exact(nC()),NotificationType:e.exact(rC()),KeyValuePairType:e.exact(de()),OverlayType:e.exact(ia()),MetadataChangeSetType:e.exact(oC()),ProjectVersionType:e.exact(sC()),MetadataEntryType:e.exact(Dd()),FileListType:e.exact(iC()),MetadataFieldResultType:e.exact(lC()),AccessControlShapeType:e.exact(Nd()),NotificationJobTriggerType:e.exact(vd()),AudioTranscodePresetChannelMixType:e.exact(xd()),ConstraintValueListType:e.exact(dC()),NotificationMetadataTriggerType:e.exact(jn()),SearchResultEntryType:e.exact(Od()),ComplexJobAnalyzeType:e.exact(Ed()),NLEJobSequenceType:e.exact(jd()),ContainerComponentType:e.exact(Pn()),CloudConvertType:e.exact(Pd()),ExternalIdentifierType:e.exact(jt()),ForwardServiceType:e.exact(kd()),TransferListType:e.exact(cC()),PartialFileRandomIndexType:e.exact(Fd()),AccessControlListType:e.exact(pC()),GroupType:e.exact(zd()),MetricsConfigurationType:e.exact(uC()),AccessControlType:e.exact(kn()),StorageMethodType:e.exact(Fn()),NLEJob2VideoOutputType:e.exact(Bd()),URIListType:e.exact(la()),ItemSearchTextValueType:e.exact(zn()),SubClipType:e.exact(qd()),ExportRequestType:e.exact(gC()),ComplexJobAudioOutputType:e.exact(Bn()),SearchHistoryListType:e.exact(hC()),TimeIntervalType:e.exact(Ue()),LicenseNumberType:e.exact(ht()),VidispineServiceType:e.exact(Vd()),MetadataFieldValueConstraintListType:e.exact(yC()),ScalingType:e.exact(qn()),AccessControlMetadataType:e.exact(Gd()),ImportSettingsType:e.exact(mC()),DMS1Type:e.exact(Ud()),AnalyzeAudioChannelType:e.exact(Vn()),VideoClipType:e.exact($d()),MetricsReporterType:e.exact(Yd()),NotificationSNSActionType:e.exact(Wd()),MDObjectBase:e.exact(da()),DurationJobType:e.exact(_d()),BulkyMetadataType:e.exact(fC()),MaterialPackageTrackType:e.exact(Qd()),NotificationFileTriggerType:e.exact(Hd()),AutocompleteResponseType:e.exact(ca()),StatsdReporterType:e.exact(Zd()),SystemInfoType:e.exact(Gn()),ShapeDeductionJobType:e.exact(Jd()),FastStartSettingType:e.exact(Xd()),VidispineServiceListType:e.exact(CC()),NLEJob2OutputType:e.exact(Kd()),CORSConfigurationEntryResponse:e.exact(Rd()),CollectionListType:e.exact(TC()),TextRenditionType:e.exact(Un()),PackageTrackType:e.exact($n()),SequenceListType:e.exact(bC()),CollectionContentType:e.exact(ec()),NotificationAccessTriggerType:e.exact(tc()),FileImportDefType:e.exact(ac()),ItemRelationListType:e.exact(IC()),SiteRuleType:e.exact(nc()),MetadataFieldValueType:e.exact(Yn()),AnalyzeVideoJobType:e.exact(rc()),MXFTimecodeExtractionJobType:e.exact(oc()),XMPResponse:e.exact(sc()),ComplexJobAudioChannelMapInputType:e.exact(Wn()),AccessKeyListType:e.exact(MC()),FacetType:e.exact(yt()),SimpleSearchFieldType:e.exact(_n()),TimeBaseType:e.exact(Se()),DatabasePurgingConfigurationType:e.exact(LC()),NLEJobTransitionType:e.exact(ic()),NotificationCollectionTriggerType:e.exact(lc()),ConformOverlayType:e.exact(dc()),NotificationJmsActionType:e.exact(cc()),DeletionLockListType:e.exact(SC()),JobInputProgressType:e.exact(pc()),MetadataFieldGroupType:e.exact(Pt()),ConformIntervalType:e.exact(Qn()),AccessControlUriType:e.exact(uc()),FileType:e.exact(mt()),MetadataSchemaMigrationListType:e.exact(wC()),MediaComponentType:e.exact(pa()),AutoImportRuleListType:e.exact(AC()),SequenceRangeType:e.exact(ft()),VXAType:e.exact(gc()),RationalType:e.exact(De()),ScheduledRequestListType:e.exact(DC()),MetadataDatasetListType:e.exact(NC()),CORSConfigurationEntry:e.exact(hc()),CORSConfigurationEntryRequest:e.exact(yc()),OAuth2ConfigurationType:e.exact(vC()),VXAVSInstanceType:e.exact(mc()),PartialFileDescriptorType:e.exact(fc()),TimeCodeType:e.exact(ue()),SubtitleClipType:e.exact(Cc()),AudioTranscodePresetMixType:e.exact(Hn()),NotificationActionType:e.exact(nt()),SimpleSearchOperatorType:e.exact(Tc()),JobSearchType:e.exact(xC()),SimpleMetadataType:e.exact(Le()),SearchFieldType:e.exact(kt()),JobPoolListType:e.exact(OC()),JobType:e.exact(Zn()),AuthenticationTokenType:e.exact(EC()),TaskGroupListType:e.exact(jC()),TaskDefinitionListType:e.exact(PC()),StorageMethodListType:e.exact(kC()),MetadataReferencedType:e.exact(Jn()),MXFTimestampType:e.exact(bc()),ResolutionType:e.exact($e()),EDLType:e.exact(Xn()),MDObjectNode:e.exact(Ft()),AutocompleteRequestType:e.exact(Ic()),SequenceMetaDataType:e.exact(Mc()),SequenceDefinitionType:e.exact(Lc()),MetadataGroupValueType:e.exact(ua()),ConformRequestType:e.exact(FC()),ProjectFileType:e.exact(zC()),ComplexJobOutputFormatType:e.exact(Kn()),DocumentListType:e.exact(BC()),ComplexJobType:e.exact(Sc()),JobTaskProgressType:e.exact(wc()),ThumbnailServiceType:e.exact(Ac()),ImportableFileListType:e.exact(qC()),ImportableFileType:e.exact(Dc()),AudioTrackTranscodePresetType:e.exact(Nc()),ExportLocationType:e.exact(vc()),ItemListType:e.exact(VC()),JobPoolType:e.exact(xc()),TaskDefinitionType:e.exact(Oc()),JobTaskType:e.exact(Rn()),TransferResponse:e.exact(Ec()),VXAListType:e.exact(GC()),SuggestionSearchType:e.exact(jc()),ItemSearchValueType:e.exact(er()),MetadataSchemaHierarchyType:e.exact(zt()),ComplexJobBulkyMetadataRequestType:e.exact(Pc()),PathAliasConfigurationType:e.exact(UC()),XMPWriteOperation:e.exact(kc()),QueueJobType:e.exact(Fc()),UserListType:e.exact(zc()),MetadataSchemaMigrationType:e.exact(Bc()),BorderType:e.exact(tr()),TranscodePresetType:e.exact($C()),CompType:e.exact(qc()),SlaveType:e.exact(Vc()),SequenceTransitionType:e.exact(Gc()),MXFPackagesType:e.exact(Uc()),FacetRangeType:e.exact(Bt()),TransferLogEntryType:e.exact($c()),BulkyMapListType:e.exact(Yc()),DescriptorComponentType:e.exact(Wc()),SequenceRenderRequestType:e.exact(YC()),NotificationDocumentTriggerType:e.exact(_c()),ShapeSearchType:e.exact(WC()),XMPReadOperation:e.exact(Qc()),QuotaRuleType:e.exact(Hc()),MetadataListType:e.exact(_C()),MDObjectWeakReference:e.exact(Zc()),AccessKeyType:e.exact(Jc()),ConformTimelineType:e.exact(Xc()),PartialFileDemuxerInfoType:e.exact(Kc()),MXFOp1bJobType:e.exact(Rc()),BinaryComponentType:e.exact(ep()),ResourceListType:e.exact(QC()),LDAPSyncType:e.exact(tp()),AudioClipType:e.exact(ap()),BulkyMetadataConfigurationType:e.exact(HC()),StorageListType:e.exact(ZC()),ResourceTypeListType:e.exact(JC()),CollectionReorderEntryType:e.exact(ga()),DurationResponse:e.exact(np()),AmountType:e.exact(rp()),TextOverlayType:e.exact(qt()),TrackType:e.exact(op()),MetadataSchemaRenameOperationType:e.exact(sp()),JobProblemListType:e.exact(XC()),GroupListType:e.exact(ha()),MetadataFieldAccessControlType:e.exact(ya()),AnalyzeVideoType:e.exact(ip()),StorageImportType:e.exact(KC()),SearchGroupType:e.exact(Vt()),SimpleSearchType:e.exact(RC()),JobProblemType:e.exact(lp()),AnalyzeAudioType:e.exact(dp()),ItemRelationType:e.exact(cp()),AudioOutputType:e.exact(pp()),VersionType:e.exact(eT()),ShapeListType:e.exact(tT())};function Ct({children:a}){return t.jsx(r.TableHead,{children:t.jsx(r.TableRow,{children:t.jsx(r.TableCell,{colSpan:2,children:a})})})}const aT=a=>({TableCellLabel:{borderStyle:"none",...a.typography.body2},TableCellValue:{borderStyle:"none",wordBreak:"break-all",...a.typography.subtitle2}});function nT({classes:a,label:n,value:o,formatValue:s=l=>l,...i}){return t.jsxs(r.TableRow,{...i,children:[t.jsx(r.TableCell,{classes:{root:a.TableCellLabel},children:n}),t.jsx(r.TableCell,{classes:{root:a.TableCellValue},children:o!==void 0?s(o):""})]})}const ie=r.withStyles(aT)(nT),rT=()=>({TableHeadLabel:{marginTop:"20px",borderBottom:"1px solid rgba(224, 224, 224, 0.5)",display:"flex",alignItems:"center"}});function oT({classes:a,className:n,audioComponentType:o}){const s=C.useMemo(()=>X.parseAudioComponent(o),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{children:t.jsx("span",{className:a.TableHeadLabel,children:"Audio Track"})}),t.jsxs(r.TableBody,{className:n,children:[t.jsx(ie,{label:"Audio Codec",value:s.audioFormat||s.audioCodec}),t.jsx(ie,{label:"Audio Channels",value:s.audioChannels}),t.jsx(ie,{label:"Audio Sample Rate",value:s.audioSamplerate}),t.jsx(ie,{label:"Audio Bit Rate",value:s.audioBitrate}),t.jsx(ie,{label:"Audio Bit Depth",value:s.audioBitDepth}),t.jsx(ie,{label:"Audio Bit Rate Mode",value:s.audioBitRateMode})]})]})}const sT=r.withStyles(rT)(oT),iT=()=>({TableHeadLabel:{borderBottom:"1px solid rgba(224, 224, 224, 1)",display:"flex",alignItems:"center"}});function lT({classes:a,className:n,containerComponentType:o}){const s=C.useMemo(()=>X.parseContainerComponent(o),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{children:t.jsx("span",{className:a.TableHeadLabel,children:"Media Container"})}),t.jsxs(r.TableBody,{className:n,children:[t.jsx(ie,{label:"Media Container",value:s.containerFormat}),t.jsx(ie,{label:"Duration",value:s.duration})]})]})}const dT=r.withStyles(iT)(lT),cT=()=>({TableHeadLabel:{marginTop:"20px",paddingBottom:"5px",borderBottom:"1px solid rgba(224, 224, 224, 0.5)",display:"flex",alignItems:"center"},IconLabel:{marginLeft:"60px"},IconLabelName:{marginLeft:"58px"},IconLabelMethod:{marginLeft:"38px"}});function up({value:a,...n}){return t.jsx(ie,{value:t.jsxs(r.Box,{style:{borderBottom:"1px solid rgba(224, 224, 224, 0.3)",marginBottom:"5px"},children:[a,t.jsx(r.Button,{onClick:()=>{navigator.clipboard.writeText(a)},children:t.jsx(j.FileCopy,{fontSize:"small"})})]}),...n})}function pT({classes:a,className:n,fileType:o,storageListType:s,displayMethodTypes:i,storageMetadataKeys:l}){var I,T;const d=o.storage,c=X.parseFileType(o),{fileSize:p,path:u}=c,g=p==="-1 B"?"Not Available":p,h=(I=s==null?void 0:s.storage)==null?void 0:I.find(b=>b.id===d),m=X.parseSimpleMetadataType(h==null?void 0:h.metadata,{joinValue:",",flat:!0}),y=((T=h==null?void 0:h.method)==null?void 0:T.filter(({type:b})=>!i||(i==null?void 0:i.includes(b))))||[];return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{children:t.jsx("span",{className:a.TableHeadLabel,children:"File Component"})}),t.jsxs(r.TableBody,{className:n,children:[t.jsx(up,{label:"File Path",value:u}),t.jsx(ie,{label:"File size",value:g}),t.jsx(ie,{label:"Storage Id",value:d}),l!=null&&l.length?l.map(b=>t.jsx(ie,{label:b.label||b.key,value:m[b.key]})):null,(h==null?void 0:h.type)&&t.jsx(ie,{label:"Storage Type",value:h.type}),y!=null&&y.length?y.map(b=>t.jsxs(t.Fragment,{children:[t.jsx(ie,{label:"Method Type",value:b.type}),t.jsx(up,{label:"Storage Uri",value:b.uri+u})]})):null]})]})}const uT=r.withStyles(cT)(pT),gT=[{prefix:"image_exif_",label:"EXIF"},{prefix:"image_iptc_",label:"IPTC"},{prefix:"image_xmp",label:"XMP"}],hT=({videoMetadata:a={}}={})=>Object.entries(a).reduce((n,[o,s])=>{const i=gT.find(({prefix:l})=>o.startsWith(l));if(i){const l={...n};return l[i.label]===void 0&&(l[i.label]={}),l[i.label][o.replace(i.prefix,"")]=s,l}return n},{});function yT({className:a,videoComponentType:n}){const o=C.useMemo(()=>X.parseVideoComponent(n),[n]),s=hT(o);return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{children:"Image"}),t.jsxs(r.TableBody,{className:a,children:[t.jsx(ie,{label:"Format",value:o.videoFormat||o.videoCodec}),t.jsx(ie,{label:"Width",value:o.width}),t.jsx(ie,{label:"Height",value:o.height})]}),Object.entries(s).map(([i,l])=>t.jsxs(C.Fragment,{children:[t.jsx(Ct,{children:i}),t.jsx(r.TableBody,{children:Object.entries(l).map(([d,c])=>t.jsx(ie,{label:d.replace("_"," "),value:c},d))})]},i))]})}function mT({className:a,videoComponentType:n}){const o=C.useMemo(()=>X.parseVideoComponent(n),[n]);return t.jsxs(r.TableBody,{className:a,children:[t.jsx(ie,{label:"Pages",value:o.videoMetadata.image_pages}),t.jsx(ie,{label:"Width",value:o.width}),t.jsx(ie,{label:"Height",value:o.height})]})}const gp=(a,n,o)=>{const[s,i]=C.useState(a),l=o===void 0?s:o,d=C.useCallback((c,p)=>i(u=>{const g=p!==void 0?p:!u;return n&&n(g),g}),[n]);return[l,d]};function ar(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,a=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16))}const hp=a=>`${a[0].toUpperCase()}${a.slice(1).toLowerCase()}`,fT=(a,n="")=>(o,s,...i)=>(o[s]!=null&&console.warn(`${s} is deprecated ${n||""}`),a(o,s,...i)),CT=()=>({TableHeadLabel:{marginTop:"20px",borderBottom:"1px solid rgba(224, 224, 224, 0.5)",display:"flex",alignItems:"center"}});function TT({classes:a,className:n,videoComponentType:o}){const s=C.useMemo(()=>X.parseVideoComponent(o),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(Ct,{children:t.jsx("span",{className:a.TableHeadLabel,children:"Video Track"})}),t.jsxs(r.TableBody,{className:n,children:[t.jsx(ie,{label:"Video Codec",value:s.videoFormat||s.videoCodec}),t.jsx(ie,{label:"SMPTE",value:s.smpte}),t.jsx(ie,{label:"Frame Rate",value:s.frameRate}),t.jsx(ie,{label:"Width",value:s.width}),t.jsx(ie,{label:"Height",value:s.height}),t.jsx(ie,{label:"Aspect Ratio",value:s.aspectRatio}),t.jsx(ie,{label:"Video Bitrate",value:s.videoBitrate}),t.jsx(ie,{label:"Color Space",value:s.colorSpace}),t.jsx(ie,{label:"Chroma Subsampling",value:s.chromaSubsampling}),t.jsx(ie,{label:"Field Order",value:s.fieldOrder,formatValue:hp})]})]})}const bT=r.withStyles(CT)(TT),Tt="VIDEO_MEDIATYPE",ma="AUDIO_MEDIATYPE",nr="IMAGE_MEDIATYPE",yp="PDF_MEDIATYPE",IT="BINARY_MEDIATYPE",MT=({mimeType:a=[],containerComponent:n,audioComponent:o,videoComponent:s,binaryComponent:i}={})=>{const[l]=a;if(l){if(l.startsWith("video"))return Tt;if(l.startsWith("audio"))return ma;if(l.startsWith("image"))return nr}if(n&&n.format==="PDF")return yp;if(o&&s)return Tt;if(o)return ma;if(s&&s.length){const[d]=s;return d.duration?Tt:nr}if(i)return IT};function mp({shapeActualSize:a,className:n,shapeType:o,storageListType:s,displayMethodTypes:i,storageMetadataKeys:l,showFiles:d=!0}){const c=C.useMemo(()=>X.parseShapeType(o),[o]),{containerComponent:p,videoComponent:u=[],audioComponent:g=[]}=o,h=MT(o),m=p==null?void 0:p.file;return t.jsxs(t.Fragment,{children:[t.jsxs(r.TableBody,{className:n,children:[c.mimeType&&t.jsx(ie,{label:"Mime-Type",value:c.mimeType}),c.fileSize&&t.jsxs(t.Fragment,{children:[t.jsx(ie,{label:"File Size",value:a}),t.jsx(ie,{label:"Checksum",value:c.hash})]})]}),(h===Tt||h===ma)&&t.jsx(dT,{containerComponentType:p}),h===Tt&&u.map(y=>t.jsx(bT,{videoComponentType:y},y.id)),(h===Tt||h===ma)&&g.map(y=>t.jsx(sT,{audioComponentType:y},y.id)),d&&(m==null?void 0:m.map(y=>t.jsx(uT,{fileType:y,storageListType:s,displayMethodTypes:i,storageMetadataKeys:l},`file-${y.id}`))),h===nr&&u.map(y=>t.jsx(yT,{videoComponentType:y},y.id)),h===yp&&u.map(y=>t.jsx(mT,{videoComponentType:y},y.id))]})}const LT=()=>({MenuIconButton:{},MenuIcon:{},DeleteIcon:{},ListItemIcon:{},ListItemText:{},Menu:{},MenuItem:{}});function ST({classes:a,onRemove:n,shapeType:o,itemId:s,shapeId:i,MenuIconComponent:l=j.MoreVert,DeleteIconComponent:d=j.Delete,deleteText:c="Delete"}){const[p,u]=Da({throwOnReject:!1}),[g,h]=C.useState(null),m=T=>{h(T.currentTarget)},y=()=>{h(null)},I=()=>{y(),u().then(T=>{T&&n({itemId:s,shapeId:i,shapeType:o})})};return t.jsxs(t.Fragment,{children:[t.jsx(r.IconButton,{className:a.IconButton,onClick:m,size:"small",children:t.jsx(l,{className:a.MenuIconButton})}),t.jsx(r.Menu,{className:a.Menu,anchorEl:g,keepMounted:!0,open:!!g,onClose:y,children:t.jsxs(r.MenuItem,{onClick:I,className:a.MenuItem,children:[t.jsx(r.ListItemIcon,{className:a.ListItemIcon,children:t.jsx(d,{className:a.DeleteIcon})}),t.jsx(r.ListItemText,{className:a.ListItemText,primary:c,primaryTypographyProps:{color:"secondary"}})]})}),p&&t.jsx(p,{titleText:"Delete File?",confirmText:"Delete",rejectText:"Cancel"})]})}const wT=r.withStyles(LT,{name:"VdtItemShapeMenu"})(ST);function AT({shapeType:a,TableRowProps:n,canExpand:o=!0,onRemove:s,showDownload:i,itemId:l,storageListType:d,displayMethodTypes:c,storageMetadataKeys:p}){const{id:u}=a,g=C.useMemo(()=>X.parseShapeType(a),[a]),[h,m]=C.useState(!1),y=()=>m(S=>!S),{containerComponent:{file:I=[]}={}}=a;let T,b;I.length>0&&(T=Be(I,"[0].uri[0]","undefined"),b=Be(I,"[0].path","undefined"));const M=a.tag.join(", "),L=g.fileSize==="-1 B"?"Not Available":g.fileSize;return t.jsxs(t.Fragment,{children:[t.jsxs(r.TableRow,{...n,children:[t.jsx(r.TableCell,{children:o&&t.jsx(r.IconButton,{size:"small",onClick:y,children:h?t.jsx(j.ExpandMore,{}):t.jsx(j.ChevronRight,{})})}),t.jsx(r.TableCell,{children:M}),t.jsxs(r.Hidden,{smDown:!0,children:[t.jsx(r.TableCell,{children:g.containerFormat}),t.jsx(r.TableCell,{children:g.videoCodec}),t.jsx(r.TableCell,{children:g.audioCodec}),t.jsx(r.TableCell,{children:g.frameRate})]}),t.jsx(r.TableCell,{children:g.dimension}),t.jsx(r.TableCell,{children:L}),t.jsxs(r.TableCell,{children:[i&&t.jsx(r.IconButton,{size:"small",href:T,download:b,style:{visibility:g.fileSizeBytes?"visible":"hidden"},children:t.jsx(j.CloudDownload,{})}),s&&t.jsx(wT,{shapeType:a,shapeId:u,itemId:l,onRemove:s})]})]}),o&&t.jsx(r.TableRow,{children:t.jsx(r.TableCell,{colSpan:9,children:t.jsx(r.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:t.jsx(r.Box,{margin:1,children:t.jsx(r.Table,{size:"small",padding:"none",children:t.jsx(mp,{shapeActualSize:L,shapeType:a,itemId:l,storageListType:d,displayMethodTypes:c,storageMetadataKeys:p})})})})})})]})}const DT=()=>({root:{width:"100%"},ItemShapeRow:{}});function rr({classes:a,className:n,itemType:o,canExpand:s,itemId:i,onRemove:l,storageListType:d,displayMethodTypes:c,storageMetadataKeys:p,showDownload:u}){const{shape:g=[]}=o;return t.jsxs(r.Table,{className:x(a.root,n),size:"small",padding:"none",children:[t.jsx(r.TableHead,{children:t.jsxs(r.TableRow,{children:[t.jsx(r.TableCell,{}),t.jsx(r.TableCell,{children:"Tags"}),t.jsxs(r.Hidden,{smDown:!0,children:[t.jsx(r.TableCell,{children:"Container"}),t.jsx(r.TableCell,{children:"Video"}),t.jsx(r.TableCell,{children:"Audio"}),t.jsx(r.TableCell,{children:"Frame Rate"})]}),t.jsx(r.TableCell,{children:"Picture Size"}),t.jsx(r.TableCell,{children:"File Size"}),t.jsx(r.TableCell,{})]})}),t.jsx(r.TableBody,{children:g.map(h=>t.jsx(AT,{className:a.ItemShapeRow,shapeType:h,TableRowProps:{hover:!0},canExpand:s,itemId:i,onRemove:l,storageListType:d,displayMethodTypes:c,storageMetadataKeys:p,showDownload:u},h.id))})]})}rr.propTypes={classes:e.objectOf(e.string),className:e.string,itemId:e.string,onRemove:e.func,itemType:ye.ItemType,canExpand:e.bool,storageListType:ye.StorageListType,displayMethodTypes:e.arrayOf(e.string),storageMetadataKeys:e.arrayOf(e.shape({key:e.string,label:e.string})),showDownload:e.bool},rr.defaultProps={className:void 0,classes:{},itemType:{},itemId:void 0,onRemove:void 0,canExpand:!0,storageListType:void 0,displayMethodTypes:void 0,storageMetadataKeys:void 0,showDownload:!0};const or=r.withStyles(DT,{name:"VdtItemShapeTable"})(rr);or.displayName="ItemShapeTable";const NT={content:"shape",methodMetadata:[{key:"format",value:"SIGNED-AUTO"},{key:"contentDisposition",value:"attachment"}]};function vT({itemId:a,hidden:n,...o}){const{itemType:s,onRefresh:i}=ne.useGetItem({itemId:a,queryParams:NT}),l=({shapeId:c})=>{Q.shape.removeShape({shapeId:c,itemId:a}).then(i)},d=C.useRef(n);return C.useEffect(()=>{n===!1&&n!==d.current&&i(),d.current=n},[n,i]),t.jsx(or,{itemId:a,itemType:s,onRemove:l,...o})}function xT({className:a,metadataType:n}){const{originalFilename:o,mediaType:s}=C.useMemo(()=>X.parseMetadataType(n,{joinValue:",",flat:!0}),[n]);return t.jsxs(r.TableBody,{className:a,children:[t.jsx(ie,{label:"Original Filename",value:o}),t.jsx(ie,{label:"Media Type",value:s,formatValue:hp})]})}const OT=()=>({root:{width:"100%"}});function sr({classes:a,className:n,itemType:o={},showFiles:s}){const{shape:i=[],metadata:l}=o,[d]=i;return t.jsxs(r.Table,{className:x(a.root,n),size:"small",padding:"none",children:[l&&t.jsx(xT,{metadataType:l}),d&&t.jsx(mp,{showFiles:s,shapeType:d})]})}sr.propTypes={classes:e.objectOf(e.string),className:e.string,itemType:ye.ItemType.isRequired,showFiles:e.bool},sr.defaultProps={className:void 0,classes:{},showFiles:!1};const ir=r.withStyles(OT,{name:"VdtItemSourceTable"})(sr);ir.displayName="ItemSourceTable";const ET={content:["shape","metadata"],tag:"original",interval:"generic",field:["mediaType","originalFilename"],group:""};function jT({itemId:a,...n}){return t.jsx(ne.GetItem,{itemId:a,queryParams:ET,children:t.jsx(ir,{...n})})}function PT({open:a,posterUri:n,handleClose:o,handleBefore:s,handleNext:i,handleDownload:l}){return t.jsxs(r.Dialog,{fullScreen:!0,open:a,onClose:o,children:[t.jsx(r.Toolbar,{children:t.jsxs(r.Box,{display:"flex",justifyContent:"space-between",width:"100%",children:[t.jsx(r.IconButton,{edge:"start",color:"inherit",onClick:o,children:t.jsx(j.Close,{})}),t.jsxs(r.Box,{children:[t.jsx(r.IconButton,{edge:"start",color:"inherit",disabled:!s,onClick:s,children:t.jsx(j.NavigateBefore,{})}),t.jsx(r.IconButton,{edge:"start",color:"inherit",disabled:!i,onClick:i,children:t.jsx(j.NavigateNext,{})})]}),t.jsx(r.IconButton,{edge:"start",color:"inherit",onClick:l,children:t.jsx(j.SaveAlt,{})})]})}),a&&t.jsx(r.Box,{width:"100vw",height:"80vh",display:"flex",justifyContent:"center",children:t.jsx("img",{src:n,alt:"",style:{maxWidth:"100%",maxHeight:"100%"}})})]})}const kT=a=>({root:{color:a.palette.common.white,backgroundColor:a.palette.common.black,marginLeft:a.spacing(1),marginRight:a.spacing(1),marginTop:a.spacing(.5),marginBottom:a.spacing(.5),paddingLeft:a.spacing(.5),paddingRight:a.spacing(.5)},label:{...a.typography.caption,color:"inherit"}});function lr({style:a,classes:n,className:o,label:s}){return t.jsx("div",{className:x(n.root,o),style:a,children:t.jsx("span",{className:n.label,children:s})})}lr.propTypes={classes:e.objectOf(e.string),className:e.string,label:e.string,style:e.objectOf(e.oneOfType([e.string,e.number]))},lr.defaultProps={className:void 0,classes:{},label:void 0,style:{}};const Xe=r.withStyles(kT,{name:"VdtMediaCardThumbnailLabel"})(lr);Xe.displayName="MediaCardThumbnailLabel";const FT=a=>{const n=Math.floor(a/3600),o=Math.floor(a%3600/60),s=Math.floor(a%60);return[n.toString().padStart(2,"0"),o.toString().padStart(2,"0"),s.toString().padStart(2,"0")].join(":")};function dr({style:a,classes:n,className:o,label:s}){if(!s)return null;const i=Number(s);if(i===0)return null;const l=FT(i);return t.jsx(Xe,{className:o,classes:n,style:a,label:l})}const zT=a=>({root:{},container:{position:"relative"},onClick:{cursor:"pointer"},scrubSlider:{width:"2px",height:"100%",background:"#ddd",position:"absolute",zIndex:4,top:0,opacity:.9},scrubLabel:{width:"fit-content",backgroundColor:a.palette.type==="dark"?a.palette.common.white:a.palette.common.black,color:a.palette.type==="dark"?a.palette.common.black:a.palette.common.white,borderRadius:2,position:"absolute",zIndex:4,top:-12},background:{transform:"scale(1.1)",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",zIndex:1,height:"100%",width:"100%",position:"absolute"},backgroundHasImage:{filter:"blur(20px) grayscale(60%)"},img:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"auto",height:"auto",maxWidth:"100%",maxHeight:"100%",zIndex:2},labelContainer:{position:"absolute",height:"100%",width:"100%",zIndex:3,display:"flex",flexDirection:"column",justifyContent:"space-between"},labelTop:{display:"flex",flexDirection:"row",justifyContent:"space-between"},labelBottom:{display:"flex",flexDirection:"row",justifyContent:"space-between"},labelLeftTop:{},labelRightTop:{},labelLeftBottom:{},labelRightBottom:{}});function cr({classes:a,className:n,component:o,image:s,height:i,width:l,primaryColor:d,onClick:c,labelLeftTop:p,LabelComponentLeftTop:u,LabelPropsLeftTop:g,labelLeftBottom:h,LabelComponentLeftBottom:m,LabelPropsLeftBottom:y,labelRightTop:I,LabelComponentRightTop:T,LabelPropsRightTop:b,labelRightBottom:M,LabelComponentRightBottom:L,LabelPropsRightBottom:S,innerProps:w,scrubOnHover:A,scrubOffsetProp:v,scrubLabelLeftMargin:O,ScrubLabelComponent:E,ScrubLabelProps:D,...F}){const{itemType:z={},itemId:B}=w,{durationSeconds:$}=X.parseMetadataType(z.metadata,{joinValue:",",flat:!0}),{thumbnails:Y={}}=z;let{uri:P=[]}=Y;s&&P.length===0&&(P=[s]);const{thumbnailIndex:V,thumbnailTimeCode:W,thumbnailWidth:_,onMouseMove:H,scrubPosition:k,handleShowScrub:U,showScrub:K}=ne.useHoverScrub(P,v,$),J=-(k/_*100/100*O).toFixed(0),q=W?`${B}?t=${W.toSeconds().toFixed(0)}`:`${B}`;return t.jsx(o,{className:x(a.root,n,{[a.onClick]:c}),onMouseEnter:A===!0?U(!0):void 0,onMouseLeave:A===!0?U(!1):void 0,onMouseMove:A===!0?H:void 0,onClick:G=>c(G,q,W),...F,children:t.jsxs("div",{className:a.container,style:{height:i,width:l},children:[t.jsx("div",{className:x(a.background,{[a.backgroundHasImage]:s}),style:{backgroundColor:s?void 0:d,backgroundImage:s?`url(${s})`:void 0}}),t.jsx("img",{className:a.img,src:P[V]||s,alt:""}),A&&t.jsx("div",{className:a.scrubSlider,style:{left:k,display:K?"block":"none"},children:W&&t.jsx(E,{className:a.scrubLabel,style:{left:J},label:W.toSeconds().toFixed(0),...D})}),t.jsxs("div",{className:a.labelContainer,children:[t.jsxs("div",{className:a.labelTop,children:[t.jsx("div",{className:a.labelLeftTop,children:t.jsx(u,{label:p,innerProps:w,...g})}),t.jsx("div",{className:a.labelRightTop,children:t.jsx(T,{label:I,innerProps:w,...b})})]}),t.jsxs("div",{className:a.labelBottom,children:[t.jsx("div",{className:a.labelLeftBottom,children:t.jsx(m,{label:h,innerProps:w,...y})}),t.jsx("div",{className:a.labelRightBottom,children:t.jsx(L,{label:M,innerProps:w,...S})})]})]})]})})}cr.propTypes={classes:e.objectOf(e.string),className:e.string,component:e.oneOfType([e.string,e.elementType]),image:e.string,height:e.oneOfType([e.string,e.number]),width:e.oneOfType([e.string,e.number]),primaryColor:e.string,onClick:e.func,labelLeftTop:e.string,LabelComponentLeftTop:e.elementType,LabelPropsLeftTop:e.objectOf(e.any),labelLeftBottom:e.string,LabelComponentLeftBottom:e.elementType,LabelPropsLeftBottom:e.objectOf(e.any),labelRightTop:e.string,LabelComponentRightTop:e.elementType,LabelPropsRightTop:e.objectOf(e.any),labelRightBottom:e.string,LabelComponentRightBottom:e.elementType,LabelPropsRightBottom:e.objectOf(e.any),innerProps:e.objectOf(e.any),scrubOnHover:e.bool,scrubOffsetProp:e.number,scrubLabelLeftMargin:e.number,ScrubLabelComponent:e.oneOfType([e.string,e.elementType]),ScrubLabelProps:e.objectOf(e.any)},cr.defaultProps={className:void 0,classes:{},component:"div",image:void 0,height:180,width:"100%",primaryColor:void 0,onClick:void 0,labelLeftTop:void 0,LabelComponentLeftTop:Xe,LabelPropsLeftTop:{},labelLeftBottom:void 0,LabelComponentLeftBottom:Xe,LabelPropsLeftBottom:{},labelRightTop:void 0,LabelComponentRightTop:Xe,LabelPropsRightTop:{},labelRightBottom:void 0,LabelComponentRightBottom:Xe,LabelPropsRightBottom:{},innerProps:{},scrubOnHover:!0,scrubOffsetProp:0,scrubLabelLeftMargin:60,ScrubLabelComponent:dr,ScrubLabelProps:{}};const bt=r.withStyles(zT,{name:"VdtMediaCardThumbnail"})(cr);bt.displayName="MediaCardThumbnail";const BT=a=>({root:{},posterRoot:{width:320,margin:a.spacing(2),cursor:"pointer"}});function qT({classes:a,className:n,imgList:o=[],handleOpen:s,MediaCardThumbnailComponent:i=bt,MediaCardThumbnailProps:l={}}){return t.jsx("div",{className:x(a.root,n,"VdtItemPosterList-root"),children:o.map(({thumbnailUri:d,time:c},p)=>t.jsx("div",{className:x(a.posterRoot,"VdtItemPosterList-posterRoot"),onClick:s?()=>s(p):void 0,children:t.jsx(i,{image:d,labelRightBottom:c.toDuration({format:"hhmmss"}),...l})},d))})}const VT=r.withStyles(BT,{name:"VdtItemPosterList"})(qT),{defaultClient:GT}=Q.utils,UT=(a,n)=>{const o=a.split("poster")[1].split("?hash")[0],s=X.formatTimeCodeText(o.split("/").pop()),i=n.find(l=>o===l.split("thumbnail")[1].split("?hash")[0]);return{posterUri:a,thumbnailUri:i,time:s}},$T=(a,n)=>{GT({url:a,method:"GET",responseType:"blob"}).then(({data:o})=>{const s=window.URL.createObjectURL(new Blob([o])),i=document.createElement("a");i.href=s,i.setAttribute("download",n),i.click(),window.URL.revokeObjectURL(s)})};function fp({itemType:a={}}){const{posters:{uri:n=[]}={},thumbnails:{uri:o=[]}={}}=a,s=C.useMemo(()=>n.map(y=>UT(y,o)),[n,o]),[i,l]=C.useState(),d=i!==void 0,{posterUri:c}=s[i]||{},p=y=>l(y),u=()=>l(),g=()=>$T(c.replace("APInoauth","API"),"poster.jpeg"),h=i!==0?()=>l(i-1):void 0,m=i+1!==s.length?()=>l(i+1):void 0;return t.jsxs(t.Fragment,{children:[t.jsx(VT,{imgList:s,handleOpen:p}),t.jsx(PT,{open:d,posterUri:c,handleClose:u,handleBefore:h,handleNext:m,handleDownload:g})]})}const YT={content:"poster,thumbnail","noauth-url":!0,url:"false"};function WT({itemId:a,hidden:n}){const{itemType:o,onRefresh:s}=ne.useGetItem({itemId:a,queryParams:YT}),i=C.useRef(n);return C.useEffect(()=>{n===!1&&n!==i.current&&s(),i.current=n},[n,s]),t.jsx(fp,{itemId:a,itemType:o})}function Gt({checked:a,handleChecked:n}){return t.jsx(r.Checkbox,{checked:a,onChange:n,style:{marginLeft:"auto",transition:"color .2s ease-out"}})}function Cp({hover:a,checked:n,handleChecked:o,primaryColor:s=Qe.grey[500],secondaryColor:i=Qe.red.A200,ChecboxComponent:l=Gt}){return t.jsxs(r.CardActions,{disableSpacing:!0,children:[t.jsx(r.IconButton,{children:t.jsx(j.Visibility,{style:{color:a?i:s,transition:"color .2s ease-out"}})}),t.jsx(r.IconButton,{children:t.jsx(j.Share,{style:{color:a?i:s,transition:"color .2s ease-out"}})}),t.jsx(l,{checked:n,handleChecked:o,hover:a,primaryColor:s,secondaryColor:i})]})}const _T="audio",QT="video",HT="image",ZT="collection",JT="file",XT="placeholder",KT={};function pr({className:a,classes:n,mimeType:o,audioIcon:s=j.Audiotrack,videoIcon:i=j.Movie,imageIcon:l=j.Image,fileIcon:d=j.InsertDriveFile,placeholderIcon:c=j.NoteAdd,collectionIcon:p=j.Folder,...u}){let g=d;return!o||typeof o!="string"?g=c:o.toLowerCase().startsWith(_T)?g=s:o.toLowerCase().startsWith(QT)?g=i:o.toLowerCase().startsWith(HT)?g=l:o.toLowerCase()===ZT?g=p:o.toLowerCase()===JT?g=d:o.toLowerCase()===XT&&(g=c),t.jsx(g,{className:x(a,n.root),...u})}pr.propTypes={classes:e.objectOf(e.string),className:e.string,mimeType:e.string,audioIcon:e.elementType,videoIcon:e.elementType,imageIcon:e.elementType,fileIcon:e.elementType,placeholderIcon:e.elementType,collectionIcon:e.elementType},pr.defaultProps={className:void 0,classes:{},mimeType:void 0,audioIcon:j.Audiotrack,videoIcon:j.Movie,imageIcon:j.Image,fileIcon:j.InsertDriveFile,placeholderIcon:j.NoteAdd,collectionIcon:j.Folder};const Ke=r.withStyles(KT,{name:"VdtMimeTypeIcon"})(pr);Ke.displayName="MimeTypeIcon";const RT={root:{transition:"background-color .2s ease-out"},colorDefaultSkeleton:{backgroundColor:"unset"}};function ur({className:a,classes:n,avatar:o,skeleton:s=!1,variant:i="square",MimeTypeComponent:l=Ke,MimeTypeProps:d={},SkeletonProps:c={},AvatarProps:p={}}){return t.jsx(r.Avatar,{className:x(a,"VdtMediaCardAvatar-root"),style:{transition:"background-color .2s ease-out"},variant:i,classes:{colorDefault:s?n.colorDefaultSkeleton:void 0},...p,children:s?t.jsx(oe.Skeleton,{variant:i==="square"?"rect":i,height:"100%",width:"100%",...c}):t.jsx(l,{mimeType:o,...d})})}ur.propTypes={className:e.string,classes:e.objectOf(e.string),avatar:e.string,skeleton:e.bool,variant:e.oneOf(["circle","circular","rounded","square"]),MimeTypeComponent:e.elementType,MimeTypeProps:e.objectOf(e.any),SkeletonProps:e.objectOf(e.any),AvatarProps:e.objectOf(e.any)},ur.defaultProps={className:void 0,classes:{},avatar:void 0,skeleton:!1,variant:"square",MimeTypeComponent:Ke,MimeTypeProps:{},SkeletonProps:{},AvatarProps:{}};const It=r.withStyles(RT,{name:"VdtMediaCardAvatar"})(ur);It.displayName="MediaCardAvatar";const eb=a=>({root:{width:"inherit",maxWidth:320,height:"inherit",borderColor:"transparent",borderWidth:.7,borderStyle:"solid",transition:"border-color .2s ease-out","&:hover":{"& .MuiIconButton-root":{color:a.palette.primary.main},"& .MuiAvatar-square":{color:a.palette.type==="dark"?a.palette.grey[500]:a.palette.grey[100],backgroundColor:a.palette.primary.main}},"& .MuiCardHeader-root":{backgroundColor:a.palette.type==="dark"?r.emphasize(a.palette.background.paper,.1):void 0,color:a.palette.type==="dark"?a.palette.common.white:void 0}},checked:{borderColor:a.palette.secondary.main}});function tb({className:a,classes:n,checked:o,handleHover:s,children:i,innerProps:l,...d}){return t.jsx(r.Card,{className:x(n.root,{[n.checked]:o},"VdtMediaCardCard-root",a),onMouseEnter:s,onMouseLeave:s,raised:!1,elevation:0,...d,children:i})}const Tp=r.withStyles(eb,{name:"VdtMediaCardCard"})(tb);function bp({content:a,truncateContentLength:n=120}){return t.jsx(r.CardContent,{style:{paddingBottom:0},children:t.jsx(r.Box,{height:60,children:t.jsx(r.Tooltip,{title:a,enterDelay:500,open:a.length>n?void 0:!1,children:t.jsx(r.Typography,{variant:"body2",color:"textSecondary",component:"p",children:hg(a,{length:n})})})})})}const ab=He.makeStyles({colorDefault:{color:a=>a.primaryColor,backgroundColor:"transparent"}});function gr({hover:a,primaryColor:n}){const o=ab({primaryColor:n}),[s,i]=C.useState(null),l=c=>{i(c.currentTarget)},d=()=>{i(null)};return t.jsxs("div",{style:{visibility:a?"visible":"hidden",transition:"visibility .2s ease-out"},children:[t.jsx(r.Avatar,{onClick:l,component:r.ButtonBase,disableRipple:!0,classes:{colorDefault:o.colorDefault},children:t.jsx(j.MoreVert,{})}),t.jsxs(r.Menu,{anchorEl:s,keepMounted:!0,open:!!s,onClose:d,elevation:0,PaperProps:{square:!0},getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t.jsx(r.MenuItem,{children:"First"}),t.jsx(r.MenuItem,{children:"Second"}),t.jsx(r.MenuItem,{children:"Third"})]})]})}const nb=r.makeStyles({root:{paddingLeft:8,paddingRight:0,paddingTop:8,paddingBottom:8},action:{margin:0}});function Ip({className:a,primaryColor:n,secondaryColor:o,title:s,titleTypographyProps:i={noWrap:!0,style:{width:220}},subheader:l,subheaderTypographyProps:d={noWrap:!0,style:{width:220}},hover:c,checked:p,handleChecked:u,avatar:g,AvatarComponent:h=It,AvatarProps:m={},MenuComponent:y=gr,MenuProps:I={},innerProps:T={}}){const b=nb();return t.jsx(r.CardHeader,{className:a,avatar:h&&t.jsx(h,{primaryColor:n,secondaryColor:o,hover:c,avatar:g,handleChecked:u,checked:p,innerProps:T,...m}),action:y&&t.jsx(y,{hover:c,innerProps:T,primaryColor:n,secondaryColor:o,handleChecked:u,checked:p,...I}),title:s,titleTypographyProps:i,subheader:l,subheaderTypographyProps:d,classes:{root:b.root,action:b.action}})}const rb=()=>({root:{}});function hr({className:a,classes:n,onHover:o,onCheck:s,onClick:i,checked:l,title:d,subheader:c,image:p,content:u,avatar:g,CardComponent:h,CardProps:m,HeaderComponent:y,HeaderProps:I,ThumbnailComponent:T,ThumbnailProps:b,ContentComponent:M,ContentProps:L,ActionsComponent:S,ActionsProps:w,AvatarComponent:A,AvatarProps:v,MenuComponent:O,MenuProps:E,...D}){const[F,z]=C.useState(!1),B=l===void 0?F:l,$=P=>{l===void 0&&z(!B),s&&s(P,!B,D)},Y=i?(P,V,W)=>i(P,D,V,W):void 0;return t.jsxs(h,{className:x(a,n.root),checked:B,innerProps:D,...m,children:[y&&t.jsx(y,{title:d,subheader:c,avatar:g,handleChecked:$,checked:B,innerProps:D,AvatarComponent:A,AvatarProps:v,MenuComponent:O,MenuProps:E,...I,...D}),T&&t.jsx(T,{image:p,innerProps:D,onClick:Y,...b}),M&&t.jsx(M,{content:u,innerProps:D,...L}),S&&t.jsx(S,{handleChecked:$,checked:B,innerProps:D,...w})]})}hr.propTypes={className:e.string,classes:e.objectOf(e.any),onClick:e.func,onHover:e.func,onCheck:e.func,checked:e.bool,hover:e.bool,title:e.node,subheader:e.node,image:e.string,content:e.string,avatar:e.string,CardComponent:e.elementType,HeaderComponent:e.elementType,ThumbnailComponent:e.elementType,ContentComponent:e.elementType,ActionsComponent:e.elementType,AvatarComponent:e.elementType,MenuComponent:e.elementType,CardProps:e.objectOf(e.any),HeaderProps:e.objectOf(e.any),ThumbnailProps:e.objectOf(e.any),ContentProps:e.objectOf(e.any),ActionsProps:e.objectOf(e.any),AvatarProps:e.objectOf(e.any),MenuProps:e.objectOf(e.any)},hr.defaultProps={className:"VdtMediaCard",classes:{},onClick:void 0,onHover:void 0,onCheck:void 0,checked:void 0,hover:void 0,title:void 0,subheader:void 0,image:void 0,content:void 0,avatar:void 0,CardComponent:Tp,HeaderComponent:Ip,ThumbnailComponent:bt,ContentComponent:bp,ActionsComponent:Cp,AvatarComponent:It,MenuComponent:gr,CardProps:{},HeaderProps:{},ThumbnailProps:{},ContentProps:{},ActionsProps:{},AvatarProps:{},MenuProps:{}};const Ut=r.withStyles(rb,{name:"VdtMediaCard"})(hr);Ut.displayName="MediaCard";function ob(){return t.jsx(r.Avatar,{variant:"square",children:t.jsx(j.Folder,{})})}const sb={},ib=({collectionType:a,titleSelector:n,subheaderSelector:o,parseMetadataOpts:s})=>{const{metadata:i={}}=a,l=X.parseMetadataType(i,s);return{title:n(l),subheader:o(l)}};function yr({collectionType:a,MediaCardComponent:n,AvatarComponent:o,ThumbnailComponent:s,MenuComponent:i,ContentComponent:l,ActionsComponent:d,metadataToProps:c,parseMetadataOpts:p,titleSelector:u,subheaderSelector:g,...h}){const m=C.useMemo(()=>c({collectionType:a,parseMetadataOpts:p,titleSelector:u,subheaderSelector:g}),[c]);return t.jsx(n,{title:m.title,subheader:m.subheader,collectionType:a,AvatarComponent:o,ThumbnailComponent:s,MenuComponent:i,ContentComponent:l,ActionsComponent:d,...h})}yr.propTypes={collectionType:e.objectOf(e.any),parseMetadataOpts:e.objectOf(e.any),metadataToProps:e.func,MediaCardComponent:e.elementType,AvatarComponent:e.elementType,ThumbnailComponent:e.elementType,MenuComponent:e.elementType,ContentComponent:e.elementType,ActionsComponent:e.elementType,titleSelector:e.func,subheaderSelector:e.func},yr.defaultProps={collectionType:void 0,metadataToProps:ib,parseMetadataOpts:{joinValue:", ",flat:!0},MediaCardComponent:Ut,AvatarComponent:ob,ThumbnailComponent:null,MenuComponent:null,ContentComponent:null,ActionsComponent:null,titleSelector:a=>a.title,subheaderSelector:a=>a.created};const rt=r.withStyles(sb,{name:"VdtCollectionCard"})(yr);rt.displayName="CollectionCard";const lb={root:{display:"flex",flexWrap:"wrap",pointerEvents:"none",width:"inherit",height:"inherit"},image:{objectFit:"cover","&:last-child:not(:first-child)":{marginRight:"auto"}},lastSingleStretched:{"&:last-child:not(:first-child)":{width:"100% !important"}},notStretchSingle:{"&:last-child&:first-child":{objectFit:"contain"}}};function mr({className:a,classes:n,urls:o,maxImages:s,maxColumns:i,showSingleStretched:l,showLastSingleStretched:d,onError:c}){if(!o.length||s<0||i<0)return null;const p=Math.min(s,o.length),u=Math.min(i,p),h=`${100/Math.ceil(p/u)}%`,m=`${100/Math.max(Math.min(i,p),1)}%`,y=p%u===1;return t.jsx("div",{className:x(a,n.root,"VdtImageCollage-root"),children:o.slice(0,s).map(I=>t.jsx("img",{className:x({[n.image]:!0,"VdtImageCollage-image":!0,[n.notStretchSingle]:!l,[n.lastSingleStretched]:d&&y}),src:I,style:{height:h,width:m},onError:c,alt:""},I))})}mr.propTypes={classes:e.objectOf(e.string),className:e.string,urls:e.arrayOf(e.string),maxColumns:e.number,maxImages:e.number,showSingleStretched:e.bool,showLastSingleStretched:e.bool,onError:e.func},mr.defaultProps={className:void 0,classes:{},urls:[],maxColumns:2,maxImages:4,showSingleStretched:!0,showLastSingleStretched:!0,onError:a=>console.warn(a)};const fr=r.withStyles(lb,{name:"VdtImageCollage"})(mr);fr.displayName="ImageCollage";const db=()=>({root:{},isClickable:{cursor:"pointer"}});function Cr({classes:a,className:n,component:o,height:s,width:i,primaryColor:l,onClick:d,onError:c,innerProps:p,ImageCollageProps:u={},...g}){const{collectionId:h,collectionType:{metadata:m}={}}=p,[y,I]=C.useState([]),{defaultClient:{defaults:{baseURL:T}={}}={}}=Q.utils;C.useEffect(()=>{const{__representativeThumbnailsNoAuth:L=[]}=X.parseMetadataType(m,{flat:!0});I(L.map(S=>(T?T.replace(/\/$/,""):"")+S))},[m,T]);const b=(L="")=>{try{return L.split(";").shift().split("/").pop()}catch{return""}},M=L=>{const{target:{src:S=""}={}}=L,w=b(S);c&&c(`Could not get thumbnail for item ${w} in collection ${h}`),I(A=>A.filter(v=>v!==S))};return t.jsx(o,{className:x(a.root,n,{[a.isClickable]:d}),onClick:d,...g,children:t.jsx("div",{style:{height:s,width:i,backgroundColor:y.length?void 0:l},children:t.jsx(fr,{className:"VdtCollectionCardThumbnail-image",urls:y,onError:M,...u})})})}Cr.propTypes={classes:e.objectOf(e.string),className:e.string,component:e.oneOfType([e.string,e.elementType]),height:e.oneOfType([e.string,e.number]),width:e.oneOfType([e.string,e.number]),primaryColor:e.string,onClick:e.func,onError:e.func,innerProps:e.objectOf(e.any),ImageCollageProps:e.objectOf(e.any)},Cr.defaultProps={className:"",classes:{},component:"div",height:180,width:284,primaryColor:void 0,onClick:void 0,onError:void 0,innerProps:{},ImageCollageProps:{}};const Mp=r.withStyles(db,{name:"VdtCollectionCardThumbnail"})(Cr);Mp.displayName="CollectionCardThumbnail";const cb={root:{}};function Tr({className:a,classes:n,collectionListType:o,CollectionCardComponent:s,CollectionCardProps:i,GridContainerProps:l,GridItemProps:d,onCollectionClick:c,onItemClick:p}){const{collection:u=[]}=o,{style:g={}}=d,h=c||p;return t.jsx(r.Grid,{container:!0,className:x(n.root,"VdtCollectionCreateDialog-root",a),...l,children:u&&u.map((m,y)=>t.jsx(r.Grid,{item:!0,xs:"auto",onClick:()=>h&&h(m),...d,style:{cursor:h?"pointer":"initial",...g},children:t.jsx(s,{index:y,collectionId:m.id,collectionType:m,...i})},m.id))})}Tr.propTypes={classes:e.objectOf(e.string),className:e.string,collectionListType:e.objectOf(e.any),CollectionCardComponent:e.elementType,CollectionCardProps:e.objectOf(e.any),GridContainerProps:e.objectOf(e.any),GridItemProps:e.objectOf(e.any),onItemClick:fT(e.func,"use onCollectionClick instead"),onCollectionClick:e.func},Tr.defaultProps={className:void 0,classes:{},collectionListType:{},CollectionCardComponent:rt,CollectionCardProps:{},GridContainerProps:{},GridItemProps:{},onItemClick:null,onCollectionClick:null};const Lp=r.withStyles(cb,{name:"VdtCollectionGrid"})(Tr);Lp.displayName="CollectionGrid";const pb=({collectionType:a,parseMetadataOpts:n,options:o})=>{const{metadata:s={}}=a,i=X.parseMetadataType(s,n);return o.map(({value:l})=>{const{[l]:d}=i;return d})},ub=()=>({root:{}});function br({classes:a,className:n,options:o=[],metadataToProps:s,parseMetadataOpts:i={joinValue:", ",flat:!0},selected:l,onCheck:d,onClick:c,TableRowProps:p={},...u}){const{collectionType:g}=u,h=C.useMemo(()=>s({collectionType:g,parseMetadataOpts:i,options:o}),[g,o,i,s]),m=y=>{d&&d(y,!l,u)};return t.jsxs(r.TableRow,{className:x(a.root,"VdtCollectionRow-root",n),hover:!0,selected:l,onClick:c,style:{cursor:"pointer"},...p,children:[d&&t.jsx(r.TableCell,{padding:"checkbox",children:t.jsx(Gt,{checked:l,handleChecked:m})}),h.map((y,I)=>t.jsx(r.Hidden,{only:o[I].hide,children:t.jsx(r.TableCell,{children:o[I].valueComponent?t.jsx(r.Box,{component:o[I].valueComponent,value:y,innerProps:u}):y})},o[I].key||o[I].value||o[I].label))]})}br.propTypes={classes:e.objectOf(e.string),className:e.string,options:e.arrayOf(e.any),metadataToProps:e.func,parseMetadataOpts:e.objectOf(e.any),selected:e.bool,onCheck:e.func,onClick:e.func,TableRowProps:e.objectOf(e.any),collectionType:e.objectOf(e.any).isRequired},br.defaultProps={className:void 0,classes:{},options:[],metadataToProps:pb,parseMetadataOpts:{joinValue:", ",flat:!0},selected:!1,onCheck:void 0,onClick:void 0,TableRowProps:{}};const fa=r.withStyles(ub,{name:"VdtCollectionRow"})(br);fa.displayName="CollectionRow";const gb=()=>({root:{}});function Ir({classes:a,className:n,collectionListType:o,RowComponent:s,options:i,onCheck:l,selected:d,onRowClick:c,...p}){const{collection:u=[]}=o;return t.jsxs(r.Table,{className:x(a.root,"VdtCollectionTable-root",n),size:"small",children:[t.jsx(r.TableHead,{children:t.jsxs(r.TableRow,{children:[l&&t.jsx(r.TableCell,{padding:"checkbox"}),i.map(({label:g,value:h,hide:m},y)=>t.jsx(r.Hidden,{only:m,children:t.jsx(r.TableCell,{children:g})},g||h||y))]})}),t.jsx(r.TableBody,{children:u&&u.map(g=>t.jsx(s,{collectionType:g,collectionId:g.id,options:i,onCheck:l,selected:d&&d.includes(g.id),onClick:()=>c(g),...p},g.id))})]})}Ir.propTypes={classes:e.objectOf(e.string),className:e.string,collectionListType:e.objectOf(e.any),RowComponent:e.elementType,options:e.arrayOf(e.any),onCheck:e.func,selected:e.arrayOf(e.string),onRowClick:e.func},Ir.defaultProps={className:void 0,classes:{},collectionListType:{},RowComponent:fa,options:[],onCheck:void 0,selected:void 0,onRowClick:void 0};const Mr=r.withStyles(gb,{name:"VdtCollectionTable"})(Ir);Mr.displayName="CollectionTable";const Sp="LOAD_MORE",Ye="ITEM",Ie="COLLECTION",ot="_",Lr="ROOT",wp="DROP_ZONE_ROOT",Ca=C.createContext({childIds:{},addAsChildrenToCollection:()=>null,removeAsChildrenToCollection:()=>null,addOrUpdateCollections:()=>null,addOrUpdateItems:()=>null,getChildCollections:()=>[],getChildItems:()=>[]});function hb({initialChildIds:a={},initialCollections:n=[],initialItems:o=[],children:s}){const[i,l]=C.useState(a),[d,c]=C.useState(n),[p,u]=C.useState(o),g=(L,S,w)=>{if(S===Ie){const A=Array.isArray(L)?L:[L];l(v=>{const{[w]:O={}}=v,{collectionIds:E=[]}=O;return{...v,[w]:{...O,collectionIds:[...Array.from(new Set([...E,...A]))]}}})}else if(S===Ye){const A=Array.isArray(L)?L:[L];l(v=>{const{[w]:O={}}=v,{itemIds:E=[]}=O;return{...v,[w]:{...O||{},itemIds:[...Array.from(new Set([...E,...A]))]}}})}},h=(L,S,w)=>{if(S===Ie){const A=Array.isArray(L)?L:[L];l(v=>{const{[w]:O={}}=v,{collectionIds:E=[]}=O;return{...v,[w]:{...O,collectionIds:[...E.filter(D=>!A.includes(D))]}}})}else if(S===Ye){const A=Array.isArray(L)?L:[L];l(v=>{const{[w]:O={}}=v,{itemIds:E=[]}=O;return{...v,[w]:{...O,itemIds:[...E.filter(D=>!A.includes(D))]}}})}},m=C.useCallback((L,S)=>{const w=L.map(D=>D.id),A=S.filter(D=>!w.includes(D.id)),v=S.filter(D=>w.includes(D.id)),O=[...v,...A].map(D=>D.id);return{unchangedEntites:L.filter(D=>!O.includes(D.id)),updatedEntities:v,newEntities:A}},[]),y=C.useCallback((L,S)=>{if(!S)return;const w=Array.isArray(S)?S:[S];c(A=>{const{unchangedEntites:v,updatedEntities:O,newEntities:E}=m(A,w);return[...v,...O,...E]})},[m]),I=C.useCallback((L,S)=>{if(!S)return;const w=Array.isArray(S)?S:[S];u(A=>{const{unchangedEntites:v,updatedEntities:O,newEntities:E}=m(A,w);return[...v,...O,...E]})},[m]),T=C.useCallback(L=>{const{collectionIds:S=[]}=i[L]||{};return S.map(w=>d.find(A=>A.id===w)).filter(w=>w)},[i,d]),b=C.useCallback(L=>{const{itemIds:S=[]}=i[L]||{};return S.map(w=>p.find(A=>A.id===w)).filter(w=>w)},[i,p]),M=C.useMemo(()=>({childIds:i,addAsChildrenToCollection:g,removeAsChildrenToCollection:h,addOrUpdateCollections:y,addOrUpdateItems:I,getChildCollections:T,getChildItems:b}),[y,I,i,T,b]);return t.jsx(Ca.Provider,{value:M,children:s})}const yb=(a,n=60)=>{const{dragDropManager:o}=C.useContext(ct.DndContext),s=o.getMonitor(),[i,l]=C.useState(s.getDifferenceFromInitialOffset()),d=()=>l(s.getDifferenceFromInitialOffset()),[c,p]=C.useState(),u=()=>{c&&(clearInterval(c),l({x:0,y:0}))};return C.useEffect(()=>(a?p(setInterval(()=>{d()},1e3/n)):u(),u),[a]),i},mb={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},fb=(a,n={x:0,y:0},o={width:0,height:0})=>{const{x:s=0,y:i=0}=a||{},{x:l,y:d}=n,{width:c,height:p}=o,u=l-s-c/2,g=d-i-p/2;return{x:u,y:g}},Cb=(a,n,o)=>{const{x:s,y:i}=n||{},{x:l,y:d}=a||{},{x:c,y:p}=o||{};return{transform:`translate(${s+l+c}px, ${i+d+p}px)`}},Tb=a=>{const o=(a.current||{}).firstChild||{},{clientHeight:s=0,clientWidth:i=0}=o;return{width:i,height:s}};function bb({allowedTypes:a=["ITEM","COLLECTION"],Component:n,componentSize:o}){const s=C.useRef(),{item:i,isDragging:l,itemType:d,initialOffset:c}=ct.useDragLayer(h=>({item:h.getItem(),itemType:h.getItemType(),initialOffset:h.getInitialSourceClientOffset(),isDragging:h.isDragging()})),{dragInfo:p}=i||{},u=ne.useMouseDownPosition(),g=yb(l);return l&&a.includes(d)?t.jsx("div",{style:mb,children:t.jsx("div",{style:Cb(g,c,fb(c,u,o||Tb(s))),children:n&&p?t.jsx("div",{ref:s,children:t.jsx(n,{...p})}):null})}):null}const Ta=C.createContext({DraggedComponent:null,setDraggedComponent:()=>{}});function Ib({children:a,DraggedComponent:n,componentSize:o}){const[s,i]=C.useState(()=>n),l=C.useMemo(()=>({DraggedComponent:s,setDraggedComponent:i}),[s]);return t.jsx(Ta.Provider,{value:l,children:t.jsxs(ct.DndProvider,{backend:os.HTML5Backend,children:[s&&t.jsx(bb,{Component:s,componentSize:o}),a]})})}const Mb=()=>{const{DraggedComponent:a}=C.useContext(Ta);return!!a},Lb=a=>{const{DraggedComponent:n,setDraggedComponent:o}=C.useContext(Ta);C.useEffect(()=>(n||o(()=>a),()=>{n&&o(()=>null)}),[a,n,o])},Sb=({entityId:a,itemId:n,collectionId:o,entity:s={},item:i={},collection:l={},entityType:d={},itemType:c={},collectionType:p={}})=>{if(a)return a;if(n)return n;if(o)return o;if(s&&s.id)return s.id;if(i&&i.id)return i.id;if(l&&l.id)return l.id;if(c&&c.id)return c.id;if(d&&d.id)return d.id;if(p&&p.id)return p.id},wb=({itemId:a,collectionId:n,entity:o={},item:s,collection:i,entityType:l,itemType:d,collectionType:c})=>{if(o&&o.type)return o.type.toUpperCase();if(l&&typeof l=="string")return l.toUpperCase();if(a||s||d)return"ITEM";if(n||i||c)return"COLLECTION"},Ab=({entity:a,entityType:n,item:o,itemType:s,collection:i,collectionType:l})=>{if(a)return a;if(n&&typeof n!="string")return n;if(o)return o;if(s)return s;if(i)return i;if(l)return l},Ap=({parentCollectionId:a,entityParentId:n,parentId:o})=>{if(a)return a;if(n)return n;if(o)return o},Db=a=>Ap(a)?"COLLECTION":void 0,Nb=({timespan:a,entityTimespan:n})=>a||n,Sr=a=>({entityId:Sb(a),entityType:wb(a),entity:Ab(a),entityParentId:Ap(a),entityParentType:Db(a),entityTimespan:Nb(a)}),vb=["COLLECTION","ITEM"],xb=(a,n)=>{a.dataTransfer.setData("text/plain",JSON.stringify(n))},Mt=a=>({className:n,classes:o={},onSort:s,onDragStart:i=xb,dragInfo:l,wrapDragInDiv:d=!0,acceptedEntityTypes:c=vb,callbackOnDrop:p,...u})=>{try{const g=C.useMemo(()=>Sr(u),[]),h=l||g,{entityType:m}=h,y=C.useRef(null),{id:I,index:T}=u,[{isDragging:b},M,L]=ct.useDrag({item:{type:`${m}`,dragInfo:h,id:I,index:T},collect:E=>({isDragging:!!E.isDragging()}),end:(E,D)=>{if(!s)return;const{id:F,index:z}=D.getItem(),B=D.didDrop();B||s({dragId:F,originalDragIndex:z}),B&&p&&p()}}),[{isOver:S},w]=ct.useDrop({accept:c,canDrop:!1,hover({id:E}){if(!s)return;const D=I;E===void 0||E===D||s({dragId:E,hoverId:D})},collect:E=>({isOver:!!E.isOver()})});M(y),w(y);const A=Mb();C.useEffect(()=>{A&&L(os.getEmptyImage())},[A,L]);const v=t.jsx(a,{className:x(n,b&&o.isDragging,b&&"VdtDraggable-isDragging",S&&o.isOver,S&&"VdtDraggable-isOver"),classes:{...o,isDragging:void 0,"VdtDraggable-isDragging":void 0,isOver:void 0,"VdtDraggable-isOver":void 0},...u}),O=C.useCallback(E=>{i&&i(E,h)},[h]);return d?t.jsx("div",{ref:y,onDragStart:O,children:v}):t.jsx(r.RootRef,{rootRef:y,children:v})}catch{return t.jsx(a,{...u})}},Dp=["COLLECTION","ITEM"];function We(a){return({className:n,classes:o={},onDrop:s,dropInfo:i,ignoreDropOnExitingIds:l=!1,ignoreDropOnSameEntity:d=!0,acceptedEntityTypes:c=Dp,...p})=>{try{const u=C.useMemo(()=>Sr(p),[]),g=i||u;if(!g)throw new Error("Did not retrieve any dropInfo to withDrop");const h=C.useCallback(({id:M,dragInfo:L})=>{const{entityId:S,entityType:w}=L;return!(l&&M!==void 0||d&&S===g.entityId&&w===g.entityType)},[g.entityId,g.entityType,l,d]),[{isOver:m,canDrop:y},I]=ct.useDrop({accept:c,canDrop:h,drop:({dragInfo:M})=>{if(!s)throw Error("onDrop inside withDrop cannot be undefined");return s({dragInfo:M,dropInfo:g})},collect:M=>({isOver:!!M.isOver(),canDrop:!!M.canDrop()})}),T=C.useMemo(()=>({...o,isOver:void 0,canDrop:void 0,"VdtDroppable-isOver":void 0,"VdtDroppable-canDrop":void 0}),[o]),b=C.useMemo(()=>t.jsx(a,{className:x(n,m&&o.isOver,y&&o.canDrop,m&&"VdtDroppable-isOver",y&&"VdtDroppable-canDrop"),classes:T,...p}),[y,n,o.canDrop,o.isOver,T,m,p]);return t.jsx("div",{ref:I,children:b})}catch{return t.jsx(a,{...p})}}}We.propTypes={className:e.string,classes:e.objectOf(e.string),onDrop:e.func,dropInfo:e.objectOf(e.any),ignoreDropOnExitingIds:e.bool,ignoreDropOnSameEntity:e.bool,acceptedEntityTypes:e.arrayOf(e.string)},We.defaultProps={classes:{},onDrop:()=>null,dropInfo:{},ignoreDropOnExitingIds:!1,ignoreDropOnSameEntity:!0,acceptedEntityTypes:Dp};const Ob={isDragging:{opacity:.5,cursor:"move"}},Np=ne.compose(r.withStyles(Ob,{name:"VdtTreeItemDraggable"}),Mt)(oe.TreeItem),Eb=()=>({root:{}});function jb({className:a,classes:n,item:o,labelField:s}){const[i,l]=C.useMemo(()=>{const d=X.parseMetadataType(o.metadata,{joinValue:",",flat:!0});return[d.mimeType,d[s]||o.id]},[o]);return t.jsxs(r.Box,{className:x(a,n.root,"VdtItemLabel-root"),display:"flex",alignItems:"flex-end",children:[t.jsx(Ke,{mimeType:i}),t.jsx(r.Typography,{style:{fontWeight:"inherit"},children:l})]})}const Pb=r.withStyles(Eb,{name:"VdtItemLabel"})(jb),kb=a=>({isOver:{backgroundColor:a.palette.primary.main}}),Fb=ne.compose(r.withStyles(kb,{name:"VdtItemLabelDroppable"}),We)(Pb),zb={root:{}};function Bb({className:a,classes:n,item:o,parentCollectionId:s,nodeId:i=[Ye,o.id,Ie,s].join(ot),onDrop:l,ItemLabelComponent:d=Fb,TreeItemComponent:c=Np,TreeItemProps:p={},ItemLabelProps:u={}}){const g=t.jsx(d,{item:o,parentCollectionId:s,nodeId:i,onDrop:l,...u});return t.jsx(c,{className:x(n.root,"VdtItemTreeItem-root",a),label:g,nodeId:i,dragInfo:{entityType:Ye,entityId:o.id,entityParentId:s},...p})}const wr=r.withStyles(zb,{name:"VdtItemTreeItem"})(Bb),qb={root:{}};function Vb({className:a,classes:n,collection:o,labelField:s}){const i=C.useMemo(()=>s?s==="name"?o.name||o.id:X.parseMetadataType(o.metadata,{joinValue:",",flat:!0})[s]||o.id:o.id,[s,o]);return t.jsxs(r.Box,{className:x(a,n.root,"VdtCollectionLabel-root"),display:"flex",alignItems:"flex-end",children:[t.jsx(j.Folder,{color:"inherit"}),t.jsx(r.Typography,{variant:"body1",style:{fontWeight:"inherit"},children:i})]})}const Gb=r.withStyles(qb,{name:"CollectionLabel"})(Vb),Ub=a=>({isOver:{backgroundColor:a.palette.primary.main}}),$b=ne.compose(r.withStyles(Ub,{name:"VdtCollectionLabelDroppable"}),We)(Gb),Yb={queryParams:{field:["content"],content:["metadata"]}},Wb={queryParams:{field:["mimeType"],content:["metadata"]}},_b=(a,n)=>{const{itemSearchDocument:o={}}=a,{field:s=[]}=o;return{...a,itemSearchDocument:{...o,field:[...s,{name:"__parent_collection",value:[{value:n}]}]}}},Qb={root:{}};function vp({parentCollectionId:a,collection:n={},nodeId:o=[Ie,n.id,Ie,a].join(ot),...s}){const i=n.id,{className:l,classes:d={},collectionState:c=Yb,itemState:p=Wb,includeItems:u=!0,onDrop:g=()=>{},onError:h=()=>null,CollectionComponent:m=vp,CollectionLabelComponent:y=$b,ItemComponent:I=wr,TreeItemComponent:T=Np,CollectionLabelProps:b={},TreeItemProps:M={},ItemProps:L={}}=s,{addOrUpdateCollections:S,addOrUpdateItems:w,addAsChildrenToCollection:A,getChildCollections:v,getChildItems:O}=C.useContext(Ca),E=v(i),D=O(i),F=async()=>{try{const{data:P={}}=await Q.collection.getCollectionItem({...p,collectionId:i});return P.item||[]}catch(P){return h({message:"Could not get items",error:P}),[]}},z=async()=>{try{const P=_b(c,i),{data:V={}}=await Q.collection.searchCollection(P);return V.collection||[]}catch(P){return h({message:`Could not list collections for ${i}`,error:P}),[]}},B=async()=>{try{const{data:P}=await Q.collection.getCollection({...c,collectionId:i}),{content:V=[]}=P,W=V.filter(H=>H.type==="collection"),_=V.filter(H=>H.type==="item");if(W.length){const H=await z();S(i,H);const k=H.map(Z=>Z.id),U=E.map(Z=>Z.id),K=k.filter(Z=>!U.includes(Z));K.length&&A(K,Ie,i)}if(u&&_.length){const H=await F();w(i,H);const k=H.map(Z=>Z.id),U=D.map(Z=>Z.id),K=k.filter(Z=>!U.includes(Z));K.length&&A(K,Ye,i)}}catch(P){h({message:`Could not get collection ${i}`,error:P})}};C.useEffect(()=>{B()},[i]);const $=t.jsx(y,{collection:n,parentCollectionId:a,nodeId:o,onDrop:g,...b}),Y=(P,V,W,_)=>[P,V,Ie,W,Ie,_].join(ot);return t.jsxs(T,{className:x(l,d.root,"VdtCollectionTreeList-root"),nodeId:o,dragInfo:{entityType:Ie,entityId:i,entityParentId:a},label:$,...M,children:[E.length?E.map(P=>t.jsx(m,{parentCollectionId:i,collection:P,...s},Y(Ie,P.id,i,a))):void 0,D.length?D.map(P=>t.jsx(I,{item:P,parentCollectionId:i,onDrop:g,...L},Y(Ye,P.id,i,a))):void 0]})}const Ar=r.withStyles(Qb,{name:"VdtCollectionTreeList"})(vp);Ar.displayName="CollectionTreeList";const Hb=()=>({ListItemSecondaryAction:{visibility:"hidden"},ListItemContainer:{"&:hover $ListItemSecondaryAction":{visibility:"visible"}}});function Dr({classes:a,className:n,collectionType:o,onClick:s,parseMetadataOptions:i,primary:l,secondary:d,AvatarComponent:c,AvatarProps:p,ActionComponent:u,ActionProps:g,ListItemProps:h,skeleton:m}){const{id:y,metadata:I}=o,T=X.parseMetadataType(I,i);let b,M;return typeof l=="string"?b=T[l]:typeof l=="function"&&(b=l({...T,collectionType:o,collectionId:y})),typeof d=="string"?M=T[d]:typeof d=="function"&&(M=d({...T,collectionType:o,collectionId:y})),t.jsxs(r.ListItem,{className:x(n,a.root,"VdtCollectionListItem-root"),onClick:s?L=>s(L,{collectionId:y,collectionType:o}):void 0,button:s?!0:void 0,classes:{container:a.ListItemContainer},...h,children:[t.jsx(r.ListItemAvatar,{className:x(a.ListItemAvatar,"VdtCollectionListItem-ListItemAvatar"),children:t.jsx(c,{avatar:"collection",collectionId:y,collectionType:o,skeleton:m,...p})}),t.jsx(r.ListItemText,{primary:m?t.jsx(oe.Skeleton,{width:120}):b,secondary:m?t.jsx(oe.Skeleton,{width:60}):M}),u&&t.jsx(r.ListItemSecondaryAction,{className:x(a.ListItemSecondaryAction,"VdtCollectionListItem-ListItemSecondaryAction"),children:t.jsx(u,{skeleton:m,collectionId:y,collectionType:o,...g})})]})}Dr.propTypes={className:e.string,classes:e.objectOf(e.string),collectionType:ye.CollectionType.isRequired,primary:e.oneOfType([e.string,e.func]),secondary:e.oneOfType([e.string,e.func]),onClick:e.func,ActionComponent:e.elementType,ActionProps:e.objectOf(e.any),AvatarComponent:e.elementType,AvatarProps:e.objectOf(e.any),ListItemProps:e.objectOf(e.any),parseMetadataOptions:e.objectOf(e.any),skeleton:e.bool},Dr.defaultProps={className:void 0,classes:{},primary:({collectionId:a})=>a,secondary:void 0,onClick:void 0,ActionComponent:void 0,ActionProps:{},AvatarComponent:It,AvatarProps:{},ListItemProps:{},parseMetadataOptions:{flat:!0,arrayOnSingleValue:!1},skeleton:!1};const Nr=r.withStyles(Hb,{name:"VdtCollectionListItem"})(Dr);Nr.displayName="CollectionListItem";const Zb=()=>({root:{width:"100%"},listItem:{},addButton:{}});function vr({classes:a,className:n,collectionListType:o,onItemClick:s,CollectionListItemComponent:i,CollectionListItemProps:l}){const{collection:d=[]}=o;return t.jsx(r.List,{className:x(a.root,"VdtCollectionList-root",n),children:d.map(c=>t.jsx(i,{collectionType:c,onClick:s,...l},c.id))})}vr.propTypes={className:e.string,classes:e.objectOf(e.any),collectionListType:e.objectOf(e.any),onItemClick:e.func,CollectionListItemComponent:e.elementType,CollectionListItemProps:e.objectOf(e.any)},vr.defaultProps={className:void 0,classes:{},collectionListType:{},onItemClick:void 0,CollectionListItemComponent:Nr,CollectionListItemProps:{}};const xr=r.withStyles(Zb,{name:"VdtCollectionList"})(vr);xr.displayName="CollectionList";function xp({collectionId:a,onSuccess:n,fields:o,groups:s,collectionType:i,metadataType:l,onRefresh:d,isLoading:c,joinValue:p,onError:u=g=>console.error(g.message)}){let g=l;i&&(g=i==null?void 0:i.metadata);const h=C.useMemo(()=>{const y=Array.isArray(o)?o.map(({name:M})=>M):[],I=Array.isArray(s)?s.map(({name:M})=>M):[],T=X.parseMetadataType(g,{flat:!0,arrayOnSingleValue:!1}),b=Object.entries(T).reduce((M,L)=>{const[S,w]=L;return y.includes(S)||I.includes(S)?{...M,[S]:w}:M},{});return Object.entries(b).reduce(sn,{})},[g,o,s]),m=async y=>{const I=Object.entries(y).reduce((b,M)=>ln(b,M,p),{}),T=X.createMetadataType(I);try{await Q.collection.updateCollectionMetadata({collectionId:a,metadataDocument:T}),await d(),n()}catch(b){u(b)}};return!c&&t.jsx(he.Form,{onSubmit:m,component:oi,fields:o,groups:s,initialValues:h})}function Jb({collectionId:a,fields:n=[],groups:o=[],editingLabel:s=I=>I?"Cancel":"Edit",showEditMetadata:i=!0,onError:l,onSuccess:d,editJoinValue:c=";",displayJoinValue:p=", ",displayGroupAsList:u=!1,useContentPaths:g=!1,formatValue:h,queryParams:m={},getAttributes:y=!1}){const I=C.useMemo(()=>{const A={...m};if(g){const v=o?o.map(E=>E.name).map(E=>`metadata.timespan[start=-INF][end=+INF].group[name=${E}]`).join(","):void 0,O=n?n.map(E=>E.name).map(E=>`v(${E})`).join(","):"metadata.timespan.field";A.p=encodeURIComponent([O,v].join(","))}else A.content="metadata",Array.isArray(n)&&n.length>0&&(A.field=n.map(({name:v})=>v)),Array.isArray(o)&&o.length>0&&(A.group=o.map(({name:v})=>v));return A},[n,o,g,m]),[T,b]=C.useState(!1),M=()=>b(!T),L=A=>{M(),d&&d(A)},{fieldsWithAttributes:S=[],groupsWithAttributes:w=[]}=ne.useAddMetadataFieldAttributes({fields:n,groups:o,getAttributes:y});return t.jsxs(t.Fragment,{children:[i&&t.jsx(r.Box,{display:"flex",justifyContent:"flex-end",children:t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{checked:T,onChange:M}),label:s(T),labelPlacement:"start"})}),(S.length>0||w.length>0)&&t.jsx(ne.GetEntityMetadata,{entity:"collection",entityId:a,queryParams:I,children:i&&T?t.jsx(xp,{fields:S||n,groups:w||o,onSuccess:L,onError:l,joinValue:c}):t.jsx(ne.MetadataType,{joinValue:p,groupAsList:u,children:t.jsx(di,{fields:S||n,groups:w||o,formatValue:h})})})]})}const Xb=r.withStyles({},{name:"VdtCollectionMetadataTab"})(Jb);function Kb({collectionId:a,toggleAddLabelText:n=i=>i?"Cancel":"Add permission",showAddAccess:o=!0,EntityAccessTableProps:s={}}){const[i,l]=C.useState(!1),d=()=>l(!i),{accessControlList:c,onList:p,onRemove:u,onAdd:g}=ne.useEntityAccess({entityId:a,entityType:"collection"});C.useEffect(()=>{p()},[p]);const h=y=>u(y).then(p),m=()=>{p(),l(!1)};return t.jsxs(t.Fragment,{children:[o&&t.jsx(r.Box,{display:"flex",justifyContent:"flex-end",children:t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{checked:i,onChange:d}),label:n(i),labelPlacement:"start"})}),o&&i?t.jsx(rn,{entityType:"collection",entityId:a,onSuccess:m,onCancel:()=>l(!1),onSubmit:g}):t.jsx(on,{entityType:"collection",entityId:a,accessControlList:c,onRemove:h,...s})]})}const Rb=r.withStyles({},{name:"VdtCollectionAccessTab"})(Kb),eI=()=>({root:{}});function Or({classes:a,className:n,collectionDocument:o,createText:s,closeText:i,collectionNameText:l,title:d,open:c,onClose:p,onSuccess:u}){const[g,h]=C.useState(""),m=()=>{const y={name:g};Q.collection.createCollection({collectionDocument:o,queryParams:y}).then(({data:I})=>{u&&u(I)})};return t.jsxs(r.Dialog,{open:c,onClose:p,className:x(a.root,"VdtCollectionCreateDialog-root",n),children:[t.jsx(r.DialogTitle,{children:d}),t.jsx(r.DialogContent,{children:t.jsx(r.TextField,{autoFocus:!0,margin:"dense",label:l,type:"text",fullWidth:!0,onChange:y=>h(y.target.value)})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:p,children:i}),t.jsx(r.Button,{onClick:m,color:"primary",variant:"contained",disabled:!g,children:s})]})]})}Or.propTypes={classes:e.objectOf(e.string),className:e.string,collectionDocument:e.objectOf(e.any),createText:e.string,closeText:e.string,collectionNameText:e.string,title:e.string,open:e.bool,onClose:e.func,onSuccess:e.func},Or.defaultProps={className:void 0,classes:{},collectionDocument:{},createText:"Create",closeText:"Cancel",collectionNameText:"Collection Name",title:"New Collection",open:!1,onClose:void 0,onSuccess:void 0};const Op=r.withStyles(eI,{name:"VdtCollectionCreateDialog"})(Or);Op.displayName="CollectionCreateDialog";const tI=a=>({root:{alignItems:"center",width:"100%",display:"flex"},input:{paddingLeft:a.spacing(1),borderWidth:1,flex:1,borderStyle:"solid",borderColor:a.palette.grey[400],borderRadius:2,transition:"border-color .3s ease-in",height:32},button:{backgroundColor:a.palette.type==="light"?a.palette.grey[100]:a.palette.grey[800],color:a.palette.text.primary,borderBottomLeftRadius:0,borderTopLeftRadius:0,borderLeftWidth:1,borderLeftStyle:"solid",borderRadius:2,borderLeftColor:a.palette.grey[400],padding:0,height:"100%"},closeButton:{visibility:"visible",cursor:"pointer",transition:"visibility .5s ease-in"},closeButtonHidden:{visibility:"hidden"},focused:{borderColor:a.palette.primary.main},touched:{},progressButton:{width:"100%",marginTop:"4px"}});function aI({suggestions:a,inputRef:n}){const o=C.useMemo(()=>[...n.current?[n.current.value]:[],...a||[]],[n,a]),[s,i]=C.useState(0);C.useEffect(()=>{i(0)},[o]);const l=(u,g)=>(u%g+g)%g,d=(u,g)=>l(u+(g.key==="ArrowDown"?1:-1),o.length);return{onKeyDown:u=>{(u.key==="ArrowDown"||u.key==="ArrowUp")&&(n.current&&(n.current.value=o[d(s,u)],i(g=>d(g,u))),u.preventDefault())},onHoverSuggestion:u=>i(u+1),focusedSuggestion:s}}function Er({className:a,classes:n,value:o,onSubmit:s,defaultValue:i,submitting:l,onCancel:d,suggestions:c,searchPlaceholder:p,onChange:u,SuggestionsComponent:g,SuggestionsProps:h,TopSearchesComponent:m,TopSearchesProps:y,ButtonProps:I,InputBaseProps:T,SearchIconComponent:b,ProgressComponent:M,ProgressProps:L,CloseIconComponent:S,inputRef:w}){let A=C.useRef(null);w&&(A=w);const[v,O]=C.useState(!1),[E,D]=C.useState(!!i);C.useEffect(()=>{i!==""&&D(!0)},[i]);const F=te=>{u(te),D(A.current.value.length>0)},z=te=>{o===void 0&&(A.current.value=te),F(te)},B=te=>{te.preventDefault(),A&&A.current&&A.current.blur();const{value:re}=A.current||"";s&&s(re),re&&D(!0)},$=()=>{D(!1),s(""),z("")},Y=(te,re)=>{z(re),B(te)},[P,V]=C.useState(null),[W,_]=C.useState(!1),H=!!P&&v&&E,k=!!P&&W,U=()=>{_(!W)},[K,Z]=C.useState(!1),J=()=>{Z(!0)},q=()=>{Z(!1)},{onKeyDown:G,onHoverSuggestion:R,focusedSuggestion:ae}=aI({suggestions:c,inputRef:A});return t.jsxs("form",{className:x(a,n.root,"VdtSearchInput-root"),onSubmit:B,children:[t.jsx(r.InputBase,{value:o,classes:{root:n.input,focused:n.focused},defaultValue:i,ref:te=>V(te),inputProps:{onFocus:()=>O(!0),onBlur:()=>O(!1)},placeholder:p,inputRef:A,endAdornment:t.jsxs(t.Fragment,{children:[t.jsx(S,{className:E?n.closeButton:n.closeButtonHidden,onClick:$}),m&&t.jsx(r.IconButton,{onClick:U,style:{borderRadius:"50%"},children:k?t.jsx(j.ArrowDropUp,{fontSize:"small"}):t.jsx(j.ArrowDropDown,{fontSize:"small"})}),t.jsx(r.Button,{size:"small",type:"submit",disableRipple:!0,className:x(n.button,{[n.focused]:v,[n.touched]:E}),onMouseOver:J,onMouseOut:q,...I,children:l?t.jsx(t.Fragment,{children:K?t.jsx(S,{onClick:d}):t.jsx(M,{size:20,color:"inherit",...L})}):t.jsx(b,{})})]}),onChange:te=>F(te.target.value),onKeyDown:c&&G,...T}),H&&g&&t.jsx(g,{suggestions:c,onSelected:Y,onHover:R,focused:ae,anchorEl:P,...h}),k&&m&&t.jsx(m,{setIsTopSearchesOpen:_,anchorEl:P,...y})]})}Er.propTypes={className:e.string,classes:e.objectOf(e.string).isRequired,value:e.string,onSubmit:e.func,defaultValue:e.string,submitting:e.bool,onCancel:e.func,suggestions:e.arrayOf(e.string),searchPlaceholder:e.string,onChange:e.func,SuggestionsComponent:e.elementType,SuggestionsProps:e.objectOf(e.any),TopSearchesComponent:e.elementType,TopSearchesProps:e.objectOf(e.any),ButtonProps:e.objectOf(e.any),InputBaseProps:e.objectOf(e.any),SearchIconComponent:e.elementType,ProgressComponent:e.elementType,ProgressProps:e.objectOf(e.any),CloseIconComponent:e.elementType,CloseIconProps:e.objectOf(e.any),inputRef:e.shape({current:e.instanceOf(Element)})},Er.defaultProps={className:void 0,value:void 0,defaultValue:void 0,submitting:!1,suggestions:void 0,searchPlaceholder:"Search",onSubmit:()=>{},onChange:()=>{},onCancel:()=>{},SuggestionsComponent:null,SuggestionsProps:{},TopSearchesComponent:null,TopSearchesProps:{},ButtonProps:{},InputBaseProps:{},SearchIconComponent:j.Search,ProgressComponent:r.CircularProgress,ProgressProps:{},CloseIconComponent:j.Close,CloseIconProps:{},inputRef:void 0};const ba=r.withStyles(tI,{name:"VdtSearchInput"})(Er);ba.displayName="SearchInput";function nI({PaginationComponent:a=Kt,...n}){const{collectionListType:{hits:o=0}}=n;return t.jsx(a,{count:o,...n})}function rI(a){const{isLoading:n}=a;return t.jsx(ba,{submitting:n,...a})}const oI=()=>({root:{}});function jr({className:a,classes:n,onChange:o,onCheck:s,CollectionTableComponent:i,CollectionTableProps:l,searchProps:d,idLabelText:c,titleLabelText:p,ownerLabelText:u,searchPlaceholder:g,SearchInputProps:h,PaginationProps:m,SearchCollectionProps:y}){const I=ne.useSearch({queryParams:{field:["collectionId","title","__user"],content:"metadata"}}),{state:T,setSearchText:b,onChangeRowsPerPage:M,onChangePage:L}=d||I,{matrixParams:S,queryParams:w,itemSearchDocument:A,page:v,rowsPerPage:O}=T,[E,D]=C.useState([]),F=B=>{E.includes(B)?D($=>$.filter(Y=>Y!==B)):D($=>[...$,B])};C.useEffect(()=>o&&o(E),[E]);const z=({id:B})=>F(B);return t.jsx("div",{className:x(n.root,"VdtCollectionSearchPicker",a),children:t.jsxs(ne.SearchCollection,{itemSearchDocument:A,matrixParams:S,queryParams:w,...y,children:[t.jsx(rI,{onSubmit:B=>b(`*${B}*`),searchPlaceholder:g,...h}),t.jsx(i,{onRowClick:z,onCheck:s,selected:E,options:[{label:p,value:"title"},{label:c,value:"collectionId"},{label:u,value:"__user"}],...l}),t.jsx(nI,{onChangePage:L,onChangeRowsPerPage:M,page:v,rowsPerPage:O,...m})]})})}jr.propTypes={classes:e.objectOf(e.string),className:e.string,onChange:e.func,onCheck:e.func,CollectionTableComponent:e.elementType,CollectionTableProps:e.objectOf(e.any),searchProps:e.objectOf(e.any),idLabelText:e.string,titleLabelText:e.string,ownerLabelText:e.string,searchPlaceholder:e.string,SearchInputProps:e.objectOf(e.any),PaginationProps:e.objectOf(e.any),SearchCollectionProps:e.objectOf(e.any)},jr.defaultProps={className:void 0,classes:{},onChange:void 0,onCheck:()=>{},CollectionTableComponent:Mr,CollectionTableProps:{},searchProps:void 0,idLabelText:"Id",titleLabelText:"Title",ownerLabelText:"Owner",searchPlaceholder:"Search collections",SearchInputProps:{},PaginationProps:{},SearchCollectionProps:{}};const Ia=r.withStyles(oI,{name:"VdtCollectionSearchPicker"})(jr);Ia.displayName="CollectionSearchPicker";function Ep(a,n){const s=a.map((i,l)=>l%100===0?a.slice(l,l+100):null).filter(i=>i);return Promise.all(s.flatMap(i=>n.map(l=>Q.collection.updateCollection({collectionId:l,collectionDocument:{content:i.map(({id:d,type:c,metadata:p})=>({id:d,mode:"add",type:c.toLowerCase(),metadata:p}))},queryParams:{clear:!1}}))))}function sI(a,n){return Q.collection.createCollection({collectionDocument:{...n}}).then(o=>{const s=new Array(o.data.id);Ep(a,s)})}const iI=r.withStyles({},{name:"VdtCreateCollection"})(({collectionDocument:a,onChange:n,collectionNameText:o="New Collection"})=>{const{title:s=""}=a.metadata?X.parseMetadataType(a.metadata,{flat:!0,joinValue:","}):{},i=d=>({metadata:X.createMetadataType({title:d})}),l=(d={})=>{const{target:{value:c}={}}=d;return n(c?i(c):{})};return t.jsx(r.TextField,{value:s,required:!0,autoFocus:!0,margin:"dense",label:o,type:"text",fullWidth:!0,onChange:l})}),lI={root:{}};function Pr({classes:a,className:n,entities:o,onClose:s,onSubmit:i,onCreate:l,onSuccess:d,onError:c,CollectionPickerComponent:p,CollectionPickerProps:u,CreateCollectionComponent:g,CreateCollectionProps:h,defaultView:m,titleText:y,submitText:I,searchText:T,createdText:b,cancelText:M,CreateCollectionIcon:L,SearchCollectionIcon:S}){const[w,A]=C.useState(m),[v,O]=C.useState([]),[E,D]=C.useState({}),F=()=>{Promise.resolve(w==="create"?l(o,E):i(o,v)).then((...B)=>d(v,...B)).catch(B=>c(v,B)).finally(()=>s())},z=w==="search"?v.length===0:Object.keys(E).length===0;return t.jsxs("div",{className:x(a.root,"VdtAddToCollectionDialog-root",n),children:[t.jsx(r.DialogTitle,{children:y}),t.jsxs(r.DialogContent,{children:[t.jsxs(r.Tabs,{value:w,onChange:(B,$)=>$&&A($),variant:"fullWidth",textColor:"primary",indicatorColor:"primary",style:{marginBottom:"10px"},children:[t.jsx(r.Tab,{value:"search",label:T,icon:t.jsx(S,{})}),t.jsx(r.Tab,{value:"create",label:b,icon:t.jsx(L,{})})]}),{search:t.jsx(p,{onChange:O,...u}),create:t.jsx(g,{collectionDocument:E,onChange:D,...h})}[w]]}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:s,variant:"outlined",children:M}),t.jsx(r.Button,{onClick:F,color:"primary",variant:"contained",disabled:z,children:I})]})]})}Pr.propTypes={classes:e.objectOf(e.string),className:e.string,entities:e.arrayOf(e.shape({id:e.string.isRequired,type:e.string.isRequired})).isRequired,onClose:e.func,onSubmit:e.func,onCreate:e.func,onSuccess:e.func,onError:e.func,CollectionPickerComponent:e.elementType,CollectionPickerProps:e.objectOf(e.any),CreateCollectionComponent:e.elementType,CreateCollectionProps:e.objectOf(e.any),defaultView:e.string,titleText:e.string,submitText:e.string,searchText:e.string,createdText:e.string,cancelText:e.string,CreateCollectionIcon:e.elementType,SearchCollectionIcon:e.elementType},Pr.defaultProps={classes:{},className:void 0,CollectionPickerComponent:Ia,CreateCollectionComponent:iI,onClose:()=>{},onSubmit:Ep,onCreate:sI,onSuccess:()=>{},onError:a=>console.error(a),CollectionPickerProps:{},CreateCollectionProps:{},defaultView:"search",titleText:"Add to Collection",submitText:"Add",searchText:"Search",createdText:"Create",cancelText:"Cancel",CreateCollectionIcon:j.CreateNewFolder,SearchCollectionIcon:j.Search};const Ma=r.withStyles(lI,{name:"VdtAddToCollectionDialog"})(Pr);Ma.displayName="AddToCollectionDialog";const dI=({collectionId:a,entityId:n,entityType:o})=>Q.collection.removeCollectionEntity({collectionId:a,entityId:n,queryParams:{type:o}}),cI={root:{}};function kr({className:a,classes:n,entityId:o,entityType:s,collectionId:i,onSuccess:l,onError:d,onClose:c,onConfirm:p,descriptionText:u,titleText:g,cancelText:h,confirmText:m}){const y=()=>p({collectionId:i,entityType:s,entityId:o}).then(l).catch(d);return t.jsxs("div",{className:x(n.root,"VdtRemoveFromCollectionDialog-root",a),children:[t.jsx(r.DialogTitle,{children:g}),t.jsx(r.DialogContent,{children:u({collectionId:i,entityType:s,entityId:o})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:c,color:"primary",children:h}),t.jsx(r.Button,{variant:"contained",onClick:y,color:"secondary",children:m})]})]})}kr.propTypes={className:e.string,classes:e.objectOf(e.string),entityId:e.string.isRequired,entityType:e.string.isRequired,collectionId:e.string.isRequired,onSuccess:e.func,onError:e.func,onClose:e.func,onConfirm:e.func,descriptionText:e.func,titleText:e.string,cancelText:e.string,confirmText:e.string},kr.defaultProps={className:void 0,classes:{},onSuccess:()=>{},onError:a=>console.error(a),onClose:()=>{},onConfirm:dI,descriptionText:({collectionId:a,entityType:n,entityId:o})=>`Do you want to remove ${n} ${o} from ${a}?`,titleText:"Remove From Collection?",cancelText:"Cancel",confirmText:"Remove"};const Fr=r.withStyles(cI,{name:"VdtRemoveFromCollectionDialog"})(kr);Fr.displayName="RemoveFromCollectionDialog";const pI=()=>({ListItemAvatar:{paddingRight:6,marginTop:0,marginBottom:0},Paper:{height:94,width:168,display:"flex",alignItems:"center",justifyContent:"center"},Icon:{fontSize:40},primary:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},secondary:{fontStyle:"italic"},ListItemText:{},Menu:{visibility:"hidden"},root:{"&:hover $Menu":{visibility:"visible"}}}),uI=({className:a,classes:n,ListItemTextComponent:o=r.ListItemText,collectionId:s,collectionType:i,showUser:l,showDate:d,...c})=>{const{metadata:{timespan:p=[]}={}}=i,u=p.find(I=>I.start==="-INF"&&I.end==="+INF"),{title:g,user:h,created:m}=X.parseTimespan(u,{flat:!0,arrayOnSingleValue:!1});let y;return l&&(y=t.jsx("div",{className:n.secondary,children:h})),d&&(y=t.jsx("div",{className:n.secondary,children:Me(m).fromNow()})),l&&d&&(y=t.jsx("div",{className:n.secondary,children:`${h} • ${Me(m).fromNow()}`})),t.jsx(o,{className:a,primary:t.jsx("div",{className:n.primary,children:g}),secondary:y,secondaryTypographyProps:{component:"div"},...c})};function gI({className:a,entityId:n,entityType:o,selectedCollectionId:s,onRemoveCollectionEntity:i,onRemoveCollectionEntityText:l="Remove From Collection",IconComponent:d=j.MoreVert}){const[c,p]=C.useState(null),u=h=>{p(h.currentTarget)},g=()=>{p(null)};return t.jsxs("div",{className:a,children:[t.jsx(r.IconButton,{onClick:u,children:t.jsx(d,{})}),t.jsx(r.Menu,{open:!!c,onClose:g,anchorEl:c,children:t.jsx(r.MenuItem,{onClick:h=>{h.stopPropagation(),i(s,n,o),g()},disabled:i===void 0,children:l})})]})}function hI({className:a,classes:n,selected:o,collectionType:s,collectionId:i,entityType:l,onClick:d,ListItemComponent:c=r.ListItem,ListItemProps:p={},ListItemTextComponent:u=uI,ListItemTextProps:g={},ListItemAvatarComponent:h=r.ListItemAvatar,ListItemAvatarProps:m={},ListItemMenuComponent:y=gI,ListItemMenuProps:I={},PaperProps:T={},IconComponent:b=Ke,onRouteChange:M=()=>{}}){const L=o&&o.entityType==="collection"&&o.entityId===i,S=w=>{w.detail===2?M(i):d({entityType:l,entityId:i})};return t.jsxs(c,{className:x(n.root,a),selected:L,alignItems:"flex-start",button:!0,onClick:S,disableRipple:!0,...p,children:[t.jsx(h,{className:n.ListItemAvatar,...m,children:t.jsx(r.Paper,{className:n.Paper,elevation:0,square:!0,...T,children:t.jsx(b,{mimeType:l,className:n.Icon})})}),t.jsx(u,{className:n.ListItemText,classes:n,collectionType:s,collectionId:i,...g}),t.jsx(r.IconButton,{onClick:()=>M(i),className:n.Menu,disableRipple:!0,children:t.jsx(j.Folder,{})}),y&&t.jsx(y,{className:n.Menu,entityId:i,entityType:l,...I})]})}const yI=r.withStyles(pI,{name:"VdtCollectionContentCollection"})(hI),mI=()=>({ListItemAvatar:{paddingRight:6,marginTop:0,marginBottom:0},Thumbnail:{},Paper:{height:94,width:168,position:"relative"},Icon:{fontSize:40,position:"absolute",left:"50%",marginLeft:-20,top:"50%",marginTop:-20},ThumbnailLabel:{position:"absolute",bottom:0,right:4},ListItemTextComponent:{},Menu:{visibility:"hidden"},primary:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},secondary:{fontStyle:"italic"},root:{"&:hover $Menu":{visibility:"visible"}},menuContainer:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-end"},representativeWrapper:{height:46,width:46,display:"flex",justifyContent:"center",alignItems:"center"}}),fI=({className:a,classes:n,ListItemTextComponent:o=r.ListItemText,itemId:s,itemType:i,simpleMetadataType:l,primaryTextKeys:d=["adu_label_AWSVideoRekognitionAnalyzer.adu_value","adu_transcript_AWSTranscribeAnalyzer.adu_value","adu_celebrity_AWSVideoRekognitionAnalyzer.adu_value","stl_subtitle.stl_text","co"],showWithStartTimecode:c=!0,showUser:p,showDate:u,...g})=>{const{start:h,end:m}=X.parseSimpleMetadataType(l),y=h!==void 0,{metadata:{timespan:I=[]}={}}=i,T=I.find(({start:P,end:V})=>P===h&&V===m),b=I.find(({start:P,end:V})=>P==="-INF"&&V==="+INF"),{title:M,originalFilename:L,durationSeconds:S,user:w,created:A,startTimeCode:v}=X.parseTimespan(b,{flat:!0,arrayOnSingleValue:!1}),O=X.parseTimespan(T,{flat:!0,arrayOnSingleValue:!1}),E=X.formatTimeCodeText(h),D=X.formatTimeCodeText(m),F=v?X.formatTimeCodeText(v):void 0,z=(c&&F?F.add(E):E).toSmpte(),B=(c&&F?F.add(D):D).toSmpte();let $,Y;return y?($=t.jsx("div",{children:d.map(P=>Be(O,P)!==void 0?t.jsx("div",{className:n.primary,children:Be(O,P)},P):null)}),Y=t.jsxs("div",{children:[t.jsx("div",{className:n.primary,children:M||L}),t.jsx("div",{className:n.secondary,children:`${z} - ${B}`}),p&&!u&&t.jsx("div",{className:n.secondary,children:w}),u&&!p&&t.jsx("div",{className:n.secondary,children:Me(A).fromNow()}),u&&p&&t.jsx("div",{className:n.secondary,children:`${w} • ${Me(A).fromNow()}`})]})):S&&($=t.jsx("div",{className:n.primary,children:M||L}),p&&(Y=t.jsx("div",{className:n.secondary,children:w})),u&&(Y=t.jsx("div",{className:n.secondary,children:Me(A).fromNow()})),p&&u&&(Y=t.jsx("div",{className:n.secondary,children:`${w} • ${Me(A).fromNow()}`}))),t.jsx(o,{className:a,primary:$,secondary:Y,secondaryTypographyProps:{component:"div"},...g})},CI=({className:a,classes:n,itemId:o,itemType:s,simpleMetadataType:i,PaperProps:l={},ThumbnailComponent:d=bt,ThumbnailProps:c={},ThumbnailLabelComponent:p=Xe,IconComponent:u=Ke,ListItemAvatarComponent:g=r.ListItemAvatar,...h})=>{const{start:m,end:y}=X.parseSimpleMetadataType(i),I=m!==void 0,{metadata:{timespan:T=[]}={}}=s,b=T.find(({start:O,end:E})=>O==="-INF"&&E==="+INF"),{durationSeconds:M,mimeType:L}=X.parseTimespan(b,{flat:!0,arrayOnSingleValue:!1}),S=X.formatTimeCodeText(m),w=X.formatTimeCodeText(y);let A;I?A=w.subtract(S).toSmpte():M&&(A=X.formatTimeCodeSeconds(M).toDuration());const v=X.findNearestThumbnail(s,m);return t.jsx(g,{className:a,...h,children:v?t.jsx(d,{className:n.Thumbnail,innerProps:{itemType:{thumbnails:{uri:[v]}}},height:94,width:168,labelRightBottom:A,...c}):t.jsxs(r.Paper,{className:n.Paper,elevation:0,square:!0,...l,children:[t.jsx(u,{mimeType:L,className:n.Icon}),A&&t.jsx(p,{className:n.ThumbnailLabel,label:A})]})})};function TI({className:a,entityId:n,entityType:o,selectedCollectionId:s,isRepresentativeItem:i,onRemoveCollectionEntity:l,onRemoveCollectionEntityText:d="Remove From Collection",onAddAsRepresentativeItem:c,onAddAsRepresentativeItemText:p="Add As Representative Item",onRemoveAsRepresentativeItem:u,onRemoveAsRepresentativeItemText:g="Remove As Representative Item",IconComponent:h=j.MoreVert}){const[m,y]=C.useState(null),I=b=>{y(b.currentTarget)},T=()=>{y(null)};return t.jsxs("div",{className:a,children:[t.jsx(r.IconButton,{onClick:I,children:t.jsx(h,{})}),t.jsxs(r.Menu,{open:!!m,onClose:T,anchorEl:m,children:[t.jsx(r.MenuItem,{onClick:b=>{b.stopPropagation(),l(s,n,o),T()},disabled:l===void 0,children:d}),i===!1&&t.jsx(r.MenuItem,{onClick:b=>{b.stopPropagation(),c(n),T()},disabled:c===void 0,children:p}),i===!0&&t.jsx(r.MenuItem,{onClick:b=>{b.stopPropagation(),u(n),T()},disabled:u===void 0,children:g})]})]})}function bI({className:a,classes:n,selected:o,simpleMetadataType:s,itemType:i,itemId:l,entityType:d,selectedCollectionId:c,representativeItems:p,onClick:u,onRemoveCollectionEntity:g,ListItemComponent:h=r.ListItem,ListItemProps:m={},ListItemTextComponent:y=fI,ListItemTextProps:I={},ListItemAvatarComponent:T=CI,ListItemAvatarProps:b={},ListItemMenuComponent:M=TI,ListItemMenuProps:L={}}){const{start:S,end:w}=X.parseSimpleMetadataType(s),A=o&&o.entityType==="item"&&o.entityId===l&&o.startTimecodeText===S&&o.endTimecodeText===w,v=()=>u({entityType:d,entityId:l,startTimecodeText:S,endTimecodeText:w,entity:i}),O=C.useMemo(()=>p?p.some(({value:E})=>E===l):void 0,[l,p]);return t.jsxs(h,{className:x(n.root,a),selected:A,alignItems:"flex-start",button:!0,onClick:v,disableRipple:!0,...m,children:[t.jsx(T,{className:n.ListItemAvatar,classes:n,itemId:l,itemType:i,simpleMetadataType:s,...b}),t.jsx(y,{className:n.ListItemTextComponent,classes:n,itemId:l,itemType:i,simpleMetadataType:s,...I}),M&&t.jsxs("div",{className:n.menuContainer,children:[t.jsx(M,{className:n.Menu,entityId:l,entityType:"item",selectedCollectionId:c,isRepresentativeItem:O,onRemoveCollectionEntity:g,...L}),O&&t.jsx("span",{className:n.representativeWrapper,children:t.jsx(j.Wallpaper,{})})]})]})}const II=r.withStyles(mI,{name:"VdtCollectionContentItem"})(bI),MI=()=>({root:{},ListItemAvatar:{},Avatar:{},ListItemText:{},Action:{},ListItemSecondaryAction:{visibility:"hidden"},ListItemContainer:{"&:hover $ListItemSecondaryAction":{visibility:"visible"}}});function zr({classes:a,className:n,AvatarComponent:o,AvatarProps:s,ActionComponent:i,ActionProps:l,ListItemProps:d,ListItemAvatarProps:c,ListItemTextProps:p}){return t.jsxs(r.ListItem,{className:x(n,a.root,"VdtCollectionContentSkeleton-root"),classes:{container:a.ListItemContainer},...d,children:[t.jsx(r.ListItemAvatar,{className:x(a.ListItemAvatar,"VdtCollectionContentSkeleton-ListItemAvatar"),...c,children:t.jsx(o,{variant:"rect",height:"100%",width:"100%",...s})}),t.jsx(r.ListItemText,{primary:t.jsx(oe.Skeleton,{width:120}),secondary:t.jsx(oe.Skeleton,{width:60}),className:x(a.ListItemText,"VdtCollectionContentSkeleton-ListItemText"),...p}),i&&t.jsx(r.ListItemSecondaryAction,{className:x(a.ListItemSecondaryAction,"VdtCollectionContentSkeleton-ListItemSecondaryAction"),children:t.jsx(i,{skeleton:!0,className:x(a.Action,"VdtCollectionContentSkeleton-Action"),...l})})]})}zr.propTypes={className:e.string,classes:e.objectOf(e.string),ActionComponent:e.elementType,ActionProps:e.objectOf(e.any),AvatarComponent:e.elementType,AvatarProps:e.objectOf(e.any),ListItemProps:e.objectOf(e.any),ListItemAvatarProps:e.objectOf(e.any),ListItemTextProps:e.objectOf(e.any)},zr.defaultProps={className:void 0,classes:{},ActionComponent:void 0,ActionProps:{},AvatarComponent:oe.Skeleton,AvatarProps:{},ListItemProps:{},ListItemAvatarProps:{},ListItemTextProps:{}};const LI=r.withStyles(MI,{name:"VdtCollectionContentSkeleton"})(zr);function SI({classes:a,className:n,selectedCollectionId:o,collectionContentType:s,onClick:i,onRemoveCollectionEntity:l,selected:d,ItemEntityComponent:c=II,ItemContentProps:p={},CollectionEntityComponent:u=yI,CollectionEntityProps:g={},LoadingEntityComponent:h=LI,LoadingEntityProps:m={},onRouteChange:y,...I}){const{id:T,type:b,metadata:M}=s,{itemType:L,itemId:S,collectionType:w,collectionId:A,onGetEntity:v,isLoading:O}=ne.useGetEntity({entityId:T,entityType:b});return C.useEffect(()=>{v({queryParams:{content:["metadata","thumbnail"],"noauth-url":!0}})},[]),O?t.jsx(h,{AvatarProps:{height:94,width:168},...m}):{item:t.jsx(c,{...I,classes:a,className:n,itemId:S,itemType:L,entityType:b,simpleMetadataType:M,onClick:i,selected:d,...p}),collection:t.jsx(u,{...I,classes:a,className:n,collectionId:A,collectionType:w,entityType:b,simpleMetadataType:M,onClick:i,selected:d,onRouteChange:y,...g})}[b]}const wI=r.withStyles({},{name:"VdtCollectionContentEntity"})(SI),AI="COLLECTION",DI=()=>({root:{}});function NI({children:a,classes:n,className:o,...s}){return t.jsx(r.List,{className:x(o,n.root),...s,children:a})}const vI=a=>({root:{transition:"background-color 0.3s ease",paddingLeft:a.spacing(2),paddingRight:a.spacing(2),paddingTop:a.spacing(1),paddingBottom:a.spacing(1),minHeight:60,minWidth:300},canDrop:{boxShadow:`inset 0px 0px 1px 1px ${a.palette.primary.main}`,"&.VdtDroppable-isOver":{backgroundColor:r.emphasize(a.palette.background.paper,.05)}}}),xI=ne.compose(r.withStyles(vI,{name:"VdtCollectionContentDroppable"}),We)(NI),OI=a=>({root:{marginBottom:a.spacing(1.25),backgroundColor:a.palette.type==="dark"?r.emphasize(a.palette.background.paper,.1):void 0,color:a.palette.type==="dark"?a.palette.common.white:void 0,borderColor:"transparent",borderWidth:.7,borderStyle:"solid",transition:"border-color 1s ease-out",overflow:"hidden",borderRadius:4},isDragging:{opacity:0}});function EI({children:a,classes:n={},className:o,...s}){return t.jsx("div",{className:x(o,n.root),children:t.jsx(wI,{...s})})}const jI=ne.compose(r.withStyles(OI,{name:"VdtCollectionContentEntityDraggable"}),Mt)(EI);function PI({classes:a,className:n,collectionId:o,ListProps:s={},ListComponent:i=xI,ListItemComponent:l=jI,ListItemProps:d={},ListItemMenuProps:c={},onClick:p,onDrop:u=()=>{},onChange:g,selected:h,onError:m,onRouteChange:y}){const{collectionType:I,onRefresh:T}=ne.useGetCollection({collectionId:o}),{content:b}=I,[M,L]=C.useState([]);C.useEffect(()=>{b&&L(b.map(D=>({...D,reorderId:ar()})))},[b,L]);const S=async(D,F,z)=>{try{await Q.collection.removeCollectionEntity({collectionId:D,entityId:F,queryParams:{type:z.toLowerCase()}}),T()}catch(B){m&&m(B)}},{representativeItems:w,onAdd:A,onRemove:v}=ne.useRepresentativeItems({collectionId:o,onError:m}),O=({dragId:D,hoverId:F,originalDragIndex:z})=>{D===void 0||F===void 0&&z===void 0||L(B=>{const $=[...B],Y=M.findIndex(W=>W.reorderId===D),P=M.findIndex(W=>W.reorderId===F),V=P>-1?P:z;return[$[V],$[Y]]=[$[Y],$[V]],$})},E=()=>{g&&g(M)};return t.jsx(i,{dropInfo:{entityType:AI},className:x(a.root,n),onDrop:u,...s,children:M.map((D,F)=>C.createElement(l,{...D,key:D.reference||D.id,index:F,id:D.reorderId,itemId:D.id,itemType:D,collectionContentType:D,representativeItems:w,selected:h,onClick:p,onSort:O,callbackOnDrop:E,onRouteChange:y,ListItemMenuProps:{onRemoveCollectionEntity:S,onAddAsRepresentativeItem:A,onRemoveAsRepresentativeItem:v,selectedCollectionId:o,...c},...d}))})}const jp=r.withStyles(DI,{name:"VdtCollectionContent"})(PI);jp.displayName="CollectionContent";const kI={};function FI({collectionId:a,itemId:n,removeText:o="Remove Item From Collection",onClick:s,goToText:i="Go To Collection",onRefresh:l}){const{anchorEl:d,onOpen:c,onClose:p,isOpen:u,onClick:g}=Na(),[h,m]=C.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(r.ButtonBase,{size:"small",onClick:c,children:t.jsx(j.MoreVert,{})}),t.jsxs(r.Menu,{anchorEl:d,open:u,keepMounted:!0,onClose:p,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t.jsxs(r.MenuItem,{onClick:g(y=>s(y,{collectionId:a})),children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.Forward,{fontSize:"small"})}),t.jsx(r.ListItemText,{primary:i})]}),t.jsxs(r.MenuItem,{onClick:g(()=>m(!0)),children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.RemoveCircleOutline,{fontSize:"small"})}),t.jsx(r.ListItemText,{primary:o})]})]}),t.jsx(r.Dialog,{open:h,children:t.jsx(Fr,{collectionId:a,entityId:n,entityType:"item",onClose:()=>m(!1),onSuccess:()=>{l(),m(!1)}})})]})}function Br({className:a,classes:n,itemId:o,itemSearchDocument:s,collectionListType:i,queryParams:l,onError:d,CollectionListComponent:c,CollectionListProps:p}){const[u,g]=C.useState(i),[h,m]=C.useState(!0),y=()=>{Q.item.getItem({itemId:o,queryParams:{content:"metadata",field:"__collection"}}).then(({data:M})=>{const{__collection:L=[]}=X.parseMetadataType(M.metadata,{flat:!0});if(L.length===0)return{data:{}};const S={name:"collectionId",value:L.map(A=>({value:A}))},w=rs(s,"field",(A=[])=>[...A.filter(v=>v.name!=="collectionId"),S]);return Q.collection.searchCollection({itemSearchDocument:w,queryParams:l})}).then(({data:M})=>{g(M),m(!1)}).catch(M=>d(M))};C.useEffect(()=>{y()},[]);const{CollectionListItemProps:I={}}=p,{onClick:T,ActionProps:b={}}=I;return t.jsx("div",{className:x(n.root,"VdtItemParentsTab-root",a),children:t.jsx(c,{collectionListType:u,...p,CollectionListItemProps:{skeleton:h,ActionProps:{itemId:o,onClick:T,onRefresh:y,...b},ActionComponent:FI,...I}})})}Br.propTypes={className:e.string,classes:e.objectOf(e.any).isRequired,itemId:e.string.isRequired,itemSearchDocument:e.objectOf(e.any),queryParams:e.objectOf(e.any),onError:e.func,CollectionListComponent:e.elementType,CollectionListProps:e.objectOf(e.any),collectionListType:e.objectOf(e.any)},Br.defaultProps={className:void 0,itemSearchDocument:{},queryParams:{content:"metadata",field:"title"},onError:({message:a})=>console.error(a),CollectionListComponent:xr,CollectionListProps:{},collectionListType:{collection:[...Array(3).keys()].map(a=>({id:String(a)}))}};const zI=r.withStyles(kI,{name:"VdtItemParentsTab"})(Br),Pp=({itemType:a,parseMetadataOpts:n,options:o})=>{const{metadata:s={}}=a,i=X.parseMetadataType(s,n);return o.map(({value:l})=>{const{[l]:d}=i;return d})};function qr({options:a=[],metadataToProps:n=Pp,parseMetadataOpts:o={joinValue:", ",flat:!0},selected:s,onCheck:i,onClick:l,TableRowProps:d={},...c}){const{itemType:p}=c,u=C.useMemo(()=>n({itemType:p,parseMetadataOpts:o,options:a}),[p,a,Pp]),g=h=>{i&&i(h,!s,c)};return t.jsxs(r.TableRow,{hover:!0,selected:s,onClick:l,style:{cursor:"pointer"},...d,children:[i&&t.jsx(r.TableCell,{padding:"checkbox",children:t.jsx(Gt,{checked:s,handleChecked:g})}),u.map((h,m)=>t.jsx(r.Hidden,{only:a[m].hide,children:t.jsx(r.TableCell,{children:a[m].valueComponent?t.jsx(r.Box,{component:a[m].valueComponent,value:h,innerProps:c}):h})},a[m].key||a[m].value||a[m].label))]})}function kp({itemListType:a={},RowComponent:n=qr,options:o=[],onCheck:s,selected:i,onRowClick:l,...d}){const{item:c=[]}=a;return t.jsxs(r.Table,{size:"small",children:[t.jsx(r.TableHead,{children:t.jsxs(r.TableRow,{children:[s&&t.jsx(r.TableCell,{padding:"checkbox"}),o.map(({label:p,value:u,hide:g},h)=>t.jsx(r.Hidden,{only:g,children:t.jsx(r.TableCell,{children:p})},p||u||h))]})}),t.jsx(r.TableBody,{children:c&&c.map(p=>t.jsx(n,{itemType:p,itemId:p.id,options:o,onCheck:s,selected:i&&i.includes(p.id),onClick:()=>l(p),...d},p.id))})]})}function BI(a){const{itemListType:{hits:n=0}}=a;return t.jsx(Kt,{count:n,...a})}function qI(a){const{isLoading:n}=a;return t.jsx(ba,{submitting:n,...a})}const VI={queryParams:{field:["itemId","title","__user"],content:"metadata"}};function GI({onChange:a,onCheck:n=()=>{},ItemTableComponent:o=kp,ItemTableProps:s={},searchProps:i=ne.useSearch(VI),idLabelText:l="Id",titleLabelText:d="Title",ownerLabelText:c="Owner",searchPlaceholder:p="Search item",SearchInputProps:u={},PaginationProps:g={},SearchItemProps:h={}}){const{state:m,setSearchText:y,onChangeRowsPerPage:I,onChangePage:T}=i,{matrixParams:b,queryParams:M,itemSearchDocument:L,page:S,rowsPerPage:w}=m,[A,v]=C.useState([]),O=D=>{A.includes(D)?v(F=>F.filter(z=>z!==D)):v(F=>[...F,D])};C.useEffect(()=>a&&a(A),[A]);const E=({id:D})=>O(D);return t.jsxs(ne.SearchItem,{itemSearchDocument:L,matrixParams:b,queryParams:M,...h,children:[t.jsx(qI,{onSubmit:D=>y(`*${D}*`),searchPlaceholder:p,...u}),t.jsx(o,{onRowClick:E,onCheck:n,selected:A,options:[{label:d,value:"title"},{label:l,value:"itemId"},{label:c,value:"__user"}],...s}),t.jsx(BI,{onChangePage:T,onChangeRowsPerPage:I,page:S,rowsPerPage:w,...g})]})}const Fp=r.withStyles({},{name:"VdtItemSearchPicker"})(GI);function UI(a,n){return Promise.resolve(Q.item.createItemRelationList({itemRelationListDocument:{relation:n.map(o=>({direction:{source:a,target:o}}))}}))}function Vr({classes:a,className:n,itemId:o,onSubmit:s,onSuccess:i,onError:l,ItemPickerComponent:d,ItemPickerProps:c,defaultView:p,titleText:u,submitText:g,onRefresh:h,open:m,setOpenDialog:y}){const[I,T]=C.useState([]),b=()=>{Promise.resolve(s(o,I)).then((...M)=>{i(I,...M),y(!1),h()}).catch(M=>l(I,M)).finally(()=>y(!1))};return t.jsx("div",{className:x(a.root,"VdtAddRelationDialog-root",n),children:t.jsxs(r.Dialog,{open:m,onClose:()=>{y(!1)},children:[t.jsx(r.DialogTitle,{children:u}),t.jsx(r.DialogContent,{children:{search:t.jsx(d,{onChange:T,...c})}[p]}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:()=>{y(!1)},color:"secondary",children:"Cancel"}),t.jsx(r.Button,{onClick:b,color:"primary",variant:"contained",disabled:p==="search"&&I.length===0,children:g})]})]})})}Vr.propTypes={classes:e.object,className:e.string,itemId:e.string.isRequired,onClose:e.func,onSubmit:e.func,onSuccess:e.func,onError:e.func,ItemPickerComponent:e.elementType,ItemPickerProps:e.object,CreateCollectionProps:e.object,defaultView:e.string,titleText:e.string,submitText:e.string,searchText:e.string,SearchCollectionIcon:e.elementType,onRefresh:e.func,open:e.bool,setOpenDialog:e.func},Vr.defaultProps={classes:{},className:void 0,ItemPickerComponent:Fp,onClose:()=>{},onSubmit:UI,onSuccess:()=>{},onError:a=>console.error(a),ItemPickerProps:{},CreateCollectionProps:{},defaultView:"search",titleText:"Add Relation",submitText:"Add",searchText:"Search",SearchCollectionIcon:j.Search,onRefresh:()=>{},open:!1,setOpenDialog:()=>{}};const zp=r.withStyles({},{name:"VdtAddRelationDialog"})(Vr),$I=()=>({root:{},ListItemAvatar:{},Avatar:{},ListItemText:{},Action:{},ListItemSecondaryAction:{visibility:"hidden"},ListItemContainer:{"&:hover $ListItemSecondaryAction":{visibility:"visible"}}});function Gr({classes:a,className:n,itemType:o,onClick:s,parseMetadataOptions:i,primary:l,secondary:d,AvatarComponent:c,AvatarProps:p,ActionComponent:u,ActionProps:g,ListItemProps:h,skeleton:m,ListItemAvatarProps:y,ListItemTextProps:I}){const{id:T,metadata:b}=o;let M,L;if(m===!1){const S=X.parseMetadataType(b,i);typeof l=="string"?M=S[l]:typeof l=="function"&&(M=l({...S,itemType:o,itemId:T})),typeof d=="string"?L=S[d]:typeof d=="function"&&(L=d({...S,itemType:o,itemId:T}))}return t.jsxs(r.ListItem,{className:x(n,a.root,"VdtItemListItem-root"),onClick:s?S=>s(S,{id:T}):void 0,button:s?!0:void 0,classes:{container:a.ListItemContainer},...h,children:[t.jsx(r.ListItemAvatar,{className:x(a.ListItemAvatar,"VdtItemListItem-ListItemAvatar"),...y,children:t.jsx(c,{avatar:"item",itemId:T,itemType:o,skeleton:m,className:x(a.Avatar,"VdtItemListItem-Avatar"),...p})}),t.jsx(r.ListItemText,{primary:m?t.jsx(oe.Skeleton,{width:120}):M,secondary:m?t.jsx(oe.Skeleton,{width:60}):L,className:x(a.ListItemText,"VdtItemListItem-ListItemText"),...I}),u&&t.jsx(r.ListItemSecondaryAction,{className:x(a.ListItemSecondaryAction,"VdtItemListItem-ListItemSecondaryAction"),children:t.jsx(u,{skeleton:m,itemType:o,className:x(a.Action,"VdtItemListItem-Action"),...g})})]})}Gr.propTypes={className:e.string,classes:e.objectOf(e.string),itemType:e.objectOf(e.any),primary:e.oneOfType([e.string,e.func]),secondary:e.oneOfType([e.string,e.func]),onClick:e.func,ActionComponent:e.elementType,ActionProps:e.objectOf(e.any),AvatarComponent:e.elementType,AvatarProps:e.objectOf(e.any),ListItemProps:e.objectOf(e.any),ListItemAvatarProps:e.objectOf(e.any),ListItemTextProps:e.objectOf(e.any),parseMetadataOptions:e.objectOf(e.any),skeleton:e.bool},Gr.defaultProps={className:void 0,classes:{},itemType:{},primary:({itemId:a})=>a,secondary:void 0,onClick:void 0,ActionComponent:void 0,ActionProps:{},AvatarComponent:It,AvatarProps:{},ListItemProps:{},ListItemAvatarProps:{},ListItemTextProps:{},parseMetadataOptions:{flat:!0,arrayOnSingleValue:!1},skeleton:!1};const Ur=r.withStyles($I,{name:"VdtItemListItem"})(Gr);Ur.displayName="ItemListItem";const YI=()=>({root:{width:"100%"}});function $r({classes:a,className:n,itemListType:o,ItemListItemComponent:s,ItemListItemProps:i}){const{item:l=[]}=o;return t.jsx(r.List,{className:x(a.root,"VdtItemList-root",n),children:l.map(d=>t.jsx(s,{itemType:d,primary:"title",...i},d.id))})}$r.propTypes={className:e.string,classes:e.objectOf(e.any),itemListType:e.objectOf(e.any),ItemListItemComponent:e.elementType,ItemListItemProps:e.objectOf(e.any)},$r.defaultProps={className:void 0,classes:{},itemListType:{},ItemListItemComponent:Ur,ItemListItemProps:{}};const Yr=r.withStyles(YI,{name:"VdtItemList"})($r);Yr.displayName="ItemList";function Wr({open:a,onClose:n,onSuccess:o,relationId:s,onError:i,onConfirm:l,ConfirmationDialogProps:d,titleText:c,confirmText:p,rejectText:u}){const g=()=>l({relationId:s}).then(o).catch(i);return t.jsx(ls,{open:a,onReject:n,titleText:c,confirmText:p,rejectText:u,onConfirm:g,...d})}Wr.propTypes={relationId:e.string.isRequired,open:e.bool,onClose:e.func,onSuccess:e.func,onError:e.func,onConfirm:e.func,ConfirmationDialogProps:e.objectOf(e.any),titleText:e.string,confirmText:e.string,rejectText:e.string},Wr.defaultProps={open:!1,onClose:void 0,onSuccess:void 0,onError:({message:a,error:n})=>console.error(`${a}
7
- ${n}`),onConfirm:({relationId:a})=>Q.item.removeRelation({relationId:a}),ConfirmationDialogProps:{},titleText:"Remove relation?",confirmText:"Remove",rejectText:"Cancel"};const Bp=r.withStyles({},{name:"VdtItemRelationRemoveDialog"})(Wr),WI={root:{},actions:{display:"flex",justifyContent:"flex-end"},button:{}};function _I({itemId:a,itemType:n,itemRelationListType:o={},removeText:s="Remove Relation",onClick:i,goToText:l="Go To Item",onRefresh:d,onRemove:c,MenuIcon:p=j.MoreVert}){const{anchorEl:u,onOpen:g,onClose:h,isOpen:m,onClick:y}=Na(),[I,T]=C.useState(!1),b=()=>T(!1),{relation:M=[]}=o,{id:L}=M.find(({direction:{source:S,target:w}={}})=>(S===n.id||w===n.id)&&(S===a||w===a))||{};return t.jsxs(t.Fragment,{children:[t.jsx(r.ButtonBase,{size:"small",onClick:g,children:t.jsx(p,{})}),t.jsxs(r.Menu,{anchorEl:u,open:m,keepMounted:!0,onClose:h,getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t.jsxs(r.MenuItem,{onClick:y(S=>i(S,{id:n.id})),children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.Forward,{fontSize:"small"})}),t.jsx(r.ListItemText,{primary:l})]}),t.jsxs(r.MenuItem,{onClick:y(()=>T(!0)),children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.RemoveCircleOutline,{fontSize:"small"})}),t.jsx(r.ListItemText,{primary:s})]})]}),t.jsx(Bp,{itemId:n.id,relationId:L,open:I,onClose:b,onSuccess:()=>{b(),c&&c(),d()}})]})}function _r({className:a,classes:n,itemId:o,itemSearchDocument:s,queryParams:i,onError:l,ItemListComponent:d,ItemListProps:c,onAdd:p,onRemove:u,addText:g,direction:h}){const[m,y]=C.useState(!1),{data:I={},request:T}=ne.useApi(Q.item.listItemRelation),{data:b,request:M,reset:L}=ne.useApi(Q.item.searchItem),S=()=>T({itemId:o,queryParams:{direction:h}}).catch(O=>l(O.message));C.useEffect(()=>{S()},[o,h]),C.useEffect(()=>{const{relation:O=[]}=I;if(O.length===0){b&&b.hits>0&&L();return}const E={name:"itemId",value:O.map(({direction:{source:F,target:z}})=>({value:F===o?z:F}))},D=rs(s,"field",(F=[])=>[...F.filter(z=>z.name!=="itemId"),E]);M({itemSearchDocument:D,queryParams:i}).catch(F=>l(F.message))},[I]);const{ItemListItemProps:w={}}=c,{onClick:A,ActionProps:v={}}=w;return t.jsxs("div",{className:x(n.root,"VdtItemRelationsTab-root",a),children:[t.jsx("div",{className:n.actions,children:t.jsx(r.Button,{variant:"contained",color:"primary",className:n.button,startIcon:t.jsx(j.Add,{}),onClick:()=>{y(!0)},children:g})}),t.jsx(d,{itemListType:b,...c,ItemListItemProps:{ActionProps:{itemId:o,onClick:A,onRefresh:S,itemRelationListType:I,onRemove:u,...v},ActionComponent:_I,...w}}),t.jsx(zp,{itemId:o,open:m,setOpenDialog:y,onSuccess:p,onRefresh:S})]})}_r.propTypes={className:e.string,classes:e.objectOf(e.any).isRequired,itemId:e.string.isRequired,itemSearchDocument:e.objectOf(e.any),queryParams:e.objectOf(e.any),onError:e.func,ItemListComponent:e.elementType,ItemListProps:e.objectOf(e.any),onRemove:e.func,onAdd:e.func,addText:e.string,direction:e.oneOf(["U","S","T","D","A"])},_r.defaultProps={className:void 0,itemSearchDocument:{},queryParams:{content:"metadata",field:"title"},onError:({message:a})=>console.error(a),ItemListComponent:Yr,ItemListProps:{},onRemove:()=>{},onAdd:()=>{},addText:"Add new relation",direction:"A"};const QI=r.withStyles(WI,{name:"VdtItemRelationsTab"})(_r),HI=a=>({root:{paddingLeft:0,minHeight:20,[a.breakpoints.up("sm")]:{minWidth:0},borderWidth:1,"&:not(:first-of-type)":{marginLeft:-1},backgroundColor:"unset","&::after":{color:a.palette.primary.main,transition:"width 0.25s ease-in-out 0.05s",borderBottom:"0.25em solid",width:0,position:"absolute",bottom:0,left:0,content:'""'},"&:hover":{opacity:1,backgroundColor:"unset","&::after":{width:"calc(100% - 12px)"}}},selected:{backgroundColor:"unset","&::after":{width:"calc(100% - 12px)"}}}),ZI=r.withStyles(HI,{name:"VdtItemTabTab"})(r.Tab),JI=a=>({root:{paddingTop:a.spacing(1),display:({value:n,currentTab:o})=>n!==o?"none":"block"}});function XI({className:a,classes:n,hideOnMount:o=!0,currentTab:s,value:i,...l}){return!o&&i!==s?null:t.jsx("div",{className:x(n.root,a),...l})}const KI=r.withStyles(JI,{name:"VdtItemTabTabPanel"})(XI),RI={root:{backgroundColor:"unset",minHeight:20},indicator:{display:"none"},scrollButtons:{backgroundColor:"unset"}},eM=r.withStyles(RI,{name:"VdtItemTabTabs"})(r.Tabs),tM=()=>({root:{}});function Qr({classes:a,className:n,tabs:o=[],TabsProps:s,TabPanelProps:i,defaultTab:l,...d}){const[c,p]=C.useState(l),u=(g,h)=>{p(h)};return t.jsxs(t.Fragment,{children:[t.jsx(eM,{value:c,onChange:u,variant:"scrollable",scrollButtons:"auto",...s,children:o.map(({label:g},h)=>t.jsx(ZI,{label:g,value:h},g))}),t.jsx(r.Divider,{}),o.map(({component:g,label:h,hideOnMount:m=!0,...y},I)=>t.jsx(KI,{currentTab:c,hideOnMount:m,value:I,...i,children:t.jsx(g,{hidden:I!==c,...d,...y})},h))]})}Qr.propTypes={classes:e.objectOf(e.string),className:e.string,defaultTab:e.number,TabsProps:e.objectOf(e.any),TabPanelProps:e.objectOf(e.any),tabs:e.arrayOf(e.shape({label:e.string,hideOnMount:e.bool,component:e.elementType}))},Qr.defaultProps={className:void 0,classes:{},defaultTab:0,TabsProps:{},TabPanelProps:{},tabs:[]};const qp=r.withStyles(tM,{name:"VdtItemTabs"})(Qr);qp.displayName="ItemTabs";const aM=({itemType:a,titleSelector:n,subheaderSelector:o,imageSelector:s,contentSelector:i,avatarSelector:l,labelRightBottomSelector:d,parseMetadataOpts:c,parseHighlightOpts:p})=>{const{metadata:u={},timespan:g=[]}=a,h=X.parseMetadataType(u,c),m=X.parseHighlightTimespanList(g,p);return{title:n(h,m),subheader:o(h,m),image:s(h),content:i(h),avatar:l(h),labelRightBottom:d(h)}};function _e({itemType:a,MediaCardComponent:n,metadataToProps:o,parseMetadataOpts:s,parseHighlightOpts:i,titleSelector:l,subheaderSelector:d,imageSelector:c,contentSelector:p,avatarSelector:u,labelRightBottomSelector:g,ThumbnailProps:h,...m}){const y=C.useMemo(()=>o({itemType:a,titleSelector:l,subheaderSelector:d,imageSelector:c,contentSelector:p,avatarSelector:u,labelRightBottomSelector:g,parseMetadataOpts:s,parseHighlightOpts:i}),[a]);return t.jsx(n,{title:y.title,subheader:y.subheader,content:y.content,avatar:y.avatar,image:y.image,ThumbnailProps:{labelRightBottom:y.labelRightBottom,LabelComponentRightBottom:dr,...h},itemType:a,...m})}_e.propTypes={itemType:e.objectOf(e.any),parseMetadataOpts:e.objectOf(e.any),parseHighlightOpts:e.objectOf(e.any),metadataToProps:e.func,MediaCardComponent:e.elementType,titleSelector:e.func,subheaderSelector:e.func,imageSelector:e.func,contentSelector:e.func,avatarSelector:e.func,labelRightBottomSelector:e.func,ThumbnailProps:e.objectOf(e.any)},_e.defaultProps={itemType:void 0,metadataToProps:aM,parseMetadataOpts:{joinValue:", ",flat:!0},parseHighlightOpts:{arrayOnSingle:!1,flat:!0},MediaCardComponent:Ut,titleSelector:(a={})=>a.title,subheaderSelector:(a={})=>a.created,imageSelector:(a={})=>a.representativeThumbnailNoAuth,contentSelector:(a={})=>a.user,avatarSelector:(a={})=>a.mimeType,labelRightBottomSelector:(a={})=>a.durationSeconds,ThumbnailProps:{}};function Hr({itemListType:a,ItemCardComponent:n,ItemCardProps:o,GridContainerProps:s,GridItemProps:i}){const{item:l=[]}=a;return t.jsx(r.Grid,{container:!0,...s,children:l&&l.map((d,c)=>t.jsx(r.Grid,{item:!0,xs:"auto",...i,children:t.jsx(n,{itemId:d.id,itemType:d,index:c,...o})},d.id))})}Hr.propTypes={itemListType:e.objectOf(e.any),ItemCardComponent:e.elementType,ItemCardProps:e.objectOf(e.any),GridContainerProps:e.objectOf(e.any),GridItemProps:e.objectOf(e.any)},Hr.defaultProps={itemListType:{},ItemCardComponent:_e,ItemCardProps:{},GridContainerProps:{},GridItemProps:{}};function nM({ItemCardComponent:a,itemType:n,provided:o,snapshot:s,rubric:i,...l}){const{draggableProps:d,dragHandleProps:c}=o,{style:p}=d;return t.jsx("div",{ref:o.innerRef,...d,...c,style:{...p,height:"inherit"},children:t.jsx(a,{...l,itemId:n.id,itemType:n,MediaCardComponent:Ut,ThumbnailComponent:null})})}function rM({ItemCardCloneComponent:a=nM,ItemCardComponent:n=_e,ItemCardProps:o={},GridContainerProps:s={},GridItemProps:i={},item:l=[],DroppableProps:d={}}){return t.jsx(r.Grid,{container:!0,...s,children:l&&l.map((c,p)=>t.jsx(r.Grid,{item:!0,xs:"auto",...i,children:t.jsx(Ht.Droppable,{droppableId:c.id,isDropDisabled:!0,renderClone:(u,g,h)=>t.jsx(a,{ItemCardComponent:n,provided:u,snapshot:g,rubric:h,itemType:c,...o}),...d,children:u=>t.jsxs("div",{...u.droppableProps,style:{minWidth:320},ref:u.innerRef,children:[t.jsx(n,{draggableId:c.id,index:p,itemId:c.id,itemType:c,...o}),t.jsx("div",{style:{display:"none",visibility:"hidden"},children:u.placeholder})]})})},c.id))})}const oM=[{name:"scc",avatar:"SCC",primary:"Scenarist Closed Captions",onDownload:({itemId:a})=>Q.subtitle.getSubtitleSCC({itemId:a})},{name:"ttml",avatar:"TTML",primary:"Timed Text Markup Language",onDownload:({itemId:a})=>Q.subtitle.getSubtitleTTML({itemId:a})},{name:"webvtt",avatar:"VTT",primary:"Web Video Text Tracks ",onDownload:({itemId:a,subtitleGroup:n="stl_subtitle",subtitleField:o="stl_text"})=>new Promise(s=>{const i={content:"metadata",group:n,field:o};Q.item.getItem({itemId:a,queryParams:i}).then(({data:l})=>{const{metadata:d}=l,c=X.metadataTypeToWebVtt(d,{subtitleGroup:n,subtitleField:o});s({data:c})})})},{name:"xml",avatar:"XML",primary:"Vidispine XML",onDownload:({itemId:a})=>Q.item.getItemMetadata({itemId:a,headers:{accept:"application/xml"}})}];function Vp({className:a,classes:n,itemId:o,subtitle:s,onSuccess:i,onFailure:l,subtitleGroup:d,subtitleField:c,DownloadIcon:p=j.GetApp,ProgressComponent:u=r.CircularProgress}){const[g,h]=C.useState(!1),{onDownload:m,name:y,avatar:I,primary:T,secondary:b,...M}=s,L=()=>{h(!0),m({itemId:o,subtitleGroup:d,subtitleField:c,...M}).then(S=>{const w=`${o}.${y}`,A=window.URL.createObjectURL(new Blob([S.data])),v=document.createElement("a");v.href=A,v.setAttribute("download",w),v.click(),window.URL.revokeObjectURL(A)}).then(()=>{h(!1),i&&i({name:y,itemId:o})}).catch(S=>{if(h(!1),l)l({name:y,itemId:o,error:S});else throw new Error(S)})};return t.jsxs(r.ListItem,{button:!0,disabled:g===!0,onClick:L,className:a,children:[I&&t.jsx(r.ListItemAvatar,{className:n.ListItemAvatar,children:t.jsx(r.Avatar,{className:n.Avatar,variant:"square",children:I})}),t.jsx(r.ListItemText,{className:n.ListItemText,primary:T,secondary:b}),t.jsxs(r.ListItemSecondaryAction,{className:n.ListItemSecondaryAction,children:[g===!0&&u&&t.jsx(u,{size:20,className:n.Progress}),g===!1&&p&&t.jsx(r.ButtonBase,{onClick:L,className:n.DownloadButton,children:t.jsx(p,{className:n.DownloadIcon})})]})]})}function sM({classes:a,className:n,options:o,itemId:s,onSuccess:i,onFailure:l,subtitleGroup:d,subtitleField:c,ItemSidecarDownloadListItemComponent:p=Vp,ItemSidecarDownloadListItemProps:u={}}){return t.jsx(r.List,{dense:!0,className:n,children:o.map(g=>t.jsx(p,{subtitle:g,className:a.ListItem,classes:a,itemId:s,onSuccess:i,onFailure:l,subtitleGroup:d,subtitleField:c,...u},g.name))})}const iM=()=>({List:{},ListItem:{},ListItemAvatar:{},Avatar:{},ListItemText:{},ListItemSecondaryAction:{},Progress:{},DownloadButton:{},DownloadIcon:{}});function Zr({className:a,classes:n,itemId:o,subtitleOptions:s,onSuccess:i,onFailure:l,subtitleGroup:d,subtitleField:c,ItemSidecarDownloadListComponent:p,ItemSidecarDownloadListProps:u,ItemSidecarDownloadListItemComponent:g,ItemSidecarDownloadListItemProps:h}){return t.jsx(p,{classes:n,className:x(n.List,a),options:s,itemId:o,onSuccess:i,onFailure:l,subtitleGroup:d,subtitleField:c,ItemSidecarDownloadListItemComponent:g,ItemSidecarDownloadListItemProps:h,...u})}Zr.propTypes={classes:e.objectOf(e.string),className:e.string,itemId:e.string.isRequired,subtitleOptions:e.arrayOf(e.shape({name:e.string,avatar:e.string,primary:e.string,onDownload:e.func})),onSuccess:e.func,onFailure:e.func,subtitleGroup:e.string,subtitleField:e.string,ItemSidecarDownloadListComponent:e.elementType,ItemSidecarDownloadListProps:e.objectOf(e.any),ItemSidecarDownloadListItemComponent:e.elementType,ItemSidecarDownloadListItemProps:e.objectOf(e.any)},Zr.defaultProps={className:void 0,classes:{},subtitleOptions:oM,onSuccess:void 0,onFailure:void 0,subtitleGroup:void 0,subtitleField:void 0,ItemSidecarDownloadListComponent:sM,ItemSidecarDownloadListProps:{},ItemSidecarDownloadListItemComponent:Vp,ItemSidecarDownloadListItemProps:{}};const Gp=r.withStyles(iM,{name:"VdtItemSidecarDownload"})(Zr),lM=[{name:"srt",avatar:"SRT",primary:"SubRip Subtitle",onUpload:({itemId:a,file:n})=>Q.vsimport.createImportItemSidecarRaw({itemId:a,file:n,queryParams:{fileExtension:"srt"}})},{name:"stl",avatar:"STL",primary:"EBU STL",onUpload:({itemId:a,file:n})=>Q.vsimport.createImportItemSidecarRaw({itemId:a,file:n,queryParams:{fileExtension:"stl"}})},{name:"scc",avatar:"SCC",primary:"Scenarist Closed Captions",onUpload:({itemId:a,file:n})=>Q.vsimport.createImportItemSidecarRaw({itemId:a,file:n,queryParams:{fileExtension:"scc"}})},{name:"evs",avatar:"EVS",primary:"EVS Metadata",onUpload:({itemId:a,file:n})=>Q.vsimport.createImportItemSidecarRaw({itemId:a,file:n,queryParams:{fileExtension:"evs"}})},{name:"xml",avatar:"XML",primary:"Vidispine XML Metadata",onUpload:({itemId:a,file:n})=>Q.vsimport.createImportItemSidecarRaw({itemId:a,file:n,queryParams:{fileExtension:"xml"}})},{name:"xmp",avatar:"XMP",primary:"eXtensible Metadata Platform",onUpload:({itemId:a,file:n})=>Q.vsimport.createImportItemSidecarRaw({itemId:a,file:n,queryParams:{fileExtension:"xmp"}})},{name:"mp4",avatar:"MP4",primary:"MP4 Proxy",onUpload:({itemId:a,file:n})=>Q.shape.createShapeImportRaw({itemId:a,file:n,queryParams:{tag:"__mp4"}})},{name:"jpg",avatar:"JPG",primary:"JPG Thumbnail",onUpload:({itemId:a,file:n})=>Q.thumbnail.listThumbnailResource({itemId:a}).then(({data:o})=>{const{uri:[s]=[]}=o;return s?Promise.resolve({data:o}):Q.thumbnail.createThumbnailResource({itemId:a})}).then(({data:o})=>{const{uri:[s]=[]}=o,[i]=s.split("/").slice(-2);return Q.thumbnail.updateThumbnail({resourceId:i,itemId:a,time:0,headers:{contentType:"image/jpeg"},file:n})})},{name:"png",avatar:"PNG",primary:"PNG Thumbnail",onUpload:({itemId:a,file:n})=>Q.thumbnail.listThumbnailResource({itemId:a}).then(({data:o})=>{const{uri:[s]=[]}=o;return s?Promise.resolve({data:o}):Q.thumbnail.createThumbnailResource({itemId:a})}).then(({data:o})=>{const{uri:[s]=[]}=o,[i]=s.split("/").slice(-2);return Q.thumbnail.updateThumbnail({resourceId:i,itemId:a,time:0,headers:{contentType:"image/png"},file:n})})}];function dM({className:a,classes:n,uploadText:o,onClickUpload:s,uploadDisabled:i,isUploading:l,ButtonComponent:d=Ba}){return t.jsx(r.DialogActions,{className:a,children:t.jsx(d,{className:n.Button,onClick:s,color:"primary",variant:"contained",disabled:i,submitting:l,children:o})})}function Up({className:a,classes:n={},option:o,onChange:s,selected:i}){const{primary:l,avatar:d}=o;return t.jsxs(r.ListItem,{button:!0,onClick:s,className:a,selected:i,children:[d&&t.jsx(r.ListItemAvatar,{className:n.ListItemAvatar,children:t.jsx(r.Avatar,{className:n.Avatar,variant:"square",children:d})}),t.jsx(r.ListItemText,{className:n.ListItemText,primary:l}),t.jsx(r.ListItemSecondaryAction,{className:n.ListItemSecondaryAction,children:t.jsx(r.Radio,{className:n.Radio,checked:i,onChange:s})})]})}function cM({className:a,classes:n,chooseText:o,options:s,onChange:i,selected:l,ItemSidecarUploadListItemComponent:d=Up,ItemSidecarUploadListItemProps:c={}}){return t.jsx(r.List,{dense:!0,className:a,subheader:t.jsx(r.ListSubheader,{className:n.ListSubheader,children:o}),children:s.map(p=>t.jsx(d,{onChange:()=>i(p),className:n.ListItem,classes:n,selected:l===p,option:p,...c},p.name))})}function pM({className:a,classes:n,onDrop:o,onReset:s,acceptedFile:i,rejectedFile:l,accept:d,dropText:c,ResetIconComponent:p=j.Cancel}){const{getRootProps:u,getInputProps:g}=ss.useDropzone({onDrop:o,maxFiles:1,multiple:!1,accept:d});return t.jsx("div",{className:a,children:t.jsxs("div",{...u(),className:x(n.dropzoneInput,l?n.dropzoneInputError:n.dropzoneInputDefault),children:[t.jsx("input",{...g()}),!i&&!l&&t.jsx("p",{children:c}),i&&t.jsxs("span",{className:n.acceptedFile,children:[i.name,t.jsx(p,{onClick:s,className:n.ResetIcon})]}),l&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:n.rejectedFile,children:[l.file.name,t.jsx(p,{onClick:s,className:n.ResetIcon})]}),l.errors.length&&t.jsx("span",{className:n.errorMessage,children:l.errors[0].message})]})]})})}const uM=a=>({dropzoneRoot:{cursor:"pointer",marginTop:a.spacing(1),marginBottom:a.spacing(1),paddingLeft:a.spacing(.5),paddingRight:a.spacing(.5)},dropzoneInput:{marginTop:a.spacing(.5),minHeight:"10vh",minWidth:a.spacing(4),borderWidth:2,borderRadius:3,borderStyle:"dotted",backgroundColor:"rgba(0,0,0,0.05)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",transition:"min-height 0.3s"},dropzoneInputDefault:{borderColor:a.palette.grey.A200},dropzoneInputError:{borderColor:a.palette.error.main,color:a.palette.error.main},ListSubheader:{},Button:{},List:{},showList:{height:"auto",overflow:"visible"},hideList:{height:0,overflow:"hidden"},ListItemAvatar:{},Avatar:{},Radio:{},DialogActions:{},acceptedFile:{display:"flex",alignItems:"center"},rejectedFile:{display:"flex",alignItems:"center"}});function Jr({classes:a,className:n,itemId:o,onSuccess:s,onFailure:i,subtitleOptions:l,dropText:d,chooseText:c,uploadText:p,defaultSelectedSubtitle:u,ItemSidecarUploadDropzoneComponent:g,ItemSidecarUploadDropzoneProps:h,ItemSidecarUploadListComponent:m,ItemSidecarUploadListProps:y,ItemSidecarUploadActionsComponent:I,ItemSidecarUploadActionsProps:T,ItemSidecarUploadListItemComponent:b,ItemSidecarUploadListItemProps:M}){const[L,S]=C.useState(u),[w,A]=C.useState(),[v,O]=C.useState(),[E,D]=C.useState(),F=(Y=[],P=[])=>{const[V]=Y,[W]=P;if(W)A(),O(W);else if(V){A(V),O();const{name:_}=V,[,H]=_.split(".");if(H){const k=l.find(({name:U})=>U===H);k&&S(k)}}else A(),O()},z=Y=>{Y.stopPropagation(),A(),O(),S()},B=Y=>S(Y),$=()=>{try{D(!0);const{onUpload:Y}=L;if(!Y)throw new Error("No upload handler");if(!w)throw new Error("No file specified");Y({itemId:o,file:w}).then(()=>{D(),s&&s({name:w.name})}).catch(P=>{D(),i&&i(P)})}catch(Y){D(),i&&i(Y)}};return t.jsxs("div",{className:x(a.root,n),children:[t.jsx(g,{className:a.dropzoneRoot,classes:a,accept:l.map(({name:Y})=>`.${Y}`).toString(),dropText:d,onDrop:F,onReset:z,acceptedFile:w,rejectedFile:v,...h}),w&&t.jsx(m,{className:a.List,classes:a,onChange:B,options:l,selected:L,chooseText:c,ItemSidecarUploadListItemComponent:b,ItemSidecarUploadListItemProps:M,...y}),t.jsx(I,{onClickUpload:$,className:a.DialogActions,classes:a,uploadDisabled:!L||!w,uploadText:p,isUploading:E,...T})]})}Jr.propTypes={classes:e.objectOf(e.string),className:e.string,itemId:e.string.isRequired,onSuccess:e.func,onFailure:e.func,subtitleOptions:e.arrayOf(e.shape({name:e.string,avatar:e.string,primary:e.string,onUpload:e.func})),defaultSelectedSubtitle:e.shape({name:e.string,avatar:e.string,primary:e.string,onUpload:e.func}),dropText:e.string,chooseText:e.string,uploadText:e.string,ItemSidecarUploadDropzoneComponent:e.elementType,ItemSidecarUploadDropzoneProps:e.objectOf(e.any),ItemSidecarUploadListComponent:e.elementType,ItemSidecarUploadListProps:e.objectOf(e.any),ItemSidecarUploadListItemComponent:e.elementType,ItemSidecarUploadListItemProps:e.objectOf(e.any),ItemSidecarUploadActionsComponent:e.elementType,ItemSidecarUploadActionsProps:e.objectOf(e.any)},Jr.defaultProps={className:void 0,classes:{},onSuccess:void 0,onFailure:void 0,subtitleOptions:lM,defaultSelectedSubtitle:void 0,dropText:"Drop file or click to browse",chooseText:"Choose Subtitle Format",uploadText:"Upload",ItemSidecarUploadDropzoneComponent:pM,ItemSidecarUploadDropzoneProps:{},ItemSidecarUploadListComponent:cM,ItemSidecarUploadListProps:{},ItemSidecarUploadListItemComponent:Up,ItemSidecarUploadListItemProps:{},ItemSidecarUploadActionsComponent:dM,ItemSidecarUploadActionsProps:{}};const $p=r.withStyles(uM,{name:"VdtItemSidecarUpload"})(Jr),Yp="ITEM_SIDECAR_UPLOAD_TAB",Xr="ITEM_SIDECAR_DOWNLOAD_TAB",gM=a=>({root:{},DialogTitle:{},DialogContent:{},Tabs:{marginBottom:a.spacing(2)},Tab:{},ItemSidecarDownload:{},ItemSidecarUpload:{}});function Kr({classes:a,className:n,itemId:o,onClose:s,onSuccessDownload:i,onFailureDownload:l,onSuccessUpload:d,onFailureUpload:c,titleText:p,subtitleGroup:u,subtitleField:g,uploadText:h,downloadText:m,defaultTab:y,ItemSidecarDownloadComponent:I,ItemSidecarDownloadProps:T,ItemSidecarUploadComponent:b,ItemSidecarUploadProps:M}){const[L,S]=C.useState(y),w=(A,v)=>v&&S(v);return t.jsxs("div",{className:x(a.root,"VdtItemSidecarDialog-root",n),children:[t.jsx(r.DialogTitle,{className:a.DialogTitle,children:p}),t.jsxs(r.DialogContent,{className:a.DialogContent,children:[t.jsxs(r.Tabs,{value:L,onChange:w,variant:"fullWidth",textColor:"primary",indicatorColor:"primary",className:a.Tabs,children:[I&&t.jsx(r.Tab,{className:a.Tab,value:Xr,label:m}),b&&t.jsx(r.Tab,{className:a.Tab,value:Yp,label:h})]}),{ITEM_SIDECAR_DOWNLOAD_TAB:I?t.jsx(I,{className:a.ItemSidecarDownload,onSuccess:(...A)=>{s&&s(),i&&i(...A)},onFailure:l,subtitleGroup:u,subtitleField:g,onClose:s,itemId:o,...T}):null,ITEM_SIDECAR_UPLOAD_TAB:b?t.jsx(b,{itemId:o,className:a.ItemSidecarUpload,onSuccess:(...A)=>{s&&s(),d&&d(...A)},onFailure:c,...M}):null}[L]]})]})}Kr.propTypes={classes:e.objectOf(e.string),className:e.string,itemId:e.string.isRequired,onClose:e.func,onSuccessDownload:e.func,onFailureDownload:e.func,onSuccessUpload:e.func,onFailureUpload:e.func,closeText:e.string,titleText:e.string,subtitleGroup:e.string,subtitleField:e.string,uploadText:e.string,downloadText:e.string,defaultTab:e.oneOf([Yp,Xr]),ItemSidecarDownloadComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ItemSidecarDownloadProps:e.objectOf(e.any),ItemSidecarUploadComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ItemSidecarUploadProps:e.objectOf(e.any)},Kr.defaultProps={classes:{},className:void 0,onClose:void 0,onSuccessDownload:void 0,onFailureDownload:void 0,onSuccessUpload:void 0,onFailureUpload:void 0,closeText:"Close",titleText:"Item Sidecar",subtitleGroup:"stl_subtitle",subtitleField:"stl_text",uploadText:"Upload",downloadText:"Download",defaultTab:Xr,ItemSidecarDownloadComponent:Gp,ItemSidecarDownloadProps:{},ItemSidecarUploadComponent:$p,ItemSidecarUploadProps:{}};const Wp=r.withStyles(gM,{name:"VdtItemSidecarDialog"})(Kr);Wp.displayName="ItemSidecarDialog";const hM=()=>({root:{}});function yM(a,n){window.open(`mailto:${a}?subject=Vidispine media access link&body=${n}`)}function mM(a,n){return Promise.resolve(Q.file.createFileTemporaryCredentials({fileId:a,queryParams:{methodMetadata:[{key:"format",value:"SIGNED-AUTO"}],"noauth-url":!0,duration:n}}))}function Rr({className:a,classes:n,open:o,itemId:s,item:i,queryParams:l,title:d,closeButtonText:c,generateLinkText:p,emailShareText:u,onClose:g,onError:h,DialogProps:m,onSendEmail:y,onShareFile:I}){const[T,b]=C.useState(""),[M,L]=C.useState([]),[S,w]=C.useState(""),[A,v]=C.useState({}),[O,E]=C.useState(i),[D,F]=C.useState(""),[z,B]=C.useState(15);C.useEffect(()=>{O||Q.item.getItem({itemId:s,queryParams:l}).then(({data:q})=>{E(q)}).catch(q=>h({message:"Could not retrieve item to share",error:q}))},[O,h,s,l]);const $=C.useMemo(()=>!O||!O.shape?[]:O.shape.map(q=>{const{tag:G,videoCodec:R,height:ae,frameRate:te,fileId:re}=X.parseShapeType(q);return{label:`${G} (${R}, ${ae}, ${te})`,value:q.id,file:re}}),[O]),Y={name:"shape",value:T,onChange:({target:{value:q}={}})=>{b(q)}},P={name:"duration",value:z,onChange:({target:{value:q}={}})=>{B(q)}},V={name:"email",value:S,onChange:({target:{value:q}={}})=>w(q)},W=()=>{b(""),F(""),L([]),g()},_=q=>{L(G=>G.filter(R=>R!==q))},H=q=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(q),k=q=>{if(!H(q)){v({error:"Please enter a valid email address",touched:!0});return}if(M.includes(q)){v({error:"Email already added",touched:!0});return}L(G=>[...G,q]),w(""),v({})},U=[{label:"15",value:15},{label:"60",value:60},{label:"720",value:720}],K=()=>{const{file:q}=$.find(({value:G})=>G===T);if(q)try{I(q,z).then(G=>F(G.data.uri[0])).catch(G=>h({message:"Could not share item",error:G}))}catch(G){h({message:"Could not share item",error:G})}else h({message:"Item is not shareable"})},Z=()=>{const q=M.map(R=>R),G=encodeURIComponent(D);y(q.toString(),G),W()},J=()=>{document.getElementById("url").select(),document.execCommand("copy")};return t.jsxs(r.Dialog,{maxWidth:"sm",fullWidth:!0,open:o,onClose:g,"aria-labelledby":"share-dialog",className:x(n.root,"VdtItemFileShareDialog-root",a),...m,children:[t.jsx(r.DialogTitle,{disableTypography:!0,className:x(n.title,"VdtItemFileShareDialog-title"),children:t.jsx(r.Typography,{variant:"h6",children:d})}),t.jsxs(r.DialogContent,{dividers:!0,className:x(n.content,"VdtItemFileShareDialog-content"),children:[t.jsx(Ve,{input:Y,options:$,FormControlProps:{disabled:!$.length},label:"Shape",required:!0,meta:$.length?void 0:{error:"No shapes detected",touched:!0}}),t.jsx(Ve,{input:P,options:U,label:"Expire duration (minutes)",required:!0}),t.jsxs(r.Grid,{container:!0,spacing:0,alignItems:"center",direction:"row",children:[t.jsx(r.Grid,{item:!0,xs:9,children:t.jsx(we,{id:"url",label:"URL",value:D,InputProps:{readOnly:!0},variant:"filled",fullWidth:!0,margin:"none"})}),t.jsx(r.Grid,{item:!0,xs:3,style:{textAlign:"right"},children:t.jsx(r.Button,{color:"primary",disabled:D==="",onClick:J,children:"Copy to clipboard"})})]}),t.jsx(r.Grid,{container:!0,spacing:0,alignItems:"center",direction:"row",children:D!==""&&t.jsxs(t.Fragment,{children:[t.jsx(r.Grid,{item:!0,xs:9,children:t.jsx(we,{input:V,onKeyDown:({key:q})=>{q==="Enter"&&k(S)},margin:"none",id:"email",label:"Email Address",type:"email",meta:A,required:!0,fullWidth:!0})}),t.jsx(r.Grid,{item:!0,xs:3,style:{textAlign:"right"},children:t.jsx(r.Button,{onClick:()=>k(S),color:"primary",children:"Add Recipient"})})]})}),M.length>0&&M.map(q=>t.jsx(r.Chip,{className:n.root,label:q,onDelete:()=>_(q)},q))]}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:g,children:c}),t.jsx(r.Button,{onClick:K,disabled:!T,color:"primary",children:p}),M.length>0&&t.jsx(r.Button,{onClick:Z,color:"primary",children:u})]})]})}const fM=r.withStyles(hM,"VdtItemFileShareDialog")(Rr);Rr.propTypes={className:e.string,classes:e.objectOf(e.any),open:e.bool,itemId:e.string,item:e.objectOf(e.any),queryParams:e.objectOf(e.any),title:e.string,closeButtonText:e.string,generateLinkText:e.string,emailShareText:e.string,onClose:e.func,onSuccess:e.func,onError:e.func,DialogProps:e.objectOf(e.any),onSendEmail:e.func,onShareFile:e.func},Rr.defaultProps={className:"VdtItemFileShareDialog",classes:{},open:!1,itemId:void 0,item:void 0,queryParams:{field:["created","title","mimeType","durationSeconds","itemId","collectionId"],content:["metadata","thumbnail","shape"],"noauth-url":!0},title:"Share file",closeButtonText:"Cancel",generateLinkText:"Generate link",emailShareText:"Send email",onClose:()=>null,onSuccess:()=>null,onError:({message:a,error:n})=>console.error(`${a}
8
- ${n}`),DialogProps:{},onSendEmail:yM,onShareFile:mM};const CM=()=>({root:{width:"100%",overflowX:"auto",display:"grid"},table:{maxWidth:"100%"}});function TM({classes:a,className:n,itemId:o,groups:s=[],isEditing:i,onRefresh:l,onSuccess:d,onError:c,editJoinValue:p,formatValue:u,rowsPerPageOptions:g=[5,10,25],...h}){const[m,y]=C.useState([]),[I,T]=C.useState(0),[b,M]=C.useState(5),{tableColumns:L,onChange:S,onSubmit:w}=ne.useCompoundMetadata(o,h,s,m,y,l,d,c),A=(B,$)=>{T($)},v=B=>{M(B.target.value),T(0)},O=(B,$)=>`${B}_${Math.random()}_${$}`,[E,D]=C.useState(""),[F,z]=C.useState([]);return t.jsxs(t.Fragment,{children:[s&&s.map((B,$)=>t.jsxs(r.Paper,{className:a.root,children:[t.jsx(r.TableContainer,{className:a.table,children:t.jsxs(r.Table,{size:"medium",children:[t.jsx(r.TableHead,{children:t.jsx(r.TableRow,{children:L.map(Y=>t.jsx(r.TableCell,{children:Y.name},Y.name))})}),t.jsx(r.TableBody,{children:m&&m.slice(I*b,I*b+b).map((Y,P)=>t.jsx(r.TableRow,{children:L.map((V,W)=>t.jsx(r.TableCell,{children:i?t.jsx(r.TextField,{autoFocus:E===V.name+P,id:O(V.name,W),value:Y[V.name],name:V.name,onClick:()=>{D(V.name+P)},onChange:_=>{D(V.name+P),z([...F,P]),S(_,Y,P,V.name,$,W,I*b+W)}}):Y[V.name]},O(V.name,W)))},O(Y.name,P)))})]})}),m&&t.jsx(r.TablePagination,{rowsPerPageOptions:g,component:"div",count:m.length,rowsPerPage:b,page:I,onPageChange:A,onRowsPerPageChange:v})]},O(B.name,$))),i&&t.jsx(r.Box,{m:2,children:t.jsx(r.Button,{fullWidth:!0,variant:"outlined",onClick:()=>w(m,F),color:"primary",children:"Save"})})]})}const _p=r.withStyles(CM,{name:"VdtItemCompoundMetadataTable"})(TM);function bM({itemId:a,groups:n,editingLabel:o=c=>c?"Cancel":"Edit",showEditMetadata:s=!0,onError:i,useContentPaths:l=!1,formatValue:d}){const c=C.useMemo(()=>l?{p:[n?n.map(y=>y.name).map(y=>`metadata.timespan.group[name=${y}]`).join(","):void 0].join(",")}:{group:n?n.map(({name:m})=>m):[],content:"metadata"},[n,l]),[p,u]=C.useState(!1),g=()=>u(!p),{groupsWithAttributes:h}=ne.useAddMetadataFieldAttributes({groups:n});return t.jsxs(t.Fragment,{children:[s&&t.jsx(r.Box,{display:"flex",justifyContent:"flex-end",children:t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{checked:p,onChange:g}),label:o(p),labelPlacement:"start"})}),h.length>0&&t.jsx(ne.GetItem,{itemId:a,queryParams:c,children:t.jsx(ne.MetadataType,{joinValue:", ",children:t.jsx(_p,{itemId:a,groups:h,formatValue:d,isEditing:p,onSuccess:g,onError:i})})})]})}const IM=r.withStyles({},{name:"VdtItemCompoundMetadataTab"})(bM),MM=["audio/mp4","audio/mpeg","audio/x-aac","audio/aac","audio/x-wav","audio/wav","audio/accp","audio/ogg","audio/webm","audio/x-flac"],LM=a=>({root:{"& .video-js":{backgroundColor:"rgba(0, 0, 0, 0.2)"},"& .video-js.vjs-has-started.vjs-user-inactive.vjs-playing:not(.controls-below-player) .vjs-control-bar":{transform:"none"},"& .video-js .vjs-play-progress.vjs-slider-bar":{backgroundColor:a.palette.secondary.main},"& .video-js .vjs-fullscreen-control":{display:"none"}}});function SM({className:a,classes:n,videoEl:o,onReady:s,width:i="100%",previewSources:l=[],audioPlayerProps:d={}}){return t.jsx(r.Box,{className:x(n.root,a),children:t.jsx(r.Box,{width:"100%",children:t.jsx(is.VideoPlayer,{controls:!0,sources:l.slice(0,1),ref:o,width:i,onReady:s,...d})})})}const wM=r.withStyles(LM,{name:"VdtItemAudioPlayer"})(SM),AM=["image/apng","image/bmp","image/gif","image/jpeg","image/x-icon","image/png","image/svg+xml"],DM=()=>({root:{width:"100%",display:"flex",justifyContent:"center"},img:{display:"block",margin:"auto",maxWidth:"100%",maxHeight:"70vh"}});function NM({classes:a,className:n,previewSource:o={}}){const{src:s}=o;return t.jsx(r.Box,{className:x(a.root,n),children:t.jsx("img",{className:a.img,src:s,alt:""})})}const Qp=r.withStyles(DM,{name:"VdtItemImagePlayer"})(NM),vM=["video/mp4"],xM=a=>({root:{"& .video-js.controls-below-player:not(.vjs-fullscreen) .vjs-control-bar .vdt-timecode:not(.vjs-menu-item-text)":{color:a.palette.text.primary},"& .video-js.controls-below-player:not(.vjs-fullscreen) .vjs-control-bar .vjs-button:not(.vjs-menu-item-text)":{color:a.palette.text.primary},"& .video-js.controls-below-player:not(.vjs-fullscreen) .vjs-control-bar .vjs-volume-level":{backgroundColor:a.palette.text.primary,color:a.palette.text.primary},"& .video-js .vjs-play-progress.vjs-slider-bar":{backgroundColor:a.palette.secondary.main}}});function OM({className:a,classes:n,itemType:o,videoEl:s,subtitleGroup:i="stl_subtitle",subtitleField:l="stl_text",subtitleLanguage:d="en",subtitleLanguageLabel:c="English",sampleRate:p="PAL",onReady:u,onCinema:g,onScreenshot:h,onScreenshotSuccess:m,onScreenshotError:y,width:I="100%",sourceTag:T="original",videoPlayerProps:b={},previewSources:M=[]}){let L=C.useRef();s&&(L=s);const{thumbnails:{uri:S=[]}={},metadata:w,id:A}=o,v=C.useMemo(()=>X.metadataTypeToWebVtt(w,{subtitleGroup:i,subtitleField:l,sampleRate:p}),[w,i,l,p]),O=C.useMemo(()=>{if(v)return[{src:new Blob([v],{type:"text/plain"}),lang:d,label:c}]},[v,d,c]),[E]=S,D=X.createTimeBase(p),F=z=>{const B=X.formatTimeCodeSeconds(z,{timeBase:D}).toText(),$="HIGHEST",Y=B,P=B;Promise.all([Q.item.createThumbnail({itemId:A,queryParams:{createThumbnails:Y,priority:$,sourceTag:T}}),Q.item.createThumbnail({itemId:A,queryParams:{createPosters:P,priority:$,sourceTag:T}})]).then(V=>{m&&m(V)}).catch(V=>{y&&y(V)})};return t.jsx(r.Box,{className:x(n.root,"VdtItemVideoPlayer-root",a),children:t.jsx(r.Box,{width:"100%",display:"flex",justifyContent:"center",children:t.jsx(r.Box,{width:"100%",children:t.jsx(is.VideoPlayer,{controls:!0,sources:M,subtitles:O,posterUrl:E,ref:L,frameRate:D.denominator/D.numerator,timecode:!0,width:I,onScreenshot:h||F,onReady:u,onCinema:g,...b})})})})}const Hp=r.withStyles(xM,{name:"VdtItemVideoPlayer"})(OM),EM=[...vM,...AM,...MM],Zp="IMAGE",eo="AUDIO",Jp="VIDEO",jM="DOCUMENT",PM="BINARY",kM=a=>a.height?a.fieldOrder?`${a.tag} (${a.height}${a.fieldOrder[0]})`:`${a.tag} (${a.height}x${a.width})`:a.audioFormat?a.containerFormat!==a.audioFormat?`${a.tag} (${a.audioFormat} - ${a.containerFormat})`:`${a.tag} (${a.audioFormat})`:a.tag,FM=a=>{const n=o=>o.split(":").reduce((s,i)=>60*s+Number(i));if(a.timeCode)return Math.floor(a.timeCode.toSeconds());if(a.duration)return n(a.duration)},zM=r.withStyles({},{name:"VdtSourceSelection"})(({value:a,onChange:n,options:o,previewSourceText:s="Preview Source"})=>{const i=o.find(l=>l.label===a.label);return t.jsxs(r.FormControl,{variant:"standard",fullWidth:!0,children:[t.jsx(r.InputLabel,{children:s}),t.jsx(r.Select,{value:i,onChange:n,children:o.map(l=>t.jsx(r.MenuItem,{value:l,children:l.label},l.src))})]})}),BM=r.withStyles({},{name:"VdtLoadingPlayer"})(a=>t.jsx(oe.Skeleton,{variant:"rect",width:"100%",height:520,...a})),qM=r.withStyles(a=>({root:{backgroundColor:a.palette.divider,width:"100%",height:520,display:"flex",justifyContent:"center",alignItems:"center"},label:{...a.typography.button}}),{name:"VdtNoPreviewPlayer"})(({className:a,classes:n,label:o="No Previews"})=>t.jsx("div",{className:x(n.root,a),children:t.jsx("div",{className:n.label,children:o})})),VM=()=>({root:{}});function GM({className:a,classes:n={},itemId:o,videoEl:s,itemType:i,isLoading:l,subtitleGroup:d="stl_subtitle",subtitleField:c="stl_text",sampleRate:p="PAL",allowedMimeTypes:u=EM,additionalMimeTypes:g=[],LoadingPlayerComponent:h=BM,NoPreviewPlayerComponent:m=qM,ItemImagePlayerComponent:y=Qp,ItemAudioPlayerComponent:I=wM,ItemVideoPlayerComponent:T=Hp,ItemBinaryPlayerComponent:b,onReady:M,onCinema:L,onScreenshot:S,width:w="100%",sourceTag:A="original",SourceSelectionComponent:v=zM,videoPlayerProps:O={},audioPlayerProps:E={},shapeToLabel:D=kM,ItemVideoPlayerProps:F={},ItemBinaryPlayerProps:z={},LoadingPlayerProps:B={},NoPreviewPlayerProps:$={},...Y}){const[P,V]=C.useState(),W=C.useMemo(()=>X.filterShapeSource(i,{allowedMimeTypes:[...u,...g]}).map(K=>({...K,label:D(K.shape)})),[i,u,g,D]),_=C.useMemo(()=>{if(P)return X.getShapeMediaType(P.shape);if(W&&W.length>0)return X.getShapeMediaType(W[0].shape)},[P,W]),H=({target:{value:U}})=>{const{src:K,shape:Z,type:J}=U;if(_===Jp||_===eo){const q=s&&s.current&&s.current.player&&s.current.player.videojs;if(!q||q.currentSrc()===K)return;const G=q.paused(),R=q.currentTime(),ae=Math.floor(q.duration()),te=FM(Z);q.preload==="none"&&(q.preload="metadata"),ae<=te+2&&ae>=te-2?(q.addClass("vjs-has-started"),q.bigPlayButton.hide(),q.poster(""),q.one("loadedmetadata",()=>{q.currentTime(R),G||q.play()})):q.one("loadeddata",()=>{q.bigPlayButton.show()}),q.pause(),q.src({src:K,type:J.replace("x-","")})}V(U)},k=l||_===void 0||W.length===0;return t.jsx("div",{className:x(n.root,a,"VdtItemPlayer-root"),children:k?t.jsx(t.Fragment,{children:l?t.jsx(h,{...B}):t.jsx(m,{...$})}):t.jsxs(t.Fragment,{children:[(_===Zp||_===eo||_===jM)&&t.jsxs(t.Fragment,{children:[y&&_===Zp&&t.jsx(y,{previewSource:P||W[0],videoEl:s,...Y}),I&&_===eo&&t.jsx(I,{videoEl:s,onReady:M,width:w,sourceTag:A,previewSources:W,audioPlayerProps:E}),v&&W.length>1&&t.jsx(v,{options:W,value:P||W[0],onChange:H})]}),b&&_===PM&&t.jsx(b,{itemId:o,itemType:i,source:P||(W==null?void 0:W[0]),sourceTag:A,previewSources:W,...z}),T&&_===Jp&&t.jsx(T,{videoEl:s,itemType:i,subtitleGroup:d,subtitleField:c,sampleRate:p,onReady:M,onCinema:L,onScreenshot:S,width:w,sourceTag:A,previewSources:W,videoPlayerProps:O,...F})]})})}const Xp=r.withStyles(VM,{name:"VdtItemPlayer"})(GM);Xp.displayName="ItemPlayer";const UM={root:{"& > *":{marginTop:"20px",width:"100%"}},rootNoMargin:{"& > *":{marginTop:"0px",width:"100%",lineHeight:"40px"}},editorContainer:{padding:"24px"},editorTitle:{float:"left",width:"90%"},closeEditor:{float:"right",padding:"4px"},deleteField:{marginLeft:"8px"}},$M=[{value:"date",label:"Date"},{value:"float",label:"Float"},{value:"integer",label:"Integer"},{value:"long",label:"Long"},{value:"string",label:"String"},{value:"string-exact",label:"String Exact"},{value:"boolean",label:"Boolean"},{value:"timeCode",label:"Time-Code"}],Kp={string:[{value:"text",label:"Text"},{value:"select",label:"Select"},{value:"textArea",label:"Text area"}],boolean:[{value:"checkbox",label:"Checkbox"},{value:"switch",label:"Switch"}]},YM=["select"];function WM({classes:a,item:n,onClose:o,onDelete:s,onEdit:i,isNewItem:l,autoAdd:d=!1}){const c={name:"",data:[{key:"displayType",value:"text"},{key:"label",value:""}],type:"string",values:{field:[]}},[p,u]=C.useState(c),[g,h]=C.useState(!1),[m,y]=C.useState(""),[I,T]=C.useState(p.name),[b,M]=C.useState(p.type),[L,S]=C.useState([]),[w,A]=C.useState({key:"",value:""});C.useEffect(()=>u(n),[n]);const v=()=>{const _={...p};_.data=[],p.type==="boolean"?(_.data.push({key:"displayType",value:"checkbox"}),y("checkbox")):["date","timecode"].includes(p.type)?(_.data.push({key:"displayType",value:"datePicker"}),y("datePicker")):(_.data.push({key:"displayType",value:"text"}),_.data.push({key:"label",value:""}),y("text")),u(_)};C.useEffect(()=>{if(typeof p.data>"u")v();else{const{value:_}=p.data.find(k=>k.key==="label")||{},{value:H}=p.data.find(k=>k.key==="displayType")||{};T(_),y(H)}if(!l)if(typeof p.values.field>"u"){const _={...p};_.values={field:[]},u(_)}else S(p.values.field)},[p]);const O=_=>{const{value:H,name:k}=_.target,U={[k]:H},K={...p,...U};u(K)},E=_=>{const{value:H}=_.target;M(H),S([]);const k={...p};k.type=H,u(k)},D=_=>{const{value:H}=_.target;T(H);const k={...p},U=k.data.findIndex(K=>K.key==="label");U>-1?k.data[U].value=H:k.data.push({key:"label",value:H}),u(k)},F=_=>{const{value:H}=_.target;y(H);const k={...p},U=k.data.findIndex(K=>K.key==="displayType");U>-1?k.data[U].value=H:k.data.push({key:"displayType",value:H}),u(k)},z=_=>{A({...w,[_.target.name]:_.target.value})},B=_=>{const H={...p};typeof H.values.field>"u"&&(H.values={field:[]}),H.values.field.unshift(_),u(H),A({key:"",value:""}),S(H.values.field)},$=_=>{const H=L,k=_;H.splice(k,1),S(H);const U={...p};U.values.field=H,u(U)},Y=()=>{h(!0)},P=()=>{h(!1)},V=()=>{i(n,p),o()},W=()=>{u(c),P(),o(),s(n)};return t.jsxs("div",{className:a.editorContainer,children:[t.jsxs(r.Grid,{container:!0,spacing:2,children:[t.jsxs(r.Grid,{item:!0,xs:12,children:[t.jsx(r.Typography,{variant:"h6",align:"center",className:a.editorTitle,children:`Editor - ${p.name}`}),t.jsx(r.IconButton,{className:a.closeEditor,onClick:o,children:t.jsx(j.Clear,{})})]}),t.jsxs(r.FormControl,{className:a.root,autoComplete:"off",fullWidth:!0,children:[l&&t.jsxs(t.Fragment,{children:[t.jsx(r.TextField,{name:"name",label:"Name",value:p.name,onChange:O,disabled:!l}),t.jsx(r.Select,{name:"type",label:"Type",value:b,onChange:E,children:$M.map(_=>t.jsx(r.MenuItem,{value:_.value,children:_.label},_.value))})]}),t.jsx(r.TextField,{name:"label",label:"Label",value:I,onChange:D})]}),Object.keys(Kp).includes(p.type)&&t.jsxs(r.FormControl,{className:a.rootNoMargin,autoComplete:"off",fullWidth:!0,children:[t.jsx(r.InputLabel,{id:"displayType",children:"Select display type"}),t.jsx(r.Select,{labelId:"displayType",value:m,onChange:F,children:Kp[p.type].map(_=>t.jsx(r.MenuItem,{value:_.value,children:_.label},_.value))})]}),YM.includes(m)&&t.jsxs(t.Fragment,{children:[t.jsx(r.FormControl,{className:a.root,autoComplete:"off",fullWidth:!0,children:t.jsxs(r.Grid,{container:!0,spacing:2,children:[t.jsx(r.Grid,{item:!0,xs:d?6:5,children:t.jsx(r.TextField,{name:"key",label:"Add option label",value:w.key,onChange:z,fullWidth:!0})}),t.jsx(r.Grid,{item:!0,xs:d?6:5,children:t.jsx(r.TextField,{id:"optionValue",name:"value",label:"Add option value",value:w.value,onChange:z,fullWidth:!0})}),!d&&t.jsx(r.Grid,{item:!0,xs:2,style:{display:"flex",alignItems:"center"},children:t.jsx(r.Button,{onClick:()=>B(w),variant:"outlined",color:"primary",children:"Add option"})})]})}),t.jsx(r.Grid,{container:!0,spacing:2,children:t.jsx(r.Grid,{item:!0,xs:12,children:t.jsx(r.List,{children:L.map((_,H)=>t.jsxs(r.ListItem,{children:[t.jsx(r.ListItemText,{primary:`Label:${_.key}`,secondary:`Value:${_.value}`}),t.jsx(r.ListItemSecondaryAction,{children:t.jsx(r.IconButton,{edge:"end","aria-label":"delete",onClick:()=>$(H),children:t.jsx(j.Delete,{})})})]},_.key))})})})]}),t.jsx(r.Grid,{container:!0,spacing:2,children:t.jsx(r.Grid,{item:!0,xs:12,children:t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:Y,color:"secondary",children:"Delete"}),!1,t.jsx(r.Button,{onClick:V,variant:"contained",color:"primary",children:"Update"})]})})})]}),t.jsxs(r.Dialog,{open:g,onClose:P,children:[t.jsx(r.DialogTitle,{id:"alert-dialog-title",children:"Delete Field?"}),t.jsx(r.DialogContent,{children:t.jsx(r.DialogContentText,{children:`Are you sure that you want to delete ${n.name}`})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:P,color:"primary",children:"Cancel"}),t.jsx(r.Button,{variant:"contained",onClick:W,color:"secondary",children:"Delete"})]})]})]})}const _M=r.withStyles(UM,{name:"VdtFieldGroupEditor"})(WM),QM={iconContainer:{width:"40px",height:"40px",backgroundColor:"rgba(0, 0, 0, 0.10)",float:"left"},iconStyle:{marginTop:8,marginLeft:8}},HM={date:j.Today,float:j.FormatListNumbered,integer:j.LooksOne,long:j.Filter9Plus,string:j.TextFields,"string-exact":j.Assignment,boolean:j.ThumbsUpDown,timeCode:j.Schedule};function ZM({fieldType:a,classes:n,icons:o=HM}){const{[a]:s=null}=o;return t.jsx("div",{className:n.iconContainer,children:t.jsx(s,{className:n.iconStyle})})}const Rp=r.withStyles(QM,{name:"VdtFieldGroupIcon"})(ZM),JM=a=>({fieldTitle:{lineHeight:"40px",marginLeft:10,width:"30%"},fieldInfo:{lineHeight:"40px",marginLeft:10,width:"60%"},item:{backgroundColor:a.palette.background.paper,boxSizing:"border-box",fontSize:"14px",userSelect:"none",display:"flex",justifyContent:"left",alignItems:"center",height:"40px"},activeItem:{backgroundColor:r.emphasize(a.palette.background.paper,.1),boxSizing:"border-box",fontSize:"14px",userSelect:"none",display:"flex",justifyContent:"left",alignItems:"center",height:"40px"},delete:{marginLeft:"auto"},edit:{marginLeft:""}});function XM({draggableStyle:a,virtualStyle:n,isDragging:o}){const s={...n,...a},i=8;return{...s,height:40,width:o?a.width:`calc(${s.width} - ${i*2}px)`,marginBottom:i}}const KM="-",RM="-";function eL({classes:a,provided:n,item:o,style:s,isDragging:i,setSelectedItem:l=()=>null,openEditor:d,openDeleteDialog:c}){const{name:p,data:u=[],type:g}=o,{value:h}=u.find(M=>M.key==="label")||{},m=h||KM,{value:y}=u.find(M=>M.key==="displayType")||{},I=y||RM,T=()=>{l(p),d()},b=M=>{M.stopPropagation(),l(p),c()};return t.jsxs(r.Card,{...n.draggableProps,...n.dragHandleProps,ref:n.innerRef,style:XM({draggableStyle:n.draggableProps.style,virtualStyle:s,isDragging:i}),className:a.item,onClick:T,children:[t.jsx(Rp,{fieldType:g}),t.jsx("span",{className:a.fieldTitle,children:p}),t.jsx("span",{className:a.fieldInfo,children:`Label: ${m} | Display Type: ${I}`}),t.jsx(r.IconButton,{"aria-label":"delete",className:a.edit,onClick:T,children:t.jsx(j.Edit,{fontSize:"small"})}),t.jsx(r.IconButton,{"aria-label":"delete",className:a.delete,onClick:b,children:t.jsx(j.Delete,{fontSize:"small"})})]})}const eu=r.withStyles(JM,{name:"VdtFieldGroupMyField"})(eL),tL={droppable:{height:600}};function aL({classes:a,items:n,setSelectedItem:o,droppableId:s,selectedItem:i,openEditor:l,onDelete:d,onUpdateFieldGroup:c,openDeleteDialog:p}){return t.jsx(Ht.Droppable,{droppableId:s,renderClone:(u,g,h)=>t.jsx(eu,{provided:u,isDragging:g.isDragging,item:n[h.source.index]}),children:u=>t.jsxs("div",{ref:u.innerRef,className:a.droppable,children:[n.map((g,h)=>t.jsx(Ht.Draggable,{draggableId:g.name,index:h,children:m=>t.jsx(eu,{provided:m,item:g,setSelectedItem:o,selectedItem:i,openEditor:l,onDelete:d,onUpdateGroup:c,openDeleteDialog:p})},g.name)),u.placeholder]})})}const nL=r.withStyles(tL,{name:"VdtFieldGroupMyFieldList"})(aL),{vFetch:rL,isRequired:tu}=Q.utils;function oL({groupName:a=tu(),orderedFieldIds:n=tu(),...o}){const s=`/API/metadata-field/field-group/${a}/metadata/order`;return rL({path:s,method:"PUT",headers:{contentType:"text/plain",accept:"text/plain"},body:n.join(","),...o})}const au=oe.createFilterOptions();function sL(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,a=>(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16))}const iL={data:{display:"flex",width:"100%"},margin:{margin:20},button:{width:"100%"},addNewField:{float:"right"},title:{"&:hover":{cursor:"pointer"}}},Oe="MY_FIELDS",lL={[Oe]:[]};function dL({classes:a,groupName:n,groups:o,metadataFieldGroupType:s={},onSuccess:i,onError:l,onChangeGroup:d,isLoading:c}){const[p,u]=C.useState(lL),[g,h]=C.useState(),[m,y]=C.useState(!1),[I,T]=C.useState(),[b,M]=C.useState(null),[L,S]=C.useState([]),[w,A]=C.useState([]),[v,O]=C.useState(!1),[E,D]=C.useState(!1),[F,z]=C.useState(!1),[B,$]=C.useState(!1),[Y,P]=C.useState(!1),[V,W]=C.useState(!1),_=()=>{z(!0)},H=()=>{z(!1)},k=()=>{W(!0)},U=()=>{W(!1)},K=()=>{O(!0)},Z=()=>{O(!1)},J=()=>{D(!0)},q=()=>{D(!1)},G=()=>{$(!0)},R=()=>{$(!1)},ae=()=>{P(!0)},te=()=>{P(!1)},re=ee=>{T(ee.target.value)};C.useEffect(()=>{if(!n)return;const{field:ee=[]}=s;if(s){if(typeof s.data>"u")T(n);else{const le=s.data.findIndex(be=>be.key==="label");le>-1&&T(s.data[le].value)}if(s.data){const le=s.data.find(be=>be.key==="order");if(le){const be=le.value.split(",");ee.sort((ve,ze)=>be.indexOf(ve.name)-be.indexOf(ze.name))}}s.group&&A(s.group),ee&&u({[Oe]:ee})}},[n,s]);const ce=()=>{n&&Q.fieldgroup.updateFieldGroup({groupName:n,metadataFieldGroupDocument:{...s,field:[...p[Oe]],data:[{key:"label",value:I}]}}).then(ee=>{ee.ok&&i&&i({message:`${n} has been saved`})}).catch(ee=>{if(l)l({error:ee,message:`Error saving ${n}`});else throw new Error(ee)})};C.useEffect(()=>{m&&ce()},[p]);const pe=()=>{const ee={data:[{key:"displayType",value:"text"},{key:"label",value:""}],type:"string",values:{field:[]}},le=[...p[Oe]],be={...p},[ve]=sL().split("-"),[ze]=n.split("_"),[et]=[`${ze}_meta${ve}`],dt={...ee,name:et};le.splice(0,0,dt),be[Oe]=le,u(be),h(et),_()},se=ee=>{if(!s||!ee)return!0;const{name:le}=ee,{field:be=[]}=s;return be.findIndex(({name:ze})=>ze===le)===-1},me=({source:ee,destination:le})=>{if(!le)return;const{droppableId:be,index:ve}=ee,{droppableId:ze,index:et}=le,dt=[...p[ze]],Lt={...p};if(be===ze){const[tt]=dt.splice(ve,1);dt.splice(et,0,tt),Lt[ze]=dt}u(Lt);const ts=Lt[Oe].map(tt=>tt.name);oL({groupName:n,orderedFieldIds:ts}).then(tt=>{tt.ok&&i&&i({message:`${n} has been saved`})}).catch(tt=>{if(l)l({message:`Error saving ${n}`,error:tt});else throw new Error(tt)})},qe=ee=>(le,be)=>{const{name:ve}=le,{name:ze}=be,et=[...p[ee]],dt=et.findIndex(({name:ts})=>ts===ve);et.splice(dt,1,be);const Lt={...p};Lt[ee]=et,u(Lt),y(!0),h(ze)},it=p[Oe],[je,lt]=C.useState({});C.useEffect(()=>{lt(it.find(({name:ee})=>ee===g))},[g]);const fe=()=>{const ee=[...p[Oe]],le=ee.findIndex(ve=>ve.name===g);ee.splice(le,1);const be={...p};be[Oe]=ee,s&&Q.fieldgroup.removeFieldGroupField({groupName:n,fieldName:g}).then(ve=>{ve.ok&&i&&i({message:`${g} has been deleted`})}).catch(ve=>{if(l)l({message:`Error deleting ${g}`,error:ve});else throw new Error(ve)}),u(be),y(!0)},Te=()=>{Q.metadatafield.listMetadataField().then(ee=>{S(ee.data.field)})};function ge(){const ee=[...p[Oe]],le={...p};ee.splice(0,0,b),le[Oe]=ee,u(le),y(!0)}const[ke,Re]=C.useState("");function Fe(ee){Re(ee)}const[Ro,Ce]=C.useState(null),es=()=>{try{Q.fieldgroup.updateFieldGroupChild({groupName:n,childGroupName:ke}).then(ee=>{ee.ok&&i&&i({message:`${ke} has been added to ${n}`})}).catch(ee=>{if(l)l({message:`Error adding ${ke}to ${n}`,error:ee});else throw new Error(ee)})}catch(ee){if(l)l({message:`Error adding ${ke}to ${n}`,error:ee});else throw new Error(ee)}},wa=ee=>{ee.stopPropagation(),K()};return t.jsxs(t.Fragment,{children:[!c&&t.jsxs(r.Grid,{container:!0,spacing:2,children:[t.jsx(r.Grid,{item:!0,xs:8,children:t.jsxs(r.Typography,{variant:"h5",className:a.title,children:[`Field-group: ${I}`,t.jsx(r.IconButton,{"aria-label":"edit label",onClick:wa,children:t.jsx(j.Edit,{fontSize:"small"})})]})}),t.jsxs(r.Grid,{item:!0,xs:4,children:[t.jsx(r.Button,{variant:"contained",color:"default",style:{marginLeft:"10px"},className:a.addNewField,onClick:ae,children:"Child groups"}),t.jsx(r.Button,{variant:"contained",color:"primary",onClick:pe,style:{marginLeft:"10px"},className:a.addNewField,children:"Add new field"}),t.jsx(r.Button,{variant:"outlined",color:"default",onClick:()=>{J(),Te()},className:a.addNewField,children:"Add existing field"})]})]}),t.jsx(Ht.DragDropContext,{onDragEnd:me,children:t.jsx(r.Grid,{container:!0,spacing:2,children:t.jsx("div",{className:a.data,children:t.jsx(r.Grid,{item:!0,xs:12,className:a.margin,children:t.jsx(nL,{items:it,setSelectedItem:h,selectedItem:g,droppableId:Oe,openEditor:_,closeEditor:H,onDelete:fe,onUpdateGroup:ce,openDeleteDialog:G})})})})}),t.jsx(r.Dialog,{onClose:H,open:F,maxWidth:"md",fullWidth:!0,children:t.jsx(_M,{item:je,isNewItem:se(je),onClose:H,onEdit:qe(Oe),onDelete:fe,onUpdateGroup:ce})}),t.jsxs(r.Dialog,{onClose:Z,open:v,maxWidth:"sm",fullWidth:!0,children:[t.jsx(r.DialogTitle,{children:"Edit group label"}),t.jsx(r.DialogContent,{children:t.jsx(r.TextField,{name:"label",label:"Label",value:I,onChange:re,fullWidth:!0})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:Z,color:"primary",children:"Cancel"}),t.jsx(r.Button,{onClick:()=>{ce(),Z()},color:"primary",autoFocus:!0,children:"Save"})]})]}),t.jsxs(r.Dialog,{onClose:q,open:E,maxWidth:"sm",fullWidth:!0,children:[t.jsx(r.DialogTitle,{children:"Choose existing field to add"}),t.jsx(r.DialogContent,{children:t.jsx(oe.Autocomplete,{options:L,value:b,onChange:(ee,le)=>{if(le&&le.inputValue){M({name:le.inputValue});return}M(le)},filterOptions:(ee,le)=>au(ee,le),getOptionLabel:ee=>typeof ee=="string"?ee:ee.inputValue?(M(ee),ee.inputValue):ee.name,renderOption:ee=>ee.name,renderInput:ee=>t.jsx(r.TextField,{...ee,label:"Select field",variant:"outlined"})})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:q,color:"primary",children:"Cancel"}),t.jsx(r.Button,{onClick:()=>{q(),ge()},color:"primary",autoFocus:!0,children:"Add"})]})]}),t.jsxs(r.Dialog,{open:B,onClose:R,maxWidth:"sm",fullWidth:!0,children:[t.jsx(r.DialogTitle,{children:"Delete Field?"}),t.jsx(r.DialogContent,{children:t.jsx(r.DialogContentText,{children:`Are you sure that you want to delete ${g}`})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:R,color:"primary",children:"Cancel"}),t.jsx(r.Button,{variant:"contained",onClick:()=>{R(),fe()},color:"secondary",children:"Delete"})]})]}),t.jsxs(r.Dialog,{onClose:te,open:Y,maxWidth:"sm",fullWidth:!0,children:[t.jsx(r.DialogContent,{children:t.jsxs(r.Grid,{container:!0,spacing:2,children:[t.jsx(r.Grid,{item:!0,xs:8,children:t.jsx(r.Typography,{variant:"h5",className:a.title,children:"Child groups"})}),t.jsx(r.Grid,{item:!0,xs:4,children:t.jsx(r.Button,{variant:"contained",color:"primary",style:{marginLeft:"10px"},className:a.addNewField,onClick:k,children:"Add Child Group"})}),t.jsx(r.Grid,{item:!0,xs:12,children:t.jsx(r.List,{children:w.map(({name:ee})=>t.jsx(r.ListItem,{button:!0,onClick:()=>{d(ee),te()},children:t.jsx(r.ListItemText,{primary:ee})},ee))})})]})}),t.jsx(r.DialogActions,{children:t.jsx(r.Button,{onClick:te,color:"primary",children:"Close"})})]}),t.jsxs(r.Dialog,{onClose:U,open:V,maxWidth:"sm",fullWidth:!0,children:[t.jsx(r.DialogTitle,{children:"Choose child group to add"}),t.jsx(r.DialogContent,{children:t.jsx(oe.Autocomplete,{options:o,value:Ro,onChange:(ee,le)=>{if(le&&le.inputValue){Ce({name:le.inputValue});return}Ce(le),le&&Fe(le.name)},filterOptions:(ee,le)=>au(ee,le),getOptionLabel:ee=>typeof ee=="string"?ee:ee.inputValue?(Fe(ee.inputValue),ee.inputValue):ee.name,renderOption:ee=>ee.name,renderInput:ee=>t.jsx(r.TextField,{...ee,label:"Select group",variant:"outlined"})})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:U,color:"primary",children:"Cancel"}),t.jsx(r.Button,{onClick:()=>{U(),es()},color:"primary",autoFocus:!0,children:"Add"})]})]})]})}const cL=r.withStyles(iL,{name:"VdtFieldGroupDesigner"})(dL),pL=a=>({label:{fontWeight:"inherit",color:"inherit"},labelRoot:{display:"flex",alignItems:"center"},labelIcon:{marginRight:a.spacing(1)},labelText:{fontWeight:"inherit",flexGrow:1}});function uL({classes:a,LabelIcon:n=j.InsertDriveFileOutlined,fileType:o,TypographyCaptionProps:s={},TypographyBodyProps:i={},LabelIconProps:l={}}){const{fileSize:d,fileName:c}=X.parseFileType(o);return t.jsxs("div",{className:a.labelRoot,children:[t.jsx(n,{color:"inherit",className:a.labelIcon,...l}),t.jsx(r.Typography,{variant:"body2",className:a.labelText,...i,children:c}),t.jsx(r.Typography,{variant:"caption",...s,children:d})]})}const nu=r.withStyles(pL,{name:"VdtFolderTreeLabel"})(uL),ru="STORAGE",ou="FILE",su="PREFIX",to="LOAD_MORE",$t="_",iu=({storageId:a,path:n="/",number:o=10})=>{const[s,i]=C.useState([]),{file:l=[],hits:d}=s,c=l.length;return C.useEffect(()=>{Q.file.listFileStorage({storageId:a,queryParams:{prefix:!0,path:n,recursive:!1,first:0,number:o}}).then(({data:u})=>i(u))},[n,a,o]),{onListFilesMore:C.useCallback(()=>{c!==d&&Q.file.listFileStorage({storageId:a,queryParams:{prefix:!0,path:n,recursive:!1,first:c,number:o}}).then(({data:{file:u=[],...g}={}})=>{i(({file:h=[]})=>({...g,file:[...h,...u]}))})},[c,d,n,a,o]),fileListType:s}},gL={};function hL({className:a="VdtFile",styles:n,fileType:o,storageId:s,LabelComponent:i=nu,LabelProps:l={}}){const{id:d}=o;return t.jsx(oe.TreeItem,{nodeId:[ou,d,s].join($t),label:t.jsx(i,{fileType:o,...l}),className:a,styles:n})}const lu=r.withStyles(gL,{name:"VdtFileTree"})(hL),yL=a=>({label:{fontWeight:"inherit",color:"inherit"},labelRoot:{display:"flex",alignItems:"center"},labelIcon:{marginRight:a.spacing(1)},labelText:{fontWeight:"inherit",flexGrow:1}});function mL({classes:a,label:n,LabelIcon:o=j.FolderOpenOutlined,TypographyBodyProps:s={},LabelIconProps:i={}}){return t.jsxs("div",{className:a.labelRoot,children:[t.jsx(o,{color:"inherit",className:a.labelIcon,...i}),t.jsx(r.Typography,{variant:"body2",className:a.labelText,...s,children:n})]})}const du=r.withStyles(yL,{name:"VdtFolderTreeLabel"})(mL),fL={};function cu({className:a="VdtFolderTree",styles:n,path:o,storageId:s,fileListType:i,onListFilesMore:l,FolderComponent:d=ao,FolderProps:c={},FileComponent:p=lu,FileProps:u={},LoadMoreProps:g={},LabelComponent:h=du}){const m=o.replace(/\/$/,"").split("/").pop(),{prefixes:{prefix:y=[]}={},file:I=[],hits:T}=i;return t.jsxs(oe.TreeItem,{nodeId:[su,o,s].join($t),label:t.jsx(h,{label:m}),className:a,styles:n,children:[y.map(b=>t.jsx(d,{path:b,storageId:s,...c},b)),I.map(b=>t.jsx(p,{fileId:b.id,fileType:b,storageId:s,...u},b.id)),T!==void 0&&T>I.length&&t.jsx(oe.TreeItem,{className:"loadMore",nodeId:`${to}_${o}_${s}`,label:"Load More",onClick:l,...g})]})}const ao=r.withStyles({},{name:"VdtFolderListTree"})(({path:a,storageId:n,FolderTreeComponent:o=cu,FolderTreeProps:s={}})=>{const{fileListType:i,onListFilesMore:l}=iu({storageId:n,path:a});return t.jsx(o,{path:a,storageId:n,fileListType:i,onListFilesMore:l,...s})}),CL=r.withStyles(fL,{name:"VdtFolderTree"})(cu),TL=({entityId:a})=>{const[n,o]=C.useState(),s=()=>{Q.file.getFile({fileId:a,queryParams:{includeItem:!0}}).then(({data:i})=>o(i))};return C.useEffect(s,[a]),{fileType:n}},bL={};function IL({className:a="VdtSelectedFile",styles:n,fileId:o,fileType:s,SelectedFileActionsComponent:i=null,SelectedFileActionsProps:l={},fileText:d="File"}){const{path:c}=s,p=c.split("/").pop(),u=p.split(".").length>1?p.split(".").pop():void 0;return t.jsxs("div",{className:a,style:n,children:[t.jsx(r.Typography,{variant:"h4",children:p}),t.jsxs(r.Box,{display:"flex",flexDirection:"row",flexWrap:"nowrap",justifyContent:u?"space-between":"flex-start",alignItems:"center",children:[t.jsx(r.Typography,{variant:"h5",children:`${d} • ${o}`}),u&&t.jsx(ea,{children:u})]}),i&&t.jsx(i,{fileId:o,fileType:s,...l})]})}const pu=r.withStyles(bL,{name:"VdtSelectedFile"})(IL),ML={};function LL({entityId:a,SelectedFileComponent:n=pu,...o}){const{fileType:s}=TL({entityId:a});return s?t.jsx(n,{fileType:s,fileId:s.id,...o}):null}const uu=r.withStyles(ML,{name:"VdtSelectedFileWrapper"})(LL),SL=({entityId:a})=>{const[n,o]=C.useState(),s=()=>{Q.storage.getStorage({storageId:a}).then(({data:i})=>o(i))};return C.useEffect(s,[a]),{storageType:n}},wL={};function AL({className:a="VdtSelectedStorage",styles:n,storageId:o,storageType:s,SelectedStorageActionsComponent:i=null,SelectedStorageActionsProps:l={},storageText:d="Storage"}){const[c,p]=C.useMemo(()=>{const{method:u=[]}=s,[g]=u;if(g&&g.uri){const{uri:h}=g,m=new URL(h),{pathname:y}=m;let{protocol:I}=m,T=y.split("@").pop();return T.endsWith("/")&&(T=T.slice(0,-1)),I.endsWith(":")&&(I=I.slice(0,-1)),[I,T]}return[]},[s]);return t.jsxs("div",{className:a,style:n,children:[t.jsx(r.Typography,{variant:"h4",children:p||""}),t.jsxs(r.Box,{display:"flex",flexDirection:"row",flexWrap:"nowrap",justifyContent:"space-between",alignItems:"center",children:[t.jsx(r.Typography,{variant:"h5",children:`${d} • ${o}`}),t.jsx(ea,{children:c})]}),i&&t.jsx(i,{storageId:o,storageType:s,...l})]})}const gu=r.withStyles(wL,{name:"VdtSelectedStorage"})(AL),DL={};function NL({entityId:a,SelectedStorageComponent:n=gu,...o}){const{storageType:s}=SL({entityId:a});return s?t.jsx(n,{storageType:s,storageId:s.id,...o}):null}const hu=r.withStyles(DL,{name:"VdtSelectedStorageWrapper"})(NL),vL={};function xL({selected:a="",SelectedEntities:n={[ru]:hu,[ou]:uu},...o}){const[s,i]=a.split($t),l=n[s];return l?t.jsx(l,{entityId:i,...o}):null}const OL=r.withStyles(vL,{name:"VdtSelectedEntityWrapper"})(xL),EL={};function jL({className:a="VdtStorageTree",styles:n,storageType:o,storageId:s,fileListType:i,onListFilesMore:l,FolderComponent:d=ao,FolderProps:c={},FileComponent:p=lu,FileProps:u={},LoadMoreProps:g={},storageText:h="Storage",loadMoreText:m="Load more"}){const y=C.useMemo(()=>{const{method:M=[]}=o,[L]=M;if(L&&L.uri){const{uri:S}=L,w=new URL(S),{pathname:A}=w;let{protocol:v}=w,O=A.split("@").pop();return O.endsWith("/")&&(O=O.slice(0,-1)),v.endsWith(":")&&(v=v.slice(0,-1)),`${v} ${O}`}return`${h} ${s}`},[o,s]),{prefixes:{prefix:I=[]}={},file:T=[],hits:b}=i;return t.jsxs(oe.TreeItem,{nodeId:[ru,s].join($t),label:y,className:a,styles:n,children:[I.map(M=>t.jsx(d,{path:M,storageId:s,...c},M)),T.map(M=>t.jsx(p,{fileId:M.id,fileType:M,storageId:s,...u},M.id)),b!==void 0&&b>T.length&&t.jsx(oe.TreeItem,{className:"loadMore",nodeId:[to,s].join($t),label:m,onClick:l,...g})]})}const yu=r.withStyles(EL,{name:"VdtStorageTree"})(jL),PL={};function kL({storageId:a,storageType:n,StorageTreeComponent:o=yu,StorageTreeProps:s={}}){const{onListFilesMore:i,fileListType:l}=iu({storageId:a});return t.jsx(o,{onListFilesMore:i,fileListType:l,storageId:a,storageType:n,...s})}const mu=r.withStyles(PL,{name:"VdtStorage"})(kL),FL=()=>{const[a,n]=C.useState({}),o=()=>{Q.storage.listStorage().then(({data:s})=>n(s))};return C.useEffect(o,[]),{storageListType:a}},zL={};function BL({StorageComponent:a=mu,StorageProps:n={}}){const{storageListType:o}=FL(),{storage:s=[]}=o;return s.length===0?null:s.map(i=>t.jsx(a,{storageId:i.id,storageType:i,...n},i.id))}const fu=r.withStyles(zL,{name:"VdtStorageList"})(BL),qL=({onChange:a,initialExpanded:n=[]})=>{const[o,s]=C.useState(n),i=C.useCallback((d,c)=>{typeof c=="string"&&(c.startsWith(su)||c.startsWith(to))||a&&a(c)},[a]);return{onNodeToggle:C.useCallback((d,c)=>{s(c)},[]),onNodeSelect:i,expanded:o}},VL={};function GL({className:a="VdtStorageListTree",styles:n,StorageListComponent:o=fu,StorageListProps:s={},selected:i,onChange:l=()=>null,expanded:d}){const{onNodeSelect:c,onNodeToggle:p,expanded:u}=qL({onChange:l,initialExpanded:d});return t.jsx(oe.TreeView,{className:a,defaultCollapseIcon:t.jsx(j.ExpandMore,{}),defaultExpandIcon:t.jsx(j.ChevronRight,{}),onNodeSelect:c,onNodeToggle:p,selected:i,expanded:u,styles:n,children:t.jsx(o,{...s})})}const UL=r.withStyles(VL,{name:"VdtStorageListTree"})(GL),$L=a=>({popper:{backgroundColor:a.palette.background.default,zIndex:100},focused:{backgroundColor:a.palette.action.hover}});function YL({suggestions:a=[],focused:n,onHover:o,onSelected:s,anchorEl:i,classes:l,className:d,MenuProps:c={},MenuItemProps:p={}}){return a.length>0?t.jsx(r.Popper,{anchorEl:i,open:!0,style:{width:i?i.clientWidth:null},className:x(l.popper,d),children:t.jsx(r.MenuList,{onMouseLeave:()=>o(-1),...c,children:a.map((u,g)=>t.jsx(r.MenuItem,{onMouseEnter:()=>o(g),onMouseDown:h=>s(h,u),className:x({[l.focused]:n===g}),...p,children:u},u))})}):null}const WL=r.withStyles($L,{name:"VdtSearchSuggestions"})(YL),Cu=({searchResultEntryType:a,parseMetadataOpts:n,options:o,innerProps:s})=>{const{metadata:i={}}=a.item||a.collection,l=X.parseMetadataType(i,n);return o.map(({value:d,valueComponent:c})=>{const{[d]:p}=l;return c?c({value:p,innerProps:s}):p})};function Tu({options:a=[],metadataToProps:n=Cu,parseMetadataOpts:o={joinValue:", ",flat:!0},selected:s,onCheck:i,onClick:l,...d}){const{searchResultEntryType:c}=d,p=C.useMemo(()=>n({searchResultEntryType:c,parseMetadataOpts:o,options:a,innerProps:d}),[c,a,Cu]),u=g=>{g.preventDefault(),i&&i(g,!s,d)};return t.jsxs(r.TableRow,{hover:!0,selected:s,onClick:l,style:{cursor:"pointer"},children:[i&&t.jsx(r.TableCell,{padding:"checkbox",children:t.jsx(Gt,{checked:s,handleChecked:u})}),p.map((g,h)=>t.jsx(r.Hidden,{only:a[h].hide,children:t.jsx(r.TableCell,{children:g})},a[h].value||a[h].label))]})}function _L({searchResultType:a={},RowComponent:n=Tu,options:o=[],onCheck:s,onRowClick:i,...l}){const{entry:d=[]}=a;return t.jsxs(r.Table,{size:"small",children:[t.jsx(r.TableHead,{children:t.jsxs(r.TableRow,{children:[s&&t.jsx(r.TableCell,{padding:"checkbox"}),o.map(({label:c,value:p,hide:u})=>t.jsx(r.Hidden,{only:u,children:t.jsx(r.TableCell,{children:c})},[c,p].join("_")))]})}),t.jsx(r.TableBody,{children:d&&d.map(c=>t.jsx(n,{searchResultEntryType:c,options:o,onCheck:s,onClick:()=>i(c),...l},[c.type,c.id].join("_")))})]})}const QL="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPgoJPHBhdGggZmlsbD0iIzAwMDAwMCIgZD0iTTIyLDRIMTRMMTIsMkg2QTIsMiAwIDAsMCA0LDRWMTZBMiwyIDAgMCwwIDYsMThIMjJBMiwyIDAgMCwwIDI0LDE2VjZBMiwyIDAgMCwwIDIyLDRNMiw2SDBWMTFIMFYyMEEyLDIgMCAwLDAgMiwyMkgyMFYyMEgyVjZaIiAvPgo8L3N2Zz4K";function HL(a){return t.jsx(r.SvgIcon,{component:QL,...a})}function ZL({collectionId:a,...n}){const{getEntityAccessProps:o,...s}=n,{accessControlList:i,onList:l,onRemove:d}=ne.useEntityAccess({entityId:a,entityType:"collection"});C.useEffect(()=>{l(o)},[a]);const c=p=>d(p).then(()=>l(o));return t.jsx(on,{entityType:"collection",entityId:a,accessControlList:i,onRemove:c,...s})}const JL={actionsSubmit:{width:"100%"},root:{width:"100%"}};function XL({classes:a,collectionId:n,...o}){const s=i=>Q.access.createEntityAccess({...i,queryParams:{allowDuplicate:!1}});return t.jsx(rn,{classes:a,entityType:"collection",entityId:n,onSubmit:s,initialAccessControlDocument:{user:null,permission:"READ"},PermissionPickerComponent:null,...o})}const KL=r.withStyles(JL,{name:"VdtShareSearch"})(XL),bu="SHARE_MENU",no="LISTACCESS_MENU",RL=a=>({root:{"&:hover $SubmitSearchIcon":{visibility:"visible"}},FolderIcon:{minWidth:32},SubmitSearchIcon:{visibility:"hidden"},inputDisabled:{cursor:"pointer"},disabled:{opacity:1},menuContext:{},menuExpand:{minWidth:a.breakpoints.values.sm/2},CancelEditIcon:{marginRight:a.spacing(.5),"&:hover":{color:"red"}},SubmitTitleIcon:{marginRight:a.spacing(.5),"&:hover":{color:"green"}},OptionsIcon:{marginRight:a.spacing(.5)}});function eS({classes:a,collectionType:n,onSelect:o,onAddRow:s,onExpand:i,onDelete:l,onUpdateSearchMetadata:d,disableDeletion:c,type:p,accessTranslate:u,extraMenuItems:g=[],isFolderRow:h=!1,hideSubFolderSharing:m=!1,allowDelete:y=()=>!0,allowShare:I=()=>!0,allowListAccess:T=()=>!0,allowEditTitle:b=()=>!0,ListAccessComponent:M=ZL,ListAccessProps:L={},ShareComponent:S=KL,ShareProps:w={},addFolderText:A="Add folder",addSearchText:v="Add search",editTitleText:O="Edit",shareText:E="Share",listAccessText:D="Access",deleteText:F="Delete",backText:z="Back",FolderSingleIcon:B=j.Folder,FolderMultiIcon:$=HL,QueryIcon:Y=j.Search,CreateFolderIcon:P=j.CreateNewFolderOutlined,AddNewSearch:V=j.Search,SubmitSearchIcon:W=j.YoutubeSearchedFor,ListAccessIcon:_=j.Lock,SubmitTitleIcon:H=j.Check,CancelEditIcon:k=j.Close,EditTitleIcon:U=j.Edit,ShareSearchIcon:K=j.Share,DeleteSearchIcon:Z=j.Delete,OptionsIcon:J=j.MoreVert}){const{metadata:q={}}=n,G=X.parseMetadataType(q,{joinValue:",",flat:!0}),R=C.useRef(),[ae,te]=C.useState(null),[re,ce]=C.useState(G.title||""),[pe,se]=C.useState(null),[me,qe]=C.useState(!1),it=Ce=>{Ce.stopPropagation&&Ce.stopPropagation(),se(Ce.currentTarget)},je=(Ce=()=>null,es="")=>wa=>{wa.stopPropagation&&wa.stopPropagation(),se(null),Ce(es)},lt=()=>d(X.createMetadataType({title:re})).then(()=>qe(!1)),fe=je(()=>{qe(!0),R.current.focus()}),Te=()=>{ce(G.title),qe(!1)},ge=je(l),ke=je(o),Re=je(i),Fe=Ce=>je(s,Ce),Ro=Ce=>{Ce(q),se(null)};return t.jsxs(t.Fragment,{children:[t.jsxs(r.ListItem,{disableGutters:!0,dense:!0,className:a.root,button:!0,onClick:p==="query"?ke:Re,children:[h?{folder:t.jsx(r.ListItemIcon,{className:a.FolderIcon,children:c?t.jsx($,{}):t.jsx(B,{})}),query:t.jsx(r.ListItemIcon,{className:a.FolderIcon,children:t.jsx(Y,{})})}[p]:W&&t.jsx(r.ListItemIcon,{children:t.jsx(r.IconButton,{size:"small",onClick:ke,children:t.jsx(W,{className:a.SubmitSearchIcon})})}),t.jsx(r.ListItemText,{primary:t.jsx(r.TextField,{fullWidth:!0,value:re,onChange:me?Ce=>ce(Ce.target.value):void 0,onClick:me?Ce=>Ce.stopPropagation():void 0,onKeyPress:Ce=>{Ce.key==="Enter"&&(Ce.preventDefault(),lt())},InputProps:{inputProps:{disabled:!me,ref:R,className:x(a.input,{[a.inputDisabled]:!me})},disableUnderline:!me,endAdornment:t.jsx(r.InputAdornment,{position:"end",children:me?t.jsxs(t.Fragment,{children:[t.jsx(r.ButtonBase,{size:"small",onClick:Te,children:t.jsx(k,{className:a.CancelEditIcon})}),t.jsx(r.ButtonBase,{size:"small",onClick:lt,children:t.jsx(H,{className:a.SubmitTitleIcon})})]}):[I,T,y,b].some(Ce=>Ce(G))&&t.jsx(r.ButtonBase,{size:"small",onClick:it,children:t.jsx(J,{className:a.OptionsIcon})})})}})})]}),t.jsx(r.Menu,{anchorEl:pe,open:!!pe&&ae===null,keepMounted:!0,onClose:()=>se(null),getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:t.jsxs("div",{className:a.menuContext,children:[T(G)&&p==="folder"&&t.jsxs(r.MenuItem,{dense:!0,onClick:Fe({id:G.collectionId,type:"folder"}),children:[P?t.jsx(r.ListItemIcon,{children:t.jsx(P,{})}):null,t.jsx(r.ListItemText,{primary:A})]},1),T(G)&&p==="folder"&&t.jsxs(r.MenuItem,{dense:!0,onClick:Fe({id:G.collectionId,type:"query"}),children:[V?t.jsx(r.ListItemIcon,{children:t.jsx(V,{})}):null,t.jsx(r.ListItemText,{primary:v})]},2),b(G)&&t.jsxs(r.MenuItem,{dense:!0,onClick:fe,children:[U?t.jsx(r.ListItemIcon,{children:t.jsx(U,{})}):null,t.jsx(r.ListItemText,{primary:O})]},3),T(G)&&t.jsxs(r.MenuItem,{dense:!0,onClick:()=>te(no),children:[_?t.jsx(r.ListItemIcon,{children:t.jsx(_,{})}):null,t.jsx(r.ListItemText,{primary:D})]},4),I(G)&&!m&&t.jsxs(r.MenuItem,{dense:!0,onClick:()=>te(bu),children:[K?t.jsx(r.ListItemIcon,{children:t.jsx(K,{})}):null,t.jsx(r.ListItemText,{primary:E})]},5),y(G)&&t.jsxs(r.MenuItem,{dense:!0,onClick:ge,disabled:c,children:[Z?t.jsx(r.ListItemIcon,{children:t.jsx(Z,{})}):null,t.jsx(r.ListItemText,{primary:F})]},6),g.map(Ce=>t.jsxs(r.MenuItem,{dense:!0,onClick:()=>Ro(Ce.function),children:[t.jsx(r.ListItemIcon,{children:t.jsx(Ce.icon,{})}),t.jsx(r.ListItemText,{primary:Ce.name})]},`extraMenu${Ce.id}`))]})}),t.jsx(r.Popover,{open:ae!==null,anchorEl:pe,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:()=>{te(null),se(null)},children:t.jsxs("div",{className:a.menuExpand,children:[t.jsxs(r.MenuItem,{onClick:()=>te(null),children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.ChevronLeft,{})}),t.jsx(r.ListItemText,{primary:z})]}),t.jsx(r.Divider,{}),ae===bu&&t.jsx(S,{collectionId:G.collectionId,onSuccess:()=>te(no),...w}),ae===no&&t.jsx(M,{entityAccessMenuText:F,collectionId:G.collectionId,accessTranslate:u,...L})]})})]})}const Iu=r.withStyles(RL,{name:"VdtSavedSearchRow"})(eS),tS={};function aS({searchProps:a,searchPlaceholderText:n="Find searches",onSelect:o,onDelete:s,onUpdateSearchMetadata:i,RowComponent:l=Iu,RowProps:d={},accessTranslate:c,extraMenuItems:p,...u}){return t.jsx(Ia,{searchProps:a,searchPlaceholder:n,CollectionTableComponent:({collectionListType:g,onRefresh:h})=>t.jsx(r.List,{children:g&&g.collection&&g.collection.map(m=>t.jsx(l,{collectionType:m,onSelect:()=>o({collectionId:m.id}),onDelete:()=>Promise.resolve(s({collectionId:m.id}).then(h)),onUpdateSearchMetadata:y=>Promise.resolve(i({collectionId:m.id,metadataDocument:y}).then(h)),accessTranslate:c,extraMenuItems:p,...d},m.id))}),PaginationProps:{rowsPerPageOptions:[5,10]},...u})}const nS=r.withStyles(tS,{name:"VdtSavedSearchList"})(aS),rS=a=>({root:{paddingTop:a.spacing(1),paddingBottom:a.spacing(1)},TextField:{},Button:{borderRadius:0}});function oS({classes:a,itemSearchDocument:n,onSaveSearch:o,onSuccess:s=()=>{},onError:i=()=>{},nameText:l="New Saved Search",saveText:d="Save"}){const[c,p]=C.useState(""),u=g=>{if(g.preventDefault(),!c){i("No Name specified");return}o({metadata:{title:c.trim()},itemSearchDocument:n}).then(s).catch(i)};return t.jsxs("form",{className:a.root,onSubmit:u,children:[t.jsx(r.InputBase,{className:a.TextField,onChange:g=>p(g.target.value),fullWidth:!0,placeholder:l}),t.jsx(r.Button,{className:a.Button,disabled:!c||c.trim()==="",fullWidth:!0,color:"primary",variant:"contained",disableElevation:!0,type:"submit",children:d})]})}const sS=r.withStyles(rS,{name:"VdtSaveSearchForm"})(oS),iS=a=>({root:{padding:a.spacing(2)}});function lS({classes:a,className:n,markerField:o,markerValue:s,itemSearchDocument:i,onSelect:l,onSaveSuccess:d=()=>{},onSaveError:c=()=>{},SearchListComponent:p=nS,SearchListProps:u={},SearchFormComponent:g=sS,SearchFormProps:h={},accessTranslate:m,extraMenuItems:y}){const{onDeleteSearch:I,onUpdateSearchMetadata:T,onGetSavedSearchSettings:b,onSaveSearch:M,searchProps:L}=ne.useSavedSearch({markerField:o,markerValue:s,initialSearchState:{rowsPerPage:5}}),S=({collectionId:w})=>b({collectionId:w}).then(A=>l(A,w));return t.jsxs("div",{className:x(a.root,"VdtSavedSearch-root",n),children:[g&&t.jsx(g,{itemSearchDocument:i,onSuccess:d,onError:c,onSaveSearch:M,...h}),p&&t.jsx(p,{onSelect:S,onDelete:I,onUpdateSearchMetadata:T,searchProps:L,accessTranslate:m,extraMenuItems:y,...u})]})}const dS=r.withStyles(iS,{name:"VdtSavedSearchList"})(lS),cS=a=>({suggestion:{"&:hover":{textFillColor:a.palette.text.primary,textStrokeColor:a.palette.text.primary,textStrokeWidth:.5},userSelect:"text"},suggested:{fontStyle:"italic"},suggestionButton:{"&:hover":{backgroundColor:"transparent"},paddingTop:0,paddingBottom:0},didYouMean:{color:a.palette.secondary.main}}),pS=(...a)=>a.length===1?a[0].map(n=>[n]):a.reduce((n,o)=>n.flatMap(s=>o.map(i=>[s,i].flat()))),uS=a=>new RegExp(a.map(({term:n})=>`(${n})`).join("|"));function gS(a,n){return a.split(uS(n)).filter(o=>o&&o.length>0).map(o=>{const s=n.find(i=>i.term===o);return s?{term:s.suggestion,replaced:!0}:{term:o,replaced:!1}}).filter(({term:o})=>o!==a)}function hS(a,n,o){return pS(...n.map(({term:i,suggestion:l})=>l.map(d=>({term:i,suggestion:d})))).slice(0,o).map(i=>gS(a,i)).filter(i=>i.length>0)}function ro({className:a,classes:n,searchText:o,suggestions:s,onClick:i,maxSuggestions:l,didYouMeanText:d="Did you mean"}){if(!(s&&s.length>0)||!o)return null;const c=hS(o,s,l);return c.length===0?null:t.jsxs("div",{className:x(a,n.root,"VdtSpellCheck-root"),children:[t.jsx(r.Typography,{classes:{root:n.didYouMean},display:"inline",children:`${d}:`}),c.map((p,u)=>t.jsx(r.Button,{disableRipple:!0,classes:{root:n.suggestionButton,label:n.suggestion},onClick:()=>i(p.map(({term:g})=>g).join("")),children:p.map(({replaced:g,term:h})=>t.jsxs("span",{children:[g?t.jsx("span",{className:x(n.suggested,"VdtSpellCheck-suggested"),children:h}):h," "]},h))},`${u}-root`))]})}ro.propTypes={className:e.string,classes:e.objectOf(e.string).isRequired,searchText:e.string,suggestions:e.arrayOf(e.shape({term:e.string,suggestion:e.arrayOf(e.string)})),maxSuggestions:e.number,didYouMeanText:e.string,onClick:e.func},ro.defaultProps={className:void 0,searchText:void 0,suggestions:void 0,maxSuggestions:void 0,didYouMeanText:"Did you mean",onClick:()=>{}};const Mu=r.withStyles(cS,{name:"VdtSpellCheck"})(ro);Mu.displayName="SpellCheck";const yS=a=>({root:{width:"100%",display:"flex",marginTop:a.spacing(.5),marginBottom:a.spacing(.5)},createTable:{},button:{backgroundColor:a.palette.type==="light"?a.palette.grey[100]:a.palette.grey[800],color:a.palette.text.primary,borderColor:a.palette.grey[400],padding:0,borderWidth:1,borderStyle:"solid",borderRadius:"0 2px 2px 0"},valueContainer:{display:"flex",flexWrap:"wrap",flex:1,alignItems:"center",overflow:"hidden",minHeight:36},input:{height:"100%",display:"flex",padding:0},option:{},noOptionsMessage:{padding:a.spacing(1)},chip:{margin:a.spacing(.5)},chipLabel:{cursor:"inherit",display:"flex",alignItems:"center",userSelect:"none",whiteSpace:"nowrap",paddingLeft:a.spacing(1.5),paddingRight:a.spacing(1.5),"& p:nth-child(1)":{fontWeight:600},"& p:nth-child(2)":{marginLeft:a.spacing(.5)}},modifierValue:{},placeholder:{position:"absolute",left:a.spacing(.25),color:a.palette.grey[500]},menu:{position:"absolute",zIndex:100,marginTop:a.spacing(.5),left:0,right:0},focused:{borderColor:a.palette.primary.main}}),mS=({isFocused:a,...n})=>o=>({input:s=>({...s,color:o.palette?o.palette.text.primary:"#AAA","& input":{font:"inherit"}}),clearIndicator:s=>({...s,cursor:"pointer"}),container:s=>({...s,width:"100%",minWidth:270,position:"relative",borderStyle:"solid",borderColor:o.palette?a?o.palette.primary.main:o.palette.grey[400]:"#AAA",borderRadius:"2px 0px 0px 2px",transition:"border-color .3s ease-in",borderWidth:"1px 0 1px 1px",paddingLeft:o.spacing?o.spacing(1):4}),...n});function fS(a){const{selectProps:{classes:n},children:o}=a;return t.jsx("div",{className:n.valueContainer,children:o})}const CS=({inputRef:a,...n})=>t.jsx("div",{ref:a,...n});function TS(a){const{selectProps:n,innerRef:o,children:s,innerProps:i}=a;return t.jsx(r.TextField,{fullWidth:!0,InputProps:{inputComponent:CS,disableUnderline:!0,inputProps:{className:n.classes.input,inputRef:o,children:s,...i}},...n.textFieldProps})}function bS(a){const{isFocused:n,selectProps:{classes:o},innerProps:s,children:i}=a;return t.jsx(r.MenuItem,{className:x(o.option),selected:n,component:"div",...s,children:i})}function IS(a){const{selectProps:{classes:n},innerProps:o,children:s}=a;return t.jsx(r.Typography,{color:"textSecondary",className:n.noOptionsMessage,...o,children:s})}function MS(a){const{selectProps:{classes:n},innerProps:o,children:s}=a;return t.jsx(r.Typography,{className:n.placeholder,...o,children:s})}function LS(a){const{selectProps:{classes:n},innerProps:o,children:s}=a;return t.jsx(r.Typography,{className:n.singleValue,...o,children:s})}function SS(a){const{selectProps:{classes:n},children:o,removeProps:s,size:i="small"}=a;return t.jsx(r.Chip,{tabIndex:-1,label:o,size:i,className:n.chip,classes:{label:n.chipLabel},onDelete:s.onClick,deleteIcon:t.jsx(j.Cancel,{...s}),color:"default"})}function wS(a){const{selectProps:{classes:n},data:{isModifier:o,label:s,modifier_label:i}}=a;return o?t.jsx("div",{className:n.modifierValue,children:t.jsx(r.Typography,{noWrap:!0,children:`${s}: `})}):t.jsx(SS,{className:n.modifierValue,...a,children:t.jsxs(t.Fragment,{children:[t.jsx(r.Typography,{noWrap:!0,children:`${i}: `}),t.jsx(r.Typography,{noWrap:!0,children:s})]})})}function AS(a){const{selectProps:{classes:n},children:o,innerProps:s}=a;return t.jsx(r.Paper,{square:!0,className:n.menu,...s,children:o})}function DS(){return null}function NS(){return null}const vS={Control:TS,Menu:AS,MultiValue:wS,NoOptionsMessage:IS,Option:bS,Placeholder:MS,SingleValue:LS,ValueContainer:fS,DropdownIndicator:DS,IndicatorSeparator:NS},xS=(a,n)=>o=>new Promise((s,i)=>{const{value:l}=a,d=[{...l&&{field:l},text:o},{...l&&{field:l},text:o.toUpperCase()},{...l&&{field:l},text:o.toLowerCase()},{...l&&{field:l},text:`${o[0].toUpperCase()}${o.slice(1)}`}],c={...n,autocomplete:d};try{Q.item.searchItem({itemSearchDocument:c}).then(({data:p})=>{const{autocomplete:u=[]}=p,g=[];u.forEach(h=>{if(h.field&&h.field!==l)return;const{suggestion:m=[]}=h;m.forEach(y=>{g.find(I=>I.value===y)||g.push({label:y,value:y})})}),s(g)}).catch(p=>i(p))}catch(p){i(p)}}),OS=a=>n=>new Promise(o=>{if(n){const s=n.toLowerCase(),i=a.filter(l=>l.label.toLowerCase().includes(s));o(i)}o(a)}),ES=({currentModifier:a,modifiers:n,itemSearchDocument:o})=>a?xS(a,o):OS(n),jS=a=>`Search for ${a}`;function oo({classes:a,className:n,theme:o,defaultValue:s,modifiers:i,loadOptions:l,itemSearchDocument:d,onSubmit:c,submitting:p,onChange:u,placeholder:g,CreateTabelSelectComponents:h,CreateTabelSelectProps:m,CreateTablestyles:y,ButtonComponent:I,ButtonProps:T,SearchIconComponent:b,SearchIconsProps:M,ProgressComponent:L,ProgressProps:S}){const[w,A]=C.useState(s),[v,O]=C.useState(),[E,D]=C.useState(!1),F=v?[]:i,z=mS({isFocused:E,CreateTablestyles:y})(o),B=(Y,{action:P,option:V={}})=>{const{isModifier:W}=V;if(W){A(Y),O(V);return}if(P==="create-option"||P==="select-option"){let _=V;P==="create-option"&&(_=Y[Y.length-1]);const{value:H,label:k,isFreeText:U}=v,K=[...Y],Z={...U&&{isFreeText:U},modifier_value:H,modifier_label:k,..._};K.splice(-2,2,Z),A(K),O(),u&&u(K);return}if(P==="remove-value"||P==="pop-value"){A(Y);const _=Y&&Y.length>0&&Y[Y.length-1].isModifier?Y[Y.length-1]:void 0;O(_);const H=Y.filter(k=>!k.isModifier);u&&u(H);return}if(P==="clear"){A([]),O(),u&&u(Y);return}A(Y)},$=Y=>{Y.preventDefault(),c&&c()};return t.jsxs("form",{className:x(n,a.root,"VdtSearchField-root"),onSubmit:$,children:[t.jsx(yg,{className:a.createTable,classes:a,styles:z,loadOptions:l({currentModifier:v,modifiers:i,itemSearchDocument:d}),components:{...vS,...h},value:w,defaultOptions:F,onChange:B,onFocus:()=>D(!0),onBlur:()=>D(!1),isFocused:E,placeholder:g,isValidNewOption:Y=>Y&&v,blurInputOnSelect:!1,isMulti:!0,allowCreateWhileLoading:!0,createOptionPosition:"first",formatCreateLabel:jS,...m}),t.jsx(I,{size:"small",type:"submit",disableRipple:!0,className:x(a.button,{[a.focused]:E},"VdtSearchField-button"),...T,children:p?t.jsx(L,{size:20,color:"inherit",...S}):t.jsx(b,{...M})})]})}oo.propTypes={classes:e.objectOf(e.string),className:e.string,theme:e.objectOf(e.any),defaultValue:e.arrayOf(e.object),modifiers:e.arrayOf(e.any),loadOptions:e.func,itemSearchDocument:e.objectOf(e.any),submitting:e.bool,onSubmit:e.func,onChange:e.func,placeholder:e.string,CreateTabelSelectComponents:e.objectOf(e.elementType),CreateTabelSelectProps:e.objectOf(e.any),CreateTablestyles:e.objectOf(e.any),ButtonComponent:e.elementType,ButtonProps:e.objectOf(e.any),SearchIconComponent:e.elementType,SearchIconsProps:e.objectOf(e.any),ProgressComponent:e.elementType,ProgressProps:e.objectOf(e.any)},oo.defaultProps={className:void 0,classes:{},theme:{},defaultValue:[],modifiers:[],loadOptions:ES,itemSearchDocument:{},submitting:!1,onSubmit:()=>{},onChange:()=>{},placeholder:"Search Items",CreateTabelSelectComponents:void 0,CreateTabelSelectProps:{},CreateTablestyles:{},ButtonComponent:r.Button,ButtonProps:{},SearchIconComponent:j.Search,SearchIconsProps:{},ProgressComponent:r.CircularProgress,ProgressProps:{}};const Lu=r.withStyles(yS,{name:"VdtSearchField"})(oo);Lu.displayName="SearchField";const PS=()=>({root:{marginRight:4,width:"100%",display:"flex",alignItems:"center",height:50},icon:{fontSize:22,marginRight:15},input:{marginRight:10,minWidth:200},iconButton:{}});function kS({classes:a,id:n,setExpand:o,saveSearch:s,onAddRow:i,createFolder:l,itemSearchDocument:d,newField:c,markerField:p="saved_search_folder",markerValue:u="SubFolder",folderNameText:g="Folder name",searchNameText:h="Search name"}){const{id:m,type:y}=c,[I,T]=C.useState(""),b=()=>{i({id:null,type:null}),o(!0)},M=()=>{I&&l(n,p,u,I,b)},L=()=>{I&&s(n,I,d,b)};return n!==m?null:t.jsxs(r.ListItem,{disableGutters:!0,dense:!0,className:a.root,children:[{folder:t.jsx(j.CreateNewFolderOutlined,{classes:{root:a.icon}}),query:t.jsx(j.Search,{className:a.icon})}[y],t.jsx(r.TextField,{className:a.input,onChange:S=>T(S.target.value),placeholder:y==="folder"?g:h,variant:"outlined",size:"small"}),t.jsx(r.IconButton,{classes:{root:a.iconButton},onClick:y==="folder"?M:L,color:"primary",variant:"outlined",children:{folder:t.jsx(j.AddCircleOutlined,{}),query:t.jsx(j.Save,{})}[y]}),t.jsx(r.IconButton,{classes:{root:a.iconButton},onClick:b,color:"primary",variant:"outlined",children:t.jsx(j.Cancel,{})})]})}const FS=r.withStyles(PS,{name:"VdtAddFolderRow"})(kS),Su={markerValue:"savedSearch",markerField:"eidr_referentType"},zS={indentationWidth:20,indentationDepthStart:1,defaultRowIndentationOffset:15,defalutNewRowIndentation:10},BS=()=>({root:{display:"flex",width:"100%",flexWrap:"wrap"},indentationContainer:{display:"flex",width:"100%"}}),qS=a=>({root:{display:"flex",width:"100%"},indentation:{height:25,borderLeft:`1px solid ${a.palette.primary.main}`,borderBottom:`1px solid ${a.palette.primary.main}`,marginRight:5}});function VS({className:a,classes:n,children:o,indentationWidth:s,hideWrapper:i,folderDepth:l,indentationDepthStart:d,isAddRow:c,rowIndentation:p,addNewRowIndentation:u}){const g=c?!0:l>=d,h=c?u:p;return i?null:t.jsxs("div",{className:x(a,n.root),children:[g&&t.jsx("div",{className:n.indentation,style:{marginLeft:h,minWidth:s}}),o]})}const GS=ne.compose(r.withStyles(qS,{name:"VdtFolderRowContentWrapper"}))(VS);function wu({classes:a,id:n,queryParams:o,markerProps:s=Su,childFolders:i=[],metadata:l={},itemSearchDocument:d={},folderDepth:c=0,type:p="folder",hideSubFolderSharing:u,onSelect:g,onRemoveItem:h,indentationValues:m={},indentationProps:y=zS,FolderRowContentComponent:I=Iu,FolderRowContentProps:T={},AddRowComponent:b=FS,AddRowProps:M={},FolderRowContentWrapperComponent:L=GS,FolderRowContentWrapperProps:S={},...w}){const[A,v]=C.useState(),[O,E]=C.useState({id:null,type:null}),{createFolder:D,saveSearch:F,deleteFolder:z,removeItem:B,subFolders:$=[]}=ne.useGetSavedSearchFolders({childFolders:i,expand:A,queryParams:o,markerProps:s}),{onDeleteSearch:Y,onUpdateSearchMetadata:P,onGetSavedSearchSettings:V}=ne.useSavedSearch({...Su}),W=({collectionId:q})=>V({collectionId:q}).then(G=>g(G,q)),_=X.parseMetadataType(l,{joinValue:"_",flat:!0}),H=C.useMemo(()=>{const{__child_collection_size:q=0}=_;return $.length>0||!A&&q>0},[$.length,A,_]),{defalutNewRowIndentation:k,defaultRowIndentationOffset:U,indentationWidth:K}=y,Z={rowIndentation:m.rowIndentation||0,addNewRowIndentation:m.addNewRowIndentation||k},J={rowIndentation:Z.addNewRowIndentation,addNewRowIndentation:Z.addNewRowIndentation+K+U};return t.jsxs("div",{className:a.root,children:[{folder:t.jsx(L,{folderDepth:c,...Z,...y,...S,children:t.jsx(I,{isFolderRow:!0,hideSubFolderSharing:u,type:p,collectionType:{id:n,metadata:l},disableDeletion:H,onDelete:()=>Promise.resolve(z(n)).then(()=>{h&&h(n)}),onUpdateSearchMetadata:q=>P({collectionId:n,metadataDocument:q}),onExpand:()=>v(q=>!q),onAddRow:E,...T})}),query:t.jsx(L,{folderDepth:c,...Z,...y,...S,children:t.jsx(I,{isFolderRow:!0,type:p,collectionType:{id:n,metadata:l},onSelect:()=>W({collectionId:n}),onDelete:()=>Promise.resolve(Y({collectionId:n})).then(()=>{h&&h(n)}),onUpdateSearchMetadata:q=>P({collectionId:n,metadataDocument:q}),onAddRow:E,...T})})}[p],t.jsx(L,{isAddRow:!0,folderDepth:c,...Z,...y,hideWrapper:!O.id,...S,children:t.jsx(b,{id:n,setExpand:v,saveSearch:F,onAddRow:E,createFolder:D,itemSearchDocument:d,newField:O,...M})}),$.map(q=>t.jsx(wu,{classes:a,id:q.id,queryParams:o,markerProps:s,childFolders:q.subFolders,metadata:q.metadata,itemSearchDocument:d,folderDepth:c+1,type:q.type,hideSubFolderSharing:!0,handleSelect:W,onSelect:g,onRemoveItem:()=>B(q.id),indentationProps:y,FolderRowContentComponent:I,FolderRowContentProps:T,AddRowComponent:b,AddRowProps:M,FolderRowContentWrapperComponent:L,FolderRowContentWrapperProps:S,indentationValues:J,props:w},q.id))]})}const US=r.withStyles(BS,{name:"VdtFolderRow"})(wu),$S=()=>({root:{"& .MuiFormHelperText-root":{display:"none"},"& .MuiInputLabel-root":{display:"none"},"& .MuiInputBase-root":{marginTop:"0px"},marginTop:"0px"}}),YS=a=>a.stopPropagation();function WS(a){return({value:n,onChange:o,...s})=>{const[i,l]=C.useState(n);C.useEffect(()=>l(n),[n]);const d=()=>{n!==i&&o({target:{value:i}})};return t.jsx(a,{value:i,onChange:c=>l(c.target.value),onBlur:d,onKeyDown:c=>{c.key==="Enter"&&d()},...s})}}function _S(a){return({value:n,onChange:o,...s})=>t.jsx(a,{input:{onChange:({target:{checked:i}})=>o({target:{value:i.toString()}}),checked:n==="true"},...s})}const QS=WS(we),HS=_S(Zt);function ZS({...a}){return t.jsx(we,{type:"number",...a})}function so({displayType:a,withAutocomplete:n,autoCompleteHoc:o,type:s,...i}){let l;if(a==="select")l=Ve;else switch(s){case"date":l=Is;break;case"boolean":l=HS;break;case"integer":case"long":case"float":l=ZS;break;default:l=n?o(we):QS;break}return t.jsx(l,{...!n&&{onClick:YS},...i})}so.propTypes={classes:e.objectOf(e.string),className:e.string,displayType:e.oneOf(["select"]),type:e.oneOf(["string","date","boolean","integer","long","float"]),withAutocomplete:e.bool,autoCompleteHoc:e.func},so.defaultProps={className:void 0,classes:{},displayType:void 0,type:void 0,withAutocomplete:!1,autoCompleteHoc:()=>{}};const La=r.withStyles($S,{name:"VdtQueryInput"})(so),JS=a=>({root:{width:"50%"},and:{marginLeft:a.spacing(.5),marginRight:a.spacing(.5)},input:{}});function io({classes:a,className:n,field:o,onChange:s,InputComponent:i,...l}){const d=(u,g)=>({name:o.name,range:[{value:[{value:u},{value:g}]}]}),c=Be(o,"range.0.value.0.value",""),p=Be(o,"range.0.value.1.value","");return t.jsxs("div",{className:x(a.root,n),children:[t.jsx(i,{className:a.input,value:c,onChange:({target:{value:u}})=>s(d(u,p)),...l}),t.jsx(i,{className:a.input,value:p,onChange:({target:{value:u}})=>s(d(c,u)),...l})]})}io.propTypes={classes:e.objectOf(e.string),className:e.string,InputComponent:e.elementType,onChange:e.func.isRequired,field:ye.SearchFieldType.isRequired},io.defaultProps={className:void 0,classes:{},InputComponent:La};const Au=r.withStyles(JS,{name:"VdtQueryBetween"})(io),Du=C.createContext(void 0);function XS({query:a,onChange:n,children:o}){const s=C.useMemo(()=>({query:a,onChange:n}),[n,a]);return t.jsx(Du.Provider,{value:s,children:o})}const KS=a=>{const n=C.useContext(Du);if(n===void 0)throw new Error("useQueryBuilder must be used within a QueryBuilderContextProvider");const{query:o,onChange:s}=n,i=C.useCallback((d,c)=>{s(Cg(mg(o),d,c))},[s,o]),l=C.useCallback((d,c)=>i(d,fg(c)),[i]);return{getEntry:()=>Be(o,a),addEntry:d=>{i(`${a}.entry`,c=>[...c,{...d,uuid:ar()}])},removeEntry:()=>{const d=a.split(".").pop(),c=Number(d);i(a.substring(0,a.length-`.${d}`.length),p=>p.filter((u,g)=>g!==c))},changeOperation:d=>l(`${a}.operation`,d),changeEntry:d=>i(a,({uuid:c})=>({uuid:c,...d})),setNot:d=>{const c=Be(o,a);d?l(a,{operation:"NOT",entry:[c],uuid:c.uuid}):l(a.substring(0,a.length-8),c)}}},RS=()=>({root:{}});function lo({classes:a,className:n,field:o,onChange:s,InputComponent:i,...l}){const d=p=>({name:o.name,value:[{value:`*${p}*`}]}),c=Be(o,"value.0.value","");return t.jsx("div",{className:x(a.root,n),children:t.jsx(i,{value:c.replaceAll("*",""),onChange:p=>s(d(p.target.value)),...l})})}lo.propTypes={classes:e.objectOf(e.string),className:e.string,InputComponent:e.elementType,onChange:e.func.isRequired,field:ye.SearchFieldType.isRequired},lo.defaultProps={className:void 0,classes:{},InputComponent:La};const Nu=r.withStyles(RS,{name:"VdtQueryContains"})(lo),ew=()=>({root:{}});function co({classes:a,className:n,field:o,onChange:s,InputComponent:i,...l}){const d=p=>({name:o.name,value:[{value:p}]}),c=Be(o,"value.0.value","");return t.jsx("div",{className:x(a.root,n),children:t.jsx(i,{value:c,onChange:p=>s(d(p.target.value)),...l})})}co.propTypes={classes:e.objectOf(e.string),className:e.string,InputComponent:e.elementType,onChange:e.func.isRequired,field:ye.SearchFieldType.isRequired},co.defaultProps={className:void 0,classes:{},InputComponent:La};const po=r.withStyles(ew,{name:"VdtQueryEquals"})(co),Yt={equals:{label:"Equals",component:po,props:{},shape:a=>({name:a,value:[{value:""}]})},equalsBoolean:{label:"Equals",component:po,props:{},shape:a=>({name:a,value:[{value:"false"}]})},contains:{label:"Contains",component:Nu,props:{},shape:a=>({name:a,value:[{value:""}]})},between:{label:"Between",component:Au,props:{},shape:a=>({name:a,range:[{value:[{value:""},{value:""}]}]})}},tw=({type:a}={})=>{switch(a){case"boolean":return[Yt.equalsBoolean];case"date":case"integer":case"long":case"float":return[Yt.equals,Yt.between];default:return[Yt.equals,Yt.contains]}},aw=(a,n,o,s)=>{let i;return a==="Equals"&&(i=n),a==="Contains"&&(i=o),a==="Between"&&(i=s),i};function nw({value:a,options:n,onChange:o,equalsText:s,containsText:i,betweenText:l,...d}){return t.jsx(r.Select,{value:a,onChange:c=>o(n.find(p=>p.label===c.target.value)),...d,children:n.map(c=>t.jsx(r.MenuItem,{value:c.label,children:aw(c.label,s,i,l)},c.label))})}const rw=a=>({root:{"& > *":{marginRight:"15px"}},errorButton:{color:a.palette.error.light},successButton:{color:a.palette.success.light},fieldPicker:{width:"250px"},predicatePicker:{width:"100px"}}),ow=(a,n)=>{const o=/^\*.+\*$/gm;return Object.prototype.hasOwnProperty.call(a,"range")?n?n[1]:{}:a&&a.value[0].value.match(o)?n?n[1]:{}:n?n[0]:{}};function uo({classes:a,className:n,field:o,fields:s,getFieldLabel:i,getFieldName:l,InputComponent:d,not:c,onRemove:p,onChange:u,setNot:g,PredicatePickerComponent:h,PredicatePickerProps:m,getPredicateOptions:y,getPredicate:I,NotIcon:T,OkIcon:b,RemoveIcon:M,includeText:L,excludeText:S,removeText:w,PredicateComponentProps:A,equalsText:v,containsText:O,betweenText:E}){const D=s.find(H=>l(H)===l(o)),F=y(D),[z,B]=C.useState(I(o,F)),{label:$,component:Y,props:P={}}=z,V=H=>{const k=y(H);return B(k?k[0]:{}),k.find(U=>U.label===$)||k[0]},W=()=>g(!c),_=H=>{const k=H.shape(l(o));u(k),B(H)};return t.jsxs(r.ListItem,{ContainerComponent:"div",component:"div",className:x(n,a.root,"VdtQueryField-root"),alignItems:"flex-start",children:[t.jsx(r.ListItemAvatar,{children:g&&t.jsx(r.Button,{className:c?a.errorButton:a.successButton,startIcon:c?t.jsx(T,{}):t.jsx(b,{}),edge:"end",onClick:W,size:"small",children:c?S:L})}),t.jsx(oe.Autocomplete,{onChange:(H,k)=>u(V(k).shape(l(k))),value:s.find(H=>l(o)===l(H)),disableClearable:!0,options:s,getOptionLabel:i,renderInput:H=>t.jsx(r.TextField,{onClick:k=>k.stopPropagation(),...H}),classes:{root:a.fieldPicker}}),t.jsx(h,{value:$,options:F,onChange:_,classes:{root:a.predicatePicker},equalsText:v,containsText:O,betweenText:E,...m}),t.jsx(Y,{field:o,onChange:u,InputComponent:d,...D,...P,...A}),p&&t.jsx(r.Button,{edge:"end",onClick:p,startIcon:t.jsx(M,{}),size:"small",children:w})]})}uo.propTypes={classes:e.objectOf(e.string),className:e.string,PredicatePickerComponent:e.elementType,PredicatePickerProps:e.objectOf(e.any),getPredicateOptions:e.func,getPredicate:e.func,NotIcon:e.elementType,OkIcon:e.elementType,RemoveIcon:e.elementType,includeText:e.string,excludeText:e.string,removeText:e.string,equalsText:e.string,containsText:e.string,betweenText:e.string,InputComponent:e.elementType,field:ye.SearchFieldType.isRequired,onRemove:e.func,onChange:e.func.isRequired,fields:e.arrayOf(e.any),getFieldLabel:e.func,getFieldName:e.func,not:e.bool,setNot:e.func,PredicateComponentProps:e.objectOf(e.any)},uo.defaultProps={className:void 0,classes:{},PredicatePickerComponent:nw,PredicatePickerProps:{},getPredicateOptions:tw,getPredicate:ow,NotIcon:()=>null,OkIcon:()=>null,RemoveIcon:j.Delete,includeText:"Include",excludeText:"Exclude",removeText:"Remove",equalsText:"Equals",containsText:"Contains",betweenText:"Between",onRemove:void 0,fields:[],InputComponent:void 0,not:!1,setNot:void 0,getFieldLabel:a=>a.label,getFieldName:a=>a.name,PredicateComponentProps:{}};const vu=r.withStyles(rw,{name:"VdtQueryField"})(uo),go=a=>n=>{n.stopPropagation(),a(n.target.value)},sw=a=>({root:{},errorButton:{color:a.palette.error.light},successButton:{color:a.palette.success.light},groupSelect:{width:"20%",marginLeft:a.spacing(2)}});function ho({className:a,classes:n,group:o,groups:s,onAddEntry:i,onRemove:l,onChange:d,setNot:c,not:p,defaultField:u,defaultGroup:g,getGroupName:h,getGroupLabel:m,addFieldText:y,addGroupText:I,includeText:T,excludeText:b,removeText:M,NotIcon:L,OkIcon:S,RemoveIcon:w}){const A=go(()=>i({name:u,value:[{value:""}]})),v=go(()=>i({name:g,entry:[]})),O=go(()=>c(!p)),E=D=>{d({name:h(D),entry:[]})};return t.jsxs(r.ListItem,{ContainerComponent:"div",className:x(a,n.root,"VdtQueryOperator-root"),children:[t.jsx(r.ListItemAvatar,{children:t.jsx("div",{children:c&&t.jsx(r.Button,{className:p?n.errorButton:n.successButton,startIcon:p?t.jsx(L,{}):t.jsx(S,{}),edge:"end",onClick:O,size:"small",children:p?b:T})})}),t.jsx(oe.Autocomplete,{className:n.groupSelect,onChange:(D,F)=>E(F),value:s.find(D=>h(o)===h(D)),disableClearable:!0,options:s,getOptionLabel:m,renderInput:D=>t.jsx(r.TextField,{onClick:F=>F.stopPropagation(),...D}),classes:{root:n.fieldPicker}}),t.jsx(r.ListItemSecondaryAction,{children:t.jsxs(r.ButtonGroup,{variant:"outlined",size:"small",children:[u&&t.jsx(r.Button,{className:"VdtQueryOperator-addFieldBtn",onClick:A,children:y}),g&&t.jsx(r.Button,{className:"VdtQueryOperator-addGroupBtn",onClick:v,children:I}),l&&t.jsx(r.Button,{edge:"end",onClick:l,startIcon:t.jsx(w,{}),size:"small",children:M})]})})]})}ho.propTypes={classes:e.objectOf(e.string),className:e.string,NotIcon:e.elementType,OkIcon:e.elementType,RemoveIcon:e.elementType,includeText:e.string,excludeText:e.string,removeText:e.string,addFieldText:e.string,addGroupText:e.string,group:e.shape({name:e.string,entry:e.arrayOf(e.any)}).isRequired,groups:e.arrayOf(e.any),onAddEntry:e.func.isRequired,onRemove:e.func,onChange:e.func.isRequired,not:e.bool,setNot:e.func,defaultField:e.string,defaultGroup:e.string,getGroupName:e.func,getGroupLabel:e.func},ho.defaultProps={className:void 0,classes:{},NotIcon:()=>null,OkIcon:()=>null,RemoveIcon:j.Delete,includeText:"Include",excludeText:"Exclude",removeText:"Remove",addFieldText:"Add field",addGroupText:"Add group",onRemove:void 0,groups:[],defaultField:void 0,defaultGroup:void 0,not:!1,setNot:void 0,getGroupLabel:a=>a.label,getGroupName:a=>a.name};const xu=r.withStyles(sw,{name:"VdtQueryGroup"})(ho),Wt=a=>n=>{n.stopPropagation(),a(n.target.value)},iw=a=>({root:{},errorButton:{color:a.palette.error.light},successButton:{color:a.palette.success.light}});function yo({className:a,classes:n,operator:o,onAddEntry:s,onRemove:i,onChangeOperation:l,setNot:d,not:c,defaultField:p,defaultGroup:u,includeText:g,excludeText:h,removeText:m,andText:y,orText:I,addFieldText:T,addGroupText:b,addOperatorText:M,NotIcon:L=j.Block,OkIcon:S=j.Check,RemoveIcon:w=j.Delete,AndIcon:A=j.CallMerge,OrIcon:v=j.CallSplit}){const{operation:O}=o,E=Wt(()=>s({name:p,value:[{value:""}]})),D=Wt(()=>s({name:u,entry:[]})),F=Wt(()=>s({operation:"AND",entry:[]})),z=Wt(()=>d(!c)),B=Wt(()=>{l(O==="AND"?"OR":"AND")});return t.jsxs(r.ListItem,{ContainerComponent:"div",className:x(a,n.root,"VdtQueryOperator-root"),children:[t.jsx(r.ListItemAvatar,{children:t.jsxs("div",{children:[l&&t.jsx(r.Button,{className:O==="AND"?n.successButton:n.errorButton,startIcon:O==="AND"?t.jsx(A,{}):t.jsx(v,{}),edge:"end",onClick:B,size:"small",children:O==="AND"?y:I}),d&&t.jsx(r.Button,{className:c?n.errorButton:n.successButton,startIcon:c?t.jsx(L,{}):t.jsx(S,{}),edge:"end",onClick:z,size:"small",children:c?h:g})]})}),t.jsx(r.ListItemSecondaryAction,{children:t.jsxs(r.ButtonGroup,{variant:"outlined",size:"small",children:[t.jsx(r.Button,{className:"VdtQueryOperator-addFieldBtn",onClick:E,children:T}),u&&t.jsx(r.Button,{className:"VdtQueryOperator-addGroupBtn",onClick:D,children:b}),t.jsx(r.Button,{className:"VdtQueryOperator-addOperatorBtn",onClick:F,children:M}),i&&t.jsx(r.Button,{edge:"end",onClick:i,startIcon:t.jsx(w,{}),size:"small",children:m})]})})]})}yo.propTypes={classes:e.objectOf(e.string),className:e.string,includeText:e.string,excludeText:e.string,removeText:e.string,andText:e.string,orText:e.string,addFieldText:e.string,addGroupText:e.string,addOperatorText:e.string,NotIcon:e.elementType,OkIcon:e.elementType,RemoveIcon:e.elementType,AndIcon:e.elementType,OrIcon:e.elementType,defaultField:e.string,defaultGroup:e.string,not:e.bool,setNot:e.func,onAddEntry:e.func.isRequired,onRemove:e.func,onChangeOperation:e.func,operator:e.shape({operation:e.oneOf(["AND","OR","NOT"]).isRequired,entry:e.arrayOf(e.any)}).isRequired},yo.defaultProps={className:void 0,classes:{},includeText:"Include",excludeText:"Exclude",removeText:"Remove",andText:"And",orText:"Or",addFieldText:"Add field",addGroupText:"Add group",addOperatorText:"Add operator",NotIcon:()=>null,OkIcon:()=>null,RemoveIcon:j.Delete,AndIcon:()=>null,OrIcon:()=>null,defaultField:void 0,defaultGroup:void 0,onRemove:void 0,not:!1,setNot:void 0,onChangeOperation:void 0};const Ou=r.withStyles(iw,{name:"VdtQueryOperator"})(yo),lw=a=>({root:{"&:focus > .MuiTreeItem-content .MuiTreeItem-label":{backgroundColor:"transparent"},"&:hover > .MuiTreeItem-content .MuiTreeItem-label":{backgroundColor:"transparent"},padding:"5px"},queryGroup:{position:"relative",border:`1px solid ${He.alpha(a.palette.text.primary,.05)}`,backgroundColor:He.alpha(a.palette.text.primary,.02),borderRadius:"4px",margin:"1rem 1rem 1rem 0","& .MuiTreeItem-iconContainer":{position:"absolute",left:"12px"}}});function dw(a){return a.operation?"operator":a.value||a.range?"field":"group"}function _t({canExpandpath:a,path:n,fields:o,groups:s,defaultField:i,defaultGroup:l,not:d,nodeId:c,canExpand:p,parentGroup:u,onRemove:g,...h}){const{expandNode:m,OperatorComponent:y,OperatorProps:I,FieldComponent:T,FieldProps:b,GroupComponent:M,GroupProps:L,getFieldLabel:S,getFieldName:w,getGroupLabel:A,getGroupName:v,getGroupFields:O,getGroupGroups:E,classes:D}=h,{getEntry:F,addEntry:z,removeEntry:B,changeOperation:$,changeEntry:Y,setNot:P}=KS(n),V=F(n),W=dw(V),_=c||n,H=i||o.length>0?w(o[0]):void 0,k=W==="group"?O(s.find(R=>v(R)===v(V))||{}):o,U=W==="group"?w(k[0]):H,K=W==="group"?E(s.find(R=>v(R)===V.name)||{}):s,Z=K&&K.length>0?K[0].name:void 0,J=C.useCallback((...R)=>{z(...R),m&&m(_)},[z,_,m]),q=g||B;if(V.operation&&V.operation==="NOT")return t.jsx(_t,{nodeId:_,path:`${n}.entry.0`,fields:k,defaultField:U,groups:s,onRemove:B,parentGroup:W==="group"?V.name:void 0,not:!0,...h});const G=({uuid:R,...ae})=>ae;return t.jsx(oe.TreeItem,{nodeId:_,className:x(W!=="field"&&D.queryGroup,D.root),expandIcon:p?t.jsx(j.ChevronRight,{}):null,collapseIcon:p?t.jsx(j.ExpandMore,{}):null,label:{operator:t.jsx(y,{operator:V,not:d,onAddEntry:J,onRemove:_!=="operator"?q:void 0,onChangeOperation:_!=="operator"?$:void 0,onChange:Y,setNot:_!=="operator"?P:void 0,defaultField:U,defaultGroup:s&&s.length>0?s[0].name:void 0,...I}),field:t.jsx(T,{field:G(V),fields:k,getFieldLabel:S,getFieldName:w,not:d,onRemove:q,onChange:Y,setNot:P,...b}),group:t.jsx(M,{group:V,groups:s,not:d,onAddEntry:J,onRemove:q,setNot:P,defaultField:U,defaultGroup:Z,getGroupLabel:A,getGroupName:v,onChange:Y,...L})}[W],children:V.entry&&V.entry.map((R,ae)=>t.jsx(_t,{nodeId:`${_}.entry.${R.uuid}`,path:`${n}.entry.${ae}`,fields:k,groups:K,defaultField:U,parentEntryType:W,parentGroup:W==="group"?V.name:void 0,...h},`${n}.entry.${R.uuid}`))})}_t.propTypes={classes:e.objectOf(e.string),className:e.string,OperatorComponent:e.elementType,OperatorProps:e.objectOf(e.any),FieldComponent:e.elementType,FieldProps:e.objectOf(e.any),GroupComponent:e.elementType,GroupProps:e.objectOf(e.any),not:e.bool,nodeId:e.string,canExpand:e.bool,getFieldLabel:e.func,getFieldName:e.func,getGroupLabel:e.func,getGroupName:e.func,getGroupFields:e.func,getGroupGroups:e.func,defaultField:e.string,defaultGroup:e.string,canExpandpath:e.bool,path:e.string,expandNode:e.func,groups:e.arrayOf(e.any),fields:e.arrayOf(e.any),parentEntryType:e.string,parentGroup:e.string,onRemove:e.func},_t.defaultProps={className:void 0,classes:{},FieldComponent:vu,FieldProps:{},GroupComponent:xu,GroupProps:{},OperatorComponent:Ou,OperatorProps:{},not:!1,nodeId:void 0,canExpand:!0,getFieldLabel:({label:a}={})=>a,getFieldName:({name:a}={})=>a,getGroupLabel:({label:a}={})=>a,getGroupName:({name:a}={})=>a,getGroupFields:({fields:a=[]}={})=>a,getGroupGroups:({groups:a=[]}={})=>a,defaultField:void 0,defaultGroup:void 0,canExpandpath:void 0,path:void 0,expandNode:void 0,groups:[],fields:[],parentEntryType:void 0,parentGroup:void 0,onRemove:void 0};const Eu=r.withStyles(lw,{name:"VdtQueryEntry"})(_t),cw=a=>({root:{},treeRoot:{backgroundColor:a.palette.background.paper,"& > .MuiTreeItem-root:first-child":{backgroundColor:"transparent",margin:"0",border:"none"}}}),pw=a=>{function n({uuid:o,...s}){const i=s.operation,l=({operation:d,value:c,range:p}={})=>d?"operator":c||p?"field":"group";return{...i?{operation:s.operation,operator:s.entry.filter(d=>d.operation).map(d=>n(d))}:{name:s.name},field:s.entry.filter(d=>l(d)==="field").map(({uuid:d,predicate:c,...p})=>p),group:s.entry.filter(d=>l(d)==="group").map(d=>n(d))}}return a&&a.operator&&{operator:n(a.operator)}},uw=a=>{const n=({operation:o,name:s,operator:i,field:l,group:d,entry:c}={})=>({...o?{operation:o}:{name:s},entry:[...l||[],...(i||[]).map(p=>n(p)),...(d||[]).map(p=>n(p)),...c||[]].map(p=>({uuid:ar(),...p}))});return a&&a.operator&&{operator:n(a.operator)}};function mo({classes:a,className:n,query:o,fields:s,groups:i,defaultField:l,defaultGroup:d,onChange:c,QueryEntryComponent:p,QueryEntryProps:u}){const g=C.useMemo(()=>uw(o),[o]),h=C.useCallback(b=>{c({...b,toItemSearchDocument(){return pw(this)}})},[c]),[m,y]=C.useState(["operator"]),I=(b,M)=>{y(M)},T=b=>{m.includes(b)||y(M=>[...M,b])};return t.jsx("div",{className:x(n,a.root,"VdtQueryBuilder-root"),children:g?t.jsx(XS,{query:g,onChange:h,children:t.jsx(oe.TreeView,{classes:{root:a.treeRoot},disableSelection:!0,expanded:m,onNodeToggle:I,children:t.jsx(p,{expandNode:T,path:"operator",defaultField:l,defaultGroup:d,fields:s,groups:i,canExpand:!1,...u})})}):null})}mo.propTypes={classes:e.objectOf(e.string),className:e.string,query:e.oneOfType([e.shape({operation:e.oneOf(["AND","OR","NOT"]).isRequired,entry:e.arrayOf(e.oneOfType([ye.SearchOperatorType,ye.SearchFieldType,ye.SearchGroupType]))}),ye.ItemSearchType]).isRequired,groups:e.arrayOf(e.any),fields:e.arrayOf(e.any),defaultField:e.oneOfType([e.string,e.objectOf(e.any)]),defaultGroup:e.string,onChange:e.func.isRequired,QueryEntryComponent:e.elementType,QueryEntryProps:e.objectOf(e.any)},mo.defaultProps={className:void 0,classes:{},fields:[],groups:[],defaultField:void 0,defaultGroup:void 0,QueryEntryComponent:Eu,QueryEntryProps:{}};const fo=r.withStyles(cw,{name:"VdtQueryBuilder"})(mo);fo.displayName="QueryBuilder";const gw=a=>({root:{padding:a.spacing(1)},resetButton:{},searchButton:{},DialogActions:{},errorButton:{color:a.palette.error.light,float:"left"},successButton:{color:a.palette.success.light,float:"left"}});function Co({className:a,classes:n,resetText:o,searchText:s,onSubmit:i,itemSearchDocument:l,initialOperator:d,fields:c,groups:p,QueryBuilderProps:u,PaperProps:g,resetButtonProps:h,searchButtonProps:m,showGeneralOperator:y}){const[I,T]=C.useState(d),[b,M]=C.useState({operator:I,...l}),L=()=>{T(I.operation==="AND"?{operation:"OR"}:{operation:"AND"})},S=()=>{const A={...l,operator:d};M(A),i(A)},w=()=>{const A={...l,...b.toItemSearchDocument?b.toItemSearchDocument():b};A.operator.operation=I.operation,i(A)};return t.jsxs(r.Paper,{className:x(n.root,a),onKeyPress:A=>{A.key==="Enter"&&w()},variant:"outlined",elevation:0,square:!0,...g,children:[y&&t.jsx(r.Button,{className:I&&I.operation==="AND"?n.successButton:n.errorButton,edge:"end",onClick:L,size:"small",children:I&&I.operation}),t.jsx(fo,{query:b,fields:c,groups:p,onChange:M,...u}),t.jsxs(r.DialogActions,{className:n.DialogActions,children:[t.jsx(r.Button,{className:n.resetButton,onClick:S,...h,children:o}),t.jsx(r.Button,{className:n.searchButton,variant:"contained",color:"primary",onClick:w,...m,children:s})]})]})}Co.propTypes={classes:e.objectOf(e.string),className:e.string,resetText:e.string,searchText:e.string,onSubmit:e.func.isRequired,itemSearchDocument:ye.ItemSearchType,initialOperator:e.objectOf(e.any),fields:e.arrayOf(e.shape({name:e.string,label:e.string,type:e.string})),groups:e.arrayOf(e.shape({name:e.string})),PaperProps:e.objectOf(e.any),QueryBuilderProps:e.objectOf(e.any),resetButtonProps:e.objectOf(e.any),searchButtonProps:e.objectOf(e.any),showGeneralOperator:e.bool},Co.defaultProps={className:void 0,classes:{},resetText:"Reset",searchText:"Search",fields:void 0,groups:void 0,itemSearchDocument:{},initialOperator:{operation:"AND"},PaperProps:{},QueryBuilderProps:{},resetButtonProps:{},searchButtonProps:{},showGeneralOperator:!0};const ju=r.withStyles(gw,{name:"VdtQueryBuilderCard"})(Co);ju.displayName="QueryBuilderCard";const Pu="item",ku="collection",hw={[Pu]:_e,[ku]:rt};function Fu({entityType:a,entity:n,entityComponents:o=hw,...s}){if(!a)return null;const i={...s},l=o[a.toLowerCase()];return l?(a.toLowerCase()===Pu.toLowerCase()?(i.itemId=n.id,i.itemType=n):a.toLowerCase()===ku.toLowerCase()&&(i.collectionId=n.id,i.collectionType=n),t.jsx(l,{...i})):null}function yw({entityType:a,entityId:n,entity:o,index:s,CollectionCardComponent:i=rt,ItemCardComponent:l=_e,CollectionCardProps:d={},ItemCardProps:c={},...p}){const u=a==="COLLECTION",g=a==="ITEM";return t.jsxs(r.Grid,{item:!0,xs:"auto",...p,children:[u&&t.jsx(i,{index:s,collectionId:n,collectionType:o,...d}),g&&t.jsx(l,{index:s,itemId:n,itemType:o,...c})]})}const mw={root:{},rootIsDragging:{opacity:.5,cursor:"move"}};function fw({className:a,classes:n,isDragging:o,...s}){return t.jsx(yw,{className:x(n.root,"VdtEntityGridItemDraggable-root",o&&n.rootIsDragging,o&&"VdtEntityGridItemDraggable-rootIsDragging",a),...s})}const zu=ne.compose(Mt,r.withStyles(mw,{name:"VdtEntityGridItemDraggable"}))(fw),Cw="COLLECTION",Tw="ITEM";function bw({entries:a=[],EntityGridItemComponent:n=zu,CollectionCardComponent:o=rt,ItemCardComponent:s=_e,CollectionCardProps:i={},ItemCardProps:l={},GridContainerProps:d={},GridItemProps:c={}}){const p=C.useMemo(()=>a.map(u=>u.collection&&{...u.collection,type:Cw}||u.item&&{...u.item,type:Tw}||void 0),[a]);return t.jsx(r.Grid,{container:!0,...d,children:p&&p.length&&p.map((u,g)=>t.jsx(n,{index:g,entity:u,entityType:u.type,entityId:u.id,CollectionCardComponent:o,ItemCardComponent:s,CollectionCardProps:i,ItemCardProps:l,...c},`${u.type}_${u.id}`))})}function Iw({entityType:a,entityId:n,entity:o,collectionOptions:s=[],itemOptions:i=[],onCollectionClick:l,onItemClick:d,...c}){const p=a==="COLLECTION",u=a==="ITEM";return t.jsxs(t.Fragment,{children:[p&&t.jsx(fa,{collectionId:n,collectionType:o,options:s,onClick:l,...c}),u&&t.jsx(qr,{itemId:n,itemType:o,options:i,onClick:d,...c})]})}const Mw={root:{},rootIsDragging:{opacity:.5,cursor:"move"}};function Lw({className:a,classes:n,isDragging:o,...s}){return t.jsx(Iw,{className:x(n.root,"VdtEntityTableRowDraggable-root",o&&n.rootIsDragging,o&&"VdtEntityTableRowDraggable-rootIsDragging",a),...s})}const Bu=ne.compose(Mt,r.withStyles(Mw,{name:"VdtEntityTableRowDraggable"}))(Lw),Sw="COLLECTION",ww="ITEM";function Aw({entries:a=[],EntityTableRowComponent:n=Bu,optionLabels:o=[],collectionOptions:s=[],itemOptions:i=[],onCheck:l,onCollectionClick:d=()=>null,onItemClick:c=()=>null,TableRowProps:p={}}){const u=C.useMemo(()=>a.map(({collection:g,item:h}={})=>{if(g)return{...g,type:Sw};if(h)return{...h,type:ww}}),[a]);return t.jsxs(r.Table,{size:"small",children:[t.jsx(r.TableHead,{children:t.jsxs(r.TableRow,{children:[l&&t.jsx(r.TableCell,{padding:"checkbox"}),o.map(({label:g,key:h,hide:m},y)=>t.jsx(r.Hidden,{only:m,children:t.jsx(r.TableCell,{children:g})},h||g||y))]})}),t.jsx(r.TableBody,{children:u&&u.length?u.map(g=>t.jsx(n,{entity:g,entityType:g.type,entityId:g.id,wrapDragInDiv:!1,collectionOptions:s,itemOptions:i,onCheck:l,onCollectionClick:()=>d(g),onItemClick:()=>c(g),...p},`${g.type}_${g.id}`)):null})]})}const Dw=()=>({root:{},entityCard:{display:"flex",justifyContent:"center"}}),Nw=(a,n)=>{const[o,s]=C.useState(!1);return{validation:o,handleValidation:d=>s(d),onDelete:()=>a.toLowerCase()==="item"?Q.item.removeItem({itemId:n}):a.toLowerCase()==="collection"?Q.collection.removeCollection({collectionId:n}):new Promise((d,c)=>{c(new Error(`Unknown entity type, is ${a}`))})}};function To({open:a,onClose:n,entity:o,entityId:s,onSuccess:i,onFailure:l,className:d,title:c,subtitle:p,validationText:u,closeButtonText:g,confirmButtonText:h,queryParams:m,DialogProps:y,CollectionCardComponent:I,CollectionCardProps:T,ItemCardComponent:b,ItemCardProps:M,showEntityPreview:L,classes:S}){const{onDelete:w,validation:A,handleValidation:v}=Nw(o,s),O=()=>w().then(E=>{n(),i(E)}).catch(l);return a?t.jsxs(r.Dialog,{open:a,onClose:n,className:x(S.root,"VdtEntityDeleteDialog-root",d),...y,children:[t.jsxs(r.DialogTitle,{disableTypography:!0,children:[t.jsx(r.Typography,{variant:"h6",children:c}),p&&t.jsx(r.Typography,{variant:"subtitle2",children:p})]}),t.jsx(r.Divider,{}),t.jsxs(r.DialogContent,{children:[L&&t.jsx("div",{className:S.entityCard,children:o==="item"?t.jsx(ne.GetItem,{itemId:s,queryParams:m,children:t.jsx(b,{titleSelector:({title:E,itemId:D})=>E||D,subheaderSelector:({created:E})=>E?Me(E).format("ll"):"",ContentComponent:null,ActionsComponent:null,...M})}):t.jsx(ne.GetCollection,{collectionId:s,queryParams:m,children:t.jsx(I,{titleSelector:({title:E,collectionId:D})=>E||D,subheaderSelector:({created:E})=>E?Me(E).format("ll"):"",avatar:o,...T})})}),t.jsx(r.FormControlLabel,{control:t.jsx(r.Checkbox,{checked:A,onChange:()=>v(!A)}),label:u})]}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{onClick:n,children:g}),t.jsx(r.Button,{variant:"contained",color:"primary",onClick:O,disabled:!A,children:h})]})]}):null}To.propTypes={open:e.bool,onClose:e.func,entityId:e.string.isRequired,entity:e.string.isRequired,onSuccess:e.func,onFailure:e.func,className:e.string,title:e.string,subtitle:e.string,validationText:e.string,closeButtonText:e.string,confirmButtonText:e.string,queryParams:e.objectOf(e.any),DialogProps:e.objectOf(e.any),CollectionCardComponent:e.elementType,CollectionCardProps:e.objectOf(e.any),ItemCardComponent:e.elementType,ItemCardProps:e.objectOf(e.any),showEntityPreview:e.bool,classes:e.objectOf(e.any)},To.defaultProps={open:!1,onClose:()=>null,onSuccess:()=>null,onFailure:()=>null,className:"VdtEntityDeleteDialog",title:"Delete entity",subtitle:"",validationText:"I understand that deleting is permanent and can't be undone",closeButtonText:"Close",confirmButtonText:"Permanently delete entity",queryParams:{field:["created","title","mimeType","durationSeconds","itemId","collectionId"],content:["metadata","thumbnail"],"noauth-url":!0},DialogProps:{},CollectionCardComponent:rt,CollectionCardProps:{},ItemCardComponent:_e,ItemCardProps:{},showEntityPreview:!0,classes:{}};const qu=r.withStyles(Dw,{name:"VdtEntityDeleteDialog"})(To);qu.displayName="EntityDeleteDialog";const bo=a=>{if(!(!a||!a.current)){if(a.current.currentTime)return a.current;if(a.current.player.currentTime)return a.current.player;if(a.current.player.videojs.currentTime)return a.current.player.videojs}},vw=({entity:a,entityId:n,metadataType:o,commentField:s="co",playerRef:i={},timeBase:l={numerator:1,denominator:25},getEntityMetadata:d=Q.metadata.getEntityMetadata,updateEntityMetadata:c=Q.metadata.updateEntityMetadata,removeGlobalMetadata:p=Q.globalmetadata.removeGlobalMetadata})=>{const[u,g]=C.useState(o),[h,m]=C.useState(""),[y,I]=C.useState(),T=y?X.formatTimeCodeSeconds(y,{timeBase:l}).toSmpte():void 0,b=C.useMemo(()=>{if(!u||!u.timespan)return;const{timespan:D=[]}=u;return D.reduce((F,z)=>{const{field:B,start:$}=z;if(B.length===0)return F;const Y=[...F];return B.forEach(({name:P,value:V=[],uuid:W})=>{P!==s||V.length===0||V.forEach(({value:_,uuid:H,user:k,timestamp:U})=>{Y.push({value:_,uuid:V.length>1?H:W,user:k,start:$,timestamp:U})})}),Y},[]).sort((F,z)=>new Date(z.timestamp)-new Date(F.timestamp))},[u,s]),M=()=>{d({entity:a,entityId:n,queryParams:{field:s}}).then(({data:D})=>{g(a==="item"?D.item[0].metadata:D)})},L=D=>m(D.target.value||""),S=()=>{const D=bo(i);if(D)if(y!==void 0||!D)I();else{const F=D.currentTime();I(F)}},w=()=>{const D=bo(i);if(!D)return;D.pause();const F=D.currentTime();y&&I(F)},A=()=>{m(""),I()};return{newComment:h,commentTimecode:y,smpteTimecode:T,commentList:b,onRefreshComments:M,onChangeTimecode:S,onChangeComment:L,onFocusComment:w,onCancelComment:A,onSubmitComment:()=>{const D=X.createMetadataType({[s]:h});if(y){const F=X.formatTimeCodeSeconds(y,{timeBase:l});F.samples=Math.round(F.samples),D.timespan[0].start=F.toText(),F.samples+=1,D.timespan[0].end=F.toText()}D.timespan[0].field[0].value[0].mode="add",c({entity:a,entityId:n,metadataDocument:D}).then(()=>{M(),A()})},onClickCommentTimecode:D=>{const F=bo(i);if(!F)return;const z=X.formatTimeCodeText(D).toSeconds();F.currentTime(z),F.played().length===0&&F.play()},onDeleteComment:D=>{p({uuid:D}).then(M)}}},xw=a=>({root:{display:"flex","&:hover":{"& $commentAction":{visibility:"visible"}}},commentBody:{paddingRight:a.spacing(1),paddingLeft:a.spacing(1),flexGrow:1},commentHeader:{display:"flex","& div":{marginRight:a.spacing(1)}},comments:{"& $root":{marginTop:a.spacing(2)}},commentUser:{fontWeight:"bold"},commentContent:{whiteSpace:"pre-line"},commentTimecode:{color:a.palette.info.dark,marginRight:a.spacing(1),verticalAlign:"unset"},commentAction:{visibility:"hidden"},menuPaper:{backgroundColor:a.palette.background.default}});function Io({className:a,classes:n,user:o,timestamp:s,start:i,value:l,onDelete:d,onClick:c,deleteText:p,MenuIconComponent:u,DeleteIconComponent:g,UserIconComponent:h}){const[m,y]=C.useState(null),I=!!m,T=M=>{y(M.currentTarget)},b=()=>{y(null)};return t.jsxs("div",{className:x(n.root,a),children:[t.jsx("div",{className:n.commentAvatar,children:t.jsx(r.Avatar,{children:o?o[0]:h})}),t.jsxs("div",{className:n.commentBody,children:[t.jsxs("div",{className:n.commentHeader,children:[t.jsx("div",{className:n.commentUser,children:o}),t.jsx("div",{className:n.commentTimestamp,children:Me(s).fromNow()})]}),t.jsxs("div",{className:n.commentContent,children:[i!=="-INF"&&t.jsx(r.ButtonBase,{className:n.commentTimecode,onClick:c,children:X.formatTimeCodeText(i).toSmpte()}),l]})]}),t.jsxs("div",{className:n.commentAction,children:[t.jsx(r.IconButton,{onClick:T,children:t.jsx(u,{})}),t.jsx(r.Menu,{className:n.Menu,elevation:0,getContentAnchorEl:null,anchorEl:m,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},variant:"menu",keepMounted:!0,open:I,PaperProps:{className:n.menuPaper,elevation:1},onClose:b,children:t.jsxs(r.MenuItem,{onClick:d,children:[t.jsx(r.ListItemIcon,{children:t.jsx(g,{fontSize:"small"})}),t.jsx(r.ListItemText,{primary:p})]})})]})]})}const Ow=r.withStyles(xw,{name:"VdtEntityCommentCard"})(Io);Io.propTypes={classes:e.objectOf(e.string),className:e.string,user:e.string.isRequired,timestamp:e.string.isRequired,start:e.string.isRequired,value:e.string.isRequired,onDelete:e.func,onClick:e.func,deleteText:e.string,MenuIconComponent:e.elementType,DeleteIconComponent:e.elementType,UserIconComponent:e.elementType},Io.defaultProps={classes:{},className:void 0,onDelete:void 0,onClick:void 0,deleteText:"Delete",MenuIconComponent:j.MoreVert,DeleteIconComponent:j.Delete,UserIconComponent:j.Person};const Ew=a=>({root:{paddingTop:a.spacing(2)},header:{...a.typography.h6,paddingBottom:a.spacing(2)},label:{fontFamily:"Monaco",fontWeight:100,fontSize:"0.75rem",fontStyle:"italic"},labelWithTimecode:{fontWeight:600,fontStyle:"normal"},buttons:{minHeight:a.spacing(4.25),display:"flex",flexDirection:"row-reverse",width:"100%",marginTop:a.spacing(1),"& button":{marginLeft:a.spacing(1)}},comments:{"& > div":{marginTop:a.spacing(2)}}});function Mo({className:a,classes:n,entity:o,entityId:s,EntityCommentCardComponent:i,EntityCommentCardProps:l,metadataType:d,commentField:c,playerRef:p,timeBase:u,getEntityMetadata:g,updateEntityMetadata:h,removeGlobalMetadata:m,noTimecodeText:y,addCommentText:I,cancelText:T,commentText:b,commentPluralText:M,loadingText:L}){const{newComment:S,commentTimecode:w,smpteTimecode:A,commentList:v,onChangeTimecode:O,onChangeComment:E,onFocusComment:D,onCancelComment:F,onSubmitComment:z,onClickCommentTimecode:B,onDeleteComment:$,onRefreshComments:Y}=vw({entity:o,entityId:s,metadataType:d,commentField:c,playerRef:p,timeBase:u,getEntityMetadata:g,updateEntityMetadata:h,removeGlobalMetadata:m});return C.useEffect(()=>{d===void 0&&Y()},[]),t.jsxs("div",{className:x(n.root,a),children:[t.jsx("div",{className:n.header,children:v?t.jsx("span",{children:`${v.length} ${v.length===1?b.toLowerCase():M.toLowerCase()}`}):t.jsx("span",{children:L})}),t.jsx(r.TextField,{className:n.TextField,value:S,onChange:E,fullWidth:!0,variant:"standard",placeholder:I,multiline:!0,InputProps:{onFocus:D,startAdornment:t.jsx(r.InputAdornment,{position:"start",children:t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{size:"small",color:"primary",checked:w!==void 0,onChange:O}),label:A||y,classes:{label:x(n.label,{[n.labelWithTimecode]:w!==void 0})}})})}}),t.jsx("div",{className:n.buttons,children:S&&t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{className:n.commentButton,color:"primary",variant:"contained",disableElevation:!0,onClick:z,children:b}),t.jsx(r.Button,{className:n.cancelButton,variant:"text",disableElevation:!0,onClick:F,children:T})]})}),t.jsx("div",{className:n.comments,children:v?v.map(({uuid:P,value:V,start:W,user:_,timestamp:H})=>t.jsx(i,{uuid:P,value:V,start:W,user:_,timestamp:H,onDelete:()=>$(P),onClick:()=>B(W),...l},P)):null})]})}const jw=r.withStyles(Ew,{name:"VdtEntityComment"})(Mo);Mo.propTypes={classes:e.objectOf(e.string),className:e.string,entityId:e.string.isRequired,entity:e.oneOf(["item","collection"]).isRequired,EntityCommentCardComponent:e.elementType,EntityCommentCardProps:e.objectOf(e.any),metadataType:e.objectOf(e.any),commentField:e.string,playerRef:e.shape({current:e.instanceOf(Element)}),timeBase:e.shape({numerator:e.number,denominator:e.number}),getEntityMetadata:e.func,updateEntityMetadata:e.func,removeGlobalMetadata:e.func,noTimecodeText:e.string,addCommentText:e.string,cancelText:e.string,commentText:e.string,commentPluralText:e.string,loadingText:e.string},Mo.defaultProps={classes:{},className:void 0,EntityCommentCardComponent:Ow,EntityCommentCardProps:{},metadataType:void 0,commentField:"co",playerRef:void 0,timeBase:{numerator:1,denominator:25},getEntityMetadata:Q.metadata.getEntityMetadata,updateEntityMetadata:Q.metadata.updateEntityMetadata,removeGlobalMetadata:Q.globalmetadata.removeGlobalMetadata,noTimecodeText:"No Timecode",addCommentText:"Add a comment",cancelText:"Cancel",commentText:"Comment",commentPluralText:"Comments",loadingText:""};const Pw={root:{}};function Vu({className:a,classes:n={},anchorEl:o,allowDuplicates:s=!1,onMenuClick:i,onMenuClose:l,onEmptyBinClick:d,onAddToCollectionClick:c,onAllowDuplicatesClick:p,emptyBinText:u="Empty Bin",addCollectionText:g="Add to collection",allowDuplicatesText:h="Allow duplicates"}){return t.jsxs("div",{className:x(n.root,a),children:[t.jsx(r.IconButton,{"aria-label":"options",onClick:i,component:r.ButtonBase,disableRipple:!0,children:t.jsx(j.MoreVert,{})}),t.jsxs(r.Menu,{anchorEl:o,keepMounted:!0,open:!!o,onClose:l,elevation:1,PaperProps:{square:!0},getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[t.jsxs(r.MenuItem,{onClick:d,children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.Delete,{})}),t.jsx(r.ListItemText,{primary:u})]}),t.jsxs(r.MenuItem,{onClick:c,children:[t.jsx(r.ListItemIcon,{children:t.jsx(j.AddCircle,{})}),t.jsx(r.ListItemText,{primary:g})]}),t.jsx(r.MenuItem,{children:t.jsx(r.FormGroup,{row:!0,children:t.jsx(r.FormControlLabel,{control:t.jsx(r.Switch,{checked:s,onChange:p,name:"checked",color:"primary"}),label:h})})})]})]})}const kw="BIN";function Fw({innerProps:{onDelete:a,id:n}}){return t.jsx(r.IconButton,{"aria-label":"Remove",onClick:()=>a(n),children:t.jsx(j.Delete,{})})}function zw({children:a,classes:n,className:o,...s}){return t.jsx("div",{className:x(o,n.root),...s,children:a})}const Bw=a=>({root:{transition:"background-color 0.3s ease",paddingLeft:a.spacing(2),paddingRight:a.spacing(2),paddingTop:a.spacing(1),paddingBottom:a.spacing(1),minHeight:60,minWidth:300},canDrop:{boxShadow:`inset 0px 0px 1px 1px ${a.palette.primary.main}`,"&.VdtDroppable-isOver":{backgroundColor:r.emphasize(a.palette.background.paper,.05)}}}),qw=ne.compose(r.withStyles(Bw,{name:"VdtBinContentDroppable"}),We)(zw),Vw={isDragging:{opacity:0}},Gw=ne.compose(r.withStyles(Vw,{name:"VdtEntityCardDraggable"}),Mt)(Fu),Uw={root:{minWidth:340}};function Lo({className:a,classes:n,title:o,bin:s,allowDuplicates:i,onDelete:l,onEmptyBin:d,onDrop:c,onSort:p,onAddToCollectionSuccess:u,onAllowDuplicates:g,ActionComponent:h,ActionProps:m,AddToCollectionDialogComponent:y,AddToCollectionDialogProps:I,BinContentComponent:T,BinContentProps:b,BinItemComponent:M,BinItemProps:L,BinItemMenuComponent:S,BinItemMenuProps:w,BinProps:A}){const[v,O]=C.useState(null),[E,D]=C.useState(!1),[F,z]=Da({throwOnReject:!1}),B=C.useMemo(()=>s&&s.map(({entity:{id:V},entityType:W,entityTimespan:{start:_,end:H}={}})=>({id:V,type:W,metadata:{field:_?[{key:"start",value:X.formatTimeCodeText(_).toText({fraction:!0})},{key:"end",value:X.formatTimeCodeText(H).toText({fraction:!0})}]:[]}})),[s]),$=V=>{O(V.currentTarget)},Y=()=>{O(null)},P=()=>{z().then(V=>{V&&(Y(),d())})};return t.jsxs(t.Fragment,{children:[t.jsxs(r.Paper,{className:x(a,n.root,"VdtBinList-root"),...A,children:[t.jsx(r.CardHeader,{title:o,titleTypographyProps:{variant:"button",color:"textSecondary"},action:h?t.jsx(h,{anchorEl:v,allowDuplicates:i,onMenuClick:$,onMenuClose:Y,onEmptyBinClick:P,onAddToCollectionClick:()=>D(!0),onAllowDuplicatesClick:({target:{checked:V}={}})=>g(V),...m}):void 0}),t.jsx(T,{onDrop:c,dropInfo:{entityType:kw},ignoreDropOnExitingIds:!0,...b,children:s&&s.map((V,W)=>t.jsx("div",{style:{marginBottom:10},children:t.jsx(M,{...V,id:V.binId,index:W,onSort:p,onDelete:l,CardProps:{elevation:1},titleTypographyProps:{noWrap:!0,style:{width:160}},subheaderTypographyProps:{noWrap:!0,style:{width:160}},MenuComponent:S,MenuProps:w,...L})},V.binId))})]}),F&&t.jsx(F,{titleText:"Empty bin",confirmText:"Empty",rejectText:"Close",children:t.jsx(r.DialogContent,{children:t.jsx(r.DialogContentText,{children:"Are you sure you want to empty the bin?"})})}),y&&t.jsx(r.Dialog,{open:E,onClose:()=>D(!1),children:t.jsx(y,{onSuccess:(V=[],W={})=>{const{data:{id:_}={}}=W;u(V.length?V:[_]),D(!1)},onClose:()=>D(!1),entities:B,...I})})]})}Lo.propTypes={classes:e.objectOf(e.string).isRequired,className:e.string,title:e.string,bin:e.arrayOf(e.objectOf(e.any)),allowDuplicates:e.bool,onDelete:e.func,onEmptyBin:e.func,onDrop:e.func,onSort:e.func,onAddToCollectionSuccess:e.func,onAllowDuplicates:e.func,ActionComponent:e.elementType,AddToCollectionDialogComponent:e.elementType,BinContentComponent:e.elementType,BinItemComponent:e.elementType,BinItemMenuComponent:e.elementType,ActionProps:e.objectOf(e.any),AddToCollectionDialogProps:e.objectOf(e.any),BinContentProps:e.objectOf(e.any),BinItemProps:e.objectOf(e.any),BinItemMenuProps:e.objectOf(e.any),BinProps:e.objectOf(e.any)},Lo.defaultProps={className:void 0,title:"Bin",bin:[],allowDuplicates:!1,onDelete:()=>null,onEmptyBin:()=>null,onDrop:()=>null,onSort:()=>null,onAddToCollectionSuccess:()=>null,onAllowDuplicates:()=>null,ActionComponent:Vu,ActionProps:{},AddToCollectionDialogComponent:Ma,AddToCollectionDialogProps:{},BinContentComponent:qw,BinContentProps:{},BinItemComponent:Gw,BinItemProps:{},BinItemMenuComponent:Fw,BinItemMenuProps:{},BinProps:{}};const Gu=r.withStyles(Uw,{name:"VdtBinList"})(Lo);Gu.displayName="BinList";const Uu=r.withStyles(Pw,{name:"VdtBinListMenu"})(Vu);Uu.displayName="BinListMenu";const $w=r.withStyles({},{name:"VdtLoadMoreTreeItem"})(({className:a,classes:n,onClick:o=()=>null,text:s="Load more",LoadMoreProps:i={}})=>{const l=t.jsx(r.Box,{className:x(n.label,"VdtLoadMoreTreeItem-label"),children:t.jsx(r.Typography,{variant:"body1",children:s})});return t.jsx(oe.TreeItem,{className:x(a,n.root,"VdtLoadMoreTreeItem-root"),nodeId:Sp,label:l,onClick:o,...i})}),Yw=a=>({isOver:{"& .VdtLoadMoreTreeItem-label":{backgroundColor:a.palette.primary.main}}}),Ww=ne.compose(r.withStyles(Yw,{name:"VdtLoadMoreDroppable"}),We)($w),_w={root:{},label:{minHeight:"24px"}},Qw=r.withStyles(_w,{name:"VdtDropZoneTreeItem"})(({className:a,classes:n,DropZoneProps:o={}})=>{const s=t.jsx(r.Box,{className:x(n.label,"VdtDropZoneTreeItem-label")});return t.jsx(oe.TreeItem,{className:x(a,n.root,"VdtDropZoneTreeItem-root"),nodeId:wp,label:s,disabled:!0,...o})}),Hw=a=>({isOver:{backgroundColor:a.palette.primary.main}}),Zw=ne.compose(r.withStyles(Hw,{name:"VdtDropZoneDroppable"}),We)(Qw);function $u({entries:a=[],hits:n,collectionId:o,nodeId:s=[Ie,o].join(ot),onLoadMore:i,onError:l,onMoveEntity:d=ne.handleMoveEntity,onMoved:c=()=>null,onAdjustHits:p=()=>null,CollectionListComponent:u=Ar,ItemComponent:g=wr,LoadMoreComponent:h=Ww,DropZoneComponent:m=Zw,CollectionListProps:y={},ItemProps:I={},LoadMoreProps:T={},DropZoneProps:b={}}){const{addOrUpdateCollections:M,addOrUpdateItems:L,addAsChildrenToCollection:S,removeAsChildrenToCollection:w,getChildCollections:A,getChildItems:v}=C.useContext(Ca),O=A(o),E=v(o);C.useEffect(()=>{const $=a.filter(P=>P.collection).map(P=>P.collection),Y=a.filter(P=>P.item).map(P=>P.item);if($.length){M(o,$);const P=O.map(W=>W.id),V=$.map(W=>W.id).filter(W=>!P.includes(W));V.length&&S(V,Ie,o)}if(Y.length){L(o,Y);const P=E.map(W=>W.id),V=Y.map(W=>W.id).filter(W=>!P.includes(W));V.length&&S(V,Ye,o)}},[a]);const D=O.length+E.length,F=a.length,z=Math.min(D,F),B=({dragInfo:$,dropInfo:Y})=>{if(!$||!Y)return;const{entityId:P,entityType:V,entityParentId:W}=$,{entityId:_,entityType:H,entityParentId:k}=Y,U=H===Ie?_:k;if(U&&U===W||V===Ie&&P===U)return;d({entityId:P,entityType:V,addToCollectionId:U,removeFromCollectionId:W,rootParentId:Lr,onMoved:()=>{S(P,V,U),U===o&&p(1),w(P,V,W),W===o&&p(-1),c()},onError:l})};return t.jsxs(t.Fragment,{children:[O.length?O.map($=>t.jsx(u,{parentCollectionId:o,collection:$,onDrop:B,ItemProps:I,...y},[Ie,$.id,Ie,o].join(ot))):void 0,E.length?E.map($=>t.jsx(g,{item:$,parentCollectionId:o,onDrop:B,...I},[Ye,$.id,Ie,o].join(ot))):void 0,n!==void 0&&n>z?t.jsx(h,{nodeId:s,onClick:()=>i(z),onDrop:B,dropInfo:{entityParentId:o},...T}):!E.length&&t.jsx(m,{nodeId:s,onDrop:B,dropInfo:{entityParentId:o},disabled:!0,...b})]})}const Jw={interval:"generic",queryParams:{field:["mimeType"],content:["metadata"]},itemSearchDocument:{operator:{field:[{name:"__parent_collection",value:[{value:""}]},{name:"__collection",value:[{value:""}]}],operation:"OR"},sort:[{field:"_type",order:"ascending"},{field:"title",order:"descending"}]}},Xw={root:{}};function Kw({className:a,classes:n,searchState:o=Jw,rootCollectionId:s=Lr,first:i=1,number:l=5,selected:d,expanded:c,selectOnToggle:p=!0,onChange:u=()=>null,onExpanded:g=()=>null,onError:h=({message:T,error:b})=>console.error(`${T}
9
- ${b}`),EntityTreeListComponent:m=$u,EntityTreeListProps:y={},TreeViewProps:I={}}){const[T,b]=C.useState([]),[M,L]=C.useState(),{entry:S=[]}=T,w=()=>{try{Q.search.searchItemCollection({...o,matrixParams:{first:i,number:l}}).then(({data:D})=>{b(D),L(D.hits)}).catch(D=>{h({message:"Could not search",error:D})})}catch(D){h({message:"Could not search",error:D})}},A=C.useCallback(D=>{const F=D+1;if(!(F>M))try{Q.search.searchItemCollection({...o,matrixParams:{first:F,number:l}}).then(({data:z})=>{const{entry:B=[],...$}=z;b(Y=>({...$,entry:[...B,...Y.entry]})),L(z.hits)}).catch(z=>{h({message:"Could not search for more",error:z})})}catch(z){h({message:"Could not search for more",error:z})}},[T]),v=D=>{const{target:{parentElement:F={}}={}}=D,z=F.parentElement||{};return F.className==="MuiTreeItem-iconContainer"||z.className==="MuiTreeItem-iconContainer"},O=(D,F)=>{!p&&v(D)||typeof F=="string"&&(F.startsWith(Sp)||F.startsWith(wp))||u(F)},E=(D,F)=>{g(F)};return C.useEffect(w,[s]),t.jsx(oe.TreeView,{className:x(n.root,"VdtEntityTree-root",a),defaultCollapseIcon:t.jsx(j.ExpandMore,{}),defaultExpandIcon:t.jsx(j.ChevronRight,{}),onNodeSelect:O,onNodeToggle:E,selected:d,expanded:c,...I,children:t.jsx(hb,{children:t.jsx(m,{hits:M,entries:S,collectionId:s,onLoadMore:A,onAdjustHits:D=>L(F=>F+D),onError:h,...y})})})}const Rw=r.withStyles(Xw,{name:"VdtEntityTree"})(Kw);function eA({classes:a,className:n,value:o,defaultOption:s,options:i,onChange:l,getOptionLabel:d=g=>g.label,getOptionOnClick:c=g=>g.onClick,getOptionDisabled:p=g=>g.disabled||!1,getOptionSelected:u=(g,h)=>g.label===h.label}){const[g,h]=C.useState(!1),m=C.useRef(null),[y,I]=C.useState(s||i[0]),T=o||i.find(S=>u(S,y)),b=S=>{l&&l(S),I(S),h(!1)},M=()=>{h(S=>!S)},L=S=>{m.current&&m.current.contains(S.target)||h(!1)};return t.jsxs("div",{className:x(a.root,"VdtSplitButton-root",n),children:[t.jsxs(r.ButtonGroup,{variant:"contained",color:"primary",ref:m,children:[t.jsx(r.Button,{onClick:c(T),disabled:p(T),children:d(T)}),i.length>1&&t.jsx(r.Button,{color:"primary",size:"small",onClick:M,disabled:i.every(S=>S.disabled),children:t.jsx(j.ArrowDropDown,{})})]}),t.jsx(r.Popper,{open:g,anchorEl:m.current,role:void 0,transition:!0,disablePortal:!0,children:t.jsx(r.Paper,{children:t.jsx(r.ClickAwayListener,{onClickAway:L,children:t.jsx(r.MenuList,{children:i.map(S=>t.jsx(r.MenuItem,{disabled:p(S),selected:S===T,onClick:()=>b(S),children:d(S)},d(S)))})})})})]})}const tA=r.withStyles({},{name:"VdtSplitButton"})(eA);function aA(a){const n={},o=a.file.path.split("/").filter(i=>i.length>0);return o[0]=`/${o[0]}`,o.map((i,l)=>o.slice(0,l+1).join("/")).reduce((i,l,d,c)=>i[l]=c.length===d+1?a:{},n),n}function nA(a){return Tg(...a.map(n=>aA(n)))}function Yu({fileTree:a,files:n,...o}){const{clickFile:s,removeFile:i,removeFolder:l,selectedFilePath:d,FileComponent:c,FileProps:p,FolderComponent:u,FolderProps:g}=o;return Object.entries(a).map(([h,m])=>m.file instanceof File?t.jsx(oe.TreeItem,{nodeId:h,label:t.jsx(c,{file:m.file,progress:m.progress,onRemove:i(m.file.path),onClick:s(m.file.path),selected:d===m.file.path,...p},h)},h):t.jsx(oe.TreeItem,{nodeId:`${h}`,label:t.jsx(u,{path:h,files:n.filter(y=>y.file.path.startsWith(`${h}/`)),onRemove:l(h),...g}),children:t.jsx(Yu,{fileTree:m,files:n,...o})},`${h}`))}function rA({files:a,removeFiles:n,onClickFile:o,selectedFile:s,FileComponent:i,FileProps:l={},FolderComponent:d,FolderProps:c={}}){const p=C.useMemo(()=>nA(a),[a]),u=y=>()=>{const I=a.map((T,b)=>T.file.path.startsWith(`${y}/`)&&b).filter(T=>T!==!1);n(I)()},g=y=>()=>{const I=a.findIndex(T=>T.file.path===y);n([I])()},h=y=>()=>{const I=a.findIndex(T=>T.file.path===y);o(I)()},m=C.useMemo(()=>{if(!Number.isNaN(s)&&!(s<0||s>=a.length)&&a[s])return a[s].file.path},[s,a]);return p&&t.jsx(oe.TreeView,{children:t.jsx(Yu,{fileTree:p,files:a,clickFile:h,removeFile:g,removeFolder:u,onClickFile:o,selectedFilePath:m,FileComponent:i,FileProps:l,FolderComponent:d,FolderProps:c})})}const oA=a=>({form:{"& > *":{marginTop:a.spacing(1.5),marginBottom:a.spacing(1.5)}}});function sA({classes:a,onChange:n,values:o}){return t.jsx("div",{className:a.root,children:t.jsxs("div",{className:a.form,children:[t.jsx(r.TextField,{onChange:n("title"),value:o.title,label:"Title",variant:"outlined",required:!0,fullWidth:!0,InputLabelProps:{shrink:!0}}),t.jsx(r.TextField,{onChange:n("dsc"),value:o.dsc,label:"Description",variant:"outlined",rows:"8",multiline:!0,fullWidth:!0,InputLabelProps:{shrink:!0}}),t.jsx(oe.Autocomplete,{onChange:n("tcd"),value:Array.isArray(o.tcd)?o.tcd:o.tcd?[o.tcd]:[],multiple:!0,freeSolo:!0,selectOnFocus:!0,clearOnBlur:!0,handleHomeEndKeys:!0,options:[],onInputChange:(s,i)=>{if(i.endsWith(",")){const[l]=i.split(","),c=[...Array.isArray(o.tcd)?o.tcd:o.tcd?[o.tcd]:[],l];n("tcd")(s,c)}},renderInput:s=>t.jsx(r.TextField,{...s,variant:"outlined",label:"Tags",InputLabelProps:{shrink:!0}})})]})})}const Wu=r.withStyles(oA,{name:"VdtUploadForm"})(sA),iA=a=>({root:{backgroundColor:a.palette.action.selected,height:"100%",padding:a.spacing(2)},title:{...a.typography.body1,paddingLeft:a.spacing(2),marginBottom:a.spacing(1),fontStyle:"italic",fontWeight:600,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},form:{padding:a.spacing(2),backgroundColor:a.palette.background.default}});function lA({classes:a,file:n,metadata:o={},onChange:s,UploadFormComponent:i=Wu,UploadFormProps:l={}}){const{name:d}=n,c=p=>(u,g)=>{const{value:h}=u.target,m={[p]:g||h};s(m)};return t.jsxs("div",{className:a.root,children:[t.jsx("div",{className:a.title,children:d}),t.jsx("div",{className:a.form,children:t.jsx(i,{values:o,onChange:c,...l})})]})}const _u=r.withStyles(iA,{name:"VdtUploadEditor"})(lA);function dA(a){const{value:n}=a;return t.jsxs(r.Box,{display:"flex",alignItems:"center",children:[t.jsx(r.Box,{width:"100%",mr:1,children:t.jsx(r.LinearProgress,{variant:"determinate",...a})}),t.jsx(r.Box,{minWidth:35,children:n&&t.jsx(r.Typography,{variant:"body2",color:"textSecondary",children:`${Math.round(n)}%`})})]})}const cA=a=>({fileListItemSecondaryAction:{visibility:"hidden"},fileListItemContainer:{cursor:"pointer","&:not(:first-of-type)":{marginTop:a.spacing(.5)},backgroundColor:r.emphasize(a.palette.background.paper,.05),"&:hover $fileListItemSecondaryAction":{visibility:"visible"},"&:hover $successIcon":{visibility:"hidden"},"&:hover $progressIcon":{visibility:"hidden"}},fileListItemContainerComplete:{cursor:"default"},fileListItemContainerHover:{"&:hover":{backgroundColor:r.emphasize(a.palette.background.paper,.1)}},successIcon:{color:a.palette.success.main,visibility:"visible"},progressIcon:{visibility:"visible"},errorIcon:{color:a.palette.error.main},progressRoot:{minHeight:16},thumbsContainer:{display:"flex",flexDirection:"row",flexWrap:"wrap",marginTop:16},thumb:{display:"inline-flex",borderRadius:2,border:"1px solid #eaeaea",marginBottom:8,marginRight:8,width:80,height:80,padding:4,boxSizing:"border-box"},thumbInner:{display:"flex",width:"100%",overflow:"hidden"},media:{display:"block",width:"auto",height:"100%"},full:{width:"100%",height:"100%"}});function pA({classes:a,file:n,progress:o,onRemove:s,onClick:i,selected:l,isUploading:d,ProgressComponent:c=dA,ProgressProps:p={},CompleteIcon:u=j.CheckCircle,ProgressIcon:g=j.QueryBuilder,DeleteIcon:h=j.Delete,MimeTypeAvatarIcon:m=Ke}){const{type:y,size:I,name:T,preview:b}=n,M=o&&o.transferedBytes?Math.floor(o.transferedBytes/o.totalBytes*100):0,L=M===100,S=I?bg.filesize(I,{base:2,standard:"jedec"}):void 0;let w;return y.includes("image")?w="image":y.includes("video")?w="video":w="other",t.jsxs(r.ListItem,{ContainerComponent:"div",ContainerProps:{className:x(a.fileListItemContainer,{[a.fileListItemContainerHover]:!l},{[a.fileListItemContainerComplete]:L})},onClick:L?void 0:i,selected:l,children:[t.jsx("aside",{className:a.thumbsContainer,children:t.jsx("div",{className:a.thumb,children:t.jsxs("div",{className:a.thumbInner,children:[w==="image"&&t.jsx("img",{src:b,className:a.media,alt:T}),w==="video"&&t.jsx("video",{className:a.media,autoPlay:!0,muted:!0,children:t.jsx("source",{src:b,type:y})}),w==="other"&&t.jsx(r.ListItemAvatar,{className:a.full,children:t.jsx(r.Avatar,{variant:"square",className:a.full,children:t.jsx(m,{mimeType:y,fontSize:"large"})})})]})},T)}),t.jsx(r.ListItemText,{disableTypography:!0,primary:t.jsxs("div",{children:[t.jsx(r.Typography,{variant:"body1",component:"span",display:"block",noWrap:!0,children:T}),I&&t.jsx(r.Typography,{variant:"body2",component:"span",display:"block",noWrap:!0,children:S}),t.jsx("div",{className:a.progressRoot,children:o&&t.jsx(c,{value:M,...p})})]})}),o&&t.jsx(r.ListItemSecondaryAction,{children:L?t.jsx(u,{className:a.successIcon}):t.jsx(g,{className:a.progressIcon})}),t.jsx(r.ListItemSecondaryAction,{classes:{root:a.fileListItemSecondaryAction},children:t.jsx(r.IconButton,{edge:"end",onClick:s,disabled:d,children:t.jsx(h,{})})})]})}const Sa=r.withStyles(cA,{name:"VdtUploadListItem"})(pA);function uA({path:a,files:n,...o}){const s=n.reduce((p,u)=>p+u.file.size||0,0),i=n.reduce((p,u)=>p+(u.progress&&u.progress.transferedBytes||0),0),d=(n.some(p=>p.progress)||void 0)&&{transferedBytes:i,totalBytes:s},c={size:s,type:"collection",name:a.split("/").pop()};return t.jsx(Sa,{file:c,progress:d,...o})}const gA=a=>({root:{paddingLeft:a.spacing(2),paddingRight:a.spacing(2)},dropzoneRoot:{cursor:"pointer",marginTop:a.spacing(1),marginBottom:a.spacing(1),paddingLeft:a.spacing(.5),paddingRight:a.spacing(.5)},dropzoneLabel:{color:a.palette.text.secondary,...a.typography.body1},dropzoneInput:{marginTop:a.spacing(.5),minHeight:"50vh",minWidth:a.spacing(4),borderWidth:2,borderColor:"grey",borderRadius:3,borderStyle:"dotted",backgroundColor:"rgba(0,0,0,0.05)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",transition:"min-height 0.3s"},dropzoneDrag:{borderStyle:"solid",backgroundColor:"rgba(0,0,0,0.1)"},dropzoneHasFiles:{minHeight:a.spacing(8)},dialogContentRoot:{display:"flex"},filesRoot:{width:"100%",transition:"width 0.3s"},editorRoot:{width:0,transition:"width 0.3s",marginTop:a.spacing(1),marginBottom:a.spacing(1)},editorOpen:{backgroundColor:r.emphasize(a.palette.background.paper,.05)},isEditing:{width:"50%"},uploadToCollectionDialog:{position:"absolute",top:"20%"},divider:{margin:"20px 0 20px 0"}});function hA({selected:a=-1,startIndex:n=0,onClickFile:o,removeFiles:s,...i}){const l=c=>o(c+n),d=c=>s(c.map(p=>p+n));return t.jsx(rA,{selectedFile:a-n,onClickFile:l,removeFiles:d,...i})}function yA({onSubmit:a,...n}){const o=(s,i)=>Q.collection.createCollection({collectionDocument:i}).then(({data:{id:l}})=>[l]);return t.jsx(Ma,{className:"VdtUploadCollectionPicker-root",entities:[],titleText:"Upload To Collection",submitText:"Upload",onSubmit:(s,i)=>i,onCreate:o,onSuccess:(s,i)=>a(i),...n})}function mA({classes:a,onSuccess:n,useUploadFiles:o=ne.useUploadFiles,uploadProps:s={},UploadListItemComponent:i=Sa,UploadListItemProps:l={},tree:d=!1,responseTimeout:c=5e3,UploadListFileComponent:p=Sa,UploadListFileProps:u={},UploadListFolderComponent:g=uA,UploadListFolderProps:h={},FileTreeComponent:m=hA,FileTreeProps:y={},UploadEditorComponent:I=_u,UploadEditorProps:T={},UploadCollectionPickerComponent:b=yA,UploadCollectionPickerProps:M={},UploadCollectionDialogProps:L={},allowUploadToCollection:S=!0,allowUpload:w=!0,dropzoneProps:A={},UploadButtonDisabledText:v="Uploading",UploadButtonText:O="Upload",UploadToCollectionButtonText:E="Upload To Collection",DragActiveText:D="Drop files here",DragInactiveText:F="Drop files or click to open"}){const[z,B]=C.useState(),[$,Y]=C.useState(!1),{onAddFiles:P,onChangeMetadata:V,onUpload:W,onRemoveFiles:_,onRemoveFile:H,files:k}=o(s),U=k.filter(se=>!se.progress),K=k.filter(se=>se.progress),Z=se=>()=>{se.includes(z)?B():z&&se[0]<z&&B(z-1),_(se)()},J=se=>()=>{z===se&&B(),H(se)()},q=se=>()=>B(me=>me===se?void 0:se),{getRootProps:G,getInputProps:R,isDragActive:ae}=ss.useDropzone({onDrop:se=>{P(se.map(me=>Object.assign(me,{preview:URL.createObjectURL(me)})))},...A}),te=C.useCallback(se=>{B(),Y(!0),W(se).then(me=>{Y(!1),setTimeout(()=>{n&&n(me)},c)}).catch(()=>{Y(!1)})},[n,W,c]),re=U.length===0||$,[ce,pe]=C.useState(!1);return t.jsxs("div",{className:a.root,children:[t.jsxs("div",{className:a.dialogContentRoot,children:[t.jsxs("div",{className:x(a.filesRoot,{[a.isEditing]:z!==void 0}),children:[t.jsx("div",{className:a.dropzoneRoot,children:t.jsxs("div",{...G(),className:x(a.dropzoneInput,{[a.dropzoneDrag]:ae,[a.dropzoneHasFiles]:k.length>0}),children:[t.jsx("div",{className:a.dropzoneLabel,children:ae?D:F}),t.jsx("input",{...R()})]})}),U.length>0&&(d?t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Queue"}),t.jsx(m,{files:U,FileComponent:p,FileProps:{isUploading:$,...u},FolderComponent:g,FolderProps:h,removeFiles:Z,onClickFile:q,selected:z,...y}),t.jsx(r.Divider,{className:a.divider})]}):t.jsxs(t.Fragment,{children:[t.jsxs(r.List,{dense:!0,children:[t.jsx("h3",{children:"Queue"}),U.map((se,me)=>t.jsx(i,{file:se.file,progress:se.progress,onRemove:J(me),onClick:q(me),selected:z===me,isUploading:$,...l},se.file.name))]}),t.jsx(r.Divider,{className:a.divider})]})),K.length>0&&(d?t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Uploaded"}),t.jsx(m,{files:K,FileComponent:p,FileProps:{isUploading:$,...u},FolderComponent:g,FolderProps:h,removeFiles:Z,onClickFile:q,selected:z,startIndex:U.length,...y}),t.jsx(r.Divider,{className:a.divider})]}):t.jsxs(t.Fragment,{children:[t.jsxs(r.List,{dense:!0,children:[t.jsx("h3",{children:"Uploaded"}),K.map((se,me)=>t.jsx(i,{file:se.file,progress:se.progress,onRemove:J(U.length+me),onClick:q(U.length+me),selected:z===U.length+me,isUploading:$,...l},se.file.name))]}),t.jsx(r.Divider,{className:a.divider})]}))]}),t.jsx("div",{className:x(a.editorRoot,{[a.isEditing]:z!==void 0,[a.editorOpen]:z!==void 0}),children:z!==void 0&&t.jsx(I,{onChange:V(z),file:k[z].file,metadata:k[z].metadata,...T})})]}),t.jsx(r.DialogActions,{children:t.jsx(tA,{options:[...w?[{value:"upload",label:$?v:O,onClick:se=>{se.preventDefault(),te()},disabled:re}]:[],...S?[{value:"upload-to-collection",label:$?v:E,onClick:()=>pe(!0),disabled:re}]:[]],getOptionSelected:(se,me)=>se.value===me.value})}),t.jsx(r.Dialog,{fullWidth:!0,open:ce,onClose:()=>pe(!1),classes:{paper:a.uploadToCollectionDialog},...L,children:t.jsx(b,{onSubmit:se=>{te({collectionId:se}),pe(!1)},onClose:()=>pe(!1),...M})})]})}const fA=r.withStyles(gA,{name:"VdtUpload"})(mA),Qu=C.createContext();function CA({children:a,...n}){return t.jsx(Qu.Provider,{value:n,children:a})}const TA=()=>{const a=C.useContext(Qu);if(a===void 0)throw new Error("useMediaCardContext must be used within a MediaCardProvider");return a},bA=a=>({root:{height:"100%",display:"flex",alignItems:"flex-end"},expand:{transform:"rotate(0deg)",marginLeft:"auto",transition:a.transitions.create("transform",{duration:a.transitions.duration.shortest})},expanded:{transform:"rotate(180deg)"},IconComponent:{}});function IA({classes:a,className:n,expanded:o,onExpand:s,IconComponent:i=j.ExpandMore}){return t.jsx("div",{className:x(n,a.root),children:t.jsx(r.IconButton,{className:x(a.expand,{[a.expanded]:o}),onClick:s,children:t.jsx(i,{className:a.IconComponent})})})}const MA=r.withStyles(bA,{name:"VdtMediaCardExpand"})(IA),LA=a=>({root:{width:"100%",borderColor:"transparent",borderWidth:.7,borderStyle:"solid",transition:"border-color .2s ease-out"},selected:{borderColor:a.palette.secondary.main}});function SA({className:a,classes:n,selected:o,children:s,...i}){return t.jsx(r.Card,{className:x(n.root,{[n.selected]:o},"VdtMediaCardFullWidthCard-root",a),elevation:2,...i,children:s})}const wA=r.withStyles(LA,{name:"VdtMediaCardFullWidthCard"})(SA),AA=a=>({root:{paddingBottom:a.spacing(1),paddingTop:a.spacing(1),"&:last-child":{paddingBottom:a.spacing(1)}},Typography:{...a.typography.body2,color:a.palette.text.secondary},truncate:{display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden"},Tooltip:{}});function DA({classes:a,className:n,content:o,truncateContentRows:s=3,TooltipProps:i={},TypographyProps:l={},enterDelay:d=500,component:c="p"}){return t.jsx(r.CardContent,{className:x(n,a.root),children:t.jsx(r.Tooltip,{className:a.Tooltip,title:o,enterDelay:d,...i,children:t.jsx(r.Typography,{className:x(a.Typography,{[a.truncate]:s}),component:c,style:{WebkitLineClamp:s===!1?void 0:s},...l,children:o})})})}const Hu=r.withStyles(AA,{name:"VdtMediaCardFullWidthContent"})(DA),NA=a=>({root:{paddingLeft:a.spacing(2),paddingRight:a.spacing(2),paddingTop:a.spacing(1),paddingBottom:a.spacing(1),overflow:"hidden"},content:{overflow:"hidden"}});function vA({classes:a,className:n,title:o,titleTypographyProps:s={noWrap:!0},subheader:i,subheaderTypographyProps:l={noWrap:!0},...d}){return t.jsx(r.CardHeader,{className:n,title:o,titleTypographyProps:s,subheader:i,subheaderTypographyProps:l,classes:{root:a.root,content:a.content},...d})}const xA=r.withStyles(NA,{name:"MediaCardFullWidthHeader"})(vA),OA=a=>({root:{width:"100%",padding:a.spacing(1)},overflow:{overflow:"hidden"},grow:{flexGrow:1},pushRight:{marginLeft:"auto"}});function So({className:a,classes:n,onClick:o,onExpand:s,expanded:i,defaultExpanded:l,onSelect:d,selected:c,defaultSelected:p,title:u,subheader:g,image:h,content:m,expandedContent:y,CardComponent:I,CardProps:T,HeaderComponent:b,HeaderProps:M,ThumbnailComponent:L,ThumbnailProps:S,ContentComponent:w,ContentProps:A,ExpandedContentComponent:v,ExpandedContentProps:O,ExpandComponent:E,ExpandProps:D,ActionsComponent:F,ActionsProps:z,...B}){const[$,Y]=gp(l,s,i),[P,V]=gp(p,d,c);return t.jsx(CA,{expanded:$,selected:P,...B,children:t.jsxs(I,{className:x(a,n.root),selected:P,...T,children:[t.jsxs(r.Grid,{container:!0,wrap:"nowrap",children:[t.jsx(r.Grid,{item:!0,children:L&&t.jsx(L,{image:h,onClick:o,height:150,width:200,...S})}),t.jsxs(r.Grid,{container:!0,wrap:"nowrap",classes:{root:n.overflow},direction:"column",children:[t.jsxs(r.Grid,{container:!0,wrap:"nowrap",justifyContent:"space-between",children:[b&&t.jsx(r.Grid,{item:!0,classes:{root:n.overflow},children:t.jsx(b,{title:u,subheader:g,...M})}),F&&t.jsx(r.Grid,{item:!0,classes:{root:n.pushRight},children:t.jsx(F,{onSelect:V,selected:P,...z})})]}),t.jsxs(r.Grid,{container:!0,wrap:"nowrap",justifyContent:"space-between",classes:{root:n.grow},children:[w&&t.jsx(r.Grid,{item:!0,children:t.jsx(w,{content:m,...A,children:m})}),E&&t.jsx(r.Grid,{item:!0,classes:{root:n.pushRight},children:t.jsx(E,{expanded:$,onExpand:Y,...D})})]})]})]}),v&&t.jsx(r.Collapse,{className:n.expandedContent,in:$,timeout:"auto",unmountOnExit:!0,children:t.jsx(v,{content:y,truncateContentRows:0,...O})})]})})}So.propTypes={className:e.string,classes:e.objectOf(e.any),onClick:e.func,onExpand:e.func,expanded:e.bool,defaultExpanded:e.bool,selected:e.bool,defaultSelected:e.bool,onSelect:e.func,title:e.string,subheader:e.string,image:e.string,content:e.string,expandedContent:e.string,CardComponent:e.elementType,HeaderComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ThumbnailComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ContentComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ActionsComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ExpandComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ExpandedContentComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),CardProps:e.objectOf(e.any),HeaderProps:e.objectOf(e.any),ThumbnailProps:e.objectOf(e.any),ContentProps:e.objectOf(e.any),ExpandProps:e.objectOf(e.any),ExpandedContentProps:e.objectOf(e.any),ActionsProps:e.objectOf(e.any)},So.defaultProps={className:"VdtMediaCardFullWidth",classes:{},onClick:void 0,onExpand:void 0,expanded:void 0,defaultExpanded:!1,selected:void 0,onSelect:void 0,defaultSelected:!1,title:void 0,subheader:void 0,image:void 0,content:void 0,expandedContent:void 0,CardComponent:wA,HeaderComponent:xA,ThumbnailComponent:bt,ContentComponent:Hu,ExpandComponent:MA,ExpandedContentComponent:Hu,ActionsComponent:!1,CardProps:{},HeaderProps:{},ThumbnailProps:{},ContentProps:{},ExpandProps:{},ExpandedContentProps:{},ActionsProps:{}};const Zu=r.withStyles(OA,{name:"VdtMediaCardFullWidth"})(So);Zu.displayName="MediaCardFullWidth";const Ju=Object.freeze({oldPassword:"",password:"",passwordAgain:"",errors:[],loading:!1,success:!1}),Ne={SET_LOADING:"SET_LOADING",SET_ERRORS:"SET_ERRORS",SET_INPUT_VALUE:"SET_INPUT_VALUE",SET_SUCCESS:"SET_SUCCESS"};function EA(a,n){switch(n.type){case Ne.SET_LOADING:{const o={...a,loading:n.payload};return n.payload&&(o.errors=[],o.success=!1),o}case Ne.SET_ERRORS:return{...a,loading:!1,errors:n.payload,success:!1};case Ne.SET_INPUT_VALUE:{const o={...a};return o[n.payload.input]=n.payload.value,o}case Ne.SET_SUCCESS:return{...Ju,success:!0};default:throw new Error}}const jA=a=>({root:{},FormControl:{display:"flex",marginBottom:a.spacing(3)},alert:{marginBottom:a.spacing(2)}});function wo({classes:a,onSuccess:n,username:o,validateOldPassword:s,changePwdTxt:i,changePwdSuccessTxt:l,usernameErrTxt:d,identicalPwdErrTxt:c,oldPwdTxt:p,oldPwdErrTxt:u,newPwdTxt:g,repeatPwdTxt:h,noPwdTxt:m,noUserTxt:y}){const[I,T]=C.useReducer(EA,Ju),[b,M]=C.useState(!1),L=()=>M(!b),[S,w]=C.useState(o);C.useEffect(()=>{S||(T({type:Ne.SET_LOADING,payload:!0}),Q.user.whoAmI().then(({data:O})=>{w(O),T({type:Ne.SET_LOADING,payload:!1})}).catch(()=>{T({type:Ne.SET_ERRORS,payload:[d]})}))},[S,d]);const A=O=>{O.preventDefault();const{oldPassword:E,password:D,passwordAgain:F}=I;if(!D||D===""){T({type:Ne.SET_ERRORS,payload:[m]});return}if(D!==F){T({type:Ne.SET_ERRORS,payload:[c]});return}if(!S){T({type:Ne.SET_ERRORS,payload:[y]});return}T({type:Ne.SET_LOADING,payload:!0}),(()=>s===!1?Promise.resolve():Q.user.validateUserPassword({userName:S,password:E,queryParams:{type:"raw"}}))().then(()=>{Q.user.updateUserPassword({userName:S,password:D,queryParams:{type:"raw"}}).then(()=>{T({type:Ne.SET_SUCCESS}),n&&n({userName:S,password:D})}).catch(B=>{T({type:Ne.SET_ERRORS,payload:[B.message]})})}).catch(()=>{T({type:Ne.SET_ERRORS,payload:[u]})})},v=O=>E=>{T({type:Ne.SET_INPUT_VALUE,payload:{input:O,value:E.target.value}})};return t.jsxs("div",{className:a.root,children:[I.errors.map(O=>t.jsx(r.Grow,{in:!0,children:t.jsx(oe.Alert,{className:a.alert,severity:"error",children:O})},O.substring(1,5))),I.success&&t.jsx(r.Grow,{in:!0,children:t.jsx(oe.Alert,{className:a.alert,severity:"success",children:l})}),t.jsxs("form",{onSubmit:A,children:[s&&t.jsxs(r.FormControl,{variant:"filled",className:a.FormControl,children:[t.jsx(r.InputLabel,{children:p}),t.jsx(r.FilledInput,{inputProps:{tabIndex:1},type:b?"text":"password",value:I.oldPassword,onChange:v("oldPassword"),endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(r.IconButton,{onClick:L,children:b?t.jsx(j.Visibility,{}):t.jsx(j.VisibilityOff,{})})})})]}),t.jsxs(r.FormControl,{variant:"filled",className:a.FormControl,children:[t.jsx(r.InputLabel,{children:g}),t.jsx(r.FilledInput,{inputProps:{tabIndex:2},type:b?"text":"password",value:I.password,onChange:v("password"),endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(r.IconButton,{onClick:L,children:b?t.jsx(j.Visibility,{}):t.jsx(j.VisibilityOff,{})})})})]}),t.jsxs(r.FormControl,{variant:"filled",className:a.FormControl,children:[t.jsx(r.InputLabel,{children:h}),t.jsx(r.FilledInput,{inputProps:{tabIndex:3},type:b?"text":"password",value:I.passwordAgain,onChange:v("passwordAgain"),endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(r.IconButton,{onClick:L,children:b?t.jsx(j.Visibility,{}):t.jsx(j.VisibilityOff,{})})})})]})]}),t.jsx(r.Button,{variant:"contained",color:"primary",onClick:A,disabled:!(I.password&&I.passwordAgain&&!I.loading),children:I.loading?t.jsx(r.CircularProgress,{size:20,color:"inherit"}):i})]})}wo.propTypes={classes:e.objectOf(e.string),username:e.string,onSuccess:e.func,validateOldPassword:e.bool,changePwdTxt:e.string,changePwdSuccessTxt:e.string,usernameErrTxt:e.string,identicalPwdErrTxt:e.string,oldPwdTxt:e.string,oldPwdErrTxt:e.string,newPwdTxt:e.string,repeatPwdTxt:e.string,noPwdTxt:e.string,noUserTxt:e.string},wo.defaultProps={classes:{},username:void 0,onSuccess:null,validateOldPassword:!0,changePwdTxt:"Change Password",changePwdSuccessTxt:"Password successfully changed!",usernameErrTxt:"Unable to verify username.",identicalPwdErrTxt:"Passwords are not identical.",oldPwdTxt:"Old password",oldPwdErrTxt:"Unable to verify the old password.",newPwdTxt:"New password",repeatPwdTxt:"Repeat password",noPwdTxt:"No password set",noUserTxt:"Cannot determine username"};const Xu=r.withStyles(jA,{name:"VdtChangePasswordForm"})(wo),PA=a=>({DialogTitle:{margin:0,padding:a.spacing(2)},closeButton:{position:"absolute",right:a.spacing(1),top:a.spacing(1),color:a.palette.grey[500]}});function kA({classes:a,username:n,onClose:o,onSuccess:s,changePasswordTxt:i="Change Password",...l}){return t.jsxs(t.Fragment,{children:[t.jsxs(r.DialogTitle,{disableTypography:!0,className:a.DialogTitle,children:[t.jsxs(r.Typography,{variant:"h6",children:[i,n?`: ${n}`:""]}),o?t.jsx(r.IconButton,{"aria-label":"close",className:a.closeButton,onClick:o,children:t.jsx(j.Close,{})}):null]}),t.jsx(r.DialogContent,{dividers:!0,children:t.jsx(Xu,{username:n,onSuccess:d=>{s&&s(d),o()},...l})})]})}const FA=r.withStyles(PA,{name:"VdtChangePasswordDialog"})(kA);function zA({user:a={},columns:n=[],onClick:o,...s}){return t.jsx(r.TableRow,{onClick:o!==void 0?()=>o(a):void 0,style:{cursor:o!==void 0?"pointer":"initial"},...s,children:n.map(({value:i,valueComponent:l})=>t.jsx(r.TableCell,{children:l?l(a[i],a):a[i]},i))})}const BA=r.withStyles({},{name:"VdtUserRow"})(zA),qA=[{value:"userName"},{value:"realName"},{value:"disabled",valueComponent:a=>a?"Disabled":"Active"}],VA={userName:"Username",realName:"Real name",disabled:"Status"},GA=()=>({root:{}});function Ao({classes:a,className:n,users:o,columns:s,hideHeader:i,UserRowComponent:l,UserRowProps:d,userColumnLabels:c}){return t.jsx("div",{className:x(a.root,"VdtUserTable-root",n),children:t.jsx(r.TableContainer,{children:t.jsxs(r.Table,{children:[!i&&t.jsx(r.TableHead,{children:t.jsx(r.TableRow,{children:s.map(({value:p})=>t.jsx(r.TableCell,{children:c[p]},c[p]))})}),t.jsx(r.TableBody,{children:o.map(p=>t.jsx(l,{user:p,columns:s,...d},p.userName))})]})})})}Ao.propTypes={classes:e.objectOf(e.string),className:e.string,users:e.arrayOf(e.any),columns:e.arrayOf(e.any),hideHeader:e.bool,UserRowComponent:e.elementType,UserRowProps:e.objectOf(e.any),userColumnLabels:e.objectOf(e.string)},Ao.defaultProps={className:void 0,classes:{},users:[],columns:qA,hideHeader:!1,UserRowComponent:BA,UserRowProps:{},userColumnLabels:VA};const Ku=r.withStyles(GA,{name:"VdtUserTable"})(Ao);Ku.displayName="UserTable";const UA=a=>({root:{display:"flex",flexDirection:"column"},groupListItem:{"& .MuiListItemSecondaryAction-root":{visibility:"hidden"},"&:hover":{backgroundColor:r.emphasize(a.palette.background.paper,.1),"& .MuiListItemSecondaryAction-root":{visibility:"visible"}}},toggleIcon:{color:a.palette.primary.main,transform:"rotate(0deg)",transition:a.transitions.create("transform",{duration:a.transitions.duration.shortest})},toggleIconActive:{transform:"rotate(45deg)"},addGroupListItem:{color:a.palette.primary.main},addButton:{alignSelf:"flex-end"},inputGroup:{paddingBottom:a.spacing(2),display:"grid",gridAutoFlow:"column",gridTemplateColumns:"1fr auto",alignItems:"end",gridGap:a.spacing(4)},subHeader:{display:"grid",gridAutoFlow:"column",gridTemplateColumns:"auto 1fr",alignItems:"center",gridGap:a.spacing(1),backgroundColor:a.palette.background.paper,top:`-${a.spacing(2)}px`}});function Do({classes:a,className:n,onClick:o,existingGroups:s,groups:i,onAddGroups:l,onRemoveGroup:d,removeTooltip:c,subHeaderText:p,inputLabel:u,SubHeaderIcon:g,emptyText:h,addText:m,disableEdit:y,lockedGroups:I,showRoles:T,showGroups:b,AddIcon:M,RemoveIcon:L,ListProps:S,ListSubheaderProps:w,ListItemProps:A,ListItemTextProps:v,EmptyListItemProps:O,EmptyListItemTextProps:E,RemoveTooltipProps:D,RemoveIconButtonProps:F,AddListItemProps:z,AddListItemTextProps:B,CollapseProps:$,AutocompleteProps:Y,AutocompleteTextFieldProps:P,AddButtonProps:V,addButtonText:W}){const[_,H]=C.useState(!1),{group:k=[]}=s,U=k.filter(G=>G.role&&T||!G.role&&b),{group:K=[]}=i,Z=K.filter(G=>G.role&&T||!G.role&&b).map(G=>G.groupName),[J,q]=C.useState([]);return t.jsxs("div",{className:x(a.root,"VdtGroupRelationList-root",n),children:[t.jsxs(r.List,{dense:!0,className:a.List,subheader:t.jsxs(r.ListSubheader,{disableGutters:!0,className:a.subHeader,...w,children:[g&&t.jsx(g,{}),p]}),...S,children:[U.length?U.map(G=>t.jsxs(r.ListItem,{classes:{container:a.groupListItem},disabled:I.includes(G.groupName),onClick:o?R=>o(R,{groupName:G.groupName,groupType:G}):void 0,button:!!o,...A,children:[t.jsx(r.ListItemText,{primary:G.groupName,primaryTypographyProps:{variant:"body2"},...v}),d&&!y&&!I.includes(G.groupName)&&t.jsx(r.ListItemSecondaryAction,{children:t.jsx(r.Tooltip,{title:c,...D,children:t.jsx("span",{children:t.jsx(r.IconButton,{size:"small",onClick:()=>d(G.groupName),...F,children:t.jsx(L,{})})})})})]},G.groupName)):t.jsx(r.ListItem,{...O,children:t.jsx(r.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"},...E})}),l&&!y&&t.jsxs(r.ListItem,{button:!0,className:a.addGroupListItem,onClick:()=>H(G=>!G),...z,children:[t.jsx(r.ListItemIcon,{children:t.jsx(M,{className:x(a.toggleIcon,{[a.toggleIconActive]:_})})}),t.jsx(r.ListItemText,{primary:m,primaryTypographyProps:{variant:"body1"},...B})]})]}),l&&!y&&t.jsx(r.Collapse,{in:_,timeout:"auto",...$,children:t.jsxs("div",{className:a.inputGroup,children:[t.jsx(oe.Autocomplete,{onChange:(G,R)=>q(R),value:J,multiple:!0,options:Z,getOptionDisabled:G=>U.findIndex(R=>R.groupName===G)!==-1||I.includes(G),filterSelectedOptions:!0,renderInput:G=>t.jsx(r.TextField,{...G,autoFocus:!0,label:u,...P}),...Y}),t.jsx(r.Button,{variant:"outlined",color:"primary",onClick:()=>{var G;(G=l({groups:J}))==null||G.then(()=>{H(!1),setTimeout(()=>{q([])},500)})},...V,children:W})]})})]})}Do.propTypes={classes:e.objectOf(e.string),className:e.string,existingGroups:ye.GroupListType,groups:ye.GroupListType,onClick:e.func,onAddGroups:e.func,onRemoveGroup:e.func,removeTooltip:e.string,subHeaderText:e.string,inputLabel:e.string,SubHeaderIcon:e.oneOfType([e.elementType,e.oneOf([!1])]),emptyText:e.string,addText:e.string,disableEdit:e.bool,lockedGroups:e.arrayOf(e.string),showRoles:e.bool,showGroups:e.bool,RemoveIcon:e.elementType,ListProps:e.objectOf(e.any),ListSubheaderProps:e.objectOf(e.any),ListItemProps:e.objectOf(e.any),ListItemTextProps:e.objectOf(e.any),EmptyListItemProps:e.objectOf(e.any),EmptyListItemTextProps:e.objectOf(e.any),RemoveTooltipProps:e.objectOf(e.any),RemoveIconButtonProps:e.objectOf(e.any),AddListItemProps:e.objectOf(e.any),AddIcon:e.elementType,AddListItemTextProps:e.objectOf(e.any),CollapseProps:e.objectOf(e.any),AutocompleteProps:e.objectOf(e.any),AutocompleteTextFieldProps:e.objectOf(e.any),AddButtonProps:e.objectOf(e.any),addButtonText:e.string},Do.defaultProps={className:void 0,classes:{},existingGroups:{},groups:{},onClick:void 0,onAddGroups:void 0,onRemoveGroup:void 0,removeTooltip:"Remove",subHeaderText:"Groups",inputLabel:"Select groups",SubHeaderIcon:!1,emptyText:"No groups",addText:"Add groups",disableEdit:!1,lockedGroups:[],showRoles:!0,showGroups:!0,RemoveIcon:j.Cancel,ListProps:{},ListSubheaderProps:{},ListItemProps:{},ListItemTextProps:{},EmptyListItemProps:{},EmptyListItemTextProps:{},RemoveTooltipProps:{},RemoveIconButtonProps:{},AddListItemProps:{},AddIcon:j.Add,AddListItemTextProps:{},CollapseProps:{},AutocompleteProps:{},AutocompleteTextFieldProps:{},AddButtonProps:{},addButtonText:"Add"};const st=r.withStyles(UA,{name:"VdtGroupRelationList"})(Do);st.displayName="GroupRelationList";const $A=a=>({root:{display:"flex",flexDirection:"column"},ListSubheader:{display:"grid",gridAutoFlow:"column",gridTemplateColumns:"auto 1fr",alignItems:"center",gridGap:a.spacing(1)},List:{}}),YA=({disabled:a})=>a?"Disabled":"Active";function WA({className:a,classes:n,user:o,SubHeaderText:s="Details",SubHeaderIcon:i=!1}){const{userName:l,realName:d}=o;return t.jsx("div",{className:x(n.root,a),children:t.jsxs(r.List,{className:n.List,dense:!0,subheader:t.jsxs(r.ListSubheader,{disableGutters:!0,className:n.ListSubheader,children:[i&&t.jsx(i,{}),s]}),children:[t.jsx(r.ListItem,{children:t.jsx(r.ListItemText,{primary:"Username",secondary:l})}),t.jsx(r.ListItem,{children:t.jsx(r.ListItemText,{primary:"Real name",secondary:d||"-"})}),t.jsx(r.ListItem,{children:t.jsx(r.ListItemText,{primary:"Status",secondary:YA(o)})})]})})}const _A=r.withStyles($A,{name:"VdtUserData"})(WA);function QA({user:a,onToggleDisabled:n,onEdit:o,onChangePassword:s,onDelete:i,editUserText:l="Edit User",changePasswordText:d="Change Password",deleteUserText:c="Delete User",enableUsertext:p="Enable User",disableUsertext:u="Disable User",...g}){return t.jsxs(r.Menu,{...g,children:[t.jsx(r.MenuItem,{onClick:()=>n(a),disabled:n===void 0,children:a.disabled?p:u}),t.jsx(r.MenuItem,{onClick:o,disabled:o===void 0,children:l}),t.jsx(r.MenuItem,{onClick:s,disabled:s===void 0,children:d}),t.jsx(r.MenuItem,{onClick:()=>i(a),disabled:i===void 0,children:c})]})}const HA=a=>({root:{display:"grid",gridGap:a.spacing(2),"& .MuiListItem-gutters":{paddingLeft:"30px"}},header:{display:"flex",alignItems:"center",justifyContent:"space-between"}});function No({classes:a,className:n,userType:o,groupListType:s,onEdit:i,onDelete:l,onAddToGroups:d,onRemoveFromGroup:c,onToggleDisabled:p,onChangePassword:u,DetailsComponent:g,DetailsProps:h,GroupsComponent:m,GroupsProps:y,RolesComponent:I,RolesProps:T,MenuComponent:b,MenuProps:M,lockedUsers:L}){const{userName:S,groupList:w={}}=o||{},[A,v]=C.useState(null),O=L.includes(S),E=z=>{v(z.currentTarget)},D=()=>{v(null)},F=z=>z?B=>{z(B),D()}:void 0;return t.jsxs("div",{className:x(a.root,"VdtUserDetails-root",n),children:[t.jsxs("div",{className:a.header,children:[t.jsx(r.Typography,{variant:"h5",children:S}),t.jsx(r.IconButton,{onClick:E,disabled:L.includes(S),children:t.jsx(j.MoreVert,{})}),b&&t.jsx(b,{user:o,open:!!A,onClose:D,anchorEl:A,onDelete:F(l),onEdit:F(i),onToggleDisabled:F(p),onChangePassword:F(u),...M})]}),g&&t.jsxs(t.Fragment,{children:[t.jsx(g,{user:o,SubHeaderIcon:j.Description,...h}),t.jsx(r.Divider,{})]}),m&&t.jsxs(t.Fragment,{children:[t.jsx(m,{existingGroups:w,groups:s,onRemoveGroup:c,onAddGroups:d,SubHeaderIcon:j.Group,disableEdit:O,showRoles:!1,...y}),t.jsx(r.Divider,{})]}),I&&t.jsxs(t.Fragment,{children:[t.jsx(I,{existingGroups:w,groups:s,onRemoveGroup:c,onAddGroups:d,removeTooltip:"Remove role",subHeaderText:"Roles",SubHeaderIcon:j.VerifiedUser,inputLabel:"Select roles",addText:"Add roles",emptyText:"No roles added",disableEdit:O,showGroups:!1,...T}),t.jsx(r.Divider,{})]})]})}No.propTypes={classes:e.objectOf(e.string),className:e.string,userType:ye.UserType,groupListType:ye.GroupListType,onEdit:e.func,onDelete:e.func,onAddToGroups:e.func,onRemoveFromGroup:e.func,onToggleDisabled:e.func,onChangePassword:e.func,DetailsComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),DetailsProps:e.objectOf(e.any),GroupsComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),GroupsProps:e.objectOf(e.any),RolesComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),RolesProps:e.objectOf(e.any),MenuComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),MenuProps:e.objectOf(e.any),lockedUsers:e.arrayOf(e.string)},No.defaultProps={classes:{},className:void 0,userType:{},groupListType:{},onEdit:void 0,onDelete:void 0,onAddToGroups:void 0,onRemoveFromGroup:void 0,onToggleDisabled:void 0,onChangePassword:void 0,DetailsComponent:_A,DetailsProps:{},GroupsComponent:st,GroupsProps:{},RolesComponent:st,RolesProps:{},MenuComponent:QA,MenuProps:{},lockedUsers:["admin","vidinetviewer"]};const Ru=r.withStyles(HA,{name:"VdtUserDetails"})(No);Ru.displayName="UserDetails";function eg(a){const[n,o]=C.useState(!1);return t.jsx(r.TextField,{type:n?"text":"password",InputProps:{endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(r.IconButton,{onClick:()=>o(s=>!s),children:n?t.jsx(j.Visibility,{}):t.jsx(j.VisibilityOff,{})})})},...a})}const ZA=a=>({root:{display:"flex",flexDirection:"column","& > *":{marginTop:a.spacing(1),marginBottom:a.spacing(1)}},action:{display:"flex",justifyContent:"flex-end"}});function JA({classes:a,onSubmit:n,onCancel:o,submitText:s="Create",cancelText:i="Cancel",groups:l,roles:d}){const c=C.useRef(),p=C.useRef(),u=C.useRef(),[g,h]=C.useState([]),[m,y]=C.useState([]),I=T=>{T.preventDefault();const b={userName:c.current.value,realName:p.current.value,password:u.current.value,groupList:{group:g.concat(m).map(M=>({groupName:M}))}};n({userDocument:b})};return t.jsxs("form",{className:a.root,onSubmit:I,children:[t.jsx(r.TextField,{required:!0,name:"userName",label:"Username",inputRef:c}),t.jsx(r.TextField,{name:"realName",label:"Real name",inputRef:p}),t.jsx(eg,{name:"password",required:!0,fullWidth:!0,label:"Password",inputRef:u}),t.jsx(oe.Autocomplete,{name:"groups",multiple:!0,options:l,getOptionLabel:T=>T,filterSelectedOptions:!0,value:g,onChange:(T,b)=>h(b),renderInput:T=>t.jsx(r.TextField,{...T,label:"Add to groups"})}),t.jsx(oe.Autocomplete,{name:"roles",multiple:!0,options:d,getOptionLabel:T=>T,filterSelectedOptions:!0,value:m,onChange:(T,b)=>y(b),renderInput:T=>t.jsx(r.TextField,{...T,label:"Add roles"})}),t.jsxs("div",{className:a.action,children:[t.jsx(r.Button,{onClick:o,children:i}),t.jsx(r.Button,{variant:"contained",color:"primary",type:"submit",children:s})]})]})}const XA=r.withStyles(ZA,{name:"VdtCreateUserForm"})(JA),KA=()=>({root:{},DialogTitle:{},DialogContent:{}});function vo({classes:a,className:n,groupListType:o,onClose:s,onSubmit:i,titleText:l,CreateUserFormProps:d}){const[c,p]=C.useMemo(()=>{const{group:u=[]}=o;return u.reduce(([g,h],m)=>m.role?[[...g,m],h]:[g,[...h,m]],[[],[]]).map(g=>g.map(h=>h.groupName))},[o]);return t.jsxs("div",{className:x(a.root,"VdtCreateUserDialog-root",n),children:[l&&t.jsx(r.DialogTitle,{className:a.DialogTitle,children:l}),t.jsx(r.DialogContent,{className:a.DialogContent,children:t.jsx(XA,{onSubmit:i,onCancel:s,roles:c,groups:p,...d})})]})}vo.propTypes={classes:e.objectOf(e.string),className:e.string,titleText:e.string,onClose:e.func,onSubmit:e.func,groupListType:ye.GroupListType,CreateUserFormProps:e.objectOf(e.any)},vo.defaultProps={className:void 0,classes:{},titleText:"Create User",onClose:void 0,onSubmit:void 0,groupListType:{},CreateUserFormProps:{}};const tg=r.withStyles(KA,{name:"VdtCreateUserDialog"})(vo);tg.displayName="CreateUserDialog";const RA=a=>({root:{display:"flex",flexDirection:"column","& > *":{marginTop:a.spacing(1),marginBottom:a.spacing(1)}},action:{display:"flex",justifyContent:"flex-end"}});function eD({classes:a,onSubmit:n,onCancel:o,submitText:s="Save",cancelText:i="Cancel",userNameText:l="Username",realNameText:d="Real name",user:c}){const p=C.useRef(),u=C.useRef(),g=h=>{h.preventDefault();const m={userName:p.current.value,realName:u.current.value};n({userDocument:m})};return t.jsxs("form",{className:a.root,onSubmit:g,children:[t.jsx(r.TextField,{required:!0,name:"userName",defaultValue:c.userName,label:l,inputRef:p}),t.jsx(r.TextField,{defaultValue:c.realName,name:"realName",label:d,inputRef:u}),t.jsxs("div",{className:a.action,children:[t.jsx(r.Button,{onClick:o,children:i}),t.jsx(r.Button,{variant:"contained",color:"primary",type:"submit",children:s})]})]})}const tD=r.withStyles(RA,{name:"VdtEditUserForm"})(eD),aD=()=>({root:{}});function xo({classes:a,className:n,user:o,onClose:s,onSubmit:i}){return t.jsxs("div",{className:x(a.root,"VdtEditUserDialog-root",n),children:[t.jsx(r.DialogTitle,{children:"Edit User"}),t.jsx(r.DialogContent,{children:t.jsx(tD,{onSubmit:i,onCancel:s,user:o})})]})}xo.propTypes={classes:e.objectOf(e.string),className:e.string,user:e.objectOf(e.any),onClose:e.func,onSubmit:e.func},xo.defaultProps={className:void 0,classes:{},user:{},onClose:()=>null,onSubmit:()=>null};const ag=r.withStyles(aD,{name:"VdtEditUserDialog"})(xo);ag.displayName="EditUserDialog";const nD=a=>({root:{display:"flex",flexDirection:"column","& > *":{marginTop:a.spacing(1),marginBottom:a.spacing(1)}},action:{display:"flex",justifyContent:"flex-end"},fields:{display:"flex",alignItems:"center"}});function rD({classes:a,userName:n,onSubmit:o,onCancel:s,submitText:i="Change",cancelText:l="Cancel",passwordText:d="New Password"}){const c=C.useRef(),p=u=>{u.preventDefault();const{value:g}=c.current;o({userName:n,password:g})};return t.jsxs("form",{className:a.root,onSubmit:p,children:[t.jsx("div",{className:a.fields,children:t.jsx(eg,{required:!0,fullWidth:!0,name:"password",label:d,inputRef:c})}),t.jsxs("div",{className:a.action,children:[t.jsx(r.Button,{onClick:s,children:l}),t.jsx(r.Button,{variant:"contained",color:"primary",type:"submit",children:i})]})]})}const oD=r.withStyles(nD,{name:"VdtUserPasswordForm"})(rD),sD=()=>({root:{}});function Oo({classes:a,className:n,user:o,onClose:s,onSubmit:i}){const{userName:l}=o;return t.jsxs("div",{className:x(a.root,"VdtCreateUserDialog-root",n),children:[t.jsxs(r.DialogTitle,{children:["Change password for ",l||"user"]}),t.jsx(r.DialogContent,{children:t.jsx(oD,{onSubmit:i,onCancel:s,userName:l})})]})}Oo.propTypes={classes:e.objectOf(e.string),className:e.string,onClose:e.func,onSubmit:e.func,user:ye.UserType.isRequired},Oo.defaultProps={className:void 0,classes:{},onClose:void 0,onSubmit:void 0};const ng=r.withStyles(sD,{name:"VdtChangeUserPasswordDialog"})(Oo);ng.displayName="ChangeUserPasswordDialog";const iD=a=>({root:{display:"flex",flexDirection:"column"},groupListItem:{"& .MuiListItemSecondaryAction-root":{visibility:"hidden"},"&:hover":{backgroundColor:r.emphasize(a.palette.background.paper,.1),"& .MuiListItemSecondaryAction-root":{visibility:"visible"}}},toggleIcon:{color:a.palette.primary.main,transform:"rotate(0deg)",transition:a.transitions.create("transform",{duration:a.transitions.duration.shortest})},toggleIconActive:{transform:"rotate(45deg)"},addGroupListItem:{color:a.palette.primary.main},addButton:{alignSelf:"flex-end"},inputGroup:{paddingBottom:a.spacing(2),display:"grid",gridAutoFlow:"column",gridTemplateColumns:"1fr auto",alignItems:"end",gridGap:a.spacing(4)},subHeader:{display:"grid",gridAutoFlow:"column",gridTemplateColumns:"auto 1fr",alignItems:"center",gridGap:a.spacing(1),backgroundColor:a.palette.background.paper,top:`-${a.spacing(2)}px`}});function Eo({classes:a,className:n,onClick:o,existingUsers:s,users:i,onAddUsers:l,onRemoveUser:d,removeTooltip:c,subHeaderText:p,inputLabel:u,SubHeaderIcon:g,emptyText:h,addText:m,disableEdit:y,lockedUsers:I,AddIcon:T,RemoveIcon:b,ListProps:M,ListSubheaderProps:L,ListItemProps:S,ListItemTextProps:w,EmptyListItemProps:A,EmptyListItemTextProps:v,RemoveTooltipProps:O,RemoveIconButtonProps:E,AddListItemProps:D,AddListItemTextProps:F,CollapseProps:z,AutocompleteProps:B,AutocompleteTextFieldProps:$,AddButtonProps:Y,addButtonText:P}){const[V,W]=C.useState(!1),{user:_=[]}=s,{user:H=[]}=i,k=H.map(Z=>Z.userName),[U,K]=C.useState([]);return t.jsxs("div",{className:x(a.root,"VdtUserRelationList-root",n),children:[t.jsxs(r.List,{dense:!0,className:a.List,subheader:t.jsxs(r.ListSubheader,{disableGutters:!0,className:a.subHeader,...L,children:[g&&t.jsx(g,{}),p]}),...M,children:[_.length?_.map(Z=>t.jsxs(r.ListItem,{classes:{container:a.groupListItem},disabled:I.includes(Z.userName),onClick:o?J=>o(J,{userName:Z.userName,userType:Z}):void 0,button:!!o,...S,children:[t.jsx(r.ListItemText,{primary:Z.userName,primaryTypographyProps:{variant:"body2"},...w}),d&&!y&&!I.includes(Z.userName)&&t.jsx(r.ListItemSecondaryAction,{children:t.jsx(r.Tooltip,{title:c,...O,children:t.jsx("span",{children:t.jsx(r.IconButton,{size:"small",onClick:()=>d(Z.userName),...E,children:t.jsx(b,{})})})})})]},Z.userName)):t.jsx(r.ListItem,{...A,children:t.jsx(r.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"},...v})}),l&&!y&&t.jsxs(r.ListItem,{button:!0,className:a.addGroupListItem,onClick:()=>W(Z=>!Z),...D,children:[t.jsx(r.ListItemIcon,{children:t.jsx(T,{className:x(a.toggleIcon,{[a.toggleIconActive]:V})})}),t.jsx(r.ListItemText,{primary:m,primaryTypographyProps:{variant:"body1"},...F})]})]}),l&&!y&&t.jsx(r.Collapse,{in:V,timeout:"auto",...z,children:t.jsxs("div",{className:a.inputGroup,children:[t.jsx(oe.Autocomplete,{onChange:(Z,J)=>K(J),value:U,multiple:!0,options:k,getOptionDisabled:Z=>_.findIndex(J=>J.userName===Z)!==-1||I.includes(Z),filterSelectedOptions:!0,renderInput:Z=>t.jsx(r.TextField,{...Z,autoFocus:!0,label:u,...$}),...B}),t.jsx(r.Button,{variant:"outlined",color:"primary",onClick:()=>{var Z;(Z=l({users:U}))==null||Z.then(()=>{W(!1),setTimeout(()=>{K([])},500)})},...Y,children:P})]})})]})}Eo.propTypes={classes:e.objectOf(e.string),className:e.string,existingUsers:ye.UserListType,onClick:e.func,users:ye.UserListType,onAddUsers:e.func,onRemoveUser:e.func,removeTooltip:e.string,subHeaderText:e.string,inputLabel:e.string,SubHeaderIcon:e.oneOfType([e.elementType,e.oneOf([!1])]),emptyText:e.string,addText:e.string,disableEdit:e.bool,lockedUsers:e.arrayOf(e.string),RemoveIcon:e.elementType,ListProps:e.objectOf(e.any),ListSubheaderProps:e.objectOf(e.any),ListItemProps:e.objectOf(e.any),ListItemTextProps:e.objectOf(e.any),EmptyListItemProps:e.objectOf(e.any),EmptyListItemTextProps:e.objectOf(e.any),RemoveTooltipProps:e.objectOf(e.any),RemoveIconButtonProps:e.objectOf(e.any),AddListItemProps:e.objectOf(e.any),AddIcon:e.elementType,AddListItemTextProps:e.objectOf(e.any),CollapseProps:e.objectOf(e.any),AutocompleteProps:e.objectOf(e.any),AutocompleteTextFieldProps:e.objectOf(e.any),AddButtonProps:e.objectOf(e.any),addButtonText:e.string},Eo.defaultProps={className:void 0,classes:{},existingUsers:{},users:{},onClick:void 0,onAddUsers:void 0,onRemoveUser:void 0,removeTooltip:"Remove",subHeaderText:"Users",inputLabel:"Select users",SubHeaderIcon:!1,emptyText:"No users",addText:"Add users",disableEdit:!1,lockedUsers:[],RemoveIcon:j.Cancel,ListProps:{},ListSubheaderProps:{},ListItemProps:{},ListItemTextProps:{},EmptyListItemProps:{},EmptyListItemTextProps:{},RemoveTooltipProps:{},RemoveIconButtonProps:{},AddListItemProps:{},AddIcon:j.Add,AddListItemTextProps:{},CollapseProps:{},AutocompleteProps:{},AutocompleteTextFieldProps:{},AddButtonProps:{},addButtonText:"Add"};const jo=r.withStyles(iD,{name:"VdtUserRelationList"})(Eo);jo.displayName="UserRelationList";const lD=a=>({avatar:{backgroundColor:a.palette.primary.main,color:a.palette.background.main},localeSelect:{width:"100%"}});function Po({className:a,classes:n,userName:o,avatarText:s,onLogout:i,togglePalette:l,isDefaultPalette:d,locale:c,children:p,signOutText:u,toggleThemeText:g,AvatarProps:h,ButtonBaseProps:m,MenuProps:y,localeSelectProps:I}){const[T,b]=C.useState(null),M=w=>{b(w.currentTarget)},L=()=>{b(null)},S=s||(o?o[0]:"");return t.jsxs("div",{className:x(a,n.root,"VdtUserAvatarButton-root"),children:[t.jsxs(r.ButtonBase,{className:x(n.ButtonBase,"VdtUserAvatarButton-ButtonBase"),onClick:M,disableRipple:!0,...m,children:[t.jsx(r.Avatar,{className:n.avatar,...h,children:S}),t.jsx(j.ArrowDropDown,{})]}),t.jsxs(r.Menu,{className:x(n.Menu,"VdtUserAvatarButton-Menu"),anchorEl:T,keepMounted:!0,open:!!T,onClose:L,elevation:1,PaperProps:{square:!0},getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},...y,children:[t.jsx(r.MenuItem,{disabled:!0,children:o}),l&&t.jsx(r.MenuItem,{className:x(n.paletteMenuItem,"VdtUserAvatarButton-paletteMenuItem"),children:t.jsx(r.FormControlLabel,{className:x(n.paletteFormControlLabel,"VdtUserAvatarButton-paletteFormControlLabel"),label:g,control:t.jsx(r.Switch,{className:x(n.paletteSwitch,"VdtUserAvatarButton-paletteSwitch"),onChange:l,checked:d})})}),(c==null?void 0:c.options)&&t.jsx(r.MenuItem,{className:x(n.localeMenuItemRoot,"VdtUserAvatarButton-localeMenuItemRoot"),children:t.jsx(r.Select,{className:x(n.localeSelect,"VdtUserAvatarButton-localeSelect"),value:c.curr,onChange:({target:{value:w}})=>c.set(w),...I,children:c.options.map(w=>t.jsx(r.MenuItem,{value:w.value,className:x(n.localeMenuItem,"VdtUserAvatarButton-localeMenuItem"),children:w.label},w.value))})}),p,t.jsx(r.MenuItem,{className:x(n.signOutMenuItem,"VdtUserAvatarButton-signOutMenuItem"),button:!0,onClick:i,children:u})]})]})}Po.propTypes={classes:e.objectOf(e.string),className:e.string,userName:e.string,avatarText:e.string,onLogout:e.func,togglePalette:e.func,isDefaultPalette:e.bool,locale:e.shape({set:e.func,curr:e.string,options:e.arrayOf(e.any)}),children:e.oneOfType([e.arrayOf(e.element),e.element]),signOutText:e.string,toggleThemeText:e.string,AvatarProps:e.objectOf(e.any),ButtonBaseProps:e.objectOf(e.any),MenuProps:e.objectOf(e.any),localeSelectProps:e.objectOf(e.any)},Po.defaultProps={className:void 0,classes:{},userName:void 0,avatarText:void 0,onLogout:void 0,togglePalette:void 0,isDefaultPalette:!0,locale:void 0,children:void 0,signOutText:"Sign Out",toggleThemeText:"Toggle Theme",AvatarProps:{},ButtonBaseProps:{},MenuProps:{},localeSelectProps:{}};const rg=r.withStyles(lD,{name:"VdtUserAvatarButton"})(Po);rg.displayName="UserAvatarButton";const dD=()=>({TableRow:{},TableCell:{}});function cD({classes:a,group:n={},columns:o=[],onClick:s,...i}){return t.jsx(r.TableRow,{onClick:s!==void 0?()=>s(n):void 0,style:{cursor:s!==void 0?"pointer":"initial"},className:a.TableRow,...i,children:o.map(({value:l,valueComponent:d})=>t.jsx(r.TableCell,{className:a.TableCell,children:d?d(n[l],n):n[l]},l))})}const pD=r.withStyles(dD,{name:"VdtGroupRow"})(cD),uD=()=>({root:{},TableContainer:{},Table:{},TableHead:{},TableHeadRow:{},TableHeadCell:{},TableBody:{}});function ko({classes:a,className:n,groups:o,columns:s,hideHeader:i,GroupRowComponent:l,GroupRowProps:d,groupColumnLabels:c}){return t.jsx("div",{className:x(a.root,"VdtGroupTable-root",n),children:t.jsx(r.TableContainer,{className:a.TableContainer,children:t.jsxs(r.Table,{className:a.Table,children:[!i&&t.jsx(r.TableHead,{className:a.TableHead,children:t.jsx(r.TableRow,{className:a.TableHeadRow,children:s.map(({value:p})=>t.jsx(r.TableCell,{className:a.TableHeadCell,children:c[p]},c[p]))})}),t.jsx(r.TableBody,{className:a.TableBody,children:o.map(p=>t.jsx(l,{group:p,columns:s,...d},p.groupName))})]})})})}ko.propTypes={classes:e.objectOf(e.string),className:e.string,groups:e.arrayOf(e.any),columns:e.arrayOf(e.any),hideHeader:e.bool,GroupRowComponent:e.elementType,GroupRowProps:e.objectOf(e.any),groupColumnLabels:e.objectOf(e.string)},ko.defaultProps={className:void 0,classes:{},groups:[],columns:[{value:"groupName"},{value:"role",valueComponent:a=>a?"Role":"Group"}],hideHeader:!1,GroupRowComponent:pD,GroupRowProps:{},groupColumnLabels:{groupName:"Groupname",role:"Type"}};const og=r.withStyles(uD,{name:"VdtGroupTable"})(ko);og.displayName="GroupTable";const gD=a=>({root:{display:"flex",flexDirection:"column"},ListSubheader:{display:"grid",gridAutoFlow:"column",gridTemplateColumns:"auto 1fr",alignItems:"center",gridGap:a.spacing(1)},List:{}}),hD=a=>a?"Role":"Group";function yD({className:a,classes:n,groupType:o,SubHeaderText:s="Details",SubHeaderIcon:i=!1,groupNameText:l="Group name",descriptionText:d="Description",typeText:c="Type"}){const{groupName:p,description:u,role:g,metadata:{field:h=[]}={}}=o;return t.jsx("div",{className:x(n.root,a),children:t.jsxs(r.List,{className:n.List,dense:!0,subheader:t.jsxs(r.ListSubheader,{disableGutters:!0,className:n.ListSubheader,children:[i&&t.jsx(i,{}),s]}),children:[t.jsx(r.ListItem,{children:t.jsx(r.ListItemText,{primary:l,secondary:p})}),t.jsx(r.ListItem,{children:t.jsx(r.ListItemText,{primary:d,secondary:u||"-"})}),t.jsx(r.ListItem,{children:t.jsx(r.ListItemText,{primary:c,secondary:hD(g)})}),h&&h.map(m=>t.jsx(r.ListItem,{children:t.jsx(r.ListItemText,{primary:m.key,secondary:m.value})},m.key))]})})}const mD=r.withStyles(gD,{name:"VdtGroupData"})(yD);function fD({groupType:a,onEdit:n,onDelete:o,editGroupText:s="Edit Group",deleteGroupText:i="Delete Group",...l}){return t.jsxs(r.Menu,{...l,children:[t.jsx(r.MenuItem,{onClick:n,disabled:n===void 0,children:s}),t.jsx(r.MenuItem,{onClick:()=>o(a),disabled:o===void 0,children:i})]})}const CD=a=>({root:{display:"grid",gridGap:a.spacing(2),"& .MuiListItem-gutters":{paddingLeft:"30px"}},header:{display:"flex",alignItems:"center",justifyContent:"space-between"}});function Fo({classes:a,className:n,groupType:o,groupListType:s,userListType:i,onEdit:l,onDelete:d,onAddChildGroups:c,onAddParentGroups:p,onAddUsersToGroup:u,onRemoveUser:g,onRemoveChildGroup:h,onRemoveFromParent:m,DetailsComponent:y,DetailsProps:I,UsersComponent:T,UsersProps:b,RolesComponent:M,RolesProps:L,ParentGroupsComponent:S,ParentGroupsProps:w,ChildGroupsComponent:A,ChildGroupsProps:v,MenuComponent:O,MenuProps:E,lockedGroups:D,lockedUsers:F}){const{groupName:z,role:B,parentGroupList:$={},childGroupList:Y={},userList:P={}}=o||{},[V,W]=C.useState(null),_=D.includes(z),H=K=>{W(K.currentTarget)},k=()=>{W(null)},U=K=>K?Z=>{K(Z),k()}:void 0;return t.jsxs("div",{className:x(a.root,"VdtGroupDetails-root",n),children:[t.jsxs("div",{className:a.header,children:[t.jsx(r.Typography,{variant:"h5",children:z}),O&&!B&&t.jsxs(t.Fragment,{children:[t.jsx(r.IconButton,{onClick:H,disabled:D.includes(z),children:t.jsx(j.MoreVert,{})}),t.jsx(O,{groupType:o,open:!!V,onClose:k,anchorEl:V,onDelete:U(d),onEdit:U(l),...E})]})]}),y&&t.jsxs(t.Fragment,{children:[t.jsx(y,{groupType:o,SubHeaderIcon:j.Description,...I}),t.jsx(r.Divider,{})]}),T&&t.jsxs(t.Fragment,{children:[t.jsx(T,{existingUsers:P,users:i,onRemoveUser:g,onAddUsers:u,lockedUsers:F,SubHeaderIcon:j.Person,...b}),t.jsx(r.Divider,{})]}),M&&!B&&t.jsxs(t.Fragment,{children:[t.jsx(M,{existingGroups:$,groups:s,onRemoveGroup:m,onAddGroups:p,SubHeaderIcon:j.VerifiedUser,disableEdit:_,showGroups:!1,removeTooltip:"Remove from role",subHeaderText:"Roles",inputLabel:"Select roles",emptyText:"Not member of any roles",addText:"Add roles",...L}),t.jsx(r.Divider,{})]}),S&&!B&&t.jsxs(t.Fragment,{children:[t.jsx(S,{existingGroups:$,groups:s,onRemoveGroup:m,onAddGroups:p,SubHeaderIcon:j.Group,disableEdit:_,showRoles:!1,removeTooltip:"Remove from group",subHeaderText:"Parent groups",emptyText:"Not member of any groups",addText:"Add parents",lockedGroups:D,...w}),t.jsx(r.Divider,{})]}),A&&t.jsxs(t.Fragment,{children:[t.jsx(A,{existingGroups:Y,groups:s,onRemoveGroup:h,onAddGroups:c,SubHeaderIcon:j.Group,disableEdit:_,showRoles:!1,subHeaderText:"Child groups",addText:"Add children",lockedGroups:D,...v}),t.jsx(r.Divider,{})]})]})}Fo.propTypes={classes:e.objectOf(e.string),className:e.string,groupType:ye.GroupType,groupListType:ye.GroupListType,userListType:ye.UserListType,onEdit:e.func,onDelete:e.func,onAddChildGroups:e.func,onAddParentGroups:e.func,onAddUsersToGroup:e.func,onRemoveUser:e.func,onRemoveChildGroup:e.func,onRemoveFromParent:e.func,DetailsComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),DetailsProps:e.objectOf(e.any),UsersComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),UsersProps:e.objectOf(e.any),RolesComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),RolesProps:e.objectOf(e.any),ParentGroupsComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ParentGroupsProps:e.objectOf(e.any),ChildGroupsComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),ChildGroupsProps:e.objectOf(e.any),MenuComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),MenuProps:e.objectOf(e.any),lockedGroups:e.arrayOf(e.string),lockedUsers:e.arrayOf(e.string)},Fo.defaultProps={classes:{},className:void 0,groupType:{},groupListType:{},userListType:{},onEdit:void 0,onDelete:void 0,onAddChildGroups:void 0,onAddParentGroups:void 0,onAddUsersToGroup:void 0,onRemoveUser:void 0,onRemoveChildGroup:void 0,onRemoveFromParent:void 0,DetailsComponent:mD,DetailsProps:{},UsersComponent:jo,UsersProps:{},RolesComponent:st,RolesProps:{},ParentGroupsComponent:st,ParentGroupsProps:{},ChildGroupsComponent:st,ChildGroupsProps:{},MenuComponent:fD,MenuProps:{},lockedGroups:["_special_all","vidinetGroup"],lockedUsers:["admin","vidinetviewer"]};const sg=r.withStyles(CD,{name:"VdtGroupDetails"})(Fo);sg.displayName="GroupDetails";const TD=a=>({root:{display:"flex",flexDirection:"column","& > *":{marginTop:a.spacing(1),marginBottom:a.spacing(1)}},action:{display:"flex",justifyContent:"flex-end"}});function bD({classes:a,onSubmit:n,onCancel:o,submitText:s="Create",cancelText:i="Cancel",users:l,groups:d,roles:c,groupNameLabel:p="Group name",descriptionLabel:u="Description",usersLabel:g="Add users",rolesLabel:h="Add roles",parentGroupsLabel:m="Add parent groups",childGroupsLabel:y="Add child groups"}){const I=C.useRef(),T=C.useRef(),[b,M]=C.useState([]),[L,S]=C.useState([]),[w,A]=C.useState([]),[v,O]=C.useState([]),E=z=>{z.preventDefault();const B={groupName:I.current.value,...T.current.value&&{description:T.current.value},parentGroupList:{group:L.concat(v).map($=>({groupName:$}))},childGroupList:{group:w.map($=>({groupName:$}))},userList:{user:b.map($=>({userName:$}))}};n({groupDocument:B})},D=z=>w.includes(z),F=z=>L.includes(z);return t.jsxs("form",{className:a.root,onSubmit:E,children:[t.jsx(r.TextField,{required:!0,name:"groupName",label:p,inputRef:I}),t.jsx(r.TextField,{name:"description",label:u,inputRef:T}),t.jsx(oe.Autocomplete,{name:"users",multiple:!0,options:l,filterSelectedOptions:!0,value:b,onChange:(z,B)=>M(B),renderInput:z=>t.jsx(r.TextField,{...z,label:g})}),t.jsx(oe.Autocomplete,{name:"roles",multiple:!0,options:c,filterSelectedOptions:!0,value:v,onChange:(z,B)=>O(B),renderInput:z=>t.jsx(r.TextField,{...z,label:h})}),t.jsx(oe.Autocomplete,{name:"parentGroups",multiple:!0,options:d,filterSelectedOptions:!0,value:L,getOptionDisabled:D,onChange:(z,B)=>S(B),renderInput:z=>t.jsx(r.TextField,{...z,label:m})}),t.jsx(oe.Autocomplete,{name:"childGroups",multiple:!0,options:d,filterSelectedOptions:!0,value:w,getOptionDisabled:F,onChange:(z,B)=>A(B),renderInput:z=>t.jsx(r.TextField,{...z,label:y})}),t.jsxs("div",{className:a.action,children:[t.jsx(r.Button,{onClick:o,children:i}),t.jsx(r.Button,{variant:"contained",color:"primary",type:"submit",children:s})]})]})}const ID=r.withStyles(TD,{name:"VdtCreateGroupForm"})(bD),MD=()=>({root:{},DialogTitle:{},DialogContent:{}});function zo({classes:a,className:n,groupListType:o,userListType:s,onClose:i,onSubmit:l,titleText:d,CreateGroupFormProps:c}){const[p,u]=C.useMemo(()=>{const{group:h=[]}=o;return h.reduce(([m,y],I)=>I.role?[[...m,I],y]:[m,[...y,I]],[[],[]]).map(m=>m.map(y=>y.groupName))},[o]),g=C.useMemo(()=>{const{user:h=[]}=s;return h.map(m=>m.userName)},[s]);return t.jsxs("div",{className:x(a.root,"VdtCreateGroupDialog-root",n),children:[d&&t.jsx(r.DialogTitle,{className:a.DialogTitle,children:d}),t.jsx(r.DialogContent,{className:a.DialogContent,children:t.jsx(ID,{onSubmit:l,onCancel:i,users:g,roles:p,groups:u,...c})})]})}zo.propTypes={classes:e.objectOf(e.string),className:e.string,titleText:e.string,onClose:e.func,onSubmit:e.func,groupListType:ye.GroupListType,userListType:ye.UserListType,CreateGroupFormProps:e.objectOf(e.any)},zo.defaultProps={classes:{},className:void 0,titleText:"Create Group",onClose:void 0,onSubmit:void 0,groupListType:{},userListType:{},CreateGroupFormProps:{}};const ig=r.withStyles(MD,{name:"VdtCreateGroupDialog"})(zo);ig.displayName="CreateGroupDialog";const LD=a=>({root:{display:"flex",flexDirection:"column","& > *":{marginTop:a.spacing(1),marginBottom:a.spacing(1)}},action:{display:"flex",justifyContent:"flex-end"}});function SD({classes:a,onSubmit:n,onCancel:o,submitText:s="Save",cancelText:i="Cancel",descriptionLabel:l="Description",groupType:d}){const c=C.useRef(),p=u=>{u.preventDefault();const g={description:c.current.value};n({groupDocument:g})};return t.jsxs("form",{className:a.root,onSubmit:p,children:[t.jsx(r.TextField,{defaultValue:d.description,name:"description",label:l,inputRef:c}),t.jsxs("div",{className:a.action,children:[t.jsx(r.Button,{onClick:o,children:i}),t.jsx(r.Button,{variant:"contained",color:"primary",type:"submit",children:s})]})]})}const wD=r.withStyles(LD,{name:"VdtEditGroupForm"})(SD),AD=()=>({root:{},DialogTitle:{},DialogContent:{}});function Bo({classes:a,className:n,groupType:o,onClose:s,onSubmit:i,titleText:l,EditGroupFormProps:d}){return t.jsxs("div",{className:x(a.root,"VdtEditGroupDialog-root",n),children:[l&&t.jsx(r.DialogTitle,{className:a.DialogTitle,children:l}),t.jsx(r.DialogContent,{className:a.DialogContent,children:t.jsx(wD,{onSubmit:i,onCancel:s,groupType:o,...d})})]})}Bo.propTypes={classes:e.objectOf(e.string),className:e.string,titleText:e.string,groupType:ye.GroupType,onClose:e.func,onSubmit:e.func,EditGroupFormProps:e.objectOf(e.any)},Bo.defaultProps={classes:{},className:void 0,titleText:"Edit Group",groupType:{},onClose:void 0,onSubmit:void 0,EditGroupFormProps:{}};const lg=r.withStyles(AD,{name:"VdtEditGroupDialog"})(Bo);lg.displayName="EditGroupDialog";const DD=()=>({root:{overflow:"auto","&::-webkit-scrollbar":{display:"none"}},scrolling:{"& *":{userSelect:"none",cursor:"grabbing"}},grab:{cursor:"grab"}}),dg=a=>{const n=a.current;return n&&(n.offsetHeight<n.scrollHeight||n.offsetWidth<n.scrollWidth)};function qo({className:a,classes:n,children:o}){const s=C.useRef(),[i,l]=C.useState(null),[d,c]=C.useState(!1),[p,u]=C.useState(!1),[g,h]=C.useState(null);C.useEffect(()=>{const b=()=>c(dg(s));return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}},[]),C.useEffect(()=>()=>{g&&clearTimeout(g)},[g]);const m=b=>{u(!1),d&&(l({left:s.current.scrollLeft,top:s.current.scrollTop,x:b.clientX,y:b.clientY}),b.preventDefault(),b.stopPropagation())},y=b=>{if(i){u(!0);const M=b.clientX-i.x,L=b.clientY-i.y;s.current.scrollTop=i.top-L,s.current.scrollLeft=i.left-M}},I=b=>{h(setTimeout(()=>u(!1))),l(null),b.preventDefault(),b.stopPropagation()},T=b=>{p&&(b.preventDefault(),b.stopPropagation())};return t.jsx("div",{onMouseDownCapture:m,onMouseUpCapture:I,onMouseLeave:I,onMouseMove:y,onClickCapture:T,ref:b=>{s.current=b,c(dg(s))},className:x(n.root,"VdtDragScroll-root",a,{[n.grab]:d&&!p,[n.scrolling]:p}),children:o})}qo.propTypes={classes:e.objectOf(e.string),className:e.string,children:e.oneOfType([e.arrayOf(e.element),e.element]).isRequired},qo.defaultProps={className:void 0,classes:{}};const cg=r.withStyles(DD,{name:"VdtDragScroll"})(qo);cg.displayName="DragScroll";const Vo={DELETE:"DELETE",DOWNLOAD:"DOWNLOAD",ADD_TO_LIBRARY:"ADD_TO_LIBRARY",SHARE_EMAIL:"SHARE_EMAIL",SHARE_LINK:"SHARE_LINK",SHARE_FACEBOOK:"SHARE_FACEBOOK"},ND=a=>({root:{color:a.palette.common.white,backgroundColor:a.palette.common.black}});function Go({classes:a,className:n,selected:o,onClear:s,selectedLabel:i,onClickAction:l}){const d=c=>()=>{l&&l(c,o)};return t.jsx(r.Collapse,{in:o.length>0,children:t.jsx(r.Toolbar,{className:x(a.root,n),children:t.jsxs(r.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[t.jsx(r.Grid,{item:!0,children:t.jsx(r.Typography,{children:`${o.length} ${i||""} Selected`})}),t.jsx(r.Grid,{item:!0,children:t.jsxs(r.Grid,{container:!0,alignItems:"center",children:[l&&t.jsxs(r.Grid,{item:!0,children:[t.jsx(r.Tooltip,{title:"Delete Selected",children:t.jsx(r.IconButton,{onClick:d(Vo.DELETE),color:"inherit",children:t.jsx(j.Delete,{})})}),t.jsx(r.Tooltip,{title:"Download Selected",children:t.jsx(r.IconButton,{onClick:d(Vo.DOWNLOAD),color:"inherit",children:t.jsx(j.GetApp,{})})}),t.jsx(r.Tooltip,{title:"Add to Library",children:t.jsx(r.IconButton,{onClick:d(Vo.ADD_TO_LIBRARY),color:"inherit",children:t.jsx(j.Add,{})})})]}),s&&t.jsx(r.Tooltip,{title:"Clear Selection",children:t.jsx(r.IconButton,{onClick:s,color:"inherit",children:t.jsx(j.Close,{})})})]})})]})})})}Go.propTypes={selected:e.arrayOf(e.any),selectedLabel:e.string,onClear:e.func,onClickAction:e.func,className:e.string,classes:e.objectOf(e.any).isRequired},Go.defaultProps={selected:[],selectedLabel:void 0,onClickAction:void 0,onClear:void 0,className:void 0};const pg=r.withStyles(ND,{name:"VdtSelectedToolbar"})(Go);pg.displayName="SelectedToolbar";const vD=a=>({root:{border:"2px solid transparent"},thumbnail:{pointerEvents:"none"},active:{animation:"$active 5s"},"@keyframes active":{"0%":{borderColor:He.alpha(a.palette.primary.main,1)},"100%":{borderColor:He.alpha(a.palette.primary.main,0)}}});function Uo({classes:a,className:n,isActive:o,EventContentComponent:s,EventContentProps:i,scrollIntoViewOpts:l,...d}){const c=C.useRef();return C.useEffect(()=>{o&&c&&c.current&&c.current.scrollIntoView(l)},[o,l]),t.jsx("div",{ref:c,className:x(a.root,n,{[a.active]:o}),children:s&&t.jsx(s,{...d,...i})})}Uo.propTypes={classes:e.objectOf(e.string),className:e.string,scrollIntoViewOpts:e.objectOf(e.any),isActive:e.bool,EventContentComponent:e.elementType,EventContentProps:e.objectOf(e.any)},Uo.defaultProps={className:void 0,classes:{},scrollIntoViewOpts:{behavior:"smooth",inline:"center",block:"nearest"},isActive:void 0,EventContentComponent:null,EventContentProps:{}};const $o=r.withStyles(vD,{name:"VdtEvent"})(Uo);$o.displayName="Event";const xD=a=>({root:{display:"flex",flexDirection:"row",alignItems:"flex-start",overflowX:"auto","&::-webkit-scrollbar":{"-webkit-appearance":"none"},"&::-webkit-scrollbar:horizontal":{height:11},"&::-webkit-scrollbar-thumb":{borderRadius:1,borderColor:a.palette.divider,borderStyle:"solid",borderWidth:1,backgroundColor:"rgba(0, 0, 0, .3)"},"& > *":{marginLeft:"10px",flexShrink:0}}});function Yo({classes:a,className:n,children:o}){return t.jsx("div",{className:x(a.root,n),children:o})}Yo.propTypes={classes:e.objectOf(e.string),className:e.string,children:e.oneOfType([e.arrayOf(e.element),e.element]).isRequired},Yo.defaultProps={className:void 0,classes:{}};const Wo=r.withStyles(xD,{name:"VdtEventContainer"})(Yo);Wo.displayName="EventContainer";const OD=()=>({root:{position:"absolute","&:hover":{transform:"scale(1.2)"}}});function _o({className:a,classes:n,position:o,length:s,onClick:i,children:l}){return t.jsx(r.ButtonBase,{disableRipple:!0,onClick:i,className:x(n.root,"VdtTimelineEvent-root",a),style:{left:`${100*o/s}%`},children:l})}_o.propTypes={classes:e.objectOf(e.string),className:e.string,onClick:e.func,children:e.oneOfType([e.arrayOf(e.element),e.element]).isRequired,length:e.number.isRequired,position:e.number.isRequired},_o.defaultProps={className:void 0,classes:{},onClick:void 0};const Qo=r.withStyles(OD,{name:"VdtEventMarker"})(_o);Qo.displayName="EventMarker";const ED={};function Ho({className:a,itemType:n,timespan:o,MissingThumbnailIcon:s,AvatarComponent:i,AvatarProps:l,TooltipComponent:d,TooltipProps:c}){const p=X.findNearestThumbnail(n,o.start||0),u=X.formatTimeCodeText(o.start).toSmpte();return t.jsx(d,{className:a,title:u,arrow:!0,placement:"right",...c,children:p?t.jsx(i,{variant:"circular",src:p,...l}):t.jsx(i,{variant:"circular",...l,children:t.jsx(s,{})})})}Ho.propTypes={classes:e.objectOf(e.string),className:e.string,itemType:e.objectOf(e.any).isRequired,timespan:e.shape({start:e.string}).isRequired,MissingThumbnailIcon:e.elementType,AvatarComponent:e.elementType,AvatarProps:e.objectOf(e.any),TooltipComponent:e.elementType,TooltipProps:e.objectOf(e.any)},Ho.defaultProps={classes:{},className:void 0,MissingThumbnailIcon:j.Image,AvatarComponent:r.Avatar,AvatarProps:{},TooltipComponent:r.Tooltip,TooltipProps:{}};const Zo=r.withStyles(ED,{name:"VdtEventMarkerThumbnail"})(Ho);Zo.displayName="EventMarkerThumbnail";const jD=a=>({root:{backgroundColor:He.alpha(a.palette.primary.main,.25),height:"5px",width:"100%",borderRadius:"2px",display:"flex",flexDirection:"row",alignItems:"center",position:"relative",marginTop:a.spacing(2),marginBottom:a.spacing(2)}});function Jo({className:a,classes:n,length:o,children:s}){return t.jsx("div",{className:x(n.root,"VdtTimeline-root",a),children:C.Children.map(s,i=>C.cloneElement(i,{length:o}))})}Jo.propTypes={classes:e.objectOf(e.string),className:e.string,children:e.oneOfType([e.arrayOf(e.element),e.element]).isRequired,length:e.number},Jo.defaultProps={classes:{},className:void 0,length:void 0};const Xo=r.withStyles(jD,{name:"VdtEventMarkerTimeline"})(Jo);Xo.displayName="EventMarkerTimeline";const PD=a=>({timelineEventContent:{height:a.spacing(3),width:a.spacing(3)},event:{},eventContainer:{paddingTop:a.spacing(2),paddingBottom:a.spacing(2)},timeline:{},timelineEvent:{}});function Ko({className:a,classes:n,matchHighlights:o,itemType:s,eventFilter:i,noEventsText:l,EventContainerComponent:d,EventContainerProps:c,EventComponent:p,EventProps:u,EventContentComponent:g,EventContentProps:h,EventMarkerThumbnailComponent:m,EventMarkerThumbnailProps:y,EventMarkerTimelineComponent:I,EventMarkerTimelineProps:T,EventMarkerComponent:b,EventMarkerProps:M,EventListComponent:L,EventListProps:S,GroupedTimeline:w,GroupConfig:A,FieldLabelMap:v,itemSearchDocument:O}){const{durationSeconds:E}=X.parseMetadataType(s.metadata,{flat:!0,arrayOnSingleValue:!1}),D=X.formatTimeCodeText(E).toSeconds(),{id:F}=s,z=C.useMemo(()=>{const{timespan:J=[],metadata:{timespan:q=[]}={}}=s;return o===!0?J.sort(({start:G},{start:R})=>X.formatTimeCodeText(G).samples-X.formatTimeCodeText(R).samples).filter(i):q.sort(({start:G},{start:R})=>X.formatTimeCodeText(G).toSeconds()-X.formatTimeCodeText(R).toSeconds()).filter(G=>J.some(({start:R,end:ae})=>G.start===R&&G.end===ae)).filter(i)},[s,i,o]),[B,$]=C.useState(null),Y=[],P=[],V=()=>{var q,G;const J=[];return((q=O.text)==null?void 0:q.length)>0&&((G=O.text)==null||G.forEach(R=>{R.value.toLowerCase().replaceAll('"',"").split(" ").forEach(te=>J.push(te))})),J},W=()=>{var q,G;const J=[];return((q=O.filter)==null?void 0:q.length)>0&&((G=O.filter)==null||G.forEach(R=>{R.field.forEach(ae=>{ae.value.forEach(te=>{const re=te.value.toLowerCase().replaceAll('"',"").split(" "),ce=[];re.forEach(pe=>ce.push(pe)),J.push({name:ae.name,data:ce})})})})),J},_=V(),H=W(),k=[],U=(J,q)=>q.every(G=>J.includes(G)),K=(J,q)=>{const G=[];return J.forEach(ae=>{q.data.filter(te=>te.name===ae.name&&ae.data.every(re=>te.valueList.includes(re))).length>0&&G.push(ae)}),J.length===G.length},Z=J=>{let q=!1;const G=[];J.data.forEach(te=>{te.value.toLowerCase().split(/[\s,]+/).forEach(ce=>G.push(ce))});const ae=(()=>{const te=[];return _.forEach(re=>{k.length>0&&(k.includes(re)&&G.includes(re)&&re!==""&&te.push(re),!k.includes(re)&&re!==""&&te.push(re))}),te})();return ae.length>0&&H.length>0&&(q=U(G,ae)&&K(H,J)),ae.length>0&&H.length<1&&(q=U(G,ae)),ae.length<1&&H.length>0&&(q=K(H,J)),q};if(w&&s.metadata.timespan.length>0){const J=s.metadata.timespan.find(G=>G.start==="-INF"&&G.end==="+INF"),q=X.parseTimespan(J,{joinValue:",",flat:!0});Object.keys(q).forEach(G=>{typeof q[G]=="string"&&G!=="user"&&G!=="created"&&G!=="duration"&&q[G].toLowerCase().split(/[\s,]+/).forEach(ae=>{k.push(ae)})}),s.metadata.timespan.forEach(G=>{const{start:R,end:ae,field:te=[],group:re=[]}=G;if(ae!=="+INF"&&R!=="-INF"){const ce=[];te.length>0&&ce.push("field"),re.length>0&&ce.push("group");const pe=X.parseTimespan(G,{joinValue:",",flat:!0}),se=fe=>Object.keys(fe).reduce((Te,ge)=>Array.isArray(fe[ge])?Te:typeof fe[ge]=="object"&&fe[ge]!==null?[...Te,...se(fe[ge])]:[...Te,ge],[]),me=se(pe);let qe=[];A.forEach(fe=>{const Te=Object.keys(pe);fe.name===Te.toString()&&me.forEach(ge=>{fe.field.length>0&&fe.field.includes(ge)&&qe.push(ge)})});const it=[],je=fe=>{let Te=null;if(qe.length<1&&(qe=me),fe instanceof Array)for(let ge=0;ge<fe.length&&(Te=je(fe[ge]),!Te);ge+=1);else for(const ge in fe)if(Te===null){if(qe.includes(ge)){const ke=v.filter(Fe=>Fe.name===ge),Re=ke.length>0?ke[0].label:ge;it.push({name:ge,label:Re,value:fe[ge],valueList:fe[ge].toLowerCase().replaceAll('"',"").split(" ")})}if((fe[ge]instanceof Object||fe[ge]instanceof Array)&&(Te=je(fe[ge]),Te))break}return Te};je(pe);const lt={start:G.start,end:G.end,data:it};Z(lt)&&ce.forEach(fe=>{G[fe].forEach(Te=>{Y.indexOf(Te.name)===-1&&(Y.push(Te.name),P.push({key:Te.name,data:[]}));const ge=P.findIndex(Fe=>Fe.key===Te.name);P[ge].data.push(lt);const Re=A.filter(Fe=>Fe.name===Te.name);Re.length>0&&(P[ge].label=Re[0].label)})})}})}return t.jsxs("div",{className:a,children:[z.length>0?t.jsxs(t.Fragment,{children:[I&&t.jsx(I,{className:n.timeline,length:D,...T,children:z.map((J,q)=>t.jsx(b,{className:n.timelineEvent,position:X.formatTimeCodeText(J.start).toSeconds(),onClick:()=>$(q),...M,children:m&&t.jsx(m,{className:n.timelineEventContent,itemType:s,timespan:J,...y})},J.start))}),!w&&L&&t.jsx(L,{classes:n,events:z,active:B,itemType:s,EventProps:u,EventContentComponent:g,EventContentProps:h,...S}),d&&t.jsx(d,{className:n.eventContainer,...c,children:z.map((J,q)=>t.jsx(p,{className:n.event,isActive:q===B,timespan:J,itemType:s,EventContentComponent:g,EventContentProps:h,...u},[F,J.start,J.end].join()))})]}):l,w&&L&&P.map(J=>t.jsxs("div",{children:[t.jsx(r.Typography,{variant:"caption",style:{marginTop:40,marginBottom:10,display:"block"},noWrap:!0,children:J.label||J.key}),t.jsx(L,{classes:n,events:J.data,active:B,itemType:s,EventProps:u,EventContentComponent:g,EventContentProps:h,...S})]},J.key))]})}Ko.propTypes={classes:e.objectOf(e.string),className:e.string,itemType:ye.ItemType.isRequired,matchHighlights:e.bool,eventFilter:e.func,noEventsText:e.string,EventContainerComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),EventContainerProps:e.objectOf(e.any),EventComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),EventProps:e.objectOf(e.any),EventContentComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),EventContentProps:e.objectOf(e.any),EventMarkerThumbnailComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),EventMarkerThumbnailProps:e.objectOf(e.any),EventMarkerTimelineComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),EventMarkerTimelineProps:e.objectOf(e.any),EventMarkerComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),EventMarkerProps:e.objectOf(e.any),EventListComponent:e.oneOfType([e.elementType,e.oneOf([!1])]),EventListProps:e.objectOf(e.any),GroupedTimeline:e.bool,GroupConfig:e.arrayOf(e.any),FieldLabelMap:e.arrayOf(e.any),itemSearchDocument:e.objectOf(e.any)},Ko.defaultProps={className:void 0,classes:{},matchHighlights:!0,eventFilter:()=>!0,noEventsText:null,EventContainerComponent:Wo,EventContainerProps:{},EventComponent:$o,EventProps:{},EventContentComponent:null,EventContentProps:{},EventMarkerThumbnailComponent:Zo,EventMarkerThumbnailProps:{},EventMarkerTimelineComponent:Xo,EventMarkerTimelineProps:{},EventMarkerComponent:Qo,EventMarkerProps:{},EventListComponent:!1,EventListProps:{},GroupedTimeline:!1,GroupConfig:[],FieldLabelMap:[],itemSearchDocument:{}};const ug=r.withStyles(PD,{name:"VdtEventTimeline"})(Ko);ug.displayName="EventTimeline",N.AddRelationDialog=zp,N.AddToCollectionDialog=Ma,N.AutocompleteConstraintField=Ls,N.AutocompleteField=Jt,N.BatonAnalysisDialog=hh,N.BatonAnalysisForm=Ss,N.BinList=Gu,N.BinListMenu=Uu,N.ChangePasswordDialog=FA,N.ChangePasswordForm=Xu,N.ChangeUserPasswordDialog=ng,N.CheckboxField=Zt,N.CheckboxGroupField=Cs,N.CollectionAccessTab=Rb,N.CollectionCard=rt,N.CollectionCardThumbnail=Mp,N.CollectionContent=jp,N.CollectionCreateDialog=Op,N.CollectionGrid=Lp,N.CollectionList=xr,N.CollectionListItem=Nr,N.CollectionMetadataEdit=xp,N.CollectionMetadataTab=Xb,N.CollectionRow=fa,N.CollectionSearchPicker=Ia,N.CollectionTable=Mr,N.CollectionTreeList=Ar,N.CreateGroupDialog=ig,N.CreateUserDialog=tg,N.DateField=Is,N.DragAndDropContext=Ta,N.DragAndDropProvider=Ib,N.DragScroll=cg,N.ENTITY_TREE_COLLECTION=Ie,N.ENTITY_TREE_ITEM=Ye,N.ENTITY_TREE_JOIN_CHARACTER=ot,N.ENTITY_TREE_ROOT=Lr,N.EditGroupDialog=lg,N.EditUserDialog=ag,N.EntityCard=Fu,N.EntityComment=jw,N.EntityDeleteDialog=qu,N.EntityGrid=bw,N.EntityGridItemDraggable=zu,N.EntityTable=Aw,N.EntityTableRowDraggable=Bu,N.EntityTree=Rw,N.EntityTreeContext=Ca,N.EntityTreeList=$u,N.Event=$o,N.EventContainer=Wo,N.EventMarker=Qo,N.EventMarkerThumbnail=Zo,N.EventMarkerTimeline=Xo,N.EventTimeline=ug,N.ExpandedFormControlLabel=Mh,N.FieldGroupDesigner=cL,N.FieldIcon=Rp,N.FileTreeLabel=nu,N.FilterCard=Bh,N.FilterForm=Os,N.FilterFormLabel=xs,N.FolderListTree=ao,N.FolderTree=CL,N.FolderTreeLabel=du,N.GroupDetails=sg,N.GroupRelationList=st,N.GroupTable=og,N.ImageCollage=fr,N.ItemAccessTab=Wm,N.ItemCard=_e,N.ItemCompoundMetadataTab=IM,N.ItemCompoundMetadataTable=_p,N.ItemFieldGroupTab=hf,N.ItemFileShareDialog=fM,N.ItemGrid=Hr,N.ItemGridDroppable=rM,N.ItemImagePlayer=Qp,N.ItemList=Yr,N.ItemListItem=Ur,N.ItemMetadataFieldGroupRow=ri,N.ItemMetadataFieldRow=dn,N.ItemMetadataFormRow=dn,N.ItemMetadataFormTable=cn,N.ItemMetadataTab=uf,N.ItemParentsTab=zI,N.ItemPlayer=Xp,N.ItemPoster=fp,N.ItemPosterTab=WT,N.ItemRelationRemoveDialog=Bp,N.ItemRelationsTab=QI,N.ItemRow=qr,N.ItemSearchPicker=Fp,N.ItemShapeTab=vT,N.ItemShapeTable=or,N.ItemSidecarDialog=Wp,N.ItemSidecarDownload=Gp,N.ItemSidecarUpload=$p,N.ItemSourceTab=jT,N.ItemSourceTable=ir,N.ItemTable=kp,N.ItemTabs=qp,N.ItemTimespanTab=Dm,N.ItemTreeItem=wr,N.ItemVideoPlayer=Hp,N.JobCard=hy,N.JobDataTable=Zs,N.JobFooter=$s,N.JobFooterContext=Xs,N.JobFooterContextProvider=fy,N.JobList=ay,N.JobRow=Gs,N.JobRowButton=Xt,N.JobTable=_a,N.JobTaskTable=Js,N.LayoutButtonGroup=Dg,N.LoginForm=vs,N.MediaBadge=ea,N.MediaBadges=Ks,N.MediaCard=Ut,N.MediaCardActions=Cp,N.MediaCardAvatar=It,N.MediaCardCard=Tp,N.MediaCardCheckbox=Gt,N.MediaCardContent=bp,N.MediaCardDurationLabel=dr,N.MediaCardFullWidth=Zu,N.MediaCardHeader=Ip,N.MediaCardMenu=gr,N.MediaCardThumbnail=bt,N.MediaCardThumbnailLabel=Xe,N.MimeTypeIcon=Ke,N.Pagination=Kt,N.PaginationActions=Ys,N.QueryBetween=Au,N.QueryBuilder=fo,N.QueryBuilderCard=ju,N.QueryContains=Nu,N.QueryEntry=Eu,N.QueryEquals=po,N.QueryField=vu,N.QueryGroup=xu,N.QueryInput=La,N.QueryOperator=Ou,N.RadioField=Ts,N.RemoveFromCollectionDialog=Fr,N.SavedSearch=dS,N.SavedSearchFolder=US,N.SearchField=Lu,N.SearchInput=ba,N.SearchInputFieldSelect=Ws,N.SearchResultRow=Tu,N.SearchResultTable=_L,N.SearchSuggestions=WL,N.SelectField=Ve,N.SelectedEntityWrapper=OL,N.SelectedFile=pu,N.SelectedFileWrapper=uu,N.SelectedStorage=gu,N.SelectedStorageWrapper=hu,N.SelectedToolbar=pg,N.ShapeTagCard=Rs,N.ShapeTagListAccordion=ei,N.SliderField=Zg,N.Sort=Ha,N.SortMenuItem=Rt,N.SpellCheck=Mu,N.Storage=mu,N.StorageList=fu,N.StorageListTree=UL,N.StorageTree=yu,N.SubmitButton=Ba,N.SwitchField=Ms,N.TagField=bs,N.TextField=we,N.ThemeContext=Aa,N.ThemeProvider=Lg,N.TranscodeDialog=Vy,N.Upload=fA,N.UploadEditor=_u,N.UploadForm=Wu,N.UploadListItem=Sa,N.UserAvatarButton=rg,N.UserDetails=Ru,N.UserRelationList=jo,N.UserTable=Ku,N.extractEntityInfo=Sr,N.onGetToken=Lh,N.useConfirmationDialog=Da,N.useDraggedComponent=Lb,N.useMediaCardContext=TA,N.useMenu=Na,N.useSnackbarAlert=vg,N.useThemeContext=Sg,N.withDrag=Mt,N.withDrop=We,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});