@hammerstone/refine-vue2
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,2 +0,2 @@ | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("@vue/composition-api"),require("vue"),require("vue2-datepicker")):"function"===typeof define&&define.amd?define(["@vue/composition-api","vue","vue2-datepicker"],t):"object"===typeof exports?exports["refine-vue2"]=t(require("@vue/composition-api"),require("vue"),require("vue2-datepicker")):e["refine-vue2"]=t(e[void 0],e[void 0],e[void 0])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8165:function(t,n){t.exports=e},8875:function(e,t,n){var r,i,o;(function(n,u){i=[],r=u,o="function"===typeof r?r.apply(t,i):r,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(f){var n,r,i,o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,u=/@([^@]*):(\d+):(\d+)\s*$/gi,s=o.exec(f.stack)||u.exec(f.stack),l=s&&s[1]||!1,c=s&&s[2]||!1,a=document.location.href.replace(document.location.hash,""),p=document.getElementsByTagName("script");l===a&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(c-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(r,"$1").trim());for(var d=0;d<p.length;d++){if("interactive"===p[d].readyState)return p[d];if(p[d].src===l)return p[d];if(l===a&&p[d].innerHTML&&p[d].innerHTML.trim()===i)return p[d]}return null}}return e}))},"8bbf":function(e,n){e.exports=t},"96cf":function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(q){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),u=new E(r||[]);return o._invoke=k(e,n,u),o}function a(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(q){return{type:"throw",arg:q}}}e.wrap=c;var p="suspendedStart",d="suspendedYield",f="executing",h="completed",v={};function m(){}function y(){}function b(){}var g={};l(g,o,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O($([])));w&&w!==n&&r.call(w,o)&&(g=w);var x=b.prototype=m.prototype=Object.create(g);function j(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(i,o,u,s){var l=a(e[i],e,o);if("throw"!==l.type){var c=l.arg,p=c.value;return p&&"object"===typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,u,s)}),(function(e){n("throw",e,u,s)})):t.resolve(p).then((function(e){c.value=e,u(c)}),(function(e){return n("throw",e,u,s)}))}s(l.arg)}var i;function o(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}this._invoke=o}function k(e,t,n){var r=p;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return I()}n.method=i,n.arg=o;while(1){var u=n.delegate;if(u){var s=S(u,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=a(e,t,n);if("normal"===l.type){if(r=n.done?h:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=h,n.method="throw",n.arg=l.arg)}}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator["return"]&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=a(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function $(e){if(e){var n=e[o];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,u=function n(){while(++i<e.length)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return u.next=u}}return{next:I}}function I(){return{value:t,done:!0}}return y.prototype=b,l(x,"constructor",b),l(b,"constructor",y),y.displayName=l(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},j(C.prototype),l(C.prototype,u,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var u=new C(c(t,n,r,i),o);return e.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},j(x),l(x,s,"Generator"),l(x,o,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){while(t.length){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=$,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],s=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var l=r.call(u,"catchLoc"),c=r.call(u,"finallyLoc");if(l&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(l){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:$(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=r}catch(i){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},"9c9e":function(e,t,n){},a34a:function(e,t,n){e.exports=n("96cf")},c255:function(e,t){e.exports=n},fb15:function(e,t,n){"use strict";n.r(t),n.d(t,"ConditionSelector",(function(){return mt})),n.d(t,"Query",(function(){return Ot})),n.d(t,"QueryBuilder",(function(){return Fn})),n.d(t,"Selector",(function(){return ct})),n.d(t,"SelectorOption",(function(){return lt}));var r={};if(n.r(r),n.d(r,"default",(function(){return On})),n.d(r,"DateInput",(function(){return en})),n.d(r,"DoubleDateInput",(function(){return sn})),n.d(r,"DoubleNumberInput",(function(){return Lt})),n.d(r,"NumberInput",(function(){return $t})),n.d(r,"OptionInput",(function(){return gn})),n.d(r,"RelativeDateInput",(function(){return fn})),n.d(r,"TextInput",(function(){return Bt})),"undefined"!==typeof window){var i=window.document.currentScript,o=n("8875");i=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var u=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);u&&(n.p=u[1])}var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("renderless-query-builder",{attrs:{blueprint:e.blueprint,conditions:e.conditions},on:{change:e.onChange},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.groupedBlueprint,i=t.replaceCriterion,o=t.insertCriterion,u=t.addGroup,s=t.removeCriterion,l=t.conditionFor;return[n("div",{staticClass:"refine-query-builder-wrapper"},[e._l(r,(function(t,r){return n("div",{key:r,staticClass:"refine-query-builder-condition-group"},[e._l(t,(function(t,r){return n("div",{key:t.uid,staticClass:"refine-query-builder-condition"},[n("renderless-condition",e._b({scopedSlots:e._u([{key:"default",fn:function(o){var u=o.switchClause;return[n("criterion",{attrs:{conditionId:t.id,conditions:e.conditions,errors:e.errors[r],input:t.input},on:{"switch-clause":function(e){var t=e.id;return u(t)},"remove-condition":function(e){return s(t.position)},"switch-condition":function(e){return i(t.position,l(e))}}})]}}],null,!0)},"renderless-condition",l(t),!1))],1)})),n("button",{staticClass:"refine-query-builder-and-button",attrs:{tabindex:"0",type:"button"},on:{click:function(e){return o(t[t.length-1].position)}}},[n("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"}})]),n("span",{staticClass:"refine-query-builder-and-button-span"},[e._v("And")])])],2)})),n("button",{staticClass:"refine-query-builder-or-button",attrs:{type:"button"},on:{click:u}},[e._v(" Add an 'Or' ")])],2)]}}])})},l=[],c=n("8bbf"),a=n.n(c),p=n("8165"),d=n.n(p),f=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"py-2"},[n("ul",{staticClass:"refine-criterion-errors"},e._l(e.errors,(function(t){return n("li",{key:t.id,staticClass:"refine-criterion-error"},[e._v(" "+e._s(t.message)+" ")])})),0),n("div",{staticClass:"flex items-start"},[n("button",{staticClass:"refine-criterion-remove-icon",attrs:{type:"button"},on:{click:function(t){return t.preventDefault(),e.$emit("remove-condition")}}},[n("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"}})])]),n("selector",{staticClass:"pr-4 flex items-center",attrs:{innerClass:"mr-4"},on:{"select-option":e.switchCondition}},e._l(e.conditions,(function(t){var r=t.id,i=t.display,o=t.meta,u=t.refinements;return n("selector-option",{key:r,attrs:{id:r,display:i,selected:e.conditionId===r}},[n("div",[n("clause",{attrs:{input:e.input,meta:o},on:{"switch-clause":e.switchClause}}),u&&u.length>0?n("refinements",{attrs:{input:e.input,refinements:u}}):e._e()],1)])})),1)],1)])},h=[],v=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("renderless-selector",{on:{"select-option":function(t){return e.$emit("select-option",arguments[0])},"deselect-option":function(t){return e.$emit("deselect-option",arguments[0])}},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.actions,i=t.isOpen,o=t.isClosed,u=t.selectedOptions,s=t.highlightedOption,l=t.options;return[n("div",{staticClass:"refine-selector-wrapper"},[n("div",{directives:[{name:"click-away",rawName:"v-click-away",value:r.close,expression:"actions.close"}],staticClass:"refine-selector",class:e.innerClass,attrs:{id:"listbox-"+e.selectorId,"aria-labelledby":e.buttonId}},[e.isMultiSelect?n("multi-selector-button",{ref:"button",attrs:{id:e.buttonId,isOpen:i,selectedOptions:u},on:{toggle:function(t){return e.toggle(r)},open:function(t){return e.open(r)},"deselect-option":function(t){var n=arguments.length,i=Array(n);while(n--)i[n]=arguments[n];return e.deselectOption.apply(void 0,i.concat([r]))}}}):n("selector-button",{ref:"button",attrs:{id:e.buttonId,isOpen:i,display:u[0]?u[0].display:""},on:{toggle:function(t){return e.toggle(r)},open:function(t){return e.open(r)}}}),n("selector-listbox",{ref:"listBox",attrs:{selectedOption:u[0],isClosed:o},on:{"highlight-next-option":function(t){return e.highlightNextOption(r)},"highlight-previous-option":function(t){return e.highlightPreviousOption(r)},"select-option":function(t){return e.selectOption(s.id,r)},close:function(t){return e.close(r)}},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.createItemId;return e._l(l,(function(t){return n("selector-list-item",{key:t.id,ref:t.id,refInFor:!0,attrs:{id:i(t.id),optionId:t.id,optionDisplay:t.display,selected:e.isSelected(t,u),isHighlighted:s&&t.id===s.id},on:{mouseenter:function(e){return r.highlightOption(t)},mouseleave:function(e){return r.highlightOption(null)},click:function(n){return e.selectOption(t.id,r)}}})}))}}],null,!0)})],1),n("div",{staticClass:"refine-selector-custom-options-wrapper"},[e._t("default")],2)])]}}],null,!0)})],1)},m=[],y=n("a34a"),b=n.n(y);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function C(e,t,n){return t&&j(e.prototype,t),n&&j(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var k=function(){function e(){x(this,e),this.options=[],this.selectedOptions=[]}return C(e,[{key:"registerOption",value:function(e){for(var t=e.id,n=0;n<this.options.length;n++){var r=this.options[n];if(r.id===t)throw new Error("An option with id ${optionId} has already been registered for this selector.")}var i=this.options[this.options.length-1]||null,o=O({previousOption:i,nextOption:null},e);i&&(i.nextOption=o),this.options.push(o)}},{key:"isSelected",value:function(e){var t=!1;return this.selectedOptions.forEach((function(n){n.id===e&&(t=!0)})),t}},{key:"findOption",value:function(e){for(var t=0;t<this.options.length;t++){var n=this.options[t];if(n.id===e)return n}return null}},{key:"toggleOption",value:function(e){return this.isSelected(e)?this.deselectOption(e):this.selectOption(e)}},{key:"clearSelectedOptions",value:function(){this.selectedOptions.splice(0,this.selectedOptions.length)}},{key:"deselectOption",value:function(e){var t=this.findOption(e);return this.selectedOptions=this.selectedOptions.filter((function(t){return t.id!==e})),{deselectedOption:t,selectedOptions:this.selectedOptions}}},{key:"selectOption",value:function(e){var t=this.findOption(e);return this.isSelected(e)||this.selectedOptions.push(t),{selectedOption:t,selectedOptions:this.selectedOptions}}}]),e}(),S=k;function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){E(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $,I,q={name:"renderless-selector",data:function(){return{selector:a.a.observable(new S),isClosed:!0,highlightedOption:null}},provide:function(){return{selector:this.selector}},computed:{selectedOptions:function(){return this.selector.selectedOptions},firstSelectedOption:function(){return this.selectedOptions[0]||this.selector.options[0]},isOpen:function(){return!this.isClosed},actions:function(){var e=this.clearOptions,t=this.close,n=this.highlightNextOption,r=this.highlightPreviousOption,i=this.highlightOption,o=this.open,u=this.selectOption,s=this.selectedOptions,l=this.toggle,c=this.toggleOption;return{clearOptions:e,close:t,highlightNextOption:n,highlightPreviousOption:r,highlightOption:i,open:o,selectOption:u,selectedOptions:s,toggle:l,toggleOption:c}},state:function(){var e=this.isClosed,t=this.isOpen,n=this.selectedOptions,r=this.highlightedOption;return{isClosed:e,isOpen:t,selectedOptions:n,highlightedOption:r,options:this.selector.options}}},methods:{nextTick:function(){var e=this;return a.a.nextTick().then((function(){return P({actions:e.actions},e.state)}))},close:function(){return this.isClosed||(this.isClosed=!0),this.nextTick()},open:function(){return this.isClosed=!1,this.highlightedOption=this.firstSelectedOption,this.nextTick()},toggle:function(){return this.isClosed?this.open():this.close(),this.nextTick()},toggleOption:function(e){var t=this.selector,n=this.highlightOption,r=t.toggleOption(e),i=r.selectedOption;return i?this.selectOption(e):this.deselectOption(e),n(t.findOption(e))},clearOptions:function(){this.selector.clearSelectedOptions()},deselectOption:function(e){this.$emit("deselect-option",this.selector.deselectOption(e))},selectOption:function(e){this.$emit("select-option",this.selector.selectOption(e))},highlightOption:function(e){return this.highlightedOption=e,this.nextTick()},highlightNextOption:function(){var e,t=null===(e=this.highlightedOption)||void 0===e?void 0:e.nextOption;return t&&(this.highlightedOption=t),this.nextTick()},highlightPreviousOption:function(){var e,t=null===(e=this.highlightedOption)||void 0===e?void 0:e.previousOption;return t&&(this.highlightedOption=t),this.nextTick()}},render:function(){var e;return null!==(e=this.$scopedSlots)&&void 0!==e&&e.default?this.$scopedSlots.default(P({actions:this.actions},this.state)):null}},D=q;function L(e,t,n,r,i,o,u,s){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),u?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(u)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var a=c.render;c.render=function(e,t){return l.call(t),a(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}var A=L(D,$,I,!1,null,null,null),M=A.exports,T=M,N={props:{id:{type:String,required:!0},display:{type:String,required:!1},selected:{type:Boolean,required:!1,default:!1}}},V=1,B={beforeCreate:function(){this.uid=V.toString(),V+=1}},R=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{ref:"button",staticClass:"refine-selector-button",attrs:{id:e.id,type:"button","aria-haspopup":"listbox","aria-expanded":e.isOpen,"aria-label":e.label()},on:{click:function(t){return t.preventDefault(),e.$emit("toggle")},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"arrow-down",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("open"))}}},[0===e.display.length?n("span",{staticClass:"refine-selector-button-placeholder"},[e._v(" Choose an option ")]):n("span",{staticClass:"refine-selector-button-selected"},[e._v(" "+e._s(e.display)+" ")]),n("span",{staticClass:"refine-selector-button-icon-wrapper"},[n("svg",{staticClass:"refine-selector-button-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])},F=[],z={name:"selector-button",props:{id:{type:String,required:!0},isOpen:{type:Boolean,required:!0},display:{type:String,required:!0}},methods:{label:function(){return this.display?"".concat(this.display," Selected"):"Choose an option"},focus:function(){this.$refs.button.focus()}}},G=z,H=L(G,R,F,!1,null,null,null),Y=H.exports,U=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"refine-selector-listbox-wrapper"},[n("ul",{ref:"listBox",staticClass:"refine-selector-listbox",class:{"refine-selector-listbox-hidden":e.isClosed},attrs:{tabindex:"-1",role:"listbox","aria-activedescendant":e.selectedOption?e.createItemId(e.selectedOption.id):""},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"arrow-down",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("highlight-next-option"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"arrow-up",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("highlight-previous-option"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.$emit("select-option"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"escape",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("close"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:(t.stopPropagation(),t.preventDefault(),e.$emit("close"))}]}},[e._t("default",null,{createItemId:e.createItemId})],2)])},W=[],Q={name:"selector-listbox",mixins:[B],props:{isClosed:{type:Boolean,required:!1,default:!0},selectedOption:{type:Object,required:!1}},methods:{focus:function(){this.$refs.listBox.focus()},createItemId:function(e){return"listbox-option-".concat(this.uid,"-").concat(e)}}},X=Q,J=L(X,U,W,!1,null,null,null),K=J.exports,Z=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{key:e.optionId,ref:"listItem",staticClass:"refine-selector-list-item",class:{"refine-selector-list-item-highlighted":e.isHighlighted},attrs:{role:"option","aria-label":e.optionDisplay,"aria-selected":e.selected},on:{mouseenter:function(t){return e.$emit("mouseenter")},mouseleave:function(t){return e.$emit("mouseleave")},click:function(t){return e.$emit("click")}}},[n("span",{staticClass:"refine-selector-list-item-text",class:{"refine-selector-list-item-text-selected":e.selected}},[e._v(" "+e._s(e.optionDisplay)+" ")]),n("span",{staticClass:"refine-selector-list-item-icon-wrapper",class:{"refine-selector-list-item-icon-wrapper-highlighted":!e.isHighlighted}},[n("svg",{directives:[{name:"show",rawName:"v-show",value:e.selected,expression:"selected"}],staticClass:"refine-selector-list-item-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!e.selected}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"}})])])])},ee=[],te={name:"selector-list-item",props:{optionId:{type:String,required:!0},optionDisplay:{type:String,required:!0},selected:{type:Boolean,required:!1,default:!1},isHighlighted:{type:Boolean,required:!1,default:!1}},methods:{scrollIntoView:function(){this.$refs.listItem.scrollIntoView(!1)}}},ne=te,re=L(ne,Z,ee,!1,null,null,null),ie=re.exports,oe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"button",staticClass:"refine-multi-selector-button",attrs:{id:e.id,"aria-haspopup":"listbox","aria-label":e.label(),"aria-expanded":e.isOpen,tabindex:"0"},on:{click:function(t){return t.preventDefault(),e.$emit("toggle")},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.$emit("open"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"arrow-down",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("open"))}]}},[0===e.selectedOptions.length?n("span",{staticClass:"refine-multi-selector-button-placeholder"},[e._v(" Choose an option ")]):e._l(e.selectedOptions,(function(t){var r=t.id,i=t.display;return n("span",{key:r,staticClass:"refine-multi-selector-button-selected"},[e._v(" "+e._s(i)+" "),n("span",{staticClass:"refine-multi-selector-button-deselect-icon-wrapper",on:{click:function(t){return t.preventDefault(),e.$emit("deselect-option",r)}}},[n("svg",{staticClass:"refine-multi-selector-button-deselect-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])})),n("span",{staticClass:"refine-multi-selector-button-icon-wrapper"},[n("svg",{staticClass:"refine-multi-selector-button-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])],2)},ue=[],se={name:"multi-selector-button",props:{id:{type:String,required:!0},isOpen:{type:Boolean,required:!0},selectedOptions:{type:Array,required:!0}},methods:{label:function(){var e=this.selectedOptions.map((function(e){var t=e.display;return t})).join(", "),t="".concat(e," Selected");return 0===this.selectedOptions.length?"Choose an option":t},focus:function(){this.$refs.button.focus()}}},le=se,ce=L(le,oe,ue,!1,null,null,null),ae=ce.exports;function pe(e,t,n,r,i,o,u){try{var s=e[o](u),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function u(e){pe(o,r,i,u,s,"next",e)}function s(e){pe(o,r,i,u,s,"throw",e)}u(void 0)}))}}var fe={name:"selector",mixins:[B],inject:["builderModeActive"],props:{isMultiSelect:{type:Boolean,required:!1,default:!1},innerClass:{type:String,required:!1,default:""}},computed:{selectorId:function(){return this.uid},buttonId:function(){return"button-".concat(this.selectorId)}},mounted:function(){this.builderModeActive&&this.$refs.button.focus()},methods:{isSelected:function(e,t){var n=!1;return t.forEach((function(t){e.id===t.id&&(n=!0)})),n},deselectOption:function(e,t){var n=t.toggleOption;n(e)},selectOption:function(e,t){var n=this;return de(b.a.mark((function r(){var i,o,u,s;return b.a.wrap((function(r){while(1)switch(r.prev=r.next){case 0:i=t.clearOptions,o=t.selectOption,u=t.toggleOption,s=n.isMultiSelect,s?u(e):(i(),o(e),n.close(t));case 3:case"end":return r.stop()}}),r)})))()},scrollIntoView:function(e){if(e){var t=this.$refs[e][0];t.scrollIntoView()}},close:function(e){var t=this;return de(b.a.mark((function n(){var r,i,o,u;return b.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.close,n.next=3,r();case 3:i=n.sent,o=i.isClosed,o&&(null===(u=t.$refs.button)||void 0===u||u.focus());case 6:case"end":return n.stop()}}),n)})))()},open:function(e){var t=this;return de(b.a.mark((function n(){var r,i,o;return b.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.open,n.next=3,r();case 3:i=n.sent,o=i.selectedOption,t.$refs.listBox.focus(),t.scrollIntoView(null===o||void 0===o?void 0:o.id);case 7:case"end":return n.stop()}}),n)})))()},toggle:function(e){var t=this;return de(b.a.mark((function n(){var r,i,o,u;return b.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.toggle,n.next=3,r();case 3:i=n.sent,o=i.isOpen,u=i.selectedOption,o?(t.$refs.listBox.focus(),t.scrollIntoView(null===u||void 0===u?void 0:u.id)):t.$refs.button.focus();case 7:case"end":return n.stop()}}),n)})))()},highlightNextOption:function(e){var t=this;return de(b.a.mark((function n(){var r,i,o;return b.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.highlightNextOption,n.next=3,r();case 3:i=n.sent,o=i.highlightedOption,t.scrollIntoView(null===o||void 0===o?void 0:o.id);case 6:case"end":return n.stop()}}),n)})))()},highlightPreviousOption:function(e){var t=this;return de(b.a.mark((function n(){var r,i,o;return b.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.highlightPreviousOption,n.next=3,r();case 3:i=n.sent,o=i.highlightedOption,t.scrollIntoView(null===o||void 0===o?void 0:o.id);case 6:case"end":return n.stop()}}),n)})))()}},components:{MultiSelectorButton:ae,RenderlessSelector:T,SelectorListItem:ie,SelectorButton:Y,SelectorListbox:K}},he=fe,ve=L(he,v,m,!1,null,null,null),me=ve.exports,ye=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("renderless-option",{attrs:{id:e.id,display:e.display,selected:e.selected}},[e._t("default")],2)},be=[];function ge(e){return xe(e)||we(e)||Ie(e)||Oe()}function Oe(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function xe(e){if(Array.isArray(e))return qe(e)}function je(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ke(e,t,n){return t&&Ce(e.prototype,t),n&&Ce(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(n),!0).forEach((function(t){Pe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ee(e,t){return Le(e)||De(e,t)||Ie(e,t)||$e()}function $e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ie(e,t){if(e){if("string"===typeof e)return qe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qe(e,t):void 0}}function qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function De(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],u=!0,s=!1;try{for(n=n.call(e);!(u=(r=n.next()).done);u=!0)if(o.push(r.value),t&&o.length===t)break}catch(l){s=!0,i=l}finally{try{u||null==n["return"]||n["return"]()}finally{if(s)throw i}}return o}}function Le(e){if(Array.isArray(e))return e}var Ae=function(){var e=0;return function(){return e+=1,e}}(),Me=function(e,t,n,r){var i,o,u=Ae(),s=r||[],l=Ee(s,1),c=l[0],a={id:e,condition_id:e,depth:t,input:_e({clause:null===n||void 0===n?void 0:n.clauses[0].id},c&&Pe({},c.id,{clause:null===c||void 0===c||null===(i=c.meta)||void 0===i||null===(o=i.clauses[0])||void 0===o?void 0:o.id})),uid:u};return a},Te=function(e){return e=void 0===e?0:e,{depth:e,type:"conjunction",word:"or"}},Ne=function(e){return e=void 0===e?1:e,{depth:e,type:"conjunction",word:"and"}},Ve=function(){function e(t,n,r){var i=this;je(this,e),t=t||[],n=n||[],this.conditions=n,this.blueprint=t.map((function(e){return _e(_e({},e),{},{id:e.condition_id,uid:Ae()})})),this.blueprintChanged=function(){r&&r(ge(i.blueprint))}}return ke(e,[{key:"groupedBlueprint",value:function(){if(0===this.blueprint.length)return[];var e=[];return e.push([]),this.blueprint.forEach((function(t,n){if("or"===t.word)e.push([]);else{if("and"===t.word)return;e[e.length-1].push(_e(_e({},t),{},{position:n}))}})),e}},{key:"indexOfCriterion",value:function(e){for(var t=e.uid,n=-1,r=0;r<this.blueprint.length;r++)if(this.blueprint[r].uid===t){n=r;break}return n}},{key:"replaceCriterion",value:function(e,t){var n=this.findCondition(t.id),r=n.meta,i=n.id,o=n.refinements,u=Me(i,1,r,o);this.blueprint.splice(e,1,u),this.blueprintChanged()}},{key:"removeCriterion",value:function(e){var t=this.blueprint,n=t[e-1],r=t[e+1],i=r&&"or"===r.word,o=n&&"or"===n.word,u=i||!r,s=o||!n,l=s&&!u,c=s&&u,a=!n&&!r;a?this.blueprint=[]:c&&o?t.splice(e-1,2):c&&!n||l?t.splice(e,2):t.splice(e-1,2),this.blueprintChanged()}},{key:"findCriterion",value:function(e){var t=this.indexOfCriterion({uid:e});return this.blueprint[t]}},{key:"addGroup",value:function(){var e=this.blueprint,t=this.conditions,n=t[0],r=n.meta,i=n.refinements;e.length>0&&e.push(Te()),e.push(Me(n.id,1,r,i)),this.blueprintChanged()}},{key:"addCriterion",value:function(e){var t=e.id,n=e.depth,r=this.blueprint,i=Me(t,n);return 0===r.length?r.push(i):r.splice(r.length,0,Ne(),i),this.blueprintChanged(),i}},{key:"insertCriterion",value:function(e){var t=this.blueprint,n=this.conditions,r=n[0],i=r.meta,o=r.refinements;return t.splice(e+1,0,Ne(),Me(r.id,1,i,o)),this.blueprintChanged(),t[e+1]}},{key:"findRefinement",value:function(e,t){var n,r=this.findCondition(e),i=r.refinements;return i.forEach((function(e){e.id===t&&(n=e)})),n}},{key:"findCondition",value:function(e){var t=this.conditions[0];return this.conditions.forEach((function(n){n.id===e&&(t=n)})),t}},{key:"switchClause",value:function(e,t,n){var r=e.uid,i=e.id,o=this.findCondition(i),u=o.component,s=this.findCriterion(r);"option-condition"===u?s.input={clause:t}:this.updateInput({uid:r},{clause:t},n)}},{key:"switchRefinement",value:function(e,t,n){var r=e.uid,i=e.id,o=this.findRefinement(i,n),u=this.findCriterion(r),s=_e({},u.input);delete s[t],s[n]={clause:o.meta.clauses[0].id},u.input=s}},{key:"updateInput",value:function(e,t,n){var r=e.uid,i=this.findCriterion(r);Object.keys(t).forEach((function(e){n?i.input[n][e]=t[e]:i.input[e]=t[e]})),this.blueprintChanged()}}]),e}(),Be=Ve,Re={name:"renderless-query-builder",props:{blueprint:{type:Array,required:!1},conditions:{type:Array,required:!0}},provide:function(){var e=this.blueprintStore;return{blueprint:e,builderModeActive:!0}},data:function(){var e=this,t=this.conditions.reduce((function(e,t){return e[t.id]=t,e}),{});return{conditionsLookup:t,blueprintStore:new Be(this.blueprint,this.conditions,(function(t){e.$emit("change",t)}))}},methods:{replaceCriterion:function(e,t){this.blueprintStore.replaceCriterion(e,t)},insertCriterion:function(e){this.blueprintStore.insertCriterion(e)},removeCriterion:function(e){this.blueprintStore.removeCriterion(e)},addGroup:function(){this.blueprintStore.addGroup()},conditionFor:function(e){var t=e.id,n=e.uid,r=this.conditionsLookup[t],i=r.id,o=r.type,u=r.display,s=r.meta;return{id:i,type:o,display:u,uid:n,meta:s}}},render:function(){var e,t=this.insertCriterion,n=this.addGroup,r=this.blueprintStore,i=this.conditionFor,o=this.replaceCriterion,u=this.removeCriterion;return null!==(e=this.$scopedSlots)&&void 0!==e&&e.default?this.$scopedSlots.default({insertCriterion:t,addGroup:n,blueprint:r,conditionFor:i,removeCriterion:u,replaceCriterion:o,groupedBlueprint:r.groupedBlueprint()}):null}},Fe=function(e,t,n){var r,i,o,u=Object(p["inject"])("blueprint"),s=Object(p["inject"])("builderModeActive");if(!e)throw new Error("useCondition requires an id.");if(!n)throw new Error("useCondition requires a Vue context.");if(!u)throw new Error("Conditions must be rendered within a query.");o=s?u.findCriterion(t.uid):u.addCriterion({id:e,depth:0});var l=function(e,t){return u.updateInput(o,e,t)},c=function(e){return u.switchClause(o,e)},a=function(e,t){u.switchRefinement(o,e,t)};Object(p["provide"])("criterion",o),Object(p["provide"])("criterionMeta",t.meta),Object(p["provide"])("updateInput",l),Object(p["provide"])("switchRefinement",a),Object(p["provide"])("refinementId",null),Object(p["onUnmounted"])((function(){s||u.removeCriterion(u.indexOfCriterion(o))}));var d=null;return null!==t&&void 0!==t&&null!==(r=t.condition)&&void 0!==r&&null!==(i=r.meta)&&void 0!==i&&i.clauses&&(d=t.condition.meta.clauses.map((function(e){return e.component}))),function(){return n.slots.default?n.slots.default({clauses:d,criterion:o,updateInput:l,switchClause:c}):null}},ze={name:"renderless-condition",props:{id:{type:String,required:!0},display:{type:String,required:!0},uid:{type:Number,required:!0},meta:{type:Object,required:!0}},setup:function(e,t){return Fe(e.id,e,t)}};function Ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(n),!0).forEach((function(t){Ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ue={name:"renderless-option",inject:["selector"],mixins:[N],computed:{isSelected:function(){var e=this.selector,t=this.id;return e.isSelected(t)}},created:function(){var e=this.id,t=this.display,n=this.selected,r=this.selector;r.registerOption(He({id:e,display:t||e},this.$attrs)),n&&r.selectOption(e)},render:function(){var e,t=this.isSelected;return null!==(e=this.$scopedSlots)&&void 0!==e&&e.default&&t?this.$scopedSlots.default():null}},We=["clause"];function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(n),!0).forEach((function(t){Je(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Je(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ke(e,t){if(null==e)return{};var n,r,i=Ze(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ze(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var et,tt,nt=function(e,t,n){var r=Object(p["inject"])("criterion"),i=Object(p["inject"])("updateInput"),o=Object(p["inject"])("refinementId"),u=Object(p["inject"])("builderModeActive"),s=function(e){i(e,o)};if(!r)throw new Error("A clause must be used within a criterion.");if(!u){i({clause:e},o);var l=r.input,c=(l.clause,Ke(l,We));Object.keys(t).length>0&&0===Object.keys(c).length&&i(Xe({},t),o)}return Object(p["onUnmounted"])((function(){u||r.input.clause===e&&i({clause:void 0},o)})),function(){return n.slots.default?n.slots.default(Xe({setValue:s},r.input)):null}},rt={name:"renderless-clause",props:{clause:{type:String,required:!0}},setup:function(e,t){return nt(e.clause,e,t)}},it={name:"renderless-refinement",inject:["updateInput"],props:{id:{type:String,required:!0}},provide:function(){return{refinementId:this.id}},render:function(){var e;if(null!==(e=this.$scopedSlots)&&void 0!==e&&e.default)return this.$scopedSlots.default()}},ot={name:"selector-option",mixins:[N],components:{RenderlessOption:Ue}},ut=ot,st=L(ut,ye,be,!1,null,null,null),lt=st.exports,ct=me,at=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("selector",{on:{"select-option":e.selectOption}},[e._t("default")],2)},pt=[],dt={name:"condition-selector",methods:{selectOption:function(e){this.$emit("select-condition",e)}},components:{Selector:ct}},ft=dt,ht=L(ft,at,pt,!1,null,null,null),vt=ht.exports,mt=vt,yt={props:{blueprint:{type:Array,required:!1},conditions:{type:Array,required:!1}},provide:function(){var e=this.blueprintStore;return{blueprint:e,builderModeActive:!1}},data:function(){var e=this;return{blueprintStore:new Be(this.blueprint,this.conditions,(function(t){e.$emit("change",t)}))}},render:function(){var e,t=this.blueprintStore;return null!==(e=this.$scopedSlots)&&void 0!==e&&e.default?this.$scopedSlots.default({blueprint:t}):null}},bt=yt,gt=L(bt,et,tt,!1,null,null,null),Ot=gt.exports,wt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("renderless-clause",e._b({scopedSlots:e._u([{key:"default",fn:function(t){var r=t.setValue;return[n("selector",{attrs:{innerClass:"refine-clause-selector"},on:{"select-option":e.switchClause}},e._l(e.meta.clauses,(function(t){var i=t.id,o=t.display,u=t.component,s=t.meta;return n("selector-option",{key:i,attrs:{id:i,display:o,selected:e.input.clause===i}},[n("div",[u?n(u,e._b({tag:"component",on:{input:r}},"component",Object.assign({},e.meta,s,e.input),!1)):e._e()],1)])})),1)]}}])},"renderless-clause",e.input,!1))},xt=[],jt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"refine-double-number-wrapper"},[n("number-input",{attrs:{meta:e.meta,value:e.currentValue},on:{input:e.updateFirstValue}}),e.joinWord?n("span",{staticClass:"refine-double-number-joiner"},[e._v(e._s(e.joinWord))]):e._e(),n("number-input",{attrs:{meta:e.meta,value:e.currentValue},on:{input:e.updateSecondValue}})],1)},Ct=[],kt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("input",e._b({staticClass:"refine-number-input",attrs:{type:"number"},domProps:{value:e.currentValue},on:{input:e.handleInputChange}},"input",e.metaAttributes,!1))},St=[],_t={name:"number-input",data:function(){return{currentValue:this.value}},props:{value:{type:Number,required:!1},meta:{type:Object,required:!1,default:function(){return{}}}},computed:{metaAttributes:function(){var e=this;return["min","max","step","placeholder"].reduce((function(t,n){return Object.prototype.hasOwnProperty.call(e.meta,n)&&""!==e.meta[n]&&(t[n]=e.meta[n]),t}),{})}},methods:{handleInputChange:function(e){var t=e.target.value,n=Number(t);isNaN(n)?this.currentValue=t:(this.currentValue=n,this.$emit("input",{value:n}))}}},Pt=_t,Et=L(Pt,kt,St,!1,null,null,null),$t=Et.exports,It={data:function(){return{currentValue:this.value}},computed:{joinWord:function(){return Object.prototype.hasOwnProperty.call(this.meta,"joiner")?this.meta.joiner:"and"}},methods:{updateFirstValue:function(e){var t=e.value;this.$emit("input",{value1:t})},updateSecondValue:function(e){var t=e.value;this.$emit("input",{value2:t})}},props:{value1:{type:[String,Number],required:!1},value2:{type:[String,Number],required:!1},meta:{type:Object,required:!1,default:function(){return{}}}},components:{NumberInput:$t}},qt=It,Dt=L(qt,jt,Ct,!1,null,null,null),Lt=Dt.exports,At=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("input",{staticClass:"refine-text-input",attrs:{type:"text"},domProps:{value:e.value},on:{input:function(t){return e.$emit("input",{value:t.target.value})}}})},Mt=[],Tt={props:{value:{type:String,required:!1,default:""}}},Nt=Tt,Vt=L(Nt,At,Mt,!1,null,null,null),Bt=Vt.exports,Rt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("date-picker",e._b({attrs:{date:e.date1},on:{input:e.handleInput}},"date-picker",e.$attrs,!1))},Ft=[],zt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("date-picker",e._b({attrs:{"value-type":"YYYY-MM-DD",format:e.format,"input-class":e.hasError?e.inputClass+e.errorClass:e.inputClass},on:{input:e.handleInput,"input-error":e.handleInputError},scopedSlots:e._u([{key:"icon-calendar",fn:function(){return[e.hasError?e._e():n("svg",{staticClass:"refine-date-input-calendar-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z","clip-rule":"evenodd"}})]),e.hasError?n("svg",{staticClass:"refine-date-input-error-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"}})]):e._e()]},proxy:!0}]),model:{value:e.time,callback:function(t){e.time=t},expression:"time"}},"date-picker",e.$attrs,!1))},Gt=[],Ht=n("c255"),Yt=n.n(Ht),Ut={components:{DatePicker:Yt.a},props:{date:{type:String,required:!1},format:{type:String,required:!1,default:"MM/DD/YYYY"}},data:function(){var e=this.date;return{time:e,hasError:!1,inputClass:"refine-date-input",errorClass:"refine-date-input-error"}},methods:{handleInputError:function(){this.hasError=!0},handleInput:function(){this.hasError=!1,this.$emit("input",{date:this.time})}}},Wt=Ut,Qt=L(Wt,zt,Gt,!1,null,null,null),Xt=Qt.exports,Jt={props:{date1:{type:String,required:!1}},components:{DatePicker:Xt},methods:{handleInput:function(e){var t=e.date;this.$emit("input",{date1:t})}}},Kt=Jt,Zt=L(Kt,Rt,Ft,!1,null,null,null),en=Zt.exports,tn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"refine-double-date-wrapper"},[n("date-picker",e._b({attrs:{date:e.date1},on:{input:e.updateFirstDate}},"date-picker",e.$attrs,!1)),e.joinWord?n("p",{staticClass:"refine-double-date-joiner"},[e._v(e._s(e.joinWord))]):e._e(),n("date-picker",{attrs:{date:e.date2},on:{input:e.updateSecondDate}})],1)},nn=[],rn={components:{DatePicker:Xt},props:{date1:{type:String,required:!1},date2:{type:String,required:!1},meta:{type:Object,required:!1,default:function(){return{}}}},computed:{joinWord:function(){return Object.prototype.hasOwnProperty.call(this.meta,"joiner")?this.meta.joiner:"and"}},methods:{updateFirstDate:function(e){var t=e.date;this.$emit("input",{date1:t})},updateSecondDate:function(e){var t=e.date;this.$emit("input",{date2:t})}}},on=rn,un=L(on,tn,nn,!1,null,null,null),sn=un.exports,ln=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"refine-relative-date-wrapper"},[n("div",[n("input",{staticClass:"number-input",attrs:{type:"number",name:"days"},domProps:{value:e.amount},on:{input:e.updateAmount}})]),n("selector",{on:{"select-option":e.updateUnit}},e._l(e.units,(function(t){return n("selector-option",{key:t.id,attrs:{id:e.id("unit-"+t.id),display:t.display}})})),1),n("selector",{on:{"select-option":e.updateModifier}},e._l(e.modifiers,(function(t){return n("selector-option",{key:t.id,attrs:{id:e.id("modifier-"+t.id),display:t.display}})})),1)],1)},cn=[],an={components:{Selector:ct,SelectorOption:lt},mixins:[B],props:{amount:{type:[String,Number],required:!1},unit:{type:String,required:!1},modifier:{type:String,required:!1},meta:{type:Object,required:!1,default:function(){return{}}}},created:function(){var e=this.modifier;this.$emit("input",{modifier:e})},computed:{units:function(){return this.meta.units},modifiers:function(){return this.meta.modifiers}},methods:{id:function(e){return"".concat(this.uid,"-").concat(e)},updateModifier:function(e){this.$emit("input",{modifier:e.id})},updateAmount:function(e){var t=e.target.value;this.$emit("input",{amount:t})},updateUnit:function(e){this.$emit("input",{unit:e.id})}}},pn=an,dn=L(pn,ln,cn,!1,null,null,null),fn=dn.exports,hn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("selector",{attrs:{isMultiSelect:e.multiple},on:{"select-option":e.selectOption,"deselect-option":e.deselectOption}},e._l(e.options,(function(t){var r=t.id,i=t.display;return n("selector-option",{key:r,attrs:{id:r,display:i,selected:e.isSelected(r)}})})),1)},vn=[],mn={name:"option-input",components:{Selector:ct,SelectorOption:lt},created:function(){console.log(this.multiple)},props:{selected:{type:Array,required:!1,default:function(){return[]}},options:{type:Array,required:!0},multiple:{type:Boolean,required:!1,default:!1}},methods:{selectOption:function(e){var t=e.selectedOptions,n=t.map((function(e){var t=e.id;return t}));this.$emit("input",{selected:n})},deselectOption:function(e){var t=e.selectedOptions,n=t.map((function(e){var t=e.id;return t}));this.$emit("input",{selected:n})},isSelected:function(e){var t=!1;return this.selected.forEach((function(n){n===e&&(t=!0)})),t}}},yn=mn,bn=L(yn,hn,vn,!1,null,null,null),gn=bn.exports,On={DateInput:en,DoubleDateInput:sn,DoubleNumberInput:Lt,NumberInput:$t,OptionInput:gn,RelativeDateInput:fn,TextInput:Bt};function wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wn(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cn={name:"clause",props:{input:{type:Object,default:function(){return{}}},meta:{type:Object,required:!0}},methods:{switchClause:function(e){var t=e.selectedOption;this.$emit("switch-clause",t)}},components:xn({RenderlessClause:rt,SelectorOption:lt,Selector:ct},r)},kn=Cn,Sn=L(kn,wt,xt,!1,null,null,null),_n=Sn.exports,Pn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("selector",{staticClass:"pt-4",attrs:{innerClass:"mr-4"},on:{"select-option":e.selectRefinement}},e._l(e.refinements,(function(t){var r=t.id,i=t.meta,o=t.display;return n("selector-option",{key:r,attrs:{id:r,display:o,selected:!!e.input[r]}},[n("renderless-refinement",{attrs:{id:r}},[n("clause",{attrs:{meta:i,input:e.input[r]},on:{"switch-clause":function(t){var n=t.id;return e.updateInput({clause:n},r)}}})],1)],1)})),1)},En=[],$n={name:"refinements",inject:["updateInput","switchRefinement"],components:{Clause:_n,RenderlessRefinement:it,Selector:ct,SelectorOption:lt},props:{refinements:{required:!0,type:Array},input:{required:!1,type:Object,default:function(){return{}}}},methods:{selectedRefinementId:function(){var e,t=this;return this.refinements.forEach((function(n){var r=n.id;t.input[r]&&(e=r)})),e},selectRefinement:function(e){var t=e.selectedOption,n=t.id;this.switchRefinement(this.selectedRefinementId(),n)}}},In=$n,qn=L(In,Pn,En,!1,null,null,null),Dn=qn.exports,Ln={name:"criterion",props:{conditions:{required:!0,type:Array},conditionId:{type:String,required:!0},input:{type:Object,required:!0},errors:{type:Array,required:!1,default:function(){return[]}}},methods:{switchCondition:function(e){var t=e.selectedOption;this.$emit("switch-condition",t)},switchClause:function(e){this.$emit("switch-clause",e)}},components:{Clause:_n,Refinements:Dn,SelectorOption:lt,Selector:ct}},An=Ln,Mn=L(An,f,h,!1,null,null,null),Tn=Mn.exports;a.a.use(d.a);var Nn={name:"query-builder",model:{prop:"blueprint",event:"change"},props:{blueprint:{required:!1,type:Array,default:function(){return[]}},conditions:{required:!0,type:Array},errors:{required:!1,type:Object,default:function(){return{}}}},methods:{onChange:function(e){this.$emit("change",e)}},created:function(){if(0===this.conditions.length)throw new Error("You must provide at least one condition to the query builder.")},components:{Criterion:Tn,RenderlessCondition:ze,RenderlessQueryBuilder:Re}},Vn=Nn,Bn=L(Vn,s,l,!1,null,null,null),Rn=Bn.exports,Fn=Rn,zn={};a.a.directive("click-away",{bind:function(e,t){var n=t.value;if("function"!==typeof n)throw new Error("The click-away directive expects a function/method as an argument.");if(!e.id)throw new Error("The click-away directive requires the element it is bound to to have an id.");var r=function(t){e.contains(t.target)||n()};zn[e.id]=r,document.addEventListener("click",r),document.addEventListener("touchstart",r)},unbind:function(e){document.removeEventListener("click",zn[e.id]),document.removeEventListener("touchstart",zn[e.id]),delete zn[e.id]}});n("9c9e");var Gn=Fn;t["default"]=Gn}})["default"]})); | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("@vue/composition-api"),require("vue"),require("vue2-datepicker")):"function"===typeof define&&define.amd?define(["@vue/composition-api","vue","vue2-datepicker"],t):"object"===typeof exports?exports["refine-vue2"]=t(require("@vue/composition-api"),require("vue"),require("vue2-datepicker")):e["refine-vue2"]=t(e[void 0],e[void 0],e[void 0])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({8165:function(t,n){t.exports=e},8875:function(e,t,n){var r,i,o;(function(n,u){i=[],r=u,o="function"===typeof r?r.apply(t,i):r,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(f){var n,r,i,o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,u=/@([^@]*):(\d+):(\d+)\s*$/gi,s=o.exec(f.stack)||u.exec(f.stack),l=s&&s[1]||!1,c=s&&s[2]||!1,a=document.location.href.replace(document.location.hash,""),p=document.getElementsByTagName("script");l===a&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(c-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),i=n.replace(r,"$1").trim());for(var d=0;d<p.length;d++){if("interactive"===p[d].readyState)return p[d];if(p[d].src===l)return p[d];if(l===a&&p[d].innerHTML&&p[d].innerHTML.trim()===i)return p[d]}return null}}return e}))},"8bbf":function(e,n){e.exports=t},"96cf":function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(q){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),u=new E(r||[]);return o._invoke=k(e,n,u),o}function a(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(q){return{type:"throw",arg:q}}}e.wrap=c;var p="suspendedStart",d="suspendedYield",f="executing",h="completed",v={};function m(){}function y(){}function b(){}var g={};l(g,o,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O($([])));w&&w!==n&&r.call(w,o)&&(g=w);var x=b.prototype=m.prototype=Object.create(g);function j(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(i,o,u,s){var l=a(e[i],e,o);if("throw"!==l.type){var c=l.arg,p=c.value;return p&&"object"===typeof p&&r.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,u,s)}),(function(e){n("throw",e,u,s)})):t.resolve(p).then((function(e){c.value=e,u(c)}),(function(e){return n("throw",e,u,s)}))}s(l.arg)}var i;function o(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}this._invoke=o}function k(e,t,n){var r=p;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return I()}n.method=i,n.arg=o;while(1){var u=n.delegate;if(u){var s=S(u,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=a(e,t,n);if("normal"===l.type){if(r=n.done?h:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=h,n.method="throw",n.arg=l.arg)}}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator["return"]&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=a(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function $(e){if(e){var n=e[o];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,u=function n(){while(++i<e.length)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return u.next=u}}return{next:I}}function I(){return{value:t,done:!0}}return y.prototype=b,l(x,"constructor",b),l(b,"constructor",y),y.displayName=l(b,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,s,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},j(C.prototype),l(C.prototype,u,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var u=new C(c(t,n,r,i),o);return e.isGeneratorFunction(n)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},j(x),l(x,s,"Generator"),l(x,o,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){while(t.length){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=$,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],s=u.completion;if("root"===u.tryLoc)return i("end");if(u.tryLoc<=this.prev){var l=r.call(u,"catchLoc"),c=r.call(u,"finallyLoc");if(l&&c){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(l){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:$(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=r}catch(i){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},"9c9e":function(e,t,n){},a34a:function(e,t,n){e.exports=n("96cf")},c255:function(e,t){e.exports=n},fb15:function(e,t,n){"use strict";n.r(t),n.d(t,"ConditionSelector",(function(){return vt})),n.d(t,"Query",(function(){return gt})),n.d(t,"QueryBuilder",(function(){return Rn})),n.d(t,"Selector",(function(){return lt})),n.d(t,"SelectorOption",(function(){return st}));var r={};if(n.r(r),n.d(r,"default",(function(){return gn})),n.d(r,"DateInput",(function(){return Zt})),n.d(r,"DoubleDateInput",(function(){return un})),n.d(r,"DoubleNumberInput",(function(){return Dt})),n.d(r,"NumberInput",(function(){return Et})),n.d(r,"OptionInput",(function(){return bn})),n.d(r,"RelativeDateInput",(function(){return dn})),n.d(r,"TextInput",(function(){return Vt})),"undefined"!==typeof window){var i=window.document.currentScript,o=n("8875");i=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var u=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);u&&(n.p=u[1])}var s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("renderless-query-builder",{attrs:{blueprint:e.blueprint,conditions:e.conditions},on:{change:e.onChange},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.groupedBlueprint,i=t.replaceCriterion,o=t.insertCriterion,u=t.addGroup,s=t.removeCriterion,l=t.conditionFor;return[n("div",{staticClass:"refine-query-builder-wrapper"},[e._l(r,(function(t,r){return n("div",{key:r,staticClass:"refine-query-builder-condition-group"},[e._l(t,(function(t,r){return n("div",{key:t.uid,staticClass:"refine-query-builder-condition"},[n("renderless-condition",e._b({scopedSlots:e._u([{key:"default",fn:function(o){var u=o.switchClause;return[n("criterion",{attrs:{conditionId:t.id,conditions:e.conditions,errors:e.errors[r],input:t.input},on:{"switch-clause":function(e){var t=e.id;return u(t)},"remove-condition":function(e){return s(t.position)},"switch-condition":function(e){return i(t.position,l(e))}}})]}}],null,!0)},"renderless-condition",l(t),!1))],1)})),n("button",{staticClass:"refine-query-builder-and-button",attrs:{tabindex:"0",type:"button"},on:{click:function(e){return o(t[t.length-1].position)}}},[n("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z","clip-rule":"evenodd"}})]),n("span",{staticClass:"refine-query-builder-and-button-span"},[e._v("And")])])],2)})),n("button",{staticClass:"refine-query-builder-or-button",attrs:{type:"button"},on:{click:u}},[e._v(" Add an 'Or' ")])],2)]}}])})},l=[],c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"py-2"},[n("ul",{staticClass:"refine-criterion-errors"},e._l(e.errors,(function(t){return n("li",{key:t.id,staticClass:"refine-criterion-error"},[e._v(" "+e._s(t.message)+" ")])})),0),n("div",{staticClass:"flex items-start"},[n("button",{staticClass:"refine-criterion-remove-icon",attrs:{type:"button"},on:{click:function(t){return t.preventDefault(),e.$emit("remove-condition")}}},[n("svg",{staticClass:"h-5 w-5",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z","clip-rule":"evenodd"}})])]),n("selector",{staticClass:"pr-4 flex items-center",attrs:{innerClass:"mr-4"},on:{"select-option":e.switchCondition}},e._l(e.conditions,(function(t){var r=t.id,i=t.display,o=t.meta,u=t.refinements;return n("selector-option",{key:r,attrs:{id:r,display:i,selected:e.conditionId===r}},[n("div",[n("clause",{attrs:{input:e.input,meta:o},on:{"switch-clause":e.switchClause}}),u&&u.length>0?n("refinements",{attrs:{input:e.input,refinements:u}}):e._e()],1)])})),1)],1)])},a=[],p=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("renderless-selector",{on:{"select-option":function(t){return e.$emit("select-option",arguments[0])},"deselect-option":function(t){return e.$emit("deselect-option",arguments[0])}},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.actions,i=t.isOpen,o=t.isClosed,u=t.selectedOptions,s=t.highlightedOption,l=t.options;return[n("div",{staticClass:"refine-selector-wrapper"},[n("div",{directives:[{name:"click-away",rawName:"v-click-away",value:r.close,expression:"actions.close"}],staticClass:"refine-selector",class:e.innerClass,attrs:{id:"listbox-"+e.selectorId,"aria-labelledby":e.buttonId}},[e.isMultiSelect?n("multi-selector-button",{ref:"button",attrs:{id:e.buttonId,isOpen:i,selectedOptions:u},on:{toggle:function(t){return e.toggle(r)},open:function(t){return e.open(r)},"deselect-option":function(t){var n=arguments.length,i=Array(n);while(n--)i[n]=arguments[n];return e.deselectOption.apply(void 0,i.concat([r]))}}}):n("selector-button",{ref:"button",attrs:{id:e.buttonId,isOpen:i,display:u[0]?u[0].display:""},on:{toggle:function(t){return e.toggle(r)},open:function(t){return e.open(r)}}}),n("selector-listbox",{ref:"listBox",attrs:{selectedOption:u[0],isClosed:o},on:{"highlight-next-option":function(t){return e.highlightNextOption(r)},"highlight-previous-option":function(t){return e.highlightPreviousOption(r)},"select-option":function(t){return e.selectOption(s.id,r)},close:function(t){return e.close(r)}},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.createItemId;return e._l(l,(function(t){return n("selector-list-item",{key:t.id,ref:t.id,refInFor:!0,attrs:{id:i(t.id),optionId:t.id,optionDisplay:t.display,selected:e.isSelected(t,u),isHighlighted:s&&t.id===s.id},on:{mouseenter:function(e){return r.highlightOption(t)},mouseleave:function(e){return r.highlightOption(null)},click:function(n){return e.selectOption(t.id,r)}}})}))}}],null,!0)})],1),n("div",{staticClass:"refine-selector-custom-options-wrapper"},[e._t("default")],2)])]}}],null,!0)})],1)},d=[],f=n("a34a"),h=n.n(f),v=n("8bbf"),m=n.n(v);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t,n){return t&&w(e.prototype,t),n&&w(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var j=function(){function e(){O(this,e),this.options=[],this.selectedOptions=[]}return x(e,[{key:"registerOption",value:function(e){for(var t=e.id,n=0;n<this.options.length;n++){var r=this.options[n];if(r.id===t)throw new Error("An option with id ${optionId} has already been registered for this selector.")}var i=this.options[this.options.length-1]||null,o=b({previousOption:i,nextOption:null},e);i&&(i.nextOption=o),this.options.push(o)}},{key:"isSelected",value:function(e){var t=!1;return this.selectedOptions.forEach((function(n){n.id===e&&(t=!0)})),t}},{key:"findOption",value:function(e){for(var t=0;t<this.options.length;t++){var n=this.options[t];if(n.id===e)return n}return null}},{key:"toggleOption",value:function(e){return this.isSelected(e)?this.deselectOption(e):this.selectOption(e)}},{key:"clearSelectedOptions",value:function(){this.selectedOptions.splice(0,this.selectedOptions.length)}},{key:"deselectOption",value:function(e){var t=this.findOption(e);return this.selectedOptions=this.selectedOptions.filter((function(t){return t.id!==e})),{deselectedOption:t,selectedOptions:this.selectedOptions}}},{key:"selectOption",value:function(e){var t=this.findOption(e);return this.isSelected(e)||this.selectedOptions.push(t),{selectedOption:t,selectedOptions:this.selectedOptions}}}]),e}(),C=j;function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P,E,$={name:"renderless-selector",data:function(){return{selector:m.a.observable(new C),isClosed:!0,highlightedOption:null}},provide:function(){return{selector:this.selector}},computed:{selectedOptions:function(){return this.selector.selectedOptions},firstSelectedOption:function(){return this.selectedOptions[0]||this.selector.options[0]},isOpen:function(){return!this.isClosed},actions:function(){var e=this.clearOptions,t=this.close,n=this.highlightNextOption,r=this.highlightPreviousOption,i=this.highlightOption,o=this.open,u=this.selectOption,s=this.selectedOptions,l=this.toggle,c=this.toggleOption;return{clearOptions:e,close:t,highlightNextOption:n,highlightPreviousOption:r,highlightOption:i,open:o,selectOption:u,selectedOptions:s,toggle:l,toggleOption:c}},state:function(){var e=this.isClosed,t=this.isOpen,n=this.selectedOptions,r=this.highlightedOption;return{isClosed:e,isOpen:t,selectedOptions:n,highlightedOption:r,options:this.selector.options}}},methods:{nextTick:function(){var e=this;return m.a.nextTick().then((function(){return S({actions:e.actions},e.state)}))},close:function(){return this.isClosed||(this.isClosed=!0),this.nextTick()},open:function(){return this.isClosed=!1,this.highlightedOption=this.firstSelectedOption,this.nextTick()},toggle:function(){return this.isClosed?this.open():this.close(),this.nextTick()},toggleOption:function(e){var t=this.selector,n=this.highlightOption,r=t.toggleOption(e),i=r.selectedOption;return i?this.selectOption(e):this.deselectOption(e),n(t.findOption(e))},clearOptions:function(){this.selector.clearSelectedOptions()},deselectOption:function(e){this.$emit("deselect-option",this.selector.deselectOption(e))},selectOption:function(e){this.$emit("select-option",this.selector.selectOption(e))},highlightOption:function(e){return this.highlightedOption=e,this.nextTick()},highlightNextOption:function(){var e,t=null===(e=this.highlightedOption)||void 0===e?void 0:e.nextOption;return t&&(this.highlightedOption=t),this.nextTick()},highlightPreviousOption:function(){var e,t=null===(e=this.highlightedOption)||void 0===e?void 0:e.previousOption;return t&&(this.highlightedOption=t),this.nextTick()}},render:function(){var e;return null!==(e=this.$scopedSlots)&&void 0!==e&&e.default?this.$scopedSlots.default(S({actions:this.actions},this.state)):null}},I=$;function q(e,t,n,r,i,o,u,s){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),u?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(u)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var a=c.render;c.render=function(e,t){return l.call(t),a(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}var D=q(I,P,E,!1,null,null,null),L=D.exports,A=L,M={props:{id:{type:String,required:!0},display:{type:String,required:!1},selected:{type:Boolean,required:!1,default:!1}}},T=1,N={beforeCreate:function(){this.uid=T.toString(),T+=1}},V=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{ref:"button",staticClass:"refine-selector-button",attrs:{id:e.id,type:"button","aria-haspopup":"listbox","aria-expanded":e.isOpen,"aria-label":e.label()},on:{click:function(t){return t.preventDefault(),e.$emit("toggle")},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"arrow-down",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("open"))}}},[0===e.display.length?n("span",{staticClass:"refine-selector-button-placeholder"},[e._v(" Choose an option ")]):n("span",{staticClass:"refine-selector-button-selected"},[e._v(" "+e._s(e.display)+" ")]),n("span",{staticClass:"refine-selector-button-icon-wrapper"},[n("svg",{staticClass:"refine-selector-button-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])},B=[],R={name:"selector-button",props:{id:{type:String,required:!0},isOpen:{type:Boolean,required:!0},display:{type:String,required:!0}},methods:{label:function(){return this.display?"".concat(this.display," Selected"):"Choose an option"},focus:function(){this.$refs.button.focus()}}},F=R,z=q(F,V,B,!1,null,null,null),G=z.exports,H=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"refine-selector-listbox-wrapper"},[n("ul",{ref:"listBox",staticClass:"refine-selector-listbox",class:{"refine-selector-listbox-hidden":e.isClosed},attrs:{tabindex:"-1",role:"listbox","aria-activedescendant":e.selectedOption?e.createItemId(e.selectedOption.id):""},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"arrow-down",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("highlight-next-option"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"arrow-up",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("highlight-previous-option"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.$emit("select-option"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"escape",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("close"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:(t.stopPropagation(),t.preventDefault(),e.$emit("close"))}]}},[e._t("default",null,{createItemId:e.createItemId})],2)])},Y=[],U={name:"selector-listbox",mixins:[N],props:{isClosed:{type:Boolean,required:!1,default:!0},selectedOption:{type:Object,required:!1}},methods:{focus:function(){this.$refs.listBox.focus()},createItemId:function(e){return"listbox-option-".concat(this.uid,"-").concat(e)}}},W=U,Q=q(W,H,Y,!1,null,null,null),X=Q.exports,J=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{key:e.optionId,ref:"listItem",staticClass:"refine-selector-list-item",class:{"refine-selector-list-item-highlighted":e.isHighlighted},attrs:{role:"option","aria-label":e.optionDisplay,"aria-selected":e.selected},on:{mouseenter:function(t){return e.$emit("mouseenter")},mouseleave:function(t){return e.$emit("mouseleave")},click:function(t){return e.$emit("click")}}},[n("span",{staticClass:"refine-selector-list-item-text",class:{"refine-selector-list-item-text-selected":e.selected}},[e._v(" "+e._s(e.optionDisplay)+" ")]),n("span",{staticClass:"refine-selector-list-item-icon-wrapper",class:{"refine-selector-list-item-icon-wrapper-highlighted":!e.isHighlighted}},[n("svg",{directives:[{name:"show",rawName:"v-show",value:e.selected,expression:"selected"}],staticClass:"refine-selector-list-item-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!e.selected}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"}})])])])},K=[],Z={name:"selector-list-item",props:{optionId:{type:String,required:!0},optionDisplay:{type:String,required:!0},selected:{type:Boolean,required:!1,default:!1},isHighlighted:{type:Boolean,required:!1,default:!1}},methods:{scrollIntoView:function(){this.$refs.listItem.scrollIntoView(!1)}}},ee=Z,te=q(ee,J,K,!1,null,null,null),ne=te.exports,re=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"button",staticClass:"refine-multi-selector-button",attrs:{id:e.id,"aria-haspopup":"listbox","aria-label":e.label(),"aria-expanded":e.isOpen,tabindex:"0"},on:{click:function(t){return t.preventDefault(),e.$emit("toggle")},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),t.preventDefault(),e.$emit("open"))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"arrow-down",void 0,t.key,void 0)?null:(t.stopPropagation(),t.preventDefault(),e.$emit("open"))}]}},[0===e.selectedOptions.length?n("span",{staticClass:"refine-multi-selector-button-placeholder"},[e._v(" Choose an option ")]):e._l(e.selectedOptions,(function(t){var r=t.id,i=t.display;return n("span",{key:r,staticClass:"refine-multi-selector-button-selected"},[e._v(" "+e._s(i)+" "),n("span",{staticClass:"refine-multi-selector-button-deselect-icon-wrapper",on:{click:function(t){return t.preventDefault(),e.$emit("deselect-option",r)}}},[n("svg",{staticClass:"refine-multi-selector-button-deselect-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])])})),n("span",{staticClass:"refine-multi-selector-button-icon-wrapper"},[n("svg",{staticClass:"refine-multi-selector-button-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"}})])])],2)},ie=[],oe={name:"multi-selector-button",props:{id:{type:String,required:!0},isOpen:{type:Boolean,required:!0},selectedOptions:{type:Array,required:!0}},methods:{label:function(){var e=this.selectedOptions.map((function(e){var t=e.display;return t})).join(", "),t="".concat(e," Selected");return 0===this.selectedOptions.length?"Choose an option":t},focus:function(){this.$refs.button.focus()}}},ue=oe,se=q(ue,re,ie,!1,null,null,null),le=se.exports;function ce(e,t,n,r,i,o,u){try{var s=e[o](u),l=s.value}catch(c){return void n(c)}s.done?t(l):Promise.resolve(l).then(r,i)}function ae(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function u(e){ce(o,r,i,u,s,"next",e)}function s(e){ce(o,r,i,u,s,"throw",e)}u(void 0)}))}}var pe={name:"selector",mixins:[N],inject:["builderModeActive"],props:{isMultiSelect:{type:Boolean,required:!1,default:!1},innerClass:{type:String,required:!1,default:""}},computed:{selectorId:function(){return this.uid},buttonId:function(){return"button-".concat(this.selectorId)}},mounted:function(){this.builderModeActive&&this.$refs.button.focus()},methods:{isSelected:function(e,t){var n=!1;return t.forEach((function(t){e.id===t.id&&(n=!0)})),n},deselectOption:function(e,t){var n=t.toggleOption;n(e)},selectOption:function(e,t){var n=this;return ae(h.a.mark((function r(){var i,o,u,s;return h.a.wrap((function(r){while(1)switch(r.prev=r.next){case 0:i=t.clearOptions,o=t.selectOption,u=t.toggleOption,s=n.isMultiSelect,s?u(e):(i(),o(e),n.close(t));case 3:case"end":return r.stop()}}),r)})))()},scrollIntoView:function(e){if(e){var t=this.$refs[e][0];t.scrollIntoView()}},close:function(e){var t=this;return ae(h.a.mark((function n(){var r,i,o,u;return h.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.close,n.next=3,r();case 3:i=n.sent,o=i.isClosed,o&&(null===(u=t.$refs.button)||void 0===u||u.focus());case 6:case"end":return n.stop()}}),n)})))()},open:function(e){var t=this;return ae(h.a.mark((function n(){var r,i,o;return h.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.open,n.next=3,r();case 3:i=n.sent,o=i.selectedOption,t.$refs.listBox.focus(),t.scrollIntoView(null===o||void 0===o?void 0:o.id);case 7:case"end":return n.stop()}}),n)})))()},toggle:function(e){var t=this;return ae(h.a.mark((function n(){var r,i,o,u;return h.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.toggle,n.next=3,r();case 3:i=n.sent,o=i.isOpen,u=i.selectedOption,o?(t.$refs.listBox.focus(),t.scrollIntoView(null===u||void 0===u?void 0:u.id)):t.$refs.button.focus();case 7:case"end":return n.stop()}}),n)})))()},highlightNextOption:function(e){var t=this;return ae(h.a.mark((function n(){var r,i,o;return h.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.highlightNextOption,n.next=3,r();case 3:i=n.sent,o=i.highlightedOption,t.scrollIntoView(null===o||void 0===o?void 0:o.id);case 6:case"end":return n.stop()}}),n)})))()},highlightPreviousOption:function(e){var t=this;return ae(h.a.mark((function n(){var r,i,o;return h.a.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.highlightPreviousOption,n.next=3,r();case 3:i=n.sent,o=i.highlightedOption,t.scrollIntoView(null===o||void 0===o?void 0:o.id);case 6:case"end":return n.stop()}}),n)})))()}},components:{MultiSelectorButton:le,RenderlessSelector:A,SelectorListItem:ne,SelectorButton:G,SelectorListbox:X}},de=pe,fe=q(de,p,d,!1,null,null,null),he=fe.exports,ve=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("renderless-option",{attrs:{id:e.id,display:e.display,selected:e.selected}},[e._t("default")],2)},me=[];function ye(e){return Oe(e)||ge(e)||Ee(e)||be()}function be(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ge(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Oe(e){if(Array.isArray(e))return $e(e)}function we(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function je(e,t,n){return t&&xe(e.prototype,t),n&&xe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){Se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e,t){return qe(e)||Ie(e,t)||Ee(e,t)||Pe()}function Pe(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ee(e,t){if(e){if("string"===typeof e)return $e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$e(e,t):void 0}}function $e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ie(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],u=!0,s=!1;try{for(n=n.call(e);!(u=(r=n.next()).done);u=!0)if(o.push(r.value),t&&o.length===t)break}catch(l){s=!0,i=l}finally{try{u||null==n["return"]||n["return"]()}finally{if(s)throw i}}return o}}function qe(e){if(Array.isArray(e))return e}var De=function(){var e=0;return function(){return e+=1,e}}(),Le=function(e,t,n,r){var i,o,u=De(),s=r||[],l=_e(s,1),c=l[0],a={id:e,condition_id:e,depth:t,input:ke({clause:null===n||void 0===n?void 0:n.clauses[0].id},c&&Se({},c.id,{clause:null===c||void 0===c||null===(i=c.meta)||void 0===i||null===(o=i.clauses[0])||void 0===o?void 0:o.id})),uid:u};return a},Ae=function(e){return e=void 0===e?0:e,{depth:e,type:"conjunction",word:"or"}},Me=function(e){return e=void 0===e?1:e,{depth:e,type:"conjunction",word:"and"}},Te=function(){function e(t,n,r){var i=this;we(this,e),t=t||[],n=n||[],this.conditions=n,this.blueprint=t.map((function(e){return ke(ke({},e),{},{id:e.condition_id,uid:De()})})),this.blueprintChanged=function(){r&&r(ye(i.blueprint))}}return je(e,[{key:"groupedBlueprint",value:function(){if(0===this.blueprint.length)return[];var e=[];return e.push([]),this.blueprint.forEach((function(t,n){if("or"===t.word)e.push([]);else{if("and"===t.word)return;e[e.length-1].push(ke(ke({},t),{},{position:n}))}})),e}},{key:"indexOfCriterion",value:function(e){for(var t=e.uid,n=-1,r=0;r<this.blueprint.length;r++)if(this.blueprint[r].uid===t){n=r;break}return n}},{key:"replaceCriterion",value:function(e,t){var n=this.findCondition(t.id),r=n.meta,i=n.id,o=n.refinements,u=Le(i,1,r,o);this.blueprint.splice(e,1,u),this.blueprintChanged()}},{key:"removeCriterion",value:function(e){var t=this.blueprint,n=t[e-1],r=t[e+1],i=r&&"or"===r.word,o=n&&"or"===n.word,u=i||!r,s=o||!n,l=s&&!u,c=s&&u,a=!n&&!r;a?this.blueprint=[]:c&&o?t.splice(e-1,2):c&&!n||l?t.splice(e,2):t.splice(e-1,2),this.blueprintChanged()}},{key:"findCriterion",value:function(e){var t=this.indexOfCriterion({uid:e});return this.blueprint[t]}},{key:"addGroup",value:function(){var e=this.blueprint,t=this.conditions,n=t[0],r=n.meta,i=n.refinements;e.length>0&&e.push(Ae()),e.push(Le(n.id,1,r,i)),this.blueprintChanged()}},{key:"addCriterion",value:function(e){var t=e.id,n=e.depth,r=this.blueprint,i=Le(t,n);return 0===r.length?r.push(i):r.splice(r.length,0,Me(),i),this.blueprintChanged(),i}},{key:"insertCriterion",value:function(e){var t=this.blueprint,n=this.conditions,r=n[0],i=r.meta,o=r.refinements;return t.splice(e+1,0,Me(),Le(r.id,1,i,o)),this.blueprintChanged(),t[e+1]}},{key:"findRefinement",value:function(e,t){var n,r=this.findCondition(e),i=r.refinements;return i.forEach((function(e){e.id===t&&(n=e)})),n}},{key:"findCondition",value:function(e){var t=this.conditions[0];return this.conditions.forEach((function(n){n.id===e&&(t=n)})),t}},{key:"switchClause",value:function(e,t,n){var r=e.uid,i=e.id,o=this.findCondition(i),u=o.component,s=this.findCriterion(r);"option-condition"===u?s.input={clause:t}:this.updateInput({uid:r},{clause:t},n)}},{key:"switchRefinement",value:function(e,t,n){var r=e.uid,i=e.id,o=this.findRefinement(i,n),u=this.findCriterion(r),s=ke({},u.input);delete s[t],s[n]={clause:o.meta.clauses[0].id},u.input=s}},{key:"updateInput",value:function(e,t,n){var r=e.uid,i=this.findCriterion(r);Object.keys(t).forEach((function(e){n?i.input[n][e]=t[e]:i.input[e]=t[e]})),this.blueprintChanged()}}]),e}(),Ne=Te,Ve={name:"renderless-query-builder",props:{blueprint:{type:Array,required:!1},conditions:{type:Array,required:!0}},provide:function(){var e=this.blueprintStore;return{blueprint:e,builderModeActive:!0}},data:function(){var e=this,t=this.conditions.reduce((function(e,t){return e[t.id]=t,e}),{});return{conditionsLookup:t,blueprintStore:new Ne(this.blueprint,this.conditions,(function(t){e.$emit("change",t)}))}},methods:{replaceCriterion:function(e,t){this.blueprintStore.replaceCriterion(e,t)},insertCriterion:function(e){this.blueprintStore.insertCriterion(e)},removeCriterion:function(e){this.blueprintStore.removeCriterion(e)},addGroup:function(){this.blueprintStore.addGroup()},conditionFor:function(e){var t=e.id,n=e.uid,r=this.conditionsLookup[t],i=r.id,o=r.type,u=r.display,s=r.meta;return{id:i,type:o,display:u,uid:n,meta:s}}},render:function(){var e,t=this.insertCriterion,n=this.addGroup,r=this.blueprintStore,i=this.conditionFor,o=this.replaceCriterion,u=this.removeCriterion;return null!==(e=this.$scopedSlots)&&void 0!==e&&e.default?this.$scopedSlots.default({insertCriterion:t,addGroup:n,blueprint:r,conditionFor:i,removeCriterion:u,replaceCriterion:o,groupedBlueprint:r.groupedBlueprint()}):null}},Be=n("8165"),Re=function(e,t,n){var r,i,o,u=Object(Be["inject"])("blueprint"),s=Object(Be["inject"])("builderModeActive");if(!e)throw new Error("useCondition requires an id.");if(!n)throw new Error("useCondition requires a Vue context.");if(!u)throw new Error("Conditions must be rendered within a query.");o=s?u.findCriterion(t.uid):u.addCriterion({id:e,depth:0});var l=function(e,t){return u.updateInput(o,e,t)},c=function(e){return u.switchClause(o,e)},a=function(e,t){u.switchRefinement(o,e,t)};Object(Be["provide"])("criterion",o),Object(Be["provide"])("criterionMeta",t.meta),Object(Be["provide"])("updateInput",l),Object(Be["provide"])("switchRefinement",a),Object(Be["provide"])("refinementId",null),Object(Be["onUnmounted"])((function(){s||u.removeCriterion(u.indexOfCriterion(o))}));var p=null;return null!==t&&void 0!==t&&null!==(r=t.condition)&&void 0!==r&&null!==(i=r.meta)&&void 0!==i&&i.clauses&&(p=t.condition.meta.clauses.map((function(e){return e.component}))),function(){return n.slots.default?n.slots.default({clauses:p,criterion:o,updateInput:l,switchClause:c}):null}},Fe={name:"renderless-condition",props:{id:{type:String,required:!0},display:{type:String,required:!0},uid:{type:Number,required:!0},meta:{type:Object,required:!0}},setup:function(e,t){return Re(e.id,e,t)}};function ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(n),!0).forEach((function(t){He(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ye={name:"renderless-option",inject:["selector"],mixins:[M],computed:{isSelected:function(){var e=this.selector,t=this.id;return e.isSelected(t)}},created:function(){var e=this.id,t=this.display,n=this.selected,r=this.selector;r.registerOption(Ge({id:e,display:t||e},this.$attrs)),n&&r.selectOption(e)},render:function(){var e,t=this.isSelected;return null!==(e=this.$scopedSlots)&&void 0!==e&&e.default&&t?this.$scopedSlots.default():null}},Ue=["clause"];function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?We(Object(n),!0).forEach((function(t){Xe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):We(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Je(e,t){if(null==e)return{};var n,r,i=Ke(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ke(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Ze,et,tt=function(e,t,n){var r=Object(Be["inject"])("criterion"),i=Object(Be["inject"])("updateInput"),o=Object(Be["inject"])("refinementId"),u=Object(Be["inject"])("builderModeActive"),s=function(e){i(e,o)};if(!r)throw new Error("A clause must be used within a criterion.");if(!u){i({clause:e},o);var l=r.input,c=(l.clause,Je(l,Ue));Object.keys(t).length>0&&0===Object.keys(c).length&&i(Qe({},t),o)}return Object(Be["onUnmounted"])((function(){u||r.input.clause===e&&i({clause:void 0},o)})),function(){return n.slots.default?n.slots.default(Qe({setValue:s},r.input)):null}},nt={name:"renderless-clause",props:{clause:{type:String,required:!0}},setup:function(e,t){return tt(e.clause,e,t)}},rt={name:"renderless-refinement",inject:["updateInput"],props:{id:{type:String,required:!0}},provide:function(){return{refinementId:this.id}},render:function(){var e;if(null!==(e=this.$scopedSlots)&&void 0!==e&&e.default)return this.$scopedSlots.default()}},it={name:"selector-option",mixins:[M],components:{RenderlessOption:Ye}},ot=it,ut=q(ot,ve,me,!1,null,null,null),st=ut.exports,lt=he,ct=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("selector",{on:{"select-option":e.selectOption}},[e._t("default")],2)},at=[],pt={name:"condition-selector",methods:{selectOption:function(e){this.$emit("select-condition",e)}},components:{Selector:lt}},dt=pt,ft=q(dt,ct,at,!1,null,null,null),ht=ft.exports,vt=ht,mt={props:{blueprint:{type:Array,required:!1},conditions:{type:Array,required:!1}},provide:function(){var e=this.blueprintStore;return{blueprint:e,builderModeActive:!1}},data:function(){var e=this;return{blueprintStore:new Ne(this.blueprint,this.conditions,(function(t){e.$emit("change",t)}))}},render:function(){var e,t=this.blueprintStore;return null!==(e=this.$scopedSlots)&&void 0!==e&&e.default?this.$scopedSlots.default({blueprint:t}):null}},yt=mt,bt=q(yt,Ze,et,!1,null,null,null),gt=bt.exports,Ot=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("renderless-clause",e._b({scopedSlots:e._u([{key:"default",fn:function(t){var r=t.setValue;return[n("selector",{attrs:{innerClass:"refine-clause-selector"},on:{"select-option":e.switchClause}},e._l(e.meta.clauses,(function(t){var i=t.id,o=t.display,u=t.component,s=t.meta;return n("selector-option",{key:i,attrs:{id:i,display:o,selected:e.input.clause===i}},[n("div",[u?n(u,e._b({tag:"component",on:{input:r}},"component",Object.assign({},e.meta,s,e.input),!1)):e._e()],1)])})),1)]}}])},"renderless-clause",e.input,!1))},wt=[],xt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"refine-double-number-wrapper"},[n("number-input",{attrs:{meta:e.meta,value:e.currentValue},on:{input:e.updateFirstValue}}),e.joinWord?n("span",{staticClass:"refine-double-number-joiner"},[e._v(e._s(e.joinWord))]):e._e(),n("number-input",{attrs:{meta:e.meta,value:e.currentValue},on:{input:e.updateSecondValue}})],1)},jt=[],Ct=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("input",e._b({staticClass:"refine-number-input",attrs:{type:"number"},domProps:{value:e.currentValue},on:{input:e.handleInputChange}},"input",e.metaAttributes,!1))},kt=[],St={name:"number-input",data:function(){return{currentValue:this.value}},props:{value:{type:Number,required:!1},meta:{type:Object,required:!1,default:function(){return{}}}},computed:{metaAttributes:function(){var e=this;return["min","max","step","placeholder"].reduce((function(t,n){return Object.prototype.hasOwnProperty.call(e.meta,n)&&""!==e.meta[n]&&(t[n]=e.meta[n]),t}),{})}},methods:{handleInputChange:function(e){var t=e.target.value,n=Number(t);isNaN(n)?this.currentValue=t:(this.currentValue=n,this.$emit("input",{value:n}))}}},_t=St,Pt=q(_t,Ct,kt,!1,null,null,null),Et=Pt.exports,$t={data:function(){return{currentValue:this.value}},computed:{joinWord:function(){return Object.prototype.hasOwnProperty.call(this.meta,"joiner")?this.meta.joiner:"and"}},methods:{updateFirstValue:function(e){var t=e.value;this.$emit("input",{value1:t})},updateSecondValue:function(e){var t=e.value;this.$emit("input",{value2:t})}},props:{value1:{type:[String,Number],required:!1},value2:{type:[String,Number],required:!1},meta:{type:Object,required:!1,default:function(){return{}}}},components:{NumberInput:Et}},It=$t,qt=q(It,xt,jt,!1,null,null,null),Dt=qt.exports,Lt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("input",{staticClass:"refine-text-input",attrs:{type:"text"},domProps:{value:e.value},on:{input:function(t){return e.$emit("input",{value:t.target.value})}}})},At=[],Mt={props:{value:{type:String,required:!1,default:""}}},Tt=Mt,Nt=q(Tt,Lt,At,!1,null,null,null),Vt=Nt.exports,Bt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("date-picker",e._b({attrs:{date:e.date1},on:{input:e.handleInput}},"date-picker",e.$attrs,!1))},Rt=[],Ft=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("date-picker",e._b({attrs:{"value-type":"YYYY-MM-DD",format:e.format,"input-class":e.hasError?e.inputClass+e.errorClass:e.inputClass},on:{input:e.handleInput,"input-error":e.handleInputError},scopedSlots:e._u([{key:"icon-calendar",fn:function(){return[e.hasError?e._e():n("svg",{staticClass:"refine-date-input-calendar-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z","clip-rule":"evenodd"}})]),e.hasError?n("svg",{staticClass:"refine-date-input-error-icon",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"}},[n("path",{attrs:{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"}})]):e._e()]},proxy:!0}]),model:{value:e.time,callback:function(t){e.time=t},expression:"time"}},"date-picker",e.$attrs,!1))},zt=[],Gt=n("c255"),Ht=n.n(Gt),Yt={components:{DatePicker:Ht.a},props:{date:{type:String,required:!1},format:{type:String,required:!1,default:"MM/DD/YYYY"}},data:function(){var e=this.date;return{time:e,hasError:!1,inputClass:"refine-date-input",errorClass:"refine-date-input-error"}},methods:{handleInputError:function(){this.hasError=!0},handleInput:function(){this.hasError=!1,this.$emit("input",{date:this.time})}}},Ut=Yt,Wt=q(Ut,Ft,zt,!1,null,null,null),Qt=Wt.exports,Xt={props:{date1:{type:String,required:!1}},components:{DatePicker:Qt},methods:{handleInput:function(e){var t=e.date;this.$emit("input",{date1:t})}}},Jt=Xt,Kt=q(Jt,Bt,Rt,!1,null,null,null),Zt=Kt.exports,en=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"refine-double-date-wrapper"},[n("date-picker",e._b({attrs:{date:e.date1},on:{input:e.updateFirstDate}},"date-picker",e.$attrs,!1)),e.joinWord?n("p",{staticClass:"refine-double-date-joiner"},[e._v(e._s(e.joinWord))]):e._e(),n("date-picker",{attrs:{date:e.date2},on:{input:e.updateSecondDate}})],1)},tn=[],nn={components:{DatePicker:Qt},props:{date1:{type:String,required:!1},date2:{type:String,required:!1},meta:{type:Object,required:!1,default:function(){return{}}}},computed:{joinWord:function(){return Object.prototype.hasOwnProperty.call(this.meta,"joiner")?this.meta.joiner:"and"}},methods:{updateFirstDate:function(e){var t=e.date;this.$emit("input",{date1:t})},updateSecondDate:function(e){var t=e.date;this.$emit("input",{date2:t})}}},rn=nn,on=q(rn,en,tn,!1,null,null,null),un=on.exports,sn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"refine-relative-date-wrapper"},[n("div",[n("input",{staticClass:"number-input",attrs:{type:"number",name:"days"},domProps:{value:e.amount},on:{input:e.updateAmount}})]),n("selector",{on:{"select-option":e.updateUnit}},e._l(e.units,(function(t){return n("selector-option",{key:t.id,attrs:{id:e.id("unit-"+t.id),display:t.display}})})),1),n("selector",{on:{"select-option":e.updateModifier}},e._l(e.modifiers,(function(t){return n("selector-option",{key:t.id,attrs:{id:e.id("modifier-"+t.id),display:t.display}})})),1)],1)},ln=[],cn={components:{Selector:lt,SelectorOption:st},mixins:[N],props:{amount:{type:[String,Number],required:!1},unit:{type:String,required:!1},modifier:{type:String,required:!1},meta:{type:Object,required:!1,default:function(){return{}}}},created:function(){var e=this.modifier;this.$emit("input",{modifier:e})},computed:{units:function(){return this.meta.units},modifiers:function(){return this.meta.modifiers}},methods:{id:function(e){return"".concat(this.uid,"-").concat(e)},updateModifier:function(e){this.$emit("input",{modifier:e.id})},updateAmount:function(e){var t=e.target.value;this.$emit("input",{amount:t})},updateUnit:function(e){this.$emit("input",{unit:e.id})}}},an=cn,pn=q(an,sn,ln,!1,null,null,null),dn=pn.exports,fn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("selector",{attrs:{isMultiSelect:e.multiple},on:{"select-option":e.selectOption,"deselect-option":e.deselectOption}},e._l(e.options,(function(t){var r=t.id,i=t.display;return n("selector-option",{key:r,attrs:{id:r,display:i,selected:e.isSelected(r)}})})),1)},hn=[],vn={name:"option-input",components:{Selector:lt,SelectorOption:st},props:{selected:{type:Array,required:!1,default:function(){return[]}},options:{type:Array,required:!0},multiple:{type:Boolean,required:!1,default:!1}},methods:{selectOption:function(e){var t=e.selectedOptions,n=t.map((function(e){var t=e.id;return t}));this.$emit("input",{selected:n})},deselectOption:function(e){var t=e.selectedOptions,n=t.map((function(e){var t=e.id;return t}));this.$emit("input",{selected:n})},isSelected:function(e){var t=!1;return this.selected.forEach((function(n){n===e&&(t=!0)})),t}}},mn=vn,yn=q(mn,fn,hn,!1,null,null,null),bn=yn.exports,gn={DateInput:Zt,DoubleDateInput:un,DoubleNumberInput:Dt,NumberInput:Et,OptionInput:bn,RelativeDateInput:dn,TextInput:Vt};function On(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach((function(t){xn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var jn={name:"clause",props:{input:{type:Object,default:function(){return{}}},meta:{type:Object,required:!0}},methods:{switchClause:function(e){var t=e.selectedOption;this.$emit("switch-clause",t)}},components:wn({RenderlessClause:nt,SelectorOption:st,Selector:lt},r)},Cn=jn,kn=q(Cn,Ot,wt,!1,null,null,null),Sn=kn.exports,_n=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("selector",{staticClass:"pt-4",attrs:{innerClass:"mr-4"},on:{"select-option":e.selectRefinement}},e._l(e.refinements,(function(t){var r=t.id,i=t.meta,o=t.display;return n("selector-option",{key:r,attrs:{id:r,display:o,selected:!!e.input[r]}},[n("renderless-refinement",{attrs:{id:r}},[n("clause",{attrs:{meta:i,input:e.input[r]},on:{"switch-clause":function(t){var n=t.id;return e.updateInput({clause:n},r)}}})],1)],1)})),1)},Pn=[],En={name:"refinements",inject:["updateInput","switchRefinement"],components:{Clause:Sn,RenderlessRefinement:rt,Selector:lt,SelectorOption:st},props:{refinements:{required:!0,type:Array},input:{required:!1,type:Object,default:function(){return{}}}},methods:{selectedRefinementId:function(){var e,t=this;return this.refinements.forEach((function(n){var r=n.id;t.input[r]&&(e=r)})),e},selectRefinement:function(e){var t=e.selectedOption,n=t.id;this.switchRefinement(this.selectedRefinementId(),n)}}},$n=En,In=q($n,_n,Pn,!1,null,null,null),qn=In.exports,Dn={name:"criterion",props:{conditions:{required:!0,type:Array},conditionId:{type:String,required:!0},input:{type:Object,required:!0},errors:{type:Array,required:!1,default:function(){return[]}}},methods:{switchCondition:function(e){var t=e.selectedOption;this.$emit("switch-condition",t)},switchClause:function(e){this.$emit("switch-clause",e)}},components:{Clause:Sn,Refinements:qn,SelectorOption:st,Selector:lt}},Ln=Dn,An=q(Ln,c,a,!1,null,null,null),Mn=An.exports,Tn={name:"query-builder",model:{prop:"blueprint",event:"change"},props:{blueprint:{required:!1,type:Array,default:function(){return[]}},conditions:{required:!0,type:Array},errors:{required:!1,type:Object,default:function(){return{}}}},methods:{onChange:function(e){this.$emit("change",e)}},created:function(){if(0===this.conditions.length)throw new Error("You must provide at least one condition to the query builder.")},components:{Criterion:Mn,RenderlessCondition:Fe,RenderlessQueryBuilder:Ve}},Nn=Tn,Vn=q(Nn,s,l,!1,null,null,null),Bn=Vn.exports,Rn=Bn,Fn={};m.a.directive("click-away",{bind:function(e,t){var n=t.value;if("function"!==typeof n)throw new Error("The click-away directive expects a function/method as an argument.");if(!e.id)throw new Error("The click-away directive requires the element it is bound to to have an id.");var r=function(t){e.contains(t.target)||n()};Fn[e.id]=r,document.addEventListener("click",r),document.addEventListener("touchstart",r)},unbind:function(e){document.removeEventListener("click",Fn[e.id]),document.removeEventListener("touchstart",Fn[e.id]),delete Fn[e.id]}});n("9c9e");var zn=Rn;t["default"]=zn}})["default"]})); | ||
//# sourceMappingURL=refine-vue2.umd.min.js.map |
@@ -19,3 +19,3 @@ { | ||
"main": "./dist/refine-vue2.umd.min.js", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"scripts": { | ||
@@ -22,0 +22,0 @@ "serve-no-eslint": "vue-cli-service --skip-plugins @vue/cli-plugin-eslint serve", |
# refine-vue2 | ||
## Project setup | ||
1. Install peer dependencies | ||
``` | ||
yarn add @vue/composition-api vue2-datepicker | ||
``` | ||
## Usage with Laravel Mix | ||
(Also tailwind and tailwind/forms are required, see the tailwind docs to install https://tailwindcss.com/docs/installation) | ||
2. Wherever you import Vue, do this right after: | ||
``` | ||
import VueCompositionAPI from '@vue/composition-api'; | ||
Vue.use(VueCompositionAPI); | ||
``` | ||
3. Include the stylesheet in your html: | ||
``` | ||
<link rel="stylesheet" href="https://unpkg.com/@hammerstone/vue2-query-builder@0.1.14/dist/vue2-query-builder.css" /> | ||
``` | ||
4. Include the date picker stylesheet wherever that makes sense in your app | ||
``` | ||
import "vue2-datepicker/index.css"; | ||
``` | ||
Install Refine and its peer dependencies. | ||
```shell | ||
yarn add @hamemrstone/refine-vue2 @vue/composition-api vue2-datepicker | ||
``` | ||
Wherever you import Vue (usually app.js), you'll need to add the VueCompositionAPI. | ||
```js | ||
import Vue from 'vue'; | ||
// Add the following two lines. | ||
import VueCompositionAPI from '@vue/composition-api'; | ||
Vue.use(VueCompositionAPI); | ||
``` | ||
You'll need to include two stylesheets. | ||
There are many ways to include external stylesheets, depending on what your setup is. If you're using PostCSS, you can use the `postcss-import` plugin by first requiring `npm install -D postcss-import` it. | ||
And then modifying your `webpack.mix.js` to reference it. | ||
```js | ||
mix.postCss('resources/css/app.css', 'public/css', [ | ||
require('postcss-import'), | ||
]); | ||
``` | ||
If you're using Tailwind, you can include the Tailwind version of the CSS by referencing it explicitly: | ||
```css | ||
@import "@hammerstone/refine-vue2/src/assets/styles/tailwind.css"; | ||
``` | ||
If you're not using Tailwind, you can use the vanilla version: | ||
```css | ||
@import "@hammerstone/refine-vue2/dist/refine-vue2.css"; | ||
``` | ||
Finally, you'll need to import the datepicker styles: | ||
```css | ||
@import "vue2-datepicker/index.css"; | ||
``` | ||
If you prefer to include the stylesheet in your layout instead of importing it through your build process, you may do so via the unpkg CDN. | ||
```html | ||
<link rel="stylesheet" href="https://unpkg.com/@hammerstone/refine-vue2/dist/refine-vue2.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/vue2-datepicker/index.css" /> | ||
``` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
57
3
1286297
8076