{"version":3,"sources":["webpack:///./node_modules/@ionic/vue/node_modules/@ionic/core/dist/esm-es5/ion-searchbar-md.entry.js","webpack:///./node_modules/@ionic/vue/node_modules/@ionic/core/dist/esm-es5/theme-18cbe2cc.js","webpack:///./node_modules/@ionic/vue/node_modules/@ionic/core/dist/esm-es5/index-3476b023.js"],"names":["Searchbar","class_1","hostRef","_this","this","isCancelVisible","shouldAlignLeft","focused","noAnimate","animated","autocomplete","autocorrect","cancelButtonIcon","cancelButtonText","debounce","disabled","inputmode","placeholder","searchIcon","showCancelButton","spellcheck","type","value","onClearInput","ev","ionClear","emit","preventDefault","stopPropagation","setTimeout","getValue","ionInput","onCancelSearchbar","ionCancel","nativeInput","blur","onInput","input","target","onBlur","ionBlur","positionElements","onFocus","ionFocus","ionChange","ionStyle","prototype","debounceChanged","valueChanged","inputEl","showCancelButtonChanged","requestAnimationFrame","el","forceUpdate","connectedCallback","emitStyle","componentDidLoad","console","warn","setFocus","_a","focus","getInputElement","Promise","resolve","prevAlignLeft","mode","trim","positionPlaceholder","positionCancelButton","isRTL","document","dir","iconEl","shadowRoot","querySelector","removeAttribute","doc","tempSpan","createElement","innerHTML","body","appendChild","textWidth","offsetWidth","remove","inputLeft","iconLeft","style","paddingRight","marginRight","paddingLeft","marginLeft","cancelButton","shouldShowCancel","shouldShowCancelButton","cancelStyle","offset","hasValue","isCancelButtonSetToNever","isCancelButtonSetToFocus","render","getBoolean","clearIcon","tabIndex","undefined","onMouseDown","onTouchStart","class","icon","lazy","role","Object","assign","color","ref","inputMode","autoComplete","autoCorrect","spellCheck","defineProperty","get","enumerable","configurable","hostContext","selector","closest","createColorClasses","length","getClassList","classes","array","Array","isArray","split","filter","c","map","getClassMap","forEach","SCHEME","openURL","url","direction","router","test","push","sanitizeDOMString","untrustedString","documentFragment_1","createDocumentFragment","workingDiv","blockedTags","blockedTag","getElementsToRemove","querySelectorAll","elementIndex","element","parentNode","removeChild","childElements","getElementChildren","childIndex","sanitizeElement","dfChildren","fragmentDiv","getInnerDiv","err","error","nodeType","i","attributes","attribute","item","attributeName","name","allowedAttributes","includes","toLowerCase","attributeValue","children","childNodes"],"mappings":"gHAAA,iIAMIA,EAA2B,WAC3B,SAASC,EAAQC,GACb,IAAIC,EAAQC,KACZ,eAAiBA,KAAMF,GACvBE,KAAKC,iBAAkB,EACvBD,KAAKE,iBAAkB,EACvBF,KAAKG,SAAU,EACfH,KAAKI,WAAY,EAIjBJ,KAAKK,UAAW,EAIhBL,KAAKM,aAAe,MAIpBN,KAAKO,YAAc,MAInBP,KAAKQ,iBAAmB,gBAIxBR,KAAKS,iBAAmB,SAIxBT,KAAKU,SAAW,IAIhBV,KAAKW,UAAW,EAMhBX,KAAKY,UAAY,SAUjBZ,KAAKa,YAAc,SAInBb,KAAKc,WAAa,SAQlBd,KAAKe,iBAAmB,QAIxBf,KAAKgB,YAAa,EAIlBhB,KAAKiB,KAAO,SAIZjB,KAAKkB,MAAQ,GAIblB,KAAKmB,aAAe,SAAUC,GAC1BrB,EAAMsB,SAASC,OACXF,IACAA,EAAGG,iBACHH,EAAGI,mBAIPC,YAAW,WACP,IAAIP,EAAQnB,EAAM2B,WACJ,KAAVR,IACAnB,EAAMmB,MAAQ,GACdnB,EAAM4B,SAASL,UAEpB,KAOPtB,KAAK4B,kBAAoB,SAAUR,GAC3BA,IACAA,EAAGG,iBACHH,EAAGI,mBAEPzB,EAAM8B,UAAUP,OAChBvB,EAAMoB,eACFpB,EAAM+B,aACN/B,EAAM+B,YAAYC,QAM1B/B,KAAKgC,QAAU,SAAUZ,GACrB,IAAIa,EAAQb,EAAGc,OACXD,IACAlC,EAAMmB,MAAQe,EAAMf,OAExBnB,EAAM4B,SAASL,KAAKF,IAMxBpB,KAAKmC,OAAS,WACVpC,EAAMI,SAAU,EAChBJ,EAAMqC,QAAQd,OACdvB,EAAMsC,oBAKVrC,KAAKsC,QAAU,WACXvC,EAAMI,SAAU,EAChBJ,EAAMwC,SAASjB,OACfvB,EAAMsC,oBAEVrC,K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,EAAmBJ,GAEvC,IAASa,EAAI,EAAGA,EAAIV,EAAchC,OAAQ0C,IACtCP,EAAgBH,EAAcU,MAOlCT,EAAqB,SAAU7G,GAC/B,OAAuB,MAAfA,EAAGgI,SAAoBhI,EAAGgI,SAAWhI,EAAGiI,YAEhDL,EAAoB,CAAC,QAAS,KAAM,OAAQ,MAAO,OAAQ,QAC3DxB,EAAc,CAAC,SAAU,QAAS,SAAU,OAAQ,OAAQ,SAAU","file":"js/chunk-37ff8997.b56dd720.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, d as createEvent, c as getIonMode, h, H as Host, e as getElement } from './core-feeeff0d.js';\nimport { b as config } from './config-3c7f3790.js';\nimport { d as debounceEvent } from './helpers-46f4a262.js';\nimport { c as createColorClasses } from './theme-18cbe2cc.js';\nimport { s as sanitizeDOMString } from './index-3476b023.js';\nvar Searchbar = /** @class */ (function () {\n function class_1(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n this.isCancelVisible = false;\n this.shouldAlignLeft = true;\n this.focused = false;\n this.noAnimate = true;\n /**\n * If `true`, enable searchbar animation.\n */\n this.animated = false;\n /**\n * Set the input's autocomplete property.\n */\n this.autocomplete = 'off';\n /**\n * Set the input's autocorrect property.\n */\n this.autocorrect = 'off';\n /**\n * Set the cancel button icon. Only applies to `md` mode.\n */\n this.cancelButtonIcon = 'md-arrow-back';\n /**\n * Set the the cancel button text. Only applies to `ios` mode.\n */\n this.cancelButtonText = 'Cancel';\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke.\n */\n this.debounce = 250;\n /**\n * If `true`, the user cannot interact with the input.\n */\n this.disabled = false;\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n this.inputmode = 'search';\n /**\n * Set the input's placeholder.\n * `placeholder` can accept either plaintext or HTML as a string.\n * To display characters normally reserved for HTML, they\n * must be escaped. For example `` would become\n * `<Ionic>`\n *\n * For more information: [Security Documentation](https://ionicframework.com/docs/faq/security)\n */\n this.placeholder = 'Search';\n /**\n * The icon to use as the search icon.\n */\n this.searchIcon = 'search';\n /**\n * Sets the behavior for the cancel button. Defaults to `\"never\"`.\n * Setting to `\"focus\"` shows the cancel button on focus.\n * Setting to `\"never\"` hides the cancel button.\n * Setting to `\"always\"` shows the cancel button regardless\n * of focus state.\n */\n this.showCancelButton = 'never';\n /**\n * If `true`, enable spellcheck on the input.\n */\n this.spellcheck = false;\n /**\n * Set the type of the input.\n */\n this.type = 'search';\n /**\n * the value of the searchbar.\n */\n this.value = '';\n /**\n * Clears the input field and triggers the control change.\n */\n this.onClearInput = function (ev) {\n _this.ionClear.emit();\n if (ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n // setTimeout() fixes https://github.com/ionic-team/ionic/issues/7527\n // wait for 4 frames\n setTimeout(function () {\n var value = _this.getValue();\n if (value !== '') {\n _this.value = '';\n _this.ionInput.emit();\n }\n }, 16 * 4);\n };\n /**\n * Clears the input field and tells the input to blur since\n * the clearInput function doesn't want the input to blur\n * then calls the custom cancel function if the user passed one in.\n */\n this.onCancelSearchbar = function (ev) {\n if (ev) {\n ev.preventDefault();\n ev.stopPropagation();\n }\n _this.ionCancel.emit();\n _this.onClearInput();\n if (_this.nativeInput) {\n _this.nativeInput.blur();\n }\n };\n /**\n * Update the Searchbar input value when the input changes\n */\n this.onInput = function (ev) {\n var input = ev.target;\n if (input) {\n _this.value = input.value;\n }\n _this.ionInput.emit(ev);\n };\n /**\n * Sets the Searchbar to not focused and checks if it should align left\n * based on whether there is a value in the searchbar or not.\n */\n this.onBlur = function () {\n _this.focused = false;\n _this.ionBlur.emit();\n _this.positionElements();\n };\n /**\n * Sets the Searchbar to focused and active on input focus.\n */\n this.onFocus = function () {\n _this.focused = true;\n _this.ionFocus.emit();\n _this.positionElements();\n };\n this.ionInput = createEvent(this, \"ionInput\", 7);\n this.ionChange = createEvent(this, \"ionChange\", 7);\n this.ionCancel = createEvent(this, \"ionCancel\", 7);\n this.ionClear = createEvent(this, \"ionClear\", 7);\n this.ionBlur = createEvent(this, \"ionBlur\", 7);\n this.ionFocus = createEvent(this, \"ionFocus\", 7);\n this.ionStyle = createEvent(this, \"ionStyle\", 7);\n }\n class_1.prototype.debounceChanged = function () {\n this.ionChange = debounceEvent(this.ionChange, this.debounce);\n };\n class_1.prototype.valueChanged = function () {\n var inputEl = this.nativeInput;\n var value = this.getValue();\n if (inputEl && inputEl.value !== value) {\n inputEl.value = value;\n }\n this.ionChange.emit({ value: value });\n };\n class_1.prototype.showCancelButtonChanged = function () {\n var _this = this;\n requestAnimationFrame(function () {\n _this.positionElements();\n _this.el.forceUpdate();\n });\n };\n class_1.prototype.connectedCallback = function () {\n this.emitStyle();\n };\n class_1.prototype.componentDidLoad = function () {\n var _this = this;\n if (this.showCancelButton === 'false' || this.showCancelButton === false) {\n console.warn('The boolean values of showCancelButton are deprecated. Please use \"never\" instead of \"false\".');\n }\n if (this.showCancelButton === '' || this.showCancelButton === 'true' || this.showCancelButton === true) {\n console.warn('The boolean values of showCancelButton are deprecated. Please use \"focus\" instead of \"true\".');\n }\n this.positionElements();\n this.debounceChanged();\n setTimeout(function () {\n _this.noAnimate = false;\n }, 300);\n };\n class_1.prototype.emitStyle = function () {\n this.ionStyle.emit({\n 'searchbar': true\n });\n };\n /**\n * Sets focus on the specified `ion-searchbar`. Use this method instead of the global\n * `input.focus()`.\n */\n class_1.prototype.setFocus = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (this.nativeInput) {\n this.nativeInput.focus();\n }\n return [2 /*return*/];\n });\n });\n };\n /**\n * Returns the native `` element used under the hood.\n */\n class_1.prototype.getInputElement = function () {\n return Promise.resolve(this.nativeInput);\n };\n /**\n * Positions the input search icon, placeholder, and the cancel button\n * based on the input value and if it is focused. (ios only)\n */\n class_1.prototype.positionElements = function () {\n var value = this.getValue();\n var prevAlignLeft = this.shouldAlignLeft;\n var mode = getIonMode(this);\n var shouldAlignLeft = (!this.animated || value.trim() !== '' || !!this.focused);\n this.shouldAlignLeft = shouldAlignLeft;\n if (mode !== 'ios') {\n return;\n }\n if (prevAlignLeft !== shouldAlignLeft) {\n this.positionPlaceholder();\n }\n if (this.animated) {\n this.positionCancelButton();\n }\n };\n /**\n * Positions the input placeholder\n */\n class_1.prototype.positionPlaceholder = function () {\n var inputEl = this.nativeInput;\n if (!inputEl) {\n return;\n }\n var isRTL = document.dir === 'rtl';\n var iconEl = (this.el.shadowRoot || this.el).querySelector('.searchbar-search-icon');\n if (this.shouldAlignLeft) {\n inputEl.removeAttribute('style');\n iconEl.removeAttribute('style');\n }\n else {\n // Create a dummy span to get the placeholder width\n var doc = document;\n var tempSpan = doc.createElement('span');\n tempSpan.innerHTML = sanitizeDOMString(this.placeholder) || '';\n doc.body.appendChild(tempSpan);\n // Get the width of the span then remove it\n var textWidth = tempSpan.offsetWidth;\n tempSpan.remove();\n // Calculate the input padding\n var inputLeft = 'calc(50% - ' + (textWidth / 2) + 'px)';\n // Calculate the icon margin\n var iconLeft = 'calc(50% - ' + ((textWidth / 2) + 30) + 'px)';\n // Set the input padding start and icon margin start\n if (isRTL) {\n inputEl.style.paddingRight = inputLeft;\n iconEl.style.marginRight = iconLeft;\n }\n else {\n inputEl.style.paddingLeft = inputLeft;\n iconEl.style.marginLeft = iconLeft;\n }\n }\n };\n /**\n * Show the iOS Cancel button on focus, hide it offscreen otherwise\n */\n class_1.prototype.positionCancelButton = function () {\n var isRTL = document.dir === 'rtl';\n var cancelButton = (this.el.shadowRoot || this.el).querySelector('.searchbar-cancel-button');\n var shouldShowCancel = this.shouldShowCancelButton();\n if (cancelButton && shouldShowCancel !== this.isCancelVisible) {\n var cancelStyle = cancelButton.style;\n this.isCancelVisible = shouldShowCancel;\n if (shouldShowCancel) {\n if (isRTL) {\n cancelStyle.marginLeft = '0';\n }\n else {\n cancelStyle.marginRight = '0';\n }\n }\n else {\n var offset = cancelButton.offsetWidth;\n if (offset > 0) {\n if (isRTL) {\n cancelStyle.marginLeft = -offset + 'px';\n }\n else {\n cancelStyle.marginRight = -offset + 'px';\n }\n }\n }\n }\n };\n class_1.prototype.getValue = function () {\n return this.value || '';\n };\n class_1.prototype.hasValue = function () {\n return this.getValue() !== '';\n };\n /**\n * Determines whether or not the cancel button should be visible onscreen.\n * Cancel button should be shown if one of two conditions applies:\n * 1. `showCancelButton` is set to `always`.\n * 2. `showCancelButton` is set to `focus`, and the searchbar has been focused.\n */\n class_1.prototype.shouldShowCancelButton = function () {\n if (isCancelButtonSetToNever(this.showCancelButton) ||\n (isCancelButtonSetToFocus(this.showCancelButton) && !this.focused)) {\n return false;\n }\n return true;\n };\n class_1.prototype.render = function () {\n var _a;\n var _this = this;\n var animated = this.animated && config.getBoolean('animated', true);\n var mode = getIonMode(this);\n var clearIcon = this.clearIcon || (mode === 'ios' ? 'ios-close-circle' : 'md-close');\n var searchIcon = this.searchIcon;\n var cancelButton = !isCancelButtonSetToNever(this.showCancelButton) && (h(\"button\", { \"aria-label\": \"cancel\", type: \"button\", tabIndex: mode === 'ios' && !this.shouldShowCancelButton() ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: \"searchbar-cancel-button\" }, h(\"div\", null, mode === 'md'\n ? h(\"ion-icon\", { \"aria-hidden\": \"true\", mode: mode, icon: this.cancelButtonIcon, lazy: false })\n : this.cancelButtonText)));\n return (h(Host, { role: \"search\", \"aria-disabled\": this.disabled ? 'true' : null, class: Object.assign(Object.assign({}, createColorClasses(this.color)), (_a = {}, _a[mode] = true, _a['searchbar-animated'] = animated, _a['searchbar-disabled'] = this.disabled, _a['searchbar-no-animate'] = animated && this.noAnimate, _a['searchbar-has-value'] = this.hasValue(), _a['searchbar-left-aligned'] = this.shouldAlignLeft, _a['searchbar-has-focus'] = this.focused, _a['searchbar-should-show-cancel'] = this.shouldShowCancelButton(), _a)) }, h(\"div\", { class: \"searchbar-input-container\" }, h(\"input\", { \"aria-label\": \"search text\", disabled: this.disabled, ref: function (el) { return _this.nativeInput = el; }, class: \"searchbar-input\", inputMode: this.inputmode, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellCheck: this.spellcheck }), mode === 'md' && cancelButton, h(\"ion-icon\", { mode: mode, icon: searchIcon, lazy: false, class: \"searchbar-search-icon\" }), h(\"button\", { \"aria-label\": \"reset\", type: \"button\", \"no-blur\": true, class: \"searchbar-clear-button\", onMouseDown: this.onClearInput, onTouchStart: this.onClearInput }, h(\"ion-icon\", { \"aria-hidden\": \"true\", mode: mode, icon: clearIcon, lazy: false, class: \"searchbar-clear-icon\" }))), mode === 'ios' && cancelButton));\n };\n Object.defineProperty(class_1.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"watchers\", {\n get: function () {\n return {\n \"debounce\": [\"debounceChanged\"],\n \"value\": [\"valueChanged\"],\n \"showCancelButton\": [\"showCancelButtonChanged\"]\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"style\", {\n get: function () { return \".sc-ion-searchbar-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family,inherit);-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-searchbar-md-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md, .ion-color.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md, .ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:inherit}.searchbar-search-icon.sc-ion-searchbar-md{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-md{display:block;position:relative;-ms-flex-negative:1;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-md{font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-input.sc-ion-searchbar-md::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-ms-clear, .searchbar-input.sc-ion-searchbar-md::-webkit-search-cancel-button{display:none}.searchbar-cancel-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-md > div.sc-ion-searchbar-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-has-value.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{display:block}.searchbar-disabled.sc-ion-searchbar-md-h{cursor:default;opacity:.4;pointer-events:none}.sc-ion-searchbar-md-h{--clear-button-color:initial;--cancel-button-color:var(--ion-color-step-900,#1a1a1a);--color:var(--ion-color-step-850,#262626);--icon-color:var(--ion-color-step-600,#666);--background:var(--ion-background-color,#fff);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;background:inherit}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.searchbar-search-icon.sc-ion-searchbar-md{left:16px;top:11px;width:21px;height:21px}[dir=rtl].sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md, [dir=rtl] .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md, [dir=rtl].sc-ion-searchbar-md .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:16px}.searchbar-cancel-button.sc-ion-searchbar-md{left:5px;top:0;background-color:transparent;font-size:1.6em}[dir=rtl].sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md, [dir=rtl] .sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md, [dir=rtl].sc-ion-searchbar-md .searchbar-cancel-button.sc-ion-searchbar-md{left:unset;right:unset;right:5px}.searchbar-cancel-button.sc-ion-searchbar-md, .searchbar-search-icon.sc-ion-searchbar-md{position:absolute}.searchbar-cancel-button.activated.sc-ion-searchbar-md, .searchbar-search-icon.activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-input.sc-ion-searchbar-md{padding-left:55px;padding-right:55px;padding-top:6px;padding-bottom:6px;border-radius:2px;background-position:left 8px center;height:auto;font-size:16px;font-weight:400;line-height:30px;-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12)}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.searchbar-input.sc-ion-searchbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:55px;padding-inline-start:55px;-webkit-padding-end:55px;padding-inline-end:55px}}[dir=rtl].sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md, [dir=rtl] .sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md, [dir=rtl].sc-ion-searchbar-md .searchbar-input.sc-ion-searchbar-md{background-position:right 8px center}.searchbar-clear-button.sc-ion-searchbar-md{right:13px;top:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;position:absolute;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md, [dir=rtl] .sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md, [dir=rtl].sc-ion-searchbar-md .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:13px}.searchbar-clear-button.activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-clear-icon.sc-ion-searchbar-md{width:22px;height:100%}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md, .searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md, .searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md + .searchbar-search-icon.sc-ion-searchbar-md, .searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md + .searchbar-search-icon.sc-ion-searchbar-md{display:none}ion-toolbar.sc-ion-searchbar-md-h, ion-toolbar .sc-ion-searchbar-md-h{padding-left:7px;padding-right:7px;padding-top:3px;padding-bottom:3px}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){ion-toolbar.sc-ion-searchbar-md-h, ion-toolbar .sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:7px;padding-inline-start:7px;-webkit-padding-end:7px;padding-inline-end:7px}}\"; },\n enumerable: true,\n configurable: true\n });\n return class_1;\n}());\n/**\n * Check if the cancel button should never be shown.\n *\n * TODO: Remove this when the `true` and `false`\n * options are removed.\n */\nvar isCancelButtonSetToNever = function (showCancelButton) {\n return (showCancelButton === 'never' ||\n showCancelButton === 'false' ||\n showCancelButton === false);\n};\n/**\n * Check if the cancel button should be shown on focus.\n *\n * TODO: Remove this when the `true` and `false`\n * options are removed.\n */\nvar isCancelButtonSetToFocus = function (showCancelButton) {\n return (showCancelButton === 'focus' ||\n showCancelButton === 'true' ||\n showCancelButton === true ||\n showCancelButton === '');\n};\nexport { Searchbar as ion_searchbar };\n","import { __awaiter, __generator } from \"tslib\";\nvar hostContext = function (selector, el) {\n return el.closest(selector) !== null;\n};\n/**\n * Create the mode and color classes for the component based on the classes passed in\n */\nvar createColorClasses = function (color) {\n var _a;\n return (typeof color === 'string' && color.length > 0) ? (_a = {\n 'ion-color': true\n },\n _a[\"ion-color-\" + color] = true,\n _a) : undefined;\n};\nvar getClassList = function (classes) {\n if (classes !== undefined) {\n var array = Array.isArray(classes) ? classes : classes.split(' ');\n return array\n .filter(function (c) { return c != null; })\n .map(function (c) { return c.trim(); })\n .filter(function (c) { return c !== ''; });\n }\n return [];\n};\nvar getClassMap = function (classes) {\n var map = {};\n getClassList(classes).forEach(function (c) { return map[c] = true; });\n return map;\n};\nvar SCHEME = /^[a-z][a-z0-9+\\-.]*:/;\nvar openURL = function (url, ev, direction) { return __awaiter(void 0, void 0, void 0, function () {\n var router;\n return __generator(this, function (_a) {\n if (url != null && url[0] !== '#' && !SCHEME.test(url)) {\n router = document.querySelector('ion-router');\n if (router) {\n if (ev != null) {\n ev.preventDefault();\n }\n return [2 /*return*/, router.push(url, direction)];\n }\n }\n return [2 /*return*/, false];\n });\n}); };\nexport { createColorClasses as c, getClassMap as g, hostContext as h, openURL as o };\n","/**\n * Does a simple sanitization of all elements\n * in an untrusted string\n */\nvar sanitizeDOMString = function (untrustedString) {\n try {\n if (typeof untrustedString !== 'string' || untrustedString === '') {\n return untrustedString;\n }\n /**\n * Create a document fragment\n * separate from the main DOM,\n * create a div to do our work in\n */\n var documentFragment_1 = document.createDocumentFragment();\n var workingDiv = document.createElement('div');\n documentFragment_1.appendChild(workingDiv);\n workingDiv.innerHTML = untrustedString;\n /**\n * Remove any elements\n * that are blocked\n */\n blockedTags.forEach(function (blockedTag) {\n var getElementsToRemove = documentFragment_1.querySelectorAll(blockedTag);\n for (var elementIndex = getElementsToRemove.length - 1; elementIndex >= 0; elementIndex--) {\n var element = getElementsToRemove[elementIndex];\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n else {\n documentFragment_1.removeChild(element);\n }\n /**\n * We still need to sanitize\n * the children of this element\n * as they are left behind\n */\n var childElements = getElementChildren(element);\n /* tslint:disable-next-line */\n for (var childIndex = 0; childIndex < childElements.length; childIndex++) {\n sanitizeElement(childElements[childIndex]);\n }\n }\n });\n /**\n * Go through remaining elements and remove\n * non-allowed attribs\n */\n // IE does not support .children on document fragments, only .childNodes\n var dfChildren = getElementChildren(documentFragment_1);\n /* tslint:disable-next-line */\n for (var childIndex = 0; childIndex < dfChildren.length; childIndex++) {\n sanitizeElement(dfChildren[childIndex]);\n }\n // Append document fragment to div\n var fragmentDiv = document.createElement('div');\n fragmentDiv.appendChild(documentFragment_1);\n // First child is always the div we did our work in\n var getInnerDiv = fragmentDiv.querySelector('div');\n return (getInnerDiv !== null) ? getInnerDiv.innerHTML : fragmentDiv.innerHTML;\n }\n catch (err) {\n console.error(err);\n return '';\n }\n};\n/**\n * Clean up current element based on allowed attributes\n * and then recursively dig down into any child elements to\n * clean those up as well\n */\nvar sanitizeElement = function (element) {\n // IE uses childNodes, so ignore nodes that are not elements\n if (element.nodeType && element.nodeType !== 1) {\n return;\n }\n for (var i = element.attributes.length - 1; i >= 0; i--) {\n var attribute = element.attributes.item(i);\n var attributeName = attribute.name;\n // remove non-allowed attribs\n if (!allowedAttributes.includes(attributeName.toLowerCase())) {\n element.removeAttribute(attributeName);\n continue;\n }\n // clean up any allowed attribs\n // that attempt to do any JS funny-business\n var attributeValue = attribute.value;\n /* tslint:disable-next-line */\n if (attributeValue != null && attributeValue.toLowerCase().includes('javascript:')) {\n element.removeAttribute(attributeName);\n }\n }\n /**\n * Sanitize any nested children\n */\n var childElements = getElementChildren(element);\n /* tslint:disable-next-line */\n for (var i = 0; i < childElements.length; i++) {\n sanitizeElement(childElements[i]);\n }\n};\n/**\n * IE doesn't always support .children\n * so we revert to .childNodes instead\n */\nvar getElementChildren = function (el) {\n return (el.children != null) ? el.children : el.childNodes;\n};\nvar allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];\nvar blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed'];\nexport { sanitizeDOMString as s };\n"],"sourceRoot":""}