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7G,EAAM3N,MAChC,GACHa,GAAAa,EAAAA,EAAAA,GAAAjB,EAAAkB,UAAA,iBA9DIC,EAAAA,SAAO,CAAAC,cAAA,EAAAC,YAAA,EAAAC,UAAA,EAAAC,YAAA,kBAAiB,CAAK,KAAAN,EAAAA,EAAAA,GAAAjB,EAAAkB,UAAA,iBAK7BM,EAAAA,QAAMC,OAAAC,yBAAA1B,EAAAkB,UAAA,iBAAAlB,EAAAkB,YAAAD,EAAAA,EAAAA,GAAAjB,EAAAkB,UAAA,sBASNM,EAAAA,QAAMC,OAAAC,yBAAA1B,EAAAkB,UAAA,sBAAAlB,EAAAkB,YAAAD,EAAAA,EAAAA,GAAAjB,EAAAkB,UAAA,aAUNM,EAAAA,QAAMC,OAAAC,yBAAA1B,EAAAkB,UAAA,aAAAlB,EAAAkB,YAAAD,EAAAA,EAAAA,GAAAjB,EAAAkB,UAAA,uBAiBNM,EAAAA,QAAMC,OAAAC,yBAAA1B,EAAAkB,UAAA,uBAAAlB,EAAAkB,YAAAD,EAAAA,EAAAA,GAAAjB,EAAAkB,UAAA,cAUNM,EAAAA,QAAMC,OAAAC,yBAAA1B,EAAAkB,UAAA,cAAAlB,EAAAkB,WAAAlB,IAtD4B+G,EAAAA,EAAAA,sBAAAC,EAAAqM,E","sources":["./components/action-sheets/enterprise/locations/location-selection/helpers/selection-items.ts","./components/action-sheets/enterprise/locations/location-selection/helpers/filter-objects.ts","./components/enterprise/location-selection/selected-item-pills/index.hbs","./components/enterprise/location-selection/selected-item-pills/index.ts","./components/enterprise/location-selection/location-selection-tree-item/index.hbs","./components/enterprise/location-selection/location-selection-tree-item/index.ts","./components/enterprise/location-selection/location-selection-tree/index.hbs","./components/enterprise/location-selection/location-selection-tree/index.ts","./components/enterprise/location-selection/simple-location-filtering/index.hbs","./components/enterprise/location-selection/simple-location-filtering/index.ts","./components/action-sheets/enterprise/locations/location-selection/index.hbs","./components/action-sheets/enterprise/locations/location-selection/index.ts","./components/ui/colored-button/index.hbs","./components/ui/colored-button/index.ts","./components/ui/icon-and-color-picker/index.hbs","./components/ui/icon-and-color-picker/index.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport { action, computed, set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\nimport CheckboxTreeItem from '@adc/ui-components/utils/checkbox-tree-item';\nimport { SELECTED } from '@adc/ui-components/utils/checkbox-tree-item';\n\nimport type { BinaryListItem } from '@adc/ui-components/components/simple-binary/list';\nimport type { SafeString } from '@ember/template';\n\nexport type SelectedItemPill = {\n icon: string;\n name: string | SafeString;\n value: string;\n unitId?: string;\n};\n\nexport type SelectionResult = {\n selectedIds: string[];\n selectingAll?: boolean;\n isParentGroup?: boolean;\n};\n\nexport type SystemItemProps = {\n id: string;\n unitId: string;\n};\n\nexport const GROUP_ID_PREFIX = 'group-';\n\n/**\n * Middle truncates the name of an item based on the passed in limit. If the current language is RTL,\n * truncates the string at the end.\n */\nexport function truncateItemName(name: string, limit: number, isRtl: boolean): string {\n if (name.length > limit + 6) {\n return isRtl ? `${name.slice(0, limit)}...` : `${name.slice(0, limit - 1)}...${name.slice(-3)}`;\n }\n\n return name;\n}\n\n/**\n * Used in the location selection action sheet when only locations are selectable.\n */\nexport class SubGroupItem {\n @tracked value;\n @tracked name;\n @tracked systems;\n @tracked excessSubItemsCount;\n @tracked isExpanded = true;\n @tracked isSelectingAll = true;\n\n constructor(props: {\n value: string;\n name: string;\n systems: BinaryListItem[];\n excessSubItemsCount: number;\n }) {\n this.value = props.value;\n this.name = props.name;\n this.systems = props.systems;\n this.excessSubItemsCount = props.excessSubItemsCount;\n }\n\n @action toggleGroupExpansion() {\n this.isExpanded = !this.isExpanded;\n }\n\n @gt('systems.length', 1)\n declare showSelectAll: boolean;\n}\n\n/**\n * Used in the location selection action sheet when groups and locations are selectable.\n */\nexport class LocationOrGroupSelectionTreeItem extends CheckboxTreeItem {\n @computed('state')\n get isFullySelected() {\n return this.state === SELECTED;\n }\n\n get isPartiallySelected(): boolean {\n return false;\n }\n\n @computed('state')\n get internalState(): number {\n return this.state;\n }\n set internalState(val: number) {\n set(this, 'state', val);\n }\n\n /**\n * Overriding the type of CheckboxTreeItem's subitems to be LocationOrGroupSelectionTreeItems.\n */\n @tracked\n subitems: LocationOrGroupSelectionTreeItem[] = [];\n\n @computed('isCollapsed', 'subitems.length')\n get showSubitems() {\n return this.subitems.length && !this.isCollapsed;\n }\n\n /**\n * We only have to check the first subitem to determine if the subitems are groups\n * because we can't have subitems of mixed types (both locations and groups).\n */\n @computed('subitems.@each.value')\n get areSubitemsGroups() {\n return !!this.subitems[0]?.value.startsWith(GROUP_ID_PREFIX);\n }\n\n /**\n * Determines the messages to be shown for excess subitems or the button to select all subitems, depending on the subitem type.\n */\n @computed('areSubitemsGroups')\n get locationSelectionResourceKeys() {\n const locationSelectionPath = 'components.action-sheets.enterprise.locations.location-selection',\n subItemType = this.areSubitemsGroups ? 'Groups' : 'Locations';\n\n return {\n moreSubitems: `${locationSelectionPath}.more${subItemType}Message`,\n selectAllButton: `${locationSelectionPath}.select${subItemType}`\n };\n }\n\n /**\n * Whether the button showing 'Select All Groups' or 'Select All Locations' should be shown under this item.\n */\n @gt('subitems.length', 1)\n declare showSelectAllSubitems: boolean;\n\n /**\n * Whether the 'Select All Groups' or 'Select All Locations' button should select or deselect those items.\n */\n @tracked isSelectingAll = true;\n}\n","import { set } from '@ember/object';\nimport AvailableSystemItemsFilteringEnum from 'customer-site/enums/AvailableSystemItemsFilteringEnum';\nimport { SELECTED } from '@adc/ui-components/utils/checkbox-tree-item';\nimport { GROUP_ID_PREFIX } from './selection-items';\n\nimport type AvailableSystemItem from 'customer-site/models/systems/available-system-item';\nimport type LocationSelectionActionSheet from '../index';\nimport type { SelectedItemPill } from './selection-items';\n\nexport function createFilterType(filterType: AvailableSystemItemsFilteringEnum) {\n switch (filterType) {\n case AvailableSystemItemsFilteringEnum.Reports:\n return new ReportsFilterType();\n case AvailableSystemItemsFilteringEnum.APUMUsers:\n return new APUMUsersFilterType();\n case AvailableSystemItemsFilteringEnum.AccessPoints:\n return new AccessPointsFilterType();\n default:\n return new BaseLocationSelectionFilterType();\n }\n}\n\n/**\n * Gets the appropriate ids corresponding to the filter type being used.\n */\nexport class BaseLocationSelectionFilterType {\n filterType: AvailableSystemItemsFilteringEnum = AvailableSystemItemsFilteringEnum.AllItems;\n\n getIdForSystemItem(item: AvailableSystemItem): string {\n return item.id;\n }\n\n getIdForSelectionItem(item: SelectedItemPill): string {\n return item.value;\n }\n\n loadForFirstTime(): void {}\n}\n\nexport class ReportsFilterType extends BaseLocationSelectionFilterType {\n filterType: AvailableSystemItemsFilteringEnum = AvailableSystemItemsFilteringEnum.Reports;\n\n getIdForSystemItem(item: AvailableSystemItem): string {\n return item.id.startsWith(GROUP_ID_PREFIX) ? item.id : item.unitId;\n }\n\n getIdForSelectionItem(item: SelectedItemPill): string {\n return item.unitId ?? '';\n }\n}\n\nexport class APUMUsersFilterType extends BaseLocationSelectionFilterType {\n filterType: AvailableSystemItemsFilteringEnum = AvailableSystemItemsFilteringEnum.APUMUsers;\n\n // Start with the selected system group selected\n loadForFirstTime(this: LocationSelectionActionSheet): void {\n if (this.checkboxTreeItems?.length) {\n const { value, name, icon } = this.checkboxTreeItems[0];\n set(this.checkboxTreeItems[0], 'state', SELECTED);\n this.addSelectedItem(value, name, icon);\n this.initiallySelectedItemIds = [this.checkboxTreeItems[0].value];\n }\n }\n}\n\nexport class AccessPointsFilterType extends BaseLocationSelectionFilterType {\n filterType: AvailableSystemItemsFilteringEnum = AvailableSystemItemsFilteringEnum.AccessPoints;\n\n // Start with every item selected unless we have specifically passed in 'defaultToNone'\n loadForFirstTime(this: LocationSelectionActionSheet): void {\n if (!this.args.properties.defaultToNone && !this.args.properties.alreadySelectedIds?.length) {\n this.selectAll(false);\n }\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{#each this.selectedItemPills as |pill|}}\\n
\\n \\n

{{pill.name}}

\\n \\n
\\n {{/each}}\\n {{#if this.excessPillsCount}}\\n

{{tc this \\'morePillsMessage\\' count=this.excessPillsCount}}

\\n {{/if}}\\n
\\n\",{ moduleName: \"customer-site/components/enterprise/location-selection/selected-item-pills/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { computed } from '@ember/object';\nimport { inject as service } from '@ember/service';\nimport { truncateItemName } from 'customer-site/components/action-sheets/enterprise/locations/location-selection/helpers/selection-items';\nimport { intlPath } from '@adc/i18n/path';\n\nimport './_style.scss';\nimport type LocaleService from '@adc/app-infrastructure/services/locale';\nimport type ADCIntlService from '@adc/i18n/services/adc-intl';\nimport type { SelectedItemPill } from 'customer-site/components/action-sheets/enterprise/locations/location-selection/helpers/selection-items';\n\nexport interface SelectedItemPillsSignature {\n Element: HTMLDivElement;\n Args: {\n selectedItems: SelectedItemPill[];\n pillsLimit: number;\n closePill: (value: string) => void;\n };\n}\n\nconst NAME_LENGTH_LIMIT = 10;\n\n@intlPath({ path: 'enterprise/location-selection/selected-item-pills' })\nexport default class SelectedItemPills extends Component {\n @service declare intl: ADCIntlService;\n @service declare locale: LocaleService;\n\n /**\n * The pills to be shown, limited by the pillsLimit arg.\n */\n @computed('args.{selectedItems,pillsLimit}', 'locale.isRtl')\n get selectedItemPills(): SelectedItemPill[] {\n const { selectedItems, pillsLimit } = this.args,\n pills = selectedItems.slice(0, pillsLimit);\n\n pills.forEach((pill) => {\n pill.name = truncateItemName(pill.name.toString(), NAME_LENGTH_LIMIT, this.locale.isRtl);\n });\n\n return pills;\n }\n\n /**\n * The number of pills exceeding the limit which won't be shown.\n */\n @computed('args.{selectedItems.length,pillsLimit}')\n get excessPillsCount(): number {\n const { selectedItems, pillsLimit } = this.args;\n return Math.max(selectedItems.length - pillsLimit, 0);\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Enterprise::LocationSelection::SelectedItemPills': typeof SelectedItemPills;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n\\n \\n \\n\\n {{#if @item.isCollapsible}}\\n \\n {{/if}}\\n \\n\\n {{#if @item.showSubitems}}\\n {{#if @item.showSelectAllSubitems}}\\n \\n {{/if}}\\n \\n {{#if @item.excessSubItemsCount}}\\n

{{t @item.locationSelectionResourceKeys.moreSubitems count=@item.excessSubItemsCount}}

\\n {{/if}}\\n {{/if}}\\n\\n\",{ moduleName: \"customer-site/components/enterprise/location-selection/location-selection-tree-item/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { action, set } from '@ember/object';\nimport { SELECTED, UNSELECTED } from '@adc/ui-components/utils/checkbox-tree-item';\n\nimport './_style.scss';\nimport type { LocationOrGroupSelectionTreeItem } from 'customer-site/components/action-sheets/enterprise/locations/location-selection/helpers/selection-items';\n\ninterface LocationSelectionTreeItemSignature {\n Element: HTMLLIElement;\n Args: {\n item: LocationOrGroupSelectionTreeItem;\n itemChanged: (item: LocationOrGroupSelectionTreeItem) => void;\n selectAllSubitems: (item: LocationOrGroupSelectionTreeItem) => void;\n isListItemFocusable: boolean;\n };\n}\n\nexport default class LocationSelectionTreeItem extends Component {\n @action toggleSubItemsVisibility(): void {\n const { item } = this.args;\n set(item, 'isCollapsed', !item.isCollapsed);\n }\n\n @action itemClicked(item: LocationOrGroupSelectionTreeItem, evt: Event & { target: HTMLInputElement }): void {\n set(item, 'internalState', evt.target.checked ? SELECTED : UNSELECTED);\n this.args.itemChanged(item);\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Enterprise::LocationSelection::LocationSelectionTreeItem': typeof LocationSelectionTreeItem;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n\\n {{#each @items as |item|}}\\n \\n {{/each}}\\n\\n\\n\",{ moduleName: \"customer-site/components/enterprise/location-selection/location-selection-tree/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport './_style.scss';\nimport type { LocationOrGroupSelectionTreeItem } from 'customer-site/components/action-sheets/enterprise/locations/location-selection/helpers/selection-items';\n\ninterface LocationSelectionTreeSignature {\n Element: HTMLUListElement;\n Args: {\n items: LocationOrGroupSelectionTreeItem[];\n itemChanged: (item: LocationOrGroupSelectionTreeItem) => void;\n selectAllSubitems: (item: LocationOrGroupSelectionTreeItem) => void;\n areItemsFocusable: boolean;\n };\n}\n\nconst LocationSelectionTree = templateOnlyComponent();\n\nexport default LocationSelectionTree;\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Enterprise::LocationSelection::LocationSelectionTree': typeof LocationSelectionTree;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{#each @subGroupItems as |group|}}\\n
\\n

{{group.name}}

\\n \\n
\\n
\\n {{#if group.isExpanded}}\\n {{#if group.showSelectAll}}\\n \\n {{/if}}\\n \\n {{#if group.excessSubItemsCount}}\\n

{{t \\'components.action-sheets.enterprise.locations.location-selection.moreLocationsMessage\\' count=group.excessSubItemsCount}}

\\n {{/if}}\\n {{/if}}\\n
\\n {{/each}}\\n \\n
\",{ moduleName: \"customer-site/components/enterprise/location-selection/simple-location-filtering/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport './_style.scss';\nimport type { BinaryListItem } from '@adc/ui-components/components/simple-binary/list';\nimport type {\n SubGroupItem,\n SystemItemProps\n} from 'customer-site/components/action-sheets/enterprise/locations/location-selection/helpers/selection-items';\n\ninterface SimpleLocationFilteringSignature {\n Args: {\n systemItems: BinaryListItem[];\n subGroupItems: SubGroupItem[];\n areItemsFocusable?: boolean;\n subGroupItemSelectAll: (item: unknown) => void;\n itemChanged: (item: unknown) => void;\n };\n}\n\nconst SimpleLocationFiltering = templateOnlyComponent();\n\nexport default SimpleLocationFiltering;\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Enterprise::LocationSelection::SimpleLocationFiltering': typeof SimpleLocationFiltering;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"\\n <:default>\\n {{#if this.displaySearchMessage}}\\n \\n {{/if}}\\n {{#if this.selectedItems.length}}\\n \\n {{/if}}\\n
\\n \\n \\n
\\n
\\n {{#if (and @properties.includeGroups this.checkboxTreeItems.length)}}\\n \\n {{else if (or this.subGroupItems.length this.systemItems.length)}}\\n \\n {{else}}\\n

{{tc this \\'noResultsFound\\'}}

\\n {{/if}}\\n\\n {{#if this.excessItemsCount}}\\n

{{this.moreItemsMessage}}

\\n {{/if}}\\n
\\n \\n\\n <:footer>\\n
\\n {{#each this.buttons as |btn|}}\\n \\n {{/each}}\\n
\\n \\n\\n\",{ moduleName: \"customer-site/components/action-sheets/enterprise/locations/location-selection/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { activateFocusTrap } from '@adc/ember-utils/utils/a11y';\nimport { action, computed, set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\nimport { inject as service } from '@ember/service';\nimport { task } from 'ember-concurrency';\nimport AvailableSystemItemsFilteringEnum from 'customer-site/enums/AvailableSystemItemsFilteringEnum';\nimport { createMark, createMeasurement, getMeasurements } from '@adc/app-infrastructure/services/performance-monitor';\nimport { intlPath } from '@adc/i18n/path';\nimport { BinaryListItem } from '@adc/ui-components/components/simple-binary/list';\nimport { SELECTED, UNSELECTED } from '@adc/ui-components/utils/checkbox-tree-item';\nimport { createFilterType } from './helpers/filter-objects';\nimport {\n LocationOrGroupSelectionTreeItem,\n SubGroupItem,\n GROUP_ID_PREFIX,\n truncateItemName\n} from './helpers/selection-items';\n\nimport type { ActionSheetButton } from '@adc/ui-components/components/action-sheet';\nimport type { BaseLocationSelectionFilterType } from './helpers/filter-objects';\nimport './_style.scss';\nimport type { Registry as ServiceRegistry } from '@ember/service';\nimport type { SafeString } from '@ember/template';\nimport type AvailableSystemItem from 'customer-site/models/systems/available-system-item';\nimport type { SystemItemProps, SelectedItemPill, SelectionResult } from './helpers/selection-items';\n\nexport interface LocationSelectionActionSheetSignature {\n Args: {\n isActive: boolean;\n close: (params?: { selectedIds: string[]; selectingAll?: boolean }) => void;\n properties: LocationSelectionActionSheetProperties;\n };\n}\n\nexport interface LocationSelectionActionSheetProperties {\n /** Whether the groups/subgroups will be selectable */\n includeGroups: boolean;\n /** Filter type for the available system items, depending on where the action sheet is being used. */\n filterType: AvailableSystemItemsFilteringEnum;\n reportId?: string;\n reportType?: number;\n alreadySelectedIds?: string[];\n /** Used for defaulting to selecting no locations. Only used when filterType is AccessPoints. */\n defaultToNone?: boolean;\n}\n\nconst GROUPED_LOCATIONS_LIMIT = 20;\nconst TOTAL_GROUPS_LIMIT = 20;\nconst TOTAL_LOCATIONS_LIMIT = 400;\n\n// Mark Names\nconst SELECT_ALL_START = 'LocationSelectionSelectAllStart';\nconst SELECT_ALL_END = 'LocationSelectionSelectAllEnd';\nconst LOAD_START = 'LocationSelectionLoadStart';\nconst LOAD_END = 'LocationSelectionLoadEnd';\n\n// Measurement Names\nconst SELECT_ALL_TIME = 'SelectAllTime';\nconst LOAD_TIME = 'LoadTime';\n\n@intlPath({ path: 'action-sheets/enterprise/locations/location-selection' })\nexport default class LocationSelectionActionSheet extends Component {\n @service declare ajax: ServiceRegistry['ajax'];\n @service declare contextManager: ServiceRegistry['context-manager'];\n @service declare intl: ServiceRegistry['adc-intl'];\n @service declare locale: ServiceRegistry['locale'];\n @service declare media: ADCResponsiveMediaService;\n @service declare store: ServiceRegistry['store'];\n @service declare identityManager: ServiceRegistry['identity-manager'];\n\n constructor(owner: unknown, props: LocationSelectionActionSheetSignature['Args']) {\n super(owner, props);\n\n this.filterTypeObject = createFilterType(this.filterType);\n this.loadItems.perform();\n }\n\n @computed('clearSelectionAndCloseActionSheet', 'saveSelectionAndCloseActionSheet')\n get buttons(): ActionSheetButton[] {\n return [\n {\n text: this.intl.t('generic.cancel'),\n fn: this.clearSelectionAndCloseActionSheet\n },\n {\n text: this.intl.t('generic.continue'),\n fn: this.saveSelectionAndCloseActionSheet,\n color: 'primary'\n }\n ];\n }\n\n @alias('args.properties.includeGroups')\n declare includeGroups: boolean;\n\n @alias('args.properties.filterType')\n declare filterType: AvailableSystemItemsFilteringEnum;\n\n /**\n * Gets the correct ids for the action sheet items depending on the filter type.\n */\n @tracked filterTypeObject: BaseLocationSelectionFilterType;\n\n /**\n * Items created when groups are also selectable in the action sheet.\n */\n @tracked checkboxTreeItems: LocationOrGroupSelectionTreeItem[] = [];\n\n /**\n * Items created when groups are not selectable in the action sheet,\n * subgroups of the selected system group and their nested systems.\n */\n @tracked subGroupItems: SubGroupItem[] = [];\n\n /**\n * Items created when groups are not selectable in the action sheet,\n * systems that are not nested within subgroups of the selected system group.\n */\n @tracked systemItems: BinaryListItem[] = [];\n\n /**\n * Whether the info alert telling the user to search again should show up--\n * will be true if any of the items in the action sheet have been limited.\n */\n @tracked displaySearchMessage = false;\n\n /**\n * Is the focus trap active.\n */\n @tracked isTrapFocusActive = false;\n\n /**\n * The number of items that were limited at the top level of the selection items.\n */\n @tracked excessItemsCount = 0;\n\n @tracked searchString = '';\n\n @tracked availableSystemItems: AvailableSystemItem[] = [];\n\n /**\n * The full set of available system items. Used to check if selecting all when saving in case\n * the 'continue' button is hit while searching on a subset of availableSystemItems.\n */\n @tracked allAvailableSystemItems: AvailableSystemItem[] = [];\n\n /**\n * The ids that will be reverted to if the user hits 'cancel'.\n * For reports, these are unitIds. For other cases like APUM they are system group or customer ids.\n */\n @tracked initiallySelectedItemIds: string[] = [];\n\n @tracked selectedItems: SelectedItemPill[] = [];\n\n /**\n * Whether the select all button should select all or clear.\n */\n @computed('selectedItems.length')\n get areAnyItemsSelected(): boolean {\n return this.selectedItems.length > 0;\n }\n\n /**\n * The number of pills to be shown at the top of the action sheet, after which point a\n * '+ more' message is shown. Varies depending on screen size.\n */\n @computed('media.isMobile')\n get pillsLimit(): number {\n return this.media.isMobile ? 3 : 9;\n }\n\n /**\n * Used to limit the names of groups or locations.\n */\n @computed('media.isMobile')\n get nameLengthLimit(): number {\n return this.media.isMobile ? 25 : 40;\n }\n\n /**\n * Message displayed when there are some groups/locations not shown in the action sheet,\n * prompting the user to search for them.\n */\n @computed('includeGroups')\n get searchMessage(): string {\n return this.intl.tc(this, this.includeGroups ? 'searchMessageGroups' : 'searchMessageLocations');\n }\n\n /**\n * Updates trap focus.\n */\n @action updateTrapFocusHandler(state: boolean): void {\n this.isTrapFocusActive = state;\n }\n\n /**\n * Called when a keyup event happens on the list of groups and/or locations.\n */\n @action activateFocusTrap(event: KeyboardEvent & { target: HTMLDivElement }): void {\n const { target } = event;\n\n activateFocusTrap(event, target, 'location-selection-body', this.updateTrapFocusHandler, () => target);\n }\n\n /**\n * Focus trap options.\n */\n focusTrapOptions = {\n returnFocusOnDeactivate: true,\n clickOutsideDeactivates: true,\n escapeDeactivates: true\n };\n\n /**\n * Triggered when hitting the 'x' on a pill at the top of the action sheet or when clearing the selected items.\n * Removes the item from the selectedItems and unchecks the corresponding checkbox in the action sheet itself, if shown.\n */\n @action removeItem(value: string): void {\n this.removeSelectedItem(value);\n if (this.includeGroups) {\n this.changeTreeItemState(this.checkboxTreeItems, value, UNSELECTED);\n } else {\n this.changeSubGroupOrSystemItemState(value, false);\n }\n }\n\n /**\n * Loops through the subGroupItems and systemItems to update the state of the item with the given id.\n */\n @action\n private changeSubGroupOrSystemItemState(id: string, state: boolean): void {\n for (const subGroup of this.subGroupItems) {\n if (this.changeSystemItemsState(subGroup.systems, id, state)) {\n return;\n }\n }\n\n this.changeSystemItemsState(this.systemItems, id, state);\n }\n\n /**\n * Sets the state for the BinaryListItem with the given id.\n */\n private changeSystemItemsState(systems: BinaryListItem[], id: string, state: boolean): boolean {\n for (const system of systems) {\n if (system.props.id === id) {\n set(system, 'state', state);\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Finds the tree item for the given id and updates its state.\n */\n @action changeTreeItemState(items: LocationOrGroupSelectionTreeItem[], id: string, treeItemState: number): boolean {\n for (const item of items) {\n if (item.value === id) {\n set(item, 'state', treeItemState);\n return true;\n }\n\n if (this.changeTreeItemState(item.subitems, id, treeItemState)) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Which resource to use for the top-level excess items message.\n */\n @computed('availableSystemItems', 'subGroupItems.length', 'excessItemsCount')\n get moreItemsMessage(): string {\n const resource = this.availableSystemItems[0]?.isGroup ? 'moreGroupsMessage' : 'moreLocationsMessage';\n\n return this.intl.tc(this, resource, { count: this.excessItemsCount });\n }\n\n /**\n * Called when clicking a tree item to change its state.\n */\n @action treeItemChanged(item: LocationOrGroupSelectionTreeItem): void {\n this.updateSelectedItems(item.value, item.name, item.state === SELECTED, item.icon);\n }\n\n /**\n * Called when a BinaryListItem's state is changed\n */\n @action individualItemChanged(item: BinaryListItem): void {\n const {\n label,\n state,\n icon,\n props: { id, unitId }\n } = item;\n this.updateSelectedItems(id, label, !!state, icon, unitId);\n }\n\n /**\n * Selects or deselects the list of tree items and their subitems.\n */\n @action\n private setStatesOfTreeItems(items: LocationOrGroupSelectionTreeItem[], state: number): void {\n items.forEach((item) => {\n set(item, 'state', state);\n\n if (item.subitems) {\n this.setStatesOfTreeItems(item.subitems, state);\n }\n });\n }\n\n /**\n * Sets the states of all the system items when selecting or deselecting all.\n */\n @action\n private setStatesOfSystemItems(systemItems: BinaryListItem[], state: boolean): void {\n systemItems.forEach((system) => {\n set(system, 'state', state);\n });\n }\n\n /**\n * Selects or deselects all the tree items, even the ones limited out of the action sheet.\n */\n private addOrRemoveAllTreeItems(items: AvailableSystemItem[], isAdding: boolean): void {\n items.forEach((item) => {\n const { id, name, icon, unitId, subItems } = item;\n this.updateSelectedItems(id, name, isAdding, icon, unitId);\n // DO NOT COPY THIS, PLEASE IMPLEMENT THE SUGGESTION AND TEST.\n // @ts-expect-error This should be: `this.addOrRemoveAllTreeItems(subItems.toArray(), isAdding);`\n this.addOrRemoveAllTreeItems(subItems, isAdding);\n });\n }\n\n /**\n * Selects or deselects all the system items when only locations are selectable,\n * even the ones limited out of the action sheet.\n */\n private addOrRemoveAllSystemItems(items: AvailableSystemItem[], isAdding: boolean): void {\n items.forEach((item) => {\n item.id.startsWith(GROUP_ID_PREFIX)\n ? // DO NOT COPY THIS, PLEASE IMPLEMENT THE SUGGESTION AND TEST.\n // @ts-expect-error This should be: `this.addOrRemoveAllSystemItems(item.subItems.toArray(), isAdding)`\n this.addOrRemoveAllSystemItems(item.subItems, isAdding)\n : this.updateSelectedItems(item.id, item.name, isAdding, item.icon, item.unitId);\n });\n }\n\n /**\n * Selects or deselects all items in the action sheet.\n */\n @action\n selectAll(reportMetric = true): void {\n if (reportMetric) {\n createMark(SELECT_ALL_START);\n }\n\n const selectingAll = !this.areAnyItemsSelected;\n if (this.includeGroups) {\n this.setStatesOfTreeItems(this.checkboxTreeItems, selectingAll ? SELECTED : UNSELECTED);\n this.addOrRemoveAllTreeItems(this.availableSystemItems, selectingAll);\n } else {\n this.setStatesOfSystemItems(this.systemItems, selectingAll);\n this.subGroupItems.forEach((item) => this.setStatesOfSystemItems(item.systems, selectingAll));\n this.addOrRemoveAllSystemItems(this.availableSystemItems, selectingAll);\n }\n\n if (reportMetric) {\n createMark(SELECT_ALL_END);\n this.sendPerformanceMetric(SELECT_ALL_TIME, SELECT_ALL_START, SELECT_ALL_END, 'SelectAll');\n }\n }\n\n /**\n * Adds or removes an item that has been updated.\n */\n @action updateSelectedItems(\n value: string,\n name: string | SafeString,\n isAdding: boolean,\n icon?: string,\n unitId?: string\n ): void {\n isAdding ? this.addSelectedItem(value, name, icon, unitId) : this.removeSelectedItem(value);\n }\n\n @action\n addSelectedItem(value: string, name: string | SafeString, icon?: string, unitId?: string): void {\n if (!this.selectedItems.some((item) => item.value === value)) {\n this.selectedItems = [\n {\n value,\n icon: icon ?? '',\n name,\n unitId\n },\n ...this.selectedItems\n ];\n }\n }\n\n @action\n private removeSelectedItem(idToRemove: string): void {\n this.selectedItems = this.selectedItems.filter((item) => item.value !== idToRemove);\n }\n\n /**\n * Selects or deselects all systems under this subgroup.\n */\n @action subGroupItemSelectAll(group: SubGroupItem): void {\n // Add to selected items even if some of the subitems have been limited out\n const groupItem = this.findAvailableSystemItem(this.availableSystemItems, group.value);\n groupItem?.subItems.forEach((subItem) => {\n const { id: value, name, icon, unitId } = subItem;\n this.updateSelectedItems(value, name, group.isSelectingAll, icon, unitId);\n });\n\n // Set the state of all the items in the action sheet\n group.systems.forEach((system) => {\n set(system, 'state', group.isSelectingAll);\n });\n\n group.isSelectingAll = !group.isSelectingAll;\n }\n\n /**\n * Sets the state of each subitem to 'selected' or 'unselected'.\n */\n @action selectAllSubitems(item: LocationOrGroupSelectionTreeItem): void {\n item.subitems.forEach((subitem) => {\n set(subitem, 'state', item.isSelectingAll ? SELECTED : UNSELECTED);\n });\n\n const availableSystemItem = this.findAvailableSystemItem(this.availableSystemItems, item.value);\n availableSystemItem?.subItems.forEach((subItem) => {\n this.updateSelectedItems(subItem.id, subItem.name, item.isSelectingAll, subItem.icon, subItem.unitId);\n });\n\n item.isSelectingAll = !item.isSelectingAll;\n }\n\n /**\n * Finds the corresponding available system item so we can select all the subitems when hitting 'Select All Groups/Locations'\n * regardless of if they are limited in the checkbox tree itself.\n */\n @action\n private findAvailableSystemItem(items: AvailableSystemItem[], value: string): AvailableSystemItem | undefined {\n let availableSystemItem: AvailableSystemItem | undefined = items.find(\n (item) => this.filterTypeObject.getIdForSystemItem(item) === value\n );\n\n if (!availableSystemItem) {\n for (const item of items) {\n availableSystemItem = this.findAvailableSystemItem(\n item.subItems.map((subItem) => subItem),\n value\n );\n if (availableSystemItem) {\n return availableSystemItem;\n }\n }\n }\n\n return availableSystemItem;\n }\n\n /**\n * Returns the result for location selection depending on the filter type.\n */\n @action\n private getSelectionResult(): SelectionResult {\n const { selectedItems, filterType = AvailableSystemItemsFilteringEnum.AllItems } = this;\n\n let result: SelectionResult;\n switch (filterType) {\n case AvailableSystemItemsFilteringEnum.APUMUsers:\n result = {\n selectedIds: selectedItems.map((item) => {\n if (item.value.startsWith(GROUP_ID_PREFIX)) {\n // Remove 'group-' from the id\n return item.value.replace(GROUP_ID_PREFIX, '');\n }\n return item.value;\n }),\n selectingAll: this.areAllAvailableItemsSelected(this.allAvailableSystemItems),\n isParentGroup: !!this.availableSystemItems[0].subItems\n .map((subItem) => subItem)[0]\n ?.id.startsWith(GROUP_ID_PREFIX)\n };\n break;\n case AvailableSystemItemsFilteringEnum.Reports:\n result = {\n selectedIds: selectedItems.map((item) => item.unitId ?? '')\n };\n break;\n default:\n result = { selectedIds: selectedItems.map((item) => item.value) };\n break;\n }\n\n return result;\n }\n\n /**\n * When hitting the cancel button, reverts back to the selected items from before.\n */\n @action async clearSelectionAndCloseActionSheet(): Promise {\n const {\n filterTypeObject: { getIdForSelectionItem },\n args: { close }\n } = this;\n\n // Remove any items we have added since opening the action sheet\n const itemsToRemove = this.selectedItems.filter((item) => {\n const id = getIdForSelectionItem(item);\n return id ? !this.initiallySelectedItemIds.includes(id) : false;\n });\n itemsToRemove.forEach((item) => {\n this.removeItem(item.value);\n });\n\n // Add back any items that we have removed since opening the action sheet\n const selectedItemIds = this.selectedItems.map((item) => getIdForSelectionItem(item)),\n itemsToAdd = this.initiallySelectedItemIds.filter((value) => !selectedItemIds.includes(value));\n itemsToAdd.forEach((value) => {\n const item = this.findAvailableSystemItem(this.availableSystemItems, value);\n if (item) {\n this.addSelectedItem(item.id, item.name, item.icon, item.unitId);\n this.includeGroups\n ? this.changeTreeItemState(this.checkboxTreeItems, item.id, SELECTED)\n : this.changeSubGroupOrSystemItemState(item.id, true);\n }\n });\n\n close();\n }\n\n /**\n * Saves the newly selected items.\n */\n @action async saveSelectionAndCloseActionSheet(): Promise {\n const {\n selectedItems,\n filterTypeObject,\n args: { close }\n } = this;\n\n this.initiallySelectedItemIds = selectedItems.map((item) => filterTypeObject.getIdForSelectionItem(item));\n return close(this.getSelectionResult());\n }\n\n /**\n * Applies the given limit to the items and returns the items and how many surpassed the limit.\n * If there were any excess items, displaySearchMessage is set to true so the user knows to search for further groups/locations.\n */\n private applyLimit(\n items: AvailableSystemItem[],\n limit?: number\n ): { limitedItems: AvailableSystemItem[]; excessCount: number } {\n let excessCount = 0,\n limitedItems = items;\n\n if (limit && items.length > limit) {\n this.displaySearchMessage = true;\n excessCount = items.length - limit;\n limitedItems = items.slice(0, limit);\n }\n\n return {\n limitedItems,\n excessCount\n };\n }\n\n /**\n * Creates a BinaryListItem for the given system, used in the case where only locations are selectable.\n */\n private createSystemItem(system: AvailableSystemItem): BinaryListItem {\n return new BinaryListItem({\n label: truncateItemName(system.name, this.nameLengthLimit, this.locale.isRtl),\n state: this.selectedItems.some((pill) => pill.value === system.id),\n icon: system.icon,\n props: {\n id: system.id,\n unitId: system.unitId\n }\n });\n }\n\n /**\n * Creates the subgroupItems and systemItems in the action sheet\n * when groups are not selectable.\n */\n @action\n private createSubgroupItems(availableSystemItems: AvailableSystemItem[], areItemsGroups: boolean): void {\n const subItemLimit = availableSystemItems.length === 1 ? TOTAL_LOCATIONS_LIMIT : GROUPED_LOCATIONS_LIMIT,\n { limitedItems, excessCount } = this.applyLimit(\n availableSystemItems,\n areItemsGroups ? TOTAL_GROUPS_LIMIT : TOTAL_LOCATIONS_LIMIT\n );\n this.excessItemsCount = excessCount;\n\n if (areItemsGroups) {\n this.subGroupItems = limitedItems.map((item) => {\n const { limitedItems: limitedSubItems, excessCount: excessSubItemsCount } = this.applyLimit(\n // DO NOT COPY THIS, PLEASE IMPLEMENT THE SUGGESTION AND TEST.\n // @ts-expect-error This should be: `item.subItems.toArray(),`\n item.subItems,\n subItemLimit\n );\n\n return new SubGroupItem({\n value: item.id,\n name: truncateItemName(item.name, this.nameLengthLimit, this.locale.isRtl),\n systems: limitedSubItems.map((system) => this.createSystemItem(system)),\n excessSubItemsCount\n });\n });\n } else {\n this.systemItems = limitedItems.map((item) => this.createSystemItem(item));\n }\n }\n\n /**\n * Creates the LocationOrGroupSelectionTreeItem for a given AvailableSystemItem.\n */\n private createTreeItem(\n item: AvailableSystemItem,\n excessSubItemsCount?: number,\n subItems?: AvailableSystemItem[]\n ): LocationOrGroupSelectionTreeItem {\n const { name, id: value, icon } = item;\n\n return LocationOrGroupSelectionTreeItem.create({\n name: truncateItemName(name, this.nameLengthLimit, this.locale.isRtl),\n value,\n state: this.selectedItems.some((pill) => pill.value === value) ? SELECTED : UNSELECTED,\n subitems: subItems ? this.createCheckboxTree(subItems) : [],\n excessSubItemsCount,\n isSelectable: true,\n isCollapsible: !!subItems?.length,\n icon\n });\n }\n\n /**\n * Creates the checkboxTreeItems in the action sheet when groups are selectable.\n */\n @action\n private createCheckboxTree(items: AvailableSystemItem[]): LocationOrGroupSelectionTreeItem[] {\n if (items[0]?.isGroup) {\n const subItems = items[0].subItems.map((subItem) => subItem),\n subItemLimit = subItems[0]?.isGroup\n ? TOTAL_GROUPS_LIMIT\n : items.length === 1\n ? TOTAL_LOCATIONS_LIMIT\n : GROUPED_LOCATIONS_LIMIT,\n { limitedItems } = this.applyLimit(items, TOTAL_GROUPS_LIMIT);\n\n return limitedItems.map((item: AvailableSystemItem) => {\n const { limitedItems: limitedSubItems, excessCount } = this.applyLimit(\n item.subItems.map((subItem) => subItem),\n subItemLimit\n );\n\n return this.createTreeItem(item, excessCount, limitedSubItems);\n });\n }\n\n return items.map((item) => this.createTreeItem(item));\n }\n\n /**\n * Used for location selection in the APUM Users dropdown. Determines if all\n * possible locations and groups were selected.\n */\n private areAllAvailableItemsSelected(items: AvailableSystemItem[]): boolean {\n for (const item of items) {\n if (\n !this.selectedItems.some((selectedItem) => selectedItem.value === item.id) ||\n !this.areAllAvailableItemsSelected(item.subItems.map((subItem) => subItem))\n ) {\n return false;\n }\n }\n\n return true;\n }\n\n @computed('searchString.length', 'initiallySelectedItemIds.length', 'selectedItems.length')\n get isFirstTimeLoadingActionSheet(): boolean {\n return !this.searchString.length && !this.initiallySelectedItemIds.length && !this.selectedItems.length;\n }\n\n @action\n private addAlreadySelectedItems(items: AvailableSystemItem[]): void {\n items.forEach((item) => {\n const id = this.filterTypeObject.getIdForSystemItem(item);\n if (this.args.properties.alreadySelectedIds?.includes(id)) {\n this.addSelectedItem(item.id, item.name, item.icon, item.unitId);\n }\n // DO NOT COPY THIS, PLEASE IMPLEMENT THE SUGGESTION AND TEST.\n // @ts-expect-error This should be: `this.addAlreadySelectedItems(item.subItems.toArray());`\n this.addAlreadySelectedItems(item.subItems);\n });\n }\n\n /**\n * Records time of initial load and of the select all buttons.\n */\n private async sendPerformanceMetric(\n measurementName: string,\n startName: string,\n endName: string,\n metric: string\n ): Promise {\n createMeasurement(measurementName, startName, endName);\n const selectedSystemGroup = await this.identityManager.identityModel?.selectedSystemGroup;\n const data: Record = getMeasurements(measurementName);\n data['pageName'] = AvailableSystemItemsFilteringEnum[this.filterType];\n data['metricType'] = metric;\n data['groupLevel'] = selectedSystemGroup?.isParentGroup\n ? 'ParentGroup'\n : selectedSystemGroup?.hasParentGroup\n ? 'Subgroup'\n : 'StandaloneGroup';\n data['source'] = this.identityManager.identityModel?.isMobileApp ? 'Mobile' : 'Web';\n\n this.ajax.apiRequest('systems/locationSelectorMetrics/recordMetric', {}, JSON.stringify(data), 'POST');\n }\n\n /**\n * Creates the items in the action sheet when first loading or when the search string has changed.\n */\n loadItems = task(this, { restartable: true }, async () => {\n createMark(LOAD_START);\n const {\n searchString,\n filterType = AvailableSystemItemsFilteringEnum.AllItems,\n includeGroups,\n isFirstTimeLoadingActionSheet,\n args: {\n properties: { reportId, reportType, alreadySelectedIds }\n }\n } = this,\n availableSystemItems = await this.store.query('systems/available-system-item', {\n searchString,\n filter: {\n includeOnlySelectedSystemGroupItems: true,\n includeSelectedSystemGroup: this.includeGroups,\n filterType,\n reportId,\n reportType\n }\n });\n\n this.displaySearchMessage = false;\n this.subGroupItems = [];\n this.systemItems = [];\n this.availableSystemItems = availableSystemItems.map((asi) => asi);\n\n // Keep track of any initially selected items\n if (alreadySelectedIds && !this.initiallySelectedItemIds.length) {\n this.addAlreadySelectedItems(this.availableSystemItems);\n this.initiallySelectedItemIds = alreadySelectedIds;\n }\n\n if (includeGroups) {\n this.checkboxTreeItems = this.createCheckboxTree(this.availableSystemItems);\n } else {\n this.createSubgroupItems(this.availableSystemItems, !!this.availableSystemItems[0]?.isGroup);\n }\n\n // Set the correct initial states for the filter type when loading for the first time\n if (isFirstTimeLoadingActionSheet) {\n this.filterTypeObject.loadForFirstTime.call(this);\n this.allAvailableSystemItems = availableSystemItems.map((asi) => asi);\n this.initiallySelectedItemIds = this.selectedItems.map((item) =>\n this.filterTypeObject.getIdForSelectionItem(item)\n );\n }\n\n createMark(LOAD_END);\n this.sendPerformanceMetric(LOAD_TIME, LOAD_START, LOAD_END, 'Load');\n });\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'ActionSheets::Enterprise::Locations::LocationSelection': typeof LocationSelectionActionSheet;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n {{yield}}\\n
\\n\",{ moduleName: \"customer-site/components/ui/colored-button/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport templateOnlyComponent from '@ember/component/template-only';\n\nimport type { SvgSymbolSignature } from '@adc/svg-system/components/svg-symbol';\n\ntype Color = SvgSymbolSignature['Args']['fillColor'];\n\nexport interface UiColoredButtonSignature {\n Element: HTMLDivElement;\n Args: {\n color: { name: Color };\n selectedColorName: Color;\n };\n Blocks: {\n default: [];\n };\n}\n\nconst UiColoredButton = templateOnlyComponent();\nexport default UiColoredButton;\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Ui::ColoredButton': typeof UiColoredButton;\n }\n}\n","import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"
\\n \\n {{#if @useButtonAdc}}\\n \\n {{else}}\\n \\n {{/if}}\\n \\n
    \\n {{#each @icons as |icon|}}\\n
  • \\n \\n {{#if (eq icon.name @currentIconName)}}\\n \\n {{/if}}\\n \\n
  • \\n {{/each}}\\n
\\n
    \\n {{#each @colors as |color|}}\\n
  • \\n \\n
  • \\n {{/each}}\\n
\\n \\n
\\n\",{ moduleName: \"customer-site/components/ui/icon-and-color-picker/index.hbs\" })","/* import __COLOCATED_TEMPLATE__ from './index.hbs'; */\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { isEnterOrSpaceCode } from '@adc/ember-utils/utils/a11y';\nimport { action } from '@ember/object';\n\nimport './_style.scss';\n\ntype Color = 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'greenblue';\n\nexport interface IconAndColorPickerSignature {\n Element: HTMLDivElement;\n Args: {\n changeColor: (color: Color) => void;\n changeIcon: (icon: string) => void;\n currentIconName: string;\n currentColorName: Color;\n colors?: IconAndColorPickerColorOption[];\n icons?: IconAndColorPickerIconOption[];\n buttonTitle?: string;\n colorJustIcon?: boolean;\n useButtonAdc?: boolean;\n };\n}\n\ninterface IconAndColorPickerColorOption {\n name: Color;\n id: string;\n}\n\ninterface IconAndColorPickerIconOption {\n name: string;\n id: string;\n}\n\n/**\n * @classdesc\n *\n * Allows selecting an icon and color.\n */\nexport default class IconAndColorPicker extends Component {\n tagName = '';\n\n @tracked isPopoverOpen = false;\n\n /**\n * Toggle the visibility of the popover\n */\n @action togglePopover() {\n this.isPopoverOpen = !this.isPopoverOpen;\n }\n\n /**\n * Update the selectedIcon, and fire the changeIcon method, passing the icon's id.\n *\n * @param icon\n */\n @action changeSelectedIcon(icon: IconAndColorPickerIconOption) {\n this.args.changeIcon(icon.name);\n }\n\n /**\n * Focus, update the selectedIcon and fire the changeIcon method, passing the icon's id, using enter or space key.\n *\n * @param icon\n * @param event\n */\n @action iconKeyUp(icon: IconAndColorPickerIconOption, event: any) {\n const { code } = event;\n\n if (!isEnterOrSpaceCode(code)) {\n return;\n }\n\n event.preventDefault();\n\n this.args.changeIcon(icon.name);\n }\n\n /**\n * Update the selectedColor, and fire the changeColor method, passing the color's id.\n *\n * @param color\n */\n @action changeSelectedColor(color: IconAndColorPickerColorOption) {\n this.args.changeColor(color.name);\n }\n\n /**\n * Focus, update the selectedColor and fire the changeColor method, passing the color's id, using enter or space key.\n *\n * @param color\n * @param event\n */\n @action colorKeyUp(color: IconAndColorPickerColorOption, event: any) {\n const { code } = event;\n\n if (!isEnterOrSpaceCode(code)) {\n return;\n }\n\n event.preventDefault();\n\n this.args.changeColor(color.name);\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Ui::IconAndColorPicker': typeof IconAndColorPicker;\n }\n}\n"],"names":["GROUP_ID_PREFIX","truncateItemName","name","limit","isRtl","length","concat","slice","SubGroupItem","_dec","gt","_class","constructor","props","_initializerDefineProperty","_descriptor","_descriptor2","_descriptor3","_descriptor4","_descriptor5","_descriptor6","_descriptor7","this","value","systems","excessSubItemsCount","toggleGroupExpansion","isExpanded","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor","LocationOrGroupSelectionTreeItem","_dec2","computed","_dec3","_dec4","_dec5","_dec6","_dec7","_class2","CheckboxTreeItem","arguments","_descriptor8","_descriptor9","_descriptor10","isFullySelected","state","SELECTED","isPartiallySelected","internalState","val","set","showSubitems","subitems","isCollapsed","areSubitemsGroups","_this$subitems$","startsWith","locationSelectionResourceKeys","locationSelectionPath","subItemType","moreSubitems","selectAllButton","BaseLocationSelectionFilterType","_defineProperty","AvailableSystemItemsFilteringEnum","AllItems","getIdForSystemItem","item","id","getIdForSelectionItem","loadForFirstTime","ReportsFilterType","Reports","unitId","_item$unitId","APUMUsersFilterType","APUMUsers","_this$checkboxTreeIte","checkboxTreeItems","icon","addSelectedItem","initiallySelectedItemIds","AccessPointsFilterType","AccessPoints","_this$args$properties","args","properties","defaultToNone","alreadySelectedIds","selectAll","createTemplateFactory","scope","svgSymbol_","buttonIcon_","t_","on","fn","tc_","SelectedItemPills","intlPath","path","Component","selectedItemPills","selectedItems","pillsLimit","pills","forEach","pill","toString","locale","excessPillsCount","Math","max","service","setComponentTemplate","TEMPLATE","formGroup_","simpleBinary_","expandButton_","not_","buttonSimple_","enterpriseLocationSelectionLocationSelectionTree_","t_0","LocationSelectionTreeItem","toggleSubItemsVisibility","itemClicked","evt","target","checked","UNSELECTED","itemChanged","enterpriseLocationSelectionLocationSelectionTreeItem_","LocationSelectionTree","templateOnlyComponent","simpleBinaryList_","SimpleLocationFiltering","actionSheet_","didUpdate_","willDestroy_","inlineAlert_","enterpriseLocationSelectionSelectedItemPills_","searchToolbar_","focusTrap_","and_","or_","enterpriseLocationSelectionSimpleLocationFiltering_","tc_0","buttonAsync_","SELECT_ALL_START","SELECT_ALL_END","LOAD_START","LOAD_END","LocationSelectionActionSheet","alias","_dec8","_dec9","_dec10","owner","super","_descriptor11","_descriptor12","_descriptor13","_descriptor14","_descriptor15","_descriptor16","_descriptor17","_descriptor18","_descriptor19","_descriptor20","_descriptor21","returnFocusOnDeactivate","clickOutsideDeactivates","escapeDeactivates","_buildTask","context","generator","createMark","searchString","filterType","includeGroups","isFirstTimeLoadingActionSheet","reportId","reportType","availableSystemItems","store","query","filter","includeOnlySelectedSystemGroupItems","includeSelectedSystemGroup","_this$availableSystem","displaySearchMessage","subGroupItems","systemItems","map","asi","addAlreadySelectedItems","createCheckboxTree","createSubgroupItems","isGroup","filterTypeObject","call","allAvailableSystemItems","sendPerformanceMetric","restartable","createFilterType","loadItems","perform","buttons","text","intl","t","clearSelectionAndCloseActionSheet","saveSelectionAndCloseActionSheet","color","areAnyItemsSelected","media","isMobile","nameLengthLimit","searchMessage","tc","updateTrapFocusHandler","isTrapFocusActive","activateFocusTrap","event","removeItem","removeSelectedItem","changeTreeItemState","changeSubGroupOrSystemItemState","subGroup","changeSystemItemsState","system","items","treeItemState","moreItemsMessage","_this$availableSystem2","resource","count","excessItemsCount","treeItemChanged","updateSelectedItems","individualItemChanged","label","setStatesOfTreeItems","setStatesOfSystemItems","addOrRemoveAllTreeItems","isAdding","subItems","addOrRemoveAllSystemItems","reportMetric","undefined","selectingAll","some","idToRemove","subGroupItemSelectAll","group","groupItem","findAvailableSystemItem","subItem","isSelectingAll","selectAllSubitems","subitem","availableSystemItem","find","getSelectionResult","_this$availableSystem3","result","selectedIds","replace","areAllAvailableItemsSelected","isParentGroup","close","includes","selectedItemIds","applyLimit","excessCount","limitedItems","createSystemItem","BinaryListItem","areItemsGroups","subItemLimit","limitedSubItems","createTreeItem","create","isSelectable","isCollapsible","_items$","_subItems$","selectedItem","measurementName","startName","endName","metric","_this$identityManager","_this$identityManager2","createMeasurement","selectedSystemGroup","identityManager","identityModel","data","getMeasurements","hasParentGroup","isMobileApp","ajax","apiRequest","JSON","stringify","eq_","UiColoredButton","guidFor_","uiColoredIcon_","popoverMenu_","uiColoredButton_","IconAndColorPicker","togglePopover","isPopoverOpen","changeSelectedIcon","changeIcon","iconKeyUp","code","isEnterOrSpaceCode","preventDefault","changeSelectedColor","changeColor","colorKeyUp"],"sourceRoot":""}