(function webpackUniversalModuleDefinition(root, factory){
if(typeof exports==='object'&&typeof module==='object')
module.exports=factory();
else if(typeof define==='function'&&define.amd)
define([], factory);
else if(typeof exports==='object')
exports["Vue2Autocomplete"]=factory();
else
root["Vue2Autocomplete"]=factory();
})(this, function(){
return  (function(modules){
var installedModules={};
function __webpack_require__(moduleId){
if(installedModules[moduleId]){
return installedModules[moduleId].exports;
}
var module=installedModules[moduleId]={
i: moduleId,
l: false,
exports: {}
};
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
module.l=true;
return module.exports;
}
__webpack_require__.m=modules;
__webpack_require__.c=installedModules;
__webpack_require__.i=function(value){ return value; };
__webpack_require__.d=function(exports, name, getter){
if(!__webpack_require__.o(exports, name)){
Object.defineProperty(exports, name, {
configurable: false,
enumerable: true,
get: getter
});
}
};
__webpack_require__.n=function(module){
var getter=module&&module.__esModule ?
function getDefault(){ return module['default']; } :
function getModuleExports(){ return module; };
__webpack_require__.d(getter, 'a', getter);
return getter;
};
__webpack_require__.o=function(object, property){ return Object.prototype.hasOwnProperty.call(object, property); };
__webpack_require__.p="../dist/";
return __webpack_require__(__webpack_require__.s=2);
})
([
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_vue_autocomplete_vue__=__webpack_require__(1);
var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_e47ae2be_hasScoped_false_node_modules_vue_loader_lib_selector_type_template_index_0_vue_autocomplete_vue__=__webpack_require__(4);
var disposed=false
var normalizeComponent=__webpack_require__(3)
var __vue_styles__=null
var __vue_scopeId__=null
var __vue_module_identifier__=null
var Component=normalizeComponent(
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_vue_autocomplete_vue__["a" ],
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_e47ae2be_hasScoped_false_node_modules_vue_loader_lib_selector_type_template_index_0_vue_autocomplete_vue__["a" ],
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
Component.options.__file="src/js/components/vue-autocomplete.vue"
if(Component.esModule&&Object.keys(Component.esModule).some(function (key){return key!=="default"&&key.substr(0, 2)!=="__"})){console.error("named exports are not supported in *.vue files.")}
if(Component.options.functional){console.error("[vue-loader] vue-autocomplete.vue: functional components are not supported with templates, they should use render functions.")}
if(false){(function (){
var hotAPI=require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if(!hotAPI.compatible) return
module.hot.accept()
if(!module.hot.data){
hotAPI.createRecord("data-v-e47ae2be", Component.options)
}else{
hotAPI.reload("data-v-e47ae2be", Component.options)
}
module.hot.dispose(function (data){
disposed=true
})
})()}
__webpack_exports__["a"]=(Component.exports);
}),
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_exports__["a"]=({
props: {
id: String,
name: String,
className: String,
classes: {
type: Object,
default: function _default(){
return {
wrapper: false,
input: false,
list: false,
item: false
};}},
placeholder: String,
required: Boolean,
initValue: {
type: String,
default: ""
},
options: Array,
filterByAnchor: {
type: Boolean,
default: true
},
anchor: {
type: String,
required: true
},
label: String,
debounce: Number,
url: {
type: String,
required: true
},
param: {
type: String,
default: 'q'
},
encodeParams: {
type: Boolean,
default: true
},
customParams: Object,
customHeaders: Object,
min: {
type: Number,
default: 0
},
onShouldRenderChild: Function,
process: Function,
onInput: Function,
onShow: Function,
onBlur: Function,
onHide: Function,
onFocus: Function,
onSelect: Function,
onBeforeAjax: Function,
onAjaxProgress: Function,
onAjaxLoaded: Function,
onShouldGetData: Function,
onKeydown: Function
},
data: function data(){
return {
showList: false,
type: "",
json: [],
focusList: "",
debounceTask: undefined
};},
watch: {
options: function options(newVal, oldVal){
if(this.filterByAnchor){
var type=this.type,
anchor=this.anchor;
var regex=new RegExp("" + type, 'i');
var filtered=newVal.filter(function (item){
var found=item[anchor].search(regex)!==-1;
return found;
});
this.json=filtered;
}else{
this.json=newVal;
}}
},
methods: {
getClassName: function getClassName(part){
var classes=this.classes,
className=this.className;
if(classes[part]) return "" + classes[part];
return className ? className + "-" + part:'';
},
clearInput: function clearInput(){
this.showList=false;
this.type="";
this.json=[];
this.focusList="";
},
cleanUp: function cleanUp(data){
if(data==null) return null;
return JSON.parse(JSON.stringify(data));
},
handleInput: function handleInput(e){
var _this=this;
var value=e.target.value;
this.showList=true;
if(this.onInput) this.onInput(value);
if(this.debounce){
if(this.debounceTask!==undefined) clearTimeout(this.debounceTask);
this.debounceTask=setTimeout(function (){
return _this.getData(value);
}, this.debounce);
}else{
return this.getData(value);
}},
handleKeyDown: function handleKeyDown(e){
var key=e.keyCode;
this.onKeydown?.(e);
if(!this.showList) return;
var DOWN=40;
var UP=38;
var ENTER=13;
var ESC=27;
switch (key){
case DOWN:
e.preventDefault();
this.focusList++;
break;
case UP:
e.preventDefault();
this.focusList--;
break;
case ENTER:
e.preventDefault();
this.selectList(this.json[this.focusList]);
this.showList=false;
break;
case ESC:
this.showList=false;
break;
}
var listLength=this.json.length - 1;
var outOfRangeBottom=this.focusList > listLength;
var outOfRangeTop=this.focusList < 0;
var topItemIndex=0;
var bottomItemIndex=listLength;
var nextFocusList=this.focusList;
if(outOfRangeBottom) nextFocusList=topItemIndex;
if(outOfRangeTop) nextFocusList=bottomItemIndex;
this.focusList=nextFocusList;
},
setValue: function setValue(val){
this.type=val;
},
handleDoubleClick: function handleDoubleClick(){
this.json=[];
this.getData("");
this.onShow ? this.onShow():null;
this.showList=true;
},
handleBlur: function handleBlur(e){
var _this2=this;
this.onBlur ? this.onBlur(e):null;
setTimeout(function (){
_this2.onHide ? _this2.onHide():null;
_this2.showList=false;
}, 250);
},
handleFocus: function handleFocus(e){
this.focusList=0;
this.onFocus ? this.onFocus(e):null;
},
mousemove: function mousemove(i){
this.focusList=i;
},
activeClass: function activeClass(i){
var focusClass=i===this.focusList ? 'focus-list':'';
return "" + focusClass;
},
selectList: function selectList(data){
var clean=this.cleanUp(data);
if(!clean) return;
this.type=clean[this.anchor];
this.showList=false;
this.onSelect ? this.onSelect(clean):null;
},
deepValue: function deepValue(obj, path){
var arrayPath=path.split('.');
for (var i=0; i < arrayPath.length; i++){
obj=obj[arrayPath[i]];
}
return obj;
},
composeParams: function composeParams(val){
var _this3=this;
var encode=function encode(val){
return _this3.encodeParams ? encodeURIComponent(val):val;
};
var params=this.param + "=" + encode(val);
if(this.customParams){
Object.keys(this.customParams).forEach(function (key){
params +="&" + key + "=" + encode(_this3.customParams[key]);
});
}
return params;
},
composeHeader: function composeHeader(ajax){
var _this4=this;
if(this.customHeaders){
Object.keys(this.customHeaders).forEach(function (key){
ajax.setRequestHeader(key, _this4.customHeaders[key]);
});
}},
doAjax: function doAjax(val){
var _this5=this;
this.onBeforeAjax ? this.onBeforeAjax(val):null;
var params=this.composeParams(val);
var ajax=new XMLHttpRequest();
ajax.open('GET', this.url + "?" + params, true);
this.composeHeader(ajax);
ajax.addEventListener('progress', function (data){
if(data.lengthComputable&&_this5.onAjaxProgress) _this5.onAjaxProgress(data);
});
ajax.addEventListener('loadend', function (e){
var responseText=e.target.responseText;
var json=JSON.parse(responseText);
_this5.onAjaxLoaded ? _this5.onAjaxLoaded(json):null;
_this5.json=_this5.process ? _this5.process(json):json;
});
ajax.send();
},
getData: function getData(value){
if(value.length < this.min||!this.url) return;
if(this.onShouldGetData) this.manualGetData(value);else this.doAjax(value);
},
manualGetData: function manualGetData(val){
var _this6=this;
var task=this.onShouldGetData(val);
if(task&&task.then){
return task.then(function (options){
_this6.json=options;
});
}}
},
created: function created(){
this.type=this.initValue ? this.initValue:null;
},
mounted: function mounted(){
if(this.required) this.$refs.input.setAttribute("required", this.required);
}});
}),
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
var __WEBPACK_IMPORTED_MODULE_0__components_vue_autocomplete_vue__=__webpack_require__(0);
__webpack_exports__["default"]=(__WEBPACK_IMPORTED_MODULE_0__components_vue_autocomplete_vue__["a" ]);
}),
(function(module, exports){
module.exports=function normalizeComponent (
rawScriptExports,
compiledTemplate,
injectStyles,
scopeId,
moduleIdentifier 
){
var esModule
var scriptExports=rawScriptExports=rawScriptExports||{}
var type=typeof rawScriptExports.default
if(type==='object'||type==='function'){
esModule=rawScriptExports
scriptExports=rawScriptExports.default
}
var options=typeof scriptExports==='function'
? scriptExports.options
: scriptExports
if(compiledTemplate){
options.render=compiledTemplate.render
options.staticRenderFns=compiledTemplate.staticRenderFns
}
if(scopeId){
options._scopeId=scopeId
}
var hook
if(moduleIdentifier){
hook=function (context){
context =
context ||
(this.$vnode&&this.$vnode.ssrContext) ||
(this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)
if(!context&&typeof __VUE_SSR_CONTEXT__!=='undefined'){
context=__VUE_SSR_CONTEXT__
}
if(injectStyles){
injectStyles.call(this, context)
}
if(context&&context._registeredComponents){
context._registeredComponents.add(moduleIdentifier)
}}
options._ssrRegister=hook
}else if(injectStyles){
hook=injectStyles
}
if(hook){
var functional=options.functional
var existing=functional
? options.render
: options.beforeCreate
if(!functional){
options.beforeCreate=existing
? [].concat(existing, hook)
: [hook]
}else{
options.render=function renderWithStyleInjection (h, context){
hook.call(context)
return existing(h, context)
}}
}
return {
esModule: esModule,
exports: scriptExports,
options: options
}}
}),
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
var render=function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('div', {
class: ((_vm.getClassName('wrapper')) + " autocomplete-wrapper")
}, [_c('input', {
directives: [{
name: "model",
rawName: "v-model",
value: (_vm.type),
expression: "type"
}],
ref: "input",
class: ((_vm.getClassName('input')) + " autocomplete-input"),
attrs: {
"type": "text",
"id": _vm.id,
"placeholder": _vm.placeholder,
"name": _vm.name,
"autocomplete": "off"
},
domProps: {
"value": (_vm.type)
},
on: {
"input": [function($event){
if($event.target.composing){ return; }
_vm.type=$event.target.value
}, _vm.handleInput],
"dblclick": _vm.handleDoubleClick,
"blur": _vm.handleBlur,
"keydown": _vm.handleKeyDown,
"focus": _vm.handleFocus
}}), _vm._v(" "), _c('div', {
directives: [{
name: "show",
rawName: "v-show",
value: (_vm.showList&&_vm.json.length),
expression: "showList&&json.length"
}],
class: ((_vm.getClassName('list')) + " autocomplete autocomplete-list")
}, [_c('ul', _vm._l((_vm.json), function(data, i){
return _c('li', {
class: _vm.activeClass(i)
}, [_c('a', {
attrs: {
"href": "#"
},
on: {
"click": function($event){
$event.preventDefault();
_vm.selectList(data)
},
"mousemove": function($event){
_vm.mousemove(i)
}}
}, [(_vm.onShouldRenderChild) ? _c('div', {
domProps: {
"innerHTML": _vm._s(_vm.onShouldRenderChild(data))
}}):_vm._e(), _vm._v(" "), (!_vm.onShouldRenderChild) ? _c('div', [_c('b', {
staticClass: "autocomplete-anchor-text"
}, [_vm._v(_vm._s(_vm.deepValue(data, _vm.anchor)))]), _vm._v(" "), _c('span', {
staticClass: "autocomplete-anchor-label"
}, [_vm._v(_vm._s(_vm.deepValue(data, _vm.label)))])]):_vm._e()])])
}))])])
}
var staticRenderFns=[]
render._withStripped=true
var esExports={ render: render, staticRenderFns: staticRenderFns }
__webpack_exports__["a"]=(esExports);
if(false){
module.hot.accept()
if(module.hot.data){
require("vue-hot-reload-api").rerender("data-v-e47ae2be", esExports)
}}
})
]);
});
(function webpackUniversalModuleDefinition(root, factory){
if(typeof exports==='object'&&typeof module==='object')
module.exports=factory();
else if(typeof define==='function'&&define.amd)
define([], factory);
else if(typeof exports==='object')
exports["Vue2Autocomplete"]=factory();
else
root["Vue2Autocomplete"]=factory();
})(this, function(){
return  (function(modules){
var installedModules={};
function __webpack_require__(moduleId){
if(installedModules[moduleId]){
return installedModules[moduleId].exports;
}
var module=installedModules[moduleId]={
i: moduleId,
l: false,
exports: {}
};
modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
module.l=true;
return module.exports;
}
__webpack_require__.m=modules;
__webpack_require__.c=installedModules;
__webpack_require__.i=function(value){ return value; };
__webpack_require__.d=function(exports, name, getter){
if(!__webpack_require__.o(exports, name)){
Object.defineProperty(exports, name, {
configurable: false,
enumerable: true,
get: getter
});
}
};
__webpack_require__.n=function(module){
var getter=module&&module.__esModule ?
function getDefault(){ return module['default']; } :
function getModuleExports(){ return module; };
__webpack_require__.d(getter, 'a', getter);
return getter;
};
__webpack_require__.o=function(object, property){ return Object.prototype.hasOwnProperty.call(object, property); };
__webpack_require__.p="../dist/";
return __webpack_require__(__webpack_require__.s=2);
})
([
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_vue_autocomplete_vue__=__webpack_require__(1);
var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_e47ae2be_hasScoped_false_node_modules_vue_loader_lib_selector_type_template_index_0_vue_autocomplete_vue__=__webpack_require__(4);
var disposed=false
var normalizeComponent=__webpack_require__(3)
var __vue_styles__=null
var __vue_scopeId__=null
var __vue_module_identifier__=null
var Component=normalizeComponent(
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_vue_autocomplete_vue__["a" ],
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_e47ae2be_hasScoped_false_node_modules_vue_loader_lib_selector_type_template_index_0_vue_autocomplete_vue__["a" ],
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
Component.options.__file="src/js/components/vue-autocomplete.vue"
if(Component.esModule&&Object.keys(Component.esModule).some(function (key){return key!=="default"&&key.substr(0, 2)!=="__"})){console.error("named exports are not supported in *.vue files.")}
if(Component.options.functional){console.error("[vue-loader] vue-autocomplete.vue: functional components are not supported with templates, they should use render functions.")}
if(false){(function (){
var hotAPI=require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if(!hotAPI.compatible) return
module.hot.accept()
if(!module.hot.data){
hotAPI.createRecord("data-v-e47ae2be", Component.options)
}else{
hotAPI.reload("data-v-e47ae2be", Component.options)
}
module.hot.dispose(function (data){
disposed=true
})
})()}
__webpack_exports__["a"]=(Component.exports);
}),
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
__webpack_exports__["a"]=({
props: {
id: String,
name: String,
className: String,
classes: {
type: Object,
default: function _default(){
return {
wrapper: false,
input: false,
list: false,
item: false
};}},
placeholder: String,
required: Boolean,
initValue: {
type: String,
default: ""
},
options: Array,
filterByAnchor: {
type: Boolean,
default: true
},
anchor: {
type: String,
required: true
},
label: String,
debounce: Number,
url: {
type: String,
required: true
},
param: {
type: String,
default: 'q'
},
encodeParams: {
type: Boolean,
default: true
},
customParams: Object,
customHeaders: Object,
min: {
type: Number,
default: 0
},
onShouldRenderChild: Function,
process: Function,
onInput: Function,
onShow: Function,
onBlur: Function,
onHide: Function,
onFocus: Function,
onSelect: Function,
onBeforeAjax: Function,
onAjaxProgress: Function,
onAjaxLoaded: Function,
onShouldGetData: Function,
onKeydown: Function
},
data: function data(){
return {
showList: false,
type: "",
json: [],
focusList: "",
debounceTask: undefined
};},
watch: {
options: function options(newVal, oldVal){
if(this.filterByAnchor){
var type=this.type,
anchor=this.anchor;
var regex=new RegExp("" + type, 'i');
var filtered=newVal.filter(function (item){
var found=item[anchor].search(regex)!==-1;
return found;
});
this.json=filtered;
}else{
this.json=newVal;
}}
},
methods: {
getClassName: function getClassName(part){
var classes=this.classes,
className=this.className;
if(classes[part]) return "" + classes[part];
return className ? className + "-" + part:'';
},
clearInput: function clearInput(){
this.showList=false;
this.type="";
this.json=[];
this.focusList="";
},
cleanUp: function cleanUp(data){
if(data==null) return null;
return JSON.parse(JSON.stringify(data));
},
handleInput: function handleInput(e){
var _this=this;
var value=e.target.value;
this.showList=true;
if(this.onInput) this.onInput(value);
if(this.debounce){
if(this.debounceTask!==undefined) clearTimeout(this.debounceTask);
this.debounceTask=setTimeout(function (){
return _this.getData(value);
}, this.debounce);
}else{
return this.getData(value);
}},
handleKeyDown: function handleKeyDown(e){
var key=e.keyCode;
this.onKeydown?.(e);
if(!this.showList) return;
var DOWN=40;
var UP=38;
var ENTER=13;
var ESC=27;
switch (key){
case DOWN:
e.preventDefault();
this.focusList++;
break;
case UP:
e.preventDefault();
this.focusList--;
break;
case ENTER:
e.preventDefault();
this.selectList(this.json[this.focusList]);
this.showList=false;
break;
case ESC:
this.showList=false;
break;
}
var listLength=this.json.length - 1;
var outOfRangeBottom=this.focusList > listLength;
var outOfRangeTop=this.focusList < 0;
var topItemIndex=0;
var bottomItemIndex=listLength;
var nextFocusList=this.focusList;
if(outOfRangeBottom) nextFocusList=topItemIndex;
if(outOfRangeTop) nextFocusList=bottomItemIndex;
this.focusList=nextFocusList;
},
setValue: function setValue(val){
this.type=val;
},
handleDoubleClick: function handleDoubleClick(){
this.json=[];
this.getData("");
this.onShow ? this.onShow():null;
this.showList=true;
},
handleBlur: function handleBlur(e){
var _this2=this;
this.onBlur ? this.onBlur(e):null;
setTimeout(function (){
_this2.onHide ? _this2.onHide():null;
_this2.showList=false;
}, 250);
},
handleFocus: function handleFocus(e){
this.focusList=0;
this.onFocus ? this.onFocus(e):null;
},
mousemove: function mousemove(i){
this.focusList=i;
},
activeClass: function activeClass(i){
var focusClass=i===this.focusList ? 'focus-list':'';
return "" + focusClass;
},
selectList: function selectList(data){
var clean=this.cleanUp(data);
if(!clean) return;
this.type=clean[this.anchor];
this.showList=false;
this.onSelect ? this.onSelect(clean):null;
},
deepValue: function deepValue(obj, path){
var arrayPath=path.split('.');
for (var i=0; i < arrayPath.length; i++){
obj=obj[arrayPath[i]];
}
return obj;
},
composeParams: function composeParams(val){
var _this3=this;
var encode=function encode(val){
return _this3.encodeParams ? encodeURIComponent(val):val;
};
var params=this.param + "=" + encode(val);
if(this.customParams){
Object.keys(this.customParams).forEach(function (key){
params +="&" + key + "=" + encode(_this3.customParams[key]);
});
}
return params;
},
composeHeader: function composeHeader(ajax){
var _this4=this;
if(this.customHeaders){
Object.keys(this.customHeaders).forEach(function (key){
ajax.setRequestHeader(key, _this4.customHeaders[key]);
});
}},
doAjax: function doAjax(val){
var _this5=this;
this.onBeforeAjax ? this.onBeforeAjax(val):null;
var params=this.composeParams(val);
var ajax=new XMLHttpRequest();
ajax.open('GET', this.url + "?" + params, true);
this.composeHeader(ajax);
ajax.addEventListener('progress', function (data){
if(data.lengthComputable&&_this5.onAjaxProgress) _this5.onAjaxProgress(data);
});
ajax.addEventListener('loadend', function (e){
var responseText=e.target.responseText;
var json=JSON.parse(responseText);
_this5.onAjaxLoaded ? _this5.onAjaxLoaded(json):null;
_this5.json=_this5.process ? _this5.process(json):json;
});
ajax.send();
},
getData: function getData(value){
if(value.length < this.min||!this.url) return;
if(this.onShouldGetData) this.manualGetData(value);else this.doAjax(value);
},
manualGetData: function manualGetData(val){
var _this6=this;
var task=this.onShouldGetData(val);
if(task&&task.then){
return task.then(function (options){
_this6.json=options;
});
}}
},
created: function created(){
this.type=this.initValue ? this.initValue:null;
},
mounted: function mounted(){
if(this.required) this.$refs.input.setAttribute("required", this.required);
}});
}),
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
var __WEBPACK_IMPORTED_MODULE_0__components_vue_autocomplete_vue__=__webpack_require__(0);
__webpack_exports__["default"]=(__WEBPACK_IMPORTED_MODULE_0__components_vue_autocomplete_vue__["a" ]);
}),
(function(module, exports){
module.exports=function normalizeComponent (
rawScriptExports,
compiledTemplate,
injectStyles,
scopeId,
moduleIdentifier 
){
var esModule
var scriptExports=rawScriptExports=rawScriptExports||{}
var type=typeof rawScriptExports.default
if(type==='object'||type==='function'){
esModule=rawScriptExports
scriptExports=rawScriptExports.default
}
var options=typeof scriptExports==='function'
? scriptExports.options
: scriptExports
if(compiledTemplate){
options.render=compiledTemplate.render
options.staticRenderFns=compiledTemplate.staticRenderFns
}
if(scopeId){
options._scopeId=scopeId
}
var hook
if(moduleIdentifier){
hook=function (context){
context =
context ||
(this.$vnode&&this.$vnode.ssrContext) ||
(this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)
if(!context&&typeof __VUE_SSR_CONTEXT__!=='undefined'){
context=__VUE_SSR_CONTEXT__
}
if(injectStyles){
injectStyles.call(this, context)
}
if(context&&context._registeredComponents){
context._registeredComponents.add(moduleIdentifier)
}}
options._ssrRegister=hook
}else if(injectStyles){
hook=injectStyles
}
if(hook){
var functional=options.functional
var existing=functional
? options.render
: options.beforeCreate
if(!functional){
options.beforeCreate=existing
? [].concat(existing, hook)
: [hook]
}else{
options.render=function renderWithStyleInjection (h, context){
hook.call(context)
return existing(h, context)
}}
}
return {
esModule: esModule,
exports: scriptExports,
options: options
}}
}),
(function(module, __webpack_exports__, __webpack_require__){
"use strict";
var render=function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('div', {
class: ((_vm.getClassName('wrapper')) + " autocomplete-wrapper")
}, [_c('input', {
directives: [{
name: "model",
rawName: "v-model",
value: (_vm.type),
expression: "type"
}],
ref: "input",
class: ((_vm.getClassName('input')) + " autocomplete-input"),
attrs: {
"type": "text",
"id": _vm.id,
"placeholder": _vm.placeholder,
"name": _vm.name,
"autocomplete": "off"
},
domProps: {
"value": (_vm.type)
},
on: {
"input": [function($event){
if($event.target.composing){ return; }
_vm.type=$event.target.value
}, _vm.handleInput],
"dblclick": _vm.handleDoubleClick,
"blur": _vm.handleBlur,
"keydown": _vm.handleKeyDown,
"focus": _vm.handleFocus
}}), _vm._v(" "), _c('div', {
directives: [{
name: "show",
rawName: "v-show",
value: (_vm.showList&&_vm.json.length),
expression: "showList&&json.length"
}],
class: ((_vm.getClassName('list')) + " autocomplete autocomplete-list")
}, [_c('ul', _vm._l((_vm.json), function(data, i){
return _c('li', {
class: _vm.activeClass(i)
}, [_c('a', {
attrs: {
"href": "#"
},
on: {
"click": function($event){
$event.preventDefault();
_vm.selectList(data)
},
"mousemove": function($event){
_vm.mousemove(i)
}}
}, [(_vm.onShouldRenderChild) ? _c('div', {
domProps: {
"innerHTML": _vm._s(_vm.onShouldRenderChild(data))
}}):_vm._e(), _vm._v(" "), (!_vm.onShouldRenderChild) ? _c('div', [_c('b', {
staticClass: "autocomplete-anchor-text"
}, [_vm._v(_vm._s(_vm.deepValue(data, _vm.anchor)))]), _vm._v(" "), _c('span', {
staticClass: "autocomplete-anchor-label"
}, [_vm._v(_vm._s(_vm.deepValue(data, _vm.label)))])]):_vm._e()])])
}))])])
}
var staticRenderFns=[]
render._withStripped=true
var esExports={ render: render, staticRenderFns: staticRenderFns }
__webpack_exports__["a"]=(esExports);
if(false){
module.hot.accept()
if(module.hot.data){
require("vue-hot-reload-api").rerender("data-v-e47ae2be", esExports)
}}
})
]);
});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});
!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);