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B,EAAiB4B,UAGlD5B,CACT,CAEA,sBAAAnC,CAAuBjsF,GACrB,OAAe,MAAXA,GAAmBA,EAAQ6vF,WACtB7vF,EAGF,IAAKxY,KAAKu8F,eAAeiI,aAC3BxkG,KAAK2kG,oBAA+B,MAAXnsF,OAAkB,EAASA,EAAQksF,gBAC5DlsF,EACH6vF,YAAY,EAEhB,CAEA,KAAArE,GACEhkG,KAAKglG,WAAWhB,QAChBhkG,KAAKy8F,cAAcuH,OACrB,iEC5VF,MAAMyE,EACJ,OAAAzxF,GACEhX,KAAKs9F,gBACP,CAEA,UAAAL,GACEj9F,KAAKs9F,kBAED,QAAet9F,KAAKg9F,aACtBh9F,KAAK0oG,UAAY9xF,YAAW,KAC1B5W,KAAKy9F,gBAAgB,GACpBz9F,KAAKg9F,WAEZ,CAEA,eAAAD,CAAgB4L,GAEd3oG,KAAKg9F,UAAY17F,KAAKc,IAAIpC,KAAKg9F,WAAa,EAAmB,MAAhB2L,EAAuBA,EAAe,KAAW1gD,IAAW,IAC7G,CAEA,cAAAq1C,GACMt9F,KAAK0oG,YACPzyF,aAAajW,KAAK0oG,WAClB1oG,KAAK0oG,eAAYrsG,EAErB","sources":["webpack://mono-repo/./node_modules/@material/dom/events.js","webpack://mono-repo/./node_modules/@material/dom/ponyfill.js","webpack://mono-repo/./node_modules/@material/menu-surface/util.js","webpack://mono-repo/./node_modules/@material/ripple/util.js","webpack://mono-repo/./node_modules/@material/tab-indicator/fading-foundation.js","webpack://mono-repo/./node_modules/@material/tab-indicator/sliding-foundation.js","webpack://mono-repo/./node_modules/@material/tab-scroller/rtl-default-scroller.js","webpack://mono-repo/./node_modules/@material/tab-scroller/rtl-negative-scroller.js","webpack://mono-repo/./node_modules/@material/tab-scroller/rtl-reverse-scroller.js","webpack://mono-repo/./node_modules/@material/tab-scroller/rtl-scroller.js","webpack://mono-repo/./node_modules/@material/tab-scroller/util.js","webpack://mono-repo/./packages/core-app/actions.js","webpack://mono-repo/./build-targets/theme/packages/core-app/actions.js","webpack://mono-repo/./packages/core-app/menus.js","webpack://mono-repo/./build-targets/theme/packages/core-app/menus.js","webpack://mono-repo/./packages/core-app/views/menuView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/menuView.js","webpack://mono-repo/./packages/core-app/models/app.js","webpack://mono-repo/./packages/core-app/models/brand.js","webpack://mono-repo/./packages/core-app/views/appFullScreenView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/appFullScreenView.js","webpack://mono-repo/./packages/core-app/views/appProgressView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/appProgressView.js","webpack://mono-repo/./packages/core-app/collections/optionTiles.js","webpack://mono-repo/./packages/core/lib/netx-analytics.js","webpack://mono-repo/./packages/core-app/controller.js","webpack://mono-repo/./build-targets/theme/packages/core-app/controller.js","webpack://mono-repo/./packages/core-app/index.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/advancedMenuItemView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/advancedMenuView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/index.js","webpack://mono-repo/./packages/core-app/routes.js","webpack://mono-repo/./build-targets/theme/packages/core-app/routes.js","webpack://mono-repo/./packages/core-app/views/appModalCrumbView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/appModalCrumbView.js","webpack://mono-repo/./packages/core-app/views/appModalCrumbsView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/appModalCrumbsView.js","webpack://mono-repo/./packages/core-app/views/appModalView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/appModalView.js","webpack://mono-repo/./packages/core-app/views/confirmView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/confirmView.js","webpack://mono-repo/./packages/core-auth/actions.js","webpack://mono-repo/./packages/core-auth/menus.js","webpack://mono-repo/./packages/core-auth/views/authSamlServiceView.js","webpack://mono-repo/./packages/core-auth/views/authUserLoginView.js","webpack://mono-repo/./build-targets/theme/packages/core-auth/views/authUserLoginView.js","webpack://mono-repo/./packages/core-auth/routes.js","webpack://mono-repo/./packages/core-auth/controller.js","webpack://mono-repo/./build-targets/theme/packages/core-auth/controller.js","webpack://mono-repo/./packages/core-auth/index.js","webpack://mono-repo/./packages/core-cart/config.js","webpack://mono-repo/./build-targets/theme/packages/core-cart/config.js","webpack://mono-repo/./packages/core-category/collections/categoryTreeNodes.js","webpack://mono-repo/./build-targets/theme/packages/core-category/collections/categoryTreeNodes.js","webpack://mono-repo/./packages/core-category/config.js","webpack://mono-repo/./build-targets/theme/packages/core-category/config.js","webpack://mono-repo/./packages/core-notification/actions.js","webpack://mono-repo/./build-targets/theme/packages/core-notification/actions.js","webpack://mono-repo/./packages/core-notification/menus.js","webpack://mono-repo/./packages/core-notification/routes.js","webpack://mono-repo/./packages/core-notification/controller.js","webpack://mono-repo/./packages/core-notification/index.js","webpack://mono-repo/./build-targets/theme/packages/core/controller.js","webpack://mono-repo/./build-targets/theme/packages/core/functionality/materialCheckboxes.js","webpack://mono-repo/./build-targets/theme/packages/core/functionality/materialMenus.js","webpack://mono-repo/./build-targets/theme/packages/core/functionality/materialRipples.js","webpack://mono-repo/./build-targets/theme/packages/core/functionality/patches/mdc-textfield.js","webpack://mono-repo/./build-targets/theme/packages/core/functionality/materialTextFields.js","webpack://mono-repo/./build-targets/theme/packages/core/functionality/patches/mdc-list.js","webpack://mono-repo/./packages/core-app-next/constants.ts","webpack://mono-repo/./packages/core-app-next/utils/getAvailableLocales.ts","webpack://mono-repo/./packages/core-app/collections/appViews.js","webpack://mono-repo/./packages/core-app/collections/appViewsQueue.js","webpack://mono-repo/./packages/core-app/collections/customForm.js","webpack://mono-repo/./packages/core-app/collections/storageLocations.js","webpack://mono-repo/./packages/core-app/enablers.js","webpack://mono-repo/./packages/core-app/models/appView.js","webpack://mono-repo/./packages/core-app/models/customFormElement.js","webpack://mono-repo/./packages/core-app/models/optionTile.js","webpack://mono-repo/./packages/core-app/models/pager.js","webpack://mono-repo/./packages/core-app/models/progress.js","webpack://mono-repo/./packages/core-app/models/sorter.js","webpack://mono-repo/./packages/core-app/models/storageLocation.js","webpack://mono-repo/./packages/core-app/properties/autocomplete.ts","webpack://mono-repo/./packages/core-app/properties/locations.js","webpack://mono-repo/./packages/core-app/singletons/appViews.ts","webpack://mono-repo/./packages/core-app/views/appBodyView.js","webpack://mono-repo/./build-targets/theme/packages/core-app/views/appBodyView.js","webpack://mono-repo/./packages/core-app/singletons/bodyViews.ts","webpack://mono-repo/./packages/core-app/singletons/fsViews.ts","webpack://mono-repo/./packages/core-app/singletons/modalViews.ts","webpack://mono-repo/./packages/core-app/views/alertView.js","webpack://mono-repo/./packages/core-asset-expiration/constants.ts","webpack://mono-repo/./packages/core-asset-expiration/enablers.ts","webpack://mono-repo/./packages/core-asset-expiration/utils/assetExpirationToDateString.ts","webpack://mono-repo/./packages/core-asset-expiration/utils/assetExpires.ts","webpack://mono-repo/./packages/core-asset-expiration/utils/userInputToExpirationTime.ts","webpack://mono-repo/./packages/core-asset-next/constants.ts","webpack://mono-repo/./packages/core-asset-next/enablers.ts","webpack://mono-repo/./packages/core-asset-project/constants.ts","webpack://mono-repo/./packages/core-asset-project/enablers.ts","webpack://mono-repo/./packages/core-asset/collections/attributeDatum.js","webpack://mono-repo/./packages/core-asset/models/assetAttributeData.js","webpack://mono-repo/./packages/core-asset/collections/assetAttributeDatum.js","webpack://mono-repo/./packages/core-asset/collections/assetConstituents_.js","webpack://mono-repo/./packages/core-asset/models/assetConstituent_keyframe.js","webpack://mono-repo/./packages/core-asset/models/assetConstituent_layer.js","webpack://mono-repo/./packages/core-asset/models/assetConstituent_page.js","webpack://mono-repo/./packages/core-asset/collections/assetConstituents.js","webpack://mono-repo/./packages/core-asset/collections/assetConstituents_clips.js","webpack://mono-repo/./packages/core-asset/collections/assetConstituents_keyframes.js","webpack://mono-repo/./packages/core-asset/collections/assetConstituents_layers.js","webpack://mono-repo/./packages/core-asset/collections/assetConstituents_pages.js","webpack://mono-repo/./packages/core-asset/collections/assets.js","webpack://mono-repo/./packages/core-asset/collections/attributeProfiles.js","webpack://mono-repo/./packages/core-asset/models/pendingAsset.js","webpack://mono-repo/./packages/core-asset/collections/pendingAssets.js","webpack://mono-repo/./packages/core-asset/collections/singleton/pendingAssets.ts","webpack://mono-repo/./packages/core-asset/constants.ts","webpack://mono-repo/./packages/core-asset/models/assetConstituent.js","webpack://mono-repo/./packages/core-asset/models/assetConstituent_clip.js","webpack://mono-repo/./packages/core-asset/models/assetSet.js","webpack://mono-repo/./packages/core-asset/models/assetVersion.js","webpack://mono-repo/./packages/core-asset/models/attribute.js","webpack://mono-repo/./packages/core-asset/models/attributeData.js","webpack://mono-repo/./packages/core-asset/models/attributeProfileAttribute.js","webpack://mono-repo/./packages/core-asset/collections/attributeProfileAttributes.js","webpack://mono-repo/./packages/core-asset/models/attributeProfile.js","webpack://mono-repo/./packages/core-asset/models/attribute_date.js","webpack://mono-repo/./packages/core-asset/models/attribute_multiselect.js","webpack://mono-repo/./packages/core-asset/models/attribute_number.js","webpack://mono-repo/./packages/core-asset/models/attribute_select.js","webpack://mono-repo/./packages/core-asset/models/attribute_semantic.js","webpack://mono-repo/./packages/core-asset/models/attribute_tag.js","webpack://mono-repo/./packages/core-asset/models/attribute_tagVocab.js","webpack://mono-repo/./packages/core-asset/models/attribute_text.js","webpack://mono-repo/./packages/core-asset/models/attribute_textarea.js","webpack://mono-repo/./packages/core-asset/properties/assetAttributesMetadata.js","webpack://mono-repo/./packages/core-asset/properties/assetSets.js","webpack://mono-repo/./packages/core-asset/utils/assetHasAudio.ts","webpack://mono-repo/./packages/core-asset/utils/assetHasVideo.ts","webpack://mono-repo/./packages/core-asset/utils/getAssetFileSizeLabel.ts","webpack://mono-repo/./packages/core-asset/utils/assetIsPresent.ts","webpack://mono-repo/./packages/core-asset/utils/createAssetObject.ts","webpack://mono-repo/./packages/core-asset/utils/isVideoFileTypeAsset.ts","webpack://mono-repo/./packages/core-asset/utils/getGeneralAssetFileType.ts","webpack://mono-repo/./packages/core-asset/utils/isDocumentFileTypeAsset.ts","webpack://mono-repo/./packages/core-asset/utils/isImageFileTypeAsset.ts","webpack://mono-repo/./packages/core-asset/utils/getMediaFileTypeAssetInfoLabel.ts","webpack://mono-repo/./packages/core-asset/utils/getAssetFileTypeInfoLabel.ts","webpack://mono-repo/./packages/core-asset/utils/getDocumentFileTypeAssetInfoLabel.ts","webpack://mono-repo/./packages/core-asset/utils/getImageFileTypeAssetInfoLabel.ts","webpack://mono-repo/./packages/core-asset/utils/isAssetCheckedOut.ts","webpack://mono-repo/./packages/core-asset/utils/isDefaultIcon.ts","webpack://mono-repo/./packages/core-asset/utils/routeToAsset.ts","webpack://mono-repo/./packages/core-asset/utils/isMediaFileTypeAsset.ts","webpack://mono-repo/./packages/core-attribute-history/constants.ts","webpack://mono-repo/./packages/core-attribute-history/enablers.ts","webpack://mono-repo/./packages/core-attribute-profile/constants.ts","webpack://mono-repo/./packages/core-attribute-profile/enablers.ts","webpack://mono-repo/./packages/core-attribute-profile/locales.ts","webpack://mono-repo/./packages/core-attribute-profile/actions/constants.ts","webpack://mono-repo/./packages/core-attribute-profile/actions/attribute-profiles-system-route.ts","webpack://mono-repo/./packages/core-attribute-smart-labels/enablers.ts","webpack://mono-repo/./packages/core-attribute/constants.ts","webpack://mono-repo/./packages/core-attribute/enablers.ts","webpack://mono-repo/./packages/core-attribute/locales.ts","webpack://mono-repo/./packages/core-attribute/singletons/attributeTemplates.ts","webpack://mono-repo/./packages/core-attribute/utils/getLabel.ts","webpack://mono-repo/./packages/core-attribute/utils/getTypeLabel.ts","webpack://mono-repo/./packages/core-attribute/utils/getTypeName.ts","webpack://mono-repo/./packages/core-auth-next/utils/canRequestPasswordReset.ts","webpack://mono-repo/./packages/core-cart/collections/cartAssets.js","webpack://mono-repo/./packages/core-cart/collections/savedCarts.js","webpack://mono-repo/./packages/core-cart/collections/singleton/savedCart.ts","webpack://mono-repo/./packages/core-cart/models/savedCart.js","webpack://mono-repo/./packages/core-cart/properties/cartAssetArchive.js","webpack://mono-repo/./packages/core-category/models/categoryDetailsData.js","webpack://mono-repo/./packages/core-cms/services/settings/constants.ts","webpack://mono-repo/./packages/core-cms/services/settings/utils/hasUpdatedAttributesSystem.ts","webpack://mono-repo/./packages/core-constituents/constants.ts","webpack://mono-repo/./packages/core-constituents/enablers.ts","webpack://mono-repo/./packages/core-data-set/constants.ts","webpack://mono-repo/./packages/core-data-set/enablers.ts","webpack://mono-repo/./packages/core-download-request/actions/constants.ts","webpack://mono-repo/./packages/core-download-request/actions/download-requests-manage-route.ts","webpack://mono-repo/./packages/core-download-request/enablers.ts","webpack://mono-repo/./packages/core-download-request/constants.ts","webpack://mono-repo/./packages/core-download-request/locales.ts","webpack://mono-repo/./packages/core-next/locales.ts","webpack://mono-repo/./packages/core-next/whenReady.ts","webpack://mono-repo/./packages/core-notification/models/notification.js","webpack://mono-repo/./packages/core-notification/collections/notifications.js","webpack://mono-repo/./packages/core-notification/singletons/notification.ts","webpack://mono-repo/./packages/core-permissions/collections/participants.js","webpack://mono-repo/./packages/core-permissions/constants.ts","webpack://mono-repo/./packages/core-permissions/models/participant.js","webpack://mono-repo/./packages/core-permissions/models/permission.js","webpack://mono-repo/./packages/core-permissions/models/permissionParticipant.js","webpack://mono-repo/./packages/core-permissions/collections/permissionsParticipants.js","webpack://mono-repo/./packages/core-permissions/collections/permissions.js","webpack://mono-repo/./packages/core-permissions/models/permissionResource.js","webpack://mono-repo/./packages/core-permissions/properties/actions.js","webpack://mono-repo/./packages/core-permissions/properties/assetPermissions.ts","webpack://mono-repo/./packages/core-permissions/properties/permissions.ts","webpack://mono-repo/./packages/core-permissions/utils/allows.ts","webpack://mono-repo/./packages/core-search/collections/searchRules.js","webpack://mono-repo/./packages/core-search/models/searchRule_asset.js","webpack://mono-repo/./packages/core-search/models/searchFacetOption.js","webpack://mono-repo/./packages/core-search/collections/searchFacetOptions.js","webpack://mono-repo/./packages/core-search/models/searchFacet.js","webpack://mono-repo/./packages/core-search/collections/searchFacetsSelected.js","webpack://mono-repo/./packages/core-search/collections/searchFacets.js","webpack://mono-repo/./packages/core-search/collections/searchRules_assets.js","webpack://mono-repo/./packages/core-search/collections/savedSearches.js","webpack://mono-repo/./packages/core-search/collections/singleton/savedSearch.ts","webpack://mono-repo/./packages/core-search/config.js","webpack://mono-repo/./packages/core-search/models/savedSearch.js","webpack://mono-repo/./packages/core-search/models/searchRule.js","webpack://mono-repo/./packages/core-search/properties/search.js","webpack://mono-repo/./packages/core-share-media-service/constants.ts","webpack://mono-repo/./packages/core-share-media-service/enablers.ts","webpack://mono-repo/./packages/core-share/collections/downloadOptions.js","webpack://mono-repo/./packages/core-share/collections/sharedResources.js","webpack://mono-repo/./packages/core-share/models/downloadOption.js","webpack://mono-repo/./packages/core-share/models/shareable.js","webpack://mono-repo/./packages/core-share/models/sharedResource.js","webpack://mono-repo/./packages/core-share/properties/downloadOptions.js","webpack://mono-repo/./packages/core-upload/enablers.js","webpack://mono-repo/./packages/core-user/collections/groups.js","webpack://mono-repo/./packages/core-user/collections/singletons/userProfile.ts","webpack://mono-repo/./packages/core-user/collections/users.js","webpack://mono-repo/./packages/core-user/constants.ts","webpack://mono-repo/./packages/core-user/models/group.js","webpack://mono-repo/./packages/core-user/models/userProfile.js","webpack://mono-repo/./packages/core-user/utils/currentUserMeetsUserLevel.ts","webpack://mono-repo/./packages/core-user/utils/getUserLevel.ts","webpack://mono-repo/./packages/core-user/utils/getCorrectedUserSelector.ts","webpack://mono-repo/./packages/core-user/utils/setPreference.ts","webpack://mono-repo/./packages/core/functionality/childViews.js","webpack://mono-repo/./packages/core-app/views/formErrorListItemView.js","webpack://mono-repo/./packages/core-app/views/formErrorListView.js","webpack://mono-repo/./src/js/lib/formValidation-netx.js","webpack://mono-repo/./packages/core/functionality/form.js","webpack://mono-repo/./packages/core/legacyMenuManager.ts","webpack://mono-repo/./packages/core/lib/netx-autocomplete.js","webpack://mono-repo/./packages/core/lib/netx-enablers.js","webpack://mono-repo/./packages/core/lib/netx-menu.js","webpack://mono-repo/./packages/core/lib/netx-moment.ts","webpack://mono-repo/./packages/core/utils/extendBackboneActions.ts","webpack://mono-repo/./packages/core/utils/randomChars.ts","webpack://mono-repo/./node_modules/moment/locale/de-at.js","webpack://mono-repo/./node_modules/moment/locale/de-ch.js","webpack://mono-repo/./node_modules/moment/locale/de.js","webpack://mono-repo/./node_modules/moment/locale/en-au.js","webpack://mono-repo/./node_modules/moment/locale/en-ca.js","webpack://mono-repo/./node_modules/moment/locale/en-gb.js","webpack://mono-repo/./node_modules/moment/locale/en-ie.js","webpack://mono-repo/./node_modules/moment/locale/en-il.js","webpack://mono-repo/./node_modules/moment/locale/en-in.js","webpack://mono-repo/./node_modules/moment/locale/en-nz.js","webpack://mono-repo/./node_modules/moment/locale/en-sg.js","webpack://mono-repo/./node_modules/moment/locale/es-do.js","webpack://mono-repo/./node_modules/moment/locale/es-us.js","webpack://mono-repo/./node_modules/moment/locale/es.js","webpack://mono-repo/./node_modules/moment/locale/fr-ca.js","webpack://mono-repo/./node_modules/moment/locale/fr-ch.js","webpack://mono-repo/./node_modules/moment/locale/fr.js","webpack://mono-repo/./node_modules/moment/locale/gom-deva.js","webpack://mono-repo/./node_modules/moment/locale/ja.js","webpack://mono-repo/./node_modules/moment/locale/ ./node_modules/moment/locale/ sync ^\\.\\/.*$","webpack://mono-repo/./node_modules/react-dom/client.js","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/advancedMenuItemView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/advancedMenuView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/alertView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/appBodyView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/appFullScreenView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/appModalCrumbView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/appModalCrumbsView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/appModalView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/appProgressView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/confirmView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/empty.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/formErrorListItemView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/formErrorListView.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-actionIconsInline.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-assetDetailActions.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-attributeColumnsContextMenu.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-attributeColumnsContextMenuItem.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-cartBarActions.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-context.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-headerActions.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-listHeaderActions.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-navTabs.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-podActions.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-sidebar.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-sidebarActions.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-systemHeaderActions.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-systemList.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView-systemTableActions.html","webpack://mono-repo/./build-targets/theme/packages/core-app/templates/menuView.html","webpack://mono-repo/./packages/core-app/templates/empty.html","webpack://mono-repo/./npm/javascript-detect-element-resize/detect-element-resize.js","webpack://mono-repo/./src/js/lib/base64.js","webpack://mono-repo/./src/js/lib/bootstrap-netx.js","webpack://mono-repo/./src/js/lib/imagesloaded.pkgd.js","webpack://mono-repo/./node_modules/@tanstack/query-core/build/lib/infiniteQueryBehavior.mjs","webpack://mono-repo/./node_modules/@tanstack/query-core/build/lib/logger.mjs","webpack://mono-repo/./node_modules/@tanstack/query-core/build/lib/mutation.mjs","webpack://mono-repo/./node_modules/@tanstack/query-core/build/lib/query.mjs","webpack://mono-repo/./node_modules/@tanstack/query-core/build/lib/queryCache.mjs","webpack://mono-repo/./node_modules/@tanstack/query-core/build/lib/mutationCache.mjs","webpack://mono-repo/./node_modules/@tanstack/query-core/build/lib/queryClient.mjs","webpack://mono-repo/./node_modules/@tanstack/query-core/build/lib/removable.mjs"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * Stores result from applyPassive to avoid redundant processing to detect\n * passive event listener support.\n */\nvar supportsPassive_;\n/**\n * Determine whether the current browser supports passive event listeners, and\n * if so, use them.\n */\nexport function applyPassive(globalObj, forceRefresh) {\n if (globalObj === void 0) { globalObj = window; }\n if (forceRefresh === void 0) { forceRefresh = false; }\n if (supportsPassive_ === undefined || forceRefresh) {\n var isSupported_1 = false;\n try {\n globalObj.document.addEventListener('test', function () { return undefined; }, {\n get passive() {\n isSupported_1 = true;\n return isSupported_1;\n },\n });\n }\n catch (e) {\n } // tslint:disable-line:no-empty cannot throw error due to tests. tslint also disables console.log.\n supportsPassive_ = isSupported_1;\n }\n return supportsPassive_ ? { passive: true } : false;\n}\n//# sourceMappingURL=events.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global prototype chain.\n * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.\n */\nexport function closest(element, selector) {\n if (element.closest) {\n return element.closest(selector);\n }\n var el = element;\n while (el) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n}\nexport function matches(element, selector) {\n var nativeMatches = element.matches\n || element.webkitMatchesSelector\n || element.msMatchesSelector;\n return nativeMatches.call(element, selector);\n}\n//# sourceMappingURL=ponyfill.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar cachedCssTransformPropertyName_;\n/**\n * Returns the name of the correct transform property to use on the current browser.\n */\nfunction getTransformPropertyName(globalObj, forceRefresh) {\n if (forceRefresh === void 0) { forceRefresh = false; }\n if (cachedCssTransformPropertyName_ === undefined || forceRefresh) {\n var el = globalObj.document.createElement('div');\n cachedCssTransformPropertyName_ = 'transform' in el.style ? 'transform' : 'webkitTransform';\n }\n return cachedCssTransformPropertyName_;\n}\nexport { getTransformPropertyName };\n//# sourceMappingURL=util.js.map","/**\n * Stores result from supportsCssVariables to avoid redundant processing to\n * detect CSS custom variable support.\n */\nvar supportsCssVariables_;\nfunction detectEdgePseudoVarBug(windowObj) {\n // Detect versions of Edge with buggy var() support\n // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/\n var document = windowObj.document;\n var node = document.createElement('div');\n node.className = 'mdc-ripple-surface--test-edge-var-bug';\n // Append to head instead of body because this script might be invoked in the\n // head, in which case the body doesn't exist yet. The probe works either way.\n document.head.appendChild(node);\n // The bug exists if ::before style ends up propagating to the parent element.\n // Additionally, getComputedStyle returns null in iframes with display: \"none\" in Firefox,\n // but Firefox is known to support CSS custom properties correctly.\n // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n var computedStyle = windowObj.getComputedStyle(node);\n var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === 'solid';\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n return hasPseudoVarBug;\n}\nexport function supportsCssVariables(windowObj, forceRefresh) {\n if (forceRefresh === void 0) { forceRefresh = false; }\n var CSS = windowObj.CSS;\n var supportsCssVars = supportsCssVariables_;\n if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {\n return supportsCssVariables_;\n }\n var supportsFunctionPresent = CSS && typeof CSS.supports === 'function';\n if (!supportsFunctionPresent) {\n return false;\n }\n var explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');\n // See: https://bugs.webkit.org/show_bug.cgi?id=154669\n // See: README section on Safari\n var weAreFeatureDetectingSafari10plus = (CSS.supports('(--css-vars: yes)') &&\n CSS.supports('color', '#00000000'));\n if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {\n supportsCssVars = !detectEdgePseudoVarBug(windowObj);\n }\n else {\n supportsCssVars = false;\n }\n if (!forceRefresh) {\n supportsCssVariables_ = supportsCssVars;\n }\n return supportsCssVars;\n}\nexport function getNormalizedEventCoords(evt, pageOffset, clientRect) {\n if (!evt) {\n return { x: 0, y: 0 };\n }\n var x = pageOffset.x, y = pageOffset.y;\n var documentX = x + clientRect.left;\n var documentY = y + clientRect.top;\n var normalizedX;\n var normalizedY;\n // Determine touch point relative to the ripple container.\n if (evt.type === 'touchstart') {\n var touchEvent = evt;\n normalizedX = touchEvent.changedTouches[0].pageX - documentX;\n normalizedY = touchEvent.changedTouches[0].pageY - documentY;\n }\n else {\n var mouseEvent = evt;\n normalizedX = mouseEvent.pageX - documentX;\n normalizedY = mouseEvent.pageY - documentY;\n }\n return { x: normalizedX, y: normalizedY };\n}\n//# sourceMappingURL=util.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCTabIndicatorFoundation } from './foundation';\n/* istanbul ignore next: subclass is not a branch statement */\nvar MDCFadingTabIndicatorFoundation = /** @class */ (function (_super) {\n tslib_1.__extends(MDCFadingTabIndicatorFoundation, _super);\n function MDCFadingTabIndicatorFoundation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCFadingTabIndicatorFoundation.prototype.activate = function () {\n this.adapter_.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n };\n MDCFadingTabIndicatorFoundation.prototype.deactivate = function () {\n this.adapter_.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n };\n return MDCFadingTabIndicatorFoundation;\n}(MDCTabIndicatorFoundation));\nexport { MDCFadingTabIndicatorFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFadingTabIndicatorFoundation;\n//# sourceMappingURL=fading-foundation.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCTabIndicatorFoundation } from './foundation';\n/* istanbul ignore next: subclass is not a branch statement */\nvar MDCSlidingTabIndicatorFoundation = /** @class */ (function (_super) {\n tslib_1.__extends(MDCSlidingTabIndicatorFoundation, _super);\n function MDCSlidingTabIndicatorFoundation() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCSlidingTabIndicatorFoundation.prototype.activate = function (previousIndicatorClientRect) {\n // Early exit if no indicator is present to handle cases where an indicator\n // may be activated without a prior indicator state\n if (!previousIndicatorClientRect) {\n this.adapter_.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n return;\n }\n // This animation uses the FLIP approach. You can read more about it at the link below:\n // https://aerotwist.com/blog/flip-your-animations/\n // Calculate the dimensions based on the dimensions of the previous indicator\n var currentClientRect = this.computeContentClientRect();\n var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;\n var xPosition = previousIndicatorClientRect.left - currentClientRect.left;\n this.adapter_.addClass(MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);\n this.adapter_.setContentStyleProperty('transform', \"translateX(\" + xPosition + \"px) scaleX(\" + widthDelta + \")\");\n // Force repaint before updating classes and transform to ensure the transform properly takes effect\n this.computeContentClientRect();\n this.adapter_.removeClass(MDCTabIndicatorFoundation.cssClasses.NO_TRANSITION);\n this.adapter_.addClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n this.adapter_.setContentStyleProperty('transform', '');\n };\n MDCSlidingTabIndicatorFoundation.prototype.deactivate = function () {\n this.adapter_.removeClass(MDCTabIndicatorFoundation.cssClasses.ACTIVE);\n };\n return MDCSlidingTabIndicatorFoundation;\n}(MDCTabIndicatorFoundation));\nexport { MDCSlidingTabIndicatorFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCSlidingTabIndicatorFoundation;\n//# sourceMappingURL=sliding-foundation.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCTabScrollerRTL } from './rtl-scroller';\nvar MDCTabScrollerRTLDefault = /** @class */ (function (_super) {\n tslib_1.__extends(MDCTabScrollerRTLDefault, _super);\n function MDCTabScrollerRTLDefault() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCTabScrollerRTLDefault.prototype.getScrollPositionRTL = function () {\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n var right = this.calculateScrollEdges_().right;\n // Scroll values on most browsers are ints instead of floats so we round\n return Math.round(right - currentScrollLeft);\n };\n MDCTabScrollerRTLDefault.prototype.scrollToRTL = function (scrollX) {\n var edges = this.calculateScrollEdges_();\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n };\n MDCTabScrollerRTLDefault.prototype.incrementScrollRTL = function (scrollX) {\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n };\n MDCTabScrollerRTLDefault.prototype.getAnimatingScrollPosition = function (scrollX) {\n return scrollX;\n };\n MDCTabScrollerRTLDefault.prototype.calculateScrollEdges_ = function () {\n var contentWidth = this.adapter_.getScrollContentOffsetWidth();\n var rootWidth = this.adapter_.getScrollAreaOffsetWidth();\n return {\n left: 0,\n right: contentWidth - rootWidth,\n };\n };\n MDCTabScrollerRTLDefault.prototype.clampScrollValue_ = function (scrollX) {\n var edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.left, scrollX), edges.right);\n };\n return MDCTabScrollerRTLDefault;\n}(MDCTabScrollerRTL));\nexport { MDCTabScrollerRTLDefault };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLDefault;\n//# sourceMappingURL=rtl-default-scroller.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCTabScrollerRTL } from './rtl-scroller';\nvar MDCTabScrollerRTLNegative = /** @class */ (function (_super) {\n tslib_1.__extends(MDCTabScrollerRTLNegative, _super);\n function MDCTabScrollerRTLNegative() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCTabScrollerRTLNegative.prototype.getScrollPositionRTL = function (translateX) {\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n return Math.round(translateX - currentScrollLeft);\n };\n MDCTabScrollerRTLNegative.prototype.scrollToRTL = function (scrollX) {\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n var clampedScrollLeft = this.clampScrollValue_(-scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n };\n MDCTabScrollerRTLNegative.prototype.incrementScrollRTL = function (scrollX) {\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: clampedScrollLeft - currentScrollLeft,\n };\n };\n MDCTabScrollerRTLNegative.prototype.getAnimatingScrollPosition = function (scrollX, translateX) {\n return scrollX - translateX;\n };\n MDCTabScrollerRTLNegative.prototype.calculateScrollEdges_ = function () {\n var contentWidth = this.adapter_.getScrollContentOffsetWidth();\n var rootWidth = this.adapter_.getScrollAreaOffsetWidth();\n return {\n left: rootWidth - contentWidth,\n right: 0,\n };\n };\n MDCTabScrollerRTLNegative.prototype.clampScrollValue_ = function (scrollX) {\n var edges = this.calculateScrollEdges_();\n return Math.max(Math.min(edges.right, scrollX), edges.left);\n };\n return MDCTabScrollerRTLNegative;\n}(MDCTabScrollerRTL));\nexport { MDCTabScrollerRTLNegative };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLNegative;\n//# sourceMappingURL=rtl-negative-scroller.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport * as tslib_1 from \"tslib\";\nimport { MDCTabScrollerRTL } from './rtl-scroller';\nvar MDCTabScrollerRTLReverse = /** @class */ (function (_super) {\n tslib_1.__extends(MDCTabScrollerRTLReverse, _super);\n function MDCTabScrollerRTLReverse() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n MDCTabScrollerRTLReverse.prototype.getScrollPositionRTL = function (translateX) {\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n // Scroll values on most browsers are ints instead of floats so we round\n return Math.round(currentScrollLeft - translateX);\n };\n MDCTabScrollerRTLReverse.prototype.scrollToRTL = function (scrollX) {\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n var clampedScrollLeft = this.clampScrollValue_(scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: currentScrollLeft - clampedScrollLeft,\n };\n };\n MDCTabScrollerRTLReverse.prototype.incrementScrollRTL = function (scrollX) {\n var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();\n var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);\n return {\n finalScrollPosition: clampedScrollLeft,\n scrollDelta: currentScrollLeft - clampedScrollLeft,\n };\n };\n MDCTabScrollerRTLReverse.prototype.getAnimatingScrollPosition = function (scrollX, translateX) {\n return scrollX + translateX;\n };\n MDCTabScrollerRTLReverse.prototype.calculateScrollEdges_ = function () {\n var contentWidth = this.adapter_.getScrollContentOffsetWidth();\n var rootWidth = this.adapter_.getScrollAreaOffsetWidth();\n return {\n left: contentWidth - rootWidth,\n right: 0,\n };\n };\n MDCTabScrollerRTLReverse.prototype.clampScrollValue_ = function (scrollX) {\n var edges = this.calculateScrollEdges_();\n return Math.min(Math.max(edges.right, scrollX), edges.left);\n };\n return MDCTabScrollerRTLReverse;\n}(MDCTabScrollerRTL));\nexport { MDCTabScrollerRTLReverse };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTLReverse;\n//# sourceMappingURL=rtl-reverse-scroller.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar MDCTabScrollerRTL = /** @class */ (function () {\n function MDCTabScrollerRTL(adapter) {\n this.adapter_ = adapter;\n }\n return MDCTabScrollerRTL;\n}());\nexport { MDCTabScrollerRTL };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCTabScrollerRTL;\n//# sourceMappingURL=rtl-scroller.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { cssClasses } from './constants';\n/**\n * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.\n */\nvar horizontalScrollbarHeight_;\n/**\n * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.\n * May return 0 (e.g. on OS X browsers under default configuration).\n */\nexport function computeHorizontalScrollbarHeight(documentObj, shouldCacheResult) {\n if (shouldCacheResult === void 0) { shouldCacheResult = true; }\n if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {\n return horizontalScrollbarHeight_;\n }\n var el = documentObj.createElement('div');\n el.classList.add(cssClasses.SCROLL_TEST);\n documentObj.body.appendChild(el);\n var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;\n documentObj.body.removeChild(el);\n if (shouldCacheResult) {\n horizontalScrollbarHeight_ = horizontalScrollbarHeight;\n }\n return horizontalScrollbarHeight;\n}\n//# sourceMappingURL=util.js.map","/**\n * @module app/actions\n */\nimport {canContact} from './enablers';\nimport {helpUrl} from '@netx/core/lib/netx-enablers';\n\n/** @type {array} */\nexport default [\n\t/** @action */\n\t{\n\t\tevent: 'app:back',\n\t\tlabel: i18n.t('i18n.goBack'),\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'app:contact',\n\t\tlabel: i18n.t('i18n.contact'),\n\t\tenableTest: canContact,\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'app:help',\n\t\tlabel: i18n.t('i18n.help'),\n\t\tenableTest: helpUrl,\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'app:reportProblem',\n\t\tlabel: i18n.t('i18n.reportProblem'),\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'app:logout',\n\t\tlabel: i18n.t('i18n.logout'),\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'app:showOptions',\n\t\tlabel: i18n.t('i18n.options'),\n\t\twrapper(view, e) {\n\t\t\treturn [view.model.get('menu')];\n\t\t},\n\t},\n];\n","import actions from 'netxcore@netx/core-app/actions';\n\nimport {\n\tdatamanagerAuthorized,\n\tdatamanagerEnabled,\n} from '@netx/core-data-set/enablers';\nimport {notMobile, reviewEnabled} from '@netx/core/lib/netx-enablers.js';\nimport {bulkCartLoaderEnabled} from '@netx/core-upload/enablers';\n\nimport {extendBackboneActions} from '@netx/core/utils/extendBackboneActions';\n\nimport {icon} from '@fortawesome/fontawesome-svg-core';\nimport {\n\tfaBell,\n\tfaCaretLeft,\n\tfaChartPie,\n\tfaClipboardList,\n\tfaCloud,\n\tfaCogs,\n\tfaExclamationTriangle,\n\tfaFolder,\n\tfaHammer,\n\tfaHome,\n\tfaInbox,\n\tfaInboxIn,\n\tfaPhone,\n\tfaPowerOff,\n\tfaQuestionCircle,\n\tfaSearch,\n\tfaSyncAlt,\n\tfaTable,\n\tfaUser,\n} from '@fortawesome/pro-solid-svg-icons';\n\nconst iconOpts = {classes: ['fa-fw']};\nconst icons = {\n\tfaBell: icon(faBell, iconOpts).html,\n\tfaCaretLeft: icon(faCaretLeft, iconOpts).html,\n\tfaChartPie: icon(faChartPie, iconOpts).html,\n\tfaClipboardList: icon(faClipboardList, iconOpts).html,\n\tfaCloud: icon(faCloud, iconOpts).html,\n\tfaCogs: icon(faCogs, iconOpts).html,\n\tfaExclamationTriangle: icon(faExclamationTriangle, iconOpts).html,\n\tfaFolder: icon(faFolder, iconOpts).html,\n\tfaHammer: icon(faHammer, iconOpts).html,\n\tfaHome: icon(faHome, iconOpts).html,\n\tfaInbox: icon(faInbox, iconOpts).html,\n\tfaInboxIn: icon(faInboxIn, iconOpts).html,\n\tfaPhone: icon(faPhone, iconOpts).html,\n\tfaPowerOff: icon(faPowerOff, iconOpts).html,\n\tfaQuestionCircle: icon(faQuestionCircle, iconOpts).html,\n\tfaSearch: icon(faSearch, iconOpts).html,\n\tfaSyncAlt: icon(faSyncAlt, iconOpts).html,\n\tfaTable: icon(faTable, iconOpts).html,\n\tfaUser: icon(faUser, iconOpts).html,\n};\n\n// Extend actions defined in core file\nlet newActions = extendBackboneActions(actions, [\n\t{\n\t\tevent: 'app:contact',\n\t\ticon: icons.faPhone,\n\t\tlabel: i18n.t('i18n.contact'),\n\t},\n\t{\n\t\tevent: 'app:help',\n\t\ticon: icons.faQuestionCircle,\n\t},\n\t{\n\t\tevent: 'app:logout',\n\t\ticon: icons.faPowerOff,\n\t\troute: 'logout',\n\t},\n\t{\n\t\tevent: 'app:reportProblem',\n\t\ticon: icons.faExclamationTriangle,\n\t},\n]);\n\n// New actions\nnewActions = newActions.concat([\n\t/** @action */\n\t{\n\t\tevent: 'nx:system:autotasks',\n\t\ticon: icons.faSyncAlt,\n\t\tlabel: i18n.t('i18n.autoTasks'),\n\t\troute: 'system/autotasks',\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'nx:collections',\n\t\ticon: icons.faInbox,\n\t\tlabel: i18n.t('i18n.collections'),\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'nx:folders',\n\t\tlabel: i18n.t('i18n.categories'),\n\t\ticon: icons.faFolder,\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'nx:home',\n\t\ticon: icons.faHome,\n\t\tlabel: i18n.t('i18n.home'),\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'nx:notifications',\n\t\tlabel: i18n.t('i18n.notifications'),\n\t\ticon: icons.faBell,\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'nx:searches',\n\t\tlabel: i18n.t('i18n.searches'),\n\t\ticon: icons.faSearch,\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'nx:system',\n\t\tlabel: i18n.t('i18n.system'),\n\t\ticon: icons.faCogs,\n\t\tenableTest: notMobile,\n\t},\n\t{\n\t\tevent: 'nx:tools',\n\t\tlabel: i18n.t('i18n.tools'),\n\t\ticons: icons.faHammer,\n\t},\n\t{\n\t\tevent: 'app:upload',\n\t\tlabel: i18n.t('i18n.uploadAssets'),\n\t\ticon: icons.faCloud,\n\t\tuserLevel: 3,\n\t},\n\t{\n\t\tevent: 'app:upload:assets',\n\t\tlabel: i18n.t('i18n.upload'),\n\t\ticon: icons.faCloud,\n\t\tuserLevel: 3,\n\t\troute: 'upload/status',\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'app:upload:attributeData',\n\t\tlabel: i18n.t('i18n.importAttributeData'),\n\t\ticon: icons.faArchive,\n\t\tuserLevel: 4,\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'app:upload:bulkCartLoader',\n\t\tlabel: i18n.t('i18n.bulkCartLoader'),\n\t\ticon: icons.faInboxIn,\n\t\tenableTest: bulkCartLoaderEnabled,\n\t\tuserLevel: 2,\n\t},\n\t// This is here because the dataSet controller comes too late\n\t{\n\t\tevent: 'dataSet:dataSets',\n\t\ticon: icons.faTable,\n\t\tlabel: i18n.t('i18n.dataSets'),\n\t\tenableTest: [datamanagerAuthorized, datamanagerEnabled],\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'dataSet:dataSets:route',\n\t\ticon: icons.faTable,\n\t\tlabel: i18n.t('i18n.dataSets'),\n\t\tenableTest: [datamanagerAuthorized, datamanagerEnabled, notMobile],\n\t\troute: 'dataset/datasets',\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'projects:route',\n\t\ticon: icons.faClipboardList,\n\t\tlabel: i18n.t('i18n.reviews'),\n\t\tenableTest: reviewEnabled,\n\t\troute: 'projects',\n\t\tuserLevel: 1,\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'stat:route',\n\t\ticon: icons.faChartPie,\n\t\tlabel: i18n.t('i18n.statistics'),\n\t\tenableTest: notMobile,\n\t\troute: 'stat',\n\t\tuserLevel: 8,\n\t},\n]);\n\nexport default newActions;\n","/**\n * @module app/menus\n */\nimport Menu from '@netx/core/lib/netx-menu';\n\nexport default {};\n","import Menu from 'netxcore@netx/core/lib/netx-menu';\nimport Menus from '@netx/core-app/menus';\n\nimport {DOWNLOAD_REQUEST_EVENT} from '@netx/core-download-request/actions';\n\nObject.assign(Menus, {\n\tsidebar: new Menu({\n\t\tactions: [\n\t\t\t'nx:home',\n\t\t\t'nx:folders',\n\t\t\t'nx:searches',\n\t\t\t'nx:collections',\n\t\t\t'nx:notifications',\n\t\t],\n\t}),\n\ttools: new Menu({\n\t\tactions: [\n\t\t\tDOWNLOAD_REQUEST_EVENT.LIST_ROUTE,\n\t\t\t'asset:requests:route',\n\t\t\t'upload:attributeData',\n\t\t\t'dataSet:dataSets:route',\n\t\t\t'asset:expirations:route',\n\t\t\t'share:tokens:route',\n\t\t\t'projects:route',\n\t\t\t'upload:bulkCartLoader',\n\t\t\t'stat:route',\n\t\t],\n\t}),\n\tuser: new Menu({\n\t\tactions: [\n\t\t\t'user:profile:route',\n\t\t\t'user:settings:route',\n\t\t\t'user:attributeSets:route',\n\t\t\t'nx:notifications',\n\t\t\t'user:integrations:route',\n\t\t\t'app:help',\n\t\t\t'app:contact',\n\t\t\t['app:logout'],\n\t\t],\n\t}),\n});\n\nexport default Menus;\n","/**\n * View that dynamically creates a set of
  • elements from a Netx.Menu model\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/menuView.html';\nimport {\n\tFindLegacyAction,\n\tRegisterLegacyAction,\n} from '@netx/core/legacyActionManager';\n\nclass MenuView extends Base {\n\t/** @type {boolean} */\n\tget isMenuView() {\n\t\treturn this.constructor.__isMenuView__;\n\t}\n\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\t// don't add .loading classes to menus\n\t\topts.loadingMethods = [];\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\n\t\t/**\n\t\t * The 'actions' array is set by the instantiator\n\t\t * @memberOf Netx.Views.MenuView\n\t\t * @alias actions\n\t\t * @type {array}\n\t\t */\n\t\tthis.actions = opts.actions || [];\n\n\t\tthis.context = opts.context === true;\n\t\tthis.menu = opts.menu;\n\n\t\t// Hey, listen\n\t\tthis\n\t\t\t// OPTIMIZATION TODO: only listen when routes exist in menu, not like this\n\t\t\t.listenTo(dispatcher, 'hash:changed', this.setActiveClasses)\n\t\t\t.listenTo(dispatcher, 'app:close:menus', () => {\n\t\t\t\tif (this.$dropdown && this.$dropdown.hasClass('open')) {\n\t\t\t\t\tthis.$dropdownToggle.click();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/** @override */\n\tcancel(e) {\n\t\tif (this.$dropdown && this.$dropdown.hasClass('open')) {\n\t\t\tthis.$dropdownToggle.click();\n\t\t}\n\t}\n\n\t/**\n\t * Instead of templates, this module renders its own html with javascript.\n\t * @override\n\t */\n\tdoTemplate() {\n\t\t// TODO MENU TEMPLATE\n\t\tif (this.template === Template) {\n\t\t\tlet html = '';\n\t\t\tlet section = 0;\n\t\t\t// a recursive function to walk the actions array:\n\t\t\tconst _toHtml = (item) => {\n\t\t\t\tif (_.isArray(item)) {\n\t\t\t\t\t// found a section\n\t\t\t\t\thtml += '
    \\n';\n\t\t\t\t\tsection++;\n\t\t\t\t\t_.each(item, _toHtml); // recursion!\n\t\t\t\t\thtml += '
    \\n';\n\t\t\t\t} else if (_.isObject(item)) {\n\t\t\t\t\t// found a submenu\n\t\t\t\t\t// I designed this to use generic objects for submenus, but Spence assumed Netx.Menu objects which makes sense too ... so now we support either.\n\t\t\t\t\tvar label, actions;\n\t\t\t\t\tif (_.isFunction(item.get)) {\n\t\t\t\t\t\t// submenu is a Netx.Menu object\n\t\t\t\t\t\tlabel = item.get('label');\n\t\t\t\t\t\tactions = item.get('actions');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlabel = item.label;\n\t\t\t\t\t\tactions = item.actions;\n\t\t\t\t\t}\n\n\t\t\t\t\thtml += '
  • \\n';\n\t\t\t\t\thtml +=\n\t\t\t\t\t\t'' +\n\t\t\t\t\t\ti18n.t(label) +\n\t\t\t\t\t\t'\\n';\n\t\t\t\t\thtml += '\\n';\n\t\t\t\t} else {\n\t\t\t\t\t// found an action\n\t\t\t\t\t// TODO: check performance of Find, and/or implement Netx.Actions differently now that we have Menus.\n\t\t\t\t\tlet a = FindLegacyAction(item);\n\t\t\t\t\tif (!a) {\n\t\t\t\t\t\t//throw new Error(\"unknown action '\" + item + \"'\");\n\t\t\t\t\t\tconsole.warn(\"unknown action '\" + item + \"'; not rendering\");\n\t\t\t\t\t} else if (!a.fake) {\n\t\t\t\t\t\thtml +=\n\t\t\t\t\t\t\t'
  • ' +\n\t\t\t\t\t\t\ti18n.t(a.label) +\n\t\t\t\t\t\t\t'
  • ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// walk the actions array, recursively:\n\t\t\t_.each(this.menu.get('actions'), _toHtml);\n\n\t\t\t// If our element is a div.dropdown, wrap with structure\n\t\t\tif (this.$el.filter('div.dropdown').length > 0) {\n\t\t\t\t// NOTE: data-toggle div is required by bootstrap.\n\t\t\t\thtml =\n\t\t\t\t\t'
    ';\n\t\t\t}\n\n\t\t\treturn html;\n\t\t}\n\t\t// Custom template\n\t\telse {\n\t\t\tlet depth = 0;\n\t\t\t// We need to strip the comment from the template (menu refactor when?!)\n\t\t\tlet $template = $(this.template({}).replace(/^\\n\\n/, ''));\n\t\t\t// First level\n\t\t\tlet $html = $template.clone(); // <----- this line == 99% of (long) render time for this view. Can we figure out how not to do this? -m-\n\t\t\t// Keep a copy of our current menu, untouched. So we can follow depth as needed.\n\t\t\tlet $currentMenu = $template.clone();\n\n\t\t\t// Empty everything inside but the header\n\t\t\t$html.children().not('header').remove();\n\t\t\t// Add some needed/helpful attributes\n\t\t\t$html\n\t\t\t\t.not('header')\n\t\t\t\t.attr('role', 'menu')\n\t\t\t\t.attr('data-nx-menu-depth', depth);\n\t\t\t/**\n\t\t\t * _findTarget\n\t\t\t * Find target based on attribute name\n\t\t\t * @function\n\t\t\t *\n\t\t\t * @param {object} $item jQuery object of element\n\t\t\t * @param {string} attr The attribute to search for\n\t\t\t *\n\t\t\t * @returns {object} jQuery element sought (or false if not found)\n\t\t\t */\n\t\t\tconst _findTarget = ($item, attr) => {\n\t\t\t\tlet $actionTarget = $item.attr(attr);\n\t\t\t\tif ($actionTarget) {\n\t\t\t\t\treturn $item;\n\t\t\t\t} else {\n\t\t\t\t\t$actionTarget = $item.find('[' + attr + ']');\n\t\t\t\t\tif ($actionTarget.length) {\n\t\t\t\t\t\treturn $actionTarget;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\t/**\n\t\t\t * _processItem\n\t\t\t * Process provided item with provided action\n\t\t\t * @function\n\t\t\t *\n\t\t\t * @param {object} $item jQuery object of element\n\t\t\t * @param {object} action Action object\n\t\t\t *\n\t\t\t * @returns {object} Processed jQuery element\n\t\t\t */\n\t\t\tconst _processItem = ($item, action) => {\n\t\t\t\tif (action.fake) return;\n\n\t\t\t\t// Our element to target\n\t\t\t\tlet $actionTarget = false;\n\n\t\t\t\t// Has data-action\n\t\t\t\t$actionTarget = _findTarget($item, 'data-action');\n\t\t\t\tif (action.event) {\n\t\t\t\t\tif ($actionTarget) {\n\t\t\t\t\t\t$actionTarget.attr('data-action', action.event);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Nothing found\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($actionTarget) {\n\t\t\t\t\t\t// Only remove if a real data action has not been provided\n\t\t\t\t\t\tif ($actionTarget.attr('data-action') === '{{action}}') {\n\t\t\t\t\t\t\t$actionTarget.removeAttr('data-action').removeClass('nx-action');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Nothing found\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Has route\n\t\t\t\t$actionTarget = _findTarget($item, 'href');\n\t\t\t\tif (action.route && !_.isFunction(action.route)) {\n\t\t\t\t\tif ($actionTarget) {\n\t\t\t\t\t\tconst hash = action.route.slice(0, 1) === '#' ? '' : '#';\n\t\t\t\t\t\t$actionTarget.attr('href', hash + action.route);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Nothing found\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($actionTarget) {\n\t\t\t\t\t\t// Only remove if a real href has not been provided\n\t\t\t\t\t\tif ($actionTarget.attr('href') === '{{route}}') {\n\t\t\t\t\t\t\t$actionTarget.removeAttr('href');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Nothing found\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Has data-target\n\t\t\t\t$actionTarget = _findTarget($item, 'data-target');\n\t\t\t\tif (action.target) {\n\t\t\t\t\tif ($actionTarget) {\n\t\t\t\t\t\t$actionTarget.attr('data-target', action.target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Nothing found\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($actionTarget) {\n\t\t\t\t\t\t// Only remove if a real data target has not been provided\n\t\t\t\t\t\tif ($actionTarget.attr('data-target') === '{{target}}') {\n\t\t\t\t\t\t\t$actionTarget.removeAttr('data-target');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Nothing found\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Has label\n\t\t\t\tif (action.label) {\n\t\t\t\t\t$item = $(\n\t\t\t\t\t\t$item[0].outerHTML.replace(/{{label}}/g, i18n.t(action.label)),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// Remove label\n\t\t\t\telse {\n\t\t\t\t\t$item = $($item[0].outerHTML.replace(/{{label}}/g, ''));\n\t\t\t\t}\n\n\t\t\t\t// Has icon\n\t\t\t\tif (action.icon) {\n\t\t\t\t\tconst icon =\n\t\t\t\t\t\ttypeof action.icon === 'string'\n\t\t\t\t\t\t\t? ``\n\t\t\t\t\t\t\t: action.icon || '';\n\t\t\t\t\t$item = $($item[0].outerHTML.replace(/{{icon}}/g, icon));\n\t\t\t\t}\n\t\t\t\t// Remove icon\n\t\t\t\telse {\n\t\t\t\t\tlet customIcon = $item.find('i').attr('class');\n\t\t\t\t\tif (customIcon) {\n\t\t\t\t\t\tcustomIcon = customIcon.includes('{{icon}}');\n\t\t\t\t\t}\n\t\t\t\t\tif (customIcon) {\n\t\t\t\t\t\t$item.find('i').remove();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$item[0].innerHTML = $item[0].innerHTML.replace(/{{icon}}/g, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn $item;\n\t\t\t};\n\t\t\t/**\n\t\t\t * _toCustomHtml\n\t\t\t * Create our custom HTML\n\t\t\t * @function\n\t\t\t *\n\t\t\t * @param {*} item An array (section), an object (submenu) or a menu item\n\t\t\t * @param {object} $_html The jQuery object to append to\n\t\t\t */\n\t\t\tconst _toCustomHtml = (item, $_html) => {\n\t\t\t\tlet $item;\n\t\t\t\t// Section\n\t\t\t\tif (_.isArray(item)) {\n\t\t\t\t\t// If we have a current menu already get the item from there - else get it from the main node\n\t\t\t\t\t$item = $currentMenu\n\t\t\t\t\t\t? $currentMenu.children().not('header').first().clone()\n\t\t\t\t\t\t: $template.children().not('header').first().clone();\n\t\t\t\t\t// We just take the tag type used for items in the template and append with class 'divider'\n\t\t\t\t\t$_html.append(\n\t\t\t\t\t\t$('
  • ', {\n\t\t\t\t\t\t\tclass: 'divider',\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\tconst $section = $currentMenu.clone();\n\t\t\t\t\t// Empty everything inside except the header\n\t\t\t\t\t$section.children().not('header').remove();\n\t\t\t\t\t// Add some needed/helpful attributes\n\t\t\t\t\t$section\n\t\t\t\t\t\t.not('header')\n\t\t\t\t\t\t.attr('role', 'menu')\n\t\t\t\t\t\t.attr('data-nx-menu-depth', depth);\n\t\t\t\t\t//$_html.after( $section );\n\t\t\t\t\t$_html.append($section);\n\t\t\t\t\t// Loop over actions in array\n\t\t\t\t\t_.each(item, (_item) => {\n\t\t\t\t\t\t_toCustomHtml(_item, $section);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// Submenu\n\t\t\t\telse if (_.isObject(item)) {\n\t\t\t\t\tdepth++;\n\n\t\t\t\t\tlet label, icon, actions;\n\t\t\t\t\t// Submenu is a Netx.Menu object\n\t\t\t\t\tif (_.isFunction(item.get)) {\n\t\t\t\t\t\tlabel = item.get('label');\n\t\t\t\t\t\ticon = item.get('icon');\n\t\t\t\t\t\tactions = item.get('actions');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlabel = item.label;\n\t\t\t\t\t\ticon = item.icon;\n\t\t\t\t\t\tactions = item.actions;\n\t\t\t\t\t}\n\t\t\t\t\t// If we have a current menu already get the item from there - else get it from the main node\n\t\t\t\t\t$item = $currentMenu\n\t\t\t\t\t\t? $currentMenu.children().not('header').first().clone()\n\t\t\t\t\t\t: $template.children().not('header').first().clone();\n\t\t\t\t\t// First lets get the submenu of the item - if it has one\n\t\t\t\t\tlet $subMenu = $item.find('.sub-menu');\n\t\t\t\t\t// Look for a submenu elsewhere\n\t\t\t\t\tif (!$subMenu.length) {\n\t\t\t\t\t\tif ($currentMenu) $subMenu = $currentMenu.find('.sub-menu').first();\n\t\t\t\t\t\tif (!$subMenu.length) {\n\t\t\t\t\t\t\t$subMenu = $template.find('.sub-menu').first();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// If submenu was provided in template\n\t\t\t\t\tif ($subMenu.length) {\n\t\t\t\t\t\t// Submenu to append to\n\t\t\t\t\t\t$subMenu = $subMenu.clone();\n\t\t\t\t\t\t// Keep a copy of our current menu, untouched.\n\t\t\t\t\t\t$currentMenu = $subMenu.clone();\n\t\t\t\t\t\t// It is now safe to empty out submenu\n\t\t\t\t\t\t$subMenu.children().not('header').remove();\n\t\t\t\t\t\t// Make sure we do not have a submenu element in the item still\n\t\t\t\t\t\t$item.find('.sub-menu').remove();\n\t\t\t\t\t}\n\t\t\t\t\t// No submenu provided - we will reuse the parent node\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Keep a copy of our current menu, untouched.\n\t\t\t\t\t\t$currentMenu = $template.clone();\n\t\t\t\t\t\t// Submenu to append to\n\t\t\t\t\t\t$subMenu = $template.clone().addClass('sub-menu');\n\t\t\t\t\t\t$subMenu.children().not('header').remove();\n\t\t\t\t\t}\n\t\t\t\t\t// Add pertinent dropdown classes\n\t\t\t\t\t$subMenu\n\t\t\t\t\t\t.addClass('dropdown-menu')\n\t\t\t\t\t\t.attr('role', 'menu')\n\t\t\t\t\t\t.attr('data-nx-menu-depth', depth);\n\t\t\t\t\t// Process submenu\n\t\t\t\t\t$subMenu = _processItem($subMenu, {label: label});\n\t\t\t\t\t// Process the item\n\t\t\t\t\t$item = _processItem($item, {label: label, icon: icon});\n\t\t\t\t\t// Add dropdown classes to item\n\t\t\t\t\t$item\n\t\t\t\t\t\t.addClass('dropdown')\n\t\t\t\t\t\t.addClass('parent')\n\t\t\t\t\t\t.addClass('dropdown-submenu');\n\n\t\t\t\t\t// Check for \n\t\t\t\t\tlet $a = $item.find('a');\n\t\t\t\t\tif ($a.length) {\n\t\t\t\t\t\t$a.addClass('dropdown-toggle')\n\t\t\t\t\t\t\t.attr('data-toggle', 'dropdown')\n\t\t\t\t\t\t\t.attr('title', label);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$item\n\t\t\t\t\t\t\t.addClass('dropdown-toggle')\n\t\t\t\t\t\t\t.attr('data-toggle', 'dropdown')\n\t\t\t\t\t\t\t.attr('title', label); //tooltips for dropdowns\n\t\t\t\t\t}\n\t\t\t\t\t// Loop over actions within item\n\t\t\t\t\t_.each(actions, (item) => {\n\t\t\t\t\t\t_toCustomHtml(item, $subMenu);\n\t\t\t\t\t});\n\t\t\t\t\t// This stops the quirky behavior of append\n\t\t\t\t\t// If you append an element straight up to another element that is not unique enough it will append to all elements that are \"similar\"\n\t\t\t\t\t$_html.append($item.html($item.html() + $subMenu[0].outerHTML));\n\t\t\t\t}\n\t\t\t\t// Menu item\n\t\t\t\telse {\n\t\t\t\t\t// Get action object\n\t\t\t\t\tlet action = FindLegacyAction(item);\n\t\t\t\t\t$item = $currentMenu\n\t\t\t\t\t\t? $currentMenu.children().not('header').first().clone()\n\t\t\t\t\t\t: $template.children().not('header').first().clone();\n\t\t\t\t\tif (!action) {\n\t\t\t\t\t\tconsole.warn('The action \"' + item + '\" has not been registered.');\n\t\t\t\t\t\t// add a minimal fake action, so we still trigger an event\n\t\t\t\t\t\taction = {event: item, fake: true};\n\t\t\t\t\t\tRegisterLegacyAction(action);\n\t\t\t\t\t}\n\t\t\t\t\t// Check for a current sub menu, otherwise get from main node\n\t\t\t\t\t// Make sure item does not have a submenu element in it\n\t\t\t\t\t$item.find('.sub-menu').remove();\n\t\t\t\t\t// Process item\n\t\t\t\t\t$item = _processItem($item, action);\n\t\t\t\t\t// Append item\n\t\t\t\t\t$_html.append($item);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Header\n\t\t\tvar headerLabel = this.menu.get('label'),\n\t\t\t\t$header = $html.find('header').first();\n\n\t\t\tif ($header.length) {\n\t\t\t\tif (headerLabel) {\n\t\t\t\t\t$header.replaceWith(\n\t\t\t\t\t\t$($header[0].outerHTML.replace(/{{label}}/g, i18n.t(headerLabel))),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$header.replaceWith(\n\t\t\t\t\t\t$($header[0].outerHTML.replace(/{{label}}/g, '')),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Loop over main actions\n\t\t\t_.each(this.menu.get('actions'), (item) => {\n\t\t\t\tdepth = 1;\n\t\t\t\t// Reset to main node\n\t\t\t\t$currentMenu = $template.clone();\n\t\t\t\t_toCustomHtml(item, $html);\n\t\t\t});\n\n\t\t\t// Clean up\n\t\t\t$currentMenu = $template = null;\n\n\t\t\tif (this.context) {\n\t\t\t\treturn [\n\t\t\t\t\t'
    ',\n\t\t\t\t\t'
    ',\n\t\t\t\t\t$html[0].outerHTML,\n\t\t\t\t\t'
    ',\n\t\t\t\t].join('');\n\t\t\t} else {\n\t\t\t\treturn $html[0].outerHTML;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\t// Cache\n\t\tthis.$dropdown = this.$('.dropdown:not(.dropdown-submenu)');\n\t\t// The dropdown could be this.el\n\t\tif (!this.$dropdown.length && this.$el.is('.dropdown')) {\n\t\t\tthis.$dropdown = this.$el;\n\t\t}\n\t\tthis.$dropdownToggle = this.$dropdown.find('.dropdown-toggle');\n\t\tthis.$subMenus = this.$('.dropdown.dropdown-submenu');\n\n\t\tthis.configureSubmenus();\n\t}\n\n\t/**\n\t * Enable/disable of our menu is handled by the parent view,\n\t * because the relevant el can be outside of our domain,\n\t * but we can & do check our own submenus.\n\t * @method\n\t */\n\tconfigureSubmenus() {\n\t\t// Check submenus:\n\t\t_.each(this.$subMenus, (el) => {\n\t\t\tconst $el = this.$(el);\n\t\t\t// TODO: see TODO in Netx.View.configureMenu() re: possible bug here.\n\t\t\t// Check if we have any enabled actions\n\t\t\tlet allActions = $el.find('.nx-action');\n\t\t\tlet disabledActions = $el.find('.nx-action[disabled]');\n\n\t\t\t// Maybe it is just href based and not data-action\n\t\t\tif (!allActions.length) {\n\t\t\t\tallActions = $el.find('[href]');\n\t\t\t\tdisabledActions = $el.find('[href][disabled]');\n\t\t\t}\n\n\t\t\t// Deal with the dropdown toggle as well\n\t\t\t$el\n\t\t\t\t.siblings('[data-toggle=\"dropdown\"]')\n\t\t\t\t.enableIf(disabledActions.length < allActions.length);\n\t\t});\n\n\t\tthis.setActiveClasses();\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} hash Current hash\n\t * @param {string} lasthash Last hash\n\t */\n\tsetActiveClasses(hash, lasthash) {\n\t\tif (!hash) {\n\t\t\thash = Backbone.history.location.hash;\n\t\t}\n\t\t//manage the active state of menu items]\n\t\tthis.$('.active').removeClass('active');\n\n\t\t// look for parent routes, set active class on href or role=\"presentation\"\n\t\tlet $actionTarget, $tabPresentation;\n\t\tif (hash.lastIndexOf('/') > 0) {\n\t\t\twhile (hash.lastIndexOf('/') > 0) {\n\t\t\t\t$actionTarget = this.$('a[href=\"' + _.escape(hash) + '\"]');\n\t\t\t\tif ($actionTarget.length) {\n\t\t\t\t\t$tabPresentation = $actionTarget.closest('[role=\"presentation\"]');\n\t\t\t\t\t($tabPresentation.length ? $tabPresentation : $actionTarget).addClass(\n\t\t\t\t\t\t'active',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\thash = hash.slice(0, hash.lastIndexOf('/'));\n\t\t\t}\n\t\t} else {\n\t\t\t$actionTarget = this.$('a[href=\"' + hash + '\"]');\n\t\t\t$actionTarget.closest('[role=\"presentation\"]').addClass('active');\n\t\t}\n\t}\n\n\t/**\n\t * Sometimes this view is instantiated on an existing element; when we 'remove' this view, we want to preserve\n\t * its outer element, so we can't call Backbone's remove() method. Instead, we use removeInner().\n\t * @todo: elevate to Netx.View?\n\t * @method\n\t */\n\tremoveInner() {\n\t\tthis.stopListening().undelegateEvents().$el.empty();\n\t}\n\n\t/** @type {boolean} */\n\tstatic get __isMenuView__() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'MenuView';\n\t}\n}\n\nexport default MenuView;\n","/**\n * @class\n * @override\n */\nimport Base from 'netxcore@netx/core-app/views/menuView';\n\nimport MaterialMenus from '@netx/core/functionality/materialMenus';\n\nclass MenuView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\tsuper(opts);\n\n\t\tthis.removeOnHide = opts.removeOnHide === true;\n\t}\n\n\t/** @override */\n\tdoTemplate() {\n\t\tlet html = super.doTemplate();\n\n\t\t// First, kill bootstrap toggle\n\t\thtml = html.replace(/data-toggle=\"dropdown\"/g, '');\n\t\thtml = html.replace(/class=\"divider\"/g, 'class=\"mdc-list-divider\"');\n\n\t\treturn html;\n\t}\n\n\t/** @method */\n\tonMenuClose() {\n\t\tif (this.removeOnHide) {\n\t\t\tthis.remove();\n\t\t}\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tconst el = this.el;\n\t\t// A quick and dirty way to make our menus behave as material design\n\t\t// until we reqork menus and allow for proper theming\n\t\t// Store for `configureSubmenus`\n\t\tconst isHeaderTitleActions = (this.isHeaderTitleActions =\n\t\t\tel.classList.contains('header__title-actions'));\n\n\t\t// When in a drawer we need to unwrap and discard the 'mdc-list' element\n\t\t// as you can only have one in a drawer (they do not appear to currently support mdc-list groups in drawers)\n\t\tconst isInDrawer = el.classList.contains('drawer-menu');\n\t\tif (isInDrawer) {\n\t\t\tconst lists = el.querySelectorAll('.mdc-list');\n\t\t\tlists.forEach((list) => {\n\t\t\t\tconst parent = list.parentNode;\n\t\t\t\twhile (list.firstChild) parent.insertBefore(list.firstChild, list);\n\t\t\t\tparent.removeChild(list);\n\t\t\t});\n\t\t}\n\n\t\t// Context menu\n\t\tif (this.context) {\n\t\t\t// We need to just hack at the thing - we are making this so that mdc-menus\n\t\t\t// \"just work\" with our sontext menus\n\t\t\tconst toggleEl = el.querySelector('.dropdown-toggle');\n\t\t\ttoggleEl && toggleEl.parentNode.removeChild(toggleEl);\n\t\t\tconst wrapperEl = el.querySelector('.dropdown-menu');\n\t\t\tif (wrapperEl) {\n\t\t\t\tel.appendChild(wrapperEl.firstChild);\n\t\t\t\twrapperEl.parentNode.removeChild(wrapperEl);\n\t\t\t}\n\t\t}\n\n\t\t// Store for `configureSubmenus`\n\t\tconst dropdownParent = (this.dropdownParent =\n\t\t\tel.querySelector('.dropdown.parent'));\n\t\tthis.listActions = dropdownParent\n\t\t\t? [...dropdownParent.querySelectorAll('.nx-action')]\n\t\t\t: [];\n\t\tif (dropdownParent) {\n\t\t\tdropdownParent.classList.add('mdc-menu-surface--anchor');\n\t\t\tthis.checkDropdownParent(dropdownParent);\n\t\t}\n\n\t\tif (this.context || dropdownParent) {\n\t\t\tconst menuEl = (this.context ? el : dropdownParent).querySelector(\n\t\t\t\t'[role=\"menu\"]',\n\t\t\t);\n\t\t\tif (menuEl) {\n\t\t\t\t// We need to wrap our menu because mdc expects the .mdc-list to live within the menu and not be\n\t\t\t\t// the menu - this is a limiatation of our menu system atm\n\t\t\t\tconst mdcMenuWrapper = document.createElement('div');\n\t\t\t\tmdcMenuWrapper.classList.add(\n\t\t\t\t\t'mdc-menu',\n\t\t\t\t\t'mdc-menu-surface',\n\t\t\t\t\t'mdc-menu--hoist',\n\t\t\t\t);\n\n\t\t\t\tmenuEl.parentNode.insertBefore(mdcMenuWrapper, menuEl);\n\t\t\t\tmdcMenuWrapper.appendChild(menuEl);\n\n\t\t\t\tmenuEl.classList.add('mdc-list');\n\t\t\t\tmenuEl.querySelectorAll('li').forEach((li) => {\n\t\t\t\t\tli.classList.add('mdc-list-item');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tconst dropdownEl = el.querySelector('.dropdown-menu');\n\t\tif (dropdownEl) {\n\t\t\t// Inject the cancel button if we ar enot in a drawer\n\t\t\tif (!dropdownEl.closest('.mdc-drawer__content')) {\n\t\t\t\tconst cancelLi = document.createElement('li');\n\t\t\t\tcancelLi.classList.add('nx-cancel', 'cancel', 'mdc-list-item');\n\t\t\t\tcancelLi.innerText = i18n.t('i18n.cancel');\n\t\t\t\tdropdownEl.appendChild(cancelLi);\n\t\t\t}\n\n\t\t\tconst menuEl = dropdownEl.querySelector('[role=\"menu\"]');\n\t\t\tif (menuEl) {\n\t\t\t\tmenuEl.classList.add('mdc-list');\n\t\t\t\tmenuEl.querySelectorAll('li').forEach((li) => {\n\t\t\t\t\tli.classList.add('mdc-list-item');\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (isHeaderTitleActions) {\n\t\t\tthis.$el\n\t\t\t\t.find('a.dropdown-toggle')\n\t\t\t\t.addClass('mdc-fab', 'mdc-ripple-surface')\n\t\t\t\t.attr('aria-label', 'Actions')\n\t\t\t\t.find('svg')\n\t\t\t\t.addClass('mdc-fab__icon');\n\t\t}\n\n\t\t// Store for `configureSubmenus`\n\t\tthis.listEl = this.el.querySelector('.mdc-list');\n\n\t\tsuper.postRender();\n\t}\n\n\t/**\n\t * @method\n\t */\n\tcheckDropdownParent(dropdownParent) {\n\t\tif (!dropdownParent || this.isHeaderTitleActions) return;\n\n\t\t// For when the menu was already defining each item as an mdc-icon-button\n\t\tdropdownParent.classList.remove('mdc-icon-button');\n\n\t\tconst hasEnabledActions = this.listActions.some(\n\t\t\t(listAction) => listAction.getAttribute('disabled') == null,\n\t\t);\n\t\tif (!hasEnabledActions) {\n\t\t\tdropdownParent.setAttribute('disabled', true);\n\t\t} else {\n\t\t\tdropdownParent.removeAttribute('disabled');\n\t\t\tconst dropdowntoggle = dropdownParent.querySelector('.dropdown-toggle');\n\t\t\tif (dropdowntoggle) {\n\t\t\t\tdropdowntoggle.classList.add('mdc-icon-button', 'mdc-ripple-surface');\n\t\t\t\tdropdowntoggle.classList.remove('mdc-button');\n\t\t\t\tdropdowntoggle.classList.remove('mdc-button--unelevated');\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @override */\n\tconfigureSubmenus() {\n\t\tsuper.configureSubmenus();\n\n\t\t// One more dirty thing!\n\t\t// Do not show item seperator if there are not any enabled actions\n\t\t// to follow\n\t\tif (this.listEl) {\n\t\t\tthis.listEl.querySelectorAll('.mdc-list-divider').forEach((dividerEl) => {\n\t\t\t\tconst menuEl = dividerEl.nextSibling;\n\t\t\t\tif (!menuEl) return;\n\n\t\t\t\tconst hasEnabledAction = menuEl.querySelector(\n\t\t\t\t\t'.nx-action:not(.disabled)',\n\t\t\t\t);\n\n\t\t\t\tdividerEl.style.display = hasEnabledAction ? '' : 'none';\n\t\t\t\tmenuEl.style.display = hasEnabledAction ? '' : 'none';\n\t\t\t});\n\t\t}\n\t\tthis.checkDropdownParent(this.dropdownParent);\n\t}\n}\n\nMaterialMenus(MenuView);\n\nexport default MenuView;\n","/**\n * Application model for the Netx instance\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport StorageLocationsCollection from '../collections/storageLocations';\nimport {randomChars} from '@netx/core/utils/randomChars';\nimport {userProfile} from '@netx/core-user/collections/singletons/userProfile';\n\nclass App extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {string} defaults.description - The default app description\n\t * @property {string} defaults.clientLogs - The default app client logs\n\t * @property {string} defaults.ccSelf - The defualt copy self (as a boolean string?)\n\t * @property {string} defaults.serverUnresponsiveCount - DAM-3261 - unavailable server, after 3 alert user\n\t * @property {string} defaults.logo - Endpoint to retrieve logo image\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t// for problem reports:\n\t\t\tdescription: '',\n\t\t\tclientLogs: '',\n\t\t\tccSelf: 'true',\n\t\t\tserverUnresponsiveCount: 0,\n\t\t\tlogo: '/theme/netx/logo?v=' + randomChars(5),\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - The methods available on this model\n\t * @property {function|array} methods.read - The read method (get)\n\t * @property {function|array} methods.complain - Sends complaint\n\t * @property {function|array} methods._contact - Sends contact\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tread: ['getProductVersion'],\n\t\t\t_contact: [\n\t\t\t\t'email',\n\t\t\t\t'contactArgs.to',\n\t\t\t\t'contactArgs.from',\n\t\t\t\t'contactArgs.subject',\n\t\t\t\t'contactArgs.message',\n\t\t\t\t'contactArgs.cc',\n\t\t\t\t'contactArgs.overrideBlock',\n\t\t\t],\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t * @listens module:app#app:loaded\n\t */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * Contact arguments\n\t\t * @memberOf Netx.Models.App\n\t\t * @alias contactArgs\n\t\t * @type {object}\n\t\t */\n\t\tthis.contactArgs = {\n\t\t\tfrom: '',\n\t\t\tto: [],\n\t\t\tcc: [],\n\t\t\tsubject: '',\n\t\t\tmessage: '',\n\t\t\toverrideBlock: false,\n\t\t};\n\n\t\t/**\n\t\t * Storage location\n\t\t * Fetched in user module\n\t\t * @memberOf Netx.Models.App\n\t\t * @alias storageLocations\n\t\t * @type {Netx.Collections.StorageLocations}\n\t\t * @see module:user#user:initialize\n\t\t */\n\t\tthis.storageLocations = new StorageLocationsCollection([]);\n\t\tthis.addSubCollection(this.storageLocations);\n\n\t\t// Hey, listen!\n\t\tthis.listenToOnce(dispatcher, 'app:loaded', () => {\n\t\t\tthis.loaded = true;\n\t\t});\n\t}\n\t/**\n\t * @method\n\t * @param {object} values Contact submission values\n\t * @return {jQuery.Deferred}\n\t */\n\tcontact(values) {\n\t\t// Check user prefs for email.mailto.rcpt_to property and convert to an array\n\t\tconst recipient = _.csvToArray(getPreference('email.mailto.rcpt_to'));\n\t\tconst userEmail = values.emailFrom || userProfile.get('email');\n\n\t\t// Check that \"recipient\" is an array of values and is not empty\n\t\tif (_.isArray(recipient) && !_.isEmpty(recipient)) {\n\t\t\t_.extend(this.contactArgs, {\n\t\t\t\tfrom: userEmail,\n\t\t\t\tsubject: values.subject,\n\t\t\t\tmessage: values.message,\n\t\t\t\tto: recipient,\n\t\t\t\tcc: values.ccSelf ? [userEmail] : [],\n\t\t\t});\n\t\t\treturn this._contact();\n\t\t} else {\n\t\t\t// Email setting not configured properly. Let developers know and return rejected promise.\n\t\t\tconsole.warn(\n\t\t\t\t'Unable to send email. Missing valid recipient(s), please configure your email settings',\n\t\t\t);\n\t\t\treturn new $.Deferred().reject();\n\t\t}\n\t}\n\t// /**\n\t// * When indicated that the app is ready, deal with the loading screen and anything else that is needed\n\t// * before the app can continue on with the UI\n\t// * @method\n\t// * @return {jQuery.Deferred}\n\t// */\n\t// ready() {\n\t// \tconst d = new $.Deferred();\n\t// \tconst done = () => {\n\t// \t\td.resolve(this);\n\t// \t};\n\n\t// \tNetx.Loading ? Netx.Loading.appLoaded(done) : done();\n\n\t// \treturn d.promise();\n\t// }\n\t// /**\n\t// * Controllers can call this and provide a callback and context (usually the controller's module namespace object)\n\t// * it will only ever fire once and will remove any previous listener for the same context if called multiple times\n\t// * @method\n\t// * @param {function} cb Callback to perform when app is ready\n\t// * @param {object} context Context to hook the listener to (will default to `window`)\n\t// * @listens module:app#app:loaded\n\t// */\n\t// whenReady(cb, context) {\n\t// \tif (this.loaded) {\n\t// \t\treturn cb();\n\t// \t}\n\t// \tdispatcher.off('app:loaded', context || window);\n\t// \tdispatcher.once('app:loaded', cb, context || window);\n\t// }\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'App';\n\t}\n}\n\nexport default App;\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nclass Brand extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {array} */\n\tget xhrTrackProgress() {\n\t\treturn ['getLocations'];\n\t}\n\n\t/**\n\t * @type {object}\n\t */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tgetBranding: 'Loading brand',\n\t\t};\n\t}\n\n\t/**\n\t * @type {object}\n\t */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tgetBranding: 'Loaded brand',\n\t\t};\n\t}\n\n\t/** @property {object} brandGetArgs - Arguments for getting brand items */\n\tget brandGetArgs() {\n\t\treturn {\n\t\t\t/** @property {object} brandGetArgs.logo - Arguments for getting brand logo */\n\t\t\tlogo: {\n\t\t\t\t/** @property {object} brandGetArgs.logo.type - String to pass as type for brand logo */\n\t\t\t\ttype: 'LOGO',\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t/** @property {string} defaults.logo - Brand logo */\n\t\t\tlogo: '',\n\t\t};\n\t}\n\n\t/**\n\t * RPC methods:\n\t * @rpcs\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\tconst d = new $.Deferred();\n\n\t\t\t\tthis.getLogo(opts).then((response) => {\n\t\t\t\t\t// RPC is now turning nulls into empty arrays?\n\t\t\t\t\tif (!response || _.isArray(response)) {\n\t\t\t\t\t\treturn d.resolve();\n\t\t\t\t\t}\n\n\t\t\t\t\t// Make sure it is a real image\n\t\t\t\t\tconst img = new Image();\n\t\t\t\t\t$(img)\n\t\t\t\t\t\t.on('load', () => {\n\t\t\t\t\t\t\tlet logo;\n\t\t\t\t\t\t\tif (img.naturalWidth && img.naturalHeight) {\n\t\t\t\t\t\t\t\tlogo = '/' + response + '?t=' + _.uniqueId(_.now());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\td.resolve({\n\t\t\t\t\t\t\t\tlogo: logo,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.on('error', () => {\n\t\t\t\t\t\t\td.resolve();\n\t\t\t\t\t\t});\n\t\t\t\t\timg.src = '/' + response;\n\t\t\t\t}, d.reject);\n\n\t\t\t\treturn d.promise();\n\t\t\t},\n\t\t\t/**\n\t\t\t * Get branding logo\n\t\t\t * See logo endpoints\n\t\t\t * @method\n\t\t\t * @deprecated\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetLogo(opts) {\n\t\t\t\treturn ['getBranding', this.brandGetArgs.logo];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Resets all branding logos\n\t\t\t * @method\n\t\t\t */\n\t\t\tresetBranding: ['resetBranding'],\n\t\t\t/**\n\t\t\t * Set branding logo\n\t\t\t * @method\n\t\t\t * @param {string} logoName Name of uploaded file\n\t\t\t * @param {number} logoMode Logo to update (2=dark, 4=light)\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetLogo(logoName, logoMode, opts) {\n\t\t\t\treturn ['simpleBranding', logoName, logoMode];\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs = {}, opts = {}) {\n\t\tattrs.id = _.uniqueId('brand-');\n\n\t\tsuper(attrs, opts);\n\n\t\t/** @property {object} brandSetArgs - Arguments for setting brand items */\n\t\tthis.brandSetArgs = {\n\t\t\t/** @property {number} brandSetArgs.logoMode - Mode for setting brand logo */\n\t\t\tlogoMode: 2,\n\t\t\t/** @property {string} brandSetArgs.logoName - Filename for setting brand logo */\n\t\t\tlogoName: '',\n\t\t\t...opts.brandSetArgs,\n\t\t};\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Brand';\n\t}\n}\n\nexport default Brand;\n","/**\n * Very similar to AppModalView but not a modal\n * Much of the code is the same minus a couple things - the main reason for not extending those methods\n * or the modalView itself, is that I want people to be able to customize them separately within the theme\n * It gets messy when you want your modal views to do something different than the fullscreen views\n * @class\n */\nimport Base from '@netx/core/lib/netx-multiView';\nimport {appRouter} from '@netx/core-next/router';\nimport {getPrefixedLogger} from '@netx/core-next/utils/logger';\nimport Template from '../templates/appFullScreenView.html';\nimport ModalView from './appModalView';\nimport ConfirmView from './confirmView';\n\nconst logger = getPrefixedLogger('views/appFullScreenView');\n\nclass AppFullScreenView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.additionalViewClasses = opts.additionalViewClasses || 'full-screen';\n\t\topts.childView = _.extend(\n\t\t\t{\n\t\t\t\ttarget: '[data-nx-control=\"full-screen-content\"]',\n\t\t\t\tviewClass(model) {\n\t\t\t\t\treturn model.get('viewClass');\n\t\t\t\t},\n\t\t\t},\n\t\t\topts.childView,\n\t\t);\n\t\topts.emptyOnHide = opts.emptyOnHide !== false;\n\t\topts.hideOnEmpty = opts.hideOnEmpty !== false;\n\t\topts.id = opts.id || 'full-screen-view';\n\t\topts.template = opts.template || Template;\n\t\topts.removeOnHide = false;\n\t\tsuper(opts);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(dispatcher, 'routed', this.hideIfWeShould).listenTo(\n\t\t\tthis,\n\t\t\t'addedNewChildView',\n\t\t\t(view) => {\n\t\t\t\tif (view.viewSpec.isMyOriginalCollection(this.viewCollection)) {\n\t\t\t\t\t// Check if the view was a result of routing\n\t\t\t\t\tif (\n\t\t\t\t\t\tview.isRouted !== false &&\n\t\t\t\t\t\tBackbone.history.isRouting() &&\n\t\t\t\t\t\t!(view instanceof ConfirmView)\n\t\t\t\t\t) {\n\t\t\t\t\t\tview.isRouted = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\t/** @override */\n\tcancel(e) {\n\t\t// For now we are making the assumption that the closing of the fullscreen is dependant on its childViews\n\t\t// we need to get in the habit of using \":first\" in our event object for childviews and cancel/close button\n\t\t// Do nothing when cancel is fired/bubbbled on this view\n\t\tif (e && e.preventDefault) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\t// Cache\n\t\tthis.$content = this.$('[data-nx-control=\"full-screen-content\"]');\n\t}\n\n\t/** @override */\n\tbeforeHidden(cb) {\n\t\t// We do not call super\n\t\tif (this.emptyOnHide) {\n\t\t\tlet view;\n\t\t\tthis.viewCollection.each((viewSpec) => {\n\t\t\t\tview = viewSpec.get('view');\n\t\t\t\tview && _.isFunction(view.cancel) && view.cancel();\n\t\t\t});\n\t\t\t// Always use set to empty\n\t\t\tthis.viewCollection.set([]);\n\t\t}\n\n\t\t// Fade out fullscreen and pipe finish to callback\n\t\t// this.$el.fadeOut(\"slow\", _.bind( cb, this ) );\n\t\tthis.$el.hide();\n\t\tcb.apply(this);\n\t}\n\n\t/**\n\t * @override\n\t * @param {function} cb Callback\n\t */\n\tbeforeShown(cb) {\n\t\tthis.$el.show();\n\t\tcb.apply(this);\n\t}\n\n\t/** @method */\n\thideIfWeShould(newRoute, oldRoute) {\n\t\treturn ModalView.prototype.hideIfWeShould.call(this, newRoute, oldRoute);\n\t}\n\n\t/**\n\t * Show is about to start\n\t * At this point no animation or actual showing [should] have taken place\n\t * @override\n\t */\n\tonShowing() {\n\t\tsuper.onShowing();\n\t\tthis.hiddenByRoute = false;\n\t}\n\n\t/**\n\t * A view was instantiated (a brand new childView was born)\n\t * @override\n\t * @param {Netx.View} view Instance of Netx.View\n\t */\n\tviewInstantiated(view) {\n\t\tsuper.viewInstantiated(view);\n\n\t\t// All true (non-transient) child views will be fully removed on hide\n\t\tif (!view.viewSpec.isMyOriginalCollection(this.viewCollection)) return;\n\n\t\tview.removeOnHide = true;\n\t}\n\n\t/**\n\t * @override\n\t * @param {Netx.View} view Instance of Netx.View\n\t */\n\tviewRemoved(view) {\n\t\tif (!this.hiddenByRoute) {\n\t\t\t// If a new view came in in the mean time and it is routed - do nothing - we are at the route we should be\n\t\t\tconst activeView = this.getActiveView();\n\t\t\tif (activeView && activeView.cid !== view.cid && activeView.isRouted) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// HACK: preserve this value across callbacks:\n\t\t\t// (isRouting() reports false if a callback is fired via setTimeout(), such as in certain Bootstrap hiding animations.)\n\t\t\tconst isRouting = Backbone.history.isRouting();\n\t\t\t// If we opened this modal view due to a route...\n\t\t\tif (view.isRouted) {\n\t\t\t\tlogger.silly('removing routed view >', view.viewSpec.id);\n\t\t\t\tdelete view.isRouted;\n\t\t\t\t// Unless we're currently routing, route back to where we were before we opened the modal.\n\t\t\t\tif (!isRouting) {\n\t\t\t\t\tview.routeMatch != null\n\t\t\t\t\t\t? appRouter.exitRoute(view.routeMatch, {force: true})\n\t\t\t\t\t\t: appRouter.back();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdelete this.hiddenByRoute;\n\n\t\tsuper.viewRemoved(view);\n\t}\n\n\t/**\n\t * @static\n\t * @type {string}\n\t */\n\tstatic get __name__() {\n\t\treturn 'AppFullScreenView';\n\t}\n}\n\nexport default AppFullScreenView;\n","import Base from 'netxcore@netx/core-app/views/appFullScreenView';\nimport '../css/appFullScreen.less';\n\nexport default class AppFullScreenView extends Base {\n\t/** @override */\n\tafterHidden(view) {\n\t\tsuper.afterHidden(view);\n\t\tthis.$el.removeClass('in');\n\t}\n\n\t/** @override */\n\tbeforeShown(view) {\n\t\tthis.$el.addClass('in');\n\t\tsuper.beforeShown(view);\n\t}\n}\n","/**\n * A view for progress\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/appProgressView.html';\n\nclass AppProgressView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.eventStr = opts.eventStr || 'foo:bar';\n\t\topts.headerTitle = opts.headerTitle || i18n.t('i18n.working');\n\t\topts.id = opts.id || 'app-progress-view';\n\t\t/**\n\t\t * Never route to a progress view, and never accidentally un-route when we close one:\n\t\t * @type {boolean}\n\t\t */\n\t\topts.isRouted = false;\n\t\topts.loadingClassRemoveDelay = opts.loadingClassRemoveDelay || 300;\n\t\topts.minimumShowTime = opts.minimumShowTime || 300;\n\t\topts.modalOptions = {\n\t\t\tblocking: true,\n\t\t\t...opts.modalOptions,\n\t\t};\n\t\topts.removeOnHide = opts.removeOnHide !== false;\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\n\t\tthis.lastEventStr = this.eventStr = opts.eventStr;\n\t\tthis.message = opts.message;\n\t\tthis.simulate = opts.simulate !== false;\n\n\t\t// Hey listen!\n\t\tthis.listenTo(\n\t\t\tdispatcher,\n\t\t\t`${this.eventStr}:success ${this.eventStr}:error`,\n\t\t\t_.debounce(this.complete, 500),\n\t\t);\n\n\t\tif (this.viewSpec) {\n\t\t\tthis.listenTo(\n\t\t\t\tthis.viewSpec,\n\t\t\t\t'change:viewOptions:eventStr',\n\t\t\t\t(viewSpec, eventStr, opts) => {\n\t\t\t\t\tthis.hideTimeout && clearTimeout(this.hideTimeout);\n\n\t\t\t\t\tthis.stopListening(\n\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t`${this.lastEventStr}:success ${this.lastEventStr}:error`,\n\t\t\t\t\t);\n\t\t\t\t\tthis.lastEventStr = eventStr;\n\t\t\t\t\tthis.listenTo(\n\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t`${eventStr}:success ${eventStr}:error`,\n\t\t\t\t\t\t_.debounce(this.complete, 500),\n\t\t\t\t\t);\n\n\t\t\t\t\tthis.render();\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\t/** @override */\n\tpreRender() {\n\t\tsuper.preRender();\n\n\t\t// We want nothing (for now at least)\n\t\tthis.templateDataSource = {};\n\t\t// Additonal template vars\n\t\tObject.assign(this.templateVars, {\n\t\t\tmessage: this.message || '',\n\t\t});\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\t// Cache the pseudo progress elements\n\t\tthis.$pseudoProgress = this.$('.nx-control-pseudo-progress:first');\n\t\tthis.$pseudoProgressBar = this.$pseudoProgress.find(\n\t\t\t'.nx-control-progress-bar',\n\t\t);\n\n\t\t// Simulation\n\t\tthis.simulate && this.simulateProgress();\n\t}\n\n\t/** @method */\n\tcomplete() {\n\t\tthis.hideTimeout && clearTimeout(this.hideTimeout);\n\n\t\t// Simulation\n\t\tthis.simulate && this.endProgressSimulation();\n\n\t\t// // Give it a half a second\n\t\tif (this.hiding) {\n\t\t\t// Check if we are already hiding, since there is a delay - but let the view know there are no more simple hides\n\t\t\tdelete this._simpleHide;\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hideTimeout = setTimeout(() => {\n\t\t\tthis.hide();\n\t\t}, 500);\n\t}\n\n\t/** @override */\n\tremove() {\n\t\tthis.hideTimeout && clearTimeout(this.hideTimeout);\n\t\tsuper.remove();\n\t}\n\n\t/**\n\t * @static\n\t * @type {string}\n\t */\n\tstatic get __name__() {\n\t\treturn 'AppProgressView';\n\t}\n}\n\nexport default AppProgressView;\n","/**\n * @class\n * @override\n */\nimport Base from 'netxcore@netx/core-app/views/appProgressView';\n\nimport {MDCLinearProgress} from '@material/linear-progress';\n\nclass AppProgressView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\tsuper(opts);\n\n\t\t// To avoid messing with core atm\n\t\tif (this.simulate) {\n\t\t\tthis._simulate = this.simulate;\n\t\t\tdelete this.simulate;\n\t\t}\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\tthis.progress = new MDCLinearProgress(\n\t\t\tthis.el.querySelector('.mdc-linear-progress'),\n\t\t);\n\t}\n\n\t/** @override */\n\tpreRender() {\n\t\tif (this.progress) {\n\t\t\tthis.progress.destroy();\n\t\t\tdelete this.progress;\n\t\t}\n\n\t\tsuper.preRender();\n\n\t\tObject.assign(this.templateVars, {\n\t\t\tindeterminate: this._simulate === true,\n\t\t});\n\t}\n\n\t/** @override */\n\tprogressUpdated(percentComplete) {\n\t\tif (!this.progress) return;\n\n\t\tthis.progress.foundation_.setProgress(percentComplete);\n\t}\n\n\t/** @override */\n\tremove() {\n\t\tthis.progress && this.progress.destroy();\n\t\tsuper.remove();\n\t}\n}\n\nexport default AppProgressView;\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/optionTile';\nimport Menu from '@netx/core/lib/netx-menu';\n\nclass OptionTiles extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tconst menu = opts.menu;\n\t\t// Must be a valid menu\n\t\tif (menu == null || !(menu instanceof Menu)) {\n\t\t\tthrow new Error('A valid menu is required for Option Tiles');\n\t\t}\n\n\t\tconst actions = menu.get('actions');\n\t\tmodels = [];\n\t\t_.each(actions, action => {\n\t\t\tconst tileOption = new opts.model({action: action}, _.omit(opts, 'menu'));\n\t\t\t// If there is no event on our model there must have been issues or this use ris not allowed to run the action provided\n\t\t\t// In any case, do not add to the collection\n\t\t\tif (tileOption.get('event')) models.push(tileOption);\n\t\t});\n\n\t\tsuper(models, opts);\n\n\t\tif (menu && menu.get) {\n\t\t\tthis.label = menu.get('label') || i18n.t('i18n.options');\n\t\t}\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'OptionTiles';\n\t}\n}\n\nexport default OptionTiles;\n","/**\n * @fires netx:analytics:start\n */\n\nimport {getPublicProperty} from '@netx/core-app-next/utils/getPublicProperty';\n\nexport default function () {\n\tconst promises = [];\n\n\t// TODO: we need a portal singleton that contains all these sorts of things\n\tvar analyticOpts = null; // Netx.custom.portal ? Netx.custom.portal.analytics : null;\n\t// Check for analytics configuration:\n\t_.each(['google'], function (provider) {\n\t\tlet trackingState, trackingCode;\n\t\tif (analyticOpts) {\n\t\t\tprovider = analyticOpts[provider] || {};\n\t\t\ttrackingState = provider.enabled;\n\t\t\ttrackingCode = provider.trackingId;\n\t\t} else {\n\t\t\ttrackingState = getPublicProperty(\n\t\t\t\t'analytics.' + provider + '.enabled',\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\ttrackingCode = getPublicProperty('analytics.' + provider + '.trackingId');\n\t\t}\n\t\tif (trackingState && trackingCode) {\n\t\t\tvar d = new $.Deferred();\n\t\t\tpromises.push(d);\n\t\t\t// Load & start Analytics.\n\t\t\tdispatcher.trigger(\n\t\t\t\t'netx:analytics:start',\n\t\t\t\tprovider,\n\t\t\t\ttrackingCode,\n\t\t\t\tfunction () {\n\t\t\t\t\td.resolve();\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t});\n\n\treturn Promise.all(promises);\n}\n","/**\n * Main application module required for proper functioning\n * Handles default functionality like authentication, alerts\n * view state and current data state\n *\n * @module app\n */\n\nimport React, {Suspense} from 'react';\nimport ReactDOM from 'react-dom/client';\n\nconst AppComponent = React.lazy(() =>\n\timport(\n\t\t/* webpackChunkName: \"App-Component\" */ '@netx/core-app-next/components/App'\n\t),\n);\n\nconst UnauthenticatedLandingComponent = React.lazy(() =>\n\timport(\n\t\t/* webpackChunkName: \"UnauthenticatedLanding-Component\" */ '@netx/core-auth-next/components/UnauthenticatedLanding'\n\t),\n);\n\n// import semver from 'core-libs/semver.browser';\nimport {localStore} from '@netx/core-next/localStore';\nimport {session} from '@netx/core-auth/collections/singleton/session';\nimport {userPrefs} from '@netx/core-user/collections/singletons/userPreferences';\nimport {\n\tcurrentUserMeetsUserLevel,\n\tUserLevel,\n} from '@netx/core-user/utils/currentUserMeetsUserLevel';\nimport Modernizr from 'core-libs/modernizr/modernizr';\n\n// Bootstrap\n// We should cherry pick the things we use and abandon the rest - just make a list of the things core has natively from bootstrap and themes can fill in the rest\nimport 'core-libs/bootstrap';\n// Then our bootstrap overrides/enhancements\nimport 'core-libs/bootstrap-netx';\nimport {spawnNewWindow} from '@netx/core/utils';\n\n// Models\nimport CoreModel from '@netx/core/lib/netx-model';\nimport AppModel from './models/app';\nimport BatchJobModel from './models/batchJob';\nimport BrandModel from './models/brand';\n\n// Views\nimport AlertView from './views/alertView';\n// import AppView from './views/appView';\nimport FullScreenView from './views/appFullScreenView';\nimport AppProgressView from './views/appProgressView';\n\n// Collections\nimport OptionTilesCollection from './collections/optionTiles';\n\nimport Analytics from '@netx/core/lib/netx-analytics';\n\n// App config `Netx.app.options`\nimport customConfig from './config';\nimport authConfig from '../core-auth/config';\n\n// A small package that lets us know when an element (in our case a view's $el) has loaded all contained images\nimport 'core-libs/imagesloaded.pkgd.js';\n\nimport {dispatcher} from '@netx/core-next/dispatcher';\nimport {batchJobs} from './collections/singleton/batchJobs';\nimport {legacyWebsocket} from './collections/singleton/websocket';\nimport {appRouter} from '@netx/core-next/router';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport {bodyView} from './singletons/bodyViews';\nimport {fsViews} from './singletons/fsViews';\nimport {modalView, modalViews} from './singletons/modalViews';\nimport {ready} from '@netx/core-next/whenReady';\nimport {getPrefixedLogger} from '@netx/core-next/utils/logger';\nimport {setGlobal} from '@netx/core-next/utils/setGlobal';\n\nconst logger = getPrefixedLogger('core:app');\n\n//=================================\n//\tINIT\n//=================================\n// All collection and model instances and event listeners\n// are created when the module is initialized.\n/**\n * app:init handler initializes the Netx.app namespace and various other handlers.\n * @event module:app#app:init\n * @param {object} options\n * @fires module:app#app:extend\n * @fires module:app#app:initialized\n */\ndispatcher.once('app:init', function (options) {\n\tlogger.silly('initializing...');\n\n\tconst NS = (Netx.app = Netx.app || new AppModel());\n\tNS.set({...customConfig, ...options});\n\n\t//=================================\n\t//\tCREATE MODELS AND COLLECTIONS\n\t//=================================\n\n\tconst disableTouchMove = (e) => {\n\t\te.preventDefault();\n\t};\n\n\tsetGlobal({\n\t\tdisableTouchMove() {\n\t\t\tdocument.addEventListener('touchmove', disableTouchMove, {\n\t\t\t\tpassive: false,\n\t\t\t});\n\t\t},\n\t\tenableTouchMove() {\n\t\t\tdocument.removeEventListener('touchmove', disableTouchMove, {\n\t\t\t\tpassive: false,\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Set user preference\n\t\t * @function\n\t\t * @param {string} key [dot seperated] preference key\n\t\t * @param {mixed} value Value to set on preference\n\t\t */\n\t\tsetPreference: function (key, val) {\n\t\t\treturn userPrefs.setUserPreference(key, val);\n\t\t},\n\t});\n\n\tNS.brand = new BrandModel();\n\t//=================================\n\t//\t!CREATE MODELS AND COLLECTIONS\n\t//=================================\n\n\t// Application-level DOM setup/manipulations:\n\t// =========================================\n\t//\n\t// TODO: Should we have a view for the entire DOM (document)?\n\t// It wouldn't render, but it could hold all this stuff.\n\tvar $body = (NS.$body = $('body')),\n\t\t$document = (NS.$document = $(document)),\n\t\t$window = (NS.$window = $(window));\n\t//=================================\n\t//\tWINDOW LISTENERS\n\t//=================================\n\tNS.size = {\n\t\twidth: $window.innerWidth(),\n\t\theight: $window.innerHeight(),\n\t};\n\n\tconst tickleSession = _.throttle(() => {\n\t\tdispatcher.trigger('session:tickle');\n\t}, 30000); // every 30 seconds we will try - the session can handle its own limits\n\tdocument.addEventListener(\n\t\t'keydown',\n\t\t() => {\n\t\t\ttickleSession();\n\t\t},\n\t\t{passive: true, capture: true},\n\t);\n\n\t// Window resize listener dispatches event 'app:resize' after window resize has been static for 100ms\n\t$window.on(\n\t\t'resize',\n\t\t_.debounce(function () {\n\t\t\tvar size = NS.size,\n\t\t\t\th = $window.innerHeight(),\n\t\t\t\tw = $window.innerWidth();\n\n\t\t\tif (size.width !== w || size.height !== h) {\n\t\t\t\tsize.width = w;\n\t\t\t\tsize.height = h;\n\t\t\t\tdispatcher.trigger('app:resize', size);\n\t\t\t}\n\t\t}, 100),\n\t);\n\t//=================================\n\t//\t!WINDOW LISTENERS\n\t//=================================\n\n\tconst root = ReactDOM.createRoot(document.getElementById('wrapper'));\n\n\tbodyView.$el.appendTo($body);\n\tbodyView.render();\n\n\tnew FullScreenView({\n\t\tel: document.querySelector('.nx-app-fullscreen'),\n\t\tviewCollection: fsViews,\n\t}).render();\n\n\tmodalView.$el.appendTo($body);\n\tmodalView.render();\n\n\t//=================================\n\t//\tEVENT LISTENERS\n\t//=================================\n\n\t/**\n\t * The app is in a ready state\n\t * @event module:app#app:ready\n\t * @param {boolean} start Start the app\n\t * @fires module:app#app:loaded\n\t * @fires module:app#app:start\n\t */\n\tdispatcher.once(\n\t\t'app:ready',\n\t\tfunction (start = false) {\n\t\t\tlogger.silly('ready', 'start >', start.toString());\n\t\t\t// TODO: this is a hack for now - need to put this in the proper place for the proper time\n\t\t\t!start &&\n\t\t\t\troot.render(\n\t\t\t\t\t}>\n\t\t\t\t\t\t\n\t\t\t\t\t,\n\t\t\t\t\t// document.getElementById('wrapper'),\n\t\t\t\t);\n\n\t\t\tready().then(function () {\n\t\t\t\tstart &&\n\t\t\t\t\troot.render(\n\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t,\n\t\t\t\t\t); //, document.getElementById('wrapper'));\n\t\t\t\tlogger.silly('loaded and starting');\n\t\t\t\tdispatcher.trigger('app:loaded', start);\n\t\t\t\t// Should we start the app (authenticated)\n\t\t\t\tstart && dispatcher.trigger('app:start');\n\t\t\t});\n\t\t},\n\t\twindow,\n\t);\n\n\t/**\n\t * App is loaded and user is authenticated\n\t * @event module:app#app:start\n\t */\n\tdispatcher.once('app:start', function () {\n\t\t// Netx.websocket = legacyWebsocket;\n\t});\n\n\t/**\n\t * The app is loaded\n\t * @event module:app#app:loaded\n\t */\n\tdispatcher.once('app:loaded', function (authenticated) {\n\t\tappRouter.ready = true;\n\t\tif (session.get('browserOk') || session.getCookie('browserOk')) {\n\t\t\t// Process the current route and get it all going\n\t\t\tif (authenticated) {\n\t\t\t\tconst hash = localStore.get(authConfig.POST_LOGIN_HASH_NAME);\n\t\t\t\tif (hash) window.location.hash = hash;\n\t\t\t\t//Netx.router.navigate(hash, true);\n\t\t\t\tlocalStore.set(authConfig.POST_LOGIN_HASH_NAME, '');\n\t\t\t}\n\t\t\tBackbone.history.loadUrl();\n\t\t}\n\t});\n\n\t/**\n\t * Switch to the Flex interface\n\t * @event module:app#app:browser:override:cancelled\n\t */\n\tdispatcher.once('app:browser:override:cancelled', function () {\n\t\t// If the user doesn't want to continue we send them to Flex\n\t\twindow.location.replace('/ImagePortal.jsp');\n\t});\n\n\t/**\n\t * Wait for compatiability confirmation\n\t * @event module:app#app:compatible:confirmed\n\t * @fires netx:app:modules\n\t */\n\tdispatcher.once('app:compatible:confirmed', function () {\n\t\tconst promises = [];\n\t\t// Get storage location info\n\t\t// Must be Importer or higher to fetch\n\t\tif (currentUserMeetsUserLevel(UserLevel.IMPORTER)) {\n\t\t\tpromises.push(\n\t\t\t\tNS.storageLocations.fetch(),\n\t\t\t\tNS.storageLocations.getLocationTypes(),\n\t\t\t);\n\t\t}\n\n\t\t// When all promises are complete\n\t\tPromise.all(promises).then(() => {\n\t\t\t// Promise.all([\n\t\t\t// \timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-permissions'),\n\t\t\t// \timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-cart'),\n\t\t\t// \timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-asset'),\n\t\t\t// \timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-user'),\n\t\t\t// \timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-category'),\n\t\t\t// \timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-public-link'),\n\t\t\t// \timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-search'),\n\t\t\t// \timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-share'),\n\t\t\t// ]).then(modules => {\n\t\t\t// \tdispatcher.trigger('netx:load:module', modules.map(m => m.default), {\n\t\t\t// \t\tinitialized() {\n\t\t\t// \t\t\tdispatcher.trigger('app:ready', true);\n\t\t\t// \t\t},\n\t\t\t// \t});\n\t\t\t// });\n\t\t\tdispatcher.trigger('netx:app:modules');\n\t\t});\n\t});\n\n\t/**\n\t * @event module:auth#auth:session:invalid\n\t * @fires module:app#app:ready\n\t */\n\tdispatcher.once('auth:session:invalid', function () {\n\t\t// The app is ready to show the login screen\n\t\tdispatcher.trigger('app:ready', false);\n\t});\n\n\t/**\n\t * Once we find a valid session, test for correct server version.\n\t * @event module:auth#auth:session:valid\n\t * @fires module:app#app:compatible:confirmed\n\t * @fires module:app#app:serverVersionWarning\n\t * @fires module:app#app:user:prefs:ready\n\t * @listens module:app#app:compatible:confirmed\n\t */\n\tdispatcher.once('auth:session:valid', function () {\n\t\t// Fetch the user prefs\n\t\t$.when(userPrefs.fetch()).then(function () {\n\t\t\t// Things in the app can start testing against user prefs now\n\t\t\tdispatcher.trigger('app:user:prefs:ready');\n\n\t\t\t// Wait until authenticated for this\n\t\t\t// If solr is not enabled, warn the user & suggest Flex\n\t\t\tif (!getPreference('searchEngine.solrEnabled', true)) {\n\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t'app:alert',\n\t\t\t\t\ti18n.t('i18n.solrNotEnabledMessage'),\n\t\t\t\t\ti18n.t('i18n.warning'),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Test server version\n\t\t\tNS.fetch().then(function (java_version) {\n\t\t\t\tdispatcher.trigger('app:compatible:confirmed');\n\t\t\t\t// var requiredVersion = NS.options.REQUIRED_SERVER_VERSION;\n\t\t\t\t// if (!_.isUndefined(semver)) {\n\t\t\t\t// \tif (\n\t\t\t\t// \t\trequiredVersion &&\n\t\t\t\t// \t\t!semver.satisfies(java_version, requiredVersion)\n\t\t\t\t// \t) {\n\t\t\t\t// \t\tdispatcher.trigger(\n\t\t\t\t// \t\t\t'app:serverVersionWarning',\n\t\t\t\t// \t\t\tjava_version,\n\t\t\t\t// \t\t\trequiredVersion,\n\t\t\t\t// \t\t);\n\t\t\t\t// \t} else {\n\t\t\t\t// \t\tdispatcher.trigger('app:compatible:confirmed');\n\t\t\t\t// \t}\n\t\t\t\t// } else {\n\t\t\t\t// \t// If the install is missing the semver dependency log the issue and continue without catastrophic failure.\n\t\t\t\t// \tdispatcher.trigger('app:compatible:confirmed');\n\t\t\t\t// \tconsole.warn('Missing semver dependency.');\n\t\t\t\t// }\n\t\t\t});\n\t\t});\n\t});\n\n\t/**\n\t * @event module:auth#auth:token:valid\n\t * @fires module:auth#auth:token:handle\n\t */\n\tdispatcher.once('auth:token:valid', function () {\n\t\tdispatcher.trigger('auth:token:handle');\n\t});\n\n\t/**\n\t * @event module:auth#auth:token:invalid\n\t * @fires module:auth#auth:token:handle\n\t */\n\tdispatcher.once('auth:token:invalid', function () {\n\t\tdispatcher.trigger('auth:token:handle');\n\t});\n\n\t/**\n\t * Using a token\n\t * Only need a handful of modules for this\n\t * @event module:auth#auth:token:handle\n\t * @fires module:netx#netx:load:module\n\t * @fires module:app#app:ready\n\t */\n\t// Regardless of valid or invalid - the related view will handle messaging\n\tdispatcher.once('auth:token:handle', function () {\n\t\tconst m = window.location.hash.match(/(\\w+)/i)?.[1] ?? '';\n\t\tif (m === 'uploads') {\n\t\t\tPromise.all([\n\t\t\t\timport(/* webpackChunkName: \"upload-requests\" */ '@netx/core-asset'),\n\t\t\t\timport(/* webpackChunkName: \"upload-requests\" */ '@netx/core-upload'),\n\t\t\t\timport(/* webpackChunkName: \"upload-requests\" */ '@netx/core-category'),\n\t\t\t]).then((modules) => {\n\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t'netx:load:module',\n\t\t\t\t\tmodules.map((m) => m.default),\n\t\t\t\t\t{\n\t\t\t\t\t\tinitialized() {\n\t\t\t\t\t\t\tdispatcher.trigger('app:ready', true);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t});\n\n\t/**\n\t * Displays an alert box to the user\n\t * @event module:app#app:alert:show\n\t * @param {object} viewOptions View options\n\t */\n\tdispatcher.on(\n\t\t'app:alert:show',\n\t\tfunction (viewOptions) {\n\t\t\tmodalViews.add({\n\t\t\t\tviewClass: AlertView,\n\t\t\t\tshowActions: ['app:alert:show'],\n\t\t\t\tviewOptions: viewOptions,\n\t\t\t});\n\t\t},\n\t\twindow,\n\t);\n\n\t/**\n\t * Prepare and display an alert box to the user\n\t * @event module:app#app:alert\n\t * @param {string} msg Message to be displayed to the user\n\t * @param {string} type Type of alert that should be displayed to user corresponds with bootstrap classes 'error','warn','info','success'\n\t * @fires module:app#app:alert:show\n\t */\n\tdispatcher.on('app:alert', function (msg, type) {\n\t\tvar alertClass, av;\n\t\ttype = type || 'Warning';\n\t\tmsg =\n\t\t\tmsg || 'Sorry, the system has encountered a problem. Please try again.';\n\t\talertClass = type ? 'alert-' + type.toLowerCase() : '';\n\n\t\tdispatcher.trigger('app:alert:show', {\n\t\t\tmodel: new CoreModel({\n\t\t\t\ttype: type,\n\t\t\t\tmsg: msg,\n\t\t\t\talertClass: alertClass ? ' ' + alertClass : '',\n\t\t\t}),\n\t\t});\n\t});\n\n\t/**\n\t * Action handler for buttons that want to trigger history.back .\n\t * @event module:system#app:back\n\t */\n\tdispatcher.on('app:back', function () {\n\t\t// Gives us some added benefits\n\t\tappRouter.back();\n\t});\n\n\t/**\n\t * @event module:app#netx:browser:override:cancelled\n\t * @global\n\t */\n\tdispatcher.on('app:browser:override:cancelled', function () {\n\t\t// If the user doesn't want to continue we send them to Flex\n\t\twindow.location.replace('/ImagePortal.jsp');\n\t});\n\n\t/**\n\t * If the user cancelled startup due to the server incompatibility,\n\t * fall back to the Flex interface.\n\t * @event module:app#netx:compatible:cancelled\n\t * @global\n\t */\n\tdispatcher.once('app:compatible:cancelled', function () {\n\t\twindow.location.replace('/ImagePortal.jsp');\n\t});\n\n\t/**\n\t * @event module:app#app:confirm:show\n\t * @param {object} viewOptions View options\n\t */\n\tdispatcher.on('app:confirm:show', function (viewOptions) {\n\t\timport(\n\t\t\t/* webpackChunkName: \"view-appConfirm\" */ './views/confirmView'\n\t\t).then((View) => {\n\t\t\tmodalViews.add({\n\t\t\t\tviewClass: View.default,\n\t\t\t\tshowActions: ['app:confirm:show'],\n\t\t\t\tviewOptions: viewOptions,\n\t\t\t});\n\t\t});\n\t});\n\t/**\n\t * Triggers a confirmation dialog to be displayed to the user.\n\t * The first parameter is an options object used in a new instance of Netx.Views.Confirmview.\n\t * All other arguments are passed to the 'args' property of that view, and are then passed\n\t * along with the confirmation event it generates.\n\t * @event module:app#app:confirm\n\t * @param {object} options Options\n\t */\n\tdispatcher.on('app:confirm', function (options) {\n\t\t// any other arguments we pass along to the view, which passes them to the event\n\t\tdispatcher.trigger(\n\t\t\t'app:confirm:show',\n\t\t\t_.extend(\n\t\t\t\t{\n\t\t\t\t\targs: _.rest(arguments),\n\t\t\t\t},\n\t\t\t\toptions,\n\t\t\t),\n\t\t);\n\t});\n\n\t/**\n\t * @event module:app#app:confirm:delete:show\n\t * @param {object} viewOptions View options\n\t */\n\tdispatcher.on('app:confirm:delete:show', function (viewOptions) {\n\t\timport(\n\t\t\t/* webpackChunkName: \"view-appConfirm\" */ './views/confirmDelete'\n\t\t).then((View) => {\n\t\t\tmodalViews.add({\n\t\t\t\tviewClass: View.default,\n\t\t\t\tshowActions: ['app:confirm:delete:show'],\n\t\t\t\tviewOptions: viewOptions,\n\t\t\t});\n\t\t});\n\t});\n\n\t/**\n\t * Triggers a delete confirmation dialog to be displayed to the user.\n\t * The first parameter is an options object used in a new instance of Netx.Views.Confirmview.\n\t * All other arguments are passed to the 'args' property of that view, and are then passed\n\t * along with the confirmation event it generates.\n\t * @event module:app#app:confirm:delete\n\t * @param {object} options Options\n\t * @fires module:app#app:confirm:delete:show\n\t */\n\tdispatcher.on('app:confirm:delete', function (options) {\n\t\t// any other arguments we pass along to the view, which passes them to the event\n\t\tdispatcher.trigger(\n\t\t\t'app:confirm:delete:show',\n\t\t\t_.extend(\n\t\t\t\t{\n\t\t\t\t\targs: _.rest(arguments),\n\t\t\t\t},\n\t\t\t\toptions,\n\t\t\t),\n\t\t);\n\t});\n\n\t/**\n\t * Confirmation for abandoning unsaved changes\n\t * @event module:app#app:confirmUnsaved\n\t * @param {object} opts Options for confirmation\n\t * @fires module:app#app:confirm\n\t * @listens module:app#app:confirmUnsaved:cancelled\n\t * @listens module:app#app:confirmUnsaved:confirmed\n\t */\n\tdispatcher.on('app:confirmUnsaved', function (opts) {\n\t\topts = opts || {};\n\n\t\tdispatcher.off('app:confirmUnsaved:confirmed');\n\t\t_.isFunction(opts.confirmed) &&\n\t\t\tdispatcher.on('app:confirmUnsaved:confirmed', opts.confirmed);\n\n\t\tdispatcher.off('app:confirmUnsaved:cancelled');\n\t\t_.isFunction(opts.cancelled) &&\n\t\t\tdispatcher.on('app:confirmUnsaved:cancelled', opts.cancelled);\n\n\t\tdispatcher.trigger('app:confirm', {\n\t\t\teventStr: 'app:confirmUnsaved',\n\t\t\tmessage: i18n.t('i18n.anyUnsavedChangesWillBeLostConfirm'),\n\t\t\toklabel: i18n.t('i18n.btnYes'),\n\t\t\tcancellabel: i18n.t('i18n.btnNo'),\n\t\t});\n\t});\n\n\t/**\n\t * Launch the contact dialog\n\t * @event module:app#app:contact:show\n\t * @param {object} viewOptions View options\n\t */\n\tdispatcher.on(\n\t\t'app:contact:show',\n\t\tfunction (viewOptions) {\n\t\t\timport(/* webpackChunkName: \"view-contact\" */ './views/contact').then(\n\t\t\t\t(View) => {\n\t\t\t\t\tmodalViews.add({\n\t\t\t\t\t\tviewClass: View.default,\n\t\t\t\t\t\tshowActions: ['app:contact:show'],\n\t\t\t\t\t\tviewOptions: viewOptions,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t\twindow,\n\t);\n\t/**\n\t * @event module:app#app:contact\n\t * @fires module:app#app:contact:show\n\t */\n\tdispatcher.on('app:contact', function () {\n\t\tdispatcher.trigger('app:contact:show');\n\t});\n\t/**\n\t * @event module:app#app:contact:confirmed\n\t * @fires module:app#app:contact:error\n\t * @fires module:app#app:contact:success\n\t */\n\tdispatcher.on('app:contact:confirmed', function (values, view) {\n\t\tNetx.app.contact(values).then(\n\t\t\tfunction () {\n\t\t\t\tdispatcher.trigger('app:contact:success');\n\t\t\t},\n\t\t\tfunction (err) {\n\t\t\t\tdispatcher.trigger('app:contact:error', err);\n\t\t\t},\n\t\t);\n\t});\n\t/**\n\t * @event module:app#app:contact:success\n\t * @fires module:notification#notification\n\t */\n\tdispatcher.on(\n\t\t'app:contact:success',\n\t\tfunction () {\n\t\t\tdispatcher.trigger('notification', {\n\t\t\t\tmodule: 'app',\n\t\t\t\ttitle: i18n.t('i18n.email'),\n\t\t\t\tdescription: i18n.t('i18n.emailSent'),\n\t\t\t\ttype: 'success',\n\t\t\t});\n\t\t},\n\t\twindow,\n\t);\n\t/**\n\t * @event module:app#app:contact:error\n\t * @param {string} error Error string\n\t * @fires module:notification#notification\n\t */\n\tdispatcher.on(\n\t\t'app:contact:error',\n\t\tfunction (error) {\n\t\t\tdispatcher.trigger('notification', {\n\t\t\t\tmodule: 'app',\n\t\t\t\ttitle: i18n.t('i18n.email'),\n\t\t\t\tdescription: i18n.t('i18n.thereWasAnErrorSendingYourRequest'),\n\t\t\t\ttype: 'danger',\n\t\t\t});\n\t\t},\n\t\twindow,\n\t);\n\n\t/**\n\t * @event module:app#app:help\n\t * @fires module:app#app:help:error\n\t */\n\tdispatcher.on('app:help', function () {\n\t\tconst url = Netx.getPreference('header.helpUrl');\n\t\tif (url != null) {\n\t\t\t// eslint-disable-next-line security/detect-unsafe-regex\n\t\t\tconst regexp =\n\t\t\t\t/(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-/]))?/;\n\t\t\tif (regexp.test(url)) return spawnNewWindow(url);\n\n\t\t\tdispatcher.trigger(\n\t\t\t\t'app:help:error',\n\t\t\t\tnew Error(i18n.t('i18n.invalidHelpUrl', {url: url})),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tdispatcher.trigger(\n\t\t\t'app:help:error',\n\t\t\tnew Error(i18n.t('i18n.helpUrlNotSet')),\n\t\t);\n\t});\n\t/**\n\t * @event module:app#app:help:error\n\t * @param {string} error Error string\n\t * @fires module:app#app:alert\n\t */\n\tdispatcher.on('app:help:error', function (error) {\n\t\tdispatcher.trigger('app:alert', error, i18n.t('i18n.error'));\n\t});\n\n\t/**\n\t * @event module:app#app:progress:show\n\t * @param {object} viewOptions View options\n\t */\n\tdispatcher.on(\n\t\t'app:progress:show',\n\t\tfunction (viewOptions) {\n\t\t\tmodalViews.add({\n\t\t\t\tviewClass: AppProgressView,\n\t\t\t\tshowActions: ['app:progress:show'],\n\t\t\t\tviewOptions: viewOptions,\n\t\t\t});\n\t\t},\n\t\twindow,\n\t);\n\t/**\n\t * @event module:app#app:progress\n\t * @param {object} opts Progress options\n\t * @fires module:app#app:progress:show\n\t */\n\tdispatcher.on('app:progress', function (opts) {\n\t\t// Nothing fancy to do yet\n\t\tdispatcher.trigger('app:progress:show', opts);\n\t});\n\n\t/**\n\t * @event module:app#app:prompt:show\n\t * @param {object} viewOptions View options\n\t */\n\tdispatcher.on('app:prompt:show', function (viewOptions) {\n\t\timport(/* webpackChunkName: \"view-prompt\" */ './views/promptView').then(\n\t\t\t(View) => {\n\t\t\t\tmodalViews.add({\n\t\t\t\t\tviewClass: View.default,\n\t\t\t\t\tshowActions: ['app:prompt:show'],\n\t\t\t\t\tviewOptions: viewOptions,\n\t\t\t\t});\n\t\t\t},\n\t\t);\n\t});\n\t/**\n\t * Triggers a prompt dialog to be displayed to the user.\n\t * The first parameter is an options object used in a new instance of Netx.Views.PromptView.\n\t * All other arguments are passed to the 'args' property of that view, and are then passed\n\t * along with the confirmation event it generates.\n\t * @event module:app#app:prompt\n\t * @fires module:app#app:prompt:show\n\t */\n\tdispatcher.on('app:prompt', function () {\n\t\t// our first argument is options for the ConfirmView\n\t\tvar opts = Array.prototype.shift.apply(arguments);\n\t\t// any other arguments we pass along to the view, which passes them to the event\n\t\tdispatcher.trigger(\n\t\t\t'app:prompt:show',\n\t\t\t_.extend({args: Array.prototype.slice.apply(arguments)}, opts),\n\t\t);\n\t});\n\n\t/**\n\t * @event module:app#app:reportProblem:show\n\t * @param {object} viewOptions View options\n\t */\n\tdispatcher.on(\n\t\t'app:reportProblem:show',\n\t\tfunction (viewOptions) {\n\t\t\timport(\n\t\t\t\t/* webpackChunkName: \"view-reportProblem\" */ './views/problemReportView'\n\t\t\t).then((View) => {\n\t\t\t\tmodalViews.add({\n\t\t\t\t\tviewClass: View.default,\n\t\t\t\t\tshowActions: ['app:reportProblem:show'],\n\t\t\t\t\tviewOptions: viewOptions,\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\twindow,\n\t);\n\t/**\n\t * Prepare and launch the report a problem dialog\n\t * @event module:app#app:reportProblem\n\t * @fires module:app#app:reportProblem:show\n\t */\n\tdispatcher.on('app:reportProblem', function () {\n\t\tdispatcher.trigger('app:reportProblem:show', {\n\t\t\tmodel: Netx.app,\n\t\t});\n\t});\n\t/**\n\t * @event module:app#app:reportProblem:confirmed\n\t * @param {string} description Description of problem\n\t * @param {boolean} ccSelf CC reporter\n\t */\n\tdispatcher.on('app:reportProblem:confirmed', function (description, ccSelf) {\n\t\tNS.set({\n\t\t\tdescription: description,\n\t\t\tclientLogs: window.console.history.dump('all'),\n\t\t\tccSelf: ccSelf ? 'true' : 'false',\n\t\t});\n\n\t\tNS.complain().then(\n\t\t\tfunction () {\n\t\t\t\tdispatcher.trigger('app:reportProblem:success');\n\t\t\t},\n\t\t\tfunction (err) {\n\t\t\t\tdispatcher.trigger('app:reportProblem:error', err);\n\t\t\t},\n\t\t);\n\t});\n\t/**\n\t * @event module:app#app:reportProblem:error\n\t * @param {string} error Error string\n\t * @fires module:app#app:alert\n\t */\n\tdispatcher.on('app:reportProblem:error', function (error) {\n\t\tdispatcher.trigger('app:alert', error, i18n.t('i18n.error'));\n\t});\n\t/**\n\t * @event module:app#app:reportProblem:success\n\t * @fires module:notification#notification\n\t */\n\tdispatcher.on('app:reportProblem:success', function () {\n\t\tdispatcher.trigger('notification', {\n\t\t\tmodule: 'app',\n\t\t\ttitle: i18n.t('i18n.reportProblem'),\n\t\t\tdescription: i18n.t('i18n.yourInformationWasSent'),\n\t\t\ttype: 'success',\n\t\t});\n\t});\n\n\t//============================================\n\t//\tApp pager\n\t//============================================\n\t/**\n\t * Rewind to the first page of a selection\n\t * @event module:app#app:pager:firstPage\n\t * @param {Netx.Collection} Netx collection instance\n\t */\n\tdispatcher.on('app:pager:firstPage', function (pager, collection) {\n\t\tpager.firstPage();\n\t});\n\n\t/**\n\t * Forward to the last page of a selection\n\t * @event module:app#app:pager:lastPage\n\t * @param {Netx.Collection} Netx collection instance\n\t */\n\tdispatcher.on('app:pager:lastPage', function (pager, collection) {\n\t\tpager.lastPage();\n\t});\n\n\t/**\n\t * Fetch the previous page of a selection\n\t * @event module:app#app:pager:prevPage\n\t * @param {Netx.Collection} Netx collection instance\n\t */\n\tdispatcher.on('app:pager:prevPage', function (pager, collection) {\n\t\tpager.prevPage();\n\t});\n\n\t/**\n\t * Fetch the next page of a selection\n\t * @event module:app#app:pager:nextPage\n\t * @param {Netx.Collection} Netx collection instance\n\t */\n\tdispatcher.on('app:pager:nextPage', function (pager, collection) {\n\t\tpager.nextPage();\n\t});\n\n\t/**\n\t * Goto a specific page of a selection\n\t * @event module:app#app:pager:gotoPage\n\t * @param {Netx.Collection} Netx collection instance\n\t */\n\tdispatcher.on('app:pager:gotoPage', function (pager, collection, page) {\n\t\tpager.gotoPage(page);\n\t});\n\t//============================================\n\t//\t!App pager\n\t//============================================\n\n\t/**\n\t * Logic for status polling\n\t * @event module:app#app:pollBatchJob\n\t * @param {string} uuid UUID string\n\t * @param {event} event Event\n\t * @param {boolean} hasResult Batch task has result\n\t * @param {array} args Additional arguments to pass on (optional)\n\t * @fires module:app#app:pollBatchJob\n\t * @fires module:app#app:pollBatchJob:error\n\t * @fires module:app#app:pollBatchJob:messages\n\t * @fires module:app#app:pollBatchJob:success\n\t * @fires module:share#share:simpleDownload\n\t */\n\tdispatcher.on(\n\t\t'app:pollBatchJob',\n\t\tfunction (uuid, event, hasResult, args, pollInterval) {\n\t\t\tvar batchJob = batchJobs.get(uuid);\n\t\t\tif (!batchJob) {\n\t\t\t\tvar eventStrs = {};\n\t\t\t\tif (event) {\n\t\t\t\t\teventStrs[event] = args;\n\t\t\t\t}\n\t\t\t\tbatchJob = new BatchJobModel(\n\t\t\t\t\t{\n\t\t\t\t\t\tuuid: uuid,\n\t\t\t\t\t\targs: args || [],\n\t\t\t\t\t\thasResult: hasResult,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\teventStrs: eventStrs,\n\t\t\t\t\t\tpollInterval,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\tbatchJobs.add(batchJob);\n\t\t\t} else {\n\t\t\t\tevent && batchJob.addEventStr(event, args);\n\t\t\t}\n\t\t},\n\t);\n\t/**\n\t * UI hander for batch job success:\n\t */\n\tdispatcher.on(\n\t\t'app:pollBatchJob:success',\n\t\tfunction (uuid, event, hasResult, args) {\n\t\t\t//Netx.views.batchJobView && Netx.views.batchJobView.hide();\n\t\t},\n\t);\n\n\t/**\n\t * UI hander for batch job error:\n\t */\n\tdispatcher.on('app:pollBatchJob:error', function (err) {});\n\t/**\n\t * Triggering app:stop will halt the application, log out the user and\n\t * reload the page. Triggered due to invalid session, expired session or logout.\n\t * @event module:app#app:stop\n\t */\n\tdispatcher.on('app:stop', function () {\n\t\tlegacyWebsocket.disconnect();\n\t\t// Force page to reload\n\t\t//\n\t\t// (If you pass true as the value of the forceGet param - location.reload(forceGet)\n\t\t// Page will reload from server instead of cache\n\t\t// For more info see - http://www.w3schools.com/jsref/met_loc_reload.asp)\n\t\t// HACK https://jira.netx.net/browse/DAM-6124\n\t\t_.defer(function () {\n\t\t\tif (window.location.href.match(/request\\/([0-9a-fA-F-]{36})/)) {\n\t\t\t\twindow.location.href = window.location.href.substr(\n\t\t\t\t\t0,\n\t\t\t\t\twindow.location.href.indexOf('#'),\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tlocation.reload();\n\t\t\t}\n\t\t});\n\t});\n\t/**\n\t * Keep us logged in if we regained consciousness in time to click that button:\n\t * @event module:app#netx:session:timeout:confirmed\n\t */\n\tdispatcher.on('netx:session:timeout:confirmed', function () {\n\t\t$('body').removeClass('session-expiring');\n\t\tclearTimeout(session.finalCountdown);\n\t\tdelete session.finalCountdown;\n\t\tsession.tickle();\n\t});\n\t/**\n\t * When the session logout timer fires, we have only 60 seconds before our session times out!\n\t * Alert the user!\n\t * @event module:app#netx:session:timeoutWarning\n\t * @fires module:app#app:confirm\n\t */\n\tdispatcher.on('netx:session:timeoutWarning', function () {\n\t\t$('body').addClass('session-expiring');\n\t\tconsole.warn('Session timeout in 60 seconds.');\n\t\tdispatcher.trigger('app:confirm', {\n\t\t\teventStr: 'netx:session:timeout',\n\t\t\tmessage: i18n.t('i18n.yourSessionIsAboutToExpire'),\n\t\t\tyesLabel: i18n.t('i18n.keepMeLoggedIn'),\n\t\t\tnoLabel: '',\n\t\t\ttitle: i18n.t('i18n.timeoutWarning'),\n\t\t});\n\t\t// We're leaving together, but it's still farewell ...\n\t\tsession.finalCountdown = setTimeout(function () {\n\t\t\tdispatcher.trigger('session:expire');\n\t\t}, 60 * 1000); // sixty seconds!\n\t});\n\t/**\n\t * Handling session timeouts:\n\t *\n\t * The DAM cancels all sessions after a configurable period of time without\n\t * user activity. X7 keeps a session timer so we can warn the user if the\n\t * timeout is imminent. The timer is automatically reset on every API call.\n\t *\n\t * Prevent our client-side session timer from timing out during uploads,\n\t * which are not API calls, and can potentially take longer than the timeout period.\n\t * @event module:app#upload:progress\n\t */\n\tdispatcher.on('upload:progress', function () {\n\t\tsession.resetLogoutTimer();\n\t});\n\n\t/**\n\t * RPC catastrophic error count reset - DAM-3261\n\t * @event module:app#app:server:success\n\t */\n\tdispatcher.on('app:server:success', function () {\n\t\tNS.set({serverUnresponsiveCount: 0});\n\t});\n\t/**\n\t * RPC catastrophic error counting - DAM-3261\n\t * @event module:app#app:server:success\n\t * @fires module:app#app:alert\n\t */\n\tdispatcher.on('app:server:error', function () {\n\t\tvar count = NS.get('serverUnresponsiveCount') + 1;\n\t\tNS.set({serverUnresponsiveCount: count});\n\t\tif (count > 3) {\n\t\t\tdispatcher.trigger(\n\t\t\t\t'app:alert',\n\t\t\t\ti18n.t('i18n.serverNotAvailable', 'danger'),\n\t\t\t);\n\t\t}\n\t});\n\n\t/**\n\t * Install analytics\n\t * @event module:app#netx:analytics:start\n\t * @param {string} provider Provider name\n\t * @param {string} code Tracking code\n\t * @param {function} cb Callback\n\t */\n\tdispatcher.once('netx:analytics:start', function (provider, code, cb) {\n\t\t// Someday we can expand this to support multiple providers. But for now, it's all Google:\n\t\tif (!['google'].includes(provider)) {\n\t\t\tconsole.warn(`unsupported analytics provider ${provider}`);\n\t\t\treturn cb();\n\t\t}\n\n\t\timport(\n\t\t\t/* webpackChunkName: \"google-analytics\" */ '@netx/core/analytics/google'\n\t\t).then(({default: setupGoogleAnalytics}) => {\n\t\t\tsetupGoogleAnalytics(code);\n\t\t\tcb();\n\t\t});\n\t});\n\n\t/**\n\t * If the server version is incorrect, provide a warning.\n\t * @event module:app#app:serverVersionWarning\n\t * @fires module:app#app:confirm\n\t * @global\n\t */\n\tdispatcher.on(\n\t\t'app:serverVersionWarning',\n\t\tfunction (version, required_version) {\n\t\t\tdispatcher.trigger('app:confirm', {\n\t\t\t\ttitle: i18n.t('i18n.serverVersionWarningTitle'),\n\t\t\t\tmessage: i18n.t('i18n.serverVersionWarningMessage', {\n\t\t\t\t\tserver_version: version,\n\t\t\t\t\trequired_version: required_version,\n\t\t\t\t}),\n\t\t\t\t//\"This application requires DAM version \" + required_version + \", but this DAM is at version \" + version + '. If you continue, you may encouter compatability errors. You may prefer to use
    the Flex interface instead.',\n\t\t\t\tyesLabel: i18n.t('i18n.serverVersionWarningContinue'),\n\t\t\t\tnoLabel: i18n.t('i18n.serverVersionWarningCancel'),\n\t\t\t\teventStr: 'app:compatible',\n\t\t\t\tid: 'server-version-warning',\n\t\t\t});\n\t\t},\n\t);\n\n\t/**\n\t * Display a menu as a set of option tiles, using OptionTilesView\n\t *\n\t * @event module:app#app:showOptions\n\t * @param {Netx.Menu} menu\n\t * @param {mixed} payload Additional data to send to options view and its child views ( best as an object ); this\n\t * @param {string} viewKey A key for referencing the OptionTilesView (when triggering app:hideOptions); if not provided, the menu will be stringified as the key.\n\t * will be returned as an extra argument to the triggered action handler.\n\t * @see module:app#app:hideOptions\n\t */\n\tdispatcher.on('app:showOptions', function (options) {\n\t\tvar tileCollection = new OptionTilesCollection([], {\n\t\t\tmenu: options.menu,\n\t\t\tdata: options.data,\n\t\t});\n\t\tif (tileCollection.length) {\n\t\t\t// If there is only one option and we have a wrapper - just fire it off\n\t\t\t// If the action does not have a wrapper - there is not much that can be done since we do not know how to get the data to the event properly\n\t\t\tif (tileCollection.length === 1) {\n\t\t\t\tvar tileOption = tileCollection.at(0),\n\t\t\t\t\twrapper = tileOption && tileOption.get('wrapper');\n\t\t\t\tif (wrapper) {\n\t\t\t\t\treturn dispatcher.trigger.apply(\n\t\t\t\t\t\tdispatcher,\n\t\t\t\t\t\t[tileOption.get('action')].concat(\n\t\t\t\t\t\t\twrapper({data: tileOption.get('data')}),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\timport(\n\t\t\t\t/* webpackChunkName: \"view-optionTiles\" */ './views/optionTilesView'\n\t\t\t).then((View) => {\n\t\t\t\tmodalViews.add({\n\t\t\t\t\tviewClass: View.default,\n\t\t\t\t\tshowActions: ['app:showOptions'],\n\t\t\t\t\tviewOptions: _.extend({}, _.omit(options, 'menu'), {\n\t\t\t\t\t\tcollection: tileCollection,\n\t\t\t\t\t}),\n\t\t\t\t});\n\t\t\t});\n\t\t} else {\n\t\t\tconsole.warn('No valid actions found in menu.');\n\t\t}\n\t});\n\n\n\t/**\n\t * app:start starts up the Netx skin/application\n\t * Show the app layer, create views, etc.\n\t * @event module:app#app:start\n\t * @fires module:app#app:started\n\t */\n\tdispatcher.on('app:start', function () {\n\t\t// Give any other `app:start` listener the ability to respond prior to calling `app:started`\n\t\t_.defer(function () {\n\t\t\t// Welcome to X7! Please click responsibly.\n\t\t\tdispatcher.trigger('app:started');\n\t\t});\n\t});\n\n\tlogger.silly('loading required modules...');\n\tdispatcher.on('app:load:modules', function (NS) {\n\t\tPromise.all([\n\t\t\timport(\n\t\t\t\t/* webpackMode: \"eager\"*/ /* webpackChunkName: \"app-module-dependencies\" */ '@netx/core-auth'\n\t\t\t),\n\t\t\timport(\n\t\t\t\t/* webpackMode: \"eager\"*/ /* webpackChunkName: \"app-module-dependencies\" */ '@netx/core-notification'\n\t\t\t),\n\t\t]).then((imports) => {\n\t\t\tlogger.silly('loaded required modules');\n\t\t\tconst [Auth, Notification] = imports;\n\n\t\t\t// Now initialize auth module\n\t\t\tdispatcher.trigger(\n\t\t\t\t'netx:load:module',\n\t\t\t\t[Auth.default, Notification.default],\n\t\t\t\t{\n\t\t\t\t\tinitialized() {\n\t\t\t\t\t\tlogger.silly('starting analytics...');\n\t\t\t\t\t\t// Setup analytics\n\t\t\t\t\t\tnew Analytics().then(() => {\n\t\t\t\t\t\t\tlogger.silly('initialized');\n\t\t\t\t\t\t\tdispatcher.trigger('app:extend', NS);\n\t\t\t\t\t\t\tdispatcher.trigger('app:initialized', NS);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t});\n\n\t//=================================\n\t//\t!EVENT LISTENERS\n\t//=================================\n\tlogger.silly('bootstrapping...');\n\t$.when.apply($, NS.bootstrap).then(function () {\n\t\tlogger.silly('bootstrapped');\n\t\tdelete NS.bootstrap;\n\t\tdispatcher.trigger('app:load:modules', NS);\n\t});\n});\n\nexport default {\n\tinitialize(opts) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tdispatcher.once('app:initialized', () => {\n\t\t\t\timport(\n\t\t\t\t\t/* webpackMode: \"eager\"*/ /* webpackChunkName: \"app-module-dependencies\" */ './routes'\n\t\t\t\t).then((routes) => {\n\t\t\t\t\tresolve(routes.default);\n\t\t\t\t});\n\t\t\t});\n\t\t\tdispatcher.trigger('app:init');\n\t\t});\n\t},\n};\n","export {default} from 'netxcore@netx/core-app/controller';\n\n////////////////////////////////////\n// Deferred module loaders\n////////////////////////////////////\n// These are all core defined deferred modules\n// If themes choose to create new deferred module they will need to set up their own dispatchers and routes accordingly\n// and in the same pattern as seen here\n// These are placed here for optimal bundle creations.\n/**\n * @event module:netx#netx:load:module:adBuilder\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:adBuilder', function (opts) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-ad-builder\" */ '@netx/core-ad-builder'\n\t).then((AdBuilder) => {\n\t\tdispatcher.trigger('netx:load:deferred:module', AdBuilder.default, opts);\n\t});\n});\n/**\n * @event module:netx#netx:load:module:audioeditor\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:audioeditor', function (opts) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-audio-editor\" */ '@netx/core-audio-editor'\n\t).then((AudioEditor) => {\n\t\tdispatcher.trigger('netx:load:deferred:module', AudioEditor.default, opts);\n\t});\n});\n/**\n * @event module:netx#netx:load:module:dataset\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:dataset', function (opts, cb) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-data-set\" */ '@netx/core-data-set'\n\t).then((DataSet) => {\n\t\tdispatcher.trigger('netx:load:deferred:module', DataSet.default, opts);\n\t});\n});\n/**\n * @event module:netx#netx:load:module:pdfViewer\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:pdfViewer', function (opts, cb) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-pdf-viewer\" */ '@netx/core-pdf-viewer'\n\t).then((PDFViewer) => {\n\t\tdispatcher.trigger('netx:load:deferred:module', PDFViewer.default, opts);\n\t});\n});\n/**\n * @event module:netx#netx:load:module:imageeditor\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:imageeditor', function (opts, cb) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-image-editor\" */ '@netx/core-image-editor'\n\t).then((ImageEditor) => {\n\t\tdispatcher.trigger('netx:load:deferred:module', ImageEditor.default, opts);\n\t});\n});\n/**\n * @event module:netx#netx:load:module:project\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:project', function (opts, cb) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-project\" */ '@netx/core-project'\n\t).then((Project) => {\n\t\tdispatcher.trigger('netx:load:deferred:module', Project.default, opts);\n\t});\n});\n/**\n * @event module:netx#netx:load:module:stat\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:stat', function (opts, cb) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-stat-next\" */ '@netx/core-stat-next'\n\t).then((Stat) => {\n\t\tdispatcher.trigger('netx:load:deferred:module', Stat.default, opts);\n\t});\n});\n/**\n * @event module:netx#netx:load:module:system\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:system', function (opts, cb) {\n\timport(/* webpackChunkName: \"@netx/core-system\" */ '@netx/core-system').then(\n\t\t(System) => {\n\t\t\tdispatcher.trigger('netx:load:deferred:module', System.default, opts);\n\t\t},\n\t);\n});\n/**\n * @event module:netx#netx:load:module:videoeditor\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:videoeditor', function (opts, cb) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-video-editor\" */ '@netx/core-video-editor'\n\t).then((VideoEditor) => {\n\t\tdispatcher.trigger('netx:load:deferred:module', VideoEditor.default, opts);\n\t});\n});\n\n/**\n * @event module:netx#netx:load:module:uploadAssetRequestManager\n * @param {object} opts Options\n * @fires module:netx#netx:load:module\n */\ndispatcher.on('netx:load:module:uploadAssetRequestManager', function (opts) {\n\timport(\n\t\t/* webpackChunkName: \"@netx/core-upload-asset-request-manager\" */ '@netx/core-upload-asset-request-manager'\n\t).then((UploadAssetRequestManager) => {\n\t\tdispatcher.trigger(\n\t\t\t'netx:load:deferred:module',\n\t\t\tUploadAssetRequestManager.default,\n\t\t\topts,\n\t\t);\n\t});\n});\n////////////////////////////////////\n// !Deferred module loaders\n////////////////////////////////////\n\n/**\n * App Module Extensions\n * @event module:app#app:extend\n */\ndispatcher.once('app:extend', function (NS) {\n\t/**\n\t * @event module:netx#routed\n\t */\n\tdispatcher.on('routed', function () {\n\t\t// Kills things (like dropdowns and the like)\n\t\tNS.$body.click();\n\t});\n\n\t// App shortcuts to the upload module\n\t// We only load upload after login and if the user is importer or above\n\t// so the app menus may have been parsed before the actions/translations\n\t// from upload are available\n\t// When we reqork our menu system we should factor this in and have some sort\n\t// of attribute that defines the menu's actions belong to another module and to not\n\t// parse/render the menu until that module has loaded\n\tdispatcher.on('app:upload', function (viewOptions, catId) {\n\t\tdispatcher.trigger('upload:landing', viewOptions, catId);\n\t});\n\n\tdispatcher.on('app:upload:attributeData', function () {\n\t\t//dispatcher.trigger('upload:attributeData');\n\t\tdispatcher.trigger('app:upload', {\n\t\t\ttab: 'attributeData',\n\t\t});\n\t});\n\tdispatcher.on('app:upload:bulkCartLoader', function () {\n\t\t//dispatcher.trigger('upload:bulkCartLoader');\n\t\tdispatcher.trigger('app:upload', {\n\t\t\ttab: 'bulkCartLoader',\n\t\t});\n\t});\n\n\t////////////////////////////\n\t// Drag Events\n\t////////////////////////////\n\t// For the love of bubbling events\n\t// Prevent the browser from trying to interpret these things\n\tNS.$document\n\t\t.off('dragover')\n\t\t// Bubbles up from drop zones within\n\t\t.on('dragover', 'body', function (e) {\n\t\t\t// Prevent\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t})\n\t\t// Bubbles up from drop zones within\n\t\t.off('drop')\n\t\t.on('drop', 'body', function (e) {\n\t\t\t// Prevent\n\t\t\te.preventDefault();\n\t\t\treturn false;\n\t\t});\n\n\t//DAM-4150 - override FormValidation.i18n for dynamic message\n\tFormValidation.I18n = $.extend(true, FormValidation.I18n || {}, {\n\t\ten_US: {\n\t\t\tstringLength: {\n\t\t\t\tless: 'Please enter no more than %s character(s)',\n\t\t\t\t// this doesn't work\n\t\t\t\tless_plural: 'Please enter no more than %s characters',\n\t\t\t},\n\t\t},\n\t});\n}); // app:extend\n","/**\n * App module\n * @module app/index\n */\n\nimport actions from './actions';\nimport menus from './menus';\nimport MenuView from '@netx/core-app/views/menuView';\nimport controller from './controller';\nimport {RegisterLegacyAction} from '@netx/core/legacyActionManager';\nimport {setGlobal} from '@netx/core-next/utils/setGlobal';\nimport {addMenus} from '@netx/core/legacyMenuManager';\n\n/**\n * @property {object} exports - Our module exports\n * @property {string} exports.namespace - Module namespace\n * @property {function} exports.initialize - Module initializer\n */\nexport default {\n\tnamespace: 'app',\n\tinitialize() {\n\t\tRegisterLegacyAction(actions);\n\n\t\taddMenus(menus);\n\n\t\tsetGlobal((Netx) => ({\n\t\t\tViews: {\n\t\t\t\t...Netx.Views,\n\t\t\t\tMenuView,\n\t\t\t},\n\t\t}));\n\n\t\treturn controller.initialize();\n\t},\n};\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/advancedMenuItemView.html';\n\nexport default class AdvancedMenuItemView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.tagName = opts.tagName || 'li';\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AdvancedMenuItemView';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './menuView';\nimport Template from '../templates/advancedMenuView.html';\nimport ChildView from './advancedMenuItemView';\n\nimport ChildViews from '@netx/core/functionality/childViews';\n\nexport default class AdvancedMenuView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.childView = {\n\t\t\tviewClass: ChildView,\n\t\t\ttarget: '.advanced-menu-items',\n\t\t\toptions: {\n\t\t\t\ttagName: 'li',\n\t\t\t\tclassName: 'menu-item',\n\t\t\t\ttemplateName: opts.childViewTemplate,\n\t\t\t},\n\t\t\t...opts.childView,\n\t\t};\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\n\t\tthis.childViewTemplate = opts.childViewTemplate;\n\t}\n\n\t/** @override */\n\tdoTemplate() {\n\t\treturn this.template({\n\t\t\t...this.collection,\n\t\t\titems: this.collection.models,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AdvancedMenuView';\n\t}\n}\n\n// Functionality\n\nChildViews(AdvancedMenuView);\n","export {default} from 'netxcore@netx/core-app/index';\n\nimport AdvancedMenuView from './views/advancedMenuView';\nconst Netx = (window.Netx = window.Netx || {});\nNetx.Views = Netx.Views || {};\nNetx.Views.AdvancedMenuView = AdvancedMenuView;\n\nimport './css/style.less';\n","import {appRouter} from '@netx/core-next/router';\nimport {getUserLevel} from '@netx/core-user/utils/getUserLevel';\nimport coreConfig from '@netx/core-next/config';\n\n/** @namespace */\n\nexport default {\n\t/**\n\t * Blank route ('') corresponds to no route at all.\n\t * The default behavior for the Netx url without a route is to show the top level category tree.\n\t * @namespace\n\t * @todo decouple?\n\t * @todo HTML-582 - Duplicating boilerplate code on behalf of Nike Foundation. Let's clean this up please.\n\t * @fires module:app#category:route:top\n\t * @listens module:app#auth:session:valid\n\t */\n\t''() {\n\t\tif (getUserLevel() > 0) {\n\t\t\t// TODO: isValid() returns a promise & will always evaluate TRUE; not what we want.\n\t\t\tif (coreConfig.HOME_ROUTE) {\n\t\t\t\tappRouter.home();\n\t\t\t} else {\n\t\t\t\tdispatcher.trigger('category:route:top');\n\t\t\t}\n\t\t} else {\n\t\t\t/** @event */\n\t\t\tdispatcher.on('auth:session:valid', function () {\n\t\t\t\tif (coreConfig.HOME_ROUTE) {\n\t\t\t\t\tappRouter.home();\n\t\t\t\t} else {\n\t\t\t\t\tdispatcher.trigger('category:route:top');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\t// External bundle\n\t'share/request(/:token)': () => window.location.reload(),\n\t'uploads/request(/:token)': () => window.location.reload(),\n\t// \"*action\":\tfunction(action){\n\t// \t// !! IMPORTANT !!\n\t// \t// DEVNOTE: @spence - This is the default method that is run\n\t// \t// when there is no matching route pattern. It is very important\n\t// \t// for proper functioning in certain situations where there may not\n\t// \t// be a valid session in play but we do have an access token.\n\t// \t// This route allows us to catch the route change and fire subsequent\n\t// \t// methods to identify and utilize the token value in the route.\n\t// }\n};\n","import routes from 'netxcore@netx/core-app/routes';\nimport {appRouter} from '@netx/core-next/router';\nimport {assetProjectEnabled} from '@netx/core-asset-project/enablers';\n\n// Deferred module routes\nObject.assign(routes, {\n\t'document(/*anything)'() {\n\t\tdispatcher.trigger('netx:load:module:pdfViewer', {loadUrl: true});\n\t},\n\t/**\n\t * @route\n\t * @fires netx:load:module:uploadAssetRequestManager\n\t */\n\t'assets/requests(/*anything)'() {\n\t\tdispatcher.trigger('netx:load:module:uploadAssetRequestManager', {\n\t\t\tloadUrl: true,\n\t\t});\n\t},\n\t/**\n\t * @route\n\t * @fires netx:load:module:audioeditor\n\t */\n\t'audioeditor(/*anything)'() {\n\t\tdispatcher.trigger('netx:load:module:audioeditor', {loadUrl: true});\n\t},\n\t/**\n\t * @route\n\t * @fires netx:load:module:dataset\n\t */\n\t'dataset(/*anything)'() {\n\t\tdispatcher.trigger('netx:load:module:dataset', {loadUrl: true});\n\t},\n\t/**\n\t * @route\n\t * @fires netx:load:module:imageeditor\n\t */\n\t'imageeditor(/*anything)'() {\n\t\tdispatcher.trigger('netx:load:module:imageeditor', {loadUrl: true});\n\t},\n\t/**\n\t * @route\n\t * @fires netx:load:module:stat\n\t */\n\t'stat(/*anything)'() {\n\t\tdispatcher.trigger('netx:load:module:stat', {loadUrl: true});\n\t},\n\t/**\n\t * @route\n\t * @fires netx:load:module:system\n\t */\n\t'system(/*anything)'() {\n\t\tif (!Netx.session?.authenticated()) {\n\t\t\tappRouter.back();\n\t\t\treturn;\n\t\t}\n\t\tdispatcher.trigger('netx:load:module:system', {loadUrl: true});\n\t},\n\t/**\n\t * @route\n\t * @fires netx:load:module:videoeditor\n\t */\n\t'videoeditor(/*anything)'() {\n\t\tdispatcher.trigger('netx:load:module:videoeditor', {loadUrl: true});\n\t},\n});\n\n// TODO: this check has to be failing given we do not have prefs yet\n// we need to ensure prefs are loaded post auth before any other modules are called upon\nif (assetProjectEnabled()) {\n\t/**\n\t * @route\n\t * @fires netx:load:module:project\n\t */\n\troutes['projects(/*anything)'] = () => {\n\t\tdispatcher.trigger('netx:load:module:project', {loadUrl: true});\n\t};\n}\n\nexport default routes;\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/appModalCrumbView.html';\n\nclass AppModalCrumbView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.template = Template;\n\t\tsuper(opts);\n\n\t\t// Related view\n\t\tthis.model.has('view')\n\t\t\t? this.addRelatedView()\n\t\t\t: this.listenToOnce(this.model, 'change:view', this.addRelatedView);\n\t}\n\n\t/** @override */\n\tbindModelEvents() {\n\t\tsuper.bindModelEvents();\n\t\treturn this.listenTo(this.model, 'change:active', this.toggleActive);\n\t}\n\n\t/** @override */\n\tpreRender() {\n\t\tsuper.preRender();\n\n\t\tconst modalOptions =\n\t\t\t(this.relatedView && this.relatedView.modalOptions) || {};\n\t\t// Additional template vars\n\t\tObject.assign(this.templateVars, {\n\t\t\taction: this.model.get('uniqueShowAction') || '',\n\t\t\tlabel:\n\t\t\t\tmodalOptions.crumbLabel ||\n\t\t\t\tthis.model.get('label') ||\n\t\t\t\tmodalOptions.headerTitle ||\n\t\t\t\t(this.relatedView && this.relatedView.headerTitle) ||\n\t\t\t\t'',\n\t\t});\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\t// Cache\n\t\tthis.$remove = this.$('.nx-action[data-action=\"app:remove:modalView\"]');\n\t\tthis.$title = this.$('.nx-title');\n\n\t\tif (this.relatedView) {\n\t\t\t// Check modal options\n\t\t\tvar modalOptions = this.relatedView.modalOptions || {};\n\t\t\tthis.$remove.toggle(modalOptions.blocking !== true);\n\t\t}\n\t}\n\n\t/**\n\t * Once our model has its view property,\n\t * remeber it at .relatedView, and use it to toggle our crumbs.\n\t * (.relatedView also used in theme override ...)\n\t * @method\n\t */\n\taddRelatedView() {\n\t\tthis.relatedView = this.model.get('view');\n\t\tvar modalOptions = this.relatedView.modalOptions || {};\n\t\tthis.$el.toggle(modalOptions.noCrumb !== true);\n\t}\n\n\t/** @method */\n\ttoggleActive() {\n\t\tthis.$el.toggleClass('active', this.model.get('active') === true);\n\t\t// Update title (it could have changed context)\n\t\tif (this.relatedView) {\n\t\t\tvar modalOpts = this.relatedView.modalOptions || {};\n\t\t\tthis.$title &&\n\t\t\t\tthis.$title.html(\n\t\t\t\t\tmodalOpts.crumbLabel ||\n\t\t\t\t\t\t_.escape(this.model.get('label')) ||\n\t\t\t\t\t\t_.escape(modalOpts.headerTitle) ||\n\t\t\t\t\t\t_.escape(this.relatedView.headerTitle),\n\t\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @static\n\t * @type {string}\n\t */\n\tstatic get __name__() {\n\t\treturn 'AppModalCrumbView';\n\t}\n}\n\nexport default AppModalCrumbView;\n","/**\n * @class\n */\nimport Base from 'netxcore@netx/core-app/views/appModalCrumbView';\n\nimport {faTimes} from '@fortawesome/pro-solid-svg-icons';\nconst icons = Base.initializeIcons({\n\tfaTimes,\n});\n\nexport default class AppModalCrumbView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\tconst model = opts.model;\n\t\tconst active = model.get('active');\n\t\tconst index = model.collection.indexOf(model);\n\n\t\topts.tagName = 'button';\n\t\topts.className = `mdc-tab ${\n\t\t\tactive || !index ? 'mdc-tab--active' : ''\n\t\t} nx-action`;\n\t\topts.attributes = {\n\t\t\t'data-action': model.get('uniqueShowAction'),\n\t\t\t'aria-selected': active || !index,\n\t\t\trole: 'tab',\n\t\t\t'data-nx-tab-name': model.get('name'),\n\t\t\ttabindex: active || !index ? 0 : -1,\n\t\t};\n\t\topts.icons = {...icons, ...opts.icons};\n\t\tsuper(opts);\n\t}\n\n\t/** @override */\n\tpreRender() {\n\t\tsuper.preRender();\n\n\t\tconst model = this.model;\n\t\tObject.assign(this.templateVars, {\n\t\t\tindex: (model.collection && model.collection.indexOf(model)) || 0,\n\t\t});\n\t}\n\n\t/** @method */\n\ttoggleActive() {\n\t\tsuper.toggleActive();\n\n\t\tconst active = this.model.get('active') === true;\n\t\tthis.el.classList.toggle('mdc-tab--active', active);\n\t\tthis.el.setAttribute('aria-selected', active);\n\t\tthis.el\n\t\t\t.querySelector('.mdc-tab-indicator')\n\t\t\t.classList.toggle('mdc-tab-indicator--active', active);\n\t}\n}\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/appModalCrumbsView.html';\n\nimport ChildViews from '@netx/core/functionality/childViews';\n\nimport ChildView from './appModalCrumbView';\n\nclass AppModalCrumbsView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.childView = {\n\t\t\tviewClass: ChildView,\n\t\t\t// Edge case: this is a view that happens to use a viewCollection to simply populate it's children and not\n\t\t\t// to inherit everything from them. Rather than try and accomplish this solution somehow in addChildView\n\t\t\t// I figured it best to be handled in the views that are utilizing a viewCollection differently than say\n\t\t\t// a netx-multiView would - since these options get applied last (superceed all others) we just put back the\n\t\t\t// values we do not want to inherit from a viewSpec\n\t\t\toptions(model, opts) {\n\t\t\t\treturn {\n\t\t\t\t\ttagName: 'li',\n\t\t\t\t\tmodel: model,\n\t\t\t\t\tcollection: model.collection,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\t'data-nx-control': 'crumb',\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t},\n\t\t\t...opts.childView,\n\t\t};\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\t}\n\n\t/** @override */\n\tbindCollectionEvents() {\n\t\tsuper.bindCollectionEvents();\n\n\t\tthis.rendered.then(() => {\n\t\t\tthis.listenTo(\n\t\t\t\tthis.collection,\n\t\t\t\t'add remove reset',\n\t\t\t\t_.debounce(this.crumbsChanged, 25),\n\t\t\t);\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/** @method */\n\tcheckMultipleCrumbs() {\n\t\tthis.el.classList.toggle('multiple-crumbs', this.collection.length > 1);\n\t}\n\n\t/** @method */\n\tcrumbsChanged() {\n\t\tthis.checkMultipleCrumbs();\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\tthis.checkMultipleCrumbs();\n\t}\n\n\t/**\n\t * @static\n\t * @type {string}\n\t */\n\tstatic get __name__() {\n\t\treturn 'AppModalCrumbsView';\n\t}\n}\n\n// Functionality\nChildViews(AppModalCrumbsView);\n\nexport default AppModalCrumbsView;\n","/**\n * @class\n * @override\n */\nimport Base from 'netxcore@netx/core-app/views/appModalCrumbsView';\n\nimport {MDCTabBar} from '@material/tab-bar';\n\nexport default class AppModalCrumbsView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\tsuper(opts);\n\n\t\t// Debounced/throttled methods\n\t\tthis.resize = _.debounce(this.resize, 32);\n\t}\n\n\t/** @override */\n\tbindCollectionEvents() {\n\t\tsuper.bindCollectionEvents();\n\n\t\treturn this.listenTo(this.collection, 'change:active', (tab, active) => {\n\t\t\tif (!active) return;\n\t\t\tthis.checkMaterialTabActive();\n\t\t});\n\t}\n\n\t/** @method */\n\tcheckMaterialTabActive() {\n\t\tif (!this.tabBar) return;\n\n\t\tconst active = this.collection.findWhere({active: true});\n\t\tif (!active) return;\n\n\t\tconst name = active.get('name');\n\t\tconst idx = this.tabBar.tabList_.findIndex((tab) => {\n\t\t\treturn tab.root_.getAttribute('data-nx-tab-name') === name;\n\t\t});\n\t\tif (idx > -1) {\n\t\t\tthis.tabBar.activateTab(idx);\n\t\t}\n\t}\n\n\t/** @override */\n\tpreRender() {\n\t\tif (this.tabBar) {\n\t\t\tthis.tabBar.destroy();\n\t\t\tdelete this.tabBar;\n\t\t}\n\n\t\tsuper.preRender();\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\tthis.setupMaterial();\n\t}\n\n\t/** @method */\n\tresize() {\n\t\tconst tabBar = this.tabBar;\n\t\tif (!tabBar) return;\n\n\t\t// Overflow\n\t\tconst tabScroller = tabBar.tabScroller_;\n\t\tif (tabScroller) {\n\t\t\tconst tabScrollerEl = tabScroller.root_;\n\t\t\ttabScrollerEl.classList.toggle(\n\t\t\t\t'mdc-tab-scroller--overflown',\n\t\t\t\ttabScroller.getScrollContentWidth() > tabScrollerEl.offsetWidth,\n\t\t\t);\n\t\t}\n\n\t\t// Bring tab into view\n\t\tconst idx = tabBar.foundation_.adapter_.getPreviousActiveTabIndex();\n\t\tidx > -1 && tabBar.scrollIntoView(idx);\n\t}\n\n\t/** @method */\n\tsetupMaterial() {\n\t\tif (this.tabBar) {\n\t\t\tthis.tabBar.destroy();\n\t\t\tdelete this.tabBar;\n\t\t}\n\n\t\tconst el = this.el.querySelector('.mdc-tab-bar');\n\t\tif (!el) return;\n\n\t\tconst tabBar = (this.tabBar = new MDCTabBar(el));\n\t\treturn tabBar;\n\t}\n\n\t/** @override */\n\tcrumbsChanged() {\n\t\tsuper.crumbsChanged();\n\n\t\t// Destroy and reinit resize listener when recreating material tabs\n\t\tthis.Plugins.Destroy('resizeListener', this.$el);\n\n\t\tthis.setupMaterial();\n\t\tthis.checkMaterialTabActive();\n\n\t\tthis.Plugins.Initialize('resizeListener', this.$el);\n\t}\n}\n","/**\n * The main modal view. Only one of me should exist in any interface. Otherwise, you might\n * be doing modals wrong ( stacked ).\n * @class\n */\nimport Base from '@netx/core/lib/netx-multiView';\nimport {getPrefixedLogger} from '@netx/core-next/utils/logger';\nimport {appRouter} from '@netx/core-next/router';\nimport Template from '../templates/appModalView.html';\nimport AppModalCrumbsView from './appModalCrumbsView';\nimport ConfirmView from './confirmView';\n\nconst logger = getPrefixedLogger('views/appFullScreenView');\n\nclass AppModalView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.attributes = _.extend(\n\t\t\t{\n\t\t\t\ttabindex: '-1',\n\t\t\t\trole: 'dialog',\n\t\t\t\t'aria-hidden': 'true',\n\t\t\t\t'aria-labelledby': 'app-modal',\n\t\t\t},\n\t\t\topts.attributes,\n\t\t);\n\t\topts.childView = _.extend(\n\t\t\t{\n\t\t\t\tviewClass(model) {\n\t\t\t\t\treturn model.get('viewClass');\n\t\t\t\t},\n\t\t\t\ttarget: '[data-nx-control=\"modal-content\"]',\n\t\t\t},\n\t\t\topts.childView,\n\t\t);\n\t\topts.className = opts.className || 'modal fade';\n\t\topts.emptyOnHide = opts.emptyOnHide !== false;\n\t\topts.events = _.extend(\n\t\t\t{\n\t\t\t\t'click [data-nx-control=\"close\"]:first': 'close',\n\t\t\t},\n\t\t\topts.events,\n\t\t);\n\t\topts.hideOnEmpty = opts.hideOnEmpty !== false;\n\t\topts.id = opts.id || 'app-modal';\n\t\topts.removeOnHide = false;\n\t\topts.modalOptions = _.extend(\n\t\t\t{\n\t\t\t\tsize: 'md',\n\t\t\t},\n\t\t\topts.modalOptions,\n\t\t);\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(dispatcher, 'routed', this.hideIfWeShould);\n\t\t// A new child view was added - check if it was caused by a route\n\t\tthis.listenTo(this, 'addedNewChildView', (view) => {\n\t\t\tif (view.viewSpec.isMyOriginalCollection(this.viewCollection)) {\n\t\t\t\t// Check if the view was a result of routing\n\t\t\t\tif (view.isRouted !== false && !(view instanceof ConfirmView)) {\n\t\t\t\t\t// view.isRouted = true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Crumbs\n\t\tthis.modalCrumbsView = this.addSubView(\n\t\t\tnew AppModalCrumbsView({\n\t\t\t\tcollection: this.viewCollection,\n\t\t\t}),\n\t\t);\n\n\t\tthis.activeViewClassNames = '';\n\t}\n\n\t/**\n\t * @override\n\t * @param {event} e Keyup event\n\t */\n\tescape(e) {\n\t\t!this.blocking && this.hide();\n\t}\n\n\t/**\n\t * This is where the any animation should happen\n\t * When the callback is executed the app considers this view as good as hidden\n\t * Overriding for bootstrap modal behavior\n\t * @override\n\t * @param {function} cb Callback\n\t */\n\tbeforeHidden(cb) {\n\t\t// We do not call super\n\t\tif (this.emptyOnHide) {\n\t\t\tlet view;\n\t\t\tthis.viewCollection.each((viewSpec) => {\n\t\t\t\tview = viewSpec.get('view');\n\t\t\t\tview && _.isFunction(view.cancel) && view.cancel();\n\t\t\t});\n\t\t\t// Always use set to empty\n\t\t\tthis.viewCollection.set([]);\n\t\t}\n\n\t\tthis.$backdrop && this.$backdrop.removeClass('in');\n\n\t\t_.delay(() => {\n\t\t\tthis.$backdrop && this.$backdrop.remove();\n\t\t\tthis.$backdrop = null;\n\t\t\t// Trigger animation\n\t\t\tthis.$el.removeClass('in').attr('aria-hidden', true);\n\t\t\t// Give css animations time to finish\n\t\t\t_.delay(() => {\n\t\t\t\tthis.$body && this.$body.removeClass('modal-open');\n\t\t\t\t// Reset scrollbar\n\t\t\t\tthis.$body.css('padding-right', '');\n\t\t\t\tthis.$el.hide();\n\t\t\t\tcb.call(self);\n\t\t\t}, 300);\n\t\t}, 150);\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\t// Cache\n\t\tthis.$crumbs = this.$('[data-nx-control=\"crumbs\"]');\n\t\tthis.$title = this.$('[data-nx-control=\"modal-title\"]');\n\t\tthis.$dialog = this.$('.modal-dialog');\n\t\tthis.$close = this.$('[data-nx-control=\"close\"]');\n\t\tthis.$content = this.$('[data-nx-control=\"modal-content\"]');\n\t\tthis.$body = $('body');\n\n\t\t// Set default size\n\t\tthis.$dialog\n\t\t\t.removeClass('modal-md modal-sm modal-lg')\n\t\t\t.addClass(`modal-${this.modalOptions.size}`);\n\n\t\t// Crumbs\n\t\tthis.modalCrumbsView.setElement(this.$crumbs).render();\n\t}\n\n\t/**\n\t * This is where the any animation should happen\n\t * When the callback is executed the app considers this view as good as shown\n\t * Overriding for bootstrap modal behavior\n\t * @override\n\t * @param {function} cb Callback\n\t */\n\tbeforeShown(cb) {\n\t\tif (this.$backdrop || !this.viewCollection.length) return;\n\n\t\t// Create and append backdrop\n\t\tthis.$backdrop = $('
    ', {\n\t\t\tclass: 'modal-backdrop fade',\n\t\t});\n\t\tthis.$backdrop.appendTo(this.$body);\n\t\tthis.$body.addClass('modal-open');\n\t\t// Set scrollbar\n\t\tconst bodyPad = parseInt(this.$body.css('padding-right') || 0, 10);\n\t\tif (this.scrollbarWidth) {\n\t\t\tthis.$body.css('padding-right', bodyPad + this.scrollbarWidth);\n\t\t}\n\t\tthis.$backdrop.appendTo(this.$body);\n\t\t// Force reflow\n\t\tthis.$backdrop[0].offsetWidth;\n\t\tthis.$backdrop.addClass('in');\n\n\t\t_.delay(() => {\n\t\t\t// Modal\n\t\t\tthis.$el.show().scrollTop(0);\n\t\t\t// Force reflow\n\t\t\tthis.$el[0].offsetWidth;\n\t\t\tthis.$el.addClass('in').attr('aria-hidden', false);\n\t\t\tthis.$el.trigger('focus');\n\t\t\t_.delay(_.bind(cb, self), 300);\n\t\t}, 150);\n\t}\n\n\t/**\n\t * Show is about to start\n\t * At this point no animation or actual showing [should] have taken place\n\t * @override\n\t * @listens Netx.View#showing\n\t */\n\tonShowing() {\n\t\tif (this.viewCollection.length === 0) {\n\t\t\tthis.hide();\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.onShowing();\n\t\tthis.hiddenByRoute = false;\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} newRoute New route\n\t * @param {string} oldRoute Old route\n\t */\n\thideIfWeShould(newRoute, oldRoute) {\n\t\tif (!this.hiddenByRoute && !this.hiding && !this.showing) {\n\t\t\t// We will need to modify this as time goes on and we understand the complexity of\n\t\t\t// the workflow for wizards and such\n\t\t\tconst activeView = this.getActiveView();\n\t\t\tif (this.viewCollection.length > 1) {\n\t\t\t\tif (newRoute !== oldRoute) {\n\t\t\t\t\tthis.viewCollection.each((viewSpec) => {\n\t\t\t\t\t\tconst view = viewSpec.get('view');\n\t\t\t\t\t\tif (activeView && view.cid === activeView.cid) return;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tview &&\n\t\t\t\t\t\t\tview.isRouted &&\n\t\t\t\t\t\t\t!_.isUndefined(view.routeMatch) &&\n\t\t\t\t\t\t\t!_.isNull(oldRoute.match(view.routeMatch))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tview.hasFunctionality('form') &&\n\t\t\t\t\t\t\t\tviewSpec.isMyOriginalCollection(this.viewCollection)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tview.cancel();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tview.hide();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (\n\t\t\t\tthis.isShown &&\n\t\t\t\t!this.hiding &&\n\t\t\t\t!_.isUndefined(activeView) &&\n\t\t\t\tactiveView.isRouted\n\t\t\t) {\n\t\t\t\t// if we should not be showing on this route\n\t\t\t\tif (!activeView.isMyRoute(window.location.hash.slice(1))) {\n\t\t\t\t\tthis.hiddenByRoute = true;\n\t\t\t\t\t// To save people from themselves we always have a slight hide delay\n\t\t\t\t\t// Meaning the view must live for at least 500ms\n\t\t\t\t\t$.when(activeView.hideDelayed ? activeView.hideDelayed : true).then(\n\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t_.delay(() => {\n\t\t\t\t\t\t\t\t// If we are the only view - just hide the modal and not go through\n\t\t\t\t\t\t\t\t// the hiding of the view followed by the modal\n\t\t\t\t\t\t\t\tif (!this.hiding && this.viewCollection.length === 1) {\n\t\t\t\t\t\t\t\t\tactiveView.$el.fadeOut('fast');\n\t\t\t\t\t\t\t\t\tthis.hide();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tactiveView.viewSpec.isMyOriginalCollection(\n\t\t\t\t\t\t\t\t\t\t\tthis.viewCollection,\n\t\t\t\t\t\t\t\t\t\t) &&\n\t\t\t\t\t\t\t\t\t\tactiveView.hasFunctionality('form')\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tactiveView.cancel();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tactiveView.hide();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, 20);\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Wait to be shown and then recheck\n\t\telse if (this.showing) {\n\t\t\tthis.whenShown.then(() => {\n\t\t\t\treturn this.hideIfWeShould(newRoute, oldRoute);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Show will be starting soon\n\t * At this point not even `view.show` has been executed\n\t * This allows the view to do anything special it needs to do in anticipation of calling `view.show`\n\t * @method\n\t * @param {Netx.View} view Instance of Netx.View\n\t * @listens Netx.View.MultiView#view:showing\n\t */\n\tbeforeShowView(view) {\n\t\t////////////////////////////////\n\t\t// UPDATE FROM MODAL OPTIONS\n\t\t////////////////////////////////\n\t\tconst modalOpts = view.modalOptions || {};\n\n\t\t// Update size\n\t\tthis.$dialog &&\n\t\t\tthis.$dialog\n\t\t\t\t.removeClass('modal-md modal-sm modal-lg')\n\t\t\t\t.addClass('modal-' + (modalOpts.size || this.modalOptions.size));\n\n\t\t// Prevent the content area from jumping\n\t\tconst currentHeight = this.$childTargetEl.height();\n\t\tif (currentHeight) {\n\t\t\tthis.$childTargetEl.height(currentHeight);\n\t\t}\n\n\t\t// Update blocking\n\t\tthis.blocking = modalOpts.blocking === true;\n\t\tthis.$el.toggleClass('blocking', this.blocking);\n\t\t// Update title - will look to the view's modal options first and then fallback to the view's title\n\t\tthis.$title && this.$title.html(modalOpts.headerTitle || view.headerTitle);\n\n\t\t// Clean up and apply any new classNames\n\t\tthis.$el.removeClass(this.activeViewClassNames);\n\t\tthis.activeViewClassNames = modalOpts.classNames || '';\n\t\tthis.$el.addClass(this.activeViewClassNames);\n\t\t////////////////////////////////\n\t\t// !UPDATE FROM MODAL OPTIONS\n\t\t////////////////////////////////\n\n\t\treturn super.beforeShowView(view);\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e Click event\n\t */\n\tclose(e) {\n\t\t!this.blocking && this.hide();\n\t}\n\n\t/**\n\t * @override\n\t * @param {Netx.View} view Instance of `Netx.View`\n\t * @listens {@link Netx.Views.MultiView#view:shown}\n\t */\n\tviewAfterShown(view) {\n\t\tsuper.viewAfterShown(view);\n\n\t\t// Reset height\n\t\tview.rendered.then(() => {\n\t\t\tthis.$childTargetEl.height('');\n\t\t});\n\t}\n\n\t/**\n\t * Provided with the view we are changing to and the knowledge of the current view\n\t * you can block the change by returning `false`\n\t * @override\n\t * @param {Netx.View} view Instance of Netx.View we are changing to\n\t * @returns {boolean} Ok to change/show view\n\t */\n\tviewChanging(view) {\n\t\tconst activeView = this.getActiveView();\n\t\tconst modalOpts = view.modalOptions || {};\n\t\t// What blocks a change:\n\t\t// We must have a currently active view - we must have more than 1 view and the current view mustnot be blocking\n\t\t// unless the view trying to show is blocking - since it is new it takes precedent\n\t\treturn (\n\t\t\tmodalOpts.blocking ||\n\t\t\t!activeView ||\n\t\t\tthis.viewCollection.length === 1 ||\n\t\t\tactiveView.stickyModal !== true\n\t\t);\n\t}\n\n\t/**\n\t * A view was instantiated (a brand new childView was born)\n\t * @override\n\t * @param {Netx.View} view Instance of Netx.View\n\t */\n\tviewInstantiated(view) {\n\t\tsuper.viewInstantiated(view);\n\n\t\t// All child views will be fully removed on hide\n\t\tif (view.viewSpec.isMyOriginalCollection(this.viewCollection)) {\n\t\t\tview.removeOnHide = true;\n\t\t\tview.removeOnSimpleHide = false;\n\t\t}\n\t\t// Sticky? - TODO: Revisit the difference between sticky and blocking - I got confused I think - I am\n\t\tconst modalOpts = view.modalOptions || {};\n\t\tview.stickyModal = modalOpts.blocking === true;\n\t}\n\n\t/**\n\t * @override\n\t * @param {Netx.View} view Instance of Netx.View\n\t */\n\tviewRemoved(view) {\n\t\tif (\n\t\t\t!this.hiddenByRoute &&\n\t\t\tview.viewSpec.isMyOriginalCollection(this.viewCollection)\n\t\t) {\n\t\t\t// If a new view came in in the mean time and it is routed - do nothing - we are at the route we should be\n\t\t\tconst activeView = this.getActiveView();\n\t\t\tif (activeView && activeView.cid !== view.cid && activeView.isRouted) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// HACK: preserve this value across callbacks:\n\t\t\t// (isRouting() reports false if a callback is fired via setTimeout(), such as in certain Bootstrap hiding animations.)\n\t\t\tconst isRouting = Backbone.history.isRouting();\n\t\t\t// If we opened this modal view due to a route...\n\t\t\tif (view.isRouted) {\n\t\t\t\tlogger.silly('removing routed view >', view.viewSpec.id);\n\n\t\t\t\tif (view.viewSpec.isMyOriginalCollection(this.viewCollection)) {\n\t\t\t\t\tdelete view.isRouted;\n\t\t\t\t}\n\t\t\t\t// Unless we're currently routing, route back to where we were before we opened the modal.\n\t\t\t\tif (!isRouting) {\n\t\t\t\t\tif (!_.isUndefined(view.routeMatch)) {\n\t\t\t\t\t\tappRouter.exitRoute(view.routeMatch);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tappRouter.back();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdelete this.hiddenByRoute;\n\n\t\tsuper.viewRemoved(view);\n\t}\n\n\t/**\n\t * @static\n\t * @type {string}\n\t */\n\tstatic get __name__() {\n\t\treturn 'AppModalView';\n\t}\n}\n\nexport default AppModalView;\n","import Base from 'netxcore@netx/core-app/views/appModalView';\n\nimport '../css/appModal.less';\n\nimport {faTimes} from '@fortawesome/pro-solid-svg-icons';\nconst icons = Base.initializeIcons({\n\tfaTimes,\n});\n\nexport default class AppModalView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.icons = {...icons, ...opts.icons};\n\t\tsuper(opts);\n\t}\n}\n","/**\n * Simple confirmation dialog view, with no model. Utilized by the {@link module:app#app:confirm|app:confirm} event\n * @class\n */\nimport Base from './alertView';\nimport Template from '../templates/confirmView.html';\n\nclass ConfirmView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.className = `app-confirm ${opts.className || ''}`;\n\t\topts.events = {\n\t\t\t'click [data-nx-control=\"yes\"]'() {\n\t\t\t\tthis.finish(true);\n\t\t\t},\n\t\t\t'click [data-nx-control=\"no\"]': 'cancel',\n\t\t\t...opts.events,\n\t\t};\n\t\topts.headerTitle = opts.headerTitle || i18n.t('i18n.confirm');\n\t\topts.id = opts.id || 'app-confirm';\n\t\topts.modalOptions = {\n\t\t\tblocking: true,\n\t\t\tsize: 'md',\n\t\t\t...opts.modalOptions,\n\t\t};\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\n\t\t/**\n\t\t * @type {array}\n\t\t * @default\n\t\t */\n\t\tthis.args = opts.args || [];\n\n\t\t/**\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.classes = opts.classes || '';\n\n\t\t/**\n\t\t * if this.yesEvent or this.noEvent are undefined, this view will build the appropriate\n\t\t * events by appending ':confirmed' or ':cancelled' to this.eventStr .\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.eventStr = opts.eventStr;\n\n\t\t/**\n\t\t * Any object that a custom template to confirmView might want to play with:\n\t\t * @type object\n\t\t * @default\n\t\t */\n\t\tthis.goo = opts.goo;\n\n\t\t/**\n\t\t * @type {string}\n\t\t * @default\n\t\t * @note This is being used as the argument to message.format() -- please document\n\t\t */\n\n\t\tthis.itemLabel = opts.itemLabel || '';\n\n\t\t/**\n\t\t * The confirmation message.\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.message = opts.message || i18n.t('i18n.areYouSure');\n\n\t\t/**\n\t\t * Event triggered when the user clicks 'no'\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.noEvent = opts.noEvent;\n\n\t\t/**\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.noLabel = opts.noLabel != null ? opts.noLabel : i18n.t('i18n.no');\n\n\t\t/**\n\t\t * Event triggered when the user clicks 'yes'\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.yesEvent = opts.yesEvent;\n\n\t\t/**\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.yesLabel = opts.yesLabel != null ? opts.yesLabel : i18n.t('i18n.yes');\n\n\t\t/**\n\t\t * Pass a function that will be fired when the user cancels\n\t\t * @memberOf Netx.Views.ConfirmView\n\t\t * @alias onCancelled\n\t\t * @type {function}\n\t\t */\n\t\tthis.onCancelled = opts.onCancelled;\n\n\t\t/**\n\t\t * Pass a function that will be fired when the user confirms\n\t\t * @memberOf Netx.Views.ConfirmView\n\t\t * @alias onConfirmed\n\t\t * @type {function}\n\t\t */\n\t\tthis.onConfirmed = opts.onConfirmed;\n\n\t\tthis.title = opts.title;\n\n\t\t// Set on modal options\n\t\tthis.modalOptions.classNames = this.classes;\n\t}\n\n\t/** @override */\n\tpreRender() {\n\t\tsuper.preRender();\n\n\t\t// Prevent bad goo data from ever causing template errors, as with DAM-6941:\n\t\tthis.goo = this.goo || {};\n\n\t\t// Additonal template vars\n\t\t// Just in case this view ever gets a model - it will lose the benefits it currently has\n\t\tObject.assign(this.templateVars, {\n\t\t\tclasses: this.classes,\n\t\t\tgoo: this.goo,\n\t\t\theaderTitle: this.headerTitle,\n\t\t\tmessage: this.message,\n\t\t\titemLabel: this.itemLabel,\n\t\t\tnoLabel: this.noLabel,\n\t\t\tyesLabel: this.yesLabel,\n\t\t});\n\t}\n\n\t/** @method */\n\tescape() {\n\t\tthis.cancel();\n\t}\n\n\t/** @override */\n\tcancel(e) {\n\t\tif (e && e.preventDefault) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\n\t\tthis.trigger('cancelled', this);\n\t\tthis.hide();\n\n\t\tconst event = this.noEvent || `${this.eventStr}:cancelled`;\n\t\tdispatcher.trigger.apply(dispatcher, [event].concat(this.args));\n\n\t\t// If any callbacks were provided, execute them.\n\t\ttypeof this.onCancelled === 'function' &&\n\t\t\tthis.onCancelled.apply(this, this.args);\n\t}\n\n\t/** @method */\n\tconfirm() {\n\t\tthis.hide();\n\n\t\tconst event = this.yesEvent || `${this.eventStr}:confirmed`;\n\t\t// return an argument list with the event\n\t\tdispatcher.trigger.apply(dispatcher, [event].concat(this.args));\n\n\t\t// If any callbacks were provided, execute them.\n\t\ttypeof this.onConfirmed === 'function' &&\n\t\t\tthis.onConfirmed.apply(this, this.args);\n\t}\n\n\t/**\n\t * Handles acceptance or rejection of confirm dialog\n\t * @method\n\t * @param {boolean} bool Was the confirm accepted or rejected?\n\t */\n\tfinish(bool) {\n\t\tbool ? this.confirm() : this.cancel();\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'ConfirmView';\n\t}\n}\n\nexport default ConfirmView;\n","import Base from 'netxcore@netx/core-app/views/confirmView';\n\nimport {faExternalLinkAlt, faPlus} from '@fortawesome/pro-solid-svg-icons';\nconst icons = Base.initializeIcons({\n\tfaExternalLinkAlt,\n\tfaPlus,\n});\n\nexport default class confirmView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.icons = {...icons, ...opts.icons};\n\t\tsuper(opts);\n\t}\n}\n","export default [];\n","import Menu from '@netx/core/lib/netx-menu';\n\nexport default {};\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/authSamlServiceView.html';\n\nclass AuthSAMLServiceView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\n\t\tthis.model.get('type') === 'saml'\n\t\t\t? this.el.classList.add('nx-saml')\n\t\t\t: this.el.classList.add('nx-standard');\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AuthSAMLServiceView';\n\t}\n}\n\nexport default AuthSAMLServiceView;\n","/**\n * View displays the user login form\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/authUserLoginView.html';\n\nimport ChildView from '@netx/core-auth/views/authSamlServiceView';\nimport ChildViews from '@netx/core/functionality/childViews';\n\nimport Form from '@netx/core/functionality/form';\n\nexport default class AuthUserLoginView extends Base {\n\t/** @override */\n\tunsavedChanges() {\n\t\treturn false;\n\t}\n\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\t// Do we have SAML endpoints?\n\t\tconst samlEnabled =\n\t\t\topts.collection && opts.collection.findWhere({type: 'saml'}) != null;\n\t\tif (samlEnabled) {\n\t\t\topts.events = {\n\t\t\t\t'click .nx-saml': 'samlServiceClicked',\n\t\t\t\t'click .nx-standard': 'standardLoginClicked',\n\t\t\t\t...opts.events,\n\t\t\t};\n\t\t\topts.childView = {\n\t\t\t\tviewClass: ChildView,\n\t\t\t\t...opts.childView,\n\t\t\t};\n\t\t}\n\n\t\topts.eventStr = opts.eventStr || 'auth:user:login';\n\t\topts.id = opts.id || 'user-login-view';\n\t\topts.removeOnHide = opts.removeOnHide !== false;\n\t\topts.removeOnSimpleHide = opts.removeOnSimpleHide !== false;\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\n\t\tif (samlEnabled) {\n\t\t\t// toggles standard login with SSO\n\t\t\tthis.$el.addClass('saml-enabled');\n\t\t}\n\t}\n\n\t/** @override */\n\tbindModelEvents() {\n\t\tsuper.bindModelEvents();\n\t\treturn this.listenTo(this.model, 'change:loginMsg', this.debouncedRender);\n\t}\n\n\t/** @override */\n\tpostRender() {\n\t\tsuper.postRender();\n\n\t\t// Cache\n\t\tthis.$password = this.$el.find('#password');\n\t\tthis.$username = this.$el.find('#username');\n\t}\n\n\t/** @override */\n\tafterShown(view) {\n\t\tsuper.afterShown(view);\n\n\t\tthis.rendered.then(this.focus);\n\t}\n\n\t/** @override */\n\tfocus() {\n\t\tthis.inputs.$username.focus();\n\t}\n\n\t/**\n\t * @override\n\t * @param {event} e Submit event\n\t */\n\tsubmit(e) {\n\t\t// drag and drop functionality requires a\n\t\t// click event somewhere in document to remove focus\n\t\tthis.$password.blur();\n\n\t\tsuper.submit(e);\n\t}\n\n\t/**\n\t * @method\n\t * @fires module:auth#auth:user:saml:navigate\n\t */\n\tsamlServiceClicked(e) {\n\t\t// saml endpoint selected\n\t\tdispatcher.trigger(\n\t\t\t'auth:user:saml:navigate',\n\t\t\tthis.$(e.currentTarget)\n\t\t\t\t.find('.nx-samlButton')\n\t\t\t\t.attr('name'),\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t */\n\tstandardLoginClicked(e) {\n\t\t// show standard login\n\t\tthis.$el.addClass('standard-enabled');\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AuthUserLoginView';\n\t}\n}\n\n// Functionality\nChildViews(AuthUserLoginView);\nForm(AuthUserLoginView);\n","/**\n * @class\n * @override\n */\nimport Base from 'netxcore@netx/core-auth/views/authUserLoginView';\nimport '../css/lib/login.less';\n\nimport MaterialCheckboxes from '@netx/core/functionality/materialCheckboxes';\nimport MaterialRipples from '@netx/core/functionality/materialRipples';\nimport MaterialTextFields from '@netx/core/functionality/materialTextFields';\n\nclass AuthUserLoginView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\tif (opts.collection) {\n\t\t\t// We do not care to display an internal button at this time in theme\n\t\t\topts.collection = new opts.collection.constructor(\n\t\t\t\topts.collection.filter({type: 'saml'}),\n\t\t\t);\n\t\t\topts.events = {\n\t\t\t\t// DAM-15604\n\t\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=669724\n\t\t\t\tanimationstart(e) {\n\t\t\t\t\tif (!e.originalEvent.animationName === 'onAutoFillStart') return;\n\t\t\t\t\tthis.formChanged = true;\n\t\t\t\t\tthis.checkForm();\n\t\t\t\t},\n\t\t\t\t...opts.events,\n\t\t\t};\n\t\t}\n\t\tsuper(opts);\n\t}\n}\n\nMaterialCheckboxes(AuthUserLoginView);\nMaterialRipples(AuthUserLoginView);\nMaterialTextFields(AuthUserLoginView);\n\nexport default AuthUserLoginView;\n","export default {\n\t/**\n\t * @route\n\t */\n\tlogin: 'auth:user:login',\n\t/**\n\t * @route\n\t */\n\tlogout: 'auth:user:logout',\n\t/**\n\t * @route\n\t */\n\t'register/approval-needed': 'auth:user:register:approvalNeeded',\n\t/**\n\t * @route\n\t */\n\tregister: 'auth:user:register',\n\t/**\n\t * Step 1 of a password reset: present a form to request a token link by email\n\t * @route\n\t */\n\t'password-reset': 'auth:user:password:reset',\n\t/**\n\t * Step 2 of a password reset, routed to by that token link, presents a form to set a new password\n\t * @route\n\t * @param {number|string} user login\n\t * @param {string} token Token string\n\t */\n\t'password-reset/:user/:token': 'auth:user:password:change',\n\t/**\n\t * This route contains a session key; if we've come this far, it probably has already been parsed.\n\t * We should just redirect to the main app.\n\t */\n\t'session/:key': 'auth:user:sessionKey',\n};\n","/**\n * Authorization\n *\n * @module auth\n */\n\nimport {appRouter} from '@netx/core-next/router';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport {getUserLevel} from '@netx/core-user/utils/getUserLevel';\n\n// Models\nimport UserProfileModel from '@netx/core-user/models/userProfile';\n\n// Collections\nimport CustomFormCollection from '@netx/core-app/collections/customForm';\n\nimport {publicProperties} from '@netx/core-app/collections/singleton/publicProperties';\nimport {getPublicProperty} from '@netx/core-app-next/utils/getPublicProperty';\n\n// Views\nimport AuthUserLoginView from './views/authUserLoginView';\nimport Netx from '@netx/core/bootstrap';\nimport coreConfig from '@netx/core-next/config';\nimport {session} from '@netx/core-auth/collections/singleton/session';\nimport {localStore} from '@netx/core-next/localStore';\nimport {userProfile} from '@netx/core-user/collections/singletons/userProfile';\nimport {appViews} from '@netx/core-app/singletons/appViews';\nimport {whenReady} from '@netx/core-next/whenReady';\n\n// App config `Netx.auth.options`\nimport customConfig from './config';\n\nimport routes from './routes';\n\nimport {getPrefixedLogger} from '@netx/core-next/utils/logger';\nimport {setGlobal} from '@netx/core-next/utils/setGlobal';\nimport {\n\tcanRequestPasswordReset,\n\tcanSelfRegister,\n} from '@netx/core-auth-next/utils/canRequestPasswordReset';\n\nconst logger = getPrefixedLogger('core:auth');\n\nconst IGNORE_SESSION_ROUTES = [\n\t'password-reset',\n\t'passwordReset',\n\t'password',\n\t'register',\n];\n\nconst IGNORE_POST_LOGIN_ROUTES = IGNORE_SESSION_ROUTES.concat(['login']);\n\n/**\n * @event module:auth#auth:init\n */\ndispatcher.once('auth:init', function (options) {\n\toptions = _.extend({}, options, customConfig);\n\n\tconst NS = (Netx.auth = {\n\t\tbootstrap: [],\n\t\toptions: options,\n\t});\n\n\tsetGlobal({session});\n\n\t// Helper functions\n\tObject.assign(Netx, {\n\t\t/**\n\t\t * @function\n\t\t * @param {string} key [dot seperated] property key\n\t\t * @param {boolean} isTrue Test if the property value is true\n\t\t * @return {boolean|mixed}\n\t\t */\n\t\tgetPublicProperty: function (key, isTrue) {\n\t\t\treturn publicProperties[isTrue ? 'isTrue' : 'getProperty'](key);\n\t\t},\n\t\t/**\n\t\t * Get the current session\n\t\t * @function\n\t\t * @param {string} attr Attribute to retrieve (if omitted the session model is returned)\n\t\t * @return {Netx.Models.Session|mixed}\n\t\t */\n\t\tgetSession: function (attr) {\n\t\t\treturn attr ? session.get(attr) : session;\n\t\t},\n\t\t/**\n\t\t * Get the current token\n\t\t * @function\n\t\t * @param {string} attr Attribute to retrieve (if omitted the user model is returned)\n\t\t * @return {Netx.Models.UserProfile|mixed}\n\t\t */\n\t\tgetToken: function () {\n\t\t\treturn session.getToken();\n\t\t},\n\t});\n\n\t// Create netx session\n\t// This will test the browser and also the remote DAM connection\n\t// if DAM_URL is specified in config.js using the Netx.session.testAjax() method.\n\t// See netx-session.js for more info\n\t// When this completes, it triggers\n\tvar nxSession = session; //(Netx.session = session);\n\n\t// Wait for the session to configure (testAjax getPublicProperties return)\n\tnxSession.configured.then(function (props) {\n\t\t// Set the public properties returned from session configure\n\t\tpublicProperties.set(props);\n\n\t\t/**\n\t\t * If a users browser is not officially supported give them the option to manually\n\t\t * override\n\t\t * @event module:app#app:browser:override:confirmed\n\t\t */\n\t\tdispatcher.once('app:browser:override:confirmed', function () {\n\t\t\t// If the user wants to pull the trigger...\n\t\t\tnxSession.set('browserOk', true);\n\t\t\tnxSession.setCookie('browserOk', true, 30);\n\t\t});\n\n\t\t/**\n\t\t * When app:compatible:confirmed is triggered, we have an API connection\n\t\t * to a compatible DAM version, and a valid session.\n\t\t * @event module:app#app:compatible:confirmed\n\t\t */\n\t\tdispatcher.once('app:compatible:confirmed', function () {\n\t\t\t// We showed them this already?\n\t\t\tnxSession.deleteCookie('sessionExpired');\n\t\t\t// Never let our session expire:\n\t\t\tNS.options.TICKLE_SESSION && nxSession.beTickling();\n\t\t});\n\n\t\t/**\n\t\t * All required modules are initialized and we can check the state of the session\n\t\t * and dispatch accordingly\n\t\t * @event module:app#app:initialized\n\t\t * @fires module:auth#auth:token:valid\n\t\t * @fires module:auth#auth:token:invalid\n\t\t * @fires module:auth#auth:session:valid\n\t\t * @fires module:auth#auth:session:invalid\n\t\t */\n\t\tdispatcher.once('app:initialized', function () {\n\t\t\t// Are we doing token-based authentication instead of user login?\n\t\t\tif (nxSession.getToken()) {\n\t\t\t\t// We have a token. Test it.\n\t\t\t\tnxSession.isValid().then(\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\t// We have a valid token.\n\t\t\t\t\t\tdispatcher.trigger('auth:token:valid');\n\t\t\t\t\t},\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\t// Token is not valid; fail gracefully\n\t\t\t\t\t\tdispatcher.trigger('auth:token:invalid');\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Do we have a valid session (are we logged in already?)\n\t\t\t\tnxSession.isValid().then(\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\t// success handler == found a session!\n\t\t\t\t\t\t// Fetch the user\n\t\t\t\t\t\tuserProfile.fetch().then(function () {\n\t\t\t\t\t\t\tdispatcher.trigger('auth:session:valid');\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\t// isValid() fail handler (no valid session == user is not logged in)\n\t\t\t\t\t\tdispatcher.trigger('auth:session:invalid');\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * Triggering app:stop will halt the application, log out the user and\n\t\t * reload the page. Triggered due to invalid session, expired session or logout.\n\t\t * @event module:app#app:stop\n\t\t */\n\t\tdispatcher.once('app:stop', function () {\n\t\t\t// Delete the sessionKey cookie\n\t\t\tnxSession.stopTickling();\n\t\t\tnxSession.deleteCookie('sessionKey');\n\t\t});\n\n\t\t/**\n\t\t * If we don't have a valid session at startup, netx:session:invalid is triggered.\n\t\t * Check for various special cases, or else show a login form.\n\t\t * @event module:auth#auth:session:invalid\n\t\t * @fires module:auth#auth:user:login\n\t\t * @fires module:auth#auth:user:login:confirmed\n\t\t */\n\t\tdispatcher.once('auth:session:invalid', function () {\n\t\t\tconst m = window.location.hash.match(/(\\w+)/i)?.[1] ?? '';\n\n\t\t\t// Nothing to process in regards to session validity\n\t\t\tif (IGNORE_SESSION_ROUTES.includes(m)) return;\n\n\t\t\tconst {hash} = window.location;\n\n\t\t\t// Check if the user was redirected to a custom login\n\t\t\tconst customLoginWasTriggered =\n\t\t\t\tlocalStore.get(customConfig.CUSTOM_LOGIN_TRIGGERED_NAME) != null;\n\n\t\t\t// Do not store any routes that would lead a user to wind up here\n\t\t\tlet postLoginHash = IGNORE_POST_LOGIN_ROUTES.includes(\n\t\t\t\thash.replace(/^#/, ''),\n\t\t\t)\n\t\t\t\t? ''\n\t\t\t\t: hash;\n\n\t\t\t// If the user was redirected from a custom login, do not blow out the post login hash\n\t\t\tif (postLoginHash === '' && customLoginWasTriggered) {\n\t\t\t\t// use the already stored hash\n\t\t\t\tpostLoginHash = localStore.get(customConfig.POST_LOGIN_HASH_NAME) || '';\n\t\t\t}\n\n\t\t\t// if login is required, show the form\n\t\t\tif (coreConfig.REQUIRE_LOGIN) {\n\t\t\t\t// Refactor ticket - DAM-10298\n\t\t\t\t// use localStorage to save hash the user came in with for successful login\n\t\t\t\tlocalStore.set(customConfig.POST_LOGIN_HASH_NAME, postLoginHash);\n\t\t\t\t// remove - if we hit the custom login logic it will be set again\n\t\t\t\tlocalStore.remove(customConfig.CUSTOM_LOGIN_TRIGGERED_NAME);\n\n\t\t\t\t// DAM-11713 allow users to authenticate via NetX bypassing SSO and/or custom login\n\t\t\t\tif (_.contains(['', '#login'], hash)) {\n\t\t\t\t\t//incase #login already present\n\t\t\t\t\tappRouter\n\t\t\t\t\t\t.navigate('', {trigger: false})\n\t\t\t\t\t\t.navigate('login', {trigger: true});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// DAM-9976 support deep links via SSO\n\t\t\t\t// The system property `custom.index_page` was added for use with the original SSO implementation\n\t\t\t\t// Its use has been augemented to include custom home pages that do not utilize SSO\n\t\t\t\t// Redirection to the value of the property is handled exclusively by NetX's /index.jsp page\n\t\t\t\tif (\n\t\t\t\t\t!_.isUndefined(publicProperties.getProperty('custom.index_page')) &&\n\t\t\t\t\tpublicProperties.getProperty('custom.index_page') !== ''\n\t\t\t\t) {\n\t\t\t\t\t// Set for 5 minutes - will get blown out on each trip through this event as well\n\t\t\t\t\tlocalStore.set(customConfig.CUSTOM_LOGIN_TRIGGERED_NAME, 1);\n\t\t\t\t\tlocalStore.expire(\n\t\t\t\t\t\tcustomConfig.CUSTOM_LOGIN_TRIGGERED_NAME,\n\t\t\t\t\t\t60 * 1000 * 5,\n\t\t\t\t\t);\n\t\t\t\t\twindow.location.replace(window.location.origin);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// DAM-10369 support for custom login page\n\t\t\t\t// The system property `login.custom` was added to allow clients to utilize a custom authentication page\n\t\t\t\t// It is a boolean property that when true redirects unauthenticated users to /login.jsp\n\t\t\t\t// Redirection to the /login.jsp page is handled exclusively by NetX's /index.jsp page\n\t\t\t\tif (publicProperties.isTrue('login.custom')) {\n\t\t\t\t\t// Set for 5 minutes - will get blown out on each trip through this event as well\n\t\t\t\t\tlocalStore.set(customConfig.CUSTOM_LOGIN_TRIGGERED_NAME, 1);\n\t\t\t\t\tlocalStore.expire(\n\t\t\t\t\t\tcustomConfig.CUSTOM_LOGIN_TRIGGERED_NAME,\n\t\t\t\t\t\t60 * 1000 * 5,\n\t\t\t\t\t);\n\t\t\t\t\twindow.location.replace(window.location.origin);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//incase #login already present\n\t\t\t\tappRouter\n\t\t\t\t\t.navigate('', {trigger: false})\n\t\t\t\t\t.navigate('login', {trigger: true});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// DEVNOTE: This seems like a questionable tactic? @spence\n\t\t\t// do a null auto-login if logins are not required.\n\t\t\t// THEM-1809 - public user (clean only) also wants deep linking\n\t\t\tlocalStore.set(customConfig.POST_LOGIN_HASH_NAME, postLoginHash);\n\t\t\t// login as public user\n\t\t\tdispatcher.trigger('auth:user:login:confirmed');\n\t\t});\n\n\t\t/**\n\t\t * Valid session\n\t\t * @event modeule:auth#auth:session:valid\n\t\t */\n\t\tdispatcher.once('auth:session:valid', function () {\n\t\t\t// the expected route will occur at app start\n\t\t\tconst hash = window.location.hash;\n\t\t\tif (IGNORE_POST_LOGIN_ROUTES.includes(hash.replace(/^#/, ''))) {\n\t\t\t\tappRouter.navigate('', {trigger: false});\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * Invalid token\n\t\t * @event modeule:auth#auth:token:invalid\n\t\t */\n\t\tdispatcher.once('auth:token:invalid', function () {\n\t\t\t// Only for main app\n\t\t\tlocalStore.set(customConfig.POST_LOGIN_HASH_NAME, '');\n\t\t});\n\n\t\t/**\n\t\t * Valid token\n\t\t * @event modeule:auth#auth:token:valid\n\t\t */\n\t\tdispatcher.once('auth:token:valid', function () {\n\t\t\t// Only for main app\n\t\t\tlocalStore.set(customConfig.POST_LOGIN_HASH_NAME, '');\n\t\t});\n\n\t\t// User login\n\t\t/**\n\t\t * @route\n\t\t * @fires module:auth#auth:user:login\n\t\t */\n\t\tappRouter.on('route:auth:user:login', function () {\n\t\t\t// if using public user, allow login screen so you don't get stuck with it\n\t\t\tif (\n\t\t\t\t!(getPublicProperty('viewer.userLogin') === userProfile.get('login')) &&\n\t\t\t\tnxSession &&\n\t\t\t\tgetUserLevel() > 0\n\t\t\t) {\n\t\t\t\tappRouter.navigate('', {trigger: true});\n\t\t\t} else {\n\t\t\t\tdispatcher.trigger('auth:user:login', true);\n\t\t\t}\n\t\t});\n\t\t/**\n\t\t * @event module:user#user:login:show\n\t\t * @param {object} viewOptions View options\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:login:show',\n\t\t\tfunction (viewOptions) {\n\t\t\t\tappViews.add({\n\t\t\t\t\tviewClass: AuthUserLoginView,\n\t\t\t\t\tshowActions: ['auth:user:login:show'],\n\t\t\t\t\tviewOptions: viewOptions,\n\t\t\t\t});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\n\t\t/**\n\t\t * User login\n\t\t * @event module:auth#auth:user:login\n\t\t * @fires module:auth#auth:user:login:expired\n\t\t * @fires module:auth#auth:user:login:show\n\t\t */\n\t\tdispatcher.on('auth:user:login', function (isRouted) {\n\t\t\tif (nxSession.sessionExpired() && nxSession.get('loginMsg') === '') {\n\t\t\t\tdispatcher.trigger('auth:user:login:expired');\n\t\t\t}\n\n\t\t\t// Wait for app ready\n\t\t\twhenReady(function () {\n\t\t\t\t// Show login\n\t\t\t\tdispatcher.trigger('auth:user:login:show', {\n\t\t\t\t\tmodel: nxSession,\n\t\t\t\t\tcollection: nxSession.get('samlServices'),\n\t\t\t\t\tisRouted: isRouted,\n\t\t\t\t\trouteMatch: new RegExp(/^login/),\n\t\t\t\t});\n\t\t\t}, NS);\n\t\t});\n\n\t\t/**\n\t\t * @event module:auth#auth:user:login:confirmed\n\t\t * @param {object} values Form data\n\t\t * @fires module:auth#auth:user:login:error\n\t\t * @fires module:auth#auth:user:login:invalid\n\t\t * @fires module:auth#auth:user:login:success\n\t\t * @fires module:auth#auth:user:login:lockout\n\t\t */\n\t\tdispatcher.on('auth:user:login:confirmed', function (values) {\n\t\t\t// Does the NetX instance use the public user\n\t\t\tif (_.isUndefined(values) && !coreConfig.REQUIRE_LOGIN) {\n\t\t\t\t// Fake the login form object\n\t\t\t\tvalues = {\n\t\t\t\t\tpassword: null,\n\t\t\t\t\tusername: null,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Login\n\t\t\tuserProfile.userLogin(values).then(\n\t\t\t\tfunction (sessionKey) {\n\t\t\t\t\tif (sessionKey !== '-1') {\n\t\t\t\t\t\tnxSession.setCookie('sessionKey', sessionKey, 1);\n\t\t\t\t\t\tnxSession.setKey(sessionKey);\n\t\t\t\t\t\tdispatcher.trigger('auth:user:login:success');\n\t\t\t\t\t\t// Perform a hard refresh to trigger the browsers' password saving prompt HTML-9\n\t\t\t\t\t\twindow.location.reload(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdispatcher.trigger('auth:user:login:invalid');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction (err) {\n\t\t\t\t\tif (err.code === 3006) {\n\t\t\t\t\t\tdispatcher.trigger('auth:user:login:lockout');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t\t\t'auth:user:login:error',\n\t\t\t\t\t\t\tnew Error(i18n.t('i18n.loginErrorOccurred')),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\n\t\t/**\n\t\t * @event module:auth#auth:user:login:expired\n\t\t */\n\t\tdispatcher.on('auth:user:login:expired', function () {\n\t\t\tnxSession.set({\n\t\t\t\tloginMsg: i18n.t('i18n.youWereLoggedOut', {\n\t\t\t\t\tdefaultValue: 'Logged out due to inactivity',\n\t\t\t\t}),\n\t\t\t\tloginMsgClass: 'has-error',\n\t\t\t});\n\t\t});\n\t\t/**\n\t\t * @event module:auth#auth:user:login:lockout\n\t\t */\n\t\tdispatcher.on('auth:user:login:lockout', function () {\n\t\t\tnxSession.set({\n\t\t\t\tloginMsg: i18n.t('i18n.loginLockedOutMessage'),\n\t\t\t\tloginMsgClass: 'has-error',\n\t\t\t});\n\t\t});\n\n\t\t/**\n\t\t * @event module:auth#auth:user:login:invalid\n\t\t */\n\t\tdispatcher.on('auth:user:login:invalid', function () {\n\t\t\tnxSession.set({\n\t\t\t\tloginMsg: i18n.t('i18n.loginIncorrect'),\n\t\t\t\tloginMsgClass: 'has-error',\n\t\t\t});\n\t\t});\n\n\t\t/**\n\t\t * @event module:auth#auth:user:login:error\n\t\t * @param {string} error Error string\n\t\t * @fires module:app#app:alert\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:login:error',\n\t\t\tfunction (error) {\n\t\t\t\tdispatcher.trigger('app:alert', error, i18n.t('i18n.error'));\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\n\t\t// User logout\n\t\tappRouter.on('route:auth:user:logout', function () {\n\t\t\tdispatcher.trigger('auth:user:logout');\n\t\t});\n\t\t/**\n\t\t * @event module:auth#auth:user:logout:routed\n\t\t * @fires module:app#app:stop\n\t\t * @fires module:app#app:alert\n\t\t */\n\t\tdispatcher.on('auth:user:logout', function () {\n\t\t\tuserProfile.logout().then(\n\t\t\t\tfunction () {\n\t\t\t\t\t// DAM-9360 - old school logout page boolean property\n\t\t\t\t\tif (getPreference('user.logoutPage', true)) {\n\t\t\t\t\t\twindow.location.href = '/logout.html';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Router navigation needs to occur before 'app:stop' is triggered\n\t\t\t\t\t\tappRouter.navigate('');\n\t\t\t\t\t\t// Trigger application shutdown\n\t\t\t\t\t\tdispatcher.trigger('app:stop');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction (err) {\n\t\t\t\t\t// Session ended before we logged out?\n\t\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t\t'app:alert',\n\t\t\t\t\t\ti18n.t('i18n.sessionInvalid'),\n\t\t\t\t\t\t'Warning',\n\t\t\t\t\t);\n\t\t\t\t\t// Whatever the problem, log out anyway in 3 secs.\n\t\t\t\t\t_.delay(function () {\n\t\t\t\t\t\tappRouter.navigate('');\n\t\t\t\t\t\tdispatcher.trigger('app:stop');\n\t\t\t\t\t}, 3000);\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\n\t\t/**\n\t\t * SAML authentication\n\t\t * @event module:auth#auth:user:saml:navigate\n\t\t * @param {string} samlServiceName SAML service name\n\t\t */\n\t\tdispatcher.on('auth:user:saml:navigate', function (samlServiceName) {\n\t\t\t// navigate browser to saml endpoint\n\t\t\twindow.location.href = '/saml/' + samlServiceName;\n\t\t});\n\n\t\t// User registration\n\t\tappRouter.on('route:auth:user:register', function () {\n\t\t\tif ((nxSession && getUserLevel() > 0) || !canSelfRegister()) {\n\t\t\t\tappRouter.navigate('', {trigger: true});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdispatcher.trigger('auth:user:register');\n\t\t});\n\t\t/**\n\t\t * @event module:auth#auth:user:register:show\n\t\t * @param {object} viewOptions View options\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:register:show',\n\t\t\tfunction (viewOptions) {\n\t\t\t\timport(\n\t\t\t\t\t/* webpackChunkName: \"view-authUserRegister\" */ './views/authUserRegisterView'\n\t\t\t\t).then((View) => {\n\t\t\t\t\tappViews.add({\n\t\t\t\t\t\tviewClass: View.default,\n\t\t\t\t\t\tshowActions: ['auth:user:register:show'],\n\t\t\t\t\t\tviewOptions: viewOptions,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * Register routed\n\t\t * creates/shows register form\n\t\t * @event module:auth#auth:user:register\n\t\t * @todo DAM-8523\n\t\t */\n\t\tdispatcher.on('auth:user:register', function () {\n\t\t\t// Let the app know we are ready and wait for it to respond\n\t\t\twhenReady(function () {\n\t\t\t\tvar customForm = new CustomFormCollection([], {\n\t\t\t\t\tformName: 'register',\n\t\t\t\t});\n\n\t\t\t\tcustomForm.fetch().then(function () {\n\t\t\t\t\t// Show registration\n\t\t\t\t\tdispatcher.trigger('auth:user:register:show', {\n\t\t\t\t\t\tmodel: new UserProfileModel(),\n\t\t\t\t\t\tcollection: customForm,\n\t\t\t\t\t\teventStr: 'auth:user:register',\n\t\t\t\t\t\trequiresChanges: true,\n\t\t\t\t\t\trouteMatch: new RegExp(/^register/),\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}, NS);\n\t\t});\n\t\t/**\n\t\t * @event module:auth#auth:user:register:confirmed\n\t\t * @param {object} values Form values\n\t\t * @param {Netx.Models.UserProfile} model User progile model\n\t\t * @fires module:auth#auth:user:register:error\n\t\t * @fires module:auth#auth:user:register:failure\n\t\t * @fires module:auth#auth:user:register:success\n\t\t * @fires module:auth#auth:user:register:awaiting:approval\n\t\t */\n\t\tdispatcher.on('auth:user:register:confirmed', function (values, model) {\n\t\t\t// Get only the values pertinant to our model's attributes\n\t\t\t// var modelValues = _.pick.apply(\n\t\t\t// \tnull,\n\t\t\t// \t[values].concat(_.keys(model.attributes)),\n\t\t\t// );\n\n\t\t\t// set custom user data if any\n\t\t\tvar modelValues = model.setPropertyArrays(values);\n\n\t\t\t// Password has not changed\n\t\t\tif (\n\t\t\t\t!values.autogeneratePassword &&\n\t\t\t\t(modelValues.password1 === '********' ||\n\t\t\t\t\tmodelValues.password2 === '********')\n\t\t\t) {\n\t\t\t\tmodelValues = _.omit(modelValues, 'password1', 'password2');\n\t\t\t}\n\t\t\t// Autogenerate password (send empty strings to server)\n\t\t\telse if (values.autogeneratePassword) {\n\t\t\t\tmodelValues.password1 = modelValues.password2 = '';\n\t\t\t}\n\n\t\t\t// ON-1732 - use the email as username when system property set to true\n\t\t\tif (getPublicProperty('user.force_email_login', true)) {\n\t\t\t\tmodelValues.login = modelValues.email;\n\t\t\t}\n\n\t\t\tmodel.registerNewUser(modelValues).then(\n\t\t\t\tfunction (response) {\n\t\t\t\t\tswitch (model.get('registration')) {\n\t\t\t\t\t\tcase 'success':\n\t\t\t\t\t\t\t// Beware it is a string and not actually a boolean\n\t\t\t\t\t\t\tvar autoLoginStr = getPublicProperty(\n\t\t\t\t\t\t\t\t'user.self_registration_auto_login',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (autoLoginStr === 'true') {\n\t\t\t\t\t\t\t\t// Just log them in\n\t\t\t\t\t\t\t\t// get hash user navigated to app with, set without triggering, clean up\n\t\t\t\t\t\t\t\tappRouter.navigate(\n\t\t\t\t\t\t\t\t\tlocalStore.get(\n\t\t\t\t\t\t\t\t\t\tcustomConfig.POST_LOGIN_HASH_NAME ||\n\t\t\t\t\t\t\t\t\t\t\tcoreConfig.HOME_ROUTE ||\n\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{trigger: false},\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tlocalStore.set(customConfig.POST_LOGIN_HASH_NAME, '');\n\t\t\t\t\t\t\t\tnxSession.set({\n\t\t\t\t\t\t\t\t\tloginMsg: i18n.t('i18n.registrationSuccessful'),\n\t\t\t\t\t\t\t\t\tloginMsgClass: 'has-success',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t// Perform a hard refresh to begin a new session with the newly registered user\n\t\t\t\t\t\t\t\twindow.location.reload(true);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Registration request was successful\n\t\t\t\t\t\t\t\t// Must wait for administraive approval\n\t\t\t\t\t\t\t\tappRouter.navigate('register/approval-needed', {trigger: true});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdispatcher.trigger('auth:user:register:success', model, true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'failure':\n\t\t\t\t\t\t\tdispatcher.trigger('auth:user:register:failure');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'error':\n\t\t\t\t\t\t\tdispatcher.trigger('auth:user:register:error');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tfunction (err) {\n\t\t\t\t\tdispatcher.trigger('auth:user:register:error', err);\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\n\t\t/**\n\t\t * @event module:auth#auth:user:register:cancelled\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:register:cancelled',\n\t\t\tfunction () {\n\t\t\t\tappRouter.navigate('login', {trigger: true});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:register:success\n\t\t * @param {Netx.Models.UserProfile} model User progile model\n\t\t * @param {boolean} awaitingApproval Awaiting approval\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:register:success',\n\t\t\tfunction (model, awaitingApproval) {\n\t\t\t\t//\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:register:failure\n\t\t * @fires module:auth#auth:user:register:error\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:register:failure',\n\t\t\tfunction () {\n\t\t\t\tdispatcher.trigger('auth:user:register:error');\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:register:error\n\t\t * @fires module:app#app:alert\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:register:error',\n\t\t\tfunction () {\n\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t'app:alert',\n\t\t\t\t\ti18n.t('i18n.registrationError'),\n\t\t\t\t\ti18n.t('i18n.error'),\n\t\t\t\t);\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\n\t\t// User registration awaitng approval\n\t\tappRouter.on('route:auth:user:register:approvalNeeded', function () {\n\t\t\tdispatcher.trigger('auth:user:register:awaiting:approval', true);\n\t\t});\n\t\t/**\n\t\t * @event module:auth#auth:user:register:awaiting:approval:show\n\t\t * @param {object} viewOptions View options\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:register:awaiting:approval:show',\n\t\t\tfunction (viewOptions) {\n\t\t\t\timport(\n\t\t\t\t\t/* webpackChunkName: \"view-authUserAwaitingApproval\" */ './views/authUserAwaitingApprovalView'\n\t\t\t\t).then((View) => {\n\t\t\t\t\tappViews.add({\n\t\t\t\t\t\tviewClass: View.default,\n\t\t\t\t\t\tshowActions: ['auth:user:register:awaiting:approval:show'],\n\t\t\t\t\t\tviewOptions: viewOptions,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:register:awaiting:approval\n\t\t * @fires module:auth#auth:user:register:awaiting:approval:show\n\t\t */\n\t\tdispatcher.on('auth:user:register:awaiting:approval', function (isRouted) {\n\t\t\t// Show\n\t\t\tdispatcher.trigger('auth:user:register:awaiting:approval:show', {\n\t\t\t\tisRouted: isRouted,\n\t\t\t\trouteMatch: new RegExp(/^register\\/approval-needed/),\n\t\t\t});\n\t\t});\n\n\t\t// User password reset\n\t\tappRouter.on('route:auth:user:password:reset', function () {\n\t\t\tif (getUserLevel() > 0 || !canRequestPasswordReset()) {\n\t\t\t\tappRouter.navigate('', {trigger: true});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdispatcher.trigger('auth:user:password:request', true);\n\t\t});\n\t\t/**\n\t\t * @event module:auth#auth:user:password:request:show\n\t\t * @param {object} viewOptions View options\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:request:show',\n\t\t\tfunction (viewOptions) {\n\t\t\t\timport(\n\t\t\t\t\t/* webpackChunkName: \"view-authUserPassResetRequest\" */ './views/authUserPassResetRequestView'\n\t\t\t\t).then((View) => {\n\t\t\t\t\tappViews.add({\n\t\t\t\t\t\tviewClass: View.default,\n\t\t\t\t\t\tshowActions: ['auth:user:password:request:show'],\n\t\t\t\t\t\tviewOptions: viewOptions,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * Request reset password\n\t\t * @event module:auth#auth:user:password:request\n\t\t * @fires module:auth#auth:user:password:request:show\n\t\t */\n\t\tdispatcher.on('auth:user:password:request', function (isRouted) {\n\t\t\t// Let the app know we are ready and wait for it to respond\n\t\t\twhenReady(function () {\n\t\t\t\t// Show password reset request\n\t\t\t\tdispatcher.trigger('auth:user:password:request:show', {\n\t\t\t\t\tmodel: userProfile,\n\t\t\t\t\trequiresChanges: true,\n\t\t\t\t\tisRouted: isRouted,\n\t\t\t\t\trouteMatch: new RegExp(/^password-request/),\n\t\t\t\t});\n\t\t\t}, NS);\n\t\t});\n\t\t/**\n\t\t * Password reset request submitting\n\t\t * @event module:auth#auth:user:password:request:confirmed\n\t\t * @param {object} values From values\n\t\t * @param {Netx.Models.UserProfile} model User progile model\n\t\t * @fires module:auth#auth:user:password:request:error\n\t\t * @fires module:auth#auth:user:password:request:success\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:request:confirmed',\n\t\t\tfunction (values, model) {\n\t\t\t\tmodel.passwordRequest(values).then(\n\t\t\t\t\tfunction (response) {\n\t\t\t\t\t\tdispatcher.trigger('auth:user:password:request:success', model);\n\t\t\t\t\t},\n\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\tdispatcher.trigger('auth:user:password:request:error', err, model);\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t},\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:request:cancelled\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:request:cancelled',\n\t\t\tfunction () {\n\t\t\t\tappRouter.navigate('login', {trigger: true});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:request:success\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:request:success',\n\t\t\tfunction () {\n\t\t\t\t// override me\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:request:failure\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:request:failure',\n\t\t\tfunction () {\n\t\t\t\t// override me\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:request:error\n\t\t * @param {string} error Error string\n\t\t * @param {Netx.Models.UserProfile} model User progile model\n\t\t * @fires module:app#app:alert\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:request:error',\n\t\t\tfunction (error, model) {\n\t\t\t\tappRouter.navigate('#login', {trigger: true});\n\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t'app:alert',\n\t\t\t\t\ti18n.t('i18n.passwordResetRequestError'),\n\t\t\t\t\ti18n.t('i18n.error'),\n\t\t\t\t);\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\n\t\tappRouter.on('route:auth:user:password:change', function (login, token) {\n\t\t\tif (nxSession && getUserLevel() > 0) {\n\t\t\t\tappRouter.navigate('', {trigger: true});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdispatcher.trigger('auth:user:password:change', login, token, true);\n\t\t});\n\t\t/**\n\t\t * @event module:auth#auth:user:password:change:show\n\t\t * @param {object} viewOptions View options\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:change:show',\n\t\t\tfunction (viewOptions) {\n\t\t\t\timport(\n\t\t\t\t\t/* webpackChunkName: \"view-authUserPassReset\" */ './views/authUserPassResetView'\n\t\t\t\t).then((View) => {\n\t\t\t\t\tappViews.add({\n\t\t\t\t\t\tviewClass: View.default,\n\t\t\t\t\t\tshowActions: ['auth:user:password:change:show'],\n\t\t\t\t\t\tviewOptions: viewOptions,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:change\n\t\t * @param {string} login Login\n\t\t * @param {string} token Token\n\t\t * @fires module:auth#auth:user:password:change:show\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:change',\n\t\t\tfunction (login, token, isRouted) {\n\t\t\t\t// this is not for logged in users\n\t\t\t\tif (userProfile.id) {\n\t\t\t\t\tuserProfile.logout().then(function () {\n\t\t\t\t\t\twindow.location.reload(true);\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// this will find any strict password requirements\n\t\t\t\tuserProfile.decodeUserToken({login: login, token: token});\n\t\t\t\t// Let the app know we are ready and wait for it to respond\n\t\t\t\twhenReady(function () {\n\t\t\t\t\t// Show password change\n\t\t\t\t\tdispatcher.trigger('auth:user:password:change:show', {\n\t\t\t\t\t\tmodel: userProfile,\n\t\t\t\t\t\trequiresChanges: true,\n\t\t\t\t\t\tisRouted: isRouted,\n\t\t\t\t\t\trouteMatch: new RegExp(/^password-reset\\/(\\d+)\\/(\\s+)/),\n\t\t\t\t\t});\n\t\t\t\t}, NS);\n\t\t\t},\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:change:confirmed\n\t\t * @param {object} values From values\n\t\t * @param {Netx.Models.UserProfile} model User progile model\n\t\t * @fires module:auth#auth:user:password:change:error\n\t\t * @fires module:auth#auth:user:password:change:success\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:change:confirmed',\n\t\t\tfunction (values, model) {\n\t\t\t\tmodel.passwordChange(values).then(\n\t\t\t\t\tfunction (response) {\n\t\t\t\t\t\tif (response.resultBool) {\n\t\t\t\t\t\t\tdispatcher.trigger('auth:user:password:change:success', model);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// handled in authUserPassResetView\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tfunction (err) {\n\t\t\t\t\t\tdispatcher.trigger('auth:user:password:change:error', err, model);\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t},\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:change:cancelled\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:change:cancelled',\n\t\t\tfunction () {\n\t\t\t\tappRouter.navigate('login', {trigger: true});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:change:success\n\t\t * @fires module:app#app:alert\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:change:success',\n\t\t\tfunction () {\n\t\t\t\tdispatcher.trigger('app:alert', i18n.t('i18n.passwordChangedLogIn'));\n\t\t\t\tappRouter.navigate('login', {trigger: true});\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:change:failure\n\t\t * @fires module:app#app:alert\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'user:password:change:failure',\n\t\t\tfunction () {\n\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t'app:alert',\n\t\t\t\t\ti18n.t('i18n.passwordResetError'),\n\t\t\t\t\ti18n.t('i18n.error'),\n\t\t\t\t);\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\t\t/**\n\t\t * @event module:auth#auth:user:password:change:error\n\t\t * @fires module:app#app:alert\n\t\t */\n\t\tdispatcher.on(\n\t\t\t'auth:user:password:change:error',\n\t\t\tfunction (errOb) {\n\t\t\t\tvar errMsg = i18n.t('i18n.passwordResetError');\n\t\t\t\tif (errOb.message) {\n\t\t\t\t\terrMsg += ' ' + errOb.message;\n\t\t\t\t}\n\t\t\t\tdispatcher.trigger('app:alert', errMsg, i18n.t('i18n.error'));\n\t\t\t},\n\t\t\twindow,\n\t\t);\n\n\t\t/**\n\t\t * This route contains a session key; if we've come this far, it probably has already been parsed.\n\t\t * We should just redirect to the main app.\n\t\t */\n\t\tappRouter.on('route:auth:user:sessionKey', function (sessionKey) {\n\t\t\tif (session.getKey() != sessionKey) {\n\t\t\t\t// this should never happen:\n\t\t\t\tconsole.warn('session key mismatch in /session route!');\n\t\t\t\t//Netx.session.setKey(key); // can't hurt. shouldn't be necessary.\n\t\t\t} else {\n\t\t\t\tappRouter.reroute('', true);\n\t\t\t}\n\t\t});\n\n\t\t// DAM-6494:\n\t\t// Get the list of public API calls.\n\t\t// (We need this before we make any private API calls.)\n\t\t//\n\t\t// For now, the list is globally available as Netx.session.get('publicMethods').\n\t\tlogger.silly('bootstrapping...');\n\t\tnxSession.getPublicMethods().then(function () {\n\t\t\t// get saml services for login\n\t\t\tnxSession.getSamlServices().then(function () {\n\t\t\t\t// Wait for all boostrap loads to complete.\n\t\t\t\t$.when.apply($, NS.bootstrap).then(function () {\n\t\t\t\t\tdelete NS.bootstrap;\n\t\t\t\t\tlogger.silly('bootstrapped');\n\t\t\t\t\tdispatcher.trigger('auth:extend', NS);\n\t\t\t\t\tdispatcher.trigger('auth:initialized', NS);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n});\n\nexport default {\n\tinitialize(opts) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlogger.silly('initializing...');\n\t\t\tdispatcher.trigger('auth:init');\n\t\t\tdispatcher.once('auth:initialized', function () {\n\t\t\t\tlogger.silly('initialized');\n\t\t\t\tresolve(routes);\n\t\t\t});\n\t\t});\n\t},\n};\n","export {default} from 'netxcore@netx/core-auth/controller';\n\nimport {appRouter} from '@netx/core-next/router';\nimport {session} from '@netx/core-auth/collections/singleton/session';\n\n/**\n * @event module:auth#auth:extend\n * @param {object} NS Namespace object\n */\ndispatcher.once('auth:extend', function (NS) {\n\t/**\n\t * @event module:auth#auth:user:password:change:success\n\t * @override\n\t */\n\tdispatcher.off('auth:user:password:change:success');\n\tdispatcher.on('auth:user:password:change:success', function () {\n\t\tsession.set({loginMsg: 'Your password was changed. Please log in.'});\n\t\tappRouter.navigate('login', {trigger: true});\n\t});\n});\n","/**\n * Auth module\n */\n\nimport actions from './actions';\nimport menus from './menus';\nimport controller from './controller';\nimport {RegisterLegacyAction} from '@netx/core/legacyActionManager';\nimport {addMenus} from '@netx/core/legacyMenuManager';\n\n/**\n * @property {object} exports - Our module exports\n * @property {string} exports.namespace - Module namespace\n * @property {function} exports.initialize - Module initializer\n */\nexport default {\n\tnamespace: 'auth',\n\tinitialize() {\n\t\t// Register actions\n\t\tRegisterLegacyAction(actions);\n\t\t// Extend menus\n\t\taddMenus(menus);\n\n\t\treturn controller.initialize();\n\t},\n};\n","export default {\n\t/**\n\t * CSS id for cart container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tSAVED_CARTS_ID: 'cart-saved',\n\t/**\n\t * CSS id for cart list element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCART_GALLERY_ID: 'cart-assets',\n\t/**\n\t * CSS id for cart actions bar element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCART_ACTIONS_BAR: 'cart-actions-bar',\n\t/**\n\t * CSS id for cart list header element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCART_HEADER_ID: 'cart-header',\n\t/**\n\t * CSS id for saved cart header container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tSAVED_CART_HEADER_ID: 'saved-cart-header',\n\t/**\n\t * CSS id for saved cart assets container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tSAVED_CART_GALLERY_ID: 'saved-cart-assets',\n\n\t/**\n\t * CSS id for cart container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCHUNK_SIZE: 12,\n\t/**\n\t * CSS id for cart container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tPAGE_SIZE: 12,\n\t/**\n\t * When sharing cart permissions, allow ownership changes?\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tSHARE_SHOW_OWNER: true,\n\t/**\n\t * When sharing cart permissions, sync immediately on every change?\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tSHARE_SYNC_IMMEDIATE: false,\n\t/**\n\t * Route component for showing the contents a saved cart\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tROUTE_SAVED_CART: 'cart-assets',\n};\n","import Config from 'netxcore@netx/core-cart/config';\n\nObject.assign(Config, {\n\tSHARE_SYNC_IMMEDIATE: true,\n\t//SHARE_SHOW_OWNER: false\n});\n\nexport default Config;\n","/**\n * @class\n * @todo Document members and methods\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/category';\n\nimport customConfig from '../config';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\n\nexport default class CategoryTreeNodes extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/** @type {array} */\n\tget xhrExcludeProgress() {\n\t\treturn ['getCategoryAutoList'];\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tgetCategories: 'Loading categories',\n\t\t\tgetCategoryObjects: 'Loading categories',\n\t\t\tsetCategoryOrder: 'Updating category order',\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tgetCategories: 'Loading categories',\n\t\t\tgetCategoryObjects: 'Loaded categories',\n\t\t\tsetCategoryOrder: 'Updated category order',\n\t\t};\n\t}\n\n\t/**\n\t * Methods for this model\n\t * @type {object}\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tread: [\n\t\t\t\t'getCategories',\n\t\t\t\t'searchString',\n\t\t\t\tfunction () {\n\t\t\t\t\treturn customConfig.categoryid;\n\t\t\t\t},\n\t\t\t],\n\t\t\t_fetchChildren: ['getCategories', 'searchString', 'targetCategory'],\n\t\t\t_fetchCategory: ['getCategoryData', 'targetCategory'],\n\t\t\t_searchCategoryName: ['getCategoryAutoList', 'searchString', 1],\n\t\t\t_getCategoryObjects: ['getCategoryObjects', 'neededCats'],\n\t\t\t_setCategoryOrder() {\n\t\t\t\t// Order by 'order' and then pluck the category ids\n\t\t\t\t// Use compact as we may have had a `dummy` category in there (\"empty\")\n\t\t\t\t// TODO: look into the 'threaded' piece (we are currently passing false)\n\t\t\t\treturn [\n\t\t\t\t\t'setCategoryOrder',\n\t\t\t\t\t_.compact(_.pluck(_.sortBy(this.order, 'order'), 'categoryid')),\n\t\t\t\t\tthis.orderType,\n\t\t\t\t\tfalse,\n\t\t\t\t];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers._read - Parse results of fetch\n\t * @property {function} parsers._fetchChildren - Parse the result of fetch children\n\t * @property {function} parsers._fetchCategory - Parse the result of fetch category\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t// read parser is the parse() method below\n\t\t\t_fetchChildren(data) {\n\t\t\t\tdata = data || [];\n\t\t\t\t//return this.parseCats(data);\t// Backbone.RPC ignores return value of parsers, feh.\n\t\t\t\tthis.parseCats(data);\n\t\t\t\treturn;\n\t\t\t},\n\t\t\t_fetchCategory(data) {\n\t\t\t\tthis.parseCats([data]);\n\t\t\t\treturn;\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tparse(data) {\n\t\t// So we know to use a reset after parsing cats\n\t\t// triggering a reset now looses any client side data we may have had\n\t\tthis.resetCategories = true;\n\t\treturn this.parseCats(data);\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\t// DAM-4561: implement the lastest craze in category sorting:\n\t\t// https://confluence.netx.net/display/DEV/Category+Order+Management+Improvement?focusedCommentId=3703829#comment-3703829\n\t\tconst alphabetize = getPreference('category.keepListAlphabetical', true);\n\t\topts.comparator = opts.comparator || alphabetize ? 'name' : 'orderby';\n\n\t\t// https://stackoverflow.com/questions/37127083/can-two-files-have-each-other-as-dependencies-in-javascript-when-using-webpack\n\t\t//Model = require('../models/category');\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t// Set categoryid if provided\n\t\tthis.categoryid = opts.categoryid;\n\n\t\t/**\n\t\t * @type {array}\n\t\t * @default\n\t\t */\n\t\tthis.disabledCategories = opts.disabledCategories || [];\n\n\t\t/**\n\t\t * Will hold our desired category order for `setCategoryOrder`\n\t\t * @type {array}\n\t\t * @default\n\t\t */\n\t\tthis.order = opts.order || [];\n\n\t\t/**\n\t\t * @type {number}\n\t\t * @default\n\t\t * 0 = manual (provided order)\n\t\t * 1 = alphabetical asc (normal)\n\t\t * 2 = alphabetical desc (reverse)\n\t\t */\n\t\tthis.orderType = opts.orderType || 0;\n\n\t\t/**\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.searchString = opts.searchString || '';\n\n\t\t/**\n\t\t * Target category id\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.targetCategory = opts.targetCategory;\n\n\t\t// We reference this a lot\n\t\tvar topLevelId = customConfig.categoryid;\n\n\t\t// Debounced methods\n\t\tthis.updateTopLevelCategories = _.debounce(\n\t\t\tthis.updateTopLevelCategories,\n\t\t\t100,\n\t\t);\n\n\t\t// We are top level\n\t\t// We provide a top level collection and a filtered collection\n\t\tif (this.categoryid === topLevelId) {\n\t\t\t// Do not pass a categoryid to these collections - always know they are \"top level\" (flat)\n\t\t\t// if you pass a categoryid you will wind up in a maximum execution error\n\t\t\tthis.topLevelCategories = new this.constructor([]);\n\t\t\tthis.filteredCategories = new this.constructor([]);\n\t\t}\n\n\t\t// Children of a category have changed\n\t\tconst debouncedFetchTopLevel = _.debounce((id) => {\n\t\t\tthis.fetchChildren(this.categoryid, {duplicateQueryPolicy: 'abort'}).then(\n\t\t\t\tthis.updateTopLevelCategories,\n\t\t\t);\n\t\t}, 100);\n\n\t\t// Hey, listen!\n\t\tthis\n\t\t\t// On reset/sync we need to put back /update our top levels\n\t\t\t.listenTo(\n\t\t\t\tthis,\n\t\t\t\t'reset sync',\n\t\t\t\t_.debounce((collection) => {\n\t\t\t\t\t// Make sure this concerns us (sync could come from a model within)\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.topLevelCategories &&\n\t\t\t\t\t\tthis._listenId === collection._listenId\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.updateTopLevelCategories();\n\t\t\t\t\t}\n\t\t\t\t}, 100),\n\t\t\t)\n\t\t\t// WARNING:\n\t\t\t// Since these are dispatch listeners and not targeted solely at us - we can not debounce the listeners\n\t\t\t.listenTo(dispatcher, 'category:children:changed', (id) => {\n\t\t\t\t// Main tree\n\t\t\t\t// All other models/collections in relation to this tree should have references\n\t\t\t\t// to us and our models - if not then there is some flawed logic somehwere that\n\t\t\t\t// will need addressing.\n\t\t\t\t// Top level trees are the only responders\n\t\t\t\tif (this.categoryid === topLevelId) {\n\t\t\t\t\tid = parseInt(id);\n\t\t\t\t\t// Was a top level that changed\n\t\t\t\t\tif (id === this.categoryid) {\n\t\t\t\t\t\t// It gets too messy to not update the whole top level in this case\n\t\t\t\t\t\t// The category model itself should be responding to data changes\n\t\t\t\t\t\tdebouncedFetchTopLevel(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t// Category deleted\n\t\t\t.listenTo(dispatcher, 'category:delete:success', (model) => {\n\t\t\t\t// Regardless of where it was deleted from - it is gone - get it out of all collections\n\t\t\t\tthis.remove(model.id);\n\t\t\t})\n\t\t\t// Categories changed\n\t\t\t.listenTo(\n\t\t\t\tdispatcher,\n\t\t\t\t'category:edit:success',\n\t\t\t\t(model, isNew, changedParent) => {\n\t\t\t\t\t// Only top level responds to this\n\t\t\t\t\tif (model instanceof Model && this.categoryid === topLevelId) {\n\t\t\t\t\t\tmodel.set({\n\t\t\t\t\t\t\t// TODO: These are strings on a save\n\t\t\t\t\t\t\t// Need to handle in set and make sure they are enforced as ints\n\t\t\t\t\t\t\tcategoryid: parseInt(model.get('categoryid')),\n\t\t\t\t\t\t\tparentid: parseInt(model.get('parentid')),\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// New - add to our collection\n\t\t\t\t\t\tif (isNew) {\n\t\t\t\t\t\t\tthis.selectedCategory = model.id;\n\t\t\t\t\t\t\t// Clone it so that different trees do not start tracking open and closestuff\n\t\t\t\t\t\t\tthis.add(model.clone());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Top level edit\n\t\t\t\t\t\t// TODO: should we also be checking that the only ancestor matches Netx.category.options.categoryid?\n\t\t\t\t\t\t// If you have only one ancestor and its not the top level id - something is terribly wrong(?)\n\t\t\t\t\t\tvar ancestors = model.get('ancestors') || [];\n\t\t\t\t\t\tif (ancestors.length === 1 && ancestors[0] === topLevelId) {\n\t\t\t\t\t\t\tthis.updateTopLevelCategories();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t)\n\t\t\t// Simulate progress / syncing when moving a category (and its children)\n\t\t\t.listenTo(dispatcher, 'category:move:confirmed', () => {\n\t\t\t\t// Top level trees are the only responders\n\t\t\t\tif (this.categoryid === topLevelId) {\n\t\t\t\t\t// Mimic read\n\t\t\t\t\tthis.trigger('request:read', this, undefined, {});\n\t\t\t\t\tthis.listenToOnce(dispatcher, 'category:move:success', (cat) => {\n\t\t\t\t\t\tthis.stopListening(dispatcher, 'category:move:error');\n\t\t\t\t\t\t// Mimic sync\n\t\t\t\t\t\tthis.trigger('sync', this, cat, {});\n\t\t\t\t\t});\n\t\t\t\t\tthis.listenToOnce(dispatcher, 'category:move:error', (error) => {\n\t\t\t\t\t\tthis.stopListening(dispatcher, 'category:move:success');\n\t\t\t\t\t\t// This will trigger a fetch on us and get the sync event when done\n\t\t\t\t\t\tdispatcher.trigger('category:tree:refresh', this);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})\n\t\t\t// Close all categories in tree\n\t\t\t// category:tree:reset means 'close all nodes'\n\t\t\t// category:tree:close:all means the same thing\n\t\t\t.listenTo(\n\t\t\t\tdispatcher,\n\t\t\t\t'category:tree:reset category:tree:close:all',\n\t\t\t\t(tree) => {\n\t\t\t\t\t// Make sure we are the tree this was requested on\n\t\t\t\t\tif (tree._listenId === this._listenId) {\n\t\t\t\t\t\tthis.closeAll();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\t}\n\n\t/**\n\t * @method\n\t */\n\tclearSearch() {\n\t\tthis.searchString = '';\n\t}\n\n\t/**\n\t * @method\n\t * @param {Netx.Collections.CategoryTreeNodes} tree Category tree to clone from\n\t */\n\tcloneFrom(tree) {\n\t\tthis.reset(\n\t\t\ttree.map((cat) => {\n\t\t\t\treturn cat.clone(this);\n\t\t\t}),\n\t\t);\n\t\tthis.disabledCategories = [];\n\t\tthis.selectedCategory = null;\n\t}\n\n\t/** @method */\n\tcloseAll() {\n\t\t// Calls the method on each model in this collection\n\t\tthis.invoke('close', {recursive: true});\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} catid Category id\n\t * @param {object} opts Request options\n\t */\n\t// TODO: unwrap!\n\tfetchCategory(catid, opts = {}) {\n\t\t// See if we already have an instance of this category model\n\t\t// If so, run the fetch through it\n\t\tconst cat = this.get(catid);\n\t\tif (cat) {\n\t\t\treturn cat.fetch(_.extend({duplicateQueryPolicy: 'merge'}, opts));\n\t\t}\n\n\t\t// Set our target category id\n\t\tthis.targetCategory = catid;\n\n\t\t// Mimic read\n\t\t!opts.silent && this.trigger('request:read', this, null, opts);\n\n\t\t// Promise\n\t\treturn this._fetchCategory(\n\t\t\t_.extend({duplicateQueryPolicy: 'merge'}, opts),\n\t\t).then((response) => {\n\t\t\t// Unset target category\n\t\t\tthis.targetCategory = null;\n\t\t\t// Open if it was previously open\n\t\t\tconst cat = this.get(catid);\n\t\t\t// If cat was open, re-open\n\t\t\tcat && cat.get('children').length > 0 && cat.get('open') && cat.open();\n\t\t\t// Trigger sync if not silent\n\t\t\t!opts.silent && this.trigger('sync', this, response, opts);\n\n\t\t\treturn cat;\n\t\t});\n\t}\n\n\t/**\n\t * fetchChildren fetches all the child categories of the specified category.\n\t * @method\n\t * @param {number} catid Category id\n\t * @param {object} opts Request options\n\t * @fires module:category#category:fetchedChildren\n\t */\n\t// TODO: unwrap!\n\tfetchChildren(catid, opts = {}) {\n\t\tthis.targetCategory = catid;\n\n\t\tvar cat = this.get(catid);\n\t\tdispatcher.trigger('category:' + catid + ':fetchingChildren', this, opts);\n\n\t\t// Mimic read\n\t\t!opts.silent && cat && cat.trigger('request:read', cat, null, opts);\n\n\t\t// Promise\n\t\tconst p = this._fetchChildren(opts);\n\n\t\tp.then((response) => {\n\t\t\tdispatcher.trigger('category:' + catid + ':fetchedChildren');\n\t\t\tdispatcher.trigger('category:fetchedChildren', catid);\n\n\t\t\t// If cat was set to be open - open it (does not matter if it is already opened or not)\n\t\t\tcat = this.get(catid);\n\n\t\t\t!opts.silent && cat && cat.trigger('sync', cat, null, opts);\n\t\t});\n\n\t\treturn p;\n\t}\n\n\t/**\n\t * Find and return the selected category model\n\t * @method\n\t * @returns {object} category model\n\t */\n\tgetSelectedCategoryModel() {\n\t\tlet category;\n\t\t// DAM-15378 - if we are filtering, look in filteredCategories\n\t\tif (this.filteredCategories.length) {\n\t\t\tcategory = this.filteredCategories.get(this.selectedCategory);\n\t\t}\n\t\treturn category || this.get(this.selectedCategory);\n\t}\n\n\t/**\n\t * Take an array of objects, convert each into a Category model, and add them to our collection.\n\t * @method\n\t * @param {array} data Array of category data\n\t */\n\tparseCats(data) {\n\t\t// If empty - do a reset - otherwise we end up running through the add method a ton in childViews\n\t\t// and can not utilize the breakItUp method\n\t\tif (!this.length || this.resetCategories) {\n\t\t\tthis.reset(\n\t\t\t\t_.map(data, (c) => {\n\t\t\t\t\t// Make sure we maintain our childCategories and open references (both are client attributes and should not be affected by the return from the server)\n\t\t\t\t\treturn new this.model(c, {collection: this});\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\t// Just add\n\t\telse {\n\t\t\tthis.add(\n\t\t\t\t_.compact(\n\t\t\t\t\t_.map(data, (c) => {\n\t\t\t\t\t\t// Merge directly into any existing so that we may maintian the true reference and the attributes se ton the client side\n\t\t\t\t\t\tvar existing = this.get(c.categoryid);\n\t\t\t\t\t\tif (existing) {\n\t\t\t\t\t\t\texisting.set(c);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Make sure we maintain our childCategories and open references (both are client attributes and should not be affected by the return from the server)\n\t\t\t\t\t\t\treturn new this.model(\n\t\t\t\t\t\t\t\t_.extend({}, existing ? existing.attributes : {}, c),\n\t\t\t\t\t\t\t\t{collection: this},\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tsilent: true,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\t// Set to false as we are done - regardless\n\t\tthis.resetCategories = false;\n\n\t\treturn this.models;\n\t}\n\n\t/**\n\t * Take an array of objects, check if the category is already in Netx.category.tree, fetch any that are not,\n\t * convert each into a Category model, and add them to our collection.\n\t * @method\n\t * @param {array} data Array of category data\n\t * @param {object} opts Request options\n\t */\n\tparseSearchCats(data, opts) {\n\t\tconst promises = [];\n\t\tconst tree = Netx.category.tree;\n\t\tlet toAdd = [];\n\n\t\t// Loop over data and look for categories we will need to fetch from the server\n\t\tthis.neededCats = _.compact(\n\t\t\t_.map(data, (c) => {\n\t\t\t\tconst catId = parseInt(c.value);\n\t\t\t\tconst category = tree.get(catId);\n\t\t\t\t// Do not want the \"0\" category (more option)\n\t\t\t\tif (!isNaN(catId) && catId > 0) {\n\t\t\t\t\tif (!category || !category.attributes.length) {\n\t\t\t\t\t\treturn c.value;\n\t\t\t\t\t}\n\t\t\t\t\ttoAdd.push(category);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\n\t\t// Need to fetch some needed categories\n\t\tif (this.neededCats.length) {\n\t\t\tpromises.push(\n\t\t\t\tthis._getCategoryObjects({...opts, duplicateQueryPolicy: 'abort'}).then(\n\t\t\t\t\t(response) => {\n\t\t\t\t\t\t// Turn response into an array of category models and concat them onto the categories we already had\n\t\t\t\t\t\ttoAdd = toAdd.concat(\n\t\t\t\t\t\t\tresponse.map((c) => new Model({...c, collection: this})),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// We are already updating the `main` tree - don't do it twice\n\t\t\t\t\t\tif (this._listenId !== tree._listenId) {\n\t\t\t\t\t\t\tthis.reset(toAdd);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Update `main` tree\n\t\t\t\t\t\t// tree.add( toAdd, { silent: true } );\n\t\t\t\t\t\tthis.neededCats = null;\n\t\t\t\t\t\treturn response;\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\t// We have everything we need\n\t\telse {\n\t\t\tthis.reset(toAdd);\n\t\t}\n\n\t\treturn $.when.apply($, promises);\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} str Category name to search\n\t * @param {object} opts Request options\n\t */\n\t// TODO: unwrap!\n\tsearchCategoryName(str, opts = {}) {\n\t\tthis.searchString = str;\n\n\t\t// Run through our filtered collection - that is what it is for\n\t\tif (this.filteredCategories) {\n\t\t\treturn this.filteredCategories.searchCategoryName(str, opts);\n\t\t}\n\n\t\tthis.reset();\n\n\t\tif (!opts.silent) {\n\t\t\tthis.trigger('request:read', this, null, opts);\n\t\t}\n\t\treturn this._searchCategoryName(opts).then((response) => {\n\t\t\treturn this.parseSearchCats(response, opts).then((_response) => {\n\t\t\t\t!opts.silent && this.trigger('sync', this, _response, opts);\n\t\t\t\treturn _response;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} cats Array of categories in the order desired\n\t * @param {object} opts Request options\n\t */\n\t// TODO: unwrap!\n\tsetCategoryOrder(cats, opts) {\n\t\tthis.order = _.map(cats, (catid, idx) => {\n\t\t\treturn {categoryid: catid, order: idx};\n\t\t});\n\t\treturn this._setCategoryOrder(opts).then(() => {\n\t\t\t// Update category models\n\t\t\t_.each(this.order, (orderObj) => {\n\t\t\t\tconst cat = this.get(orderObj.categoryid);\n\t\t\t\tcat && cat.set('orderby', orderObj.order);\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Order in which to display the returned categories\n\t * 0 = manual (provided order);\n\t * 1 = alphabetical asc (normal);\n\t * 2 = alphabetical desc (reverse);\n\t * @method\n\t * @param {integer} type 0,1,2\n\t */\n\tsetCategoryOrderType(type) {\n\t\tthis.orderType = type;\n\t\treturn this.orderType;\n\t}\n\n\t/**\n\t * @method\n\t */\n\tupdateTopLevelCategories() {\n\t\tconst topLevelCategories = this.topLevelCategories;\n\t\ttopLevelCategories.reset(this.where({parentid: customConfig.categoryid}));\n\t\ttopLevelCategories.each((model) => {\n\t\t\tconst category = this.get(model.id);\n\t\t\tif (!category) return;\n\t\t\t// If we were open - re-open\n\t\t\t// Run through the controller instead of the model\n\t\t\tcategory.get('open') &&\n\t\t\t\tdispatcher.trigger('category:tree:open', model, this);\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'CategoryTreeNodes';\n\t}\n}\n","/**\n * @class\n */\nimport Base from 'netxcore@netx/core-category/collections/categoryTreeNodes';\n\nexport default class CategoryTreeNodes extends Base {\n\t/**\n\t * Do not return top level - 1 or \"the more option\"\n\t * @override\n\t */\n\tparseSearchCats(data) {\n\t\tdata = _.filter(data, (d) => d.value && d.value != 1);\n\t\treturn super.parseSearchCats(data);\n\t}\n}\n","export default {\n\t/**\n\t * CSS class used for active category\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tACTIVE_CLASS: 'active',\n\t/**\n\t * Is the CategoryAssets class extended from the MiniAssets class (instead of the Assets class)?\n\t * @const\n\t * @type {boolean}\n\t * @default\n\t */\n\tASSETS_MINI: false,\n\t/**\n\t * CSS class used for open tree nodes\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tTREE_NODE_OPEN_CLASS: 'open',\n\t/**\n\t * CSS class used for closed tree nodes\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tTREE_NODE_CLOSED_CLASS: 'closed',\n\t/**\n\t * CSS id used for the container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tTREE_ID: 'category-tree',\n\t/**\n\t * CSS id used for the category layer header\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCATEGORY_HEADER_ID: 'category-header',\n\t/**\n\t * CSS id used for the category list container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCATEGORY_LIST_ID: 'category-list',\n\t/**\n\t * CSS id used for the category asset list container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tASSET_LIST_ID: 'category-assets',\n\t/**\n\t * Should the asset list employ faceted search?\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tASSET_LIST_FACETED: false,\n\t/**\n\t * CSS id used for the breadcrumb container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tBREADCRUMB_ID: 'breadcrumb',\n\t/**\n\t * CSS id used for the category detail container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCATEGORY_DETAIL_ID: 'category',\n\t/**\n\t * CSS id of the category container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCONTAINER_ID: 'categories',\n\t/**\n\t * CSS id for the category edit container element\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tCATEGORY_EDIT_ID: 'category-edit',\n\t/**\n\t * Should we allow drag actions on categories?\n\t * @const\n\t * @type {boolean}\n\t * @default\n\t */\n\tDRAGGABLE: true,\n\t/**\n\t * Category edit view display type\n\t * @const\n\t * @type {boolean}\n\t * @default\n\t */\n\tMODAL: true,\n\t/**\n\t * Default category id\n\t * @const\n\t * @type {number}\n\t * @default\n\t */\n\tcategoryid: 1,\n\t/**\n\t * Allows categories to be only displayed in the tree or both the tree and gallery\n\t * @const\n\t * @type {boolean}\n\t * @default\n\t */\n\tdisplayCategoriesAsAssets: true,\n\t/**\n\t * Default repository directory path\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\trepositorydirectory: '/',\n\t/**\n\t * Turns the category tree on or off\n\t * @const\n\t * @type {boolean}\n\t * @default\n\t */\n\ttree: true,\n\t/**\n\t * Sets the maximum depth to display in the category tree\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tTREE_MAX_DEPTH: null, // How many layers deep should we display?\n};\n","import Config from 'netxcore@netx/core-category/config';\n\nObject.assign(Config, {\n\t//ASSET_LIST_FACETED: true,\n\tMODAL: true, // the category editor window can be modal or full-screen\n\t/*\n\t * TREE_MAX_DEPTH: 1\n\t * tree: true,\n\t * displayCategoriesAsAssets: true\n\t * categoryid: 9\n\t */\n});\n\nexport default Config;\n","export default [\n\t/** @action */\n\t{\n\t\tevent: 'notification:remove',\n\t\tlabel: i18n.t('i18n.remove'),\n\t\twrapper(view, e) {\n\t\t\treturn [view.model];\n\t\t},\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'notifications',\n\t\tlabel: i18n.t('i18n.viewNotifications'),\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'notifications:route',\n\t\tlabel: i18n.t('i18n.viewNotifications'),\n\t\troute: 'notifications',\n\t},\n\t/** @action */\n\t{\n\t\tevent: 'notifications:routed',\n\t\tlabel: i18n.t('i18n.notifications'),\n\t},\n];\n","import actions from 'netxcore@netx/core-notification/actions';\n\nimport {icon} from '@fortawesome/fontawesome-svg-core';\nimport {faComment} from '@fortawesome/pro-regular-svg-icons';\n\nimport {extendBackboneActions} from '@netx/core/utils/extendBackboneActions';\n\nconst iconOpts = {classes: ['fa-fw']};\nconst icons = {\n\tfaComment: icon(faComment, iconOpts).html,\n};\n\n// Extend actions defined in core file\nlet newActions = extendBackboneActions(actions, [\n\t{\n\t\tevent: 'notifications:routed',\n\t\ticon: icons.faComment,\n\t\troute: 'notifications',\n\t},\n]);\n\nexport default newActions;\n","import Menu from '@netx/core/lib/netx-menu';\n\nexport default {};\n","export default {\n\t/**\n\t * notification route. (Lowercased.) Keep routes simple; they should just fire events handled elsewhere.\n\t * @route\n\t */\n\tnotifications() {\n\t\tdispatcher.trigger('notifications:routed');\n\t},\n};\n","/**\n * Notification module\n *\n * @module notification\n */\nimport {appRouter} from '@netx/core-next/router';\nimport {appViews} from '@netx/core-app/singletons/appViews';\nimport NotificationModel from './models/notification';\nimport {notifications} from './singletons/notification';\nimport {getPrefixedLogger} from '@netx/core-next/utils/logger';\n\nconst logger = getPrefixedLogger('notification');\n\nimport routes from './routes';\n\n// MODULE INITIALIZATION\n// =====================\n// All collection and model instances and event listeners\n// are created when the module is initialized.\n\n/**\n * Init handler\n * @event {@link module:imageEditor#imageEditor:init|imageEditor:init}\n * @param {object} options Normally undefined, but a manual init trigger may override properties of Netx.custom.imageEditor here.\n */\ndispatcher.once('notification:init', function () {\n\t// PUBLIC MODELS & COLLECTIONS\n\t// ===========================\n\t// Object initializations, etc, go here.\n\n\t// BEGIN DISPATCHER EVENT LISTENERS\n\t// ================================\n\t// All other module event listeners are added here, inside the init handler.\n\n\t/**\n\t * @event module:notification#notifications\n\t */\n\tdispatcher.on('notifications', function () {\n\t\tappRouter.navigate('notifications', {trigger: true});\n\t});\n\n\t/**\n\t * @event module:notification#notifications:show\n\t * @param {object} viewOptions View options\n\t */\n\tdispatcher.on('notifications:show', function (viewOptions) {\n\t\timport(\n\t\t\t/* webpackChunkName: \"view-notificationList\" */ './views/notificationListView'\n\t\t).then((View) => {\n\t\t\tappViews.add({\n\t\t\t\tviewClass: View.default,\n\t\t\t\tshowActions: ['notifications:show'],\n\t\t\t\tviewOptions: viewOptions,\n\t\t\t});\n\t\t});\n\t});\n\n\t/**\n\t * @event module:notification#notifications:routed\n\t * @fires module:notification#notifications:show\n\t */\n\tdispatcher.on('notifications:routed', function () {\n\t\t// Show\n\t\tdispatcher.trigger('notifications:show', {\n\t\t\tcollection: notifications,\n\t\t});\n\t});\n\n\t/**\n\t * @event module:notification#notification\n\t * @param {object} options Notification options\n\t */\n\tdispatcher.on('notification', function (attributes, options) {\n\t\tconst model = new NotificationModel(attributes, {\n\t\t\tstoreOptions: options,\n\t\t});\n\t\t// Give the notification model a chance to deal with initialization completely\n\t\t_.defer(function () {\n\t\t\tnotifications.add(model);\n\t\t});\n\t});\n\t/**\n\t * @event module:notification#notification:remove\n\t * @param {Netx.Models.Notification} model Notification model\n\t */\n\tdispatcher.on('notification:remove', function (model) {\n\t\tnotifications.remove(model);\n\t});\n\n\t// END DISPATCHER EVENT LISTENERS\n\n\t// LAST STEPS:\n\t// non-core extensions may listen on this event to hook into the init process:\n\tdispatcher.trigger('notification:extend');\n\t// Tell the module loader we're initialized.\n\tdispatcher.trigger('notification:initialized');\n});\n\nexport default {\n\tinitialize(opts) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tdispatcher.once('notification:initialized', () => {\n\t\t\t\tresolve(routes);\n\t\t\t});\n\t\t\tdispatcher.trigger('notification:init');\n\t\t});\n\t},\n};\n","/**\n * Notification module\n */\n\nimport actions from './actions';\nimport menus from './menus';\nimport controller from './controller';\nimport {RegisterLegacyAction} from '@netx/core/legacyActionManager';\nimport {addMenus} from '@netx/core/legacyMenuManager';\n\n/**\n * @property {object} exports - Our module exports\n * @property {string} exports.namespace - Module namespace\n * @property {function} exports.initialize - Module initializer\n */\nexport default {\n\tnamespace: 'notification',\n\tinitialize() {\n\t\t// Register actions\n\t\tRegisterLegacyAction(actions);\n\t\t// Extend menus\n\t\taddMenus(menus);\n\n\t\treturn controller.initialize();\n\t},\n};\n","import {appRouter} from '@netx/core-next/router';\nimport {favoriteSavedCarts} from '@netx/core-cart/collections/singleton/savedCart';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport {\n\tcurrentUserMeetsUserLevel,\n\tUserLevel,\n} from '@netx/core-user/utils/currentUserMeetsUserLevel';\nimport {dispatcher} from '@netx/core-next/dispatcher';\n\n//////////////////////////\n// Underscore mixins\n//////////////////////////\n_.mixin({\n\toverrideDefaultIcon(path, override) {\n\t\tif (!path || (!path.includes('icons/') && !override)) return '';\n\t\treturn (\n\t\t\t'custom-icon-' +\n\t\t\t_.toCamelCase(path.replace(/^\\S+icons\\//, '').replace(/\\.\\S+$/, ''))\n\t\t);\n\t},\n});\n//////////////////////////\n// !Underscore mixins\n//////////////////////////\n\n//////////////////////////\n// Event Listeners\n//////////////////////////\n// /**\n// * A catch all listener\n// * @event all\n// */\n// dispatcher.on('all', function(eventName) {\n// \tconsole.debug('>>EVENT ' + eventName);\n// } );\n\n// Sidebar tab custom events\n\n/** @event module:nx#nx:home */\ndispatcher.on('nx:home', function () {\n\tappRouter.home();\n});\n\ndispatcher.on('nx:collections', function () {\n\tfavoriteSavedCarts.fetch();\n});\n\n/** @event module:nx#nx:notifications */\ndispatcher.on('nx:notifications', function () {\n\tappRouter.navigate('notifications', {trigger: true});\n});\n\n//////////////////////////\n// !Event Listeners\n//////////////////////////\n\n/**\n * @event netx:app:modules\n * @fires module:netx#netx:load:module\n * @fires module:app#app:ready\n */\ndispatcher.once('netx:app:modules', () => {\n\t// This is the pattern for defining all modules that must load as part of your app\n\t// after the user is validated\n\t// Keep in mind we still have some global variable tangles and some modules have\n\t// to be defined before others\n\tPromise.all([\n\t\timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-cart'),\n\t\timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-category'),\n\t\timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-dashboard'),\n\t\timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-grid'),\n\t\timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-public-link'),\n\t\timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-share'),\n\t\timport(/* webpackChunkName: \"post-login-app\" */ '@netx/core-user'),\n\t]).then((modules) => {\n\t\tdispatcher.trigger(\n\t\t\t'netx:load:module',\n\t\t\tmodules.map((m) => m.default),\n\t\t\t{\n\t\t\t\tinitialized() {\n\t\t\t\t\t// Load any modules that are conditional (and cannot be deferred for later)\n\t\t\t\t\tconst promises = [];\n\n\t\t\t\t\tif (getPreference('review.enabled', true)) {\n\t\t\t\t\t\tpromises.push(\n\t\t\t\t\t\t\tnew Promise((resolve, reject) => {\n\t\t\t\t\t\t\t\timport(\n\t\t\t\t\t\t\t\t\t/* webpackChunkName: \"project\" */ '@netx/core-project'\n\t\t\t\t\t\t\t\t).then((Project) => {\n\t\t\t\t\t\t\t\t\tdispatcher.trigger('netx:load:module', Project.default, {\n\t\t\t\t\t\t\t\t\t\tinitialized: resolve,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Consumers or above (bulk selection uploader)\n\t\t\t\t\tif (currentUserMeetsUserLevel(UserLevel.CONSUMER)) {\n\t\t\t\t\t\tpromises.push(\n\t\t\t\t\t\t\tnew Promise((resolve, reject) => {\n\t\t\t\t\t\t\t\timport(\n\t\t\t\t\t\t\t\t\t/* webpackChunkName: \"upload\" */ '@netx/core-upload'\n\t\t\t\t\t\t\t\t).then((Upload) => {\n\t\t\t\t\t\t\t\t\tdispatcher.trigger('netx:load:module', Upload.default, {\n\t\t\t\t\t\t\t\t\t\tinitialized: resolve,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Always dispatch `app:ready` when done\n\t\t\t\t\tPromise.all(promises).then(() => {\n\t\t\t\t\t\tdispatcher.trigger('app:ready', true);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t});\n});\n\n//////////////////////////\n// NetX Ready\n//////////////////////////\n/**\n * Custom events and functions should be utilized within the \"ready\" event\n * @event module:app#app:ready\n */\ndispatcher.once('app:ready', function () {\n\t/**\n\t * Build UI\n\t *\n\t * This is the entry point for building your application UI.\n\t * Place all custom code below this comment block.\n\t */\n\t// Custom Code Here\n});\n//////////////////////////\n// !NetX Ready\n//////////////////////////\n","const NAME = 'materialCheckboxes';\n\nimport './css/materialCheckboxes.less';\n\nimport {MDCFormField} from '@material/form-field';\nimport {MDCCheckbox} from '@material/checkbox';\nimport {purgeEls} from '@netx/core/utils/purgeEls';\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tlet materialCheckboxes = [];\n\n\t\tconst cleanUp = () => {\n\t\t\t_.invoke(materialCheckboxes, 'destroy');\n\t\t\tmaterialCheckboxes = [];\n\t\t};\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', cleanUp)\n\t\t\t.on('removeHook', cleanUp)\n\t\t\t.on('postRenderHook', () => {\n\t\t\t\tpurgeEls(\n\t\t\t\t\t[...instance.el.querySelectorAll('.mdc-form-field')],\n\t\t\t\t\tinstance.getExcludedViews(),\n\t\t\t\t).forEach((field) => {\n\t\t\t\t\tconst checkboxEl = field.querySelector('.mdc-checkbox');\n\t\t\t\t\tif (!checkboxEl) return;\n\n\t\t\t\t\tconst checkbox = new MDCCheckbox(checkboxEl);\n\t\t\t\t\tmaterialCheckboxes.push(checkbox);\n\n\t\t\t\t\tconst formField = new MDCFormField(field);\n\t\t\t\t\tformField.input = checkbox;\n\t\t\t\t\tmaterialCheckboxes.push(formField);\n\t\t\t\t});\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","const NAME = 'materialMenus';\n\nimport {MDCMenu} from '@material/menu';\nimport {MDCRipple} from '@material/ripple';\nimport {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation';\nimport purgeEls from '@netx/core/utils/purgeEls';\nimport simulateClickBody from '@netx/core/utils/simulateClickBody';\n\nimport {arrowNavigationPatch} from './patches/mdc-list';\n\nclass Menu {\n\t/**\n\t * @method\n\t */\n\tconstructor(anchorEl, view, opts = {}) {\n\t\tthis.anchorEl = anchorEl;\n\t\tthis.view = view;\n\n\t\tconst el = (this.el = anchorEl.querySelector('.mdc-menu-surface'));\n\t\tconst dropdownToggle = (this.dropdownToggle =\n\t\t\tel.parentElement.querySelector('.menu-button, .dropdown-toggle'));\n\n\t\tthis.hoist =\n\t\t\topts.hoist === true || el.classList.contains('mdc-menu--hoist');\n\t\tthis.horizontal =\n\t\t\topts.horizontal === true || el.classList.contains('mdc-menu--horizontal');\n\t\tthis.destroyOnClose = opts.destroyOnClose === true;\n\n\t\tel.addEventListener(\n\t\t\t'MDCMenuSurface:closed',\n\t\t\t(this.onClosed = this.closed.bind(this)),\n\t\t);\n\t\tel.addEventListener(\n\t\t\t'MDCMenuSurface:opened',\n\t\t\t(this.onOpen = this.opened.bind(this)),\n\t\t);\n\t\tel.addEventListener(\n\t\t\t'MDCList:action',\n\t\t\t(this.onAction = this.itemSelected.bind(this)),\n\t\t);\n\n\t\t// For our \"special\" menus that have dropdown in them\n\t\t// we need to not do this but until the facets refactor to the sidebar\n\t\t// we need this\n\t\t$(el)\n\t\t\t.on('shown.bs.dropdown', () => {\n\t\t\t\tthis.recalculatePosition();\n\t\t\t})\n\t\t\t.on('hidden.bs.dropdown', () => {\n\t\t\t\tthis.recalculatePosition();\n\t\t\t});\n\n\t\tel.addEventListener('click', (this.onClick = this.clicked.bind(this)));\n\t\tel.addEventListener('touchstart', (this.onTap = this.clicked.bind(this)));\n\t\tif (dropdownToggle) {\n\t\t\t// If in an mdc-list-item the ripple gets double applied\n\t\t\tif (!dropdownToggle.closest('.mdc-list-item__meta')) {\n\t\t\t\tthis.ripple = new MDCRipple(dropdownToggle);\n\t\t\t\tthis.ripple.unbounded = true;\n\t\t\t}\n\n\t\t\tdropdownToggle.addEventListener(\n\t\t\t\t'click',\n\t\t\t\t(this.onToggleClick = this.toggleClicked.bind(this)),\n\t\t\t);\n\t\t\tdropdownToggle.addEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\t(this.onToggleTap = this.toggleClicked.bind(this)),\n\t\t\t);\n\t\t}\n\n\t\tif (!this.hoist) {\n\t\t\tthis.menu = this.createMenu(el); //new MDCMenu(el);\n\t\t}\n\n\t\tthis._open = false;\n\n\t\tif (\n\t\t\topts.autoOpen === true ||\n\t\t\tel.classList.contains('mdc-menu-surface--auto-open')\n\t\t) {\n\t\t\tthis.open();\n\t\t}\n\t}\n\n\t/** @method */\n\tcleanUp() {\n\t\tif (this.backdrop) {\n\t\t\tdocument.body.removeChild(this.backdrop);\n\t\t\tdelete this.backdrop;\n\t\t}\n\n\t\tconst menu = this.menu;\n\t\tif (!menu) return;\n\n\t\t// Put the element back - would be nice if the mdc-menu-surface did this\n\t\t// maybe they do and i missed it (like a config or whatever)\n\t\tif (this.hoist && menu.menuSurface_.foundation_.isHoistedElement_) {\n\t\t\tthis.anchorEl.appendChild(menu.root_.parentNode.removeChild(menu.root_));\n\t\t}\n\n\t\tmenu.destroy();\n\t\tdelete this.menu;\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e `click` event\n\t */\n\tclicked(e) {\n\t\t// When we click on an action our event listeners in core fire\n\t\t// but mdc list items (which live in mdc menus) can be triggered\n\t\t// by `space`, `enter` and `click`\n\t\t// So, when a click occurs we do not want to fire the action off in\n\t\t// here as to not have it fire twice\n\t\t// When we rework our actions we should keep this in mind\n\t\tif (e.target.classList.contains('nx-action')) {\n\t\t\tthis._ignoreItemSelection = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis._ignoreItemSelection = false;\n\t\t\t}, 20);\n\t\t}\n\t}\n\n\t/** @method */\n\tclose() {\n\t\tconst menu = this.menu;\n\t\tif (!menu || !menu.open) return;\n\n\t\tmenu.open = false;\n\t}\n\n\t/** @method */\n\tclosed() {\n\t\tif (!this._open) return;\n\t\tthis._open = false;\n\t\tthis.anchorEl.classList.remove('open');\n\n\t\tif (this.view.onMenuClose) {\n\t\t\tthis.view.onMenuClose(this.menu);\n\t\t}\n\n\t\tif (this.destroyOnClose) {\n\t\t\tthis.destroy();\n\t\t} else if (this.hoist) {\n\t\t\tthis.cleanUp();\n\t\t}\n\t}\n\n\t/** @method */\n\tcreateMenu() {\n\t\tconst menu = (this.menu = new MDCMenu(this.el));\n\t\tarrowNavigationPatch(menu.list_);\n\n\t\t// DAM-15440 - if the menu is open when the view re-renders,\n\t\t// the menu will not reopen, because this.menu.open remains falsely true\n\t\tmenu.open = false;\n\n\t\tif (this.horizontal) {\n\t\t\tmenu.list_.foundation_.setVerticalOrientation(false);\n\t\t}\n\n\t\t// Need to look into mdc's pull request\n\t\t// HACK\n\t\t// Support mobile \"tap\"\n\t\tmenu.menuSurface_.handleBodyTap_ = (evt) => {\n\t\t\treturn menu.menuSurface_.foundation_.handleBodyClick(evt);\n\t\t};\n\t\tmenu.menuSurface_.registerBodyTapListener_ = () => {\n\t\t\treturn document.body.addEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\tmenu.menuSurface_.handleBodyTap_,\n\t\t\t);\n\t\t};\n\t\tmenu.menuSurface_.deregisterBodyTapListener_ = function () {\n\t\t\treturn document.body.removeEventListener(\n\t\t\t\t'touchstart',\n\t\t\t\tmenu.menuSurface_.handleBodyTap_,\n\t\t\t);\n\t\t};\n\t\tmenu.menuSurface_.listen(\n\t\t\tMDCMenuSurfaceFoundation.strings.OPENED_EVENT,\n\t\t\tmenu.menuSurface_.registerBodyTapListener_,\n\t\t);\n\t\tmenu.menuSurface_.listen(\n\t\t\tMDCMenuSurfaceFoundation.strings.CLOSED_EVENT,\n\t\t\tmenu.menuSurface_.deregisterBodyTapListener_,\n\t\t);\n\n\t\t// menu-surface/foundation is not checking if the menu is even open. So, it will\n\t\t// will add the `mdc-menu-surface--open` modifier class and immediately remove it\n\t\t// (as the menu animation does not need to occur), which makes the menu toggle light up\n\t\t// We use thae `mdc-menu-surface--open` to display that a menu toggle is active\n\t\tmenu.menuSurface_.foundation_.close = _.wrap(\n\t\t\tmenu.menuSurface_.foundation_.close,\n\t\t\t(close) => {\n\t\t\t\tif (!menu.open) return;\n\n\t\t\t\t// On mobile we wind up clicking on any element that is behind the menu\n\t\t\t\t// in that click position - do not allow any interactive clicks for 300ms\n\t\t\t\tthis.reEnableTouchEventsTimeout &&\n\t\t\t\t\tclearTimeout(this.reEnableTouchEventsTimeout);\n\t\t\t\tdocument.body.style['pointer-events'] = 'none';\n\n\t\t\t\tthis.reEnableTouchEventsTimeout = setTimeout(() => {\n\t\t\t\t\tdocument.body.style['pointer-events'] = '';\n\t\t\t\t}, 300);\n\n\t\t\t\tclose.call(menu.menuSurface_.foundation_);\n\t\t\t},\n\t\t);\n\n\t\treturn menu;\n\t}\n\n\t/** @method */\n\tdestroy() {\n\t\tif (this.dropdownToggle) {\n\t\t\tthis.dropdownToggle.removeEventListener('click', this.onToggleClick);\n\t\t\tthis.dropdownToggle.removeEventListener('touchstart', this.onToggleTap);\n\t\t\tdelete this.dropdownToggle;\n\t\t}\n\n\t\tthis.cleanUp();\n\t\tdelete this.menu;\n\n\t\tthis.ripple && this.ripple.destroy();\n\n\t\tconst el = this.el;\n\t\tel.removeEventListener('click', this.onClick);\n\t\tel.removeEventListener('touchstart', this.onTap);\n\t\tel.removeEventListener('MDCList:action', this.onAction);\n\t\tel.removeEventListener('MDCMenuSurface:closed', this.onClosed);\n\t\tel.removeEventListener('MDCMenuSurface:opened', this.onOpen);\n\t\t$(el).off('.bs.dropdown');\n\n\t\tdelete this.anchorEl;\n\t\tdelete this.el;\n\t\tdelete this.view;\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e `MDCList:action` event\n\t */\n\titemSelected(e) {\n\t\t// Defer because our `click` event comes immediately after `MDCList:action`\n\t\t// we want to know if it was via a `click` or other (`space`, `enter`)\n\t\t_.defer(() => {\n\t\t\tif (!this._ignoreItemSelection) {\n\t\t\t\tconst item = this.menu.list_.listElements[e.detail.index];\n\t\t\t\tif (!item || !item.classList.contains('nx-action')) {\n\t\t\t\t\tif (this.view.onMenuItemSelect) {\n\t\t\t\t\t\tthis.view.onMenuItemSelect(item, this.menu);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Pass along to our action event handler\n\t\t\t\tconst evt = new MouseEvent('click', {\n\t\t\t\t\tbubbles: false,\n\t\t\t\t\tcancelable: true,\n\t\t\t\t\tview: window,\n\t\t\t\t});\n\t\t\t\titem.dispatchEvent(evt);\n\t\t\t}\n\t\t});\n\t}\n\n\t/** @method */\n\topen() {\n\t\tconst el = this.el;\n\t\tlet menu = this.menu;\n\n\t\tsimulateClickBody();\n\n\t\tif (menu && menu.open) return;\n\n\t\tif (this.hoist) {\n\t\t\tmenu = this.createMenu();\n\t\t\tmenu.setFixedPosition(true);\n\t\t\tmenu.hoistMenuToBody();\n\n\t\t\tconst backdrop = (this.backdrop = document.createElement('div'));\n\t\t\tbackdrop.classList.add('mdc-menu-backdrop');\n\t\t\tdocument.body.appendChild(backdrop);\n\n\t\t\tconst cancelItem = el.querySelector('.mdc-list-item.cancel');\n\t\t\tcancelItem &&\n\t\t\t\tcancelItem.classList.toggle(\n\t\t\t\t\t'mdc-list-item--disabled',\n\t\t\t\t\twindow.innerWidth >= 767,\n\t\t\t\t);\n\t\t}\n\n\t\tif (!menu || menu.open) return;\n\n\t\tthis.reEnableTouchEventsTimeout &&\n\t\t\tclearTimeout(this.reEnableTouchEventsTimeout);\n\t\tmenu.root_.style['pointer-events'] = 'none';\n\n\t\tmenu.open = true;\n\t}\n\n\t/** @method */\n\topened() {\n\t\tif (this._open) return;\n\n\t\tconst menu = this.menu;\n\n\t\tthis._open = true;\n\t\tthis.anchorEl.classList.add('open');\n\n\t\tif (this.view.onMenuOpen) {\n\t\t\tthis.view.onMenuOpen(menu);\n\t\t}\n\n\t\tthis.reEnableTouchEventsTimeout &&\n\t\t\tclearTimeout(this.reEnableTouchEventsTimeout);\n\t\tthis.reEnableTouchEventsTimeout = setTimeout(() => {\n\t\t\tmenu.root_.style['pointer-events'] = '';\n\t\t}, 300);\n\t}\n\n\t/** @method */\n\trecalculatePosition() {\n\t\tif (!this.menu || !this._open) return;\n\t\tconst menuSurface = this.menu.menuSurface_.foundation_;\n\t\tmenuSurface.dimensions_ = menuSurface.adapter_.getInnerDimensions();\n\t\tmenuSurface.autoPosition_();\n\t}\n\n\t/** @method */\n\ttoggle() {\n\t\tconst menu = this.menu;\n\t\t!menu || !menu.open ? this.open() : this.close();\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e `click` event\n\t */\n\ttoggleClicked(e) {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tthis.open();\n\t}\n}\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tlet materialMenus = [];\n\n\t\tconst cleanUp = () => {\n\t\t\t_.invoke(materialMenus, 'destroy');\n\t\t\tmaterialMenus = [];\n\t\t};\n\n\t\tinstance.addMaterialMenu = (el, show) => {\n\t\t\tconst menu = new Menu(el, instance);\n\t\t\tmaterialMenus.push(menu);\n\t\t\tshow && menu.open();\n\t\t};\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', cleanUp)\n\t\t\t.on('removeHook', cleanUp)\n\t\t\t.on('renderedHook', () => {\n\t\t\t\tconst el = instance.el;\n\t\t\t\tconst els = el.classList.contains('mdc-menu-surface--anchor')\n\t\t\t\t\t? [el]\n\t\t\t\t\t: purgeEls(\n\t\t\t\t\t\t\t[...instance.el.querySelectorAll('.mdc-menu-surface--anchor')],\n\t\t\t\t\t\t\tinstance.getExcludedViews(),\n\t\t\t\t\t );\n\t\t\t\tmaterialMenus = els.map((anchorEl) => {\n\t\t\t\t\treturn new Menu(anchorEl, instance, opts.materialMenus);\n\t\t\t\t});\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","const NAME = 'materialRipples';\n\nimport {MDCRipple} from '@material/ripple';\nimport {purgeEls} from '@netx/core/utils';\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tlet materialRipples = [];\n\n\t\tconst cleanUp = () => {\n\t\t\t_.invoke(materialRipples, 'destroy');\n\t\t\tmaterialRipples = [];\n\t\t};\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', cleanUp)\n\t\t\t.on('removeHook', cleanUp)\n\t\t\t.on('postRenderHook', () => {\n\t\t\t\tmaterialRipples = purgeEls(\n\t\t\t\t\t[...instance.el.querySelectorAll('.mdc-ripple-surface')],\n\t\t\t\t\tinstance.getExcludedViews(),\n\t\t\t\t).map((el) => new MDCRipple(el));\n\t\t\t})\n\t\t\t.on('materialRipples:ripple', (el) => {\n\t\t\t\tconst ripple = materialRipples.find((ripple) => ripple.root_ === el);\n\t\t\t\tif (!ripple) return;\n\n\t\t\t\tconst foundation = ripple.foundation_;\n\t\t\t\tfoundation.activate();\n\t\t\t\tfoundation.deactivate();\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","import {cssClasses, numbers} from '@material/textfield/constants';\n\n/**\n * As of v3 there is no mechanism for material components to know that measurable widths\n * have changed - so if a textfield has a value, is a textarea, and was rendered prior to\n * being measurable in the DOM, we wind up with a missing floating label\n * This will hopefully go away as we switch over to react\n * @function\n * @param {MDCTextfield} textfield Instance of mdc-textfield\n */\nexport const notchOutlinePatch = (textfield) => {\n\t// Do not patch twice\n\tif (!textfield || textfield.notchOutlinePatched_) return;\n\ttextfield.notchOutlinePatched_ = true;\n\n\tconst foundation = textfield.foundation_;\n\tconst adapter = foundation.adapter_;\n\tfoundation.notchOutline = _.wrap(\n\t\tfoundation.notchOutline,\n\t\t(notchOutline, openNotch) => {\n\t\t\ttextfield.notchOutlinePatchTimeout &&\n\t\t\t\tclearTimeout(textfield.notchOutlinePatchTimeout);\n\t\t\tif (!adapter.hasOutline()) return;\n\t\t\tif (!openNotch) return notchOutline.call(foundation, openNotch);\n\n\t\t\tconst isDense = adapter.hasClass(cssClasses.DENSE);\n\t\t\tconst labelScale = isDense\n\t\t\t\t? numbers.DENSE_LABEL_SCALE\n\t\t\t\t: numbers.LABEL_SCALE;\n\t\t\tconst labelWidth = adapter.getLabelWidth() * labelScale;\n\t\t\tif (!labelWidth || isNaN(labelWidth)) {\n\t\t\t\treturn (textfield.notchOutlinePatchTimeout = setTimeout(() => {\n\t\t\t\t\tfoundation.notchOutline(openNotch);\n\t\t\t\t}, 100));\n\t\t\t}\n\t\t\tadapter.notchOutline(labelWidth);\n\t\t},\n\t);\n\n\t// Make sure we clean up our timer\n\tfoundation.destroy = _.wrap(foundation.destroy, (destroy) => {\n\t\ttextfield.notchOutlinePatchTimeout &&\n\t\t\tclearTimeout(textfield.notchOutlinePatchTimeout);\n\t\tdestroy.call(foundation);\n\t});\n\n\t// Fun hack for our inputs that have floating labels regardless of having a value or not\n\tconst forceFloat =\n\t\tadapter.hasLabel() &&\n\t\ttextfield.label_.root_.classList.contains(\n\t\t\t'mdc-floating-label--float-above',\n\t\t);\n\n\t// Since this patch is applied after init and init calls float label if there is a value, call it again\n\t// As seen in foundation.init:\n\tif (adapter.isFocused()) {\n\t\tfoundation.inputFocusHandler_();\n\t} else if (forceFloat || (adapter.hasLabel() && foundation.shouldFloat)) {\n\t\tfoundation.notchOutline(true);\n\t\tadapter.floatLabel(true);\n\t}\n};\n","const NAME = 'materialTextFields';\n\nimport {MDCTextField} from '@material/textfield';\nimport {purgeEls} from '@netx/core/utils';\nimport {notchOutlinePatch} from './patches/mdc-textfield';\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tlet materialTextFields = [];\n\t\tlet dateComponents = [];\n\n\t\tconst cleanUp = () => {\n\t\t\t_.invoke(materialTextFields, 'destroy');\n\t\t\tmaterialTextFields = [];\n\t\t\tdateComponents = [];\n\t\t};\n\n\t\tconst getMaterailTextField = (el) => {\n\t\t\tfor (let i = 0, c = materialTextFields.length; i < c; i++) {\n\t\t\t\tconst textField = materialTextFields[i];\n\t\t\t\tif (textField.input_ === el) {\n\t\t\t\t\treturn textField;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tinstance.events = {\n\t\t\t'change .mdc-text-field [data-provide=\"datepicker\"]'(e) {\n\t\t\t\tconst target = e.currentTarget;\n\t\t\t\tdateComponents.forEach((textField) => {\n\t\t\t\t\tif (textField.input_ !== target) return;\n\t\t\t\t\t// This will fix the floating label and validation\n\t\t\t\t\tconst foundation = textField.foundation_;\n\t\t\t\t\tfoundation.deactivateFocus();\n\t\t\t\t});\n\t\t\t},\n\t\t\t...instance.events,\n\t\t};\n\n\t\tinstance.materialTextFieldFloatLabel = (el, shouldFloat = false) => {\n\t\t\tconst textField = getMaterailTextField(el);\n\t\t\tif (!textField || !textField.label_) return;\n\t\t\ttextField.label_.float(shouldFloat);\n\t\t\ttextField.foundation_.notchOutline &&\n\t\t\t\ttextField.foundation_.notchOutline(shouldFloat);\n\t\t};\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', cleanUp)\n\t\t\t.on('removeHook', cleanUp)\n\t\t\t.on('postRenderHook', () => {\n\t\t\t\tdateComponents = [];\n\t\t\t\tmaterialTextFields = purgeEls(\n\t\t\t\t\t[...instance.el.querySelectorAll('.mdc-text-field')],\n\t\t\t\t\tinstance.getExcludedViews(),\n\t\t\t\t).map((field) => {\n\t\t\t\t\t// Hack for typeahead - we want the styles but mdc will grab it first (since it gets prepended)\n\t\t\t\t\t// Remove the class before creating mdc-text-field and then re-add\n\t\t\t\t\tconst ttInputEl = field.querySelector(\n\t\t\t\t\t\t'.mdc-text-field__input.tt-hint',\n\t\t\t\t\t);\n\t\t\t\t\tif (ttInputEl) {\n\t\t\t\t\t\tttInputEl.classList.remove('mdc-text-field__input');\n\t\t\t\t\t}\n\n\t\t\t\t\tconst inputEl = field.querySelector('.mdc-text-field__input');\n\t\t\t\t\tif (!inputEl) return;\n\n\t\t\t\t\tconst textField = new MDCTextField(field);\n\t\t\t\t\tif (field.classList.contains('mdc-text-field--textarea')) {\n\t\t\t\t\t\tnotchOutlinePatch(textField);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (inputEl.getAttribute('data-provide') === 'datepicker') {\n\t\t\t\t\t\tdateComponents.push(textField);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Put the class back for styles\n\t\t\t\t\tif (ttInputEl) {\n\t\t\t\t\t\tttInputEl.classList.add('mdc-text-field__input');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn textField;\n\t\t\t\t});\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","import {cssClasses, strings} from '@material/list/constants';\n\n/**\n * As of v2 they stopped checking disabled items\n * I can understand this from an accessibility standpoint, in a world where disabled items are visible\n * but in our theme we hide disabled list tiems from the user\n * @function\n * @param {MDCList} list Instance of mdc-list\n */\nexport const arrowNavigationPatch = (list) => {\n\t// Do not patch twice\n\tif (!list || list.arrowNavaigationPatched_) return;\n\n\tlist.arrowNavaigationPatched_ = true;\n\n\tconst foundation = list.foundation_;\n\n\tfoundation.focusPrevElement = _.wrap(\n\t\tfoundation.focusPrevElement,\n\t\t(focusPrevElement, index) => {\n\t\t\tlet prevIndex = index - 1;\n\t\t\tif (prevIndex < 0) {\n\t\t\t\t// Return early because first item is already focused.\n\t\t\t\tif (!foundation.wrapFocus_) return index;\n\t\t\t\tprevIndex = foundation.adapter_.getListItemCount() - 1;\n\t\t\t}\n\n\t\t\t// Skip disabled items\n\t\t\tconst listItemEl = list.listElements[prevIndex];\n\t\t\tif (\n\t\t\t\tlistItemEl &&\n\t\t\t\tlistItemEl.classList.contains(cssClasses.LIST_ITEM_DISABLED_CLASS)\n\t\t\t) {\n\t\t\t\treturn foundation.focusPrevElement(prevIndex);\n\t\t\t}\n\n\t\t\t// Carry on\n\t\t\treturn focusPrevElement.call(foundation, index);\n\t\t},\n\t);\n\n\tfoundation.focusNextElement = _.wrap(\n\t\tfoundation.focusNextElement,\n\t\t(focusNextElement, index) => {\n\t\t\tconst count = foundation.adapter_.getListItemCount();\n\t\t\tlet nextIndex = index + 1;\n\t\t\tif (nextIndex >= count) {\n\t\t\t\t// Return early because last item is already focused.\n\t\t\t\tif (!foundation.wrapFocus_) return index;\n\t\t\t\tnextIndex = 0;\n\t\t\t}\n\n\t\t\t// Skip disabled items\n\t\t\tconst listItemEl = list.listElements[nextIndex];\n\t\t\tif (\n\t\t\t\tlistItemEl &&\n\t\t\t\tlistItemEl.classList.contains(cssClasses.LIST_ITEM_DISABLED_CLASS)\n\t\t\t) {\n\t\t\t\treturn foundation.focusNextElement(nextIndex);\n\t\t\t}\n\n\t\t\t// Carry on\n\t\t\treturn focusNextElement.call(foundation, index);\n\t\t},\n\t);\n};\n\n/**\n * https://github.com/material-components/material-components-web/issues/4696\n * @function\n * @param {MDCList} list MDCList\n */\nexport const disabledListItemCheckboxPatch = (list) => {\n\t// Do not patch twice\n\tif (!list || list.disabledListItemCheckboxPatched_) return;\n\n\tlist.prototype.initializeListType = _.wrap(\n\t\tlist.prototype.initializeListType,\n\t\tfunction (initializeListType) {\n\t\t\tconst foundation = this.foundation_;\n\t\t\tconst adapter = foundation.adapter_;\n\n\t\t\tadapter.setCheckedCheckboxOrRadioAtIndex = (index, isChecked) => {\n\t\t\t\tconst listItem = this.listElements[index];\n\t\t\t\tconst toggleEl = listItem.querySelector(\n\t\t\t\t\tstrings.CHECKBOX_RADIO_SELECTOR,\n\t\t\t\t);\n\t\t\t\t// This is all this was overriden for\n\t\t\t\tif (!toggleEl) return;\n\n\t\t\t\ttoggleEl.checked = isChecked;\n\t\t\t\tconst event = document.createEvent('Event');\n\t\t\t\tevent.initEvent('change', true, true);\n\t\t\t\ttoggleEl.dispatchEvent(event);\n\t\t\t};\n\n\t\t\treturn initializeListType.call(this);\n\t\t},\n\t);\n};\n","export enum SupportedLocale {\n\tENGLISH = 'en-US',\n\tFRENCH = 'fr-FR',\n\tGERMAN = 'de-DE',\n\tJAPANESE = 'ja-JP',\n}\n","import {getPreference} from '@netx/core-user/utils/getPreference';\nimport {SupportedLocale} from '../constants';\n\nexport const getAvailableLocales = () => {\n\tconst localesPref = getPreference('i18n.userSelectableLocales');\n\tif (!localesPref) return Object.values(SupportedLocale);\n\tconst localesFilter = localesPref.split(/[ ,]+/);\n\treturn Object.values(SupportedLocale).filter((locale) =>\n\t\tlocalesFilter.includes(locale),\n\t);\n};\n\nexport default getAvailableLocales;\n","/**\n * A collection of appView models.\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/appView';\n\nclass AppViews extends Base {\n\t/**\n\t * @override\n\t * @listens {@link Netx.Collections.AppViews#add}\n\t * @listens {@link Netx.Collections.AppViews#destroyed}\n\t * @listens {@link Netx.Collections.AppViews#switched}\n\t * @listens {@link Netx.Collections.AppViews#switchedBack}\n\t * @listens {@link Netx.Collections.AppViews#remove}\n\t */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\tthis.view = opts.view;\n\n\t\t// Hey, listen!\n\t\t// A model has been destroyed or returned to its original `viewCollection`\n\t\t// This will cleanup any other collection the model may have lived in (other than home - that must be done explicitly)\n\t\tthis.listenTo(this, 'destroyed switchedBack', (model, collection) => {\n\t\t\t// The model has a `viewCollection` and the model's `viewCollection` is not us\n\t\t\tif (model.collection && model.collection._listenId !== this._listenId) {\n\t\t\t\t// Make sure it is removed from all collections that are not the model's `viewCollection`\n\t\t\t\tcollection._listenId !== this._listenId && this.remove(model);\n\t\t\t}\n\t\t})\n\t\t\t// A model switched `viewCollections`\n\t\t\t.listenTo(this, 'switched', (model, collection) => {\n\t\t\t\t// Not the original `viewCollection` and `viewCollection` switched to is not us\n\t\t\t\tif (\n\t\t\t\t\tmodel.collection &&\n\t\t\t\t\tmodel.collection._listenId !== this._listenId &&\n\t\t\t\t\tcollection._listenId !== this._listenId\n\t\t\t\t) {\n\t\t\t\t\t// Models can only live in two places at a time, and we are not one of those two places\n\t\t\t\t\tthis.remove(model);\n\t\t\t\t}\n\t\t\t});\n\t\t// Are we a view queue\n\t\t// If so, manage setting and unsetting the `queued` attribute on the model when added/removed\n\t\tif (this.isQueue) {\n\t\t\tthis.listenTo(this, 'add', (model, collection) => {\n\t\t\t\tthis._listenId === collection._listenId && model.set('queued', true);\n\t\t\t}).listenTo(this, 'remove', (model, collection) => {\n\t\t\t\tthis._listenId === collection._listenId && model.set('queued', false);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * @override\n\t * @param {array} models Models\n\t * @param {object} opts Options\n\t */\n\tparse(models, opts) {\n\t\tif (!_.isArray(models)) models = [models];\n\n\t\t_.each(models, model => {\n\t\t\tif (model instanceof Model) return;\n\n\t\t\tif (model.id == null) {\n\t\t\t\tconst viewClass = model.viewClass;\n\t\t\t\tmodel.id = viewClass.__name__;\n\t\t\t}\n\t\t});\n\t\treturn models;\n\t}\n\n\t/** @override */\n\tadd(models, opts) {\n\t\topts = opts || {};\n\n\t\t// We always merge\n\t\t// but... if by chance we have explicitly opted not to... whelp.\n\t\tif (opts.merge !== false) {\n\t\t\topts.merge = true;\n\t\t}\n\t\t// Ditto\n\t\tif (opts.parse !== false) {\n\t\t\topts.parse = true;\n\t\t}\n\n\t\treturn super.add(models, opts);\n\t}\n\n\t/**\n\t * This is a helper method meant for only use in the console while trying to debug a particular view\n\t * Use in code is neither admirable or wise.\n\t * @method\n\t * @param {string} templateKey Template key\n\t * @return {module:core/lib/netx-view} Instance of netx-view\n\t */\n\tfindByTemplateKey(templateKey) {\n\t\tconsole.warn(\n\t\t\t'Do not use the `findByTemplateKey` method in production! The method `findByTemplateKey` is not supported',\n\t\t);\n\n\t\t/**\n\t\t * @function\n\t\t * @param {module:core/lib/netx-view} view View\n\t\t * @return {module:core/lib/netx-view} Instance of netx-view\n\t\t */\n\t\tconst findView = view => {\n\t\t\tif (view.templateKey === templateKey) {\n\t\t\t\treturn view;\n\t\t\t}\n\n\t\t\tlet found = false;\n\t\t\tif (view.viewCollection) {\n\t\t\t\tfound = findInViews(view.viewCollection.pluck('view'));\n\t\t\t\tif (found) return found;\n\t\t\t}\n\t\t\tif (view.childViews) {\n\t\t\t\tfound = findInViews(_.values(view.childViews));\n\t\t\t\tif (found) return found;\n\t\t\t}\n\t\t\tif (view.subViews) {\n\t\t\t\tfound = findInViews(_.values(view.subViews));\n\t\t\t\tif (found) return found;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\t/**\n\t\t * @function\n\t\t * @param {array} views Views\n\t\t * @return {module:core/lib/netx-view} Instance of netx-view\n\t\t */\n\t\tconst findInViews = views => {\n\t\t\tfor (let i = 0, c = views.length, view, found; i < c; i++) {\n\t\t\t\tview = views[i];\n\t\t\t\tfound = findView(view);\n\t\t\t\tif (found) return found;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\treturn findInViews(this.pluck('view'));\n\t}\n\n\t/**\n\t * Get transient view (if there is one)\n\t * @method\n\t * @return {boolean|Netx.Models.AppView}\n\t */\n\tgetTransient() {\n\t\tvar transient = false;\n\t\tfor (var i = 0, c = this.length; i < c; i++) {\n\t\t\ttransient = !this.at(i).isMyOriginalCollection(this) ? this.at(i) : false;\n\t\t\tif (transient) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn transient;\n\t}\n\n\t/**\n\t * Overriding to document this: Never use reset on this collection after it has been populated with models - always use\n\t * `set([])` if you are looking to clear it out properly. We will get all the proper events rather than a single `reset` event.\n\t * Nothing about how this event works is overriden.\n\t * @override\n\t */\n\treset(models, opts) {\n\t\t// I would like to warn you about using reset manually on this - but backbone sends a reset call off the bat\n\t\t// to new collections. Do not want to throw up bad warnings.\n\t\treturn super.reset(models, opts);\n\t}\n\n\t/** @override */\n\tset(models, opts = {}) {\n\t\t// Always parse unless explicitly told not to\n\t\topts.parse = opts.parse !== false;\n\t\treturn super.set(models, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {Netx.Models.AppView} model App view model\n\t * @param {Netx.Collections.AppViews} collection The new `viewCollection`\n\t * @param {object} opts Add to collection options\n\t */\n\tswitchTo(model, collection, opts = {}) {\n\t\t// You should never be trying to `switchTo` the original `viewCollection`\n\t\tif (collection !== this) {\n\t\t\t// Store this so that we can know the current context of the `viewCollection`\n\t\t\tmodel.currentCollection = collection;\n\t\t\tcollection.add(model, opts);\n\t\t\t// Let the model know it has switched `viewCollections`\n\t\t\tmodel.trigger('switched', model, collection);\n\t\t}\n\t\t// But in the event you are - just remove it from the `currentCollection` and let events do the rest\n\t\telse {\n\t\t\tmodel.switchBack();\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AppViews';\n\t}\n}\n\nexport default AppViews;\n","/**\n * A queued collection of appView models.\n * @class\n */\nimport Base from './appViews';\n\nclass AppViewsQueue extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\tsuper(models, opts);\n\n\t\tthis.isQueue = true;\n\n\t\t// Reference to the viewCollection we are acting as a queue for\n\t\tconst queueFor = (this.queueFor = opts.queueFor);\n\t\tconst view = (this.view = opts.view);\n\n\t\t// Backup\n\t\tthis.oldQueueForSet = queueFor.set;\n\t\t// collection.add is a middle man for set - set by itself produces no options by default\n\t\tqueueFor.set = (models, opts) => {\n\t\t\t// If we are fixing to get out of here, store the incoming views\n\t\t\t// so we can reshow when done\n\t\t\tif (view.preparingToHide || view.removing) {\n\t\t\t\tthis.set(models, {remove: false});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Let it run as usual\n\t\t\treturn this.oldQueueForSet.call(queueFor, models, opts);\n\t\t};\n\n\t\t// Backup\n\t\tthis.oldQueueForRemove = queueFor.remove;\n\t\tqueueFor.remove = (models, opts) => {\n\t\t\tthis.remove(models);\n\t\t\t// Let it run as usual\n\t\t\treturn this.oldQueueForRemove.call(queueFor, models, opts);\n\t\t};\n\t}\n\n\t/** @override */\n\tgarbageCollect() {\n\t\tthis.queueFor.remove = this.oldQueueForRemove;\n\t\tthis.queueFor.set = this.oldQueueForSet;\n\n\t\tsuper.garbageCollect();\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AppViewsQueue';\n\t}\n}\n\nexport default AppViewsQueue;\n","/**\n * CustomForm collection\n * Represents a single form\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/customFormElement';\n\nclass CustomForm extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} methods - Collection RPC methods\n\t * @property {method} methods.read - Fetch custom form fields\n\t *\n\t * @property {method} methods.deleteCustomForm - Delete custom form\n\t * @property {method} methods.setCustomForm - Update custom form fields\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn ['getCustomFormByName', this.customForm.formName];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tdeleteCustomForm(opts) {\n\t\t\t\treturn ['deleteCustomForm', this.customForm.formName];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetCustomForm(opts) {\n\t\t\t\treturn ['setCustomForm', this.customForm];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers.read - Parses result of fetched form\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} data Form data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(data, opts) {\n\t\t\t\tif (!data) return null;\n\n\t\t\t\t// taking the raw form data and parsing it so customFormElementView can deal\n\t\t\t\t/* eslint-disable */\n\t\t\t\tconst elements = JSON.parse(data.formData.replace(/\\\\\\\"/g, '\"'));\n\t\t\t\ttry {\n\t\t\t\t\tconst userVals = this.customForm.userValues;\n\t\t\t\t\t_.each(elements, (element, idx, all) => {\n\t\t\t\t\t\tif (this.duplicateKeys.indexOf(element.label.key) !== -1) {\n\t\t\t\t\t\t\tdelete all[idx];\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst name = element.label.key\n\t\t\t\t\t\t\t? element.label.key\n\t\t\t\t\t\t\t: this.model.makeName(element.label.en);\n\n\t\t\t\t\t\tif (element.type === 'checkboxes') {\n\t\t\t\t\t\t\t// if we have user values, loop though and create userValues array\n\t\t\t\t\t\t\tif (_.isEmpty(userVals)) return;\n\n\t\t\t\t\t\t\t_.each(element.value, (elem, idx, all) => {\n\t\t\t\t\t\t\t\tconst userVal = userVals[`${name}-${elem.key}`];\n\t\t\t\t\t\t\t\tif (!userVal) return;\n\n\t\t\t\t\t\t\t\tif (!element.userValues) {\n\t\t\t\t\t\t\t\t\telement.userValues = [];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\telement.userValues.push(userVal);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else if (userVals[name]) {\n\t\t\t\t\t\t\telement.userValue = userVals[name];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\treturn elements;\n\t\t\t\t} catch (e) {\n\t\t\t\t\tconsole.warn('could not parse fetched elements, err: %o', e);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * @type {object}\n\t\t */\n\t\tconst customForm = (this.customForm = {\n\t\t\tformName: '',\n\t\t\tformData: '',\n\t\t\tuserValues: {},\n\t\t\tduplicateKeys: [],\n\t\t\treadOnly: false,\n\t\t});\n\n\t\tif (opts.formName) {\n\t\t\tcustomForm.formName = opts.formName;\n\t\t\tcustomForm.userValues = opts.userValues || {};\n\t\t\tthis.readOnly = opts.readOnly || false;\n\t\t\tthis.duplicateKeys = opts.duplicateKeys || [];\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} formData Form data\n\t * @return {object} Form data\n\t */\n\tgetDisplayByData(formData) {\n\t\tif (this.length <= 1) return formData;\n\n\t\t// take the form data and return it with actual labels\n\t\t_.each(formData, (detail, idx, all) => {\n\t\t\tconst idxAr = idx.split('cfe-');\n\t\t\tif (idxAr.length <= 1) return;\n\n\t\t\tconst element = this.find({name: idxAr[1]});\n\t\t\tif (element) {\n\t\t\t\t// this data is in the form, use the label\n\t\t\t\tconst label = element.getDisplayLabel();\n\t\t\t\tall[label] = element.getDisplayValue(detail);\n\t\t\t} else {\n\t\t\t\t// not in the form, just trim the 'cfe-', likely the form has changed\n\t\t\t\tall[idxAr[1]] = detail;\n\t\t\t}\n\t\t\tdelete all[idx];\n\t\t});\n\n\t\treturn formData;\n\t}\n\n\t/**\n\t * Cleans form data, removes cfe-\n\t * @method\n\t * @param {object} formData Form data\n\t * @return {object} Form data\n\t */\n\tsubmitArgs(formData) {\n\t\t_.each(formData, (dataValue, dataKey, all) => {\n\t\t\tif (dataKey.slice(0, 4) !== 'cfe-') return;\n\n\t\t\tall[dataKey.slice(4)] = dataValue.toString().replace(/\"/g, '');\n\t\t\tdelete all[dataKey];\n\t\t});\n\t\treturn formData;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'CustomForm';\n\t}\n}\n\nexport default CustomForm;\n\nNetx.CustomForm = CustomForm;\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/storageLocation';\n\nimport properties from '../properties/locations';\n\nclass StorageLocations extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {object} */\n\tget xhrTrackProgress() {\n\t\treturn {\n\t\t\tgetLocations: true,\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tgetLocations: 'Fetching storage locations',\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tgetLocations: 'Fetched storage locations',\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - The methods available on this model\n\t * @property {function|array} methods.read - The read method (get)\n\t * @property {function|array} methods.getLocationTypes - Get location types (when called will update app/properties/locations)\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn ['getLocations', '', false];\n\t\t\t},\n\t\t\tgetLocationTypes: ['getLocationTypes'],\n\t\t};\n\t}\n\n\t/**\n\t * Parsers for this model\n\t * @type {object}\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(data, opts) {\n\t\t\t\treturn _.map(data, (loc) =>\n\t\t\t\t\t_.extend(loc, {\n\t\t\t\t\t\tlabel: i18n.t('i18n.' + _.toCamelCase(loc.name), {\n\t\t\t\t\t\t\tdefaultValue: loc.name,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tlocationTypeLabel: i18n.t(\n\t\t\t\t\t\t\t'app:i18n.' + _.toCamelCase(loc.locationTypeName),\n\t\t\t\t\t\t\t{defaultValue: loc.locationTypeName},\n\t\t\t\t\t\t),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Sets the properties file location type data app/properties/locations\n\t\t\t * @function\n\t\t\t * @param {array} data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetLocationTypes(data, opts) {\n\t\t\t\tconst typeIds = properties.typeIds;\n\t\t\t\tconst typeLabels = properties.typeLabels;\n\t\t\t\t_.each(data, (locationType, idx) => {\n\t\t\t\t\tconst id = locationType.id;\n\t\t\t\t\tconst name = _.toCamelCase(locationType.name);\n\t\t\t\t\ttypeIds[name] = id;\n\t\t\t\t\ttypeLabels[id] = i18n.t(`app:i18n.${name}`);\n\t\t\t\t});\n\t\t\t\tproperties.types = _.invert(typeIds);\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @return {Netx.Models.StorageLocation}\n\t */\n\tgetDefaultLocation() {\n\t\treturn this.findWhere({defaultLocation: 1});\n\t}\n\n\t/**\n\t * Get an object indexed by id with label values by locationTypeId\n\t * Used a lot for select element options\n\t * @method\n\t * @param {number} locationTypeId Location type\n\t * @return {object} Labels\n\t */\n\tgetLocationLabelsForType(locationTypeId) {\n\t\tlocationTypeId = parseInt(locationTypeId);\n\n\t\tconst locations = this.where({locationTypeId: locationTypeId});\n\t\tconst list = {};\n\n\t\t_.each(locations, (locModel, idx) => {\n\t\t\tlist[locModel.id] = locModel.get('name');\n\t\t});\n\n\t\treturn list;\n\t}\n\n\t/**\n\t * Returns locations that are available to be uploaded to.\n\t * @method\n\t * @return {Netx.Collection} Collection of active location models\n\t */\n\tgetLocationsForUpload() {\n\t\treturn new Base(this.where({active: 1}));\n\t}\n\n\t/**\n\t * Set the default storage location\n\t * @method\n\t * @param {Netx.Models.StorageLocation} model Sotrage location\n\t * @param {object} opts Options\n\t */\n\tsetDefaultLocation(model, opts) {\n\t\t// Get current default\n\t\tconst currentDefaultLocation = this.findWhere({defaultLocation: 1});\n\n\t\t// If not already default\n\t\tif (currentDefaultLocation === model) {\n\t\t\treturn new $.Deferred().resolve();\n\t\t}\n\n\t\t// Set the new default location\n\t\treturn model\n\t\t\t.save(\n\t\t\t\t{\n\t\t\t\t\tdefaultLocation: 1,\n\t\t\t\t\tactive: 1,\n\t\t\t\t},\n\t\t\t\t_.extend({wait: true}, opts),\n\t\t\t)\n\t\t\t.then(() => {\n\t\t\t\tcurrentDefaultLocation.set({defaultLocation: 0});\n\t\t\t\t// Trigger custom event since we will be changing the values of `defaultLocation` quite a bit here\n\t\t\t\tthis.trigger('nx:change:defaultLocation', this, model);\n\t\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'StorageLocations';\n\t}\n}\n\nexport default StorageLocations;\n","import {getPreference} from '@netx/core-user/utils/getPreference';\n\n/**\n * @return Can contact\n */\nexport const canContact = () => getPreference('email.mailto.rcpt_to') != null;\n","/**\n * @class\n * @example\n * {\n * viewClass : FooView, // Just like `childView`, the view constructor\n * deferredModules : ['foo'], // If you need to initialize any deferred modules before showing the corresponding view\n * label : i18n.t('i18n.fooViewLabel'), // The `label` to show for the view (if ommitted we will look for `headerTitle` within the view's prototype)\n * name : 'foo', // If you would like specify your own name to reference the view (otherwise the `viewClass` will be used in camelcase form)\n * showActions : ['module:foo:bar'], // If you want other actions to trigger the showing of the corresponding view\n * uniqueShowAction : 'module:foo:route', // If you want to decide what happens when a tab is clicked (`appView:[view.cid]:show` will be registered and used)\n * viewOptions : {...}, // Anything that should be passed to the view at creation\n * }\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport {getEnabledActions} from '@netx/core-permissions/properties/actions';\nimport {\n\tFindLegacyAction,\n\tRegisterLegacyAction,\n} from '@netx/core/legacyActionManager';\n\nclass AppView extends Base {\n\t/** @type {boolean} */\n\tget isAppView() {\n\t\treturn true;\n\t}\n\n\t/** @type {ES6Model} */\n\tget viewModel() {\n\t\tconst view = this.get('view');\n\t\tif (view) {\n\t\t\treturn view.model;\n\t\t}\n\t\tconst viewOptions = this.get('viewOptions') || {};\n\t\treturn viewOptions.model;\n\t}\n\n\t/**\n\t * @property {object} defaults - Defaults\n\t * @property {string} defaults.id - Unique `id` - the class name of the view if not provided\n\t * @property {module:core/lib/netx-view} defaults.viewClass - View constructor\n\t * @property {boolean} defaults.active - Is the view `model` currently active\n\t * @property {array} defaults.deferredModules - Deferred modules that must be loaded before the view can be `shown`/`rendered`\n\t * @property {array} defaults.showAction - An array of `actions` the view will listen for and show itself on\n\t * @property {string} defaults.label - If you want set a sepcific `label` for this view (will be used by tabs and crumbs)\n\t * @property {string} defaults.name - If you want set a sepcific `name` for this view (will be used by tabs)\n\t * @property {boolean} defaults.queued - Is the view `queued` (this should not be set manually)\n\t * @property {boolean} defaults.switched - Is the view `switched` out (this should not be set manually)\n\t * @property {string} defaults.uniqueShowAction - This will be used as the primary unique `action` for showing the view. If not set, a unique one will be created for it\n\t * @property {object} defaults.viewOptions - The `options` that will be passed to the view at creation\n\t * @property {module:core/lib/netx-ollection} defaults.viewOptions.collection - The `collection` for the view\n\t * @property {module:core/lib/netx-model} defaults.viewOptions.model - The `model` for the view\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t// id : \"\",\n\t\t\tviewClass: null,\n\t\t\tactive: false,\n\t\t\tdeferredModules: undefined,\n\t\t\tshowActions: [],\n\t\t\tlabel: undefined,\n\t\t\tname: undefined,\n\t\t\tqueued: false,\n\t\t\tswitched: false,\n\t\t\tuniqueShowAction: undefined,\n\t\t\tviewOptions: {\n\t\t\t\tcollection: undefined,\n\t\t\t\tmodel: undefined,\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t * @fires {@link Netx.Models.AppView#destroy}\n\t * @fires {@link Netx.Models.AppView#switchedBack}\n\t * @listens {@link Netx.Models.AppView#remove}\n\t * @listens {@link Netx.Models.AppView#change:view}\n\t * @listens {@link Netx.Models.AppView#change:viewOptions:model}\n\t * @listens {@link Netx.Models.AppView#change:viewOptions:collection}\n\t */\n\tconstructor(attrs = {}, opts = {}) {\n\t\tif (attrs.id == null) {\n\t\t\tconst viewClass = attrs.viewClass;\n\t\t\tattrs.id = viewClass.__name__;\n\t\t}\n\n\t\tsuper(attrs, opts);\n\n\t\t// If a name was not set - add one\n\t\t!this.has('name') &&\n\t\t\tthis.set('name', _.camelCaseToDash(_.toCamelCase(this.id)));\n\n\t\t// Hey, listen!\n\t\t// We deal with the nested object `viewOptions` in the set method.\n\t\t// Backbone will only tell you about the change, to a key, in an object,\n\t\t// on a model, once (at least until that model has `synced\tsince the last chnage).\n\t\t// But regardless of syncing (which we do not do) that still would not get us\n\t\t// deep change event namespacing\n\n\t\t// If a unique show action was not provided, make one. This ensures\n\t\t// that the simple action of showing a view does not require accidentally\n\t\t// firing off a conflicting event name. Also, you do not absolutely\n\t\t// have to define any `showActions` if you do not need anything special\n\t\t// and are really just using a viewCollection to create a tab interface.\n\t\tlet uniqueShowAction = this.get('uniqueShowAction');\n\t\tif (this.get('uniqueShowAction') == null) {\n\t\t\tuniqueShowAction = `appView:${this.cid}:show`;\n\t\t\tthis.set('uniqueShowAction', uniqueShowAction);\n\t\t\tRegisterLegacyAction([\n\t\t\t\t{\n\t\t\t\t\tevent: uniqueShowAction,\n\t\t\t\t\tlabel: i18n.t('i18n.show'),\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\t\t// Check that the action provided has been registered, if not throw warning\n\t\telse {\n\t\t\tconst action = FindLegacyAction(uniqueShowAction);\n\t\t\tif (!action) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The action `' +\n\t\t\t\t\t\tthis.get('uniqueShowAction') +\n\t\t\t\t\t\t'` provided for multiView childView has not been registered. This will result in an error in `performAction`.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Hey, listen!\n\t\tthis\n\t\t\t////////////////////////////////\n\t\t\t// MODEL\n\t\t\t////////////////////////////////\n\t\t\t// Update model\n\t\t\t.listenTo(this, 'change:viewOptions:model', (model) => {\n\t\t\t\tif (model !== this || !this.get('view')) return;\n\t\t\t\t// Since we are piping below\n\t\t\t\tconst _model = this.get('viewOptions').model;\n\t\t\t\t_model != null && this.get('view').setModel(_model);\n\t\t\t})\n\t\t\t////////////////////////////////\n\t\t\t// !MODEL\n\t\t\t////////////////////////////////\n\n\t\t\t////////////////////////////////\n\t\t\t// COLLECTION\n\t\t\t////////////////////////////////\n\t\t\t// Update collection\n\t\t\t.listenTo(this, 'change:viewOptions:collection', (model) => {\n\t\t\t\tif (model !== this || !this.get('view')) return;\n\t\t\t\t// Since we are piping below\n\t\t\t\tconst collection = this.get('viewOptions').collection;\n\t\t\t\tcollection != null && this.get('view').setCollection(collection);\n\t\t\t})\n\t\t\t////////////////////////////////\n\t\t\t// !COLLECTION\n\t\t\t////////////////////////////////\n\n\t\t\t// Cleanup\n\t\t\t.listenTo(this, 'remove', (model, collection, options = {}) => {\n\t\t\t\t// Using `options`, spelled out, to not conflict with the `opts` passed to `initialize`\n\t\t\t\t// In the current artchitecture it would not make much sense to remove a model entirely from a viewCollection and add it to another\n\t\t\t\t// We can offer an option to pop the view from one place to the next but in the end always returns home and can only live in 1 other\n\t\t\t\t// `viewCollection` at a time:\n\t\t\t\t// app -> fullScreen || modal -> app || app -> modal\n\t\t\t\t// And even:\n\t\t\t\t// app -> fullScreen -> modal || app -> modal -> fullScreen\n\t\t\t\t// And by just adding the same instance of the model you do not loose any data inputed in the view. If we were trully removed from\n\t\t\t\t// our original `viewCollection` then we fire off a destroy event which in turn cleans it up from other `viewCollections` it may be in.\n\t\t\t\tif (model !== this) return;\n\n\t\t\t\tif (this.collection === collection) {\n\t\t\t\t\t// TODO: remove any created uniqueShowActions - but first discuss if simply removing\n\t\t\t\t\t// an action from the Action array is enough to be considered \"cleaned up\"\n\t\t\t\t\tthis.stopListening();\n\t\t\t\t\t// Let it known, for all intents and purposes, we were destroyed\n\t\t\t\t\t// There is no coming back from this kind of removal\n\t\t\t\t\tthis.trigger('destroy', this, this.collection);\n\t\t\t\t}\n\t\t\t\t// We were in another `viewCollection` and our `viewCollection` is not the collection we were removed from\n\t\t\t\telse if (\n\t\t\t\t\tthis.currentCollection &&\n\t\t\t\t\tthis.currentCollection._listenId === collection._listenId\n\t\t\t\t) {\n\t\t\t\t\t// When removed from a `viewCollection`, check to see if we should be switching back to our original `viewCollection`\n\t\t\t\t\t// Switch back - the switch isn't really anything more than an event - the other collections this may still be in will\n\t\t\t\t\t// be listening for this event to remove us from there as well\n\t\t\t\t\tthis.trigger('switchedBack', this, this.collection);\n\t\t\t\t\t// Be sure to delete this so that we only fire `switchedBack` on the first removal from not our original `viewCollection`\n\t\t\t\t\tdelete this.currentCollection;\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t////////////////////////////////\n\t\t\t// EVENT PIPING\n\t\t\t////////////////////////////////\n\t\t\t// Pipe view events - only once\n\t\t\t// If the view is removed so is the model and vice versa\n\t\t\t.listenToOnce(this, 'change:view', (model) => {\n\t\t\t\tif (model !== this) return;\n\n\t\t\t\t// The view gets set in Netx.View.prototype.addChildView\n\t\t\t\tconst view = this.get('view');\n\n\t\t\t\t// Pipe them all - if this turns out to be too costly we can get specific\n\t\t\t\t// to events that we know we want\n\t\t\t\tthis.listenTo(view, 'all', (...args) => {\n\t\t\t\t\t// Make `arguments` an array\n\t\t\t\t\targs = [...args];\n\t\t\t\t\tconst length = args.length;\n\t\t\t\t\t// We are not consistent in sending the view with the event trigger\n\t\t\t\t\t// Like: this.trigger('rendered'); -> this.trigger('rendered', this);\n\t\t\t\t\t// Because really we have never needed to pipe anything and always knew\n\t\t\t\t\t// if we were explicitly listening to a view's events within another\n\t\t\t\t\t// view - this abstracts it so any view which has access to this model's\n\t\t\t\t\t// collection can listen for all events that occur on the child views\n\t\t\t\t\t// within.\n\t\t\t\t\t// Prepend event with \"view:\"\n\t\t\t\t\targs[0] = `view:${args[0]}`;\n\t\t\t\t\tif (length === 1 || (length > 1 && args[1] !== view)) {\n\t\t\t\t\t\targs.splice(1, 0, view);\n\t\t\t\t\t}\n\t\t\t\t\tthis.trigger.apply(this, args);\n\t\t\t\t});\n\t\t\t});\n\t\t////////////////////////////////\n\t\t// !EVENT PIPING\n\t\t////////////////////////////////\n\n\t\t// A very slight pause before being considered \"synced\"\n\t\t_.defer(() => {\n\t\t\tthis.trigger('sync', this);\n\t\t});\n\t}\n\t/**\n\t * We only care about `viewOptions`\n\t * @override\n\t * @param {object|string} key Either the key or an object of key values\n\t * @param {mixed} value Either a value or, if the key is an object, it is the options object\n\t * @param {object} opts If key is not an object this the options object, otherwise `null`\n\t */\n\tset(key, value, opts) {\n\t\tlet newViewAttrs;\n\n\t\tconst changes = [];\n\t\tconst attrsToRemove = {};\n\t\tconst attrsToChange = {};\n\n\t\tlet attrs = {};\n\t\tlet _opts;\n\t\t// If the key is an object then we have only two args and the second one is the opts\n\t\tif (_.isObject(key)) {\n\t\t\t_opts = value || {};\n\t\t\tattrs = key;\n\t\t} else {\n\t\t\tattrs[key] = value;\n\t\t}\n\n\t\t// Updating `viewOptions`\n\t\tif (attrs.viewOptions != null) {\n\t\t\t// Protect `viewOptions` as an object\n\t\t\tif (!_.isObject(attrs.viewOptions)) {\n\t\t\t\tattrs.viewOptions = {};\n\t\t\t}\n\t\t\tnewViewAttrs = attrs.viewOptions;\n\t\t}\n\n\t\t// Deal with changes to `viewOptions`\n\t\tif (newViewAttrs && this.attributes.viewOptions) {\n\t\t\t// Clone a copy of old options\n\t\t\tconst oldViewAttrs = _.clone(this.attributes.viewOptions);\n\t\t\tif (newViewAttrs) {\n\t\t\t\t// Loop over new values\n\t\t\t\t_.each(newViewAttrs, (attr, k) => {\n\t\t\t\t\tif (_.isUndefined(oldViewAttrs[k])) {\n\t\t\t\t\t\t// Add to changes\n\t\t\t\t\t\tchanges.push({key: k, change: 'added'});\n\t\t\t\t\t\tattrsToChange[k] = attr;\n\t\t\t\t\t}\n\t\t\t\t\t// _.isEqual does not work for comparing models/collections\n\t\t\t\t\telse if (oldViewAttrs[k] !== attr) {\n\t\t\t\t\t\t// Add to changes\n\t\t\t\t\t\tchanges.push({key: k, change: 'changed'});\n\t\t\t\t\t\tattrsToChange[k] = attr;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Loop over old values\n\t\t\t\t_.each(oldViewAttrs, (attr, k) => {\n\t\t\t\t\tif (newViewAttrs[k] == null) {\n\t\t\t\t\t\t// Add to changes\n\t\t\t\t\t\tchanges.push({key: k, change: 'removed'});\n\t\t\t\t\t\tattrsToRemove[k] = attr;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// We want default backbone behavior here - see override in netx.js\n\t\t// This is because we do not care about all the stuff set being tracked in subCollections/subModels\n\t\t// We know that when this model is removed it just stops listening - if you are removing this model\n\t\t// from a viewCollection to put somewhere else - you would be [currently] doing it wrong\n\t\tconst ret = Backbone.Model.prototype.set.call(this, attrs, _opts);\n\n\t\t// Loop over changes and emit named change events\n\t\tif (changes.length) {\n\t\t\t// Unless silent was passed in opts\n\t\t\tif (_opts?.silent !== true) {\n\t\t\t\t// Loop and emit\n\t\t\t\t_.each(changes, (change) => {\n\t\t\t\t\t// The arguments are the same as any other Backbone.Model change event\n\t\t\t\t\tthis.trigger(\n\t\t\t\t\t\t'change:viewOptions:' + change.key,\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tnewViewAttrs[change.key],\n\t\t\t\t\t\t_opts,\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\t// Update view's options (except model/collection that is a special case and handled in the\n\t\t\t\t// listeners of this initialize)\n\t\t\t\tconst view = this.get('view');\n\t\t\t\tif (view) {\n\t\t\t\t\t// Set any changed attrs on the view\n\t\t\t\t\t_.extend(view, _.omit(attrsToChange, 'model', 'collection'));\n\t\t\t\t\t// Remove any values not present in the newViewAttrs from the view\n\t\t\t\t\t// save the model and/or collection\n\t\t\t\t\t_.each(_.omit(attrsToRemove, 'model', 'collection'), (opt, k) => {\n\t\t\t\t\t\tdelete view[k];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Backbone.Model.protoype.set return\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Is the provided `viewCollection` our original `viewCollection`?\n\t * @method\n\t * @param {Netx.Collections.AppViews} collection Our `viewCollecton`\n\t * @return {boolean}\n\t */\n\tisMyOriginalCollection(collection) {\n\t\treturn !this.collection ||\n\t\t\t!collection ||\n\t\t\t(this.get('queued') &&\n\t\t\t\tthis.collection.queueFor &&\n\t\t\t\tthis.collection.queueFor._listenId === collection._listenId) ||\n\t\t\tthis.collection._listenId === collection._listenId\n\t\t\t? true\n\t\t\t: false;\n\t}\n\t/**\n\t * @method\n\t * @param {object|string} key Either the key or an object of key values\n\t * @param {mixed} value Either a value or, if the key is an object, it is the options object\n\t * @param {object} opts If key is not an object this the options object, otherwise `null`\n\t */\n\tsetViewOption(key, value, opts) {\n\t\tconst newViewOptions = _.clone(this.get('viewOptions') || {});\n\t\tif (_.isObject(key)) {\n\t\t\t_.extend(newViewOptions, key);\n\t\t} else {\n\t\t\tnewViewOptions[key] = value;\n\t\t}\n\t\treturn this.set('viewOptions', newViewOptions, opts);\n\t}\n\t/**\n\t * Switch back to original `viewCollection`\n\t * @method\n\t */\n\tswitchBack() {\n\t\tthis.currentCollection && this.currentCollection.remove(this);\n\t\treturn this;\n\t}\n\t/**\n\t * Switch to another `viewCollection`\n\t * @method\n\t * @param {Netx.Collections.AppViews} collection Our `viewCollecton`\n\t */\n\tswitchTo(collection) {\n\t\tthis.collection.switchTo(this, collection);\n\t\treturn this;\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean} Valid\n\t */\n\tisViewActionValid() {\n\t\tconst view = this.get('view');\n\t\tif (!view) return true;\n\n\t\tconst uniqueShowAction = this.get('uniqueShowAction');\n\t\tconst actions = getEnabledActions(\n\t\t\t[FindLegacyAction(uniqueShowAction)],\n\t\t\tview,\n\t\t);\n\n\t\treturn actions.length > 0;\n\t}\n\n\t/** @type {boolean} */\n\tstatic get __isAppView__() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AppView';\n\t}\n}\n\nexport default AppView;\n","/**\n * CustomFormElement model\n *\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nclass CustomFormElement extends Base {\n\t/**\n\t * @property {object} defaults - Model defaults\n\t * @property {string} defaults.type - element type, (text, textarea, number, date, select, radios, checkboxes, multiselect)\n\t * @property {string} defaults.label - display label\n\t * @property {string} defaults.value - element options\n\t * @property {string} defaults.name - nice name\n\t * @property {string} defaults.required - required string\n\t * @property {boolean} defaults.disabled - if the form is read only\n\t * @property {string} defaults.userValue - data, if any, associated with this element\n\t * @property {string} defaults.userValue - checkbox data, if any, associated with this element\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\ttype: '',\n\t\t\tlabel: '',\n\t\t\tvalue: '',\n\t\t\tname: '',\n\t\t\trequired: '',\n\t\t\tdisabled: false,\n\t\t\tuserValue: '',\n\t\t\tuserValues: [],\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\tlet label = this.get('label');\n\t\tif (!label) return;\n\n\t\tconst toSet = {};\n\t\tconst value = this.get('value');\n\n\t\tlet lang = i18n.language.slice(0, 2);\n\t\tif (label[lang] == null) {\n\t\t\tlang = 'en';\n\t\t}\n\n\t\tif (typeof label === 'object') {\n\t\t\ttoSet.label = label[lang];\n\n\t\t\t// key should be mandatory, but it's left off sections in the wild\n\t\t\tif (!label.key && this.get('type') === 'section') {\n\t\t\t\tlabel.key = 'section' + this.cid;\n\t\t\t}\n\t\t} else if (typeof label === 'string') {\n\t\t\t// just incase\n\t\t\ttoSet.label = label;\n\t\t}\n\n\t\ttoSet.name = label.key ? label.key : this.makeName(toSet.label);\n\n\t\tif (_.isArray(value)) {\n\t\t\t_.each(value, (opt, idx, all) => {\n\t\t\t\tif (typeof opt === 'object') {\n\t\t\t\t\tall[idx] = {\n\t\t\t\t\t\tkey: opt.key,\n\t\t\t\t\t\tvalue: opt[lang],\n\t\t\t\t\t\tdisabled: opt.disabled,\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tall[idx] = {\n\t\t\t\t\t\tkey: this.makeName(opt),\n\t\t\t\t\t\tvalue: opt,\n\t\t\t\t\t\tdisabled: opt.disabled,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (this.collection.readOnly) {\n\t\t\ttoSet.disabled = true;\n\t\t}\n\n\t\tthis.set(toSet);\n\t}\n\t/** @method */\n\tmakeName(elementLabel) {\n\t\treturn this.constructor.makeName(elementLabel);\n\t}\n\t/**\n\t * @method\n\t * @return parsed element label\n\t */\n\tgetDisplayLabel() {\n\t\tconst label = this.get('label');\n\t\t// remove :\n\t\treturn label.replace(/:\\s*$/, '');\n\t}\n\t/**\n\t * @method\n\t * @return parsed element value\n\t */\n\tgetDisplayValue(value) {\n\t\tswitch (this.get('type')) {\n\t\t\tcase 'checkboxes':\n\t\t\tcase 'multiselect':\n\t\t\t\treturn value.replace(/\",\"/g, ', ');\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * @method\n\t * @static\n\t * @param {string} elementLabel Element label\n\t * @return {string} Name\n\t */\n\tstatic makeName(elementLabel) {\n\t\tif (elementLabel) {\n\t\t\treturn elementLabel\n\t\t\t\t.toLowerCase() // make everything lowercase\n\t\t\t\t.replace(/[-\\W]+/g, '-') // convert pattersn of multiple dashes or non-word characters -> a single dash\n\t\t\t\t.replace(/^-/, '') // strip any dash from front of slug\n\t\t\t\t.replace(/-$/, '');\n\t\t} else {\n\t\t\tconsole.warn('form element name error');\n\t\t\treturn '';\n\t\t}\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'CustomFormElement';\n\t}\n}\n\nexport default CustomFormElement;\n","/**\n * @class\n * @extends Netx.Model\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport Menu from '@netx/core/lib/netx-menu';\nimport {currentUserMeetsUserLevel} from '@netx/core-user/utils/currentUserMeetsUserLevel';\nimport {FindLegacyAction} from '@netx/core/legacyActionManager';\n\nclass OptionTile extends Base {\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\taction: '',\n\t\t\tevent: '',\n\t\t\ticon: null,\n\t\t\tlabel: '',\n\t\t\tmenu: null,\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attr = {}, opts = {}) {\n\t\tsuper(attr, opts);\n\n\t\t// Action string\n\t\tif (_.isString(attr.action)) {\n\t\t\t// Innocent until proven guilty in a court of law\n\t\t\tlet valid = true;\n\t\t\t// Get action object\n\t\t\tlet action = FindLegacyAction(attr.action);\n\n\t\t\t// Unregistered action\n\t\t\tif (!action) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'Could not locate an action for \"' +\n\t\t\t\t\t\tattr.action +\n\t\t\t\t\t\t'\". Ensure it has been registered view Netx.Action.Register.',\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Run through enabler test(s)\n\t\t\tif (action.enableTest) {\n\t\t\t\t// We have multiple enabler tests\n\t\t\t\tif (_.isArray(action.enableTest)) {\n\t\t\t\t\t_.each(action.enableTest, (et) => {\n\t\t\t\t\t\t// If still valid\n\t\t\t\t\t\tif (valid && _.isFunction(et)) {\n\t\t\t\t\t\t\t// Hopefully you passed an object containing something that can be tested\n\t\t\t\t\t\t\t// TODO: update after DAM-6168 is fixed.\n\t\t\t\t\t\t\tvalid = et(opts);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// Just a single enabler test\n\t\t\t\telse if (_.isFunction(action.enableTest)) {\n\t\t\t\t\t//valid = action.enableTest( opts );\n\t\t\t\t\t//\n\t\t\t\t\t// DAM-6168: this generally won't work. EnableTests expect a view and an event as args.\n\t\t\t\t\t// Here's a hacking option for 8.5: see cart:relationships handler for the other end of the snake.\n\t\t\t\t\tif (opts.data && opts.data.view) {\n\t\t\t\t\t\tvalid = action.enableTest(opts.data.view);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalid = action.enableTest(opts);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Check user level\n\t\t\tif (action.userLevel && !currentUserMeetsUserLevel(action.userLevel)) {\n\t\t\t\tvalid = false;\n\t\t\t}\n\n\t\t\t// All is good\n\t\t\tif (valid) {\n\t\t\t\tthis.attributes = _.extend({}, this.attributes, action);\n\t\t\t\t// Additional 'payload' data\n\t\t\t\t// Useful for enablerTests and permissions checks\n\t\t\t\tthis.attributes.data = opts.data;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!(attr.action instanceof Menu)) {\n\t\t\tconsole.warn('Unknown action: ' + attr.action);\n\t\t\treturn;\n\t\t}\n\n\t\t// Action menu\n\t\tthis.attributes = _.extend({}, this.attributes, {\n\t\t\t// We just point the action back at 'app:optionTiles' which will take this model's menu object and keep going\n\t\t\taction: 'app:showOptions',\n\t\t\tevent: 'app:showOptions',\n\t\t\tmenu: attr.action,\n\t\t\ticon: attr.action.get('icon'),\n\t\t\tlabel: attr.action.get('label'),\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'OptionTile';\n\t}\n}\n\nexport default OptionTile;\n","/**\n * Describe your model\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\nimport Netx from '@netx/core/bootstrap';\nimport {dispatcher} from '@netx/core-next/dispatcher';\n\nclass Pager extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - Model defaults\n\t * @property {string} defaults.currentPage - Current page number\n\t * @property {number} defaults.itemTotal - Total number of items\n\t * @property {number} defaults.pageSize - Items per page\n\t * @property {number} defaults.pagesToDisplay - Number of numeric page options to display\n\t * @property {number} defaults.pageTotal - Total number of pages\n\t * @property {boolean} defaults.routesToPage - Changing page causes route (TODO: this should not be handled in the pager model itself)\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tcurrentPage: 1,\n\t\t\titemTotal: 0,\n\t\t\tpageSize: 50,\n\t\t\tpagesToDisplay: 8,\n\t\t\tpageTotal: 0,\n\t\t\tstartIndex: null,\n\t\t\troutesToPage: true,\n\t\t};\n\t}\n\n\t/**\n\t * When passing options to a madel, Backbone will look for a definition of the model's collection and if we should parse the initial attributes (which also receives our options object)\n\t * All options are then passed along to the set method which is fired off the bat to set the model's attributes\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\t// Debounced/throttled methods\n\t\tthis.changedCurrentPage = _.debounce(this.changedCurrentPage, 50);\n\n\t\t// Hey, listen!\n\t\tthis.on('change:itemTotal change:pageSize', this.calculatePages).on(\n\t\t\t'change:currentPage',\n\t\t\tthis.changedCurrentPage,\n\t\t);\n\n\t\tif (this.collection) {\n\t\t\t// To avoid any pager total collision, when we fetch we do not want to listen\n\t\t\t// for add and removes until after the sync\n\t\t\tthis.listenTo(this.collection, 'request:read', () => {\n\t\t\t\tthis.stopListening(this.collection, 'add').stopListening(\n\t\t\t\t\tthis.collection,\n\t\t\t\t\t'remove',\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tthis.listenTo(this.collection, 'destroy', () => {\n\t\t\t\tconst assetCount = this.get('itemTotal');\n\t\t\t\tassetCount && this.set('itemTotal', assetCount - 1);\n\t\t\t}).listenTo(this.collection, 'sync', (collection, results, opts) => {\n\t\t\t\tif (!collection.selection) return;\n\n\t\t\t\tconst p = {};\n\t\t\t\tp.firstIndex = collection.selection.startPosition;\n\t\t\t\tp.lastIndex = p.firstIndex + collection.length - 1; // i think this is smarter.\n\t\t\t\tp.firstPage = p.firstIndex == 1;\n\t\t\t\tp.lastChunk = this.lastChunk;\n\n\t\t\t\t// logic: imagine chunkSize = 50, then ...\n\t\t\t\t// startPosition 1 = page 1\n\t\t\t\t// startPosition 2 - 51 = page 2 ( < 51 is an abnormal start position, but it's ahead of some assets)\n\t\t\t\t// startPosition 52 = page 3, and so on.\n\t\t\t\tp.currentPage = Math.ceil((p.firstIndex - 1) / collection.pageSize) + 1;\n\n\t\t\t\tif (this.has('itemTotal')) {\n\t\t\t\t\t// 1 = 1 page. 51- 100 = 2 pages. 101 = 3 pages. And so on.\n\t\t\t\t\tp.pageTotal = Math.ceil(this.get('itemTotal') / collection.pageSize);\n\t\t\t\t}\n\n\t\t\t\tthis.set(p);\n\n\t\t\t\t// To be safe, if anything rogue fires syncs without a `request:read`\n\t\t\t\t// cleanup\n\t\t\t\tthis.stopListening(this.collection, 'add')\n\t\t\t\t\t.stopListening(this.collection, 'remove')\n\t\t\t\t\t.listenTo(this.collection, 'add', (model, collection, opts) => {\n\t\t\t\t\t\tif (opts.index == null || opts.success != null) return;\n\t\t\t\t\t\tthis.adjustTotal(1);\n\t\t\t\t\t})\n\t\t\t\t\t.listenTo(this.collection, 'remove', (model, collection, opts) => {\n\t\t\t\t\t\tif (opts.index == null || opts.success != null) return;\n\t\t\t\t\t\tthis.adjustTotal(-1);\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Calculate the total asset count after add or remove\n\t * @param {number} adj (+1 or -1)\n\t * @method\n\t */\n\tadjustTotal(adj) {\n\t\tconst assetCount = this.get('itemTotal');\n\t\tassetCount && this.set('itemTotal', assetCount + adj);\n\t}\n\n\t/**\n\t * Calculate the total number of pages required given itemTotal and pageSize\n\t * @method\n\t */\n\tcalculatePages() {\n\t\tconst pageTotal = Math.ceil(this.get('itemTotal') / this.get('pageSize'));\n\t\tthis.set('pageTotal', pageTotal);\n\t}\n\n\t/**\n\t * @method\n\t * @param {module:app/models/pager} pager Pager (this)\n\t * @param {number} page Page\n\t * @param {object} opts Options\n\t */\n\tchangedCurrentPage(pager, page, opts) {\n\t\tconst collection = this.collection;\n\n\t\tif (!collection) return;\n\n\t\t// see if this pager uses the route\n\t\tif (this.get('routesToPage')) {\n\t\t\tdispatcher.trigger('router:page', page, this.collection.routeContext);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.collection.gotoPage(page, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Options\n\t */\n\tfirstPage(opts) {\n\t\tthis.set('currentPage', 1, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @return {object} PageDTO\n\t */\n\tgetPageDTO() {\n\t\tconst pageDTO = {\n\t\t\tsize: this.get('pageSize'),\n\t\t};\n\n\t\tif (this.get('startId') != null) {\n\t\t\tpageDTO.startId = this.get('startId');\n\t\t} else {\n\t\t\t// This is 0 based pager\n\t\t\tpageDTO.startIndex = (this.get('currentPage') - 1) * this.get('pageSize');\n\t\t}\n\n\t\treturn pageDTO;\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} page Page number\n\t * @param {object} opts Options\n\t */\n\tgotoPage(page, opts) {\n\t\tthis.set('currentPage', parseInt(page), opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Options\n\t */\n\tlastPage(opts) {\n\t\tthis.set('currentPage', this.get('pageTotal'), opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Options\n\t */\n\tnextPage(opts) {\n\t\tconst currentPage = this.get('currentPage');\n\t\tif (currentPage >= this.get('pageTotal')) return;\n\n\t\tthis.set('currentPage', currentPage + 1, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Options\n\t */\n\tprevPage(opts) {\n\t\tconst currentPage = this.get('currentPage');\n\t\tif (currentPage <= 1) return;\n\n\t\tthis.set('currentPage', currentPage - 1, opts);\n\t}\n\n\t/**\n\t * We get back a start index on paging calls\n\t * @method\n\t * @param {number} index Index\n\t */\n\tsetStartIndex(index, opts) {\n\t\treturn this.set(\n\t\t\t{\n\t\t\t\tcurrentPage: Math.floor(index / this.get('pageSize') + 1),\n\t\t\t\tstartIndex: index,\n\t\t\t},\n\t\t\t{fetch: false, ...opts},\n\t\t);\n\t}\n\t/**\n\t * When clearing the current cart we need to reset the pager\n\t * without trashing instance specific attributes\n\t * @method\n\t */\n\tclearPages() {\n\t\tthis.set({\n\t\t\tcurrentPage: 1,\n\t\t\tfirstIndex: 1,\n\t\t\titemTotal: 0,\n\t\t\tpageTotal: 0,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Pager';\n\t}\n}\n\nexport default Pager;\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nclass Progress extends Base {\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {boolean} defaults.active - Progress is active\n\t * @property {string} defaults.message - Progress message\n\t * @property {number} defaults.percent - Progress percentage\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tpercent: 0,\n\t\t\tmessage: '',\n\t\t\tactive: false,\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\t// Use delay option if passed\n\t\tthis.delay = opts.delay != null ? opts.delay : 1000;\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} message Message\n\t */\n\tcomplete(message) {\n\t\tthis.set({\n\t\t\tmessage: message || '',\n\t\t\tpercent: 100,\n\t\t});\n\t\t_.delay(() => {\n\t\t\tthis.set({\n\t\t\t\tactive: false,\n\t\t\t\tpercent: 0,\n\t\t\t});\n\t\t}, this.delay);\n\t}\n\n\t/**\n\t * We have no server methods - just cleanup\n\t * @override\n\t */\n\tdestroy() {\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * @method\n\t */\n\treset() {\n\t\tthis.set(this.constructor.GetDefaults());\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} percent Percent\n\t * @param {string} message Message\n\t */\n\tupdate(percent, message) {\n\t\tthis.set({\n\t\t\tactive: true,\n\t\t\tmessage: message || '',\n\t\t\tpercent: percent,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Progress';\n\t}\n}\n\nexport default Progress;\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nclass Sorter extends Base {\n\t/**\n\t * @property {object} defaults - Model defaults\n\t * @property {string} defaults.field - Sort field\n\t * @property {string} defaults.sortOrder - Sort order (asc, desc)\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tfield: '',\n\t\t\torder: 'desc',\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * If not provided, the keys of the collection's models will be used\n\t\t * @memberof module:app/models/sorter\n\t\t * @alias sortableFields\n\t\t * @type {array}\n\t\t */\n\t\tthis.sortableFields =\n\t\t\topts.sortableFields || _.keys(this.collection.model.GetDefaults());\n\n\t\t/**\n\t\t * @memberof module:app/models/sorter\n\t\t * @alias sortableOrders\n\t\t * @type {array}\n\t\t */\n\t\tthis.sortableOrders = opts.sortableOrders || ['asc', 'desc'];\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(\n\t\t\tthis,\n\t\t\t'change',\n\t\t\t_.debounce((sorter, opts) => {\n\t\t\t\tthis.collection[this.collection.preferredFetchMethod || 'fetch'](\n\t\t\t\t\t_.extend({duplicateQueryPolicy: 'abort'}, opts),\n\t\t\t\t);\n\t\t\t}, 15),\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @return {object}\n\t */\n\tgetSortDTO() {\n\t\treturn this.self();\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} field Field\n\t * @param {string} order Order\n\t */\n\tsetSort(field, order) {\n\t\torder = order || 'desc';\n\t\t// Normalize\n\t\tif (order === 'descending') order = 'desc';\n\t\tif (order === 'ascending') order = 'asc';\n\n\t\tif (!_.contains(this.sortableFields, field)) {\n\t\t\tthrow new Error('Invalid sort `field` \"' + field + '\"');\n\t\t}\n\t\tif (!_.contains(this.sortableOrders, order)) {\n\t\t\tthrow new Error('Invalid sort `order` \"' + order + '\"');\n\t\t}\n\n\t\treturn this.set({\n\t\t\tfield: field,\n\t\t\torder: order,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Sorter';\n\t}\n}\n\nexport default Sorter;\n","/**\n * @class\n * @extends Netx.Model\n * @see Netx.Collections.StorageLocations\n */\nimport Base from '@netx/core/lib/netx-model';\n\nclass StorageLocation extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Set the attribute backbone will look to as the id\n\t * @type {string}\n\t */\n\tget idAttribute() {\n\t\treturn 'locationId';\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.active - The default system location active (pseudo boolean 0/1)\n\t * @property {string} defaults.basePath - The default system location base path\n\t * @property {number} defaults.capacitySize - The defualt system location capacity size\n\t * @property {string} defaults.creationdate - The defualt system location creation date\n\t * @property {number} defaults.currentSize - The defualt system location current size\n\t * @property {number} defaults.defaultLocation - The defualt system location default (pseudo boolean 0/1)\n\t * @property {string} defaults.key1 - The default system location key1\n\t * @property {string} defaults.key2 - The default system location key2\n\t * @property {string} defaults.locationTypeName - The defualt system location type name\n\t * @property {number} defaults.locationTypeStatus - The defualt system location type status\n\t * @property {number} defaults.locationTypeId - The default system location type id - ( File url - 1, HTTP URL - 3, offline - 8, Amazon - 9, Microsoft - 10, box - 101, Not implemented [database - 2, dvd - 4, cd - 5, jazz - 6, zip - 7])\n\t * @property {number} defaults.locationId - The defualt system location id\n\t * @property {number} defaults.members - The defualt system location members\n\t * @property {string} defaults.name - The defualt system location name\n\t * @property {string} defaults.notes - The defualt system location notes\n\t * @property {number} defaults.sync - The defualt system location sync (pseudo boolean 0/1)\n\t * @property {string} defaults.userEmail - The defualt system location user email\n\t * @property {number} defaults.userid - The defualt system location user id\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tactive: 0,\n\t\t\tbasePath: '',\n\t\t\tcapacitySize: 0,\n\t\t\tcreationdate: '',\n\t\t\tcurrentSize: 0,\n\t\t\tdefaultLocation: 0,\n\t\t\tkey1: '',\n\t\t\tkey2: '',\n\t\t\tlocationTypeName: '',\n\t\t\tlocationTypeStatus: 0,\n\t\t\tlocationTypeId: 0,\n\t\t\t// locationId : 0,\n\t\t\tmembers: 0,\n\t\t\tname: '',\n\t\t\tnotes: '',\n\t\t\tsync: 0,\n\t\t\tuserEmail: '',\n\t\t\tuserid: 0,\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn ['label', 'locationTypeLabel'];\n\t}\n\n\t/**\n\t * RPC methods:\n\t * @rpcs\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn ['getLocationObjects', [this.id], false];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tcreate(opts) {\n\t\t\t\treturn ['setLocationObject', this.self()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate(opts) {\n\t\t\t\treturn ['setLocationObject', this.self()];\n\t\t\t},\n\t\t\t/** @method */\n\t\t\tremove: ['deleteLocation', 'locationId'],\n\t\t};\n\t}\n\n\t/**\n\t * Parsers for this model\n\t * @type {object}\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(data, opts) {\n\t\t\t\tif (!data.length) return null;\n\n\t\t\t\tdata = data[0];\n\t\t\t\treturn _.extend(data, {\n\t\t\t\t\tlabel: i18n.t('i18n.' + _.toCamelCase(data.name), {\n\t\t\t\t\t\tdefaultValue: data.name,\n\t\t\t\t\t}),\n\t\t\t\t\tlocationTypeLabel: i18n.t(\n\t\t\t\t\t\t'app:i18n.' + _.toCamelCase(data.locationTypeName),\n\t\t\t\t\t\t{defaultValue: data.locationTypeName},\n\t\t\t\t\t),\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(\n\t\t\tthis,\n\t\t\t'change:locationTypeName',\n\t\t\t(model, locationTypeName) => {\n\t\t\t\tthis.set(\n\t\t\t\t\t'locationTypeLabel',\n\t\t\t\t\ti18n.t('i18n.' + _.toCamelCase(locationTypeName), {\n\t\t\t\t\t\tdefaultValue: locationTypeName,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t).listenTo(this, 'change:name', (model, name) => {\n\t\t\tthis.set(\n\t\t\t\t'label',\n\t\t\t\ti18n.t('i18n.' + _.toCamelCase(name), {defaultValue: name}),\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * @param {object} data Data\n\t * @param {object} opts Options\n\t */\n\tparseAndSave(data, opts) {\n\t\t// Collect needed data\n\t\tconst updatedData = _.extend(\n\t\t\t_.pick.apply(_, [data].concat(_.keys(this.constructor.GetDefaults()))),\n\t\t\t{\n\t\t\t\tactive: data.active || data.defaultLocation ? 1 : 0,\n\t\t\t\tdefaultLocation: data.defaultLocation ? 1 : 0,\n\t\t\t\tsync: data.sync ? 1 : 0,\n\t\t\t\tlocationTypeId: parseInt(data.locationTypeId),\n\t\t\t},\n\t\t);\n\n\t\t// Save changes\n\t\treturn this.save(updatedData, _.extend({wait: true}, opts));\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} active Active\n\t * @param {object} opts Options\n\t */\n\tsetActive(active, opts) {\n\t\treturn this.save(\n\t\t\t{\n\t\t\t\tsync: active ? 1 : 0,\n\t\t\t},\n\t\t\t_.extend({wait: true}, opts),\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Options\n\t */\n\tsetAsDefault(opts) {\n\t\treturn this.save(\n\t\t\t{\n\t\t\t\tactive: 1,\n\t\t\t\tdefaultLocation: 1,\n\t\t\t},\n\t\t\t_.extend({wait: true}, opts),\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} sync Sync\n\t * @param {object} opts Options\n\t */\n\tsetSync(sync, opts) {\n\t\treturn this.save(\n\t\t\t{\n\t\t\t\tsync: sync ? 1 : 0,\n\t\t\t},\n\t\t\t_.extend({wait: true}, opts),\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'StorageLocation';\n\t}\n}\n\nexport default StorageLocation;\n","// Definitions of the various autocompletion API calls go here.\n// The return types are 'lvb' for an array of labelValueBeans, or 'string' for an array of strings.\n// TODO: double-check that all these permissionMatrixLevel integers match what Flex uses.\nexport const completions = {\n\tattributeHistory: {\n\t\tdata: [] as string[],\n\t\treturn: 'lvb',\n\t},\n\tsearch: {\n\t\tapi: 'getKeywordAutoList',\n\t\targs: ['_TERM_', ''], // required to pass a blank second argument.\n\t\treturn: 'string',\n\t},\n\tsavedSearch: {\n\t\tapi: 'getSavedSearchAutoList',\n\t\targs: ['_TERM_'],\n\t\treturn: 'lvb',\n\t},\n\tasset: {\n\t\tapi: 'getAssetAutoList',\n\t\targs: ['_TERM_'],\n\t\treturn: 'lvb',\n\t},\n\tcategory(opts: Record) {\n\t\treturn {\n\t\t\tapi: 'getCategoryAutoList',\n\t\t\targs: ['_TERM_', opts['permission-matrix-level'] || 1],\n\t\t\treturn: 'lvb',\n\t\t};\n\t},\n\tcategoryName(opts: Record) {\n\t\treturn {\n\t\t\tapi: 'getCategoryAutoList',\n\t\t\targs: ['_TERM_', opts['permission-matrix-level'] || 1],\n\t\t\treturn: 'string',\n\t\t};\n\t},\n\tdomain: {\n\t\tapi: 'getDomainAutoList',\n\t\targs: ['_TERM_'],\n\t\treturn: 'lvb',\n\t},\n\tuser(opts: Record) {\n\t\treturn {\n\t\t\tapi: 'getUserAutoList',\n\t\t\targs: ['_TERM_', opts['permission-matrix-level'] || 1],\n\t\t\treturn: 'lvb',\n\t\t};\n\t},\n\tsharedResource(opts: Record) {\n\t\treturn {\n\t\t\tapi: 'getSharedResourceAutoList',\n\t\t\targs: [opts['resource-name'], '_TERM_', opts.permission || 'read'],\n\t\t\treturn: 'lvb',\n\t\t};\n\t},\n\tgroup: {\n\t\tapi: 'getGroupAutoList',\n\t\targs: ['_TERM_'],\n\t\treturn: 'lvb',\n\t},\n\tpage: {\n\t\t// This is local data which will be populated when available\n\t\tdata: [] as string[],\n\t\treturn: 'string',\n\t},\n\tsemanticObjects(opts: Record) {\n\t\treturn {\n\t\t\tapi: 'getSemanticObjectAutoList',\n\t\t\targs: ['_TERM_', opts['semantic-object-type-id']],\n\t\t\treturn: 'string',\n\t\t};\n\t},\n\tsemanticObjectTypes: {\n\t\tapi: 'getSemanticObjectTypeAutoList',\n\t\targs: ['_TERM_'],\n\t\treturn: 'lvb',\n\t},\n\ttag(opts: Record) {\n\t\treturn {\n\t\t\tapi: 'metadataAutoCompleteLookup',\n\t\t\targs: [opts['dataset-id'], '_TERM_'],\n\t\t\treturn: 'string',\n\t\t};\n\t},\n\tcart: {\n\t\tapi: 'getSavedCartAutoList',\n\t\targs: ['_TERM_'],\n\t\treturn: 'lvb',\n\t},\n\tsavedCart: {\n\t\t// duplicate of above\n\t\tapi: 'getSavedCartAutoList',\n\t\targs: ['_TERM_'],\n\t\treturn: 'lvb',\n\t},\n\tmetadataLookup(opts: Record) {\n\t\treturn {\n\t\t\tapi: 'metadataDatasetAutoList',\n\t\t\targs: [opts['template-id'], '_TERM_'],\n\t\t\treturn: 'string',\n\t\t};\n\t},\n\tattributeProfile: {\n\t\tapi: 'getAttributeProfileAutoList',\n\t\targs: ['_TERM_'],\n\t\treturn: 'lvb',\n\t},\n\tvocabulary: {\n\t\tapi: 'vocabularyLookup',\n\t\targs: ['_TERM_'],\n\t\treturn: 'inb',\n\t},\n\tvocabularyValue(opts: Record) {\n\t\treturn {\n\t\t\tapi: 'vocabularyValueLookup',\n\t\t\targs: [opts['vocabulary-id'], '_TERM_'],\n\t\t\treturn: 'string',\n\t\t};\n\t},\n};\n\nexport default {completions};\n","// See Netx.Collections.StorageLocations `getLocationTypes` parser for how typeIds/labels/types get set\nexport let typeIds = {};\nexport let typeLabels = {};\n\nexport default {typeIds, typeLabels};\n","import {setGlobal} from '@netx/core-next/utils/setGlobal';\nimport AppViewsCollection from '../collections/appViews';\n\nexport const appViews = new AppViewsCollection([]);\n\nexport default appViews;\n\nsetGlobal({appViews});\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-multiView';\nimport Template from '../templates/appBodyView.html';\n\nclass AppBodyView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.additionalViewClasses = opts.additionalViewClasses || 'body-view';\n\t\topts.childView = {\n\t\t\tviewClass(model) {\n\t\t\t\treturn model.get('viewClass');\n\t\t\t},\n\t\t\t...opts.childView,\n\t\t};\n\t\topts.id = opts.id || 'body-view';\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\t}\n\n\t/**\n\t * @static\n\t * @type {string}\n\t */\n\tstatic get __name__() {\n\t\treturn 'AppBodyView';\n\t}\n}\n\nexport default AppBodyView;\n","import Base from 'netxcore@netx/core-app/views/appBodyView';\nimport '../css/appBodyViews.less';\n\nexport default Base;\n","import AppViewsCollection from '../collections/appViews';\nimport AppBodyView from '../views/appBodyView';\n\nexport const bodyViews = new AppViewsCollection([]);\n\nexport const bodyView = new AppBodyView({\n\tviewCollection: bodyViews,\n});\n\nexport default bodyViews;\n\nimport {setGlobal} from '@netx/core-next/utils/setGlobal';\nif (process.env.NODE_ENV !== 'production') {\n\tsetGlobal({bodyViews});\n}\n","import {dispatcher} from '@netx/core-next/dispatcher';\nimport {RegisterLegacyAction} from '@netx/core/legacyActionManager';\nimport AppViewsCollection from '../collections/appViews';\n\nexport const fsViews = new AppViewsCollection([]);\n\nRegisterLegacyAction([\n\t{\n\t\tevent: 'app:remove:fsView',\n\t\tlabel: '',\n\t\twrapper: function (v: any) {\n\t\t\treturn [v.model];\n\t\t},\n\t},\n]);\n\n/**\n * Removes all fullscreen views (and in turn closes the fullscreen view if open)\n * @event module:app#app:reset:fsViews\n */\ndispatcher.on('app:reset:fsViews', function () {\n\tfsViews.set([]);\n});\n\n/**\n * @event module:app#app:remove:fsView\n * @param {Netx.Models.AppView} appView App view model\n */\ndispatcher.on('app:remove:fsView', function (appView: any) {\n\tconst view = appView.get('view');\n\tif (!view) return;\n\n\t// TODO: set property that tells us if this is a form view - no need to be doing this instance of stuff\n\t// in the current state it would be something like: `isFormView: true`\n\t// when we start extending functionality and not whole views we can keep an array of the funstionality\n\t// that has been extended - `functionality: ['form', 'table']`\n\n\t// Let the view know it has been `cancelled`\n\t// Allows us to utlize the standard event system\n\tif (view.hasFunctionality('form') && typeof view.cancel === 'function') {\n\t\tappView.collection._listenId === fsViews._listenId && view.cancel();\n\t\treturn;\n\t}\n\t// Will remove from fs childViews\n\tfsViews.remove(appView.id);\n\t// Let the hide stuff run so we do not get jerky results\n\t// all fs views are set to remove on hidden so long as the simple param is not passed\n\t// view.hide();\n});\n\nexport default fsViews;\n\nimport {setGlobal} from '@netx/core-next/utils/setGlobal';\nsetGlobal({fsViews});\n","import {RegisterLegacyAction} from '@netx/core/legacyActionManager';\nimport AppViewsCollection from '../collections/appViews';\nimport AppModalView from '../views/appModalView';\n\nexport const modalViews = new AppViewsCollection([]);\n\nexport const modalView = new AppModalView({\n\tviewCollection: modalViews,\n});\n\nRegisterLegacyAction([\n\t{\n\t\tevent: 'app:remove:modalView',\n\t\tlabel: '',\n\t\twrapper: (v: any) => {\n\t\t\treturn [v.model];\n\t\t},\n\t},\n]);\n\n/**\n * @event module:app#app:remove:modalView\n * @param {Netx.Models.AppView} appView App view model\n */\ndispatcher.on('app:remove:modalView', function (appView: any) {\n\tconst view = appView.get('view');\n\tif (!view) return;\n\n\t// Vars\n\tconst modalOpts = view.modalOptions || {};\n\tconst activeView = modalViews.findWhere({active: true}) as any;\n\tconst activeViewModalOpts =\n\t\tactiveView && activeView.modalOptions ? activeView.modalOptions : {};\n\n\t// Can't do that while blocking\n\tif (modalOpts.blocking === true || activeViewModalOpts.blocking === true) {\n\t\treturn;\n\t}\n\t// Let the view know it has been `cancelled`\n\t// Allows us to utlize the standard event system\n\tif (view.hasFunctionality('form') && typeof view.cancel === 'function') {\n\t\tappView.collection._listenId === modalViews._listenId && view.cancel();\n\t\treturn;\n\t} else {\n\t\t// Will remove from modal childViews\n\t\tmodalViews.remove(appView.id);\n\t\t// Let the hide stuff run so we do not get jerky results\n\t\t// all modal views are set to remove on hidden so long as the simple param is not passed\n\t\t// view.hide();\n\t}\n});\n/**\n * Removes all modal views (and in turn closes modal if open)\n * @event module:app#app:reset:modalViews\n */\ndispatcher.on('app:reset:modalViews', function () {\n\tmodalViews.set([]);\n});\n\nexport default modalViews;\n","/**\n * View utilized by the {@link module:app#app:alert|app:alert} to display alerts to the user\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/alertView.html';\n\nclass AlertView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.events = _.extend(\n\t\t\t{\n\t\t\t\t'click [data-nx-control=\"dismiss\"]:first': 'hide',\n\t\t\t},\n\t\t\topts.events,\n\t\t);\n\t\topts.id = opts.id || _.uniqueId('alert-');\n\t\topts.modalOptions = _.extend(\n\t\t\t{\n\t\t\t\tblocking: true,\n\t\t\t},\n\t\t\topts.modalOptions,\n\t\t);\n\t\topts.removeOnHide = opts.removeOnHide !== false;\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\n\t\tthis.alertClass = opts.alertClass;\n\t\tthis.msg = opts.msg;\n\t\tthis.type = opts.type;\n\n\t\tif (this.model) {\n\t\t\tthis.headerTitle = this.model.get('type');\n\t\t}\n\t}\n\n\t/**\n\t * @static\n\t * @type {string}\n\t */\n\tstatic get __name__() {\n\t\treturn 'AlertView';\n\t}\n}\n\nexport default AlertView;\n","import {UserLevel} from '@netx/core-user/constants';\n\nexport const MINIMUM_USER_LEVEL = UserLevel.MANAGER;\n","import type {AssetGalleryAsset} from '@netx/core-asset-gallery/types';\nimport {PermissionMatrixName} from '@netx/core-permissions/constants';\nimport {allows} from '@netx/core-permissions/utils';\nimport {currentUserMeetsUserLevel} from '@netx/core-user/utils/currentUserMeetsUserLevel';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport type {Asset} from '@netx/core-asset-next/types';\nimport {MINIMUM_USER_LEVEL} from './constants';\nimport {assetExpires} from './utils';\n\nexport const assetExpirationEnabled = () =>\n\tgetPreference('asset.expire.enabled', true);\n\nexport const canModifyAssetExpiration = (asset: AssetGalleryAsset | Asset) =>\n\tassetExpirationEnabled() &&\n\tcurrentUserMeetsUserLevel(MINIMUM_USER_LEVEL) &&\n\tallows(asset.permissionMatrix, PermissionMatrixName.DELETE);\n\nexport const canExpireAsset = (asset: AssetGalleryAsset | Asset) =>\n\t!assetExpires(asset) && canModifyAssetExpiration(asset);\n\nexport const canUnexpireAsset = (asset: AssetGalleryAsset | Asset) =>\n\tassetExpires(asset) && canModifyAssetExpiration(asset);\n","import {utc} from '@netx/core/lib/netx-moment';\n\n/**\n * @param expirationDate datetime in milliseconds\n */\nexport const assetExpirationToDateString = (expirationDate: number) => {\n\treturn `${utc(expirationDate).local().format('YYYY-MM-DD')}`;\n};\n\nexport default assetExpirationToDateString;\n","import {AssetGalleryAsset} from '@netx/core-asset-gallery/types';\nimport type {Asset} from '@netx/core-asset-next/types';\n\nexport const assetExpires = (asset: AssetGalleryAsset | Asset) =>\n\t!!asset.expirationDate;\nexport default assetExpires;\n","import moment from '@netx/core/lib/netx-moment';\n\nexport const userInputToExpirationTime = (expirationDate: string) => {\n\tconst date = moment(expirationDate).endOf('day');\n\tdate.utc();\n\n\tconst tomorrow = moment().utc(false).add(1, 'day').valueOf();\n\n\t// Make sure date is valid and that it is greater than or equal to tomorrow\n\tif (!date.isValid() || date.valueOf() < tomorrow) {\n\t\tthrow new Error('Invalid expiration date');\n\t}\n\n\treturn date.valueOf();\n};\n\nexport default userInputToExpirationTime;\n","import {UserLevel} from '@netx/core-user/constants';\n\nexport const ASSET_DOWNLOAD_MINUMUM_USER_LEVEL = UserLevel.CONSUMER;\nexport const ASSET_RESYNC_MINIMUM_USER_LEVEL = UserLevel.PRODUCER;\n\nexport enum AssetPref {\n\tCHECKSUM_ENABLED = 'metadata.checksumEnabled',\n}\n","import type {Asset} from '@netx/core-asset/types';\nimport {assetIsPresent, isAssetCheckedOut} from '@netx/core-asset/utils';\nimport {PermissionMatrixName} from '@netx/core-permissions/constants';\nimport {allows} from '@netx/core-permissions/utils/allows';\nimport {mediaServicesAvailable} from '@netx/core-share-media-service/enablers';\nimport {pendingAssets} from '@netx/core-asset/collections/singleton/pendingAssets';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport {\n\tcurrentUserMeetsUserLevel,\n\tUserLevel,\n} from '@netx/core-user/utils/currentUserMeetsUserLevel';\nimport {ASSET_RESYNC_MINIMUM_USER_LEVEL, AssetPref} from './constants';\n\nexport const checksumEnabled = () =>\n\tgetPreference(AssetPref.CHECKSUM_ENABLED, true);\n\n/** Check that asset isn't pending */\nexport const assetNotPending = (asset?: Asset) =>\n\tasset != null && pendingAssets.get(asset.assetId) != null;\n\nexport const canDeleteAsset = (asset?: Asset) =>\n\tasset != null && allows(asset.permissionMatrix, PermissionMatrixName.DELETE);\n\nexport const canCreatePdfFromAsset = (asset?: Asset) =>\n\tasset != null &&\n\tcurrentUserMeetsUserLevel(UserLevel.CONSUMER) &&\n\tassetIsPresent(asset) &&\n\tallows(asset.permissionMatrix, PermissionMatrixName.DOWNLOAD);\n\nexport const canDownloadAsset = (asset?: Asset) =>\n\tasset != null &&\n\t!isAssetCheckedOut(asset) &&\n\tassetIsPresent(asset) &&\n\tallows(asset.permissionMatrix, PermissionMatrixName.DOWNLOAD);\n\nexport const canOrganizeAsset = (asset?: Asset) =>\n\tasset != null &&\n\tcurrentUserMeetsUserLevel(UserLevel.MANAGER) &&\n\tallows(asset.permissionMatrix, PermissionMatrixName.MODIFY);\n\nexport const canResyncAsset = (asset?: Asset) =>\n\tasset != null &&\n\tcurrentUserMeetsUserLevel(ASSET_RESYNC_MINIMUM_USER_LEVEL) &&\n\tassetIsPresent(asset) &&\n\tallows(asset.permissionMatrix, PermissionMatrixName.MODIFY);\n\n// TODO: this is incomplete at the moment... more, it is a holdover for react until we get the share menu\n// reworked one day\nexport const canShareAsset = (asset?: Asset) => {\n\tif (asset == null) return false;\n\t// share:assetSet:users is not for assets currently\n\treturn (\n\t\t// share:feed:new -> [mediaServicesAvailable]\n\t\t(currentUserMeetsUserLevel(UserLevel.DIRECTOR) &&\n\t\t\tmediaServicesAvailable()) ||\n\t\t// share:assetSet:token -> matrix: 'download',\n\t\t// share:assetSet:media:service -> [mediaServicesEnabled, downloadOptionSelected], matrix: 'download',\n\t\t// share:token:embed -> [canEmbed], matrix: 'download',\n\t\t(currentUserMeetsUserLevel(UserLevel.CONSUMER) &&\n\t\t\tallows(asset.permissionMatrix, PermissionMatrixName.DOWNLOAD))\n\t);\n};\n","export enum AssetProjectPref {\n\tENABLED = 'review.enabled',\n}\n","import type {Asset} from '@netx/core-asset/types';\nimport {isMobile} from '@netx/core/utils/isMobile';\nimport {getPreference} from '@netx/core-user/utils';\nimport {AssetProjectPref} from './constants';\n\nexport const assetProjectEnabled = () =>\n\tgetPreference(AssetProjectPref.ENABLED, true);\n\nexport const canManageAssetProject = (asset?: Asset) =>\n\t!isMobile(false) &&\n\tassetProjectEnabled() &&\n\tasset?.fileFormatFamily.includes('image') === true;\n","/**\n * This collection is the attribute datum for a single asset\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/attributeData';\n\nexport default class AttributeDatum extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * @memberof module:asset/models/attributeDatum\n\t\t * @alias assetAttributes\n\t\t * @type {module:asset/collections/attributes}\n\t\t */\n\t\tthis.assetAttributes = opts.assetAttributes;\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(this, 'sync', this.clearChanges).listenTo(\n\t\t\tthis,\n\t\t\t'metadataLookup:complete',\n\t\t\tthis.metadataLookupComplete,\n\t\t);\n\t}\n\n\t/**\n\t * Clear value changes\n\t * @method\n\t */\n\tclearChanges() {\n\t\tthis.invoke('clearChanges');\n\t}\n\n\t/**\n\t * Get a single attribute data model\n\t * @method\n\t * @param {number} tempateId Attribute template id (will support name as well until totally phased out)\n\t * @param {string} name Template name\n\t * @return {Netx.Models.AttributeData}\n\t */\n\tgetAttribute(templateId, name) {\n\t\tvar attrModel;\n\n\t\t// Find asset attribute template model\n\t\tattrModel =\n\t\t\tname != null\n\t\t\t\t? (this.assetAttributes || Netx.attributes).findWhere({name: name})\n\t\t\t\t: (this.assetAttributes || Netx.attributes).get(templateId);\n\n\t\t// Get existing asset attribute data record\n\t\treturn attrModel && this.get(attrModel.id);\n\t}\n\n\t/**\n\t * Get all attribute value changes\n\t * @method\n\t * @return {array}\n\t */\n\tgetChanges() {\n\t\treturn _.compact(\n\t\t\tthis.map((attr) => {\n\t\t\t\tif (attr.hasValueChanged()) {\n\t\t\t\t\treturn _.pick.apply(\n\t\t\t\t\t\t_,\n\t\t\t\t\t\t[attr.self()].concat(_.keys(Model.GetDefaults())),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Get a single attribute value\n\t * @method\n\t * @param {number|string} templateId Attribute template id (or name)\n\t * @return {mixed}\n\t */\n\tgetValue(templateId) {\n\t\tvar attributeDataModel = this.getAttribute(templateId);\n\t\tif (attributeDataModel) {\n\t\t\treturn attributeDataModel.getValue();\n\t\t}\n\t}\n\n\t/**\n\t * Get all attribute values\n\t * @method\n\t * @return {array}\n\t */\n\tgetValues() {\n\t\treturn this.map((attrData) => attrData.getValue());\n\t}\n\n\t/**\n\t * Get all read-only attributes\n\t * @method\n\t * @return {array}\n\t */\n\tgetReadOnly() {\n\t\tconst readOnly = this.filter((attrData) => !attrData.allows('edit'));\n\t\treturn readOnly.length ? readOnly : null;\n\t}\n\n\t/**\n\t * Get all writable attributes\n\t * @method\n\t * @return {array}\n\t */\n\tgetWritable() {\n\t\tconst writable = this.filter((attrData) => attrData.allows('edit'));\n\t\treturn writable.length ? writable : null;\n\t}\n\n\t/**\n\t * @method\n\t * @param {module:asset/models/attributeData} attrData Attribute data\n\t * @param {array} matches Matches\n\t */\n\tmetadataLookupComplete(attrData, matches) {\n\t\tlet attr;\n\t\t_.each(matches, (match) => {\n\t\t\tattr = this.getAttribute(null, match.label);\n\t\t\tattr &&\n\t\t\t\tattr.setValue(match.value, {\n\t\t\t\t\tautofilled: true,\n\t\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Reset all values\n\t * @method\n\t * @param {object} opts Options\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tresetValues(opts) {\n\t\treturn this.invoke('resetValues', opts);\n\t}\n\n\t/**\n\t * Set value on a single attribute\n\t * @method\n\t * @param {number} templateId Attribute template id\n\t * @param {mixed} val Value\n\t * @param {object} opts Options\n\t */\n\tsetValue(templateId, val, opts) {\n\t\tvar attributeDataModel = this.getAttribute(templateId);\n\t\tattributeDataModel && attributeDataModel.setValue(val, opts);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AttributeDatum';\n\t}\n}\n","/**\n * This model is the individual asset's attribute datum\n * A collection is created `this.attributeDatum` that represents all the data in `this.defaults.attributes`\n * @class\n * @extends Netx.Model\n * @see Netx.Collections.AttributeDatum\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport AttributeDatumCollection from '../collections/attributeDatum';\n\nexport default class AssetAttributeData extends Base {\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'assetId';\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {string} defaults.assetId - ID\n\t * @property {array} defaults.attributes - Attributes\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t// assetId: 0,\n\t\t\tattributes: [\n\t\t\t\t// Will be passed to and handled by Netx.Collections.AttributeDatum\n\t\t\t\t// {\n\t\t\t\t// \ttemplateId: 0,\n\t\t\t\t// \tassetId: 0,\n\t\t\t\t// \tpermission: \"r\",\n\t\t\t\t// \tvalues: []\n\t\t\t\t// }\n\t\t\t],\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attr Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs = {}, opts = {}) {\n\t\t// Circular reference\n\t\t//AttributeDatumCollection = require('../collections/attributeDatum').default;\n\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * @memberof module:asset/models/assetAttributeData\n\t\t * @alias assetAttributes\n\t\t * @type {module:asset/collections/attributes}\n\t\t */\n\t\tthis.assetAttributes = opts.assetAttributes || Netx.attributes;\n\n\t\t/**\n\t\t * @memberof module:asset/models/assetAttributeData\n\t\t * @alias attributeDatum\n\t\t * @type {Netx.Collections.AttributeDatum}\n\t\t */\n\t\tthis.attributeDatum = new AttributeDatumCollection([], {\n\t\t\tassetId: attrs.assetId || opts.assetId || this.id,\n\t\t});\n\n\t\t// Set initial data if passed\n\t\tattrs && this.updateAttributeDatum(attrs.attributes);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(this, 'change:attributes', (model, newValue, opts) => {\n\t\t\tthis.updateAttributeDatum();\n\t\t});\n\t}\n\n\t/**\n\t * Add an attribute object to this model's `attributes` array\n\t * @method\n\t * @param {object} attribute Attribute object\n\t */\n\taddAttribute(attribute) {\n\t\tconst existing = this.attributeDatum.getAttribute(attribute.templateId);\n\t\tif (existing) return;\n\n\t\tthis.set('attributes', this.get('attributes').concat([attribute]));\n\t}\n\n\t/**\n\t * Clear value changes\n\t * @method\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tclearChanges() {\n\t\tthis.attributeDatum.clearChanges();\n\t}\n\n\t/**\n\t * Get a single attribute data model\n\t * @method\n\t * @param {number} tempateId Attribute template id\n\t * @param {string} name Template name\n\t * @return {Netx.Models.AttributeData}\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tgetAttribute(templateId, name) {\n\t\treturn this.attributeDatum.getAttribute(templateId, name);\n\t}\n\n\t/**\n\t * Get a single attribute template model\n\t * @method\n\t * @param {number} tempateId Attribute template id\n\t * @param {string} name Template name\n\t * @return {module:asset/models/assetAttribute}\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tgetAttributeTemplate(templateId, name) {\n\t\tconst attributeDataModel = this.getAttribute(templateId, name);\n\t\treturn attributeDataModel && attributeDataModel.getTemplate();\n\t}\n\n\t/**\n\t * Get all attribute value changes\n\t * @method\n\t * @return {array}\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tgetChanges() {\n\t\tconst changes = this.attributeDatum.getChanges();\n\t\tif (!changes || !changes.length) return;\n\n\t\treturn {\n\t\t\tassetId: this.id,\n\t\t\tattributes: changes,\n\t\t};\n\t}\n\n\t/**\n\t * Get a single attribute value\n\t * @method\n\t * @param {number} templateId Attribute template id\n\t * @return {mixed}\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tgetValue(templateId) {\n\t\treturn this.attributeDatum.getValue(templateId);\n\t}\n\n\t/**\n\t * Get all attribute values\n\t * @method\n\t * @return {array}\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tgetValues() {\n\t\treturn this.attributeDatum.getValues();\n\t}\n\n\t/**\n\t * Get all read-only attributes\n\t * @method\n\t * @return {array}\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tgetReadOnly() {\n\t\treturn this.attributeDatum.getReadOnly();\n\t}\n\n\t/**\n\t * Get all writable attributes\n\t * @method\n\t * @return {array}\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tgetWritable() {\n\t\treturn this.attributeDatum.getWritable();\n\t}\n\n\t/**\n\t * Remove an attribute object from this model's `attributes` array\n\t * @method\n\t * @param {number} templateId Template id\n\t */\n\tremoveAttribute(templateId) {\n\t\tconst attributes = this.get('attributes');\n\t\tconst idx = _.indexOf(\n\t\t\tattributes,\n\t\t\t_.findWhere(attributes, {templateId: templateId}),\n\t\t);\n\t\tif (idx < 0) return;\n\n\t\tattributes.splice(idx, 1);\n\t\tthis.set('attributes', attributes);\n\t}\n\n\t/**\n\t * Reset all values\n\t * @method\n\t * @param {object} opts Options\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tresetValues(opts) {\n\t\treturn this.attributeDatum.resetValues(opts);\n\t}\n\n\t/**\n\t * Set value on a single attribute\n\t * @method\n\t * @param {number} templateId Attribute template id\n\t * @param {mixed} val Value\n\t * @param {object} opts Options\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tsetValue(templateId, val, opts) {\n\t\tthis.attributeDatum.setValue(templateId, val, opts);\n\t}\n\n\t/**\n\t * When this model syncs we populate `this.attributeDatum` based on `this.attributes.attributes`\n\t * @method\n\t * @param {array} attributes Attributes array\n\t * @param {object} opts Options\n\t */\n\tupdateAttributeDatum(attributes, opts) {\n\t\tattributes = attributes || this.get('attributes');\n\n\t\tconst assetAttributes = this.assetAttributes;\n\t\tthis.attributeDatum.set(\n\t\t\t_.compact(\n\t\t\t\t_.map(attributes, (attr) => {\n\t\t\t\t\tconst attrModel = assetAttributes.get(attr.templateId);\n\t\t\t\t\tif (!attrModel) return;\n\n\t\t\t\t\treturn _.extend(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttemplateId: attrModel.id,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tattr,\n\t\t\t\t\t\t_.omit(\n\t\t\t\t\t\t\tattrModel.attributes,\n\t\t\t\t\t\t\t'attributeid',\n\t\t\t\t\t\t\t'objectTypes',\n\t\t\t\t\t\t\t'templateid',\n\t\t\t\t\t\t\t'value',\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}),\n\t\t\t),\n\t\t\t_.extend({merge: true}, opts),\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetAttributeData';\n\t}\n}\n","/**\n * This collection represents attribute data for n assets\n * Each model has an asset id and an array of attribute datum for that particular asset\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/assetAttributeData';\n\nimport {isEmptyValue} from '@netx/core/utils/isEmptyValue';\nimport {unescapeAttributeName} from '@netx/core/utils/unescapeAttributeName';\n\nexport default class AssetAttributeDatum extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tgetAssetAttributes: 'Loading asset attributes',\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tgetAssetAttributes: 'Loaded asset attributes',\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this collection\n\t * @property {method} methods.read - Fetch asset attribute datum\n\t * @property {method} methods.setAssetAttributes - Update asset attributes datum\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {array} assetIds Asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn ['getAssetAttributes', this.assetIds];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {array} data Attribute datum\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetAssetAttributes(data, opts) {\n\t\t\t\treturn ['setAssetAttributes', data];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Parsers for this collection\n\t * @property {method} partser.read - Parse response of fetch\n\t * @property {method} partser.setAssetAttributes - Parse response of set asset attributes\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Attribute datum\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(data, opts) {\n\t\t\t\t// Provide default values\n\t\t\t\tif (this.useDefaultValues) {\n\t\t\t\t\tvar assetAttributes = this.assetAttributes || Netx.attributes,\n\t\t\t\t\t\tattrModel,\n\t\t\t\t\t\tvalues;\n\n\t\t\t\t\tdata = _.map(data, (d) => {\n\t\t\t\t\t\treturn _.extend(d, {\n\t\t\t\t\t\t\tattributes: _.map(d.attributes, (attr, idx, all) => {\n\t\t\t\t\t\t\t\tvalues = attr.values;\n\t\t\t\t\t\t\t\tif (isEmptyValue(values)) {\n\t\t\t\t\t\t\t\t\tattrModel = assetAttributes.get(attr.templateId);\n\t\t\t\t\t\t\t\t\tvalues = [\n\t\t\t\t\t\t\t\t\t\tattrModel && attrModel.get('value') != null\n\t\t\t\t\t\t\t\t\t\t\t? attrModel.get('value')\n\t\t\t\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn _.extend(attr, {\n\t\t\t\t\t\t\t\t\tvalues: values,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn data;\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {string} uuid UUID\n\t\t\t * @param {array} data Attribute datum\n\t\t\t * @param {object} opts Request options\n\t\t\t * @fires module:app#app:pollBatchJob\n\t\t\t */\n\t\t\tsetAssetAttributes(uuid, data, opts) {\n\t\t\t\tif (!uuid) return false;\n\n\t\t\t\t// On save, wipe out all model changes\n\t\t\t\tthis.clearChanges();\n\n\t\t\t\t// Poll\n\t\t\t\treturn this.trackBatchJob(uuid, [data], 1000);\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {array} models An array of models or model attributes\n\t * @param {object} opts Collection options\n\t */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * @memberof module:asset/models/assetAttributeDatum\n\t\t * @memberof\n\t\t * @alias assetIds\n\t\t * @type {array}\n\t\t */\n\t\tthis.assetIds = opts.assetIds || [];\n\n\t\t/**\n\t\t * @memberof module:asset/models/assetAttributeDatum\n\t\t * @alias assetAttributes\n\t\t * @type {Netx.Collections.AssetAttributes}\n\t\t */\n\t\tthis.assetAttributes = opts.assetAttributes;\n\n\t\t/**\n\t\t * Use default value if no values are present\n\t\t * @type {boolean}\n\t\t */\n\t\tthis.useDefaultValues = opts.useDefaultValues === true;\n\n\t\t// Hey, listen!\n\t\tthis\n\t\t\t// On sync, wipe out all model changes\n\t\t\t.listenTo(this, 'sync', this.clearChanges)\n\t\t\t.listenTo(this, 'complete', (self, batchJob, data) => {\n\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t'asset:attributes:submit:succeeded',\n\t\t\t\t\tself,\n\t\t\t\t\tbatchJob,\n\t\t\t\t\tdata,\n\t\t\t\t);\n\t\t\t});\n\t}\n\n\t/**\n\t * Clear value changes\n\t * @method\n\t */\n\tclearChanges() {\n\t\tthis.invoke('clearChanges');\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} tempateId Attribute template id\n\t * @param {string} name Template name\n\t * @param {number} assetId Asset id\n\t * @return {array|Netx.Models.AttributeData} Attribute(s)\n\t */\n\tgetAttribute(templateId, name, assetId) {\n\t\tif (assetId == null) {\n\t\t\treturn _.compact(this.map((m) => m.getAttribute(templateId, name)));\n\t\t}\n\n\t\tconst assetAttributeDataModel = this.get(assetId);\n\t\tif (assetAttributeDataModel) {\n\t\t\treturn assetAttributeDataModel.getAttribute(templateId, name);\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @param {number|string} tempateId Attribute template id (will support name as well until totally phased out)\n\t * @return {array|module:asset/models/assetAttribute} Attribute template(s)\n\t */\n\tgetAttributeTemplate(templateId, assetId) {\n\t\tconst attributeDataModel = this.getAttribute(templateId, assetId);\n\t\tif (assetId == null) {\n\t\t\treturn _.compact(\n\t\t\t\t_.map(attributeDataModel, (attrDataModel) =>\n\t\t\t\t\tattrDataModel.getTemplate(),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn attributeDataModel && attributeDataModel.getTemplate();\n\t}\n\n\t/**\n\t * @method\n\t * @return {array}\n\t */\n\tgetChanges() {\n\t\treturn _.compact(this.map((m) => m.getChanges()));\n\t}\n\n\t/**\n\t * If no asset id is passed, all records will be returned\n\t * @method\n\t * @param {number} assetId Asset id\n\t * @return {array}\n\t */\n\tgetWritableAttributes(assetId) {\n\t\tif (assetId == null) {\n\t\t\treturn _.compact(this.map((m) => m.getWritable()));\n\t\t}\n\n\t\tconst assetAttributeDataModel = this.get(assetId);\n\t\tif (assetAttributeDataModel) {\n\t\t\treturn assetAttributeDataModel.getWrtiable();\n\t\t}\n\t}\n\n\t/**\n\t * If no asset id is passed, all records will be returned\n\t * @method\n\t * @param {number} assetId Asset id\n\t * @return {array}\n\t */\n\tgetReadOnlyAttributes(assetId) {\n\t\tif (assetId == null) {\n\t\t\treturn _.compact(this.map((m) => m.getReadOnly()));\n\t\t}\n\n\t\tconst assetAttributeDataModel = this.get(assetId);\n\t\tif (assetAttributeDataModel) {\n\t\t\treturn assetAttributeDataModel.getReadOnly();\n\t\t}\n\t}\n\n\t/**\n\t * If no asset id is passed, all records will be returned\n\t * @method\n\t * @param {number} assetId Asset id\n\t * @return {array}\n\t */\n\tgetValues(assetId) {\n\t\tif (assetId == null) {\n\t\t\treturn _.compact(this.map((m) => m.getValues()));\n\t\t}\n\n\t\tconst assetAttributeDataModel = this.get(assetId);\n\t\tif (assetAttributeDataModel) {\n\t\t\treturn assetAttributeDataModel.getValues();\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} templateId Attribute template id\n\t * @param {number} assetId Asset id\n\t * @return {array|mixed} Value(s)\n\t */\n\tgetValue(templateId, assetId) {\n\t\tif (assetId == null) {\n\t\t\treturn _.filter(\n\t\t\t\tthis.map((m) => m.getValue(templateId)),\n\t\t\t\t(val) => val != null,\n\t\t\t);\n\t\t}\n\n\t\tconst attributeDataModel = this.getAttribute(templateId, null, assetId);\n\t\tif (attributeDataModel) {\n\t\t\treturn attributeDataModel.getValue(templateId);\n\t\t}\n\t}\n\n\t/**\n\t * If no asset id is passed, all records will be checked\n\t * @method\n\t * @param {number} assetId Asset id\n\t * @return {boolean}\n\t */\n\thasAttributeValues(assetId) {\n\t\tconst values = this.getValues(assetId);\n\n\t\tfor (let i = 0, c = values.length, foundValue, _values; i < c; i++) {\n\t\t\t_values = values[i];\n\t\t\tfor (let j = 0, k = _values.length, val; j < k; j++) {\n\t\t\t\tval = _values[j];\n\t\t\t\tif (_.isArray(val)) {\n\t\t\t\t\tfoundValue = val.length > 0 && val !== '' && val != null;\n\t\t\t\t} else {\n\t\t\t\t\tfoundValue = val !== '' && val != null;\n\t\t\t\t}\n\t\t\t\tif (foundValue) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * If no asset id is passed, all records will be checked\n\t * @method\n\t * @param {number} assetId Asset id\n\t * @return {boolean}\n\t */\n\thasWritableAttributes(assetId) {\n\t\tconst attributes = this.getWritableAttributes(assetId);\n\t\tfor (let i = 0, c = attributes.length; i < c; i++) {\n\t\t\tif (attributes[0].length > 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} data Attribute data\n\t * @param {number} assetId Asset id (if not provided, data will be applied to all assets in this collection)\n\t * @param {object} opts Options\n\t */\n\tparseAndSave(data, assetId, opts) {\n\t\t_.each(data, (v, k) => {\n\t\t\t// This most likely came from a form, need to be safe and unescape the name\n\t\t\t// TODO: look into switching our attribute names in forms to utilize the templateId instead\n\t\t\t// User defined names as form input names is troublesome\n\t\t\tk = unescapeAttributeName(k);\n\n\t\t\tconst attrModel = (this.assetAttributes || Netx.attributes).findWhere({\n\t\t\t\tname: k,\n\t\t\t});\n\t\t\tif (attrModel && attrModel.isValueWritable()) {\n\t\t\t\tv = attrModel.parseOutValue(v);\n\t\t\t\t// Set - default to silently as this will most likely be the product of cloned data and a form update\n\t\t\t\t// so the underlying attribute data model does not need to respond to the change and populate the values collection\n\t\t\t\t// as the values collection should already be mirrored in the UI\n\t\t\t\tthis.setValue(attrModel.id, assetId, v, _.extend({silent: true}, opts));\n\t\t\t}\n\t\t});\n\n\t\t// Save\n\t\treturn this.setAssetAttributes(this.getChanges(), opts);\n\t}\n\n\t/**\n\t * Reset all values\n\t * @method\n\t * @param {object} opts Options\n\t * @see Netx.Collections.AttributeDatum\n\t */\n\tresetValues(opts) {\n\t\treturn this.invoke('resetValues', opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} templateId Attribute template id\n\t * @param {array|mixed} val Value(s)\n\t * @param {object} opts Options\n\t */\n\tsetValue(templateId, assetId, val, opts) {\n\t\tif (assetId == null) {\n\t\t\tthis.invoke('setValue', templateId, val, opts);\n\t\t\treturn;\n\t\t}\n\n\t\tconst attributeDataModel = this.getAttribute(templateId, null, assetId);\n\t\tattributeDataModel && attributeDataModel.setValue(templateId, val, opts);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetAttributeDatum';\n\t}\n}\n","/**\n * For when you want to just deal with a single type of constituent (like doc viewer)\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\n\nexport default class AssetConstituents_ extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} methods - Collection RPC methods\n\t * @property {method} methods.read - Fetch constituents\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/** @method */\n\t\t\tread: ['getConstituentsForAsset', 'assetId'],\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers.read - Parse the results of fetch\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(data, opts) {\n\t\t\t\t// Where k could be\n\t\t\t\t// clips\n\t\t\t\t// keyframes\n\t\t\t\t// layers\n\t\t\t\t// pages\n\t\t\t\t_.each(data, (v, k) => {\n\t\t\t\t\tif (k === this.type) {\n\t\t\t\t\t\tthis.reset(v);\n\t\t\t\t\t\tthis['original' + _.ucfirst(k)] = v.slice();\n\t\t\t\t\t}\n\t\t\t\t\tdelete data[k];\n\t\t\t\t});\n\t\t\t\t// Return nothing - not doing so will result in rpc setting the return for us\n\t\t\t\treturn null;\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituents_';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './assetConstituent';\n\nexport default class AssetConstituent_Keyframe extends Base {\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.type - Default type (1 = keyframe)\n\t */\n\tget defaults() {\n\t\treturn _.extend(super.defaults, {\n\t\t\ttype: 1,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituent_Keyframe';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './assetConstituent';\n\nexport default class AssetConstituent_Layer extends Base {\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.type - Default type (2 = layer)\n\t */\n\tget defaults() {\n\t\treturn _.extend(super.defaults, {\n\t\t\ttype: 2,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituent_Layer';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './assetConstituent';\n\nexport default class AssetConstituent_Page extends Base {\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.type - Default type (3 = page)\n\t * @property {number} defaults.pageNumber - The default page number (client side)\n\t */\n\tget defaults() {\n\t\treturn _.extend(super.defaults, {\n\t\t\ttype: 3,\n\t\t\t// Client attributes\n\t\t\tpageNumber: 0,\n\t\t});\n\t}\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn ['pageNumber'];\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attr Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t// Internationalize the title for pages\n\t\tvar title = this.get('title');\n\t\tif (title) {\n\t\t\t// \"Page n\"\n\t\t\ttitle = title.split(' ');\n\t\t\tif (title.length > 1) {\n\t\t\t\tthis.attributes.title = i18n.t('i18n.pageAndNumber', {\n\t\t\t\t\tpage: title[1],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituent_Page';\n\t}\n}\n","/**\n * AssetConstituents collection\n * We now get a return with objects - the key representing the constituent type.\n * There is currently no individual call to get the constituents of a type for an asset.\n * This collection makes the fetch and splits off the return into the appropriate constituent sub collection.\n * Each collection may need a different comparator and definitely needs its own model type (looking at you clips)\n * The alternative is that we get in a mess of declaring all these collections within a controller and then have a\n * specific call for each - why not just fetch here and get it all for free?\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/assetConstituent';\n\nimport Clips from './assetConstituents_clips';\nimport Keyframes from './assetConstituents_keyframes';\nimport Layers from './assetConstituents_layers';\nimport Pages from './assetConstituents_pages';\n\nimport {constituents as constituentProps} from '../properties/asset';\n\nconst ConsituentCollections = {\n\tclips: Clips,\n\tkeyframes: Keyframes,\n\tlayers: Layers,\n\tpages: Pages,\n};\n\nexport default class AssetConstituents extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} methods - Collection RPC methods\n\t * @property {method} methods.read - Fetch constituents\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tread: ['getConstituentsForAsset', 'assetId'],\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers.read - Parse the results of fetch\n\t */\n\tget parsers() {\n\t\treturn _.extend(super.parsers, {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(data, opts) {\n\t\t\t\t// Where k could be\n\t\t\t\t// clips\n\t\t\t\t// keyframes\n\t\t\t\t// layers\n\t\t\t\t// pages\n\t\t\t\t_.each(data, (v, k) => {\n\t\t\t\t\tconst subCollection = this[k];\n\n\t\t\t\t\t// Set models for sub colelction\n\t\t\t\t\tsubCollection.set(v);\n\n\t\t\t\t\t// Check for selected constituent and store it\n\t\t\t\t\tconst selected = subCollection.findWhere({display: 1});\n\t\t\t\t\tif (selected) {\n\t\t\t\t\t\tthis.displayed = selected;\n\t\t\t\t\t}\n\n\t\t\t\t\tdelete data[k];\n\t\t\t\t});\n\n\t\t\t\treturn data;\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @override\n\t * @param {array} models An array of models or model attirbutes\n\t * @param {object} options Options\n\t */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * AssetId that the constituents reference\n\t\t * @type {Number}\n\t\t * @default\n\t\t */\n\t\tthis.assetId = opts.assetId || 0;\n\n\t\t/**\n\t\t * The currently selected constituent for display\n\t\t * @memberOf Netx.Collections.AssetConstituents\n\t\t * @alias displayed\n\t\t * @type {module:asset/models/assetConstituent}\n\t\t */\n\t\tthis.displayed = null;\n\n\t\t/**\n\t\t * @memberOf Netx.Collections.AssetConstituents\n\t\t * @alias properties\n\t\t * @type {object}\n\t\t */\n\t\tthis.properties = opts.properties || constituentProps;\n\n\t\t// Our clip types\n\t\t// this.clips = new Netx.Collections.AssetConstituents_clips\n\t\t// this.keyframes = new Netx.Collections.AssetConstituents_keyframes\n\t\t// this.layers = new Netx.Collections.AssetConstituents_layers\n\t\t// this.pages = new Netx.Collections.AssetConstituents_pages\n\t\t_.each(this.properties.types, (thing, id) => {\n\t\t\tconst things = new ConsituentCollections[`${thing}s`]([]);\n\n\t\t\tthings\n\t\t\t\t// The subcollections should mirror the read events of the parent collections, as they're all fetched as one:\n\t\t\t\t.listenTo(this, 'request:read', (collection, xhr, opts) => {\n\t\t\t\t\tif (collection !== this) return;\n\t\t\t\t\t!opts.silent && things.trigger('request:read', things, xhr, opts);\n\t\t\t\t})\n\t\t\t\t// When it syncs we sync\n\t\t\t\t.listenTo(this, 'sync', (collection, resp, opts) => {\n\t\t\t\t\tif (collection !== this) return;\n\t\t\t\t\t!opts.silent && things.trigger('sync', things, resp, opts);\n\t\t\t\t});\n\n\t\t\tthis.listenTo(things, 'sync', (collection) => {\n\t\t\t\tif (collection !== things) return;\n\t\t\t\tconst displayed = this.findWhere({display: 1});\n\t\t\t\tif (displayed) {\n\t\t\t\t\tthis.displayed = displayed;\n\t\t\t\t}\n\t\t\t}).listenTo(things, 'change:display', (model, display) => {\n\t\t\t\tif (display && this.displayed !== model) {\n\t\t\t\t\tthis.displayed && this.displayed.set('display', 0);\n\t\t\t\t\tthis.displayed = model;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis[thing + 's'] = things;\n\t\t\tthis.addSubCollection(things);\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituents';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './assetConstituents_';\nimport Model from '../models/assetConstituent_clip';\n\nexport default class AssetConstituents_Clips extends Base {\n\t/** @type {string} */\n\tget type() {\n\t\treturn 'clips';\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituents_Clips';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './assetConstituents_';\nimport Model from '../models/assetConstituent_keyframe';\n\nexport default class AssetConstituents_Keyframes extends Base {\n\t/** @type {string} */\n\tget type() {\n\t\treturn 'keyframes';\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituents_Keyframes';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './assetConstituents_';\nimport Model from '../models/assetConstituent_layer';\n\nexport default class AssetConstituents_Layers extends Base {\n\t/** @type {string} */\n\tget type() {\n\t\treturn 'layers';\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituents_Layers';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './assetConstituents_';\nimport Model from '../models/assetConstituent_page';\n\nexport default class AssetConstituents_Pages extends Base {\n\t/** @type {string} */\n\tget type() {\n\t\treturn 'pages';\n\t}\n\n\t/**\n\t * @property {object} methods - Collection RPC methods\n\t * @property {method} methods.read - Search pages\n\t */\n\tget methods() {\n\t\treturn _.extend(super.methods, {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {string} str Search fragment\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsearchPDFPages(str, opts) {\n\t\t\t\tthis.filtered = true;\n\t\t\t\treturn ['searchPDFPages', this.assetId, str];\n\t\t\t},\n\t\t});\n\t}\n\n\t/*\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers.read - Parse the results of fetch\n\t * @property {function} parsers.searchPDFPages - Parse the results of search\n\t */\n\tget parsers() {\n\t\treturn _.extend(super.parsers, {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(data, opts) {\n\t\t\t\t// Set page number - cannot be certain of this with the ref/id\n\t\t\t\t_.each(data.pages, (page, idx) => {\n\t\t\t\t\tpage.pageNumber = idx + 1;\n\t\t\t\t});\n\t\t\t\tthis.originalPages = data.pages.slice();\n\t\t\t\treturn data.pages;\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsearchPDFPages(data, opts) {\n\t\t\t\tthis.reset(\n\t\t\t\t\t_.map(data, (d, idx) => {\n\t\t\t\t\t\td.pageNumber = idx + 1;\n\t\t\t\t\t\treturn d;\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t});\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * Store original pages (for search results)\n\t\t * @memberOf Netx.Collections.Pages\n\t\t * @alias originalPages\n\t\t * @type {array}\n\t\t */\n\t\tthis.originalPages = this.originalPages || [];\n\t}\n\n\t/**\n\t * Clear search\n\t * @method\n\t */\n\tclearSearch() {\n\t\t// No longer filtered\n\t\tthis.filtered = false;\n\t\tthis.reset(this.originalPages);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituents_Pages';\n\t}\n}\n","/**\n * Assets Collection\n *\n * Much of the DAM API operates on sets of assets. This Assets collection is home to many of those API methods,\n * and all other asset collection classes inherit from this one.\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/asset';\nimport _ from 'underscore';\nimport {getPrefixedLogger} from '@netx/core-next/utils/logger';\nimport PagerModel from '@netx/core-app/models/pager';\nimport AssetSetModel from '../models/assetSet';\nimport CategoryModel from '@netx/core-category/models/category';\nimport SearchRulesCollection from '@netx/core-search/collections/searchRules_assets';\n\nimport {types as assetSetTypes} from '../properties/assetSets';\nimport customConfig from '../config';\n\nimport {\n\tfacetSupports,\n\tsearchProperties,\n\tsystemFacets,\n} from '@netx/core-search/properties/search';\nimport {escapeURI} from '@netx/core/utils/escapeURI';\nimport {unescapeURI} from '@netx/core/utils/unescapeURI';\n\nconst logger = getPrefixedLogger('collections/assets');\n\nexport default class Assets extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * this.fetchSpecificMethod defines the API call for fetching specific asset objects of this type; it will be overridden in Netx.Collections.MiniAssets\n\t * @type {string}\n\t * @default\n\t */\n\tget fetchSpecificMethod() {\n\t\treturn 'getAssetObjects';\n\t}\n\n\t/**\n\t * The following RPC methods cause the DAM to operate on the assets described in the collection.\n\t * All manipulation takes place in the DAM; the browser does not directly manipulate image\n\t * data, files or the database.\n\t * @rpcs\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tread(opts) {\n\t\t\t\tthis.setStartPosition();\n\n\t\t\t\t// An empty search was sent\n\t\t\t\tif (!this.selection.length) {\n\t\t\t\t\tthis.pager.set({\n\t\t\t\t\t\titemTotal: 0,\n\t\t\t\t\t});\n\t\t\t\t\treturn new $.Deferred().resolve([]);\n\t\t\t\t}\n\n\t\t\t\tconst search = this.selection.createSearchObject();\n\n\t\t\t\t// Configure paging:\n\t\t\t\t// if chunk-fetch is requested, use chunk logic to determine the start & length.\n\t\t\t\tif (opts.chunk) {\n\t\t\t\t\tthis._startPosition = opts.refetch\n\t\t\t\t\t\t? this.selection.startPosition\n\t\t\t\t\t\t: this.selection.startPosition + this.length;\n\t\t\t\t\tthis._maxItems = opts.refetch\n\t\t\t\t\t\t? this.length + this.chunkSize\n\t\t\t\t\t\t: this.selection.maxItems;\n\t\t\t\t}\n\t\t\t\t// Otherwise use the standard values.\n\t\t\t\telse {\n\t\t\t\t\tthis._startPosition = this.selection.startPosition;\n\t\t\t\t\tthis._maxItems = this.selection.maxItems;\n\t\t\t\t}\n\n\t\t\t\tif (this.useFacetedSearch()) {\n\t\t\t\t\t// Faceted\n\t\t\t\t\tthis._filterMode = this.selection.searchFacets.filterMode;\n\t\t\t\t\treturn [\n\t\t\t\t\t\t_.contains(search.elementTypes, 200)\n\t\t\t\t\t\t\t? 'searchAssetsByAttributeHistory'\n\t\t\t\t\t\t\t: 'facetedSearch',\n\t\t\t\t\t\tsearch.sortField,\n\t\t\t\t\t\tsearch.sortOrder,\n\t\t\t\t\t\tsearch.matchCriteria,\n\t\t\t\t\t\tsearch.elementTypes,\n\t\t\t\t\t\tsearch.elementSubType1s,\n\t\t\t\t\t\tsearch.elementSubType2s,\n\t\t\t\t\t\tsearch.elementValue1s,\n\t\t\t\t\t\tsearch.elementValue2s,\n\t\t\t\t\t\tsearch.elementValue3s,\n\t\t\t\t\t\tthis._startPosition,\n\t\t\t\t\t\tthis._maxItems,\n\t\t\t\t\t\tthis.selection.searchFacets.selectedValues(),\n\t\t\t\t\t\tthis._filterMode,\n\t\t\t\t\t];\n\t\t\t\t} else {\n\t\t\t\t\t// Default\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'searchAssetObjects',\n\t\t\t\t\t\tsearch.sortField,\n\t\t\t\t\t\tsearch.sortOrder,\n\t\t\t\t\t\tsearch.matchCriteria,\n\t\t\t\t\t\tsearch.elementTypes,\n\t\t\t\t\t\tsearch.elementSubType1s,\n\t\t\t\t\t\tsearch.elementSubType2s,\n\t\t\t\t\t\tsearch.elementValue1s,\n\t\t\t\t\t\tsearch.elementValue2s,\n\t\t\t\t\t\tsearch.elementValue3s,\n\t\t\t\t\t\tsearch.saveSearch,\n\t\t\t\t\t\tsearch.notifyType,\n\t\t\t\t\t\tsearch.ignoreStat,\n\t\t\t\t\t\tthis._startPosition,\n\t\t\t\t\t\tthis._maxItems,\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Given an array of ids, fetch the full asset beans\n\t\t\t * @method\n\t\t\t */\n\t\t\tfetchSpecificAssets(assetIds, opts) {\n\t\t\t\treturn [this.fetchSpecificMethod, assetIds];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Soon this will go away as we will get `size` on all our calls\n\t\t\t * @method\n\t\t\t */\n\t\t\tfetchAssetCount(opts) {\n\t\t\t\t// Cleared in parser\n\t\t\t\tthis.fetchingAssetCount = true;\n\n\t\t\t\tconst search = this.selection.createSearchObject();\n\t\t\t\treturn [\n\t\t\t\t\t'searchAssetListLength',\n\t\t\t\t\tsearch.sortField,\n\t\t\t\t\tsearch.sortOrder,\n\t\t\t\t\tsearch.matchCriteria,\n\t\t\t\t\tsearch.elementTypes,\n\t\t\t\t\tsearch.elementSubType1s,\n\t\t\t\t\tsearch.elementSubType2s,\n\t\t\t\t\tsearch.elementValue1s,\n\t\t\t\t\tsearch.elementValue2s,\n\t\t\t\t\tsearch.elementValue3s,\n\t\t\t\t\tsearch.saveSearch,\n\t\t\t\t\tsearch.notifyType,\n\t\t\t\t\tsearch.ignoreStat,\n\t\t\t\t];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Rather than get full asset beans from a search, just fetch the asset ids\n\t\t\t * @method\n\t\t\t */\n\t\t\tgetAssetIds(opts) {\n\t\t\t\tconst search = this.selection.createSearchObject();\n\t\t\t\treturn [\n\t\t\t\t\t'searchAssetData',\n\t\t\t\t\tsearch.sortField,\n\t\t\t\t\tsearch.sortOrder,\n\t\t\t\t\tsearch.matchCriteria,\n\t\t\t\t\tsearch.elementTypes,\n\t\t\t\t\tsearch.elementSubType1s,\n\t\t\t\t\tsearch.elementSubType2s,\n\t\t\t\t\tsearch.elementValue1s,\n\t\t\t\t\tsearch.elementValue2s,\n\t\t\t\t\tsearch.elementValue3s,\n\t\t\t\t\tsearch.saveSearch,\n\t\t\t\t\tsearch.notifyType,\n\t\t\t\t\tsearch.ignoreStat,\n\t\t\t\t\t// Start at the first one and get eeeeeeeverything\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Essentially the same as calling fetchSpecificAssets, only the parser will not set it on this\n\t\t\t * It is to fetch assets on the fly by id without affecting the collection\n\t\t\t * @method\n\t\t\t * @deprecated\n\t\t\t */\n\t\t\t// Appears unused.\n\t\t\tgetAssetObjects() {\n\t\t\t\tconsole.warn('assets.getAssetObjects() deprecated, gone in 8.13');\n\t\t\t\treturn ['getAssetObjects', 'getAssetObjectIds'];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * getMostViewedAssets(): like fetch(), but this fetches a set of assets from the DAM that cannot yet be obtained by searchAssetListObjects()\n\t\t\t * @method\n\t\t\t */\n\t\t\tgetMostViewedAssets() {\n\t\t\t\treturn ['getMostViewedAssets', customConfig.MOST_VIEWED_SIZE];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * getRecentlyUploadedAssets(): like fetch(), but this fetches a set of assets from the DAM that cannot yet be obtained by searchAssetListObjects()\n\t\t\t * @method\n\t\t\t */\n\t\t\tgetRecentlyUploadedAssets() {\n\t\t\t\treturn [\n\t\t\t\t\t'getRecentlyUploadedAssets',\n\t\t\t\t\tcustomConfig.RECENTLY_UPLOADED_SIZE,\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * createPDF(): generate a PDF of assets on the DAM, and prepare it for download/share.\n\t\t\t * @method\n\t\t\t * @deprecated\n\t\t\t */\n\t\t\tcreatePDF(opts) {\n\t\t\t\tconsole.warn('assets.createPDF deprecated, gone in 8.12!'); // the share controller does this a whole different way now.\n\t\t\t\tconst search = this.selection.createSearchObject();\n\t\t\t\tconst pdf = this.pdf;\n\t\t\t\treturn [\n\t\t\t\t\t'createPDFFromSearch',\n\t\t\t\t\tsearch.sortField,\n\t\t\t\t\tsearch.sortOrder,\n\t\t\t\t\tsearch.matchCriteria,\n\t\t\t\t\tsearch.elementTypes,\n\t\t\t\t\tsearch.elementSubType1s,\n\t\t\t\t\tsearch.elementSubType2s,\n\t\t\t\t\tsearch.elementValue1s,\n\t\t\t\t\tsearch.elementValue2s,\n\t\t\t\t\tsearch.elementValue3s,\n\t\t\t\t\tpdf.templateName,\n\t\t\t\t\tpdf.titleStr,\n\t\t\t\t\tpdf.hiRes,\n\t\t\t\t\tpdf.pdfExportPreset,\n\t\t\t\t];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * createPDFWithOptions(): like createPDF() but with more options.\n\t\t\t * @method\n\t\t\t * @deprecated\n\t\t\t */\n\t\t\tcreatePDFWithOptions(opts) {\n\t\t\t\tconsole.warn('assets.createPDFWithOptions deprecated, gone in 8.12!');\n\t\t\t\tconst cpwo = this.cpwo;\n\t\t\t\treturn [\n\t\t\t\t\t'createPDFWithOptions',\n\t\t\t\t\t// the share controller does this a whole different way now.\n\t\t\t\t\tthis.ids(),\n\t\t\t\t\tcpwo.sortField,\n\t\t\t\t\tcpwo.portrait,\n\t\t\t\t\tcpwo.cols,\n\t\t\t\t\tcpwo.rows,\n\t\t\t\t\tcpwo.attrNames,\n\t\t\t\t\tcpwo.attrLines,\n\t\t\t\t\tcpwo.highRes,\n\t\t\t\t\tcpwo.templateName,\n\t\t\t\t\tcpwo.titleStr,\n\t\t\t\t\tcpwo.pdfExportPreset,\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Add/move cart assets to category\n\t\t\t * @method\n\t\t\t */\n\t\t\tcategorize(opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'batchCategorizeAssets',\n\t\t\t\t\tthis.ids(),\n\t\t\t\t\tthis.categorizeArgs.targetCat,\n\t\t\t\t\tthis.categorizeArgs.action,\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Move cart assets to category\n\t\t\t * @method\n\t\t\t */\n\t\t\tmoveToCategory(opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'batchCategorizeAssets',\n\t\t\t\t\tthis.ids(),\n\t\t\t\t\tthis.categorizeArgs.targetCat,\n\t\t\t\t\tthis.categorizeArgs.move,\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * addToCategory() and removeFromCategory(): perform these category operations on every asset in our collection.\n\t\t\t * (The collection must be fetched first.)\n\t\t\t */\n\t\t\t/**\n\t\t\t * addToCategory(): add to a specified category every asset in our collection\n\t\t\t * @method\n\t\t\t */\n\t\t\t_addToCategory(opts) {\n\t\t\t\tconst cid = this.get('categoryid');\n\t\t\t\treturn ['setAssetCategoryLinks', this.ids(), this.targetCategory, true];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * removeFromCategory(): remove from specified category every asset in our collection\n\t\t\t * @method\n\t\t\t */\n\t\t\tremoveFromCategory(opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'batchCategorizeAssets',\n\t\t\t\t\tthis.ids(),\n\t\t\t\t\tthis.targetCategory,\n\t\t\t\t\t'remove',\n\t\t\t\t];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * moveToCategory(): move to a specified category every asset in our collection\n\t\t\t * @method\n\t\t\t */\n\t\t\t_moveToCategory(opts) {\n\t\t\t\tconst cid = this.get('categoryid');\n\t\t\t\treturn [\n\t\t\t\t\t'setAssetCategoryLinks',\n\t\t\t\t\tthis.ids(),\n\t\t\t\t\tthis.targetCategory,\n\t\t\t\t\tfalse,\n\t\t\t\t];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * reserve() reserves assetIDs from the DAM, and creates asset models for those IDs that can later be imported.\n\t\t\t * Used by the asset import logic of the upload module.\n\t\t\t * @method\n\t\t\t * @todo: I still find this screwy. An asset that has a reserved ID ought to have an import() method too.\n\t\t\t * Or else this reserve method should live where the rest of the import logic lives. Like,\n\t\t\t * a subclass of Netx.Models.Upload called Netx.Models.Import that handles all that stuff?\n\t\t\t */\n\t\t\treserve: ['reserveAssetIds', 'reserveCount'],\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} result Result\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(result, opts) {\n\t\t\t\t// Did we fetch faceted, or normal?\n\t\t\t\tconst facetedResult = this.useFacetedSearch();\n\t\t\t\tlet assets = result.results || result;\n\n\t\t\t\t// DAM-15036 - Omit any assets without valid assetIds\n\t\t\t\tassets = _.filter(assets, (a) => {\n\t\t\t\t\tif (!a.assetId) {\n\t\t\t\t\t\tlogger.warn('server returned a bogus asset');\n\t\t\t\t\t}\n\t\t\t\t\treturn a.assetId;\n\t\t\t\t});\n\n\t\t\t\t// Check length of results; did we reach the end yet?\n\t\t\t\tif (assets.length > this.chunkSize) {\n\t\t\t\t\tassets.pop();\n\t\t\t\t\tthis.lastChunk = false;\n\t\t\t\t} else {\n\t\t\t\t\tthis.lastChunk = true;\n\t\t\t\t}\n\n\t\t\t\t// Don't remove existing assets if we are doing a chunk fetch.\n\t\t\t\t// (This options object will be passed to set.)\n\t\t\t\topts.remove = !opts.chunk;\n\n\t\t\t\tif (facetedResult) {\n\t\t\t\t\tconst systemFacetLabels = systemFacets;\n\t\t\t\t\tconst facets = _.map(result.facets, (facet) =>\n\t\t\t\t\t\t_.extend(facet, {\n\t\t\t\t\t\t\ttitle: systemFacetLabels[facet.label] || facet.label,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\n\t\t\t\t\t// Only return facets that have options with a count\n\t\t\t\t\tthis.selection.searchFacets.set(facets);\n\t\t\t\t\tthis.selection.searchFacets.itemTotal = result.size;\n\n\t\t\t\t\tthis.pager.set({\n\t\t\t\t\t\titemTotal: result.size,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn assets;\n\t\t\t},\n\t\t\t/**\n\t\t\t * fetchSpecificAssets returns an array of asset beans\n\t\t\t * @method\n\t\t\t * @param {array} assets\n\t\t\t */\n\t\t\tfetchSpecificAssets(assets, assetIds, opts) {\n\t\t\t\t// Omit any assets without valid assetIds\n\t\t\t\tthis.set(\n\t\t\t\t\t_.filter(assets, (asset) => asset.assetId),\n\t\t\t\t\topts,\n\t\t\t\t);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * fetchAssetCount returns simply a count (will one day be usurped by the `size` paramater)\n\t\t\t * @method\n\t\t\t * @param {number}\n\t\t\t */\n\t\t\tfetchAssetCount(count, opts) {\n\t\t\t\tif (count == null) {\n\t\t\t\t\tthrow new Error('bad return value from getAssetCount');\n\t\t\t\t}\n\t\t\t\tthis.pager.set({\n\t\t\t\t\titemTotal: count,\n\t\t\t\t});\n\n\t\t\t\t// Clear up this flag\n\t\t\t\tdelete this.fetchingAssetCount;\n\t\t\t},\n\t\t\t/**\n\t\t\t * Sets assetIds property and returns the array of assetIds\n\t\t\t * @param {array} assetIds Array of assetIds contained in collection\n\t\t\t * @return {array} Array of assetIds contained in collection\n\t\t\t */\n\t\t\tgetAssetIds(assetIds) {\n\t\t\t\tthis.assetIds = assetIds;\n\t\t\t\treturn assetIds;\n\t\t\t},\n\t\t\t/**\n\t\t\t * getMostViewedAssets returns an array of asset beans\n\t\t\t * @method\n\t\t\t * @param {array} assets\n\t\t\t * @todo Any reason why we are using reset instead of set - I know reset is faster but bypasses all add/remove/merge events\n\t\t\t */\n\t\t\tgetMostViewedAssets(assets) {\n\t\t\t\tthis.reset(assets);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * getRecentlyUploadedAssets returns an array of asset beans\n\t\t\t * @method\n\t\t\t * @param {array} assets\n\t\t\t * @todo Any reason why we are using reset instead of set - I know reset is faster but bypasses all add/remove/merge events\n\t\t\t */\n\t\t\tgetRecentlyUploadedAssets(assets) {\n\t\t\t\tthis.reset(assets);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Provided a count of new assets, reserve returns an array of asset ids that have been reserved for our new assets\n\t\t\t * @param {array} ids\n\t\t\t */\n\t\t\treserve(ids, opts) {\n\t\t\t\tids.forEach((id, idx, all) => {\n\t\t\t\t\tthis.add(\n\t\t\t\t\t\tnew Model({\n\t\t\t\t\t\t\tassetId: id,\n\t\t\t\t\t\t\tinCurrentCart: false,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\t// This is related to a circular reference somewhere\n\t\t// Anytime you find that a require at the top results in an empty object - this is why\n\t\t// https://stackoverflow.com/questions/37127083/can-two-files-have-each-other-as-dependencies-in-javascript-when-using-webpack\n\t\t//Model = '../models/asset');\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * When getAssetIds() is called this property is updated with an array of all asset ids in the collection\n\t\t * @memberof Netx.Collections.Assets\n\t\t * @alias assetIds\n\t\t * @type {array}\n\t\t */\n\t\tthis.assetIds = opts.assetIds || [];\n\n\t\t/**\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.chunkSize = parseInt(opts.chunkSize) || customConfig.CHUNK_SIZE;\n\n\t\t/**\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.curPage = opts.curPage || 0;\n\n\t\t// An Assets collection can manage paged fetching of its assets. If the value 'chunkSize' is smaller than the value 'pageSize',\n\t\t// chunk loading is enabled.\n\t\t// TODO: use a Netx.Models.Pager here.\n\t\t/**\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.pageSize = parseInt(opts.pageSize) || customConfig.PAGE_SIZE;\n\n\t\t/**\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.routeContext = opts.routeContext || '';\n\n\t\t/**\n\t\t * For reserve\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.reserveCount = 0;\n\n\t\t/**\n\t\t * This will contain a SearchRules collection to describe the set of assets this collection will fetch.\n\t\t * @memberof Netx.Collections.Assets\n\t\t * @alias selection\n\t\t * @type {Netx.Collections.SearchRules}\n\t\t */\n\t\tthis.selection = opts.selection || new SearchRulesCollection();\n\t\tthis.addSubCollection(this.selection);\n\t\tdelete opts.selection;\n\n\t\t// We have this problem that a sort runs whenever a model changes - even if the change does not require a sort (for example: inCurrentCart)\n\t\tthis.sortableChange = true; //false;\n\n\t\tthis.pager = new PagerModel(\n\t\t\t{\n\t\t\t\tpageSize: this.pageSize,\n\t\t\t\tpagesToDisplay: 10,\n\t\t\t\t// I would really like to just do !( opts.pagerRoutes ) but lint yells about confusing use of `!`\n\t\t\t\troutesToPage: opts.pagerRoutes === false ? false : true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tcollection: this,\n\t\t\t},\n\t\t);\n\t\tthis.addSubModel(this.pager);\n\n\t\t/**\n\t\t * (because we can't pass strings directly in backbone.rpc method defs)\n\t\t * (because ... backbone.rpc!)\n\t\t * @property {object} categorizeArgs - Arguments for the batchCategorizeAssets rpc call\n\t\t * @property {string} categorizeArgs.add - Because RPC\n\t\t * @property {string} categorizeArgs.move - Because RPC\n\t\t * @property {string} categorizeArgs.remove - Because RPC\n\t\t * @property {number} categorizeArgs.targetCat - Category id\n\t\t * @property {string} categorizeArgs.action - Action to take (\"Add\", \"Move\", \"Remove\")\n\t\t */\n\t\tthis.categorizeArgs = {\n\t\t\tadd: 'add',\n\t\t\tmove: 'move',\n\t\t\tremove: 'remove',\n\t\t\ttargetCat: 0,\n\t\t\taction: '',\n\t\t};\n\n\t\t// TODO: Maybe SearchRules should manage this, aggregating these events into some sort of 'rulesChanged' event.\n\t\t// Or mabye Netx.Collection should do that generically.\n\n\t\t// Sometimes we fetch in 'faceted search' mode.\n\t\tconst useFS =\n\t\t\topts.useFacetedSearch != null\n\t\t\t\t? opts.useFacetedSearch === true\n\t\t\t\t: customConfig.USE_FACETED_SEARCH;\n\t\tconst fsOpts = opts.facetedSearchOptions || {};\n\t\tthis.useFacetedSearch(useFS, fsOpts);\n\n\t\t// Find & use any selection params set in options\n\t\tif (!_.isEmpty(opts)) {\n\t\t\t// are any of the options searchRule attributes?\n\t\t\t_.each(this.selection.at(0).keys(), (p) => {\n\t\t\t\tif (!opts[p]) return;\n\n\t\t\t\tif (_.isArray[p]) {\n\t\t\t\t\t// TODO: make this work for multidimensional options (more than one search rule specified) ?\n\t\t\t\t} else {\n\t\t\t\t\tthis.selection.at(0).set(p, opts[p]);\n\t\t\t\t}\n\t\t\t});\n\t\t\t// are any of the options searchRules properties?\n\t\t\t_.each(searchProperties, (p) => {\n\t\t\t\tif (opts[p] == null) return;\n\n\t\t\t\tthis.selection[p] = opts[p];\n\t\t\t});\n\t\t\t// are we attempting to set maxItems, which is not allowed in this context?\n\t\t\tif (opts.maxItems != null) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'Error: attempting to set maxItems in search rules collection, but it will be ignored. Set pageSize or chunkSize on asset collection instead.',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// this.chunkSize is used for fetching a subset of a page, for endless scroll & such.\n\t\t// allow chunkSize to change.\n\t\t//\n\t\tthis.fetch = _.wrap(this.fetch, (origFetch, opts) => {\n\t\t\tif (this.chunkSize) {\n\t\t\t\tthis.selection.maxItems = this.chunkSize + 1;\n\t\t\t}\n\t\t\treturn origFetch.call(this, opts);\n\t\t});\n\n\t\t// For fetching assets on the fly without affecting this collection\n\t\tthis.getAssetObjectIds = [];\n\n\t\t// When our selection changes, our contents are no longer valid\n\t\tconst invalidate = () => {\n\t\t\tthis.stopListening(this, 'useFaceted');\n\n\t\t\tdelete this.fetchingAssetCount;\n\t\t\tif (this.length) {\n\t\t\t\t// clear out our contents, so subsequent fetch() runs faster.\n\t\t\t\tthis.reset();\n\t\t\t}\n\t\t};\n\n\t\t// Hey, listen!\n\t\tthis\n\t\t\t// We have an extra fetch method that needs to simulate standard fetch events:\n\t\t\t.listenTo(\n\t\t\t\tthis,\n\t\t\t\t'request:fetchSpecificAssets',\n\t\t\t\t(collection, xhr, opts) => {\n\t\t\t\t\tif (!opts.silent) {\n\t\t\t\t\t\tthis.trigger('request:read', this, xhr, opts);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tthis,\n\t\t\t\t'complete:fetchSpecificAssets',\n\t\t\t\t(collection, result, opts) => {\n\t\t\t\t\tif (!opts.silent) {\n\t\t\t\t\t\tthis.trigger('sync', this, this.models, opts);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t)\n\t\t\t// When a faceted search happens, this.selection.searchFacets wants to mirror our fetch events:\n\t\t\t.listenTo(this, 'request:read', (collection, xhr, opts) => {\n\t\t\t\topts = opts || {};\n\t\t\t\tif (!opts.silent && this.useFacetedSearch()) {\n\t\t\t\t\tthis.selection.searchFacets.trigger(\n\t\t\t\t\t\t'request:read',\n\t\t\t\t\t\tthis.selection.searchFacets,\n\t\t\t\t\t\txhr,\n\t\t\t\t\t\topts,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t\t// When we sync listen for change in using faceted\n\t\t\t.listenTo(this, 'sync', (collection, result, opts) => {\n\t\t\t\tthis.stopListening(this, 'useFaceted');\n\t\t\t\tthis.listenTo(\n\t\t\t\t\tthis,\n\t\t\t\t\t'useFaceted',\n\t\t\t\t\t_.throttle((state) => {\n\t\t\t\t\t\tthis.fetch();\n\t\t\t\t\t}, 150),\n\t\t\t\t);\n\t\t\t\t// If so instructed, cache our selection after a successful sync.\n\t\t\t\t// (This allows Netx.assets.cursor to explore the same set of assets.)\n\t\t\t\tif (opts.cacheSelection) {\n\t\t\t\t\tdispatcher.trigger('asset:cursor:cacheFetch', this);\n\t\t\t\t}\n\t\t\t\tif (!opts.silent && this.useFacetedSearch()) {\n\t\t\t\t\tthis.selection.searchFacets.trigger(\n\t\t\t\t\t\t'sync',\n\t\t\t\t\t\tthis.selection.searchFacets,\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\topts,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t})\n\t\t\t// Always trigger a 'counted' event when this.pager.itemTotal changes to a defined value,\n\t\t\t// or a 'countUnknown' event when we no longer have a correct value.\n\t\t\t.listenTo(this.pager, 'change:itemTotal', (m, count) => {\n\t\t\t\tcount != null\n\t\t\t\t\t? this.trigger('counted', count)\n\t\t\t\t\t: this.trigger('countUnknown');\n\t\t\t})\n\t\t\t// We will get multiple events here; fire on just the first event\n\t\t\t.listenTo(\n\t\t\t\tthis.selection,\n\t\t\t\t'change add remove reset',\n\t\t\t\t_.throttle(invalidate, 250, {trailing: false}),\n\t\t\t)\n\t\t\t// Keep up with destruction\n\t\t\t.listenTo(this, 'destroy', (model, collection, opts) => {\n\t\t\t\t//Object {remove: true, add: true, merge: true, index: 0}\n\t\t\t\tlet count = this.pager.get('itemTotal');\n\t\t\t\tif (!count || isNaN(count)) count = 0;\n\t\t\t\tif (count) count--;\n\t\t\t\tthis.pager.set('itemTotal', count);\n\t\t\t})\n\t\t\t// Remove deleted assets\n\t\t\t.listenTo(dispatcher, 'asset:deleted', (assetId) => {\n\t\t\t\tthis.get(assetId) && this.remove(assetId);\n\t\t\t})\n\t\t\t// Listen for removal from category (if this happens to be a category asset collection)\n\t\t\t.listenTo(dispatcher, 'asset:moved:to:category', (assetId, newCat) => {\n\t\t\t\tif (!this.categoryId) return;\n\t\t\t\tlet asset = this.get(assetId);\n\t\t\t\tif (asset && newCat !== this.categoryId) {\n\t\t\t\t\tthis.remove(assetId);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.listenTo(\n\t\t\t\tdispatcher,\n\t\t\t\t'asset:editor:edited smartLabels:updated',\n\t\t\t\t(assetId) => {\n\t\t\t\t\tif (!this.get(assetId)) return;\n\t\t\t\t\tthis.reFetch({});\n\t\t\t\t},\n\t\t\t)\n\t\t\t// Listen for sort events\n\t\t\t.listenTo(dispatcher, 'user:sort', this.setSort);\n\t}\n\n\t/**\n\t * assetCount() returns an asset count, if the count is known. If the count isn't know,\n\t * it returns undefined and triggers an asset count call to the DAM. When the count is known,\n\t * 'counted' will be triggered on the collection with the correct count as an argument.\n\t *\n\t * Views that wish to display a count should call assetCount(), and listen for the 'counted' event.\n\t * @method\n\t * @return {number|undefined} Asset count\n\t */\n\tassetCount() {\n\t\tif (this.useFacetedSearch()) {\n\t\t\tif (!this.pager.get('itemTotal') && this.length) {\n\t\t\t\tthis.pager.set('itemTotal', this.selection.searchFacets.itemTotal || 0);\n\t\t\t}\n\t\t\treturn this.pager.get('itemTotal');\n\t\t}\n\n\t\t// Fixes false '0' occurences\n\t\tif (\n\t\t\tthis.pager.has('itemTotal') &&\n\t\t\tthis.pager.get('itemTotal') >= this.length\n\t\t) {\n\t\t\treturn this.pager.get('itemTotal');\n\t\t}\n\n\t\tif (this.fetchingAssetCount || this.length) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tthis.pager.set('itemTotal', 0);\n\t\treturn 0;\n\t}\n\n\t/**\n\t * Destroy all assets in this collection -- here and on the server.\n\t * @method\n\t * @fires module:asset#asset:deleted\n\t * @fires module:asset#asset:deleted:error\n\t */\n\tdestroyAll() {\n\t\t// Store for promises\n\t\tconst promises = [];\n\n\t\t// Do not create functions in while loops\n\t\tconst error = (assetId) => {\n\t\t\tdispatcher.trigger('asset:deleted:error', assetId);\n\t\t\tdispatcher.trigger('asset:deleted:error:' + assetId);\n\t\t};\n\t\tconst success = (assetId) => {\n\t\t\tdispatcher.trigger('asset:deleted', assetId);\n\t\t\tdispatcher.trigger('asset:deleted:' + assetId);\n\t\t};\n\n\t\t// Loop over all assets in this collection\n\t\tlet asset;\n\t\twhile (this.length > 0) {\n\t\t\tasset = this.at(0);\n\t\t\tconst aID = asset.get('assetId');\n\t\t\tpromises.push(\n\t\t\t\tasset.destroy().then(_.partial(success, aID), _.partial(error, aID)),\n\t\t\t);\n\t\t}\n\t\t// Wait for all promises to return\n\t\treturn $.when.apply($, promises);\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tisSortable() {\n\t\t// Cannot sort on cart or custom search types currently\n\t\tvar customSearchType = this.selection.findWhere({elementType: 9});\n\t\treturn _.isUndefined(customSearchType);\n\t}\n\n\t/**\n\t * Re-fetch all assets in collection\n\t * @method\n\t * @param {object} opts Fetch options\n\t */\n\treFetch(opts) {\n\t\t// See the wrapped fetch method in constructor\n\t\tconst hasChunkSize = !!this.chunkSize;\n\n\t\t// Backup values\n\t\tconst oldChunkSize = this.chunkSize;\n\t\tconst oldMaxItems = this.selection.maxItems;\n\n\t\t// Change to the amount of assets we currently have\n\t\thasChunkSize\n\t\t\t? (this.chunkSize = this.length)\n\t\t\t: (this.selection.maxItems = this.length + 1); // start positions begins at 1\n\n\t\treturn this.fetch(opts).always(() => {\n\t\t\t// Restore values\n\t\t\tthis.chunkSize = oldChunkSize;\n\t\t\tthis.selection.maxItems = oldMaxItems;\n\t\t});\n\t}\n\n\t/**\n\t * Respond to sort events\n\t * @method\n\t * @param {string} sortField Field to sort by\n\t * @param {number} sortOrder Sort direction ( 0/1 )\n\t */\n\tsetSort(sortField, sortOrder) {\n\t\tthis.selection.sortField = sortField;\n\t\tthis.selection.sortOrder = sortOrder;\n\t\tthis.trigger('sortChanged', this);\n\t}\n\n\t/**\n\t * selection start position basec on paging\n\t * @method\n\t * defaults to 1\n\t */\n\tsetStartPosition() {\n\t\tthis.curPage = this.curPage || 1;\n\t\t// otherwise set start position based on page\n\t\tthis.selection.startPosition = this.pageSize * (this.curPage - 1) + 1;\n\t}\n\n\t/**\n\t * Create an AssetSet model describing this set of assets.\n\t * This generic version returns just the current set of assets in this collection at this moment -- ignorant of paging, selection, etc.\n\t * Subclasses (cartAssets, searchAssets, categoryAssets, etc) will override this to return more meaningful asset sets.\n\t * @method\n\t * @return {module:asset/models/assetSet} AssetSet\n\t */\n\ttoAssetSet() {\n\t\treturn new AssetSetModel({\n\t\t\ttype: assetSetTypes.asset,\n\t\t\tids: this.ids(),\n\t\t\tlabel: i18n.t('i18n.nAssets', {count: this.length}),\n\t\t\tmodels: this.models,\n\t\t});\n\t}\n\n\t////////////////////////////////////\n\t// CATEGORIZE\n\t////////////////////////////////////\n\n\t/**\n\t * @method\n\t * @param {number} catId Category id\n\t * @todo DAM-8470, then unwrap this.\n\t */\n\taddToCategory(catId) {\n\t\tconst d = new $.Deferred();\n\t\tconst cat = new CategoryModel({id: catId});\n\t\tcat.fetch().then((c) => {\n\t\t\tconst assetIds = this.ids();\n\t\t\tif (!assetIds.length) {\n\t\t\t\treturn d.reject();\n\t\t\t}\n\n\t\t\tthis.targetCategory = catId;\n\t\t\tthis._addToCategory().then(() => {\n\t\t\t\td.resolve();\n\t\t\t}, d.reject);\n\t\t}, d.reject);\n\t\treturn d.promise();\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} catId Category id\n\t * @todo DAM-8470, then unwrap this.\n\t */\n\tmoveToCategory(catId) {\n\t\tconst d = new $.Deferred();\n\t\tconst cat = new CategoryModel({id: catId});\n\t\tcat.fetch().then((c) => {\n\t\t\tvar assetIds = this.ids();\n\t\t\tif (!assetIds.length) {\n\t\t\t\treturn d.reject();\n\t\t\t}\n\n\t\t\tthis.targetCategory = catId;\n\t\t\tthis._moveToCategory().then(() => {\n\t\t\t\td.resolve();\n\t\t\t}, d.reject);\n\t\t}, d.reject);\n\t\treturn d.promise();\n\t}\n\n\t////////////////////////////////////\n\t// !CATEGORIZE\n\t////////////////////////////////////\n\n\t////////////////////////////////////\n\t// CHUNKS\n\t////////////////////////////////////\n\n\t/**\n\t * For chunked loading of pages, addChunk loads the next not-yet-loaded section of a page.\n\t * @method\n\t * @param {object} opts Chunk fetch options\n\t */\n\taddChunk(opts = {}) {\n\t\tif (\n\t\t\t// Do nothing if we're in the midst of a sync, or if we have no more chunks.\n\t\t\tthis.syncing ||\n\t\t\tthis.lastChunk ||\n\t\t\tthis.pageSize == this.length ||\n\t\t\tthis.length >= this.pageSize\n\t\t) {\n\t\t\treturn new $.Deferred().resolve();\n\t\t}\n\n\t\tconst lengthBefore = this.length;\n\t\t// disable the 'loading' class/div behaviour when loading a chunk\n\t\topts.chunk = this.loadingChunk = true;\n\n\t\treturn this.fetch(opts).then(() => {\n\t\t\t// if we didn't get anything new?\n\t\t\tif (this.length == lengthBefore && !this.lastChunk) {\n\t\t\t\t// Out-of-order fetches can occur, leading to a deadly chunk loop.\n\t\t\t\t// Clean that up by re-fetching the entire page so far.\n\t\t\t\topts.refetch = true;\n\t\t\t\treturn this.fetch(opts).then((response) => {\n\t\t\t\t\tdelete this.loadingChunk;\n\t\t\t\t\treturn this;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tdelete this.loadingChunk;\n\t\t\treturn this;\n\t\t});\n\t}\n\n\t////////////////////////////////////\n\t// !CHUNKS\n\t////////////////////////////////////\n\n\t////////////////////////////////////\n\t// FACETS\n\t////////////////////////////////////\n\n\t/**\n\t * This checks that there are no invalid facet search types in our search rules\\\n\t * @method\n\t * @return {boolean} Valid\n\t */\n\tcheckValidFacetSearchType() {\n\t\tlet valid = true;\n\t\tthis.selection.each((m) => {\n\t\t\tif (valid && _.indexOf(facetSupports, m.get('elementType')) < 0) {\n\t\t\t\tvalid = false;\n\t\t\t}\n\t\t});\n\n\t\treturn valid;\n\t}\n\n\t/**\n\t * When an option is selected or deselected in our search facets, this function is called.\n\t * By default it triggers a fetch. Override it for different behavior.\n\t * @method\n\t * @param {Netx.Models.SearchFacet} model SearchFacet model that changed\n\t * @param {object} opts Options\n\t */\n\tfacetSelected(model, collection, opts) {\n\t\t// Reset start position to 1\n\t\tthis.selection.startPosition = 1;\n\t\tthis.pager.gotoPage(1, true);\n\t\tthis.fetch(_.extend({}, opts, {duplicateQueryPolicy: 'abort'}));\n\t}\n\n\t/**\n\t * calling this.useFacetedSearch() with a boolean sets faceted search mode on or off,\n\t * and returns the state.\n\t * Calling it with no arguments just returns the state.\n\t * @method\n\t * @param {boolean} state true (on) or false (off)\n\t * @param {object} opts options to set on the searchFacets child collection -- such as 'filterMode'\n\t */\n\tuseFacetedSearch(state, opts) {\n\t\t// Check that we are using a valid search type\n\t\tconst validSearchType = this.checkValidFacetSearchType();\n\t\t// Let it set the things it would normally set regardless\n\t\tif (state != null) {\n\t\t\tif (state) {\n\t\t\t\t_.extend(this.selection.searchFacets, opts || {});\n\t\t\t\t// Listen for facet options to change\n\t\t\t\tthis.stopListening(dispatcher, 'search:facet:option:changed').listenTo(\n\t\t\t\t\tdispatcher,\n\t\t\t\t\t'search:facet:option:changed',\n\t\t\t\t\t(model, collection) => {\n\t\t\t\t\t\t// Make sure we're the right collection:\n\t\t\t\t\t\t// added !this.hasRouteContext() because collection !== this.selection.searchFacets\n\t\t\t\t\t\t// results in false for both category and search asset collections\n\t\t\t\t\t\t// are they using the same facet collection? Not seeing ids to compare\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcollection !== this.selection.searchFacets ||\n\t\t\t\t\t\t\t!this.hasRouteContext()\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\tthis.facetSelected.apply(this, arguments);\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.stopListening(dispatcher, 'search:facet:option:changed');\n\t\t\t}\n\n\t\t\tthis._usingFacetedSearch = state;\n\t\t\t// This only matters if they have chosen a valid search type\n\t\t\tif (validSearchType) {\n\t\t\t\tif (!state) this.selection.searchFacets.turnOff();\n\t\t\t\tthis.trigger('useFaceted', state, this);\n\t\t\t} else if (state && !validSearchType) {\n\t\t\t\t// Dispatch something to let the user know that facets have been disabled for this search type\n\t\t\t}\n\t\t}\n\t\t// Not valid\n\t\t// We do it like this so we are not actually turning facets off if a user wished to turn them on\n\t\t// we are just turning them off for this search type but will honor the users wishes to have facets on for\n\t\t// all other valid searches\n\t\telse if (!validSearchType) {\n\t\t\t// Dispatch something to let the user know that facets have been disabled for this search type\n\t\t\tthis.selection.searchFacets.turnOff();\n\t\t\treturn false;\n\t\t}\n\t\t// We made it\n\t\treturn this._usingFacetedSearch;\n\t}\n\t////////////////////////////////////\n\t// !FACETS\n\t////////////////////////////////////\n\n\t////////////////////////////////////\n\t// PAGING\n\t////////////////////////////////////\n\t/**\n\t * Determine if this collection is the one referred to in the route hash\n\t * helpful for search facets, is this the right collection? have we changed contexts?\n\t * should facets be reset or are we paging? Is our context in the location.hash?\n\t * @method\n\t */\n\thasRouteContext() {\n\t\t// Check for unescaped and escaped\n\t\tconst hash = unescapeURI(window.location.hash);\n\t\treturn (\n\t\t\thash.indexOf(unescapeURI(this.routeContext)) > -1 ||\n\t\t\thash.indexOf(escapeURI(this.routeContext)) > -1\n\t\t);\n\t}\n\n\t////////////////////////////////////\n\t// !PAGING\n\t////////////////////////////////////\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Assets';\n\t}\n}\n","/**\n * @class\n * Collection to handle attribute profiles\n * https://kb.netx.net/display/DEV/Attribute+Profiles+for+Folders\n */\n\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/attributeProfile';\nimport Netx from '@netx/core/bootstrap';\nimport PagerModel from '@netx/core-app/models/pager';\nimport SorterModel from '@netx/core-app/models/sorter';\n\nimport {ATTRIBUTE_PROFILE_EVENT} from '@netx/core-attribute-profile/actions';\n\nexport default class AttributeProfiles extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tgetAttributeProfiles: 'Loading attribute profiles',\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tgetAttributeProfiles: 'Loaded attribute profiles',\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget methods() {\n\t\treturn {\n\t\t\tread() {\n\t\t\t\treturn [\n\t\t\t\t\t'getAttributeProfiles',\n\t\t\t\t\tthis.filterStr,\n\t\t\t\t\tthis.sorter.getSortDTO(),\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t];\n\t\t\t},\n\t\t\tgetAttributeProfileForFolder: (folderId, opts) => [\n\t\t\t\t'getAttributeProfileForFolder',\n\t\t\t\tfolderId,\n\t\t\t],\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget parsers() {\n\t\treturn {\n\t\t\tgetAttributeProfileForFolder: (data, opts) => {\n\t\t\t\treturn data;\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * Paging model\n\t\t * @memberOf Netx.Collections.AttributeProfiles\n\t\t * @alias pager\n\t\t * @type {Netx.Models.Pager}\n\t\t */\n\t\tthis.pager = new PagerModel(\n\t\t\tObject.assign(\n\t\t\t\t{\n\t\t\t\t\t// TODO: collections/models should not need to know about routes/routing\n\t\t\t\t\troutesToPage: false,\n\t\t\t\t},\n\t\t\t\topts.pager,\n\t\t\t),\n\t\t\t{collection: this},\n\t\t);\n\n\t\t/**\n\t\t * Sorting model\n\t\t * @memberof module:asset/collections/participants\n\t\t * @alias sorter\n\t\t * @type {module:app/models/sorter}\n\t\t */\n\t\tthis.sorter = new SorterModel(\n\t\t\t{\n\t\t\t\tfield: opts.sortField || 'name',\n\t\t\t\torder: opts.sortOrder || 'desc',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcollection: this,\n\t\t\t\tsortableFields: ['name'],\n\t\t\t},\n\t\t);\n\t\tthis.addSubModel(this.sorter);\n\n\t\t// Add model to collection after successful edit\n\t\tthis.listenTo(\n\t\t\tdispatcher,\n\t\t\t`${ATTRIBUTE_PROFILE_EVENT.EDIT}:success`,\n\t\t\t(attributeProfile) => {\n\t\t\t\tthis.add(attributeProfile, {merge: true});\n\t\t\t\tthis.trigger('sync', this);\n\t\t\t},\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AttributeProfiles';\n\t}\n}\n","/**\n * @class\n * @todo Documents defaults\n */\nimport Base from '@netx/core/lib/netx-model';\n\nexport default class PendingAsset extends Base {\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'assetId';\n\t}\n\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t// assetId: undefined,\n\t\t\tcategoryIds: [],\n\t\t\tdirection: undefined, // 'coming' or 'going'\n\t\t\tstate: undefined, // 'uploading', 'importing', 'indexing', etc\n\t\t};\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'PendingAsset';\n\t}\n}\n","/**\n * the Pending Assets collection maintans a list of assets that are in a state of flux,\n * entering or leaving a category due to import, deletion or recategorization. We need\n * to do this parly because our main selection mechanism, searchAssetListObjects(), goes through\n * an indexed search layer that takes a moment to re-index after a change. This collection\n * maintains state about any changes that we have performed that the DAM is not yet finished with.\n * @class\n * @TODO This collection needs a lot of attention but right now it works\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/pendingAsset';\n\nexport default class PendingAssets extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * Pending Assets collections react to various pre-existing system events that indicate\n\t\t * an asset is about to be added to, or removed from, a category.\n\t\t *\n\t\t * It creates an 'coming' record when a file import begins,\n\t\t */\n\t\tthis.listenTo(dispatcher, 'upload:import:imported', this.assetImporting);\n\t\t/**\n\t\t * and both 'coming' and 'going' records when assets are recategorized.\n\t\t */\n\t\tthis.listenTo(\n\t\t\tdispatcher,\n\t\t\t'asset:category:added',\n\t\t\tthis.assetEnteringCategory,\n\t\t);\n\t\tthis.listenTo(\n\t\t\tdispatcher,\n\t\t\t'asset:category:removed',\n\t\t\tthis.assetLeavingCategory,\n\t\t);\n\n\t\t/**\n\t\t * Asset deletion is almost instant, but this could be extended to that as well.\n\t\t */\n\t}\n\n\tassetImporting(plupload, file, asset) {\n\t\tconst categoryId = asset.get('categoryid');\n\n\t\tvar p = new Model({\n\t\t\tassetId: asset.id,\n\t\t\tcategoryIds: [categoryId],\n\t\t\tdirection: 'coming',\n\t\t\tstate: 'uploading',\n\t\t});\n\n\t\tvar events = {\n\t\t\tdone: 'asset:task:complete:',\n\t\t\tcancelled: 'asset:pending:import:cancelled:',\n\t\t};\n\n\t\tthis.add(p);\n\n\t\t/**\n\t\t * When an uploading asset finishes uploading, the pending list record state is switched from 'uploading' to 'pending'\n\t\t */\n\t\tdispatcher.once(\n\t\t\tevents.uploaded + p.id,\n\t\t\tfunction () {\n\t\t\t\tp.set({state: 'pending'});\n\t\t\t},\n\t\t\tp,\n\t\t);\n\n\t\t/**\n\t\t * When a 'tasks:done' event for an asset arrives, that asset is removed from the Pending list.\n\t\t */\n\t\tvar setupDoneListener = function () {\n\t\t\tdispatcher.once(\n\t\t\t\tevents.done + p.id,\n\t\t\t\tfunction () {\n\t\t\t\t\tif (p.collection) {\n\t\t\t\t\t\tp.collection.remove(p);\n\t\t\t\t\t}\n\t\t\t\t\tdispatcher.trigger('asset:pending:task:complete:' + p.id);\n\t\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t\t'category:asset:pending:task:complete',\n\t\t\t\t\t\tcategoryId,\n\t\t\t\t\t\tp.id,\n\t\t\t\t\t);\n\t\t\t\t\t// kill the cancel listener.\n\t\t\t\t\tdispatcher.off(events.cancelled + p.id, undefined, p);\n\t\t\t\t},\n\t\t\t\tp,\n\t\t\t);\n\t\t};\n\n\t\tsetupDoneListener();\n\n\t\t/**\n\t\t * In the case of import cancellation, that asset is also removed from the list.\n\t\t */\n\t\tdispatcher.once(\n\t\t\tevents.cancelled + p.id,\n\t\t\tfunction (model, newId) {\n\t\t\t\t// DAM-7713:\n\t\t\t\t// If there was a new ID issued, we want to track tasks on that ID,\n\t\t\t\t// instead of on the model's current ID.\n\t\t\t\t// (The model ought to update itself momentarily; this event is triggered right before that happens.)\n\t\t\t\tif (model && model.id !== newId) {\n\t\t\t\t\tvar oldId = model.id;\n\t\t\t\t\tp.set({\n\t\t\t\t\t\tassetId: newId,\n\t\t\t\t\t});\n\t\t\t\t\t// DEVNOTE: the decision to embed the asset id in the event name makes this part hella awkward.\n\t\t\t\t\t// It's nice elsewhere: in the case of asset models, every asset can listen for only its ID\n\t\t\t\t\t// (n performance), rather than all assets listening for all IDs (n^2), and we have a lot of asset models.\n\t\t\t\t\t// But in this context, it'd be better to have permanent listeners to events that don't have IDs in their names,\n\t\t\t\t\t// that don't need to be turned on and off all the time.\n\t\t\t\t\t//\n\t\t\t\t\t// I know that in some places we trigger two different events in order to have it both ways. That also feels yucky.\n\t\t\t\t\t//\n\t\t\t\t\t// Perhaps a single \"all\" listener could be in charge of spotting the form without the ID,\n\t\t\t\t\t// translating it to the form with the ID, and re-triggering,\n\t\t\t\t\t// for every event its useful to do that with.\n\t\t\t\t\t//\n\t\t\t\t\t// Until then, this sort of cruft is necessary:\n\t\t\t\t\tdispatcher.off(events.done + oldId); // that ID is dead, nobody should listen.\n\t\t\t\t\tsetupDoneListener();\n\t\t\t\t} else {\n\t\t\t\t\t// Some other cancellation ... just leave it alone\n\t\t\t\t\tif (p.collection) {\n\t\t\t\t\t\tp.collection.remove(p);\n\t\t\t\t\t}\n\t\t\t\t\t// Kill all listeners\n\t\t\t\t\tdispatcher.off(events.uploaded + p.id, undefined, p);\n\t\t\t\t\tdispatcher.off(events.done + p.id, undefined, p);\n\t\t\t\t}\n\t\t\t\t// TODO: all listeners off\n\t\t\t},\n\t\t\tp,\n\t\t);\n\n\t\tdispatcher.trigger(\n\t\t\t'asset:pending:import:start',\n\t\t\tplupload,\n\t\t\tfile,\n\t\t\tasset,\n\t\t\tcategoryId,\n\t\t);\n\t}\n\n\tassetEnteringCategory(assetId, categoryId, asset) {\n\t\tvar p = new Model({\n\t\t\tassetId: parseInt(assetId),\n\t\t\tcategoryIds: [parseInt(categoryId)],\n\t\t\tdirection: 'coming',\n\t\t\tstate: 'pending',\n\t\t});\n\n\t\tthis.add(p);\n\n\t\tdispatcher.once(\n\t\t\t'asset:task:complete:' + assetId,\n\t\t\tfunction (task) {\n\t\t\t\tif (p.collection) {\n\t\t\t\t\tp.collection.remove(p);\n\t\t\t\t}\n\t\t\t\tdispatcher.trigger('asset:pending:task:complete:' + assetId);\n\t\t\t},\n\t\t\tp,\n\t\t);\n\n\t\tdispatcher.trigger('asset:pending:category:coming', assetId, categoryId, p);\n\t}\n\n\tassetLeavingCategory(assetId, categoryId, asset) {\n\t\tvar p = new Model({\n\t\t\tassetId: parseInt(assetId),\n\t\t\tcategoryIds: [parseInt(categoryId)],\n\t\t\tdirection: 'going',\n\t\t\tstate: 'pending',\n\t\t});\n\n\t\tthis.add(p);\n\n\t\tdispatcher.once(\n\t\t\t'asset:task:complete:' + assetId,\n\t\t\tfunction (task) {\n\t\t\t\tif (p.collection) {\n\t\t\t\t\tp.collection.remove(p);\n\t\t\t\t}\n\t\t\t\tdispatcher.trigger('asset:pending:task:complete:' + assetId);\n\t\t\t},\n\t\t\tp,\n\t\t);\n\n\t\tdispatcher.trigger('asset:pending:category:going', assetId, categoryId, p);\n\t}\n\n\t/**\n\t * The methods findByAsset, filterByAsset, findByCategory and filterByCategory\n\t * take the appropriate ID as an argument, and return pendingAsset objects if they exist in the collection.\n\t * The find* methods return undefined if nothing is found; the filter* methods\n\t * return an empty array.\n\t */\n\n\t// TODO: every render of every assetListItemView now calls findByAsset, so\n\t// maybe measure its performance, possibly reorg the object to get better access.\n\n\tfindByAsset(assetId) {\n\t\treturn this.find(function (p) {\n\t\t\treturn parseInt(assetId) == parseInt(p.get('assetId'));\n\t\t});\n\t}\n\n\tfilterByAsset(assetId) {\n\t\treturn this.filter(function (p) {\n\t\t\treturn parseInt(assetId) == parseInt(p.get('assetId'));\n\t\t});\n\t}\n\n\tfindByCategory(catId) {\n\t\treturn this.find(function (p) {\n\t\t\treturn (\n\t\t\t\t_.indexOf(p.get('categoryIds'), parseInt(catId)) > -1 || // check for 37\n\t\t\t\t_.indexOf(p.get('categoryIds'), catId + '') > -1 // check for \"37\"\n\t\t\t);\n\t\t}); // TODO: refactor as array\n\t}\n\n\tfilterByCategory(catId) {\n\t\treturn this.filter(function (p) {\n\t\t\treturn (\n\t\t\t\t_.indexOf(p.get('categoryIds'), parseInt(catId)) > -1 || // check for 37\n\t\t\t\t_.indexOf(p.get('categoryIds'), catId + '') > -1 // check for \"37\"\n\t\t\t);\n\t\t}); // TODO: refactor as array\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'PendingAssets';\n\t}\n}\n","import PendingAssetsCollection from '../pendingAssets';\n\nexport const pendingAssets = new PendingAssetsCollection([]);\n\nexport default pendingAssets;\n\nimport {setGlobal} from '@netx/core-next/utils/setGlobal';\nif (process.env.NODE_ENV !== 'production') {\n\tsetGlobal({pendingAssets});\n}\n","export const AudioFormatFamilyType = {\n\tAUDIO: 'audio',\n};\nexport const AudioFormatFamilies = Object.values(AudioFormatFamilyType);\n\nexport const DocumentFormatFamilyType = {\n\tDOCUMENT: 'document',\n\tLAYOUT: 'layout',\n};\nexport const DocumentFormatFamilies = Object.values(DocumentFormatFamilyType);\n\nexport const ImageFormatFamilyType = {\n\tCAMERA_RAW: 'cameraRaw',\n\tIMAGE: 'image',\n\tRAW: 'raw',\n\tVECTOR: 'vector',\n};\nexport const ImageFormatFamilies = Object.values(ImageFormatFamilyType);\n\nexport const VideoFormatFamilyType = {\n\tVIDEO: 'video',\n};\nexport const VideoFormatFamilies = Object.values(VideoFormatFamilyType);\n\nexport const MediaFormatFamilyType = {\n\t...AudioFormatFamilyType,\n\t...VideoFormatFamilyType,\n};\nexport const MediaFormatFamilies = Object.values(MediaFormatFamilyType);\n","/**\n * Asset constituent model\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport AssetSetModel from './assetSet';\nimport {types as assetSetTypes} from '../properties/assetSets';\n\nexport default class AssetConstituent extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * The unique ID for this model is \"id\"\n\t * @type {string}\n\t */\n\tget idAttribute() {\n\t\treturn 'constituentId';\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.constituentId - Constituent id (Never set the id in defaults)\n\t * @property {number} defaults.display - Display constituent (boolean as number)\n\t * @property {number} defaults.assetId - Asset id (the asset I am a constituent of)\n\t * @property {string} defaults.lowresUrl - Low resolution image (unused?)\n\t * @property {string} defaults.modDate - Modification date string\n\t * @property {string} defaults.previewUrl - Preview image\n\t * @property {number} defaults.rebuildCount - ??? Rebuild count\n\t * @property {number} defaults.rebuildType - ??? Rebuild type\n\t * @property {number} defaults.ref - ???\n\t * @property {string} defaults.thumbUrl - Thumbnail image\n\t * @property {string} defaults.title - Title\n\t * @property {number} defaults.type - 1 = time (keyframe), 2 = layer, 3 = page, 4 = clips\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t// constituentId : 0,\n\t\t\tattributes: [],\n\t\t\tdisplay: 0,\n\t\t\tassetId: 0,\n\t\t\tlowresUrl: '',\n\t\t\tmodDate: '',\n\t\t\tpreviewUrl: '',\n\t\t\trebuildType: 0,\n\t\t\trebuildCount: 0,\n\t\t\tref: 1,\n\t\t\tthumbUrl: '',\n\t\t\ttitle: '',\n\t\t\ttype: 0,\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - Model RPC methods\n\t * @property {function|array} methods.read - Fetch constituent\n\t * @property {function|array} methods.setDisplay - Tell the dam to use this constituent as the image thumbnail/preview\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tread: ['getConstituentObject', 'constituentId'],\n\t\t\tsetDisplay: ['setConstituentDisplay', 'constituentId'],\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Model parsers\n\t * @property {function} parsers.setDisplay - Parse the return of our fetch, it is an array with a single record\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {null} result Result (returns `null` - very helpful)\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetDisplay(result, opts) {\n\t\t\t\tthis.set({display: 1});\n\t\t\t\treturn result;\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * @memberof module:asset/models/assetConstituent\n\t\t * @alias clipAttributes\n\t\t * @type {module:asset/collections/attributes}\n\t\t */\n\t\tthis.clipAttributes = opts.clipAttributes;\n\t}\n\n\t/**\n\t * Check our permissionMatrix for whether a particular named bit is set.\n\t * Pipes through the asset we belong to\n\t * @method\n\t * @param {string} perm One of the permissions in {module:permissions/properties/assetPermissions#matrixNames}\n\t * @returns {mixed} returns true or false, or undefined (which is falsy) if the argument is undefined.\n\t */\n\tallows(perm) {\n\t\t// TODO: better way to handle the contituents having access to the asset bean they belong to\n\t\t// Maybe, rather than passing an assetId to constituents we passa full on bean - that way when it updates\n\t\t// we update and have proper permission matrix rather than relying that the constituent's asset will always\n\t\t// be Netx.currentAsset\n\t\treturn Netx.currentAsset.allows.apply(Netx.currentAsset, arguments);\n\t}\n\n\t/**\n\t * Return an assetSet object defining the set that contains just this constituent.\n\t * @method\n\t * @return {module:asset/models/assetSet} AssetSet model\n\t */\n\ttoAssetSet() {\n\t\treturn new AssetSetModel({\n\t\t\ttype: assetSetTypes.asset,\n\t\t\tids: [this.get('assetId')],\n\t\t\tmodels: [this],\n\t\t\tlabel: this.get('title'),\n\t\t\tcanCreateLink: false,\n\t\t\tcanEmail: false,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituent';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './assetConstituent';\n\nimport ProgressModel from '@netx/core-app/models/progress';\n\nimport {pad} from '@netx/core/lib/underscore-netx';\n\nexport default class AssetConstituent_Clip extends Base {\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {string} defaults.endTime - Clip end time string\n\t * @property {string} defaults.startTime - Clip start time string\n\t * @property {string} defaults.title - Default title\n\t * @property {number} defaults.type - Default type (4 = clip)\n\t *\n\t * @property {boolean} defaults.keyframeReady - Default keyframe ready state (client)\n\t * @property {string} defaults.uuid - Default uuid for tracking creation/update progress\n\t */\n\tget defaults() {\n\t\treturn _.extend(super.defaults, {\n\t\t\tendTime: 0,\n\t\t\tstartTime: 0,\n\t\t\ttitle: '',\n\t\t\ttype: 4,\n\t\t\t// Client attrs\n\t\t\tkeyframeReady: true,\n\t\t\tuuid: '',\n\t\t});\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn super.clientAttrs.concat(['keyframeReady', 'uuid']);\n\t}\n\n\t/**\n\t * Right now, the only constituents that can be created by the client are clips\n\t * @property {object} methods - Model RPC methods\n\t * @property {function|array} methods.create - Create clip\n\t * @property {function|array} methods.remove - Delete clip\n\t * @property {function|array} methods.updated - Update clip\n\t */\n\tget methods() {\n\t\treturn _.extend(super.methods, {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tcreate(opts) {\n\t\t\t\treturn ['setClip', this.self()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tremove(opts) {\n\t\t\t\treturn ['deleteClip', this.id];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate(opts) {\n\t\t\t\treturn ['setClip', this.self()];\n\t\t\t},\n\t\t\t_prepareDownload: [\n\t\t\t\t'prepareDownload',\n\t\t\t\t'downloadOptions.assets',\n\t\t\t\t'downloadOptions.processes',\n\t\t\t\t'downloadOptions.arg1',\n\t\t\t\t'downloadOptions.arg2',\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * @property {object} parsers - Model parsers\n\t * @property {function} parsers.create - Parse the return of create clip\n\t * @property {function} parsers.create - Parse the return of update clip\n\t */\n\tget parsers() {\n\t\treturn _.extend(super.parsers, {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} data Clip data (constituent and keyframe uuid)\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tcreate(data, opts) {\n\t\t\t\treturn _.extend(data.constituent, {\n\t\t\t\t\tkeyframeReady: false,\n\t\t\t\t\tuuid: data.progressUuid,\n\t\t\t\t});\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} data Clip data (constituent and [possibly] keyframe uuid)\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate(data) {\n\t\t\t\tlet _data = {};\n\t\t\t\tif (data.progressUuid) {\n\t\t\t\t\t_data = {\n\t\t\t\t\t\tkeyframeReady: false,\n\t\t\t\t\t\tuuid: data.progressUuid,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn _.extend(data.constituent, _data);\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attr Model attributes\n\t * @param {object} opts Model options\n\t * @fires module:app#app:pollBatchJob\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * @memberOf module:asset/models/assetConstituent_clip\n\t\t * @alias downloadOptions\n\t\t * @type {object}\n\t\t */\n\t\tthis.downloadOptions = opts.downloadOptions || {};\n\n\t\t/**\n\t\t * @memberof module:asset/models/assetConstituent_clip\n\t\t * @alias progress\n\t\t * @type {module:app/models/progress}\n\t\t */\n\t\tthis.progress = new ProgressModel();\n\n\t\t// Hey, listen!\n\t\t// When a clip is beign created/updated on the server - track the progress\n\t\tthis.listenTo(this, 'change:uuid', () => {\n\t\t\tthis.trackBatchJob(this.get('uuid'));\n\t\t})\n\t\t\t.listenTo(this, 'progress', (model, batchJob, progress) => {\n\t\t\t\tconst progressMessage = (batchJob && batchJob.get('details')) || '';\n\t\t\t\tthis.progress.update(progress, progressMessage);\n\t\t\t})\n\t\t\t.listenTo(this, 'complete', (model, batchJob) => {\n\t\t\t\tthis.fetch().then(() => {\n\t\t\t\t\tthis.set({\n\t\t\t\t\t\tkeyframeReady: true,\n\t\t\t\t\t});\n\t\t\t\t\tthis.progress.complete();\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\t/**\n\t * return a cache-busting string for the asset preview; this string should change every time the asset preview changes.\n\t * @method\n\t * @return string\n\t */\n\tcacheBuster(prefix) {\n\t\t// If this model doesn't have moddate set, use the current time.\n\t\tconst timeStr = this.get('moddate')\n\t\t\t? _.dateFromAsset(this.get('moddate')).getTime()\n\t\t\t: _.now();\n\n\t\treturn '?' + (prefix ? prefix + '&' : '') + 't=' + timeStr;\n\t}\n\t/**\n\t * @method\n\t * @return {object} Duration\n\t */\n\tgetDuration() {\n\t\tconst start = parseFloat(this.get('startTime'));\n\t\tconst end = parseFloat(this.get('endTime'));\n\t\tconst floor = Math.floor;\n\t\tconst duration = end - start;\n\n\t\tlet hour, minute, second, millisecond, time;\n\n\t\ttime = duration;\n\t\thour = floor(time / 3600);\n\t\ttime -= hour * 3600;\n\t\tminute = floor(time / 60);\n\t\ttime -= floor(minute * 60);\n\t\tsecond = floor(time);\n\t\tmillisecond = Math.round((time - second) * 1000);\n\n\t\treturn {\n\t\t\tseconds: duration,\n\t\t\tpretty: [\n\t\t\t\tpad(hour, 2),\n\t\t\t\t':',\n\t\t\t\tpad(minute, 2),\n\t\t\t\t':',\n\t\t\t\tpad(second, 2),\n\t\t\t\t'.',\n\t\t\t\tpad(millisecond, 3),\n\t\t\t].join(''),\n\t\t};\n\t}\n\t/**\n\t * Get the manual repurpose options for clip downloading\n\t * @method\n\t * @param {module:asset/models/assetProcess} process (Video) preset process data\n\t * @returns {array} Manual repurpose options\n\t */\n\tgetManualRepurposeOptions(process) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tlabel: 'trim',\n\t\t\t\tvalue: [this.get('startTime'), this.get('endTime')].join('-'),\n\t\t\t},\n\t\t\t{label: 'codec', value: process.get('videoCodec')},\n\t\t\t{label: 'videoBitrate', value: process.get('videoBitrate')},\n\t\t\t{label: 'audioBitrate', value: process.get('audioBitrate')},\n\t\t\t{label: 'audioChannels', value: process.get('audioChannels')},\n\t\t\t{\n\t\t\t\tlabel: 'resize',\n\t\t\t\tvalue: [process.get('width'), process.get('height')].join(),\n\t\t\t},\n\t\t\t{label: 'format', value: process.get('format')},\n\t\t];\n\t}\n\t/**\n\t * @method\n\t * @return {object} Pretty range\n\t */\n\tgetPrettyRange() {\n\t\tconst floor = Math.floor;\n\t\tconst round = Math.round;\n\t\tconst prettyRange = {};\n\n\t\t// Loops over start, end, duration\n\t\t_.each(['startTime', 'endTime'], (r) => {\n\t\t\tlet hour, minute, second, millisecond, time;\n\n\t\t\ttime = parseFloat(this.get(r)) || 0;\n\t\t\thour = floor(time / 3600);\n\t\t\ttime -= hour * 3600;\n\t\t\tminute = floor(time / 60);\n\t\t\ttime -= floor(minute * 60);\n\t\t\tsecond = floor(time);\n\t\t\tmillisecond = round((time - second) * 1000);\n\n\t\t\tprettyRange[r] = [\n\t\t\t\tpad(hour, 2),\n\t\t\t\t':',\n\t\t\t\tpad(minute, 2),\n\t\t\t\t':',\n\t\t\t\tpad(second, 2),\n\t\t\t\t'.',\n\t\t\t\tpad(millisecond, 3),\n\t\t\t].join('');\n\t\t});\n\n\t\treturn prettyRange;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetConstituent_Clip';\n\t}\n}\n","/**\n * This object allows us to specify assets in one of the four Asset Set types\n * we know how to download: a cart, a search, a category or some bare assets.\n * (Other types may be added in the future.)\n * @class\n * @extends Netx.Model\n * @todo Finish documentation of defaults, methods and parsers\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport DownloadOptionsCollection from '@netx/core-share/collections/downloadOptions';\nimport ShareableModel from '@netx/core-share/models/shareable';\n\nimport Rpc from 'core-libs/backbone.rpc';\n\nimport {i18n} from '@netx/core/i18n';\n\nimport {types as assetSetTypes} from '../properties/assetSets';\nimport {types as downloadOptionTypes} from '@netx/core-share/properties/downloadOptions';\n// portal is causing issues here with `local selection` for public users\n// import {allSavedCarts} from '@netx/core-cart/collections/singleton/savedCart';\nimport {allSavedSearches} from '@netx/core-search/collections/singleton/savedSearch';\n\nexport default class AssetSet extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {array} defaults.ids - The default ids\n\t * @property {boolean} defaults.recursive - The default recursiveness. For completeness, the `category` type needs this extra info. Other types ignore this property.\n\t * @property {string} defaults.type - The default type. See assetSetProps.types\n\t *\n\t * @property {array} defaults.assetIds - The default asset ids belonging to set (client side)\n\t * @property {string} defaults.label - The default label. It's useful to set a label for the set when it's created, since it feeds into a generic system (client side)\n\t * @property {array} defaults.models - The default models. Handy to attach the original models/collections, if we had them (client side)\n\t * @property {boolean} defaults.canCreateLink - The default description (client side)\n\t * @property {boolean} defaults.canEmail - The default description (client side)\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tids: [],\n\t\t\trecursive: false,\n\t\t\ttype: '',\n\n\t\t\t// Client\n\t\t\tassetCount: 0,\n\t\t\tassetIds: [],\n\t\t\tcanCreateLink: null,\n\t\t\tcanEmail: null,\n\t\t\tlabel: '',\n\t\t\tmodels: [],\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn [\n\t\t\t'assetIds',\n\t\t\t'assetCount',\n\t\t\t'label',\n\t\t\t'models',\n\t\t\t'canCreateLink',\n\t\t\t'canEmail',\n\t\t];\n\t}\n\n\t/**\n\t * @property {object} methods - Model RPC methods\n\t * @property {method} methods.getAssetIdsInSets - Get all asset ids in asset set\n\t * @property {method} methods.getDownloadWarnings - Get any download warnings for asset set\n\t * @property {method} methods.getDownloadOptions - Get any download options for asset set\n\t * @property {method} methods.prepareDownload - Prepare asset set download\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetAssetIdsInSets(opts) {\n\t\t\t\treturn ['getAssetIdsInSets', [this.self()]];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetDownloadWarnings(opts) {\n\t\t\t\treturn ['getDownloadWarnings', [this.self()]];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetDownloadOptions(opts) {\n\t\t\t\treturn ['getDownloadOptions', [this.self()]];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Request the DAM prepare a set of assets (asset lists, categories, saved searches, carts) in any of several formats (as originals, proxies, views or preset processes).\n\t\t\t * If download is authorized, this returns a progress UUID for tracking the progress of this request.\n\t\t\t * If download is prohibited due to a missing justification, this throws an exception that becomes a JSON-RPC error object.\n\t\t\t * If download is prohibited due to approval, this triggers the server-side asset approval processes for the requested assets\n\t\t\t * (sending email, creating categories, etc -- all the things that requestDownloadApproval does),\n\t\t\t * then throws an exception that becomes a JSON-RPC error object.\n\t\t\t * @function\n\t\t\t * @param {*} assets -- an AssetSets collection, a single AssetSet model, or raw object/array data to instantiate one of those\n\t\t\t * @param {*} options -- a DownloadOptions collection, a single DownloadOption model, or raw object/array data to instantiate one of those\n\t\t\t * @param {String} archiveName -- String of archive name to create\n\t\t\t * @param {String} justification -- Download justification data. Can be null or empty if no justification is needed.\n\t\t\t * @param {Object} syncOptions -- any options for Backbone.Sync\n\t\t\t * @throws JustificationRequired -- if a justification data is required for this download, and none was provided\n\t\t\t * @throws ApprovalRequired -- if approval is required for this download.\n\t\t\t * @return {String} It returns a promise that resolves to a Progress UUID (as String)\n\t\t\t * @todo: the API call works with an array of assetSets. The AssetSets collection should have this method, and then the model\n\t\t\t * method can use the collection version (since we're creating a collection anyway (for some reason).)\n\t\t\t */\n\t\t\tprepareDownload(downloadOptions, archiveName, justification, opts) {\n\t\t\t\tconst assetSets = [this.self()];\n\t\t\t\tdownloadOptions = _.toCollection(\n\t\t\t\t\tdownloadOptions,\n\t\t\t\t\tDownloadOptionsCollection,\n\t\t\t\t);\n\t\t\t\tjustification = justification || '';\n\n\t\t\t\treturn [\n\t\t\t\t\t'prepareDownload',\n\t\t\t\t\tassetSets,\n\t\t\t\t\tdownloadOptions,\n\t\t\t\t\tarchiveName,\n\t\t\t\t\tjustification,\n\t\t\t\t];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Model parsers\n\t * @property {function} parsers.getAssetIdsInSets - Parse the return of asset ids\n\t * @property {function} parsers.getDownloadOptions - Parse the return of download options\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @functon\n\t\t\t * @param {array} results Asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetAssetIdsInSets(results, opts) {\n\t\t\t\tif (!_.isArray(results)) {\n\t\t\t\t\tthrow new Rpc.ParseError('getAssetIdsInSets() returned non-array');\n\t\t\t\t}\n\t\t\t\tthis.set({assetIds: results});\n\t\t\t},\n\t\t\t/**\n\t\t\t * Filters the download options to only include the ones in displayedDownloadOptionTypes and turns the results into a collection\n\t\t\t * @function\n\t\t\t * @param {array} downloadOptions array of download options\n\t\t\t * @param {object} opts Request options\n\t\t\t * @return {Netx.Collections.DownloadOptions} Download options collection\n\t\t\t */\n\t\t\tgetDownloadOptions(downloadOptions, opts) {\n\t\t\t\t// this should never be a null array.\n\t\t\t\tif (downloadOptions == null || !downloadOptions.length) {\n\t\t\t\t\tthrow new Rpc.ParseError('bad response from getDownloadOptions');\n\t\t\t\t}\n\t\t\t\t// Filter returned download options by the array of options types we want to show the user\n\t\t\t\t// TODO: Currently \"manualRepurpose\" is not in this list - though we may not want to show it, it still counts as a downloadOption\n\t\t\t\t// I am forcing it into `displayedDownloadOptionTypes` when the `assetSet` is created for the image being repurposed\n\t\t\t\t// I think that `displayedDownloadOptionTypes` should be taken into consideration in the controller or view and not be causing\n\t\t\t\t// data to not get back from the server that is needed. The model should not be concerned with what is displayed in the UI\n\t\t\t\t// Maybe it is the wrong name for the property - maybe it should be `supportedDownloadOptionTypes`?\n\t\t\t\tdownloadOptions = _.filter(downloadOptions, (downloadOption) =>\n\t\t\t\t\t_.contains(this.displayedDownloadOptionTypes, downloadOption.type),\n\t\t\t\t);\n\t\t\t\t// Turn into a proper collection\n\t\t\t\tthis.downloadOptions.set(downloadOptions);\n\t\t\t\treturn this.downloadOptions;\n\t\t\t},\n\t\t\t/**\n\t\t\t * Check that we have any assets left to download/create a link with\n\t\t\t * @function\n\t\t\t * @param {object} warnings Warnings\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetDownloadWarnings(warnings, opts) {\n\t\t\t\tif (!warnings.messageCount) return warnings;\n\n\t\t\t\tconst assetsUnavailableCount = _.unique(\n\t\t\t\t\t_.map(warnings.progressMessages, (message) => message.objectId),\n\t\t\t\t).length;\n\n\t\t\t\t// TODO: we need to be passing the thing that made the assetSet\n\t\t\t\t// as a target arguments\n\t\t\t\t// Then we can pass some logic off to the collection/model that\n\t\t\t\t// the asset set spawned from\n\t\t\t\tif (assetsUnavailableCount) {\n\t\t\t\t\tlet abort = false;\n\t\t\t\t\tconst assetCount = this.get('assetCount') || 0;\n\t\t\t\t\tconst ids = this.get('ids') || [];\n\t\t\t\t\tconst type = this.get('type');\n\t\t\t\t\tconst types = assetSetTypes;\n\n\t\t\t\t\tswitch (type) {\n\t\t\t\t\t\tcase types.cart: {\n\t\t\t\t\t\t\tabort =\n\t\t\t\t\t\t\t\tNetx.getCurrentCart().getTotal() <= assetsUnavailableCount;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase types.category:\n\t\t\t\t\t\t\tabort = assetCount <= assetsUnavailableCount;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase types.savedCart: {\n\t\t\t\t\t\t\tconst cart = Netx.cart.saved.all.get(ids[0]);\n\t\t\t\t\t\t\tabort =\n\t\t\t\t\t\t\t\tcart && cart.get('contentCount') <= assetsUnavailableCount;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase types.savedSearch: {\n\t\t\t\t\t\t\tconst search = allSavedSearches.get(ids[0]);\n\t\t\t\t\t\t\tabort =\n\t\t\t\t\t\t\t\tsearch && search.get('contentCount') <= assetsUnavailableCount;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault: {\n\t\t\t\t\t\t\tabort = ids.length <= assetsUnavailableCount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (abort) {\n\t\t\t\t\t\twarnings.abort = new Error(\n\t\t\t\t\t\t\ti18n.t('i18n.noAssetsAvailableForDownload'),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn warnings;\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * Contains the downloadOptions returned by getDownloadOptions\n\t\t * @memberOf module:asset/models/assetSet\n\t\t * @alias downloadOptions\n\t\t * @type {Netx.Collections.DownloadOptions}\n\t\t */\n\t\tthis.downloadOptions =\n\t\t\topts.downloadOptions || new DownloadOptionsCollection([]);\n\t\t/**\n\t\t * All of the download option types to filter by after getting download options. Set to all by default(but will only show what the user has permission for).\n\t\t * @memberOf module:asset/models/assetSet\n\t\t * @type {Array}\n\t\t */\n\t\tthis.displayedDownloadOptionTypes =\n\t\t\topts.displayedDownloadOptionTypes || _.values(downloadOptionTypes);\n\t}\n\t/**\n\t * @override\n\t * @return {object}\n\t */\n\tself() {\n\t\tconst attrs = super.self();\n\n\t\t// getDownloadOptions does not work with type assetSet however it does work with asset and will accept multiple ids.\n\t\tif (attrs.type === 'assetSet') {\n\t\t\tattrs.type = 'asset';\n\t\t}\n\t\treturn attrs;\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} type Option type\n\t * @return {boolean} Has option\n\t */\n\thasOption(type) {\n\t\treturn !!this.downloadOptions.findWhere({type: type});\n\t}\n\n\t/**\n\t * For backwards compatibility with the shareways system, this method returns a new Shareable model\n\t * based on the content of this assetSet model.\n\t * @method\n\t * @returns {Netx.Models.Shareable}\n\t */\n\ttoShareable() {\n\t\tlet sType;\n\t\tswitch (this.get('type')) {\n\t\t\tcase 'cart':\n\t\t\t\tsType = 'current cart';\n\t\t\t\tbreak;\n\t\t\tcase 'savedCart':\n\t\t\t\tsType = 'saved cart';\n\t\t\t\tbreak;\n\t\t\tcase 'savedSearch':\n\t\t\t\tsType = 'saved search';\n\t\t\t\tbreak;\n\t\t\tcase 'asset':\n\t\t\t\tsType = 'assets';\n\t\t\t\tbreak;\n\t\t\tcase 'category':\n\t\t\t\t// No shareable for catagory!\n\t\t\t\treturn undefined;\n\t\t}\n\n\t\treturn new ShareableModel({\n\t\t\tids: this.get('ids'),\n\t\t\tmodel: this.get('models')[0],\n\t\t\tmodels: this.get('models'),\n\t\t\tlabel: this.get('label'),\n\t\t\ttype: sType,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetSet';\n\t}\n}\n","/**\n * AssetVersion Model\n * @class\n * @todo Should you be allowed to remove a top version?\n */\nimport Base from '@netx/core/lib/netx-model';\n\nexport default class AssetVersion extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'versionId';\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.versionId - The default id (do not set this in defaults)\n\t * @property {number} defaults.active - The default active status (number as boolean)\n\t * @property {number} defaults.assetId - The default asset id version belongs to\n\t * @property {string} defaults.creationDate - The default creation date (as string)\n\t * @property {number} defaults.fileSize - The default file size\n\t * @property {number} defaults.fileTypeId - The default file type id\n\t * @property {string} defaults.fileTypeLabel - The default file type label\n\t * @property {number} defaults.memoId - The default memoId (unused as far as I can tell - always comes back 0)\n\t * @property {string} defaults.memoText - The default memo text\n\t * @property {number} defaults.original - The default original status (number as boolean)\n\t * @property {string} defaults.previewUrl - The default preview url\n\t * @property {string} defaults.shortMemoText - The default short memo text (truncated memo text)\n\t * @property {string} defaults.thumbUrl - The default thumbnail url\n\t * @property {number} defaults.userId - The default user id\n\t * @property {string} defaults.userLabel - The default user label\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t// versionId: 0\n\t\t\tactive: 0,\n\t\t\tassetId: 0,\n\t\t\tcreationDate: '',\n\t\t\tfileSize: 0,\n\t\t\tfileTypeId: 0,\n\t\t\tfileTypeLabel: '',\n\t\t\tmemoId: 0,\n\t\t\tmemoText: '',\n\t\t\toriginal: 0,\n\t\t\tpreviewUrl: '',\n\t\t\tshortMemoText: '',\n\t\t\tthumbUrl: '',\n\t\t\tuserId: 0,\n\t\t\tuserLabel: '',\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - Model RPC methods\n\t * @property {array} methods.read - Fetch version\n\t * @property {array} methods.remove - Destroy version\n\t * @property {array} methods.reactivateAssetVersion - Reactivate version\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn ['getVersionObjects', [this.get('versionId')]];\n\t\t\t},\n\t\t\t/** @method */\n\t\t\tremove: ['deleteAssetVersion', 'versionId'],\n\t\t\t// Reactivate version\n\t\t\t// Deprecated - use new uuid call `reactivateAssetVersion`\n\t\t\t// reactivateVersion: ['reactivateVersion', 'versionId', 'memoText'],\n\t\t\t/** @method */\n\t\t\treactivateAssetVersion: [\n\t\t\t\t'reactivateAssetVersion',\n\t\t\t\t'versionId',\n\t\t\t\t'memoText',\n\t\t\t],\n\t\t};\n\t}\n\t/** @type {object} */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function reactivateAssetVersion\n\t\t\t * @param {boolean} response Response\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\treactivateAssetVersion(uuid, opts) {\n\t\t\t\tthis.trackBatchJob(uuid);\n\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t'asset:versions:reactivate:progress',\n\t\t\t\t\tthis.get('assetId'),\n\t\t\t\t\t1,\n\t\t\t\t\ti18n.t('i18n.reactivatingVersion'),\n\t\t\t\t);\n\t\t\t\treturn uuid;\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\tthis.on('progress', (assetVersion, batchJob, progress) => {\n\t\t\tdispatcher.trigger(\n\t\t\t\t'asset:versions:reactivate:progress',\n\t\t\t\tthis.get('assetId'),\n\t\t\t\tprogress,\n\t\t\t\ti18n.t('i18n.reactivatingVersion'),\n\t\t\t);\n\t\t});\n\t\tthis.on('complete', (assetVersion, batchJob, progress) => {\n\t\t\tdispatcher.trigger('asset:versions:reactivate:succeeded', this);\n\t\t});\n\t\tthis.on('error', (assetVersion, error) => {\n\t\t\tdispatcher.trigger('asset:versions:reactivate:error', error, this);\n\t\t});\n\t}\n\n\t/**\n\t * Unwrap the one-object array returned by `getVersionObjects`\n\t * @method\n\t * @param {object} attrs Model attributes\n\t */\n\tparse(attrs) {\n\t\treturn _.isArray(attrs) ? attrs[0] : attrs;\n\t}\n\n\t/**\n\t * Cache-busting string for asset version objects: encode the versionID and creation date as query args\n\t * @method\n\t * @param {string} prefix Prefix for cachbuster string\n\t * @return {string}\n\t */\n\tcacheBuster(prefix = '') {\n\t\treturn (\n\t\t\tprefix +\n\t\t\t'?t=' +\n\t\t\t_.dateFromAsset(this.get('creationDate')).getTime() +\n\t\t\t'&v=' +\n\t\t\tthis.get('versionId')\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AssetVersion';\n\t}\n}\n","/**\n * @classdesc\n * Attribute template model\n *\n * @property {reference} attributeTypes - Available search types\n * @property {number} attributeTypes.UNKNOWN - 0\n * @property {number} attributeTypes.TEXT - 1\n * @property {number} attributeTypes.TEXTAREA - 2\n * @property {number} attributeTypes.PULLDOWN - 3 (select)\n * @property {number} attributeTypes.DATE - 4\n * @property {number} attributeTypes.COMBO - 5 (multiselect)\n * @property {number} attributeTypes.TAGS - 6\n * @property {number} attributeTypes.NUMERIC - 7\n * @property {number} attributeTypes.HIERARCHICAL - 8 (deprecated)\n * @property {number} attributeTypes.TAGSET - 9 (deprecated)\n * @property {number} attributeTypes.AUTOCOMPLETE - 10 (deprecated)\n * @property {number} attributeTypes.DATALOOKUP - 11 (deprecated)\n * @property {number} attributeTypes.SEMANTIC - 12 (deprecated)\n *\n * @class\n * @extends Netx.Models.PermissionResource\n */\nimport Base from '@netx/core-permissions/models/permissionResource';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport {\n\tATTRIBUTE_EDITABLE_TYPES,\n\tATTRIBUTE_FACET_TYPES,\n\tATTRIBUTE_TYPE,\n\tATTRIBUTE_MULTIPLE_VALUE_DEPRECATED_TYPES,\n} from '@netx/core-attribute/constants';\nimport {getTypeLabel} from '@netx/core-attribute/utils/getTypeLabel';\nimport {getTypeName} from '@netx/core-attribute/utils/getTypeName';\nimport {getLabel} from '@netx/core-attribute/utils/getLabel';\n\nimport {\n\tmap as syncMap,\n\ttypeOptions as syncTypeOptions,\n} from '../properties/assetAttributesMetadata';\n\nimport {escapeAttributeName} from '@netx/core/lib/underscore-netx';\nimport {attributeHistoryEnabled} from '@netx/core-attribute-history/enablers';\nimport {attributeSystemVocabulariesEnabled} from '@netx/core-attribute/enablers';\n\nexport default class Attribute extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tget idAttribute() {\n\t\t// DEVNOTE: the capitalization of 'id' is particularly haphazard in this object.\n\t\t// groupIds is capital I, the others are all lowercase i. This is mirroring the\n\t\t// object on the server ... which should be fixed!\n\t\t// TODO: could we regularize that on the client side, or would be there be trouble?\n\t\treturn 'attributeid';\n\t}\n\t/** @override */\n\tget titleAttribute() {\n\t\treturn 'name';\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.attributeid - ID (someone has explicitely set this to 0 without any reasoning - the `isNew` method has been adjusted accordingly. https://confluence.netx.net/display/DEV/Avoid+setting+default+IDs+in+X7+models)\n\t * @property {array} defaults.groupIds - Group ids (Unknown use - possibly permission oriented, and should be deprecated with the new permission system)\n\t * @property {boolean} defaults.facet - Is this attribute a faceted attribute\n\t * @property {boolean} defaults.hasPermissions - Does this attribute have permission records?\n\t * @property {number} defaults.imageid - Image id (Unknown use)\n\t * @property {array} defaults.keyDatasets - Datasets attribute is tied to\n\t * @property {number} defaults.mandatory - Mandatory value (boolean as number)\n\t * @property {string} defaults.modDate - Modification date\n\t * @property {boolean} defaults.multivalue - Multivalue attribute\n\t * @property {string} defaults.name - Attribute name\n\t * @property {array} defaults.objectTypes - Object types (asset/clip)\n\t * @property {number} defaults.orderby - Order by (auto-increments when attribute is added - currently we do not respect this, we order the collection by `name`)\n\t * @property {boolean} default.permissioned\t\t\t - New permission system enabled\n\t * @property {array} defaults.pulldownOptions - Pulldown options (for select/multiselect)\n\t * @property {number} defaults.restrictedUserLevel - Restricted user level (Should be deprecated with the new permission system)\n\t * @property {number} defaults.semanticTypeId - Semantic type id (only used if `type` is 12 - semantic)\n\t * @property {number} defaults.spec1 - Use dependent on the attribute type ( number - format, tag - dateSet id )\n\t * @property {number} defaults.spec2 - Use dependent on the attribute type\n\t * @property {array} defaults.targetDatasets - Ids of datasets that use this attribute as the key for a metadata lookup\n\t * @property {number} defaults.templateid - Attribute template id (the exact same as the `attributeid` - must be legacy code)\n\t * @property {number} defaults.type - Attribute type (as defined in module:asset/properties/attributes#types)\n\t * @property {boolean} defaults.trackHistory - Track attribute history (must have `metadata.history.enabled`)\n\t * @property {number} defaults.userid - ID of creating user\n\t * @property {mixed} defaults.value - Default attribute value\n\t *\n\t * @property {object} defaults.attributeOptions - Attribute options for fields\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tattributeid: 0,\n\t\t\tgroupIds: [],\n\t\t\tfacet: false,\n\t\t\thasPermissions: true,\n\t\t\timageid: 0,\n\t\t\tkeyDatasets: [],\n\t\t\tobjectTypes: ['asset'],\n\t\t\tmandatory: 0,\n\t\t\tmodDate: '',\n\t\t\tmultivalue: false,\n\t\t\tname: '',\n\t\t\torderby: 0,\n\t\t\tpermissioned: false,\n\t\t\tpulldownOptions: [],\n\t\t\trestrictedUserLevel: 0,\n\t\t\tsemanticTypeId: 0,\n\t\t\tspec1: 0,\n\t\t\tspec2: 0,\n\t\t\ttargetDatasets: [],\n\t\t\ttemplateid: 0,\n\t\t\ttrackHistory: false,\n\t\t\ttype: 1,\n\t\t\tuserid: 0,\n\t\t\tvalue: '',\n\n\t\t\t// Client attributes\n\t\t\t// For things like upload asset request to get their custom labels/placeholders/captions to the view\n\t\t\t// rendering the attribute field\n\t\t\tattributeOptions: {},\n\t\t\tvocabulary: null,\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn ['attributeOptions', 'vocabulary'];\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this model\n\t * @property {method} methods.metadataDatasetLookup - Metadata dataset lookup\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tremove: ['deleteAttribute', 'attributeid'],\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tcreate(opts) {\n\t\t\t\treturn ['setAttributeObject', this.self()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate(opts) {\n\t\t\t\treturn ['setAttributeObject', this.self()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn ['getAttributeObjects', [this.get('attributeid')]];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetAttributeVocabulary: (opts) => {\n\t\t\t\treturn ['getAttributeVocabulary', this.get('spec1')];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {string} val Value\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tmetadataDatasetLookup(val, opts) {\n\t\t\t\treturn ['metadataDatasetLookup', this.get('name'), val];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Parsers for this model\n\t * @property {method} parsers.metadataDatasetLookup - Parse response of metadata dataset lookup\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * We do not have a call specifically to fetch a single record\n\t\t\t * But we can pass ids and get a single record back wrapped in an array\n\t\t\t * @function\n\t\t\t * @param {array} data Attribute data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(data, opts) {\n\t\t\t\treturn _.isArray(data) && data.length ? data[0] : null;\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} data Vocabulary\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetAttributeVocabulary(data, opts) {\n\t\t\t\tif (!data) return;\n\t\t\t\tthis.set('vocabulary', data);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} match Matches\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tmetadataDatasetLookup(matches, opts) {\n\t\t\t\t// This API call sometimes returns nulls\n\t\t\t\t// Some csvs can contain empty label/values as well\n\t\t\t\treturn _.filter(matches, (match) => match && match.label !== '');\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\t/**\n\t\t * Shared resource type name\n\t\t * @type {string}\n\t\t */\n\t\topts.resourceName = 'attribute';\n\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * Though multiselects/tags/semantics are multivalue, they are not dealt with the same\n\t\t * @memberof Netx.Models.Attribute\n\t\t * @alias multivalueTypes\n\t\t * @type {array}\n\t\t */\n\t\tthis.multivalueTypes = [1, 2, 3, 4, 7];\n\n\t\t/**\n\t\t * multiselects/tags/semantics arenative multivalues, but they are not dealt with the same as other mutlivalues\n\t\t * @memberof Netx.Models.Attribute\n\t\t * @alias multivalueTypes\n\t\t * @type {array}\n\t\t */\n\t\tthis.nativeMultivalueTypes = [5, 6, 12, 13];\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(dispatcher, 'system:attribute:edit:success', (model) => {\n\t\t\t// See Netx.Models.AttributeData for the reasoning behind the `templateId` check\n\t\t\tif (\n\t\t\t\t(model.id === this.id || model.id === this.get('templateId')) &&\n\t\t\t\tmodel !== this\n\t\t\t) {\n\t\t\t\tthis.set(\n\t\t\t\t\t_.clone(_.omit(model.attributes, 'attributeid', 'templateid')),\n\t\t\t\t);\n\t\t\t}\n\t\t})\n\t\t\t// Listen for permission changes and refetch the attribute model\n\t\t\t.listenTo(\n\t\t\t\tdispatcher,\n\t\t\t\t'permissions:permission:edit:success permissions:permission:delete:success',\n\t\t\t\t(permission) => {\n\t\t\t\t\tconst resource = permission.get('resource');\n\t\t\t\t\tif (resource.type === 'attribute' && resource.id === this.id) {\n\t\t\t\t\t\tthis.fetch();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t);\n\t}\n\n\t/**\n\t * Add object type to attribute\n\t * @method\n\t * @param {string} objectType Object type (asset/clip)\n\t * @type {object} opts Request options\n\t */\n\taddObjectType(objectType, opts) {\n\t\tconst objectTypes = this.get('objectTypes');\n\n\t\tif (_.contains(objectTypes, objectType)) {\n\t\t\treturn new $.Deferred().resolve();\n\t\t}\n\n\t\treturn this.save(\n\t\t\t{objectTypes: objectTypes.concat([objectType])},\n\t\t\t_.extend({wait: true}, opts),\n\t\t);\n\t}\n\n\t/**\n\t * For when an attribute template model has been amalgamated with an attribute data model\n\t * @method\n\t * @return {boolean}\n\t * @see Netx.Models.AttributeData\n\t */\n\tallows(perm) {\n\t\tif (perm == null) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (!this.has('permission')) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst permission = this.get('permission');\n\t\tswitch (perm) {\n\t\t\tcase 'delete':\n\t\t\t\treturn permission === 'd';\n\t\t\tcase 'edit':\n\t\t\tcase 'write':\n\t\t\t\treturn permission === 'd' || permission === 'w';\n\t\t\tcase 'read':\n\t\t\t\treturn permission === 'd' || permission === 'w' || permission === 'r';\n\t\t\tdefault:\n\t\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value\n\t * @param {number} truncateAt Truncate at index\n\t * @return {mixed}\n\t */\n\tformat(value, truncateAt) {\n\t\tvalue = this.parseInValue(value);\n\n\t\tif (_.isArray(value)) {\n\t\t\tvalue = value.join(', ');\n\t\t}\n\n\t\tif (typeof value === 'string') {\n\t\t\tvalue = value.replace(//g, '>');\n\t\t}\n\n\t\tif (value != null && truncateAt && value.length > truncateAt) {\n\t\t\tvalue = value.substr(0, truncateAt) + '...';\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * @method\n\t * @return {object} Attribute options\n\t */\n\tgetAttributeOptions() {\n\t\tconst attrOptions = {...(this.get('attributeOptions') || {})};\n\t\tif (attrOptions.required != null) {\n\t\t\tattrOptions.required = attrOptions.required === true;\n\t\t}\n\n\t\tif (!attrOptions.caption) delete attrOptions.caption;\n\t\tif (!attrOptions.placeholder) delete attrOptions.placeholder;\n\n\t\treturn attrOptions;\n\t}\n\n\t/** @override */\n\tgetLabel(dontEscape = false) {\n\t\treturn getLabel(this.attributes, dontEscape === false);\n\t}\n\n\t/**\n\t * Get metadata sync info for this attribute\n\t * @method\n\t * @return {object} Metadata sync data\n\t */\n\tgetMetadataSynced() {\n\t\tconst attributes = Netx.attributes;\n\n\t\tconst metadataSync = {}; //this.model.syncMetadata;\n\n\t\t// Look for this attribute's id in the metadataMap\n\t\tconst exportIdx = _.indexOf(attributes.metadataMap.exportIds, this.id);\n\t\tconst importIdx = _.indexOf(attributes.metadataMap.importIds, this.id);\n\n\t\t// Assign values if found\n\t\tmetadataSync.export =\n\t\t\texportIdx > -1 ? attributes.metadataMap.exportValues[exportIdx] : null;\n\t\tmetadataSync.import =\n\t\t\timportIdx > -1 ? attributes.metadataMap.importValues[importIdx] : null;\n\n\t\t// Create pattern for custom input - no mapped schema prifixes allowed\n\t\tmetadataSync.regex = [\n\t\t\t'^(?!',\n\t\t\t_.map(_.keys(syncMap), (v) => v + ':').join('|'),\n\t\t\t').*',\n\t\t].join('');\n\n\t\t// Get selected sync type and value\n\t\t// Both\n\t\tif (metadataSync.import && metadataSync.export) {\n\t\t\tmetadataSync.direction = 'both';\n\t\t\tmetadataSync.value = metadataSync.import;\n\t\t}\n\t\t// Import\n\t\telse if (metadataSync.import) {\n\t\t\tmetadataSync.direction = 'import';\n\t\t\tmetadataSync.value = metadataSync.import;\n\t\t}\n\t\t// Export\n\t\telse if (metadataSync.export) {\n\t\t\tmetadataSync.direction = 'export';\n\t\t\tmetadataSync.value = metadataSync.export;\n\t\t}\n\n\t\tif (metadataSync.value) {\n\t\t\t// Get schema prefix\n\t\t\tconst schemaPrefix = metadataSync.value.split(':')[0];\n\t\t\t// Check that it exists in the map\n\t\t\tmetadataSync.schema = syncMap[schemaPrefix];\n\t\t\t// Assume custom schema\n\t\t\tif (metadataSync.value.indexOf(':') < 0 || !metadataSync.schema) {\n\t\t\t\tmetadataSync.schema = 'Custom';\n\t\t\t}\n\t\t\t// Mapped shema\n\t\t\telse {\n\t\t\t\tconst schema = _.findWhere(Netx.attributes.metadata, {\n\t\t\t\t\tlabel: metadataSync.schema,\n\t\t\t\t});\n\t\t\t\tif (schema) {\n\t\t\t\t\tconst optionValue = _.findWhere(schema.options, {\n\t\t\t\t\t\tvalue: metadataSync.value,\n\t\t\t\t\t});\n\t\t\t\t\tif (optionValue) {\n\t\t\t\t\t\t// Top level sync shema label\n\t\t\t\t\t\tmetadataSync.schema = schema.label;\n\t\t\t\t\t\t// Sync schema options\n\t\t\t\t\t\tmetadataSync.valueOptions = schema.options;\n\t\t\t\t\t\t// We can only export\n\t\t\t\t\t\tif (optionValue.direction === 'export') {\n\t\t\t\t\t\t\tmetadataSync.typeOptions = _.omit(\n\t\t\t\t\t\t\t\tsyncTypeOptions,\n\t\t\t\t\t\t\t\t'both',\n\t\t\t\t\t\t\t\t'import',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// We can only import\n\t\t\t\t\t\telse if (optionValue.direction === 'import') {\n\t\t\t\t\t\t\tmetadataSync.typeOptions = _.omit(\n\t\t\t\t\t\t\t\tsyncTypeOptions,\n\t\t\t\t\t\t\t\t'both',\n\t\t\t\t\t\t\t\t'export',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn metadataSync;\n\t}\n\n\t/**\n\t * Return the option values of an attribute pulldown\n\t * @method\n\t * @return {array} Pulldown values\n\t */\n\tgetOptions() {\n\t\treturn this.get('pulldownOptions');\n\t}\n\n\t/**\n\t * @method\n\t * @return camelCased name without special characters\n\t */\n\tgetSafeName() {\n\t\treturn _.toCamelCase(this.get('name'));\n\t}\n\n\t/**\n\t * Get attribute sort field name\n\t * User defined attributes are passed as they are named but system attributes are different\n\t * ie: Modification Date -> moddate\n\t * @method\n\t * @param {boolean} escape Escape attribute name (makes it safe for data attrs etc)\n\t * @return {string}\n\t */\n\tgetSortFieldName(escape) {\n\t\tconst name = this.get('name');\n\t\treturn escape ? escapeAttributeName(name) : name;\n\t}\n\n\t/**\n\t * Get attribute english name from attribute type id\n\t * @method\n\t * @param {number}\n\t * @return {string} Attribute type english name\n\t * @todo Rename to getEnglis\n\t */\n\tgetTypeLabel(type) {\n\t\treturn getTypeLabel(type ?? this.get('type'));\n\t}\n\n\t/**\n\t * Get attribute type name from number\n\t * @method\n\t * @param {number} type Type id (if not provided this.attributes.type will be used)\n\t * @return {string} Attribute name\n\t */\n\tgetTypeName(type) {\n\t\treturn getTypeName(type ?? this.get('type'));\n\t}\n\n\t/**\n\t * For when an attribute template model has been amalgamated with an attribute data model\n\t * @method\n\t * @return {array|mixed} Value(s)\n\t * @see Netx.Models.AttributeData\n\t */\n\tgetValue() {\n\t\tif (!this.has('values')) return;\n\n\t\t// Is not a multivalue type attribute\n\t\tif (!this.get('multivalue')) return this.get('values')[0] || '';\n\n\t\treturn this.get('values');\n\t}\n\n\t/**\n\t * History enabled\n\t * @method\n\t * @return {boolean}\n\t */\n\thistoryEnabled() {\n\t\treturn attributeHistoryEnabled();\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean} Has default value\n\t */\n\thasDefaultValue() {\n\t\treturn this.get('value') != null && this.get('value') !== '';\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value\n\t * @return {boolean} Invalid\n\t */\n\tinvalid(value) {\n\t\treturn this.validator(value) !== true;\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean} Value is appendable\n\t */\n\tisAppendable() {\n\t\treturn false;\n\t}\n\n\t/**\n\t * isFlexible() returns true if this attribute is defined as having 'folksonomy'\n\t * and will therefore allow users to add terms via the select2 tagging system.\n\t * @method\n\t * @return {boolean} Is flexible\n\t */\n\tisFlexible() {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Test whether this attribute can be valid for a given object type, by\n\t * checking the objectTypes array\n\t * @method\n\t * @param {string} objectType\n\t * @return {boolean}\n\t */\n\tisForObjectType(objectType) {\n\t\treturn this.get('objectTypes').includes(objectType);\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tisMandatory() {\n\t\treturn this.get('mandatory') === 1;\n\t}\n\n\t/**\n\t * We set the default id to 0\n\t * @override\n\t * @return {boolean} Is new\n\t * @todo Someone explain why we have to set attributeid to 0 by default?\n\t */\n\tisNew() {\n\t\treturn !this.has(this.idAttribute) || this.id === 0;\n\t}\n\n\t/**\n\t * Are we a native multivalue attribute (see `this.nativeMultivalueTypes`)\n\t * @method\n\t * @param {number} type Type\n\t * @return {boolean}\n\t */\n\tisNativeMultivalue(type) {\n\t\ttype = (type && parseInt(type)) || this.get('type');\n\t\treturn this.nativeMultivalueTypes.includes(type);\n\t}\n\n\t/**\n\t * Are we a true multivalue attribute (see `this.multivalueTypes`)\n\t * @method\n\t * @return {boolean}\n\t */\n\tisTrueMultivalue() {\n\t\treturn (\n\t\t\tthis.get('multivalue') &&\n\t\t\tATTRIBUTE_MULTIPLE_VALUE_DEPRECATED_TYPES.includes(this.get('type'))\n\t\t);\n\t}\n\n\t/**\n\t * Can values be written to for this attribute template\n\t * @method\n\t * @return {boolean}\n\t */\n\tisValueWritable() {\n\t\treturn !(\n\t\t\tthis.get('system') ||\n\t\t\tthis.get('readOnly') ||\n\t\t\t!ATTRIBUTE_EDITABLE_TYPES.includes(this.get('type'))\n\t\t);\n\t}\n\n\t/**\n\t * Try to perform an auto-complete of attributes (DAM-6749)\n\t * @method\n\t */\n\tmetadataLookup(value) {\n\t\tif (!this.get('keyDatasets').length) return new $.Deferred().resolve([]);\n\n\t\treturn this.metadataDatasetLookup(value, {\n\t\t\tduplicateQueryPolicy: 'abort',\n\t\t}).then((matches) => {\n\t\t\treturn _.compact(matches);\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} data Data\n\t * @param {object} opts Request options\n\t */\n\tparseAndSave(data, opts) {\n\t\t// these should all be numbers, not strings.\n\t\t_.each(\n\t\t\t[\n\t\t\t\t'restrictedUserLevel',\n\t\t\t\t'spec1-number',\n\t\t\t\t'spec2-number',\n\t\t\t\t'spec1-tag',\n\t\t\t\t'spec1-vocab',\n\t\t\t\t'type',\n\t\t\t],\n\t\t\t(a) => {\n\t\t\t\tdata[a] = parseInt(data[a]);\n\t\t\t\t// Save some grief\n\t\t\t\tif (isNaN(data[a])) {\n\t\t\t\t\tdata[a] = 0;\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\n\t\t// Set attribute object type\n\t\tlet objectTypes = _.csvToArray(data.objectTypes);\n\t\t// Defaults to `asset`\n\t\tif (!objectTypes || !objectTypes.length) {\n\t\t\tobjectTypes = ['asset'];\n\t\t}\n\n\t\t// Clip only attributes are not mandatory\n\t\tif (!_.contains(objectTypes, 'asset')) {\n\t\t\tdata.mandatory = false;\n\t\t}\n\n\t\t// These fields are applied the same way for all types:\n\t\tlet parsed = _.extend({}, _.pick(data, 'type', 'restrictedUserLevel'), {\n\t\t\tname: data.name.trim(),\n\t\t\tfacet: data.facet && this.supportsFacets(data.type),\n\t\t\tmandatory: data.mandatory ? 1 : 0,\n\t\t\tmultivalue: data.multivalue,\n\t\t\tobjectTypes: objectTypes,\n\t\t\ttrackHistory: data.trackHistory && this.historyEnabled(),\n\t\t});\n\n\t\t// Adjust depending on type\n\t\tswitch (data.type) {\n\t\t\tcase ATTRIBUTE_TYPE.TEXT:\n\t\t\t\tparsed.value = data['value-text'];\n\t\t\t\tbreak;\n\n\t\t\tcase ATTRIBUTE_TYPE.TEXTAREA:\n\t\t\t\tparsed.value = data['value-textarea'];\n\t\t\t\tbreak;\n\n\t\t\tcase ATTRIBUTE_TYPE.SELECT:\n\t\t\tcase ATTRIBUTE_TYPE.MULTISELECT:\n\t\t\t\tif (attributeSystemVocabulariesEnabled()) {\n\t\t\t\t\tparsed.spec1 = data['spec1-vocab'];\n\t\t\t\t} else {\n\t\t\t\t\tparsed.pulldownOptions = data.pulldownOptions.split('\\n');\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase ATTRIBUTE_TYPE.DATE:\n\t\t\t\tparsed.value = data['value-date'];\n\t\t\t\tbreak;\n\n\t\t\tcase ATTRIBUTE_TYPE.NUMBER:\n\t\t\t\t_.extend(parsed, {\n\t\t\t\t\tvalue: data['value-number'],\n\t\t\t\t\tspec1: data['spec1-number'],\n\t\t\t\t\tspec2: data['spec2-number'],\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase ATTRIBUTE_TYPE.SEMANTIC:\n\t\t\t\tparsed.semanticTypeId = parseInt(data.semanticTypeId);\n\t\t\t\tbreak;\n\t\t\tcase ATTRIBUTE_TYPE.TAG:\n\t\t\t\tparsed.spec1 = data['spec1-tag'];\n\t\t\t\tparsed.spec2 = data['spec2-tag'] === true ? 1 : 0;\n\t\t\t\tbreak;\n\n\t\t\tcase ATTRIBUTE_TYPE.TAG_VOCAB:\n\t\t\t\tparsed.spec1 = data['spec1-vocab'];\n\t\t\t\t// Intentionally piggy backing off of regular tag spec2 here\n\t\t\t\tparsed.spec2 = data['spec2-tag'] === true ? 1 : 0;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// We only allow certain edits to existing attributes\n\t\tif (!this.isNew()) {\n\t\t\tconst updatableFields = [\n\t\t\t\t'name',\n\t\t\t\t'facet',\n\t\t\t\t'mandatory',\n\t\t\t\t'pulldownOptions',\n\t\t\t\t'restrictedUserLevel',\n\t\t\t\t'trackHistory',\n\t\t\t\t'value',\n\t\t\t];\n\n\t\t\tif ([ATTRIBUTE_TYPE.TAG, ATTRIBUTE_TYPE.TAG_VOCAB].includes(data.type)) {\n\t\t\t\tupdatableFields.push('spec2');\n\t\t\t}\n\n\t\t\tparsed = _.pick.apply(_, [parsed].concat(updatableFields));\n\t\t}\n\n\t\t// Set and save\n\t\treturn this.save(parsed, _.extend({wait: true}, opts));\n\t}\n\n\t/**\n\t * Parse in value for this attribute\n\t * @method\n\t * @param {mixed} value Value\n\t * @return {mixed}\n\t */\n\tparseInValue(value) {\n\t\t// Our asset beans still use csv\n\t\t// So gross\n\t\tif (\n\t\t\tthis.isTrueMultivalue() &&\n\t\t\tvalue != null &&\n\t\t\t!_.isArray(value) &&\n\t\t\tvalue.includes('\"')\n\t\t) {\n\t\t\treturn _.csvToArray(value);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Parse out value for this attribute\n\t * @method\n\t * @param {mixed} value Value\n\t * @return {mixed}\n\t */\n\tparseOutValue(value) {\n\t\t// Not worth the effort\n\t\tif (_.isUndefined(value) || _.isNull(value) || value === '') {\n\t\t\treturn value;\n\t\t}\n\n\t\t// True multivalue\n\t\tif (this.isTrueMultivalue()) {\n\t\t\tif (_.isObject(value)) {\n\t\t\t\t// Strip out any empty/null/undefined values\n\t\t\t\t// Cannot use _.compact since it strips `false` and `0`\n\t\t\t\tvalue = _.filter(\n\t\t\t\t\t_.values(value),\n\t\t\t\t\t(v) => v !== '' && !_.isNull(v) && !_.isUndefined(v),\n\t\t\t\t);\n\t\t\t} else if (_.isString(value)) {\n\t\t\t\tvalue = _.csvToArray(value);\n\t\t\t}\n\t\t} else if (this.isCSV && _.isString(value)) {\n\t\t\tvalue = _.csvToArray(value);\n\t\t}\n\n\t\treturn value;\n\t}\n\n\t/**\n\t * Are permissions for this resource enabled\n\t * @override\n\t * @return {boolean}\n\t */\n\tpermissionsEnabled() {\n\t\treturn getPreference('permission.attributesEnabled', true);\n\t}\n\n\t/**\n\t * Remove object type from attribute\n\t * @method\n\t * @param {string} objectType Object type (asset/clip)\n\t * @type {object} opts Request options\n\t */\n\tremoveObjectType(objectType, opts) {\n\t\tconst objectTypes = this.get('objectTypes');\n\n\t\tif (!_.contains(objectTypes, objectType)) {\n\t\t\treturn new $.Deferred().resolve();\n\t\t}\n\n\t\treturn this.save(\n\t\t\t{objectTypes: _.without(objectTypes, objectType)},\n\t\t\t{wait: true, ...opts},\n\t\t);\n\t}\n\n\t/**\n\t * Test whether this attribute supports facets\n\t * @method\n\t * @param {number} type Attribute type\n\t * @return {boolean} Supports facets\n\t */\n\tsupportsFacets(type) {\n\t\treturn ATTRIBUTE_FACET_TYPES.includes(type ?? this.get('type'));\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} on Toggle facet on\n\t * @param {object} opts Options\n\t */\n\ttoggleMandatory(on, opts) {\n\t\t// Clip only attributes cannot be mandatory\n\t\tif (!this.isForObjectType('asset')) {\n\t\t\ton = false;\n\t\t}\n\n\t\ton = on != null ? on === true : !this.get('mandatory');\n\n\t\t// If it is the same there is nothing to do\n\t\tif (on === this.get('mandatory')) {\n\t\t\treturn new $.Deferred().resolve();\n\t\t}\n\n\t\treturn this.save({mandatory: on ? 1 : 0}, _.extend({wait: true}, opts));\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} on Toggle facet on\n\t * @param {object} opts Options\n\t */\n\ttoggleFacet(on, opts) {\n\t\tif (!ATTRIBUTE_FACET_TYPES.includes(this.get('type'))) {\n\t\t\ton = false;\n\t\t}\n\n\t\ton = on != null ? on === true : !this.get('facet');\n\n\t\t// If it is the same there is nothing to do\n\t\tif (on === this.get('facet')) {\n\t\t\treturn new $.Deferred().resolve();\n\t\t}\n\n\t\treturn this.save({facet: on}, _.extend({wait: true}, opts));\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\ttrackingHistory() {\n\t\treturn this.historyEnabled() && this.get('trackHistory');\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value\n\t * @return {boolean} Valid\n\t */\n\tvalidator(value) {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute';\n\t}\n}\n","/**\n * Asset attribute data\n * This model represents a single record of an asset's attribute datum\n * If the attribute data is for a true multivalue attribute, `this.valuesCollection` will be populated with a record for each value in the `values` array\n * `this.valuesCollection` is just an attributes collection with amlagamated attribute models (read: monster)\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport AttributesCollection from '../collections/attributes';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\n\nexport default class AttributeData extends Base {\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'templateId';\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {string} defaults.templateId - ID\n\t * @property {number} defaults.assetId - Asset id (redundant)\n\t * @property {string} defaults.permission - Permission (d/r/w)\n\t * @property {array} defaults.values - Attribute values\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\ttemplateId: 0,\n\t\t\tassetId: 0,\n\t\t\tpermission: 'r',\n\t\t\tvalues: [],\n\n\t\t\t// Client\n\t\t\tautofilled: false,\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn ['autofilled'];\n\t}\n\n\t/**\n\t * @override\n\t * @param {array} models An array of models or model attributes\n\t * @param {object} opts Collection options\n\t * @listens module:system#system:attribute:edit:success\n\t */\n\tconstructor(models, opts = {}) {\n\t\t// Circular reference fix\n\t\t// attributes collection requires asset attribute datum collection which\n\t\t// is the top level parent of this model\n\t\t// const AttributesCollection = require('../collections/attributes').default;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * @memberof Netx.Models.AttributeData\n\t\t * @alias assetAttributes\n\t\t * @type {module:asset/collections/attributes}\n\t\t */\n\t\tthis.assetAttributes = opts.assetAttributes || Netx.attributes;\n\n\t\t/**\n\t\t * Will be used as a one off for our multivalue childViews and data\n\t\t * @memberof Netx.Models.AttributeData\n\t\t * @alias valuesCollection\n\t\t * @type {Netx.Collections.AssetAttributes}\n\t\t */\n\t\tthis.valuesCollection = new AttributesCollection([]);\n\n\t\tthis.metadataLookupEnabled = getPreference(\n\t\t\t'category.metadataDatasetLookupEnabled',\n\t\t\ttrue,\n\t\t);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(this, 'change:values', () => {\n\t\t\tthis.populateValuesCollection();\n\t\t});\n\n\t\t// Wait for initialize to fully complete\n\t\t_.defer(_.bind(this.populateValuesCollection, this));\n\n\t\t/**\n\t\t * Store original value\n\t\t * @memberof module:asset/models/attributeData\n\t\t * @type {mixed}\n\t\t */\n\t\tthis.originalValue = this.getValue();\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(dispatcher, 'system:attribute:edit:success', (model) => {\n\t\t\tif (model.id === this.id && model !== this) {\n\t\t\t\tthis.set(\n\t\t\t\t\t_.clone(_.omit(model.attributes, 'attributeid', 'templateid')),\n\t\t\t\t);\n\t\t\t}\n\t\t})\n\t\t\t// Always have one empty value in last place\n\t\t\t.listenTo(\n\t\t\t\tthis.valuesCollection,\n\t\t\t\t'change',\n\t\t\t\t_.debounce(() => {\n\t\t\t\t\tconst lastModel = _.last(this.valuesCollection.models);\n\t\t\t\t\tconst value = (lastModel && lastModel.getValue()) || [];\n\n\t\t\t\t\tif (!lastModel || (value.length && value[0] !== '')) {\n\t\t\t\t\t\tthis.addValue();\n\t\t\t\t\t}\n\t\t\t\t}, 50),\n\t\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value to add\n\t */\n\taddValue(value) {\n\t\tif (!this.get('multivalue')) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make a safe copy so we do not pollute original data\n\t\tconst data = this.createValueModelAttributes(value);\n\n\t\t// Always set to an empty value in this.attributes.values (and quietly so we do not trigger repopulation)\n\t\t// since the values collection models will cache their current values\n\t\tthis.set('values', this.get('values').concat(''), {silent: true});\n\n\t\tthis.valuesCollection.add(data);\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} perm Permission string ( \"delete\", \"write/(edit)\", \"share\", etc )\n\t * @return {boolean} Allowed\n\t */\n\tallows(perm) {\n\t\tif (perm == null) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst template = this.getTemplate();\n\t\tif (!template.isValueWritable()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (perm) {\n\t\t\tcase 'delete':\n\t\t\t\treturn this.canManage();\n\t\t\tcase 'edit':\n\t\t\tcase 'write':\n\t\t\t\treturn this.canEdit();\n\t\t\tdefault:\n\t\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tcanEdit() {\n\t\treturn (\n\t\t\tthis.get('readOnly') !== true &&\n\t\t\t(this.get('permission') === 'w' || this.canManage())\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tcanManage() {\n\t\treturn !this.has('permission') || this.get('permission') === 'd';\n\t}\n\n\t/**\n\t * @method\n\t */\n\tclearChanges() {\n\t\tthis.changed = {};\n\t\tthis.originalValue = this.getValue();\n\t\treturn this;\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value\n\t * @return {object}\n\t */\n\tcreateValueModelAttributes(value) {\n\t\tif (_.isUndefined(value) || _.isNull(value)) {\n\t\t\tvalue = [''];\n\t\t}\n\t\tif (!_.isArray(value)) {\n\t\t\tvalue = [value];\n\t\t}\n\t\treturn _.extend({}, _.clone(this.self()), {\n\t\t\t// This is purely for the sake of having a unique id, this will not be used in any other way\n\t\t\tattributeid: _.uniqueId('attribute-value-'),\n\t\t\tvalues: value,\n\t\t});\n\t}\n\n\t/** @override */\n\tgetLabel() {\n\t\tconst template = this.getTemplate();\n\t\treturn template && template.getLabel();\n\t}\n\n\t/**\n\t * @method\n\t * @return {module:asset/models/assetAttribute}\n\t */\n\tgetTemplate() {\n\t\treturn this.assetAttributes.get(this.id);\n\t}\n\n\t/**\n\t * @method\n\t * @return {string}\n\t */\n\tgetTypeName() {\n\t\tconst template = this.getTemplate();\n\t\treturn template && template.getTypeName();\n\t}\n\n\t/**\n\t * @method\n\t * @return {array|mixed} Value(s)\n\t */\n\tgetValue() {\n\t\t// Is not a multivalue type attribute\n\t\tif (!this.get('multivalue')) {\n\t\t\treturn this.get('values')[0] || '';\n\t\t}\n\n\t\treturn this.get('values');\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\thasValue() {\n\t\tconst valuesCollection = this.valuesCollection;\n\n\t\tfor (let i = 0, c = valuesCollection.length, vals; i < c; i++) {\n\t\t\tvals = valuesCollection.at(i).get('values');\n\t\t\tif (vals.length && vals[0] !== '') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value\n\t * @return {boolean}\n\t */\n\thasValueChanged(value) {\n\t\tvalue = value != null ? value : this.get('values');\n\n\t\tlet originalValue = this.get('multiple') ? '' : this.originalValue;\n\n\t\tif (!_.isArray(originalValue)) {\n\t\t\tvalue = value !== '' ? [value] : [];\n\t\t}\n\n\t\tif (!_.isArray(originalValue)) {\n\t\t\toriginalValue = originalValue !== '' ? [originalValue] : [];\n\t\t}\n\t\treturn value.join() !== originalValue.join();\n\t}\n\n\t/**\n\t * Try to perform an auto-complete of attributes (DAM-6749)\n\t * @method\n\t */\n\tmetadataLookup() {\n\t\tconst attrTemplate = this.getTemplate();\n\t\tif (!attrTemplate.get('keyDatasets').length) return;\n\n\t\tattrTemplate\n\t\t\t.metadataDatasetLookup(this.getValue(), {\n\t\t\t\tduplicateQueryPolicy: 'abort',\n\t\t\t})\n\t\t\t.then((matches) => {\n\t\t\t\tthis.trigger('metadataLookup:complete', this, _.compact(matches));\n\t\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} useOriginalValues Use original values\n\t * @param {boolean} dontMerge Do not merge the models\n\t */\n\tpopulateValuesCollection(useOriginalValues, dontMerge) {\n\t\tconst values = useOriginalValues ? this.originalValue : this.get('values');\n\t\t// Map out our `values` array to objects for model creation\n\t\tconst data = _.map(values, (value) =>\n\t\t\tthis.createValueModelAttributes(value),\n\t\t);\n\n\t\t// Always have at least one empty at the end\n\t\tdata.push(this.createValueModelAttributes());\n\n\t\tthis.valuesCollection.set(data, {merge: dontMerge !== true});\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} id Value id\n\t */\n\tremoveValue(id) {\n\t\tif (!this.get('multivalue')) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst valuesCollection = this.valuesCollection;\n\t\tconst valueModel = valuesCollection.get(id);\n\t\tconst values = this.get('values');\n\n\t\tif (valueModel) {\n\t\t\tconst idx = _.indexOf(values, valueModel.get('value')[0]);\n\t\t\tif (idx > -1) {\n\t\t\t\tvalues.splice(idx, 1, '');\n\t\t\t\t// Remove quietly so we do not trigger repopulation\n\t\t\t\tthis.set('value', values, {silent: true});\n\t\t\t}\n\t\t}\n\n\t\tvaluesCollection.remove(id);\n\n\t\t// Always have at least one empty field\n\t\tconst count = valuesCollection.length;\n\t\tif (!count) {\n\t\t\tthis.addValue();\n\t\t} else {\n\t\t\tconst vals = valuesCollection.at(count - 1).get('values');\n\t\t\tif (!vals.length || vals[0] !== '') {\n\t\t\t\tthis.addValue();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Options\n\t */\n\tresetValues(opts) {\n\t\tconst values = this.originalValue;\n\t\tthis.setValue(values, opts);\n\t\tthis.clearChanges();\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value\n\t * @param {object} opts Options\n\t */\n\tsetValue(value, opts = {}) {\n\t\t// Must already exist and have permission to edit\n\t\tif (!this.canEdit()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Undefined/null/empty string are all considered an empty array\n\t\tif (_.isUndefined(value) || _.isNull(value) || value === '') {\n\t\t\tvalue = [];\n\t\t}\n\n\t\t// Regardless of \"multivalue\" value array - all values are dealt with as arrays\n\t\t// Not already an array\n\t\t// Is an array but is a multivalue value attribute, so there must be at least one value in the array and that value must also be an array\n\t\tif (!_.isArray(value)) {\n\t\t\tvalue = [value];\n\t\t}\n\n\t\t// Set asset attribute value(s)\n\t\tthis.set(\n\t\t\t{\n\t\t\t\tvalues: value,\n\t\t\t\tautofilled: opts.autofilled === true,\n\t\t\t},\n\t\t\topts,\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @static\n\t * @param {module:asset/models/attribute} attrModel Attribute template\n\t * @param {object} opts Options\n\t */\n\tstatic CreateFromTemplate(attrModel, opts = {}) {\n\t\tif (!attrModel) {\n\t\t\tthrow new Error('Attribute template required');\n\t\t}\n\n\t\treturn new this(\n\t\t\t_.extend(\n\t\t\t\t_.omit(\n\t\t\t\t\tattrModel.attributes,\n\t\t\t\t\t'attributeid',\n\t\t\t\t\t'objectTypes',\n\t\t\t\t\t'templateid',\n\t\t\t\t\t'value',\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttemplateId: attrModel.id,\n\t\t\t\t\tpermission: 'r',\n\t\t\t\t},\n\t\t\t\topts,\n\t\t\t),\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AttributeData';\n\t}\n}\n","/**\n * @class\n * Model to store attribute data for attribute profile items.\n * Specifically used to store attribute's id and associated value.\n * https://kb.netx.net/display/DEV/Attribute+Profiles+for+Folders\n */\n\nimport Base from '../models/attribute';\n\nexport default class AttributeProfileAttribute extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @type {string}\n\t * @private\n\t */\n\tget idAttribute() {\n\t\treturn 'attributeid';\n\t}\n\n\t/**\n\t * @type {object}\n\t * @private\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\tappend: false,\n\t\t\tattributeid: null,\n\t\t\tcleared: false,\n\t\t\t// Our base sets this to 0 be default\n\t\t\t// we will set this as needed when re-ordering\n\t\t\tindex: null,\n\t\t\tvalue: null,\n\t\t};\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AttributeProfileAttribute';\n\t}\n}\n","/**\n * @class\n * Collection to handle attribute templates/values for attribute profiles\n * https://kb.netx.net/display/DEV/Attribute+Profiles+for+Folders\n */\n\nimport Base from '../collections/attributes';\nimport Model from '../models/attributeProfileAttribute';\n\nexport default class AttributeProfileAttributes extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\tthis.comparator = null;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AttributeProfileAttributes';\n\t}\n}\n","/**\n * @class\n * Model to handle attribute profile data\n * https://kb.netx.net/display/DEV/Attribute+Profiles+for+Folders\n */\n\nimport Base from '@netx/core/lib/netx-model';\nimport AttributeProfileAttributes from '../collections/attributeProfileAttributes';\nimport AttributeProfileAttribute from '../models/attributeProfileAttribute';\nimport {isEmptyValue} from '@netx/core/lib/underscore-netx';\nimport {ATTRIBUTE_MULTIPLE_VALUE_TYPES} from '@netx/core-attribute/constants';\nimport {assetAttributes} from '@netx/core-attribute/singletons';\nimport {csvToArray} from '@netx/core/utils/csvToArray';\n\nexport default class AttributeProfile extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @type {string}\n\t * @private\n\t */\n\tget idAttribute() {\n\t\treturn 'profileId';\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute profile values\n\t * @property {string} defaults.name - Name of attribute profile\n\t * @property {object[]} defaults.items - Objects representing profile attributes and values\n\t * @property {number} defaults.items[i].templateId - Attribute template id\n\t * @property {string[]} defaults.items[i].values - Attribute values\n\t * @property {boolean} defaults.items[i].append - Whether attribute value is to be appended or not\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tname: '',\n\t\t\titems: [],\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget methods() {\n\t\treturn {\n\t\t\tcreate(opts) {\n\t\t\t\treturn ['setAttributeProfile', this.self()];\n\t\t\t},\n\t\t\tupdate(opts) {\n\t\t\t\treturn ['setAttributeProfile', this.self()];\n\t\t\t},\n\t\t\tremove(opts) {\n\t\t\t\treturn ['removeAttributeProfile', this.id];\n\t\t\t},\n\t\t\tsetAttributeProfileForFolder(folderId, opts) {\n\t\t\t\treturn ['setAttributeProfileForFolder', folderId, this.self()];\n\t\t\t},\n\t\t\tremoveAttributeProfileFromFolder(folderId, opts) {\n\t\t\t\treturn ['removeAttributeProfileFromFolder', folderId];\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\tthis.assetAttributes = assetAttributes;\n\n\t\tthis.attributesSelected = new AttributeProfileAttributes();\n\t\tthis.addSubCollection(this.attributesSelected);\n\n\t\tthis.populateSelectedAttributes();\n\n\t\tthis.listenTo(\n\t\t\tdispatcher,\n\t\t\t'attribute:profile:edit:success',\n\t\t\t(attributeProfile) => {\n\t\t\t\tif (attributeProfile.profileId !== this.id) return;\n\t\t\t\tthis.set(attributeProfile);\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} data Data\n\t * @param {object} opts Options\n\t */\n\tparseAndSave(data, opts) {\n\t\t/* Structure of `data` arg\n\t\t{\n\t\t \tname: \n\t\t \tattribute-profile-attributes-item: {\n\t\t \t\t: ,\n\t\t \t\t...\n\t\t \t}\n\t\t \t: ,\n\t\t \t-append: \n\t\t \t...\n\t\t}\n\t\t*/\n\n\t\tconst attrIds = Object.values(\n\t\t\tdata['attribute-profile-attributes-item'] || {},\n\t\t).map(Number);\n\n\t\tconst items = attrIds\n\t\t\t.map((attrId) => {\n\t\t\t\tconst attr = assetAttributes.get(attrId);\n\t\t\t\tif (!attr) return;\n\n\t\t\t\tconst name = attr.get('name');\n\t\t\t\tconst type = attr.get('type');\n\n\t\t\t\tlet _data = data[name];\n\n\t\t\t\treturn {\n\t\t\t\t\ttemplateId: attrId,\n\t\t\t\t\tvalues: ATTRIBUTE_MULTIPLE_VALUE_TYPES.includes(type)\n\t\t\t\t\t\t? csvToArray(_data)\n\t\t\t\t\t\t: Array.isArray(_data)\n\t\t\t\t\t\t? _data\n\t\t\t\t\t\t: [_data],\n\t\t\t\t\tappendable: data[`${name}-append`] || false,\n\t\t\t\t};\n\t\t\t})\n\t\t\t.filter((attrObj) => attrObj != null);\n\n\t\treturn this.save({name: data.name, items}, {wait: true, ...opts}).then(\n\t\t\t// Repopulate our selected attributes after any changes\n\t\t\tthis.populateSelectedAttributes,\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * Loop through the `items` array attribute to find all template IDs\n\t * for this attribute profile and get the associated models for each\n\t * and place them in an AttributeProfileAttributes collection\n\t */\n\tpopulateSelectedAttributes() {\n\t\tconst attributeModels = this.get('items')\n\t\t\t.map((attr, idx) => {\n\t\t\t\tconst _attrModel = this.assetAttributes.get(attr.templateId);\n\t\t\t\tif (!_attrModel) return;\n\n\t\t\t\tconst attrModel = new AttributeProfileAttribute({\n\t\t\t\t\t..._attrModel.attributes,\n\t\t\t\t});\n\t\t\t\tattrModel.set({\n\t\t\t\t\tappend: attr.appendable,\n\t\t\t\t\torderby: idx,\n\t\t\t\t});\n\n\t\t\t\tif (!ATTRIBUTE_MULTIPLE_VALUE_TYPES.includes(attrModel.get('type'))) {\n\t\t\t\t\tattrModel.set('value', attr.values[0]);\n\t\t\t\t} else {\n\t\t\t\t\tattrModel.set('value', attr.values);\n\t\t\t\t}\n\n\t\t\t\tif (isEmptyValue(attrModel.get('value'))) {\n\t\t\t\t\tattrModel.set('cleared', true);\n\t\t\t\t}\n\n\t\t\t\treturn attrModel;\n\t\t\t})\n\t\t\t.filter((attr) => attr != null);\n\n\t\tthis.attributesSelected.set(attributeModels);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'AttributeProfile';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './attribute';\n\nimport {ids as attributeTypeIds} from '@netx/core-asset/properties/attributes';\nimport {assetExpirationToDateString} from '@netx/core-asset-expiration/utils';\n\nexport default class Attribute_Date extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.date,\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {mixed} value Value\n\t * @param {number} truncateAt Truncate at index\n\t * @return {mixed} Formatted value\n\t */\n\tformat(value, truncateAt) {\n\t\t// In all cases (currently), except one, we want `yyyy-mm-dd`\n\t\t// The dam will sometimes send us mm/dd/yyyy and we want to normalize this\n\t\t// except for `expirationDate` - which is a time and a time that we want to\n\t\t// show in a relative format\n\t\tif (this.get('system') && this.get('name') === 'expirationDate') {\n\t\t\tif (value) {\n\t\t\t\tvalue = `${i18n.t('i18n.expires')}: ${assetExpirationToDateString(\n\t\t\t\t\tvalue,\n\t\t\t\t)}`;\n\t\t\t}\n\t\t\treturn value === 0 ? '' : value;\n\t\t}\n\n\t\tvalue = this.parseInValue(value);\n\t\treturn super.format(value);\n\t}\n\n\t/**\n\t * @override\n\t * @param {mixed} value Value\n\t * @return {mixed} Parsed in value\n\t */\n\tparseInValue(value) {\n\t\tvalue = super.parseInValue(value);\n\n\t\tif (_.isArray(value)) {\n\t\t\tvalue = _.map(value, (v) => {\n\t\t\t\tif (v.includes('/')) {\n\t\t\t\t\tv = _.dateToHTML(v);\n\t\t\t\t}\n\t\t\t\treturn v;\n\t\t\t});\n\t\t} else if (value && (_.isNumber(value) || value.includes('/'))) {\n\t\t\tvalue = _.dateToHTML(value);\n\t\t}\n\n\t\treturn value;\n\t}\n\n\t/**\n\t * @override\n\t * @param {mixed} value Value\n\t * @return {mixed} Parsed out value\n\t */\n\tparseOutValue(value) {\n\t\tvalue = super.parseOutValue(value);\n\n\t\tif (_.isArray(value)) {\n\t\t\tvalue = _.map(value, (d) => {\n\t\t\t\tif (_.isNumber(d)) {\n\t\t\t\t\treturn d;\n\t\t\t\t}\n\t\t\t\treturn d.replace(/(\\d+)-(\\d+)-(\\d+)/, '$2/$3/$1');\n\t\t\t});\n\t\t} else if (value) {\n\t\t\tvalue = _.isNumber(value)\n\t\t\t\t? value\n\t\t\t\t: value.replace(/(\\d+)-(\\d+)-(\\d+)/, '$2/$3/$1');\n\t\t}\n\n\t\t// Ensure leading zero's or server side validation will fail\n\t\tif (_.isString(value) && value.length) {\n\t\t\tvalue = value\n\t\t\t\t.split('/')\n\t\t\t\t.map((v) => {\n\t\t\t\t\treturn v.padStart(2, '0');\n\t\t\t\t})\n\t\t\t\t.join('/');\n\t\t}\n\t\treturn value;\n\t}\n\n\t/** @method */\n\tvalidator(val) {\n\t\tif (val === '' || val == null) return true;\n\n\t\tconst valid =\n\t\t\tval.search(/\\d\\d\\/\\d\\d\\/\\d\\d\\d\\d/) > -1 ||\n\t\t\tval.search(/\\d\\d\\d\\d-\\d\\d-\\d\\d/) > -1;\n\n\t\tif (!valid) return new Error('Invalid date');\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_Date';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './attribute';\n\nimport {ids as attributeTypeIds} from '@netx/core-asset/properties/attributes';\n\nexport default class Attribute_Multiselect extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.multiselect,\n\t\t};\n\t}\n\n\t/** @type {boolean} */\n\tget isCSV() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @override\n\t * @param {mixed} value Value\n\t * @return {mixed} Parsed in value\n\t */\n\tparseInValue(value) {\n\t\t// DAM-15267 - if there are no commas, one value, the regex in csvToArray()\n\t\t// will return null if the single value contains a single apostrophe\n\t\tif (_.isString(value) && value.indexOf(',') > -1) {\n\t\t\tvalue = _.csvToArray(value);\n\t\t}\n\t\treturn super.parseInValue(value) || [];\n\t}\n\n\t/**\n\t * @override\n\t * @param {mixed} value Value\n\t * @return {mixed} Parsed out value\n\t */\n\tparseOutValue(value) {\n\t\treturn super.parseOutValue(value) || [];\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_Multiselect';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './attribute';\n\nimport {ids as attributeTypeIds, numberTypes} from '../properties/attributes';\n\n// Polyfill\n// Safari did not have this prior to version 10 (currently at v11 but just to be safe)\nif (!window.Intl) {\n\twindow.Intl = {\n\t\tNumberFormat(locale, options) {\n\t\t\tconst digits = '0123456789';\n\t\t\tthis.format = n => {\n\t\t\t\tlet s = n.toString();\n\t\t\t\tif (\n\t\t\t\t\t!options ||\n\t\t\t\t\toptions.useGrouping === undefined ||\n\t\t\t\t\toptions.useGrouping\n\t\t\t\t) {\n\t\t\t\t\tvar dp = s.indexOf('.');\n\t\t\t\t\tif (dp < 0) {\n\t\t\t\t\t\tdp = s.length;\n\t\t\t\t\t}\n\t\t\t\t\twhile ((dp -= 3) > 0 && digits.indexOf(s[dp - 1]) >= 0) {\n\t\t\t\t\t\ts = s.substr(0, dp) + ',' + s.substr(dp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn s;\n\t\t\t};\n\t\t},\n\t};\n}\n/**\n * @function\n * @param {number} value Value\n * @return {number} Decimals\n */\nfunction getDecimalCount(value) {\n\tvalue = value + '';\n\n\tconst decimalSeparator = whatDecimalSeparator();\n\tconst decimals = value.split('.');\n\n\tif (!decimals[1]) {\n\t\treturn 0;\n\t}\n\n\treturn decimals[1].length;\n}\n/**\n * https://stackoverflow.com/questions/11665884/how-can-i-parse-a-string-with-a-comma-thousand-separator-to-a-number\n * @function\n * @param {mixed} value Value\n * @param {string} locale Locale\n * @return {number}\n */\nfunction parseNumber(value, locale) {\n\tvalue = value.toString();\n\tlocale = locale || navigator.language;\n\tconst example = Intl.NumberFormat(locale).format('1.1');\n\tconst cleanPattern = new RegExp('[^-+0-9' + example.charAt(1) + ']', 'g');\n\tconst cleaned = value.replace(cleanPattern, '');\n\tconst normalized = cleaned.replace(example.charAt(1), '.');\n\n\treturn parseFloat(normalized);\n}\n/**\n * @function\n * @return {string} Decimal separator for locale\n */\nfunction whatDecimalSeparator() {\n\tlet n = 1.1;\n\tn = n.toLocaleString().substring(1, 2);\n\treturn n;\n}\n\nexport default class Attribute_Number extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.number,\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {mixed} value Value\n\t * @param {object} opts Options\n\t * @return {mixed} Formatted value\n\t */\n\tformat(value, opts = {}) {\n\t\tvalue = this.parseInValue(value);\n\n\t\t// Do not parse into locale string\n\t\tconst noLocale = opts.noLocale === true;\n\t\tconst numberType = numberTypes[this.get('spec2')] || {};\n\t\tconst maxDecimal = numberType.maxDecimal || 0;\n\n\t\t/**\n\t\t * @function\n\t\t * @param {number} value Value\n\t\t * @return Parsed number\n\t\t */\n\t\tconst parse = value => {\n\t\t\tvalue = parseNumber(value);\n\n\t\t\t// `Unlimited` number type\n\t\t\tif (maxDecimal === Infinity) {\n\t\t\t\treturn noLocale\n\t\t\t\t\t? value.toString()\n\t\t\t\t\t: value.toLocaleString(undefined, {\n\t\t\t\t\t\t\tuseGrouping: false,\n\t\t\t\t\t\t\tmaximumFractionDigits: 20, // Maximum allowed by`toLocaleString`\n\t\t\t\t\t });\n\t\t\t} else {\n\t\t\t\treturn noLocale\n\t\t\t\t\t? value.toFixed(maxDecimal)\n\t\t\t\t\t: value.toLocaleString(undefined, {\n\t\t\t\t\t\t\tuseGrouping: false,\n\t\t\t\t\t\t\tminimumFractionDigits: maxDecimal,\n\t\t\t\t\t\t\tmaximumFractionDigits: maxDecimal,\n\t\t\t\t\t });\n\t\t\t}\n\t\t};\n\n\t\tif (this.get('system')) {\n\t\t\t// Normalize\n\t\t\tswitch (this.get('name')) {\n\t\t\t\tcase 'fileSize':\n\t\t\t\tcase 'fileSize2':\n\t\t\t\t\tvalue = _.bytes(value, true);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if (value) {\n\t\t\tvalue = _.isArray(value) ? _.map(value, parse) : parse(value);\n\t\t}\n\n\t\treturn super.format(value);\n\t}\n\n\t/**\n\t * Fix for displaying floats with zeros\n\t * @override\n\t * @param {object|string} key The key or an object of key values\n\t * @param {mixed} value Either the value, or if the key is an object, the options\n\t * @param {object} opts Either the options, or if the key is an object, undefined\n\t */\n\tset(key, value, opts) {\n\t\t// Make life easier\n\t\tlet attrs;\n\t\tif (_.isObject(key)) {\n\t\t\tattrs = key;\n\t\t\topts = value;\n\t\t} else {\n\t\t\tattrs = {\n\t\t\t\t[key]: value,\n\t\t\t};\n\t\t}\n\n\t\tif (attrs.value) {\n\t\t\t// Check if we are enforcing decimals via spec2 (a value of 4 means it is free - whole/decimal whatever)\n\t\t\tconst decimalPlaces = attrs.spec2 || this.get('spec2');\n\t\t\tif (decimalPlaces && decimalPlaces <= 3) {\n\t\t\t\tattrs.value = Number(attrs.value).toFixed(decimalPlaces);\n\t\t\t}\n\t\t}\n\n\t\t// Super\n\t\treturn super.set(attrs, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value\n\t * @return {boolean} Invalid\n\t */\n\tinvalid(value) {\n\t\tlet valid = this.validator(value);\n\n\t\tif (valid === true) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (valid instanceof Error) {\n\t\t\treturn valid.message;\n\t\t}\n\n\t\treturn i18n.t('i18n.invalid');\n\t}\n\n\t/**\n\t * @method\n\t * @param {mixed} value Value\n\t * @return {boolean} Valid\n\t */\n\tvalidator(value) {\n\t\t// Empty values are fine\n\t\t// TODO: check for mandatory\n\t\tif (_.isNull(value) || _.isUndefined(value) || value === '') {\n\t\t\treturn true;\n\t\t}\n\n\t\tvalue = value.toString();\n\n\t\tconst numberType = numberTypes[this.get('spec2')] || false;\n\t\tconst maxDecimal = numberType && numberType.maxDecimal;\n\t\tconst maxLength =\n\t\t\tnumberType.key === 'whole' ? this.get('spec1') : undefined;\n\n\t\tconst decimalIndex = value.indexOf('.');\n\t\tif (decimalIndex > -1 && decimalIndex + 1 === value.length) {\n\t\t\treturn new Error('Invalid number');\n\t\t}\n\n\t\tif (maxLength && value.length > maxLength) {\n\t\t\treturn new Error(`Exceeds max length of ${maxLength}`);\n\t\t}\n\n\t\tif (isNaN(parseNumber(value))) {\n\t\t\treturn new Error('Invalid number format');\n\t\t}\n\n\t\t// Negative numbers are not allowed by the DAM\n\t\tif (numberType.key === 'unlimited' && value < 0) {\n\t\t\treturn new Error('Negative numbers are not allowed');\n\t\t}\n\n\t\tconst decimalCount = getDecimalCount(value);\n\t\tif (decimalCount > maxDecimal) {\n\t\t\treturn new Error(`Exceeds max decimals of ${maxDecimal}`);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_Number';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './attribute';\n\nimport {ids as attributeTypeIds} from '@netx/core-asset/properties/attributes';\n\nexport default class Attribute_Select extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.select,\n\t\t};\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_Select';\n\t}\n}\n","/**\n * @class\n * @deprecated\n */\nimport Base from './attribute_tag';\n\nimport {ids as attributeTypeIds} from '@netx/core-asset/properties/attributes';\n\nexport default class Attribute_Semantic extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.semantic,\n\t\t};\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_Semantic';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './attribute_multiselect';\n\nimport {ids as attributeTypeIds} from '@netx/core-asset/properties/attributes';\n\nexport default class Attribute_Tag extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.tag,\n\t\t};\n\t}\n\n\t/**\n\t * isFlexible() returns true if this attribute is defined as having 'folksonomy'\n\t * and will therefore allow users to add terms via the select2 tagging system.\n\t * @override\n\t * @return {boolean} Is flexible\n\t */\n\tisFlexible() {\n\t\treturn this.get('spec2') === 1;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_Tag';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './attribute_tag';\n\nimport {ids as attributeTypeIds} from '@netx/core-asset/properties/attributes';\n\nexport default class Attribute_TagVocab extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.tagVocab,\n\t\t};\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_TagVocab';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './attribute';\n\nimport {ids as attributeTypeIds} from '@netx/core-asset/properties/attributes';\n\nexport default class Attribute_Text extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.text,\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {mixed} value Value\n\t * @param {object} opts Options\n\t * @return {mixed} Formatted value\n\t */\n\tformat(value, opts) {\n\t\topts = opts || {};\n\n\t\tconst parsedInValue = this.parseInValue(value);\n\t\tvalue = parsedInValue != null ? parsedInValue : '';\n\n\t\tvar parseURL = opts.parseURL !== false,\n\t\t\ttruncateAt = opts.truncateAt;\n\n\t\tif (_.isArray(value)) {\n\t\t\tvalue = value.join(', ');\n\t\t}\n\n\t\tvalue = value.replace(//g, '>');\n\n\t\t// Truncate value\n\t\tif (truncateAt && truncateAt !== Infinity && value.length > truncateAt) {\n\t\t\tvar truncatedValue = value.substr(0, truncateAt).trim();\n\n\t\t\tif (parseURL) {\n\t\t\t\tvar urls = value.match(/(https?:\\/\\/.*?[^\\s]+)/g);\n\t\t\t\t// We need to check if any urls started prior to truncation that did not complete\n\t\t\t\t// before truncation\n\t\t\t\tif (urls) {\n\t\t\t\t\tvar valLength = truncatedValue.length,\n\t\t\t\t\t\tcutoffUrl,\n\t\t\t\t\t\tc,\n\t\t\t\t\t\ti,\n\t\t\t\t\t\tidx;\n\n\t\t\t\t\tfor (i = 0, c = urls.length; i < c; i++) {\n\t\t\t\t\t\tconst url = urls[i];\n\t\t\t\t\t\tidx = value.lastIndexOf(url);\n\t\t\t\t\t\tif (idx < valLength && idx + url.length > valLength) {\n\t\t\t\t\t\t\tcutoffUrl = url;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttruncatedValue = cutoffUrl\n\t\t\t\t\t\t? _.parseURLS(truncatedValue.substr(0, idx)) +\n\t\t\t\t\t\t '' +\n\t\t\t\t\t\t truncatedValue.substr(idx) +\n\t\t\t\t\t\t ''\n\t\t\t\t\t\t: _.parseURLS(truncatedValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn truncatedValue + '...';\n\t\t}\n\n\t\treturn parseURL ? _.parseURLS(value) || '' : value;\n\t}\n\n\t/**\n\t * Value only appendable if not a multivalue attribute\n\t * @override\n\t * @return {boolean} Value is appendable\n\t */\n\tisAppendable() {\n\t\treturn !this.isTrueMultivalue();\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_Text';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './attribute_text';\n\nimport {ids as attributeTypeIds} from '@netx/core-asset/properties/attributes';\n\nexport default class Attribute_Textarea extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\ttype: attributeTypeIds.textarea,\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {mixed} value Value\n\t * @param {object} opts Options\n\t * @return {mixed} Formatted value\n\t */\n\tformat(value, opts) {\n\t\topts = opts || {};\n\t\tvalue = super.format(value, opts);\n\n\t\treturn opts.html !== false ? value && value.replace(/\\n/g, '
    ') : value;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Attribute_Textarea';\n\t}\n}\n","import {i18n} from '@netx/core/i18n';\n\nexport let typeIds = {\n\texport: 'export',\n\timport: 'import',\n\tboth: 'both',\n};\n\nexport let typeLabels = {\n\tboth: i18n.t('i18n.roundTrip'),\n\texport: i18n.t('i18n.export'),\n\timport: i18n.t('i18n.import'),\n};\n\n// Because figuring out a custom value is not easy\nexport let map = {\n\tcdr: 'Corel cdr',\n\tcdrinfo: 'Corel cdrinfo',\n\tcdt: 'Corel cdt',\n\tcrl: 'Corel',\n\tdc: 'Dublin Core',\n\tDICOM: 'Dicom',\n\texif: 'EXIF',\n\tfill: 'Corel Fill',\n\tID3: 'ID3',\n\tIptc4xmpCore: 'IPTC',\n\tpdf: 'PDF',\n\tphotoshop: 'Photoshop',\n\ttiff: 'EXIF',\n\txmp: 'XMP',\n\txmpDM: 'XMP',\n\txmpMM: 'XMP',\n\txmpRights: 'XMP',\n};\n\nexport let types = _.invert(typeIds);\n\n// This is for dropdowns\nexport let typeOptions = _.mapObject(types, (name) => typeLabels[name]);\n\nexport default {\n\tmap: map,\n\ttypeIds: typeIds,\n\ttypeLabels: typeLabels,\n\ttypeOptions: typeOptions,\n\ttypes: types,\n};\n","import {i18n} from '@netx/core/i18n';\n\nexport let types = {\n\tasset: 'asset',\n\tattributeSet: 'attributeSet',\n\tcart: 'cart',\n\tsavedCart: 'savedCart',\n\tcategory: 'category',\n\tconstituent: 'constituent',\n\t//search: 'search'\n\tsavedSearch: 'savedSearch',\n\t// NOTE: this got changed to 'assets' but these are not strings to i18n, these are DAM symbols. Use share:i18n.asssetSet or similar instead.\n\tassetSet: 'assetSet',\n};\n\nexport let organizeByTypes = {\n\tnone: {\n\t\tvalue: 0,\n\t\tlabel: i18n.t('i18n.noOrganization'),\n\t},\n\tfileType: {\n\t\tvalue: -105,\n\t\tlabel: i18n.t('i18n.fileType'),\n\t},\n\tfileFormatFamily: {\n\t\tvalue: -106,\n\t\tlabel: i18n.t('i18n.fileFormatFamily'),\n\t},\n\tfolderPath: {\n\t\tvalue: -108,\n\t\tlabel: i18n.t('i18n.categoryPath'),\n\t},\n};\n\nexport default {organizeByTypes, types};\n","import {isMediaFileTypeAsset} from './isMediaFileTypeAsset';\n\nexport const assetHasAudio = (\n\tfileFormatFamily: string[],\n\tviewNames: string[],\n) => isMediaFileTypeAsset(fileFormatFamily) && viewNames.includes('previewMp3');\n\nexport default assetHasAudio;\n","import {isMediaFileTypeAsset} from './isMediaFileTypeAsset';\n\nexport const assetHasVideo = (\n\tfileFormatFamily: string[],\n\tviewNames: string[],\n) =>\n\tisMediaFileTypeAsset(fileFormatFamily) && viewNames.includes('previewH264');\n\nexport default assetHasVideo;\n","import {bytes} from '@netx/core/lib/underscore-netx';\n\nexport const getAssetFileSizeLabel = bytes; // (fileSize: number) => bytes(fileSize);\n\nexport default getAssetFileSizeLabel;\n","import {status as assetStatuses} from '../properties/asset';\nimport type {Asset} from '../types';\n\nconst PRESENT_STATUSES = [\n\tassetStatuses.NEARLINE,\n\tassetStatuses.ONLINE,\n\tassetStatuses.TEMP,\n];\n\nexport const assetIsPresent = (asset: Asset) =>\n\tPRESENT_STATUSES.includes(asset.status);\n\nexport default assetIsPresent;\n","import type {Asset} from '../types';\n\nexport const createAssetObject = (overrides?: Partial): Asset => ({\n\tassetId: 0,\n\tattribute1: '',\n\tattribute2: '',\n\tattribute3: '',\n\tattribute4: '',\n\tattribute5: '',\n\tattribute6: '',\n\tattribute7: '',\n\tattribute8: '',\n\tattribute9: '',\n\tattribute10: '',\n\tattribute11: '',\n\tattribute12: '',\n\tattribute13: '',\n\tattribute14: '',\n\tattribute15: '',\n\tattribute16: '',\n\tattributeIds: [],\n\tattributeNames: [],\n\tattributePermissions: [],\n\tattributeValues: [],\n\taudioBitRate: 0,\n\taudioChannelCount: 0,\n\taudioChannelLayout: '',\n\taudioSampleRate: 0,\n\tcategories: [],\n\tcategoryPaths: [],\n\tcategoryid: 0,\n\tcheckout: 0,\n\tcheckoutUserLabel: '',\n\tcommitAttributes: false,\n\tconstituentIds: [],\n\tconstituentType: '',\n\tcreationdate: '',\n\tduration: 0,\n\texpirationDate: 0,\n\tfile: '',\n\tfileSize2: 0,\n\tfileheight: 0,\n\tfilesize: 0,\n\tfiletype: 0,\n\tfiletypelabel: '',\n\tfilewidth: 0,\n\tfileFormatFamily: [],\n\tflvPreview: false,\n\tgeoLocationLabel: '',\n\thasChildren: false,\n\thidden: 0,\n\timageid: 0,\n\timportDate: '',\n\timportUserLabel: '',\n\tinCurrentCart: false,\n\tlatitude: 0,\n\tlocationContext: '',\n\tlocationid: 1,\n\tlongitude: 0,\n\tmetadata: '',\n\tmetadataAvailable: false,\n\tmoddate: '',\n\tmoduserid: 0,\n\tmoduserlabel: '',\n\tname: '',\n\tparentId: 0,\n\tpath: '',\n\tpermissionMatrix: [1, 1, 1, 1, 1, 1],\n\tpreviewHeight: 0,\n\tpreviewUrl: '',\n\tpreviewWidth: 0,\n\tproofAvailable: false,\n\trating: 0,\n\treadOnly: 0,\n\trelatedAvailable: false,\n\trepurposeAvailability: 1,\n\treviewAvailable: false,\n\tstatDeliveries: 0,\n\tstatPreviews: 0,\n\tstatus: 1,\n\tthumb: '',\n\tthumbUrl: '',\n\ttimeScale: 0,\n\tversionIds: [],\n\tviewIds: [],\n\tviewNames: [],\n\tvisible: 1,\n\tzoomAvailable: false,\n\tdpi: 0,\n\tmd5sum: '',\n\tbitDepth: 0,\n\tcolorProfile: '',\n\talphaChannel: '',\n\ttemplatable: false,\n\ttemplate: false,\n\ttemplateCustomizable: false,\n\tiiifManifestUrl: null,\n\t...overrides,\n});\n\nexport default createAssetObject;\n","import {VideoFormatFamilies} from '../constants';\n\nexport const isVideoFileTypeAsset = (fileFormatFamily: string[]) =>\n\tfileFormatFamily.some((format) =>\n\t\tVideoFormatFamilies.includes(format as typeof VideoFormatFamilies[number]),\n\t);\n\nexport default isVideoFileTypeAsset;\n","import {isDocumentFileTypeAsset} from './isDocumentFileTypeAsset';\nimport {isImageFileTypeAsset} from './isImageFileTypeAsset';\nimport {isMediaFileTypeAsset} from './isMediaFileTypeAsset';\nimport {isVideoFileTypeAsset} from './isVideoFileTypeAsset';\n\nexport const getGeneralAssetFileType = (\n\tfileFormatFamily: string[] = [],\n\tspecific = false,\n) => {\n\tif (isDocumentFileTypeAsset(fileFormatFamily)) return 'document';\n\tif (isImageFileTypeAsset(fileFormatFamily)) return 'image';\n\tif (isMediaFileTypeAsset(fileFormatFamily)) {\n\t\treturn specific\n\t\t\t? isVideoFileTypeAsset(fileFormatFamily)\n\t\t\t\t? 'video'\n\t\t\t\t: 'audio'\n\t\t\t: 'media';\n\t}\n};\n\nexport default getGeneralAssetFileType;\n","import {DocumentFormatFamilies} from '../constants';\n\nexport const isDocumentFileTypeAsset = (fileFormatFamily: string[]) =>\n\tfileFormatFamily.some((format) =>\n\t\tDocumentFormatFamilies.includes(\n\t\t\tformat as typeof DocumentFormatFamilies[number],\n\t\t),\n\t);\n\nexport default isDocumentFileTypeAsset;\n","import {ImageFormatFamilies} from '../constants';\n\nexport const isImageFileTypeAsset = (fileFormatFamily: string[]) =>\n\tfileFormatFamily.some((format) =>\n\t\tImageFormatFamilies.includes(format as typeof ImageFormatFamilies[number]),\n\t);\n\nexport default isImageFileTypeAsset;\n","import {secondsToHms} from '@netx/core/lib/utils';\n\n/**\n * @param duration Duration in milliseconds\n * @returns Duration label\n */\nexport const getMediaFileTypeAssetInfoLabel = (duration: number) =>\n\tsecondsToHms(duration / 1000);\n\nexport default getMediaFileTypeAssetInfoLabel;\n","import {getGeneralAssetFileType} from './getGeneralAssetFileType';\nimport {getDocumentFileTypeAssetInfoLabel} from './getDocumentFileTypeAssetInfoLabel';\nimport {getMediaFileTypeAssetInfoLabel} from './getMediaFileTypeAssetInfoLabel';\nimport {getImageFileTypeAssetInfoLabel} from './getImageFileTypeAssetInfoLabel';\nimport type {Asset} from '../types';\n\nexport const getAssetFileTypeInfoLabel = ({\n\tduration,\n\tfileFormatFamily,\n\tfileheight,\n\tfilewidth,\n\tconstituentIds,\n}: Pick<\n\tAsset,\n\t| 'constituentIds'\n\t| 'duration'\n\t| 'fileFormatFamily'\n\t| 'fileheight'\n\t| 'filewidth'\n>) => {\n\tswitch (getGeneralAssetFileType(fileFormatFamily)) {\n\t\tcase 'document':\n\t\t\treturn getDocumentFileTypeAssetInfoLabel(constituentIds.length);\n\t\tcase 'media':\n\t\t\treturn getMediaFileTypeAssetInfoLabel(duration);\n\t\tdefault:\n\t\t\t//case 'image':\n\t\t\treturn getImageFileTypeAssetInfoLabel(filewidth, fileheight);\n\t}\n};\n\nexport default getAssetFileTypeInfoLabel;\n","import {i18n} from '@netx/core/i18n';\n\nexport const getDocumentFileTypeAssetInfoLabel = (pageCount: number) =>\n\t// Do not display when there are no pages\n\tpageCount ? i18n.t('i18n.nPages', {count: pageCount}) : undefined;\n\nexport default getDocumentFileTypeAssetInfoLabel;\n","export const getImageFileTypeAssetInfoLabel = (\n\tfilewidth: number,\n\tfileheight: number,\n) => (filewidth || fileheight ? `${filewidth}x${fileheight}` : undefined);\n\nexport default getImageFileTypeAssetInfoLabel;\n","import type {Asset} from '../types';\nimport {status as assetStatuses} from '../properties/asset';\n\nexport const isAssetCheckedOut = (asset: Asset) =>\n\tasset.status === assetStatuses.CHECKOUT;\n\nexport default isAssetCheckedOut;\n","export const ASSET_DEFAULT_ICON_TEST = /icons\\/(.*)\\.png/;\n\nexport const isDefaultIcon = (previewUrl?: string) =>\n\tpreviewUrl?.match(ASSET_DEFAULT_ICON_TEST);\n\nexport default isDefaultIcon;\n","import {appRouter} from '@netx/core-next/router';\nimport type {AssetId} from '../types';\n\nexport const routeToAsset = (id: AssetId) =>\n\tappRouter.navigate(`asset/${id}`, true);\n\nexport default routeToAsset;\n","import {MediaFormatFamilies} from '../constants';\n\nexport const isMediaFileTypeAsset = (fileFormatFamily: string[]) =>\n\tfileFormatFamily.some((format) =>\n\t\tMediaFormatFamilies.includes(format as typeof MediaFormatFamilies[number]),\n\t);\n\nexport default isMediaFileTypeAsset;\n","import {UserLevel} from '@netx/core-user/constants';\n\nexport const ATTRIBUTE_HISTROY_MINIMUM_LEVEL = UserLevel.PRODUCER;\n\nexport enum AttributeHistoryPref {\n\tENABLED = 'metadata.history.enabled',\n}\n","import {getPreference, currentUserMeetsUserLevel} from '@netx/core-user/utils';\nimport {\n\tAttributeHistoryPref,\n\tATTRIBUTE_HISTROY_MINIMUM_LEVEL,\n} from './constants';\n\nexport const attributeHistoryEnabled = () =>\n\tgetPreference(AttributeHistoryPref.ENABLED, true);\n\nexport const canViewAttributeHistory = () =>\n\tcurrentUserMeetsUserLevel(ATTRIBUTE_HISTROY_MINIMUM_LEVEL);\n","import {UserLevel} from '@netx/core-user/constants';\n\nexport const MINIMUM_USER_LEVEL = UserLevel.ADMIN;\n","import type AttributeModel from '@netx/core-asset/models/attribute';\nimport type View from '@netx/core/lib/netx-view';\nimport {currentUserMeetsUserLevel} from '@netx/core-user/utils/currentUserMeetsUserLevel';\nimport {MINIMUM_USER_LEVEL} from './constants';\n\nexport const canManageAttributeProfiles = () =>\n\tcurrentUserMeetsUserLevel(MINIMUM_USER_LEVEL);\n\nexport const canEdit = (view: View) =>\n\tcurrentUserMeetsUserLevel(MINIMUM_USER_LEVEL);\n","import {i18n} from '@netx/core/i18n';\n\nexport const AttributeProfilesSystemLabel = {\n\tROUTE: i18n.t('i18n.attributeProfiles'),\n};\n\nexport const PROFILE_ACTION = {\n\tADD: i18n.t('i18n.addAttributeProfile'),\n\tEDIT: i18n.t('i18n.editAttributeProfile'),\n};\n","import {getViewModel} from '@netx/core/lib/utils';\n\nimport type AttributeModel from '@netx/core-asset/models/attribute';\nimport type View from '@netx/core/lib/netx-view';\n\nimport {MINIMUM_USER_LEVEL} from '../constants';\nimport {canEdit} from '../enablers';\nimport {PROFILE_ACTION} from '../locales';\n\nimport type {Action} from '@netx/core/bootstrap';\n\nimport {icon} from '@fortawesome/fontawesome-svg-core';\nimport {faPencilAlt} from '@fortawesome/pro-solid-svg-icons';\n\nconst iconOpts = {classes: ['fa-fw']};\nconst icons = {\n\tfaPencilAlt: icon(faPencilAlt, iconOpts).html,\n};\n\nconst wrapper = (view: View, event: MouseEvent) => [\n\tgetViewModel(view),\n\tevent,\n];\n\nexport const BASE_EVENT = `attribute:profile`;\n\nexport const ATTRIBUTE_PROFILE_EVENT = {\n\tADD: `${BASE_EVENT}:new`,\n\tEDIT: `${BASE_EVENT}:edit`,\n};\n\nexport const ACTIONS: Action<\n\ttypeof ATTRIBUTE_PROFILE_EVENT[keyof typeof ATTRIBUTE_PROFILE_EVENT]\n>[] = [\n\t{\n\t\tevent: ATTRIBUTE_PROFILE_EVENT.ADD,\n\t\tenableTest: canEdit,\n\t\tlabel: PROFILE_ACTION.ADD,\n\t\ttestOnSync: true,\n\t\tuserLevel: MINIMUM_USER_LEVEL,\n\t},\n\t{\n\t\tevent: ATTRIBUTE_PROFILE_EVENT.EDIT,\n\t\tenableTest: canEdit,\n\t\ticon: icons.faPencilAlt,\n\t\tlabel: PROFILE_ACTION.EDIT,\n\t\ttestOnSync: true,\n\t\tuserLevel: MINIMUM_USER_LEVEL,\n\t\twrapper,\n\t},\n];\n\nexport default ACTIONS;\n","import type {ReactAction} from '@netx/core/bootstrap';\nimport {performAction} from '@netx/core/lib/utils';\nimport {faProjectDiagram} from '@fortawesome/pro-solid-svg-icons';\nimport {canManageAttributeProfiles} from '../enablers';\nimport {AttributeProfilesSystemLabel} from '../locales';\n\nexport const attributeProfileActionProfilesSystemRouteIcon = faProjectDiagram;\n\n/**\n * Route to attribute profiles system\n * @param params\n * @returns Action\n */\nexport const attributeProfileActionProfilesSystemRoute = (\n\tparams?: Partial,\n): ReactAction => ({\n\tname: 'attribute-profiles-system-route',\n\tcb: () => performAction('system:attributes:attributeProfiles:route'),\n\tenableTest: () => canManageAttributeProfiles(),\n\ticon: attributeProfileActionProfilesSystemRouteIcon,\n\tlabel: AttributeProfilesSystemLabel.ROUTE,\n\trouteMatch: /^system\\/attribute\\/attributeProfiles/,\n\t...params,\n});\n","import {AssetAttributes} from '@netx/core-asset/models/asset';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\n\nexport const enabled = () => {\n\treturn getPreference('metadata.smartLabels.enabled', true);\n};\n\nexport const supportsAsset = (assetData: AssetAttributes) => {\n\tconst {fileFormatFamily} = assetData;\n\treturn (\n\t\tfileFormatFamily.includes('image') ||\n\t\tfileFormatFamily.includes('raw') ||\n\t\tfileFormatFamily.includes('cameraRaw')\n\t);\n};\n","import {UserLevel} from '@netx/core-user-next/constants';\n\nexport const ATTRIBUTE_SYSTEM_ATTRIBUTES_MINIMUM_USER_LEVEL = UserLevel.ADMIN;\nexport const ATTRIBUTE_SYSTEM_METADATA_MAPS_MINIMUM_USER_LEVEL =\n\tUserLevel.ADMIN;\nexport const ATTRIBUTE_SYSTEM_SEMANTICS_MINIMUM_USER_LEVEL = UserLevel.ADMIN;\n\nexport enum AttributePref {\n\tSEMANTICS_ENABLED = 'metadata.semantic.enabled',\n\tVOCABULARY_ENABLED = 'metadata.vocabulary.enabled',\n\tALL_USERS_PERMITTED_TO_EDIT = 'permission.attributesEnabled',\n}\n\nexport const ATTRIBUTE_ID = 'attributeid';\n\nexport const ATTRIBUTE_TYPE = {\n\tTEXT: 1,\n\tTEXTAREA: 2,\n\t/** aka pulldown */\n\tSELECT: 3,\n\tDATE: 4,\n\tMULTISELECT: 5,\n\t/** This requires the system property `dataManager.enabled` be `true` */\n\tTAG: 6,\n\tNUMBER: 7,\n\t/** Stupid terrible beast */\n\tHIERARCHICAL: 8,\n\t/** pretty much deprecated. but it works... */\n\tSEMANTIC: 12,\n\t/** This requires the system property `metadata.vocabulary.enabled` be `true` */\n\tTAG_VOCAB: 13,\n};\n\nexport const ATTRIBUTE_ACTION = {\n\tAPPEND: 'append',\n\tCLEAR: 'clear',\n\tOVERWRITE: 'overwrite',\n\tREMOVE: 'remove',\n\tSET_IF_BLANK: 'set_if_blank',\n};\n\nexport const ATTRIBUTE_ACCESS_FILTER_TYPES = [\n\tATTRIBUTE_TYPE.SELECT,\n\tATTRIBUTE_TYPE.MULTISELECT,\n\tATTRIBUTE_TYPE.TAG_VOCAB,\n];\n\nexport const ATTRIBUTE_APPENDABLE_TYPES = [\n\tATTRIBUTE_TYPE.TEXT,\n\tATTRIBUTE_TYPE.TEXTAREA,\n\tATTRIBUTE_TYPE.MULTISELECT,\n\tATTRIBUTE_TYPE.TAG,\n\tATTRIBUTE_TYPE.SEMANTIC,\n\tATTRIBUTE_TYPE.TAG_VOCAB,\n];\n\nexport const ATTRIBUTE_AUTO_LOOKUP_TYPES = [\n\tATTRIBUTE_TYPE.TAG,\n\tATTRIBUTE_TYPE.SEMANTIC,\n\tATTRIBUTE_TYPE.TAG_VOCAB,\n];\n\nexport const ATTRIBUTE_DEFAULTABLE_TYPES = [\n\tATTRIBUTE_TYPE.DATE,\n\tATTRIBUTE_TYPE.NUMBER,\n\tATTRIBUTE_TYPE.TEXT,\n\tATTRIBUTE_TYPE.TEXTAREA,\n];\n\n// !!! hierarchical is not supported for edit !!!\n// !!! I REPEAT: hierarchical is not editable !!!\nexport const ATTRIBUTE_EDITABLE_TYPES = Object.values(ATTRIBUTE_TYPE).filter(\n\t(type) => type !== ATTRIBUTE_TYPE.HIERARCHICAL,\n);\n\nexport const ATTRIBUTE_FACET_TYPES = [\n\tATTRIBUTE_TYPE.SELECT,\n\tATTRIBUTE_TYPE.MULTISELECT,\n\tATTRIBUTE_TYPE.TAG,\n\tATTRIBUTE_TYPE.TAG_VOCAB,\n];\n\nexport const ATTRIBUTE_MULTIPLE_VALUE_TYPES = [\n\tATTRIBUTE_TYPE.MULTISELECT,\n\tATTRIBUTE_TYPE.TAG,\n\tATTRIBUTE_TYPE.SEMANTIC,\n\tATTRIBUTE_TYPE.TAG_VOCAB,\n];\n\nexport const ATTRIBUTE_MULTIPLE_VALUE_DEPRECATED_TYPES = [\n\tATTRIBUTE_TYPE.TEXT,\n\tATTRIBUTE_TYPE.TEXTAREA,\n\tATTRIBUTE_TYPE.SELECT,\n\tATTRIBUTE_TYPE.DATE,\n\tATTRIBUTE_TYPE.NUMBER,\n];\n\nexport const ATTRIBUTE_NUMBER_SPEC_2_TYPE = {\n\tWHOLE: 0,\n\tONE_DECIMAL: 1,\n\tTWO_DECIMALS: 2,\n\tTHREE_DECIMALS: 3,\n\t/** \"free,\" but not negative */\n\tUNLIMITED: 4,\n\t/** TODO: what is 'sortable' - should all number not be sortable? */\n\tSORTABLE: 5,\n};\n\nexport const ATTRIBUTE_NUMBER_TESTS: Record<\n\ttypeof ATTRIBUTE_NUMBER_SPEC_2_TYPE[keyof typeof ATTRIBUTE_NUMBER_SPEC_2_TYPE],\n\tstring\n> = {\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.ONE_DECIMAL]: `^(-?\\\\d+(\\\\.\\\\d{0,1})?|-?\\\\.\\\\d{1})$`,\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.SORTABLE]: `.*`,\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.THREE_DECIMALS]: `^(-?\\\\d+(\\\\.\\\\d{0,3})?|-?\\\\.\\\\d{1,3})$`,\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.TWO_DECIMALS]: `^(-?\\\\d+(\\\\.\\\\d{0,2})?|-?\\\\.\\\\d{1,2})$`,\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.UNLIMITED]: `^\\\\d*\\\\.?\\\\d+$`,\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.WHOLE]: `^-?\\\\d+$`,\n};\n\nexport const ATTRIBUTE_NUMBER_MAX_DECIMAL = {\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.ONE_DECIMAL]: 1,\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.THREE_DECIMALS]: 3,\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.TWO_DECIMALS]: 2,\n\t[ATTRIBUTE_NUMBER_SPEC_2_TYPE.UNLIMITED]: Infinity,\n};\n\nexport const ATTRIBUTE_OBJECT_TYPE = {\n\tASSET: 'asset',\n\tCLIP: 'clip',\n};\n\nexport const ATTRIBUTE_REMOVABLE_TYPES = [\n\tATTRIBUTE_TYPE.MULTISELECT,\n\tATTRIBUTE_TYPE.TAG,\n\tATTRIBUTE_TYPE.SEMANTIC,\n\tATTRIBUTE_TYPE.TAG,\n];\n\nexport const ATTRIBUTE_VOCABULARY_TYPES = [\n\tATTRIBUTE_TYPE.SELECT,\n\tATTRIBUTE_TYPE.MULTISELECT,\n\tATTRIBUTE_TYPE.TAG,\n\tATTRIBUTE_TYPE.TAG_VOCAB,\n];\n\nexport const ATTRIBUTE_SYSTEM = {\n\tASSET_ID: 'assetId',\n\tCATEGORY_PATHS: 'categoryPaths',\n\tCHECKSUM: 'checksum',\n\tCREATION_DATE: 'creationdate',\n\tDIMENSIONS: 'dimensions',\n\tEXPIRE_DATE: 'expireDate',\n\tFILE: 'file',\n\tFILE_FORMAT_FAMILY: 'fileFormatFamily',\n\tFILE_SIZE_2: 'fileSize2',\n\tFILE_TYPE_LABEL: 'filetypelabel',\n\tHEIGHT: 'height',\n\tIMPORT_DATE: 'importDate',\n\tMOD_DATE: 'moddate',\n\tMOD_USER: 'modUser',\n\tNAME: 'name',\n\tPATH: 'path',\n\tSMART_LABELS: 'smart labels',\n\tTHUMB_PATH: 'thumbPath',\n\tWIDTH: 'width',\n};\n\nexport const ATTRIBUTE_SYSTEM_ID: Record<\n\ttypeof ATTRIBUTE_SYSTEM[keyof typeof ATTRIBUTE_SYSTEM],\n\tnumber\n> = {\n\t[ATTRIBUTE_SYSTEM.NAME]: -100,\n\t[ATTRIBUTE_SYSTEM.FILE]: -101,\n\t[ATTRIBUTE_SYSTEM.ASSET_ID]: -102,\n\t[ATTRIBUTE_SYSTEM.FILE_SIZE_2]: -104,\n\t[ATTRIBUTE_SYSTEM.FILE_TYPE_LABEL]: -105,\n\t[ATTRIBUTE_SYSTEM.FILE_FORMAT_FAMILY]: -106,\n\t[ATTRIBUTE_SYSTEM.PATH]: -107,\n\t[ATTRIBUTE_SYSTEM.CATEGORY_PATHS]: -108,\n\t[ATTRIBUTE_SYSTEM.EXPIRE_DATE]: -109,\n\t[ATTRIBUTE_SYSTEM.MOD_DATE]: -110,\n\t[ATTRIBUTE_SYSTEM.CREATION_DATE]: -111,\n\t[ATTRIBUTE_SYSTEM.IMPORT_DATE]: -112,\n\t[ATTRIBUTE_SYSTEM.MOD_USER]: -113,\n\t[ATTRIBUTE_SYSTEM.WIDTH]: -114,\n\t[ATTRIBUTE_SYSTEM.HEIGHT]: -115,\n\t[ATTRIBUTE_SYSTEM.CHECKSUM]: -117,\n\t[ATTRIBUTE_SYSTEM.THUMB_PATH]: -118,\n\t[ATTRIBUTE_SYSTEM.SMART_LABELS]: -119,\n\t[ATTRIBUTE_SYSTEM.DIMENSIONS]: -120,\n};\n","import {currentUserMeetsUserLevel, getPreference} from '@netx/core-user/utils';\nimport {\n\tAttributePref,\n\tATTRIBUTE_SYSTEM_ATTRIBUTES_MINIMUM_USER_LEVEL,\n\tATTRIBUTE_SYSTEM_METADATA_MAPS_MINIMUM_USER_LEVEL,\n\tATTRIBUTE_SYSTEM_SEMANTICS_MINIMUM_USER_LEVEL,\n} from './constants';\n\nexport const canManageAttributeSystemAttributes = () =>\n\tcurrentUserMeetsUserLevel(ATTRIBUTE_SYSTEM_ATTRIBUTES_MINIMUM_USER_LEVEL);\n\nexport const canManageAttributeSystemMetadataMaps = () =>\n\tcurrentUserMeetsUserLevel(ATTRIBUTE_SYSTEM_METADATA_MAPS_MINIMUM_USER_LEVEL);\n\nexport const canManageAttributeSystemSemantics = () =>\n\tattributeSystemSemanticsEnabled() &&\n\tcurrentUserMeetsUserLevel(ATTRIBUTE_SYSTEM_SEMANTICS_MINIMUM_USER_LEVEL);\n\nexport const attributeSystemSemanticsEnabled = () =>\n\tgetPreference(AttributePref.SEMANTICS_ENABLED, true);\n\nexport const attributeSystemVocabulariesEnabled = () =>\n\tgetPreference(AttributePref.VOCABULARY_ENABLED, true);\n","import {Locales} from '@netx/core-next/locales';\n\nimport {\n\tATTRIBUTE_TYPE,\n\tATTRIBUTE_SYSTEM,\n\tATTRIBUTE_SYSTEM_ID,\n\tATTRIBUTE_OBJECT_TYPE,\n} from './constants';\nimport {AttributeType, AttributeSystemType} from './types';\n\nexport const AttributeObjectTypeLabel = Locales((i18n) => ({\n\t[ATTRIBUTE_OBJECT_TYPE.ASSET]: i18n('i18n.asset'),\n\t[ATTRIBUTE_OBJECT_TYPE.CLIP]: i18n('i18n.clip'),\n}));\n\nexport const AttributeSystemAttributesLabel = Locales((i18n) => ({\n\tROUTE: i18n('i18n.attributes'),\n}));\n\nexport const AttributeSystemMetadataMapsLabel = Locales((i18n) => ({\n\tROUTE: i18n('i18n.metadataMaps'),\n}));\n\nexport const AttributeSystemSemanticsLabel = Locales((i18n) => ({\n\tROUTE: i18n('i18n.semantics'),\n}));\n\nexport const TYPE_LABELS = Locales>((i18n) => ({\n\t[ATTRIBUTE_TYPE.DATE]: i18n('i18n.date'),\n\t[ATTRIBUTE_TYPE.HIERARCHICAL]: i18n('i18n.hierarchical'),\n\t[ATTRIBUTE_TYPE.MULTISELECT]: i18n('i18n.multiSelectBox'),\n\t[ATTRIBUTE_TYPE.NUMBER]: i18n('i18n.number'),\n\t[ATTRIBUTE_TYPE.SELECT]: i18n('i18n.pulldown'),\n\t[ATTRIBUTE_TYPE.SEMANTIC]: i18n('i18n.semantic'),\n\t[ATTRIBUTE_TYPE.TAG]: i18n('i18n.tag'),\n\t[ATTRIBUTE_TYPE.TAG_VOCAB]: i18n('i18n.tagVocab'),\n\t[ATTRIBUTE_TYPE.TEXT]: i18n('i18n.text'),\n\t[ATTRIBUTE_TYPE.TEXTAREA]: i18n('i18n.textarea'),\n}));\n\nexport const SYSTEM_ATTRIBUTE_LABELS = Locales<\n\tRecord\n>((i18n) => ({\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.ASSET_ID]]: i18n('i18n.assetId'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.CATEGORY_PATHS]]:\n\t\ti18n('i18n.folderPath'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.CHECKSUM]]: i18n('i18n.checksum'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.CREATION_DATE]]:\n\t\ti18n('i18n.creationDate'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.DIMENSIONS]]: i18n('i18n.dimensions'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.EXPIRE_DATE]]: i18n('i18n.expires'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.FILE]]: i18n('i18n.file'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.FILE_FORMAT_FAMILY]]: i18n(\n\t\t'i18n.fileFormatFamily',\n\t),\n\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.FILE_SIZE_2]]: i18n('i18n.fileSize'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.FILE_TYPE_LABEL]]:\n\t\ti18n('i18n.fileType'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.HEIGHT]]: i18n('i18n.height'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.IMPORT_DATE]]: i18n('i18n.importDate'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.MOD_DATE]]: i18n('i18n.modDate'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.MOD_USER]]: i18n('i18n.modUser'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.NAME]]: i18n('i18n.name'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.PATH]]: i18n('i18n.path'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.SMART_LABELS]]:\n\t\ti18n('i18n.smartLabels'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.THUMB_PATH]]: i18n('i18n.thumbPath'),\n\t[ATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.WIDTH]]: i18n('i18n.width'),\n}));\n","import _ from 'underscore';\nimport {completions as autocompletions} from '@netx/core-app/properties/autocomplete';\nimport AttributesCollection from '@netx/core-asset/collections/attributes';\nimport AttributeModel from '@netx/core-asset/models/attribute';\nimport {dispatcher} from '@netx/core-next/dispatcher';\n\nexport const attributes = new AttributesCollection([]);\nexport const attributeTemplates = attributes;\n\nattributes.listenTo(\n\tdispatcher,\n\t'system:attribute:edit:success',\n\t(model: any, isNew: boolean) => {\n\t\tif (!isNew) return;\n\t\t// Add the model attributes so that we get the proper attribute model type\n\t\t// when creating a new attribute the model is just the generic base model\n\t\tattributes.add(model.attributes);\n\t\tattributes.sort();\n\t},\n);\n\n// Update autocompletions\nconst attributeHistoryCompletion = autocompletions.attributeHistory;\nattributes.on(\n\t'add remove sync',\n\t_.debounce(() => {\n\t\t// @ts-ignore\n\t\tattributeHistoryCompletion.data = attributes\n\t\t\t.filterByHistory()\n\t\t\t.map((attr: AttributeModel) => ({\n\t\t\t\tlabel: attr.getLabel(),\n\t\t\t\tvalue: attr.id,\n\t\t\t}));\n\t}, 50),\n);\n\n// Keeping clip and asset attributes together in the same call with wholly different needs was\n// kinf of a mistake\nexport const assetAttributes = attributes.filterByObjectType('asset');\nexport const clipAttributes = attributes.filterByObjectType('clip');\n\n// Update our sub attribute collections\nconst attributesChanged = _.debounce(() => {\n\tassetAttributes.set(attributes.filterByObjectType('asset').models, {\n\t\tmerge: true,\n\t});\n\tclipAttributes.set(attributes.filterByObjectType('clip').models, {\n\t\tmerge: true,\n\t});\n\tdispatcher.trigger('asset:attributes:updated', attributes);\n}, 25);\n\nattributes\n\t.on('add remove', attributesChanged)\n\t.on('change', (model) => {\n\t\t!_.isEmpty(model.changed) && attributesChanged();\n\t})\n\t.on('sync', (collection) => {\n\t\tcollection === attributes && attributesChanged();\n\t});\n\nexport const getAttribute = (id?: number, name?: string) => {\n\tif (id != null) return attributes.get(parseInt(id.toString()));\n\tif (name != null) return attributes.findWhere({name: name});\n};\n\nexport const getAttributesByObjectType = (type: 'asset' | 'clip') => {\n\treturn attributes.filterByObjectType(type);\n};\n\nexport const getAttributeId = (name: string) => {\n\treturn getAttribute(undefined, name)?.id;\n};\n\nexport default attributes;\n\nimport {setGlobal} from '@netx/core-next/utils/setGlobal';\n// circular dependency:\n// attribute model (related to some metadata map stuff)\n// attribute collection (related to some metadata map stuff)\n// if (process.env.NODE_ENV !== 'production') {\nsetGlobal({attributes, assetAttributes, clipAttributes});\n//}\n","import _ from 'underscore';\nimport {SYSTEM_ATTRIBUTE_LABELS} from '../locales';\nimport {AttributeTemplate} from '../types';\n\nexport const getLabel = (attr: AttributeTemplate, escape = false) => {\n\tconst label = attr.system\n\t\t? SYSTEM_ATTRIBUTE_LABELS[attr.attributeid] ?? i18n.t(`i18n.${attr.name}`)\n\t\t: attr.name;\n\n\treturn escape ? _.escape(label) : label;\n};\n\nexport default getLabel;\n","import {AttributeType} from '../types';\nimport {TYPE_LABELS} from '../locales';\n\n/**\n * Get attribute template type label from type\n * @param type Attribute template type\n * @return Attribute template type label\n */\nexport const getTypeLabel = (type: AttributeType) =>\n\tTYPE_LABELS[type] || 'unknown';\n\nexport default getTypeLabel;\n","import {ATTRIBUTE_TYPE} from '../constants';\nimport type {AttributeType} from '../types';\n\nexport const getTypeName = (type: AttributeType) => {\n\tswitch (type) {\n\t\tcase ATTRIBUTE_TYPE.DATE:\n\t\t\treturn 'date';\n\t\tcase ATTRIBUTE_TYPE.HIERARCHICAL:\n\t\t\treturn 'hierarchical';\n\t\tcase ATTRIBUTE_TYPE.MULTISELECT:\n\t\t\treturn 'multiselect';\n\t\tcase ATTRIBUTE_TYPE.NUMBER:\n\t\t\treturn 'number';\n\t\tcase ATTRIBUTE_TYPE.SELECT:\n\t\t\treturn 'select';\n\t\tcase ATTRIBUTE_TYPE.SEMANTIC:\n\t\t\treturn 'semantic';\n\t\tcase ATTRIBUTE_TYPE.TAG:\n\t\t\treturn 'tag';\n\t\tcase ATTRIBUTE_TYPE.TAG_VOCAB:\n\t\t\treturn 'tagVocab';\n\t\tcase ATTRIBUTE_TYPE.TEXT:\n\t\t\treturn 'text';\n\t\tcase ATTRIBUTE_TYPE.TEXTAREA:\n\t\t\treturn 'textarea';\n\t}\n};\n\nexport default getTypeName;\n","import {getPublicProperty} from '@netx/core-app-next/utils/getPublicProperty';\nimport {AuthPref} from '../constants';\n\nexport const canRequestPasswordReset = () => {\n\treturn !getPublicProperty(AuthPref.PASSWORD_RESET_DISABLED, true);\n};\n\nexport default canRequestPasswordReset;\n","/**\n * Netx.Collections.CartAssets reflects the assets in a cart on the DAM -- either a saved cart, or\n * the in-memory cart AKA the \"current cart\". It contains a host of RPC methods for manipulating cart\n * contents and for all of the cart-based asset operations on the DAM.\n *\n * Inherts the paging system from Netx.Collections.Assets to fetch cart assets by page or chunk.\n *\n * @class\n * @todo The new cart API is much nicer, and it'd be nice if this object reflected it.\n * I'd rather call 'cart.addAssets' than 'cart.cartAdd', etc. We'd want to create deprecations\n * around the old methods so they still work for now, but use the new methods in the core controlle\n */\nimport Base from '@netx/core-asset/collections/assets';\n\nimport {i18n} from '@netx/core/i18n';\nimport AssetSetModel from '@netx/core-asset/models/assetSet';\nimport {types as assetSetTypes} from '@netx/core-asset/properties/assetSets';\nimport {userInputToExpirationTime} from '@netx/core-asset-expiration/utils';\nimport customConfig from '../config';\nimport {unarchiveTypes} from '../properties/cartAssetArchive';\nimport {allSavedCarts} from '@netx/core-cart/collections/singleton/savedCart';\n\nexport default class CartAssets extends Base {\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tfacetedSearch: 'Loading saved cart assets',\n\t\t\tsearchAssetBeanObjects: 'Loading saved cart assets',\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tfacetedSearch: 'Loaded saved cart assets',\n\t\t\tsearchAssetBeanObjects: 'Loaded saved cart assets',\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this Collection\n\t * @property {method} methods.addAssetsToCart - Add assets to cart\n\t * @property {method} methods.addFacetedSearchToCart - Add faceted search to cart\n\t * @property {method} methods.archiveCartAssets - Archive all assets in cart\n\t * @property {method} methods.createObjectPackage - Create TMS object package\n\t * @property {method} methods.deleteCartAssets - Delete all assets in cart\n\t * @property {method} methods.empty - Empty cart\n\t * @property {method} methods.expireCartAssets - Set all assets in cart to expire\n\t * @property {method} methods.fetchAll - Fetch all assets\n\t * @property {method} methods.inspect - Inspect cart contents\n\t * @property {method} methods.removeAssetsFromCart - Remove assets from cart\n\t * @property {method} methods.setAssetsInCart - Set assets in cart\n\t * @property {method} methods.unarchiveCartAssets - Unarchive all assets in cart\n\t */\n\tget methods() {\n\t\treturn _.extend(super.methods, {\n\t\t\t/**\n\t\t\t * Add assets to cart\n\t\t\t * @method\n\t\t\t * @param {array} assets Assets/asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\taddAssetsToCart(assets, opts) {\n\t\t\t\treturn ['addAssetsToCart', this.id, _.tidyAssetList(assets)];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Add faceted search to cart\n\t\t\t * @method\n\t\t\t * @param {module:search/collections/searchRules} selection Selection\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\taddFacetedSearchToCart(selection, opts) {\n\t\t\t\tif (!selection) {\n\t\t\t\t\tthrow new Error('No search selection!');\n\t\t\t\t}\n\n\t\t\t\tvar search = selection.createSearchObject();\n\t\t\t\treturn [\n\t\t\t\t\t'addFacetedSearchToCart',\n\t\t\t\t\tthis.id,\n\t\t\t\t\tsearch.sortField,\n\t\t\t\t\tsearch.sortOrder,\n\t\t\t\t\tsearch.matchCriteria,\n\t\t\t\t\tsearch.elementTypes,\n\t\t\t\t\tsearch.elementSubType1s,\n\t\t\t\t\tsearch.elementSubType2s,\n\t\t\t\t\tsearch.elementValue1s,\n\t\t\t\t\tsearch.elementValue2s,\n\t\t\t\t\tsearch.elementValue3s,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\tselection.searchFacets.selectedValues(),\n\t\t\t\t\tselection.searchFacets.filterMode,\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Archive cart assets\n\t\t\t * @method\n\t\t\t */\n\t\t\tarchiveCartAssets: ['archiveCartAssets', 'id', 'archiveArgs.locationId'],\n\t\t\t/**\n\t\t\t * TMS\n\t\t\t * @method\n\t\t\t */\n\t\t\tcreateObjectPackage: ['createObjectPackage', 'id'],\n\t\t\t/**\n\t\t\t * Delete all assets in cart\n\t\t\t * @method\n\t\t\t */\n\t\t\tdeleteCartAssets: ['deleteCartAssets', 'id'],\n\t\t\t/**\n\t\t\t * Empty cart\n\t\t\t * @method\n\t\t\t */\n\t\t\tempty: ['setAssetsInCart', 'id', []],\n\t\t\t/**\n\t\t\t * Delete all assets in cart\n\t\t\t * @method\n\t\t\t */\n\t\t\texpireCartAssets: ['expireCartAssets', 'id', 'expirationArgs.date'],\n\t\t\t/**\n\t\t\t * Fetch all assets\n\t\t\t * Usefull for our pull until (chekcing to see if an asset is still present)\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchAll(opts) {\n\t\t\t\tvar search = this.selection.createSearchObject();\n\t\t\t\treturn [\n\t\t\t\t\t'searchAssetObjects',\n\t\t\t\t\tsearch.sortField,\n\t\t\t\t\tsearch.sortOrder,\n\t\t\t\t\tsearch.matchCriteria,\n\t\t\t\t\tsearch.elementTypes,\n\t\t\t\t\tsearch.elementSubType1s,\n\t\t\t\t\tsearch.elementSubType2s,\n\t\t\t\t\tsearch.elementValue1s,\n\t\t\t\t\tsearch.elementValue2s,\n\t\t\t\t\tsearch.elementValue3s,\n\t\t\t\t\tsearch.saveSearch,\n\t\t\t\t\tsearch.notifyType,\n\t\t\t\t\tsearch.ignoreStat,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Inspects cart assets for repupose\n\t\t\t * @method\n\t\t\t */\n\t\t\tinspect: ['inspectCartContents', 'id'],\n\t\t\t/**\n\t\t\t * Remove assets from cart\n\t\t\t * @method\n\t\t\t * @param {array} assets Assets/asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tremoveAssetsFromCart(assets, opts) {\n\t\t\t\treturn ['removeAssetsFromCart', this.id, _.tidyAssetList(assets)];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Set assets in cart\n\t\t\t * @method\n\t\t\t * @param {array} assets Assets/asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetAssetsInCart(assets, opts) {\n\t\t\t\treturn ['setAssetsInCart', this.id, _.tidyAssetList(assets)];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Unarchive cart assets\n\t\t\t * @method\n\t\t\t */\n\t\t\tunarchiveCartAssets: [\n\t\t\t\t'unarchiveCartAssets',\n\t\t\t\t'id',\n\t\t\t\t'unarchiveArgs.type',\n\t\t\t\t'unarchiveArgs.email',\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * @property {object} parsers - Parsers for this collection\n\t * @property {function} parsers.addAssetsToCart - Added assets to cart\n\t * @property {function} parsers.addFacetedSearch - Added assets to cart based on faceted search\n\t * @property {function} parsers.addSearch - Added assets to cart based on search\n\t * @property {function} parsers.empty - Emptied cart\n\t * @property {function} parsers.inspect - Inspected cart assets\n\t * @property {function} parsers.repurpose - Repurposed assets with preset\n\t * @property {function} parsers.removeAssetsFromCart - Removed assets from cart\n\t */\n\tget parsers() {\n\t\treturn _.extend(super.parsers, {\n\t\t\t/**\n\t\t\t * Added assets to cart\n\t\t\t * @function\n\t\t\t * @param {number} count Cart asset count\n\t\t\t * @param {array} assets Assets/asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\taddAssetsToCart(count, assets, opts) {\n\t\t\t\tassets = _.tidyAssetList(assets);\n\t\t\t\t// TODO: it'd be nice to get the calling arguments included in the complete: event & not have to do this:\n\t\t\t\tthis.listenToOnce(this, 'complete:addAssetsToCart', () => {\n\t\t\t\t\tdispatcher.trigger('cart:added', assets);\n\t\t\t\t\tthis.trigger('added', assets);\n\t\t\t\t});\n\n\t\t\t\tthis.cartResultParser(count);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Added assets to cart based on facetedsearch\n\t\t\t * @function\n\t\t\t * @param {number} count Cart asset count\n\t\t\t * @param {module:search/collections/searchRules} selection Selection\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\taddFacetedSearchToCart(count, selection, opts) {\n\t\t\t\tthis.cartResultParser(count);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Emptied cart\n\t\t\t * @function\n\t\t\t * @param {number} count Cart asset count\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tempty(count, opts) {\n\t\t\t\tthis.reset(); // clear out the collection\n\t\t\t\tthis.pager.clearPages();\n\t\t\t\tthis.trigger('emptied');\n\t\t\t\tdispatcher.trigger('cart:cleared', this);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Inspected cart assets\n\t\t\t * @function\n\t\t\t * @param {object} data Inspection data\n\t\t\t * @param {object} opts Request options\n\t\t\t * @example\n\t\t\t * {\n\t\t\t * \"imageCount\":2,\n\t\t\t * \"videoCount\":0,\n\t\t\t * \"audioCount\":0,\n\t\t\t * \"documentCount\":0,\n\t\t\t * \"otherAssetCount\":0,\n\t\t\t * \"downloadApprovalRequired\":false,\n\t\t\t * \"videoAssetIds\":[],\n\t\t\t * \"imageAssetIds\":[3,6],\n\t\t\t * \"audioAssetIds\":[],\n\t\t\t * \"documentAssetIds\":null,\n\t\t\t * \"otherAssetIds\":[],\n\t\t\t * \"cartItemBreachesImageDownloadThreshold\":false,\n\t\t\t * \"cartItemBreachesVideoDownloadThreshold\":false\n\t\t\t * }\n\t\t\t */\n\t\t\tinspect(data, opts) {\n\t\t\t\tthis.inspection = data;\n\t\t\t},\n\t\t\t/**\n\t\t\t * Removed assets from cart\n\t\t\t * @function\n\t\t\t * @param {number} count Cart asset count\n\t\t\t * @param {array} assets Assets/asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tremoveAssetsFromCart(count, assets, opts) {\n\t\t\t\t!this.id && this.cartResultParser(count);\n\t\t\t},\n\t\t});\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * The cart ID; set to 0 to fetch from the current cart.\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.id = 0;\n\n\t\tif (opts.cartId) {\n\t\t\tconsole.warn(\n\t\t\t\t'`cartId` is deprecated on the `CartAssets` collections. Use the `id` by version 9.1',\n\t\t\t);\n\t\t\topts.id = opts.cartId;\n\t\t}\n\n\t\tif (opts.id) {\n\t\t\tthis.setCartId(opts.id || opts.cartId);\n\t\t}\n\n\t\t/**\n\t\t * @memberof Netx.Collections.CartAssets\n\t\t * @property {object} archiveArgs - Arguments to the archive cart assets method\n\t\t * @property {number} archiveArgs.locationId - Archive location id\n\t\t * @default\n\t\t */\n\t\tthis.archiveArgs = _.extend(\n\t\t\t{\n\t\t\t\tlocationId: 0,\n\t\t\t},\n\t\t\topts.archiveArgs,\n\t\t);\n\n\t\t/**\n\t\t * Target of various batch task methods -- a list of asset IDs, or an empty array to specify the current cart contents.\n\t\t * @memberof Netx.Collections.CartAssets\n\t\t * @type {array}\n\t\t */\n\t\tthis.batch = [];\n\n\t\t/**\n\t\t * @memberof Netx.Collections.CartAssets\n\t\t * @property {object} expirationArgs - Arguments to the expire cart assets method\n\t\t * @property {number} expirationArgs.date - Expiration date to set (in milliseconds)\n\t\t */\n\t\tthis.expirationArgs = _.extend(\n\t\t\t{\n\t\t\t\tdate: 0,\n\t\t\t},\n\t\t\topts.expirationArgs,\n\t\t);\n\n\t\t/**\n\t\t * attributes returned by inspectCartContents()\n\t\t * @memberof Netx.Collections.CartAssets\n\t\t * @type {object}\n\t\t */\n\t\tthis.inspection = _.extend({}, opts.inspection);\n\n\t\t/**\n\t\t * Route of last cart dislplayed\n\t\t * @type {string}\n\t\t */\n\t\tthis.lastCartRoute = opts.lastCartRoute;\n\n\t\t/**\n\t\t * number of items in the cart, as reported by DAM\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.total = opts.total || 0;\n\n\t\t/**\n\t\t * @memberof Netx.Collections.CartAssets\n\t\t * @property {object} unarchiveArgs - Arguments to the unarchive cart assets method\n\t\t * @property {number} unarchiveArgs.unarchiveType - Type of unarchive ( 1 = temporary, 2 = permanently )\n\t\t * @property {string} unarchiveArgs.email - Email address to notify on unarchive complete\n\t\t * @default\n\t\t */\n\t\tthis.unarchiveArgs = _.extend(\n\t\t\t{\n\t\t\t\ttype: 1,\n\t\t\t\temail: '',\n\t\t\t},\n\t\t\topts.unarchiveArgs,\n\t\t);\n\n\t\t// Set selection to cart/cartId\n\t\tthis.selection.at(0).set({\n\t\t\telementType: 10, // cart search\n\t\t\telementValue1: this.id, // cart id (0 for current)\n\t\t});\n\t\t// Set max items (this already happens in Netx.Collections.Assets - necessary to do here again?)\n\t\tthis.selection.maxItems = customConfig.CHUNK_SIZE + 1;\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(this, 'add', this.addAsset)\n\t\t\t// Don't consider a cart sync to be a user selection - I do not see cacheSelection in any code - remove soon? 2015-09-25\n\t\t\t// nk - also this was stopping the super collection sync listener which calls calculatePaging\n\t\t\t// this.stopListening( this, 'sync', this.cacheSelection );\n\t\t\t// always count the cart after a sync\n\t\t\t.listenTo(this, 'sync', this.assetCount)\n\t\t\t.listenTo(\n\t\t\t\tdispatcher,\n\t\t\t\t'cart:saved:collect:success cart:saved:add:assets:success',\n\t\t\t\t(savedCarts) => {\n\t\t\t\t\tsavedCarts.get(this.id) && this.fetch();\n\t\t\t\t},\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tdispatcher,\n\t\t\t\t[\n\t\t\t\t\t'cart:saved:assets:unexpire:succeeded',\n\t\t\t\t\t'cart:saved:assets:expire:succeeded',\n\t\t\t\t].join(' '),\n\t\t\t\t(savedCart) => {\n\t\t\t\t\tthis.id === this.model.id && this.fetch();\n\t\t\t\t},\n\t\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} locationId Archive location id\n\t * @param {object} opts Request options\n\t */\n\tarchive(locationId, opts) {\n\t\tlocationId = parseInt(locationId);\n\n\t\tif (isNaN(locationId) || !Netx.app.storageLocations.get(locationId)) {\n\t\t\treturn new $.Deferred().reject(\n\t\t\t\tnew Error(i18n.t('i18n.invalidArchiveLocation')),\n\t\t\t);\n\t\t}\n\n\t\tthis.archiveArgs.locationId = locationId;\n\t\treturn this.archiveCartAssets(opts);\n\t}\n\n\t/**\n\t * Generic handler for cart methods' success\n\t * @method\n\t * @param {number} count Cart asset count\n\t * @todo Check parameter documentation\n\t */\n\tcartResultParser(count) {\n\t\t// update our asset count\n\t\tthis.setAssetCount(count);\n\t\t// re-get our list of cart assets from the DAM, now that the search results have been added there.\n\t\treturn this.fetch();\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} dateStr Date (yyyy-mm-dd)\n\t */\n\tasync expireAssets(dateStr) {\n\t\ttry {\n\t\t\tconst expirationTime = userInputToExpirationTime(dateStr);\n\t\t\tthis.expirationArgs.date = expirationTime;\n\t\t\tconst uuid = await this.expireCartAssets();\n\t\t\treturn [uuid, expirationTime];\n\t\t} catch (ex) {\n\t\t\treturn new $.Deferred().reject(ex);\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} page\n\t * set page and context for selection, then fetch\n\t */\n\tfetchCurrentCart(page, opts) {\n\t\tthis.curPage = page ? page : 1;\n\t\tthis.routeContext = 'cart';\n\t\treturn this.fetch(opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} id\n\t * @param {number} page\n\t * set page and context for savedCart, then fetch\n\t */\n\tfetchSavedCart(id, page, opts) {\n\t\treturn allSavedCarts.getCart(id).then((savedCart) => {\n\t\t\tthis.savedCart = savedCart;\n\t\t\tthis.setCartId(id, page);\n\t\t\treturn this.fetch(opts);\n\t\t});\n\t}\n\n\t/**\n\t * Try to find the saved cart model for our ID\n\t * @method\n\t * @todo this will need to be addressed when we get into paging\n\t */\n\tfindCartModel() {\n\t\treturn allSavedCarts.get(this.id);\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolen}\n\t */\n\tisSortable() {\n\t\t// Cannot sort on cart or custom search types currently\n\t\tconst customSearchType = this.selection.findWhere({elementType: 9});\n\t\treturn _.isUndefined(customSearchType);\n\t}\n\n\t/**\n\t * We are only allow one poll at a time per instance\n\t * @method\n\t * @param {array} assetsList An array of asset ids\n\t */\n\tpollRemoveAssets(assetsList) {\n\t\tconst d = new $.Deferred();\n\n\t\tconst checkPolling = () => {\n\t\t\t// Already polling\n\t\t\tif (this._polling) {\n\t\t\t\t// Wait for poll to complete and try again\n\t\t\t\tthis._polling.promise().then(() => {\n\t\t\t\t\t// Otherwise a loop will ensue\n\t\t\t\t\t// this._polling will still be defined and so the method will just return the polling promise\n\t\t\t\t\t// which immediately is resolved - which would trigger this again - repeat... forever.\n\t\t\t\t\t_.defer(() => {\n\t\t\t\t\t\tcheckPolling();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\t// Ready to poll\n\t\t\telse {\n\t\t\t\tlet assetIds = [];\n\t\t\t\tthis.pollUntil(\n\t\t\t\t\t(assets) => {\n\t\t\t\t\t\tif (!_.isUndefined(assets)) {\n\t\t\t\t\t\t\tassetIds = _.pluck(assets, 'assetId');\n\t\t\t\t\t\t\treturn !_.intersection(assetIds, assetsList).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t\t'cart:saved:removing:assets',\n\t\t\t\t\tthis.fetchAll,\n\t\t\t\t\t500,\n\t\t\t\t\t{silent: true},\n\t\t\t\t).then(() => {\n\t\t\t\t\treturn d.resolve(assetIds);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\tcheckPolling();\n\n\t\treturn d.promise();\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} assets Array of asset models\n\t * @fires modules:cart#cart:saved:removing:assets\n\t * @fires modules:cart#cart:removed\n\t */\n\t// TODO: document or fix: why do we poll after removeAssetsFromCart, but not after addAssetsToCart ?\n\t// TODO: refactor/unwrap removeAssets, matching how we did it for addAssets.\n\tremoveAssets(assets, opts = {}) {\n\t\tconst assetsList = _.tidyAssetList(assets);\n\t\tconst count = this.assetCount();\n\n\t\treturn this.removeAssetsFromCart(assetsList, opts).then(() => {\n\t\t\t// Let the world know\n\t\t\tdispatcher.trigger('cart:saved:removing:assets', assetsList, this.id);\n\t\t\treturn this.pollRemoveAssets(assetsList).then((assetIds) => {\n\t\t\t\t// Remove from collection\n\t\t\t\tthis.remove(assetsList);\n\t\t\t\tdispatcher.trigger('cart:removed', assetsList, this.id);\n\n\t\t\t\tthis.trigger('sync', this, [], opts).setAssetCount(assetIds.length);\n\n\t\t\t\treturn assetsList;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} count Count\n\t */\n\tsetAssetCount(count) {\n\t\t// triggers 'counted'\n\t\tthis.pager.set({itemTotal: parseInt(count)});\n\t\t// We kind of painted ourselves into a corner here\n\t\t// our actions react to sync events to test enablers\n\t\t// we want the cart to reflect the selection immediately\n\t\t// upon add/remove from cart - so, a fake sync here.\n\t\tthis.trigger('sync', this, [], {});\n\n\t\treturn this.pager;\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} assets Array of assets\n\t * @fires module:cart#cart:wasSet\n\t */\n\tsetAssets(assets) {\n\t\tconst assetsList = _.tidyAssetList(assets);\n\t\treturn this.setAssetsInCart(assetsList).then(() => {\n\t\t\tdispatcher.trigger('cart:wasSet', assetsList);\n\t\t\tthis.trigger('wasSet', assetsList);\n\t\t});\n\t}\n\n\t/**\n\t * Set the cart id and page\n\t * @param {number} id SavedCart id\n\t * @param {number} page\n\t */\n\tsetCartId(id, page) {\n\t\tconst selection = this.selection;\n\t\tthis.curPage = page;\n\t\tthis.routeContext = 'cart-assets/' + id;\n\t\tid = parseInt(id);\n\t\t// triggers 'countUnknown'\n\t\tselection.at(0).set({elementValue1: id});\n\n\t\t// reset facets\n\t\tif (selection.searchFacets && id != this.id) {\n\t\t\tselection.searchFacets.reset();\n\t\t}\n\n\t\tthis.id = id;\n\t\tthis.batch = id === 0 ? [] : [id];\n\t}\n\n\t/**\n\t * return an assetSet model defining the set of this cart's assets\n\t * @method\n\t * @return {module:asset/models/assetSet} AssetSet model\n\t */\n\ttoAssetSet() {\n\t\t// TODO: this will need to be addressed when we get into paging\n\t\tconst model = this.findCartModel();\n\t\treturn new AssetSetModel({\n\t\t\ttype: assetSetTypes.savedCart,\n\t\t\tids: [this.id],\n\t\t\tmodels: model ? [model] : undefined,\n\t\t\tlabel: model ? model.get('title') : i18n.t('i18n.cartAssets'),\n\t\t});\n\t}\n\n\t/**\n\t * Unarchive all assets\n\t * @method\n\t * @param {number} type Unarchive type\n\t * @param {string} email Email to notify on completion\n\t */\n\tunarchive(type, email) {\n\t\ttype = parseInt(type);\n\n\t\tif (isNaN(type) || unarchiveTypes[type] == null) {\n\t\t\treturn new $.Deferred().reject(\n\t\t\t\tnew Error(i18n.t('i18n.invalidUnarchiveType')),\n\t\t\t);\n\t\t}\n\n\t\t_.extend(this.unarchiveArgs, {\n\t\t\temail: email,\n\t\t\ttype: type,\n\t\t});\n\t\treturn this.unarchiveCartAssets();\n\t}\n\n\t/**\n\t * Unset all asset expiration\n\t * @method\n\t */\n\tasync unexpireAssets() {\n\t\tthis.expirationArgs.date = 0;\n\t\tconst uuid = await this.expireCartAssets();\n\t\treturn [uuid, 0];\n\t}\n\n\t/**\n\t * Instantiate a cartAssets collection with a page of cart assets from a specified cart:\n\t * @method\n\t * @param {number} id Cart id\n\t */\n\tstatic Load(id) {\n\t\tconst instance = new this([], {id: id});\n\t\treturn instance.fetch().then(() => {\n\t\t\treturn this;\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'CartAssets';\n\t}\n}\n","/**\n * Reflects the records for saved carts in the DAM.\n * @class\n */\nimport Base from '@netx/core-share/collections/sharedResources';\nimport Model from '../models/savedCart';\n\nimport AssetSetModel from '@netx/core-asset/models/assetSet';\nimport {types as assetSetTypes} from '@netx/core-asset/properties/assetSets';\n\nexport default class SavedCarts extends Base {\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tgetSharedResources() {\n\t\t\t\treturn this.isFiltered()\n\t\t\t\t\t? 'Filtering saved carts'\n\t\t\t\t\t: 'Loading saved carts';\n\t\t\t},\n\t\t\tgetAllCarts: 'Loading saved carts',\n\t\t\tgetUserCarts: 'Loading saved carts',\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tgetSharedResources() {\n\t\t\t\treturn this.isFiltered()\n\t\t\t\t\t? 'Filtered saved carts'\n\t\t\t\t\t: 'Loaded saved carts';\n\t\t\t},\n\t\t\tgetAllCarts: 'Loaded saved carts',\n\t\t\tgetUserCarts: 'Loaded saved carts',\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this collection\n\t * @property {method} methods.fetchBeans - Fetch saved cart beans\n\t * @property {method} methods.fetchBeansForUser - Fetch saved cart beans for user\n\t */\n\tget methods() {\n\t\treturn _.extend(super.methods, {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBeans(opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'getAllCarts',\n\t\t\t\t\tthis.modeFilters,\n\t\t\t\t\tthis.filterStr,\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {number} userId User id\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBeansForUser(userId, opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'getUserCarts',\n\t\t\t\t\tuserId,\n\t\t\t\t\tthis.modeFilters,\n\t\t\t\t\tthis.filterStr,\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t];\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @property {object} parsers - Parsers for this collection\n\t * @property {method} parsers.fetchBeans - Parse response of saved cart beans\n\t * @property {method} parsers.fetchBeansForUser - Parse response of saved cart beans\n\t */\n\tget parsers() {\n\t\treturn _.extend(super.parsers, {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Saved carts\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBeans(data, opts = {}) {\n\t\t\t\tthis.set(data, _.extend({merge: true}, opts));\n\t\t\t\t!opts.silent && this.trigger('sync', this, data, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Saved carts\n\t\t\t * @param {number} userId User id\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBeansForUser(data, userId, opts = {}) {\n\t\t\t\tthis.set(data, opts);\n\t\t\t\t!opts.silent && this.trigger('sync', this, data, opts);\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @override\n\t * @listens module:cart#cart:saved:delete:success\n\t * @listens module:cart#cart:save:current:success\n\t */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\topts.resourceName = 'savedCart';\n\n\t\tsuper(models, opts);\n\n\t\t// Set name filter if provided\n\t\tthis.filterStr = opts.filterStr || this.filterStr;\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(dispatcher, 'cart:saved:delete:success', (savedCart) => {\n\t\t\tconst model = this.get(savedCart.id);\n\t\t\tmodel && this.remove(model);\n\t\t}).listenTo(dispatcher, 'cart:save:current:success', (savedCart) => {\n\t\t\tthis.matchesFilters(savedCart) && this.unshift(savedCart.attributes);\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} ids Saved cart ids\n\t * @param {array} assetIds Asset ids\n\t * @return {Promise -> Netx.Collections.SavedCarts}\n\t */\n\taddAssets(ids, assetIds = []) {\n\t\t// Get all carts involved\n\t\treturn this.getCarts(ids || []).then((savedCarts) => {\n\t\t\t// Add current cart assets and store the promises\n\t\t\tconst addAssets = savedCarts.map((savedCart) =>\n\t\t\t\tsavedCart.addAssetsToCart(assetIds),\n\t\t\t);\n\t\t\t// Wait for everything to finish\n\t\t\treturn $.when.apply($, addAssets).then(() => {\n\t\t\t\treturn savedCarts;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} ids Saved cart ids to update\n\t * @return {Promise -> Netx.Collections.SavedCarts}\n\t */\n\taddCurrentCart(ids) {\n\t\tif (!ids || !ids.length) return new $.Deferred().resolve([]);\n\t\t// Get all carts involved\n\t\treturn this.getCarts(ids || []).then((savedCarts) => {\n\t\t\t// Add current cart assets and store the promises\n\t\t\tconst addAssets = savedCarts.map((savedCart) =>\n\t\t\t\tsavedCart.addCurrentCart(),\n\t\t\t);\n\t\t\t// Wait for everything to finish\n\t\t\treturn Promise.all(addAssets).then(() => {\n\t\t\t\treturn savedCarts;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} ids Saved cart ids\n\t * @param {Netx.Collections.SearchRules} search Search rules\n\t * @return {Promise -> Netx.Collections.SavedCarts}\n\t */\n\taddSearch(ids, search) {\n\t\t// Get all carts involved\n\t\treturn this.getCarts(ids || []).then((savedCarts) => {\n\t\t\t// Add current cart assets and store the promises\n\t\t\tconst addAssets = savedCarts.map((savedCart) =>\n\t\t\t\tsavedCart.addFacetedSearchToCart(search),\n\t\t\t);\n\t\t\t// Wait for everything to finish\n\t\t\treturn $.when.apply($, addAssets).then(() => {\n\t\t\t\treturn savedCarts;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} carts An array of cart objects `{title: }`\n\t * @param {object} opts Options\n\t */\n\tcreateNewCarts(carts, opts = {}) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif (!carts) resolve([]);\n\n\t\t\tconst newCarts = [];\n\t\t\t// Save each cart after the other has completed to avoid data locks on the server\n\t\t\tconst next = () => {\n\t\t\t\tif (!carts.length) return resolve(newCarts);\n\n\t\t\t\tconst cart = new Model(carts.shift());\n\t\t\t\tcart.save(opts).then(() => {\n\t\t\t\t\tnewCarts.push(cart);\n\t\t\t\t\tnext();\n\t\t\t\t}, reject);\n\t\t\t};\n\n\t\t\tnext();\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} id Cart id\n\t * @return {module:cart/models/savedCart}\n\t */\n\tgetCart(id) {\n\t\tlet savedCart = this.get(id);\n\t\tif (savedCart) {\n\t\t\treturn new $.Deferred().resolve(savedCart);\n\t\t}\n\n\t\treturn new Model({\n\t\t\t[Model.prototype.idAttribute || 'id']: id,\n\t\t})\n\t\t\t.fetch()\n\t\t\t.then(() => {\n\t\t\t\treturn savedCart;\n\t\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} ids Cart ids\n\t * @return {Netx.Collections.SavedCarts}\n\t */\n\tgetCarts(ids) {\n\t\t// Get cart data for any cartIds passed\n\t\tconst carts = _.compact(\n\t\t\t_.map(ids, (id) => (id && this.getCart(id)) || null),\n\t\t);\n\t\t// Wait for all cart models to be available\n\t\treturn $.when.apply($, carts).then((...carts) => {\n\t\t\treturn new this.constructor([...carts]);\n\t\t});\n\t}\n\n\t/**\n\t * Get all carts that current user can edit\n\t * @method\n\t * @return {Netx.Collections.SavedCarts}\n\t * @todo this will not work once we have paging enforced - this will need to fetch and return a promise\n\t * but the actions need to be reworked to allow for promises in enable tests\n\t */\n\tgetEditableCarts() {\n\t\treturn new this.constructor(this.filter((cart) => cart.canEdit()));\n\t}\n\n\t/**\n\t * Check if we have any carts the current user can edit\n\t * @method\n\t */\n\thasEditableCarts() {\n\t\treturn this.getEditableCarts().length > 0;\n\t}\n\n\t/**\n\t * @method\n\t * @return {module:asset/models/assetSet} AssetSet\n\t */\n\ttoAssetSet() {\n\t\treturn new AssetSetModel({\n\t\t\ttype: assetSetTypes.cart,\n\t\t\tids: this.ids(),\n\t\t\tlabel: i18n.t('i18n.savedCart'),\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SavedCarts';\n\t}\n}\n","import SavedCartsCollection from '../savedCarts';\n\nexport const allSavedCarts = new SavedCartsCollection([], {\n\tpager: {pageSize: 0x7fffffff},\n});\n\nexport const favoriteSavedCarts = new SavedCartsCollection([], {\n\tpager: {pageSize: 0x7fffffff, pagesToDisplay: 0},\n\tmodeFilters: ['favorites'],\n});\n\nallSavedCarts\n\t.on(\n\t\t'add',\n\t\t(model) => model.isFavorite() && favoriteSavedCarts.add(model.attributes),\n\t)\n\t.on('destroy', (model) => favoriteSavedCarts.remove(model.id));\n\nexport default {allSavedCarts, favoriteSavedCarts};\n","/**\n * Saved cart model holds data regarding a saved cart instance\n * Saved carts are part of the shared resource system\n * `fetch` will get you the shared resource bean for the saved cart\n * `fetchBean` will get you the actual saved cart bean\n * @class\n */\n\nimport Base from '@netx/core-share/models/sharedResource';\n\nimport AssetSetModel from '@netx/core-asset/models/assetSet';\nimport CartAssetsCollection from '../collections/cartAssets';\nimport AssetSearchRulesCollection from '@netx/core-search/collections/searchRules_assets';\n\nimport {types as assetSetTypes} from '@netx/core-asset/properties/assetSets';\nimport {URL} from '@netx/core-next/url';\nimport customConfig from '../config';\n\nexport default class SavedCart extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this model\n\t * @property {method} methods.create - Save new cart\n\t * @property {method} methods.read - Fetch saved cart\n\t * @property {method} methods.remove - Destroy saved cart\n\t * @property {method} methods.update - Update saved cart\n\t *\n\t * @property {method} methods.addAssetsToCart - Add assets to saved cart\n\t * @property {method} methods.addFacetedSearchToCart- Add search to saved cart\n\t * @property {method} methods.archiveCartAssets - Archive assets in saved cart\n\t * @property {method} methods.download - Download cart assets\n\t * @property {method} methods.duplicateCart - Duplicate saved cart\n\t * @property {method} methods.expireCartAssets - Set expiration for assets in saved cart\n\t * @property {method} methods.fetchBean - Fetch saved search bean (fetch gets the shared resource)\n\t * @property {method} methods.inspect - Inspect saved cart contents\n\t * @property {method} methods.removeAssetsFromCart - Remove assets from saved cart\n\t * @property {method} methods.setCart - Set cart data\n\t * @property {method} methods.unarchiveCartAssets - Unarchive assets in saved cart\n\t */\n\tget methods() {\n\t\treturn _.extend(super.methods, {\n\t\t\t/**\n\t\t\t * Create saved cart\n\t\t\t * @method\n\t\t\t * @private\n\t\t\t */\n\t\t\tcreate(opts) {\n\t\t\t\t// TODO: Need the DAM to return full beans on creation\n\t\t\t\t// in this case (all shared resource cases) it would be the shared resource and not the underlying cart bean itself\n\t\t\t\treturn this.setCart().then((id) => {\n\t\t\t\t\tthis.set({id: id}, opts);\n\t\t\t\t\treturn this.fetch(opts);\n\t\t\t\t});\n\t\t\t},\n\t\t\t/**\n\t\t\t * Destroy saved cart\n\t\t\t * @method\n\t\t\t */\n\t\t\tremove: ['deleteCart', 'id'],\n\t\t\t/**\n\t\t\t * Update saved cart\n\t\t\t * @method\n\t\t\t */\n\t\t\tupdate: ['setCart', 'id', 'title'],\n\n\t\t\t/**\n\t\t\t * Add assets to saved cart\n\t\t\t * @method\n\t\t\t * @param {array} assets Asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\taddAssetsToCart(assets, opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'addAssetsToCart',\n\t\t\t\t\tthis.id,\n\t\t\t\t\t_.tidyAssetList.apply(this, [assets]),\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Add faceted search to cart\n\t\t\t * @method\n\t\t\t */\n\t\t\taddFacetedSearchToCart(selection, opts) {\n\t\t\t\tif (!selection) {\n\t\t\t\t\tthrow new Error('No search selection!');\n\t\t\t\t}\n\n\t\t\t\tconst search = selection.createSearchObject();\n\t\t\t\treturn [\n\t\t\t\t\t'addFacetedSearchToCart',\n\t\t\t\t\tthis.id,\n\t\t\t\t\tsearch.sortField,\n\t\t\t\t\tsearch.sortOrder,\n\t\t\t\t\tsearch.matchCriteria,\n\t\t\t\t\tsearch.elementTypes,\n\t\t\t\t\tsearch.elementSubType1s,\n\t\t\t\t\tsearch.elementSubType2s,\n\t\t\t\t\tsearch.elementValue1s,\n\t\t\t\t\tsearch.elementValue2s,\n\t\t\t\t\tsearch.elementValue3s,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\tselection.searchFacets.selectedValues(),\n\t\t\t\t\tselection.searchFacets.filterMode,\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Archive cart assets\n\t\t\t * @method\n\t\t\t */\n\t\t\tarchiveCartAssets: ['archiveCartAssets', 'id', 'archiveArgs.locationId'],\n\t\t\t/**\n\t\t\t * Download cart assets\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tdownload(opts) {\n\t\t\t\treturn ['downloadAssetsFromSavedCart', this.id, true];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Duplicate saved cart\n\t\t\t * @method\n\t\t\t * @param {string} cartName Saved cart name\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tduplicateCart(cartName, opts) {\n\t\t\t\treturn ['duplicateCart', cartName, this.id];\n\t\t\t},\n\t\t\t/**\n\t\t\t * This works for both expiring and unexpiring\n\t\t\t * Unexpireing just means setting 0 on expirationDate\n\t\t\t * @method\n\t\t\t */\n\t\t\texpireCartAssets: ['expireCartAssets', 'id', 'expirationArgs.date'],\n\t\t\t/**\n\t\t\t * Fetch saved cart\n\t\t\t * @method\n\t\t\t */\n\t\t\tfetchBean: ['getCart', 'id'],\n\t\t\t/**\n\t\t\t * Report on the contents of this cart.\n\t\t\t * @method\n\t\t\t */\n\t\t\tinspect: ['inspectCartContents', 'id'],\n\t\t\t/**\n\t\t\t * Remove assets from saved cart\n\t\t\t * @method\n\t\t\t * @param {array} assets Asset ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tremoveAssetsFromCart(assets, opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'removeAssetsFromCart',\n\t\t\t\t\tthis.id,\n\t\t\t\t\t_.tidyAssetList.apply(this, arguments),\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Set cart data\n\t\t\t * @method\n\t\t\t */\n\t\t\tsetCart: ['setCart', 0, 'title'],\n\t\t\t/**\n\t\t\t * Unarchive cart assets\n\t\t\t * @method\n\t\t\t */\n\t\t\tunarchiveCartAssets: [\n\t\t\t\t'unarchiveCartAssets',\n\t\t\t\t'id',\n\t\t\t\t'unarchiveArgs.type',\n\t\t\t\t'unarchiveArgs.email',\n\t\t\t],\n\t\t});\n\t}\n\n\t/**\n\t * @property {object} parsers - Parsers for this model\n\t * @property {method} parsers.addAssetsToCart - Add assets to saved cart\n\t * @property {method} parsers.addFacetedSearchToCart - Add search to saved cart\n\t * @property {method} parsers.fetchBean - Parse response of fetch saved cart bean\n\t * @property {method} parsers.removeAssetsFromCart - Remove assets from saved cart\n\t * @property {method} parsers.setAssetsInCart - Replace contents of saved cart\n\t */\n\tget parsers() {\n\t\treturn _.extend(super.parsers, {\n\t\t\t/**\n\t\t\t * Add assets to saved cart\n\t\t\t * @method\n\t\t\t * @param {number} newCount Saved cart's asset count\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\taddAssetsToCart(newCount, opts) {\n\t\t\t\tthis.set({contentCount: newCount}, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Add search to saved cart\n\t\t\t * @method\n\t\t\t * @param {number} newCount Saved cart's asset count\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\taddFacetedSearchToCart(newCount, opts) {\n\t\t\t\tthis.set({contentCount: newCount}, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * Remove assets from saved cart\n\t\t\t * @method\n\t\t\t * @param {number} newCount Saved cart's asset count\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tremoveAssetsFromCart(newCount, opts) {\n\t\t\t\tthis.set({contentCount: newCount}, opts);\n\t\t\t},\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tget sharedResourceRoute() {\n\t\treturn `cart-assets/${this.id}`;\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attr Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\t/**\n\t\t * Resource type name\n\t\t * @type {string}\n\t\t */\n\t\topts.resourceName = 'savedCart';\n\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * @memberof module:cart/models/savedCart\n\t\t * @alias archiveArgs\n\t\t * @property {object} archiveArgs - Arguments to the archive cart assets method\n\t\t * @property {number} archiveArgs.locationId - Archive location id\n\t\t */\n\t\tthis.archiveArgs = _.extend(\n\t\t\t{\n\t\t\t\tlocationId: 0,\n\t\t\t},\n\t\t\topts.archiveArgs,\n\t\t);\n\n\t\t/**\n\t\t * For adding/removing assets\n\t\t * Array of asset Ids\n\t\t * @memberof module:cart/models/savedCart\n\t\t * @alias assetArg\n\t\t * @type {array}\n\t\t */\n\t\tthis.assetsArg = opts.assetsArg || [];\n\n\t\t/**\n\t\t * @memberof module:cart/models/savedCart\n\t\t * @alias expirationArgs\n\t\t * @property {object} expirationArgs - Arguments to the expire cart assets method\n\t\t * @property {array} expirationArgs.date - Expiration date to set\n\t\t */\n\t\tthis.expirationArgs = _.extend(\n\t\t\t{\n\t\t\t\tdate: 0,\n\t\t\t},\n\t\t\topts.expirationArgs,\n\t\t);\n\n\t\t/**\n\t\t * @memberof module:cart/models/savedCart\n\t\t * @alias unarchiveArgs\n\t\t * @property {object} unarchiveArgs - Arguments to the unarchive cart assets method\n\t\t * @property {number} unarchiveArgs.unarchiveType - Type of unarchive ( 1 = temporary, 2 = permanently )\n\t\t * @property {string} unarchiveArgs.email - Email address to notify on unarchive complete\n\t\t */\n\t\tthis.unarchiveArgs = _.extend(\n\t\t\t{\n\t\t\t\ttype: 1,\n\t\t\t\temail: '',\n\t\t\t},\n\t\t\topts.unarchiveArgs,\n\t\t);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(dispatcher, 'cart:rename:success', (model) => {\n\t\t\tmodel.id === this.id &&\n\t\t\t\tmodel !== this &&\n\t\t\t\tthis.set('title', model.get('title'));\n\t\t});\n\t}\n\n\t/**\n\t * Add current cart assets\n\t * @method\n\t */\n\taddCurrentCart() {\n\t\treturn this.addFacetedSearchToCart(\n\t\t\tnew AssetSearchRulesCollection([\n\t\t\t\t{\n\t\t\t\t\telementType: 10, // search type \"cart\"\n\t\t\t\t\telementValue1: 0, // id of current cart\n\t\t\t\t},\n\t\t\t]),\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} locationId Archive location id\n\t */\n\tarchive() {\n\t\treturn CartAssetsCollection.prototype.archive.apply(this, arguments);\n\t}\n\n\t/**\n\t * @method\n\t * @param {date|string} date Date\n\t */\n\texpireAssets() {\n\t\treturn CartAssetsCollection.prototype.expireAssets.apply(this, arguments);\n\t}\n\n\t/**\n\t * @method\n\t * @return {array} Asset ids\n\t */\n\tgetAssetIds() {\n\t\treturn this.getCartAssets().getAssetIds();\n\t}\n\n\t/**\n\t * @method\n\t * @return {Netx.Collections.CartAssets} Assets\n\t */\n\tgetCartAssets() {\n\t\t// TODO: are we making the code that calls this fetch this collection?\n\t\t// because we would be retunring an empty collection here\n\t\tif (_.isUndefined(this.cartAssets)) {\n\t\t\tthis.cartAssets = new CartAssetsCollection([], {id: this.id});\n\t\t}\n\t\treturn this.cartAssets;\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} fullUrl Return full url\n\t * @return {string}\n\t */\n\tgetRoute(fullUrl) {\n\t\treturn (\n\t\t\t((fullUrl && URL.location.split('#')[0]) || '') +\n\t\t\t'#' +\n\t\t\tcustomConfig.ROUTE_SAVED_CART +\n\t\t\t'/' +\n\t\t\tthis.id\n\t\t);\n\t}\n\n\t/**\n\t * Change saved cart name\n\t * @method\n\t * @param {string} name New saved cart name\n\t * @todo Opts?\n\t */\n\trename(name) {\n\t\tthis.set({title: name});\n\t\treturn this.save();\n\t}\n\n\t/**\n\t * Get an assetSet model defining the set of this cart's assets\n\t * @method\n\t * @return {module:asset/models/assetSet} Asset set\n\t */\n\ttoAssetSet() {\n\t\treturn new AssetSetModel({\n\t\t\ttype: assetSetTypes.savedCart,\n\t\t\tids: [this.id],\n\t\t\tmodels: [this],\n\t\t\tlabel: this.getLabel(),\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} type Unarchive type\n\t * @param {string} email Email to notify on completion\n\t */\n\tunarchive(type, email) {\n\t\treturn CartAssetsCollection.prototype.unarchive.apply(this, arguments);\n\t}\n\n\t/**\n\t * @method\n\t */\n\tunexpireAssets() {\n\t\treturn CartAssetsCollection.prototype.unexpireAssets.apply(this, arguments);\n\t}\n\n\t/**\n\t * Create a saved cart from a name and some assets\n\t * @method\n\t * @param {string} name Saved cart name\n\t * @param {Netx.Collections.Assets|array} assets Either a collection of assets or an array of asset ids\n\t */\n\tstatic Create(name, assets) {\n\t\tconst sc = new this.constructor({title: name});\n\n\t\tsc.assetsArg = _.tidyAssetList(assets);\n\t\treturn sc.create().then(() => {\n\t\t\treturn sc.fetch().then(() => {\n\t\t\t\treturn sc;\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Load a saved cart from an ID\n\t * @method\n\t * @param {number} id Saved cart id\n\t */\n\tstatic Load(id) {\n\t\tconst sc = new this.constructor({id: id});\n\n\t\treturn sc.fetch().then(() => {\n\t\t\treturn sc;\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SavedCart';\n\t}\n}\n","export let unarchiveTypeIds = {\n\ttemporary: 1,\n\tpermanent: 2,\n};\n\nexport let unarchiveTypeLabels = {\n\t1: 'cart:i18n.temporarily',\n\t2: 'cart:i18n.permanently',\n};\n\nexport let unarchiveTypes = _.invert(unarchiveTypeIds);\n\nexport default {\n\tunarchiveTypeIds: unarchiveTypeIds,\n\tunarchiveTypeLabels: unarchiveTypeLabels,\n\tunarchiveTypes: unarchiveTypes,\n};\n","/**\n * CategoryDetailsData contains the results of the getCategoryDetailsData() API call.\n *\n * This info could be considered part of a Category model, but the data is calculated on-demand and\n * isn't part of the server-side CategoryBean that our Category model reflects. Instead, we store\n * these stats in this model, and then use calls on the Category model to create/update this model & attach\n * it to the Category.\n *\n * CategoryDetailsData cannot be written to the server; it is a fetch-only model.\n *\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nexport default class CategoryDetailsData extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * The unique ID for this model\n\t * @type {string}\n\t */\n\tget idAttribute() {\n\t\treturn 'categoryId';\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {string} defaults.byteCount - Total bytes of all assets in the category (recursive)\n\t * @property {string} defaults.fileCount - Total number of files in the category (recursive)\n\t * @property {string} defaults.subcategoryCount - Total number of subcategories in the category (recursive)\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tbyteCount: '',\n\t\t\tfileCount: 0,\n\t\t\tsubCategoryCount: 0,\n\t\t};\n\t}\n\n\t/**\n\t * RPC methods:\n\t * @rpcs\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/** @method */\n\t\t\tread: ['getCategoryDetailsData', 'categoryId'],\n\t\t};\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'CategoryDetailsData';\n\t}\n}\n","import {\n\tATTRIBUTE_SYSTEM_ID,\n\tATTRIBUTE_SYSTEM,\n} from '@netx/core-attribute/constants';\n\nexport const UPGRADED_FEATURES = ['attributes'];\n\nexport const GOO_SETTING_KEYS = <const>[\n\t'contactMessage',\n\t'detailAttributes',\n\t'googleAnalyticsEnabled',\n\t'googleAnalyticsId',\n\t'homeRoute',\n\t'logoutUrl',\n\t'requireLogin',\n\t'searchCategory',\n\t'searchCategoryName',\n\t'searchCategoryPath',\n\t'sortAttributes',\n\t'ssoLabel',\n\t'ssoLoginEnabled',\n\t'ssoUrl',\n\t'upgradedFeatures',\n];\nexport const SETTING_KEYS = <const>[\n\t'attributeIds',\n\t'category',\n\t'categoryName',\n\t'categoryPath',\n\t'displayCatDescriptions',\n\t'label',\n\t'path',\n\t'searchPlaceholder',\n\t'userLevel',\n];\n\nexport const ATTRIBUTE_CONTEXT = <const>{\n\tDETAIL: 'detailAttributes',\n\tSORT: 'sortAttributes',\n};\n\nexport const DEFAULT_ATTRIBUTE_IDS = <const>[\n\tATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.NAME],\n\tATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.FILE_SIZE_2],\n\tATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.FILE_TYPE_LABEL],\n\tATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.DIMENSIONS],\n];\n\nexport const ENFORCE_ATTRIBUTE_IDS = <const>[\n\tATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.FILE],\n\tATTRIBUTE_SYSTEM_ID[ATTRIBUTE_SYSTEM.NAME],\n];\n","import {BrandPortal} from '../types';\n\n// TODO: right now this is supporting the brand portal model and the new brand portal settings context\n// the items using this right now are in js and will not care but eventually need to get the two as the same\n// Maybe keeping goo was a mistake on my part... but spreading it on the top of the model also doesn't strike\n// me as the \"correct\" move but ¯\\_(ツ)_/¯\n// So throughout this we will first check the top level and then check the goo\n\n/**\n * Has updated portal attribute system\\\n * Has a user updated the portal settings since the attributes upgrade?\n * @param portal Brand portal\n * @return Has updated attribute system\n */\nexport const hasUpdatedAttributesSystem = (portal: BrandPortal) => {\n\treturn (\n\t\t(portal as any).upgradedFeatures?.includes('attributes') ||\n\t\tportal.goo.upgradedFeatures?.includes('attributes')\n\t);\n};\nexport default hasUpdatedAttributesSystem;\n","import {UserLevel} from '@netx/core-user-next/constants';\n\nexport enum ConstituentsPref {\n\tCLIPS_ENABLED = 'asset.constituent.videoClips.enabled',\n}\n\nexport enum ConstituentType {\n\tKEYFRAME = 1,\n\tLAYER = 2,\n\tPAGE = 3,\n\tVIDEO_CLIP = 4,\n}\n\nexport const SEARCH_CONSTITIUENT_CLIPS_MINIMUM_USER_LEVEL = UserLevel.CONSUMER;\n","import {currentUserMeetsUserLevel, getPreference} from '@netx/core-user/utils';\nimport {\n\tConstituentsPref,\n\tSEARCH_CONSTITIUENT_CLIPS_MINIMUM_USER_LEVEL,\n} from './constants';\n\nexport const consituentClipsEnabled = () =>\n\tgetPreference(ConstituentsPref.CLIPS_ENABLED, true);\n\nexport const canSearchConstituentClips = () =>\n\tconsituentClipsEnabled() &&\n\tcurrentUserMeetsUserLevel(SEARCH_CONSTITIUENT_CLIPS_MINIMUM_USER_LEVEL);\n","export enum DataSetPref {\n\tENABLED = 'dataManager.enabled',\n\tMIN_USER_LEVEL = 'dataManager.minUserLevel',\n}\n","import {getPreference} from '@netx/core-user/utils/getPreference';\nimport {currentUserMeetsUserLevel} from '@netx/core-user/utils/currentUserMeetsUserLevel';\nimport {UserLevel} from '@netx/core-user-next/constants';\nimport {DataSetPref} from './constants';\n\n/**\n * Can replace data set\n * @param {Backbone.View} v View instance\n */\nexport const canReplaceDataSet = (v: any) => {\n\t// Only CSV sourced dataSets can be replaced\n\treturn v.model.get('source') === 'CSV File';\n};\n\n/** Is the user above the min user level? */\nexport const datamanagerAuthorized = () =>\n\tcurrentUserMeetsUserLevel(\n\t\tparseInt(getPreference(DataSetPref.MIN_USER_LEVEL) || '') ||\n\t\t\tUserLevel.MANAGER,\n\t);\n\n/** Is datamanager enabled */\nexport const datamanagerEnabled = () =>\n\tgetPreference(DataSetPref.ENABLED, true);\n","import {MINIMUM_USER_LEVEL} from '../constants';\nimport {DOWNLOAD_REQUEST_ACTION_LABEL} from '../locales';\n\nimport type {Action} from '@netx/core/bootstrap';\n\nimport {icon} from '@fortawesome/fontawesome-svg-core';\nimport {faCheckSquare, faImages} from '@fortawesome/pro-solid-svg-icons';\n\nconst iconOpts = {classes: ['fa-fw']};\nconst icons = {\n\tfaCheckSquare: icon(faCheckSquare, iconOpts).html,\n\tfaImages: icon(faImages, iconOpts).html,\n};\n\nexport const DOWNLOAD_REQUEST_ROUTES = <const>{\n\tLIST: 'share/approvals',\n\tVIEW: 'share/request/review',\n};\n\nexport type BaseVent = typeof BASE_EVENT;\n\nexport const BASE_EVENT = `download:request`;\n\nexport const DOWNLOAD_REQUEST_EVENT = <const>{\n\tLIST_ROUTE: `${BASE_EVENT}:list:route`,\n\tLIST: `${BASE_EVENT}:list`,\n\tVIEW: `${BASE_EVENT}:view`,\n\tVIEW_ROUTE: `${BASE_EVENT}:view:route`,\n};\n\nexport const ACTIONS: Action<\n\ttypeof DOWNLOAD_REQUEST_EVENT[keyof typeof DOWNLOAD_REQUEST_EVENT]\n>[] = [\n\t{\n\t\tevent: DOWNLOAD_REQUEST_EVENT.LIST,\n\t\ticon: icons.faCheckSquare,\n\t\tlabel: DOWNLOAD_REQUEST_ACTION_LABEL.LIST,\n\t\tuserLevel: MINIMUM_USER_LEVEL,\n\t},\n\t{\n\t\tevent: DOWNLOAD_REQUEST_EVENT.LIST_ROUTE,\n\t\ticon: icons.faCheckSquare,\n\t\tlabel: DOWNLOAD_REQUEST_ACTION_LABEL.LIST,\n\t\troute: DOWNLOAD_REQUEST_ROUTES.LIST,\n\t\tuserLevel: MINIMUM_USER_LEVEL,\n\t},\n\t{\n\t\tevent: DOWNLOAD_REQUEST_EVENT.VIEW,\n\t\ticon: icons.faImages,\n\t\tlabel: DOWNLOAD_REQUEST_ACTION_LABEL.VIEW,\n\t\tuserLevel: MINIMUM_USER_LEVEL,\n\t},\n\t{\n\t\tevent: DOWNLOAD_REQUEST_EVENT.VIEW_ROUTE,\n\t\ticon: icons.faImages,\n\t\tlabel: DOWNLOAD_REQUEST_ACTION_LABEL.VIEW,\n\t\tuserLevel: MINIMUM_USER_LEVEL,\n\t\troute: (id) => `${DOWNLOAD_REQUEST_ROUTES.VIEW}/${id}`,\n\t},\n];\n\nexport default ACTIONS;\n","import type {ReactAction} from '@netx/core/bootstrap';\nimport {appRouter} from '@netx/core-next/router';\nimport {faCheckSquare} from '@fortawesome/pro-solid-svg-icons';\nimport {canManageDownloadRequests} from '../enablers';\nimport {DownloadRequestsLabel} from '../locales';\nimport {DOWNLOAD_REQUEST_ROUTES} from './constants';\n\nexport const downloadRequestActionRequestsManageRouteIcon = faCheckSquare;\n\n/**\n * Route to download requests management\n * @param params\n * @returns Action\n */\nexport const downloadRequestActionRequestsManageRoute = (\n\tparams?: Partial<ReactAction>,\n): ReactAction => ({\n\tname: 'download-requests-manage-route',\n\tcb: () => appRouter.navigate(DOWNLOAD_REQUEST_ROUTES.LIST, true),\n\tenableTest: () => canManageDownloadRequests(),\n\ticon: downloadRequestActionRequestsManageRouteIcon,\n\tlabel: DownloadRequestsLabel.ROUTE,\n\trouteMatch: /^share\\/approvals(\\/?)/,\n\t...params,\n});\n","import {currentUserMeetsUserLevel} from '@netx/core-user/utils';\nimport {DOWNLOAD_REQUESTS_MANAGE_MINIMUM_USER_LEVEL} from './constants';\n\n// should we turn this off when download approvals is not setup?\n// and if so, do we have all the information needed, for any user level, to determine this?\nexport const canManageDownloadRequests = () =>\n\tcurrentUserMeetsUserLevel(DOWNLOAD_REQUESTS_MANAGE_MINIMUM_USER_LEVEL);\n","import {QueryClient} from '@tanstack/react-query';\nimport {UserLevel} from '@netx/core-user/constants';\n\nexport const queryClient = new QueryClient();\n\nexport const ASSET_SOURCE_TYPE = <const>{\n\tASSETS: 'ASSETS', // 1\n\tCOLLECTION: 'COLLECTION', // 2\n\tFOLDER: 'FOLDER', // 3\n\tSAVED_SEARCH: 'SAVED_SEARCH', // 4\n};\n\nexport const REVIEW_STATUS = <const>{\n\tNO_APPROVAL_REQUIRED: 'NO_APPROVAL_REQUIRED', // 1\n\tPENDING: 'PENDING', // 2\n\tCOMPLETED: 'COMPLETED', // 3\n};\n\nexport const APPROVAL_STATUS = <const>{\n\tNO_APPROVAL_REQUIRED: 'NO_APPROVAL_REQUIRED', // 1\n\tPENDING_APPROVAL: 'PENDING_APPROVAL', // 2\n\tAPPROVED: 'APPROVED', // 3\n\tDENIED: 'DENIED', // 4\n};\n\nexport const PAGE_SIZE = 25;\n\nexport const DOWNLOAD_REQUESTS_MANAGE_MINIMUM_USER_LEVEL = UserLevel.DIRECTOR;\n// TODO: rectify - always be specific\nexport const MINIMUM_USER_LEVEL = DOWNLOAD_REQUESTS_MANAGE_MINIMUM_USER_LEVEL;\n","import {i18n} from '@netx/core/i18n';\n\nimport {APPROVAL_STATUS, REVIEW_STATUS} from './constants';\n\nexport const DownloadRequestsLabel = {\n\tROUTE: i18n.t('i18n.downloadRequests'),\n};\n\nexport const APPROVAL_STATUS_LABEL: Record<\n\ttypeof APPROVAL_STATUS[keyof typeof APPROVAL_STATUS],\n\tstring\n> = <const>{\n\t[APPROVAL_STATUS.APPROVED]: i18n.t('i18n.approved'),\n\t[APPROVAL_STATUS.NO_APPROVAL_REQUIRED]: i18n.t('i18n.noApprovalRequired'),\n\t[APPROVAL_STATUS.DENIED]: i18n.t('i18n.denied'),\n\t[APPROVAL_STATUS.PENDING_APPROVAL]: i18n.t('i18n.pendingApproval'),\n};\n\nexport const REVIEW_STATUS_LABEL: Record<\n\ttypeof REVIEW_STATUS[keyof typeof REVIEW_STATUS],\n\tstring\n> = <const>{\n\t[REVIEW_STATUS.COMPLETED]: i18n.t('i18n.completed'),\n\t[REVIEW_STATUS.NO_APPROVAL_REQUIRED]: i18n.t('i18n.noApprovalRequired'),\n\t[REVIEW_STATUS.PENDING]: i18n.t('i18n.pending'),\n};\n\nexport const DOWNLOAD_REQUEST_ACTION_LABEL = <const>{\n\tLIST: i18n.t('i18n.downloadRequests'),\n\tVIEW: i18n.t('i18n.viewAssets'),\n};\n","import {i18n, initialized, isReady} from '@netx/core/i18n';\n\ntype i18nFn = (i18nKey: string, opts?: any) => string;\n\n/**\n * Locales wrapper to ensure that values are set when i18n has been initialized\n * @param cb callback\n * @returns locales\n */\nexport const Locales = <\n\tT extends Record<string | number, string> = Record<string | number, string>,\n\tF extends (...args: any[]) => any = (i18n: i18nFn) => T,\n>(\n\tcb: F,\n): ReturnType<F> => {\n\t// we will just abuse the object reference\n\t// we are still going to need to make a react hook for locales\n\t// so that one day we don't have to reload the entire site when that changes\n\t// just update the app context and any components rendered will re-render with\n\t// the updated locales\n\t// in any event, still think it may be nice to keep things wrapped in this so\n\t// that we can deal with the lib directly here and not a thousand places\n\tconst results = {} as ReturnType<F>;\n\tif (!isReady) {\n\t\tObject.assign(results, cb(i18n.t.bind(i18n)));\n\t\tinitialized.then(() => {\n\t\t\tObject.assign(results, cb(i18n.t.bind(i18n)));\n\t\t});\n\t} else {\n\t\tObject.assign(results, cb(i18n.t.bind(i18n)));\n\t}\n\treturn results;\n};\n\nexport default Locales;\n","// @ts-ignore\nimport window from 'global/window';\n\nlet _ready = false;\n\nexport const ready = () => {\n\treturn new Promise<void>((resolve) => {\n\t\tconst done = () => {\n\t\t\t_ready = true;\n\t\t\tresolve();\n\t\t};\n\n\t\t// @ts-ignore\n\t\tNetx.Loading ? Netx.Loading.appLoaded(done) : done();\n\t});\n};\n\nexport const whenReady = (cb: () => void, context: any = window) => {\n\tif (_ready) return cb();\n\tdispatcher.off('app:loaded', context);\n\tdispatcher.once('app:loaded', cb, context);\n};\n\nexport default whenReady;\n","/**\n * A model for notifications\n * If you pass a `progressTask` object containing a `uuid` to the attributes at creation, batch task polling will happen automatically\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\nimport {batchJobs} from '@netx/core-app/collections/singleton/batchJobs';\nimport {getUserLevel} from '@netx/core-user/utils/getUserLevel';\n\nexport default class Notification extends Base {\n\t/**\n\t * @property {object} defaults - The defaults for this model\n\t * @property {number} defaults.id - The default id\n\t * @property {date} defaults.creationTime - The default creation time\n\t * @property {array} defaults.ids - The default ids related\n\t * @property {string} defaults.module - The default module related\n\t * @property {string} defaults.route - Default link to add to notification\n\t * @property {string} defaults.routeLabel - Default text for the link\n\t * @property {string} defaults.title - The default title\n\t * @property {string} defaults.type - The default type (danger, info, success, warning)\n\t * @property {object} defaults.progressTask - The default `progressTask` object (if this is related to a batch task polling)\n\t * @property {array} defaults.progressTask.args - The default arguments to pass to batch task polling\n\t * @property {string} defaults.progressTask.eventStr - The default eventStr to pass to batch task polling\n\t * @property {boolean} defaults.progressTask.hasResult - The default hasResult to pass to batch task polling\n\t * @property {string} defaults.progressTask.uuid - The default uuid to pass to batch task polling (without this, no polling will occur)\n\t * @property {number} defaults.progressTask.progress - The default progress of the batch task polling (this when when a task progresses)\n\t * @property {object} defaults.progressTask.completed - The default `completed` object\n\t * @property {string} defaults.progressTask.completed.error - The default error string for batch task (only set if error occurred while polling)\n\t * @property {mixed} defaults.progressTask.completed.shareData - The default `shareData` for batch task (only set if the batch task had results)\n\t * @property {number} defaults.progressTask.completed.time - The default time of completion\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tid: _.uniqueId(_.now()),\n\t\t\tcreationTime: _.now(),\n\t\t\tdescription: '',\n\t\t\tids: [],\n\t\t\tmodule: '',\n\t\t\troute: '',\n\t\t\trouteLabel: '',\n\t\t\ttitle: '',\n\t\t\ttype: '',\n\t\t\tprogressTask: {},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t * @fires module:app#app:pollBatchJob\n\t */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\tif (getUserLevel() < 0) {\n\t\t\tthis.listenToOnce(dispatcher, 'auth:session:valid', () => {\n\t\t\t\tthis.checkForProgress();\n\t\t\t});\n\t\t} else {\n\t\t\t_.defer(() => {\n\t\t\t\tthis.checkForProgress();\n\t\t\t});\n\t\t}\n\t}\n\n\t/** @method */\n\tcheckForProgress() {\n\t\tif (getUserLevel() > 0) {\n\t\t\tvar progressTask = this.get('progressTask');\n\t\t\tif (!_.isEmpty(progressTask) && _.isUndefined(progressTask.completed)) {\n\t\t\t\t// Persist\n\t\t\t\tthis.storeOptions.persist = true;\n\n\t\t\t\tvar batchJob = batchJobs.get(progressTask.uuid);\n\t\t\t\t// Doesn't exist yet\n\t\t\t\tif (!batchJob) {\n\t\t\t\t\t// Poll the job\n\t\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t\t'app:pollBatchJob',\n\t\t\t\t\t\tprogressTask.uuid,\n\t\t\t\t\t\tprogressTask.eventStr,\n\t\t\t\t\t\tprogressTask.hasResult,\n\t\t\t\t\t\tprogressTask.args,\n\t\t\t\t\t);\n\t\t\t\t\t// There should now be a betch job model for this job\n\t\t\t\t\tbatchJob = batchJobs.get(progressTask.uuid);\n\t\t\t\t}\n\n\t\t\t\tif (batchJob) {\n\t\t\t\t\t// Listen for progress\n\t\t\t\t\tthis.listenTo(\n\t\t\t\t\t\tbatchJob,\n\t\t\t\t\t\t'change:percentComplete',\n\t\t\t\t\t\tfunction (batchJob, percentComplete) {\n\t\t\t\t\t\t\tprogressTask.progress = percentComplete;\n\t\t\t\t\t\t\tthis.trigger('progress', this, percentComplete);\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\t// Listen once for an error\n\t\t\t\t\tthis.listenToOnce(batchJob, 'error', function (batchJob, err) {\n\t\t\t\t\t\t// Set time of completion and the error message\n\t\t\t\t\t\tprogressTask.completed = {\n\t\t\t\t\t\t\ttime: new Date().getTime(),\n\t\t\t\t\t\t\terror: err,\n\t\t\t\t\t\t\tcompleted: true,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.trigger('error', this, err, batchJob);\n\t\t\t\t\t\t// Objects only register changes once\n\t\t\t\t\t\tthis.trigger('change', this);\n\t\t\t\t\t});\n\t\t\t\t\t// Listen once for complete\n\t\t\t\t\tthis.listenToOnce(batchJob, 'complete', function (batchJob) {\n\t\t\t\t\t\t// Set time of completion and any shareData related\n\t\t\t\t\t\tprogressTask.completed = {\n\t\t\t\t\t\t\ttime: new Date().getTime(),\n\t\t\t\t\t\t\tshareData: batchJob.get('shareData'),\n\t\t\t\t\t\t\tcompleted: true,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.trigger('complete', this, batchJob);\n\t\t\t\t\t\t// Objects only register changes once\n\t\t\t\t\t\tthis.trigger('change', this);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Notification';\n\t}\n}\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/notification';\n\nexport default class Notifications extends Base {\n\t/**\n\t * Sort descending\n\t * @type {string}\n\t * @param {Netx.Models.Notification} model Notification model\n\t */\n\tcomparator(model) {\n\t\treturn -model.get('creationTime');\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\n\t\t/** @type {string} */\n\t\tthis.localStorageKey = opts.localStorageKey || 'notifications';\n\n\t\t/** @type {number} */\n\t\tthis.maxStore = opts.maxStore || 100;\n\n\t\t// Hey, listen\n\t\tthis.listenTo(this, 'sync', this.checkNotifications);\n\t}\n\n\t/**\n\t * @method\n\t * @todo: Go through notifications, check for progress tasks, check to see if the tasks are still in progress\n\t */\n\tcheckNotifications() {\n\t\tthis.each(model => {\n\t\t\tif (model.get('progressTask')) {\n\t\t\t\t//dispatcher.trigger('notification:batch:task', model );\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Modify the model object that came back from local storage before inserting it into the collection\n\t * @override\n\t * @param {object} obj Model data object\n\t * @return {object} Model data\n\t */\n\tparseLocalStorageModelIn(obj) {\n\t\t// Do not load any corrupted/empty notification local sotrage records\n\t\tif (obj && obj.title && obj.type) {\n\t\t\treturn obj;\n\t\t}\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Notifications';\n\t}\n}\n","import {setGlobal} from '@netx/core-next/utils/setGlobal';\nimport NotificationsCollection from '../collections/notifications';\n\nexport const notifications = new NotificationsCollection([]);\n\nexport default notifications;\n\nif (process.env.NODE_ENV !== 'production') {\n\tsetGlobal({notifications});\n}\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/participant';\n\nimport PagerModel from '@netx/core-app/models/pager';\nimport SorterModel from '@netx/core-app/models/sorter';\n\nexport default class Participants extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} methods - Collection methods\n\t * @property {method} methods.read - Fetch participants\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'getParticipants',\n\t\t\t\t\tthis.resourceName,\n\t\t\t\t\tthis.resourceId,\n\t\t\t\t\tthis.filterStr,\n\t\t\t\t\tthis.sorter.getSortDTO(),\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers.read - Parse participants\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} participants Participants\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(participants, opts) {\n\t\t\t\treturn _.map(participants, (participant) => {\n\t\t\t\t\t// We want to combine the type and id `<type>-<id>`\n\t\t\t\t\t// `all` has no id and is just \"all\"\n\t\t\t\t\tconst uniqueId = _.compact(\n\t\t\t\t\t\t_.values(_.pick(participant, 'type', 'id')),\n\t\t\t\t\t).join('-');\n\n\t\t\t\t\treturn _.extend(participant, {\n\t\t\t\t\t\tuniqueId: uniqueId,\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {array} models An array of models or model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * @memberof module:asset/collections/participants\n\t\t * @alias resourceId\n\t\t * @type {number}\n\t\t */\n\t\tthis.resourceId = opts.resourceId;\n\n\t\t/**\n\t\t * @memberof module:asset/collections/participants\n\t\t * @alias resourceName\n\t\t * @type {string}\n\t\t */\n\t\tthis.resourceName = opts.resourceName;\n\n\t\t/**\n\t\t * Paging model\n\t\t * @memberof module:asset/collections/participants\n\t\t * @alias pager\n\t\t * @type {module:app/models/pager}\n\t\t */\n\t\tthis.pager = new PagerModel(\n\t\t\t{},\n\t\t\t{\n\t\t\t\tcollection: this,\n\t\t\t},\n\t\t);\n\n\t\t/**\n\t\t * Sorting model\n\t\t * @memberof module:asset/collections/participants\n\t\t * @alias sorter\n\t\t * @type {module:app/models/sorter}\n\t\t */\n\t\tthis.sorter = new SorterModel(\n\t\t\t{\n\t\t\t\tfield: opts.sortField || 'label',\n\t\t\t\torder: opts.sortOrder || 'desc',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcollection: this,\n\t\t\t},\n\t\t);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(\n\t\t\tdispatcher,\n\t\t\t'permissions:participant:edit:success',\n\t\t\t(participant, isNew) => {\n\t\t\t\tif (\n\t\t\t\t\tparticipant.get('resourceName') !== this.resourceName ||\n\t\t\t\t\tparticipant.get('resourceId') !== this.resourceId ||\n\t\t\t\t\tthis.get(participant.id)\n\t\t\t\t)\n\t\t\t\t\treturn;\n\n\t\t\t\tthis.add(participant);\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} participant Participant object\n\t * @param {object} opts Request options\n\t */\n\taddParticipant(participant, opts) {\n\t\tconst model = new this.model(\n\t\t\t_.extend(\n\t\t\t\t_.pick.apply(_, [participant].concat(_.keys(this.model.GetDefaults()))),\n\t\t\t\t{\n\t\t\t\t\tresourceId: this.resourceId,\n\t\t\t\t\tresourceName: this.resourceName,\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\treturn model.save().then(() => this.add(model, opts));\n\t}\n\n\t/**\n\t * Filter by participant type\n\t * @param {string} type Type (user/group/all)\n\t * @return {module:permissions/collections/participants} Participants\n\t */\n\tfilterByType(type) {\n\t\treturn new this.constructor(\n\t\t\tthis.filter((model) => model.get('type') === type),\n\t\t\t{\n\t\t\t\tresourceName: this.resourceName,\n\t\t\t\tresourceId: this.resourceId,\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * Get participant by type (and id)\n\t * @param {string} type Type\n\t * @param {number} id ID\n\t * @return {module:permissions/models/participant} Participant\n\t */\n\tgetParticipant(type, id) {\n\t\tif (type === 'all') {\n\t\t\treturn this.findWhere({type: type});\n\t\t}\n\t\treturn this.findWhere({type: type, id: id});\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} id Participant id\n\t */\n\tremoveParticipant(id) {\n\t\tconst model = this.get(id);\n\n\t\tif (!model) {\n\t\t\treturn new $.Deferred().reject(\n\t\t\t\tnew Error('Participant model with id `' + id + '` not found.'),\n\t\t\t);\n\t\t}\n\n\t\treturn model.destroy({wait: true});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Participants';\n\t}\n}\n","export enum PermissionMatrixName {\n\tADD = 'add',\n\tALL = 'all',\n\tDELETE = 'delete',\n\tDOWNLOAD = 'download',\n\tMODIFY = 'modify',\n\tREAD = 'read',\n}\n\n// NOTE: keep these ordered as they would be in the permission matrix\nexport const PERMISSION_MATRIX_NAMES = [\n\tPermissionMatrixName.READ,\n\tPermissionMatrixName.DOWNLOAD,\n\tPermissionMatrixName.ADD,\n\tPermissionMatrixName.MODIFY,\n\tPermissionMatrixName.DELETE,\n\tPermissionMatrixName.ALL,\n] as const;\n\nexport enum PermissionMode {\n\tREAD = 'read',\n\tWRITE = 'write',\n\tDELETE = 'delete',\n}\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nexport default class Participant extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'uniqueId';\n\t}\n\t/** @type {string} */\n\tget titleAttribute() {\n\t\treturn 'label';\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - Model defaults\n\t * @property {string} defaults.uniqueId - Participant `<type>-<id>`\n\t * @property {number} defaults.id - Participant id\n\t * @property {string} defaults.label - Participant label\n\t * @property {string} defaults.permission - Participant permission\n\t * @property {number} defaults.resourceId - Participant resource id\n\t * @property {string} defaults.resourceName - Participant resource name\n\t * @property {string} defaults.type - Participant type (all, group, user)\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tid: 0,\n\t\t\tlabel: '',\n\t\t\tpermission: 'read',\n\t\t\tresourceId: 0,\n\t\t\tresourceName: '',\n\t\t\ttype: 'user',\n\n\t\t\t// We have an issue - the unique id for these records are two keys: id and type\n\t\t\t// Backbone does not support this, so we have to make our own single id on the client of the two\n\t\t\t// uniqueId : ''\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn ['uniqueId'];\n\t}\n\n\t/**\n\t * @property {object} methods - Model methods\n\t * @property {method} methods.create - Add particpant to shared resource\n\t * @property {method} methods.remove - Remove participant from shared resource\n\t * @property {method} methods.update - Update participant on shared resource\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tcreate: function (opts) {\n\t\t\t\treturn ['addParticipant', this.self()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tremove: function (opts) {\n\t\t\t\treturn ['removeParticipant', this.self()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate: function (opts) {\n\t\t\t\treturn ['updateParticipant', this.self()];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Model parsers\n\t * @property {method} parsers.create - Parse newly created participant\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} participant Participant\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tcreate: function (participant, opts) {\n\t\t\t\t// We want to combine the type and id `<type>-<id>`\n\t\t\t\t// `all` has no id and is just \"all\"\n\t\t\t\tvar uniqueId = _.compact(\n\t\t\t\t\t_.values(_.pick(participant, 'type', 'id')),\n\t\t\t\t).join('-');\n\n\t\t\t\treturn _.extend(participant, {\n\t\t\t\t\tuniqueId: uniqueId,\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {string} attr Attribute\n\t * @return {mixed} Value\n\t */\n\tget(attr) {\n\t\tif (attr === 'label' && this.attributes.type === 'all') {\n\t\t\treturn i18n.t('i18n.allUsers');\n\t\t}\n\t\treturn super.get(attr);\n\t}\n\n\t/** @override */\n\tgetLabel() {\n\t\treturn this.get('type') === 'all'\n\t\t\t? i18n.t('i18n.allUsers')\n\t\t\t: super.getLabel();\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} data Data\n\t * @param {object} opts Request options\n\t */\n\tparseAndSave(data, opts) {\n\t\treturn this.save(\n\t\t\t_.pick.apply(_, [data].concat(_.keys(this.constructor.GetDefaults()))),\n\t\t\topts,\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Participant';\n\t}\n}\n","/**\n * Permission model\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nexport default class Permission extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'permissionId';\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - The default permission values\n\t * @property {number} defaults.permissionsId - The default permission id\n\t * @property {string} defaults.type - The default permission type (read/deny)\n\t * @property {string} defaults.mode - The default permission mode\n\t * @property {object} defaults.resource - The default permission resource\n\t * @property {number} defaults.resource.id - The default permission resource id\n\t * @property {string} defaults.resource.type - The default permission resource type\n\t * @property {string} defaults.resource.scope - The default permission resource scope\n\t * @property {number} defaults.resource.attributeScope - The default permission resource attribute scope\n\t * @property {object} defaults.userSelector - The default permission user selector https://kb.netx.net/display/DEV/UserSelector\n\t * @property {boolean} defaults.userSelector.all - The default permission user selector all\n\t * @property {array} defaults.userSelector.emails - The default permission user selector emails\n\t * @property {array} defaults.userSelector.groupIds - The default permission user selector group ids\n\t * @property {boolean} defaults.userSelector.none - The default permission user selector none\n\t * @property {array} defaults.userSelector.userIds - The default permission user selector user ids\n\t * @property {array} defaults.category - The default permission category scope\n\t * @property {array} defaults.resourceScopes - The default permission resource scopes\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t// permissionId : 0,\n\t\t\ttype: 'permit',\n\t\t\tmode: 'read',\n\t\t\tresource: {\n\t\t\t\tid: 0,\n\t\t\t\ttype: '',\n\t\t\t\tscope: '',\n\t\t\t\tattributeScope: 0,\n\t\t\t},\n\t\t\tuserSelector: {\n\t\t\t\tall: false,\n\t\t\t\temails: [],\n\t\t\t\tgroupIds: [],\n\t\t\t\tnone: false,\n\t\t\t\tuserIds: [],\n\t\t\t},\n\t\t\tcategoryScope: [],\n\t\t\tresourceScopes: [],\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - Model RPC methods\n\t * @property {array} methods.create - Create new permission\n\t * @property {array} methods.remove - Destroy permission\n\t * @property {array} methods.update - Update permission\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tcreate(opts) {\n\t\t\t\treturn ['setPermission', this.self()];\n\t\t\t},\n\t\t\tremove: ['deletePermission', 'permissionId'],\n\t\t\tupdate(opts) {\n\t\t\t\treturn ['setPermission', this.self()];\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(this, 'change:mode', (model, mode) => {\n\t\t\t// `attribute` resources do not have a category scope when in `read` mode\n\t\t\tif (mode === 'read' && this.getResourceType() === 'attribute') {\n\t\t\t\tthis.set('categoryScope', []);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} type Selector type (user/group)\n\t * @param {array} ids Selector ids\n\t * @param {object} opts Options\n\t */\n\taddSelectorItems(type, ids, opts = {}) {\n\t\tif (!_.isArray(ids)) ids = [ids];\n\n\t\tconst userSelector = this.get('userSelector') || {};\n\t\tconst existingIds = userSelector[`${type}Ids`];\n\n\t\tconst newIds = _.compact(\n\t\t\tids.map((id) => (existingIds.indexOf(id) > -1 ? null : id)),\n\t\t);\n\n\t\tif (!newIds.length) return this;\n\n\t\tuserSelector[`${type}Ids`] = existingIds.concat(newIds);\n\n\t\tif (opts.silent) return this;\n\n\t\treturn this.trigger('change', this, opts)\n\t\t\t.trigger('change:userSelector', this, userSelector, opts)\n\t\t\t.trigger(`userSelector:add:${type}Ids`, this, newIds, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @return {string}\n\t */\n\tgetResourceType() {\n\t\treturn this.get('resource').type || '';\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean} Has selectors\n\t */\n\thasSelectors() {\n\t\tconst userSelector = this.get('userSelector');\n\t\treturn !(\n\t\t\t!userSelector.all &&\n\t\t\t!userSelector.groupIds.length &&\n\t\t\t!userSelector.userIds.length\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} data Data\n\t * @param {object} opts Options\n\t */\n\tparseAndSave(data, opts) {\n\t\treturn this.save(\n\t\t\t_.pick.apply(_, [data].concat(_.keys(this.getDefaults()))),\n\t\t\topts,\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} type Selector type (user/group)\n\t * @param {array} ids Selector ids\n\t * @param {object} opts Options\n\t */\n\tremoveSelectorItems(type, ids, opts = {}) {\n\t\tif (!_.isArray(ids)) ids = [ids];\n\n\t\tconst userSelector = this.get('userSelector') || {};\n\t\tconst existingIds = userSelector[`${type}Ids`];\n\n\t\tconst removedIds = _.compact(\n\t\t\tids.map((id) => {\n\t\t\t\tconst idx = existingIds.indexOf(id);\n\t\t\t\tif (idx < 0) return;\n\n\t\t\t\texistingIds.splice(idx, 1);\n\t\t\t\treturn id;\n\t\t\t}),\n\t\t);\n\n\t\tif (!removedIds.length) return;\n\n\t\tuserSelector[`${type}Ids`] = existingIds;\n\n\t\tif (opts.silent) return this;\n\n\t\treturn this.trigger('change', this, opts)\n\t\t\t.trigger('change:userSelector', this, userSelector, opts)\n\t\t\t.trigger(`userSelector:remove:${type}Ids`, this, removedIds, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} selectAll Select all\n\t * @param {object} opts Options\n\t */\n\ttoggleSelectAll(selectAll, opts = {}) {\n\t\tconst userSelector = this.get('userSelector');\n\n\t\tif (selectAll == null) selectAll = !userSelector.all;\n\n\t\tuserSelector.all = selectAll;\n\n\t\tif (opts.silent) return this;\n\n\t\treturn this.trigger('change', this, opts)\n\t\t\t.trigger('change:userSelector', this, userSelector, opts)\n\t\t\t.trigger('change:userSelector:all', this, selectAll, opts);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Permission';\n\t}\n}\n","/**\n * A model layer for making permissions play like participants in 8.12\n * @class\n */\nimport Base from './participant';\n\nexport default class PermissionParticipant extends Base {\n\t/** @override */\n\tconstructor(attrs, opts) {\n\t\t// This model does not have calls to the server\n\t\topts.rpc = false;\n\t\tsuper(attrs, opts);\n\t}\n\n\t/**\n\t * We do not save to the serve rourselves\n\t * @override\n\t */\n\tdestroy() {\n\t\t// Just remove and let the underlying permissions handle the saving\n\t\tthis.collection.remove(this.id);\n\t\treturn new $.Deferred().resolveWith(this);\n\t}\n\n\t/**\n\t * We do not save to the serve rourselves\n\t * @override\n\t * @param {object} data Data\n\t * @param {object} opts Options\n\t */\n\tparseAndSave(data, opts) {\n\t\t// Just set and let the underlying permissions handle the saving\n\t\tthis.set(data, opts);\n\n\t\treturn new $.Deferred().resolveWith(this);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'PermissionParticipant';\n\t}\n}\n","/**\n * A collection layer for making permissions play like participants in 8.12\n * @class\n */\nimport Base from './participants';\nimport Model from '../models/permissionParticipant';\n\nimport GroupsCollection from '@netx/core-user/collections/groups';\nimport UsersCollection from '@netx/core-user/collections/users';\n\nexport default class PermissionsParticipants extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.comparator = opts.comparator || 'label';\n\t\topts.model = opts.model || Model;\n\t\t// This collection does not have calls to the server\n\t\topts.rpc = false;\n\n\t\tsuper(models, opts);\n\n\t\t// Debounced/throttled methods\n\t\tthis.groupsSynced = _.debounce(this.groupsSynced, 50);\n\t\tthis.labelsUpdated = _.debounce(this.labelsUpdated, 25);\n\t\tthis.usersSynced = _.debounce(this.usersSynced, 50);\n\n\t\t/**\n\t\t * @memberof module:permissions/collections/permissionsParticipants\n\t\t * @alias permissionsCollection\n\t\t * @type {module:permissions/collections/permissions}\n\t\t */\n\t\tthis.permissionsCollection = opts.collection;\n\n\t\t/**\n\t\t * Store group models for particpant labeling\n\t\t * @memberof module:permissions/collections/permissionsParticipants\n\t\t * @alias groups\n\t\t * @type {module:user/collections/groups}\n\t\t */\n\t\tthis.groups = new GroupsCollection();\n\n\t\t/**\n\t\t * Store user models for particpant labeling\n\t\t * @memberof module:permissions/collections/permissionsParticipants\n\t\t * @alias users\n\t\t * @type {module:user/collections/users}\n\t\t */\n\t\tthis.users = new UsersCollection();\n\n\t\t// Hey, listen!\n\t\tthis\n\t\t\t// Underlying `userSelector`\n\t\t\t.listenTo(\n\t\t\t\tthis.permissionsCollection,\n\t\t\t\t'change:userSelector:all',\n\t\t\t\tthis.userSelectorAllToggled,\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tthis.permissionsCollection,\n\t\t\t\t'userSelector:add:groupIds',\n\t\t\t\tthis.userSelectorAddedGroups,\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tthis.permissionsCollection,\n\t\t\t\t'userSelector:add:userIds',\n\t\t\t\tthis.userSelectorAddedUsers,\n\t\t\t)\n\t\t\t// Selector object collections\n\t\t\t.listenTo(this.groups, 'sync', this.groupsSynced)\n\t\t\t.listenTo(this.users, 'sync', this.usersSynced)\n\t\t\t// A permission participant's permission has changed\n\t\t\t// We need to reflect that on the underlying userSelector\n\t\t\t.listenTo(this, 'change:permission', (model, permission) => {\n\t\t\t\t// Remove participant from the old permission\n\t\t\t\tthis.removeParticipant(\n\t\t\t\t\tmodel.get('type'),\n\t\t\t\t\tmodel._previousAttributes.permission,\n\t\t\t\t\tmodel.get('id'),\n\t\t\t\t);\n\t\t\t\t// Add to the new permission\n\t\t\t\tthis.addParticipant(model.attributes);\n\t\t\t})\n\t\t\t// A permission participant has been removed\n\t\t\t// We need to reflect that on the underlying userSelector\n\t\t\t.listenTo(this, 'remove', (model, collection, opts) => {\n\t\t\t\topts = opts || {};\n\n\t\t\t\t// From places like backgrid filter...\n\t\t\t\tif (!this.permissionsCollection) return;\n\n\t\t\t\tthis.removeParticipant(\n\t\t\t\t\tmodel.get('type'),\n\t\t\t\t\tmodel.get('permission'),\n\t\t\t\t\tmodel.get('id'),\n\t\t\t\t);\n\t\t\t});\n\t}\n\n\t/**\n\t * Add participants for permission\n\t * @method\n\t * @param {module:permissions/models/permission} permission Permission\n\t */\n\taddByPermission(permission) {\n\t\tconst userSelector = permission.get('userSelector');\n\t\tconst mode = permission.get('mode');\n\t\tconst toSet = [];\n\n\t\t// I hate wild carding it... but I am not typing it all twice\n\t\t_.each(['group', 'user'], selector => {\n\t\t\tconst ids = userSelector[selector + 'Ids'];\n\n\t\t\t_.each(ids, id => {\n\t\t\t\ttoSet.push({\n\t\t\t\t\tuniqueId: selector + '-' + id,\n\t\t\t\t\tid: id,\n\t\t\t\t\tpermission: mode,\n\t\t\t\t\tpermissionId: permission.id,\n\t\t\t\t\ttype: selector,\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// Fetch selector objects\n\t\t\tids.length &&\n\t\t\t\tthis[selector + 's'].getByIds(ids, {\n\t\t\t\t\tmerge: true,\n\t\t\t\t\tremove: false,\n\t\t\t\t});\n\t\t});\n\n\t\tif (userSelector.all === true) {\n\t\t\ttoSet.push({\n\t\t\t\tuniqueId: 'all',\n\t\t\t\tid: null,\n\t\t\t\ttype: 'all',\n\t\t\t\tpermission: mode,\n\t\t\t\tpermissionId: permission.id,\n\t\t\t});\n\t\t}\n\n\t\treturn this.set(toSet, {merge: true, remove: false});\n\t}\n\n\t/**\n\t * Addidng a participant will modify the underlying userSelector\n\t * @override\n\t * @param {object} participant Participant object\n\t * @param {object} opts Request options\n\t */\n\taddParticipant(participant, opts) {\n\t\t// Backgrid...\n\t\tif (!this.permissionsCollection) {\n\t\t\treturn new $.Deferred().resolveWith(this);\n\t\t}\n\n\t\tconst collection = this.permissionsCollection;\n\t\tlet permission = collection.findWhere({mode: participant.permission});\n\n\t\t// Add the permission if there is not already one for this mode\n\t\tif (!permission) {\n\t\t\tpermission = collection.addPermission({\n\t\t\t\tmode: participant.permission,\n\t\t\t});\n\t\t}\n\n\t\t// Add to the underlying userSelector\n\t\tconst type = participant.type;\n\t\tswitch (type) {\n\t\t\tcase 'user':\n\t\t\tcase 'group':\n\t\t\t\tpermission.addSelectorItems(type, parseInt(participant.id), opts);\n\t\t\t\tbreak;\n\t\t\tcase 'all':\n\t\t\t\tpermission.toggleSelectAll(true);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Normal pariticpant code gets saved immediately\n\t\treturn new $.Deferred().resolveWith(this, [permission]);\n\t}\n\n\t/**\n\t * @method\n\t * @param {module:user/collections/groups} collection Collection\n\t */\n\tgroupsSynced(collection) {\n\t\tconst groups = this.groups;\n\t\tif (collection !== groups) return;\n\n\t\tthis.filterByType('group').each(m => {\n\t\t\tconst group = groups.get(m.get('id'));\n\t\t\tgroup && m.set('label', group.getLabel());\n\t\t});\n\n\t\tthis.labelsUpdated();\n\t}\n\n\t/**\n\t * @method\n\t */\n\tlabelsUpdated() {\n\t\tthis.sort();\n\t}\n\n\t/**\n\t * Remove participants for permission\n\t * @method\n\t * @param {module:permissions/models/permission} permission Permission\n\t */\n\tremoveByPermission(permission) {\n\t\tconst userSelector = permission.get('userSelector');\n\t\tconst mode = permission.get('mode');\n\n\t\t_.each(['group', 'user'], selector => {\n\t\t\tvar ids = userSelector[selector + 'Ids'];\n\t\t\t_.each(ids, id => {\n\t\t\t\tthis.remove(selector + '-' + id);\n\t\t\t});\n\t\t});\n\n\t\tif (userSelector.all === true) {\n\t\t\tthis.remove('all');\n\t\t}\n\t}\n\n\t/**\n\t * Removing a participant will modify the underlying userSelector\n\t * @override\n\t * @param {string} type Selector type (user/group/all)\n\t * @param {string} mode Mode (read/write/delete)\n\t * @param {number} id Selector id (null for `all`)\n\t * @param {object} opts Options\n\t */\n\tremoveParticipant(type, mode, id, opts) {\n\t\tconst permission =\n\t\t\tthis.permissionsCollection &&\n\t\t\tthis.permissionsCollection.findWhere({mode: mode});\n\n\t\tif (!permission) return new $.Deferred().resolveWith(this);\n\n\t\tswitch (type) {\n\t\t\tcase 'user':\n\t\t\tcase 'group':\n\t\t\t\tpermission.removeSelectorItems(type, id, opts);\n\t\t\t\tbreak;\n\t\t\tcase 'all':\n\t\t\t\tpermission.toggleSelectAll(false);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Normal pariticpant code gets saved immediately\n\t\treturn new $.Deferred().resolveWith(this, [permission]);\n\t}\n\n\t/**\n\t * The underlying userSelector has changed whether all users are selected or not\n\t * We need to reflect that here as a participant\n\t * @param {module:permissions/models/permission} Permission\n\t * @param {boolean} allSelected All selected\n\t * @param {object} opts Options\n\t */\n\tuserSelectorAllToggled(permission, allSelected, opts) {\n\t\tif (!allSelected) {\n\t\t\tthis.remove('all');\n\t\t\treturn;\n\t\t}\n\n\t\tthis.add(\n\t\t\t{\n\t\t\t\tuniqueId: 'all',\n\t\t\t\tid: null,\n\t\t\t\ttype: 'all',\n\t\t\t\tpermission: permission.get('mode'),\n\t\t\t\tpermissionId: permission.id,\n\t\t\t},\n\t\t\t{merge: true},\n\t\t);\n\t}\n\n\t/**\n\t * Groups have been added to the underlying userSelector\n\t * We need to reflect that here as a participants\n\t * @method\n\t * @param {module:permissions/models/permission} Permission\n\t * @param {array} groupIds Added group ids\n\t * @param {object} opts Options\n\t */\n\tuserSelectorAddedGroups(permission, ids, opts) {\n\t\tconst mode = permission.get('mode');\n\t\tthis.set(\n\t\t\tids.map(id => {\n\t\t\t\treturn {\n\t\t\t\t\tuniqueId: 'group-' + id,\n\t\t\t\t\tid: id,\n\t\t\t\t\tpermission: mode,\n\t\t\t\t\tpermissionId: permission.id,\n\t\t\t\t\ttype: 'group',\n\t\t\t\t};\n\t\t\t}),\n\t\t\t{\n\t\t\t\tmerge: true,\n\t\t\t\tremove: false,\n\t\t\t},\n\t\t);\n\t\tthis.groups.getByIds(ids);\n\t}\n\n\t/**\n\t * Users have been added to the underlying userSelector\n\t * We need to reflect that here as a participants\n\t * @method\n\t * @param {module:permissions/models/permission} Permission\n\t * @param {array} ids Added user ids\n\t * @param {object} opts Options\n\t */\n\tuserSelectorAddedUsers(permission, ids, opts) {\n\t\tconst mode = permission.get('mode');\n\t\tthis.set(\n\t\t\tids.map(id => {\n\t\t\t\treturn {\n\t\t\t\t\tuniqueId: 'user-' + id,\n\t\t\t\t\tid: id,\n\t\t\t\t\tpermission: mode,\n\t\t\t\t\tpermissionId: permission.id,\n\t\t\t\t\ttype: 'user',\n\t\t\t\t};\n\t\t\t}),\n\t\t\t{\n\t\t\t\tmerge: true,\n\t\t\t\tremove: false,\n\t\t\t},\n\t\t);\n\t\tthis.users.getByIds(ids);\n\t}\n\n\t/**\n\t * @method\n\t * @param {module:user/collections/users} collection Collection\n\t */\n\tusersSynced(collection) {\n\t\tconst users = this.users;\n\t\tif (collection !== users) return;\n\n\t\tthis.filterByType('user').each(m => {\n\t\t\tconst user = users.get(m.get('id'));\n\t\t\tuser && m.set('label', user.getLexicographicName());\n\t\t});\n\t\tthis.labelsUpdated();\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'PermissionsParticipants';\n\t}\n}\n","/**\n * Permsissions collection\n * This collection contains all permissions for a given resource [Asset, Attribute, Attribute Set, Category, Cart, Module, Search]\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/permission';\n\nimport PagerModel from '@netx/core-app/models/pager';\nimport PermissionsParticipants from './permissionsParticipants';\n\nexport default class Permissions extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} methods - Collection RPC methods\n\t * @property {array} methods.read - Get all permissions for resource\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tread(opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'getPermissionsByResource',\n\t\t\t\t\tthis.resourceName,\n\t\t\t\t\tthis.resourceId,\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t\tthis.modeFilters,\n\t\t\t\t];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers.read - Parse permissions\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * Make sure we do not have duplicate modes\n\t\t\t * @function\n\t\t\t * @param {array} permissions Permissions\n\t\t\t * @param {object} opts Options\n\t\t\t */\n\t\t\tread(permissions, opts) {\n\t\t\t\tconst uniquePerms = [];\n\t\t\t\tlet groupIds = [];\n\t\t\t\tlet userIds = [];\n\n\t\t\t\t_.each(permissions, (permission) => {\n\t\t\t\t\t// No deny permissions\n\t\t\t\t\tif (permission.type === 'deny') {\n\t\t\t\t\t\tthis.toRemove.push(permission.permissionId);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet selectors = permission.userSelector;\n\n\t\t\t\t\tconst existing = _.findWhere(uniquePerms, {mode: permission.mode});\n\t\t\t\t\tif (!existing) {\n\t\t\t\t\t\tuserIds = userIds.concat(selectors.userIds);\n\t\t\t\t\t\tgroupIds = groupIds.concat(selectors.groupIds);\n\t\t\t\t\t\tuniquePerms.push(permission);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Remove the duplicate\n\t\t\t\t\tthis.toRemove.push(permission.permissionId);\n\t\t\t\t\t// Update the existing\n\t\t\t\t\tthis.toSave.push(existing.permissionId);\n\n\t\t\t\t\tconst existingSelectors = existing.userSelector;\n\n\t\t\t\t\t// Do not let a user be in multiple permission modes\n\t\t\t\t\tconst newGroupIds = _.without(\n\t\t\t\t\t\tselectors.groupIds,\n\t\t\t\t\t\t_.intersection(userIds, selectors.groupIds),\n\t\t\t\t\t);\n\t\t\t\t\tconst newUserIds = _.without(\n\t\t\t\t\t\tselectors.userIds,\n\t\t\t\t\t\t_.intersection(userIds, selectors.userIds),\n\t\t\t\t\t);\n\n\t\t\t\t\t// Merge user selectors\n\t\t\t\t\texisting.userSelector = {\n\t\t\t\t\t\tall: existingSelectors.all || selectors.all,\n\t\t\t\t\t\tgroupIds: existingSelectors.groupIds.concat(newGroupIds),\n\t\t\t\t\t\tuserIds: existingSelectors.userIds.concat(newUserIds),\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\treturn uniquePerms;\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * Paging model\n\t\t * @memberOf Netx.Collections.Users\n\t\t * @alias pager\n\t\t * @type {Netx.Models.Pager}\n\t\t * @todo We need to trigger unsaved changes warning for when paging permissions\n\t\t */\n\t\tthis.pager = new PagerModel({pageSize: 0x7fffffff}, {collection: this});\n\n\t\t/**\n\t\t * Mode filters (read/write/delete/favorite)\n\t\t * @memberOf Netx.Collections.Permissions\n\t\t * @alias modeFilters\n\t\t * @type {object}\n\t\t */\n\t\tthis.modeFilters = opts.modeFilters || null;\n\n\t\t/**\n\t\t * Resource name\n\t\t * @memberOf Netx.Collections.Permissions\n\t\t * @alias resourceName\n\t\t * @type {string}\n\t\t */\n\t\tthis.resourceName = opts.resourceName || '';\n\n\t\t/**\n\t\t * Resource id\n\t\t * @memberOf Netx.Collections.Permissions\n\t\t * @alias resourceId\n\t\t * @type {number}\n\t\t */\n\t\tthis.resourceId = opts.resourceId || null;\n\n\t\t/**\n\t\t * A layer for making permissions play like participants in 8.12\n\t\t * @memberof module:permissions/collections/permissions\n\t\t * @alias participants\n\t\t * @type {module:permissions/collections/permissionsParticipants}\n\t\t */\n\t\tthis.participants = new PermissionsParticipants([], {\n\t\t\tcollection: this,\n\t\t\tresourceId: this.resourceId,\n\t\t\tresourceName: this.resourceName,\n\t\t});\n\n\t\t/**\n\t\t * Store models that need to be created on the server\n\t\t * @memberof module:permissions/collections/permissions\n\t\t * @alias toAdd\n\t\t * @type {array}\n\t\t */\n\t\tthis.toAdd = [];\n\t\t/**\n\t\t * Store model ids that need to be updated on the server\n\t\t * @memberof module:permissions/collections/permissions\n\t\t * @alias toSave\n\t\t * @type {array}\n\t\t */\n\t\tthis.toSave = [];\n\t\t/**\n\t\t * Store model ids that need to be destroyed on the server\n\t\t * @memberof module:permissions/collections/permissions\n\t\t * @alias toRemove\n\t\t * @type {array}\n\t\t */\n\t\tthis.toRemove = [];\n\n\t\t// Hey, listen!\n\t\t// For making permissions play like participants in 8.12\n\t\tthis.listenTo(this, 'request:read', (collection, xhr, opts) => {\n\t\t\t// Reset\n\t\t\tthis.stopListening(this, 'add remove change sync');\n\t\t\tthis.participants.reset([]);\n\n\t\t\tthis.listenTo(this, 'sync', (collection) => {\n\t\t\t\t// Could be an underlying model\n\t\t\t\tif (collection !== this) return;\n\n\t\t\t\t// Add existing records\n\t\t\t\tthis.each(this.participants.addByPermission, this.participants);\n\n\t\t\t\t// Keep track additions, removals and changes\n\t\t\t\tthis.listenTo(this, 'add', (model, collection) => {\n\t\t\t\t\t// If we do not already have and id, we need to be created on the server\n\t\t\t\t\t!model.id && this.toAdd.push(model);\n\t\t\t\t})\n\t\t\t\t\t.listenTo(this, 'remove', (model, collection) => {\n\t\t\t\t\t\tlet idx;\n\t\t\t\t\t\t// If we were new and removed before ever being saved,\n\t\t\t\t\t\t// we no longer need to be created on the server\n\t\t\t\t\t\tif (!model.id) {\n\t\t\t\t\t\t\tidx = this.toAdd.indexOf(model);\n\t\t\t\t\t\t\treturn idx > -1 && this.toAdd.splice(idx, 1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tidx = this.toSave.indexOf(model.id);\n\t\t\t\t\t\tidx > -1 && this.toSave.splice(idx, 1);\n\t\t\t\t\t\tthis.toRemove.push(model.id);\n\t\t\t\t\t})\n\t\t\t\t\t.listenTo(this, 'change', (model) => {\n\t\t\t\t\t\t// If the model does not have an id then we have not been created\n\t\t\t\t\t\t// on the server yet and do not need saving\n\t\t\t\t\t\tif (!model.id) return;\n\t\t\t\t\t\tthis.toSave.indexOf(model.id) < 0 && this.toSave.push(model.id);\n\t\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Add a new default permission for this resource\n\t * The permission is not yet saved - just added to the collection\n\t * @method\n\t * @param {object} attrs Attributes\n\t * @param {object} opts Options\n\t */\n\taddPermission(attrs = {}, opts = {}) {\n\t\treturn this.add(\n\t\t\t_.extend(attrs, {\n\t\t\t\tresource: {\n\t\t\t\t\tid: this.resourceId,\n\t\t\t\t\ttype: this.resourceName,\n\t\t\t\t},\n\t\t\t}),\n\t\t\topts,\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Options\n\t */\n\tsave(opts = {}) {\n\t\tlet toRemove = this.toRemove;\n\t\tlet toAdd = this.toAdd;\n\t\tlet toSave = this.toSave;\n\n\t\t// Part of the particpants hack for this collection\n\t\t// We will trigger a sync when done\n\t\tthis.stopListening(this, 'add remove change sync');\n\n\t\t// All permissions with empty userSelectors will be set for removal\n\t\tthis.forEach((perm) => {\n\t\t\tif (perm.hasSelectors()) return;\n\t\t\t!_.contains(toRemove, perm.id) && toRemove.push(perm.id);\n\t\t});\n\n\t\t// Remove\n\t\tconst removePromises = _.compact(\n\t\t\t_.map(toRemove, (id) => {\n\t\t\t\tconst model = this.get(id) || new this.model({permissionId: id});\n\t\t\t\treturn model.destroy(_.extend({wait: true}, opts));\n\t\t\t}),\n\t\t);\n\n\t\t// Create\n\t\tconst addPromises = _.compact(\n\t\t\t_.map(toAdd, (model) => {\n\t\t\t\t// We will not be adding it if there are no selectors\n\t\t\t\tif (!model.hasSelectors() || model.id) return;\n\t\t\t\treturn model.save(opts);\n\t\t\t}),\n\t\t);\n\n\t\t// Update\n\t\tconst savePromises = _.compact(\n\t\t\t_.map(toSave, (id) => {\n\t\t\t\t// We will not be updating it if it was removed\n\t\t\t\tif (_.contains(toRemove, id)) return;\n\t\t\t\tconst model = this.get(id);\n\t\t\t\treturn model && model.save(opts);\n\t\t\t}),\n\t\t);\n\n\t\tthis.toRemove = [];\n\t\tthis.toAdd = [];\n\t\tthis.toSave = [];\n\n\t\tconst allPromises = removePromises.concat(addPromises, savePromises);\n\n\t\tconst p = this.when.apply(this, allPromises);\n\t\tp.then(() => {\n\t\t\t!opts.silent && allPromises.length && this.trigger('sync', this, opts);\n\t\t});\n\n\t\treturn p;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Permissions';\n\t}\n}\n","/**\n * Permission resource model\n * This model does not have defaults as it is intended to be extended for functionality only\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport PermissionsCollection from '@netx/core-permissions/collections/permissions';\nimport {resourceLabels} from '../properties/permissions';\n\nexport default class PermissionResource extends Base {\n\t/**\n\t * Not all models that extend us use the same attribute for their title\n\t * Things like attributes (which do not extend Netx.Models.SharedResource) use `name`\n\t * @type {string}\n\t */\n\tget titleAttribute() {\n\t\treturn 'title';\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * Resource type name\n\t\t * Must be set by extending model or at initialize\n\t\t * @type {string}\n\t\t */\n\t\tthis.resourceName = opts.resourceName;\n\t\t// Need a `resourceName` for any permission fetching to work\n\t\tif (this.resourceName == null) {\n\t\t\tthrow new Error('Permission resource instatiated without `resourceName`');\n\t\t}\n\n\t\t/**\n\t\t * @memberof module:share/model/sharedResource\n\t\t * @alias participants\n\t\t * @type {module:permissions/collections/permissions}\n\t\t */\n\t\tthis.permissions = new PermissionsCollection([], {\n\t\t\tresourceName: this.resourceName,\n\t\t\tresourceId: this.id,\n\t\t});\n\t\tthis.addSubCollection(this.permissions);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(this, 'change:id', function(model, id) {\n\t\t\tthis.permissions.resourceId = this.id;\n\t\t}).listenTo(this.permissions, 'sync', function(permissions) {\n\t\t\tif (permissions !== this.permissions) return;\n\t\t\t// Defer so that all other sync related logic has run\n\t\t\t_.defer(this.permissionsUpdated.bind(this));\n\t\t});\n\t}\n\n\t/**\n\t * Get applicable permissions\n\t * @method\n\t * @return {module:permissions/collections/permissions}\n\t */\n\tgetPermissions() {\n\t\tif (\n\t\t\t!this.permissionsEnabled() ||\n\t\t\tthis.isNew()\n\t\t\t// Just resolve so the normal workflow can occur\n\t\t)\n\t\t\treturn new $.Deferred().resolve();\n\n\t\treturn this.permissions.fetch();\n\t}\n\n\t/**\n\t * @method\n\t * @return {string}\n\t */\n\tgetResourceLabel() {\n\t\treturn resourceLabels[this.resourceName] || '';\n\t}\n\n\t/**\n\t * @method\n\t * @return {string}\n\t */\n\tgetTitle() {\n\t\treturn this.get(this.titleAttribute) || '';\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\thasParticipants() {\n\t\treturn this.permissions.participants.length !== 0;\n\t}\n\n\t/**\n\t * Are permissions for this resource enabled\n\t * Override this method as needed - default return is `true`\n\t * @override\n\t * @return {boolean}\n\t */\n\tpermissionsEnabled() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @method\n\t */\n\tpermissionsUpdated() {\n\t\tthis.set('hasPermissions', this.hasParticipants());\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'PermissionResource';\n\t}\n}\n","import {getUserLevel} from '@netx/core-user/utils/getUserLevel';\nimport {getViewModel} from '@netx/core/lib/utils';\n\n// TODO: this is a util, not a property file\n\n/**\n * @function\n * @param {array} actions Actions\n * @param {module:core/lib/netx-view} view View instance\n * @return {array} Enabled actions\n */\nexport const getEnabledActions = (actions, view) => {\n\tconst userLevel = getUserLevel();\n\n\treturn actions.filter((action) => {\n\t\tif (!action) return false;\n\t\tconst actionUserLevel = action.userLevel;\n\t\tconst model = getViewModel(view);\n\n\t\t// User level\n\t\t// Leaving this check here for `userLevel < 9` - not sure why we would have any\n\t\t// actions with user levels greater than 9 but ¯\\_(ツ)_/¯\n\t\tif (actionUserLevel && userLevel < 9 && userLevel < actionUserLevel) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Action matrix\n\t\tconst actionMatrix = action.matrix;\n\t\tif (actionMatrix && model) {\n\t\t\tconst modelAllows = model.allows;\n\t\t\t// check for fuxxups in action config:\n\t\t\tif (typeof modelAllows !== 'function') {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'action \"' +\n\t\t\t\t\t\taction.event +\n\t\t\t\t\t\t'\" defined \"matrix\", but no allows() method was found on model.',\n\t\t\t\t);\n\t\t\t} else if (!modelAllows.call(model, actionMatrix)) return false;\n\t\t}\n\n\t\t// Enable test(s)\n\t\tconst actionEnableTest = action.enableTest;\n\t\tif (typeof actionEnableTest === 'function') {\n\t\t\tif (!actionEnableTest(view)) return false;\n\t\t} else if (_.isArray(actionEnableTest)) {\n\t\t\tconst failedEnableTest = actionEnableTest.some((enableTest) => {\n\t\t\t\tif (!enableTest) return;\n\t\t\t\tif (typeof enableTest !== 'function') {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`enableTest array contained non-function: ${enableTest}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn !enableTest(view);\n\t\t\t});\n\t\t\tif (failedEnableTest) return false;\n\t\t}\n\n\t\treturn true;\n\t});\n};\n","import {i18n} from '@netx/core/i18n';\n\nimport {PERMISSION_MATRIX_NAMES} from '../constants';\n\n// Names for the six bits on a permissionsMatrix, in the order they appear on asset & category models:\nexport const matrixNames = PERMISSION_MATRIX_NAMES;\n\n// These *Types data structures are optimized for creating OPTION lists in forms. Their order must be preserved.\nexport const permissionTypes = [\n\t{\n\t\tkey: 'ALL',\n\t\tlabel: i18n.t('i18n.acl-ALL'),\n\t\tvalue: 9,\n\t},\n\t{\n\t\tkey: 'READ',\n\t\tlabel: i18n.t('i18n.acl-READ'),\n\t\tvalue: 1,\n\t},\n\t{\n\t\tkey: 'DOWNLOAD',\n\t\tlabel: i18n.t('i18n.acl-DOWNLOAD'),\n\t\tvalue: 2,\n\t},\n\t{\n\t\tkey: 'ADD',\n\t\tlabel: i18n.t('i18n.acl-ADD'),\n\t\tvalue: 3,\n\t},\n\t{\n\t\tkey: 'MODIFY',\n\t\tlabel: i18n.t('i18n.acl-MODIFY'),\n\t\tvalue: 5,\n\t},\n\t{\n\t\tkey: 'DELETE',\n\t\tlabel: i18n.t('i18n.acl-DELETE'),\n\t\tvalue: 7,\n\t},\n];\n\nexport const principalTypes = [\n\t{\n\t\tkey: 'ANY',\n\t\tlabel: i18n.t('i18n.acl-ANY'),\n\t\tvalue: 0,\n\t},\n\t{\n\t\tkey: 'GROUP',\n\t\tlabel: i18n.t('i18n.acl-GROUP'),\n\t\tvalue: 1,\n\t},\n\t{\n\t\tkey: 'USER',\n\t\tlabel: i18n.t('i18n.acl-USER'),\n\t\tvalue: 2,\n\t},\n];\n\nexport const targetTypes = [\n\t{\n\t\tkey: 'category',\n\t\tlabel: i18n.t('i18n.category'),\n\t\tvalue: 0,\n\t},\n\t{\n\t\tkey: 'asset',\n\t\tlabel: i18n.t('i18n.asset'),\n\t\tvalue: 1,\n\t},\n];\n\nexport const typeTypes = [\n\t{\n\t\tkey: 'PERMIT',\n\t\tlabel: i18n.t('i18n.acl-PERMIT'),\n\t\tvalue: 1,\n\t},\n\t{\n\t\tkey: 'DENY',\n\t\tlabel: i18n.t('i18n.acl-DENY'),\n\t\tvalue: 0,\n\t},\n];\n\nconst properties = {\n\tmatrixNames,\n\tpermissionIds: {},\n\tpermissionLabels: {},\n\tpermissionTypes,\n\tprincipalIds: {},\n\tprincipalLabels: {},\n\tprincipalTypes,\n\ttargetIds: {},\n\ttargetLabels: {},\n\ttargetTypes,\n\ttypeIds: {},\n\ttypeLabels: {},\n\ttypeTypes,\n};\n\n// Parse the *Types data structures into *Ids data structures optimized for looking up ID by label or vise versa:\n(['permission', 'principal', 'target', 'type'] as const).forEach((thing) => {\n\tconst obj: Record<string, number> = {};\n\tconst obj2: Record<number, string> = {};\n\tObject.entries(properties[`${thing}Types`]).forEach(([, entry]) => {\n\t\tobj[entry.key] = entry.value;\n\t\tobj2[entry.value] = entry.label;\n\t});\n\tproperties[`${thing}Ids`] = obj;\n\tproperties[`${thing}Labels`] = obj2;\n});\n\nexport const targetIds = properties.targetIds;\nexport const targetLabels = properties.targetLabels;\nexport const permissionIds = properties.permissionIds;\nexport const permissionLabels = properties.permissionLabels;\nexport const principalIds = properties.principalIds;\nexport const principalLabels = properties.principalLabels;\nexport const typeIds = properties.typeIds;\nexport const typeLabels = properties.typeLabels;\n\nexport default properties;\n","// Attribute specific permission props\nimport {i18n} from '@netx/core/i18n';\n\n// TODO: Explain why - I cannot remember why - is it that only admins can administer the attibute templates themeselves?\nexport const attribute = {\n\tmodes: ['read', 'write'],\n};\n\nexport const modes = {\n\tread: i18n.t('i18n.read'),\n\twrite: i18n.t('i18n.write'),\n\tdelete: i18n.t('i18n.delete'),\n};\n\nexport const specialModes = {\n\tread: i18n.t('i18n.viewer'),\n\twrite: i18n.t('i18n.contributor'),\n\tdelete: i18n.t('i18n.manager'),\n};\n\nexport const resourceLabels = {\n\tattribute: i18n.t('i18n.attribute'),\n\tattributeSet: i18n.t('i18n.attributeSet'),\n\tsavedCart: i18n.t('i18n.savedCart'),\n\tsavedSearch: i18n.t('i18n.savedSearch'),\n};\n\nexport const targets = {\n\tall: i18n.t('i18n.all'),\n\tgroup: i18n.t('i18n.group'),\n\tuser: i18n.t('i18n.user'),\n};\n\nexport default {\n\tattribute: attribute,\n\tmodes: modes,\n\tresourceLabels: resourceLabels,\n\tspecialModes: specialModes,\n\ttargets: targets,\n};\n","import type {PermissionMatrix} from '../types';\nimport {PERMISSION_MATRIX_NAMES, PermissionMatrixName} from '../constants';\n\nexport {PermissionMatrixName} from '../constants';\n\nexport const allows = (\n\tpermissionMatrix: PermissionMatrix,\n\tperm?: PermissionMatrixName | null,\n) => {\n\tif (perm == null) return false;\n\tconst matrixIndex = PERMISSION_MATRIX_NAMES.indexOf(perm);\n\treturn permissionMatrix[matrixIndex] === 1;\n};\n\nexport default allows;\n","/**\n * @classdesc\n * Netx.Collections.SearchRules contains all the data to make up a DAM Search Bean, the argument to various API calls including searchAssetListObjects().\n * It is used heavily by Netx.Collections.Assets and its many subclasses, to define what assets should be fetched.\n * Its models describe a set of up to ten individual searches; multiple searches are combined\n * logically with \"AND\", \"OR\" or \"NOT\". The collection also has eight search parameters, stored as non-Backbone\n * object properties. which affect the search as a whole.\n * Options for all of these fields are defined more completely in the object search/properties/search.\n *\n * NOTE: The search parameter properties on the collection are manipulated via standard JS syntax, not via backbone's get() and set(), because this is a Collection, not a Model.\n *\n * @param {string} sortField Name of the field to sort results by.\n * @param {int} sortOrder 0 == ascending order, 1 == descending order.\n * @param {int} matchCriteria How to logically combine multiple type searches: 0 is \"AND\", 1 is \"OR\", 2 is \"NOT\".\n * @param {string} saveSearch If this string is not empty, the search will be saved under this name.\n * @param {int} notifyType If search is saved, how should the user be notified of updates to the search set?\n * @param {boolean} ignoreStat Should this search be recorded against asset statistics? true = no, false = yes.\n * @param {int} startPosition Of the complete ordered set of search results, return results starting at this position.\n * @param {int} maxItems Of the complete ordered set of search results, return this many items or fewer.\n *\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/searchRule';\n\nimport Netx from '@netx/core/bootstrap';\nimport {dispatcher} from '@netx/core-next/dispatcher';\n\nimport base64 from 'core-libs/base64';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\n\nimport {\n\tfileFormatFamilies,\n\tfileTypes,\n\tsearchProperties,\n} from '../properties/search';\n\nexport default class SearchRules extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Methods for this model\n\t * @type {object}\n\t * @property {object} methods - Methods for this model\n\t * @property {method} methods.read - Get asset search bean for saved search\n\t * @property {method} methods.fetchFileTypes - We need to get this list of file types from the server at start up, for the use of Advanced Search, and put it in search/properties/search\n\t * @property {method} methods.fetchFormatFamilies - We need to get this list of file format families from the server at start up, for the use of Advanced Search, and put it in search/properties/search\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * Fetch\n\t\t\t * @method\n\t\t\t */\n\t\t\tread: ['getAssetSearchBeanForSavedSearch', 'savedSearchId'],\n\t\t\t// We need to get this list of file types from the server at start up, for the use of Advanced Search, and put it in search/properties/search.\n\t\t\t// Rather than create a File Types collection just for that, I'm adding a method call here; the results are filed away by the parser, below.\n\t\t\t/**\n\t\t\t * Get file types\n\t\t\t * @method\n\t\t\t */\n\t\t\tfetchFileTypes(opts) {\n\t\t\t\treturn ['getChoiceList', 'file_type_list'];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Get format families\n\t\t\t * @method\n\t\t\t */\n\t\t\tfetchFormatFamilies(opts) {\n\t\t\t\treturn ['getChoiceList', 'fileFormatFamilies'];\n\t\t\t},\n\t\t};\n\t}\n\n\t/*\n\t * Parse the searchBean output of getAssetSearchBeanForSavedSearch into this object.\n\t * @method\n\t * @param {object} data Search rules data\n\t * @return {object} PArsed search rules\n\t */\n\tparse(data) {\n\t\t// if the data looks right:\n\t\tif (_.has(data, 'element1Type')) {\n\t\t\tconst rxElement = /^element(\\d+)(.*)/;\n\t\t\tconst searchRules = [];\n\n\t\t\tfor (let x = 0; x < 10; x++) {\n\t\t\t\tsearchRules.push({});\n\t\t\t}\n\n\t\t\t_.each(data, (v, k, l) => {\n\t\t\t\tconst match = k.match(rxElement);\n\t\t\t\tif (match) {\n\t\t\t\t\tconst elIdx = match[1];\n\t\t\t\t\tconst elPart = match[2];\n\t\t\t\t\tconst idx = parseInt(elIdx) - 1;\n\n\t\t\t\t\t_.extend(searchRules[idx], {\n\t\t\t\t\t\t[`element${elPart}`]: v,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// found a search property\n\t\t\t\t\tif (searchProperties.indexOf(k) > -1) {\n\t\t\t\t\t\tthis[k] = v;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`unknown search element '${k}' from getAssetSearchBeanForSavedSearch()`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// return just the rules that mean something\n\t\t\treturn _.filter(searchRules, (r) => {\n\t\t\t\treturn r.elementType > 0;\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Parsers for this model\n\t * @type {object}\n\t * @property {object} parsers - Parsers for this model\n\t * @property {object} parsers.fetchFileTypes - File types fetched\n\t * @property {object} parsers.fetchFormatFamilies - File format families fetched\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * File types fetched\n\t\t\t * @method\n\t\t\t * @param {mixed} data Cart asset data\n\t\t\t */\n\t\t\tfetchFileTypes(data) {\n\t\t\t\t_.each(data, (ft) => {\n\t\t\t\t\t// Filter out null strings and all-digit strings -- they are bad data introduced by DAM-1911; that bug is fixed but the bad data may persist.\n\t\t\t\t\tif (ft.label.length > 0 && !ft.label.match(/^\\d+$/)) {\n\t\t\t\t\t\tfileTypes[ft.label] = ft.value;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t/**\n\t\t\t * File format families fetched\n\t\t\t * @method\n\t\t\t * @param {mixed} data Cart asset data\n\t\t\t */\n\t\t\tfetchFormatFamilies(data) {\n\t\t\t\t_.each(data, (ff) => {\n\t\t\t\t\tif (ff.label.length > 0 && !ff.label.match(/^\\d+$/)) {\n\t\t\t\t\t\tfileFormatFamilies[ff.label] = ff.value;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * If a SearchRules object is initialized without any arguments, it will contain a single default SearchRule.\n\t * If it is passed an array of N objects containing SearchRule attributes, N SearchRule models will be added.\n\t * with those attributes set and all other attributes default. An optional second argument can be\n\t * an object specifying any subset of the eight general search parameters.\n\t * @override\n\t */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.matchCriteria = 0;\n\n\t\t/**\n\t\t * Max items to fetch (0 is all)\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.maxItems = 0;\n\n\t\t/**\n\t\t * sALO string map\n\t\t * @memberOf Netx.Collections.SearchRules\n\t\t * @property {object} sALOstrMap - sALO string map\n\t\t * @property {string} sALOstrMap.a - Sort field\n\t\t * @property {string} sALOstrMap.b - Sort order\n\t\t * @property {string} sALOstrMap.c - Match criteria\n\t\t * @property {string} sALOstrMap.d - Element types\n\t\t * @property {string} sALOstrMap.e - Element sub type 1\n\t\t * @property {string} sALOstrMap.f - Element sub type 2\n\t\t * @property {string} sALOstrMap.g - Element value 1\n\t\t * @property {string} sALOstrMap.h - Element value 2\n\t\t * @property {string} sALOstrMap.i - Element value 3\n\t\t * @property {string} sALOstrMap.j - Save search\n\t\t * @property {string} sALOstrMap.k - Notify type\n\t\t * @property {string} sALOstrMap.l - Ignore stat\n\t\t * @property {string} sALOstrMap.m - Start position\n\t\t * @property {string} sALOstrMap.n - Max items\n\t\t */\n\t\tthis.sALOstrMap = opts.sALOstrMap || {\n\t\t\ta: 'sortField',\n\t\t\tb: 'sortOrder',\n\t\t\tc: 'matchCriteria',\n\t\t\td: 'elementTypes',\n\t\t\te: 'elementSubType1s',\n\t\t\tf: 'elementSubType2s',\n\t\t\tg: 'elementValue1s',\n\t\t\th: 'elementValue2s',\n\t\t\ti: 'elementValue3s',\n\t\t\tj: 'saveSearch',\n\t\t\tk: 'notifyType',\n\t\t\tl: 'ignoreStat',\n\t\t\tm: 'startPosition',\n\t\t\tn: 'maxItems',\n\t\t};\n\n\t\t/**\n\t\t * For fetching a saved search from the DAM\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.savedSearchId = 0;\n\n\t\t/**\n\t\t * The field to sort by\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.sortField = 'file';\n\n\t\t/**\n\t\t * The sort order\n\t\t * Ascending: 0, Descending: 1\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.sortOrder = 0;\n\n\t\t/**\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.startPosition = 1;\n\n\t\t// Set non-rule defaults.\n\t\tthis.initProperties(opts);\n\n\t\t// If we are initialized without models, insert a default rule.\n\t\tif (!models) {\n\t\t\tthis.add(new Model());\n\t\t}\n\t\t// else {\n\t\t// \t// TODO: This seems to be necessary, but I don't get why. The parent constructor was handed 'objects' and should have\n\t\t// \t// turned it into objects, but it didn't. Need to figure this out ... -m-\n\t\t// \tthis.set( objects );\n\t\t// }\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} option Option name\n\t * @param {mixed} value Option value\n\t * @param {object} opts Options\n\t */\n\tchangeOption(option, value, opts = {}) {\n\t\tswitch (option) {\n\t\t\tcase 'matchCriteria':\n\t\t\t\tvalue = parseInt(value);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst oldValue = this[option];\n\t\tthis[option] = value;\n\n\t\tif (opts.silent && oldValue !== value) {\n\t\t\tthis.trigger('change:' + option, this, value, opts).trigger(\n\t\t\t\t'change:option',\n\t\t\t\tthis,\n\t\t\t\toption,\n\t\t\t\tvalue,\n\t\t\t\topts,\n\t\t\t);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Aggregate the various arguments used by our search API calls\n\t * (such as searchAssetListObjects(), aka \"sALO\"),\n\t * into one handy object.\n\t *\n\t * @method\n\t * @param {boolean} ignoreQuirks Ignore quirks\n\t * @return {object} Asset search object\n\t */\n\tcreateSearchObject(ignoreQuirks = false) {\n\t\tlet elementTypes = [];\n\t\tlet elementSubType1s = [];\n\t\tlet elementSubType2s = [];\n\t\tlet elementValue1s = [];\n\t\tlet elementValue2s = [];\n\t\tlet elementValue3s = [];\n\n\t\tthis.forEach((model) => {\n\t\t\tconst searchObject = model.getSearchObject(ignoreQuirks);\n\t\t\tconst values = searchObject.elementValue1;\n\n\t\t\t// Either we care not about the quirks of our sALO params\n\t\t\t// or we do not have any multiple value search rules\n\t\t\tif (ignoreQuirks || !_.isArray(values)) {\n\t\t\t\telementTypes.push(searchObject.elementType);\n\t\t\t\telementSubType1s.push(searchObject.elementSubType1);\n\t\t\t\telementSubType2s.push(searchObject.elementSubType2);\n\t\t\t\telementValue1s.push(searchObject.elementValue1);\n\t\t\t\telementValue2s.push(searchObject.elementValue2);\n\t\t\t\telementValue3s.push(searchObject.elementValue3);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Support for multiple value search rules\n\t\t\t// We must create a new rule in the sALO params for each\n\t\t\t// value passed on a rule\n\t\t\tconst {\n\t\t\t\telementType,\n\t\t\t\telementSubType1,\n\t\t\t\telementSubType2,\n\t\t\t\telementValue2,\n\t\t\t\telementValue3,\n\t\t\t} = searchObject;\n\t\t\tvalues.forEach((value) => {\n\t\t\t\telementTypes.push(elementType);\n\t\t\t\telementSubType1s.push(elementSubType1);\n\t\t\t\telementSubType2s.push(elementSubType2);\n\t\t\t\telementValue1s.push(value);\n\t\t\t\telementValue2s.push(elementValue2);\n\t\t\t\telementValue3s.push(elementValue3);\n\t\t\t});\n\t\t});\n\n\t\treturn {\n\t\t\tsortField: this.sortField,\n\t\t\tsortOrder: this.sortOrder,\n\t\t\tmatchCriteria: this.matchCriteria,\n\t\t\telementTypes,\n\t\t\telementSubType1s,\n\t\t\telementSubType2s,\n\t\t\telementValue1s,\n\t\t\telementValue2s,\n\t\t\telementValue3s,\n\t\t\tstartPosition: this.startPosition,\n\t\t\tmaxItems: this.maxItems,\n\t\t};\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Request options\n\t */\n\tfetchSearchCriteria(opts) {\n\t\treturn $.when(this.fetchFileTypes(opts), this.fetchFormatFamilies(opts));\n\t}\n\n\t/**\n\t * Intialize the Asset Search Object Properties\n\t * @method\n\t * @param {object} opts Properties to set\n\t */\n\tinitProperties(opts = {}) {\n\t\tconst userPrefKeys = this.userPrefKeys || {};\n\n\t\tlet preferredSortOrder = parseInt(getPreference(userPrefKeys.sortOrder));\n\t\tif (isNaN(preferredSortOrder)) {\n\t\t\tpreferredSortOrder = this.sortOrder;\n\t\t}\n\n\t\t_.extend(this, {\n\t\t\t// Asset attribute to sort on\n\t\t\tsortField:\n\t\t\t\topts.sortField ||\n\t\t\t\tgetPreference(userPrefKeys.sortField) ||\n\t\t\t\tthis.sortField,\n\t\t\t// Ascending: 0, Descending: 1\n\t\t\tsortOrder: opts.sortOrder != null ? opts.sortOrder : preferredSortOrder,\n\t\t\t// Match ALL: 0, Match ANY: 1\n\t\t\tmatchCriteria:\n\t\t\t\topts.matchCriteria != null ? opts.matchCriteria : this.matchCriteria,\n\t\t\t// First asset in query to fetch\n\t\t\tstartPosition:\n\t\t\t\topts.startPosition != null ? opts.startPosition : this.startPosition,\n\t\t\t// Maximum number of items to return (zero == all items?)\n\t\t\tmaxItems: opts.maxItems != null ? opts.maxItems : this.maxItems,\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Non-sALO replacement for above strTosALO\n\t * @method\n\t * @param {string} str Base64 encoded search string\n\t */\n\tloadFromStr(str) {\n\t\tlet small = '';\n\t\ttry {\n\t\t\tsmall = JSON.parse(base64.decode(str));\n\t\t} catch (e) {\n\t\t\t// a bogus URL did not decode into a legit object.\n\t\t\tdispatcher.trigger('app:alert', 'Search not found.', 'Info');\n\t\t\treturn;\n\t\t}\n\n\t\t// clear out any existing rules.\n\t\tthis.reset();\n\t\tthis.initProperties();\n\n\t\t_.each(this.sALOstrMap, (realName, smallName) => {\n\t\t\tif (small[smallName] == null) return;\n\n\t\t\t// the elements of a search object are arrays with pluralized names 'element*s';\n\t\t\t// break those into individual searchRule properties, which are singular\n\t\t\tif (/^element.*s$/.test(realName)) {\n\t\t\t\trealName = realName.replace(/s$/, '');\n\t\t\t\t_.each(small[smallName], (val, idx) => {\n\t\t\t\t\tif (!this.at(idx)) {\n\t\t\t\t\t\tthis.add(new this.model());\n\t\t\t\t\t}\n\t\t\t\t\tthis.at(idx).set(realName, val);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// unpack searchRules properties too:\n\t\t\t\tthis[realName] = small[smallName];\n\t\t\t}\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchRules';\n\t}\n}\n","/**\n * @class\n */\nimport Base from './searchRule';\n\nimport {dateSubTypes1_default} from '../properties/search';\nimport {ATTRIBUTE_TYPE} from '@netx/core-attribute/constants';\nimport {systemAttributes as searchableSystemAttributes} from '../properties/search';\nimport {assetAttributes, getAttribute} from '@netx/core-attribute/singletons';\n\nexport default class SearchRule_Asset extends Base {\n\t/** @type {module/@netx/core-asset/models/attribute} */\n\tget attributeTemplate() {\n\t\tif (!this.searchTargetIsMetadata()) return undefined;\n\n\t\treturn this.assetAttributes.findWhere({\n\t\t\tname: this.get('elementValue2'),\n\t\t});\n\t}\n\n\t/** @type {boolean} */\n\tget isRange() {\n\t\tconst elementType = this.get('elementType');\n\t\treturn (\n\t\t\t(elementType === 3 && this.get('elementSubType1') === 6) ||\n\t\t\t(elementType === 4 && this.get('elementSubType2') === 6)\n\t\t);\n\t}\n\n\t/** @type {boolean} */\n\tget isRangeCompatible() {\n\t\tconst attrName = this.get('elementValue2');\n\t\tconst attr = this.assetAttributes.findWhere({name: attrName});\n\t\tif (!attr) return false;\n\n\t\tconst type = attr.get('type');\n\t\treturn [ATTRIBUTE_TYPE.DATE, ATTRIBUTE_TYPE.NUMBER].includes(type);\n\t}\n\n\t/**\n\t * What search type are we dealing with\n\t * @type {string}\n\t * @default\n\t */\n\tget searchApi() {\n\t\treturn 'assets';\n\t}\n\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t...super.defaults,\n\t\t\telementType: 1, // KEYWORD\n\t\t\telementSubType1: 4, // AND matching of keywords\n\t\t\telementSubType2: 0,\n\t\t\telementValue1: '',\n\t\t\telementValue2: '',\n\t\t\telementValue3: '',\n\n\t\t\t// Client attrs\n\t\t\telementValue1Label: '',\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn ['elementValue1Label'];\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\tthis.assetAttributes = assetAttributes;\n\n\t\t// Hey, listen\n\t\tthis.on('change:elementValue1', (self, elementValue1) => {\n\t\t\tif (elementValue1 !== '') return;\n\t\t\tthis.set('elementValue1Label', '');\n\t\t});\n\t}\n\n\t/** @override */\n\tgetSearchObject(ignoreQuirks) {\n\t\tconst searchObject = this.self();\n\t\tif (ignoreQuirks) return searchObject;\n\n\t\tconst elementType = searchObject.elementType;\n\n\t\t// Attribute\n\t\tif (elementType === 3) {\n\t\t\t// assetId -> objectId ¯\\_(ツ)_/¯\n\t\t\tif (searchObject.elementValue2 === 'assetId') {\n\t\t\t\tsearchObject.elementValue2 = 'objectId';\n\t\t\t}\n\t\t}\n\t\t// DAM-16349 - in-between date search rules needs adjusting (and refactoring)\n\t\t// so it does not need the below date hacking\n\t\t// (even grosser) Do not apply this hack if it was a system defined date\n\t\telse if (\n\t\t\telementType === 4 &&\n\t\t\tsearchObject.elementSubType2 === 6 &&\n\t\t\t// Not the system defined ones\n\t\t\t[0, 1, 3].includes(searchObject.elementSubType1) &&\n\t\t\tsearchObject.elementValue3 !== ''\n\t\t) {\n\t\t\tsearchObject.elementValue2 = searchObject.elementValue3;\n\t\t\tsearchObject.elementValue3 = '';\n\t\t}\n\t\t// All other dates\n\t\telse if (elementType === 4) {\n\t\t\t// DEVNOTE: obscure corner case bug here.\n\t\t\t// .. then it's an attribute Date search.\n\t\t\t// In the UI, Date attributes automagically show up on the 'date' search type UI, and have subtype ids other than the standard set of them.\n\t\t\t// But these searches are encoded differently.\n\t\t\t// In order for this search to work, elementSubType1 can not reference the option in the dropdown but needs to use the value of 2 to signify that we want to use a\n\t\t\t// date attribute - and the value we have chosen via elementSubType1 becomes the value for elementValue3\n\t\t\t// Therefore: change elementSubType1 to 2 and elementValue3 to the name of the attr, which is the elementSubType1 value\n\t\t\tconst elementSubType1 = searchObject.elementSubType1;\n\t\t\tif (\n\t\t\t\t!dateSubTypes1_default.find((item) => item.val === elementSubType1) &&\n\t\t\t\tsearchObject.elementSubType1 !== 2\n\t\t\t) {\n\t\t\t\tsearchObject.elementValue2 = searchObject.elementValue3;\n\t\t\t\tsearchObject.elementValue3 = elementSubType1;\n\t\t\t\tsearchObject.elementSubType1 = 2;\n\t\t\t}\n\t\t}\n\t\t// Checkouts - if all is selected, java seems to want user id to be 0\n\t\tif (elementType === 13 && searchObject.elementSubType1 === 0) {\n\t\t\tsearchObject.elementValue1 = 0;\n\t\t}\n\n\t\treturn searchObject;\n\t}\n\n\t/**\n\t * @method\n\t * @return {array} Searchable attributes\n\t */\n\tgetSearchableAttributes() {\n\t\treturn this.assetAttributes\n\t\t\t.map((attr) => {\n\t\t\t\tconst attrName = attr.get('name');\n\t\t\t\tif (\n\t\t\t\t\tattr.get('system') &&\n\t\t\t\t\t!searchableSystemAttributes.includes(attrName)\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\treturn {label: attr.getLabel(), val: attrName};\n\t\t\t})\n\t\t\t.filter((attr) => attr != null);\n\t}\n\n\t/**\n\t * Is this rule searching on dynamic metadata?\n\t * (as opposed to system metadata or any other type of search.)\n\t * @method\n\t * @return {boolean}\n\t */\n\tsearchTargetIsMetadata() {\n\t\treturn (\n\t\t\tthis.get('elementType') == 3 &&\n\t\t\t!_.isUndefined(getAttribute(null, this.get('elementValue2')))\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchRule_Asset';\n\t}\n}\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport {systemFacetOptions} from '../properties/search';\n\nexport default class SearchFacetOption extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'value';\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.count - Option asset match\n\t * @property {boolean} defaults.selected - Option selected\n\t * @property {string} defaults.value - Option value (an attribute value)\n\t * @property {string} defaults.facetId - Facet id\n\t * @property {string} defaults.facetLabel - Facet label\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\tcount: 0,\n\t\t\tselected: false,\n\t\t\tvalue: '',\n\t\t\tfacetId: 0,\n\t\t\tfacetLabel: '',\n\t\t};\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} attr Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(dispatcher, 'search:facet:option:toggle', (model) => {\n\t\t\t// Only if it concerns us\n\t\t\t// And it concerns us if both value and facetId match\n\t\t\t// As well as matching parent collections\n\t\t\tif (\n\t\t\t\t(!model.collection ||\n\t\t\t\t\tmodel.collection._listenId === this.collection._listenId) &&\n\t\t\t\tmodel.get('facetId') === this.get('facetId') &&\n\t\t\t\tmodel.get('value') === this.get('value')\n\t\t\t) {\n\t\t\t\tthis.toggle();\n\t\t\t}\n\t\t});\n\n\t\t// Set human readable title\n\t\tconst value = this.get('value');\n\t\tconst systemValue = systemFacetOptions[value];\n\t\tthis.attributes.title = systemValue || value;\n\t}\n\t/**\n\t * @method\n\t * @param {boolean} state State\n\t */\n\ttoggle(state) {\n\t\t// Current state\n\t\tconst selected = this.get('selected');\n\t\t// New state\n\t\tconst newstate = !_.isUndefined(state) ? state : !selected;\n\t\t// If changed\n\t\tnewstate != selected && this.set('selected', newstate);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchFacetOption';\n\t}\n}\n","/**\n * A collection for search facet options which come back from the server as an array on searchFacet\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/searchFacetOption';\n\nexport default class SearchFacetOptions extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\t// do a locale (case insensitive) compare\n\t\t// providing a string to `comparator` makes it run through underscore's `sortBy`\n\t\t// and is case sensitivie\n\t\topts.comparator =\n\t\t\topts.comparator ||\n\t\t\tfunction (a, b) {\n\t\t\t\treturn a.get('value').localeCompare(b.get('value'));\n\t\t\t};\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\t}\n\n\t/**\n\t * Get selected options\n\t * @method\n\t * @return {array} Selected\n\t */\n\tgetSelected() {\n\t\t// Return an array of model attribute objects, not whole models\n\t\treturn _.compact(\n\t\t\t_.map(\n\t\t\t\tthis.filter((m) => m.get('selected')),\n\t\t\t\t(m) => m.attributes,\n\t\t\t),\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchFacetOptions';\n\t}\n}\n","/**\n * A Faceted Search returns a list of these objects along with the search results;\n * they can be displayed by searchFacetViews in a faceted search UI,\n * @class Netx.Models.SearchFacet\n * @extends Netx.Model\n * @see Netx.Collections.SearchFacetOptions\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport SearchFacetOptionsCollection from '../collections/searchFacetOptions';\n\nexport default class SearchFacet extends Base {\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.id - Unique id\n\t * @property {string} defaults.label - Facet attribute label\n\t * @property {Netx.Collections.SearchFacetOptions} defaults.options - Facet options for attribute\n\t * @property {string} defaults.label - Facet attribute label (client created)\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t// id: null,\n\t\t\tlabel: '',\n\t\t\toptions: null,\n\t\t\ttitle: '',\n\t\t};\n\t}\n\n\t/**\n\t * Maintain Netx.Collections.SearchFacetOptions for this.attributes.options\n\t * Checks if what is being set is, in part or whole, facet options - parses those out and passes the rest (if any) onto super\n\t * @override\n\t * @param {object|string} key Model key string | Model keys/values object\n\t * @param {mixed} val Value to set on model\n\t * @param {object} options Options for setting\n\t */\n\tset(key, val, options) {\n\t\t// If key is an object and contains our options\n\t\tif (_.isObject(key) && key.options) {\n\t\t\t// Set the rest first so we have an id and all that jazz\n\t\t\tsuper.set(_.omit(key, 'options'), val, options);\n\t\t\t// Setup\n\t\t\treturn this.parseOptions(key.options);\n\t\t}\n\t\t// If key is a single value and is options\n\t\telse if (key === 'options') {\n\t\t\t// Setup\n\t\t\treturn this.parseOptions(val);\n\t\t}\n\t\t// Act as if\n\t\treturn super.set(key, val, options);\n\t}\n\n\t/**\n\t * Check for and create/reset Netx.Collections.SearchFacetOptions on this.attributes.options\n\t * @method\n\t * @param {object} options Facet options\n\t * @fires module:asset#search:facet:option:changed\n\t */\n\tparseOptions(options) {\n\t\t// Map our options to contain this id\n\t\tvar facetId = this.id,\n\t\t\tfacetLabel = this.get('label'),\n\t\t\tfacetTitle = this.get('title');\n\n\t\toptions = _.compact(\n\t\t\t_.map(!_.isArray(options) ? [options] : options, function (o) {\n\t\t\t\t// Only want facets options that matter\n\t\t\t\tif (o.count)\n\t\t\t\t\treturn _.extend({}, o, {\n\t\t\t\t\t\tfacetId: facetId,\n\t\t\t\t\t\tfacetLabel: facetLabel,\n\t\t\t\t\t\tfacetTitle: facetTitle,\n\t\t\t\t\t});\n\t\t\t}),\n\t\t);\n\n\t\t// If we haven't created the collection yet\n\t\tif (!(this.attributes.options || {}).isCollection) {\n\t\t\t// Create\n\t\t\tthis.attributes.options = new SearchFacetOptionsCollection(options);\n\t\t\tthis.addSubCollection(this.attributes.options);\n\t\t\t// Mimic sync\n\t\t\tthis.attributes.options.trigger(\n\t\t\t\t'request:read',\n\t\t\t\tthis.attributes.options,\n\t\t\t\tnull,\n\t\t\t);\n\t\t\tthis.attributes.options.trigger('sync', this.attributes.options, this);\n\n\t\t\t// When the options change I change\n\t\t\tthis.listenTo(this.get('options'), 'change', function (model) {\n\t\t\t\t//this.trigger('change', this, model );\n\t\t\t\tif (model.changed && !_.isUndefined(model.changed.selected)) {\n\t\t\t\t\tdispatcher.trigger(\n\t\t\t\t\t\t'search:facet:option:changed',\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tthis.collection,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t// Already created, just need to update\n\t\telse {\n\t\t\t// Set\n\t\t\tthis.attributes.options.set(options);\n\t\t}\n\t}\n\t/**\n\t * Get selected facet options\n\t * @method\n\t * @return {array} Selected\n\t */\n\tselectedOptions() {\n\t\treturn this.get('options').getSelected();\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchFacet';\n\t}\n}\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/searchFacetOption';\n\nexport default class SearchFacetsSelected extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\n\t\t// When the options change I change\n\t\tthis.on('change:selected', function (model, val, opts) {\n\t\t\t// DAM-19110 - selected facet options are not the same facet options\n\t\t\tconst facet = this.facetsCollection.find({id: model.get('facetId')});\n\t\t\tconst options = facet && facet.get('options');\n\t\t\tconst option = options && options.find({value: model.id});\n\n\t\t\toption && option.toggle(val);\n\t\t});\n\t}\n\n\t/**\n\t * This could come in handy in a situation where we are not updating the facetedSearch until\n\t * something else happens, like a user submits etc (not on each change)\n\t * @method\n\t * @param {Netx.Models.SearchFacetOption} facetOption SearchFacetOption\n\t */\n\ttoggle(facetOption) {\n\t\tconst selected = facetOption.get('selected');\n\t\tconst existing = this.findWhere({\n\t\t\tfacetId: facetOption.get('facetId'),\n\t\t\tvalue: facetOption.get('value'),\n\t\t});\n\n\t\tif (selected && !existing) {\n\t\t\tthis.add(facetOption);\n\t\t} else if (!selected && existing) {\n\t\t\tthis.remove(existing);\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @param {Netx.Collection.SearchFacets} facets SearchFacets\n\t */\n\tupdate(facets) {\n\t\t// Mimic sync - gets rid of the `not-loaded` class\n\t\t// also gets us the `no-assets` class if needed\n\t\tthis.trigger('request:read', this, null);\n\t\tthis.set(facets.selectedFacets());\n\t\tthis.trigger('sync', this, this.models);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchFacetsSelected';\n\t}\n}\n","/**\n * Search Facets collection holds the set of SearchFacets returned by the FacetedSearch API call.\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/searchFacet';\n\nimport Netx from '@netx/core/bootstrap';\n\nimport SearchFacetsSelectedCollection from './searchFacetsSelected';\n\nimport searchConfig from '@netx/core-search/config';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\n\nexport default class SearchFacets extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget hasSelection() {\n\t\treturn this.models.some((facet) => {\n\t\t\treturn facet.selectedOptions().length > 0;\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tcomparator(a, b) {\n\t\ta = a.get('title').toLowerCase();\n\t\tb = b.get('title').toLowerCase();\n\n\t\tif (a < b) return -1;\n\t\tif (b < a) return 1;\n\n\t\treturn 0;\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * filterMode can be one of 'DEFAULT', 'ADDITIVE' or 'SUBTRACTIVE'\n\t\t * See https://confluence.netx.net/display/DEV/Faceted+Search for details\n\t\t * @memberof Netx.Collections.SearchFacets\n\t\t * @alias filterMode\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.filterMode =\n\t\t\topts.filterMode || getPreference('search.facet.filterMode') || 'DEFAULT';\n\n\t\t// Store selected options\n\t\tthis.selected = new SearchFacetsSelectedCollection([]);\n\t\tthis.selected.facetsCollection = this;\n\t\tthis.addSubCollection(this.selected);\n\n\t\t// Hey, listen!\n\t\tthis\n\t\t\t// This is all handled by that collection now but it is handy to see visual toggling prior to a response from the server\n\t\t\t// if this causes any problems- just get rid of it as it is not a must, just aesthetically pleasing\n\t\t\t.listenTo(this, 'change', (facet, facetOption = {}) => {\n\t\t\t\tif (!facetOption.changed || facetOption.changed.selected == null)\n\t\t\t\t\treturn;\n\t\t\t\tthis.selected.toggle(facetOption, facet);\n\t\t\t})\n\t\t\t// When we are reset or synced, update selected\n\t\t\t.listenTo(this, 'sync reset', () => {\n\t\t\t\tthis.selected.update(this);\n\t\t\t});\n\t}\n\n\t/**\n\t * Get selected facet options\n\t * @return {array} Selected facets options\n\t */\n\tselectedFacets() {\n\t\tlet selection = [];\n\t\tthis.each((facet) => {\n\t\t\tconst sOpts = facet.selectedOptions();\n\t\t\tif (!sOpts.length) return;\n\n\t\t\tselection = selection.concat(sOpts);\n\t\t});\n\t\treturn selection;\n\t}\n\n\t/**\n\t * Get selected facet option values\n\t * @return {array} Facets expected by the facetedSearch API call\n\t */\n\tselectedValues() {\n\t\tconst selection = [];\n\t\tthis.each((facet) => {\n\t\t\tconst sOpts = facet.selectedOptions();\n\t\t\tif (!sOpts.length) return;\n\n\t\t\tselection.push({\n\t\t\t\tid: facet.id,\n\t\t\t\tvalues: _.pluck(sOpts, 'value'),\n\t\t\t});\n\t\t});\n\t\treturn selection;\n\t}\n\n\t/**\n\t * Turn facets off\n\t * This mimics a sync so that we get all the proper classes on our views and can handle the hiding\n\t * of the facets view via css\n\t */\n\tturnOff() {\n\t\tthis.trigger('request:read', this, null);\n\t\tthis.reset();\n\t\tthis.trigger('sync', this);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchFacets';\n\t}\n}\n","/**\n * @class\n * @extends Netx.Collections.SearchRules\n */\nimport Base from './searchRules';\nimport Model from '../models/searchRule_asset';\n\nimport {dispatcher} from '@netx/core-next/dispatcher';\n\nimport SearchFacetsCollection from './searchFacets';\n\nimport assetCustomConfig from '@netx/core-asset/config';\nimport base64 from 'core-libs/base64';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport {escapeURI} from '@netx/core/utils/escapeURI';\nimport {unescapeURI} from '@netx/core/utils/unescapeURI';\n\nexport default class SearchRules_Assets extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * Ignore recording stats for our searches\n\t\t * Boolean as number\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.ignoreStat = opts.ignoreStat || 0;\n\n\t\t/**\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.notifyType = opts.notifyType || 0;\n\n\t\t/**\n\t\t * Unless we want to save the search, leave this field blank.\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.saveSearch = opts.saveSearch || '';\n\n\t\t/**\n\t\t * The field to ort by\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tthis.sortField = opts.files || 'file';\n\n\t\t/**\n\t\t * Must be set prior to super\n\t\t * @memberOf Netx.Collections.SearchRules_assets\n\t\t * @alias userPrefKeys\n\t\t * @type {object}\n\t\t */\n\t\tthis.userPrefKeys = _.extend(\n\t\t\t{\n\t\t\t\tsortField: 'asset.list.sort.field',\n\t\t\t\tsortOrder: 'asset.list.sort.order',\n\t\t\t},\n\t\t\topts.userPrefKeys,\n\t\t);\n\n\t\t/**\n\t\t * Last asset in query to fetch\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.maxItems = assetCustomConfig.CHUNK_SIZE + 1;\n\n\t\t/**\n\t\t * When Netx.Collections.Assets uses this search to perform a faceted search mode,\n\t\t * the returned facets will be attached here in a Netx.Collections.SearchFacets object.\n\t\t * @memberOf Netx.Collections.SearchRules_assets\n\t\t * @alias searchFacets\n\t\t */\n\t\tthis.searchFacets = opts.searchFacets || new SearchFacetsCollection();\n\t\tthis.addSubCollection(this.searchFacets);\n\n\t\t// Listen for sort events\n\t\tthis.listenTo(dispatcher, 'user:sort', this.setSort);\n\t}\n\n\t/** @override */\n\tcreateSearchObject(ignoreQuirks) {\n\t\treturn {\n\t\t\t...super.createSearchObject(ignoreQuirks),\n\t\t\tsaveSearch: this.saveSearch,\n\t\t\tnotifyType: this.notifyType,\n\t\t\tignoreStat: this.ignoreStat,\n\t\t};\n\t}\n\n\t/**\n\t * Intialize the Asset Search Object Properties\n\t * @override\n\t * @param {object} opts Properties to set\n\t */\n\tinitProperties(opts = {}) {\n\t\tif (opts.maxItems != null) {\n\t\t\tconsole.warn(\n\t\t\t\t'Error: attempting to set maxItems in search rules collection, but it will be ignored. Set pageSize or chunkSize on asset collection instead.',\n\t\t\t);\n\t\t\tdelete opts.maxItems;\n\t\t}\n\n\t\tsuper.initProperties(opts);\n\n\t\t_.extend(this, {\n\t\t\t// Unless we want to save the search, leave this field blank.\n\t\t\tsaveSearch: opts.saveSearch || this.saveSearch,\n\t\t\t// notifyType\n\t\t\tnotifyType: opts.notifyType != null ? opts.notifyType : this.notifyType,\n\t\t\t// Go ahead and record stats for our searches.\n\t\t\tignoreStat: opts.ignoreStat != null ? opts.ignoreStat : this.ignoreStat,\n\t\t});\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Convert base64 encoded search string to searchRules\n\t * @method\n\t * @param {string} str Base64 encoded search string\n\t * @return {object} Asset search object\n\t */\n\tstrTosALO(str) {\n\t\tlet small = '';\n\t\ttry {\n\t\t\tsmall = JSON.parse(base64.decode(unescapeURI(str)));\n\t\t} catch (e) {\n\t\t\t// a bogus URL did not decode into a legit object.\n\t\t\tdispatcher.trigger('app:alert', 'Search not found.', 'Info');\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst rules = new this.constructor().createSearchObject();\n\t\t_.each(this.sALOstrMap, (realName, smallName) => {\n\t\t\tif (small[smallName] == null) return;\n\t\t\trules[realName] = small[smallName];\n\t\t});\n\n\t\treturn rules;\n\t}\n\n\t/**\n\t * Respond to sort events\n\t * @method\n\t * @param {string} sortField Field to sort by\n\t * @param {number} sortOrder Sort direction ( 0/1 )\n\t */\n\tsetSort(sortField, sortOrder) {\n\t\tthis.sortField = sortField;\n\t\tthis.sortOrder = sortOrder;\n\t}\n\n\t/**\n\t * Convert advanced search rules to a base64 encoded string\n\t * @method\n\t * @return {string} Base64 encoded search string\n\t */\n\ttoStr(useThisSort = false) {\n\t\tconst searchObj = this.createSearchObject(true);\n\t\tconst small = {};\n\t\t// a new object will have the defaults ...\n\t\tconst defs = new this.constructor().createSearchObject();\n\n\t\t// NOTE: portal does not use advanced search\n\t\t// theme uses it but would always be relying on the user sort\n\t\t// this is just a hold over until we can reactify advanced search (creation)\n\t\tif (!useThisSort) {\n\t\t\tsearchObj.sortField = getPreference('asset.list.sort.field') || 'file';\n\t\t\tsearchObj.sortOrder =\n\t\t\t\tparseInt(getPreference('asset.list.sort.order')) || 0;\n\t\t}\n\n\t\t// create a minified object, so the string representation can be smaller.\n\t\t_.each(this.sALOstrMap, (realName, smallName) => {\n\t\t\t// don't store either of these two fields, and don't store any default values.\n\t\t\tif (realName == 'startPosition' || realName == 'maxItems') return;\n\t\t\tsmall[smallName] = searchObj[realName];\n\t\t});\n\n\t\tconst ret = escapeURI(base64.encode(JSON.stringify(small)));\n\t\tif (ret.length > 2000) {\n\t\t\tconsole.warn(\n\t\t\t\t'Warning: advanced search encoded to ' +\n\t\t\t\t\tret.length +\n\t\t\t\t\t' chars; Internet Explorer may fail if total URL lengh > 2083 chars.',\n\t\t\t);\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchRules_Assets';\n\t}\n}\n","/**\n * Collection contains saved search models\n * @class\n */\nimport Base from '@netx/core-share/collections/sharedResources';\nimport Model from '../models/savedSearch';\n\nimport AssetSetModel from '@netx/core-asset/models/assetSet';\n\nimport {types as assetSetTypes} from '@netx/core-asset/properties/assetSets';\nimport {userProfile} from '@netx/core-user/collections/singletons/userProfile';\nimport {\n\tcurrentUserMeetsUserLevel,\n\tUserLevel,\n} from '@netx/core-user/utils/currentUserMeetsUserLevel';\n\nexport default class SavedSearches extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tgetSearchesForUser: 'Loading saved searches',\n\t\t\tgetSharedResources() {\n\t\t\t\treturn this.isFiltered()\n\t\t\t\t\t? 'Filtering saved searches'\n\t\t\t\t\t: 'Loading saved searches';\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tgetSearchesForUser: 'Loaded saved searches',\n\t\t\tgetSharedResources() {\n\t\t\t\treturn this.isFiltered()\n\t\t\t\t\t? 'Filtered saved searches'\n\t\t\t\t\t: 'Loaded saved searches';\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this collection\n\t * @property {method} methods.fetchBeans - Fetch saved search beans\n\t * @property {method} methods.fetchBeansForUser - Fetch saved search beans for user\n\t */\n\tget methods() {\n\t\treturn _.extend(super.methods, {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBeans(opts) {\n\t\t\t\treturn this.fetchBeansForUser(userProfile.id, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {number} userId User id\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBeansForUser(userId, opts) {\n\t\t\t\tif (!currentUserMeetsUserLevel(UserLevel.ADMIN))\n\t\t\t\t\tuserId = userProfile.id;\n\n\t\t\t\treturn [\n\t\t\t\t\t'getSearchesForUser',\n\t\t\t\t\tuserId,\n\t\t\t\t\tthis.modeFilters,\n\t\t\t\t\tthis.filterStr,\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t];\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @property {object} parsers - Parsers for this collection\n\t * @property {method} parsers.fetchBeans - Parse response of saved search beans\n\t * @property {method} parsers.fetchBeansForUser - Parse response of saved search beans\n\t */\n\tget parsers() {\n\t\treturn _.extend(super.parsers, {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Saved carts\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBeans(data, opts) {\n\t\t\t\tthis.set(data, _.extend({merge: true}, opts));\n\n\t\t\t\t!opts.silent && this.trigger('sync', this, data, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Saved carts\n\t\t\t * @param {number} userId User id\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBeansForUser(data, userId, opts) {\n\t\t\t\tthis.set(data, opts);\n\n\t\t\t\t!opts.silent && this.trigger('sync', this, data, opts);\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @override\n\t * @listens module:search#search:saved:delete:success\n\t * @listens module:search#search:save:success\n\t */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\topts.resourceName = opts.resourceName || 'savedSearch';\n\n\t\tsuper(models, opts);\n\n\t\t// Set name filter if provided\n\t\tthis.filterStr = opts.filterStr || '';\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(dispatcher, 'search:saved:delete:success', (savedSearch) => {\n\t\t\tconst model = this.get(savedSearch.id);\n\t\t\tmodel && this.remove(model);\n\t\t}).listenTo(\n\t\t\tdispatcher,\n\t\t\t'search:save:success',\n\t\t\t(savedSearches, savedSearch) => {\n\t\t\t\tthis.matchesFilters(savedSearch) &&\n\t\t\t\t\tthis.unshift(savedSearch.attributes);\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @return {module:asset/models/assetSet}\n\t */\n\ttoAssetSet() {\n\t\treturn new AssetSetModel({\n\t\t\ttype: assetSetTypes.search,\n\t\t\tids: this.ids(),\n\t\t\tlabel: i18n.t('i18n.savedSearches'),\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SavedSearches';\n\t}\n}\n","import Netx from '@netx/core/bootstrap';\nimport {dispatcher} from '@netx/core-next/dispatcher';\nimport SavedSearchesCollection from '../savedSearches';\n\nexport const allSavedSearches = new SavedSearchesCollection([], {\n\tpager: {pageSize: 0x7fffffff},\n});\n\nallSavedSearches\n\t.on(\n\t\t'add',\n\t\t(model) =>\n\t\t\tmodel.isFavorite() && favoriteSavedSearches.add(model.attributes),\n\t)\n\t.on('destroy', (model) => favoriteSavedSearches.remove(model.id))\n\t.listenTo(dispatcher, 'search:save:success', (_, savedSearchBean) => {\n\t\tconst model = allSavedSearches.get(savedSearchBean.id);\n\t\tif (!model) return;\n\t\tmodel.set({...savedSearchBean.attributes});\n\t});\n\nexport const favoriteSavedSearches = new SavedSearchesCollection([], {\n\tpager: {pageSize: 0x7fffffff, pagesToDisplay: 0},\n\tmodeFilters: ['favorites'],\n});\n\nexport default {allSavedSearches, favoriteSavedSearches};\n","export default {\n\tASSET_LIST_ID: 'search-assets',\n\tCLIP_LIST_ID: 'search-clips',\n\tSEARCH_ADVANCED_ID: 'search-advanced',\n\tSEARCH_BASIC_ID: 'search-basic',\n\tSEARCH_CLIP_HEADER_ID: 'search-clips-header',\n\tSEARCH_HEADER_ID: 'search-header',\n\tSAVED_SEARCH_ID: 'search-saved',\n\t/**\n\t * Route component for showing the contents a saved search\n\t * @const\n\t * @type {string}\n\t * @default\n\t */\n\tROUTE_SAVED_SEARCH: 'search/saved',\n};\n","/**\n * Saved search model holds data regarding a saved search instance\n * Saved searches are part of the shared resource system\n * `fetch` will get you the shared resource bean for the saved search\n * `fetchBean` will get you the actual saved search bean\n * @class\n */\nimport Base from '@netx/core-share/models/sharedResource';\nimport {URL} from '@netx/core-next/url';\nimport AssetSetModel from '@netx/core-asset/models/assetSet';\n\nimport {types as assetSetTypes} from '@netx/core-asset/properties/assetSets';\nimport customConfig from '../config';\n\nexport default class SavedSearch extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - The defaults for SavedSearch model\n\t * @property {object} defaults.criteria - The default criteria for SavedSearch\n\t * @property {string} defaults.description - The default description for SavedSearch (TODO: description should become part of shared resource and removed from this bean)\n\t * @property {number} defaults.matchCriteria - The default match criteria for SavedSearch\n\t * @property {number} defaults.notifyType - Notify ( 0 = none, 1 = weekly, 2 = daily, 3 = immediately )\n\t * @property {string} defaults.sortField - The default sort field for SavedSearch\n\t * @property {string} defaults.sortOrder - The default sort order for SavedSearch\n\t */\n\tget defaults() {\n\t\treturn _.extend(super.defaults, {\n\t\t\tcriteria: [],\n\t\t\tdescription: '',\n\t\t\tmatchCriteria: 0,\n\t\t\tnotifyType: 0,\n\t\t\tsortField: '',\n\t\t\tsortOrder: 0,\n\t\t});\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this model\n\t * @property {method} methods.create - Create new saved search\n\t * @property {method} methods.remove - Destroy saved search\n\t * @property {method} methods.update - Update saved search\n\t *\n\t * @property {method} methods.duplicateSearch - Duplicate saved search\n\t * @property {method} methods.fetchBean - Fetch saved search bean (fetch gets the shared resource)\n\t * @property {method} methods.setSearch - Set search data\n\t */\n\tget methods() {\n\t\treturn _.extend(super.methods, {\n\t\t\t/**\n\t\t\t * Create saved search\n\t\t\t * @method\n\t\t\t * @private\n\t\t\t */\n\t\t\tcreate: function (opts) {\n\t\t\t\tvar d = new $.Deferred();\n\t\t\t\t// TODO: Need the DAM to return full beans on creation (right now it is sending the full search bean but not the shared resource [which is the one we want])\n\t\t\t\t// in this case (all shared resource cases) it would be the shared resource and not the underlying search bean itself\n\t\t\t\tthis.setSearch().then(function (data) {\n\t\t\t\t\tthis.set({id: data.id}, opts);\n\t\t\t\t\tthis.fetch(opts).then(function () {\n\t\t\t\t\t\td.resolveWith(this, arguments);\n\t\t\t\t\t}, d.reject);\n\t\t\t\t}, d.reject);\n\t\t\t\treturn d.promise();\n\t\t\t},\n\t\t\t/**\n\t\t\t * Destroy saved search\n\t\t\t * @method\n\t\t\t */\n\t\t\tremove: ['deleteSearch', 'id'],\n\t\t\t/**\n\t\t\t * Update saved search\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate: function (opts) {\n\t\t\t\treturn ['setSearch', this.self()];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Duplicate saved search\n\t\t\t * @method\n\t\t\t * @param {string} searchName Saved search name\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tduplicateSearch: function (searchName, opts) {\n\t\t\t\treturn ['duplicateSearch', searchName, this.id];\n\t\t\t},\n\t\t\t/**\n\t\t\t * Fetch saved search\n\t\t\t * @method\n\t\t\t */\n\t\t\tfetchBean: ['getSearch', 'id'],\n\t\t\t/**\n\t\t\t * Set search data\n\t\t\t * @method\n\t\t\t */\n\t\t\tsetSearch: function () {\n\t\t\t\treturn ['setSearch', this.self()];\n\t\t\t},\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tget sharedResourceRoute() {\n\t\treturn `search/saved/${this.id}`;\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts = {}) {\n\t\t/**\n\t\t * Resource type name\n\t\t * @type {string}\n\t\t */\n\t\topts.resourceName = 'savedSearch';\n\n\t\tsuper(attrs, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} fullUrl Return full url\n\t * @return {string}\n\t */\n\tgetRoute(fullUrl) {\n\t\treturn (\n\t\t\t((fullUrl && URL.location.split('#')[0]) || '') +\n\t\t\t'#' +\n\t\t\tcustomConfig.ROUTE_SAVED_SEARCH +\n\t\t\t'/' +\n\t\t\tthis.id\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @return {module:asset/models/assetSet}\n\t */\n\ttoAssetSet() {\n\t\treturn new AssetSetModel({\n\t\t\ttype: assetSetTypes.savedSearch,\n\t\t\tids: [this.id],\n\t\t\tlabel: this.getLabel(),\n\t\t\tmodels: [this],\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SavedSearch';\n\t}\n}\n","/**\n * A SearchRule model holds the data the makes up a single search rule; A SearchRules collection contains 1-10 of these.\n *\n * @param {Array} elementType Integers describing the search types; see search/properties/search.\n * @param {Array} elementSubType1 Integers describing the search subtypes; search/properties/search.\n * @param {Array} elementSubType2 Integers describing the search subtypes; search/properties/search.\n * @param {Array} elementValue1 takes an array of Strings.\n * @param {Array} elementValue2 takes an array of Strings.\n * @param {Array} elementValue3 takes an array of Strings.\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport properties from '../properties/search';\n\nexport default class SearchRule extends Base {\n\t/**\n\t * What search type are we dealing with\n\t * Fall back in case anyone tries to use this model without specifying it is for assets\n\t * @type {string}\n\t * @default\n\t */\n\tget searchApi() {\n\t\treturn 'assets';\n\t}\n\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t// Type\n\t\t\t// SEARCH_TYPE_KEYWORDS - 1\n\t\t\t// SEARCH_TYPE_CONTENTS - 2\n\t\t\t// SEARCH_TYPE_METADATA - 3\n\t\t\t// SEARCH_TYPE_DATE - 4\n\t\t\t// SEARCH_TYPE_CATEGORY - 5 (Path string)\n\t\t\t// SEARCH_TYPE_FILE_FORMAT - 6\n\t\t\t// SEARCH_TYPE_FILE_SIZE - 7\n\t\t\t// SEARCH_TYPE_RAW - 8\n\t\t\t// SEARCH_TYPE_CUSTOM - 9\n\t\t\t// SEARCH_TYPE_CART - 10\n\t\t\t// SEARCH_TYPE_RELATED_ASSETS - 11\n\t\t\t// SEARCH_TYPE_LAST_SEARCH - 12\n\t\t\t// SEARCH_TYPE_CHECKOUT - 13 ( Value1 = userId; zero = all )\n\t\t\t// SEARCH_TYPE_THESAURUS - 14\n\t\t\t// SEARCH_TYPE_BRANCH_CHILDREN - 15\n\t\t\t// SEARCH_TYPE_REVIEWS - 16 (Contextual to user)\n\t\t\t// SEARCH_TYPE_EXPIRE - 17 (All)\n\t\t\t// SEARCH_TYPE_METADATA_HISTORY - 18\n\t\t\t// SEARCH_TYPE_RATING - 19\n\t\t\t// SEARCH_TYPE_LOCATION - 20 (Storage location)\n\t\t\t// SEARCH_TYPE_PROOF - 21 (For showing proofs)\n\t\t\t// SEARCH_TYPE_FILE_ASPECT - 22\n\t\t\t// SEARCH_TYPE_CATEGORY_ID - 23 (value1 must be an integer of the Category ID)\n\t\t\t// SEARCH_TYPE_SAVED_SEARCH - 24 (value1 must be an integer of the Saved Search ID)\n\t\t\t// SEARCH_TYPE_FILE_STATUS - 25 (value1 must be an integer of the status type)\n\t\t\t// SEARCH_TYPE_FILE_FORMAT_FAMILY - 26 (value1 must be one of the known families (from New York or Jersey); see FormatFamilyManager)\n\t\t\t// SEARCH_TYPE_VISUAL - 27\n\t\t\t// SEARCH_TYPE_USER - 29\n\t\t\telementType: 0,\n\n\t\t\t// Sub type 1\n\t\t\t//\n\t\t\t// Keyword/Contents/Metadata\n\t\t\t// QUERY_TYPE_AND - 0\n\t\t\t// QUERY_TYPE_EXACT - 1\n\t\t\t// QUERY_TYPE_OR - 2\n\t\t\t// QUERY_TYPE_NOT - 3\n\t\t\t// QUERY_TYPE_AND_FRAG - 4\n\t\t\t// QUERY_TYPE_OR_FRAG - 5\n\t\t\t// QUERY_TYPE_RANGE - 6\n\t\t\t// QUERY_TYPE_PHRASE - 7\n\t\t\t// QUERY_TYPE_RAW - 8\n\t\t\t// QUERY_TYPE_EMPTY - 9\n\t\t\t// QUERY_TYPE_RESPECT_DIACRITICS - 10\n\t\t\t//\n\t\t\t// Category\n\t\t\t// CATEGORY_TYPE_ONLY_RECURSIVE - 0\n\t\t\t// CATEGORY_TYPE_EXCLUDE_RECURSIVE - 1\n\t\t\t// CATEGORY_TYPE_ONLY - 2\n\t\t\t// CATEGORY_TYPE_EXCLUDE - 3\n\t\t\t// CATEGORY_TYPE_RECURSIVE - 4\n\t\t\t//\n\t\t\t// Checkout\n\t\t\t// CHECKOUT_TYPE_ANY - 0\n\t\t\t// CHECKOUT_TYPE_USER - 1\n\t\t\t//\n\t\t\t// Date\n\t\t\t// DATE_TYPE_CREATION - 0\n\t\t\t// DATE_TYPE_MODIFICATION - 1\n\t\t\t// DATE_TYPE_ATTRIBUTE - 2\n\t\t\t// DATE_TYPE_IMPORT - 3\n\t\t\t//\n\t\t\t// File aspect\n\t\t\t// FILE_ASPECT_TYPE_ORIENTATION - 0\n\t\t\t// FILE_ASPECT_TYPE_DURATION - 1\n\t\t\t// FILE_ASPECT_TYPE_WIDTH - 2\n\t\t\t// FILE_ASPECT_TYPE_HEIGHT - 3\n\t\t\t//\n\t\t\t// File-Format\n\t\t\t// TYPE_ONLY - 0\n\t\t\t// TYPE_EXCLUDE - 1\n\t\t\t//\n\t\t\t// File Size\n\t\t\t// FILE_SIZE_TYPE_APPROXIMATELY - 0\n\t\t\t// FILE_SIZE_TYPE_GREATER_THAN - 1\n\t\t\t// FILE_SIZE_TYPE_LESS_THAN - 2\n\t\t\t// FILE_SIZE_TYPE_EQUAL_TO - 3\n\t\t\t//\n\t\t\t// Rating\n\t\t\t// RATING_TYPE_APPROXIMATELY - 0\n\t\t\t// RATING_TYPE_GREATER_THAN - 1\n\t\t\t// RATING_TYPE_LESS_THAN - 2\n\t\t\t// RATING_TYPE_EQUAL_TO - 3\n\t\t\t//\n\t\t\t// Visual\n\t\t\t// VISUAL_TYPE_ID - 1\n\t\t\t// VISUAL_TYPE_COLOR - 2\n\t\t\t//\n\t\t\t// User\n\t\t\t// USER_TYPE_IMPORT - 0\n\t\t\t// USER_TYPE_MOD \t- 1\n\t\t\telementSubType1: 0,\n\n\t\t\t// Sub type 2\n\t\t\t//\n\t\t\t// Date\n\t\t\t// DATE_ANYTIME - 0\n\t\t\t// DATE_LAST_THREE_MONTHS - 1\n\t\t\t// DATE_LAST_SIX_MONTHS - 2\n\t\t\t// DATE_LAST_YEAR - 3\n\t\t\t// DATE_BEFORE - 4\n\t\t\t// DATE_AFTER - 5\n\t\t\t// DATE_INBETWEEN - 6\n\t\t\t// DATE_LAST_WEEK - 7\n\t\t\t// DATE_LAST_MONTH - 8\n\t\t\t// DATE_LAST_DAY - 9\n\t\t\t// DATE_YESTERDAY - 10\n\t\t\t// DATE_LAST_TWO_MONTHS - 11\n\t\t\t//\n\t\t\t// File Aspect\n\t\t\t// FILE_ASPECT_TYPE_APPROXIMATELY - 0\n\t\t\t// FILE_ASPECT_TYPE_GREATER_THAN - 1\n\t\t\t// FILE_ASPECT_TYPE_LESS_THAN - 2\n\t\t\t// FILE_ASPECT_TYPE_EQUAL_TO - 3\n\t\t\t//\n\t\t\t// File Size\n\t\t\t// FILE_SIZE_SIZE_BYTES - 0\n\t\t\t// FILE_SIZE_SIZE_KBYTES - 1\n\t\t\t// FILE_SIZE_SIZE_MBYTES - 2\n\t\t\t// FILE_SIZE_SIZE_GBYTES - 3\n\t\t\telementSubType2: 0,\n\n\t\t\t// TODO finish documenting values\n\t\t\t// Value 1\n\t\t\t// Date - Date\n\t\t\t// Date (range) - Start date\n\t\t\t// Metadata - Attribute template name\n\t\t\telementValue1: '',\n\t\t\t// Value 2\n\t\t\t// Date (range) - End date\n\t\t\t// Metadata - Attribute value\n\t\t\telementValue2: '',\n\t\t\t// Value 3\n\t\t\telementValue3: '',\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * Search properties to use\n\t\t * @memberOf Netx.Models.SearchRule\n\t\t * @alias searchProps\n\t\t * @type {object}\n\t\t */\n\t\tthis.searchProps = properties[this.searchApi];\n\t}\n\n\t/**\n\t * @method\n\t * @param {boolean} ignoreQuirks Ignore quirks (get a pure rule and not one mangled for the quirks of the sALO params we pass to the server)\n\t * @return {object} Search object\n\t */\n\tgetSearchObject(ignoreQuirks) {\n\t\treturn this.self();\n\t}\n\n\t/**\n\t * We never sync with the server (not currently anyways)\n\t * @override\n\t * @return {boolean}\n\t */\n\tisNew() {\n\t\treturn false;\n\t}\n\n\t/**\n\t * @deparcated - no longer used\n\t * Utility function for looking up the names of type properties that are stored as integers,\n\t * and mapped awkwardly in search/properties/search\n\t * @method\n\t * @param {number} type Integer representation of type; if left out, use this model's type.\n\t * @return {string}\n\t */\n\ttypeName(type) {\n\t\ttype = type || this.get('elementType');\n\n\t\tvar thing = _.findWhere(this.searchProps.elementTypes.options, {val: type});\n\n\t\treturn thing ? thing.label : undefined;\n\t}\n\n\t/**\n\t * @deparcated - no longer used\n\t * Return the name of this model's subtype1 field.\n\t * @method\n\t * @return {string}\n\t */\n\tsubType1Name() {\n\t\tvar type = this.get('elementType');\n\t\tif (_.isUndefined(this.searchProps.elementSubType1s[type].options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tvar thing = _.findWhere(this.searchProps.elementSubType1s[type].options, {\n\t\t\tval: this.get('elementSubType1'),\n\t\t});\n\n\t\treturn thing ? thing.label : undefined;\n\t}\n\n\t/**\n\t * @deparcated - no longer used\n\t * Return the name of this model's subtype2 field.\n\t * @method\n\t * @return {string}\n\t */\n\tsubType2Name() {\n\t\tvar type = this.get('elementType');\n\t\tif (_.isUndefined(this.searchProps.elementSubType2s[type].options)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tvar thing = _.findWhere(this.searchProps.elementSubType2s[type].options, {\n\t\t\tval: this.get('elementSubType2'),\n\t\t});\n\n\t\treturn thing ? thing.label : undefined;\n\t}\n\n\t/**\n\t * Is this rule searching on dynamic metadata?\n\t * (as opposed to system metadata or any other type of search.)\n\t *\n\t * @returns boolean\n\t *\n\t * @method\n\t */\n\tsearchTargetIsMetadata() {\n\t\treturn null;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SearchRule';\n\t}\n}\n","import {enabled as smartLabelsEnabled} from '@netx/core-attribute-smart-labels/enablers';\nimport {i18n} from '@netx/core/i18n';\n\n// Search modes\nexport let modes = {\n\tbasic: i18n.t('i18n.basic'),\n\tclip: i18n.t('i18n.constituentClips'),\n\t'visual:color': i18n.t('i18n.visualColor'),\n};\n\nexport let systemAttributes = ['file', 'name', 'assetId', 'status'];\n\n////////////////////////////////////////\n// Asset searches\n////////////////////////////////////////\nexport let assets = {\n\telementTypes: {\n\t\ttype: 'Select',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.keywords'),\n\t\t\t\tval: 1,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.contents'),\n\t\t\t\tval: 2,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.attributes'),\n\t\t\t\tval: 3,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.date'),\n\t\t\t\tval: 4,\n\t\t\t},\n\t\t\t// {label: \"Category\", val: 5}, // category search by string is buggy & deprecated\n\t\t\t// category search by catId is the future of awesome\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.category'),\n\t\t\t\tval: 23,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.fileFormat'),\n\t\t\t\tval: 6,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.fileSize'),\n\t\t\t\tval: 7,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.advancedRaw'),\n\t\t\t\tval: 8,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.fileAspect'),\n\t\t\t\tval: 22,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.checkouts'),\n\t\t\t\tval: 13,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.savedSearch'),\n\t\t\t\tval: 24,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.fileFormatFamily'),\n\t\t\t\tval: 26,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.visual'),\n\t\t\t\tval: 27,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.user'),\n\t\t\t\tval: 29,\n\t\t\t},\n\t\t],\n\t},\n\telementSubType1s: {\n\t\t// Keywords\n\t\t1: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAllFragments'),\n\t\t\t\t\tval: 4,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyFragment'),\n\t\t\t\t\tval: 5,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchExactly'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchExactlyIncludingDiacriticalMarks'),\n\t\t\t\t\tval: 10,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchExclude'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAllWholeWordsAND'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyWholeWordsOR'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Contents\n\t\t2: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAllFragments'),\n\t\t\t\t\tval: 4,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyFragment'),\n\t\t\t\t\tval: 5,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchExactly'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchExclude'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAllWholeWordsAND'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyWholeWordsOR'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Attributes\n\t\t3: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAllFragments'),\n\t\t\t\t\tval: 4,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyFragment'),\n\t\t\t\t\tval: 5,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchExactly'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchExclude'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAllWholeWordsAND'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyWholeWordsOR'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyRange'),\n\t\t\t\t\tval: 6,\n\t\t\t\t},\n\t\t\t\t// Removed per https://jira.netx.net/browse/DAM-8229\n\t\t\t\t// Possibly related to attributes of type heirarchical?\n\t\t\t\t// {label: \"Options [OPTS]\", val: 7}\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchValueIsEmpty'),\n\t\t\t\t\tval: 11,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchValueIsNotEmpty'),\n\t\t\t\t\tval: 12,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Date\n\t\t4: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t// See dateSubTypes1_default\n\t\t\t],\n\t\t},\n\t\t// Category name is too buggy (5) - use 23\n\t\t// File format\n\t\t6: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.only'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.exclude'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// File size\n\t\t7: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.approximately'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.greaterThan'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.lessThan'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.equalTo'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Advanced(raw)\n\t\t8: {},\n\t\t// Checkouts\n\t\t13: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.all'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.specificUser'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// File Aspect\n\t\t22: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.orientation'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.durationSeconds'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.width'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.height'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Category\n\t\t23: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.onlyRecursive'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.excludeRecursive'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.only'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.exclude'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Saved Search\n\t\t24: {},\n\t\t// File Format Family\n\t\t26: {},\n\t\t// Visual\n\t\t27: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.asset'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.color'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// User\n\t\t29: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.importedBy'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.modifiedBy'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\telementSubType2s: {\n\t\t// Keywords\n\t\t1: {},\n\t\t// Contents\n\t\t2: {},\n\t\t// Attributes\n\t\t3: {},\n\t\t// Date\n\t\t4: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.today'),\n\t\t\t\t\tval: 9,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeYesterday'),\n\t\t\t\t\tval: 10,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeLastWeek'),\n\t\t\t\t\tval: 7,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeLastMonth'),\n\t\t\t\t\tval: 8,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeLastThreeMonths'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeLastSixMonths'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeLastYear'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeBefore'),\n\t\t\t\t\tval: 4,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeAfter'),\n\t\t\t\t\tval: 5,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.rangeInBetween'),\n\t\t\t\t\tval: 6,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Category name is too buggy (5) - use 23\n\t\t// File Format\n\t\t6: {},\n\t\t// File Size\n\t\t7: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.unitBytes'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.unitKbytes'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.unitMbytes'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.unitGbytes'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Advanced(raw)\n\t\t8: {},\n\t\t// Checkouts\n\t\t13: {},\n\t\t// File Aspect - alternate (if elementSubType1s === 0)\n\t\t'22-0': {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.equals'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t22: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.approximately'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.greaterThan'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.lessThan'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.equals'),\n\t\t\t\t\tval: 3,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Category\n\t\t23: {},\n\t\t// Saved Search\n\t\t24: {},\n\t\t// File Format Family\n\t\t26: {},\n\t\t// Visual\n\t\t27: {},\n\t\t// User\n\t\t29: {},\n\t},\n\telementValue1s: {\n\t\t// Keywords\n\t\t1: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// Contents\n\t\t2: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// Attributes\n\t\t3: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// Attribute match empty\n\t\t'3-11': {},\n\t\t// Attribute match not empty\n\t\t'3-12': {},\n\t\t// Date\n\t\t4: {\n\t\t\ttype: 'Date',\n\t\t},\n\t\t// Category name is too buggy (5) - use 23\n\t\t// File Format\n\t\t6: {\n\t\t\ttype: 'Select',\n\t\t\tdata: 'FileType',\n\t\t},\n\t\t// File Size\n\t\t7: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// Advanced(raw)\n\t\t8: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// Checkouts\n\t\t13: {\n\t\t\ttype: 'Select',\n\t\t\tdata: 'User',\n\t\t},\n\t\t// File Aspect - alternate (if elementSubType1s === 0)\n\t\t'22-0': {\n\t\t\ttype: 'Select',\n\t\t\tdata: 'Orientation',\n\t\t},\n\t\t// File Aspect\n\t\t22: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// Category\n\t\t23: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// Saved Search\n\t\t24: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// File Format Family\n\t\t26: {\n\t\t\ttype: 'Select',\n\t\t\tdata: 'FileFormatFamily',\n\t\t},\n\t\t// Visual\n\t\t27: {\n\t\t\ttype: 'Visual',\n\t\t},\n\t\t// User\n\t\t29: {\n\t\t\ttype: 'Select',\n\t\t\tdata: 'User',\n\t\t},\n\t},\n\telementValue2s: {\n\t\t// Keywords\n\t\t1: {},\n\t\t// Contents\n\t\t2: {},\n\t\t// Attributes\n\t\t3: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [],\n\t\t},\n\t\t// Date\n\t\t4: {},\n\t\t// Category name is too buggy (5) - use 23\n\t\t// File Format\n\t\t6: {},\n\t\t// File Size\n\t\t7: {},\n\t\t// Advanced(raw)\n\t\t8: {},\n\t\t// Checkouts\n\t\t13: {},\n\t\t// File Aspect\n\t\t22: {},\n\t\t// Category\n\t\t23: {},\n\t\t// Saved Search\n\t\t24: {},\n\t\t// File Format Family\n\t\t26: {},\n\t\t// Visual\n\t\t27: {},\n\t\t// User\n\t\t29: {},\n\t},\n\telementValue3s: {\n\t\t// Keywords\n\t\t1: {},\n\t\t// Contents\n\t\t2: {},\n\t\t// Attributes\n\t\t3: {},\n\t\t// Date\n\t\t4: {\n\t\t\ttype: 'Date',\n\t\t},\n\t\t// Category name is too buggy (5) - use 23\n\t\t// File Format\n\t\t6: {},\n\t\t// File Size\n\t\t7: {},\n\t\t// Advanced(raw)\n\t\t8: {},\n\t\t// Checkouts\n\t\t13: {},\n\t\t// File Aspect\n\t\t22: {},\n\t\t// Category\n\t\t23: {},\n\t\t// Saved Search\n\t\t24: {},\n\t\t// File Format Family\n\t\t26: {},\n\t\t// Visual\n\t\t27: {},\n\t\t// User\n\t\t29: {},\n\t},\n\tsortFields: {\n\t\t// Expiration date gets inserted in search controller init if expiration is enabled\n\t\t// TODO: Make sort fields a collection that can handle user prefs and events - also, then we can have compartors and sort these things in the DOM\n\t\t// this list gets concated with user defined attribute names and things get out of order\n\t\t// https://jira.netx.net/browse/DAM-9364\n\t\t// expirationDate : i18n.t('i18n.expirationDate'),\n\t\tfile: i18n.t('i18n.file'),\n\t\tname: i18n.t('i18n.name'),\n\t\tassetId: i18n.t('i18n.assetId'),\n\t\tfileFormatFamily: i18n.t('i18n.fileFormatFamily'),\n\t\tfileSize2: i18n.t('i18n.fileSize'),\n\t\tfiletypelabel: i18n.t('i18n.fileType'),\n\t\theight: i18n.t('i18n.height'),\n\t\timportDate: i18n.t('i18n.importDate'),\n\t\tmoddate: i18n.t('i18n.modDate'),\n\t\tcreationdate: i18n.t('i18n.creationDate'),\n\t\tdimensions: i18n.t('i18n.dimensions'),\n\t\trelevance: i18n.t('i18n.relevance'),\n\t\twidth: i18n.t('i18n.width'),\n\t},\n};\n\n// Will be concated with date attributes (on attributes fetch) and applied to assets.elementSubType1s.Date.options\nexport let dateSubTypes1_default = [\n\t{\n\t\tlabel: i18n.t('i18n.creationDate'),\n\t\tval: 0,\n\t},\n\t{\n\t\tlabel: i18n.t('i18n.lastModified'),\n\t\tval: 1,\n\t},\n\t// Type 2 is for searching date attributes, where value3 is set to the attribute name.\n\t// Type 2 is only avialable when there are attribute templates of date type (See: Netx.Collections.Attributes)\n\t{\n\t\tlabel: i18n.t('i18n.importDate'),\n\t\tval: 3,\n\t},\n];\n////////////////////////////////////////\n// !Asset searches\n////////////////////////////////////////\n\n////////////////////////////////////////\n// Attribute searches\n////////////////////////////////////////\nexport let attributes = {\n\telementTypes: {\n\t\ttype: 'Select',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.cart'),\n\t\t\t\tval: 10,\n\t\t\t},\n\t\t],\n\t},\n\telementSubType1s: {\n\t\t// Cart\n\t\t10: {},\n\t},\n\telementSubType2s: {\n\t\t// Cart\n\t\t10: {},\n\t},\n\telementValue1s: {\n\t\t// Cart\n\t\t10: {\n\t\t\ttype: 'Text',\n\t\t},\n\t},\n\telementValue2s: {\n\t\t// Cart\n\t\t10: {},\n\t},\n\telementValue3s: {\n\t\t// Cart\n\t\t10: {},\n\t},\n};\n////////////////////////////////////////\n// !Attribute searches\n////////////////////////////////////////\n\n////////////////////////////////////////\n// Clip searches\n////////////////////////////////////////\nexport let clips = {\n\telementTypes: {\n\t\ttype: 'Select',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.keywords'),\n\t\t\t\tval: 101,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.assets'),\n\t\t\t\tval: 102,\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: i18n.t('i18n.attributes'),\n\t\t\t\tval: 101,\n\t\t\t},\n\t\t],\n\t},\n\telementSubType1s: {\n\t\t// Keywords\n\t\t// Attributes\n\t\t101: {\n\t\t\ttype: 'Select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAllWildcardsAND'),\n\t\t\t\t\tval: 4,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyWildcardsOR'),\n\t\t\t\t\tval: 5,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchExactly'),\n\t\t\t\t\tval: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAllWords'),\n\t\t\t\t\tval: 0,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyWholeWordsOR'),\n\t\t\t\t\tval: 2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchEmpty'),\n\t\t\t\t\tval: 6,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: i18n.t('i18n.matchAnyRange'),\n\t\t\t\t\tval: 9,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t// Assets\n\t\t102: {},\n\t},\n\telementSubType2s: {\n\t\t// Keywords\n\t\t// Attributes\n\t\t101: {},\n\t\t// Assets\n\t\t102: {},\n\t},\n\telementValue1s: {\n\t\t// Keywords\n\t\t// Attributes\n\t\t101: {\n\t\t\ttype: 'Text',\n\t\t},\n\t\t// Assets\n\t\t102: {\n\t\t\ttype: 'Text',\n\t\t},\n\t},\n\telementValue3s: {\n\t\t// Keywords\n\t\t// Attributes\n\t\t101: {},\n\t\t// Assets\n\t\t102: {},\n\t},\n\tsortFields: {\n\t\tstartTime: i18n.t('i18n.startTime'),\n\t\tendTime: i18n.t('i18n.endTime'),\n\t\ttitle: i18n.t('i18n.title'),\n\t},\n};\n////////////////////////////////////////\n// !Clip searches\n////////////////////////////////////////\n\n////////////////////////////////////////\n// Facets\n////////////////////////////////////////\n// Search types facets support\nexport let facetSupports = [\n\t1, // Keyword\n\t2, // Contents\n\t3, // Metadata\n\t4, // Date\n\t5, // Category name\n\t6, // File format\n\t7, // File size\n\t8, // Advanced raw\n\t10, // Cart\n\t13, // Checkouts\n\t14, // Thesaurus - no longer a thing really but still there\n\t22, // File aspect\n\t23, // Category id\n\t24, // Saved search\n\t26, // File format family\n\t27, // Visual search\n\t28, // Active templates\n\t200, // Attribute history\n];\n\n// Translation/readability\nexport let systemFacetOptions = {\n\t'creationDate.older': i18n.t('i18n.older'),\n\t'creationDate.pastMonth': i18n.t('i18n.pastMonth'),\n\t'creationDate.pastWeek': i18n.t('i18n.pastWeek'),\n\t'creationDate.pastYear': i18n.t('i18n.pastYear'),\n\t'creationDate.today': i18n.t('i18n.today'),\n\t'fileSize.extraLarge': i18n.t('i18n.extraLarge'),\n\t'fileSize.large': i18n.t('i18n.large'),\n\t'fileSize.medium': i18n.t('i18n.medium'),\n\t'fileSize.small': i18n.t('i18n.small'),\n\t'fileSize.tiny': i18n.t('i18n.tiny'),\n\t'importDate.older': i18n.t('i18n.older'),\n\t'importDate.pastMonth': i18n.t('i18n.pastMonth'),\n\t'importDate.pastYear': i18n.t('i18n.pastYear'),\n\t'importDate.pastWeek': i18n.t('i18n.pastWeek'),\n\t'importDate.today': i18n.t('i18n.today'),\n\t'modificationDate.older': i18n.t('i18n.older'),\n\t'modificationDate.pastMonth': i18n.t('i18n.pastMonth'),\n\t'modificationDate.pastWeek': i18n.t('i18n.pastWeek'),\n\t'modificationDate.pastYear': i18n.t('i18n.pastYear'),\n\t'modificationDate.today': i18n.t('i18n.today'),\n};\n\n// These are system provided facets\nexport let systemFacets = {\n\tcreationDate: i18n.t('i18n.created'),\n\tfileFormatFamily: i18n.t('i18n.type'),\n\tfileSize: i18n.t('i18n.size'),\n\tfileType: i18n.t('i18n.extension'),\n\tfolder: i18n.t('i18n.folder'),\n\tcategory: i18n.t('i18n.category'),\n\timportDate: i18n.t('i18n.imported'),\n\tmodificationDate: i18n.t('i18n.modified'),\n};\n////////////////////////////////////////\n// !Facets\n////////////////////////////////////////\n\n// Populated by the search module when it initializes.\nexport let fileFormatFamilies = {};\n\n// Populated by the search module when it initializes.\nexport let fileTypes = {};\n\n// For File Aspect of Orientation\nexport let orientationTypes = {\n\t1: i18n.t('i18n.portrait'),\n\t2: i18n.t('i18n.landscape'),\n};\n\n// For saved search notification\nexport let notificationTypes = {\n\t0: i18n.t('i18n.none'),\n\t1: i18n.t('i18n.weekly'),\n\t2: i18n.t('i18n.daily'),\n\t3: i18n.t('i18n.immediately'),\n};\n\n//\nexport let permissionTypes = {\n\tMANAGE: 'manage',\n\tNONE: 'none',\n\tOWN: 'own',\n\tREAD: 'read',\n\tWRITE: 'write',\n};\n\n// Properties that can be updated manually\nexport let searchProperties = [\n\t'sortField',\n\t'sortOrder',\n\t'matchCriteria',\n\t'saveSearch',\n\t'notifyType',\n\t'ignoreStat',\n\t'startPosition',\n\t// 'maxItems' // hands off maxItems! use chunkSize/pageSize instead.\n];\n\n// DEVNOTE:\n// All of these 'options' objects are awkward to use in any context other than when directly generating form select elements.\n// (If they used the key \"value\" instead of \"val\", we could at least use our LVB utitities to parse them.)\n//\n// We need objects that simply define our constants, so we can use them everywhere.\n// For instance, when defining a search in code, we want to use these symbolic constants instead of inline integers,\n// so our code is easier to read.\n\n// Therefore:\n// Here's a function to parse one of these label/val arrays into a normal object:\nexport let normalize = (options) => {\n\tif (options == null) return undefined;\n\n\tconst normalObj = {};\n\t_.each(options, (lvobj) => {\n\t\tnormalObj[lvobj.label] = lvobj.val;\n\t});\n\treturn normalObj;\n};\n// Using that, we can attach meaningful symbolic names to all of the search-rule integer values we use:\n\nconst normal = (assets.normal = {}); // \"The word 'normal' here means 'as done elsewhere (mostly)'.\nnormal.types = normalize(assets.elementTypes.options);\n\n_.each(\n\t['subType1s', 'subType2s', 'value1s', 'value2s', 'value3s'],\n\t(things) => {\n\t\t// the keys we'll use in the 'normal' object\n\t\tconst ruleComponent = assets[`element${_.ucfirst(things)}`]; // 'elementSubType1', 'elementValue3', etc.\n\t\tnormal[things] = {};\n\t\t_.each(_.keys(ruleComponent), (searchType) => {\n\t\t\tnormal[things][searchType] = normalize(ruleComponent[searchType].options);\n\t\t});\n\t},\n);\n\n// TODO: The cms module in portal that is grabbing this file too early (prior to having user prefs)\n// we need to clean that up at some point as we should not be grabbing things from other modules\n// until prefs are returned form the server (for a variety of reasons)\n//\n// For anything that waits for prefs before loading this file\nif (smartLabelsEnabled()) {\n\tassets.sortFields['smart labels'] = i18n.t('i18n.smartLabels');\n}\n// For portal\ndispatcher.once('app:user:prefs:ready', () => {\n\tif (smartLabelsEnabled()) {\n\t\tassets.sortFields['smart labels'] = i18n.t('i18n.smartLabels');\n\t}\n});\n\nexport default {\n\tassets,\n\tattributes,\n\tclips,\n\tdateSubTypes1_default,\n\tfacetSupports,\n\tfileFormatFamilies,\n\tfileTypes,\n\tmodes,\n\tnormal,\n\tnormalize,\n\tnotificationTypes,\n\torientationTypes,\n\tpermissionTypes,\n\tsearchProperties,\n\tsystemFacetOptions,\n\tsystemFacets,\n};\n","import {UserLevel} from '@netx/core-user/constants';\n\nexport const SHARE_MEDIA_SERVICE_FEEDS_MINIMUM_USER_LEVEL = UserLevel.DIRECTOR;\nexport const SHARE_MEDIA_SERVICE_SERVICES_MINIMUM_USER_LEVEL = UserLevel.ADMIN;\n\nexport enum ShareMediaServicesPref {\n\tENABLED = 'mediaServices.enabled',\n}\n","import {getPublicProperty} from '@netx/core-app-next/utils';\nimport {currentUserMeetsUserLevel} from '@netx/core-user/utils/currentUserMeetsUserLevel';\nimport {\n\tShareMediaServicesPref,\n\tSHARE_MEDIA_SERVICE_FEEDS_MINIMUM_USER_LEVEL,\n\tSHARE_MEDIA_SERVICE_SERVICES_MINIMUM_USER_LEVEL,\n} from './constants';\n\nexport const canMangeMediaServiceFeeds = () =>\n\tcurrentUserMeetsUserLevel(SHARE_MEDIA_SERVICE_FEEDS_MINIMUM_USER_LEVEL);\n\nexport const canMangeMediaServiceServices = () =>\n\tcurrentUserMeetsUserLevel(SHARE_MEDIA_SERVICE_SERVICES_MINIMUM_USER_LEVEL);\n\n/** are media services available */\nexport const mediaServicesAvailable = () =>\n\tgetPublicProperty(ShareMediaServicesPref.ENABLED, true);\n","/**\n * DownloadOption collection\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/downloadOption';\n\nimport {types as downloadOptionTypes} from '../properties/downloadOptions';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\n\nexport default class DownloadOptions extends Base {\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\t\tsuper(models, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} type Download options type\n\t */\n\tfilterTypes(type) {\n\t\tif (type != null) {\n\t\t\t// filter us by the given type.\n\t\t\treturn this.where({type: type});\n\t\t}\n\n\t\t// If no argument, return an object with all our models split out by type.\n\t\tconst filtered = {\n\t\t\toriginalOption: this.where({type: downloadOptionTypes.original}) || [],\n\t\t\tproxyOptions: this.where({type: downloadOptionTypes.proxy}) || [],\n\t\t\tviewOptions: this.where({type: downloadOptionTypes.assetView}) || [],\n\t\t\tprocessOptions:\n\t\t\t\tthis.where({type: downloadOptionTypes.presetProcess}) || [],\n\t\t\tmetadataOptions: this.where({type: downloadOptionTypes.metadata}) || [],\n\t\t\tcontactSheetOptions:\n\t\t\t\tthis.where({type: downloadOptionTypes.contactSheet}) || [],\n\t\t};\n\t\t// These three are sometimes lumped together:\n\t\tfiltered.vppOptions = filtered.viewOptions\n\t\t\t.concat(filtered.proxyOptions)\n\t\t\t.concat(filtered.processOptions);\n\t\treturn filtered;\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} type Download options type\n\t * @return {module:share/models/downloadOption}\n\t */\n\tgetOption(type, name) {\n\t\tconst opts = {};\n\n\t\tif (type != null) {\n\t\t\topts.type = type;\n\t\t}\n\n\t\tif (name != null) {\n\t\t\topts.name = name;\n\t\t}\n\n\t\treturn this.findWhere(opts);\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean} Has manual repurpose options\n\t */\n\thasManualRepurposeOptions() {\n\t\tconst manualRepurpose = this.getOption('manualRepurpose');\n\t\treturn manualRepurpose && manualRepurpose.get('options').length > 0;\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} type Download options type\n\t * @return {boolean} Has option\n\t */\n\thasOption(type, name) {\n\t\treturn this.getOption(type, name) != null;\n\t}\n\n\t/**\n\t * Takes the selected download options and filters this collection to only contain selected download options\n\t * @method\n\t * @param {object} selectedDownloadOptions Form object containing user selected download options\n\t */\n\tparseSelectedDownloadOptions(selectedDownloadOptions) {\n\t\t// reduce the option set to just the selected items\n\t\t// continue to next step in workflow: check justification\n\n\t\t// DAM-12078 - set organizeContentsBy on all options but pdf and metadata\n\n\t\tconst selectedDownloadOptionModels = [];\n\n\t\tlet requiresJustification = false;\n\t\tlet requiresApproval = false;\n\n\t\tif (selectedDownloadOptions.original) {\n\t\t\tconst originalOption = this.getOption('original');\n\t\t\tif (originalOption) {\n\t\t\t\toriginalOption.set({\n\t\t\t\t\torganizeContentsBy: selectedDownloadOptions.organizeContentsBy,\n\t\t\t\t});\n\t\t\t\t// Set the embed metadata options\n\t\t\t\tif (selectedDownloadOptions.embedMetadata) {\n\t\t\t\t\toriginalOption.addOptions({\n\t\t\t\t\t\tmetadataMapping: selectedDownloadOptions.embedMetadata,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tselectedDownloadOptionModels.push(originalOption);\n\t\t\t}\n\t\t}\n\n\t\t// Support embeded metadata for manual repurposes\n\t\tconst manualRepurposeOption = this.getOption('manualRepurpose');\n\t\tif (manualRepurposeOption && selectedDownloadOptions.embedMetadata) {\n\t\t\tmanualRepurposeOption.addOptions({\n\t\t\t\tmetadataMapping: selectedDownloadOptions.embedMetadata,\n\t\t\t});\n\t\t}\n\n\t\t// Manual repurpose\n\t\t// If it has options, we use it.\n\t\tconst manualRepurpose = this.getOption('manualRepurpose');\n\t\tconst manualRepurposeOpts =\n\t\t\t(manualRepurpose && manualRepurpose.get('options')) || [];\n\t\tif (manualRepurposeOpts.length) {\n\t\t\tmanualRepurpose.set({\n\t\t\t\torganizeContentsBy: selectedDownloadOptions.organizeContentsBy,\n\t\t\t});\n\t\t\tselectedDownloadOptionModels.push(manualRepurpose);\n\t\t}\n\n\t\t// Loop over sleected proxies\n\t\tlet proxyDownloadOption;\n\t\t_.each(selectedDownloadOptions.proxies, (proxyName) => {\n\t\t\tproxyDownloadOption = this.getOption('proxy', proxyName);\n\t\t\tif (proxyDownloadOption) {\n\t\t\t\tproxyDownloadOption.set({\n\t\t\t\t\torganizeContentsBy: selectedDownloadOptions.organizeContentsBy,\n\t\t\t\t});\n\t\t\t\tselectedDownloadOptionModels.push(proxyDownloadOption);\n\t\t\t}\n\t\t});\n\n\t\t// Loop over selected views\n\t\tlet viewDownloadOption;\n\t\t_.each(selectedDownloadOptions.views, (viewName) => {\n\t\t\tviewDownloadOption = this.getOption('assetView', viewName);\n\t\t\tif (viewDownloadOption) {\n\t\t\t\tviewDownloadOption.set({\n\t\t\t\t\torganizeContentsBy: selectedDownloadOptions.organizeContentsBy,\n\t\t\t\t});\n\t\t\t\tselectedDownloadOptionModels.push(\n\t\t\t\t\tthis.getOption('assetView', viewName),\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\n\t\t// Loop over selected preset processes\n\t\t_.each(selectedDownloadOptions.processes, (processId) => {\n\t\t\t// If it is a true preset process (user defined) it has a numeric id\n\t\t\t// otherwise it is one of those 'fancy' preset processes that come from an XML file and use a unique name rather than a numeric id\n\t\t\tconst presetProcess = !_.isNumeric(processId)\n\t\t\t\t? // Assume name\n\t\t\t\t this.getOption('presetProcess', processId)\n\t\t\t\t: // Assume id\n\t\t\t\t this.findWhere({type: 'presetProcess', id: parseInt(processId)});\n\n\t\t\tif (!presetProcess) return;\n\n\t\t\tpresetProcess.set({\n\t\t\t\torganizeContentsBy: selectedDownloadOptions.organizeContentsBy,\n\t\t\t});\n\n\t\t\t// Set the embed metadata options\n\t\t\tif (selectedDownloadOptions.embedMetadata) {\n\t\t\t\tpresetProcess.addOptions({\n\t\t\t\t\tmetadataMapping: selectedDownloadOptions.embedMetadata,\n\t\t\t\t});\n\t\t\t}\n\t\t\tselectedDownloadOptionModels.push(presetProcess);\n\t\t});\n\n\t\t// PDF (contact sheet)\n\t\tif (selectedDownloadOptions.contactSheet.selected) {\n\t\t\tlet sheetOption = this.getOption('contactSheet');\n\t\t\tif (sheetOption) {\n\t\t\t\tsheetOption.set(\n\t\t\t\t\t_.pick(selectedDownloadOptions.contactSheet, 'name', 'attributeIds'),\n\t\t\t\t);\n\t\t\t\t// Get rid of our client attributes - do not want to risk borking the prepareDownload call\n\t\t\t\t_.each(sheetOption.clientAttrs, (attr) => {\n\t\t\t\t\tsheetOption.unset(attr);\n\t\t\t\t});\n\t\t\t\t// I am guessing the server does not want a null title - so at least respect the other options\n\t\t\t\tconst toPick = [\n\t\t\t\t\t'displayLabels',\n\t\t\t\t\t'highRes',\n\t\t\t\t\t'pdfExportPreset',\n\t\t\t\t\t'templateName',\n\t\t\t\t];\n\t\t\t\tif (selectedDownloadOptions.contactSheet.title) {\n\t\t\t\t\ttoPick.push('title');\n\t\t\t\t}\n\t\t\t\tsheetOption.addOptions(\n\t\t\t\t\t_.pick.apply(\n\t\t\t\t\t\t_,\n\t\t\t\t\t\t[selectedDownloadOptions.contactSheet].concat(toPick),\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\t// DAM-8650: ship our default asset sort prefs to the PDF creator.\n\t\t\t\t// (Maybe someday this will be part of the PDF form, and we'll do this differently.)\n\t\t\t\tsheetOption.addOptions({\n\t\t\t\t\tassetListSortField: getPreference('asset.list.sort.field'),\n\t\t\t\t\tassetListSortOrder: getPreference('asset.list.sort.order'),\n\t\t\t\t});\n\n\t\t\t\tselectedDownloadOptionModels.push(sheetOption);\n\t\t\t}\n\t\t}\n\n\t\t// Attribute data\n\t\tif (selectedDownloadOptions.metadata.selected) {\n\t\t\t// Get a clone of our attribute download option model (not entirely sure why we clone since these things get wiped out on each download prompt)\n\t\t\t// I suppose the clone could be a safeguard for when the prepareDownload call fails, that way we haven't modified the model that the downloadOptionsView\n\t\t\t// is using (since it will still be open on an error)\n\t\t\tlet metadataOption = this.getOption('metadata');\n\t\t\tif (metadataOption) {\n\t\t\t\tmetadataOption = metadataOption.clone();\n\t\t\t\tconst setId = selectedDownloadOptions.metadata.setId;\n\t\t\t\t// If metadata manager is not enabled then we have no attributeSets, only custom\n\t\t\t\t// if (setId == 'custom' || setId == '') {\n\t\t\t\t// \t// User specified a custom set. We received the IDs from the selectedDownloadOptions.\n\t\t\t\t// \tmetadataOption.set(\n\t\t\t\t// \t\t_.pick(selectedDownloadOptions.metadata, 'attributeIds'),\n\t\t\t\t// \t);\n\t\t\t\t// } else {\n\t\t\t\t// \t// User specified an existing set. Get those IDs.\n\t\t\t\t// \tmetadataOption.set(\n\t\t\t\t// \t\t'attributeIds',\n\t\t\t\t// \t\tNetx.asset.attributeSets.get(setId).get('attributeIds'),\n\t\t\t\t// \t);\n\t\t\t\t// }\n\t\t\t\tmetadataOption.set(\n\t\t\t\t\t_.pick(selectedDownloadOptions.metadata, 'attributeIds'),\n\t\t\t\t);\n\t\t\t\tselectedDownloadOptionModels.push(metadataOption);\n\t\t\t}\n\t\t}\n\n\t\t// Historical attribute data\n\t\tif (selectedDownloadOptions.historical) {\n\t\t\tconst historicalOption = this.getOption('historical');\n\t\t\tif (historicalOption) {\n\t\t\t\tselectedDownloadOptionModels.push(historicalOption);\n\t\t\t}\n\t\t}\n\n\t\t// Set this collection with the selected download options\n\t\tthis.reset(selectedDownloadOptionModels);\n\t}\n\n\t/**\n\t * Takes the download options that have already been selected and set the selected attribute as true.\n\t * This is used so the correct download options are selected when editing a token\n\t * @method\n\t * @param {Netx.Collection.DownloadOptions} selectedDownloadOptions The collection of downloadOptions that are selected\n\t */\n\tsetUserSelectedDownloadOptions(selectedDownloadOptions) {\n\t\t// Set original download selected to false. If it's undefined the template will default to using the user pref for original which we do not want when editing\n\t\t// If it is selected, it it will be set correctly below\n\t\tconst originalOption = this.findWhere({type: 'original'});\n\t\toriginalOption && originalOption.set({selected: false});\n\n\t\t_.each(selectedDownloadOptions, (option, idx, all) => {\n\t\t\tlet opt;\n\t\t\tswitch (option.type) {\n\t\t\t\tcase 'original':\n\t\t\t\t\topt = this.findWhere({type: 'original'});\n\t\t\t\t\tif (opt) {\n\t\t\t\t\t\topt.set({selected: true});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'proxy':\n\t\t\t\t\topt = this.findWhere({name: option.name});\n\t\t\t\t\tif (opt) {\n\t\t\t\t\t\topt.set({selected: true});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'presetProcess':\n\t\t\t\t\topt = this.findWhere({name: option.name});\n\t\t\t\t\tif (opt) {\n\t\t\t\t\t\topt.set(option).set({selected: true});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contactSheet':\n\t\t\t\tcase 'historical':\n\t\t\t\tcase 'metadata':\n\t\t\t\t\topt = this.findWhere({type: option.type});\n\t\t\t\t\tif (opt) {\n\t\t\t\t\t\topt.set(option);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// todo: what about views?\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'DownloadOptions';\n\t}\n}\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\n\nimport PagerModel from '@netx/core-app/models/pager';\nimport SorterModel from '@netx/core-app/models/sorter';\n\nimport Netx from '@netx/core/bootstrap';\nimport {dispatcher} from '@netx/core-next/dispatcher';\nimport {userProfile} from '@netx/core-user/collections/singletons/userProfile';\n\nexport default class SharedResources extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this collection\n\t * @property {method} methods.read - Fetch shared resources for current user\n\t * @property {method} methods.fetchForUser - Fetch shared resources for user\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'getSharedResources',\n\t\t\t\t\tuserProfile.id,\n\t\t\t\t\tthis.resourceName,\n\t\t\t\t\tthis.modeFilters,\n\t\t\t\t\tthis.filterStr,\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Admins only\n\t\t\t * @method\n\t\t\t * @param {number} userId User id\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchForUser(userId, opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'getSharedResources',\n\t\t\t\t\tuserId,\n\t\t\t\t\tthis.resourceName,\n\t\t\t\t\tthis.modeFilters,\n\t\t\t\t\tthis.filterStr,\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Parsers for this collection\n\t * @property {method} parsers.fetchForUser - Parse response of user shared resources\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} data Shared resources\n\t\t\t * @param {number} userId User id\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchForUser(data, userId, opts) {\n\t\t\t\topts = opts || {};\n\n\t\t\t\tthis.set(data, opts);\n\t\t\t\t!opts.silent && this.trigger('sync', this, data, opts);\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\tsuper(models, opts);\n\n\t\tthis.resourceName = opts.resourceName;\n\n\t\t/**\n\t\t * This is non negotiable - we use the fields supported by `sharedResourceSortDTO`\n\t\t * @memberof module:share/collections/sharedResources\n\t\t * @override\n\t\t * @alias sortableFields\n\t\t * @type {array}\n\t\t */\n\t\tthis.sortableFields = opts.sortableFields || [\n\t\t\t'id',\n\t\t\t'creationDate',\n\t\t\t'contentCount',\n\t\t\t'modDate',\n\t\t\t'title',\n\t\t];\n\n\t\t/**\n\t\t * Mode filters (read/write/delete/favorites)\n\t\t * @memberof module:share/collections/sharedResources\n\t\t * @alias modeFilters\n\t\t * @type {array}\n\t\t */\n\t\tthis.modeFilters = opts.modeFilters || null;\n\n\t\t/**\n\t\t * Paging model\n\t\t * @memberof module:share/collections/sharedResources\n\t\t * @alias pager\n\t\t * @type {module:app/models/pager}\n\t\t */\n\t\tthis.pager = new PagerModel(_.extend({}, opts.pager), {collection: this});\n\n\t\t/**\n\t\t * Sorting model\n\t\t * @memberof module:asset/models/assetProject\n\t\t * @alias sorter\n\t\t * @type {module:app/models/sorter}\n\t\t */\n\t\tthis.sorter = new SorterModel(\n\t\t\t{\n\t\t\t\tfield: opts.sortField || 'title',\n\t\t\t\torder: opts.sortOrder || 'desc',\n\t\t\t},\n\t\t\t{\n\t\t\t\tcollection: this,\n\t\t\t\tsortableFields: this.sortableFields,\n\t\t\t},\n\t\t);\n\n\t\t/**\n\t\t * Update main collections when a shared resource is toggled as favorite\n\t\t * @listens share:sharedResource:toggle:favorite:success\n\t\t * @param {module:share/models/sharedResource} sharedResource Shared resource\n\t\t * @param {boolean} isFavorite Is favorite\n\t\t */\n\t\tthis.listenTo(\n\t\t\tdispatcher,\n\t\t\t'share:sharedResource:toggle:favorite:success',\n\t\t\t(sharedResource, isFavorite) => {\n\t\t\t\tif (sharedResource.resourceName !== this.resourceName) return;\n\n\t\t\t\tconst model = this.get(sharedResource.id);\n\n\t\t\t\t// Existing, reflect `isFavorite`\n\t\t\t\tmodel && model.set('isFavorite', isFavorite);\n\n\t\t\t\t// We are filtered down to favorites, add or remove the model\n\t\t\t\tif (this.hasModeFilter('favorites')) {\n\t\t\t\t\tisFavorite\n\t\t\t\t\t\t? this.add(sharedResource.attributes, {merge: true})\n\t\t\t\t\t\t: model && this.remove(model);\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} mode Mode\n\t * @return {boolean} Has mode filter\n\t */\n\thasModeFilter(mode) {\n\t\treturn this.modeFilters && _.contains(this.modeFilters, mode);\n\t}\n\n\t/** @override */\n\tisFiltered() {\n\t\tconst filtered = super.isFiltered();\n\t\treturn filtered || this.filterStr !== '' || this.selectedMode != null;\n\t}\n\n\t/**\n\t * @method\n\t * @param {module:share/models/sharedResource} model Shared resource\n\t * @return {boolean}\n\t */\n\tmatchesFilters(model) {\n\t\tif (\n\t\t\tthis.filterStr !== '' &&\n\t\t\t!model.getTitle().toLowerCase().match(this.filterStr.toLowerCase())\n\t\t)\n\t\t\treturn false;\n\n\t\tif (this.hasModeFilter('favorites')) {\n\t\t\treturn model.isFavorite();\n\t\t}\n\n\t\treturn this.selectedMode ? model.allows(this.selectedMode) : true;\n\t}\n\n\t/**\n\t * Reset the mode filter and refetch\n\t * @method\n\t */\n\tresetModeFilter() {\n\t\t// Nothing to reset\n\t\tif (this.selectedMode == null) return new $.Deferred().resolve();\n\n\t\tthis.selectedMode = this.modeFilters = null;\n\t\t// Reset to first page\n\t\tthis.pager.firstPage();\n\t\t// Fetch the unfiltered data\n\t\treturn this.fetch({duplicateQueryPolicy: 'abort'});\n\t}\n\n\t/**\n\t * Set mode filter refetch\n\t * @method\n\t * @param {string} mode Mode filter\n\t */\n\tsetModeFilter(mode) {\n\t\t// No filter, reset\n\t\tif (!mode) return this.resetModeFilter();\n\n\t\t// Nothing to do\n\t\tif (this.selectedMode === mode) return new $.Deferred().resolve();\n\n\t\tthis.selectedMode = mode;\n\n\t\tswitch (mode) {\n\t\t\t// In cases of write (edit)- a user can write to anything they can delete\n\t\t\tcase 'write':\n\t\t\t\tthis.modeFilters = ['delete', 'write'];\n\t\t\t\tbreak;\n\t\t\t// Favorites\n\t\t\t// case 'favorites':\n\t\t\t// The following will enforce that permission ONLY for filtering\n\t\t\t// Manage\n\t\t\t// case 'delete':\n\t\t\t// Read-only\n\t\t\t// case 'read':\n\t\t\tdefault:\n\t\t\t\tthis.modeFilters = [mode];\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Reset to first page\n\t\tthis.pager.firstPage();\n\n\t\treturn this.fetch({duplicateQueryPolicy: 'abort'});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SharedResources';\n\t}\n}\n","/**\n * Describes a possible option for asset downloads(original, view, proxy, repurpose)\n * @class\n * @extends Netx.Model\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport Collection from '@netx/core/lib/netx-collection';\n\nimport {types as downloadOptionTypes} from '../properties/downloadOptions';\n\nexport default class DownloadOption extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\t// not sure if this is right, but for now it has to be something other than 'id'\n\tget idAttribute() {\n\t\treturn 'some-bogus-id';\n\t}\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {string} defaults.type - The default type (see share/properties/downloadOptions#types)\n\t * @property {string} defaults.name - The defualt name (\"thumb\",\"preview\", asset view name, or PDF contact sheet name [1x1, 3x3, or 9x9])\n\t * @property {number} defaults.id - The default processId / attrFieldSet (preset process Id, or metadata AttrFieldSet Id [if zero for Contact Sheet, then use defaults])\n\t * @property {array} defaults.options - The default options (an array of LabelValue objects)\n\t * @property {boolean} defaults.requiresApproval - The default requires approval (read-only from server)\n\t * @property {boolean} defaults.requiresJustification - The default requires justification (read-only from server)\n\t * @property {array} defaults.attributeIds - The default array of attribute ids (for PDF contact sheets, this is sent as the list of attributes to display)\n\t * @property {number} defaults.organizeContentsBy - default option for recursive download zip origanization\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\ttype: '',\n\t\t\tname: '',\n\t\t\tid: 0,\n\t\t\tfamily: '',\n\t\t\toptions: [],\n\t\t\trequiresApproval: false,\n\t\t\trequiresJustification: false,\n\t\t\tattributeIds: [],\n\t\t\torganizeContentsBy: 0, // default to no organization, this is not a user option currently\n\n\t\t\t// Client attributes\n\t\t\t// For PDF (contactSheet)\n\t\t\tengine: 'java',\n\t\t\texportOptions: new Collection([]),\n\t\t\ttemplates: new Collection([]),\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn ['engine', 'exportOptions', 'templates'];\n\t}\n\n\t////////////////////////////////////\n\t// RPC METHODS\n\t////////////////////////////////////\n\t/**\n\t * @property {object} methods - The methods available on this model\n\t * @property {function|array} methods.getPDFTemplateOptions - Request the template options for generating a PDF\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\tgetPDFTemplateOptions: ['getPDFTemplateOptions'],\n\t\t};\n\t}\n\t////////////////////////////////////\n\t// !RPC METHODS\n\t////////////////////////////////////\n\n\tget parsers() {\n\t\treturn {\n\t\t\tgetPDFTemplateOptions: function (response) {\n\t\t\t\tresponse = response || {};\n\t\t\t\t// Set client attributes\n\t\t\t\tthis.set('engine', response.engine || 'java');\n\t\t\t\tthis.get('exportOptions').reset(response.exportOptions);\n\t\t\t\tthis.get('templates').reset(response.templates);\n\t\t\t\treturn response;\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t// Defer so that any code which created this model can have a chance to do anything right after initialization is finished\n\t\t// and just before we shove these client attributes in\n\t\t_.defer(() => {\n\t\t\tswitch (this.get('type')) {\n\t\t\t\tcase downloadOptionTypes.contactSheet:\n\t\t\t\t\tif (!this.has('exportOptions') || !this.has('templates')) {\n\t\t\t\t\t\tthis.set({\n\t\t\t\t\t\t\texportOptions: new Collection([]),\n\t\t\t\t\t\t\ttemplates: new Collection([]),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.getPDFTemplateOptions();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n\n\t// Utility for handling that options array\n\tgetOptions() {\n\t\treturn _.lvbsToObject(this.get('options'));\n\t}\n\n\tsetOptions(obj, opts) {\n\t\treturn this.set({options: _.objectToLvbs(obj)}, opts);\n\t}\n\n\taddOptions(addObject, opts) {\n\t\treturn this.setOptions(_.extend(this.getOptions(), addObject), opts);\n\t}\n\n\t//TODO: this *Options interface is nonstandard and weird. Better to have this.options as a sub-model, and use this.self() & this.parse() to pack it/unpack it.\n\t//see the asset model's .metadata model for an example.\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'DownloadOption';\n\t}\n}\n","/**\n * A Shareable is a simple wrapper for a set of sharable things and its type\n * @class\n * @extends Netx.Model\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport Collection from '@netx/core/lib/netx-collection';\nimport AssetSetModel from '@netx/core-asset/models/assetSet';\n\nimport {types as assetSetTypes} from '@netx/core-asset/properties/assetSets';\n\nexport default class Shareable extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\t/** a type from Netx.ShareableTypes */\n\t\t\ttype: '',\n\t\t\t/** array of object ids, */\n\t\t\tids: [],\n\t\t\t/** optional array of models */\n\t\t\tmodels: [],\n\t\t\t/** optional array of collections */\n\t\t\tcollections: [],\n\t\t\t/** label for the share options view */\n\t\t\tlabel: '',\n\t\t};\n\t}\n\n\t/**\n\t * Constructor options: \"type\" (required) plus one of \"ids\", \"model\", \"models\" or \"collection\"\n\t * For model/models, we extract the ids;\n\t * For collection, we extract all the model IDs in the collection.\n\t */\n\tconstructor(attrs = {}, opts = {}) {\n\t\tif (!_.isString(attrs.type)) {\n\t\t\tthrow new Error('new Shareable(opts): type not found');\n\t\t}\n\n\t\tconst ids = attrs.ids,\n\t\t\tmodel = attrs.model,\n\t\t\tmodels = attrs.models,\n\t\t\tcollection = attrs.collection;\n\n\t\tif (_.isArray(ids) && ids.length) {\n\t\t\tattrs.label =\n\t\t\t\tids.length > 1 ? ids.length + ' ' + attrs.type + 's' : attrs.type;\n\t\t} else if (model && model instanceof Base) {\n\t\t\tattrs.ids = [model.id];\n\t\t\tattrs.models = [model];\n\t\t\tattrs.label = _.isFunction(model.getLabel)\n\t\t\t\t? '\"' + model.getLabel() + '\"'\n\t\t\t\t: attrs.type;\n\t\t} else if (_.isArray(models) && models.length) {\n\t\t\tattrs.ids = _.pluck(models, 'id');\n\t\t\tattrs.label =\n\t\t\t\tmodels.length +\n\t\t\t\t' ' +\n\t\t\t\t(models.length === 1 ? attrs.type.slice(0, -1) : attrs.type);\n\t\t} else if (\n\t\t\tcollection &&\n\t\t\tcollection instanceof Collection &&\n\t\t\tcollection.length\n\t\t) {\n\t\t\tattrs.ids = _.pluck(collection.models, 'id');\n\t\t\tattrs.collections = [collection];\n\t\t\tattrs.label = attrs.type;\n\t\t}\n\n\t\tsuper(attrs, opts);\n\n\t\t// DEVNOTE: i am leaving open the possibility of someday sharing more than one collection,\n\t\t// by defining collections[] as an array. But I'm not going to implement the rest until\n\t\t// it's needed.\n\t\t/*\n\t\telse if (_.isArray(opts.collections)) ... etc\n\t\t*/\n\t}\n\n\t/**\n\t * For forwards- compatibility with the token system ...\n\t */\n\ttoAssetSet() {\n\t\tvar aType;\n\t\tswitch (this.get('type')) {\n\t\t\tcase 'current cart':\n\t\t\t\taType = assetSetTypes.cart;\n\t\t\t\tbreak;\n\t\t\tcase 'saved cart':\n\t\t\t\taType = assetSetTypes.savedCart;\n\t\t\t\tbreak;\n\t\t\tcase 'saved search':\n\t\t\t\taType = assetSetTypes.savedSearch;\n\t\t\t\tbreak;\n\t\t\tcase 'assets':\n\t\t\t\taType = assetSetTypes.asset;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn new AssetSetModel({\n\t\t\tids: this.get('ids'),\n\t\t\tmodels: this.get('models'),\n\t\t\tlabel: this.get('label'),\n\t\t\ttype: aType,\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Shareable';\n\t}\n}\n","/**\n * @class\n */\nimport Base from '@netx/core-permissions/models/permissionResource';\n\nimport ParticipantsCollection from '@netx/core-permissions/collections/participants';\n\nexport default class SharedResource extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.id - The default shared resource id (attribute set id, cart id, search id etc)\n\t * @property {boolean} defaults.canEdit - The default shared resource edit permission (can change the object's criteria [assets, attrs, etc])\n\t * @property {boolean} defaults.canManage - The default shared resource manage permission (can add new participants who can r/w, and can remove participants)\n\t * @property {number} defaults.contentCount - The default shared resource content count\n\t * @property {boolean} defaults.isFavorite - The default shared resource is favorited\n\t * @property {number} defaults.participantCount - The default shared resource other user particpation count\n\t * @property {string} defaults.title - The default shared resource title\n\t */\n\tget defaults() {\n\t\treturn _.extend(super.defaults, {\n\t\t\t// id: 0,\n\t\t\tcanEdit: false,\n\t\t\tcanManage: false,\n\t\t\tcontentCount: 0,\n\t\t\tisFavorite: false,\n\t\t\tparticipantCount: 0,\n\t\t\ttitle: '',\n\t\t});\n\t}\n\n\t/**\n\t * These are not client side defined, but are also not to be sent to the server when\n\t * `this.self()` is called from the extending model\n\t * @memberof module:share/model/sharedResource\n\t * @alias clientAttrs\n\t * @type {array}\n\t */\n\tget clientAttrs() {\n\t\treturn [\n\t\t\t'canEdit',\n\t\t\t'canManage',\n\t\t\t'contentCount',\n\t\t\t'isFavorite',\n\t\t\t'participantCount',\n\t\t];\n\t}\n\n\t/**\n\t * @property {object} methods - Methods for this model\n\t * @property {method} methods.read - Fetch shared resource\n\t *\n\t * @property {method} methods.sendMessageBySharedResource - Notify user that resource has been shared with them\n\t * @property {method} methods.setFavorite - Set/unset shared resource as favorite\n\t */\n\tget methods() {\n\t\treturn _.extend(super.methods, {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread: function (opts) {\n\t\t\t\treturn ['getSharedResource', this.resourceName, this.id];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Notify user that resource has been shared with them\n\t\t\t * @method\n\t\t\t * @param {string} message Message\n\t\t\t * @param {object} userSelector User selector\n\t\t\t */\n\t\t\tsendMessageBySharedResource: function (message, userSelector, opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'sendMessageBySharedResource',\n\t\t\t\t\tthis.resourceName,\n\t\t\t\t\tthis.id,\n\t\t\t\t\tmessage || '',\n\t\t\t\t\tuserSelector,\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {boolean} favorite Favorite\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetFavorite: function (favorite, opts) {\n\t\t\t\treturn ['setFavorite', this.resourceName, this.id, favorite || false];\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @property {object} parsers - Parsers for this model\n\t * @property {function} parsers.fetchBean - Parse the result of full bean tied to shared resource\n\t * @property {function} parsers.setFavorite - Parse the result of set/unset favorite\n\t */\n\tget parsers() {\n\t\treturn _.extend(super.parsers, {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} fullBean Full bean of the thing shared resource is tied to\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tfetchBean: function (fullBean, opts) {\n\t\t\t\tthis.set(fullBean, opts);\n\t\t\t\t!opts.silent && this.trigger('sync', this, fullBean, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {boolean} resp Response (success as a boolean)\n\t\t\t * @param {boolean} favorite Favorite\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetFavorite: function (resp, favorite, opts) {\n\t\t\t\t// If it was successful\n\t\t\t\t// Technically an unsuccessful response should be an error and so we should never hit this parser with a response of `false`\n\t\t\t\tresp && this.set('isFavorite', favorite);\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @override\n\t * @param {object} attrs Model attributes\n\t * @param {object} opts Model options\n\t */\n\tconstructor(attrs, opts = {}) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * @memberof module:share/model/sharedResource\n\t\t * @alias participants\n\t\t * @type {module:share/collections/participants}\n\t\t */\n\t\tlet participants = opts.participants;\n\t\tif (_.isFunction(participants)) {\n\t\t\tparticipants = new participants([], {\n\t\t\t\tresourceId: this.id,\n\t\t\t\tresourceName: this.resourceName,\n\t\t\t});\n\t\t}\n\t\tthis.participants =\n\t\t\tparticipants ||\n\t\t\tnew ParticipantsCollection([], {\n\t\t\t\tresourceId: this.id,\n\t\t\t\tresourceName: this.resourceName,\n\t\t\t});\n\t\tthis.addSubCollection(this.participants);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(this, 'sync', function (model, id) {\n\t\t\tthis.participants.resourceId = this.id;\n\t\t});\n\t\tthis.listenTo(this, 'request:fetchBean', function (model, xhr, opts) {\n\t\t\tthis.trigger('request:read', this, xhr, opts);\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} participant Participant object\n\t * @param {object} opts Request options\n\t * @return {module:permissions/model/participant} Particpant model\n\t */\n\taddParticipant(participant, opts) {\n\t\treturn this.participants.addParticipant(participant, opts);\n\t}\n\n\t/**\n\t * ACL\n\t * @method\n\t * @param {string} perm Permission string ( \"delete\", \"write/(edit)\", \"share\", etc )\n\t * @return {boolean} Allowed\n\t */\n\tallows(perm) {\n\t\tif (perm == null) return;\n\n\t\t// If the data came from the server we can always read it\n\t\tif (perm === 'read') return true;\n\n\t\tswitch (perm) {\n\t\t\t// Can delete saved cart\n\t\t\tcase 'delete':\n\t\t\t\treturn this.canManage();\n\t\t\t// Can download\n\t\t\t// DAM-6555. (Allow access to download; the download process will reveal what can/can't be downloaded.)\n\t\t\tcase 'download':\n\t\t\t\treturn true;\n\t\t\t// Can manage user access to shared resource\n\t\t\tcase 'manage':\n\t\t\tcase 'share':\n\t\t\t\treturn this.canManage();\n\t\t\t// Can add/remove items from shared resource\n\t\t\tcase 'edit':\n\t\t\tcase 'write':\n\t\t\t\treturn this.canManage() || this.canEdit();\n\t\t}\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tcanEdit() {\n\t\tvar perm = this.get('permission');\n\n\t\treturn (\n\t\t\tthis.get('canEdit') === true || perm === 'delete' || perm === 'write'\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tcanManage() {\n\t\tvar perm = this.get('permission');\n\n\t\treturn this.get('canManage') === true || perm === 'delete';\n\t}\n\n\t/**\n\t * Shared resources use participants\n\t * We should try and unify the two and have particpants be how all\n\t * permissions are handled\n\t * @override\n\t * @param {object} opts Request options\n\t */\n\tgetPermissions(opts) {\n\t\treturn this.getParticipants.apply(this, arguments);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Request options\n\t */\n\tgetParticipants(opts) {\n\t\tif (this.isNew()) return new $.Deferred().resolveWith(this.participants);\n\n\t\treturn this.participants.fetch(opts);\n\t}\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tisFavorite() {\n\t\treturn this.get('isFavorite') === true;\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} id Participant id\n\t * @param {object} opts Request options\n\t * @return {module:permissions/model/participant} Particpant model\n\t */\n\tremoveParticipant(id, opts) {\n\t\treturn this.participants.removeParticipant(id, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {string} message Message\n\t * @param {object} userSelector User selector\n\t * @param {object} opts Options\n\t */\n\tsendMessage(message, userSelector, opts) {\n\t\treturn this.sendMessageBySharedResource(message, userSelector, opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Request options\n\t */\n\ttoggleFavorite(opts) {\n\t\tvar favorite = !this.isFavorite();\n\t\treturn this.setFavorite(favorite, opts).then(function () {\n\t\t\treturn this.isFavorite();\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'SharedResource';\n\t}\n}\n","export let contactSheet = {\n\tdefaultEngine: 'java',\n\tdefaultTemplates: {\n\t\t'1x1': {\n\t\t\tmaxAttributes: 10,\n\t\t},\n\t\t'2x2': {\n\t\t\tmaxAttributes: 5,\n\t\t},\n\t\t'3x3': {\n\t\t\tmaxAttributes: 3,\n\t\t},\n\t},\n};\n\nexport const ignoreDownloadWarningTypes = ['contactSheet', 'metadata'];\n\nexport let types = {\n\toriginal: 'original',\n\tproxy: 'proxy',\n\tassetView: 'assetView',\n\tpresetProcess: 'presetProcess',\n\thistorical: 'historical',\n\tmetadata: 'metadata',\n\tcontactSheet: 'contactSheet',\n\tthumb: 'thumb',\n\ttemplateCustomization: 'templateCustomization',\n\tpreview: 'preview',\n\t'1x1': '1x1',\n\t'2x2': '2x2',\n\t'3x3': '3x3',\n};\n\nexport default {contactSheet, ignoreDownloadWarningTypes, types};\n","import {getPreference} from '@netx/core-user/utils/getPreference';\n\n/**\n * Is bulk cart loader enabled\n * @method\n */\nexport const bulkCartLoaderEnabled = (v) => {\n\treturn getPreference('cart.bulkCartLoader.enabled', true);\n};\n","/**\n * Group collection\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/group';\n\nimport PagerModel from '@netx/core-app/models/pager';\n\nexport default class Groups extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tgetGroupObjects: 'Loading groups',\n\t\t\tgetGroups: 'Loading groups',\n\t\t\tgetUsersForGroup: 'Loading users for group',\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tgetGroupObjects: 'Loaded groups',\n\t\t\tgetGroups: 'Loaded groups',\n\t\t\tgetUsersForGroup: 'Loaded users for group',\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} methods - The methods available on this model\n\t * @property {method} methods.read - The read method (get)\n\t * @property {method} methods.getByIds - Fetch groups by passed ids\n\t * @property {method} methods.getGroups - Fetch groups by `this.ids()`\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\treturn ['getGroups', this.filterStr, this.pager.getPageDTO()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {array} ids Group ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetByIds(ids, opts) {\n\t\t\t\tif (!_.isArray(ids)) ids = [ids];\n\t\t\t\treturn ['getGroupObjects', ids];\n\t\t\t},\n\t\t\t// One day, the above method will be a pageable method - will still want access to a full fetch (like users)\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetGroups(opts) {\n\t\t\t\treturn this.getByIds(this.ids(), opts);\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers.getByIds - Groups fetched by passed id\n\t * @property {function} parsers.getGroups - Groups fetched\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} groups Groups\n\t\t\t * @param {array} ids Group ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetByIds(groups, ids, opts = {}) {\n\t\t\t\tthis.set(groups, opts);\n\t\t\t\t!opts.silent && this.trigger('sync', this, groups, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} groups Groups\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetGroups(groups, opts = {}) {\n\t\t\t\tthis.set(groups, opts);\n\t\t\t\t!opts.silent && this.trigger('sync', this, groups, opts);\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @override\n\t * @param {array} models An array of models or model attributes\n\t * @param {object} opts Collection options\n\t */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * Paging model\n\t\t * @memberof module:user/collections/groups\n\t\t * @alias pager\n\t\t * @type {module:app/models/pager}\n\t\t */\n\t\tthis.pager = new PagerModel(\n\t\t\t{\n\t\t\t\t// TODO: collections/models should not need to know about routes/routing\n\t\t\t\troutesToPage: false,\n\t\t\t\tpageSize: 25,\n\t\t\t\t...opts.pager,\n\t\t\t},\n\t\t\t{collection: this},\n\t\t);\n\n\t\t// Hey, listen\n\t\tthis.listenTo(this, 'sync', (collection, data, opts) => {\n\t\t\tif (collection !== this) return;\n\t\t\tif (!opts.ignoreUsers) this.invoke('getUserIds');\n\n\t\t\tthis.stopListening(this, 'add', this.addedGroup).listenTo(\n\t\t\t\tthis,\n\t\t\t\t'add',\n\t\t\t\tthis.addedGroup,\n\t\t\t);\n\t\t}).listenTo(\n\t\t\tthis,\n\t\t\t['request:getGroups', 'request:getByIds'].join(' '),\n\t\t\t(collection, xhr, opts) => {\n\t\t\t\tthis.trigger('request:read', this, xhr, opts);\n\t\t\t},\n\t\t);\n\t}\n\n\t/**\n\t * Retrieve users for newly added group\n\t * @method\n\t * @param {Netx.Models.Group} group Group model\n\t */\n\taddedGroup(group, groups, opts = {}) {\n\t\tif (opts.ignoreUsers === true) return;\n\t\tgroup.getUserIds();\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} groups An array of group objects `{name: <name>}`\n\t * @param {object} opts Options\n\t */\n\tcreateNewGroups(groups, opts = {}) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif (!groups) resolve();\n\n\t\t\tconst existingPromises = [];\n\n\t\t\tconst newGroups = [];\n\t\t\t// Save each group after the other has completed to avoid data locks on the server\n\t\t\tconst next = () => {\n\t\t\t\tif (!groups.length) {\n\t\t\t\t\tPromise.all(existingPromises).then(() => {\n\t\t\t\t\t\tresolve(newGroups);\n\t\t\t\t\t}, reject);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst group = new Model(groups.shift());\n\t\t\t\tgroup.save(opts).then(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tnewGroups.push(group);\n\t\t\t\t\t\tnext();\n\t\t\t\t\t},\n\t\t\t\t\t(err) => {\n\t\t\t\t\t\t// Duplicate name - just pass back and get users added\n\t\t\t\t\t\tif (err.code === -103) {\n\t\t\t\t\t\t\tconst _group = new Model();\n\t\t\t\t\t\t\texistingPromises.push(\n\t\t\t\t\t\t\t\tnew Promise((resolve, reject) => {\n\t\t\t\t\t\t\t\t\t_group.getByName(group.get('name')).then(\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tnewGroups.push(_group);\n\t\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t(err) => {\n\t\t\t\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn next();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tnext();\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {array} ids Group ids\n\t */\n\tdeleteGroups(ids) {\n\t\treturn this.deleteMultiple.apply(this, arguments);\n\t}\n\n\t/*\n\t * @method\n\t * @param {number} page Page number\n\t * @param {object} opts Options\n\t */\n\tgotoPage(page, opts) {\n\t\tif (page === this.curPage) {\n\t\t\treturn new $.Deferred().resolveWith(this);\n\t\t}\n\n\t\tthis.curPage = parseInt(page);\n\t\t// Getting a page for detail view\n\t\treturn this.fetch(\n\t\t\tnull,\n\t\t\t_.extend(\n\t\t\t\t{\n\t\t\t\t\tcurrentPage: page,\n\t\t\t\t\tduplicateQueryPolicy: 'abort',\n\t\t\t\t},\n\t\t\t\topts,\n\t\t\t),\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Groups';\n\t}\n}\n","import UserProfile from '../../models/userProfile';\n\nexport const userProfile = new UserProfile();\n\n// Make sure that our current user's profile instance is updated when/if we edit it in the system area:\nuserProfile.listenTo(dispatcher, 'system:user:edit:success', function (model) {\n\tmodel.id == userProfile.id && userProfile.fetch();\n});\n\nexport default userProfile;\n\nimport {setGlobal} from '@netx/core-next/utils/setGlobal';\n// circular dependency\n// userProfile relies on this to determine if the profile being edited is the user editing it or not\n// will get worked out as we continue switching out data sources\n// if (process.env.NODE_ENV !== 'production') {\nsetGlobal({userProfile});\n//}\n","/**\n * Collection of all users' profiles. Useful for general-purpose how's-it-going stuff between users.\n * @class\n */\nimport Base from '@netx/core/lib/netx-collection';\nimport Model from '../models/userProfile';\n\nimport PagerModel from '@netx/core-app/models/pager';\n\nexport default class Users extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadingMessages() {\n\t\treturn {\n\t\t\tsearchUsers() {\n\t\t\t\treturn this.isFiltered() ? 'Filtering users' : 'Loading users';\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @type {object} */\n\tget xhrLoadedMessages() {\n\t\treturn {\n\t\t\tsearchUsers() {\n\t\t\t\treturn this.isFiltered() ? 'Filtered users' : 'Loaded users';\n\t\t\t},\n\t\t};\n\t}\n\n\t// Everywhere else uses `filterStr` for the, well, filter string\n\t// just mirror what it would have been onto our search params until\n\t// we can sort this out in develop\n\t/** @type {string} */\n\tget filterStr() {\n\t\tif (!this.searchParams) return '';\n\t\treturn this.searchParams.str;\n\t}\n\n\t/** @type {string} */\n\tset filterStr(str) {\n\t\tif (!this.searchParams) return '';\n\t\treturn (this.searchParams.str = str);\n\t}\n\n\t/**\n\t * @property {object} methods - Collection RPC methods\n\t * @property {method} methods.read - Fetch users\n\t * @property {method} methods.downloadUserData - Download all user data\n\t * @property {method} methods._getUsersForCart - Get users for saved cart\n\t * @property {method} methods.getByIds - Fetch users by passed ids\n\t * @property {method} methods.getUserObjectsForGroup - Fetch users by `groupId`\n\t * @property {method} methods.getUsers - Fetch users by `this.ids()`\n\t * @property {method} methods.importUserData - Import users via CSV/XLS\n\t *\n\t * @property {method} methods.getUsersLength - Deprecated - the total user count is on the paging object after a `read`\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * Return user objects for users matching search criteria\n\t\t\t * @param {string} str Search phrase to filter by\n\t\t\t * @param {number} level User type to return, or <code>0</code> for all user types\n\t\t\t * @param {object} paging Page DTO object\n\t\t\t * @type {function}\n\t\t\t */\n\t\t\tread(opts) {\n\t\t\t\tif (this.groupId != null) {\n\t\t\t\t\treturn this.getUserObjectsForGroup(this.groupId, opts);\n\t\t\t\t}\n\t\t\t\tvar searchParams = this.searchParams;\n\t\t\t\treturn [\n\t\t\t\t\t'searchUsers',\n\t\t\t\t\tsearchParams.str,\n\t\t\t\t\tsearchParams.level,\n\t\t\t\t\tthis.pager.getPageDTO(),\n\t\t\t\t];\n\t\t\t},\n\t\t\t// Helpers\n\t\t\t// downloadUserData takes a `UserSelector` object - though it currently only supports all, none and groupIds\n\t\t\t// See: package com.netxposure.module.user.selector.UserSelector for more deails on this object\n\t\t\t// TODO: once this object is fully supported we should mirror it with our own model - then we could pass params and get a valid `UserSelector` to send\n\t\t\t// to any call that will expect one\n\t\t\tdownloadUserData: ['downloadUserData', {all: true}],\n\t\t\t_getUsersForCart: ['getUsersForCart', 'cartId'],\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {array} ids User ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetByIds(ids, opts) {\n\t\t\t\tif (!_.isArray(ids)) ids = [ids];\n\t\t\t\treturn ['getUserObjects', ids];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {number} groupId Group id\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetUserObjectsForGroup(groupId, opts) {\n\t\t\t\treturn ['getUserObjectsForGroup', groupId, this.pager.getPageDTO()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetUsers(opts) {\n\t\t\t\treturn this.getByIds(this.ids(), opts);\n\t\t\t},\n\t\t\timportUserData: [\n\t\t\t\t'importUserData',\n\t\t\t\t'importUserDataParams.fileName',\n\t\t\t\t'importUserDataParams.option',\n\t\t\t],\n\t\t\t// Deprecated - Check the pager\n\t\t\tgetUsersLength: [\n\t\t\t\t'getUsersLength',\n\t\t\t\t'searchParams.str',\n\t\t\t\t'searchParams.level',\n\t\t\t\t'searchParams.field',\n\t\t\t],\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Collection parsers\n\t * @property {function} parsers.getUsers - Parse the results of our users (fetched by id)\n\t * @property {function} parsers.getByIds - Parse the results of our users (fetched by id)\n\t * @property {function} parsers.importUserData - Parse the results of importing user data\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\tread(users, opts = {}) {\n\t\t\t\treturn users.map((user) => ({\n\t\t\t\t\t...user,\n\t\t\t\t\tpassword1: null,\n\t\t\t\t\tpassword2: null,\n\t\t\t\t}));\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} users Results\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetUsers(users, opts = {}) {\n\t\t\t\tthis.set(\n\t\t\t\t\tusers.map((user) => ({...user, password1: null, password2: null})),\n\t\t\t\t\topts,\n\t\t\t\t);\n\t\t\t\t!opts.silent && this.trigger('sync', this, users, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} users Results\n\t\t\t * @param {array} ids User ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetByIds(users, ids, opts = {}) {\n\t\t\t\tthis.set(users, opts);\n\t\t\t\t!opts.silent && this.trigger('sync', this, users, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} results Results\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\timportUserData(results, opts) {\n\t\t\t\t// Put back default data\n\t\t\t\t_.extend(this.importUserDataParams, {\n\t\t\t\t\tfileName: '',\n\t\t\t\t\toption: 1,\n\t\t\t\t});\n\t\t\t\treturn results;\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(models, opts = {}) {\n\t\topts.model = opts.model || Model;\n\n\t\tsuper(models, opts);\n\n\t\t/**\n\t\t * Param for `getUsersForCart` call\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.cartId = opts.cartId;\n\n\t\t/**\n\t\t * Default search params\n\t\t * @memberOf Netx.Collections.Users\n\t\t * @private\n\t\t * @alias defaultSearchParams\n\t\t * @property {object} searchParams - The default search params\n\t\t * @property {string} searchParams.str - The default search param string for user\n\t\t * @property {number} searchParams.level - The default search param number for user level\n\t\t * @default\n\t\t */\n\t\tthis.defaultSearchParams = {\n\t\t\tstr: '',\n\t\t\tlevel: 0,\n\t\t};\n\n\t\t/**\n\t\t * When exporting users you can specify a `group` id\n\t\t * @type {number}\n\t\t * @default\n\t\t */\n\t\tthis.exportGroupId = opts.exportGroup || 0;\n\n\t\t/**\n\t\t * Fetch users based on `groupId`\n\t\t * @type {number}\n\t\t */\n\t\tthis.groupId = opts.groupId;\n\n\t\t/**\n\t\t * Import users params\n\t\t * @memberOf Netx.Collections.Users\n\t\t * @alias importUserDataParams\n\t\t * @property {object} importUserDataParams - The default search params\n\t\t * @property {string} importUserDataParams.fileName - The default import user data file name param\n\t\t * @property {number} importUserDataParams.option - The default import user data option param ( 1 - Add only new users, 2 - Only update existing users, 3 - Add and update, 4 - Delete )\n\t\t * @default\n\t\t */\n\t\tthis.importUserDataParams = _.extend(\n\t\t\t{\n\t\t\t\tfileName: '',\n\t\t\t\toption: 1,\n\t\t\t},\n\t\t\topts.importUserDataParams,\n\t\t);\n\n\t\t/**\n\t\t * Paging model\n\t\t * @memberOf Netx.Collections.Users\n\t\t * @alias pager\n\t\t * @type {Netx.Models.Pager}\n\t\t */\n\t\tthis.pager = new PagerModel(\n\t\t\t_.extend(\n\t\t\t\t{\n\t\t\t\t\t// TODO: collections/models should not need to know about routes/routing\n\t\t\t\t\troutesToPage: false,\n\t\t\t\t},\n\t\t\t\topts.pager,\n\t\t\t),\n\t\t\t{collection: this},\n\t\t);\n\n\t\t/**\n\t\t * Search params\n\t\t * @memberOf Netx.Collections.Users\n\t\t * @alias searchParams\n\t\t * @property {object} searchParams - The default search params\n\t\t * @property {string} searchParams.str - The default search param string for user\n\t\t * @property {number} searchParams.level - The default search param number for user level\n\t\t * @default\n\t\t */\n\t\tthis.searchParams = _.extend(\n\t\t\t{},\n\t\t\tthis.defaultSearchParams,\n\t\t\topts.searchParams,\n\t\t);\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(\n\t\t\tthis,\n\t\t\t['request:getUsers', 'request:getByIds'].join(' '),\n\t\t\t(collection, xhr, opts) => {\n\t\t\t\tthis.trigger('request:read', this, xhr, opts);\n\t\t\t},\n\t\t);\n\t}\n\n\t// TODO: find a way to make this more \"agnostic to where it lives\" and move to netx-collection\n\t// If we agree all paging colelctions with search/filter capabilities will utilize this.searchParams\n\t// clearSearch is all ready to go to Netx.Collection\n\t/**\n\t * Clear search\n\t * @method\n\t * @param {object} opts Request options\n\t */\n\tclearSearch(opts) {\n\t\t// No longer filtered\n\t\tthis.filtered = false;\n\n\t\t// Make sure we actually need to clear\n\t\tconst defaults = this.defaultSearchParams;\n\t\tif (_.isEqual(defaults, this.searchParams)) {\n\t\t\treturn new $.Deferred().resolve();\n\t\t}\n\n\t\t// Put back to defaults\n\t\t_.extend(this.searchParams, defaults);\n\t\treturn this.fetch(opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {number} id Saved cart id\n\t * @param {object} opts Request options\n\t */\n\tgetUsersForCart(id, opts) {\n\t\tthis.cartId = id;\n\t\treturn this._getUsersForCart(opts);\n\t}\n\n\t/**\n\t * Search users\n\t * @method\n\t * @param {object} searchParams Search params\n\t * @param {object} opts Request options\n\t */\n\tsearch(searchParams, opts) {\n\t\tsearchParams = searchParams || {};\n\n\t\t// TODO: search and user level do not work together?\n\n\t\tlet userLevel = parseInt(searchParams.level);\n\t\t// We have to convert this to no access\n\t\tif (userLevel === 0) {\n\t\t\tuserLevel = -1;\n\t\t}\n\t\t// Trully a 'no filter'\n\t\telse if (isNaN(userLevel)) {\n\t\t\tuserLevel = 0;\n\t\t}\n\n\t\t// Extend search params\n\t\t_.extend(this.searchParams, {\n\t\t\tstr: searchParams.str || '',\n\t\t\tlevel: userLevel,\n\t\t});\n\n\t\t// Filtered?\n\t\tconst defaults = this.defaultSearchParams;\n\t\tthis.filtered = !_.isEqual(defaults, this.searchParams);\n\n\t\t// Reset paging start\n\t\t// Pager fires off a fetch when currentPage changes\n\t\t// We are planning on fetching ourselves just below\n\t\t// TODO: it does not fire off a fetch becuase we have set routesToPage: false\n\t\t// since that is false it will not auto fetch - but silent will prevent the pager\n\t\t// view from updating the currently selected page\n\t\t// this is all so gross - refactor one day :pray:\n\t\t// Basically it goes:\n\t\t// pagerModel: page changed, if it does not route to page calls `collection.gotoPage`\n\t\t// let our goto page method handle the fetch\n\t\tif (this.pager.get('currentPage') !== 1) {\n\t\t\tthis.pager.set({currentPage: 1}, opts);\n\t\t} else {\n\t\t\treturn this.fetch(opts);\n\t\t}\n\t}\n\n\t/*\n\t * @method\n\t * @param {number} page Page number\n\t * @param {object} opts Options\n\t */\n\tgotoPage(page, opts) {\n\t\tif (page === this.curPage) {\n\t\t\treturn new $.Deferred().resolveWith(this);\n\t\t}\n\n\t\tthis.curPage = parseInt(page);\n\t\treturn this.fetch(opts);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Users';\n\t}\n}\n","export * from '@netx/core-user-next/constants';\n\nexport const USER_LEVEL = <const>{\n\tNO_ACCESS: 0,\n\tBROWSER: 1,\n\tCONSUMER: 2,\n\tIMPORTER: 3,\n\tPRODUCER: 4,\n\tMANAGER: 7,\n\tDIRECTOR: 8,\n\tADMIN: 9,\n};\n","/**\n * Group model\n * @class\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport UsersCollection from '../collections/users';\n\nexport default class Group extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'groupId';\n\t}\n\n\t/** @type {string} */\n\tget titleAttribute() {\n\t\treturn 'name';\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {number} defaults.groupId - The default system group id\n\t * @property {string} defaults.name - The default system group name\n\t * @property {array} defaults.memberIds - The defualt array of system group users\n\t *\n\t * @todo it's unfortunate that this uses 'memberIds' and not 'userIds'. Refactor?\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\t//groupId: 0,\n\t\t\tname: '',\n\t\t\tmemberIds: [],\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn ['members'];\n\t}\n\n\t/**\n\t * @property {object} methods - The methods available on this model\n\t * @property {method} methods.create - The create method (post)\n\t * @property {method} methods.read - The read method (get)\n\t * @property {method} methods.remove - The destroy method (delete)\n\t * @property {method} methods.update - The update method (put)\n\t *\n\t * @property {method} methods.getGroupObjects - Fetches group objects by id\n\t * @property {method} methods.getUserIds - Fetches user ids for system group\n\t * @property {method} methods.getUsers - Fetches users for system group\n\t * @property {method} methods.setUserIds - Sets users on system group\n\t * @property {method} methods.exportData - Exports system group user data\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tcreate: function (opts) {\n\t\t\t\treturn ['setGroup', this.self()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread: function (opts) {\n\t\t\t\t// We do not have a call to get a single group\n\t\t\t\t// We do have a call to get groups by id, and so we use that and fix the array return part\n\t\t\t\treturn this.getGroupObjects(opts).then(function (groups) {\n\t\t\t\t\tif (!groups.length) return null;\n\n\t\t\t\t\tif (!opts.ignoreUsers) {\n\t\t\t\t\t\treturn this.getUsers(opts).then(function () {\n\t\t\t\t\t\t\treturn groups[0];\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\treturn groups[0];\n\t\t\t\t});\n\t\t\t},\n\t\t\t/** @method */\n\t\t\tremove(opts) {\n\t\t\t\treturn ['deleteGroup', this.id];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate: function (opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'setGroup',\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupId: this.id,\n\t\t\t\t\t\tname: this.get('name'),\n\t\t\t\t\t},\n\t\t\t\t];\n\t\t\t},\n\t\t\t// Helpers\n\t\t\tautolist(name, opts) {\n\t\t\t\treturn ['getGroupAutoList', name];\n\t\t\t},\n\t\t\t// downloadUserData takes a `UserSelector` object - though it currently only supports all, none and groupIds\n\t\t\t// See: package com.netxposure.module.user.selector.UserSelector for more deails on this object\n\t\t\t// TODO: once this object is fully supported we should mirror it with our own model - then we could pass params and get a valid `UserSelector` to send\n\t\t\t// to any call that will expect one\n\t\t\tdownloadUserData: function (opts) {\n\t\t\t\treturn ['downloadUserData', {groupIds: [this.id]}];\n\t\t\t},\n\t\t\t/** @method */\n\t\t\tgetByName(name, opts) {\n\t\t\t\treturn this.autolist(name, opts).then((results) => {\n\t\t\t\t\tconst result = results.find((result) => result.label === name);\n\t\t\t\t\tif (!result) {\n\t\t\t\t\t\treturn new Error(`Group \"${name}\" not found`);\n\t\t\t\t\t}\n\t\t\t\t\tthis.set({[this.idAttribute]: parseInt(result.value)});\n\t\t\t\t\treturn this.fetch();\n\t\t\t\t});\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetGroupObjects: function (opts) {\n\t\t\t\treturn ['getGroupObjects', [this.id]];\n\t\t\t},\n\t\t\t/** @method */\n\t\t\tgetUserIds(opts) {\n\t\t\t\treturn ['getUsersForGroup', this.id];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @deprecated See `this.users`\n\t\t\t */\n\t\t\tgetUsers: ['getUserObjects', 'memberIds'],\n\t\t\t/** @method */\n\t\t\tsetUserIds(opts) {\n\t\t\t\treturn ['setGroupUsers', this.id, this.get('memberIds')];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - The parsers available on this model\n\t * @property {function} parsers.create - Parses result of create method\n\t * @property {function} parsers.update - Parses result of update method\n\t * @property {function} parsers.getUserIds - Parses result of fetched user ids for system group\n\t * @property {function} parsers.getUsers - Parses result of fetched users for system group\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} response Response\n\t\t\t * @param {object} opts Request options\n\t\t\t * @todo return full beans\n\t\t\t */\n\t\t\tcreate: function (response, opts) {\n\t\t\t\t// We just get that messy validation object\n\t\t\t\treturn {\n\t\t\t\t\tgroupId: response.id,\n\t\t\t\t};\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} response Response\n\t\t\t * @param {object} opts Request options\n\t\t\t * @todo return full updated beans\n\t\t\t */\n\t\t\tupdate: function (response, opts) {\n\t\t\t\t// TODO: We were setting the id again to avoid the backbone code\n\t\t\t\t// to add that whole messy validation object to our model\n\t\t\t\t// our id will never change after a creation and we can just\n\t\t\t\t// return `null` until we are getting back useful data from an update\n\t\t\t\t// this.set( { groupId: response.id }, opts );\n\t\t\t\treturn null;\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {array} userIds User ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetUserIds: function (userIds, opts) {\n\t\t\t\tthis.set('memberIds', userIds, opts);\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * @memberof module:user/models/group\n\t\t * @alias users\n\t\t * @type {module:user/collections/users}\n\t\t */\n\t\tthis.users = new UsersCollection([], {\n\t\t\t// Used in a selection mode our labels get tangled\n\t\t\t// see userProfile\n\t\t\tcomparator: function (a, b) {\n\t\t\t\treturn a.getAutocompleteLabel() < b.getAutocompleteLabel() ? -1 : 1;\n\t\t\t},\n\t\t\tgroupId: this.id,\n\t\t\t// We do not have a good solution for paging selected items as of yet\n\t\t\tpager: {\n\t\t\t\tpageSize: 0x7fffffff,\n\t\t\t},\n\t\t});\n\n\t\t// Hey, listen!\n\t\tthis.listenTo(this, 'change:groupId', function (model) {\n\t\t\tthis.users.groupId = this.id;\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} opts Request options\n\t */\n\tfetchUsers(opts) {\n\t\treturn this.users.fetch(\n\t\t\t_.extend(\n\t\t\t\t{\n\t\t\t\t\tduplicateQueryPolicy: 'abort',\n\t\t\t\t\treset: true,\n\t\t\t\t},\n\t\t\t\topts,\n\t\t\t),\n\t\t);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} data Data\n\t * @param {object} opts Options\n\t * @return {boolean} Members updated\n\t */\n\tparseAndSave(data, opts) {\n\t\t// Save changes\n\t\treturn this.save(\n\t\t\t{\n\t\t\t\tname: data.name,\n\t\t\t\tmemberIds: data.ids,\n\t\t\t},\n\t\t\t_.extend({wait: true}, opts),\n\t\t).then(function () {\n\t\t\t// currently setGroupUsers(setUserIds) returns\n\t\t\t// errors that setGroup(setUserIds) does not.\n\t\t\t// so we must call this every time\n\t\t\treturn this.setUserIds().then(\n\t\t\t\t() => {\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\t(e) => {\n\t\t\t\t\tthis.fetchUsers();\n\t\t\t\t\tthrow e;\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Group';\n\t}\n}\n","/**\n * UserProfile: The Netx user object\n * @class\n * @todo DAM-8523\n */\nimport Base from '@netx/core/lib/netx-model';\n\nimport GroupsCollection from '../collections/groups';\n\nimport {types as userTypes} from '../properties/user';\n\nexport default class UserProfile extends Base {\n\t/**\n\t * @type {Netx.Rpc}\n\t * @private\n\t */\n\tget rpc() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tget idAttribute() {\n\t\treturn 'userId';\n\t}\n\t/** @type {string} */\n\tget titleAttribute() {\n\t\treturn 'login';\n\t}\n\n\t/**\n\t * @type {string}\n\t * @default\n\t * @todo This does not belong here - this belongs in Netx.user.options\n\t */\n\tget resetUrl() {\n\t\treturn window.location.href.replace(/#.*$/, '') + '#password-reset';\n\t}\n\n\t/** @type {boolean} */\n\tget xhrTrackProgress() {\n\t\treturn true;\n\t}\n\n\t/**\n\t * @property {object} defaults - The default attribute values\n\t * @property {string} defaults.address1 - Default address line 1\n\t * @property {string} defaults.address2 - Default address line 2\n\t * @property {string} defaults.city - Default city\n\t * @property {string} defaults.country - Default country\n\t * @property {string} defaults.email - Default email address\n\t * @property {string} defaults.expirationDate - Default expiration date as an ANSI-formatted date string (\"2003-11-13\")\n\t * @property {array} defaults.groupIds - Default group ids this user is a member of\n\t * @property {array} defaults.groupNames - Default group names this user is a member of\n\t * @property {string} defaults.login - Default login (username)\n\t * @property {string} defaults.name1 - Default first name\n\t * @property {string} defaults.name2 - Default middle name\n\t * @property {string} defaults.name3 - Default last name\n\t * @property {string} defaults.name4 - Default (???) This value is generally only used with Japanese names\n\t * @property {number} defaults.notify - Default notify (boolean as number). Signifies whether this user should receive email from the application.\n\t * @property {string} defaults.organization - Default organization\n\t * @property {string} defaults.password1 - Default password\n\t * @property {string} defaults.password2 - Default password confirmed\n\t * @property {string} defaults.phone1 - Default home phone\n\t * @property {string} defaults.phone2 - Default work phone\n\t * @property {string} defaults.phone3 - Default cell phone\n\t * @property {string} defaults.phone4 - Default (???) phone\n\t * @property {array} defaults.propertyNames - Default ???\n\t * @property {array} defaults.propertyValues - Default ???\n\t * @property {string} defaults.state - Default state (region)\n\t * @property {number} defaults.type - Default type (user level). See `user/properties/user`\n\t * @property {number} defaults.userId - Default id\n\t * @property {number} defaults.userSource - Default user source. 0 - INTERNAL, 1 - LDAP, 2 - SAML, 3 - PING_ONE, 4 LIVE_CONNECT\n\t * @property {number} defaults.zip - Default postal code\n\t *\n\t * @property {number} defaults.category - Default upload category. See `this.parsers.getUserUploadCategory`\n\t * @property {number} defaults.minimumPasswordLength - Minimum password length. See `this.decodeUserToken`\n\t * @property {string} defaults.passwordChange - ??? Can not find it being utilized anywhere (perhaps it is supposed to be `passwordReset` as seen in `this.passwordChange`? )\n\t * @property {string} defaults.passwordRequest - A string signifying the \"success\" of a password request. See `this.passwordRequest`\n\t * @property {string} defaults.registration - A string signifying the \"success\" of a registration attempt. See `this.registerNewUser`\n\t * @property {string} defaults.strictPasswordInstructions - Strict password instructions. See `this.decodeUserToken`\n\t */\n\tget defaults() {\n\t\treturn {\n\t\t\taddress1: '',\n\t\t\taddress2: '',\n\t\t\tcity: '',\n\t\t\tcountry: '',\n\t\t\temail: '',\n\t\t\texpirationDate: '',\n\t\t\tgroupIds: [],\n\t\t\tgroupNames: [],\n\t\t\tlogin: '',\n\t\t\tname1: '',\n\t\t\tname2: '',\n\t\t\tname3: '',\n\t\t\tname4: '',\n\t\t\tnotify: 1,\n\t\t\torganization: '',\n\t\t\tpassword1: '',\n\t\t\tpassword2: '',\n\t\t\tphone1: '',\n\t\t\tphone2: '',\n\t\t\tphone3: '',\n\t\t\tphone4: 'NA',\n\t\t\tpropertyNames: [],\n\t\t\tpropertyValues: [],\n\t\t\tstate: 'NA',\n\t\t\ttoken: '',\n\t\t\ttype: -1,\n\t\t\t// userId: 0,\n\t\t\tuserSource: 0,\n\t\t\tzip: '',\n\n\t\t\t// Client side attributes\n\t\t\tcategory: 0,\n\t\t\tminimumPasswordLength: 8,\n\t\t\tpasswordChange: '',\n\t\t\tpasswordRequest: '',\n\t\t\tregistration: '',\n\t\t\tstrictPasswordInstructions: '',\n\t\t};\n\t}\n\n\t/** @type {array} */\n\tget clientAttrs() {\n\t\treturn [\n\t\t\t'category',\n\t\t\t'minimumPasswordLength',\n\t\t\t'strictPasswordInstructions',\n\t\t\t'passwordRequest',\n\t\t\t'passwordChange',\n\t\t\t'registration',\n\t\t];\n\t}\n\n\t/**\n\t * @property {object} methods - Model RPC methods\n\t * @property {method} methods.create - Create new user\n\t * @property {method} methods.read - Fetch user\n\t * @property {method} methods.remove - Destroy user\n\t * @property {method} methods.update - Update user\n\t * @property {method} methods.authenticate - Authenticate user\n\t * @property {method} methods.getGroupForUser - Fetch user's groups\n\t * @property {method} methods.getSessionKeyForUser - Fetch user's session key (admin only)\n\t * @property {method} methods.getUserUploadCategory - Fetch user's upload category\n\t * @property {method} methods.login - Login user\n\t * @property {method} methods.logout - Lougout user\n\t * @property {method} methods.logoutUser - Logout specific user by id (spiderman pointing at spiderman.jpg)\n\t * @property {method} methods.passwordReset - Step 2 in reset: Update user password via token from `requestPasswordReset`\n\t * @property {method} methods.requestPasswordReset - Step 1 in reset: Requests that a password reset link be emailed to the user\n\t * @property {method} methods.setUserGroups - Update user groups\n\t * @property {method} methods.userSelfRegistration - Register as user\n\t */\n\tget methods() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tcreate: function (opts) {\n\t\t\t\treturn ['setUser', this.self()];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread: function (opts) {\n\t\t\t\tif (!this.isMe()) {\n\t\t\t\t\t// returns an *array*, see parsers.read()\n\t\t\t\t\treturn ['getUserObjects', [this.id]];\n\t\t\t\t}\n\t\t\t\treturn ['getSelf'];\n\t\t\t},\n\t\t\t/** @method */\n\t\t\t// note: according to flex docs, user cannot delete themselves (returns 0). -1 = fail, 1 = success\n\t\t\tremove: ['deleteUser', 'id'],\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate: function (opts) {\n\t\t\t\t// DAM-5605\n\t\t\t\tif (!this.isMe()) {\n\t\t\t\t\treturn ['setUser', this.self()];\n\t\t\t\t}\n\t\t\t\treturn ['modifyCurrentUserData', this.self()];\n\t\t\t},\n\n\t\t\t/** @method */\n\t\t\tauthenticate: ['authenticate', 'login', 'password1'],\n\t\t\t/** @method */\n\t\t\tgetGroups(opts) {\n\t\t\t\treturn this.getGroupsForUser(opts).then((groupIds) => {\n\t\t\t\t\tthis.set('groupIds', groupIds);\n\n\t\t\t\t\tthis.groups.reset(\n\t\t\t\t\t\tgroupIds.map((id) => {\n\t\t\t\t\t\t\treturn {groupId: id};\n\t\t\t\t\t\t}),\n\t\t\t\t\t\topts,\n\t\t\t\t\t);\n\n\t\t\t\t\tthis.groups.pager.set(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentPage: 1,\n\t\t\t\t\t\t\tpageSize: groupIds.length,\n\t\t\t\t\t\t},\n\t\t\t\t\t\topts,\n\t\t\t\t\t);\n\n\t\t\t\t\treturn this.groups.getGroups(opts);\n\t\t\t\t});\n\t\t\t},\n\t\t\t/** @method */\n\t\t\tgetGroupsForUser(opts) {\n\t\t\t\treturn ['getGroupsForUser', this.id];\n\t\t\t},\n\t\t\t/** @method */\n\t\t\tgetSessionKeyForUser: ['getSessionKeyForUser', 'userId'],\n\t\t\t/** @method */\n\t\t\tgetUserUploadCategory: ['getUserUploadCategory'],\n\t\t\t/** @method */\n\t\t\tlogin: ['authenticateAndGetUserBean', 'login', 'password1'],\n\t\t\t/** @method */\n\t\t\tlogout: ['logoutUser'],\n\t\t\t/** @method */\n\t\t\tlogoutUser: ['logout', 'userId'],\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tpasswordReset: function (opts) {\n\t\t\t\treturn [\n\t\t\t\t\t'changePassword',\n\t\t\t\t\tthis.get('login'),\n\t\t\t\t\t'',\n\t\t\t\t\tthis.get('token'),\n\t\t\t\t\tthis.get('password'),\n\t\t\t\t];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\trequestPasswordReset: function (opts) {\n\t\t\t\treturn ['changePassword', this.get('login'), this.resetUrl, '', ''];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {array} ids Group ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetUserGroups(ids, opts) {\n\t\t\t\treturn ['setUserGroups', this.id, ids];\n\t\t\t},\n\t\t\t/**\n\t\t\t * @method\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tuserSelfRegistration: function (opts) {\n\t\t\t\treturn ['userSelfRegistration', this.self()];\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @property {object} parsers - Model parsers\n\t * @property {function} parsers.create - Parse from creation of new user\n\t * @property {function} parsers.read - Parse fetch of user\n\t * @property {function} parsers.update - Parse update of user\n\t * @property {function} parsers.getGroupForUser - Parse fetch of user's groups\n\t * @property {function} parsers.getUserUploadCategory - Parse fetch of user's upload category\n\t * @property {function} parsers.passwordReset - Parse update of user password via token from `requestPasswordReset`\n\t * @property {function} parsers.requestPasswordReset - Parse request that a password reset link be emailed to the user\n\t * @property {function} parsers.userSelfRegistration - Parse register as user\n\t */\n\tget parsers() {\n\t\treturn {\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} data Data (validation bean)\n\t\t\t * @param {object} opts Request options\n\t\t\t * @todo Get full beans\n\t\t\t */\n\t\t\tcreate: function (data, opts) {\n\t\t\t\treturn {userId: data.id, password1: null, password2: null};\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} data Data (validation bean)\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tread: function (data, opts) {\n\t\t\t\t// kinda hacktacular, but... ? getUsers returns an *array* of user object but we just want one. but getSelf just returns the obj.\n\t\t\t\tif (data instanceof Array) {\n\t\t\t\t\tif (!data.length) return null;\n\n\t\t\t\t\tdata[0].password1 = data[0].password2 = null;\n\t\t\t\t\treturn data[0];\n\t\t\t\t}\n\n\t\t\t\t// modifyCurrentData won't ignore the password fields unless they're set to '********'\n\t\t\t\tdata.password1 = data.password2 = null;\n\t\t\t\treturn data;\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {object} data Data\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tupdate: function (data, opts) {\n\t\t\t\t// get rid of the result entirely, so BackboneRPC doesn't extend it onto Netx.User\n\t\t\t\treturn {\n\t\t\t\t\tpassword1: null,\n\t\t\t\t\tpassword2: null,\n\t\t\t\t};\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {number} categoryId Category id\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tgetUserUploadCategory: function (categoryId, opts) {\n\t\t\t\tthis.set('category', categoryId, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {boolean} resultBool Result\n\t\t\t * @param {object} opts Request options\n\t\t\t * @todo Can someone document why we are doing this?\n\t\t\t * The code that makes this call would get the `resultBool` and would already have\n\t\t\t * reference to `this` in order to do so...\n\t\t\t */\n\t\t\tpasswordReset: function (resultBool, opts) {\n\t\t\t\treturn {\n\t\t\t\t\tprofile: this,\n\t\t\t\t\tresultBool: resultBool,\n\t\t\t\t};\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {boolean} resultBool Result\n\t\t\t * @param {object} opts Request options\n\t\t\t * @todo Can someone document why we are doing this?\n\t\t\t * The code that makes this call would get the `resultBool` and would already have\n\t\t\t * reference to `this` in order to do so...\n\t\t\t */\n\t\t\trequestPasswordReset: function (resultBool, opts) {\n\t\t\t\treturn {\n\t\t\t\t\tprofile: this,\n\t\t\t\t\tresultBool: resultBool,\n\t\t\t\t};\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {boolean} result Result\n\t\t\t * @param {array} ids Group ids\n\t\t\t * @param {object} opts Request options\n\t\t\t */\n\t\t\tsetUserGroups(result, ids, opts) {\n\t\t\t\tthis.set('groupIds', ids, opts);\n\t\t\t},\n\t\t\t/**\n\t\t\t * @function\n\t\t\t * @param {null} response Null response\n\t\t\t * @param {object} opts Request options\n\t\t\t * @todo Can someone document why we are doing this?\n\t\t\t * The code that makes this call would already have reference to `this` in order to do so...\n\t\t\t */\n\t\t\tuserSelfRegistration: function (response, opts) {\n\t\t\t\treturn {profile: this};\n\t\t\t},\n\t\t};\n\t}\n\n\t/** @override */\n\tconstructor(attrs, opts) {\n\t\tsuper(attrs, opts);\n\n\t\t/**\n\t\t * @memberof module:user/models/userProfile\n\t\t * @alias groups\n\t\t * @type {module:user/collections/groups}\n\t\t */\n\t\tthis.groups = new GroupsCollection([], {\n\t\t\tcomparator: 'name',\n\t\t\t// We do not have a good solution for paging selected items as of yet\n\t\t\tpager: {\n\t\t\t\tpageSize: 0x7fffffff,\n\t\t\t},\n\t\t});\n\t}\n\n\t/**\n\t * @method\n\t * @return Lexicographic name (\"Doe, Jane\")\n\t */\n\tgetLexicographicName() {\n\t\treturn _.without(_.values(this.pick('name3', 'name1')), '').join(', ');\n\t}\n\n\t/**\n\t * returns true if profile instance is the logined user\n\t * @method\n\t * @return {boolean}\n\t */\n\tisMe() {\n\t\treturn Netx.userProfile.id === this.id;\n\t}\n\n\t/**\n\t * some(all?) of this will/should be caught via in-form validation js\n\t * @todo document\n\t */\n\t// TODO: we generally don't use the validate feature of Backbone.Model, so maybe we should take this out.\n\t// The form handler does the same kind of checking ...\n\t//\n\tvalidate(attrs, options) {\n\t\tvar err = [];\n\t\tif (attrs.userId < 1) {\n\t\t\t//only check for new user\n\t\t\tif (Netx.system && Netx.system.users && Netx.system.users.length) {\n\t\t\t\t_.each(Netx.system.users.models, function (u) {\n\t\t\t\t\tif (u.get('login').toLowerCase() == attrs.login.toLowerCase()) {\n\t\t\t\t\t\terr.push('Login <b>' + attrs.login + '</b> already in use.');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (!/^\\S+@\\S+\\.\\S+/.test(attrs.email)) {\n\t\t\terr.push('Invalid email address');\n\t\t}\n\t\tvar req = {\n\t\t\temail: 'email address',\n\t\t\tname1: 'first name',\n\t\t\tlogin: 'login',\n\t\t}; //TODO generalize (e.g. passed from server) - could read from form. :(\n\t\t_.each(req, function (name, prop) {\n\t\t\tif (attrs[prop] === '') {\n\t\t\t\terr.push('you must have a value for ' + name);\n\t\t\t}\n\t\t});\n\t\tif (attrs.password1 != attrs.password2) {\n\t\t\terr.push('passwords do not match');\n\t\t}\n\t\tif (err.length > 0) {\n\t\t\treturn '<ul><li>' + err.join('</li><li>') + '</li><ul>';\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Test for profile usertype by name\n\t * @method\n\t * @param {string} typeName Type name\n\t * @returns {boolean}\n\t */\n\tisType(typeName) {\n\t\t// keys in this object are all ucfirst ...\n\t\treturn (\n\t\t\tthis.get('type') == _.invert(userTypes)[_.ucfirst(typeName.toLowerCase())]\n\t\t);\n\t}\n\t/**\n\t * Test for profile usertype by name\n\t * @param {string} typeName Type name\n\t * @returns {boolean}\n\t */\n\tisTypeOrGreater(typeName) {\n\t\treturn (\n\t\t\tthis.get('type') >= _.invert(userTypes)[_.ucfirst(typeName.toLowerCase())]\n\t\t);\n\t}\n\n\t/**\n\t * Sets model(itself), calls requestPasswordReset x7 api\n\t * @method\n\t * @param {object} loginObj Login data\n\t */\n\tuserLogin(loginObj, opts) {\n\t\tthis.set({\n\t\t\tlogin: loginObj.username,\n\t\t\tpassword1: loginObj.password,\n\t\t});\n\t\treturn this.authenticate(opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {object} data Data\n\t * @param {object} opts Options\n\t */\n\tparseAndSave(data, opts) {\n\t\t// Get only the values pertinant to our model's attributes\n\t\tvar parsed = _.pick.apply(\n\t\t\tnull,\n\t\t\t[data].concat(_.keys(this.constructor.GetDefaults())),\n\t\t);\n\n\t\t// No point in setting this here\n\t\t// neither setUser nor modifyCurrentUserData sets propertyNames and propertyValues\n\t\t// custom user data\n\t\t// model.setPropertyArrays(values);\n\n\t\t// Adjust notify boolean to int\n\t\tparsed.notify = parsed.notify ? 1 : 0;\n\n\t\t// TODO: https://jira.netx.net/browse/DAM-8541\n\t\tif (parseInt(parsed.type) === 0) {\n\t\t\tparsed.type = -1;\n\t\t}\n\n\t\t// Password has not changed\n\t\tif (\n\t\t\t!data.autogeneratePassword &&\n\t\t\t(parsed.password1 === '' || parsed.password2 === '')\n\t\t) {\n\t\t\tparsed = _.omit(parsed, 'password1', 'password2');\n\t\t}\n\t\t// Autogenerate password (send empty strings to server)\n\t\telse if (data.autogeneratePassword) {\n\t\t\tparsed.password1 = parsed.password2 = '';\n\t\t}\n\n\t\treturn this.set(parsed, opts).save(opts);\n\t}\n\n\t/**\n\t * Sets model(itself), calls requestPasswordReset x7 api\n\t * @method\n\t * @param {object} passObj Login data\n\t * @param {object} opts Request options\n\t */\n\tpasswordRequest(loginObj, opts) {\n\t\tthis.set({\n\t\t\tlogin: loginObj.login,\n\t\t\tpasswordRequest: '',\n\t\t});\n\t\treturn this.requestPasswordReset(opts).then(function (response) {\n\t\t\tthis.set({\n\t\t\t\tlogin: '',\n\t\t\t\tpasswordRequest: response.resultBool ? 'success' : 'failure',\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Sets model(itself), calls passwordReset x7 api\n\t * @method\n\t * @param {object} passObj Password data\n\t * @param {object} opts Request options\n\t */\n\tpasswordChange(passObj, opts) {\n\t\tthis.set({password: passObj.newPassword});\n\t\treturn this.passwordReset(opts).then(function (response) {\n\t\t\tthis.set({passwordReset: response.resultBool ? 'success' : 'failure'});\n\t\t\treturn response;\n\t\t});\n\t}\n\n\t/**\n\t * Sets model(itself) and calls userSelfRegistration x7 api\n\t * @method\n\t * @param {object} userObj User data\n\t * @param {object} opts Request options\n\t * todo: have Java send back useful information\n\t */\n\tregisterNewUser(userObj, opts) {\n\t\tthis.set(userObj);\n\t\treturn this.userSelfRegistration(opts).then(function (response) {\n\t\t\tthis.set({registration: 'success'});\n\t\t\treturn response;\n\t\t});\n\t}\n\n\tself() {\n\t\tconst self = super.self();\n\t\tif (self.password1 == null) self.password1 = '********';\n\t\tif (self.password2 == null) self.password2 = '********';\n\t\treturn self;\n\t}\n\n\t/**\n\t * Login as this user in a new browser.\n\t * Admin only\n\t * @method\n\t * @param {object} opts Request options\n\t * @returns {string} key\n\t */\n\tloginAs(opts) {\n\t\treturn this.getSessionKeyForUser(opts);\n\t}\n\n\t/**\n\t * Handles decoding the token for password restrictions if there are any\n\t * @param {object} loginTokenObj Login token data\n\t */\n\tdecodeUserToken(loginTokenOb) {\n\t\tthis.set(loginTokenOb);\n\t\tvar decodedTokenArr = window\n\t\t\t.atob(decodeURIComponent(this.get('token')))\n\t\t\t.split('~');\n\n\t\t// did java pass strict password info?\n\t\tif (decodedTokenArr.length > 3) {\n\t\t\tthis.set({\n\t\t\t\tminimumPasswordLength: decodedTokenArr[2].length\n\t\t\t\t\t? parseInt(decodedTokenArr[2])\n\t\t\t\t\t: 8,\n\t\t\t});\n\n\t\t\tvar strictMsg = '';\n\n\t\t\t// required password pattern\n\t\t\tif (decodedTokenArr[3].length) {\n\t\t\t\t_.each(\n\t\t\t\t\tdecodedTokenArr[3].split(','),\n\t\t\t\t\tfunction (pat, idx, all) {\n\t\t\t\t\t\tvar value = parseInt(pat.slice(0, -1)),\n\t\t\t\t\t\t\tleadIn =\n\t\t\t\t\t\t\t\tidx === all.length - 1\n\t\t\t\t\t\t\t\t\t? ' ' + i18n.t('i18n.passwordAnd') + ' '\n\t\t\t\t\t\t\t\t\t: idx > 0\n\t\t\t\t\t\t\t\t\t? ', '\n\t\t\t\t\t\t\t\t\t: ' ',\n\t\t\t\t\t\t\ti18nString = value > 1 ? '_plural' : '';\n\t\t\t\t\t\tswitch (pat.slice(-1)) {\n\t\t\t\t\t\t\t// required number count\n\t\t\t\t\t\t\tcase 'N':\n\t\t\t\t\t\t\t\ti18nString = 'user:i18n.passwordNumberCount' + i18nString;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// required lowercase count\n\t\t\t\t\t\t\tcase 'L':\n\t\t\t\t\t\t\t\ti18nString = 'user:i18n.passwordLowercaseCount' + i18nString;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// required uppercase count\n\t\t\t\t\t\t\tcase 'U':\n\t\t\t\t\t\t\t\ti18nString = 'user:i18n.passwordUppercaseCount' + i18nString;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// required special character count\n\t\t\t\t\t\t\tcase 'S':\n\t\t\t\t\t\t\t\ti18nString = 'user:i18n.passwordSpecialCount' + i18nString;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstrictMsg += leadIn + i18n.t(i18nString, {count: value});\n\t\t\t\t\t},\n\t\t\t\t\tthis,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (strictMsg.length) {\n\t\t\t\tthis.set({\n\t\t\t\t\tstrictPasswordInstructions:\n\t\t\t\t\t\ti18n.t('i18n.passwordStrict') + ' ' + strictMsg,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * We have a fun issue with users\n\t * Our autocompletes do not return `login` but full names\n\t * We want labels to match up between a select from a collection\n\t * and a select from an autolookup - so...\n\t * @override\n\t * @return {string} Autocomplete label\n\t */\n\tgetAutocompleteLabel() {\n\t\treturn this.fullName() || this.getLabel();\n\t}\n\n\t/**\n\t * Converts propertyNames/propertyValues parallel arrays into usable object\n\t * @method\n\t * @returns {object} formData\n\t */\n\tgetPropertyObject() {\n\t\t// create a userValues object for the CustomForm collection\n\t\tvar formData = {},\n\t\t\tvalues = this.get('propertyValues');\n\t\t_.each(this.get('propertyNames'), function (propName, idx, all) {\n\t\t\tformData[propName] = values[idx];\n\t\t});\n\n\t\treturn formData;\n\t}\n\t/**\n\t * Converts form data object into propertyNames/propertyValues parallel arrays\n\t * and sets them\n\t * @method\n\t * @param {object} values Form values\n\t */\n\tsetPropertyArrays(values) {\n\t\t// overriding to store custom fields, the dam just loves parallel arrays\n\t\tvar propertyNames = [],\n\t\t\tpropertyValues = [],\n\t\t\tmodelAttrs = [];\n\n\t\t_.each(\n\t\t\tvalues,\n\t\t\t_.bind(function (empty, idx, all) {\n\t\t\t\tvar prefix = idx.slice(0, 4),\n\t\t\t\t\tattrName = idx.slice(4),\n\t\t\t\t\tisOurAttr;\n\n\t\t\t\tif (prefix === 'cfe-') {\n\t\t\t\t\tisOurAttr = _.keys(this.attributes).indexOf(attrName) !== -1;\n\t\t\t\t\tif (!isOurAttr) {\n\t\t\t\t\t\tpropertyNames.push(attrName);\n\t\t\t\t\t\tpropertyValues.push(all[idx]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tattrName = idx;\n\t\t\t\t\tisOurAttr = _.keys(this.attributes).indexOf(attrName) !== -1;\n\t\t\t\t}\n\n\t\t\t\tif (isOurAttr) {\n\t\t\t\t\tmodelAttrs[attrName] = all[idx];\n\t\t\t\t}\n\t\t\t}, this),\n\t\t);\n\n\t\tthis.set('propertyNames', propertyNames);\n\t\tthis.set('propertyValues', propertyValues);\n\n\t\treturn modelAttrs;\n\t}\n\n\t/**\n\t * Return a 'full name' string for the user.\n\t *\n\t * The DAM maintains 4 'name' fields (name1 - name4) but our UI only uses two of them (name1 & name3).\n\t * Other names (middle name, suffix) might exist out there somewhere, so we check for those too.\n\t *\n\t * @method\n\t * @returns {string} Full name.\n\t */\n\tfullName() {\n\t\treturn (\n\t\t\tthis.chain()\n\t\t\t\t// Get an object containing the four name fields:\n\t\t\t\t.pick('name1', 'name2', 'name3', 'name4')\n\t\t\t\t// Get an array of just the values (not the keys)\n\t\t\t\t.values()\n\t\t\t\t// Take out any empty strings\n\t\t\t\t.without('')\n\t\t\t\t// Join the rest with single spaces\n\t\t\t\t.join(' ')\n\t\t\t\t// Finish the chain().\n\t\t\t\t.value()\n\t\t);\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'UserProfile';\n\t}\n}\n","import type {UserLevel} from '../constants';\nimport {getUserLevel} from './getUserLevel';\nexport {UserLevel} from '../constants';\n\nexport const currentUserMeetsUserLevel = (userLevel: UserLevel) =>\n\tgetUserLevel() >= userLevel;\n\nexport default currentUserMeetsUserLevel;\n","import {userProfile} from '../collections/singletons/userProfile';\n\nexport const getUserLevel = () => userProfile.get('type');\n\nexport default getUserLevel;\n","import type {SetOptional} from 'type-fest';\nimport type {EnhancedUserSelector} from '../types';\n\nexport const getCorrectedUserSelector = <\n\tT extends\n\t\t| SetOptional<EnhancedUserSelector, 'userSelectorId'>\n\t\t| EnhancedUserSelector,\n>(\n\tuserSelector: T,\n): T => {\n\tif (userSelector.all) {\n\t\treturn {\n\t\t\t...userSelector,\n\t\t\tall: true,\n\t\t\tnone: false,\n\t\t\tgroups: [],\n\t\t\tusers: [],\n\t\t};\n\t}\n\n\tif (\n\t\tuserSelector.none ||\n\t\t(!userSelector.groups.length && !userSelector.users.length)\n\t) {\n\t\treturn {\n\t\t\t...userSelector,\n\t\t\tall: false,\n\t\t\tnone: true,\n\t\t\tgroups: [],\n\t\t\tusers: [],\n\t\t};\n\t}\n\n\treturn userSelector;\n};\n\nexport default getCorrectedUserSelector;\n","import {userPrefs} from '@netx/core-user/collections/singletons/userPreferences';\n\nexport const setPreference = (key: string, value: any) =>\n\tuserPrefs.setUserPreference(key, value);\n\nexport default setPreference;\n","/**\n * @module core/functionality/childViews\n */\n\nconst NAME = 'childViews';\n\nimport LazyLoader from 'core-libs/nx-lazyloader';\n\nconst Props = {\n\t/**\n\t * @method\n\t * @param {string} event Event\n\t * @param {function} func Callback\n\t */\n\taddChildViewListener(event, func) {\n\t\t_.each(this.childViews, (v) => this.listenTo(v, event, func));\n\t},\n\n\t/**\n\t * Setup listeners on child views\n\t * @method\n\t * @private\n\t */\n\taddChildViewListeners() {\n\t\tconst collection = this.getChildViewCollection();\n\n\t\tif (!collection) {\n\t\t\tthrow new Error(\"Can't use child views without a collection\");\n\t\t}\n\n\t\tthis.removeChildViewListeners(collection);\n\n\t\t// Listen for child events:\n\t\t// ------------------------\n\t\t// Do we re-render on every add?\n\t\tthis.listenTo(collection, 'add', this.addedChildViewModel);\n\n\t\t// Sort has fired\n\t\t// TODO: Somewhere something is triggering sort - and it isn't backbone (because I know the compartor is not set and backbone will not sort without one)\n\t\t// This was causing us to render all the children in an asset gallery, and then immediately reset and re-add them\n\t\t// I have searched the codebase and can not find where this is happening, but it is possible this is a variable named event string...\n\t\t// Haven't gone deep enough in the debugger to spot it\n\t\t// Regardless, nothing should be bypassing this check and triggering `sort`\n\t\tif (collection.compartor) {\n\t\t\tthis.listenTo(collection, 'sort', this.resetChildViews);\n\t\t}\n\t\t// Respond to a remove on our collection by removing the view.\n\t\tthis.listenTo(collection, 'remove', this.removeChildView);\n\t\t// And if our collection is reset, update everything\n\t\tthis.listenTo(collection, 'reset', this.resetChildViews);\n\n\t\treturn this;\n\t},\n\n\t/**\n\t * @method\n\t */\n\taddedChildViewModel(model) {\n\t\tthis.childView.reset ? this.render() : this.addChildView(model);\n\t},\n\n\t/**\n\t * Internal function to install one child view\n\t * @private\n\t * @param {Netx.Model} model Model\n\t * @returns {Netx.View} Child view\n\t */\n\taddChildView(model, append) {\n\t\tif (!model) return;\n\n\t\t// Recycling is good! Create storage for child views if it doesn't exist yet, indexed by model.cid.\n\t\tthis.childViews = this.childViews || {};\n\n\t\tlet childView = this.childViews[model.cid];\n\t\tlet newChildView = false;\n\n\t\t// Create main options\n\t\t// Loop over each thing in this.childView, excluding this.options.options, and execute\n\t\t// any value that may be a function\n\t\tconst mainOptions = {};\n\t\t_.each(_.omit(this.childView, 'options'), (v, k) => {\n\t\t\tlet val = v;\n\t\t\tif (_.isFunction(v) && !v.__isView__) {\n\t\t\t\tval = v.call(this, model);\n\t\t\t}\n\t\t\tmainOptions[k] = val;\n\t\t});\n\n\t\tconst childCollection = this.getChildViewCollection();\n\t\tconst isAppViewModel = model.constructor.__name__ === 'AppView';\n\n\t\tlet _view;\n\t\t// Check and see if it was in the view queue\n\t\tif (\n\t\t\t!childView &&\n\t\t\tmodel.get('queued') &&\n\t\t\tthis._viewQueue &&\n\t\t\tisAppViewModel\n\t\t) {\n\t\t\tif (this._viewQueue.get(model.id)) {\n\t\t\t\t_view = model.get('view');\n\t\t\t\tif (_view) {\n\t\t\t\t\t// Get the view\n\t\t\t\t\tchildView = this.childViews[model.cid] = _view;\n\t\t\t\t\t// Make sure it knows who its rightful owner is\n\t\t\t\t\tmodel.collection = this.viewCollection;\n\t\t\t\t\t// We are new!\n\t\t\t\t\tnewChildView = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check and see if the view was already created via another `viewCollection`\n\t\tif (\n\t\t\t!childView &&\n\t\t\tisAppViewModel &&\n\t\t\tthis.viewCollection &&\n\t\t\t!model.isMyOriginalCollection(this.viewCollection)\n\t\t) {\n\t\t\t_view = model.get('view');\n\t\t\tif (_view) {\n\t\t\t\tchildView = this.childViews[model.cid] = _view;\n\t\t\t\t// We are new!\n\t\t\t\tnewChildView = true;\n\t\t\t}\n\t\t}\n\n\t\t// New childView\n\t\tif (!childView) {\n\t\t\t// Respect max items\n\t\t\t// Do it in here so we do not erroneously think we have exceeded our limits i nthe event of a detach re-add deal\n\t\t\tif (\n\t\t\t\tmainOptions.maxItems &&\n\t\t\t\t_.keys(this.childViews).length >= mainOptions.maxItems\n\t\t\t)\n\t\t\t\treturn;\n\n\t\t\t////////////////////////////////\n\t\t\t// CHILD VIEW SETUP\n\t\t\t////////////////////////////////\n\n\t\t\t// Child View class:\n\t\t\tconst childViewClass = mainOptions.viewClass;\n\n\t\t\t// if the child class isn't specified assume we do not want to output anything\n\t\t\tif (!childViewClass) return;\n\n\t\t\tconst childViewProto = childViewClass.prototype;\n\t\t\tconst childViewModule = childViewProto.module\n\t\t\t\t? childViewProto.module\n\t\t\t\t: 'none';\n\n\t\t\t// Child View ID, if defined.\n\t\t\tconst childId = mainOptions.id ? {id: mainOptions.id} : {};\n\n\t\t\t// Child View options:\n\t\t\tlet childViewOptions = {};\n\t\t\tlet _childViewOptions = this.childView.options || {};\n\n\t\t\t// If we are an appView model, extend anything on the model to our childView options\n\t\t\tif (isAppViewModel) {\n\t\t\t\t_.each(model.attributes.viewOptions, (v, k) => {\n\t\t\t\t\tchildViewOptions[k] = v;\n\t\t\t\t});\n\t\t\t\tchildViewOptions.viewSpec = model;\n\t\t\t}\n\n\t\t\t// Check if any of our child view options are functions\n\t\t\tif (!_.isFunction(_childViewOptions)) {\n\t\t\t\t_.each(_.omit(_childViewOptions, 'template'), (opt, key) => {\n\t\t\t\t\tlet val = opt;\n\t\t\t\t\tif (\n\t\t\t\t\t\t// Do not execute method overrides - leave them as is\n\t\t\t\t\t\t_.isFunction(opt) &&\n\t\t\t\t\t\t!opt.__isView__\n\t\t\t\t\t) {\n\t\t\t\t\t\tval = opt.call(this, model);\n\t\t\t\t\t}\n\n\t\t\t\t\tchildViewOptions[key] = val;\n\t\t\t\t});\n\t\t\t\tif (_childViewOptions.template) {\n\t\t\t\t\tchildViewOptions.template = _childViewOptions.template;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Child View attributes:\n\t\t\tconst childViewAttributes = childViewOptions.attributes || {};\n\t\t\t// Check if any of our attributes are functions\n\t\t\t_.each(childViewAttributes, (attr, key, all) => {\n\t\t\t\tif (!_.isFunction(attr)) return;\n\t\t\t\tall[key] = attr.call(this, model);\n\t\t\t});\n\t\t\t// If draggable is true add the attibute draggable=\"true\" to the child view\n\t\t\tchildViewAttributes.draggable =\n\t\t\t\tmainOptions.draggable === true ? true : undefined;\n\t\t\tif (mainOptions.href) {\n\t\t\t\tchildViewAttributes.href = mainOptions.href;\n\t\t\t}\n\t\t\t////////////////////////////////\n\t\t\t// !CHILD VIEW SETUP\n\t\t\t////////////////////////////////\n\n\t\t\t////////////////////////////////\n\t\t\t// CHILD VIEW CREATION\n\t\t\t////////////////////////////////\n\t\t\tlet _options = {};\n\n\t\t\t// Only extend the model/collection if it is not AppView/AppViews\n\t\t\t// For edge cases see Netx.Views.AppModalCrumbsView\n\t\t\tif (childCollection.constructor.__name__ !== 'AppViews') {\n\t\t\t\t_options.collection = childCollection;\n\t\t\t}\n\t\t\tif (!isAppViewModel) {\n\t\t\t\t_options.model = model;\n\t\t\t}\n\n\t\t\t// Put them all together in order:\n\t\t\t// First the options we just defined\n\t\t\t// Then the options parsed in childView setup\n\t\t\t// Then the childId (which is collected from the parsed main options)\n\t\t\t// And lastly, the parsed attributes options\n\t\t\t_.extend(_options, childViewOptions, childId, {\n\t\t\t\tattributes: childViewAttributes,\n\t\t\t});\n\t\t\ttry {\n\t\t\t\t// Allow one last chance to take full control over what gets extended to the childView\n\t\t\t\tif (_.isFunction(_childViewOptions)) {\n\t\t\t\t\t_.extend(_options, _childViewOptions.call(this, model, _options));\n\t\t\t\t}\n\t\t\t} catch (ex) {\n\t\t\t\tconsole.error(ex);\n\t\t\t}\n\n\t\t\t// Create\n\t\t\tthis.childViews[model.cid] = childView = new childViewClass(_options);\n\n\t\t\t// If the model present on options is not of type Netx.Models.AppView then do not set the view\n\t\t\t// this will override the correct one\n\t\t\tif (\n\t\t\t\tisAppViewModel &&\n\t\t\t\t!(_options.model && _options.model.constructor.__name__ === 'AppView')\n\t\t\t) {\n\t\t\t\tmodel.set('view', childView);\n\t\t\t}\n\t\t\t// We are new!\n\t\t\tnewChildView = true;\n\t\t\t////////////////////////////////\n\t\t\t// !CHILD VIEW CREATION\n\t\t\t////////////////////////////////\n\t\t}\n\t\t// ! New childView\n\n\t\t// ////////////////////////////////////\n\t\t// // SET TARGET\n\t\t// ////////////////////////////////////\n\t\t// var target;\n\t\t// // If target is explicitly set to false, use this.$el\n\t\t// if( mainOptions.target === false ) {\n\t\t// \ttarget = this.$el;\n\t\t// }\n\t\t// // If set\n\t\t// else if( mainOptions.target ) {\n\t\t// \ttarget = this.$( mainOptions.target );\n\t\t// }\n\t\t// // Target was either not provided or could not be found\n\t\t// if ( !target || target.length === 0 ) {\n\t\t// \t// Try for .nx-childview or [data-nx-childviews] else use this.$el\n\t\t// \t// TODO: this must be better targeted - we need to make sure we do not wind up grabbing a nested childView element\n\t\t// \t// TODO: switch over to `.nx-childviews` for better performance\n\t\t// \tvar childviewTarget = this.$('.nx-childviews, [data-nx-childviews]');\n\t\t// \ttarget = childviewTarget.length ? childviewTarget.first() : this.$el;\n\t\t// }\n\t\t// ////////////////////////////////////\n\t\t// // !SET TARGET\n\t\t// ////////////////////////////////////\n\n\t\t////////////////////////////////////\n\t\t// POSITION IN DOM\n\t\t////////////////////////////////////\n\t\tconst childModelCount = childCollection.length;\n\t\tif (append === true) {\n\t\t\tchildView.$el.appendTo(this.$childTargetEl);\n\t\t} else {\n\t\t\t// Add the view in the specific order it appears in the collection.\n\t\t\t// NOTE: sometimes we are called by backbone with a model\n\t\t\t// that is identical to, but not the same as, some model in the collection --\n\t\t\t// for instance, if we call set() from a method parser, so the models haven't been unified yet.\n\t\t\t// This line works around that.\n\t\t\tlet idx = childCollection.indexOf(childCollection.get(model.id));\n\t\t\t// However, if the model has no ID, the previous search fails, but the simpler case works.\n\t\t\tif (idx === -1) {\n\t\t\t\tidx = childCollection.indexOf(model);\n\t\t\t}\n\t\t\t// Before\n\t\t\tif (idx === 0) {\n\t\t\t\tchildView.$el.prependTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// If we are the last view, append to the end of the target:\n\t\t\telse if (idx === childModelCount - 1) {\n\t\t\t\t// If there is a view all children element, insert before\n\t\t\t\tchildView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// collection.indexOf(model) can return -1 if the model has no id.\n\t\t\telse if (idx === -1) {\n\t\t\t\tif (model.id) {\n\t\t\t\t\t// Otherwise, this really shouldn't happen unless something is using addChildView in an unsupported way.\n\t\t\t\t\tconsole.warn('adding child view not in childViews collection', model);\n\t\t\t\t}\n\t\t\t\t// Either way, we ought to add what we were asked to add, so append the model's view.\n\t\t\t\tchildView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// After\n\t\t\telse {\n\t\t\t\t// Otherwise, insert this view after the previous model's view\n\t\t\t\tconst previousChildView =\n\t\t\t\t\tthis.childViews[childCollection.at(idx - 1).cid];\n\t\t\t\tpreviousChildView != null\n\t\t\t\t\t? previousChildView.$el.after(childView.el)\n\t\t\t\t\t: childView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t}\n\t\t////////////////////////////////////\n\t\t// !POSITION IN DOM\n\t\t////////////////////////////////////\n\n\t\t// Let the child view know it's just been added to its parent view\n\t\tchildView.trigger('addedToParent', this);\n\n\t\t// Let the view know a child view was added\n\t\tthis.trigger('addedChildView', childView);\n\n\t\tif (newChildView) {\n\t\t\tthis.trigger('addedNewChildView', childView)\n\t\t\t\t// Listeners for the life of the child view:\n\t\t\t\t// When removed\n\t\t\t\t.listenTo(childView, 'remove', () => {\n\t\t\t\t\tthis.trigger('removedChildView', childView).stopListening(childView);\n\t\t\t\t});\n\t\t}\n\n\t\t// The boolean lastAdded can be set true on a model before it is added to a collecton, to indicate that no more models are being added after this one.\n\t\t// This causes the addedChildViews event to be triggered on the parent collection's view after the child model view is rendered.\n\t\t// Use this for one-off additions to a view, to trigger post-rendering things (like grid resizing).\n\t\t// (Normal childView processing does not need to worry about this.)\n\t\t// TODO: This feels like a hack, but I don't have a better idea yet.\n\t\tif (model.lastAdded) {\n\t\t\tdelete model.lastAdded;\n\t\t\tthis.trigger('addedChildViews');\n\t\t}\n\n\t\tif (newChildView) {\n\t\t\t// Allow views to access info before the render actually oocurs on viewSpec related views\n\t\t\tif (isAppViewModel) {\n\t\t\t\t_.defer(() => {\n\t\t\t\t\t// Trigger first render. After that, the view will render itself on its own model's events.\n\t\t\t\t\t// TODO: views should decide when to render. They can listen for 'addedToParent' if they need to re-render when re-added.\n\t\t\t\t\t// For now - as I do not want to fix every view that is depending on this behavior\n\t\t\t\t\tif (mainOptions.noRender !== true && !childView.renderedOnce) {\n\t\t\t\t\t\tchildView.render();\n\t\t\t\t\t\t!mainOptions.noShow &&\n\t\t\t\t\t\t\tthis.whenShown.then(() => {\n\t\t\t\t\t\t\t\tchildView.show();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Trigger first render. After that, the view will render itself on its own model's events.\n\t\t\t\t// TODO: views should decide when to render. They can listen for 'addedToParent' if they need to re-render when re-added.\n\t\t\t\t// For now - as I do not want to fix every view that is depending on this behavior\n\t\t\t\tif (mainOptions.noRender !== true) {\n\t\t\t\t\tchildView.render();\n\t\t\t\t\t!mainOptions.noShow &&\n\t\t\t\t\t\tthis.whenShown.then(() => {\n\t\t\t\t\t\t\tchildView.show();\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Return new child view\n\t\treturn childView;\n\t},\n\n\t/**\n\t * Internal function to add one child view for each collection model\n\t * @method\n\t * @private\n\t * @todo Cleanup/reorganize?\n\t */\n\taddChildViews() {\n\t\t// Add child views, if required.\n\t\tconst addedCVs = [];\n\t\tconst parentCollection = this.getChildViewCollection();\n\n\t\t// We have a collection to work off of\n\t\tif (!parentCollection) return this;\n\n\t\t// Free all views from this.childViews that are not specific to models in parentCollection.\n\t\t// (NOTE: we could defer this block for performance if necessary.)\n\t\t// NOTE: any other code that stores views in this.childViews (to track rendering & lifecycle)\n\t\t// is totally incompatible with the childView system! We used to do that a lot,\n\t\t// but for best results, store such views by calling this.addSubView(view), which stores\n\t\t// them in this.subViews{}.\n\t\tconst modelCids = _.pluck(parentCollection.models, 'cid');\n\n\t\t_.each(this.childViews, (view, cid) => {\n\t\t\tif (modelCids.indexOf(cid) > -1) return;\n\t\t\tview.remove();\n\t\t\tdelete this.childViews[cid];\n\t\t});\n\n\t\tthis.trigger('addingChildViews', this);\n\t\t// Opting to break up the adding into chunks\n\t\tif (this.childView.breakItUp) {\n\t\t\tconst opts = _.isObject(this.childView.breakItUp)\n\t\t\t\t? this.childView.breakItUp\n\t\t\t\t: {};\n\t\t\tconst totalLength = this.childView.maxItems || parentCollection.length;\n\n\t\t\tthis.breakItUp(\n\t\t\t\t{\n\t\t\t\t\tsize: totalLength,\n\t\t\t\t\tamount: opts.amount || 50,\n\t\t\t\t\tdelay: opts.delay || 0,\n\t\t\t\t},\n\t\t\t\t(index) => {\n\t\t\t\t\tthis.addChildView(parentCollection.at(index), true);\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tthis.trigger('addedChildViews', this);\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t\t// We only want to display a certain number of childViews\n\t\telse if (this.childView.maxItems) {\n\t\t\t_.each(_.first(parentCollection.models, this.childView.maxItems), (m) =>\n\t\t\t\tthis.addChildView(m, true),\n\t\t\t);\n\t\t}\n\t\t// Lazy load children\n\t\telse if (this.childView.lazyLoad) {\n\t\t\tthis.Plugins.Destroy('lazyloader');\n\t\t\tthis.initializeLazyLoad();\n\n\t\t\tconst start = this.lazyLoadIndex;\n\t\t\tthis.lazyLoadIndex = start + 25;\n\n\t\t\tconst models = parentCollection.models.slice(start, this.lazyLoadIndex);\n\t\t\tmodels.forEach(_.partial(this.addChildView.bind(this), _, true));\n\n\t\t\tlet additionalOpts = this.childView.lazyLoad;\n\t\t\tif (_.isFunction(additionalOpts)) {\n\t\t\t\tadditionalOpts = additionalOpts.call(this);\n\t\t\t}\n\n\t\t\tmodels.length &&\n\t\t\t\tthis.Plugins.Initialize(\n\t\t\t\t\t'lazyloader',\n\t\t\t\t\tthis.$el,\n\t\t\t\t\t_.extend(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchildrenEl: this.$childTargetEl[0],\n\t\t\t\t\t\t\ttarget: this,\n\t\t\t\t\t\t\tforwardOnly: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tadditionalOpts,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t}\n\t\t// Show everything we've got\n\t\telse {\n\t\t\tparentCollection.each((m) => this.addChildView(m, true));\n\t\t}\n\t},\n\n\t/** @method */\n\tcleanUpChildViews() {\n\t\t// Remove any children we may have.\n\t\t_.invoke(this.childViews, 'remove');\n\t\tdelete this.childViews;\n\t},\n\n\t/**\n\t * @method\n\t */\n\tdetachChildViews() {\n\t\t// protect child views from losing their event listeners:\n\t\t// remove them from this.$el before we call .html() on it.\n\t\t// http://tbranyen.com/post/missing-jquery-events-while-rendering\n\t\t_.each(this.childViews, (v) => v.$el.detach());\n\t},\n\n\t/**\n\t * @method\n\t * @param {Netx.Model} model Model\n\t * @return {Netx.View} Child view\n\t */\n\tgetChildViewByModel(model) {\n\t\tconst childViews = this.childViews;\n\n\t\t// Simplest way (should always work)\n\t\tlet childView = childViews[model.cid];\n\t\tif (childView) {\n\t\t\treturn childView;\n\t\t}\n\n\t\t// But if not, the next simple way is to get it via the order in the child view collection\n\t\tconst collection = this.getChildViewCollection();\n\t\tif (collection) {\n\t\t\tconst idx = collection.indexOf(model);\n\t\t\tchildView =\n\t\t\t\tidx > -1 && childViews[collection.at(collection.indexOf(model)).cid];\n\t\t\tif (childView.model === model) return childView;\n\t\t}\n\n\t\t// If SOMEHOW nothing above worked, loop ovet child views and find the first one that has\n\t\t// the modeltied to it\n\t\tfor (let key in childViews) {\n\t\t\tif (childViews.hasOwnProperty(key)) {\n\t\t\t\tchildView = childViews[key];\n\t\t\t\tif (childView.model.cid === model.cid) {\n\t\t\t\t\treturn childView;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * @method\n\t * @return {module:core/lib/netx-collection} Collection\n\t */\n\tgetChildViewCollection() {\n\t\t// View have a collection\n\t\t// This is to avoid the fact we try and push a different (t initialize in some childView parents\n\t\t// that is fine in itself - except for when you want loading classes to reflect that collection in the childView\n\t\tconst childViewCollection = this.childView.collection;\n\t\t// This is to avoid the fact we try and push a different collection in at initialize in some childView parents\n\t\t// that is fine in itself - except for when you want loading classes to reflect that collection in the childView\n\t\tlet parentCollection;\n\t\tif (childViewCollection) {\n\t\t\tparentCollection = _.isFunction(childViewCollection)\n\t\t\t\t? childViewCollection(this.model)\n\t\t\t\t: childViewCollection;\n\t\t}\n\t\treturn parentCollection || this.collection;\n\t},\n\n\t/**\n\t * @method\n\t */\n\tinitializeLazyLoad() {\n\t\tthis.lazyLoadedForward = this.reachedBeginning = true;\n\t\tthis.reachedEnd = false;\n\t\tthis.lazyLoadIndex = 0;\n\t},\n\n\t/**\n\t * @method\n\t * @return {number} Items loading\n\t */\n\tlazyLoadItems() {\n\t\tif (this.reachedEnd) return false;\n\n\t\tconst parentCollection = this.getChildViewCollection();\n\n\t\tconst pageSize = 3;\n\t\tconst totalItems = parentCollection.length;\n\n\t\t// Always forward\n\t\tthis.lazyLoadedForward = true;\n\n\t\tthis.reachedEnd = this.lazyLoadIndex >= totalItems - 1;\n\n\t\tconst start = this.lazyLoadIndex;\n\t\tthis.lazyLoadIndex = start + pageSize;\n\t\tparentCollection.models\n\t\t\t.slice(start, this.lazyLoadIndex)\n\t\t\t.forEach((model) => this.addChildView(model, true));\n\n\t\treturn totalItems === 0 ? 0 : false;\n\t},\n\n\t/**\n\t * @method\n\t * @param {number} oldIndex Old index\n\t * @param {number} newIndex New index\n\t * @param {object} opts Options\n\t * @property {object} opts - Options\n\t * @property {boolean} opts.ignoreCollection - If true, the child view collection model order will not be modified\n\t * @property {boolean} opts.ignoreEl - If true, the child view elements order will not be modified\n\t */\n\tmoveChildViewToIndex(oldIndex, newIndex, opts = {}) {\n\t\tif (newIndex === oldIndex) return this;\n\n\t\t// Child view collection\n\t\tconst collection = this.getChildViewCollection();\n\n\t\t// Assume the collection is up to date and it is a view trying to catch up (in cases where multiple views use the same child view collection)\n\t\t// in which case we are using the newIndex as our point of reference for data\n\t\tconst idx = opts.ignoreCollection ? newIndex : oldIndex;\n\n\t\t// Get the model being moved\n\t\tconst temp = collection.at(idx);\n\n\t\t// Get the child view being moved\n\t\tconst childView = this.getChildViewByModel(temp);\n\n\t\tif (!childView) return this;\n\n\t\t// Indexes\n\t\tlet start = oldIndex;\n\t\tlet end = newIndex;\n\t\t// We are modifying everything between the start and end of the move\n\t\t// Adjust if old index is after the new index, we want to increment from the lowest index\n\t\t// Add 1 to start so that we are not hitting the moving element again - that gets\n\t\tif (oldIndex > newIndex) {\n\t\t\tstart = newIndex + 1;\n\t\t\tend = oldIndex;\n\t\t}\n\n\t\t// Correct placement in DOM\n\t\tif (!opts.ignoreEl) {\n\t\t\t// Detach and preserve\n\t\t\tchildView.$el.detach();\n\n\t\t\t// Beginning\n\t\t\tif (newIndex === 0) {\n\t\t\t\tchildView.$el.prependTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// End\n\t\t\telse if (idx === collection.length - 1) {\n\t\t\t\tchildView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t\t// Otherwise, insert this view after the previous model's view\n\t\t\telse {\n\t\t\t\tconst previousChildView = this.getChildViewByModel(\n\t\t\t\t\tcollection.at(newIndex - 1),\n\t\t\t\t);\n\t\t\t\t!_.isUndefined(previousChildView)\n\t\t\t\t\t? previousChildView.$el.after(childView.el)\n\t\t\t\t\t: childView.$el.appendTo(this.$childTargetEl);\n\t\t\t}\n\t\t}\n\n\t\t// Correct placement in child view collection (that way subsequent re-renders will maintain the child view order)\n\t\tif (!opts.ignoreCollection && newIndex !== temp.getIndex()) {\n\t\t\t// Remove it, silently\n\t\t\tcollection.remove(temp, {silent: true});\n\t\t\t// Add it back in at the new index, silently (we will fire an event when this is over)\n\t\t\tcollection.add(temp, {at: newIndex, silent: true});\n\t\t}\n\n\t\t// Loop over and emit events to all sibling child views affected by this move\n\t\tfor (let i = start, cv; i <= end; i++) {\n\t\t\tcv = this.getChildViewByModel(collection.at(i));\n\t\t\tcv && cv.trigger('movedToIndex', cv, this, {from: i - 1, to: i});\n\t\t}\n\t\t// We moved\n\t\tchildView.trigger(\n\t\t\t'movedToIndex',\n\t\t\tchildView,\n\t\t\tthis,\n\t\t\t_.extend({}, opts, {from: oldIndex, to: newIndex}),\n\t\t);\n\n\t\t// Corrected placement in collection\n\t\tif (!opts.ignoreCollection) {\n\t\t\tcollection.trigger(\n\t\t\t\t'movedItem',\n\t\t\t\tcollection,\n\t\t\t\tchildView,\n\t\t\t\tthis,\n\t\t\t\t_.extend({}, opts, {from: oldIndex, to: newIndex}),\n\t\t\t);\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t/**\n\t * @method\n\t */\n\tprepareChildViews() {\n\t\tif (!this.childView) return;\n\n\t\t// Wait until we have rendered, as childViews could be trying to add themselves before this.$el\n\t\t// has anything in it, in which case they wind up in the root of this.$el (for a brief second)\n\t\t// This method cleans up any existing listeners as well - so no need to manage that here\n\t\tthis.addChildViewListeners();\n\n\t\t// Put back child filter string if available\n\t\tif (this._childViewFilterStr) {\n\t\t\tconst $childSearchFilter = this.$('.nx-filter-children');\n\t\t\tif ($childSearchFilter.length) {\n\t\t\t\t$childSearchFilter.val(this._childViewFilterStr);\n\t\t\t}\n\t\t}\n\n\t\t// Unset before moving forward\n\t\tdelete this.$childTargetEl;\n\n\t\tconst childViewTarget = this.childView.target;\n\t\tif (childViewTarget === false) {\n\t\t\tthis.$childTargetEl = this.$el;\n\t\t} else if (childViewTarget) {\n\t\t\tif (_.isFunction(childViewTarget)) {\n\t\t\t\t// TODO: support this being a function so that we can have a way to do our split column childViews -\n\t\t\t\t// really, here we would negate `this.$childTargetEl` and in the `addChildView` method if `this.$childTargetEl` is undefined\n\t\t\t\t// we would check if it is a function - call the function and pass the child view's model and the view can tell us where it should be\n\t\t\t\t// appended\n\t\t\t} else {\n\t\t\t\tthis.$childTargetEl = this.$(childViewTarget);\n\t\t\t}\n\t\t}\n\t\t// Target was either not provided or could not be found\n\t\tif (!this.$childTargetEl || this.$childTargetEl.length === 0) {\n\t\t\tconst childviewTarget = this.$('.nx-childviews:first');\n\t\t\tthis.$childTargetEl = childviewTarget.length\n\t\t\t\t? childviewTarget.first()\n\t\t\t\t: this.$el;\n\t\t}\n\n\t\tif (this.childView.lazyLoad) {\n\t\t\tthis.Plugins.Register({\n\t\t\t\tlazyloader: {\n\t\t\t\t\tname: 'LazyLoader',\n\t\t\t\t\tdestroyMethod(instance) {\n\t\t\t\t\t\tthis.off(instance.destroy());\n\t\t\t\t\t},\n\t\t\t\t\tinitializeMethod(pluginObj, $pluginEl, initOpts, cb) {\n\t\t\t\t\t\tconst instance = new LazyLoader(\n\t\t\t\t\t\t\t$pluginEl[0],\n\t\t\t\t\t\t\t_.extend({}, pluginObj.options, initOpts),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tcb(instance);\n\t\t\t\t\t},\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdirection: 'horizontal',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// Add child views, if defined.\n\t\tthis.addChildViews();\n\t},\n\n\t/**\n\t * @method\n\t */\n\tremoveAllChildViews() {\n\t\t_.invoke(this.childViews, 'remove');\n\t\tthis.childViews = {};\n\t},\n\n\t/**\n\t * Respond to collection remove events by removing the associated childView, if it exists.\n\t * @method\n\t * @private\n\t * @param {Netx.Model} model Model\n\t */\n\tremoveChildView(model, collection, opts = {}) {\n\t\tconst childView = this.childViews[model.cid];\n\t\tif (!childView) return;\n\n\t\tthis.stopListening(childView);\n\t\tchildView.remove();\n\t\tdelete this.childViews[model.cid];\n\t\tthis.trigger('removedChildView', childView);\n\t\treturn childView;\n\t},\n\n\t/**\n\t * @method\n\t * @param {string} event Event\n\t * @param {function} func Callback\n\t */\n\tremoveChildViewListener(event, func) {\n\t\t_.each(this.childViews, (v) => this.stopListening(v, event, func));\n\t},\n\n\t/**\n\t * Remove listners on child views\n\t * @method\n\t */\n\tremoveChildViewListeners(collection) {\n\t\treturn this.stopListening(collection, 'add', this.addedChildViewModel)\n\t\t\t.stopListening(collection, 'sort', this.resetChildViews)\n\t\t\t.stopListening(collection, 'remove', this.removeChildView)\n\t\t\t.stopListening(collection, 'reset', this.resetChildViews)\n\t\t\t.stopListening('addedChildViews');\n\t},\n\n\t/**\n\t * Internal function to reset the child views to match the current collection\n\t * @method\n\t * @private\n\t */\n\tresetChildViews() {\n\t\tconst collection = this.getChildViewCollection();\n\n\t\tif (!collection.length) {\n\t\t\tthis.Plugins.Destroy('lazyloader');\n\t\t\tthis.$childTargetEl.empty();\n\t\t\t_.invoke(this.childViews, 'remove');\n\t\t\tthis.childViews = {};\n\t\t\treturn this;\n\t\t}\n\n\t\t// Detach all child views we have.\n\t\tthis.detachChildViews();\n\t\t// this.trigger('childViewsReset');\n\t\t// Add back the ones we want.\n\t\tthis.addChildViews();\n\n\t\treturn this;\n\t},\n\n\t/**\n\t * Provided a search event, loop over child views and check a particular key, on its model, for the searched value\n\t * @method\n\t * @param {event} e Search event\n\t */\n\tsearchAndFilterChildren(e) {\n\t\t// Search str\n\t\tlet str = '';\n\t\tlet attributeKey = [];\n\t\tlet minimumLength = 2;\n\t\tlet hasResults = true;\n\n\t\tif (e && e.originalEvent) {\n\t\t\t// This ends here - do not want parent views to get this event\n\t\t\te.stopPropagation();\n\t\t\tconst $target = this.$(e.target);\n\n\t\t\t// Do not interfere with children\n\t\t\tif (this.$childTargetEl.find($target).length) return;\n\n\t\t\tif ($target.attr('data-nx-search-key')) {\n\t\t\t\tattributeKey = $target.attr('data-nx-search-key').split(',');\n\t\t\t}\n\t\t\tminimumLength =\n\t\t\t\tparseInt($target.attr('data-nx-search-minLength')) || minimumLength;\n\t\t\tstr = e.originalEvent.detail || '';\n\t\t}\n\n\t\t// Store so we can put back after renders\n\t\tthis._childViewFilterStr = str;\n\n\t\t// Lowercase it\n\t\tstr = str.toLowerCase();\n\n\t\tif (str.length < minimumLength) {\n\t\t\t// show all child search views\n\t\t\t_.each(this.childViews, (cv) => cv.$el.show());\n\t\t\tthis.el.removeAttribute('data-nx-no-matches');\n\t\t} else if (str.length >= minimumLength) {\n\t\t\tlet shown = 0;\n\t\t\t// hide all search views that don't match this string\n\t\t\t_.each(this.childViews, (cv) => {\n\t\t\t\tconst model = cv.model;\n\t\t\t\tlet show = attributeKey.some((attrKey) => {\n\t\t\t\t\tconst value = model.get(attrKey);\n\t\t\t\t\treturn value != null && value.toLowerCase().includes(str);\n\t\t\t\t});\n\t\t\t\t// Fallback to model title\n\t\t\t\tif (!show) {\n\t\t\t\t\tshow = model.getLabel().toLowerCase().includes(str);\n\t\t\t\t}\n\t\t\t\tshow && shown++;\n\t\t\t\tcv.$el.toggle(show);\n\n\t\t\t\t// make sure the first child view\n\t\t\t\t// is tabable when filtering\n\t\t\t\tif (show && shown === 1) {\n\t\t\t\t\tcv.$el.attr('tabindex', '0');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\thasResults = shown > 0;\n\n\t\t\tshown === 0\n\t\t\t\t? this.el.setAttribute('data-nx-no-matches', true)\n\t\t\t\t: this.el.removeAttribute('data-nx-no-matches');\n\t\t}\n\n\t\tthis.trigger('filteredChildren', this, hasResults);\n\n\t\treturn hasResults;\n\t},\n};\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.extendFunctionality(Props);\n\ttarget.__isChildViews__ = true;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\t// As we transition over to react we may find ourselves still stuck with views that extended views\n\t\t// that utilize child functionality - rather than making it so we have to jump through a million hoopd\n\t\t// or rewrite the thing entirely... just provide a quick way to opt out\n\t\tif (opts.disableChildViews === true) return;\n\n\t\tinstance.isChildViews = true;\n\t\tinstance.childViews = {};\n\n\t\t// Simply add an `<nx-search class=\"@netx/core-filter-children\">` to the tmeplate and you can filter the children\n\t\t// It defaults to comparing the search string to the model attribute `name` - if you need to compare to a different attribute use `data-nx-search-key=\"myDesiredKey\"`\n\t\t// It defaults to a minimum input length of 2 before filtering, if you need to modify this use `data-nx-search-minLength=\"5\"`\n\t\tinstance.events['search .nx-filter-children'] = 'searchAndFilterChildren';\n\t\t/**\n\t\t * Store so that we can put back after renders\n\t\t * @memberOf Netx.View\n\t\t * @alias _childViewFilterStr\n\t\t * @type {string}\n\t\t */\n\t\tinstance._childViewFilterStr = '';\n\n\t\tinstance.childView = opts.childView;\n\n\t\t// Wrap the excluded views method\n\t\tinstance.getExcludedViews = _.wrap(\n\t\t\tinstance.getExcludedViews,\n\t\t\t(getExcludedViews) => {\n\t\t\t\treturn _.pluck(instance.childViews, 'el').concat(\n\t\t\t\t\tgetExcludedViews.call(instance),\n\t\t\t\t);\n\t\t\t},\n\t\t);\n\n\t\tif (!instance.unsavedChanges) {\n\t\t\tinstance.unsavedChanges = (unsavedChanges, noProxy) => {\n\t\t\t\tlet hasUnsavedChanges = false;\n\t\t\t\tconst childViews = instance.childViews;\n\t\t\t\tconst keys = _.keys(childViews);\n\t\t\t\tfor (let i = 0, c = keys.length, childView; i < c; i++) {\n\t\t\t\t\tchildView = childViews[keys[i]];\n\t\t\t\t\tif (childView.unsavedChanges()) {\n\t\t\t\t\t\treturn noProxy ? childView : instance;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', instance.detachChildViews)\n\t\t\t.on('postRenderHook', instance.prepareChildViews)\n\t\t\t.on('removeHook', instance.cleanUpChildViews)\n\t\t\t.on('bindCollectionEventsHook', instance.addChildViewListeners)\n\t\t\t//.on('unbindCollectionEventsHook', instance.removeChildViewListeners)\n\t\t\t// cancel loading classes if child views are added.\n\t\t\t// This passes the childView to showLoaded which hurts the loading class removal\n\t\t\t// We no longer check that thing is of model or collection in showLoaded\n\t\t\t// this.listenTo(this, \"addedChildView\", _.debounce( this.showLoaded, 100 ) );\n\t\t\t.on('addedChildViews', () => {\n\t\t\t\tinstance.showLoaded();\n\t\t\t})\n\t\t\t.on('hidden', () => {\n\t\t\t\t_.invoke(instance.childViews, 'trigger', 'hiddenByProxy', instance);\n\t\t\t})\n\t\t\t.on('shown', () => {\n\t\t\t\t_.invoke(instance.childViews, 'trigger', 'shownByProxy', instance);\n\t\t\t});\n\t}, NAME);\n\n\treturn target;\n}\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/formErrorListItemView.html';\n\nclass FormErrorListItemView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.events = _.extend(\n\t\t\t{\n\t\t\t\tclick: 'gotoInput',\n\t\t\t},\n\t\t\topts.events,\n\t\t);\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e Click event\n\t */\n\tgotoInput(e) {\n\t\tthis.model.get('input').focus();\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'FormErrorListItemView';\n\t}\n}\n\nexport default FormErrorListItemView;\n","/**\n * @class\n */\nimport Base from '@netx/core/lib/netx-view';\nimport Template from '../templates/formErrorListView.html';\n\nimport ChildViews from '@netx/core/functionality/childViews';\n\nimport ChildView from './formErrorListItemView';\n\nclass FormErrorListView extends Base {\n\t/** @override */\n\tconstructor(opts = {}) {\n\t\topts.childView = _.extend(\n\t\t\t{\n\t\t\t\tviewClass: ChildView,\n\t\t\t},\n\t\t\topts.childView,\n\t\t);\n\t\topts.loadingClassObjects = opts.loadingClassObjects || ['collection'];\n\t\topts.template = opts.template || Template;\n\t\tsuper(opts);\n\t}\n\n\t/**\n\t * @method\n\t * @param {event} e Click event\n\t */\n\tgotoInput(e) {\n\t\tthis.model.get('input').focus();\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'FormErrorListView';\n\t}\n}\n\n// Functionality\nChildViews(FormErrorListView);\n\nexport default FormErrorListView;\n","//////////////\n// NetX extensions to FormValidation:\n//\n// numberAttr is a validator for DAM number attributes.\n//\n////////\n// all-in-one number attribute validator!\n//\n// Form validation\n// If you are not logged in, we start right off from the get go with a form\nimport 'core-libs/formValidation/dist/js/formValidation';\nimport 'core-libs/formValidation/dist/js/framework/bootstrap';\n\nimport {isEmptyValue} from '@netx/core/lib/underscore-netx';\n\n/**\n * @method\n * @param {array} results Query results\n * @return {array} Parsed query results\n */\nconst LVBHandler = function(results) {\n\t// Sort\n\tresults = _.sortBy(results, v => v.label);\n\treturn _.map(results, r => {\n\t\treturn {id: r.value, text: r.label};\n\t});\n};\n\nimport {getCompletion, inquiry} from '@netx/core/lib/netx-autocomplete';\n\n// Support case insensitivity\nFormValidation.Validator.regexp.validate = function (\n\tvalidator,\n\t$field,\n\toptions,\n) {\n\t// Original code\n\t// var value = validator.getFieldValue($field, 'regexp');\n\t// if (value === '') {\n\t// \treturn true;\n\t// }\n\t//var regexp = ('string' === typeof options.regexp) ? new RegExp(options.regexp) : options.regexp;\n\t//return regexp.test(value);\n\n\t// New code\n\n\t// Vars\n\tvar insensitive, regexp, value;\n\n\tvalue = validator.getFieldValue($field, 'regexp');\n\tif (value === '') {\n\t\treturn true;\n\t}\n\n\tinsensitive = $field.attr('data-nx-fv-caseInsensitive');\n\n\tif (_.isString(options.regexp)) {\n\t\tif (insensitive) {\n\t\t\tregexp = new RegExp(options.regexp, 'i');\n\t\t} else {\n\t\t\tregexp = new RegExp(options.regexp);\n\t\t}\n\t} else {\n\t\tregexp = options.regexp;\n\t}\n\treturn regexp.test(value);\n};\n\nFormValidation.Validator.lookup = {\n\thtml5Attributes: {\n\t\tmessage: 'message',\n\t\tcompletion: 'completion'\n\t},\n\n\tvalidate(validator, $field, options, validatorName) {\n\t\tconst value = validator.getFieldValue($field, validatorName).toLowerCase().trim();\n\t\tif (value === '') return true;\n\n\t\tconst deferred = new $.Deferred();\n\n\t\tconst completion = getCompletion({completion: options.completion, LVBHandler});\n\t\tinquiry(completion.completion, value, completion.extra, completion).then((results) => {\n\t\t\tif (results.some(result => results[0].text.toLowerCase() === value)) {\n\t\t\t\tdeferred.resolve($field, validatorName, {valid: false, message: options.message || \"Name already exists\"});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdeferred.resolve($field, validatorName, {valid: true});\n\t\t});\n\n\t\treturn deferred;\n\t}\n}\n\n// Enforce entering a value or opting to clear the value\nFormValidation.Validator.attributeProfile = {\n\tvalidate: function(validator, $field, options, validatorName) {\n\t\toptions = options || {};\n\t\tvar message = options.message;\n\t\tvar value = validator.getFieldValue($field, validatorName);\n\t\tvar valid = true;\n\n\t\tvar cleared = $field.closest('.form-group').find('[data-nx-control=\"clear-toggle\"]:checked').length > 0;\n\t\tif (isEmptyValue(value) && !cleared) {\n\t\t\tmessage = i18n.t('app:i18n.validationProfileAttributeInvalid');\n\t\t\tvalid = false;\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: valid,\n\t\t\tmessage: message\n\t\t};\n\t}\n};\n\nFormValidation.Validator.numberAttr = {\n\thtml5Attributes: {\n\t\tmessage: 'message',\n\t\ttrim: 'trim',\n\t\tsize: 'size',\n\t\ttype: 'type',\n\t\tspec1: 'spec1',\n\t\tspec2: 'spec2'\n\t},\n\t/**\n\t * Validate a DAM number field.\n\t *\n\t * @param {FormValidation.Base} validator The validator plugin instance\n\t * @param {jQuery} $field Field element\n\t * @param {Object} options Consists of following keys:\n\t * -size\n\t * -type\n\t * -spec1\n\t * -spec2\n\t * - message: The invalid message\n\t * - trim: Indicate the length will be calculated after trimming the value or not. It is false, by default\n\t *\n\t * Keys 'size' & 'spec1' are interchangeable. Keys 'type' & 'spec2' are also interchangeable.\n\t * At least 'type' (or 'spec1') must be defined.\n\t *\n\t * Validation rules:\n\t * * We only test size on integer types (type 0 and type 5)\n\t * * When testing size, we count number of digits; decimal point doesn't count.\n\t * * If size = 0, or not specified as an option, then any length is okay.\n\t * * For types 1-3, we test that the value has only that many digits (or less) after the decimal point (if any).\n\t * * Integer types cannot have decimal points (but the others can.)\n\t *\n\t * At least one of two keys is required\n\t * The min, max keys define the number which the field value compares to. min, max can be\n\t * - A number\n\t * - Name of field which its value defines the number\n\t * - Name of callback function that returns the number\n\t * - A callback function that returns the number\n\t *\n\t * @returns {Object}\n\t */\n\tvalidate: function(validator, $field, options) {\n\t\toptions = options || {};\n\t\tvar value = validator.getFieldValue($field, 'numberAttr');\n\n\t\tif (options.trim === true || options.trim === 'true') {\n\t\t\tvalue = $.trim(value);\n\t\t}\n\n\t\tif (value === '') {\n\t\t\treturn true;\n\t\t}\n\n\t\tvar isValid = true,\n\t\t\tlocale = validator.getLocale(),\n\t\t\tmessage = options.message || i18n.t('i18n.validationNumberInvalidLength'),\n\t\t\tsize = $.isNumeric( options.size ) ? options.size : validator.getDynamicOption( $field, options.size ),\n\t\t\ttype = $.isNumeric( options.type ) ? options.type : validator.getDynamicOption( $field, options.type ),\n\t\t\tspec1 = $.isNumeric( options.spec1 ) ? options.spec1 : validator.getDynamicOption( $field, options.spec1 ),\n\t\t\tspec2 = $.isNumeric( options.spec2 ) ? options.spec2 : validator.getDynamicOption( $field, options.spec2 ),\n\t\t\t// Credit to http://stackoverflow.com/a/23329386 (@lovasoa) for UTF-8 byte length code\n\t\t\tutf8Length = function(str) {\n\t\t\t\tvar s = str.length;\n\t\t\t\tfor (var i = str.length - 1; i >= 0; i--) {\n\t\t\t\t\tvar code = str.charCodeAt(i);\n\t\t\t\t\tif (code > 0x7f && code <= 0x7ff) {\n\t\t\t\t\t\ts++;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( code > 0x7ff && code <= 0xffff ) {\n\t\t\t\t\t\ts += 2;\n\t\t\t\t\t}\n\t\t\t\t\tif (code >= 0xDC00 && code <= 0xDFFF) {\n\t\t\t\t\t\ti--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn s;\n\t\t\t}, numLength;\n\n\t\t// size can be size or spec1\n\t\tif ( spec1 && !size ) {\n\t\t\tsize = spec1;\n\t\t}\n\n\t\t// type can be type or spec2\n\t\tif ( spec2 && !type ) {\n\t\t\ttype = spec2;\n\t\t}\n\n\t\t// without type, we can't really validate anything.\n\t\tif ( !_.isNumeric( type ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t//////\n\t\t// Size test:\n\t\t//\n\t\t// If type is 'whole number' (type == 0, because that means \"0 decimal points allowed\"),\n\t\t// or 'sortable' (type == 5, because nothing's that simple).\n\t\t// and size is not 0, test length against 'size' option\n\t\t//\n\t\tif ( (type == 0 || type == 5 ) && _.isNumeric( size ) && size > 0) {\n\t\t\t// for number attrs, we measure length without decimal point:\n\t\t\tnumLength = value.replace('.', '').length;\n\n\t\t\tif (size && numLength > parseInt(size, 10)) {\n\t\t\t\tisValid = false;\n\t\t\t\tmessage = options.message || i18n.t('i18n.validationNumberLessDigits', { count: parseInt( size, 10 ) } );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: isValid,\n\t\t\tmessage: message\n\t\t};\n\t}\n};\n\nconst originalStringLengthValidate = FormValidation.Validator.stringLength.validate;\nFormValidation.Validator.stringLength.validate = (validator, $field, options, validatorName) => {\n\tconst result = originalStringLengthValidate.call(FormValidation.Validator.stringLength, validator, $field, options, validatorName);\n\t\n\tif (result !== true && result.valid !== true && $field.attr('type') === 'password') {\n\t\tconst min = $.isNumeric(options.min) ? options.min : validator.getDynamicOption($field, options.min);\n\t\tresult.message = i18n.t('i18n.pleaseEnterAtLeastNCharacters', {count: min});\n\t}\n\n\treturn result;\n}\n\n// Do not handle disabling enabling of our submit buttons\nFormValidation.Framework.Bootstrap.prototype.disableSubmitButtons = function() {\n\treturn this;\n};\n\n// FV's destroy() method breaks if we re-render any form element after validation has been added.\n// Here is a workaround, but really this should be fixed in the plugin itself:\n// https://github.com/formvalidation/support/issues/488\nFormValidation.Base.prototype.destroy = FormValidation.Framework.Bootstrap.prototype.destroy = _.wrap( FormValidation.Base.prototype.destroy, function(destroy) {\n\tvar ns = 'fv';\n\tfor ( var field in this.options.fields ) {\n\t\tvar fields = this.getFieldElements(field);\n\t\tvar row = this.options.fields[field].row || this.options.row.selector;\n\t\tfor (var i = 0; i < fields.length; i++) {\n\t\t\t\tvar $field = fields.eq(i);\n\t\t\t\t// FV calls $field.data(ns + '.messages') and then expects jQuery functions to exist on the resulting object.\n\t\t\t\t// but if we've re-rendered, no such object exists.\n\t\t\t\t// Here we add a dummy empty jQ object, just to prevent that failure.\n\t\t\t\tvar f = $field.data(ns + '.messages');\n\t\t\t\tif (!f) {\n\t\t\t\t\t// http://stackoverflow.com/questions/1228474/jquery-empty-selector-null-selector\n\t\t\t\t\t$field.data(ns + '.messages', $());\n\t\t\t\t}\n\t\t}\n\t}\n\treturn destroy.apply(this, _.rest(arguments));\n});\n\n// It actually occurs in updateStatus which can get called from other parts than just the destroy method\nFormValidation.Base.prototype.updateStatus = FormValidation.Framework.Bootstrap.prototype.updateStatus = _.wrap( FormValidation.Base.prototype.updateStatus, function( updateStatus ) {\n\tvar ns = 'fv';\n\tfor ( var field in this.options.fields ) {\n\t\tvar fields = this.getFieldElements(field);\n\t\tvar row = this.options.fields[field].row || this.options.row.selector;\n\t\tfor (var i = 0; i < fields.length; i++) {\n\t\t\t\tvar $field = fields.eq(i);\n\t\t\t\t// FV calls $field.data(ns + '.messages') and then expects jQuery functions to exist on the resulting object.\n\t\t\t\t// but if we've re-rendered, no such object exists.\n\t\t\t\t// Here we add a dummy empty jQ object, just to prevent that failure.\n\t\t\t\tvar f = $field.data(ns + '.messages');\n\t\t\t\tif (!f) {\n\t\t\t\t\t// http://stackoverflow.com/questions/1228474/jquery-empty-selector-null-selector\n\t\t\t\t\t$field.data(ns + '.messages', $());\n\t\t\t\t}\n\t\t}\n\t}\n\treturn updateStatus.apply( this, _.rest( arguments ) );\n} );\n\nexport default FormValidation;","/**\n * @module core/functionality/form\n */\n\nconst NAME = 'form';\n\nimport CoreCollection from '../lib/netx-collection';\nimport FormErrorListView from '@netx/core-app/views/formErrorListView';\n\nimport {unescapeAttributeName} from '@netx/core/lib/underscore-netx';\n\nimport 'core-libs/formValidation-netx';\n\nexport const Props = {\n\t/**\n\t * Do anything you want when a field loses focus\n\t * @method\n\t * @param {event} e jQuery event\n\t */\n\tblurred(e) {\n\t\t//\n\t},\n\n\t/**\n\t * To support arbitrary re-rendering of the form at any time,\n\t * we cache all form values in _.formValues during preRender\n\t * and restore them (one by one) in postRender.\n\t * @see restoreCachedFormValue\n\t * @see flushCachedFormValues\n\t * @method\n\t */\n\tcacheFormValues() {\n\t\t//this._formValues = this.formChanged ? this.formValues() : {};\n\t\t// TODO: this sometimes fails, because subclasses override .formValues() in all sorts\n\t\t// of different ways. I had a note in here to not do that ... but it's been pretty useful.\n\t\t//\n\t\t// I think the solution is to call the non-overriden method, Netx.Views.FormView.protytpe.formValues(),\n\t\t// for just this specific case:\n\t\tthis._formValues = this.formChanged ? this.formValues() : {};\n\t},\n\n\t/**\n\t * You may want to override this.cacheQueries(), to cache more queries.\n\t * By default it caches jQuery queries, by name, for all form inputs. They are stored in the object this.inputs.\n\t * Example: if the template contains a form field named \"address\", it will be cached in this.inputs.$address .\n\t * (The leading $ is a naming convention to indicate a jQuery query.)\n\t * @method\n\t */\n\tcacheQueries() {\n\t\tthis.inputs = {};\n\n\t\t_.each(this.$(':input'), (el) => {\n\t\t\t// if element doesn't have a name, use id; if not that, fuggedaboutit.\n\t\t\tconst elName = el.name ? el.name : el.id;\n\n\t\t\tif (el.type == 'radio' || el.type == 'checkbox') {\n\t\t\t\t// Radios always come in groups, checkboxes sometimes do too.\n\t\t\t\t// If we haven't cached the complete group yet,\n\t\t\t\tif (!this.inputs[`$${elName}`]) {\n\t\t\t\t\t// cache it now.\n\t\t\t\t\tthis.inputs[`$${elName}`] = this.$(`:input[name=\"${elName}\"]`);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// or if the element is unnamed, discard it.\n\t\t\tif (elName) {\n\t\t\t\tthis.inputs[`$${elName}`] = this.$(el);\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * this.checkForm() is called at render, and on every form change.\n\t * If your form needs to manipulate itself based on changes, override this method to do that.\n\t * By default, it enables or disables the submit button based on the return value of this.submitReady();\n\t * @method\n\t * @param {event} e jQueryEvent (optional)\n\t */\n\tcheckForm(e) {\n\t\t// if this form hasn't ever rendered, there's nothing we can do here.\n\t\tif (!this.$submit || !this.$submit.length) return;\n\n\t\tif (this.submitReady()) {\n\t\t\tthis.$submit.enable();\n\t\t\tif (this.$submit.data('enabled-label')) {\n\t\t\t\tthis.$submit.html(this.$submit.data('enabled-label'));\n\t\t\t}\n\t\t} else {\n\t\t\tthis.$submit.disable();\n\t\t\tif (this.$submit.data('disabled-label')) {\n\t\t\t\tthis.$submit.html(this.$submit.data('disabled-label'));\n\t\t\t}\n\t\t}\n\t},\n\n\t// /**\n\t// * this.clearForm() clears out all values in the form.\n\t// * http://stackoverflow.com/questions/680241/resetting-a-multi-stage-form-with-jquery\n\t// * @method\n\t// * @deprecated\n\t// * @todo This is all handled in our reset wrapper above.\n\t// */\n\t// clearForm() {\n\t// \tconsole.warn('formView.clearForm deprecated, gone in 8.13');\n\t// \tthis.$el.find('input:text, input:password, input:file, select, textarea').val('');\n\t// \tthis.$el.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');\n\t// \t// TODO: reset changes?\n\t// }\n\n\t/**\n\t * Is called when this.eventStr + \":error\" is triggered\n\t * @method\n\t * @param {string} error Error string\n\t */\n\tfailure(error, thing) {\n\t\t// Check that the failure was for us (comes from <eventStr>:error)\n\t\t// Our pattern has been to have the model/collection as the second argument passed back from the success event\n\t\tif (thing) {\n\t\t\tif (this.model && thing.isModel) {\n\t\t\t\tif (thing !== this.model) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (this.collection && thing.isCollection) {\n\t\t\t\tif (thing !== this.collection) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.submitting) {\n\t\t\tthis.submitting.rejectWith(this, arguments);\n\t\t\tdelete this.submitting;\n\t\t}\n\t\tthis.$el.removeClass('form-submitting');\n\t\tthis.$('.form-submitting').hide();\n\t},\n\n\t/**\n\t * A new input field was added\n\t * @method\n\t * @param e Field added event (nx)\n\t */\n\tfieldAdded(e) {\n\t\tconst validator = this.validator;\n\t\tconst $target = $(e.target);\n\t\tif (validator.enabled && validator.plugin) {\n\t\t\tvalidator.plugin.addField($target);\n\t\t\tif (this.revalidateFieldOnAdd) {\n\t\t\t\tvalidator.plugin.revalidateField($target);\n\t\t\t}\n\t\t}\n\t\t// Add reference to the cached queries\n\t\tif (this.inputs) {\n\t\t\tthis.inputs['$' + e.target.name] = $target;\n\t\t}\n\t},\n\n\t/**\n\t * An input field is being modifed, assume it will be non recoverable and remove from\n\t * the validation instance (will be added back in `this.fieldMutated` if the proper event is fired by the view in charge)\n\t * @method\n\t * @param e Field changing event (nx)\n\t */\n\tfieldMutating(e) {\n\t\tconst validator = this.validator;\n\n\t\tvalidator.enabled &&\n\t\t\tvalidator.plugin &&\n\t\t\tvalidator.plugin._cacheFields[e.target.name] &&\n\t\t\tvalidator.plugin.removeField($(e.target));\n\t},\n\n\t/**\n\t * Should be fired right after the input field has been mutated (see `this.fieldMutating`)\n\t * @method\n\t * @param e Field changed event (nx)\n\t */\n\tfieldMutated(e) {\n\t\tconst validator = this.validator;\n\t\tconst $target = $(e.target);\n\t\tif (validator.enabled && validator.plugin) {\n\t\t\tvalidator.plugin.addField($target).revalidateField($target);\n\t\t}\n\t\t// Add reference back to the cached queries\n\t\tif (this.inputs) {\n\t\t\tthis.inputs['$' + e.target.name] = $target;\n\t\t}\n\t},\n\n\t/**\n\t * Should be fired right before the filed is removed from the DOM\n\t * Important that the input is still in the DOM so we can properyly remove validation\n\t * @method\n\t * @param e Field removed event (nx)\n\t */\n\tfieldRemoved(e) {\n\t\tconst validator = this.validator;\n\n\t\tvalidator.enabled &&\n\t\t\tvalidator.plugin &&\n\t\t\tvalidator.plugin._cacheFields[e.target.name] &&\n\t\t\tvalidator.plugin.removeField($(e.target));\n\n\t\t// Remove cached query\n\t\tif (this.inputs) {\n\t\t\tdelete this.inputs['$' + e.target.name];\n\t\t}\n\t},\n\n\t/**\n\t * A field has been deemed invalid\n\t * @method\n\t * @param {event} e jQuery event\n\t * @param {object} fvf formValidation field object\n\t */\n\tfieldValidationFailure(e, fvf) {},\n\n\t/**\n\t * A field has been deemed valid\n\t * @method\n\t * @param {event} e jQuery event\n\t * @param {object} fvf formValidation field object\n\t */\n\tfieldValidationSuccess(e, fvf) {\n\t\t// If we have submitted before then we obviously had some errors\n\t\tif (this.errorCache.length && this.submitted) {\n\t\t\tthis.errorCache.remove(fvf.element.attr('name'));\n\t\t}\n\t},\n\n\t/**\n\t * Clear all form values we may have cached during a render\n\t * @method\n\t * @see cacheFormValues\n\t * @see restoreCachedFormValue\n\t */\n\tflushCachedFormValues() {\n\t\tdelete this._formValues;\n\t},\n\n\t/**\n\t * this.focus() is called when the form is shown or rendered; override it to set form focus how you like it.\n\t * The default does this: http://stackoverflow.com/questions/267615/focusing-first-control-in-the-form-using-jquery\n\t * @method\n\t * @param {string} selector jQuery selector string\n\t */\n\tfocus(selector) {\n\t\tif (selector == null) {\n\t\t\tthis.$('form:not(.filter) :input:visible:enabled:first').focus();\n\t\t} else {\n\t\t\tthis.$(selector).focus();\n\t\t}\n\t},\n\n\t/**\n\t * The form was submitted but was invalid\n\t * @method\n\t * @param {event} e jQuery event\n\t * @fires (this.eventStr):validation:failure\n\t * @fires module:notification#notification\n\t */\n\tformValidationFailure(e) {\n\t\t// Set errors\n\t\tthis.errorCache.set(\n\t\t\t_.map(this.getValidationErrors(), (input) => {\n\t\t\t\treturn {\n\t\t\t\t\tid: input.name,\n\t\t\t\t\tname: input.name,\n\t\t\t\t\tinput: $(input),\n\t\t\t\t};\n\t\t\t}),\n\t\t);\n\n\t\tdispatcher.trigger(`${this.eventStr}:validation:failure`, this);\n\t\tthis.submitted = true;\n\t\t// We will need to rethink this as you cannot read the whole message in that little notification box.\n\t\tdispatcher.trigger('notification', {\n\t\t\tmodule: 'app',\n\t\t\ttitle: i18n.t('i18n.error'),\n\t\t\tdescription: i18n.t('i18n.invalidForm'),\n\t\t\ttype: 'danger',\n\t\t});\n\t},\n\n\t/**\n\t * Form was successfully validated\n\t * @method\n\t * @param {event} e jQuery event\n\t */\n\tformValidationSuccess(e) {\n\t\t// forward the event\n\t\tdispatcher.trigger(`${this.eventStr}:validation:success`, this);\n\t},\n\n\t/**\n\t * this.formValues() gathers the names and values of all the form inputs into one simple JS object for submission to a submit event handler.\n\t * This should not need to be overridden -- if it's not working, let's fix it.\n\t * @method\n\t * @return {object} Object containing input form values\n\t */\n\tformValues() {\n\t\t// HACK: the initial query caching can fail for the assetAttributes view, because its fields\n\t\t// all have templates that are still loading. We solved that for childViews ... so attrs should\n\t\t// just be converted to childViews. For now, make sure we get everything by caching once more.\n\t\t//\n\t\t// TODO: this shouldn't be necessary now that templates are preloaded. Remove this?\n\t\t// No, so much depends on this behavior apparently - that is how unknown (new) inputs magically found their way in to this.inputs.\n\t\tthis.cacheQueries();\n\n\t\tconst values = {};\n\t\t_.each(this.inputs, (i, $idx, all) => {\n\t\t\t// TODO: there's some oddness here:\n\t\t\t// At this point, i is a jquery selector,\n\t\t\t// but we're also using $(i) below -- which works, but is not necessary.\n\t\t\t// Also: use .is() to determine attr type & state, instead of all that .attr/.prop stuff.\n\t\t\t// In general this method needs cleanup & better doc, but it's working, so ...\n\n\t\t\t// '$foo' -> 'foo'\n\t\t\tlet idx = $idx.slice(1);\n\n\t\t\t// Skip any auto-generated form elements created by select2 -- they don't contain our data.\n\t\t\t// TODO: do this in cacheQueries() instead. (Never even cache these.)\n\t\t\tif (idx.match(/s2id_autogen\\d/)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If we have multiple inputs with array styled names (like attribute[0], attribute[1]);\n\t\t\tlet match = idx.match(/\\[(.*?)\\]/g);\n\n\t\t\tif (!_.isNull(match)) {\n\t\t\t\tif (match.length === 1) {\n\t\t\t\t\tidx = idx.replace(/\\[(.*?)\\]/, '');\n\t\t\t\t\tif (!values[idx]) {\n\t\t\t\t\t\tvalues[idx] = _.isNumeric(idx) ? [] : {};\n\t\t\t\t\t}\n\t\t\t\t\t// eslint-disable-next-line no-useless-escape\n\t\t\t\t\tvalues[idx][match[0].replace(/[\\[\\]']+/g, '')] =\n\t\t\t\t\t\ti.attr('type') == 'checkbox'\n\t\t\t\t\t\t\t? i.prop('checked')\n\t\t\t\t\t\t\t: i.attr('type') == 'radio'\n\t\t\t\t\t\t\t? i.filter(':checked').val()\n\t\t\t\t\t\t\t: i.val();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// (like attribute[thing1][thing], attribute[thing2][thing])\n\t\t\t\t\tconst topLevelName = idx.replace(match.join(''), '');\n\t\t\t\t\tif (_.isUndefined(values[topLevelName])) {\n\t\t\t\t\t\tvalues[topLevelName] = {};\n\t\t\t\t\t}\n\t\t\t\t\t_.reduce(\n\t\t\t\t\t\tmatch,\n\t\t\t\t\t\t(memo, name, index, all) => {\n\t\t\t\t\t\t\t// eslint-disable-next-line no-useless-escape\n\t\t\t\t\t\t\tname = name.replace(/[\\[\\]']+/g, '');\n\t\t\t\t\t\t\tif (_.isUndefined(memo[name])) {\n\t\t\t\t\t\t\t\tmemo[name] =\n\t\t\t\t\t\t\t\t\tindex + 1 < all.length\n\t\t\t\t\t\t\t\t\t\t? {}\n\t\t\t\t\t\t\t\t\t\t: i.attr('type') == 'checkbox'\n\t\t\t\t\t\t\t\t\t\t? i.prop('checked')\n\t\t\t\t\t\t\t\t\t\t: i.attr('type') == 'radio'\n\t\t\t\t\t\t\t\t\t\t? i.filter(':checked').val()\n\t\t\t\t\t\t\t\t\t\t: i.val();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn memo[name];\n\t\t\t\t\t\t},\n\t\t\t\t\t\tvalues[topLevelName],\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we have broken a multiselect into individual checkboxes, save only the box that's checked.\n\t\t\tmatch = idx.match(/-checkbox(\\d+)$/);\n\t\t\t// DEVNOTE: to match normal multiselect behavior, we need 'null' instead of empty array for no selection.\n\t\t\tif (!_.isNull(match)) {\n\t\t\t\tif (!values[match[1]]) {\n\t\t\t\t\tvalues[match[1]] = '';\n\t\t\t\t}\n\t\t\t\tif ($(i).prop('checked')) {\n\t\t\t\t\t// convert the csv to an array, append to it, then convert back\n\t\t\t\t\tvalues[match[1]] = _.arrayToCsv(\n\t\t\t\t\t\t_.csvToArray(values[match[1]]).concat($(i).val()),\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for multiselects, encode the array value as CSV.\n\t\t\tif (i.prop('multiple')) {\n\t\t\t\tvalues[idx] = _.arrayToCsv(i.val());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If this is a radio button, find the radio button by this name that's actually checked\n\t\t\tif ($(i).attr('type') == 'radio') {\n\t\t\t\tconst checkedRadio = this.$(':input[name=\"' + i[0].name + '\"]:checked');\n\t\t\t\tif (checkedRadio.length) {\n\t\t\t\t\ti = checkedRadio;\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If this is a checkbox group, amalgamate the checked values.\n\t\t\tif (i.is(':checkbox') && i.length > 1) {\n\t\t\t\tconst checkedBoxes = this.$(':input[name=\"' + i[0].name + '\"]:checked');\n\t\t\t\t// convert to array of values:\n\t\t\t\tvalues[idx] = checkedBoxes.map(function (elIdx, el) {\n\t\t\t\t\treturn $(el).val();\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvalues[idx] = i.attr('type') == 'checkbox' ? i.prop('checked') : i.val();\n\t\t});\n\n\t\treturn values;\n\t},\n\n\t/**\n\t * Gets a jQuery array of invalid fields\n\t * @method\n\t * @return {array} Invalid fields\n\t */\n\tgetValidationErrors() {\n\t\tconst validation = this.Plugins.GetInstance('validation');\n\t\tif (validation) {\n\t\t\treturn validation.getInvalidFields();\n\t\t}\n\t\treturn [];\n\t},\n\n\t/**\n\t * Ok, there are some issues with trying to be agnostic and having input/select ui plugins that hide the original element\n\t * you still want that hidden element to be validated but it is almost impossible to know (without modifying code each time you add a plugin)\n\t * if the element was hidden intentionally (like we do in attribute forms) and when an element was hidden to manipulate the ui only.\n\t * Solution: rather than calling hide/show/toggle directly on the elements in the view- pass the elements through here.\n\t * It also handles bulk hiding (the validator will look at parents for the data-nx-ignore=\"validation\" attribute as well)\n\t * If validation is not turned on for whatever reason the element passed will be sent to where it would have gone\n\t * @param {element} input The jQuery element to hide\n\t */\n\thideField(...input) {\n\t\tconst inputs = [...input];\n\t\tconst $form = this.$form;\n\t\tconst plugins = this.Plugins;\n\t\tconst validation = this.validator.enabled;\n\n\t\t_.each(inputs, (input) => {\n\t\t\tlet $input = $(input);\n\t\t\tif (!$input.is(':input')) {\n\t\t\t\t$input = $input.find(':input');\n\t\t\t}\n\n\t\t\tlet $formGroup = $input.closest('.form-group');\n\t\t\tif (!$formGroup.length) {\n\t\t\t\t$formGroup = $input;\n\t\t\t}\n\n\t\t\tif (validation) {\n\t\t\t\t_.each($input, (el) => {\n\t\t\t\t\tel.name &&\n\t\t\t\t\t\tplugins.Invoke('validation', $form, 'updateStatus', [\n\t\t\t\t\t\t\tel.name,\n\t\t\t\t\t\t\t'VALID',\n\t\t\t\t\t\t]);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t$input.nxIgnore('validation');\n\t\t\t$formGroup.hide();\n\t\t});\n\t},\n\n\t/**\n\t * Tell FormView that a form changed happened.\n\t * It sets the formChanged flag, and calls checkForm() to potentially enable the submit button.\n\t * Form input change events are forwarded here (see events{} block).\n\t * Various other form tricks (like adding/removing inputs from the form) may also need to trigger this.\n\t * @method\n\t * @param {event} e Change event (optional)\n\t */\n\tinputChanged(e) {\n\t\tlet $target, changeEvent;\n\t\tif (e instanceof jQuery.Event) {\n\t\t\tchangeEvent = e;\n\t\t\t$target = this.$(changeEvent.target);\n\t\t\tif (\n\t\t\t\t$target.nxIgnores('change') ||\n\t\t\t\t$target.hasClass('select2-search__field')\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.formChanged = true;\n\t\tthis.trigger('formChanged', $target);\n\t\tthis.checkForm(changeEvent);\n\t},\n\n\t/**\n\t * @method\n\t * @return {boolean}\n\t */\n\tisValid() {\n\t\treturn this.submitReady();\n\t},\n\n\t/**\n\t * this.keydown() checks if there are more erros and focus the input with the next error\n\t * @method\n\t * @param {event} e jQuery event\n\t */\n\tkeydown(e) {\n\t\tconst keyCode = e.keyCode || e.which;\n\t\t// Only care if it was an enter key\n\t\tif (keyCode === 13 && this.errorCache.length) {\n\t\t\tthis.errorCache.at(0).get('input').focus();\n\t\t}\n\t},\n\n\t/** @override */\n\tprepareForm() {\n\t\t// Cleanup\n\t\tthis.$form && this.$form.off();\n\t\tthis.validator.enabled = false;\n\t\tthis.Plugins.Destroy('validation');\n\n\t\tif (this.disableCache) {\n\t\t\t// Fresh start\n\t\t\tthis.formChanged = false;\n\t\t\tthis._formValues = {};\n\t\t} else {\n\t\t\tthis.cacheFormValues();\n\t\t}\n\t},\n\n\t/**\n\t * Do not override postRender() without calling the superclass imlementation (this._super ) explicity!\n\t * Sets up submit target and calls {@link #cacheQueries} and {@link #checkForm}.\n\t * @method\n\t */\n\trenderForm() {\n\t\t// Cache\n\t\tthis.$form = this.$('form:first');\n\t\tthis.$submit = this.$('[type=\"submit\"]');\n\t\tthis.$target = this.$('.target');\n\n\t\t/**\n\t\t * Form permissions:\n\t\t * Asset and category models have an 'allows' method that checks their internal permissions\n\t\t * against the current use ID and one of the default permission types (for instance, 'modify').\n\t\t *\n\t\t * If this.model.allows() is a method, and this.matrix is a string,\n\t\t * FormView will test that string using that function, and put the form into 'read-only' mode if the test fails:\n\t\t * the class 'read-only' will be added to the top-level element, and all inputs will be disabled.\n\t\t *\n\t\t * Individual form inputs that need to override this can set the HTML attrbute \"data-nx-matrix\"\n\t\t * to a different permision name (for instance, 'read') and that permission will be tested instead.\n\t\t */\n\n\t\t// https://jira.netx.net/browse/DAM-9780\n\t\t// We do not want to collide with `attributePermissions` and `permissionMatrix`\n\t\t// Really, we need to break the attribute code out of formView and let it do what it does best: forms\n\t\tlet readonly = false;\n\n\t\tthis.$el.toggleClass('read-only', readonly);\n\n\t\tlet disabledCount = 0;\n\t\tlet emptyCount = 0;\n\t\tlet inputCount = 0;\n\t\t// TODO: Start using form names and target our searches for inputs to that specific form\n\t\t// That way we can start utilizing nested forms without interference\n\t\t// Iterate over each input in the form:\n\t\t_.each(this.$(':input').not(':button'), (element) => {\n\t\t\tconst $element = $(element);\n\t\t\t// Is this input for toggling \"append value\"?\n\t\t\tconst isAppend = $element.hasClass('nx-append-value');\n\n\t\t\t// Track amount of inputs\n\t\t\t// Omit \"append value\" toggles\n\t\t\tif (!isAppend) {\n\t\t\t\tinputCount++;\n\t\t\t}\n\n\t\t\tconst $input = $element;\n\t\t\t// TODO: This code will never get hit because we explicitely set this to fale with no way to change it from the outside\n\t\t\t// Disable the input if we're read-only:\n\t\t\tif (readonly) {\n\t\t\t\tconst disableInput = !$input.nxIgnores('matrix');\n\n\t\t\t\t$input\n\t\t\t\t\t.prop('disabled', disableInput)\n\t\t\t\t\t.closest('.form-group')\n\t\t\t\t\t.toggleClass('read-only', disableInput);\n\n\t\t\t\t// Track the amount of disabled inputs\n\t\t\t\tif (disableInput) {\n\t\t\t\t\tdisabledCount++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// restore the value from before render, if any\n\t\t\tconst cachedValue = this.restoreCachedFormValue($element) || $input.val();\n\t\t\tconst value = cachedValue;\n\t\t\tlet hasValue = !_.isUndefined(value);\n\t\t\tif (hasValue) {\n\t\t\t\tif (_.isArray(value)) {\n\t\t\t\t\thasValue = value.length > 0;\n\t\t\t\t} else if (_.isString(value)) {\n\t\t\t\t\thasValue = value.trim() != '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Track the amount of empty inputs\n\t\t\tif (!isAppend && !hasValue) {\n\t\t\t\temptyCount++;\n\t\t\t}\n\t\t});\n\n\t\t// if our form has any backbone tooltips, initialize that piece of Backbone.\n\t\tthis.$('[data-toggle=\"tooltip\"]').tooltip();\n\n\t\tthis.cacheQueries();\n\n\t\t// Validation error list element\n\t\tthis.$validationErrors = this.$('[data-nx-control=\"validation-errors\"]');\n\t\tthis.errorCacheView.setElement(this.$validationErrors).render();\n\n\t\t// Are all the fileds disabled\n\t\tthis.$el.toggleClass(\n\t\t\t'all-fields-disabled',\n\t\t\t!_.isEmpty(this.inputs) && disabledCount >= inputCount,\n\t\t);\n\t\t// Are all the fields empty\n\t\tthis.$el.toggleClass(\n\t\t\t'all-fields-empty',\n\t\t\t!_.isEmpty(this.inputs) && emptyCount >= inputCount,\n\t\t);\n\n\t\t// DEVNOTE: X7 core code should not be making UX decisions like\n\t\t// determining whether a form field gains focus when shown. The\n\t\t// theme itself should decide when to utilize a formView's focus() method.\n\t\t// this.focus();\n\n\t\t// Most likely cases of this- modals\n\t\t// If the element is not visible then neither is any of its inputs\n\t\t// We can not get validation on inputs that are not visible\n\t\t// So let's wait to check the form until it is shown\n\t\tthis.whenShown.then(this.checkForm);\n\t},\n\n\t/**\n\t * this.reset() is intended to reset the form into a clean initial state.\n\t * The actual reset of the form is handled in a wrapper above.\n\t * This method is intended to provide child views the ability to reset private\n\t * variables, set up complex UI elements, etc.\n\t * this.reset() is called automatically when this.show() is called, if the\n\t * boolean this.resetOnShow is true and the view is not already visible in the DOM.\n\t * @method\n\t */\n\treset() {\n\t\tconst $form = this.$('form');\n\t\t// Vanilla reset\n\t\t$form.length && $form[0].reset();\n\t\t// Validator reset - only resets fields that would be validated\n\t\tthis.validator.enabled &&\n\t\t\tthis.Plugins.Invoke('validation', $form, 'resetForm');\n\n\t\t// Other\n\t\tthis.formChanged = false;\n\t\tthis.submitted = false;\n\t\t// If the submitting promise is still around for some reason\n\t\tif (this.submitting) {\n\t\t\t// And it is still in a pending state - reject\n\t\t\tthis.submitting.state() === 'pending' && this.submitting.rejectWith(this);\n\t\t\tdelete this.submitting;\n\t\t}\n\t},\n\n\t/**\n\t * Restore a single form value from the cache\n\t * @method\n\t * @param {object} element jQuery element\n\t * @return {mixed} Cached value\n\t * @see cacheFormValues\n\t * @see flushCachedFormValues\n\t */\n\trestoreCachedFormValue($element) {\n\t\tconst inputName = $element.attr('name');\n\t\tlet value;\n\n\t\tif (\n\t\t\tinputName == null ||\n\t\t\tinputName === false ||\n\t\t\t!this._formValues ||\n\t\t\t!_.has(this._formValues, inputName)\n\t\t)\n\t\t\treturn value;\n\n\t\t// We have to unpack the cache differently for different input types.\n\t\tif ($element.prop('multiple')) {\n\t\t\tvalue = _.csvToArray(this._formValues[inputName]);\n\t\t\t$element.val(value);\n\t\t\treturn value;\n\t\t}\n\t\tif ($element.attr('type') === 'checkbox') {\n\t\t\tvalue = this._formValues[inputName];\n\t\t\t$element.prop('checked', value);\n\t\t\treturn value;\n\t\t}\n\n\t\t// If it's a radio, we need to check the correct option in the group\n\t\tif ($element.attr('type') === 'radio') {\n\t\t\tvalue = this._formValues[inputName];\n\t\t\t$element.prop('checked', $element.val() === value);\n\t\t\treturn value;\n\t\t}\n\n\t\tvalue = this._formValues[inputName];\n\t\t$element.val(value);\n\t\treturn value;\n\t},\n\n\t/**\n\t * this.setForm(values) sets all inputs to the values given.\n\t * @method\n\t * @param {object} values Form values\n\t */\n\tsetForm(values) {\n\t\t_.each(values, (v, idx) => this.setValue(idx, v));\n\t},\n\n\t/**\n\t * this.setFormValidation() is called at postRender and initializes form validation\n\t * @method\n\t * @param {element} $form Form element\n\t */\n\tsetFormValidation($form) {\n\t\t$form = $form || this.$('form[data-nx-validate-form]');\n\n\t\t// Cleanup\n\t\tthis.Plugins.Destroy('validation');\n\t\tthis.validator.enabled = false;\n\n\t\tif (!$form.length) return;\n\n\t\tthis.validator.enabled = true;\n\t\tthis.Plugins.Initialize('validation', $form).then((instance) => {\n\t\t\t// Store\n\t\t\tthis.validator.plugin = instance;\n\n\t\t\t// Pipe some events\n\t\t\t_.each(\n\t\t\t\t['err.form.fv', 'err.field.fv', 'success.form.fv', 'success.field.fv'],\n\t\t\t\t(event) => {\n\t\t\t\t\t$form.off(event).on(event, (...args) => {\n\t\t\t\t\t\tthis.trigger(`validation:${event}`, ...args);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t);\n\n\t\t\t// FV does a weird thing: it catches submit events, preventsDefault() on them,\n\t\t\t// and detects if they were due to a submit button click or not.\n\t\t\t// BUT it doesn't call stopPropagation() on them.\n\t\t\t// Then after validation succeeds, it triggers a new submit event\n\t\t\t// *only if* the original submit was from a button click. But\n\t\t\t// the original submit event propagates either way.\n\t\t\t//\n\t\t\t// So our submit event handler would get two submit events if form is valid & submit button was clicked,\n\t\t\t// but one otherwise, whether or not the form is valid. That's bizarre.\n\t\t\t//\n\t\t\t// FV's official policy is that you should give up on the submit event and listen\n\t\t\t// for their success event instead; however, that requires a lot of special-FV-handling\n\t\t\t// code, and not all our forms have FV on them. Either they don't understand\n\t\t\t// the problem well enough, or I don't understand their special needs yet ...\n\t\t\t//\n\t\t\t// FormView wants to get one event if validation succeeds, no events otherwise.\n\t\t\t// It wants to remain agnostic about where the event came from, and\n\t\t\t// whether or not fv is enabled.\n\t\t\t//\n\t\t\t// Here we override FV, to have it stopPropagation on the original event if\n\t\t\t// fv already detected a button click.\n\t\t\t//\n\t\t\t// TODO: test in all browsers, with all three submission techniques: click submit,\n\t\t\t// trigger submit event, or call view.submit().\n\t\t\t//\n\t\t\t// Tested in Chrome, works fine.\n\t\t\t// Tested in Safari, works fine.\n\t\t\t$form.off('submit.fv').on('submit.fv', (e) => {\n\t\t\t\t// fv does this.\n\t\t\t\te.preventDefault();\n\t\t\t\t// fv doesn't do this.\n\t\t\t\tinstance.$submitButton && e.stopPropagation();\n\t\t\t\tinstance.validate();\n\t\t\t});\n\n\t\t\t// Let the view know\n\t\t\tthis.trigger('validation:set', this, instance);\n\t\t});\n\t},\n\n\t/**\n\t * Set an individual form value.\n\t * @method\n\t * @param {string} input Input name\n\t * @param {string} value New input value\n\t */\n\tsetValue(input, value) {\n\t\tthis.$(':input').filter(`[name=\"${input}\"]`).val(value);\n\t},\n\n\t/**\n\t * Ok, there are some issues with trying to be agnostic and having input/select ui plugins that hide the original element\n\t * you still want that hidden element to be validated but it is almost impossible to know (without modifying code each time you add a plugin)\n\t * if the element was hidden intentionally (like we do in attribute forms) and when an element was hidden to manipulate the ui only.\n\t *\n\t * Solution: rather than calling hide/show/toggle directly on the elements in the view- pass the elements through here.\n\t * It also handles bulk hiding (the validator will look at parents for the data-nx-ignore=\"validation\" attribute as well)\n\t * If validation is not turned on for whatever reason the element passed will be sent to where it would have gone\n\t * @param {element} input The jQuery element to hide\n\t * @fires module:app#app:resize\n\t */\n\tshowField(...input) {\n\t\tconst inputs = [...input];\n\t\tconst $form = this.$form;\n\t\tconst plugins = this.Plugins;\n\t\tconst validation = this.validator.enabled;\n\n\t\t_.each(inputs, (input) => {\n\t\t\tlet $input = $(input);\n\t\t\tif (!$input.is(':input')) {\n\t\t\t\t$input = $input.find(':input');\n\t\t\t}\n\n\t\t\tlet $formGroup = $input.closest('.form-group');\n\t\t\tif (!$formGroup.length) {\n\t\t\t\t$formGroup = $input;\n\t\t\t}\n\n\t\t\t$input.nxUnignore('validation');\n\t\t\t$formGroup.show();\n\n\t\t\tif (validation) {\n\t\t\t\t_.each($input, (el) => {\n\t\t\t\t\tel.name &&\n\t\t\t\t\t\tplugins.Invoke('validation', $form, 'resetField', [el.name]);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * this.submit() submits the current form by triggering the event this.eventStr + \":confirmed\" on dispatcher,\n\t * with the arguments returned by this.submitArgs(). A controller should catch this event\n\t * and perform whatever steps are necessary.\n\t *\n\t * @method\n\t * @param {method} submit Submit method\n\t * @param {event} e Submit event\n\t * @fires (this.eventStr):cancelled\n\t * @fires (this.eventStr):confirmed\n\t */\n\tsubmit(e) {\n\t\t// The cake stops here:\n\t\tif (e && e.preventDefault) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t} else {\n\t\t\t// There was no event argument, so we weren't called by an event handler.\n\t\t\t// Instead, other code called submit() directly.\n\t\t\t// However, that circumvents any form validation that might be present.\n\t\t\t// So we re-trigger a new submit event, which will call this method again\n\t\t\t// if validation succeeds.\n\t\t\t//\n\t\t\t// In other words, there isn't & should not be a difference between calling\n\t\t\t// this method and triggering a submit event. We are agnostic, and that is good!\n\t\t\treturn this.$('form:first').trigger('submit');\n\t\t}\n\n\t\t// Yes, the form may be valid ... but what if we disabled the submit for other reasons?\n\t\tif (!this.submitReady()) {\n\t\t\treturn this.checkForm();\n\t\t}\n\n\t\t// Let it be known\n\t\tthis.submitted = true;\n\n\t\t// Track our submit\n\t\tif (this.submitting && this.submitting.state() === 'pending') {\n\t\t\tthis.submitting.rejectWith(this);\n\t\t}\n\t\tthis.submitting = new $.Deferred();\n\n\t\tconst confirmed = () => {\n\t\t\tthis.$el.addClass('form-submitting');\n\n\t\t\t// Just submit it\n\t\t\t// Disable submit buttons\n\t\t\tthis.$('[type=\"submit\"]').disable();\n\n\t\t\t// DAM-15747 if there is a confirmMessage, then let\n\t\t\t// confirmView trigger the :confirmed event, no doubling down\n\t\t\tif (!this.confirmMessage) {\n\t\t\t\tdispatcher.trigger.apply(\n\t\t\t\t\tdispatcher,\n\t\t\t\t\t[this.eventStr + ':confirmed'].concat(this.submitArgs.apply(this)),\n\t\t\t\t);\n\t\t\t}\n\t\t\tthis.$('.form-submitting').show();\n\t\t};\n\n\t\tconst cancelled = () => {\n\t\t\tif (!this.submitting) return;\n\t\t\tthis.submitting.rejectWith(this);\n\t\t\tdelete this.submitting;\n\t\t};\n\n\t\tif (this.confirmMessage) {\n\t\t\t// Confirm before submit:\n\t\t\t// If we have a confirmation message, fire a confirmation modal\n\t\t\tconst cancelEventStr = `${this.eventStr}:cancelled`;\n\t\t\t// We do want fire our `<this.eventStr>:confirmed` event twice\n\t\t\tconst confirmedEventStr = `${this.eventStr}:confirmed`;\n\n\t\t\t// custom listener methods are safe to remove\n\t\t\tconst confirmedMethod = () => {\n\t\t\t\tdispatcher.off(cancelEventStr, cancelledMethod);\n\t\t\t\tconfirmed();\n\t\t\t};\n\t\t\tconst cancelledMethod = () => {\n\t\t\t\tdispatcher.off(confirmedEventStr, confirmedMethod);\n\t\t\t\t// Re-enable etc\n\t\t\t\tthis.checkForm();\n\t\t\t\tcancelled();\n\t\t\t};\n\t\t\tdispatcher.once(confirmedEventStr, confirmedMethod);\n\t\t\tdispatcher.once(cancelEventStr, cancelledMethod);\n\n\t\t\tdispatcher.trigger.apply(\n\t\t\t\tdispatcher,\n\t\t\t\t[\n\t\t\t\t\t'app:confirm',\n\t\t\t\t\t_.extend(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmessage: _.isFunction(this.confirmMessage)\n\t\t\t\t\t\t\t\t? this.confirmMessage()\n\t\t\t\t\t\t\t\t: this.confirmMessage,\n\t\t\t\t\t\t\tyesEvent: confirmedEventStr,\n\t\t\t\t\t\t\tnoEvent: cancelEventStr,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tthis.confirmViewOpts,\n\t\t\t\t\t),\n\t\t\t\t].concat(this.submitArgs()),\n\t\t\t);\n\t\t} else {\n\t\t\t// just do it!\n\t\t\tconfirmed();\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t/**\n\t * this.submitArgs() can be overriden to return an array of whatever args you want to pass.\n\t * by default we return three args: an object with all the input form values, our model or collection,\n\t * and this.args (which may be undefined)\n\t * @method\n\t * @return {array} Two element array: object containing input form values, and this.args\n\t */\n\tsubmitArgs() {\n\t\tconst formValues = this.formValues();\n\t\tlet _formValues = {};\n\n\t\t// Unescape our from value keys as they were escaped via the name when injecting attributes\n\t\t_.reduce(\n\t\t\tformValues,\n\t\t\t(result, value, key) => {\n\t\t\t\tresult[unescapeAttributeName(key)] = value;\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\t_formValues,\n\t\t);\n\n\t\treturn [_formValues, this.model || this.collection].concat(this.args);\n\t},\n\n\t/**\n\t * submitReady() tests if the form can be submitted yet.\n\t * There is a wrapper above for this that checks form validation and the result of this method\n\t * Returns true by default; can be overridden with any submit-enable test you like.\n\t * @method\n\t * @return {boolean} Status of the submit action: ready or not.\n\t */\n\tsubmitReady() {\n\t\tconst validation = this.Plugins.GetInstance('validation');\n\t\treturn (\n\t\t\t(!validation || validation.isValid() !== false) &&\n\t\t\t(!this.requiresChanges || this.formChanged)\n\t\t);\n\t},\n\n\t/**\n\t * Is called when <this.eventStr>:success is triggered\n\t * @method\n\t * @param {Netx.Model|Netx.Collection} thing Netx.Model or Netx.Collection\n\t * @param {boolean} isNew Whether the model was new or not\n\t */\n\tsuccess(thing) {\n\t\t// Check that the success was for us (comes from <eventStr>:success)\n\t\t// Our pattern has been to have the model/collection as the first argument passed back from the success event\n\t\tif (thing) {\n\t\t\tif (this.model && thing.constructor.__isModel__) {\n\t\t\t\tif (thing !== this.model) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (this.collection && thing.constructor.__isCollection__) {\n\t\t\t\tif (thing !== this.collection) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Let the form know it is no longer changed (as data has most likely been saved)\n\t\tthis.formChanged = false;\n\t\t// Resolve submitting promise and pass back any arguments that may have come with the success\n\t\tif (this.submitting) {\n\t\t\tthis.submitting.resolveWith(this, _.rest(arguments));\n\t\t\tdelete this.submitting;\n\t\t}\n\t\t// Hide on submit\n\t\tif (this.hideOnSubmit) {\n\t\t\tif (!this.removeOnHide) {\n\t\t\t\t// Reset form\n\t\t\t\tif (this.resetOnSubmit) this.reset();\n\t\t\t}\n\t\t\tthis.hide();\n\t\t\tthis.stopListening(dispatcher, `${this.eventStr}:success`, this.success);\n\t\t}\n\t\t// Remove on submit\n\t\telse if (this.removeOnSubmit) {\n\t\t\t// Let hide handle the remove in case there are any theme related animations, etc\n\t\t\t// so set this.removeOnHide to true and call this.hide\n\t\t\tthis.removeOnHide = true;\n\t\t\tthis.hide();\n\t\t\tthis.stopListening(dispatcher, `${this.eventStr}:success`, this.success);\n\t\t}\n\t\t// Nothing\n\t\telse {\n\t\t\t// Reset form\n\t\t\tif (this.resetOnSubmit) this.reset();\n\t\t\t// Reset validation\n\t\t\tif (this.validator.enabled) {\n\t\t\t\tthis.setFormValidation();\n\t\t\t\tthis.checkForm();\n\t\t\t}\n\t\t}\n\n\t\tthis.formChanged = false;\n\t\tthis.$el.removeClass('form-submitting');\n\t\tthis.$('.form-submitting').hide();\n\t},\n\n\t/**\n\t * Ok, there are some issues with trying to be agnostic and having input/select ui plugins that hide the original element\n\t * you still want that hidden element to be validated but it is almost impossible to know (without modifying code each time you add a plugin)\n\t * if the element was hidden intentionally (like we do in attribute forms) and when an element was hidden to manipulate the ui only.\n\t * Solution: rather than calling hide/show/toggle directly on the elements in the view- pass the elements through here.\n\t * It also handles bulk hiding (the validator will look at parents for the data-nx-ignore=\"validation\" attribute as well)\n\t * If validation is not turned on for whatever reason the element passed will be sent to where it would have gone\n\t * @param {element} input The jQuery element to hide\n\t * @param {boolean} bool Hide/show boolean\n\t */\n\ttoggleField(input, bool) {\n\t\tthis[bool === true ? 'showField' : 'hideField'](input);\n\t},\n\n\t/**\n\t * Helper for validating field\n\t * @method\n\t * @param {element|string} input Input element or `name`\n\t */\n\tvalidateField(input) {\n\t\t// validateField does not seem to do much in this case\n\t\t// but revalidateField gets us what we want\n\t\tthis.validator.enabled &&\n\t\t\tthis.Plugins.Invoke('validation', this.$form, 'revalidateField', [input]);\n\t},\n\n\t//\n\t// HELPERS\n\t// When some plugins just can't get the field to fire a correct change\n\t//\n\t/**\n\t * datepicker just doesn't seem to fire the change event formValidation needs properly\n\t * @method\n\t */\n\tdatepickerChanged(e) {\n\t\t// TODO: The plugin fires a change event when the date picker is first shown... cannot seems to find a clean way to get around it\n\t\t// aside from editing their code.\n\t\t// It is in the `update` method and at the very bottom...\n\t\tthis.validateField($(e.target));\n\t},\n\n\t/**\n\t * select2 multiple just doesn't seem to fire the change event formValidation needs properly\n\t * @method\n\t */\n\tselect2changed(e) {\n\t\tthis.validateField($(e.target));\n\t},\n\n\t// /**\n\t// * Before child views are attached, search for form elements that will need validation attached.\n\t// */\n\t// hook_preChildren: function(){\n\t// \tthis._forms = this.$('form[data-nx-validate-form]');\n\t// },\n};\n\nexport default function (target) {\n\tif (!target || target.hasFunctionality(NAME)) return target;\n\n\ttarget.extendFunctionality(Props);\n\ttarget.__isForm__ = true;\n\n\ttarget.addInitializer((instance, opts = {}) => {\n\t\tinstance.isForm = true;\n\t\tinstance.$el.addClass('form-view');\n\t\tinstance.events = {\n\t\t\tsubmit: 'submit',\n\t\t\t'click .nx-cancel:first': 'cancel',\n\t\t\t'click [data-nx-control=\"close\"]:first': 'cancel',\n\t\t\t'change .select2-hidden-accessible': 'select2changed',\n\t\t\t'change [data-provide=\"datepicker\"]': 'datepickerChanged',\n\t\t\tchange: 'inputChanged',\n\t\t\tinput: 'inputChanged',\n\t\t\t// Used to check if we need to lead the user to another invalid field\n\t\t\t'blur input, select, textarea': 'blurred',\n\t\t\t// Used to check if we need to lead the user to another invalid field\n\t\t\t'keydown input': 'keydown',\n\t\t\t'keyup textarea': 'inputChanged',\n\t\t\t'click select': 'inputChanged',\n\t\t\t'nx.fieldAdded :input': 'fieldAdded',\n\t\t\t'nx.fieldMutated :input': 'fieldMutated',\n\t\t\t'nx.fieldMutating :input': 'fieldMutating',\n\t\t\t'nx.fieldRemoved :input': 'fieldRemoved',\n\t\t\t...instance.events,\n\t\t};\n\n\t\t/** @override */\n\t\tinstance.setModel = _.wrap(instance.setModel, (setModel, model, opts) => {\n\t\t\t// flush our cache when our model changes\n\t\t\tinstance.flushCachedFormValues();\n\t\t\tinstance.formChanged = false;\n\n\t\t\treturn setModel.call(instance, model, opts);\n\t\t});\n\n\t\t/** @override */\n\t\tinstance.show = _.wrap(instance.show, (show) => {\n\t\t\tif (!instance.isShown && instance.resetOnShow) {\n\t\t\t\tinstance.reset();\n\t\t\t}\n\t\t\treturn show.call(instance);\n\t\t});\n\n\t\tif (!instance.unsavedChanges) {\n\t\t\tinstance.unsavedChanges = (unsavedChanges, noProxy) => {\n\t\t\t\t// First check us:\n\t\t\t\t// We are a `formView` AND\n\t\t\t\t// We have changed OR\n\t\t\t\t// We have a model and it is new\n\t\t\t\tif (\n\t\t\t\t\tinstance.formChanged ||\n\t\t\t\t\t(instance.model && instance.model.isNew())\n\t\t\t\t) {\n\t\t\t\t\treturn instance;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Alternately, this.eventStr is the prefix for both the submit & cancel events generated by the form.\n\t\t * For instance, if eventStr == 'module:foo',\n\t\t * form sumission will trigger 'module:foo:confirmed' on the dispatcher, and cancel will trigger 'module:foo:cancelled'.\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tinstance.eventStr = opts.eventStr || 'module:foo';\n\n\t\t/**\n\t\t * this.confirmMessage contains a confirmation string that pops up in a confirmView before submission.\n\t\t * If you don't want any confirmation pop-up, undefine this property.\n\t\t * @type {string}\n\t\t * @default\n\t\t */\n\t\tinstance.confirmMessage = opts.confirmMessage || false; //'Warning! This process cannot be undone. Please confirm you want to execute this job on these assets.'\n\n\t\t/**\n\t\t * Should we diable caching values at `preRender`?\n\t\t * @type {boolean}\n\t\t * @default\n\t\t */\n\t\tinstance.disableCache = opts.disableCache === true;\n\n\t\tinstance.hideOnSubmit = opts.hideOnSubmit === true;\n\n\t\tinstance.removeOnSubmit = opts.removeOnSubmit === true;\n\n\t\tinstance.revalidateFieldOnAdd = opts.revalidateFieldOnAdd === true;\n\n\t\t/**\n\t\t * resetOnShow determines whether this.reset() will be called when the form is\n\t\t * first shown. Reset will only be called when this.show() is called on a form that\n\t\t * is not yet visible.\n\t\t * @type {boolean}\n\t\t * @default\n\t\t */\n\t\tinstance.resetOnShow = opts.resetOnShow === true;\n\n\t\t/**\n\t\t * Signifies that not only must a form be valid to submit but a change must have been made as well\n\t\t * @type {boolean}\n\t\t */\n\t\tinstance.requiresChanges = opts.requiresChanges !== false;\n\n\t\t/**\n\t\t * Whether to reset form on submit\n\t\t * @type {boolean}\n\t\t */\n\t\tinstance.resetOnSubmit = opts.resetOnSubmit !== false;\n\n\t\t/**\n\t\t * Custum validation\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias validatorFields\n\t\t * @type {object}\n\t\t */\n\t\tinstance.validatorFields = opts.validatorFields || {};\n\n\t\t/**\n\t\t * Options for confirmViewModal when triggering a confirm on form submit\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias confirmViewOpts\n\t\t * @type {Object}\n\t\t */\n\t\tinstance.confirmViewOpts = opts.confirmViewOpts || {};\n\n\t\t/**\n\t\t * Error cache\n\t\t * Stores invalid fields when validation is turned on\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias errorCache\n\t\t * @type {Netx.Collection}\n\t\t */\n\t\tinstance.errorCache = new CoreCollection([]);\n\n\t\t/**\n\t\t * Error cache view\n\t\t * If your template has an element with [data-nx-control=\"validation-errors\"], then errors will be listed there automatically on a bad submit\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias errorCacheView\n\t\t * @type {Netx.Views.FormErrorListView}\n\t\t */\n\t\tinstance.errorCacheView = instance.addSubView(\n\t\t\tnew FormErrorListView({\n\t\t\t\tcollection: instance.errorCache,\n\t\t\t}),\n\t\t);\n\n\t\t/**\n\t\t * Form validator object\n\t\t * @memberOf Netx.Views.FormView\n\t\t * @alias validator\n\t\t * @type {object}\n\t\t */\n\t\tinstance.validator = _.extend(\n\t\t\t{\n\t\t\t\tenabled: false,\n\t\t\t\tplugin: null,\n\t\t\t\tfields: {},\n\t\t\t},\n\t\t\topts.validator,\n\t\t);\n\n\t\t/**\n\t\t * @property {object} Plugins - Plugins for this view\n\t\t * @property {object} Plugins.validation - Validation\n\t\t */\n\t\tinstance.Plugins.Register({\n\t\t\tvalidation: {\n\t\t\t\tname: 'formValidation',\n\t\t\t\toptions: {\n\t\t\t\t\tmessage: i18n.t('i18n.valueIsNotValid'),\n\t\t\t\t\texcluded: [\n\t\t\t\t\t\t':disabled',\n\t\t\t\t\t\t($field, validator) => {\n\t\t\t\t\t\t\treturn $field.nxIgnores('validation');\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tfields:\n\t\t\t\t\t\t_.isObject(instance.validator) &&\n\t\t\t\t\t\t_.isObject(instance.validator.fields)\n\t\t\t\t\t\t\t? instance.validator.fields\n\t\t\t\t\t\t\t: {},\n\t\t\t\t\tframework: 'bootstrap',\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\n\t\t// If form values were passed, set them at render\n\t\tif (opts.form) {\n\t\t\tinstance.rendered.then(() => {\n\t\t\t\tinstance.setForm(opts.form);\n\t\t\t});\n\t\t}\n\n\t\t// Hey, listen!\n\t\tinstance\n\t\t\t.on('preRenderHook', instance.prepareForm)\n\t\t\t.on('postRenderHook', () => {\n\t\t\t\tinstance.renderForm();\n\t\t\t\t// We do not want to setFormValidation before the view has ran all the code\n\t\t\t\t// in its `postRender`\n\t\t\t\t_.defer(() => {\n\t\t\t\t\t// Set form validation\n\t\t\t\t\tinstance.setFormValidation();\n\t\t\t\t});\n\t\t\t})\n\t\t\t.listenTo(dispatcher, `${instance.eventStr}:success`, instance.success)\n\t\t\t.listenTo(dispatcher, `${instance.eventStr}:error`, instance.failure)\n\t\t\t.listenTo(\n\t\t\t\tinstance,\n\t\t\t\t'validation:err.form.fv',\n\t\t\t\tinstance.formValidationFailure,\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tinstance,\n\t\t\t\t'validation:err.field.fv',\n\t\t\t\tinstance.fieldValidationFailure,\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tinstance,\n\t\t\t\t'validation:success.form.fv',\n\t\t\t\tinstance.formValidationSuccess,\n\t\t\t)\n\t\t\t.listenTo(\n\t\t\t\tinstance,\n\t\t\t\t'validation:success.field.fv',\n\t\t\t\tinstance.fieldValidationSuccess,\n\t\t\t);\n\n\t\t// HTML-948: if the formview has .dispatcherSubmitEvent set, trigger form submit when dispatcher triggers that event\n\t\tif (instance.dispatcherSubmitEvent) {\n\t\t\tinstance.listenTo(\n\t\t\t\tdispatcher,\n\t\t\t\tinstance.dispatcherSubmitEvent,\n\t\t\t\tinstance.submit,\n\t\t\t);\n\t\t}\n\t\tif (instance.viewCollection) {\n\t\t\t// Each `childView` could have its own set inputs - when they render we need to:\n\t\t\t// Cache queries\n\t\t\t// Check the form (enable/disable submit) if applicable\n\t\t\tinstance.listenTo(\n\t\t\t\tinstance.viewCollection,\n\t\t\t\t'view:rendered',\n\t\t\t\t_.debounce(() => {\n\t\t\t\t\tinstance.cacheQueries();\n\t\t\t\t\tinstance.checkForm();\n\t\t\t\t}, 50),\n\t\t\t);\n\t\t}\n\t}, NAME);\n\n\treturn target;\n}\n","import {setGlobal} from '@netx/core-next/utils/setGlobal';\n\nexport const Menus: any = {};\n\n// because... well, take a guess\nsetGlobal((Netx) => ({\n\t...Netx,\n\tMenus,\n}));\n\nexport const addMenus = (menus: any) => {\n\tObject.assign(Menus, menus);\n};\n\nexport default Menus;\n","/**\n * This is an attempt to abstract the complexities of our autocomplete plugins from netx.view\n * It became even more neccessary with the new version of select2 (which is very different but I think it is acutally a trully usable plugin finally)\n * The important thing is that now all autocomplete plugins can be self contained and our API can be agnostic\n * @class\n * @param {object} plugins Additonal plugin support\n * @todo Document the plugins object and what it has to return and why\n */\nimport Rpc from 'core-libs/backbone.rpc';\nimport {completions as autocompletions} from '@netx/core-app/properties/autocomplete';\n\n// Create and provide RPC with our api url\nvar rpc = new Rpc();\n\n/**\n * Makes the inquery to the server and returns results\n * It only cares about the plugin to get the return type method\n * @method\n * @private\n * @param {string} completion Completion type (category, asset, user, etc)\n * @param {string} q Search string\n * @param {object} extra Extra data to return with results\n * @param {object} opts Options to pass along (has the plugin name)\n * @param {Netx.View} view View that contains the autocomplete\n */\nexport const inquiry = function(completion, q, extra, opts, view) {\n\tvar d = new $.Deferred();\n\n\t//var plg = plugins[opts.plugin];\n\n\t// our completion\n\tvar c = autocompletions[completion];\n\tif (_.isFunction(c)) c = c(opts);\n\n\tlet sh = opts.stringHandler;\n\t// success handler\n\tswitch(c.return) {\n\t\tcase 'lvb':\n\t\t\tsh = opts.LVBHandler;\n\t\t\tbreak;\n\t\tcase 'inb':\n\t\t\tsh = opts.INBHandler;\n\t\t\tbreak;\n\t}\n\n\tif (!_.isFunction(sh)) {\n\t\tthrow new Error(\n\t\t\t'Handler not defined or is invalid for autocomplete: ' +\n\t\t\t\topts.plugin +\n\t\t\t\t' - \"' +\n\t\t\t\tcompletion +\n\t\t\t\t'\" : ' +\n\t\t\t\t(c.return == 'lvb' ? 'LVB' : 'String'),\n\t\t);\n\t}\n\n\t// It is always possible we got here with no query string\n\t// This kills the query\n\tif (q) {\n\t\t// Local data\n\t\tif (!_.isUndefined(c.data) && _.isUndefined(c.api)) {\n\t\t\t// convert the result into the right object with the handler sh(), then extend on any extra props in 'extra'\n\t\t\tq = q.toLowerCase();\n\t\t\tvar r = sh(\n\t\t\t\t_.filter(c.data, function(d) {\n\t\t\t\t\treturn d.label.toLowerCase().includes(q);\n\t\t\t\t}),\n\t\t\t);\n\t\t\t// Append any extra data to results\n\t\t\tif (!_.isUndefined(extra)) {\n\t\t\t\tr = _.map(r, function(d) {\n\t\t\t\t\treturn _.extend(d, extra);\n\t\t\t\t});\n\t\t\t}\n\t\t\t// Give the view a chance to filter\n\t\t\tif (view && _.isFunction(view.filterAutocompleteResults)) {\n\t\t\t\tr = view.filterAutocompleteResults(r, completion, q);\n\t\t\t}\n\t\t\treturn d.resolve(r);\n\t\t} else {\n\t\t\t// give rpc.query() an api endpoint name, some args, and a callback\n\t\t\trpc.query(\n\t\t\t\tc.api,\n\t\t\t\t_.map(c.args, function(a) {\n\t\t\t\t\treturn a == '_TERM_' ? q : a;\n\t\t\t\t}),\n\t\t\t\tfunction(reply) {\n\t\t\t\t\t// success handler\n\t\t\t\t\t// convert the result into the right object with the handler sh(), then extend on any extra props in 'extra'\n\t\t\t\t\tvar r = sh(reply);\n\t\t\t\t\t// Append any extra data to results\n\t\t\t\t\tif (!_.isUndefined(extra)) {\n\t\t\t\t\t\tr = _.map(r, function(d) {\n\t\t\t\t\t\t\treturn _.extend(d, extra);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t// Give the view a chance to filter\n\t\t\t\t\tif (view && _.isFunction(view.filterAutocompleteResults)) {\n\t\t\t\t\t\tr = view.filterAutocompleteResults(r, completion, q);\n\t\t\t\t\t}\n\t\t\t\t\treturn d.resolve(r);\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t} else {\n\t\td.resolve([]);\n\t}\n\treturn d.promise();\n};\n\nexport const getCompletion = function(opts) {\n\tswitch (opts.completion) {\n\t\tcase 'group':\n\t\t\treturn {\n\t\t\t\t...opts,\n\t\t\t\textra: {\n\t\t\t\t\ttype: 'group',\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'tag':\n\t\t\treturn {\n\t\t\t\t...opts,\n\t\t\t\tcompletion: 'tag',\n\t\t\t\ttags: true,\n\t\t\t};\n\t\tcase 'user':\n\t\tcase 'users':\n\t\t\treturn {\n\t\t\t\t...opts,\n\t\t\t\tcompletion: 'user',\n\t\t\t\textra: {\n\t\t\t\t\ttype: 'user',\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'user/group': // TODO: rename userOrGroup\n\t\tcase 'userOrGroup':\n\t\t\treturn {\n\t\t\t\t...opts,\n\t\t\t\tcompletion: 'userOrGroup',\n\t\t\t};\n\t}\n\n\treturn opts;\n};\n\n// detect data-autocomplete fields in this.el, and install automatically.\nexport const detectAutocomplete = function(el, type) {\n\tlet autos = [\n\t\t...el.querySelectorAll(\n\t\t\t'[data-autocomplete]:not([data-autocomplete-added])',\n\t\t),\n\t];\n\tif (\n\t\t!autos.length &&\n\t\tel.getAttribute('data-autocomplete') &&\n\t\t!el.getAttribute('data-autocomplete-added')\n\t) {\n\t\tautos = [el];\n\t}\n\n\treturn autos.filter(el => {\n\t\treturn type === el.getAttribute('data-autocomplete-plugin');\n\t});\n};\n","/**\n * The 'enableTest' field of an Action definitions may be set to one of these, or to an array of them for multiple tests.\n * @module core/enablers\n */\n\nimport {getViewCollection, getViewModel} from '@netx/core/lib/utils';\nimport {userSource as userSources} from '@netx/core-user/properties/user';\nimport {isMobile as checkIsMobile} from '@netx/core/lib/underscore-netx';\nimport {mediaServicesAvailable} from '@netx/core-share-media-service/enablers';\nimport {assetProjectEnabled} from '@netx/core-asset-project/enablers';\nimport {getPreference} from '@netx/core-user/utils/getPreference';\nimport {userProfile} from '@netx/core-user/collections/singletons/userProfile';\n\n/**\n * Clips cannot be emailed currently\n * @function\n * @returns {boolean}\n */\nexport const canEmail = (v) => {\n\tif (v.data && v.data.assetSet) {\n\t\treturn v.data.assetSet.get('canEmail') !== false;\n\t}\n\treturn true;\n};\n\n/**\n * Can user logout\n * @function\n * @return {boolean}\n */\nexport const canLogout = (v) => {\n\tconst userSource = userProfile.get('userSource');\n\t// If user source is INTERNAL or SAML\n\treturn userSource === userSources.INTERNAL || userSource === userSources.SAML;\n};\n\n// TODO: We should not reference Netx.[module] (other than user) for enable tests\n// DAM-11555 - currently used only for video publishing\n/**\n * @function\n * @returns {boolean}\n */\nexport const mediaServicesEnabled = (v) => {\n\tif (mediaServicesAvailable()) {\n\t\tvar mediaServices = Netx.share.mediaServices,\n\t\t\tbrightCove = mediaServices.find({name: 'Brightcove'}),\n\t\t\tyouTube = mediaServices.find({name: 'YouTube'});\n\n\t\treturn (\n\t\t\t(youTube && youTube.get('authenticated')) ||\n\t\t\t(brightCove && brightCove.get('authenticated'))\n\t\t);\n\t}\n\treturn false;\n};\n\n// collection has at least one model\n/**\n * @function\n * @returns {boolean}\n */\nexport const collectionNotEmpty = (v) => {\n\tconst collection = getViewCollection(v);\n\tif (!collection) return false;\n\n\t// Sometimes we update the pager before we get models in a collection\n\tconst pager = collection.pager;\n\tif (!pager) return collection.length > 0;\n\n\treturn pager.get('itemTotal') > 0;\n};\n\n/**\n * @function\n * @returns {boolean}\n */\nexport const canUseGridEditor = (v) => {\n\treturn true;\n};\n\n/**\n * @function\n * @returns {boolean}\n */\nexport const allowsDelete = (v) => {\n\tif (v.model && _.isFunction(v.model.allows)) {\n\t\treturn v.model.allows('delete');\n\t} else if (v.collection && _.isFunction(v.collection.allows)) {\n\t\treturn v.collectionl.allows('delete');\n\t}\n\treturn false;\n};\n\n// For the case when you want to move an asset out of/into a category,\n// for which you need modify permissions on both. We can't know whether\n// to expect an asset view or a category view here. We have a few different\n// patterns for inserting extra references, too, so here we perform an\n// exhaustive search.\n/**\n * @function\n * @returns {boolean}\n */\nexport const categoryAndAssetCanEdit = (view) => {\n\t// Best approach is if the view itself has both .asset and .category, being links to appropriate models.\n\tif (view.asset && view.category) {\n\t\treturn view.asset.allows('modify') && view.category.allows('modify');\n\t}\n\n\t// view.model could be either an asset model or a catgegory model, but either way this has to pass:\n\tif (!view.model || !view.model.allows || !view.model.allows('modify')) {\n\t\treturn false;\n\t}\n\n\tif (view.model.constructor.__name__ === 'Category') {\n\t\tif (view.asset) {\n\t\t\t// If a category view has an asset model as .asset, this will work.\n\t\t\treturn view.asset.allows('modify');\n\t\t} else {\n\t\t\t// NOTE: this view.model.get('asset') thing is kind of a hack, used to reference the original asset model in the asset:category:edit handler.\n\t\t\t// I'd rather we attached that directly to the view (as above), because its meaning can be misconstrued otherwise.\n\t\t\t// TODO: fix that up.\n\t\t\treturn (\n\t\t\t\tview.model.get('asset') && view.model.get('asset').allows('modify')\n\t\t\t);\n\t\t}\n\t}\n\n\tif (view.model.constructor.__name__ === 'Asset') {\n\t\t// if an asset view has a category model as .category, this will work.\n\t\tif (view.category) {\n\t\t\treturn view.category.allows('modify');\n\t\t} else {\n\t\t\t// if the current category just so happens to be our asset's \"main\" category, we're in luck and can test.\n\t\t\tview.model.get('categoryid') == Netx.category.current.id &&\n\t\t\t\tNetx.category.current.allows('modify');\n\t\t}\n\t}\n\n\t// Couldn't find a test, alas.\n\treturn false;\n};\n\n/**\n * Have we set `header.helpUrl`?\n * @function\n * @returns {boolean}\n */\nexport const helpUrl = (v) => {\n\treturn !_.isUndefined(getPreference('header.helpUrl'));\n};\n\n/**\n * @function\n * @returns {boolean}\n */\nexport const isMobile = () => {\n\treturn checkIsMobile(false);\n};\n\n/**\n * @function\n * @returns {boolean}\n */\nexport const notMobile = () => {\n\treturn !isMobile();\n};\n\n/**\n * @function\n * @returns {boolean}\n */\nexport const readOnly = (v) => {\n\tconst model = getViewModel(v);\n\treturn !model.allows('write');\n};\n\n/**\n * Asset review enabled\n * @function\n * @returns {boolean}\n */\nexport const reviewEnabled = (v) => {\n\t// DAM-14088\n\tif (checkIsMobile()) return false;\n\n\treturn assetProjectEnabled();\n};\n","/**\n * A Netx.Menu defines menus, composed of actions, for use with the data-action-context tag in our templates.\n * It is a more flexible & more centralized syntax than our previous system. Menus are also use to define\n * tabsets and other navigational structures.\n *\n * The 'actions' property of a Netx.Menu is an array that can contain either the names of actions\n * (defined in Netx.Actions) or arrays of same. The arrays are used to define sections in situations\n * where that is useful.\n *\n * The action entries match the \"event\" property of defined actions.\n *\n * This object is not parsed until the moment a menu is rendered. Nonexistent actions are ignored.\n * @class\n */\nimport Base from './netx-model';\nimport {FindLegacyAction} from '@netx/core/legacyActionManager';\n\nclass Menu extends Base {\n\t/** @type {object} */\n\tget defaults() {\n\t\treturn {\n\t\t\tlabel: '', // in some situations (such as submenus) a menu may need a label\n\t\t\tactions: [], // actions in the menu; see example below.\n\t\t};\n\t}\n\n\t/** @type {boolean} */\n\tget isMenu() {\n\t\treturn this.constructor.__isMenu__;\n\t}\n\n\t/*\n\t * return the names of all the actions in a menu, i.e. flatten the menu\n\t */\n\tflatten() {\n\t\treturn this.get('actions'); // TODO: flatten\n\t}\n\n\t/*\n\t * return a flat list of all the action objects (that exist) referenced by a menu\n\t */\n\ttoActions() {\n\t\tvar actions = [];\n\t\t_.each(this.flatten(), function (actionName) {\n\t\t\tif (actionName.isMenu) {\n\t\t\t\tactions = actions.concat(actionName.toActions());\n\t\t\t} else if (_.isArray(actionName)) {\n\t\t\t\t_.map(actionName, function (name) {\n\t\t\t\t\tvar action = FindLegacyAction(actionName);\n\t\t\t\t\taction && actions.push(action);\n\t\t\t\t});\n\t\t\t} else if (_.isString(actionName)) {\n\t\t\t\tvar action = FindLegacyAction(actionName);\n\t\t\t\taction && actions.push(action);\n\t\t\t} else {\n\t\t\t\tconsole.warn('undefined action ' + actionName);\n\t\t\t}\n\t\t});\n\t\treturn actions;\n\t}\n\n\t/** @type {boolean} */\n\tstatic get __isMenu__() {\n\t\treturn true;\n\t}\n\n\t/** @type {string} */\n\tstatic get __name__() {\n\t\treturn 'Menu';\n\t}\n}\n\nexport default Menu;\n","// created this file to address the fact that we need to tell moment\n// what locale to use\n// the prime place for this imo was the i18n initialization BUT moment\n// is not needed for logging in (atm) and it increases our pre-logged in bundle\n// enough\n// this file ensures that no matter when moment is called on that we have\n// set the locale\n\nimport {i18n, initialized} from '@netx/core/i18n';\nimport moment from 'moment';\n\ninitialized.then(() => {\n\t// We have to set this manually\n\t// https://momentjs.com/docs/#/i18n/changing-locale/\n\tmoment.locale(i18n.language);\n});\n\nexport {Moment, utc} from 'moment';\nexport {default} from 'moment';\n","import type {Action} from '@netx/core/bootstrap';\n/**\n * @param exports module.exports\n * @param actions Actions\n * @return Extended actions\n */\nexport const extendBackboneActions = (exports: Action[], actions: Action[]) => {\n\tactions.forEach((action) => {\n\t\tconst existing = exports.find((exp) => exp.event === action.event);\n\t\tif (!existing) return;\n\t\tObject.assign(existing, action);\n\t});\n\treturn exports;\n};\n\nexport default extendBackboneActions;\n","/**\n * Generate random text.\n * @param {number} length How much.\n * @param {string} [chars] A set of characters to compose random text from.\n */\nexport const randomChars = (length: number, chars: string) => {\n\tif (!chars) {\n\t\tchars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t}\n\tlet result = '';\n\tfor (let i = length; i > 0; --i) {\n\t\tresult += chars[Math.round(Math.random() * (chars.length - 1))];\n\t}\n\treturn result;\n};\n\nexport default randomChars;\n","//! moment.js locale configuration\n//! locale : German (Austria) [de-at]\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Martin Groller : https://github.com/MadMG\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n m: ['eine Minute', 'einer Minute'],\n h: ['eine Stunde', 'einer Stunde'],\n d: ['ein Tag', 'einem Tag'],\n dd: [number + ' Tage', number + ' Tagen'],\n w: ['eine Woche', 'einer Woche'],\n M: ['ein Monat', 'einem Monat'],\n MM: [number + ' Monate', number + ' Monaten'],\n y: ['ein Jahr', 'einem Jahr'],\n yy: [number + ' Jahre', number + ' Jahren'],\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n }\n\n var deAt = moment.defineLocale('de-at', {\n months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n '_'\n ),\n monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n '_'\n ),\n weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY HH:mm',\n LLLL: 'dddd, D. MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[heute um] LT [Uhr]',\n sameElse: 'L',\n nextDay: '[morgen um] LT [Uhr]',\n nextWeek: 'dddd [um] LT [Uhr]',\n lastDay: '[gestern um] LT [Uhr]',\n lastWeek: '[letzten] dddd [um] LT [Uhr]',\n },\n relativeTime: {\n future: 'in %s',\n past: 'vor %s',\n s: 'ein paar Sekunden',\n ss: '%d Sekunden',\n m: processRelativeTime,\n mm: '%d Minuten',\n h: processRelativeTime,\n hh: '%d Stunden',\n d: processRelativeTime,\n dd: processRelativeTime,\n w: processRelativeTime,\n ww: '%d Wochen',\n M: processRelativeTime,\n MM: processRelativeTime,\n y: processRelativeTime,\n yy: processRelativeTime,\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return deAt;\n\n})));\n","//! moment.js locale configuration\n//! locale : German (Switzerland) [de-ch]\n//! author : sschueller : https://github.com/sschueller\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n m: ['eine Minute', 'einer Minute'],\n h: ['eine Stunde', 'einer Stunde'],\n d: ['ein Tag', 'einem Tag'],\n dd: [number + ' Tage', number + ' Tagen'],\n w: ['eine Woche', 'einer Woche'],\n M: ['ein Monat', 'einem Monat'],\n MM: [number + ' Monate', number + ' Monaten'],\n y: ['ein Jahr', 'einem Jahr'],\n yy: [number + ' Jahre', number + ' Jahren'],\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n }\n\n var deCh = moment.defineLocale('de-ch', {\n months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n '_'\n ),\n monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n '_'\n ),\n weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY HH:mm',\n LLLL: 'dddd, D. MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[heute um] LT [Uhr]',\n sameElse: 'L',\n nextDay: '[morgen um] LT [Uhr]',\n nextWeek: 'dddd [um] LT [Uhr]',\n lastDay: '[gestern um] LT [Uhr]',\n lastWeek: '[letzten] dddd [um] LT [Uhr]',\n },\n relativeTime: {\n future: 'in %s',\n past: 'vor %s',\n s: 'ein paar Sekunden',\n ss: '%d Sekunden',\n m: processRelativeTime,\n mm: '%d Minuten',\n h: processRelativeTime,\n hh: '%d Stunden',\n d: processRelativeTime,\n dd: processRelativeTime,\n w: processRelativeTime,\n ww: '%d Wochen',\n M: processRelativeTime,\n MM: processRelativeTime,\n y: processRelativeTime,\n yy: processRelativeTime,\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return deCh;\n\n})));\n","//! moment.js locale configuration\n//! locale : German [de]\n//! author : lluchs : https://github.com/lluchs\n//! author: Menelion Elensúle: https://github.com/Oire\n//! author : Mikolaj Dadela : https://github.com/mik01aj\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n m: ['eine Minute', 'einer Minute'],\n h: ['eine Stunde', 'einer Stunde'],\n d: ['ein Tag', 'einem Tag'],\n dd: [number + ' Tage', number + ' Tagen'],\n w: ['eine Woche', 'einer Woche'],\n M: ['ein Monat', 'einem Monat'],\n MM: [number + ' Monate', number + ' Monaten'],\n y: ['ein Jahr', 'einem Jahr'],\n yy: [number + ' Jahre', number + ' Jahren'],\n };\n return withoutSuffix ? format[key][0] : format[key][1];\n }\n\n var de = moment.defineLocale('de', {\n months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(\n '_'\n ),\n monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(\n '_'\n ),\n weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),\n weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D. MMMM YYYY',\n LLL: 'D. MMMM YYYY HH:mm',\n LLLL: 'dddd, D. MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[heute um] LT [Uhr]',\n sameElse: 'L',\n nextDay: '[morgen um] LT [Uhr]',\n nextWeek: 'dddd [um] LT [Uhr]',\n lastDay: '[gestern um] LT [Uhr]',\n lastWeek: '[letzten] dddd [um] LT [Uhr]',\n },\n relativeTime: {\n future: 'in %s',\n past: 'vor %s',\n s: 'ein paar Sekunden',\n ss: '%d Sekunden',\n m: processRelativeTime,\n mm: '%d Minuten',\n h: processRelativeTime,\n hh: '%d Stunden',\n d: processRelativeTime,\n dd: processRelativeTime,\n w: processRelativeTime,\n ww: '%d Wochen',\n M: processRelativeTime,\n MM: processRelativeTime,\n y: processRelativeTime,\n yy: processRelativeTime,\n },\n dayOfMonthOrdinalParse: /\\d{1,2}\\./,\n ordinal: '%d.',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return de;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Australia) [en-au]\n//! author : Jared Morse : https://github.com/jarcoal\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enAu = moment.defineLocale('en-au', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY h:mm A',\n LLLL: 'dddd, D MMMM YYYY h:mm A',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return enAu;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Canada) [en-ca]\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enCa = moment.defineLocale('en-ca', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'YYYY-MM-DD',\n LL: 'MMMM D, YYYY',\n LLL: 'MMMM D, YYYY h:mm A',\n LLLL: 'dddd, MMMM D, YYYY h:mm A',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n });\n\n return enCa;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (United Kingdom) [en-gb]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enGb = moment.defineLocale('en-gb', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return enGb;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Ireland) [en-ie]\n//! author : Chris Cartlidge : https://github.com/chriscartlidge\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enIe = moment.defineLocale('en-ie', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return enIe;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Israel) [en-il]\n//! author : Chris Gedrim : https://github.com/chrisgedrim\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enIl = moment.defineLocale('en-il', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n });\n\n return enIl;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (India) [en-in]\n//! author : Jatin Agrawal : https://github.com/jatinag22\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enIn = moment.defineLocale('en-in', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY h:mm A',\n LLLL: 'dddd, D MMMM YYYY h:mm A',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 1st is the first week of the year.\n },\n });\n\n return enIn;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (New Zealand) [en-nz]\n//! author : Luke McGregor : https://github.com/lukemcgregor\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enNz = moment.defineLocale('en-nz', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY h:mm A',\n LLLL: 'dddd, D MMMM YYYY h:mm A',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return enNz;\n\n})));\n","//! moment.js locale configuration\n//! locale : English (Singapore) [en-sg]\n//! author : Matthew Castrillon-Madrigal : https://github.com/techdimension\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var enSg = moment.defineLocale('en-sg', {\n months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(\n '_'\n ),\n monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),\n weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(\n '_'\n ),\n weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),\n weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd, D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Today at] LT',\n nextDay: '[Tomorrow at] LT',\n nextWeek: 'dddd [at] LT',\n lastDay: '[Yesterday at] LT',\n lastWeek: '[Last] dddd [at] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'in %s',\n past: '%s ago',\n s: 'a few seconds',\n ss: '%d seconds',\n m: 'a minute',\n mm: '%d minutes',\n h: 'an hour',\n hh: '%d hours',\n d: 'a day',\n dd: '%d days',\n M: 'a month',\n MM: '%d months',\n y: 'a year',\n yy: '%d years',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(st|nd|rd|th)/,\n ordinal: function (number) {\n var b = number % 10,\n output =\n ~~((number % 100) / 10) === 1\n ? 'th'\n : b === 1\n ? 'st'\n : b === 2\n ? 'nd'\n : b === 3\n ? 'rd'\n : 'th';\n return number + output;\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return enSg;\n\n})));\n","//! moment.js locale configuration\n//! locale : Spanish (Dominican Republic) [es-do]\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n '_'\n ),\n monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n monthsParse = [\n /^ene/i,\n /^feb/i,\n /^mar/i,\n /^abr/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^ago/i,\n /^sep/i,\n /^oct/i,\n /^nov/i,\n /^dic/i,\n ],\n monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n var esDo = moment.defineLocale('es-do', {\n months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n '_'\n ),\n monthsShort: function (m, format) {\n if (!m) {\n return monthsShortDot;\n } else if (/-MMM-/.test(format)) {\n return monthsShort[m.month()];\n } else {\n return monthsShortDot[m.month()];\n }\n },\n monthsRegex: monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n monthsShortStrictRegex: /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n monthsParse: monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY h:mm A',\n LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',\n },\n calendar: {\n sameDay: function () {\n return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n nextDay: function () {\n return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n nextWeek: function () {\n return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n lastDay: function () {\n return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n lastWeek: function () {\n return (\n '[el] dddd [pasado a la' +\n (this.hours() !== 1 ? 's' : '') +\n '] LT'\n );\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'en %s',\n past: 'hace %s',\n s: 'unos segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'una hora',\n hh: '%d horas',\n d: 'un día',\n dd: '%d días',\n M: 'un mes',\n MM: '%d meses',\n y: 'un año',\n yy: '%d años',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return esDo;\n\n})));\n","//! moment.js locale configuration\n//! locale : Spanish (United States) [es-us]\n//! author : bustta : https://github.com/bustta\n//! author : chrisrodz : https://github.com/chrisrodz\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n '_'\n ),\n monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n monthsParse = [\n /^ene/i,\n /^feb/i,\n /^mar/i,\n /^abr/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^ago/i,\n /^sep/i,\n /^oct/i,\n /^nov/i,\n /^dic/i,\n ],\n monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n var esUs = moment.defineLocale('es-us', {\n months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n '_'\n ),\n monthsShort: function (m, format) {\n if (!m) {\n return monthsShortDot;\n } else if (/-MMM-/.test(format)) {\n return monthsShort[m.month()];\n } else {\n return monthsShortDot[m.month()];\n }\n },\n monthsRegex: monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n monthsShortStrictRegex: /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n monthsParse: monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'h:mm A',\n LTS: 'h:mm:ss A',\n L: 'MM/DD/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY h:mm A',\n LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',\n },\n calendar: {\n sameDay: function () {\n return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n nextDay: function () {\n return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n nextWeek: function () {\n return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n lastDay: function () {\n return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n lastWeek: function () {\n return (\n '[el] dddd [pasado a la' +\n (this.hours() !== 1 ? 's' : '') +\n '] LT'\n );\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'en %s',\n past: 'hace %s',\n s: 'unos segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'una hora',\n hh: '%d horas',\n d: 'un día',\n dd: '%d días',\n M: 'un mes',\n MM: '%d meses',\n y: 'un año',\n yy: '%d años',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 0, // Sunday is the first day of the week.\n doy: 6, // The week that contains Jan 6th is the first week of the year.\n },\n });\n\n return esUs;\n\n})));\n","//! moment.js locale configuration\n//! locale : Spanish [es]\n//! author : Julio Napurí : https://github.com/julionc\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(\n '_'\n ),\n monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),\n monthsParse = [\n /^ene/i,\n /^feb/i,\n /^mar/i,\n /^abr/i,\n /^may/i,\n /^jun/i,\n /^jul/i,\n /^ago/i,\n /^sep/i,\n /^oct/i,\n /^nov/i,\n /^dic/i,\n ],\n monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i;\n\n var es = moment.defineLocale('es', {\n months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(\n '_'\n ),\n monthsShort: function (m, format) {\n if (!m) {\n return monthsShortDot;\n } else if (/-MMM-/.test(format)) {\n return monthsShort[m.month()];\n } else {\n return monthsShortDot[m.month()];\n }\n },\n monthsRegex: monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,\n monthsShortStrictRegex: /^(ene\\.?|feb\\.?|mar\\.?|abr\\.?|may\\.?|jun\\.?|jul\\.?|ago\\.?|sep\\.?|oct\\.?|nov\\.?|dic\\.?)/i,\n monthsParse: monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),\n weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),\n weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'H:mm',\n LTS: 'H:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D [de] MMMM [de] YYYY',\n LLL: 'D [de] MMMM [de] YYYY H:mm',\n LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',\n },\n calendar: {\n sameDay: function () {\n return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n nextDay: function () {\n return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n nextWeek: function () {\n return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n lastDay: function () {\n return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';\n },\n lastWeek: function () {\n return (\n '[el] dddd [pasado a la' +\n (this.hours() !== 1 ? 's' : '') +\n '] LT'\n );\n },\n sameElse: 'L',\n },\n relativeTime: {\n future: 'en %s',\n past: 'hace %s',\n s: 'unos segundos',\n ss: '%d segundos',\n m: 'un minuto',\n mm: '%d minutos',\n h: 'una hora',\n hh: '%d horas',\n d: 'un día',\n dd: '%d días',\n M: 'un mes',\n MM: '%d meses',\n y: 'un año',\n yy: '%d años',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}º/,\n ordinal: '%dº',\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n invalidDate: 'Fecha invalida',\n });\n\n return es;\n\n})));\n","//! moment.js locale configuration\n//! locale : French (Canada) [fr-ca]\n//! author : Jonathan Abourbih : https://github.com/jonbca\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var frCa = moment.defineLocale('fr-ca', {\n months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n '_'\n ),\n monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'YYYY-MM-DD',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Aujourd’hui à] LT',\n nextDay: '[Demain à] LT',\n nextWeek: 'dddd [à] LT',\n lastDay: '[Hier à] LT',\n lastWeek: 'dddd [dernier à] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'dans %s',\n past: 'il y a %s',\n s: 'quelques secondes',\n ss: '%d secondes',\n m: 'une minute',\n mm: '%d minutes',\n h: 'une heure',\n hh: '%d heures',\n d: 'un jour',\n dd: '%d jours',\n M: 'un mois',\n MM: '%d mois',\n y: 'un an',\n yy: '%d ans',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(er|e)/,\n ordinal: function (number, period) {\n switch (period) {\n // Words with masculine grammatical gender: mois, trimestre, jour\n default:\n case 'M':\n case 'Q':\n case 'D':\n case 'DDD':\n case 'd':\n return number + (number === 1 ? 'er' : 'e');\n\n // Words with feminine grammatical gender: semaine\n case 'w':\n case 'W':\n return number + (number === 1 ? 're' : 'e');\n }\n },\n });\n\n return frCa;\n\n})));\n","//! moment.js locale configuration\n//! locale : French (Switzerland) [fr-ch]\n//! author : Gaspard Bucher : https://github.com/gaspard\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var frCh = moment.defineLocale('fr-ch', {\n months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n '_'\n ),\n monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD.MM.YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Aujourd’hui à] LT',\n nextDay: '[Demain à] LT',\n nextWeek: 'dddd [à] LT',\n lastDay: '[Hier à] LT',\n lastWeek: 'dddd [dernier à] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'dans %s',\n past: 'il y a %s',\n s: 'quelques secondes',\n ss: '%d secondes',\n m: 'une minute',\n mm: '%d minutes',\n h: 'une heure',\n hh: '%d heures',\n d: 'un jour',\n dd: '%d jours',\n M: 'un mois',\n MM: '%d mois',\n y: 'un an',\n yy: '%d ans',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(er|e)/,\n ordinal: function (number, period) {\n switch (period) {\n // Words with masculine grammatical gender: mois, trimestre, jour\n default:\n case 'M':\n case 'Q':\n case 'D':\n case 'DDD':\n case 'd':\n return number + (number === 1 ? 'er' : 'e');\n\n // Words with feminine grammatical gender: semaine\n case 'w':\n case 'W':\n return number + (number === 1 ? 're' : 'e');\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return frCh;\n\n})));\n","//! moment.js locale configuration\n//! locale : French [fr]\n//! author : John Fischer : https://github.com/jfroffice\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n monthsShortStrictRegex = /(janv\\.?|févr\\.?|mars|avr\\.?|mai|juin|juil\\.?|août|sept\\.?|oct\\.?|nov\\.?|déc\\.?)/i,\n monthsRegex = /(janv\\.?|févr\\.?|mars|avr\\.?|mai|juin|juil\\.?|août|sept\\.?|oct\\.?|nov\\.?|déc\\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,\n monthsParse = [\n /^janv/i,\n /^févr/i,\n /^mars/i,\n /^avr/i,\n /^mai/i,\n /^juin/i,\n /^juil/i,\n /^août/i,\n /^sept/i,\n /^oct/i,\n /^nov/i,\n /^déc/i,\n ];\n\n var fr = moment.defineLocale('fr', {\n months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(\n '_'\n ),\n monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(\n '_'\n ),\n monthsRegex: monthsRegex,\n monthsShortRegex: monthsRegex,\n monthsStrictRegex: monthsStrictRegex,\n monthsShortStrictRegex: monthsShortStrictRegex,\n monthsParse: monthsParse,\n longMonthsParse: monthsParse,\n shortMonthsParse: monthsParse,\n weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),\n weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),\n weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'DD/MM/YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY HH:mm',\n LLLL: 'dddd D MMMM YYYY HH:mm',\n },\n calendar: {\n sameDay: '[Aujourd’hui à] LT',\n nextDay: '[Demain à] LT',\n nextWeek: 'dddd [à] LT',\n lastDay: '[Hier à] LT',\n lastWeek: 'dddd [dernier à] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: 'dans %s',\n past: 'il y a %s',\n s: 'quelques secondes',\n ss: '%d secondes',\n m: 'une minute',\n mm: '%d minutes',\n h: 'une heure',\n hh: '%d heures',\n d: 'un jour',\n dd: '%d jours',\n M: 'un mois',\n MM: '%d mois',\n y: 'un an',\n yy: '%d ans',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(er|)/,\n ordinal: function (number, period) {\n switch (period) {\n // TODO: Return 'e' when day of month > 1. Move this case inside\n // block for masculine words below.\n // See https://github.com/moment/moment/issues/3375\n case 'D':\n return number + (number === 1 ? 'er' : '');\n\n // Words with masculine grammatical gender: mois, trimestre, jour\n default:\n case 'M':\n case 'Q':\n case 'DDD':\n case 'd':\n return number + (number === 1 ? 'er' : 'e');\n\n // Words with feminine grammatical gender: semaine\n case 'w':\n case 'W':\n return number + (number === 1 ? 're' : 'e');\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n });\n\n return fr;\n\n})));\n","//! moment.js locale configuration\n//! locale : Konkani Devanagari script [gom-deva]\n//! author : The Discoverer : https://github.com/WikiDiscoverer\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n function processRelativeTime(number, withoutSuffix, key, isFuture) {\n var format = {\n s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'],\n ss: [number + ' सॅकंडांनी', number + ' सॅकंड'],\n m: ['एका मिणटान', 'एक मिनूट'],\n mm: [number + ' मिणटांनी', number + ' मिणटां'],\n h: ['एका वरान', 'एक वर'],\n hh: [number + ' वरांनी', number + ' वरां'],\n d: ['एका दिसान', 'एक दीस'],\n dd: [number + ' दिसांनी', number + ' दीस'],\n M: ['एका म्हयन्यान', 'एक म्हयनो'],\n MM: [number + ' म्हयन्यानी', number + ' म्हयने'],\n y: ['एका वर्सान', 'एक वर्स'],\n yy: [number + ' वर्सांनी', number + ' वर्सां'],\n };\n return isFuture ? format[key][0] : format[key][1];\n }\n\n var gomDeva = moment.defineLocale('gom-deva', {\n months: {\n standalone: 'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(\n '_'\n ),\n format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split(\n '_'\n ),\n isFormat: /MMMM(\\s)+D[oD]?/,\n },\n monthsShort: 'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(\n '_'\n ),\n monthsParseExact: true,\n weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'),\n weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'),\n weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'),\n weekdaysParseExact: true,\n longDateFormat: {\n LT: 'A h:mm [वाजतां]',\n LTS: 'A h:mm:ss [वाजतां]',\n L: 'DD-MM-YYYY',\n LL: 'D MMMM YYYY',\n LLL: 'D MMMM YYYY A h:mm [वाजतां]',\n LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]',\n llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]',\n },\n calendar: {\n sameDay: '[आयज] LT',\n nextDay: '[फाल्यां] LT',\n nextWeek: '[फुडलो] dddd[,] LT',\n lastDay: '[काल] LT',\n lastWeek: '[फाटलो] dddd[,] LT',\n sameElse: 'L',\n },\n relativeTime: {\n future: '%s',\n past: '%s आदीं',\n s: processRelativeTime,\n ss: processRelativeTime,\n m: processRelativeTime,\n mm: processRelativeTime,\n h: processRelativeTime,\n hh: processRelativeTime,\n d: processRelativeTime,\n dd: processRelativeTime,\n M: processRelativeTime,\n MM: processRelativeTime,\n y: processRelativeTime,\n yy: processRelativeTime,\n },\n dayOfMonthOrdinalParse: /\\d{1,2}(वेर)/,\n ordinal: function (number, period) {\n switch (period) {\n // the ordinal 'वेर' only applies to day of the month\n case 'D':\n return number + 'वेर';\n default:\n case 'M':\n case 'Q':\n case 'DDD':\n case 'd':\n case 'w':\n case 'W':\n return number;\n }\n },\n week: {\n dow: 1, // Monday is the first day of the week.\n doy: 4, // The week that contains Jan 4th is the first week of the year.\n },\n meridiemParse: /राती|सकाळीं|दनपारां|सांजे/,\n meridiemHour: function (hour, meridiem) {\n if (hour === 12) {\n hour = 0;\n }\n if (meridiem === 'राती') {\n return hour < 4 ? hour : hour + 12;\n } else if (meridiem === 'सकाळीं') {\n return hour;\n } else if (meridiem === 'दनपारां') {\n return hour > 12 ? hour : hour + 12;\n } else if (meridiem === 'सांजे') {\n return hour + 12;\n }\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 4) {\n return 'राती';\n } else if (hour < 12) {\n return 'सकाळीं';\n } else if (hour < 16) {\n return 'दनपारां';\n } else if (hour < 20) {\n return 'सांजे';\n } else {\n return 'राती';\n }\n },\n });\n\n return gomDeva;\n\n})));\n","//! moment.js locale configuration\n//! locale : Japanese [ja]\n//! author : LI Long : https://github.com/baryon\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n && typeof require === 'function' ? factory(require('../moment')) :\n typeof define === 'function' && define.amd ? define(['../moment'], factory) :\n factory(global.moment)\n}(this, (function (moment) { 'use strict';\n\n //! moment.js locale configuration\n\n var ja = moment.defineLocale('ja', {\n eras: [\n {\n since: '2019-05-01',\n offset: 1,\n name: '令和',\n narrow: '㋿',\n abbr: 'R',\n },\n {\n since: '1989-01-08',\n until: '2019-04-30',\n offset: 1,\n name: '平成',\n narrow: '㍻',\n abbr: 'H',\n },\n {\n since: '1926-12-25',\n until: '1989-01-07',\n offset: 1,\n name: '昭和',\n narrow: '㍼',\n abbr: 'S',\n },\n {\n since: '1912-07-30',\n until: '1926-12-24',\n offset: 1,\n name: '大正',\n narrow: '㍽',\n abbr: 'T',\n },\n {\n since: '1873-01-01',\n until: '1912-07-29',\n offset: 6,\n name: '明治',\n narrow: '㍾',\n abbr: 'M',\n },\n {\n since: '0001-01-01',\n until: '1873-12-31',\n offset: 1,\n name: '西暦',\n narrow: 'AD',\n abbr: 'AD',\n },\n {\n since: '0000-12-31',\n until: -Infinity,\n offset: 1,\n name: '紀元前',\n narrow: 'BC',\n abbr: 'BC',\n },\n ],\n eraYearOrdinalRegex: /(元|\\d+)年/,\n eraYearOrdinalParse: function (input, match) {\n return match[1] === '元' ? 1 : parseInt(match[1] || input, 10);\n },\n months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),\n monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(\n '_'\n ),\n weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),\n weekdaysShort: '日_月_火_水_木_金_土'.split('_'),\n weekdaysMin: '日_月_火_水_木_金_土'.split('_'),\n longDateFormat: {\n LT: 'HH:mm',\n LTS: 'HH:mm:ss',\n L: 'YYYY/MM/DD',\n LL: 'YYYY年M月D日',\n LLL: 'YYYY年M月D日 HH:mm',\n LLLL: 'YYYY年M月D日 dddd HH:mm',\n l: 'YYYY/MM/DD',\n ll: 'YYYY年M月D日',\n lll: 'YYYY年M月D日 HH:mm',\n llll: 'YYYY年M月D日(ddd) HH:mm',\n },\n meridiemParse: /午前|午後/i,\n isPM: function (input) {\n return input === '午後';\n },\n meridiem: function (hour, minute, isLower) {\n if (hour < 12) {\n return '午前';\n } else {\n return '午後';\n }\n },\n calendar: {\n sameDay: '[今日] LT',\n nextDay: '[明日] LT',\n nextWeek: function (now) {\n if (now.week() !== this.week()) {\n return '[来週]dddd LT';\n } else {\n return 'dddd LT';\n }\n },\n lastDay: '[昨日] LT',\n lastWeek: function (now) {\n if (this.week() !== now.week()) {\n return '[先週]dddd LT';\n } else {\n return 'dddd LT';\n }\n },\n sameElse: 'L',\n },\n dayOfMonthOrdinalParse: /\\d{1,2}日/,\n ordinal: function (number, period) {\n switch (period) {\n case 'y':\n return number === 1 ? '元年' : number + '年';\n case 'd':\n case 'D':\n case 'DDD':\n return number + '日';\n default:\n return number;\n }\n },\n relativeTime: {\n future: '%s後',\n past: '%s前',\n s: '数秒',\n ss: '%d秒',\n m: '1分',\n mm: '%d分',\n h: '1時間',\n hh: '%d時間',\n d: '1日',\n dd: '%d日',\n M: '1ヶ月',\n MM: '%dヶ月',\n y: '1年',\n yy: '%d年',\n },\n });\n\n return ja;\n\n})));\n","var map = {\n\t\"./de\": 59740,\n\t\"./de-at\": 60217,\n\t\"./de-at.js\": 60217,\n\t\"./de-ch\": 60894,\n\t\"./de-ch.js\": 60894,\n\t\"./de.js\": 59740,\n\t\"./en-au\": 78348,\n\t\"./en-au.js\": 78348,\n\t\"./en-ca\": 77925,\n\t\"./en-ca.js\": 77925,\n\t\"./en-gb\": 22243,\n\t\"./en-gb.js\": 22243,\n\t\"./en-ie\": 46436,\n\t\"./en-ie.js\": 46436,\n\t\"./en-il\": 47207,\n\t\"./en-il.js\": 47207,\n\t\"./en-in\": 44175,\n\t\"./en-in.js\": 44175,\n\t\"./en-nz\": 76319,\n\t\"./en-nz.js\": 76319,\n\t\"./en-sg\": 31662,\n\t\"./en-sg.js\": 31662,\n\t\"./es\": 55655,\n\t\"./es-do\": 55251,\n\t\"./es-do.js\": 55251,\n\t\"./es-us\": 71146,\n\t\"./es-us.js\": 71146,\n\t\"./es.js\": 55655,\n\t\"./fr\": 94470,\n\t\"./fr-ca\": 63049,\n\t\"./fr-ca.js\": 63049,\n\t\"./fr-ch\": 52330,\n\t\"./fr-ch.js\": 52330,\n\t\"./fr.js\": 94470,\n\t\"./gom-deva\": 27884,\n\t\"./gom-deva.js\": 27884,\n\t\"./ja\": 39183,\n\t\"./ja.js\": 39183\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 30931;","'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/advancedMenuItemView.html -->\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/advancedMenuView.html -->\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/alertView.html -->\\n<article class=\"content content--modal\">\\n\t<p>'+\n((__t=( msg ))==null?'':__t)+\n'</p>\\n</article>\\n<footer class=\"footer footer--modal\">\\n\t<div class=\"footer-actions footer-actions--right\">\\n\t\t<button type=\"submit\" class=\"mdc-button mdc-button--unelevated nx-save\" data-nx-control=\"dismiss\" data-i18n=\"i18n.ok\">i18n.ok</button>\\n\t</div>\\n</footer>\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/appBodyView.html -->\\n\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/appFullScreenView.html -->\\n<div class=\"container\">\\n\t<div id=\"fs-view-loader\" data-nx-control=\"loader\"></div>\\n\t<div data-nx-control=\"full-screen-content\"></div>\\n</div>\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/appModalCrumbView.html -->\\n<span class=\"mdc-tab__content\">\\n\t<h5 class=\"mdc-typography--headline5 header__title mdc-tab__text-label nx-title\">'+\n((__t=( label ))==null?'':__t)+\n'</h5>\\n</span>\\n<span class=\"mdc-tab-indicator '+\n((__t=( active || !index ? 'mdc-tab-indicator--active' : '' ))==null?'':__t)+\n'\">\\n\t<span class=\"mdc-tab-indicator__content mdc-tab-indicator__content--underline\"></span>\\n</span>\\n<span class=\"mdc-tab__ripple\"></span>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/appModalCrumbsView.html -->\\n<div class=\"mdc-tab-bar\" role=\"tablist\">\\n\t<div class=\"mdc-tab-scroller\">\\n\t\t<div class=\"mdc-tab-scroller__scroll-area\">\\n\t\t\t<div class=\"mdc-tab-scroller__scroll-content nx-childviews\"></div>\\n\t\t</div>\\n\t</div>\\n</div>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/appModalView.html -->\\n<div class=\"modal-dialog modal-md\">\\n\t<div class=\"modal-content\">\\n\t\t<div class=\"modal-header\">\\n\t\t\t<div data-nx-control=\"crumbs\"></div>\\n\t\t\t<div class=\"actions\">\\n\t\t\t\t<button class=\"mdc-icon-button close\" data-nx-control=\"close\">\\n\t\t\t\t\t<span class=\"mdc-icon-button__icon\">'+\n((__t=( icons.faTimes ))==null?'':__t)+\n'</span>\\n\t\t\t\t</button>\\n\t\t\t</div>\\n\t\t</div>\\n\t\t<div class=\"modal-body\">\\n\t\t\t<div data-nx-control=\"modal-content\"></div>\\n\t\t</div>\\n\t</div>\\n</div>\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/appProgressView.html -->\\n<article class=\"content content--modal\">\\n\t<p class=\"mdc-typography--body1\">'+\n((__t=( message ))==null?'':_.escape(__t))+\n'</p>\\n\t<div role=\"progressbar\" class=\"progress mdc-linear-progress '+\n((__t=( indeterminate ? 'mdc-linear-progress--indeterminate' : '' ))==null?'':_.escape(__t))+\n'\">\\n\t\t<div class=\"mdc-linear-progress__buffering-dots\"></div>\\n\t\t<div class=\"mdc-linear-progress__buffer\"></div>\\n\t\t<div class=\"mdc-linear-progress__bar mdc-linear-progress__primary-bar\">\\n\t\t\t<span class=\"mdc-linear-progress__bar-inner\"></span>\\n\t\t</div>\\n\t\t<div class=\"mdc-linear-progress__bar mdc-linear-progress__secondary-bar\">\\n\t\t\t<span class=\"mdc-linear-progress__bar-inner\"></span>\\n\t\t</div>\\n\t</div>\\n</article>\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/confirmView.html -->\\n<article class=\"content content--modal scrollable '+\n((__t=( classes ))==null?'':_.escape(__t))+\n'\">\\n\t<p class=\"mdc-typography--body1\">'+\n((__t=( message.format(itemLabel) ))==null?'':__t)+\n'</hp>\\n</article>\\n\\n<footer class=\"footer footer--modal\">\\n\t<div class=\"footer-actions\">\\n\t\t';\n if (noLabel) { \n__p+='\\n\t\t<button type=\"button\" class=\"mdc-button cancel nx-cancel\" data-nx-control=\"no\">'+\n((__t=( noLabel ))==null?'':_.escape(__t))+\n'</button>\\n\t\t';\n } \n__p+='\\n\t</div>\\n\t<div class=\"footer-actions footer-actions--right\">\\n\t\t';\n if (yesLabel) { \n__p+='\\n\t\t<button type=\"submit\" class=\"mdc-button mdc-button--unelevated submit nx-save\" data-nx-control=\"yes\">'+\n((__t=( yesLabel ))==null?'':_.escape(__t))+\n'</button>\\n\t\t';\n } \n__p+='\\n\t</div>\\n</footer>\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/empty.html -->\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/formErrorListItemView.html -->\\n'+\n((__t=( name ))==null?'':__t)+\n'';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/formErrorListView.html -->\\n<div class=\"container\">\\n\t<header>\\n\t\t<h2 class=\"title\"><span class=\"text\">Please fill out all mandatory attributes</span></h2>\\n\t</header>\\n\t<div class=\"nx-childviews\"></div>\\n</div>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-actionIconsInline.html -->\\n<ul class=\"nav nav-icons\" role=\"menu\">\\n\t<li role=\"presentation\" class=\"nx-action\" data-action=\"{{action}}\"><a href=\"{{route}}\" class=\"action\" aria-controls=\"{{label}}\" role=\"tab\" data-toggle=\"tab\">{{icon}}</a></li>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-assetDetailActions.html -->\\n<ul role=\"menu\">\\n\t<li class=\"nx-action mdc-icon-button\" data-action=\"{{action}}\" data-target=\"{{target}}\">\\n\t\t<a href=\"{{route}}\"><span class=\"mdc-icon-button__icon\">{{icon}}</span></a>\\n\t\t<ul role=\"menu\" class=\"mdc-list sub-menu mdc-menu--dropup mdc-menu--right\" aria-hidden=\"true\" aria-orientation=\"vertical\">\\n\t\t\t<a href=\"{{route}}\" class=\"mdc-list-item mdc-ripple-surface mdc-ripple-surface--primary nx-action\" data-action=\"{{action}}\" tabindex=\"-1\">\\n\t\t\t\t<span class=\"mdc-list-item__graphic\" aria-hidden=\"true\">{{icon}}</span>\\n\t\t\t\t<span class=\"mdc-list-item__text\">{{label}}</span>\\n\t\t\t</a>\\n\t\t</ul>\\n\t</li>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-attributeColumnsContextMenu.html -->\\n<div class=\"dropdown-toggle\" data-toggle=\"dropdown\"></div>\\n<div class=\"dropdown-menu\" data-nx-drilldown>\\n\t<ul class=\"advanced-menu-items\" role=\"menu\"></ul>\\n</div>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-attributeColumnsContextMenuItem.html -->\\n<a data-action=\"asset:tagPanel:grid:toggle:column\" class=\"nx-action '+\n((__t=( _.indexOf( Netx.asset.tagPanelGrid.columns, name ) > -1 ? 'active' : '' ))==null?'':_.escape(__t))+\n'\">'+\n((__t=( name ))==null?'':__t)+\n'</a>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-cartBarActions.html -->\\n<ul role=\"menu\">\\n\t<li class=\"nx-action\" data-action=\"{{action}}\" data-target=\"{{target}}\">\\n\t\t<a class=\"action mdc-button mdc-button--unelevated\" href=\"{{route}}\">\\n\t\t\t<span class=\"mdc-button__icon\">{{icon}}</span>\\n\t\t\t<span class=\"text\">{{label}}</span>\\n\t\t</a>\\n\t\t<ul role=\"menu\" class=\"mdc-list sub-menu mdc-menu--dropup mdc-menu--right\" aria-hidden=\"true\" aria-orientation=\"vertical\">\\n\t\t\t<a href=\"{{route}}\" class=\"mdc-list-item mdc-ripple-surface mdc-ripple-surface--primary nx-action\" data-action=\"{{action}}\" tabindex=\"-1\">\\n\t\t\t\t<span class=\"mdc-list-item__graphic\" aria-hidden=\"true\">{{icon}}</span>\\n\t\t\t\t<span class=\"mdc-list-item__text\">{{label}}</span>\\n\t\t\t</a>\\n\t\t</ul>\\n\t</li>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-context.html -->\\n<ul class=\"mdc-list dropdown-menu\" role=\"menu\" aria-hidden=\"true\" aria-orientation=\"vertical\">\\n\t<a href=\"{{route}}\" class=\"mdc-list-item mdc-ripple-surface mdc-ripple-surface--primary nx-action\" data-action=\"{{action}}\" tabindex=\"-1\">\\n\t\t<span class=\"mdc-list-item__graphic\" aria-hidden=\"true\">{{icon}}</span>\\n\t\t<span class=\"mdc-list-item__text\">{{label}}</span>\\n\t</a>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-headerActions.html -->\\n<ul class=\"mdc-list dropdown-menu\" role=\"menu\" aria-hidden=\"true\" aria-orientation=\"vertical\">\\n\t<a href=\"{{route}}\" class=\"mdc-list-item mdc-ripple-surface mdc-ripple-surface--primary nx-action\" data-action=\"{{action}}\" tabindex=\"-1\">\\n\t\t<span class=\"mdc-list-item__graphic\" aria-hidden=\"true\">{{icon}}</span>\\n\t\t<span class=\"mdc-list-item__text\">{{label}}</span>\\n\t</a>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-listHeaderActions.html -->\\n<ul class=\"actions\" role=\"menu\">\\n\t<li class=\"nx-action\" data-action=\"{{action}}\" data-target=\"{{target}}\">\\n\t\t<a class=\"action\" href=\"{{route}}\">{{icon}}</a>\\n\t\t<ul role=\"menu\" class=\"mdc-list sub-menu\" aria-hidden=\"true\" aria-orientation=\"vertical\">\\n\t\t\t<a href=\"{{route}}\" class=\"mdc-list-item mdc-ripple-surface mdc-ripple-surface--primary nx-action\" data-action=\"{{action}}\" tabindex=\"-1\">\\n\t\t\t\t<span class=\"mdc-list-item__graphic\">{{icon}}</span>\\n\t\t\t\t<span class=\"mdc-list-item__text\">{{label}}</span>\\n\t\t\t</a>\\n\t\t</ul>\\n\t</li>\\n</ul>\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-navTabs.html -->\\n<ul class=\"nav nav-tabs\" role=\"menu\">\\n\t<li role=\"presentation\">\\n\t\t<a href=\"{{route}}\" role=\"tab\"><span class=\"text\">{{label}}</span></a>\\n\t</li>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-podActions.html -->\\n<ul role=\"menu\">\\n\t<li class=\"nx-action\" data-action=\"{{action}}\" data-target=\"{{target}}\">\\n\t\t<a class=\"action\" href=\"{{route}}\">{{icon}}</a>\\n\t\t<ul role=\"menu\" class=\"mdc-list sub-menu\" aria-hidden=\"true\" aria-orientation=\"vertical\">\\n\t\t\t<a href=\"{{route}}\" class=\"mdc-list-item mdc-ripple-surface mdc-ripple-surface--primary nx-action\" data-action=\"{{action}}\" tabindex=\"-1\">\\n\t\t\t\t<span class=\"mdc-list-item__graphic\" aria-hidden=\"true\">{{icon}}</span>\\n\t\t\t\t<span class=\"mdc-list-item__text\">{{label}}</span>\\n\t\t\t</a>\\n\t\t</ul>\\n\t</li>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-sidebar.html -->\\n<ul class=\"nav nav-tabs flex-column-grid\" role=\"tablist\">\\n\t<li class=\"flex-item nx-action\" role=\"presentation\" data-action=\"{{action}}\"><a aria-controls=\"{{label}}\" role=\"tab\">{{icon}}</a></li>\\n</ul>\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-sidebarActions.html -->\\n<ul role=\"menu\">\\n\t<li class=\"nx-action\" data-action=\"{{action}}\" data-target=\"{{target}}\">\\n\t\t<a href=\"{{route}}\">{{icon}}<span class=\"text\">{{label}}</span></a>\\n\t</li>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-systemHeaderActions.html -->\\n<ul class=\"actions list\" role=\"menu\">\\n\t<li class=\"nx-action\" data-action=\"{{action}}\" data-target=\"{{target}}\">\\n\t\t<a class=\"action\" href=\"{{route}}\">{{icon}}<span class=\"text\">{{label}}</span></a>\\n\t</li>\\n</ul>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-systemList.html -->\\n<nav class=\"mdc-list\" role=\"menu\" aria-orientation=\"vertical\">\\n\t<a href=\"{{route}}\" class=\"mdc-list-item mdc-ripple-surface mdc-ripple-surface--primary nx-action\" data-action=\"{{action}}\" tabindex=\"-1\">\\n\t\t<span class=\"mdc-list-item__graphic\" aria-hidden=\"true\">{{icon}}</span>\\n\t\t<span class=\"mdc-list-item__text\">{{label}}</span>\\n\t</a>\\n</nav>';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView-systemTableActions.html -->\\n<ul class=\"nav nav-icons va\" role=\"menu\">\\n\t<li class=\"nx-action\" role=\"presentation\" data-action=\"{{action}}\"><a href=\"{{route}}\" class=\"action\" aria-controls=\"{{label}}\" data-placement=\"right\">{{icon}}</a></li>\\n</ul>\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- build-targets/theme/packages/core-app/templates/menuView.html -->\\n';\n}\nreturn __p;\n};\n","module.exports = function(obj){\nvar __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\nwith(obj||{}){\n__p+='\\n<!-- packages/core-app/templates/empty.html -->\\n';\n}\nreturn __p;\n};\n","/**\n* Detect Element Resize\n*\n* https://github.com/sdecima/javascript-detect-element-resize\n* Sebastian Decima\n*\n* version: 0.5.3\n**/\n\n(function () {\n\tvar attachEvent = document.attachEvent,\n\t\tstylesCreated = false;\n\t\n\tif (!attachEvent) {\n\t\tvar requestFrame = (function(){\n\t\t\tvar raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||\n\t\t\t\t\t\t\t\tfunction(fn){ return window.setTimeout(fn, 20); };\n\t\t\treturn function(fn){ return raf(fn); };\n\t\t})();\n\t\t\n\t\tvar cancelFrame = (function(){\n\t\t\tvar cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame ||\n\t\t\t\t\t\t\t\t window.clearTimeout;\n\t\t return function(id){ return cancel(id); };\n\t\t})();\n\n\t\tfunction _resetTriggers(element){\n\t\t\tvar triggers = element.__resizeTriggers__,\n\t\t\t\texpand = triggers.firstElementChild,\n\t\t\t\tcontract = triggers.lastElementChild,\n\t\t\t\texpandChild = expand.firstElementChild;\n\t\t\tcontract.scrollLeft = contract.scrollWidth;\n\t\t\tcontract.scrollTop = contract.scrollHeight;\n\t\t\texpandChild.style.width = expand.offsetWidth + 1 + 'px';\n\t\t\texpandChild.style.height = expand.offsetHeight + 1 + 'px';\n\t\t\texpand.scrollLeft = expand.scrollWidth;\n\t\t\texpand.scrollTop = expand.scrollHeight;\n\t\t};\n\n\t\tfunction checkTriggers(element){\n\t\t\treturn element.offsetWidth != element.__resizeLast__.width ||\n\t\t\t\t\t\t element.offsetHeight != element.__resizeLast__.height;\n\t\t}\n\t\t\n\t\tfunction scrollListener(e){\n\t\t\tvar element = this;\n\t\t\t_resetTriggers(this);\n\t\t\tif (this.__resizeRAF__) cancelFrame(this.__resizeRAF__);\n\t\t\tthis.__resizeRAF__ = requestFrame(function(){\n\t\t\t\tif (checkTriggers(element)) {\n\t\t\t\t\telement.__resizeLast__.width = element.offsetWidth;\n\t\t\t\t\telement.__resizeLast__.height = element.offsetHeight;\n\t\t\t\t\telement.__resizeListeners__.forEach(function(fn){\n\t\t\t\t\t\tfn.call(element, e);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\t\n\t\t/* Detect CSS Animations support to detect element display/re-attach */\n\t\tvar animation = false,\n\t\t\tanimationstring = 'animation',\n\t\t\tkeyframeprefix = '',\n\t\t\tanimationstartevent = 'animationstart',\n\t\t\tdomPrefixes = 'Webkit Moz O ms'.split(' '),\n\t\t\tstartEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),\n\t\t\tpfx = '';\n\t\t\n\t\tvar elm = document.createElement('fakeelement');\n\t\tif( elm.style.animationName !== undefined ) { animation = true; }\n\n\t\tif( animation === false ) {\n\t\t\tfor( var i = 0; i < domPrefixes.length; i++ ) {\n\t\t\t\tif( elm.style[ domPrefixes[i] + 'AnimationName' ] !== undefined ) {\n\t\t\t\t\tpfx = domPrefixes[ i ];\n\t\t\t\t\tanimationstring = pfx + 'Animation';\n\t\t\t\t\tkeyframeprefix = '-' + pfx.toLowerCase() + '-';\n\t\t\t\t\tanimationstartevent = startEvents[ i ];\n\t\t\t\t\tanimation = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tvar animationName = 'resizeanim';\n\t\tvar animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';\n\t\tvar animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';\n\t}\n\t\n\tfunction createStyles() {\n\t\tif (!stylesCreated) {\n\t\t\t//opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360\n\t\t\tvar css = (animationKeyframes ? animationKeyframes : '') +\n\t\t\t\t\t'.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' +\n\t\t\t\t\t'.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \\\" \\\"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',\n\t\t\t\thead = document.head || document.getElementsByTagName('head')[0],\n\t\t\t\tstyle = document.createElement('style');\n\t\t\t\n\t\t\tstyle.type = 'text/css';\n\t\t\tif (style.styleSheet) {\n\t\t\t\tstyle.styleSheet.cssText = css;\n\t\t\t} else {\n\t\t\t\tstyle.appendChild(document.createTextNode(css));\n\t\t\t}\n\n\t\t\thead.appendChild(style);\n\t\t\tstylesCreated = true;\n\t\t}\n\t}\n\t\n\twindow.addResizeListener = function(element, fn){\n\t\tif (attachEvent) element.attachEvent('onresize', fn);\n\t\telse {\n\t\t\tif (!element.__resizeTriggers__) {\n\t\t\t\tif (getComputedStyle(element).position == 'static') element.style.position = 'relative';\n\t\t\t\tcreateStyles();\n\t\t\t\telement.__resizeLast__ = {};\n\t\t\t\telement.__resizeListeners__ = [];\n\t\t\t\t(element.__resizeTriggers__ = document.createElement('div')).className = 'resize-triggers';\n\t\t\t\telement.__resizeTriggers__.innerHTML = '<div class=\"expand-trigger\"><div></div></div>' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'<div class=\"contract-trigger\"></div>';\n\t\t\t\telement.appendChild(element.__resizeTriggers__);\n\t\t\t\t_resetTriggers(element);\n\t\t\t\telement.addEventListener('scroll', scrollListener, {\n\t\t\t\t\tcapture: true,\n\t\t\t\t\tpassive: true\n\t\t\t\t} );\n\t\t\t\t\n\t\t\t\t/* Listen for a css animation to detect element display/re-attach */\n\t\t\t\tanimationstartevent && element.__resizeTriggers__.addEventListener(animationstartevent, function(e) {\n\t\t\t\t\tif(e.animationName == animationName)\n\t\t\t\t\t\t_resetTriggers(element);\n\t\t\t\t});\n\t\t\t}\n\t\t\telement.__resizeListeners__.push(fn);\n\t\t}\n\t};\n\t\n\twindow.removeResizeListener = function(element, fn){\n\t\tif (attachEvent) element.detachEvent('onresize', fn);\n\t\telse {\n\t\t\telement.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);\n\t\t\tif (!element.__resizeListeners__.length) {\n\t\t\t\t\telement.removeEventListener('scroll', scrollListener, {\n\t\t\t\t\t\tcapture: true,\n\t\t\t\t\t\tpassive: true\n\t\t\t\t\t} );\n\t\t\t\t\telement.__resizeLast__ = {};\n\t\t\t\t\telement.__resizeListeners__ = [];\n\t\t\t\t\telement.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);\n\t\t\t}\n\t\t}\n\t}\n})();","/**\n*\n* Base64 encode / decode\n* http://www.webtoolkit.info\n*\n**/\nvar Base64 = {\n\n // private property\n _keyStr: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"\n\n // public method for encoding\n , encode: function (input)\n {\n var output = \"\";\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n\n input = Base64._utf8_encode(input);\n\n while (i < input.length)\n {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2))\n {\n enc3 = enc4 = 64;\n }\n else if (isNaN(chr3))\n {\n enc4 = 64;\n }\n\n output = output +\n this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +\n this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);\n } // Whend \n\n return output;\n } // End Function encode \n\n\n // public method for decoding\n ,decode: function (input)\n {\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n while (i < input.length)\n {\n enc1 = this._keyStr.indexOf(input.charAt(i++));\n enc2 = this._keyStr.indexOf(input.charAt(i++));\n enc3 = this._keyStr.indexOf(input.charAt(i++));\n enc4 = this._keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 != 64)\n {\n output = output + String.fromCharCode(chr2);\n }\n\n if (enc4 != 64)\n {\n output = output + String.fromCharCode(chr3);\n }\n\n } // Whend \n\n output = Base64._utf8_decode(output);\n\n return output;\n } // End Function decode \n\n\n // private method for UTF-8 encoding\n ,_utf8_encode: function (string)\n {\n var utftext = \"\";\n string = string.replace(/\\r\\n/g, \"\\n\");\n\n for (var n = 0; n < string.length; n++)\n {\n var c = string.charCodeAt(n);\n\n if (c < 128)\n {\n utftext += String.fromCharCode(c);\n }\n else if ((c > 127) && (c < 2048))\n {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n else\n {\n utftext += String.fromCharCode((c >> 12) | 224);\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n\n } // Next n \n\n return utftext;\n } // End Function _utf8_encode \n\n // private method for UTF-8 decoding\n ,_utf8_decode: function (utftext)\n {\n var string = \"\";\n var i = 0;\n var c, c1, c2, c3;\n c = c1 = c2 = 0;\n\n while (i < utftext.length)\n {\n c = utftext.charCodeAt(i);\n\n if (c < 128)\n {\n string += String.fromCharCode(c);\n i++;\n }\n else if ((c > 191) && (c < 224))\n {\n c2 = utftext.charCodeAt(i + 1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n }\n else\n {\n c2 = utftext.charCodeAt(i + 1);\n c3 = utftext.charCodeAt(i + 2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n\n } // Whend \n\n return string;\n } // End Function _utf8_decode \n\n};\n\nmodule.exports = Base64;\n","/**\n * NOTE: Be sure to document new items in https://confluence.netx.net/display/DEV/X7+Library+Overrides%2C+Extensions+and+Mixins\n */\n+function( $ ) {\n\t\n\t// https://github.com/select2/select2/issues/1436\n\t//$.fn.modal.Constructor.prototype.enforceFocus = function() {};\n\t\n\t// // Prevent dropdown from closing under certain conditions\n\t// $(document).on('hide.bs.dropdown', function (e) {\n\t// \tvar $target = $(e.target);\n\t// \tif( $target.find('.nx-popover-open').length ) {\n\t// \t\treturn false;\n\t// \t}\n\t// } );\n\t\n\t// Interesting, Safari is behaving correctly on this (by not positioning tootlips correctly) - offsetWidth/offsetHeight are returned for SVG elements in all other browsers\n\t// https://bugs.chromium.org/p/chromium/issues/detail?id=463116\n\t// https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetheight / https://drafts.csswg.org/cssom-view/#dom-htmlelement-offsetwidth\n\t// Both assume the css box model which SVG is not - so we constantly come up {left:0,top:0} in safari no matter what when `jQuery.fn.offset` is used\n\t// Part of me thinks I ought to override jQuery offset and use `getBoundingClientRect` in the event of an SVG element\n\t// but since this problem only is affecting us with tooltips in stats at the moment, bootstrap override:\n\t$.fn.tooltip.Constructor.prototype.getPosition = function ($element) {\n\t\t$element = $element || this.$element;\n\t\tvar el = $element[0];\n\t\tvar isBody = el.tagName == 'BODY';\n\t\t\n\t\tvar hasBoundingClientRect = _.isFunction( el.getBoundingClientRect );\n\t\tvar svgRelated = $element.is('svg') || $element.closest('svg').length;\n\t\t\n\t\tif( svgRelated && !hasBoundingClientRect ) {\n\t\t\tconsole.warn(\"Bootstrap tooltip: element is SVG and does not have boundingClientRect - positions cannot be calculated.\");\n\t\t}\n\t\t\n\t\tvar boundingClientRect = hasBoundingClientRect ? el.getBoundingClientRect() : $element.offset();\n\t\treturn $.extend({}, hasBoundingClientRect && boundingClientRect || null, {\n\t\t\tscroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),\n\t\t\twidth: isBody ? $(window).width() : $element.outerWidth(),\n\t\t\theight: isBody ? $(window).height() : $element.outerHeight()\n\t\t}, isBody ? { top: 0, left: 0 } : svgRelated && _.pick( boundingClientRect, 'left', 'top' ) || $element.offset() );\n\t}\n\t\n}( jQuery );","/*!\n * imagesLoaded PACKAGED v4.1.1\n * JavaScript is all like \"You images are done yet or what?\"\n * MIT License\n */\n\n/**\n * EvEmitter v1.0.3\n * Lil' event emitter\n * MIT License\n */\n\n/* jshint unused: true, undef: true, strict: true */\n\n( function( global, factory ) {\n // universal module definition\n /* jshint strict: false */ /* globals define, module, window */\n if ( typeof define == 'function' && define.amd ) {\n // AMD - RequireJS\n define( 'ev-emitter/ev-emitter',factory );\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS - Browserify, Webpack\n module.exports = factory();\n } else {\n // Browser globals\n global.EvEmitter = factory();\n }\n\n}( typeof window != 'undefined' ? window : this, function() {\n\n\n\nfunction EvEmitter() {}\n\nvar proto = EvEmitter.prototype;\n\nproto.on = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // set events hash\n var events = this._events = this._events || {};\n // set listeners array\n var listeners = events[ eventName ] = events[ eventName ] || [];\n // only add once\n if ( listeners.indexOf( listener ) == -1 ) {\n listeners.push( listener );\n }\n\n return this;\n};\n\nproto.once = function( eventName, listener ) {\n if ( !eventName || !listener ) {\n return;\n }\n // add event\n this.on( eventName, listener );\n // set once flag\n // set onceEvents hash\n var onceEvents = this._onceEvents = this._onceEvents || {};\n // set onceListeners object\n var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};\n // set flag\n onceListeners[ listener ] = true;\n\n return this;\n};\n\nproto.off = function( eventName, listener ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n var index = listeners.indexOf( listener );\n if ( index != -1 ) {\n listeners.splice( index, 1 );\n }\n\n return this;\n};\n\nproto.emitEvent = function( eventName, args ) {\n var listeners = this._events && this._events[ eventName ];\n if ( !listeners || !listeners.length ) {\n return;\n }\n var i = 0;\n var listener = listeners[i];\n args = args || [];\n // once stuff\n var onceListeners = this._onceEvents && this._onceEvents[ eventName ];\n\n while ( listener ) {\n var isOnce = onceListeners && onceListeners[ listener ];\n if ( isOnce ) {\n // remove listener\n // remove before trigger to prevent recursion\n this.off( eventName, listener );\n // unset once flag\n delete onceListeners[ listener ];\n }\n // trigger listener\n listener.apply( this, args );\n // get next listener\n i += isOnce ? 0 : 1;\n listener = listeners[i];\n }\n\n return this;\n};\n\nreturn EvEmitter;\n\n}));\n\n/*!\n * imagesLoaded v4.1.1\n * JavaScript is all like \"You images are done yet or what?\"\n * MIT License\n */\n\n( function( window, factory ) { 'use strict';\n // universal module definition\n\n /*global define: false, module: false, require: false */\n\n if ( typeof define == 'function' && define.amd ) {\n // AMD\n define( [\n 'ev-emitter/ev-emitter'\n ], function( EvEmitter ) {\n return factory( window, EvEmitter );\n });\n } else if ( typeof module == 'object' && module.exports ) {\n // CommonJS\n module.exports = factory(\n window,\n require('ev-emitter')\n );\n } else {\n // browser global\n window.imagesLoaded = factory(\n window,\n window.EvEmitter\n );\n }\n\n})( window,\n\n// -------------------------- factory -------------------------- //\n\nfunction factory( window, EvEmitter ) {\n\n\n\nvar $ = window.jQuery;\nvar console = window.console;\n\n// -------------------------- helpers -------------------------- //\n\n// extend objects\nfunction extend( a, b ) {\n for ( var prop in b ) {\n a[ prop ] = b[ prop ];\n }\n return a;\n}\n\n// turn element or nodeList into an array\nfunction makeArray( obj ) {\n var ary = [];\n if ( Array.isArray( obj ) ) {\n // use object if already an array\n ary = obj;\n } else if ( typeof obj.length == 'number' ) {\n // convert nodeList to array\n for ( var i=0; i < obj.length; i++ ) {\n ary.push( obj[i] );\n }\n } else {\n // array of single index\n ary.push( obj );\n }\n return ary;\n}\n\n// -------------------------- imagesLoaded -------------------------- //\n\n/**\n * @param {Array, Element, NodeList, String} elem\n * @param {Object or Function} options - if function, use as callback\n * @param {Function} onAlways - callback function\n */\nfunction ImagesLoaded( elem, options, onAlways ) {\n // coerce ImagesLoaded() without new, to be new ImagesLoaded()\n if ( !( this instanceof ImagesLoaded ) ) {\n return new ImagesLoaded( elem, options, onAlways );\n }\n // use elem as selector string\n if ( typeof elem == 'string' ) {\n elem = document.querySelectorAll( elem );\n }\n\n this.elements = makeArray( elem );\n this.options = extend( {}, this.options );\n\n if ( typeof options == 'function' ) {\n onAlways = options;\n } else {\n extend( this.options, options );\n }\n\n if ( onAlways ) {\n this.on( 'always', onAlways );\n }\n\n this.getImages();\n\n if ( $ ) {\n // add jQuery Deferred object\n this.jqDeferred = new $.Deferred();\n }\n\n // HACK check async to allow time to bind listeners\n setTimeout( function() {\n this.check();\n }.bind( this ));\n}\n\nImagesLoaded.prototype = Object.create( EvEmitter.prototype );\n\nImagesLoaded.prototype.options = {};\n\nImagesLoaded.prototype.getImages = function() {\n this.images = [];\n\n // filter & find items if we have an item selector\n this.elements.forEach( this.addElementImages, this );\n};\n\n/**\n * @param {Node} element\n */\nImagesLoaded.prototype.addElementImages = function( elem ) {\n // filter siblings\n if ( elem.nodeName == 'IMG' ) {\n this.addImage( elem );\n }\n // get background image on element\n if ( this.options.background === true ) {\n this.addElementBackgroundImages( elem );\n }\n\n // find children\n // no non-element nodes, #143\n var nodeType = elem.nodeType;\n if ( !nodeType || !elementNodeTypes[ nodeType ] ) {\n return;\n }\n var childImgs = elem.querySelectorAll('img');\n // concat childElems to filterFound array\n for ( var i=0; i < childImgs.length; i++ ) {\n var img = childImgs[i];\n this.addImage( img );\n }\n\n // get child background images\n if ( typeof this.options.background == 'string' ) {\n var children = elem.querySelectorAll( this.options.background );\n for ( i=0; i < children.length; i++ ) {\n var child = children[i];\n this.addElementBackgroundImages( child );\n }\n }\n};\n\nvar elementNodeTypes = {\n 1: true,\n 9: true,\n 11: true\n};\n\nImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {\n var style = getComputedStyle( elem );\n if ( !style ) {\n // Firefox returns null if in a hidden iframe https://bugzil.la/548397\n return;\n }\n // get url inside url(\"...\")\n var reURL = /url\\((['\"])?(.*?)\\1\\)/gi;\n var matches = reURL.exec( style.backgroundImage );\n while ( matches !== null ) {\n var url = matches && matches[2];\n if ( url ) {\n this.addBackground( url, elem );\n }\n matches = reURL.exec( style.backgroundImage );\n }\n};\n\n/**\n * @param {Image} img\n */\nImagesLoaded.prototype.addImage = function( img ) {\n var loadingImage = new LoadingImage( img );\n this.images.push( loadingImage );\n};\n\nImagesLoaded.prototype.addBackground = function( url, elem ) {\n var background = new Background( url, elem );\n this.images.push( background );\n};\n\nImagesLoaded.prototype.check = function() {\n var _this = this;\n this.progressedCount = 0;\n this.hasAnyBroken = false;\n // complete if no images\n if ( !this.images.length ) {\n this.complete();\n return;\n }\n\n function onProgress( image, elem, message ) {\n // HACK - Chrome triggers event before object properties have changed. #83\n setTimeout( function() {\n _this.progress( image, elem, message );\n });\n }\n\n this.images.forEach( function( loadingImage ) {\n loadingImage.once( 'progress', onProgress );\n loadingImage.check();\n });\n};\n\nImagesLoaded.prototype.progress = function( image, elem, message ) {\n this.progressedCount++;\n this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;\n // progress event\n this.emitEvent( 'progress', [ this, image, elem ] );\n if ( this.jqDeferred && this.jqDeferred.notify ) {\n this.jqDeferred.notify( this, image );\n }\n // check if completed\n if ( this.progressedCount == this.images.length ) {\n this.complete();\n }\n\n if ( this.options.debug && console ) {\n console.log( 'progress: ' + message, image, elem );\n }\n};\n\nImagesLoaded.prototype.complete = function() {\n var eventName = this.hasAnyBroken ? 'fail' : 'done';\n this.isComplete = true;\n this.emitEvent( eventName, [ this ] );\n this.emitEvent( 'always', [ this ] );\n if ( this.jqDeferred ) {\n var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';\n this.jqDeferred[ jqMethod ]( this );\n }\n};\n\n// -------------------------- -------------------------- //\n\nfunction LoadingImage( img ) {\n this.img = img;\n}\n\nLoadingImage.prototype = Object.create( EvEmitter.prototype );\n\nLoadingImage.prototype.check = function() {\n // If complete is true and browser supports natural sizes,\n // try to check for image status manually.\n var isComplete = this.getIsImageComplete();\n if ( isComplete ) {\n // report based on naturalWidth\n this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );\n return;\n }\n\n // If none of the checks above matched, simulate loading on detached element.\n this.proxyImage = new Image();\n this.proxyImage.addEventListener( 'load', this );\n this.proxyImage.addEventListener( 'error', this );\n // bind to image as well for Firefox. #191\n this.img.addEventListener( 'load', this );\n this.img.addEventListener( 'error', this );\n this.proxyImage.src = this.img.src;\n};\n\nLoadingImage.prototype.getIsImageComplete = function() {\n return this.img.complete && this.img.naturalWidth !== undefined;\n};\n\nLoadingImage.prototype.confirm = function( isLoaded, message ) {\n this.isLoaded = isLoaded;\n this.emitEvent( 'progress', [ this, this.img, message ] );\n};\n\n// ----- events ----- //\n\n// trigger specified handler for event type\nLoadingImage.prototype.handleEvent = function( event ) {\n var method = 'on' + event.type;\n if ( this[ method ] ) {\n this[ method ]( event );\n }\n};\n\nLoadingImage.prototype.onload = function() {\n this.confirm( true, 'onload' );\n this.unbindEvents();\n};\n\nLoadingImage.prototype.onerror = function() {\n this.confirm( false, 'onerror' );\n this.unbindEvents();\n};\n\nLoadingImage.prototype.unbindEvents = function() {\n this.proxyImage.removeEventListener( 'load', this );\n this.proxyImage.removeEventListener( 'error', this );\n this.img.removeEventListener( 'load', this );\n this.img.removeEventListener( 'error', this );\n};\n\n// -------------------------- Background -------------------------- //\n\nfunction Background( url, element ) {\n this.url = url;\n this.element = element;\n this.img = new Image();\n}\n\n// inherit LoadingImage prototype\nBackground.prototype = Object.create( LoadingImage.prototype );\n\nBackground.prototype.check = function() {\n this.img.addEventListener( 'load', this );\n this.img.addEventListener( 'error', this );\n this.img.src = this.url;\n // check if image is already complete\n var isComplete = this.getIsImageComplete();\n if ( isComplete ) {\n this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );\n this.unbindEvents();\n }\n};\n\nBackground.prototype.unbindEvents = function() {\n this.img.removeEventListener( 'load', this );\n this.img.removeEventListener( 'error', this );\n};\n\nBackground.prototype.confirm = function( isLoaded, message ) {\n this.isLoaded = isLoaded;\n this.emitEvent( 'progress', [ this, this.element, message ] );\n};\n\n// -------------------------- jQuery -------------------------- //\n\nImagesLoaded.makeJQueryPlugin = function( jQuery ) {\n jQuery = jQuery || window.jQuery;\n if ( !jQuery ) {\n return;\n }\n // set local variable\n $ = jQuery;\n // $().imagesLoaded()\n $.fn.imagesLoaded = function( options, callback ) {\n var instance = new ImagesLoaded( this, options, callback );\n return instance.jqDeferred.promise( $(this) );\n };\n};\n// try making plugin\nImagesLoaded.makeJQueryPlugin();\n\n// -------------------------- -------------------------- //\n\nreturn ImagesLoaded;\n\n});\n","function infiniteQueryBehavior() {\n return {\n onFetch: context => {\n context.fetchFn = () => {\n var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2;\n\n const refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage;\n const fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore;\n const pageParam = fetchMore == null ? void 0 : fetchMore.pageParam;\n const isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'forward';\n const isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'backward';\n const oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || [];\n const oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || [];\n let newPageParams = oldPageParams;\n let cancelled = false;\n\n const addSignalProperty = object => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n var _context$signal;\n\n if ((_context$signal = context.signal) != null && _context$signal.aborted) {\n cancelled = true;\n } else {\n var _context$signal2;\n\n (_context$signal2 = context.signal) == null ? void 0 : _context$signal2.addEventListener('abort', () => {\n cancelled = true;\n });\n }\n\n return context.signal;\n }\n });\n }; // Get query function\n\n\n const queryFn = context.options.queryFn || (() => Promise.reject('Missing queryFn'));\n\n const buildNewPages = (pages, param, page, previous) => {\n newPageParams = previous ? [param, ...newPageParams] : [...newPageParams, param];\n return previous ? [page, ...pages] : [...pages, page];\n }; // Create function to fetch a page\n\n\n const fetchPage = (pages, manual, param, previous) => {\n if (cancelled) {\n return Promise.reject('Cancelled');\n }\n\n if (typeof param === 'undefined' && !manual && pages.length) {\n return Promise.resolve(pages);\n }\n\n const queryFnContext = {\n queryKey: context.queryKey,\n pageParam: param,\n meta: context.options.meta\n };\n addSignalProperty(queryFnContext);\n const queryFnResult = queryFn(queryFnContext);\n const promise = Promise.resolve(queryFnResult).then(page => buildNewPages(pages, param, page, previous));\n return promise;\n };\n\n let promise; // Fetch first page?\n\n if (!oldPages.length) {\n promise = fetchPage([]);\n } // Fetch next page?\n else if (isFetchingNextPage) {\n const manual = typeof pageParam !== 'undefined';\n const param = manual ? pageParam : getNextPageParam(context.options, oldPages);\n promise = fetchPage(oldPages, manual, param);\n } // Fetch previous page?\n else if (isFetchingPreviousPage) {\n const manual = typeof pageParam !== 'undefined';\n const param = manual ? pageParam : getPreviousPageParam(context.options, oldPages);\n promise = fetchPage(oldPages, manual, param, true);\n } // Refetch pages\n else {\n newPageParams = [];\n const manual = typeof context.options.getNextPageParam === 'undefined';\n const shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; // Fetch first page\n\n promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); // Fetch remaining pages\n\n for (let i = 1; i < oldPages.length; i++) {\n promise = promise.then(pages => {\n const shouldFetchNextPage = refetchPage && oldPages[i] ? refetchPage(oldPages[i], i, oldPages) : true;\n\n if (shouldFetchNextPage) {\n const param = manual ? oldPageParams[i] : getNextPageParam(context.options, pages);\n return fetchPage(pages, manual, param);\n }\n\n return Promise.resolve(buildNewPages(pages, oldPageParams[i], oldPages[i]));\n });\n }\n }\n\n const finalPromise = promise.then(pages => ({\n pages,\n pageParams: newPageParams\n }));\n return finalPromise;\n };\n }\n };\n}\nfunction getNextPageParam(options, pages) {\n return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages);\n}\nfunction getPreviousPageParam(options, pages) {\n return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages);\n}\n/**\n * Checks if there is a next page.\n * Returns `undefined` if it cannot be determined.\n */\n\nfunction hasNextPage(options, pages) {\n if (options.getNextPageParam && Array.isArray(pages)) {\n const nextPageParam = getNextPageParam(options, pages);\n return typeof nextPageParam !== 'undefined' && nextPageParam !== null && nextPageParam !== false;\n }\n\n return;\n}\n/**\n * Checks if there is a previous page.\n * Returns `undefined` if it cannot be determined.\n */\n\nfunction hasPreviousPage(options, pages) {\n if (options.getPreviousPageParam && Array.isArray(pages)) {\n const previousPageParam = getPreviousPageParam(options, pages);\n return typeof previousPageParam !== 'undefined' && previousPageParam !== null && previousPageParam !== false;\n }\n\n return;\n}\n\nexport { getNextPageParam, getPreviousPageParam, hasNextPage, hasPreviousPage, infiniteQueryBehavior };\n//# sourceMappingURL=infiniteQueryBehavior.mjs.map\n","const defaultLogger = console;\n\nexport { defaultLogger };\n//# sourceMappingURL=logger.mjs.map\n","import { defaultLogger } from './logger.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { Removable } from './removable.mjs';\nimport { createRetryer, canFetch } from './retryer.mjs';\n\n// CLASS\nclass Mutation extends Removable {\n constructor(config) {\n super();\n this.options = { ...config.defaultOptions,\n ...config.options\n };\n this.mutationId = config.mutationId;\n this.mutationCache = config.mutationCache;\n this.logger = config.logger || defaultLogger;\n this.observers = [];\n this.state = config.state || getDefaultState();\n this.updateCacheTime(this.options.cacheTime);\n this.scheduleGc();\n }\n\n get meta() {\n return this.options.meta;\n }\n\n setState(state) {\n this.dispatch({\n type: 'setState',\n state\n });\n }\n\n addObserver(observer) {\n if (this.observers.indexOf(observer) === -1) {\n this.observers.push(observer); // Stop the mutation from being garbage collected\n\n this.clearGcTimeout();\n this.mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer\n });\n }\n }\n\n removeObserver(observer) {\n this.observers = this.observers.filter(x => x !== observer);\n this.scheduleGc();\n this.mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer\n });\n }\n\n optionalRemove() {\n if (!this.observers.length) {\n if (this.state.status === 'loading') {\n this.scheduleGc();\n } else {\n this.mutationCache.remove(this);\n }\n }\n }\n\n continue() {\n var _this$retryer$continu, _this$retryer;\n\n return (_this$retryer$continu = (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.continue()) != null ? _this$retryer$continu : this.execute();\n }\n\n async execute() {\n const executeMutation = () => {\n var _this$options$retry;\n\n this.retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject('No mutationFn found');\n }\n\n return this.options.mutationFn(this.state.variables);\n },\n onFail: (failureCount, error) => {\n this.dispatch({\n type: 'failed',\n failureCount,\n error\n });\n },\n onPause: () => {\n this.dispatch({\n type: 'pause'\n });\n },\n onContinue: () => {\n this.dispatch({\n type: 'continue'\n });\n },\n retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode\n });\n return this.retryer.promise;\n };\n\n const restored = this.state.status === 'loading';\n\n try {\n var _this$mutationCache$c3, _this$mutationCache$c4, _this$options$onSucce, _this$options2, _this$options$onSettl, _this$options3;\n\n if (!restored) {\n var _this$mutationCache$c, _this$mutationCache$c2, _this$options$onMutat, _this$options;\n\n this.dispatch({\n type: 'loading',\n variables: this.options.variables\n }); // Notify cache callback\n\n await ((_this$mutationCache$c = (_this$mutationCache$c2 = this.mutationCache.config).onMutate) == null ? void 0 : _this$mutationCache$c.call(_this$mutationCache$c2, this.state.variables, this));\n const context = await ((_this$options$onMutat = (_this$options = this.options).onMutate) == null ? void 0 : _this$options$onMutat.call(_this$options, this.state.variables));\n\n if (context !== this.state.context) {\n this.dispatch({\n type: 'loading',\n context,\n variables: this.state.variables\n });\n }\n }\n\n const data = await executeMutation(); // Notify cache callback\n\n await ((_this$mutationCache$c3 = (_this$mutationCache$c4 = this.mutationCache.config).onSuccess) == null ? void 0 : _this$mutationCache$c3.call(_this$mutationCache$c4, data, this.state.variables, this.state.context, this));\n await ((_this$options$onSucce = (_this$options2 = this.options).onSuccess) == null ? void 0 : _this$options$onSucce.call(_this$options2, data, this.state.variables, this.state.context));\n await ((_this$options$onSettl = (_this$options3 = this.options).onSettled) == null ? void 0 : _this$options$onSettl.call(_this$options3, data, null, this.state.variables, this.state.context));\n this.dispatch({\n type: 'success',\n data\n });\n return data;\n } catch (error) {\n try {\n var _this$mutationCache$c5, _this$mutationCache$c6, _this$options$onError, _this$options4, _this$options$onSettl2, _this$options5;\n\n // Notify cache callback\n await ((_this$mutationCache$c5 = (_this$mutationCache$c6 = this.mutationCache.config).onError) == null ? void 0 : _this$mutationCache$c5.call(_this$mutationCache$c6, error, this.state.variables, this.state.context, this));\n\n if (process.env.NODE_ENV !== 'production') {\n this.logger.error(error);\n }\n\n await ((_this$options$onError = (_this$options4 = this.options).onError) == null ? void 0 : _this$options$onError.call(_this$options4, error, this.state.variables, this.state.context));\n await ((_this$options$onSettl2 = (_this$options5 = this.options).onSettled) == null ? void 0 : _this$options$onSettl2.call(_this$options5, undefined, error, this.state.variables, this.state.context));\n throw error;\n } finally {\n this.dispatch({\n type: 'error',\n error: error\n });\n }\n }\n }\n\n dispatch(action) {\n const reducer = state => {\n switch (action.type) {\n case 'failed':\n return { ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n\n case 'pause':\n return { ...state,\n isPaused: true\n };\n\n case 'continue':\n return { ...state,\n isPaused: false\n };\n\n case 'loading':\n return { ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: !canFetch(this.options.networkMode),\n status: 'loading',\n variables: action.variables\n };\n\n case 'success':\n return { ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false\n };\n\n case 'error':\n return { ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error'\n };\n\n case 'setState':\n return { ...state,\n ...action.state\n };\n }\n };\n\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.observers.forEach(observer => {\n observer.onMutationUpdate(action);\n });\n this.mutationCache.notify({\n mutation: this,\n type: 'updated',\n action\n });\n });\n }\n\n}\nfunction getDefaultState() {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined\n };\n}\n\nexport { Mutation, getDefaultState };\n//# sourceMappingURL=mutation.mjs.map\n","import { replaceData, noop, timeUntilStale, getAbortController } from './utils.mjs';\nimport { defaultLogger } from './logger.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { createRetryer, isCancelledError, canFetch } from './retryer.mjs';\nimport { Removable } from './removable.mjs';\n\n// CLASS\nclass Query extends Removable {\n constructor(config) {\n super();\n this.abortSignalConsumed = false;\n this.defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.observers = [];\n this.cache = config.cache;\n this.logger = config.logger || defaultLogger;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.initialState = config.state || getDefaultState(this.options);\n this.state = this.initialState;\n this.scheduleGc();\n }\n\n get meta() {\n return this.options.meta;\n }\n\n setOptions(options) {\n this.options = { ...this.defaultOptions,\n ...options\n };\n this.updateCacheTime(this.options.cacheTime);\n }\n\n optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.cache.remove(this);\n }\n }\n\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options); // Set data and mark it as cached\n\n this.dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options == null ? void 0 : options.updatedAt,\n manual: options == null ? void 0 : options.manual\n });\n return data;\n }\n\n setState(state, setStateOptions) {\n this.dispatch({\n type: 'setState',\n state,\n setStateOptions\n });\n }\n\n cancel(options) {\n var _this$retryer;\n\n const promise = this.promise;\n (_this$retryer = this.retryer) == null ? void 0 : _this$retryer.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n\n destroy() {\n super.destroy();\n this.cancel({\n silent: true\n });\n }\n\n reset() {\n this.destroy();\n this.setState(this.initialState);\n }\n\n isActive() {\n return this.observers.some(observer => observer.options.enabled !== false);\n }\n\n isDisabled() {\n return this.getObserversCount() > 0 && !this.isActive();\n }\n\n isStale() {\n return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(observer => observer.getCurrentResult().isStale);\n }\n\n isStaleByTime(staleTime = 0) {\n return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n\n onFocus() {\n var _this$retryer2;\n\n const observer = this.observers.find(x => x.shouldFetchOnWindowFocus());\n\n if (observer) {\n observer.refetch({\n cancelRefetch: false\n });\n } // Continue fetch if currently paused\n\n\n (_this$retryer2 = this.retryer) == null ? void 0 : _this$retryer2.continue();\n }\n\n onOnline() {\n var _this$retryer3;\n\n const observer = this.observers.find(x => x.shouldFetchOnReconnect());\n\n if (observer) {\n observer.refetch({\n cancelRefetch: false\n });\n } // Continue fetch if currently paused\n\n\n (_this$retryer3 = this.retryer) == null ? void 0 : _this$retryer3.continue();\n }\n\n addObserver(observer) {\n if (this.observers.indexOf(observer) === -1) {\n this.observers.push(observer); // Stop the query from being garbage collected\n\n this.clearGcTimeout();\n this.cache.notify({\n type: 'observerAdded',\n query: this,\n observer\n });\n }\n }\n\n removeObserver(observer) {\n if (this.observers.indexOf(observer) !== -1) {\n this.observers = this.observers.filter(x => x !== observer);\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.retryer) {\n if (this.abortSignalConsumed) {\n this.retryer.cancel({\n revert: true\n });\n } else {\n this.retryer.cancelRetry();\n }\n }\n\n this.scheduleGc();\n }\n\n this.cache.notify({\n type: 'observerRemoved',\n query: this,\n observer\n });\n }\n }\n\n getObserversCount() {\n return this.observers.length;\n }\n\n invalidate() {\n if (!this.state.isInvalidated) {\n this.dispatch({\n type: 'invalidate'\n });\n }\n }\n\n fetch(options, fetchOptions) {\n var _this$options$behavio, _context$fetchOptions;\n\n if (this.state.fetchStatus !== 'idle') {\n if (this.state.dataUpdatedAt && fetchOptions != null && fetchOptions.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetches\n this.cancel({\n silent: true\n });\n } else if (this.promise) {\n var _this$retryer4;\n\n // make sure that retries that were potentially cancelled due to unmounts can continue\n (_this$retryer4 = this.retryer) == null ? void 0 : _this$retryer4.continueRetry(); // Return current promise if we are already fetching\n\n return this.promise;\n }\n } // Update config if passed, otherwise the config from the last execution is used\n\n\n if (options) {\n this.setOptions(options);\n } // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n\n\n if (!this.options.queryFn) {\n const observer = this.observers.find(x => x.options.queryFn);\n\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n\n if (!Array.isArray(this.options.queryKey)) {\n if (process.env.NODE_ENV !== 'production') {\n this.logger.error(\"As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']\");\n }\n }\n\n const abortController = getAbortController(); // Create query function context\n\n const queryFnContext = {\n queryKey: this.queryKey,\n pageParam: undefined,\n meta: this.meta\n }; // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n\n const addSignalProperty = object => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n if (abortController) {\n this.abortSignalConsumed = true;\n return abortController.signal;\n }\n\n return undefined;\n }\n });\n };\n\n addSignalProperty(queryFnContext); // Create fetch function\n\n const fetchFn = () => {\n if (!this.options.queryFn) {\n return Promise.reject('Missing queryFn');\n }\n\n this.abortSignalConsumed = false;\n return this.options.queryFn(queryFnContext);\n }; // Trigger behavior hook\n\n\n const context = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context);\n (_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch(context); // Store state in case the current fetch needs to be reverted\n\n this.revertState = this.state; // Set to fetching state if not already in it\n\n if (this.state.fetchStatus === 'idle' || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) {\n var _context$fetchOptions2;\n\n this.dispatch({\n type: 'fetch',\n meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta\n });\n }\n\n const onError = error => {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n this.dispatch({\n type: 'error',\n error: error\n });\n }\n\n if (!isCancelledError(error)) {\n var _this$cache$config$on, _this$cache$config;\n\n // Notify cache callback\n (_this$cache$config$on = (_this$cache$config = this.cache.config).onError) == null ? void 0 : _this$cache$config$on.call(_this$cache$config, error, this);\n\n if (process.env.NODE_ENV !== 'production') {\n this.logger.error(error);\n }\n }\n\n if (!this.isFetchingOptimistic) {\n // Schedule query gc after fetching\n this.scheduleGc();\n }\n\n this.isFetchingOptimistic = false;\n }; // Try to fetch the data\n\n\n this.retryer = createRetryer({\n fn: context.fetchFn,\n abort: abortController == null ? void 0 : abortController.abort.bind(abortController),\n onSuccess: data => {\n var _this$cache$config$on2, _this$cache$config2;\n\n if (typeof data === 'undefined') {\n if (process.env.NODE_ENV !== 'production') {\n this.logger.error(\"Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: \" + this.queryHash);\n }\n\n onError(new Error('undefined'));\n return;\n }\n\n this.setData(data); // Notify cache callback\n\n (_this$cache$config$on2 = (_this$cache$config2 = this.cache.config).onSuccess) == null ? void 0 : _this$cache$config$on2.call(_this$cache$config2, data, this);\n\n if (!this.isFetchingOptimistic) {\n // Schedule query gc after fetching\n this.scheduleGc();\n }\n\n this.isFetchingOptimistic = false;\n },\n onError,\n onFail: (failureCount, error) => {\n this.dispatch({\n type: 'failed',\n failureCount,\n error\n });\n },\n onPause: () => {\n this.dispatch({\n type: 'pause'\n });\n },\n onContinue: () => {\n this.dispatch({\n type: 'continue'\n });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode\n });\n this.promise = this.retryer.promise;\n return this.promise;\n }\n\n dispatch(action) {\n const reducer = state => {\n var _action$meta, _action$dataUpdatedAt;\n\n switch (action.type) {\n case 'failed':\n return { ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n\n case 'pause':\n return { ...state,\n fetchStatus: 'paused'\n };\n\n case 'continue':\n return { ...state,\n fetchStatus: 'fetching'\n };\n\n case 'fetch':\n return { ...state,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null,\n fetchStatus: canFetch(this.options.networkMode) ? 'fetching' : 'paused',\n ...(!state.dataUpdatedAt && {\n error: null,\n status: 'loading'\n })\n };\n\n case 'success':\n return { ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success',\n ...(!action.manual && {\n fetchStatus: 'idle',\n fetchFailureCount: 0,\n fetchFailureReason: null\n })\n };\n\n case 'error':\n const error = action.error;\n\n if (isCancelledError(error) && error.revert && this.revertState) {\n return { ...this.revertState\n };\n }\n\n return { ...state,\n error: error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error'\n };\n\n case 'invalidate':\n return { ...state,\n isInvalidated: true\n };\n\n case 'setState':\n return { ...state,\n ...action.state\n };\n }\n };\n\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.observers.forEach(observer => {\n observer.onQueryUpdate(action);\n });\n this.cache.notify({\n query: this,\n type: 'updated',\n action\n });\n });\n }\n\n}\n\nfunction getDefaultState(options) {\n const data = typeof options.initialData === 'function' ? options.initialData() : options.initialData;\n const hasData = typeof data !== 'undefined';\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === 'function' ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'loading',\n fetchStatus: 'idle'\n };\n}\n\nexport { Query };\n//# sourceMappingURL=query.mjs.map\n","import { hashQueryKeyByOptions, parseFilterArgs, matchQuery } from './utils.mjs';\nimport { Query } from './query.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { Subscribable } from './subscribable.mjs';\n\n// CLASS\nclass QueryCache extends Subscribable {\n constructor(config) {\n super();\n this.config = config || {};\n this.queries = [];\n this.queriesMap = {};\n }\n\n build(client, options, state) {\n var _options$queryHash;\n\n const queryKey = options.queryKey;\n const queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options);\n let query = this.get(queryHash);\n\n if (!query) {\n query = new Query({\n cache: this,\n logger: client.getLogger(),\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey)\n });\n this.add(query);\n }\n\n return query;\n }\n\n add(query) {\n if (!this.queriesMap[query.queryHash]) {\n this.queriesMap[query.queryHash] = query;\n this.queries.push(query);\n this.notify({\n type: 'added',\n query\n });\n }\n }\n\n remove(query) {\n const queryInMap = this.queriesMap[query.queryHash];\n\n if (queryInMap) {\n query.destroy();\n this.queries = this.queries.filter(x => x !== query);\n\n if (queryInMap === query) {\n delete this.queriesMap[query.queryHash];\n }\n\n this.notify({\n type: 'removed',\n query\n });\n }\n }\n\n clear() {\n notifyManager.batch(() => {\n this.queries.forEach(query => {\n this.remove(query);\n });\n });\n }\n\n get(queryHash) {\n return this.queriesMap[queryHash];\n }\n\n getAll() {\n return this.queries;\n }\n\n find(arg1, arg2) {\n const [filters] = parseFilterArgs(arg1, arg2);\n\n if (typeof filters.exact === 'undefined') {\n filters.exact = true;\n }\n\n return this.queries.find(query => matchQuery(filters, query));\n }\n\n findAll(arg1, arg2) {\n const [filters] = parseFilterArgs(arg1, arg2);\n return Object.keys(filters).length > 0 ? this.queries.filter(query => matchQuery(filters, query)) : this.queries;\n }\n\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach(listener => {\n listener(event);\n });\n });\n }\n\n onFocus() {\n notifyManager.batch(() => {\n this.queries.forEach(query => {\n query.onFocus();\n });\n });\n }\n\n onOnline() {\n notifyManager.batch(() => {\n this.queries.forEach(query => {\n query.onOnline();\n });\n });\n }\n\n}\n\nexport { QueryCache };\n//# sourceMappingURL=queryCache.mjs.map\n","import { notifyManager } from './notifyManager.mjs';\nimport { Mutation } from './mutation.mjs';\nimport { matchMutation, noop } from './utils.mjs';\nimport { Subscribable } from './subscribable.mjs';\n\n// CLASS\nclass MutationCache extends Subscribable {\n constructor(config) {\n super();\n this.config = config || {};\n this.mutations = [];\n this.mutationId = 0;\n }\n\n build(client, options, state) {\n const mutation = new Mutation({\n mutationCache: this,\n logger: client.getLogger(),\n mutationId: ++this.mutationId,\n options: client.defaultMutationOptions(options),\n state,\n defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : undefined\n });\n this.add(mutation);\n return mutation;\n }\n\n add(mutation) {\n this.mutations.push(mutation);\n this.notify({\n type: 'added',\n mutation\n });\n }\n\n remove(mutation) {\n this.mutations = this.mutations.filter(x => x !== mutation);\n this.notify({\n type: 'removed',\n mutation\n });\n }\n\n clear() {\n notifyManager.batch(() => {\n this.mutations.forEach(mutation => {\n this.remove(mutation);\n });\n });\n }\n\n getAll() {\n return this.mutations;\n }\n\n find(filters) {\n if (typeof filters.exact === 'undefined') {\n filters.exact = true;\n }\n\n return this.mutations.find(mutation => matchMutation(filters, mutation));\n }\n\n findAll(filters) {\n return this.mutations.filter(mutation => matchMutation(filters, mutation));\n }\n\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach(listener => {\n listener(event);\n });\n });\n }\n\n resumePausedMutations() {\n var _this$resuming;\n\n this.resuming = ((_this$resuming = this.resuming) != null ? _this$resuming : Promise.resolve()).then(() => {\n const pausedMutations = this.mutations.filter(x => x.state.isPaused);\n return notifyManager.batch(() => pausedMutations.reduce((promise, mutation) => promise.then(() => mutation.continue().catch(noop)), Promise.resolve()));\n }).then(() => {\n this.resuming = undefined;\n });\n return this.resuming;\n }\n\n}\n\nexport { MutationCache };\n//# sourceMappingURL=mutationCache.mjs.map\n","import { parseFilterArgs, parseQueryArgs, functionalUpdate, noop, hashQueryKey, partialMatchKey, hashQueryKeyByOptions } from './utils.mjs';\nimport { QueryCache } from './queryCache.mjs';\nimport { MutationCache } from './mutationCache.mjs';\nimport { focusManager } from './focusManager.mjs';\nimport { onlineManager } from './onlineManager.mjs';\nimport { notifyManager } from './notifyManager.mjs';\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior.mjs';\nimport { defaultLogger } from './logger.mjs';\n\n// CLASS\nclass QueryClient {\n constructor(config = {}) {\n this.queryCache = config.queryCache || new QueryCache();\n this.mutationCache = config.mutationCache || new MutationCache();\n this.logger = config.logger || defaultLogger;\n this.defaultOptions = config.defaultOptions || {};\n this.queryDefaults = [];\n this.mutationDefaults = [];\n this.mountCount = 0;\n\n if (process.env.NODE_ENV !== 'production' && config.logger) {\n this.logger.error(\"Passing a custom logger has been deprecated and will be removed in the next major version.\");\n }\n }\n\n mount() {\n this.mountCount++;\n if (this.mountCount !== 1) return;\n this.unsubscribeFocus = focusManager.subscribe(() => {\n if (focusManager.isFocused()) {\n this.resumePausedMutations();\n this.queryCache.onFocus();\n }\n });\n this.unsubscribeOnline = onlineManager.subscribe(() => {\n if (onlineManager.isOnline()) {\n this.resumePausedMutations();\n this.queryCache.onOnline();\n }\n });\n }\n\n unmount() {\n var _this$unsubscribeFocu, _this$unsubscribeOnli;\n\n this.mountCount--;\n if (this.mountCount !== 0) return;\n (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);\n this.unsubscribeFocus = undefined;\n (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);\n this.unsubscribeOnline = undefined;\n }\n\n isFetching(arg1, arg2) {\n const [filters] = parseFilterArgs(arg1, arg2);\n filters.fetchStatus = 'fetching';\n return this.queryCache.findAll(filters).length;\n }\n\n isMutating(filters) {\n return this.mutationCache.findAll({ ...filters,\n fetching: true\n }).length;\n }\n\n getQueryData(queryKey, filters) {\n var _this$queryCache$find;\n\n return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data;\n }\n\n ensureQueryData(arg1, arg2, arg3) {\n const parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n const cachedData = this.getQueryData(parsedOptions.queryKey);\n return cachedData ? Promise.resolve(cachedData) : this.fetchQuery(parsedOptions);\n }\n\n getQueriesData(queryKeyOrFilters) {\n return this.getQueryCache().findAll(queryKeyOrFilters).map(({\n queryKey,\n state\n }) => {\n const data = state.data;\n return [queryKey, data];\n });\n }\n\n setQueryData(queryKey, updater, options) {\n const query = this.queryCache.find(queryKey);\n const prevData = query == null ? void 0 : query.state.data;\n const data = functionalUpdate(updater, prevData);\n\n if (typeof data === 'undefined') {\n return undefined;\n }\n\n const parsedOptions = parseQueryArgs(queryKey);\n const defaultedOptions = this.defaultQueryOptions(parsedOptions);\n return this.queryCache.build(this, defaultedOptions).setData(data, { ...options,\n manual: true\n });\n }\n\n setQueriesData(queryKeyOrFilters, updater, options) {\n return notifyManager.batch(() => this.getQueryCache().findAll(queryKeyOrFilters).map(({\n queryKey\n }) => [queryKey, this.setQueryData(queryKey, updater, options)]));\n }\n\n getQueryState(queryKey, filters) {\n var _this$queryCache$find2;\n\n return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state;\n }\n\n removeQueries(arg1, arg2) {\n const [filters] = parseFilterArgs(arg1, arg2);\n const queryCache = this.queryCache;\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach(query => {\n queryCache.remove(query);\n });\n });\n }\n\n resetQueries(arg1, arg2, arg3) {\n const [filters, options] = parseFilterArgs(arg1, arg2, arg3);\n const queryCache = this.queryCache;\n const refetchFilters = {\n type: 'active',\n ...filters\n };\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach(query => {\n query.reset();\n });\n return this.refetchQueries(refetchFilters, options);\n });\n }\n\n cancelQueries(arg1, arg2, arg3) {\n const [filters, cancelOptions = {}] = parseFilterArgs(arg1, arg2, arg3);\n\n if (typeof cancelOptions.revert === 'undefined') {\n cancelOptions.revert = true;\n }\n\n const promises = notifyManager.batch(() => this.queryCache.findAll(filters).map(query => query.cancel(cancelOptions)));\n return Promise.all(promises).then(noop).catch(noop);\n }\n\n invalidateQueries(arg1, arg2, arg3) {\n const [filters, options] = parseFilterArgs(arg1, arg2, arg3);\n return notifyManager.batch(() => {\n var _ref, _filters$refetchType;\n\n this.queryCache.findAll(filters).forEach(query => {\n query.invalidate();\n });\n\n if (filters.refetchType === 'none') {\n return Promise.resolve();\n }\n\n const refetchFilters = { ...filters,\n type: (_ref = (_filters$refetchType = filters.refetchType) != null ? _filters$refetchType : filters.type) != null ? _ref : 'active'\n };\n return this.refetchQueries(refetchFilters, options);\n });\n }\n\n refetchQueries(arg1, arg2, arg3) {\n const [filters, options] = parseFilterArgs(arg1, arg2, arg3);\n const promises = notifyManager.batch(() => this.queryCache.findAll(filters).filter(query => !query.isDisabled()).map(query => {\n var _options$cancelRefetc;\n\n return query.fetch(undefined, { ...options,\n cancelRefetch: (_options$cancelRefetc = options == null ? void 0 : options.cancelRefetch) != null ? _options$cancelRefetc : true,\n meta: {\n refetchPage: filters.refetchPage\n }\n });\n }));\n let promise = Promise.all(promises).then(noop);\n\n if (!(options != null && options.throwOnError)) {\n promise = promise.catch(noop);\n }\n\n return promise;\n }\n\n fetchQuery(arg1, arg2, arg3) {\n const parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n const defaultedOptions = this.defaultQueryOptions(parsedOptions); // https://github.com/tannerlinsley/react-query/issues/652\n\n if (typeof defaultedOptions.retry === 'undefined') {\n defaultedOptions.retry = false;\n }\n\n const query = this.queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n }\n\n prefetchQuery(arg1, arg2, arg3) {\n return this.fetchQuery(arg1, arg2, arg3).then(noop).catch(noop);\n }\n\n fetchInfiniteQuery(arg1, arg2, arg3) {\n const parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n parsedOptions.behavior = infiniteQueryBehavior();\n return this.fetchQuery(parsedOptions);\n }\n\n prefetchInfiniteQuery(arg1, arg2, arg3) {\n return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop).catch(noop);\n }\n\n resumePausedMutations() {\n return this.mutationCache.resumePausedMutations();\n }\n\n getQueryCache() {\n return this.queryCache;\n }\n\n getMutationCache() {\n return this.mutationCache;\n }\n\n getLogger() {\n return this.logger;\n }\n\n getDefaultOptions() {\n return this.defaultOptions;\n }\n\n setDefaultOptions(options) {\n this.defaultOptions = options;\n }\n\n setQueryDefaults(queryKey, options) {\n const result = this.queryDefaults.find(x => hashQueryKey(queryKey) === hashQueryKey(x.queryKey));\n\n if (result) {\n result.defaultOptions = options;\n } else {\n this.queryDefaults.push({\n queryKey,\n defaultOptions: options\n });\n }\n }\n\n getQueryDefaults(queryKey) {\n if (!queryKey) {\n return undefined;\n } // Get the first matching defaults\n\n\n const firstMatchingDefaults = this.queryDefaults.find(x => partialMatchKey(queryKey, x.queryKey)); // Additional checks and error in dev mode\n\n if (process.env.NODE_ENV !== 'production') {\n // Retrieve all matching defaults for the given key\n const matchingDefaults = this.queryDefaults.filter(x => partialMatchKey(queryKey, x.queryKey)); // It is ok not having defaults, but it is error prone to have more than 1 default for a given key\n\n if (matchingDefaults.length > 1) {\n this.logger.error(\"[QueryClient] Several query defaults match with key '\" + JSON.stringify(queryKey) + \"'. The first matching query defaults are used. Please check how query defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetquerydefaults.\");\n }\n }\n\n return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions;\n }\n\n setMutationDefaults(mutationKey, options) {\n const result = this.mutationDefaults.find(x => hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey));\n\n if (result) {\n result.defaultOptions = options;\n } else {\n this.mutationDefaults.push({\n mutationKey,\n defaultOptions: options\n });\n }\n }\n\n getMutationDefaults(mutationKey) {\n if (!mutationKey) {\n return undefined;\n } // Get the first matching defaults\n\n\n const firstMatchingDefaults = this.mutationDefaults.find(x => partialMatchKey(mutationKey, x.mutationKey)); // Additional checks and error in dev mode\n\n if (process.env.NODE_ENV !== 'production') {\n // Retrieve all matching defaults for the given key\n const matchingDefaults = this.mutationDefaults.filter(x => partialMatchKey(mutationKey, x.mutationKey)); // It is ok not having defaults, but it is error prone to have more than 1 default for a given key\n\n if (matchingDefaults.length > 1) {\n this.logger.error(\"[QueryClient] Several mutation defaults match with key '\" + JSON.stringify(mutationKey) + \"'. The first matching mutation defaults are used. Please check how mutation defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetmutationdefaults.\");\n }\n }\n\n return firstMatchingDefaults == null ? void 0 : firstMatchingDefaults.defaultOptions;\n }\n\n defaultQueryOptions(options) {\n if (options != null && options._defaulted) {\n return options;\n }\n\n const defaultedOptions = { ...this.defaultOptions.queries,\n ...this.getQueryDefaults(options == null ? void 0 : options.queryKey),\n ...options,\n _defaulted: true\n };\n\n if (!defaultedOptions.queryHash && defaultedOptions.queryKey) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);\n } // dependent default values\n\n\n if (typeof defaultedOptions.refetchOnReconnect === 'undefined') {\n defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== 'always';\n }\n\n if (typeof defaultedOptions.useErrorBoundary === 'undefined') {\n defaultedOptions.useErrorBoundary = !!defaultedOptions.suspense;\n }\n\n return defaultedOptions;\n }\n\n defaultMutationOptions(options) {\n if (options != null && options._defaulted) {\n return options;\n }\n\n return { ...this.defaultOptions.mutations,\n ...this.getMutationDefaults(options == null ? void 0 : options.mutationKey),\n ...options,\n _defaulted: true\n };\n }\n\n clear() {\n this.queryCache.clear();\n this.mutationCache.clear();\n }\n\n}\n\nexport { QueryClient };\n//# sourceMappingURL=queryClient.mjs.map\n","import { isValidTimeout, isServer } from './utils.mjs';\n\nclass Removable {\n destroy() {\n this.clearGcTimeout();\n }\n\n scheduleGc() {\n this.clearGcTimeout();\n\n if (isValidTimeout(this.cacheTime)) {\n this.gcTimeout = setTimeout(() => {\n this.optionalRemove();\n }, this.cacheTime);\n }\n }\n\n updateCacheTime(newCacheTime) {\n // Default to 5 minutes (Infinity for server-side) if no cache time is set\n this.cacheTime = Math.max(this.cacheTime || 0, newCacheTime != null ? newCacheTime : isServer ? Infinity : 5 * 60 * 1000);\n }\n\n clearGcTimeout() {\n if (this.gcTimeout) {\n clearTimeout(this.gcTimeout);\n this.gcTimeout = undefined;\n }\n }\n\n}\n\nexport { Removable };\n//# sourceMappingURL=removable.mjs.map\n"],"names":["supportsPassive_","applyPassive","globalObj","forceRefresh","window","undefined","isSupported_1","document","addEventListener","passive","e","closest","element","selector","el","matches","parentElement","webkitMatchesSelector","msMatchesSelector","call","cachedCssTransformPropertyName_","getTransformPropertyName","createElement","style","supportsCssVariables_","supportsCssVariables","windowObj","supportsCssVars","CSS","supports","explicitlySupportsCssVars","weAreFeatureDetectingSafari10plus","node","className","head","appendChild","computedStyle","getComputedStyle","hasPseudoVarBug","borderTopStyle","parentNode","removeChild","detectEdgePseudoVarBug","getNormalizedEventCoords","evt","pageOffset","clientRect","x","y","normalizedX","normalizedY","documentX","left","documentY","top","type","touchEvent","changedTouches","pageX","pageY","mouseEvent","MDCFadingTabIndicatorFoundation","_super","apply","this","arguments","prototype","activate","adapter_","addClass","deactivate","removeClass","MDCSlidingTabIndicatorFoundation","previousIndicatorClientRect","currentClientRect","computeContentClientRect","widthDelta","width","xPosition","setContentStyleProperty","MDCTabScrollerRTLDefault","getScrollPositionRTL","currentScrollLeft","getScrollAreaScrollLeft","right","calculateScrollEdges_","Math","round","scrollToRTL","scrollX","edges","clampedScrollLeft","clampScrollValue_","finalScrollPosition","scrollDelta","incrementScrollRTL","getAnimatingScrollPosition","getScrollContentOffsetWidth","getScrollAreaOffsetWidth","min","max","MDCTabScrollerRTLNegative","translateX","contentWidth","MDCTabScrollerRTLReverse","MDCTabScrollerRTL","adapter","horizontalScrollbarHeight_","computeHorizontalScrollbarHeight","documentObj","shouldCacheResult","classList","add","body","horizontalScrollbarHeight","offsetHeight","clientHeight","event","label","i18n","t","enableTest","canContact","helpUrl","wrapper","view","model","get","iconOpts","classes","icons","faBell","icon","html","faCaretLeft","faChartPie","faClipboardList","faCloud","faCogs","faExclamationTriangle","faFolder","faHammer","faHome","faInbox","faInboxIn","faPhone","faPowerOff","faQuestionCircle","faSearch","faSyncAlt","faTable","faUser","newActions","extendBackboneActions","actions","route","concat","notMobile","userLevel","faArchive","bulkCartLoaderEnabled","datamanagerAuthorized","datamanagerEnabled","reviewEnabled","Object","assign","Menus","sidebar","Menu","tools","DOWNLOAD_REQUEST_EVENT","user","MenuView","Base","isMenuView","constructor","__isMenuView__","opts","loadingMethods","template","Template","super","context","menu","listenTo","dispatcher","setActiveClasses","$dropdown","hasClass","$dropdownToggle","click","cancel","doTemplate","section","_toHtml","item","_","isArray","each","isObject","isFunction","a","FindLegacyAction","fake","console","warn","$el","filter","length","depth","$template","$","replace","$html","clone","$currentMenu","children","not","remove","attr","_findTarget","$item","$actionTarget","find","_processItem","action","removeAttr","hash","slice","target","outerHTML","customIcon","includes","innerHTML","_toCustomHtml","$_html","first","append","class","$section","_item","$subMenu","$a","RegisterLegacyAction","headerLabel","$header","replaceWith","join","postRender","is","$subMenus","configureSubmenus","allActions","disabledActions","siblings","enableIf","lasthash","$tabPresentation","Backbone","history","location","lastIndexOf","escape","removeInner","stopListening","undelegateEvents","empty","__name__","removeOnHide","onMenuClose","isHeaderTitleActions","contains","querySelectorAll","forEach","list","parent","firstChild","insertBefore","toggleEl","querySelector","wrapperEl","dropdownParent","listActions","checkDropdownParent","menuEl","mdcMenuWrapper","li","dropdownEl","cancelLi","innerText","listEl","some","listAction","getAttribute","removeAttribute","dropdowntoggle","setAttribute","dividerEl","nextSibling","hasEnabledAction","display","MaterialMenus","App","rpc","xhrTrackProgress","defaults","description","clientLogs","ccSelf","serverUnresponsiveCount","logo","randomChars","methods","read","_contact","attrs","contactArgs","from","to","cc","subject","message","overrideBlock","storageLocations","StorageLocationsCollection","addSubCollection","listenToOnce","loaded","contact","values","recipient","csvToArray","getPreference","userEmail","emailFrom","userProfile","isEmpty","extend","Deferred","reject","Brand","xhrLoadingMessages","getBranding","xhrLoadedMessages","brandGetArgs","d","getLogo","then","response","resolve","img","Image","on","naturalWidth","naturalHeight","uniqueId","now","src","promise","resetBranding","setLogo","logoName","logoMode","id","brandSetArgs","_objectSpread","logger","getPrefixedLogger","AppFullScreenView","additionalViewClasses","childView","viewClass","emptyOnHide","hideOnEmpty","hideIfWeShould","viewSpec","isMyOriginalCollection","viewCollection","isRouted","isRouting","ConfirmView","preventDefault","stopPropagation","$content","beforeHidden","cb","set","hide","beforeShown","show","newRoute","oldRoute","ModalView","onShowing","hiddenByRoute","viewInstantiated","viewRemoved","activeView","getActiveView","cid","silly","routeMatch","appRouter","force","afterHidden","AppProgressView","eventStr","headerTitle","loadingClassRemoveDelay","minimumShowTime","modalOptions","blocking","lastEventStr","simulate","debounce","complete","hideTimeout","clearTimeout","render","preRender","templateDataSource","templateVars","$pseudoProgress","$pseudoProgressBar","simulateProgress","endProgressSimulation","hiding","_simpleHide","setTimeout","_simulate","progress","MDCLinearProgress","destroy","indeterminate","progressUpdated","percentComplete","foundation_","setProgress","OptionTiles","models","Model","Error","tileOption","omit","push","promises","provider","trackingState","trackingCode","getPublicProperty","trigger","Promise","all","AppComponent","React","UnauthenticatedLandingComponent","options","NS","Netx","app","AppModel","customConfig","disableTouchMove","setGlobal","enableTouchMove","removeEventListener","setPreference","key","val","userPrefs","brand","BrandModel","$body","$window","$document","size","innerWidth","height","innerHeight","tickleSession","throttle","capture","h","w","root","ReactDOM","getElementById","bodyView","FullScreenView","fsViews","modalView","start","toString","Suspense","fallback","ready","authenticated","session","localStore","authConfig","loadUrl","currentUserMeetsUserLevel","UserLevel","fetch","getLocationTypes","when","java_version","_window$location$hash","_window$location$hash2","match","modules","map","m","default","initialized","viewOptions","modalViews","AlertView","showActions","msg","alertClass","toLowerCase","CoreModel","View","args","rest","confirmed","cancelled","oklabel","cancellabel","err","module","title","error","url","test","spawnNewWindow","Array","shift","dump","complain","pager","collection","firstPage","lastPage","prevPage","nextPage","page","gotoPage","uuid","hasResult","pollInterval","batchJob","batchJobs","addEventStr","eventStrs","BatchJobModel","legacyWebsocket","defer","href","substr","indexOf","reload","yesLabel","noLabel","count","code","setupGoogleAnalytics","version","required_version","server_version","tileCollection","OptionTilesCollection","data","at","imports","Auth","Notification","Analytics","bootstrap","routes","AdBuilder","AudioEditor","DataSet","PDFViewer","ImageEditor","Project","Stat","System","VideoEditor","UploadAssetRequestManager","once","catId","tab","off","FormValidation","I18n","en_US","stringLength","less","less_plural","namespace","initialize","addMenus","menus","Views","controller","AdvancedMenuItemView","tagName","AdvancedMenuView","ChildView","templateName","childViewTemplate","items","ChildViews","getUserLevel","coreConfig","share/request(/:token)","uploads/request(/:token)","_Netx$session","assetProjectEnabled","AppModalCrumbView","has","addRelatedView","bindModelEvents","toggleActive","relatedView","crumbLabel","$remove","$title","toggle","noCrumb","toggleClass","modalOpts","faTimes","active","index","attributes","role","tabindex","AppModalCrumbsView","bindCollectionEvents","rendered","crumbsChanged","checkMultipleCrumbs","resize","checkMaterialTabActive","tabBar","findWhere","name","idx","tabList_","findIndex","root_","activateTab","setupMaterial","tabScroller","tabScroller_","tabScrollerEl","getScrollContentWidth","offsetWidth","getPreviousActiveTabIndex","scrollIntoView","MDCTabBar","Plugins","Destroy","Initialize","AppModalView","events","modalCrumbsView","addSubView","activeViewClassNames","$backdrop","delay","css","self","$crumbs","$dialog","$close","setElement","appendTo","bodyPad","parseInt","scrollbarWidth","scrollTop","bind","showing","whenShown","isUndefined","isNull","hasFunctionality","isShown","isMyRoute","hideDelayed","fadeOut","beforeShowView","currentHeight","$childTargetEl","classNames","close","viewAfterShown","viewChanging","stickyModal","removeOnSimpleHide","finish","goo","itemLabel","noEvent","yesEvent","onCancelled","onConfirmed","confirm","bool","faExternalLinkAlt","faPlus","confirmView","AuthSAMLServiceView","AuthUserLoginView","unsavedChanges","samlEnabled","debouncedRender","$password","$username","afterShown","focus","inputs","submit","blur","samlServiceClicked","currentTarget","standardLoginClicked","Form","animationstart","originalEvent","animationName","formChanged","checkForm","MaterialCheckboxes","MaterialRipples","MaterialTextFields","login","logout","register","IGNORE_SESSION_ROUTES","IGNORE_POST_LOGIN_ROUTES","isTrue","publicProperties","getSession","getToken","nxSession","configured","props","setCookie","deleteCookie","TICKLE_SESSION","beTickling","isValid","stopTickling","customLoginWasTriggered","postLoginHash","navigate","origin","appViews","sessionExpired","whenReady","RegExp","password","username","sessionKey","setKey","loginMsg","defaultValue","loginMsgClass","samlServiceName","canSelfRegister","customForm","CustomFormCollection","formName","UserProfileModel","requiresChanges","modelValues","setPropertyArrays","autogeneratePassword","password1","password2","email","registerNewUser","awaitingApproval","canRequestPasswordReset","passwordRequest","token","passwordChange","resultBool","errOb","errMsg","getPublicMethods","getSamlServices","SAVED_CARTS_ID","CART_GALLERY_ID","CART_ACTIONS_BAR","CART_HEADER_ID","SAVED_CART_HEADER_ID","SAVED_CART_GALLERY_ID","CHUNK_SIZE","PAGE_SIZE","SHARE_SHOW_OWNER","SHARE_SYNC_IMMEDIATE","ROUTE_SAVED_CART","Config","CategoryTreeNodes","xhrExcludeProgress","getCategories","getCategoryObjects","setCategoryOrder","_fetchChildren","_fetchCategory","_searchCategoryName","_getCategoryObjects","_setCategoryOrder","compact","pluck","sortBy","order","orderType","parsers","parseCats","parse","resetCategories","alphabetize","comparator","categoryid","disabledCategories","searchString","targetCategory","topLevelId","updateTopLevelCategories","topLevelCategories","filteredCategories","debouncedFetchTopLevel","fetchChildren","duplicateQueryPolicy","_listenId","isNew","changedParent","parentid","selectedCategory","ancestors","cat","tree","closeAll","clearSearch","cloneFrom","reset","invoke","recursive","fetchCategory","catid","silent","open","p","getSelectedCategoryModel","category","c","existing","parseSearchCats","toAdd","neededCats","value","isNaN","searchCategoryName","str","_response","cats","orderObj","setCategoryOrderType","where","ACTIVE_CLASS","ASSETS_MINI","TREE_NODE_OPEN_CLASS","TREE_NODE_CLOSED_CLASS","TREE_ID","CATEGORY_HEADER_ID","CATEGORY_LIST_ID","ASSET_LIST_ID","ASSET_LIST_FACETED","BREADCRUMB_ID","CATEGORY_DETAIL_ID","CONTAINER_ID","CATEGORY_EDIT_ID","DRAGGABLE","MODAL","displayCategoriesAsAssets","repositorydirectory","TREE_MAX_DEPTH","faComment","notifications","NotificationModel","storeOptions","mixin","overrideDefaultIcon","path","override","toCamelCase","favoriteSavedCarts","Upload","NAME","addInitializer","instance","materialCheckboxes","cleanUp","purgeEls","getExcludedViews","field","checkboxEl","checkbox","MDCCheckbox","formField","MDCFormField","input","anchorEl","dropdownToggle","hoist","horizontal","destroyOnClose","onClosed","closed","onOpen","opened","onAction","itemSelected","recalculatePosition","onClick","clicked","onTap","ripple","MDCRipple","unbounded","onToggleClick","toggleClicked","onToggleTap","createMenu","_open","autoOpen","backdrop","menuSurface_","isHoistedElement_","_ignoreItemSelection","MDCMenu","arrowNavigationPatch","list_","setVerticalOrientation","handleBodyTap_","handleBodyClick","registerBodyTapListener_","deregisterBodyTapListener_","listen","MDCMenuSurfaceFoundation","wrap","reEnableTouchEventsTimeout","listElements","detail","onMenuItemSelect","MouseEvent","bubbles","cancelable","dispatchEvent","simulateClickBody","setFixedPosition","hoistMenuToBody","cancelItem","onMenuOpen","menuSurface","dimensions_","getInnerDimensions","autoPosition_","materialMenus","addMaterialMenu","els","materialRipples","foundation","notchOutlinePatch","textfield","notchOutlinePatched_","notchOutline","openNotch","notchOutlinePatchTimeout","hasOutline","labelScale","cssClasses","numbers","labelWidth","getLabelWidth","forceFloat","hasLabel","label_","isFocused","inputFocusHandler_","shouldFloat","floatLabel","materialTextFields","dateComponents","textField","input_","deactivateFocus","materialTextFieldFloatLabel","i","getMaterailTextField","float","ttInputEl","inputEl","MDCTextField","arrowNavaigationPatched_","focusPrevElement","prevIndex","wrapFocus_","getListItemCount","listItemEl","focusNextElement","nextIndex","disabledListItemCheckboxPatch","disabledListItemCheckboxPatched_","initializeListType","setCheckedCheckboxOrRadioAtIndex","isChecked","strings","checked","createEvent","initEvent","SupportedLocale","getAvailableLocales","localesPref","localesFilter","split","locale","AppViews","isQueue","merge","findByTemplateKey","templateKey","findView","found","findInViews","childViews","subViews","views","getTransient","transient","switchTo","currentCollection","switchBack","AppViewsQueue","queueFor","oldQueueForSet","preparingToHide","removing","oldQueueForRemove","garbageCollect","CustomForm","deleteCustomForm","setCustomForm","elements","JSON","formData","userVals","userValues","duplicateKeys","makeName","en","elem","userVal","userValue","readOnly","getDisplayByData","idxAr","getDisplayLabel","getDisplayValue","submitArgs","dataValue","dataKey","StorageLocations","getLocations","loc","locationTypeLabel","locationTypeName","typeIds","properties","typeLabels","locationType","invert","getDefaultLocation","defaultLocation","getLocationLabelsForType","locationTypeId","locations","locModel","getLocationsForUpload","setDefaultLocation","currentDefaultLocation","save","wait","AppView","isAppView","viewModel","deferredModules","queued","switched","uniqueShowAction","camelCaseToDash","_model","setModel","setCollection","splice","newViewAttrs","changes","attrsToRemove","attrsToChange","_opts","oldViewAttrs","k","change","ret","_opts2","opt","setViewOption","newViewOptions","isViewActionValid","getEnabledActions","__isAppView__","CustomFormElement","required","disabled","toSet","lang","language","elementLabel","OptionTile","isString","valid","et","Pager","currentPage","itemTotal","pageSize","pagesToDisplay","pageTotal","startIndex","routesToPage","changedCurrentPage","calculatePages","assetCount","results","selection","firstIndex","startPosition","lastIndex","lastChunk","ceil","success","adjustTotal","adj","routeContext","getPageDTO","pageDTO","startId","setStartIndex","floor","clearPages","Progress","percent","GetDefaults","update","Sorter","sortableFields","keys","sortableOrders","sorter","preferredFetchMethod","getSortDTO","setSort","StorageLocation","idAttribute","basePath","capacitySize","creationdate","currentSize","key1","key2","locationTypeStatus","members","notes","sync","userid","clientAttrs","create","parseAndSave","updatedData","pick","setActive","setAsDefault","setSync","completions","attributeHistory","return","search","api","savedSearch","asset","categoryName","domain","sharedResource","permission","group","semanticObjects","semanticObjectTypes","tag","cart","savedCart","metadataLookup","attributeProfile","vocabulary","vocabularyValue","AppViewsCollection","AppBodyView","bodyViews","v","appView","activeViewModalOpts","MINIMUM_USER_LEVEL","assetExpirationEnabled","canModifyAssetExpiration","allows","permissionMatrix","PermissionMatrixName","canExpireAsset","assetExpires","canUnexpireAsset","assetExpirationToDateString","expirationDate","utc","local","format","userInputToExpirationTime","date","moment","endOf","tomorrow","valueOf","ASSET_RESYNC_MINIMUM_USER_LEVEL","AssetPref","checksumEnabled","CHECKSUM_ENABLED","canDeleteAsset","canCreatePdfFromAsset","assetIsPresent","canDownloadAsset","isAssetCheckedOut","canOrganizeAsset","canResyncAsset","canShareAsset","mediaServicesAvailable","AssetProjectPref","ENABLED","canManageAssetProject","isMobile","fileFormatFamily","AttributeDatum","assetAttributes","clearChanges","metadataLookupComplete","templateId","attrModel","getChanges","hasValueChanged","getValue","attributeDataModel","getValues","attrData","getReadOnly","getWritable","writable","setValue","autofilled","resetValues","AssetAttributeData","attributeDatum","AttributeDatumCollection","assetId","updateAttributeDatum","newValue","addAttribute","attribute","getAttributeTemplate","getTemplate","AssetAttributeDatum","getAssetAttributes","assetIds","setAssetAttributes","useDefaultValues","isEmptyValue","trackBatchJob","assetAttributeDataModel","attrDataModel","getWritableAttributes","getWrtiable","getReadOnlyAttributes","hasAttributeValues","foundValue","_values","j","hasWritableAttributes","unescapeAttributeName","isValueWritable","parseOutValue","AssetConstituents_","ucfirst","AssetConstituent_Keyframe","AssetConstituent_Layer","AssetConstituent_Page","pageNumber","ConsituentCollections","clips","keyframes","layers","pages","searchPDFPages","filtered","originalPages","AssetConstituents","subCollection","selected","displayed","constituentProps","types","thing","things","xhr","resp","Assets","fetchSpecificMethod","setStartPosition","createSearchObject","chunk","_startPosition","refetch","_maxItems","chunkSize","maxItems","useFacetedSearch","_filterMode","searchFacets","filterMode","elementTypes","sortField","sortOrder","matchCriteria","elementSubType1s","elementSubType2s","elementValue1s","elementValue2s","elementValue3s","selectedValues","saveSearch","notifyType","ignoreStat","fetchSpecificAssets","fetchAssetCount","fetchingAssetCount","getAssetIds","getAssetObjects","getMostViewedAssets","getRecentlyUploadedAssets","createPDF","pdf","titleStr","hiRes","pdfExportPreset","createPDFWithOptions","cpwo","ids","portrait","cols","rows","attrNames","attrLines","highRes","categorize","categorizeArgs","targetCat","moveToCategory","move","_addToCategory","removeFromCategory","_moveToCategory","reserve","result","facetedResult","assets","pop","systemFacetLabels","systemFacets","facets","facet","inCurrentCart","curPage","reserveCount","SearchRulesCollection","sortableChange","PagerModel","pagerRoutes","addSubModel","useFS","fsOpts","facetedSearchOptions","searchProperties","origFetch","getAssetObjectIds","state","cacheSelection","invalidate","trailing","newCat","categoryId","reFetch","destroyAll","aID","isSortable","customSearchType","elementType","hasChunkSize","oldChunkSize","oldMaxItems","always","toAssetSet","AssetSetModel","assetSetTypes","addToCategory","CategoryModel","addChunk","syncing","lengthBefore","loadingChunk","checkValidFacetSearchType","facetSupports","facetSelected","validSearchType","hasRouteContext","_usingFacetedSearch","turnOff","unescapeURI","escapeURI","AttributeProfiles","getAttributeProfiles","filterStr","getAttributeProfileForFolder","folderId","SorterModel","ATTRIBUTE_PROFILE_EVENT","PendingAsset","categoryIds","direction","PendingAssets","assetImporting","assetEnteringCategory","assetLeavingCategory","plupload","file","done","uploaded","setupDoneListener","newId","oldId","task","findByAsset","filterByAsset","findByCategory","filterByCategory","pendingAssets","PendingAssetsCollection","AudioFormatFamilyType","AUDIO","DocumentFormatFamilies","DOCUMENT","LAYOUT","ImageFormatFamilies","CAMERA_RAW","IMAGE","RAW","VECTOR","VideoFormatFamilyType","VIDEO","VideoFormatFamilies","MediaFormatFamilyType","MediaFormatFamilies","AssetConstituent","lowresUrl","modDate","previewUrl","rebuildType","rebuildCount","ref","thumbUrl","setDisplay","clipAttributes","perm","currentAsset","canCreateLink","canEmail","AssetConstituent_Clip","endTime","startTime","keyframeReady","_prepareDownload","constituent","progressUuid","_data","downloadOptions","ProgressModel","progressMessage","cacheBuster","prefix","dateFromAsset","getTime","getDuration","parseFloat","end","duration","hour","minute","second","millisecond","time","seconds","pretty","pad","getManualRepurposeOptions","process","getPrettyRange","prettyRange","r","AssetSet","getAssetIdsInSets","getDownloadWarnings","getDownloadOptions","prepareDownload","archiveName","justification","toCollection","DownloadOptionsCollection","Rpc","downloadOption","displayedDownloadOptionTypes","warnings","messageCount","assetsUnavailableCount","unique","progressMessages","objectId","abort","getCurrentCart","getTotal","saved","allSavedSearches","downloadOptionTypes","hasOption","toShareable","sType","ShareableModel","AssetVersion","creationDate","fileSize","fileTypeId","fileTypeLabel","memoId","memoText","original","shortMemoText","userId","userLabel","reactivateAssetVersion","assetVersion","Attribute","titleAttribute","attributeid","groupIds","hasPermissions","imageid","keyDatasets","objectTypes","mandatory","multivalue","orderby","permissioned","pulldownOptions","restrictedUserLevel","semanticTypeId","spec1","spec2","targetDatasets","templateid","trackHistory","attributeOptions","getAttributeVocabulary","metadataDatasetLookup","resourceName","multivalueTypes","nativeMultivalueTypes","resource","addObjectType","objectType","truncateAt","parseInValue","getAttributeOptions","attrOptions","caption","placeholder","getLabel","dontEscape","getMetadataSynced","metadataSync","exportIdx","metadataMap","exportIds","importIdx","importIds","export","exportValues","import","importValues","regex","syncMap","schemaPrefix","schema","metadata","optionValue","valueOptions","typeOptions","syncTypeOptions","getOptions","getSafeName","getSortFieldName","escapeAttributeName","getTypeLabel","getTypeName","historyEnabled","attributeHistoryEnabled","hasDefaultValue","invalid","validator","isAppendable","isFlexible","isForObjectType","isMandatory","isNativeMultivalue","isTrueMultivalue","ATTRIBUTE_MULTIPLE_VALUE_DEPRECATED_TYPES","ATTRIBUTE_EDITABLE_TYPES","parsed","trim","supportsFacets","ATTRIBUTE_TYPE","attributeSystemVocabulariesEnabled","updatableFields","isCSV","permissionsEnabled","removeObjectType","without","ATTRIBUTE_FACET_TYPES","toggleMandatory","toggleFacet","trackingHistory","AttributeData","valuesCollection","AttributesCollection","metadataLookupEnabled","populateValuesCollection","originalValue","lastModel","last","addValue","createValueModelAttributes","canManage","canEdit","changed","hasValue","vals","attrTemplate","useOriginalValues","dontMerge","removeValue","valueModel","CreateFromTemplate","AttributeProfileAttribute","cleared","AttributeProfileAttributes","AttributeProfile","setAttributeProfileForFolder","removeAttributeProfileFromFolder","attributesSelected","populateSelectedAttributes","profileId","Number","attrId","ATTRIBUTE_MULTIPLE_VALUE_TYPES","appendable","attrObj","attributeModels","_attrModel","Attribute_Date","attributeTypeIds","dateToHTML","isNumber","padStart","Attribute_Multiselect","parseNumber","navigator","example","Intl","NumberFormat","cleanPattern","charAt","normalized","n","s","useGrouping","dp","Attribute_Number","noLocale","maxDecimal","numberTypes","Infinity","toLocaleString","maximumFractionDigits","toFixed","minimumFractionDigits","bytes","decimalPlaces","numberType","maxLength","decimalIndex","decimalCount","substring","whatDecimalSeparator","decimals","getDecimalCount","Attribute_Select","Attribute_Semantic","Attribute_Tag","Attribute_TagVocab","Attribute_Text","parsedInValue","parseURL","truncatedValue","urls","cutoffUrl","valLength","parseURLS","Attribute_Textarea","both","cdr","cdrinfo","cdt","crl","dc","DICOM","exif","fill","ID3","Iptc4xmpCore","photoshop","tiff","xmp","xmpDM","xmpMM","xmpRights","mapObject","attributeSet","assetSet","organizeByTypes","none","fileType","folderPath","assetHasAudio","viewNames","isMediaFileTypeAsset","assetHasVideo","getAssetFileSizeLabel","PRESENT_STATUSES","assetStatuses","status","createAssetObject","overrides","attribute1","attribute2","attribute3","attribute4","attribute5","attribute6","attribute7","attribute8","attribute9","attribute10","attribute11","attribute12","attribute13","attribute14","attribute15","attribute16","attributeIds","attributeNames","attributePermissions","attributeValues","audioBitRate","audioChannelCount","audioChannelLayout","audioSampleRate","categories","categoryPaths","checkout","checkoutUserLabel","commitAttributes","constituentIds","constituentType","fileSize2","fileheight","filesize","filetype","filetypelabel","filewidth","flvPreview","geoLocationLabel","hasChildren","hidden","importDate","importUserLabel","latitude","locationContext","locationid","longitude","metadataAvailable","moddate","moduserid","moduserlabel","parentId","previewHeight","previewWidth","proofAvailable","rating","relatedAvailable","repurposeAvailability","reviewAvailable","statDeliveries","statPreviews","thumb","timeScale","versionIds","viewIds","visible","zoomAvailable","dpi","md5sum","bitDepth","colorProfile","alphaChannel","templatable","templateCustomizable","iiifManifestUrl","getGeneralAssetFileType","specific","isDocumentFileTypeAsset","isImageFileTypeAsset","isVideoFileTypeAsset","getAssetFileTypeInfoLabel","pageCount","secondsToHms","getMediaFileTypeAssetInfoLabel","getImageFileTypeAssetInfoLabel","ASSET_DEFAULT_ICON_TEST","isDefaultIcon","routeToAsset","ATTRIBUTE_HISTROY_MINIMUM_LEVEL","AttributeHistoryPref","canViewAttributeHistory","AttributeProfilesSystemLabel","ROUTE","PROFILE_ACTION","ADD","EDIT","faPencilAlt","BASE_EVENT","testOnSync","getViewModel","attributeProfileActionProfilesSystemRouteIcon","faProjectDiagram","attributeProfileActionProfilesSystemRoute","params","performAction","enabled","supportsAsset","assetData","ATTRIBUTE_SYSTEM_ATTRIBUTES_MINIMUM_USER_LEVEL","ATTRIBUTE_SYSTEM_METADATA_MAPS_MINIMUM_USER_LEVEL","ATTRIBUTE_SYSTEM_SEMANTICS_MINIMUM_USER_LEVEL","AttributePref","TEXT","TEXTAREA","SELECT","DATE","MULTISELECT","TAG","NUMBER","HIERARCHICAL","SEMANTIC","TAG_VOCAB","ATTRIBUTE_ACCESS_FILTER_TYPES","ATTRIBUTE_APPENDABLE_TYPES","ATTRIBUTE_NUMBER_SPEC_2_TYPE","WHOLE","ONE_DECIMAL","TWO_DECIMALS","THREE_DECIMALS","UNLIMITED","SORTABLE","ATTRIBUTE_NUMBER_MAX_DECIMAL","ATTRIBUTE_OBJECT_TYPE","ASSET","CLIP","ATTRIBUTE_SYSTEM","ASSET_ID","CATEGORY_PATHS","CHECKSUM","CREATION_DATE","DIMENSIONS","EXPIRE_DATE","FILE","FILE_FORMAT_FAMILY","FILE_SIZE_2","FILE_TYPE_LABEL","HEIGHT","IMPORT_DATE","MOD_DATE","MOD_USER","PATH","SMART_LABELS","THUMB_PATH","WIDTH","ATTRIBUTE_SYSTEM_ID","canManageAttributeSystemAttributes","canManageAttributeSystemMetadataMaps","canManageAttributeSystemSemantics","attributeSystemSemanticsEnabled","AttributeObjectTypeLabel","Locales","AttributeSystemAttributesLabel","AttributeSystemMetadataMapsLabel","AttributeSystemSemanticsLabel","TYPE_LABELS","SYSTEM_ATTRIBUTE_LABELS","attributeTemplates","sort","attributeHistoryCompletion","autocompletions","filterByHistory","filterByObjectType","attributesChanged","getAttributeId","_getAttribute","_SYSTEM_ATTRIBUTE_LAB","system","AuthPref","CartAssets","facetedSearch","searchAssetBeanObjects","addAssetsToCart","tidyAssetList","addFacetedSearchToCart","archiveCartAssets","createObjectPackage","deleteCartAssets","expireCartAssets","fetchAll","inspect","removeAssetsFromCart","setAssetsInCart","unarchiveCartAssets","cartResultParser","inspection","cartId","setCartId","archiveArgs","locationId","batch","expirationArgs","lastCartRoute","total","unarchiveArgs","elementValue1","addAsset","savedCarts","archive","setAssetCount","expireAssets","dateStr","expirationTime","ex","fetchCurrentCart","fetchSavedCart","allSavedCarts","findCartModel","pollRemoveAssets","assetsList","checkPolling","_polling","pollUntil","intersection","removeAssets","setAssets","unarchive","unarchiveTypes","unexpireAssets","Load","SavedCarts","getSharedResources","isFiltered","getAllCarts","getUserCarts","fetchBeans","modeFilters","fetchBeansForUser","matchesFilters","unshift","addAssets","getCarts","addCurrentCart","addSearch","createNewCarts","carts","newCarts","next","getCart","getEditableCarts","hasEditableCarts","SavedCartsCollection","isFavorite","SavedCart","setCart","download","duplicateCart","cartName","fetchBean","newCount","contentCount","sharedResourceRoute","assetsArg","AssetSearchRulesCollection","CartAssetsCollection","getCartAssets","cartAssets","getRoute","fullUrl","URL","rename","Create","sc","unarchiveTypeLabels","temporary","permanent","CategoryDetailsData","byteCount","fileCount","subCategoryCount","UPGRADED_FEATURES","GOO_SETTING_KEYS","SETTING_KEYS","ATTRIBUTE_CONTEXT","DETAIL","SORT","DEFAULT_ATTRIBUTE_IDS","ENFORCE_ATTRIBUTE_IDS","hasUpdatedAttributesSystem","portal","_upgradedFeatures","_portal$goo$upgradedF","upgradedFeatures","ConstituentsPref","SEARCH_CONSTITIUENT_CLIPS_MINIMUM_USER_LEVEL","consituentClipsEnabled","CLIPS_ENABLED","canSearchConstituentClips","DataSetPref","canReplaceDataSet","MIN_USER_LEVEL","faCheckSquare","faImages","DOWNLOAD_REQUEST_ROUTES","LIST","VIEW","LIST_ROUTE","VIEW_ROUTE","DOWNLOAD_REQUEST_ACTION_LABEL","downloadRequestActionRequestsManageRouteIcon","downloadRequestActionRequestsManageRoute","DOWNLOAD_REQUESTS_MANAGE_MINIMUM_USER_LEVEL","DownloadRequestsLabel","queryClient","QueryClient","ASSET_SOURCE_TYPE","ASSETS","COLLECTION","FOLDER","SAVED_SEARCH","REVIEW_STATUS","NO_APPROVAL_REQUIRED","PENDING","COMPLETED","APPROVAL_STATUS","PENDING_APPROVAL","APPROVED","DENIED","REVIEW_STATUS_LABEL","isReady","_ready","Loading","appLoaded","creationTime","routeLabel","progressTask","checkForProgress","completed","persist","Date","shareData","Notifications","localStorageKey","maxStore","checkNotifications","parseLocalStorageModelIn","obj","NotificationsCollection","Participants","resourceId","participants","participant","addParticipant","filterByType","getParticipant","removeParticipant","PERMISSION_MATRIX_NAMES","READ","DOWNLOAD","MODIFY","DELETE","ALL","PermissionMode","Participant","Permission","mode","scope","attributeScope","userSelector","emails","userIds","categoryScope","resourceScopes","getResourceType","addSelectorItems","existingIds","newIds","hasSelectors","getDefaults","removeSelectorItems","removedIds","toggleSelectAll","selectAll","PermissionParticipant","resolveWith","PermissionsParticipants","groupsSynced","labelsUpdated","usersSynced","permissionsCollection","groups","GroupsCollection","users","UsersCollection","userSelectorAllToggled","userSelectorAddedGroups","userSelectorAddedUsers","_previousAttributes","addByPermission","permissionId","getByIds","addPermission","removeByPermission","allSelected","getLexicographicName","Permissions","permissions","uniquePerms","toRemove","selectors","toSave","existingSelectors","newGroupIds","newUserIds","removePromises","addPromises","savePromises","allPromises","PermissionResource","PermissionsCollection","permissionsUpdated","getPermissions","getResourceLabel","resourceLabels","getTitle","hasParticipants","actionUserLevel","actionMatrix","matrix","modelAllows","actionEnableTest","matrixNames","permissionTypes","principalTypes","targetTypes","typeTypes","permissionIds","permissionLabels","principalIds","principalLabels","targetIds","targetLabels","obj2","entries","entry","modes","write","delete","specialModes","targets","SearchRules","fetchFileTypes","fetchFormatFamilies","rxElement","searchRules","l","elIdx","elPart","ft","fileTypes","ff","fileFormatFamilies","sALOstrMap","b","f","g","savedSearchId","initProperties","changeOption","option","oldValue","ignoreQuirks","searchObject","getSearchObject","elementSubType1","elementSubType2","elementValue2","elementValue3","fetchSearchCriteria","userPrefKeys","preferredSortOrder","loadFromStr","small","base64","realName","smallName","SearchRule_Asset","attributeTemplate","searchTargetIsMetadata","isRange","isRangeCompatible","attrName","searchApi","elementValue1Label","dateSubTypes1_default","getSearchableAttributes","searchableSystemAttributes","SearchFacetOption","facetId","facetLabel","systemValue","systemFacetOptions","newstate","SearchFacetOptions","localeCompare","getSelected","SearchFacet","parseOptions","facetTitle","o","isCollection","SearchFacetOptionsCollection","selectedOptions","SearchFacetsSelected","facetsCollection","facetOption","selectedFacets","SearchFacets","hasSelection","SearchFacetsSelectedCollection","sOpts","SearchRules_Assets","files","assetCustomConfig","SearchFacetsCollection","strTosALO","rules","toStr","useThisSort","searchObj","stringify","SavedSearches","getSearchesForUser","savedSearches","SavedSearchesCollection","favoriteSavedSearches","savedSearchBean","CLIP_LIST_ID","SEARCH_ADVANCED_ID","SEARCH_BASIC_ID","SEARCH_CLIP_HEADER_ID","SEARCH_HEADER_ID","SAVED_SEARCH_ID","ROUTE_SAVED_SEARCH","SavedSearch","criteria","setSearch","duplicateSearch","searchName","SearchRule","searchProps","typeName","subType1Name","subType2Name","basic","clip","systemAttributes","sortFields","dimensions","relevance","folder","modificationDate","orientationTypes","notificationTypes","MANAGE","NONE","OWN","WRITE","normalize","normalObj","lvobj","normal","ruleComponent","searchType","smartLabelsEnabled","SHARE_MEDIA_SERVICE_FEEDS_MINIMUM_USER_LEVEL","SHARE_MEDIA_SERVICE_SERVICES_MINIMUM_USER_LEVEL","ShareMediaServicesPref","canMangeMediaServiceFeeds","canMangeMediaServiceServices","DownloadOptions","filterTypes","originalOption","proxyOptions","processOptions","metadataOptions","contactSheetOptions","vppOptions","getOption","hasManualRepurposeOptions","manualRepurpose","parseSelectedDownloadOptions","selectedDownloadOptions","selectedDownloadOptionModels","organizeContentsBy","embedMetadata","addOptions","metadataMapping","manualRepurposeOption","proxyDownloadOption","viewDownloadOption","proxies","proxyName","viewName","processes","processId","presetProcess","isNumeric","contactSheet","sheetOption","unset","toPick","assetListSortField","assetListSortOrder","metadataOption","setId","historical","historicalOption","setUserSelectedDownloadOptions","SharedResources","fetchForUser","hasModeFilter","selectedMode","resetModeFilter","setModeFilter","DownloadOption","family","requiresApproval","requiresJustification","engine","exportOptions","Collection","templates","getPDFTemplateOptions","lvbsToObject","setOptions","objectToLvbs","addObject","Shareable","collections","aType","SharedResource","participantCount","sendMessageBySharedResource","setFavorite","favorite","fullBean","ParticipantsCollection","getParticipants","sendMessage","toggleFavorite","defaultEngine","defaultTemplates","maxAttributes","ignoreDownloadWarningTypes","proxy","assetView","templateCustomization","preview","Groups","getGroupObjects","getGroups","getUsersForGroup","ignoreUsers","addedGroup","getUserIds","createNewGroups","existingPromises","newGroups","_group","getByName","deleteGroups","deleteMultiple","UserProfile","Users","searchUsers","searchParams","groupId","getUserObjectsForGroup","level","downloadUserData","_getUsersForCart","getUsers","importUserData","getUsersLength","importUserDataParams","fileName","defaultSearchParams","exportGroupId","exportGroup","isEqual","getUsersForCart","USER_LEVEL","NO_ACCESS","BROWSER","CONSUMER","IMPORTER","PRODUCER","MANAGER","DIRECTOR","ADMIN","Group","memberIds","autolist","setUserIds","getAutocompleteLabel","fetchUsers","resetUrl","address1","address2","city","country","groupNames","name1","name2","name3","name4","notify","organization","phone1","phone2","phone3","phone4","propertyNames","propertyValues","userSource","zip","minimumPasswordLength","registration","strictPasswordInstructions","isMe","authenticate","getGroupsForUser","getSessionKeyForUser","getUserUploadCategory","logoutUser","passwordReset","requestPasswordReset","setUserGroups","userSelfRegistration","profile","validate","u","prop","isType","userTypes","isTypeOrGreater","userLogin","loginObj","passObj","newPassword","userObj","loginAs","decodeUserToken","loginTokenOb","decodedTokenArr","atob","decodeURIComponent","strictMsg","pat","leadIn","i18nString","fullName","getPropertyObject","propName","modelAttrs","isOurAttr","chain","getCorrectedUserSelector","Props","addChildViewListener","func","addChildViewListeners","getChildViewCollection","removeChildViewListeners","addedChildViewModel","compartor","resetChildViews","removeChildView","addChildView","newChildView","mainOptions","__isView__","childCollection","isAppViewModel","_view","_viewQueue","childViewClass","childViewProto","childId","childViewOptions","_childViewOptions","childViewAttributes","draggable","_options","childModelCount","prependTo","previousChildView","after","lastAdded","noRender","renderedOnce","noShow","addChildViews","parentCollection","modelCids","breakItUp","totalLength","amount","lazyLoad","initializeLazyLoad","lazyLoadIndex","partial","additionalOpts","childrenEl","forwardOnly","cleanUpChildViews","detachChildViews","detach","getChildViewByModel","hasOwnProperty","childViewCollection","lazyLoadedForward","reachedBeginning","reachedEnd","lazyLoadItems","totalItems","moveChildViewToIndex","oldIndex","newIndex","ignoreCollection","temp","ignoreEl","getIndex","cv","prepareChildViews","_childViewFilterStr","$childSearchFilter","childViewTarget","childviewTarget","Register","lazyloader","destroyMethod","initializeMethod","pluginObj","$pluginEl","initOpts","LazyLoader","removeAllChildViews","removeChildViewListener","searchAndFilterChildren","attributeKey","minimumLength","hasResults","$target","shown","attrKey","extendFunctionality","__isChildViews__","disableChildViews","isChildViews","noProxy","showLoaded","FormErrorListItemView","gotoInput","FormErrorListView","loadingClassObjects","LVBHandler","text","Validator","regexp","$field","insensitive","getFieldValue","lookup","html5Attributes","completion","validatorName","deferred","extra","numberAttr","numLength","getLocale","getDynamicOption","originalStringLengthValidate","Framework","Bootstrap","disableSubmitButtons","fields","getFieldElements","row","eq","ns","updateStatus","blurred","cacheFormValues","_formValues","formValues","cacheQueries","elName","$submit","submitReady","enable","disable","failure","isModel","submitting","rejectWith","fieldAdded","plugin","addField","revalidateFieldOnAdd","revalidateField","fieldMutating","_cacheFields","removeField","fieldMutated","fieldRemoved","fieldValidationFailure","fvf","fieldValidationSuccess","errorCache","submitted","flushCachedFormValues","formValidationFailure","getValidationErrors","formValidationSuccess","$idx","topLevelName","reduce","memo","arrayToCsv","checkedRadio","checkedBoxes","validation","GetInstance","getInvalidFields","hideField","$form","plugins","$input","$formGroup","Invoke","nxIgnore","inputChanged","changeEvent","jQuery","Event","nxIgnores","keydown","keyCode","which","prepareForm","disableCache","renderForm","emptyCount","inputCount","$element","isAppend","restoreCachedFormValue","tooltip","$validationErrors","errorCacheView","inputName","setForm","setFormValidation","$submitButton","showField","nxUnignore","confirmMessage","cancelEventStr","confirmedEventStr","confirmedMethod","cancelledMethod","confirmViewOpts","__isModel__","__isCollection__","hideOnSubmit","resetOnSubmit","removeOnSubmit","toggleField","validateField","datepickerChanged","select2changed","__isForm__","isForm","resetOnShow","validatorFields","CoreCollection","excluded","framework","form","dispatcherSubmitEvent","inquiry","q","sh","stringHandler","INBHandler","filterAutocompleteResults","query","reply","getCompletion","tags","detectAutocomplete","autos","mediaServicesEnabled","mediaServices","share","brightCove","youTube","collectionNotEmpty","getViewCollection","canUseGridEditor","allowsDelete","collectionl","categoryAndAssetCanEdit","current","checkIsMobile","isMenu","__isMenu__","flatten","toActions","actionName","exports","exp","chars","random","processRelativeTime","number","withoutSuffix","isFuture","dd","M","MM","yy","defineLocale","months","monthsShort","monthsParseExact","weekdays","weekdaysShort","weekdaysMin","weekdaysParseExact","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","sameElse","nextDay","nextWeek","lastDay","lastWeek","relativeTime","future","past","ss","mm","hh","ww","dayOfMonthOrdinalParse","ordinal","week","dow","doy","factory","monthsShortDot","monthsParse","monthsRegex","month","monthsShortRegex","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","hours","invalidDate","period","standalone","isFormat","llll","meridiemParse","meridiemHour","meridiem","isLower","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","ll","lll","isPM","webpackContext","req","webpackContextResolve","__webpack_require__","createRoot","hydrateRoot","__t","__p","__j","print","tagPanelGrid","columns","raf","attachEvent","stylesCreated","requestFrame","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","fn","cancelFrame","cancelAnimationFrame","mozCancelAnimationFrame","webkitCancelAnimationFrame","_resetTriggers","triggers","__resizeTriggers__","expand","firstElementChild","contract","lastElementChild","expandChild","scrollLeft","scrollWidth","scrollHeight","scrollListener","__resizeRAF__","__resizeLast__","checkTriggers","__resizeListeners__","animation","keyframeprefix","animationstartevent","domPrefixes","startEvents","elm","animationKeyframes","animationStyle","addResizeListener","position","getElementsByTagName","styleSheet","cssText","createTextNode","createStyles","removeResizeListener","detachEvent","Base64","_keyStr","encode","chr1","chr2","chr3","enc1","enc2","enc3","enc4","output","_utf8_encode","charCodeAt","decode","String","fromCharCode","_utf8_decode","string","utftext","c2","c3","Constructor","getPosition","isBody","hasBoundingClientRect","getBoundingClientRect","svgRelated","boundingClientRect","scroll","documentElement","outerWidth","outerHeight","EvEmitter","proto","eventName","listener","_events","listeners","onceEvents","_onceEvents","emitEvent","onceListeners","isOnce","ImagesLoaded","onAlways","ary","makeArray","getImages","jqDeferred","check","images","addElementImages","nodeName","addImage","background","addElementBackgroundImages","nodeType","elementNodeTypes","childImgs","child","LoadingImage","Background","reURL","exec","backgroundImage","addBackground","loadingImage","_this","onProgress","image","progressedCount","hasAnyBroken","isLoaded","debug","log","isComplete","jqMethod","getIsImageComplete","proxyImage","handleEvent","method","onload","unbindEvents","onerror","makeJQueryPlugin","imagesLoaded","callback","infiniteQueryBehavior","onFetch","fetchFn","_context$fetchOptions","_context$fetchOptions2","_context$fetchOptions3","_context$fetchOptions4","_context$state$data","_context$state$data2","refetchPage","fetchOptions","meta","fetchMore","pageParam","isFetchingNextPage","isFetchingPreviousPage","oldPages","oldPageParams","pageParams","newPageParams","queryFn","buildNewPages","param","previous","fetchPage","manual","queryFnContext","queryKey","object","defineProperty","enumerable","_context$signal","_context$signal2","signal","aborted","queryFnResult","getNextPageParam","getPreviousPageParam","hasNextPage","nextPageParam","hasPreviousPage","previousPageParam","defaultLogger","Mutation","config","defaultOptions","mutationId","mutationCache","observers","failureCount","failureReason","isPaused","variables","updateCacheTime","cacheTime","scheduleGc","setState","dispatch","addObserver","observer","clearGcTimeout","mutation","removeObserver","optionalRemove","_this$retryer$continu","_this$retryer","retryer","continue","execute","executeMutation","_this$options$retry","mutationFn","onFail","onPause","onContinue","retry","retryDelay","networkMode","restored","_this$mutationCache$c3","_this$mutationCache$c4","_this$options$onSucce","_this$options2","_this$options$onSettl","_this$options3","_this$mutationCache$c","_this$mutationCache$c2","_this$options$onMutat","_this$options","onMutate","onSuccess","onSettled","_this$mutationCache$c5","_this$mutationCache$c6","_this$options$onError","_this$options4","_this$options$onSettl2","_this$options5","onError","reducer","onMutationUpdate","getDefaultState","Query","abortSignalConsumed","cache","queryHash","initialState","initialData","hasData","initialDataUpdatedAt","dataUpdateCount","dataUpdatedAt","errorUpdateCount","errorUpdatedAt","fetchFailureCount","fetchFailureReason","fetchMeta","isInvalidated","fetchStatus","setData","newData","updatedAt","setStateOptions","catch","isActive","isDisabled","getObserversCount","isStale","getCurrentResult","isStaleByTime","staleTime","onFocus","_this$retryer2","shouldFetchOnWindowFocus","cancelRefetch","onOnline","_this$retryer3","shouldFetchOnReconnect","revert","cancelRetry","_this$options$behavio","_this$retryer4","continueRetry","abortController","addSignalProperty","behavior","revertState","_this$cache$config$on","_this$cache$config","isFetchingOptimistic","_this$cache$config$on2","_this$cache$config2","_action$meta","_action$dataUpdatedAt","notifyManager","onQueryUpdate","QueryCache","queries","queriesMap","build","client","_options$queryHash","getLogger","defaultQueryOptions","getQueryDefaults","queryInMap","clear","getAll","arg1","arg2","filters","exact","findAll","MutationCache","mutations","defaultMutationOptions","mutationKey","getMutationDefaults","resumePausedMutations","_this$resuming","resuming","pausedMutations","queryCache","queryDefaults","mutationDefaults","mountCount","mount","unsubscribeFocus","focusManager","unsubscribeOnline","onlineManager","unmount","_this$unsubscribeFocu","_this$unsubscribeOnli","isFetching","isMutating","fetching","getQueryData","_this$queryCache$find","ensureQueryData","arg3","parsedOptions","cachedData","fetchQuery","getQueriesData","queryKeyOrFilters","getQueryCache","setQueryData","updater","prevData","defaultedOptions","setQueriesData","getQueryState","_this$queryCache$find2","removeQueries","resetQueries","refetchFilters","refetchQueries","cancelQueries","cancelOptions","invalidateQueries","_ref","_filters$refetchType","refetchType","_options$cancelRefetc","throwOnError","prefetchQuery","fetchInfiniteQuery","prefetchInfiniteQuery","getMutationCache","getDefaultOptions","setDefaultOptions","setQueryDefaults","firstMatchingDefaults","setMutationDefaults","_defaulted","refetchOnReconnect","useErrorBoundary","suspense","Removable","gcTimeout","newCacheTime"],"sourceRoot":""}