{"version":3,"file":"NcSelectUsers-RyUVUaWQ-i6ykqGF1.chunk.mjs","sources":["../node_modules/@nextcloud/vue/dist/chunks/NcSelectUsers-RyUVUaWQ.mjs"],"sourcesContent":["import '../assets/NcSelectUsers-CfOSPgtz.css';\nimport { ref, watch } from \"vue\";\nimport { N as NcListItemIcon } from \"./NcListItemIcon-DT7XMp5c.mjs\";\nimport { N as NcSelect } from \"./NcSelect-DTniMiUS.mjs\";\nimport { r as register, j as t46, g as t16, a as t } from \"./_l10n-BmKQgz1z.mjs\";\nimport { G as GenRandomId } from \"./GenRandomId-F5ebeBB_.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t16, t46);\nconst __default__ = {\n  model: {\n    prop: \"modelValue\",\n    event: \"update:modelValue\"\n  }\n};\nconst _sfc_main = /* @__PURE__ */ Object.assign(__default__, {\n  __name: \"NcSelectUsers\",\n  props: {\n    /**\n     * `aria-label` for the clear input button\n     */\n    ariaLabelClearSelected: {\n      type: String,\n      default: t(\"Clear selected\")\n    },\n    /**\n     * `aria-label` for the listbox element\n     */\n    ariaLabelListbox: {\n      type: String,\n      default: t(\"Options\")\n    },\n    /**\n     * Allows to customize the `aria-label` for the deselect-option button\n     * The default is \"Deselect \" + optionLabel\n     *\n     * @type {(optionLabel: string) => string}\n     */\n    ariaLabelDeselectOption: {\n      type: Function,\n      default: (optionLabel) => t(\"Deselect {option}\", { option: optionLabel })\n    },\n    /**\n     * Keep the dropdown open after selecting an entry.\n     */\n    keepOpen: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * Disable the component\n     */\n    disabled: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * Callback to determine if the provided option should match the current search text.\n     * Used to determine if the option should be displayed.\n     *\n     * By default it filters by the `displayName` and `subname` properties of the user\n     * option object unless this prop is set explicitly\n     */\n    filterBy: {\n      type: Function,\n      default: null\n    },\n    /**\n     * Input element id\n     */\n    inputId: {\n      type: String,\n      default: () => GenRandomId()\n    },\n    /**\n     * Visible label for the input element\n     *\n     * @default 'Select account'\n     */\n    inputLabel: {\n      type: String,\n      default: t(\"Select account\")\n    },\n    /**\n     * Pass true if you are using an external label.\n     * In this case make sure you set the `for` attribute of your `<label>` to the `inputId` of this component.\n     */\n    labelOutside: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * Show a loading icon.\n     *\n     * @default false\n     */\n    loading: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * Allow selection of multiple options\n     *\n     * @default false\n     */\n    multiple: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * Disable automatic wrapping when selected options overflow the width.\n     *\n     * @default false\n     */\n    noWrap: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * Array of users.\n     *\n     * @type {{displayName: string, user: string, subname?: string, iconSvg?: string, iconName?: string, isGuest?: boolean, isNoUser?: boolean}[]}\n     */\n    options: {\n      type: Array,\n      default: () => []\n    },\n    /**\n     * Placeholder text.\n     */\n    placeholder: {\n      type: String,\n      default: \"\"\n    },\n    /**\n     * Enable if a value is required for native form validation\n     */\n    required: {\n      type: Boolean,\n      default: false\n    },\n    /**\n     * Currently selected value\n     *\n     * The `v-model` directive may be used for two-way data binding\n     */\n    modelValue: {\n      type: Object,\n      default: null\n    }\n  },\n  emits: [\"search\", \"update:modelValue\"],\n  setup(__props, { emit }) {\n    const props = __props;\n    const search = ref(\"\");\n    watch(search, () => {\n      emit(\"search\", search.value);\n    });\n    const clickableArea = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue(\"--default-clickable-area\"));\n    const gridBaseLine = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue(\"--default-grid-baseline\"));\n    const avatarSize = clickableArea - 2 * gridBaseLine;\n    function localFilterBy(option, label, search2) {\n      if (props.filterBy) {\n        return props.filterBy;\n      }\n      const EMAIL_NOTATION = /[^<]*<([^>]+)/;\n      const match = search2.match(EMAIL_NOTATION);\n      const subname = option.subname?.toLocaleLowerCase() ?? \"\";\n      return match && subname.indexOf(match[1].toLocaleLowerCase()) > -1 || `${label} ${option.subname}`.toLocaleLowerCase().indexOf(search2.toLocaleLowerCase()) > -1;\n    }\n    return { __sfc: true, props, emit, search, clickableArea, gridBaseLine, avatarSize, localFilterBy, NcListItemIcon, NcSelect };\n  }\n});\nvar _sfc_render = function render() {\n  var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;\n  return _c(_setup.NcSelect, _vm._b({ staticClass: \"nc-select-users\", attrs: { \"filter-by\": _setup.localFilterBy, \"label\": \"displayName\" }, on: { \"search\": function($event) {\n    _setup.search = $event;\n  }, \"update:model-value\": function($event) {\n    return _vm.$emit(\"update:modelValue\", $event);\n  } }, scopedSlots: _vm._u([{ key: \"option\", fn: function(option) {\n    return [_c(_setup.NcListItemIcon, _vm._b({ attrs: { \"avatar-size\": 32, \"name\": option.displayName, \"search\": _setup.search } }, \"NcListItemIcon\", option, false))];\n  } }, { key: \"selected-option\", fn: function(selectedOption) {\n    return [_c(_setup.NcListItemIcon, _vm._b({ attrs: { \"avatar-size\": _setup.avatarSize, \"name\": selectedOption.displayName, \"no-margin\": \"\", \"search\": _setup.search } }, \"NcListItemIcon\", selectedOption, false))];\n  } }]) }, \"NcSelect\", _vm.$props, false));\n};\nvar _sfc_staticRenderFns = [];\nvar __component__ = /* @__PURE__ */ normalizeComponent(\n  _sfc_main,\n  _sfc_render,\n  _sfc_staticRenderFns,\n  false,\n  null,\n  \"e5d43b0e\"\n);\nconst NcSelectUsers = __component__.exports;\nexport {\n  NcSelectUsers as N\n};\n//# sourceMappingURL=NcSelectUsers-RyUVUaWQ.mjs.map\n"],"names":["register","t16","t46","__default__","_sfc_main","t","optionLabel","GenRandomId","__props","emit","props","search","ref","watch","clickableArea","gridBaseLine","avatarSize","localFilterBy","option","label","search2","EMAIL_NOTATION","match","subname","NcListItemIcon","NcSelect","_sfc_render","_vm","_c","_setup","$event","selectedOption","_sfc_staticRenderFns","__component__","normalizeComponent","NcSelectUsers"],"mappings":"mNAOA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