vue-instantsearch 4.4.1 → 4.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var r="4.4.1";export{r as version};
1
+ var r="4.4.2";export{r as version};
2
2
  //# sourceMappingURL=package.json.js.map
@@ -1,2 +1,2 @@
1
- import{createSuitMixin as e}from"../mixins/suit.js";import{isVue2 as t,isVue3 as i}from"../util/vue-compat/index-vue3.js";import{createWidgetMixin as o}from"../mixins/widget.js";import{connectSearchBox as s}from"instantsearch.js/es/connectors/index.js";import l from"./SearchInput.vue.js";export default{name:"AisSearchBox",mixins:[o({connector:s},{$$widgetType:"ais.searchBox"}),e({name:"SearchBox"})],components:{SearchInput:l},props:{placeholder:{type:String,default:"Search here…"},autofocus:{type:Boolean,default:!1},showLoadingIndicator:{type:Boolean,default:!1},submitTitle:{type:String,default:"Search"},resetTitle:{type:String,default:"Clear"},value:{type:String,default:void 0},modelValue:{type:String,default:void 0}},data:function(){return{localValue:"",isVue2:t,isVue3:i}},computed:{isControlled:function(){return void 0!==this.value||void 0!==this.modelValue},model:function(){return this.value||this.modelValue},currentRefinement:{get:function(){this.isControlled&&this.model!==this.localValue&&(this.localValue=this.model,this.$emit("input",this.model),this.$emit("update:modelValue",this.model),this.state.refine(this.model));var e=this.$refs.searchInput;return e&&e.isFocused()?this.localValue:this.model||this.state.query||""},set:function(e){this.localValue=e,this.state.refine(e),this.isControlled&&(this.$emit("input",e),this.$emit("update:modelValue",e))}}}};
1
+ import{createSuitMixin as e}from"../mixins/suit.js";import{isVue2 as t,isVue3 as i}from"../util/vue-compat/index-vue3.js";import{createWidgetMixin as o}from"../mixins/widget.js";import{connectSearchBox as s}from"instantsearch.js/es/connectors/index.js";import a from"./SearchInput.vue.js";export default{name:"AisSearchBox",mixins:[o({connector:s},{$$widgetType:"ais.searchBox"}),e({name:"SearchBox"})],components:{SearchInput:a},props:{placeholder:{type:String,default:"Search here…"},autofocus:{type:Boolean,default:!1},showLoadingIndicator:{type:Boolean,default:!1},submitTitle:{type:String,default:"Search"},resetTitle:{type:String,default:"Clear"},value:{type:String,default:void 0},modelValue:{type:String,default:void 0},queryHook:{type:Function,default:void 0}},data:function(){return{localValue:"",isVue2:t,isVue3:i}},computed:{widgetParams:function(){return{queryHook:this.queryHook}},isControlled:function(){return void 0!==this.value||void 0!==this.modelValue},model:function(){return this.value||this.modelValue},currentRefinement:{get:function(){this.isControlled&&this.model!==this.localValue&&(this.localValue=this.model,this.$emit("input",this.model),this.$emit("update:modelValue",this.model),this.state.refine(this.model));var e=this.$refs.searchInput;return e&&e.isFocused()?this.localValue:this.model||this.state.query||""},set:function(e){this.localValue=e,this.state.refine(e),this.isControlled&&(this.$emit("input",e),this.$emit("update:modelValue",e))}}}};
2
2
  //# sourceMappingURL=SearchBox.vue_vue&type=script&lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.vue_vue&type=script&lang.js","sources":["../../../../src/components/SearchBox.vue"],"sourcesContent":["<template>\n <div\n v-if=\"state\"\n :class=\"suit()\"\n >\n <slot\n :current-refinement=\"currentRefinement\"\n :is-search-stalled=\"state.isSearchStalled\"\n :refine=\"state.refine\"\n >\n <search-input\n @focus=\"$emit('focus', $event)\"\n @blur=\"$emit('blur', $event)\"\n @reset=\"$emit('reset')\"\n :placeholder=\"placeholder\"\n :autofocus=\"autofocus\"\n :show-loading-indicator=\"showLoadingIndicator\"\n :should-show-loading-indicator=\"state.isSearchStalled\"\n :submit-title=\"submitTitle\"\n :reset-title=\"resetTitle\"\n :class-names=\"classNames\"\n v-model=\"currentRefinement\"\n ref=\"searchInput\"\n >\n <template\n v-slot:loading-indicator\n v-if=\"isVue3\"\n >\n <slot\n name=\"loading-indicator\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"loading-indicator\"\n slot=\"loading-indicator\"\n />\n\n <template\n v-slot:submit-icon\n v-if=\"isVue3\"\n >\n <slot\n name=\"submit-icon\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"submit-icon\"\n slot=\"submit-icon\"\n />\n\n <template\n v-slot:reset-icon\n v-if=\"isVue3\"\n >\n <slot\n name=\"reset-icon\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"reset-icon\"\n slot=\"reset-icon\"\n />\n </search-input>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectSearchBox } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\nimport { isVue3, isVue2 } from '../util/vue-compat';\nimport SearchInput from './SearchInput.vue';\n\nexport default {\n name: 'AisSearchBox',\n mixins: [\n createWidgetMixin(\n {\n connector: connectSearchBox,\n },\n {\n $$widgetType: 'ais.searchBox',\n }\n ),\n createSuitMixin({ name: 'SearchBox' }),\n ],\n components: {\n SearchInput,\n },\n props: {\n placeholder: {\n type: String,\n default: 'Search here…',\n },\n autofocus: {\n type: Boolean,\n default: false,\n },\n showLoadingIndicator: {\n type: Boolean,\n default: false,\n },\n submitTitle: {\n type: String,\n default: 'Search',\n },\n resetTitle: {\n type: String,\n default: 'Clear',\n },\n value: {\n type: String,\n default: undefined,\n },\n modelValue: {\n type: String,\n default: undefined,\n },\n },\n data() {\n return {\n localValue: '',\n isVue2,\n isVue3,\n };\n },\n computed: {\n isControlled() {\n return (\n typeof this.value !== 'undefined' ||\n typeof this.modelValue !== 'undefined'\n );\n },\n model() {\n return this.value || this.modelValue;\n },\n currentRefinement: {\n get() {\n // if the input is controlled, but not up to date\n // this means it didn't search, and we should pretend it was `set`\n if (this.isControlled && this.model !== this.localValue) {\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\n this.localValue = this.model;\n this.$emit('input', this.model);\n this.$emit('update:modelValue', this.model);\n this.state.refine(this.model);\n }\n\n // we return the local value if the input is focused to avoid\n // concurrent updates when typing\n const { searchInput } = this.$refs;\n if (searchInput && searchInput.isFocused()) {\n return this.localValue;\n }\n\n return this.model || this.state.query || '';\n },\n set(val) {\n this.localValue = val;\n this.state.refine(val);\n if (this.isControlled) {\n this.$emit('input', val);\n this.$emit('update:modelValue', val);\n }\n },\n },\n },\n};\n</script>\n"],"names":["name","mixins","createWidgetMixin","connector","connectSearchBox","$$widgetType","createSuitMixin","components","SearchInput","props","placeholder","type","String","default","autofocus","Boolean","showLoadingIndicator","submitTitle","resetTitle","value","undefined","modelValue","data","localValue","isVue2","isVue3","computed","isControlled","this","model","currentRefinement","get","$emit","state","refine","$refs","searchInput","isFocused","query","set","val"],"mappings":"+SA6Ee,CACbA,KAAM,eACNC,OAAQ,CACNC,EACE,CACEC,UAAWC,GAEb,CACEC,aAAc,kBAGlBC,EAAgB,CAAEN,KAAM,eAE1BO,WAAY,aACVC,GAEFC,MAAO,CACLC,YAAa,CACXC,KAAMC,OACNC,QAAS,gBAEXC,UAAW,CACTH,KAAMI,QACNF,SAAS,GAEXG,qBAAsB,CACpBL,KAAMI,QACNF,SAAS,GAEXI,YAAa,CACXN,KAAMC,OACNC,QAAS,UAEXK,WAAY,CACVP,KAAMC,OACNC,QAAS,SAEXM,MAAO,CACLR,KAAMC,OACNC,aAASO,GAEXC,WAAY,CACVV,KAAMC,OACNC,aAASO,IAGbE,sBACS,CACLC,WAAY,UACZC,SACAC,IAGJC,SAAU,CACRC,oCAE0B,IAAfC,KAAKT,YACe,IAApBS,KAAKP,YAGhBQ,wBACSD,KAAKT,OAASS,KAAKP,YAE5BS,kBAAmB,CACjBC,eAGMH,KAAKD,cAAgBC,KAAKC,QAAUD,KAAKL,kBAEtCA,WAAaK,KAAKC,WAClBG,MAAM,QAASJ,KAAKC,YACpBG,MAAM,oBAAqBJ,KAAKC,YAChCI,MAAMC,OAAON,KAAKC,cAKDD,KAAKO,yBACzBC,GAAeA,EAAYC,YACtBT,KAAKL,WAGPK,KAAKC,OAASD,KAAKK,MAAMK,OAAS,IAE3CC,aAAIC,QACGjB,WAAaiB,OACbP,MAAMC,OAAOM,GACdZ,KAAKD,oBACFK,MAAM,QAASQ,QACfR,MAAM,oBAAqBQ"}
1
+ {"version":3,"file":"SearchBox.vue_vue&type=script&lang.js","sources":["../../../../src/components/SearchBox.vue"],"sourcesContent":["<template>\n <div\n v-if=\"state\"\n :class=\"suit()\"\n >\n <slot\n :current-refinement=\"currentRefinement\"\n :is-search-stalled=\"state.isSearchStalled\"\n :refine=\"state.refine\"\n >\n <search-input\n @focus=\"$emit('focus', $event)\"\n @blur=\"$emit('blur', $event)\"\n @reset=\"$emit('reset')\"\n :placeholder=\"placeholder\"\n :autofocus=\"autofocus\"\n :show-loading-indicator=\"showLoadingIndicator\"\n :should-show-loading-indicator=\"state.isSearchStalled\"\n :submit-title=\"submitTitle\"\n :reset-title=\"resetTitle\"\n :class-names=\"classNames\"\n v-model=\"currentRefinement\"\n ref=\"searchInput\"\n >\n <template\n v-slot:loading-indicator\n v-if=\"isVue3\"\n >\n <slot\n name=\"loading-indicator\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"loading-indicator\"\n slot=\"loading-indicator\"\n />\n\n <template\n v-slot:submit-icon\n v-if=\"isVue3\"\n >\n <slot\n name=\"submit-icon\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"submit-icon\"\n slot=\"submit-icon\"\n />\n\n <template\n v-slot:reset-icon\n v-if=\"isVue3\"\n >\n <slot\n name=\"reset-icon\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"reset-icon\"\n slot=\"reset-icon\"\n />\n </search-input>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectSearchBox } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\nimport { isVue3, isVue2 } from '../util/vue-compat';\nimport SearchInput from './SearchInput.vue';\n\nexport default {\n name: 'AisSearchBox',\n mixins: [\n createWidgetMixin(\n {\n connector: connectSearchBox,\n },\n {\n $$widgetType: 'ais.searchBox',\n }\n ),\n createSuitMixin({ name: 'SearchBox' }),\n ],\n components: {\n SearchInput,\n },\n props: {\n placeholder: {\n type: String,\n default: 'Search here…',\n },\n autofocus: {\n type: Boolean,\n default: false,\n },\n showLoadingIndicator: {\n type: Boolean,\n default: false,\n },\n submitTitle: {\n type: String,\n default: 'Search',\n },\n resetTitle: {\n type: String,\n default: 'Clear',\n },\n value: {\n type: String,\n default: undefined,\n },\n modelValue: {\n type: String,\n default: undefined,\n },\n queryHook: {\n type: Function,\n default: undefined,\n },\n },\n data() {\n return {\n localValue: '',\n isVue2,\n isVue3,\n };\n },\n computed: {\n widgetParams() {\n return {\n queryHook: this.queryHook,\n };\n },\n isControlled() {\n return (\n typeof this.value !== 'undefined' ||\n typeof this.modelValue !== 'undefined'\n );\n },\n model() {\n return this.value || this.modelValue;\n },\n currentRefinement: {\n get() {\n // if the input is controlled, but not up to date\n // this means it didn't search, and we should pretend it was `set`\n if (this.isControlled && this.model !== this.localValue) {\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\n this.localValue = this.model;\n this.$emit('input', this.model);\n this.$emit('update:modelValue', this.model);\n this.state.refine(this.model);\n }\n\n // we return the local value if the input is focused to avoid\n // concurrent updates when typing\n const { searchInput } = this.$refs;\n if (searchInput && searchInput.isFocused()) {\n return this.localValue;\n }\n\n return this.model || this.state.query || '';\n },\n set(val) {\n this.localValue = val;\n this.state.refine(val);\n if (this.isControlled) {\n this.$emit('input', val);\n this.$emit('update:modelValue', val);\n }\n },\n },\n },\n};\n</script>\n"],"names":["name","mixins","createWidgetMixin","connector","connectSearchBox","$$widgetType","createSuitMixin","components","SearchInput","props","placeholder","type","String","default","autofocus","Boolean","showLoadingIndicator","submitTitle","resetTitle","value","undefined","modelValue","queryHook","Function","data","localValue","isVue2","isVue3","computed","widgetParams","this","isControlled","model","currentRefinement","get","$emit","state","refine","$refs","searchInput","isFocused","query","set","val"],"mappings":"+SA6Ee,CACbA,KAAM,eACNC,OAAQ,CACNC,EACE,CACEC,UAAWC,GAEb,CACEC,aAAc,kBAGlBC,EAAgB,CAAEN,KAAM,eAE1BO,WAAY,aACVC,GAEFC,MAAO,CACLC,YAAa,CACXC,KAAMC,OACNC,QAAS,gBAEXC,UAAW,CACTH,KAAMI,QACNF,SAAS,GAEXG,qBAAsB,CACpBL,KAAMI,QACNF,SAAS,GAEXI,YAAa,CACXN,KAAMC,OACNC,QAAS,UAEXK,WAAY,CACVP,KAAMC,OACNC,QAAS,SAEXM,MAAO,CACLR,KAAMC,OACNC,aAASO,GAEXC,WAAY,CACVV,KAAMC,OACNC,aAASO,GAEXE,UAAW,CACTX,KAAMY,SACNV,aAASO,IAGbI,sBACS,CACLC,WAAY,UACZC,SACAC,IAGJC,SAAU,CACRC,8BACS,CACLP,UAAWQ,KAAKR,YAGpBS,oCAE0B,IAAfD,KAAKX,YACe,IAApBW,KAAKT,YAGhBW,wBACSF,KAAKX,OAASW,KAAKT,YAE5BY,kBAAmB,CACjBC,eAGMJ,KAAKC,cAAgBD,KAAKE,QAAUF,KAAKL,kBAEtCA,WAAaK,KAAKE,WAClBG,MAAM,QAASL,KAAKE,YACpBG,MAAM,oBAAqBL,KAAKE,YAChCI,MAAMC,OAAOP,KAAKE,cAKDF,KAAKQ,yBACzBC,GAAeA,EAAYC,YACtBV,KAAKL,WAGPK,KAAKE,OAASF,KAAKM,MAAMK,OAAS,IAE3CC,aAAIC,QACGlB,WAAakB,OACbP,MAAMC,OAAOM,GACdb,KAAKC,oBACFI,MAAM,QAASQ,QACfR,MAAM,oBAAqBQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.vue_vue&type=template&id=27029d83&lang.js","sources":["../../../../src/components/SearchBox.vue?vue&type=template&id=27029d83&lang.js"],"sourcesContent":["<template>\n <div\n v-if=\"state\"\n :class=\"suit()\"\n >\n <slot\n :current-refinement=\"currentRefinement\"\n :is-search-stalled=\"state.isSearchStalled\"\n :refine=\"state.refine\"\n >\n <search-input\n @focus=\"$emit('focus', $event)\"\n @blur=\"$emit('blur', $event)\"\n @reset=\"$emit('reset')\"\n :placeholder=\"placeholder\"\n :autofocus=\"autofocus\"\n :show-loading-indicator=\"showLoadingIndicator\"\n :should-show-loading-indicator=\"state.isSearchStalled\"\n :submit-title=\"submitTitle\"\n :reset-title=\"resetTitle\"\n :class-names=\"classNames\"\n v-model=\"currentRefinement\"\n ref=\"searchInput\"\n >\n <template\n v-slot:loading-indicator\n v-if=\"isVue3\"\n >\n <slot\n name=\"loading-indicator\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"loading-indicator\"\n slot=\"loading-indicator\"\n />\n\n <template\n v-slot:submit-icon\n v-if=\"isVue3\"\n >\n <slot\n name=\"submit-icon\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"submit-icon\"\n slot=\"submit-icon\"\n />\n\n <template\n v-slot:reset-icon\n v-if=\"isVue3\"\n >\n <slot\n name=\"reset-icon\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"reset-icon\"\n slot=\"reset-icon\"\n />\n </search-input>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectSearchBox } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\nimport { isVue3, isVue2 } from '../util/vue-compat';\nimport SearchInput from './SearchInput.vue';\n\nexport default {\n name: 'AisSearchBox',\n mixins: [\n createWidgetMixin(\n {\n connector: connectSearchBox,\n },\n {\n $$widgetType: 'ais.searchBox',\n }\n ),\n createSuitMixin({ name: 'SearchBox' }),\n ],\n components: {\n SearchInput,\n },\n props: {\n placeholder: {\n type: String,\n default: 'Search here…',\n },\n autofocus: {\n type: Boolean,\n default: false,\n },\n showLoadingIndicator: {\n type: Boolean,\n default: false,\n },\n submitTitle: {\n type: String,\n default: 'Search',\n },\n resetTitle: {\n type: String,\n default: 'Clear',\n },\n value: {\n type: String,\n default: undefined,\n },\n modelValue: {\n type: String,\n default: undefined,\n },\n },\n data() {\n return {\n localValue: '',\n isVue2,\n isVue3,\n };\n },\n computed: {\n isControlled() {\n return (\n typeof this.value !== 'undefined' ||\n typeof this.modelValue !== 'undefined'\n );\n },\n model() {\n return this.value || this.modelValue;\n },\n currentRefinement: {\n get() {\n // if the input is controlled, but not up to date\n // this means it didn't search, and we should pretend it was `set`\n if (this.isControlled && this.model !== this.localValue) {\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\n this.localValue = this.model;\n this.$emit('input', this.model);\n this.$emit('update:modelValue', this.model);\n this.state.refine(this.model);\n }\n\n // we return the local value if the input is focused to avoid\n // concurrent updates when typing\n const { searchInput } = this.$refs;\n if (searchInput && searchInput.isFocused()) {\n return this.localValue;\n }\n\n return this.model || this.state.query || '';\n },\n set(val) {\n this.localValue = val;\n this.state.refine(val);\n if (this.isControlled) {\n this.$emit('input', val);\n this.$emit('update:modelValue', val);\n }\n },\n },\n },\n};\n</script>\n"],"names":["_ctx","_createBlock","class","_renderSlot","currentRefinement","$options","isSearchStalled","refine","_createVNode","onFocus","$event","onBlur","onReset","placeholder","$props","autofocus","ref","$data","slot"],"mappings":"qNAEUA,aADRC,eAEGC,MAAOF,WAERG,sBACGC,kBAAoBC,oBACpBC,gBAAmBN,QAAMM,gBACzBC,OAAQP,QAAMO,0BAEfC,KACGC,uCAAOT,gBAAeU,KACtBC,sCAAMX,eAAcU,KACpBE,uCAAOZ,mBACPa,YAAaC,cACbC,UAAWD,qCACaA,uDACOd,QAAMM,+BACvBQ,4BACDA,2BACAd,wBACLK,yEAAAA,wBACTW,IAAI,8CAWIC,SADRd,sCAGEe,KAAK,mCAYCD,SADRd,gCAGEe,KAAK,6BAYCD,SADRd,+BAGEe,KAAK,qCArCCD,eADC,2CAGPd,2CAYMc,eADC,qCAGPd,qCAYMc,eADC,oCAGPd"}
1
+ {"version":3,"file":"SearchBox.vue_vue&type=template&id=27029d83&lang.js","sources":["../../../../src/components/SearchBox.vue?vue&type=template&id=27029d83&lang.js"],"sourcesContent":["<template>\n <div\n v-if=\"state\"\n :class=\"suit()\"\n >\n <slot\n :current-refinement=\"currentRefinement\"\n :is-search-stalled=\"state.isSearchStalled\"\n :refine=\"state.refine\"\n >\n <search-input\n @focus=\"$emit('focus', $event)\"\n @blur=\"$emit('blur', $event)\"\n @reset=\"$emit('reset')\"\n :placeholder=\"placeholder\"\n :autofocus=\"autofocus\"\n :show-loading-indicator=\"showLoadingIndicator\"\n :should-show-loading-indicator=\"state.isSearchStalled\"\n :submit-title=\"submitTitle\"\n :reset-title=\"resetTitle\"\n :class-names=\"classNames\"\n v-model=\"currentRefinement\"\n ref=\"searchInput\"\n >\n <template\n v-slot:loading-indicator\n v-if=\"isVue3\"\n >\n <slot\n name=\"loading-indicator\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"loading-indicator\"\n slot=\"loading-indicator\"\n />\n\n <template\n v-slot:submit-icon\n v-if=\"isVue3\"\n >\n <slot\n name=\"submit-icon\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"submit-icon\"\n slot=\"submit-icon\"\n />\n\n <template\n v-slot:reset-icon\n v-if=\"isVue3\"\n >\n <slot\n name=\"reset-icon\"\n />\n </template>\n <slot\n v-if=\"isVue2\"\n name=\"reset-icon\"\n slot=\"reset-icon\"\n />\n </search-input>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectSearchBox } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\nimport { isVue3, isVue2 } from '../util/vue-compat';\nimport SearchInput from './SearchInput.vue';\n\nexport default {\n name: 'AisSearchBox',\n mixins: [\n createWidgetMixin(\n {\n connector: connectSearchBox,\n },\n {\n $$widgetType: 'ais.searchBox',\n }\n ),\n createSuitMixin({ name: 'SearchBox' }),\n ],\n components: {\n SearchInput,\n },\n props: {\n placeholder: {\n type: String,\n default: 'Search here…',\n },\n autofocus: {\n type: Boolean,\n default: false,\n },\n showLoadingIndicator: {\n type: Boolean,\n default: false,\n },\n submitTitle: {\n type: String,\n default: 'Search',\n },\n resetTitle: {\n type: String,\n default: 'Clear',\n },\n value: {\n type: String,\n default: undefined,\n },\n modelValue: {\n type: String,\n default: undefined,\n },\n queryHook: {\n type: Function,\n default: undefined,\n },\n },\n data() {\n return {\n localValue: '',\n isVue2,\n isVue3,\n };\n },\n computed: {\n widgetParams() {\n return {\n queryHook: this.queryHook,\n };\n },\n isControlled() {\n return (\n typeof this.value !== 'undefined' ||\n typeof this.modelValue !== 'undefined'\n );\n },\n model() {\n return this.value || this.modelValue;\n },\n currentRefinement: {\n get() {\n // if the input is controlled, but not up to date\n // this means it didn't search, and we should pretend it was `set`\n if (this.isControlled && this.model !== this.localValue) {\n // eslint-disable-next-line vue/no-side-effects-in-computed-properties\n this.localValue = this.model;\n this.$emit('input', this.model);\n this.$emit('update:modelValue', this.model);\n this.state.refine(this.model);\n }\n\n // we return the local value if the input is focused to avoid\n // concurrent updates when typing\n const { searchInput } = this.$refs;\n if (searchInput && searchInput.isFocused()) {\n return this.localValue;\n }\n\n return this.model || this.state.query || '';\n },\n set(val) {\n this.localValue = val;\n this.state.refine(val);\n if (this.isControlled) {\n this.$emit('input', val);\n this.$emit('update:modelValue', val);\n }\n },\n },\n },\n};\n</script>\n"],"names":["_ctx","_createBlock","class","_renderSlot","currentRefinement","$options","isSearchStalled","refine","_createVNode","onFocus","$event","onBlur","onReset","placeholder","$props","autofocus","ref","$data","slot"],"mappings":"qNAEUA,aADRC,eAEGC,MAAOF,WAERG,sBACGC,kBAAoBC,oBACpBC,gBAAmBN,QAAMM,gBACzBC,OAAQP,QAAMO,0BAEfC,KACGC,uCAAOT,gBAAeU,KACtBC,sCAAMX,eAAcU,KACpBE,uCAAOZ,mBACPa,YAAaC,cACbC,UAAWD,qCACaA,uDACOd,QAAMM,+BACvBQ,4BACDA,2BACAd,wBACLK,yEAAAA,wBACTW,IAAI,8CAWIC,SADRd,sCAGEe,KAAK,mCAYCD,SADRd,gCAGEe,KAAK,6BAYCD,SADRd,+BAGEe,KAAK,qCArCCD,eADC,2CAGPd,2CAYMc,eADC,qCAGPd,qCAYMc,eADC,oCAGPd"}
@@ -1,2 +1,2 @@
1
- import{createSuitMixin as t}from"../mixins/suit.js";import{createWidgetMixin as e}from"../mixins/widget.js";import{connectVoiceSearch as i}from"instantsearch.js/es/connectors/index.js";export default{name:"AisVoiceSearch",mixins:[e({connector:i},{$$widgetType:"ais.voiceSearch"}),t({name:"VoiceSearch"})],props:{searchAsYouSpeak:{type:Boolean,required:!1,default:void 0},buttonTitle:{type:String,required:!1,default:"Search by voice"},disabledButtonTitle:{type:String,required:!1,default:"Search by voice (not supported on this browser)"}},data:function(){return{buttonSvgAttrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}}},computed:{widgetParams:function(){return{searchAsYouSpeak:this.searchAsYouSpeak}},errorNotAllowed:function(){return"error"===this.state.voiceListeningState.status&&"not-allowed"===this.state.voiceListeningState.errorCode},rootSlotProps:function(){return{isBrowserSupported:this.state.isBrowserSupported,isListening:this.state.isListening,toggleListening:this.state.toggleListening,voiceListeningState:this.state.voiceListeningState}},innerSlotProps:function(){return{status:this.state.voiceListeningState.status,errorCode:this.state.voiceListeningState.errorCode,isListening:this.state.isListening,transcript:this.state.voiceListeningState.transcript,isSpeechFinal:this.state.voiceListeningState.isSpeechFinal,isBrowserSupported:this.state.isBrowserSupported}}},methods:{handleClick:function(t){t.currentTarget.blur(),this.state.toggleListening()}}};
1
+ import{createSuitMixin as t}from"../mixins/suit.js";import{createWidgetMixin as e}from"../mixins/widget.js";import{connectVoiceSearch as i}from"instantsearch.js/es/connectors/index.js";export default{name:"AisVoiceSearch",mixins:[e({connector:i},{$$widgetType:"ais.voiceSearch"}),t({name:"VoiceSearch"})],props:{searchAsYouSpeak:{type:Boolean,required:!1,default:void 0},language:{type:String,default:void 0},additionalQueryParameters:{type:Object,default:void 0},buttonTitle:{type:String,required:!1,default:"Search by voice"},disabledButtonTitle:{type:String,required:!1,default:"Search by voice (not supported on this browser)"}},data:function(){return{buttonSvgAttrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}}},computed:{widgetParams:function(){return{searchAsYouSpeak:this.searchAsYouSpeak,language:this.language,additionalQueryParameters:this.additionalQueryParameters}},errorNotAllowed:function(){return"error"===this.state.voiceListeningState.status&&"not-allowed"===this.state.voiceListeningState.errorCode},rootSlotProps:function(){return{isBrowserSupported:this.state.isBrowserSupported,isListening:this.state.isListening,toggleListening:this.state.toggleListening,voiceListeningState:this.state.voiceListeningState}},innerSlotProps:function(){return{status:this.state.voiceListeningState.status,errorCode:this.state.voiceListeningState.errorCode,isListening:this.state.isListening,transcript:this.state.voiceListeningState.transcript,isSpeechFinal:this.state.voiceListeningState.isSpeechFinal,isBrowserSupported:this.state.isBrowserSupported}}},methods:{handleClick:function(t){t.currentTarget.blur(),this.state.toggleListening()}}};
2
2
  //# sourceMappingURL=VoiceSearch.vue_vue&type=script&lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VoiceSearch.vue_vue&type=script&lang.js","sources":["../../../../src/components/VoiceSearch.vue"],"sourcesContent":["<template>\n <div\n v-if=\"state\"\n :class=\"suit()\"\n >\n <slot v-bind=\"rootSlotProps\">\n <button\n type=\"button\"\n :class=\"suit('button')\"\n :title=\"state.isBrowserSupported ? buttonTitle : disabledButtonTitle\"\n :disabled=\"!state.isBrowserSupported\"\n @click=\"handleClick\"\n >\n <slot\n name=\"buttonText\"\n v-bind=\"innerSlotProps\"\n >\n <svg\n v-bind=\"buttonSvgAttrs\"\n v-if=\"errorNotAllowed\"\n >\n <line\n x1=\"1\"\n y1=\"1\"\n x2=\"23\"\n y2=\"23\"\n />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6\" />\n <path d=\"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23\" />\n <line\n x1=\"12\"\n y1=\"19\"\n x2=\"12\"\n y2=\"23\"\n />\n <line\n x1=\"8\"\n y1=\"23\"\n x2=\"16\"\n y2=\"23\"\n />\n </svg>\n <svg\n v-bind=\"buttonSvgAttrs\"\n v-else\n >\n <path\n d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\"\n :fill=\"state.isListening ? 'currentColor' : 'none'\"\n />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <line\n x1=\"12\"\n y1=\"19\"\n x2=\"12\"\n y2=\"23\"\n />\n <line\n x1=\"8\"\n y1=\"23\"\n x2=\"16\"\n y2=\"23\"\n />\n </svg>\n </slot>\n </button>\n <div :class=\"suit('status')\">\n <slot\n name=\"status\"\n v-bind=\"innerSlotProps\"\n >\n <p>{{ state.voiceListeningState.transcript }}</p>\n </slot>\n </div>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectVoiceSearch } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\n\nexport default {\n name: 'AisVoiceSearch',\n mixins: [\n createWidgetMixin(\n {\n connector: connectVoiceSearch,\n },\n {\n $$widgetType: 'ais.voiceSearch',\n }\n ),\n createSuitMixin({ name: 'VoiceSearch' }),\n ],\n props: {\n searchAsYouSpeak: {\n type: Boolean,\n required: false,\n default: undefined,\n },\n buttonTitle: {\n type: String,\n required: false,\n default: 'Search by voice',\n },\n disabledButtonTitle: {\n type: String,\n required: false,\n default: 'Search by voice (not supported on this browser)',\n },\n },\n data() {\n return {\n buttonSvgAttrs: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: '16',\n height: '16',\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: '2',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n },\n };\n },\n computed: {\n widgetParams() {\n return {\n searchAsYouSpeak: this.searchAsYouSpeak,\n };\n },\n errorNotAllowed() {\n return (\n this.state.voiceListeningState.status === 'error' &&\n this.state.voiceListeningState.errorCode === 'not-allowed'\n );\n },\n rootSlotProps() {\n return {\n isBrowserSupported: this.state.isBrowserSupported,\n isListening: this.state.isListening,\n toggleListening: this.state.toggleListening,\n voiceListeningState: this.state.voiceListeningState,\n };\n },\n innerSlotProps() {\n return {\n status: this.state.voiceListeningState.status,\n errorCode: this.state.voiceListeningState.errorCode,\n isListening: this.state.isListening,\n transcript: this.state.voiceListeningState.transcript,\n isSpeechFinal: this.state.voiceListeningState.isSpeechFinal,\n isBrowserSupported: this.state.isBrowserSupported,\n };\n },\n },\n methods: {\n handleClick(event) {\n event.currentTarget.blur();\n this.state.toggleListening();\n },\n },\n};\n</script>\n"],"names":["name","mixins","createWidgetMixin","connector","connectVoiceSearch","$$widgetType","createSuitMixin","props","searchAsYouSpeak","type","Boolean","required","default","undefined","buttonTitle","String","disabledButtonTitle","data","buttonSvgAttrs","xmlns","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","computed","widgetParams","this","errorNotAllowed","state","voiceListeningState","status","errorCode","rootSlotProps","isBrowserSupported","isListening","toggleListening","innerSlotProps","transcript","isSpeechFinal","methods","handleClick","event","currentTarget","blur"],"mappings":"uMAmFe,CACbA,KAAM,iBACNC,OAAQ,CACNC,EACE,CACEC,UAAWC,GAEb,CACEC,aAAc,oBAGlBC,EAAgB,CAAEN,KAAM,iBAE1BO,MAAO,CACLC,iBAAkB,CAChBC,KAAMC,QACNC,UAAU,EACVC,aAASC,GAEXC,YAAa,CACXL,KAAMM,OACNJ,UAAU,EACVC,QAAS,mBAEXI,oBAAqB,CACnBP,KAAMM,OACNJ,UAAU,EACVC,QAAS,oDAGbK,sBACS,CACLC,eAAgB,CACdC,MAAO,6BACPC,MAAO,KACPC,OAAQ,KACRC,QAAS,YACTC,KAAM,OACNC,OAAQ,eACRC,YAAa,IACbC,cAAe,QACfC,eAAgB,WAItBC,SAAU,CACRC,8BACS,CACLrB,iBAAkBsB,KAAKtB,mBAG3BuB,iCAE8C,UAA1CD,KAAKE,MAAMC,oBAAoBC,QACc,gBAA7CJ,KAAKE,MAAMC,oBAAoBE,WAGnCC,+BACS,CACLC,mBAAoBP,KAAKE,MAAMK,mBAC/BC,YAAaR,KAAKE,MAAMM,YACxBC,gBAAiBT,KAAKE,MAAMO,gBAC5BN,oBAAqBH,KAAKE,MAAMC,sBAGpCO,gCACS,CACLN,OAAQJ,KAAKE,MAAMC,oBAAoBC,OACvCC,UAAWL,KAAKE,MAAMC,oBAAoBE,UAC1CG,YAAaR,KAAKE,MAAMM,YACxBG,WAAYX,KAAKE,MAAMC,oBAAoBQ,WAC3CC,cAAeZ,KAAKE,MAAMC,oBAAoBS,cAC9CL,mBAAoBP,KAAKE,MAAMK,sBAIrCM,QAAS,CACPC,qBAAYC,GACVA,EAAMC,cAAcC,YACff,MAAMO"}
1
+ {"version":3,"file":"VoiceSearch.vue_vue&type=script&lang.js","sources":["../../../../src/components/VoiceSearch.vue"],"sourcesContent":["<template>\n <div\n v-if=\"state\"\n :class=\"suit()\"\n >\n <slot v-bind=\"rootSlotProps\">\n <button\n type=\"button\"\n :class=\"suit('button')\"\n :title=\"state.isBrowserSupported ? buttonTitle : disabledButtonTitle\"\n :disabled=\"!state.isBrowserSupported\"\n @click=\"handleClick\"\n >\n <slot\n name=\"buttonText\"\n v-bind=\"innerSlotProps\"\n >\n <svg\n v-bind=\"buttonSvgAttrs\"\n v-if=\"errorNotAllowed\"\n >\n <line\n x1=\"1\"\n y1=\"1\"\n x2=\"23\"\n y2=\"23\"\n />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6\" />\n <path d=\"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23\" />\n <line\n x1=\"12\"\n y1=\"19\"\n x2=\"12\"\n y2=\"23\"\n />\n <line\n x1=\"8\"\n y1=\"23\"\n x2=\"16\"\n y2=\"23\"\n />\n </svg>\n <svg\n v-bind=\"buttonSvgAttrs\"\n v-else\n >\n <path\n d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\"\n :fill=\"state.isListening ? 'currentColor' : 'none'\"\n />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <line\n x1=\"12\"\n y1=\"19\"\n x2=\"12\"\n y2=\"23\"\n />\n <line\n x1=\"8\"\n y1=\"23\"\n x2=\"16\"\n y2=\"23\"\n />\n </svg>\n </slot>\n </button>\n <div :class=\"suit('status')\">\n <slot\n name=\"status\"\n v-bind=\"innerSlotProps\"\n >\n <p>{{ state.voiceListeningState.transcript }}</p>\n </slot>\n </div>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectVoiceSearch } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\n\nexport default {\n name: 'AisVoiceSearch',\n mixins: [\n createWidgetMixin(\n {\n connector: connectVoiceSearch,\n },\n {\n $$widgetType: 'ais.voiceSearch',\n }\n ),\n createSuitMixin({ name: 'VoiceSearch' }),\n ],\n props: {\n searchAsYouSpeak: {\n type: Boolean,\n required: false,\n default: undefined,\n },\n language: {\n type: String,\n default: undefined,\n },\n additionalQueryParameters: {\n type: Object,\n default: undefined,\n },\n buttonTitle: {\n type: String,\n required: false,\n default: 'Search by voice',\n },\n disabledButtonTitle: {\n type: String,\n required: false,\n default: 'Search by voice (not supported on this browser)',\n },\n },\n data() {\n return {\n buttonSvgAttrs: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: '16',\n height: '16',\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: '2',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n },\n };\n },\n computed: {\n widgetParams() {\n return {\n searchAsYouSpeak: this.searchAsYouSpeak,\n language: this.language,\n additionalQueryParameters: this.additionalQueryParameters,\n };\n },\n errorNotAllowed() {\n return (\n this.state.voiceListeningState.status === 'error' &&\n this.state.voiceListeningState.errorCode === 'not-allowed'\n );\n },\n rootSlotProps() {\n return {\n isBrowserSupported: this.state.isBrowserSupported,\n isListening: this.state.isListening,\n toggleListening: this.state.toggleListening,\n voiceListeningState: this.state.voiceListeningState,\n };\n },\n innerSlotProps() {\n return {\n status: this.state.voiceListeningState.status,\n errorCode: this.state.voiceListeningState.errorCode,\n isListening: this.state.isListening,\n transcript: this.state.voiceListeningState.transcript,\n isSpeechFinal: this.state.voiceListeningState.isSpeechFinal,\n isBrowserSupported: this.state.isBrowserSupported,\n };\n },\n },\n methods: {\n handleClick(event) {\n event.currentTarget.blur();\n this.state.toggleListening();\n },\n },\n};\n</script>\n"],"names":["name","mixins","createWidgetMixin","connector","connectVoiceSearch","$$widgetType","createSuitMixin","props","searchAsYouSpeak","type","Boolean","required","default","undefined","language","String","additionalQueryParameters","Object","buttonTitle","disabledButtonTitle","data","buttonSvgAttrs","xmlns","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","computed","widgetParams","this","errorNotAllowed","state","voiceListeningState","status","errorCode","rootSlotProps","isBrowserSupported","isListening","toggleListening","innerSlotProps","transcript","isSpeechFinal","methods","handleClick","event","currentTarget","blur"],"mappings":"uMAmFe,CACbA,KAAM,iBACNC,OAAQ,CACNC,EACE,CACEC,UAAWC,GAEb,CACEC,aAAc,oBAGlBC,EAAgB,CAAEN,KAAM,iBAE1BO,MAAO,CACLC,iBAAkB,CAChBC,KAAMC,QACNC,UAAU,EACVC,aAASC,GAEXC,SAAU,CACRL,KAAMM,OACNH,aAASC,GAEXG,0BAA2B,CACzBP,KAAMQ,OACNL,aAASC,GAEXK,YAAa,CACXT,KAAMM,OACNJ,UAAU,EACVC,QAAS,mBAEXO,oBAAqB,CACnBV,KAAMM,OACNJ,UAAU,EACVC,QAAS,oDAGbQ,sBACS,CACLC,eAAgB,CACdC,MAAO,6BACPC,MAAO,KACPC,OAAQ,KACRC,QAAS,YACTC,KAAM,OACNC,OAAQ,eACRC,YAAa,IACbC,cAAe,QACfC,eAAgB,WAItBC,SAAU,CACRC,8BACS,CACLxB,iBAAkByB,KAAKzB,iBACvBM,SAAUmB,KAAKnB,SACfE,0BAA2BiB,KAAKjB,4BAGpCkB,iCAE8C,UAA1CD,KAAKE,MAAMC,oBAAoBC,QACc,gBAA7CJ,KAAKE,MAAMC,oBAAoBE,WAGnCC,+BACS,CACLC,mBAAoBP,KAAKE,MAAMK,mBAC/BC,YAAaR,KAAKE,MAAMM,YACxBC,gBAAiBT,KAAKE,MAAMO,gBAC5BN,oBAAqBH,KAAKE,MAAMC,sBAGpCO,gCACS,CACLN,OAAQJ,KAAKE,MAAMC,oBAAoBC,OACvCC,UAAWL,KAAKE,MAAMC,oBAAoBE,UAC1CG,YAAaR,KAAKE,MAAMM,YACxBG,WAAYX,KAAKE,MAAMC,oBAAoBQ,WAC3CC,cAAeZ,KAAKE,MAAMC,oBAAoBS,cAC9CL,mBAAoBP,KAAKE,MAAMK,sBAIrCM,QAAS,CACPC,qBAAYC,GACVA,EAAMC,cAAcC,YACff,MAAMO"}
@@ -1 +1 @@
1
- {"version":3,"file":"VoiceSearch.vue_vue&type=template&id=24b0f67a&lang.js","sources":["../../../../src/components/VoiceSearch.vue?vue&type=template&id=24b0f67a&lang.js"],"sourcesContent":["<template>\n <div\n v-if=\"state\"\n :class=\"suit()\"\n >\n <slot v-bind=\"rootSlotProps\">\n <button\n type=\"button\"\n :class=\"suit('button')\"\n :title=\"state.isBrowserSupported ? buttonTitle : disabledButtonTitle\"\n :disabled=\"!state.isBrowserSupported\"\n @click=\"handleClick\"\n >\n <slot\n name=\"buttonText\"\n v-bind=\"innerSlotProps\"\n >\n <svg\n v-bind=\"buttonSvgAttrs\"\n v-if=\"errorNotAllowed\"\n >\n <line\n x1=\"1\"\n y1=\"1\"\n x2=\"23\"\n y2=\"23\"\n />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6\" />\n <path d=\"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23\" />\n <line\n x1=\"12\"\n y1=\"19\"\n x2=\"12\"\n y2=\"23\"\n />\n <line\n x1=\"8\"\n y1=\"23\"\n x2=\"16\"\n y2=\"23\"\n />\n </svg>\n <svg\n v-bind=\"buttonSvgAttrs\"\n v-else\n >\n <path\n d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\"\n :fill=\"state.isListening ? 'currentColor' : 'none'\"\n />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <line\n x1=\"12\"\n y1=\"19\"\n x2=\"12\"\n y2=\"23\"\n />\n <line\n x1=\"8\"\n y1=\"23\"\n x2=\"16\"\n y2=\"23\"\n />\n </svg>\n </slot>\n </button>\n <div :class=\"suit('status')\">\n <slot\n name=\"status\"\n v-bind=\"innerSlotProps\"\n >\n <p>{{ state.voiceListeningState.transcript }}</p>\n </slot>\n </div>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectVoiceSearch } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\n\nexport default {\n name: 'AisVoiceSearch',\n mixins: [\n createWidgetMixin(\n {\n connector: connectVoiceSearch,\n },\n {\n $$widgetType: 'ais.voiceSearch',\n }\n ),\n createSuitMixin({ name: 'VoiceSearch' }),\n ],\n props: {\n searchAsYouSpeak: {\n type: Boolean,\n required: false,\n default: undefined,\n },\n buttonTitle: {\n type: String,\n required: false,\n default: 'Search by voice',\n },\n disabledButtonTitle: {\n type: String,\n required: false,\n default: 'Search by voice (not supported on this browser)',\n },\n },\n data() {\n return {\n buttonSvgAttrs: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: '16',\n height: '16',\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: '2',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n },\n };\n },\n computed: {\n widgetParams() {\n return {\n searchAsYouSpeak: this.searchAsYouSpeak,\n };\n },\n errorNotAllowed() {\n return (\n this.state.voiceListeningState.status === 'error' &&\n this.state.voiceListeningState.errorCode === 'not-allowed'\n );\n },\n rootSlotProps() {\n return {\n isBrowserSupported: this.state.isBrowserSupported,\n isListening: this.state.isListening,\n toggleListening: this.state.toggleListening,\n voiceListeningState: this.state.voiceListeningState,\n };\n },\n innerSlotProps() {\n return {\n status: this.state.voiceListeningState.status,\n errorCode: this.state.voiceListeningState.errorCode,\n isListening: this.state.isListening,\n transcript: this.state.voiceListeningState.transcript,\n isSpeechFinal: this.state.voiceListeningState.isSpeechFinal,\n isBrowserSupported: this.state.isBrowserSupported,\n };\n },\n },\n methods: {\n handleClick(event) {\n event.currentTarget.blur();\n this.state.toggleListening();\n },\n },\n};\n</script>\n"],"names":["_createVNode","x1","y1","x2","y2","d","_ctx","_createBlock","class","_renderSlot","$options","type","title","isBrowserSupported","$props","disabled","onClick","$data","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","fill","isListening","_hoisted_6","_hoisted_7","_hoisted_8","voiceListeningState","transcript"],"mappings":"qJAqBYA,UACEC,GAAG,IACHC,GAAG,IACHC,GAAG,KACHC,GAAG,iBAELJ,UAAMK,EAAE,qEACRL,UAAMK,EAAE,oEACRL,UACEC,GAAG,KACHC,GAAG,KACHC,GAAG,KACHC,GAAG,iBAELJ,UACEC,GAAG,IACHC,GAAG,KACHC,GAAG,KACHC,GAAG,iBAWLJ,UAAMK,EAAE,yCACRL,UACEC,GAAG,KACHC,GAAG,KACHC,GAAG,KACHC,GAAG,iBAELJ,UACEC,GAAG,IACHC,GAAG,KACHC,GAAG,KACHC,GAAG,8CA3DPE,aADRC,eAEGC,MAAOF,WAERG,qBAAcC,kCACZV,YACEW,KAAK,SACJH,MAAOF,iBACPM,MAAON,QAAMO,mBAAqBC,cAAcA,sBAChDC,UAAWT,QAAMO,mBACjBG,6FAAON,4CAERD,wBAEUC,mCAIAA,uBAFRH,kBACUU,mBAGRC,EAMAC,EACAC,EACAC,EAMAC,aAOFf,kBACUU,mBAGRjB,UACEK,EAAE,uDACDkB,KAAMjB,QAAMkB,oDAEfC,EACAC,EAMAC,qCASN3B,SAAMQ,MAAOF,mBACXG,oBAEUC,mCAERV,aAAMM,QAAMsB,oBAAoBC"}
1
+ {"version":3,"file":"VoiceSearch.vue_vue&type=template&id=24b0f67a&lang.js","sources":["../../../../src/components/VoiceSearch.vue?vue&type=template&id=24b0f67a&lang.js"],"sourcesContent":["<template>\n <div\n v-if=\"state\"\n :class=\"suit()\"\n >\n <slot v-bind=\"rootSlotProps\">\n <button\n type=\"button\"\n :class=\"suit('button')\"\n :title=\"state.isBrowserSupported ? buttonTitle : disabledButtonTitle\"\n :disabled=\"!state.isBrowserSupported\"\n @click=\"handleClick\"\n >\n <slot\n name=\"buttonText\"\n v-bind=\"innerSlotProps\"\n >\n <svg\n v-bind=\"buttonSvgAttrs\"\n v-if=\"errorNotAllowed\"\n >\n <line\n x1=\"1\"\n y1=\"1\"\n x2=\"23\"\n y2=\"23\"\n />\n <path d=\"M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6\" />\n <path d=\"M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23\" />\n <line\n x1=\"12\"\n y1=\"19\"\n x2=\"12\"\n y2=\"23\"\n />\n <line\n x1=\"8\"\n y1=\"23\"\n x2=\"16\"\n y2=\"23\"\n />\n </svg>\n <svg\n v-bind=\"buttonSvgAttrs\"\n v-else\n >\n <path\n d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\"\n :fill=\"state.isListening ? 'currentColor' : 'none'\"\n />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <line\n x1=\"12\"\n y1=\"19\"\n x2=\"12\"\n y2=\"23\"\n />\n <line\n x1=\"8\"\n y1=\"23\"\n x2=\"16\"\n y2=\"23\"\n />\n </svg>\n </slot>\n </button>\n <div :class=\"suit('status')\">\n <slot\n name=\"status\"\n v-bind=\"innerSlotProps\"\n >\n <p>{{ state.voiceListeningState.transcript }}</p>\n </slot>\n </div>\n </slot>\n </div>\n</template>\n\n<script>\nimport { connectVoiceSearch } from 'instantsearch.js/es/connectors';\nimport { createSuitMixin } from '../mixins/suit';\nimport { createWidgetMixin } from '../mixins/widget';\n\nexport default {\n name: 'AisVoiceSearch',\n mixins: [\n createWidgetMixin(\n {\n connector: connectVoiceSearch,\n },\n {\n $$widgetType: 'ais.voiceSearch',\n }\n ),\n createSuitMixin({ name: 'VoiceSearch' }),\n ],\n props: {\n searchAsYouSpeak: {\n type: Boolean,\n required: false,\n default: undefined,\n },\n language: {\n type: String,\n default: undefined,\n },\n additionalQueryParameters: {\n type: Object,\n default: undefined,\n },\n buttonTitle: {\n type: String,\n required: false,\n default: 'Search by voice',\n },\n disabledButtonTitle: {\n type: String,\n required: false,\n default: 'Search by voice (not supported on this browser)',\n },\n },\n data() {\n return {\n buttonSvgAttrs: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: '16',\n height: '16',\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: '2',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n },\n };\n },\n computed: {\n widgetParams() {\n return {\n searchAsYouSpeak: this.searchAsYouSpeak,\n language: this.language,\n additionalQueryParameters: this.additionalQueryParameters,\n };\n },\n errorNotAllowed() {\n return (\n this.state.voiceListeningState.status === 'error' &&\n this.state.voiceListeningState.errorCode === 'not-allowed'\n );\n },\n rootSlotProps() {\n return {\n isBrowserSupported: this.state.isBrowserSupported,\n isListening: this.state.isListening,\n toggleListening: this.state.toggleListening,\n voiceListeningState: this.state.voiceListeningState,\n };\n },\n innerSlotProps() {\n return {\n status: this.state.voiceListeningState.status,\n errorCode: this.state.voiceListeningState.errorCode,\n isListening: this.state.isListening,\n transcript: this.state.voiceListeningState.transcript,\n isSpeechFinal: this.state.voiceListeningState.isSpeechFinal,\n isBrowserSupported: this.state.isBrowserSupported,\n };\n },\n },\n methods: {\n handleClick(event) {\n event.currentTarget.blur();\n this.state.toggleListening();\n },\n },\n};\n</script>\n"],"names":["_createVNode","x1","y1","x2","y2","d","_ctx","_createBlock","class","_renderSlot","$options","type","title","isBrowserSupported","$props","disabled","onClick","$data","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","fill","isListening","_hoisted_6","_hoisted_7","_hoisted_8","voiceListeningState","transcript"],"mappings":"qJAqBYA,UACEC,GAAG,IACHC,GAAG,IACHC,GAAG,KACHC,GAAG,iBAELJ,UAAMK,EAAE,qEACRL,UAAMK,EAAE,oEACRL,UACEC,GAAG,KACHC,GAAG,KACHC,GAAG,KACHC,GAAG,iBAELJ,UACEC,GAAG,IACHC,GAAG,KACHC,GAAG,KACHC,GAAG,iBAWLJ,UAAMK,EAAE,yCACRL,UACEC,GAAG,KACHC,GAAG,KACHC,GAAG,KACHC,GAAG,iBAELJ,UACEC,GAAG,IACHC,GAAG,KACHC,GAAG,KACHC,GAAG,8CA3DPE,aADRC,eAEGC,MAAOF,WAERG,qBAAcC,kCACZV,YACEW,KAAK,SACJH,MAAOF,iBACPM,MAAON,QAAMO,mBAAqBC,cAAcA,sBAChDC,UAAWT,QAAMO,mBACjBG,6FAAON,4CAERD,wBAEUC,mCAIAA,uBAFRH,kBACUU,mBAGRC,EAMAC,EACAC,EACAC,EAMAC,aAOFf,kBACUU,mBAGRjB,UACEK,EAAE,uDACDkB,KAAMjB,QAAMkB,oDAEfC,EACAC,EAMAC,qCASN3B,SAAMQ,MAAOF,mBACXG,oBAEUC,mCAERV,aAAMM,QAAMsB,oBAAoBC"}