instantsearch.js 4.45.1 → 4.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/cjs/components/Hits/Hits.js +3 -1
- package/cjs/components/InfiniteHits/InfiniteHits.js +3 -1
- package/cjs/components/Template/Template.js +13 -3
- package/cjs/lib/createHelpers.js +3 -1
- package/cjs/lib/formatNumber.js +10 -0
- package/cjs/lib/utils/cx.js +10 -0
- package/cjs/lib/utils/index.js +10 -1
- package/cjs/lib/utils/renderTemplate.js +17 -2
- package/cjs/lib/version.js +1 -1
- package/cjs/widgets/answers/defaultTemplates.js +6 -2
- package/cjs/widgets/breadcrumb/defaultTemplates.js +6 -2
- package/cjs/widgets/clear-refinements/defaultTemplates.js +3 -1
- package/cjs/widgets/geo-search/createHTMLMarker.js +10 -4
- package/cjs/widgets/geo-search/defaultTemplates.js +18 -4
- package/cjs/widgets/hierarchical-menu/defaultTemplates.js +26 -2
- package/cjs/widgets/hits/defaultTemplates.js +3 -1
- package/cjs/widgets/infinite-hits/defaultTemplates.js +9 -3
- package/cjs/widgets/menu/defaultTemplates.js +26 -2
- package/cjs/widgets/menu-select/defaultTemplates.js +11 -2
- package/cjs/widgets/numeric-menu/defaultTemplates.js +20 -1
- package/cjs/widgets/range-input/range-input.js +6 -2
- package/cjs/widgets/rating-menu/defaultTemplates.js +57 -1
- package/cjs/widgets/refinement-list/defaultTemplates.js +38 -3
- package/cjs/widgets/relevant-sort/defaultTemplates.js +3 -1
- package/cjs/widgets/search-box/defaultTemplates.js +62 -3
- package/cjs/widgets/stats/stats.js +70 -22
- package/cjs/widgets/toggle-refinement/defaultTemplates.js +4 -1
- package/cjs/widgets/voice-search/defaultTemplates.js +81 -9
- package/dist/instantsearch.development.d.ts +142 -19
- package/dist/instantsearch.development.js +1232 -563
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +142 -19
- package/dist/instantsearch.production.min.d.ts +142 -19
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Hits/Hits.d.ts +1 -1
- package/es/components/Hits/Hits.js +3 -1
- package/es/components/InfiniteHits/InfiniteHits.d.ts +1 -1
- package/es/components/InfiniteHits/InfiniteHits.js +3 -1
- package/es/components/Template/Template.d.ts +4 -2
- package/es/components/Template/Template.js +14 -4
- package/es/lib/createHelpers.js +2 -1
- package/es/lib/formatNumber.d.ts +1 -0
- package/es/lib/formatNumber.js +3 -0
- package/es/lib/utils/cx.d.ts +1 -0
- package/es/lib/utils/cx.js +3 -0
- package/es/lib/utils/index.d.ts +1 -0
- package/es/lib/utils/index.js +2 -1
- package/es/lib/utils/renderTemplate.d.ts +4 -3
- package/es/lib/utils/renderTemplate.js +15 -2
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/types/templates.d.ts +16 -3
- package/es/widgets/answers/defaultTemplates.js +6 -2
- package/es/widgets/breadcrumb/defaultTemplates.js +6 -2
- package/es/widgets/clear-refinements/clear-refinements.d.ts +3 -1
- package/es/widgets/clear-refinements/defaultTemplates.js +3 -1
- package/es/widgets/geo-search/createHTMLMarker.d.ts +2 -1
- package/es/widgets/geo-search/createHTMLMarker.js +8 -1
- package/es/widgets/geo-search/defaultTemplates.d.ts +1 -0
- package/es/widgets/geo-search/defaultTemplates.js +17 -4
- package/es/widgets/hierarchical-menu/defaultTemplates.js +22 -2
- package/es/widgets/hierarchical-menu/hierarchical-menu.d.ts +2 -0
- package/es/widgets/hits/defaultTemplates.js +3 -1
- package/es/widgets/hits/hits.d.ts +2 -1
- package/es/widgets/infinite-hits/defaultTemplates.js +9 -3
- package/es/widgets/infinite-hits/infinite-hits.d.ts +1 -3
- package/es/widgets/menu/defaultTemplates.js +22 -2
- package/es/widgets/menu-select/defaultTemplates.js +9 -2
- package/es/widgets/numeric-menu/defaultTemplates.js +18 -1
- package/es/widgets/range-input/range-input.js +6 -2
- package/es/widgets/rating-menu/defaultTemplates.js +54 -1
- package/es/widgets/rating-menu/rating-menu.d.ts +6 -0
- package/es/widgets/refinement-list/defaultTemplates.js +34 -3
- package/es/widgets/refinement-list/refinement-list.d.ts +7 -1
- package/es/widgets/relevant-sort/defaultTemplates.js +3 -1
- package/es/widgets/search-box/defaultTemplates.js +61 -3
- package/es/widgets/search-box/search-box.d.ts +10 -3
- package/es/widgets/stats/stats.d.ts +10 -6
- package/es/widgets/stats/stats.js +69 -22
- package/es/widgets/toggle-refinement/defaultTemplates.js +4 -1
- package/es/widgets/toggle-refinement/toggle-refinement.d.ts +3 -1
- package/es/widgets/voice-search/defaultTemplates.js +81 -9
- package/package.json +6 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! InstantSearch.js 4.
|
|
1
|
+
/*! InstantSearch.js 4.46.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch.js */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -6707,6 +6707,534 @@
|
|
|
6707
6707
|
compiler.template = compiler.Template;
|
|
6708
6708
|
var hogan = compiler;
|
|
6709
6709
|
|
|
6710
|
+
var n,l,u,t,o,r,f={},e=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a(n){var l=n.parentNode;l&&l.removeChild(n);}function h(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v(l,f,t,o,null)}function v(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u:r};return null==r&&null!=l.vnode&&l.vnode(f),f}function y(){return {current:null}}function p(n){return n.children}function d(n,l){this.props=n,this.context=l;}function _(n,l){if(null==l)return n.__?_(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_(n):null}function k(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k(n)}}function b(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||setTimeout)(g);}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s({},t)).__v=t.__v+1,j(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_(t):o,t.__h),z(u,t),t.__e!=o&&k(t)));});}function w(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v(null,k,null,null,k):Array.isArray(k)?v(p,{children:k},null,null,null):k.__b>0?v(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j(n,k,d=d||f,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m(k,s,n):s=A(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&("function"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=_(i,h+1)),N(x[h],x[h]));if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m(i,l,u):A(u,i,i,t,i.__e,l));return l}function A(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else{for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c.test(l)?u:u+"px";}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T:I,o):n.removeEventListener(l,o?T:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l.event?l.event(n):n);}function T(n){this.l[n.type+!0](l.event?l.event(n):n);}function j(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l.__b)&&a(u);try{n:if("function"==typeof H){if(g=u.props,m=(a=H.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in H&&H.prototype.render?u.__c=h=new H(g,x):(u.__c=h=new d(g,x),h.constructor=H,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=H.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s({},h.__s)),s(h.__s,H.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==H.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==H.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,A=l.__r,C=0,"prototype"in H&&H.prototype.render)h.state=h.__s,h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context);else do{h.__d=!1,A&&A(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++C<25);h.state=h.__s,null!=h.getChildContext&&(t=s(s({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),$=null!=a&&a.type===p&&null==a.key?a.props.children:a,w(n,Array.isArray($)?$:[$],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l.__e(n,u,i);}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(r=r&&n.call(l.childNodes),h=(y=i.props||f).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l.__e(n,i);}}function N(n,u,i){var t,o;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||a(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l.__&&l.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j(i,u=(!o&&t||i).__k=h(p,null,[u]),r||f,f,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z(e,u);}n=e.slice,l={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u=0,d.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s({},this.state),"function"==typeof n&&(n=n(s({},u),this.props)),n&&s(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),b(this));},d.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b(this));},d.prototype.render=p,t=[],g.__r=0,r=0;
|
|
6711
|
+
|
|
6712
|
+
function cx() {
|
|
6713
|
+
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6714
|
+
classNames[_key] = arguments[_key];
|
|
6715
|
+
}
|
|
6716
|
+
|
|
6717
|
+
return classNames.filter(Boolean).join(' ') || undefined;
|
|
6718
|
+
}
|
|
6719
|
+
|
|
6720
|
+
var _extends_1 = createCommonjsModule(function (module) {
|
|
6721
|
+
function _extends() {
|
|
6722
|
+
module.exports = _extends = Object.assign || function (target) {
|
|
6723
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6724
|
+
var source = arguments[i];
|
|
6725
|
+
|
|
6726
|
+
for (var key in source) {
|
|
6727
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
6728
|
+
target[key] = source[key];
|
|
6729
|
+
}
|
|
6730
|
+
}
|
|
6731
|
+
}
|
|
6732
|
+
|
|
6733
|
+
return target;
|
|
6734
|
+
};
|
|
6735
|
+
|
|
6736
|
+
return _extends.apply(this, arguments);
|
|
6737
|
+
}
|
|
6738
|
+
|
|
6739
|
+
module.exports = _extends;
|
|
6740
|
+
});
|
|
6741
|
+
|
|
6742
|
+
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
6743
|
+
if (source == null) return {};
|
|
6744
|
+
var target = {};
|
|
6745
|
+
var sourceKeys = Object.keys(source);
|
|
6746
|
+
var key, i;
|
|
6747
|
+
|
|
6748
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
6749
|
+
key = sourceKeys[i];
|
|
6750
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
6751
|
+
target[key] = source[key];
|
|
6752
|
+
}
|
|
6753
|
+
|
|
6754
|
+
return target;
|
|
6755
|
+
}
|
|
6756
|
+
|
|
6757
|
+
var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose$2;
|
|
6758
|
+
|
|
6759
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
6760
|
+
if (source == null) return {};
|
|
6761
|
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
6762
|
+
var key, i;
|
|
6763
|
+
|
|
6764
|
+
if (Object.getOwnPropertySymbols) {
|
|
6765
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
6766
|
+
|
|
6767
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
6768
|
+
key = sourceSymbolKeys[i];
|
|
6769
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
6770
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
6771
|
+
target[key] = source[key];
|
|
6772
|
+
}
|
|
6773
|
+
}
|
|
6774
|
+
|
|
6775
|
+
return target;
|
|
6776
|
+
}
|
|
6777
|
+
|
|
6778
|
+
var objectWithoutProperties = _objectWithoutProperties$1;
|
|
6779
|
+
|
|
6780
|
+
var _excluded = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
6781
|
+
|
|
6782
|
+
function createHighlightPartComponent(_ref) {
|
|
6783
|
+
var createElement = _ref.createElement;
|
|
6784
|
+
return function HighlightPart(_ref2) {
|
|
6785
|
+
var classNames = _ref2.classNames,
|
|
6786
|
+
children = _ref2.children,
|
|
6787
|
+
highlightedTagName = _ref2.highlightedTagName,
|
|
6788
|
+
isHighlighted = _ref2.isHighlighted,
|
|
6789
|
+
nonHighlightedTagName = _ref2.nonHighlightedTagName;
|
|
6790
|
+
var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
|
|
6791
|
+
return createElement(TagName, {
|
|
6792
|
+
className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
|
|
6793
|
+
}, children);
|
|
6794
|
+
};
|
|
6795
|
+
}
|
|
6796
|
+
|
|
6797
|
+
function createHighlightComponent(_ref3) {
|
|
6798
|
+
var createElement = _ref3.createElement,
|
|
6799
|
+
Fragment = _ref3.Fragment;
|
|
6800
|
+
var HighlightPart = createHighlightPartComponent({
|
|
6801
|
+
createElement: createElement,
|
|
6802
|
+
Fragment: Fragment
|
|
6803
|
+
});
|
|
6804
|
+
return function Highlight(_ref4) {
|
|
6805
|
+
var parts = _ref4.parts,
|
|
6806
|
+
_ref4$highlightedTagN = _ref4.highlightedTagName,
|
|
6807
|
+
highlightedTagName = _ref4$highlightedTagN === void 0 ? 'mark' : _ref4$highlightedTagN,
|
|
6808
|
+
_ref4$nonHighlightedT = _ref4.nonHighlightedTagName,
|
|
6809
|
+
nonHighlightedTagName = _ref4$nonHighlightedT === void 0 ? 'span' : _ref4$nonHighlightedT,
|
|
6810
|
+
_ref4$separator = _ref4.separator,
|
|
6811
|
+
separator = _ref4$separator === void 0 ? ', ' : _ref4$separator,
|
|
6812
|
+
className = _ref4.className,
|
|
6813
|
+
_ref4$classNames = _ref4.classNames,
|
|
6814
|
+
classNames = _ref4$classNames === void 0 ? {} : _ref4$classNames,
|
|
6815
|
+
props = objectWithoutProperties(_ref4, _excluded);
|
|
6816
|
+
|
|
6817
|
+
return createElement("span", _extends_1({}, props, {
|
|
6818
|
+
className: cx(classNames.root, className)
|
|
6819
|
+
}), parts.map(function (part, partIndex) {
|
|
6820
|
+
var isLastPart = partIndex === parts.length - 1;
|
|
6821
|
+
return createElement(Fragment, {
|
|
6822
|
+
key: partIndex
|
|
6823
|
+
}, part.map(function (subPart, subPartIndex) {
|
|
6824
|
+
return createElement(HighlightPart, {
|
|
6825
|
+
key: subPartIndex,
|
|
6826
|
+
classNames: classNames,
|
|
6827
|
+
highlightedTagName: highlightedTagName,
|
|
6828
|
+
nonHighlightedTagName: nonHighlightedTagName,
|
|
6829
|
+
isHighlighted: subPart.isHighlighted
|
|
6830
|
+
}, subPart.value);
|
|
6831
|
+
}), !isLastPart && createElement("span", {
|
|
6832
|
+
className: classNames.separator
|
|
6833
|
+
}, separator));
|
|
6834
|
+
}));
|
|
6835
|
+
};
|
|
6836
|
+
}
|
|
6837
|
+
|
|
6838
|
+
var InternalHighlight = createHighlightComponent({
|
|
6839
|
+
createElement: h,
|
|
6840
|
+
Fragment: p
|
|
6841
|
+
});
|
|
6842
|
+
|
|
6843
|
+
function Highlight(_ref) {
|
|
6844
|
+
var _ref$classNames = _ref.classNames,
|
|
6845
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
6846
|
+
props = _objectWithoutProperties(_ref, ["classNames"]);
|
|
6847
|
+
|
|
6848
|
+
return h(InternalHighlight, _extends({
|
|
6849
|
+
classNames: {
|
|
6850
|
+
root: cx('ais-Highlight', classNames.root),
|
|
6851
|
+
highlighted: cx('ais-Highlight-highlighted', classNames.highlighted),
|
|
6852
|
+
nonHighlighted: cx('ais-Highlight-nonHighlighted', classNames.nonHighlighted),
|
|
6853
|
+
separator: cx('ais-Highlight-separator', classNames.separator)
|
|
6854
|
+
}
|
|
6855
|
+
}, props));
|
|
6856
|
+
}
|
|
6857
|
+
|
|
6858
|
+
/**
|
|
6859
|
+
* This implementation is taken from Lodash implementation.
|
|
6860
|
+
* See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js
|
|
6861
|
+
*/
|
|
6862
|
+
// Used to map characters to HTML entities.
|
|
6863
|
+
var htmlEscapes = {
|
|
6864
|
+
'&': '&',
|
|
6865
|
+
'<': '<',
|
|
6866
|
+
'>': '>',
|
|
6867
|
+
'"': '"',
|
|
6868
|
+
"'": '''
|
|
6869
|
+
}; // Used to match HTML entities and HTML characters.
|
|
6870
|
+
|
|
6871
|
+
var regexUnescapedHtml = /[&<>"']/g;
|
|
6872
|
+
var regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);
|
|
6873
|
+
/**
|
|
6874
|
+
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
|
|
6875
|
+
* corresponding HTML entities.
|
|
6876
|
+
*/
|
|
6877
|
+
|
|
6878
|
+
function escape$1(value) {
|
|
6879
|
+
return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {
|
|
6880
|
+
return htmlEscapes[character];
|
|
6881
|
+
}) : value;
|
|
6882
|
+
}
|
|
6883
|
+
|
|
6884
|
+
/**
|
|
6885
|
+
* This implementation is taken from Lodash implementation.
|
|
6886
|
+
* See: https://github.com/lodash/lodash/blob/master/isPlainObject.js
|
|
6887
|
+
*/
|
|
6888
|
+
function getTag(value) {
|
|
6889
|
+
if (value === null) {
|
|
6890
|
+
return value === undefined ? '[object Undefined]' : '[object Null]';
|
|
6891
|
+
}
|
|
6892
|
+
|
|
6893
|
+
return Object.prototype.toString.call(value);
|
|
6894
|
+
}
|
|
6895
|
+
|
|
6896
|
+
function isObjectLike(value) {
|
|
6897
|
+
return _typeof(value) === 'object' && value !== null;
|
|
6898
|
+
}
|
|
6899
|
+
/**
|
|
6900
|
+
* Checks if `value` is a plain object.
|
|
6901
|
+
*
|
|
6902
|
+
* A plain object is an object created by the `Object`
|
|
6903
|
+
* constructor or with a `[[Prototype]]` of `null`.
|
|
6904
|
+
*/
|
|
6905
|
+
|
|
6906
|
+
|
|
6907
|
+
function isPlainObject(value) {
|
|
6908
|
+
if (!isObjectLike(value) || getTag(value) !== '[object Object]') {
|
|
6909
|
+
return false;
|
|
6910
|
+
}
|
|
6911
|
+
|
|
6912
|
+
if (Object.getPrototypeOf(value) === null) {
|
|
6913
|
+
return true;
|
|
6914
|
+
}
|
|
6915
|
+
|
|
6916
|
+
var proto = value;
|
|
6917
|
+
|
|
6918
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
6919
|
+
proto = Object.getPrototypeOf(proto);
|
|
6920
|
+
}
|
|
6921
|
+
|
|
6922
|
+
return Object.getPrototypeOf(value) === proto;
|
|
6923
|
+
}
|
|
6924
|
+
|
|
6925
|
+
var TAG_PLACEHOLDER = {
|
|
6926
|
+
highlightPreTag: '__ais-highlight__',
|
|
6927
|
+
highlightPostTag: '__/ais-highlight__'
|
|
6928
|
+
};
|
|
6929
|
+
var TAG_REPLACEMENT = {
|
|
6930
|
+
highlightPreTag: '<mark>',
|
|
6931
|
+
highlightPostTag: '</mark>'
|
|
6932
|
+
};
|
|
6933
|
+
|
|
6934
|
+
function replaceTagsAndEscape(value) {
|
|
6935
|
+
return escape$1(value).replace(new RegExp(TAG_PLACEHOLDER.highlightPreTag, 'g'), TAG_REPLACEMENT.highlightPreTag).replace(new RegExp(TAG_PLACEHOLDER.highlightPostTag, 'g'), TAG_REPLACEMENT.highlightPostTag);
|
|
6936
|
+
}
|
|
6937
|
+
|
|
6938
|
+
function recursiveEscape(input) {
|
|
6939
|
+
if (isPlainObject(input) && typeof input.value !== 'string') {
|
|
6940
|
+
return Object.keys(input).reduce(function (acc, key) {
|
|
6941
|
+
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, recursiveEscape(input[key])));
|
|
6942
|
+
}, {});
|
|
6943
|
+
}
|
|
6944
|
+
|
|
6945
|
+
if (Array.isArray(input)) {
|
|
6946
|
+
return input.map(recursiveEscape);
|
|
6947
|
+
}
|
|
6948
|
+
|
|
6949
|
+
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
6950
|
+
value: replaceTagsAndEscape(input.value)
|
|
6951
|
+
});
|
|
6952
|
+
}
|
|
6953
|
+
|
|
6954
|
+
function escapeHits(hits) {
|
|
6955
|
+
if (hits.__escaped === undefined) {
|
|
6956
|
+
// We don't override the value on hit because it will mutate the raw results
|
|
6957
|
+
// instead we make a shallow copy and we assign the escaped values on it.
|
|
6958
|
+
hits = hits.map(function (_ref) {
|
|
6959
|
+
var hit = _extends({}, _ref);
|
|
6960
|
+
|
|
6961
|
+
if (hit._highlightResult) {
|
|
6962
|
+
hit._highlightResult = recursiveEscape(hit._highlightResult);
|
|
6963
|
+
}
|
|
6964
|
+
|
|
6965
|
+
if (hit._snippetResult) {
|
|
6966
|
+
hit._snippetResult = recursiveEscape(hit._snippetResult);
|
|
6967
|
+
}
|
|
6968
|
+
|
|
6969
|
+
return hit;
|
|
6970
|
+
});
|
|
6971
|
+
hits.__escaped = true;
|
|
6972
|
+
}
|
|
6973
|
+
|
|
6974
|
+
return hits;
|
|
6975
|
+
}
|
|
6976
|
+
function escapeFacets(facetHits) {
|
|
6977
|
+
return facetHits.map(function (h) {
|
|
6978
|
+
return _objectSpread2(_objectSpread2({}, h), {}, {
|
|
6979
|
+
highlighted: replaceTagsAndEscape(h.highlighted)
|
|
6980
|
+
});
|
|
6981
|
+
});
|
|
6982
|
+
}
|
|
6983
|
+
|
|
6984
|
+
function getHighlightedParts(highlightedValue) {
|
|
6985
|
+
var highlightPostTag = TAG_REPLACEMENT.highlightPostTag,
|
|
6986
|
+
highlightPreTag = TAG_REPLACEMENT.highlightPreTag;
|
|
6987
|
+
var splitByPreTag = highlightedValue.split(highlightPreTag);
|
|
6988
|
+
var firstValue = splitByPreTag.shift();
|
|
6989
|
+
var elements = !firstValue ? [] : [{
|
|
6990
|
+
value: firstValue,
|
|
6991
|
+
isHighlighted: false
|
|
6992
|
+
}];
|
|
6993
|
+
splitByPreTag.forEach(function (split) {
|
|
6994
|
+
var splitByPostTag = split.split(highlightPostTag);
|
|
6995
|
+
elements.push({
|
|
6996
|
+
value: splitByPostTag[0],
|
|
6997
|
+
isHighlighted: true
|
|
6998
|
+
});
|
|
6999
|
+
|
|
7000
|
+
if (splitByPostTag[1] !== '') {
|
|
7001
|
+
elements.push({
|
|
7002
|
+
value: splitByPostTag[1],
|
|
7003
|
+
isHighlighted: false
|
|
7004
|
+
});
|
|
7005
|
+
}
|
|
7006
|
+
});
|
|
7007
|
+
return elements;
|
|
7008
|
+
}
|
|
7009
|
+
|
|
7010
|
+
function getPropertyByPath(object, path) {
|
|
7011
|
+
var parts = Array.isArray(path) ? path : path.split('.');
|
|
7012
|
+
return parts.reduce(function (current, key) {
|
|
7013
|
+
return current && current[key];
|
|
7014
|
+
}, object);
|
|
7015
|
+
}
|
|
7016
|
+
|
|
7017
|
+
/**
|
|
7018
|
+
* This implementation is taken from Lodash implementation.
|
|
7019
|
+
* See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js
|
|
7020
|
+
*/
|
|
7021
|
+
// Used to map HTML entities to characters.
|
|
7022
|
+
var htmlEscapes$1 = {
|
|
7023
|
+
'&': '&',
|
|
7024
|
+
'<': '<',
|
|
7025
|
+
'>': '>',
|
|
7026
|
+
'"': '"',
|
|
7027
|
+
''': "'"
|
|
7028
|
+
}; // Used to match HTML entities and HTML characters.
|
|
7029
|
+
|
|
7030
|
+
var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;
|
|
7031
|
+
var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);
|
|
7032
|
+
/**
|
|
7033
|
+
* Converts the HTML entities "&", "<", ">", '"', and "'" in `string` to their
|
|
7034
|
+
* characters.
|
|
7035
|
+
*/
|
|
7036
|
+
|
|
7037
|
+
function unescape$1(value) {
|
|
7038
|
+
return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {
|
|
7039
|
+
return htmlEscapes$1[character];
|
|
7040
|
+
}) : value;
|
|
7041
|
+
}
|
|
7042
|
+
|
|
7043
|
+
function noop() {}
|
|
7044
|
+
|
|
7045
|
+
/**
|
|
7046
|
+
* Logs a warning when this function is called, in development environment only.
|
|
7047
|
+
*/
|
|
7048
|
+
var deprecate = function deprecate(fn, message) {
|
|
7049
|
+
return fn;
|
|
7050
|
+
};
|
|
7051
|
+
/**
|
|
7052
|
+
* Logs a warning
|
|
7053
|
+
* This is used to log issues in development environment only.
|
|
7054
|
+
*/
|
|
7055
|
+
|
|
7056
|
+
|
|
7057
|
+
var warn = noop;
|
|
7058
|
+
/**
|
|
7059
|
+
* Logs a warning if the condition is not met.
|
|
7060
|
+
* This is used to log issues in development environment only.
|
|
7061
|
+
*/
|
|
7062
|
+
|
|
7063
|
+
var _warning = noop;
|
|
7064
|
+
|
|
7065
|
+
{
|
|
7066
|
+
warn = function warn(message) {
|
|
7067
|
+
// eslint-disable-next-line no-console
|
|
7068
|
+
console.warn("[InstantSearch.js]: ".concat(message.trim()));
|
|
7069
|
+
};
|
|
7070
|
+
|
|
7071
|
+
deprecate = function deprecate(fn, message) {
|
|
7072
|
+
var hasAlreadyPrinted = false;
|
|
7073
|
+
return function () {
|
|
7074
|
+
if (!hasAlreadyPrinted) {
|
|
7075
|
+
hasAlreadyPrinted = true;
|
|
7076
|
+
warn(message);
|
|
7077
|
+
}
|
|
7078
|
+
|
|
7079
|
+
return fn.apply(void 0, arguments);
|
|
7080
|
+
};
|
|
7081
|
+
};
|
|
7082
|
+
|
|
7083
|
+
_warning = function warning(condition, message) {
|
|
7084
|
+
if (condition) {
|
|
7085
|
+
return;
|
|
7086
|
+
}
|
|
7087
|
+
|
|
7088
|
+
var hasAlreadyPrinted = _warning.cache[message];
|
|
7089
|
+
|
|
7090
|
+
if (!hasAlreadyPrinted) {
|
|
7091
|
+
_warning.cache[message] = true;
|
|
7092
|
+
warn(message);
|
|
7093
|
+
}
|
|
7094
|
+
};
|
|
7095
|
+
|
|
7096
|
+
_warning.cache = {};
|
|
7097
|
+
}
|
|
7098
|
+
|
|
7099
|
+
function Highlight$1(_ref) {
|
|
7100
|
+
var hit = _ref.hit,
|
|
7101
|
+
attribute = _ref.attribute,
|
|
7102
|
+
cssClasses = _ref.cssClasses,
|
|
7103
|
+
props = _objectWithoutProperties(_ref, ["hit", "attribute", "cssClasses"]);
|
|
7104
|
+
|
|
7105
|
+
var property = getPropertyByPath(hit._highlightResult, attribute) || [];
|
|
7106
|
+
var properties = Array.isArray(property) ? property : [property];
|
|
7107
|
+
_warning(Boolean(properties.length), "Could not enable highlight for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\n\nSee: https://alg.li/highlighting\n")) ;
|
|
7108
|
+
var parts = properties.map(function (_ref2) {
|
|
7109
|
+
var value = _ref2.value;
|
|
7110
|
+
return getHighlightedParts(unescape$1(value || ''));
|
|
7111
|
+
});
|
|
7112
|
+
return h(Highlight, _extends({}, props, {
|
|
7113
|
+
parts: parts,
|
|
7114
|
+
classNames: cssClasses
|
|
7115
|
+
}));
|
|
7116
|
+
}
|
|
7117
|
+
|
|
7118
|
+
function ReverseHighlight(_ref) {
|
|
7119
|
+
var _ref$classNames = _ref.classNames,
|
|
7120
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
7121
|
+
props = _objectWithoutProperties(_ref, ["classNames"]);
|
|
7122
|
+
|
|
7123
|
+
return h(InternalHighlight, _extends({
|
|
7124
|
+
classNames: {
|
|
7125
|
+
root: cx('ais-ReverseHighlight', classNames.root),
|
|
7126
|
+
highlighted: cx('ais-ReverseHighlight-highlighted', classNames.highlighted),
|
|
7127
|
+
nonHighlighted: cx('ais-ReverseHighlight-nonHighlighted', classNames.nonHighlighted),
|
|
7128
|
+
separator: cx('ais-ReverseHighlight-separator', classNames.separator)
|
|
7129
|
+
}
|
|
7130
|
+
}, props));
|
|
7131
|
+
}
|
|
7132
|
+
|
|
7133
|
+
function ReverseHighlight$1(_ref) {
|
|
7134
|
+
var hit = _ref.hit,
|
|
7135
|
+
attribute = _ref.attribute,
|
|
7136
|
+
cssClasses = _ref.cssClasses,
|
|
7137
|
+
props = _objectWithoutProperties(_ref, ["hit", "attribute", "cssClasses"]);
|
|
7138
|
+
|
|
7139
|
+
var property = getPropertyByPath(hit._highlightResult, attribute) || [];
|
|
7140
|
+
var properties = Array.isArray(property) ? property : [property];
|
|
7141
|
+
_warning(Boolean(properties.length), "Could not enable highlight for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\n\nSee: https://alg.li/highlighting\n")) ;
|
|
7142
|
+
var parts = properties.map(function (_ref2) {
|
|
7143
|
+
var value = _ref2.value;
|
|
7144
|
+
return getHighlightedParts(unescape$1(value || '')).map(function (_ref3) {
|
|
7145
|
+
var isHighlighted = _ref3.isHighlighted,
|
|
7146
|
+
rest = _objectWithoutProperties(_ref3, ["isHighlighted"]);
|
|
7147
|
+
|
|
7148
|
+
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
7149
|
+
isHighlighted: !isHighlighted
|
|
7150
|
+
});
|
|
7151
|
+
});
|
|
7152
|
+
});
|
|
7153
|
+
return h(ReverseHighlight, _extends({}, props, {
|
|
7154
|
+
parts: parts,
|
|
7155
|
+
classNames: cssClasses
|
|
7156
|
+
}));
|
|
7157
|
+
}
|
|
7158
|
+
|
|
7159
|
+
function ReverseSnippet(_ref) {
|
|
7160
|
+
var _ref$classNames = _ref.classNames,
|
|
7161
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
7162
|
+
props = _objectWithoutProperties(_ref, ["classNames"]);
|
|
7163
|
+
|
|
7164
|
+
return h(InternalHighlight, _extends({
|
|
7165
|
+
classNames: {
|
|
7166
|
+
root: cx('ais-ReverseSnippet', classNames.root),
|
|
7167
|
+
highlighted: cx('ais-ReverseSnippet-highlighted', classNames.highlighted),
|
|
7168
|
+
nonHighlighted: cx('ais-ReverseSnippet-nonHighlighted', classNames.nonHighlighted),
|
|
7169
|
+
separator: cx('ais-ReverseSnippet-separator', classNames.separator)
|
|
7170
|
+
}
|
|
7171
|
+
}, props));
|
|
7172
|
+
}
|
|
7173
|
+
|
|
7174
|
+
function ReverseSnippet$1(_ref) {
|
|
7175
|
+
var hit = _ref.hit,
|
|
7176
|
+
attribute = _ref.attribute,
|
|
7177
|
+
cssClasses = _ref.cssClasses,
|
|
7178
|
+
props = _objectWithoutProperties(_ref, ["hit", "attribute", "cssClasses"]);
|
|
7179
|
+
|
|
7180
|
+
var property = getPropertyByPath(hit._snippetResult, attribute) || [];
|
|
7181
|
+
var properties = Array.isArray(property) ? property : [property];
|
|
7182
|
+
_warning(Boolean(properties.length), "Could not enable snippet for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\n\nSee: https://alg.li/highlighting\n")) ;
|
|
7183
|
+
var parts = properties.map(function (_ref2) {
|
|
7184
|
+
var value = _ref2.value;
|
|
7185
|
+
return getHighlightedParts(unescape$1(value || '')).map(function (_ref3) {
|
|
7186
|
+
var isHighlighted = _ref3.isHighlighted,
|
|
7187
|
+
rest = _objectWithoutProperties(_ref3, ["isHighlighted"]);
|
|
7188
|
+
|
|
7189
|
+
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
7190
|
+
isHighlighted: !isHighlighted
|
|
7191
|
+
});
|
|
7192
|
+
});
|
|
7193
|
+
});
|
|
7194
|
+
return h(ReverseSnippet, _extends({}, props, {
|
|
7195
|
+
parts: parts,
|
|
7196
|
+
classNames: cssClasses
|
|
7197
|
+
}));
|
|
7198
|
+
}
|
|
7199
|
+
|
|
7200
|
+
function Snippet(_ref) {
|
|
7201
|
+
var _ref$classNames = _ref.classNames,
|
|
7202
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
7203
|
+
props = _objectWithoutProperties(_ref, ["classNames"]);
|
|
7204
|
+
|
|
7205
|
+
return h(InternalHighlight, _extends({
|
|
7206
|
+
classNames: {
|
|
7207
|
+
root: cx('ais-Snippet', classNames.root),
|
|
7208
|
+
highlighted: cx('ais-Snippet-highlighted', classNames.highlighted),
|
|
7209
|
+
nonHighlighted: cx('ais-Snippet-nonHighlighted', classNames.nonHighlighted),
|
|
7210
|
+
separator: cx('ais-Snippet-separator', classNames.separator)
|
|
7211
|
+
}
|
|
7212
|
+
}, props));
|
|
7213
|
+
}
|
|
7214
|
+
|
|
7215
|
+
function Snippet$1(_ref) {
|
|
7216
|
+
var hit = _ref.hit,
|
|
7217
|
+
attribute = _ref.attribute,
|
|
7218
|
+
cssClasses = _ref.cssClasses,
|
|
7219
|
+
props = _objectWithoutProperties(_ref, ["hit", "attribute", "cssClasses"]);
|
|
7220
|
+
|
|
7221
|
+
var property = getPropertyByPath(hit._snippetResult, attribute) || [];
|
|
7222
|
+
var properties = Array.isArray(property) ? property : [property];
|
|
7223
|
+
_warning(Boolean(properties.length), "Could not enable snippet for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\n\nSee: https://alg.li/highlighting\n")) ;
|
|
7224
|
+
var parts = properties.map(function (_ref2) {
|
|
7225
|
+
var value = _ref2.value;
|
|
7226
|
+
return getHighlightedParts(unescape$1(value || ''));
|
|
7227
|
+
});
|
|
7228
|
+
return h(Snippet, _extends({}, props, {
|
|
7229
|
+
parts: parts,
|
|
7230
|
+
classNames: cssClasses
|
|
7231
|
+
}));
|
|
7232
|
+
}
|
|
7233
|
+
|
|
7234
|
+
var n$1=function(t,s,r,e){var u;s[0]=0;for(var h=1;h<s.length;h++){var p=s[h++],a=s[h]?(s[0]|=p?1:2,r[s[h++]]):s[++h];3===p?e[0]=a:4===p?e[1]=Object.assign(e[1]||{},a):5===p?(e[1]=e[1]||{})[s[++h]]=a:6===p?e[1][s[++h]]+=a+"":p?(u=t.apply(a,n$1(t,a,r,["",null])),e.push(u),a[0]?s[0]|=2:(s[h-2]=0,s[h]=u)):e.push(a);}return e},t$1=new Map;function e$1(s){var r=t$1.get(this);return r||(r=new Map,t$1.set(this,r)),(r=n$1(this,r.get(s)||(r.set(s,r=function(n){for(var t,s,r=1,e="",u="",h=[0],p=function(n){1===r&&(n||(e=e.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?h.push(0,n,e):3===r&&(n||e)?(h.push(3,n,e),r=2):2===r&&"..."===e&&n?h.push(4,n,0):2===r&&e&&!n?h.push(5,0,!0,e):r>=5&&((e||!n&&5===r)&&(h.push(r,0,e,s),r=6),n&&(h.push(r,n,0,s),r=6)),e="";},a=0;a<n.length;a++){a&&(1===r&&p(),p(a));for(var l=0;l<n[a].length;l++)t=n[a][l],1===r?"<"===t?(p(),h=[h],r=3):e+=t:4===r?"--"===e&&">"===t?(r=1,e=""):e=t+e[0]:u?t===u?u="":e+=t:'"'===t||"'"===t?u=t:">"===t?(p(),r=1):r&&("="===t?(r=5,s=e,e=""):"/"===t&&(r<5||">"===n[a][l+1])?(p(),3===r&&(h=h[0]),r=h,(h=h[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(p(),r=2):e+=t),3===r&&"!--"===e&&(r=4,h=h[0]);}return p(),h}(s)),r),arguments,[])).length>1?r:r[0]}
|
|
7235
|
+
|
|
7236
|
+
var m$1=e$1.bind(h);
|
|
7237
|
+
|
|
6710
7238
|
// We add all our template helper methods to the template as lambdas. Note
|
|
6711
7239
|
// that lambdas in Mustache are supposed to accept a second argument of
|
|
6712
7240
|
// `render` to get the rendered value, not the literal `{{value}}`. But
|
|
@@ -6736,7 +7264,8 @@
|
|
|
6736
7264
|
compileOptions = _ref.compileOptions,
|
|
6737
7265
|
helpers = _ref.helpers,
|
|
6738
7266
|
data = _ref.data,
|
|
6739
|
-
bindEvent = _ref.bindEvent
|
|
7267
|
+
bindEvent = _ref.bindEvent,
|
|
7268
|
+
sendEvent = _ref.sendEvent;
|
|
6740
7269
|
var template = templates[templateKey];
|
|
6741
7270
|
|
|
6742
7271
|
if (typeof template !== 'string' && typeof template !== 'function') {
|
|
@@ -6744,7 +7273,17 @@
|
|
|
6744
7273
|
}
|
|
6745
7274
|
|
|
6746
7275
|
if (typeof template === 'function') {
|
|
6747
|
-
|
|
7276
|
+
// @MAJOR no longer pass bindEvent when string templates are removed
|
|
7277
|
+
var params = bindEvent || {};
|
|
7278
|
+
params.html = m$1;
|
|
7279
|
+
params.sendEvent = sendEvent;
|
|
7280
|
+
params.components = {
|
|
7281
|
+
Highlight: Highlight$1,
|
|
7282
|
+
ReverseHighlight: ReverseHighlight$1,
|
|
7283
|
+
Snippet: Snippet$1,
|
|
7284
|
+
ReverseSnippet: ReverseSnippet$1
|
|
7285
|
+
};
|
|
7286
|
+
return template(data, params);
|
|
6748
7287
|
}
|
|
6749
7288
|
|
|
6750
7289
|
var transformedHelpers = transformHelpersToHogan(helpers, compileOptions, data);
|
|
@@ -6975,62 +7514,6 @@
|
|
|
6975
7514
|
}
|
|
6976
7515
|
}
|
|
6977
7516
|
|
|
6978
|
-
function noop() {}
|
|
6979
|
-
|
|
6980
|
-
/**
|
|
6981
|
-
* Logs a warning when this function is called, in development environment only.
|
|
6982
|
-
*/
|
|
6983
|
-
var deprecate = function deprecate(fn, message) {
|
|
6984
|
-
return fn;
|
|
6985
|
-
};
|
|
6986
|
-
/**
|
|
6987
|
-
* Logs a warning
|
|
6988
|
-
* This is used to log issues in development environment only.
|
|
6989
|
-
*/
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
var warn = noop;
|
|
6993
|
-
/**
|
|
6994
|
-
* Logs a warning if the condition is not met.
|
|
6995
|
-
* This is used to log issues in development environment only.
|
|
6996
|
-
*/
|
|
6997
|
-
|
|
6998
|
-
var _warning = noop;
|
|
6999
|
-
|
|
7000
|
-
{
|
|
7001
|
-
warn = function warn(message) {
|
|
7002
|
-
// eslint-disable-next-line no-console
|
|
7003
|
-
console.warn("[InstantSearch.js]: ".concat(message.trim()));
|
|
7004
|
-
};
|
|
7005
|
-
|
|
7006
|
-
deprecate = function deprecate(fn, message) {
|
|
7007
|
-
var hasAlreadyPrinted = false;
|
|
7008
|
-
return function () {
|
|
7009
|
-
if (!hasAlreadyPrinted) {
|
|
7010
|
-
hasAlreadyPrinted = true;
|
|
7011
|
-
warn(message);
|
|
7012
|
-
}
|
|
7013
|
-
|
|
7014
|
-
return fn.apply(void 0, arguments);
|
|
7015
|
-
};
|
|
7016
|
-
};
|
|
7017
|
-
|
|
7018
|
-
_warning = function warning(condition, message) {
|
|
7019
|
-
if (condition) {
|
|
7020
|
-
return;
|
|
7021
|
-
}
|
|
7022
|
-
|
|
7023
|
-
var hasAlreadyPrinted = _warning.cache[message];
|
|
7024
|
-
|
|
7025
|
-
if (!hasAlreadyPrinted) {
|
|
7026
|
-
_warning.cache[message] = true;
|
|
7027
|
-
warn(message);
|
|
7028
|
-
}
|
|
7029
|
-
};
|
|
7030
|
-
|
|
7031
|
-
_warning.cache = {};
|
|
7032
|
-
}
|
|
7033
|
-
|
|
7034
7517
|
/**
|
|
7035
7518
|
* A typed version of Object.keys, to use when looping over a static object
|
|
7036
7519
|
* inspired from https://stackoverflow.com/a/65117465/3185307
|
|
@@ -7175,228 +7658,69 @@
|
|
|
7175
7658
|
}).map(function (_ref11) {
|
|
7176
7659
|
var _ref12 = _slicedToArray(_ref11, 2),
|
|
7177
7660
|
_stateParameter = _ref12[0],
|
|
7178
|
-
widgets = _ref12[1].widgets;
|
|
7179
|
-
|
|
7180
|
-
var capitalizedWidget = capitalize(widgets[0]);
|
|
7181
|
-
return "virtual".concat(capitalizedWidget, "({ /* ... */ })");
|
|
7182
|
-
}).join(',\n '), "\n]);\n```\n\nIf you're using custom widgets that do set these query parameters, we recommend using connectors instead.\n\nSee https://www.algolia.com/doc/guides/building-search-ui/widgets/customize-an-existing-widget/js/#customize-the-complete-ui-of-the-widgets")) ;
|
|
7183
|
-
}
|
|
7184
|
-
|
|
7185
|
-
function getPropertyByPath(object, path) {
|
|
7186
|
-
var parts = Array.isArray(path) ? path : path.split('.');
|
|
7187
|
-
return parts.reduce(function (current, key) {
|
|
7188
|
-
return current && current[key];
|
|
7189
|
-
}, object);
|
|
7190
|
-
}
|
|
7191
|
-
|
|
7192
|
-
// This is the `Number.isFinite()` polyfill recommended by MDN.
|
|
7193
|
-
// We do not provide any tests for this function.
|
|
7194
|
-
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill
|
|
7195
|
-
function isFiniteNumber(value) {
|
|
7196
|
-
return typeof value === 'number' && isFinite(value);
|
|
7197
|
-
}
|
|
7198
|
-
|
|
7199
|
-
/**
|
|
7200
|
-
* This implementation is taken from Lodash implementation.
|
|
7201
|
-
* See: https://github.com/lodash/lodash/blob/master/isPlainObject.js
|
|
7202
|
-
*/
|
|
7203
|
-
function getTag(value) {
|
|
7204
|
-
if (value === null) {
|
|
7205
|
-
return value === undefined ? '[object Undefined]' : '[object Null]';
|
|
7206
|
-
}
|
|
7207
|
-
|
|
7208
|
-
return Object.prototype.toString.call(value);
|
|
7209
|
-
}
|
|
7210
|
-
|
|
7211
|
-
function isObjectLike(value) {
|
|
7212
|
-
return _typeof(value) === 'object' && value !== null;
|
|
7213
|
-
}
|
|
7214
|
-
/**
|
|
7215
|
-
* Checks if `value` is a plain object.
|
|
7216
|
-
*
|
|
7217
|
-
* A plain object is an object created by the `Object`
|
|
7218
|
-
* constructor or with a `[[Prototype]]` of `null`.
|
|
7219
|
-
*/
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
function isPlainObject(value) {
|
|
7223
|
-
if (!isObjectLike(value) || getTag(value) !== '[object Object]') {
|
|
7224
|
-
return false;
|
|
7225
|
-
}
|
|
7226
|
-
|
|
7227
|
-
if (Object.getPrototypeOf(value) === null) {
|
|
7228
|
-
return true;
|
|
7229
|
-
}
|
|
7230
|
-
|
|
7231
|
-
var proto = value;
|
|
7232
|
-
|
|
7233
|
-
while (Object.getPrototypeOf(proto) !== null) {
|
|
7234
|
-
proto = Object.getPrototypeOf(proto);
|
|
7235
|
-
}
|
|
7236
|
-
|
|
7237
|
-
return Object.getPrototypeOf(value) === proto;
|
|
7238
|
-
}
|
|
7239
|
-
|
|
7240
|
-
function range(_ref) {
|
|
7241
|
-
var _ref$start = _ref.start,
|
|
7242
|
-
start = _ref$start === void 0 ? 0 : _ref$start,
|
|
7243
|
-
end = _ref.end,
|
|
7244
|
-
_ref$step = _ref.step,
|
|
7245
|
-
step = _ref$step === void 0 ? 1 : _ref$step;
|
|
7246
|
-
// We can't divide by 0 so we re-assign the step to 1 if it happens.
|
|
7247
|
-
var limitStep = step === 0 ? 1 : step; // In some cases the array to create has a decimal length.
|
|
7248
|
-
// We therefore need to round the value.
|
|
7249
|
-
// Example:
|
|
7250
|
-
// { start: 1, end: 5000, step: 500 }
|
|
7251
|
-
// => Array length = (5000 - 1) / 500 = 9.998
|
|
7252
|
-
|
|
7253
|
-
var arrayLength = Math.round((end - start) / limitStep);
|
|
7254
|
-
return _toConsumableArray(Array(arrayLength)).map(function (_, current) {
|
|
7255
|
-
return start + current * limitStep;
|
|
7256
|
-
});
|
|
7257
|
-
}
|
|
7258
|
-
|
|
7259
|
-
function isPrimitive(obj) {
|
|
7260
|
-
return obj !== Object(obj);
|
|
7261
|
-
}
|
|
7262
|
-
|
|
7263
|
-
function isEqual(first, second) {
|
|
7264
|
-
if (first === second) {
|
|
7265
|
-
return true;
|
|
7266
|
-
}
|
|
7267
|
-
|
|
7268
|
-
if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') {
|
|
7269
|
-
return first === second;
|
|
7270
|
-
}
|
|
7271
|
-
|
|
7272
|
-
if (Object.keys(first).length !== Object.keys(second).length) {
|
|
7273
|
-
return false;
|
|
7274
|
-
}
|
|
7275
|
-
|
|
7276
|
-
for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {
|
|
7277
|
-
var key = _Object$keys[_i];
|
|
7278
|
-
|
|
7279
|
-
if (!(key in second)) {
|
|
7280
|
-
return false;
|
|
7281
|
-
}
|
|
7282
|
-
|
|
7283
|
-
if (!isEqual(first[key], second[key])) {
|
|
7284
|
-
return false;
|
|
7285
|
-
}
|
|
7286
|
-
}
|
|
7287
|
-
|
|
7288
|
-
return true;
|
|
7289
|
-
}
|
|
7290
|
-
|
|
7291
|
-
/**
|
|
7292
|
-
* This implementation is taken from Lodash implementation.
|
|
7293
|
-
* See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js
|
|
7294
|
-
*/
|
|
7295
|
-
// Used to map characters to HTML entities.
|
|
7296
|
-
var htmlEscapes = {
|
|
7297
|
-
'&': '&',
|
|
7298
|
-
'<': '<',
|
|
7299
|
-
'>': '>',
|
|
7300
|
-
'"': '"',
|
|
7301
|
-
"'": '''
|
|
7302
|
-
}; // Used to match HTML entities and HTML characters.
|
|
7303
|
-
|
|
7304
|
-
var regexUnescapedHtml = /[&<>"']/g;
|
|
7305
|
-
var regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);
|
|
7306
|
-
/**
|
|
7307
|
-
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
|
|
7308
|
-
* corresponding HTML entities.
|
|
7309
|
-
*/
|
|
7310
|
-
|
|
7311
|
-
function escape$1(value) {
|
|
7312
|
-
return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {
|
|
7313
|
-
return htmlEscapes[character];
|
|
7314
|
-
}) : value;
|
|
7315
|
-
}
|
|
7316
|
-
|
|
7317
|
-
/**
|
|
7318
|
-
* This implementation is taken from Lodash implementation.
|
|
7319
|
-
* See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js
|
|
7320
|
-
*/
|
|
7321
|
-
// Used to map HTML entities to characters.
|
|
7322
|
-
var htmlEscapes$1 = {
|
|
7323
|
-
'&': '&',
|
|
7324
|
-
'<': '<',
|
|
7325
|
-
'>': '>',
|
|
7326
|
-
'"': '"',
|
|
7327
|
-
''': "'"
|
|
7328
|
-
}; // Used to match HTML entities and HTML characters.
|
|
7661
|
+
widgets = _ref12[1].widgets;
|
|
7329
7662
|
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
* characters.
|
|
7335
|
-
*/
|
|
7663
|
+
var capitalizedWidget = capitalize(widgets[0]);
|
|
7664
|
+
return "virtual".concat(capitalizedWidget, "({ /* ... */ })");
|
|
7665
|
+
}).join(',\n '), "\n]);\n```\n\nIf you're using custom widgets that do set these query parameters, we recommend using connectors instead.\n\nSee https://www.algolia.com/doc/guides/building-search-ui/widgets/customize-an-existing-widget/js/#customize-the-complete-ui-of-the-widgets")) ;
|
|
7666
|
+
}
|
|
7336
7667
|
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7668
|
+
// This is the `Number.isFinite()` polyfill recommended by MDN.
|
|
7669
|
+
// We do not provide any tests for this function.
|
|
7670
|
+
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill
|
|
7671
|
+
function isFiniteNumber(value) {
|
|
7672
|
+
return typeof value === 'number' && isFinite(value);
|
|
7341
7673
|
}
|
|
7342
7674
|
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7675
|
+
function range(_ref) {
|
|
7676
|
+
var _ref$start = _ref.start,
|
|
7677
|
+
start = _ref$start === void 0 ? 0 : _ref$start,
|
|
7678
|
+
end = _ref.end,
|
|
7679
|
+
_ref$step = _ref.step,
|
|
7680
|
+
step = _ref$step === void 0 ? 1 : _ref$step;
|
|
7681
|
+
// We can't divide by 0 so we re-assign the step to 1 if it happens.
|
|
7682
|
+
var limitStep = step === 0 ? 1 : step; // In some cases the array to create has a decimal length.
|
|
7683
|
+
// We therefore need to round the value.
|
|
7684
|
+
// Example:
|
|
7685
|
+
// { start: 1, end: 5000, step: 500 }
|
|
7686
|
+
// => Array length = (5000 - 1) / 500 = 9.998
|
|
7351
7687
|
|
|
7352
|
-
|
|
7353
|
-
return
|
|
7688
|
+
var arrayLength = Math.round((end - start) / limitStep);
|
|
7689
|
+
return _toConsumableArray(Array(arrayLength)).map(function (_, current) {
|
|
7690
|
+
return start + current * limitStep;
|
|
7691
|
+
});
|
|
7354
7692
|
}
|
|
7355
7693
|
|
|
7356
|
-
function
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, recursiveEscape(input[key])));
|
|
7360
|
-
}, {});
|
|
7361
|
-
}
|
|
7694
|
+
function isPrimitive(obj) {
|
|
7695
|
+
return obj !== Object(obj);
|
|
7696
|
+
}
|
|
7362
7697
|
|
|
7363
|
-
|
|
7364
|
-
|
|
7698
|
+
function isEqual(first, second) {
|
|
7699
|
+
if (first === second) {
|
|
7700
|
+
return true;
|
|
7365
7701
|
}
|
|
7366
7702
|
|
|
7367
|
-
|
|
7368
|
-
|
|
7369
|
-
}
|
|
7370
|
-
}
|
|
7703
|
+
if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') {
|
|
7704
|
+
return first === second;
|
|
7705
|
+
}
|
|
7371
7706
|
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
// instead we make a shallow copy and we assign the escaped values on it.
|
|
7376
|
-
hits = hits.map(function (_ref) {
|
|
7377
|
-
var hit = _extends({}, _ref);
|
|
7707
|
+
if (Object.keys(first).length !== Object.keys(second).length) {
|
|
7708
|
+
return false;
|
|
7709
|
+
}
|
|
7378
7710
|
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
}
|
|
7711
|
+
for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {
|
|
7712
|
+
var key = _Object$keys[_i];
|
|
7382
7713
|
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7714
|
+
if (!(key in second)) {
|
|
7715
|
+
return false;
|
|
7716
|
+
}
|
|
7386
7717
|
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7718
|
+
if (!isEqual(first[key], second[key])) {
|
|
7719
|
+
return false;
|
|
7720
|
+
}
|
|
7390
7721
|
}
|
|
7391
7722
|
|
|
7392
|
-
return
|
|
7393
|
-
}
|
|
7394
|
-
function escapeFacets(facetHits) {
|
|
7395
|
-
return facetHits.map(function (h) {
|
|
7396
|
-
return _objectSpread2(_objectSpread2({}, h), {}, {
|
|
7397
|
-
highlighted: replaceTagsAndEscape(h.highlighted)
|
|
7398
|
-
});
|
|
7399
|
-
});
|
|
7723
|
+
return true;
|
|
7400
7724
|
}
|
|
7401
7725
|
|
|
7402
7726
|
function concatHighlightedParts(parts) {
|
|
@@ -7407,32 +7731,6 @@
|
|
|
7407
7731
|
}).join('');
|
|
7408
7732
|
}
|
|
7409
7733
|
|
|
7410
|
-
function getHighlightedParts(highlightedValue) {
|
|
7411
|
-
var highlightPostTag = TAG_REPLACEMENT.highlightPostTag,
|
|
7412
|
-
highlightPreTag = TAG_REPLACEMENT.highlightPreTag;
|
|
7413
|
-
var splitByPreTag = highlightedValue.split(highlightPreTag);
|
|
7414
|
-
var firstValue = splitByPreTag.shift();
|
|
7415
|
-
var elements = !firstValue ? [] : [{
|
|
7416
|
-
value: firstValue,
|
|
7417
|
-
isHighlighted: false
|
|
7418
|
-
}];
|
|
7419
|
-
splitByPreTag.forEach(function (split) {
|
|
7420
|
-
var splitByPostTag = split.split(highlightPostTag);
|
|
7421
|
-
elements.push({
|
|
7422
|
-
value: splitByPostTag[0],
|
|
7423
|
-
isHighlighted: true
|
|
7424
|
-
});
|
|
7425
|
-
|
|
7426
|
-
if (splitByPostTag[1] !== '') {
|
|
7427
|
-
elements.push({
|
|
7428
|
-
value: splitByPostTag[1],
|
|
7429
|
-
isHighlighted: false
|
|
7430
|
-
});
|
|
7431
|
-
}
|
|
7432
|
-
});
|
|
7433
|
-
return elements;
|
|
7434
|
-
}
|
|
7435
|
-
|
|
7436
7734
|
var hasAlphanumeric = new RegExp(/\w/i);
|
|
7437
7735
|
function getHighlightFromSiblings(parts, i) {
|
|
7438
7736
|
var _parts, _parts2;
|
|
@@ -8085,6 +8383,10 @@
|
|
|
8085
8383
|
});
|
|
8086
8384
|
}
|
|
8087
8385
|
|
|
8386
|
+
function cx$1(cssClasses) {
|
|
8387
|
+
return Array.isArray(cssClasses) ? cssClasses.filter(Boolean).join(' ') : cssClasses || '';
|
|
8388
|
+
}
|
|
8389
|
+
|
|
8088
8390
|
var withUsage = createDocumentationMessageGenerator({
|
|
8089
8391
|
name: 'index-widget'
|
|
8090
8392
|
});
|
|
@@ -8635,7 +8937,7 @@
|
|
|
8635
8937
|
instantSearchInstance.renderState = _objectSpread2(_objectSpread2({}, instantSearchInstance.renderState), {}, _defineProperty({}, parentIndexName, _objectSpread2(_objectSpread2({}, instantSearchInstance.renderState[parentIndexName]), renderState)));
|
|
8636
8938
|
}
|
|
8637
8939
|
|
|
8638
|
-
var version$1 = '4.
|
|
8940
|
+
var version$1 = '4.46.0';
|
|
8639
8941
|
|
|
8640
8942
|
var NAMESPACE = 'ais';
|
|
8641
8943
|
var component = function component(componentName) {
|
|
@@ -8820,11 +9122,15 @@
|
|
|
8820
9122
|
return getCookie(ANONYMOUS_TOKEN_COOKIE_KEY);
|
|
8821
9123
|
}
|
|
8822
9124
|
|
|
9125
|
+
function formatNumber(value, numberLocale) {
|
|
9126
|
+
return value.toLocaleString(numberLocale);
|
|
9127
|
+
}
|
|
9128
|
+
|
|
8823
9129
|
function hoganHelpers(_ref) {
|
|
8824
9130
|
var numberLocale = _ref.numberLocale;
|
|
8825
9131
|
return {
|
|
8826
|
-
formatNumber: function formatNumber(value, render) {
|
|
8827
|
-
return Number(render(value))
|
|
9132
|
+
formatNumber: function formatNumber$1(value, render) {
|
|
9133
|
+
return formatNumber(Number(render(value)), numberLocale);
|
|
8828
9134
|
},
|
|
8829
9135
|
highlight: function highlight$1(options, render) {
|
|
8830
9136
|
try {
|
|
@@ -11494,8 +11800,6 @@
|
|
|
11494
11800
|
};
|
|
11495
11801
|
}
|
|
11496
11802
|
|
|
11497
|
-
var n,l,u,t,r,o,f,e={},c=[],s=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a(n,l){for(var u in l)n[u]=l[u];return n}function h(n){var l=n.parentNode;l&&l.removeChild(n);}function v(l,u,i){var t,r,o,f={};for(o in u)"key"==o?t=u[o]:"ref"==o?r=u[o]:f[o]=u[o];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===f[o]&&(f[o]=l.defaultProps[o]);return y(l,f,t,r,null)}function y(n,i,t,r,o){var f={type:n,props:i,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++u:o};return null==o&&null!=l.vnode&&l.vnode(f),f}function p(){return {current:null}}function d(n){return n.children}function _(n,l){this.props=n,this.context=l;}function k(n,l){if(null==l)return n.__?k(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k(n):null}function b(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b(n)}}function m(n){(!n.__d&&(n.__d=!0)&&t.push(n)&&!g.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(g);}function g(){for(var n;g.__r=t.length;)n=t.sort(function(n,l){return n.__v.__b-l.__v.__b}),t=[],n.some(function(n){var l,u,i,t,r,o;n.__d&&(r=(t=(l=n).__v).__e,(o=l.__P)&&(u=[],(i=a({},t)).__v=t.__v+1,j(o,t,i,l.__n,void 0!==o.ownerSVGElement,null!=t.__h?[r]:null,u,null==r?k(t):r,t.__h),z(u,t),t.__e!=r&&b(t)));});}function w(n,l,u,i,t,r,o,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y(null,_,null,null,_):Array.isArray(_)?y(d,{children:_},null,null,null):_.__b>0?y(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j(n,_,p=p||e,t,r,o,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x(_,s,n):s=P(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M(g[h],g[++h],g[++h]);}function x(n,l,u){for(var i,t=n.__k,r=0;t&&r<t.length;r++)(i=t[r])&&(i.__=n,l="function"==typeof i.type?x(i,l,u):P(u,i,i,t,i.__e,l));return l}function P(n,l,u,i,t,r){var o,f,e;if(void 0!==l.__d)o=l.__d,l.__d=void 0;else if(null==u||t!=r||null==t.parentNode)n:if(null==r||r.parentNode!==n)n.appendChild(t),o=null;else{for(f=r,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,r),o=r;}return void 0!==o?o:t.nextSibling}function C(n,l,u,i,t){var r;for(r in u)"children"===r||"key"===r||r in l||H(n,r,null,u[r],i);for(r in l)t&&"function"!=typeof l[r]||"children"===r||"key"===r||"value"===r||"checked"===r||u[r]===l[r]||H(n,r,l[r],u[r],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s.test(l)?u:u+"px";}function H(n,l,u,i,t){var r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])r=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?i||n.addEventListener(l,r?T:I,r):n.removeEventListener(l,r?T:I,r);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l.event?l.event(n):n);}function T(n){this.l[n.type+!0](l.event?l.event(n):n);}function j(n,u,i,t,r,o,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,o=[e]),(s=l.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _(m,x),h.constructor=P,h.render=O),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a({},h.__s)),a(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a(a({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d&&null==s.key?s.props.children:s,w(n,Array.isArray(A)?A:[A],u,i,t,r,o,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==o&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,r,o,f,c);(s=l.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=o)&&(u.__e=e,u.__h=!!c,o[o.indexOf(e)]=null),l.__e(n,u,i);}}function z(n,u){l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l.__e(n,u.__v);}});}function L(l,u,i,t,r,o,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(r=!0),null!=o)for(;_<o.length;_++)if((s=o[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,o[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),o=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else{if(o=o&&n.call(l.childNodes),a=(y=i.props||e).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=o)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C(l,p,y,r,c),v)u.__k=[];else if(_=u.props.children,w(l,Array.isArray(_)?_:[_],u,i,t,r&&"foreignObject"!==d,o,f,o?o[0]:i.__k&&k(i,0),c),null!=o)for(_=o.length;_--;)null!=o[_]&&h(o[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==y.value||_!==l.value||"progress"===d&&!_)&&H(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H(l,"checked",_,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l.__e(n,i);}}function N(n,u,i){var t,r;if(l.unmount&&l.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(r=0;r<t.length;r++)t[r]&&N(t[r],u,"function"!=typeof n.type);i||null==n.__e||h(n.__e),n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function S(u,i,t){var r,o,f;l.__&&l.__(u,i),o=(r="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j(i,u=(!r&&t||i).__k=v(d,null,[u]),o||e,e,void 0!==i.ownerSVGElement,!r&&t?[t]:o?null:i.firstChild?n.call(i.childNodes):null,f,!r&&t?t:o?o.__e:i.firstChild,r),z(f,u);}n=c.slice,l={__e:function(n,l){for(var u,i,t;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return u.__E=u}catch(l){n=l;}throw n}},u=0,_.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a({},this.state),"function"==typeof n&&(n=n(a({},u),this.props)),n&&a(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m(this));},_.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m(this));},_.prototype.render=d,t=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,f=0;
|
|
11498
|
-
|
|
11499
11803
|
/** @jsx h */
|
|
11500
11804
|
|
|
11501
11805
|
var findInsightsTarget = function findInsightsTarget(startElement, endElement, validator) {
|
|
@@ -11557,9 +11861,9 @@
|
|
|
11557
11861
|
}
|
|
11558
11862
|
};
|
|
11559
11863
|
|
|
11560
|
-
return
|
|
11864
|
+
return h("div", {
|
|
11561
11865
|
onClick: handleClick
|
|
11562
|
-
},
|
|
11866
|
+
}, h(BaseComponent, props));
|
|
11563
11867
|
}
|
|
11564
11868
|
|
|
11565
11869
|
return WithInsightsListener;
|
|
@@ -15878,6 +16182,11 @@
|
|
|
15878
16182
|
}, {
|
|
15879
16183
|
key: "render",
|
|
15880
16184
|
value: function render() {
|
|
16185
|
+
var _this = this;
|
|
16186
|
+
|
|
16187
|
+
_warning(Object.keys(this.props.templates).every(function (key) {
|
|
16188
|
+
return typeof _this.props.templates[key] === 'function';
|
|
16189
|
+
}), "Hogan.js and string-based templates are deprecated and will not be supported in InstantSearch.js 5.x.\n\nYou can replace them with function-form templates and use either the provided `html` function or JSX templates.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#upgrade-templates") ;
|
|
15881
16190
|
var RootTagName = this.props.rootTagName;
|
|
15882
16191
|
var useCustomCompileOptions = this.props.useCustomCompileOptions[this.props.templateKey];
|
|
15883
16192
|
var compileOptions = useCustomCompileOptions ? this.props.templatesConfig.compileOptions : {};
|
|
@@ -15887,7 +16196,8 @@
|
|
|
15887
16196
|
compileOptions: compileOptions,
|
|
15888
16197
|
helpers: this.props.templatesConfig.helpers,
|
|
15889
16198
|
data: this.props.data,
|
|
15890
|
-
bindEvent: this.props.bindEvent
|
|
16199
|
+
bindEvent: this.props.bindEvent,
|
|
16200
|
+
sendEvent: this.props.sendEvent
|
|
15891
16201
|
});
|
|
15892
16202
|
|
|
15893
16203
|
if (content === null) {
|
|
@@ -15896,7 +16206,11 @@
|
|
|
15896
16206
|
return null;
|
|
15897
16207
|
}
|
|
15898
16208
|
|
|
15899
|
-
|
|
16209
|
+
if (_typeof(content) === 'object') {
|
|
16210
|
+
return h(RootTagName, this.props.rootProps, content);
|
|
16211
|
+
}
|
|
16212
|
+
|
|
16213
|
+
return h(RootTagName, _extends({}, this.props.rootProps, {
|
|
15900
16214
|
dangerouslySetInnerHTML: {
|
|
15901
16215
|
__html: content
|
|
15902
16216
|
}
|
|
@@ -15905,7 +16219,7 @@
|
|
|
15905
16219
|
}]);
|
|
15906
16220
|
|
|
15907
16221
|
return Template;
|
|
15908
|
-
}(
|
|
16222
|
+
}(d);
|
|
15909
16223
|
|
|
15910
16224
|
_defineProperty(Template, "defaultProps", defaultProps);
|
|
15911
16225
|
|
|
@@ -15915,13 +16229,13 @@
|
|
|
15915
16229
|
templateProps = _ref.templateProps,
|
|
15916
16230
|
createURL = _ref.createURL,
|
|
15917
16231
|
refine = _ref.refine;
|
|
15918
|
-
return
|
|
16232
|
+
return h("div", {
|
|
15919
16233
|
className: classnames(cssClasses.root, _defineProperty({}, cssClasses.noRefinementRoot, items.length === 0))
|
|
15920
|
-
},
|
|
16234
|
+
}, h("ul", {
|
|
15921
16235
|
className: cssClasses.list
|
|
15922
|
-
},
|
|
16236
|
+
}, h("li", {
|
|
15923
16237
|
className: classnames(cssClasses.item, _defineProperty({}, cssClasses.selectedItem, items.length === 0))
|
|
15924
|
-
},
|
|
16238
|
+
}, h(Template, _extends({}, templateProps, {
|
|
15925
16239
|
templateKey: "home",
|
|
15926
16240
|
rootTagName: "a",
|
|
15927
16241
|
rootProps: {
|
|
@@ -15934,17 +16248,17 @@
|
|
|
15934
16248
|
}
|
|
15935
16249
|
}))), items.map(function (item, idx) {
|
|
15936
16250
|
var isLast = idx === items.length - 1;
|
|
15937
|
-
return
|
|
16251
|
+
return h("li", {
|
|
15938
16252
|
key: item.label + idx,
|
|
15939
16253
|
className: classnames(cssClasses.item, _defineProperty({}, cssClasses.selectedItem, isLast))
|
|
15940
|
-
},
|
|
16254
|
+
}, h(Template, _extends({}, templateProps, {
|
|
15941
16255
|
templateKey: "separator",
|
|
15942
16256
|
rootTagName: "span",
|
|
15943
16257
|
rootProps: {
|
|
15944
16258
|
className: cssClasses.separator,
|
|
15945
16259
|
'aria-hidden': true
|
|
15946
16260
|
}
|
|
15947
|
-
})), isLast ? item.label :
|
|
16261
|
+
})), isLast ? item.label : h("a", {
|
|
15948
16262
|
className: cssClasses.link,
|
|
15949
16263
|
href: createURL(item.value),
|
|
15950
16264
|
onClick: function onClick(event) {
|
|
@@ -15956,8 +16270,12 @@
|
|
|
15956
16270
|
};
|
|
15957
16271
|
|
|
15958
16272
|
var defaultTemplates = {
|
|
15959
|
-
home:
|
|
15960
|
-
|
|
16273
|
+
home: function home() {
|
|
16274
|
+
return 'Home';
|
|
16275
|
+
},
|
|
16276
|
+
separator: function separator() {
|
|
16277
|
+
return '>';
|
|
16278
|
+
}
|
|
15961
16279
|
};
|
|
15962
16280
|
|
|
15963
16281
|
var withUsage$t = createDocumentationMessageGenerator({
|
|
@@ -15986,7 +16304,7 @@
|
|
|
15986
16304
|
return;
|
|
15987
16305
|
}
|
|
15988
16306
|
|
|
15989
|
-
|
|
16307
|
+
P(h(Breadcrumb, {
|
|
15990
16308
|
canRefine: canRefine,
|
|
15991
16309
|
cssClasses: cssClasses,
|
|
15992
16310
|
createURL: createURL,
|
|
@@ -16043,7 +16361,7 @@
|
|
|
16043
16361
|
templates: templates
|
|
16044
16362
|
});
|
|
16045
16363
|
var makeWidget = connectBreadcrumb(specializedRenderer, function () {
|
|
16046
|
-
return
|
|
16364
|
+
return P(null, containerNode);
|
|
16047
16365
|
});
|
|
16048
16366
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
16049
16367
|
attributes: attributes,
|
|
@@ -16060,9 +16378,9 @@
|
|
|
16060
16378
|
refine = _ref.refine,
|
|
16061
16379
|
cssClasses = _ref.cssClasses,
|
|
16062
16380
|
templateProps = _ref.templateProps;
|
|
16063
|
-
return
|
|
16381
|
+
return h("div", {
|
|
16064
16382
|
className: cssClasses.root
|
|
16065
|
-
},
|
|
16383
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16066
16384
|
templateKey: "resetLabel",
|
|
16067
16385
|
rootTagName: "button",
|
|
16068
16386
|
rootProps: {
|
|
@@ -16077,7 +16395,9 @@
|
|
|
16077
16395
|
};
|
|
16078
16396
|
|
|
16079
16397
|
var defaultTemplates$1 = {
|
|
16080
|
-
resetLabel:
|
|
16398
|
+
resetLabel: function resetLabel() {
|
|
16399
|
+
return 'Clear refinements';
|
|
16400
|
+
}
|
|
16081
16401
|
};
|
|
16082
16402
|
|
|
16083
16403
|
var withUsage$u = createDocumentationMessageGenerator({
|
|
@@ -16104,7 +16424,7 @@
|
|
|
16104
16424
|
return;
|
|
16105
16425
|
}
|
|
16106
16426
|
|
|
16107
|
-
|
|
16427
|
+
P(h(ClearRefinements, {
|
|
16108
16428
|
refine: refine,
|
|
16109
16429
|
cssClasses: cssClasses,
|
|
16110
16430
|
hasRefinements: canRefine,
|
|
@@ -16146,7 +16466,7 @@
|
|
|
16146
16466
|
templates: templates
|
|
16147
16467
|
});
|
|
16148
16468
|
var makeWidget = connectClearRefinements(specializedRenderer, function () {
|
|
16149
|
-
return
|
|
16469
|
+
return P(null, containerNode);
|
|
16150
16470
|
});
|
|
16151
16471
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
16152
16472
|
includedAttributes: includedAttributes,
|
|
@@ -16199,23 +16519,23 @@
|
|
|
16199
16519
|
var CurrentRefinements = function CurrentRefinements(_ref2) {
|
|
16200
16520
|
var items = _ref2.items,
|
|
16201
16521
|
cssClasses = _ref2.cssClasses;
|
|
16202
|
-
return
|
|
16522
|
+
return h("div", {
|
|
16203
16523
|
className: cssClasses.root
|
|
16204
|
-
},
|
|
16524
|
+
}, h("ul", {
|
|
16205
16525
|
className: cssClasses.list
|
|
16206
16526
|
}, items.map(function (item, index) {
|
|
16207
|
-
return
|
|
16527
|
+
return h("li", {
|
|
16208
16528
|
key: "".concat(item.indexName, "-").concat(item.attribute, "-").concat(index),
|
|
16209
16529
|
className: cssClasses.item
|
|
16210
|
-
},
|
|
16530
|
+
}, h("span", {
|
|
16211
16531
|
className: cssClasses.label
|
|
16212
16532
|
}, capitalize(item.label), ":"), item.refinements.map(function (refinement) {
|
|
16213
|
-
return
|
|
16533
|
+
return h("span", {
|
|
16214
16534
|
key: createItemKey(refinement),
|
|
16215
16535
|
className: cssClasses.category
|
|
16216
|
-
},
|
|
16536
|
+
}, h("span", {
|
|
16217
16537
|
className: cssClasses.categoryLabel
|
|
16218
|
-
}, refinement.attribute === 'query' ?
|
|
16538
|
+
}, refinement.attribute === 'query' ? h("q", null, refinement.label) : refinement.label), h("button", {
|
|
16219
16539
|
className: cssClasses.delete,
|
|
16220
16540
|
onClick: handleClick(item.refine.bind(null, refinement))
|
|
16221
16541
|
}, "\u2715"));
|
|
@@ -16239,7 +16559,7 @@
|
|
|
16239
16559
|
var _ref2 = widgetParams,
|
|
16240
16560
|
container = _ref2.container,
|
|
16241
16561
|
cssClasses = _ref2.cssClasses;
|
|
16242
|
-
|
|
16562
|
+
P(h(CurrentRefinements, {
|
|
16243
16563
|
cssClasses: cssClasses,
|
|
16244
16564
|
items: items
|
|
16245
16565
|
}), container);
|
|
@@ -16281,7 +16601,7 @@
|
|
|
16281
16601
|
}), userCssClasses.delete)
|
|
16282
16602
|
};
|
|
16283
16603
|
var makeWidget = connectCurrentRefinements(renderer$2, function () {
|
|
16284
|
-
return
|
|
16604
|
+
return P(null, containerNode);
|
|
16285
16605
|
});
|
|
16286
16606
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
16287
16607
|
container: containerNode,
|
|
@@ -16295,8 +16615,12 @@
|
|
|
16295
16615
|
};
|
|
16296
16616
|
|
|
16297
16617
|
var defaultTemplates$2 = {
|
|
16298
|
-
header:
|
|
16299
|
-
|
|
16618
|
+
header: function header() {
|
|
16619
|
+
return '';
|
|
16620
|
+
},
|
|
16621
|
+
loader: function loader() {
|
|
16622
|
+
return '';
|
|
16623
|
+
},
|
|
16300
16624
|
item: function item(_item) {
|
|
16301
16625
|
return JSON.stringify(_item);
|
|
16302
16626
|
}
|
|
@@ -16307,9 +16631,9 @@
|
|
|
16307
16631
|
isLoading = _ref.isLoading,
|
|
16308
16632
|
cssClasses = _ref.cssClasses,
|
|
16309
16633
|
templateProps = _ref.templateProps;
|
|
16310
|
-
return
|
|
16634
|
+
return h("div", {
|
|
16311
16635
|
className: classnames(cssClasses.root, _defineProperty({}, cssClasses.emptyRoot, hits.length === 0))
|
|
16312
|
-
},
|
|
16636
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16313
16637
|
templateKey: "header",
|
|
16314
16638
|
rootProps: {
|
|
16315
16639
|
className: cssClasses.header
|
|
@@ -16318,15 +16642,15 @@
|
|
|
16318
16642
|
hits: hits,
|
|
16319
16643
|
isLoading: isLoading
|
|
16320
16644
|
}
|
|
16321
|
-
})), isLoading ?
|
|
16645
|
+
})), isLoading ? h(Template, _extends({}, templateProps, {
|
|
16322
16646
|
templateKey: "loader",
|
|
16323
16647
|
rootProps: {
|
|
16324
16648
|
className: cssClasses.loader
|
|
16325
16649
|
}
|
|
16326
|
-
})) :
|
|
16650
|
+
})) : h("ul", {
|
|
16327
16651
|
className: cssClasses.list
|
|
16328
16652
|
}, hits.map(function (hit, position) {
|
|
16329
|
-
return
|
|
16653
|
+
return h(Template, _extends({}, templateProps, {
|
|
16330
16654
|
templateKey: "item",
|
|
16331
16655
|
rootTagName: "li",
|
|
16332
16656
|
rootProps: {
|
|
@@ -16364,7 +16688,7 @@
|
|
|
16364
16688
|
return;
|
|
16365
16689
|
}
|
|
16366
16690
|
|
|
16367
|
-
|
|
16691
|
+
P(h(Answers, {
|
|
16368
16692
|
cssClasses: cssClasses,
|
|
16369
16693
|
hits: hits,
|
|
16370
16694
|
isLoading: isLoading,
|
|
@@ -16418,7 +16742,7 @@
|
|
|
16418
16742
|
renderState: {}
|
|
16419
16743
|
});
|
|
16420
16744
|
var makeWidget = connectAnswers(specializedRenderer, function () {
|
|
16421
|
-
return
|
|
16745
|
+
return P(null, containerNode);
|
|
16422
16746
|
});
|
|
16423
16747
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
16424
16748
|
attributesForPrediction: attributesForPrediction,
|
|
@@ -16529,7 +16853,7 @@
|
|
|
16529
16853
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
16530
16854
|
onClick = _ref.onClick,
|
|
16531
16855
|
children = _ref.children;
|
|
16532
|
-
return
|
|
16856
|
+
return h("button", {
|
|
16533
16857
|
className: className,
|
|
16534
16858
|
onClick: onClick,
|
|
16535
16859
|
disabled: disabled
|
|
@@ -16544,9 +16868,9 @@
|
|
|
16544
16868
|
checked = _ref.checked,
|
|
16545
16869
|
onToggle = _ref.onToggle,
|
|
16546
16870
|
children = _ref.children;
|
|
16547
|
-
return
|
|
16871
|
+
return h("label", {
|
|
16548
16872
|
className: classNameLabel
|
|
16549
|
-
},
|
|
16873
|
+
}, h("input", {
|
|
16550
16874
|
className: classNameInput,
|
|
16551
16875
|
type: "checkbox",
|
|
16552
16876
|
checked: checked,
|
|
@@ -16566,36 +16890,36 @@
|
|
|
16566
16890
|
onRefineClick = _ref.onRefineClick,
|
|
16567
16891
|
onClearClick = _ref.onClearClick,
|
|
16568
16892
|
templateProps = _ref.templateProps;
|
|
16569
|
-
return
|
|
16893
|
+
return h(p, null, enableRefine && h("div", null, enableRefineControl && h("div", {
|
|
16570
16894
|
className: cssClasses.control
|
|
16571
|
-
}, isRefineOnMapMove || !hasMapMoveSinceLastRefine ?
|
|
16895
|
+
}, isRefineOnMapMove || !hasMapMoveSinceLastRefine ? h(GeoSearchToggle, {
|
|
16572
16896
|
classNameLabel: classnames(cssClasses.label, _defineProperty({}, cssClasses.selectedLabel, isRefineOnMapMove)),
|
|
16573
16897
|
classNameInput: cssClasses.input,
|
|
16574
16898
|
checked: isRefineOnMapMove,
|
|
16575
16899
|
onToggle: onRefineToggle
|
|
16576
|
-
},
|
|
16900
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16577
16901
|
templateKey: "toggle",
|
|
16578
16902
|
rootTagName: "span"
|
|
16579
|
-
}))) :
|
|
16903
|
+
}))) : h(GeoSearchButton, {
|
|
16580
16904
|
className: cssClasses.redo,
|
|
16581
16905
|
disabled: !hasMapMoveSinceLastRefine,
|
|
16582
16906
|
onClick: onRefineClick
|
|
16583
|
-
},
|
|
16907
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16584
16908
|
templateKey: "redo",
|
|
16585
16909
|
rootTagName: "span"
|
|
16586
|
-
})))), !enableRefineControl && !isRefineOnMapMove &&
|
|
16910
|
+
})))), !enableRefineControl && !isRefineOnMapMove && h("div", {
|
|
16587
16911
|
className: cssClasses.control
|
|
16588
|
-
},
|
|
16912
|
+
}, h(GeoSearchButton, {
|
|
16589
16913
|
className: classnames(cssClasses.redo, _defineProperty({}, cssClasses.disabledRedo, !hasMapMoveSinceLastRefine)),
|
|
16590
16914
|
disabled: !hasMapMoveSinceLastRefine,
|
|
16591
16915
|
onClick: onRefineClick
|
|
16592
|
-
},
|
|
16916
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16593
16917
|
templateKey: "redo",
|
|
16594
16918
|
rootTagName: "span"
|
|
16595
|
-
})))), enableClearMapRefinement && isRefinedWithMap &&
|
|
16919
|
+
})))), enableClearMapRefinement && isRefinedWithMap && h(GeoSearchButton, {
|
|
16596
16920
|
className: cssClasses.reset,
|
|
16597
16921
|
onClick: onClearClick
|
|
16598
|
-
},
|
|
16922
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16599
16923
|
templateKey: "reset",
|
|
16600
16924
|
rootTagName: "span"
|
|
16601
16925
|
})))));
|
|
@@ -16779,7 +17103,7 @@
|
|
|
16779
17103
|
});
|
|
16780
17104
|
}
|
|
16781
17105
|
|
|
16782
|
-
|
|
17106
|
+
P(h(GeoSearchControls, {
|
|
16783
17107
|
cssClasses: cssClasses,
|
|
16784
17108
|
enableRefine: enableRefine,
|
|
16785
17109
|
enableRefineControl: enableRefineControl,
|
|
@@ -16799,14 +17123,25 @@
|
|
|
16799
17123
|
}), container.querySelector(".".concat(cssClasses.tree)));
|
|
16800
17124
|
};
|
|
16801
17125
|
|
|
17126
|
+
/** @jsx h */
|
|
17127
|
+
|
|
17128
|
+
var _ref = h("p", null, "Your custom HTML Marker");
|
|
17129
|
+
|
|
16802
17130
|
var defaultTemplates$3 = {
|
|
16803
|
-
HTMLMarker:
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
17131
|
+
HTMLMarker: function HTMLMarker() {
|
|
17132
|
+
return _ref;
|
|
17133
|
+
},
|
|
17134
|
+
reset: function reset() {
|
|
17135
|
+
return 'Clear the map refinement';
|
|
17136
|
+
},
|
|
17137
|
+
toggle: function toggle() {
|
|
17138
|
+
return 'Search as I move the map';
|
|
17139
|
+
},
|
|
17140
|
+
redo: function redo() {
|
|
17141
|
+
return 'Redo search here';
|
|
17142
|
+
}
|
|
16807
17143
|
};
|
|
16808
17144
|
|
|
16809
|
-
/* global google EventListener */
|
|
16810
17145
|
var createHTMLMarker = function createHTMLMarker(googleReference) {
|
|
16811
17146
|
var HTMLMarker = /*#__PURE__*/function (_googleReference$maps) {
|
|
16812
17147
|
_inherits(HTMLMarker, _googleReference$maps);
|
|
@@ -16850,7 +17185,12 @@
|
|
|
16850
17185
|
_this.element = document.createElement('div');
|
|
16851
17186
|
_this.element.className = className;
|
|
16852
17187
|
_this.element.style.position = 'absolute';
|
|
16853
|
-
|
|
17188
|
+
|
|
17189
|
+
if (_typeof(template) === 'object') {
|
|
17190
|
+
P(template, _this.element);
|
|
17191
|
+
} else {
|
|
17192
|
+
_this.element.innerHTML = template;
|
|
17193
|
+
}
|
|
16854
17194
|
|
|
16855
17195
|
_this.setMap(map);
|
|
16856
17196
|
|
|
@@ -17068,7 +17408,7 @@
|
|
|
17068
17408
|
var createMarker = !customHTMLMarker ? createBuiltInMarker : createCustomHTMLMarker;
|
|
17069
17409
|
var markerOptions = !customHTMLMarker ? builtInMarker : customHTMLMarker;
|
|
17070
17410
|
var makeWidget = connectGeoSearch(renderer$4, function () {
|
|
17071
|
-
return
|
|
17411
|
+
return P(null, containerNode);
|
|
17072
17412
|
});
|
|
17073
17413
|
return _objectSpread2(_objectSpread2({}, makeWidget(_objectSpread2(_objectSpread2({}, otherWidgetParams), {}, {
|
|
17074
17414
|
renderState: {},
|
|
@@ -17097,7 +17437,7 @@
|
|
|
17097
17437
|
templateKey = _ref.templateKey,
|
|
17098
17438
|
templateData = _ref.templateData,
|
|
17099
17439
|
subItems = _ref.subItems;
|
|
17100
|
-
return
|
|
17440
|
+
return h("li", {
|
|
17101
17441
|
className: className,
|
|
17102
17442
|
onClick: function onClick(originalEvent) {
|
|
17103
17443
|
handleClick({
|
|
@@ -17106,7 +17446,7 @@
|
|
|
17106
17446
|
originalEvent: originalEvent
|
|
17107
17447
|
});
|
|
17108
17448
|
}
|
|
17109
|
-
},
|
|
17449
|
+
}, h(Template, _extends({}, templateProps, {
|
|
17110
17450
|
templateKey: templateKey,
|
|
17111
17451
|
data: templateData
|
|
17112
17452
|
})), subItems);
|
|
@@ -17148,7 +17488,7 @@
|
|
|
17148
17488
|
focused: false
|
|
17149
17489
|
});
|
|
17150
17490
|
|
|
17151
|
-
_defineProperty(_assertThisInitialized(_this), "input",
|
|
17491
|
+
_defineProperty(_assertThisInitialized(_this), "input", y());
|
|
17152
17492
|
|
|
17153
17493
|
_defineProperty(_assertThisInitialized(_this), "onInput", function (event) {
|
|
17154
17494
|
var _this$props = _this.props,
|
|
@@ -17263,16 +17603,16 @@
|
|
|
17263
17603
|
showLoadingIndicator = _this$props4.showLoadingIndicator,
|
|
17264
17604
|
templates = _this$props4.templates,
|
|
17265
17605
|
isSearchStalled = _this$props4.isSearchStalled;
|
|
17266
|
-
return
|
|
17606
|
+
return h("div", {
|
|
17267
17607
|
className: cssClasses.root
|
|
17268
|
-
},
|
|
17608
|
+
}, h("form", {
|
|
17269
17609
|
action: "",
|
|
17270
17610
|
role: "search",
|
|
17271
17611
|
className: cssClasses.form,
|
|
17272
17612
|
noValidate: true,
|
|
17273
17613
|
onSubmit: this.onSubmit,
|
|
17274
17614
|
onReset: this.onReset
|
|
17275
|
-
},
|
|
17615
|
+
}, h("input", {
|
|
17276
17616
|
ref: this.input,
|
|
17277
17617
|
value: this.state.query,
|
|
17278
17618
|
disabled: this.props.disabled,
|
|
@@ -17289,7 +17629,7 @@
|
|
|
17289
17629
|
onInput: this.onInput,
|
|
17290
17630
|
onBlur: this.onBlur,
|
|
17291
17631
|
onFocus: this.onFocus
|
|
17292
|
-
}),
|
|
17632
|
+
}), h(Template, {
|
|
17293
17633
|
templateKey: "submit",
|
|
17294
17634
|
rootTagName: "button",
|
|
17295
17635
|
rootProps: {
|
|
@@ -17302,7 +17642,7 @@
|
|
|
17302
17642
|
data: {
|
|
17303
17643
|
cssClasses: cssClasses
|
|
17304
17644
|
}
|
|
17305
|
-
}),
|
|
17645
|
+
}), h(Template, {
|
|
17306
17646
|
templateKey: "reset",
|
|
17307
17647
|
rootTagName: "button",
|
|
17308
17648
|
rootProps: {
|
|
@@ -17315,7 +17655,7 @@
|
|
|
17315
17655
|
data: {
|
|
17316
17656
|
cssClasses: cssClasses
|
|
17317
17657
|
}
|
|
17318
|
-
}), showLoadingIndicator &&
|
|
17658
|
+
}), showLoadingIndicator && h(Template, {
|
|
17319
17659
|
templateKey: "loadingIndicator",
|
|
17320
17660
|
rootTagName: "span",
|
|
17321
17661
|
rootProps: {
|
|
@@ -17331,7 +17671,7 @@
|
|
|
17331
17671
|
}]);
|
|
17332
17672
|
|
|
17333
17673
|
return SearchBox;
|
|
17334
|
-
}(
|
|
17674
|
+
}(d);
|
|
17335
17675
|
|
|
17336
17676
|
_defineProperty(SearchBox, "defaultProps", defaultProps$1);
|
|
17337
17677
|
|
|
@@ -17356,7 +17696,7 @@
|
|
|
17356
17696
|
|
|
17357
17697
|
_this = _super.call(this, props);
|
|
17358
17698
|
|
|
17359
|
-
_defineProperty(_assertThisInitialized(_this), "searchBox",
|
|
17699
|
+
_defineProperty(_assertThisInitialized(_this), "searchBox", y());
|
|
17360
17700
|
|
|
17361
17701
|
_this.handleItemClick = _this.handleItemClick.bind(_assertThisInitialized(_this));
|
|
17362
17702
|
return _this;
|
|
@@ -17385,7 +17725,7 @@
|
|
|
17385
17725
|
root = _this$props$cssClasse.root,
|
|
17386
17726
|
cssClasses = _objectWithoutProperties(_this$props$cssClasse, ["root"]);
|
|
17387
17727
|
|
|
17388
|
-
subItems =
|
|
17728
|
+
subItems = h(RefinementList, _extends({}, this.props, {
|
|
17389
17729
|
// We want to keep `root` required for external usage but not for the
|
|
17390
17730
|
// sub items.
|
|
17391
17731
|
cssClasses: cssClasses,
|
|
@@ -17416,7 +17756,7 @@
|
|
|
17416
17756
|
}
|
|
17417
17757
|
|
|
17418
17758
|
var refinementListItemClassName = classnames(this.props.cssClasses.item, (_cx = {}, _defineProperty(_cx, this.props.cssClasses.selectedItem, facetValue.isRefined), _defineProperty(_cx, this.props.cssClasses.disabledItem, !facetValue.count), _defineProperty(_cx, this.props.cssClasses.parentItem, isHierarchicalMenuItem(facetValue) && Array.isArray(facetValue.data) && facetValue.data.length > 0), _cx));
|
|
17419
|
-
return
|
|
17759
|
+
return h(RefinementListItem, {
|
|
17420
17760
|
templateKey: "item",
|
|
17421
17761
|
key: key,
|
|
17422
17762
|
facetValueToRefine: facetValue.value,
|
|
@@ -17510,7 +17850,7 @@
|
|
|
17510
17850
|
var _this2 = this;
|
|
17511
17851
|
|
|
17512
17852
|
var showMoreButtonClassName = classnames(this.props.cssClasses.showMore, _defineProperty({}, this.props.cssClasses.disabledShowMore, !(this.props.showMore === true && this.props.canToggleShowMore)));
|
|
17513
|
-
var showMoreButton = this.props.showMore === true &&
|
|
17853
|
+
var showMoreButton = this.props.showMore === true && h(Template, _extends({}, this.props.templateProps, {
|
|
17514
17854
|
templateKey: "showMoreText",
|
|
17515
17855
|
rootTagName: "button",
|
|
17516
17856
|
rootProps: {
|
|
@@ -17523,9 +17863,9 @@
|
|
|
17523
17863
|
}
|
|
17524
17864
|
}));
|
|
17525
17865
|
var shouldDisableSearchBox = this.props.searchIsAlwaysActive !== true && !(this.props.isFromSearch || !this.props.hasExhaustiveItems);
|
|
17526
|
-
var searchBox = this.props.searchFacetValues &&
|
|
17866
|
+
var searchBox = this.props.searchFacetValues && h("div", {
|
|
17527
17867
|
className: this.props.cssClasses.searchBox
|
|
17528
|
-
},
|
|
17868
|
+
}, h(SearchBox, {
|
|
17529
17869
|
ref: this.searchBox,
|
|
17530
17870
|
placeholder: this.props.searchPlaceholder,
|
|
17531
17871
|
disabled: shouldDisableSearchBox,
|
|
@@ -17544,30 +17884,47 @@
|
|
|
17544
17884
|
,
|
|
17545
17885
|
searchAsYouType: false
|
|
17546
17886
|
}));
|
|
17547
|
-
var facetValues = this.props.facetValues && this.props.facetValues.length > 0 &&
|
|
17887
|
+
var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && h("ul", {
|
|
17548
17888
|
className: this.props.cssClasses.list
|
|
17549
17889
|
}, this.props.facetValues.map(this._generateFacetItem, this));
|
|
17550
|
-
var noResults = this.props.searchFacetValues && this.props.isFromSearch && (!this.props.facetValues || this.props.facetValues.length === 0) &&
|
|
17890
|
+
var noResults = this.props.searchFacetValues && this.props.isFromSearch && (!this.props.facetValues || this.props.facetValues.length === 0) && h(Template, _extends({}, this.props.templateProps, {
|
|
17551
17891
|
templateKey: "searchableNoResults",
|
|
17552
17892
|
rootProps: {
|
|
17553
17893
|
className: this.props.cssClasses.noResults
|
|
17554
17894
|
}
|
|
17555
17895
|
}));
|
|
17556
17896
|
var rootClassName = classnames(this.props.cssClasses.root, _defineProperty({}, this.props.cssClasses.noRefinementRoot, !this.props.facetValues || this.props.facetValues.length === 0), this.props.className);
|
|
17557
|
-
return
|
|
17897
|
+
return h("div", {
|
|
17558
17898
|
className: rootClassName
|
|
17559
17899
|
}, this.props.children, searchBox, facetValues, noResults, showMoreButton);
|
|
17560
17900
|
}
|
|
17561
17901
|
}]);
|
|
17562
17902
|
|
|
17563
17903
|
return RefinementList;
|
|
17564
|
-
}(
|
|
17904
|
+
}(d);
|
|
17565
17905
|
|
|
17566
17906
|
_defineProperty(RefinementList$1, "defaultProps", defaultProps$2);
|
|
17567
17907
|
|
|
17908
|
+
/** @jsx h */
|
|
17568
17909
|
var defaultTemplates$4 = {
|
|
17569
|
-
item:
|
|
17570
|
-
|
|
17910
|
+
item: function item(_ref) {
|
|
17911
|
+
var url = _ref.url,
|
|
17912
|
+
label = _ref.label,
|
|
17913
|
+
count = _ref.count,
|
|
17914
|
+
cssClasses = _ref.cssClasses;
|
|
17915
|
+
return h("a", {
|
|
17916
|
+
className: cx$1(cssClasses.link),
|
|
17917
|
+
href: url
|
|
17918
|
+
}, h("span", {
|
|
17919
|
+
className: cx$1(cssClasses.label)
|
|
17920
|
+
}, label), h("span", {
|
|
17921
|
+
className: cx$1(cssClasses.count)
|
|
17922
|
+
}, formatNumber(count)));
|
|
17923
|
+
},
|
|
17924
|
+
showMoreText: function showMoreText(_ref2) {
|
|
17925
|
+
var isShowingMore = _ref2.isShowingMore;
|
|
17926
|
+
return isShowingMore ? 'Show less' : 'Show more';
|
|
17927
|
+
}
|
|
17571
17928
|
};
|
|
17572
17929
|
|
|
17573
17930
|
var withUsage$z = createDocumentationMessageGenerator({
|
|
@@ -17599,7 +17956,7 @@
|
|
|
17599
17956
|
return;
|
|
17600
17957
|
}
|
|
17601
17958
|
|
|
17602
|
-
|
|
17959
|
+
P(h(RefinementList$1, {
|
|
17603
17960
|
createURL: createURL,
|
|
17604
17961
|
cssClasses: cssClasses,
|
|
17605
17962
|
facetValues: items,
|
|
@@ -17736,7 +18093,7 @@
|
|
|
17736
18093
|
renderState: {}
|
|
17737
18094
|
});
|
|
17738
18095
|
var makeWidget = connectHierarchicalMenu(specializedRenderer, function () {
|
|
17739
|
-
return
|
|
18096
|
+
return P(null, containerNode);
|
|
17740
18097
|
});
|
|
17741
18098
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
17742
18099
|
attributes: attributes,
|
|
@@ -17757,11 +18114,12 @@
|
|
|
17757
18114
|
var results = _ref.results,
|
|
17758
18115
|
hits = _ref.hits,
|
|
17759
18116
|
bindEvent = _ref.bindEvent,
|
|
18117
|
+
sendEvent = _ref.sendEvent,
|
|
17760
18118
|
cssClasses = _ref.cssClasses,
|
|
17761
18119
|
templateProps = _ref.templateProps;
|
|
17762
18120
|
|
|
17763
18121
|
if (results.hits.length === 0) {
|
|
17764
|
-
return
|
|
18122
|
+
return h(Template, _extends({}, templateProps, {
|
|
17765
18123
|
templateKey: "empty",
|
|
17766
18124
|
rootProps: {
|
|
17767
18125
|
className: classnames(cssClasses.root, cssClasses.emptyRoot)
|
|
@@ -17770,12 +18128,12 @@
|
|
|
17770
18128
|
}));
|
|
17771
18129
|
}
|
|
17772
18130
|
|
|
17773
|
-
return
|
|
18131
|
+
return h("div", {
|
|
17774
18132
|
className: cssClasses.root
|
|
17775
|
-
},
|
|
18133
|
+
}, h("ol", {
|
|
17776
18134
|
className: cssClasses.list
|
|
17777
18135
|
}, hits.map(function (hit, index) {
|
|
17778
|
-
return
|
|
18136
|
+
return h(Template, _extends({}, templateProps, {
|
|
17779
18137
|
templateKey: "item",
|
|
17780
18138
|
rootTagName: "li",
|
|
17781
18139
|
rootProps: {
|
|
@@ -17785,13 +18143,16 @@
|
|
|
17785
18143
|
data: _objectSpread2(_objectSpread2({}, hit), {}, {
|
|
17786
18144
|
__hitIndex: index
|
|
17787
18145
|
}),
|
|
17788
|
-
bindEvent: bindEvent
|
|
18146
|
+
bindEvent: bindEvent,
|
|
18147
|
+
sendEvent: sendEvent
|
|
17789
18148
|
}));
|
|
17790
18149
|
})));
|
|
17791
18150
|
};
|
|
17792
18151
|
|
|
17793
18152
|
var defaultTemplates$5 = {
|
|
17794
|
-
empty:
|
|
18153
|
+
empty: function empty() {
|
|
18154
|
+
return 'No results';
|
|
18155
|
+
},
|
|
17795
18156
|
item: function item(data) {
|
|
17796
18157
|
return JSON.stringify(data, null, 2);
|
|
17797
18158
|
}
|
|
@@ -17824,7 +18185,7 @@
|
|
|
17824
18185
|
return;
|
|
17825
18186
|
}
|
|
17826
18187
|
|
|
17827
|
-
|
|
18188
|
+
P(h(HitsWithInsightsListener, {
|
|
17828
18189
|
cssClasses: cssClasses,
|
|
17829
18190
|
hits: receivedHits,
|
|
17830
18191
|
results: results,
|
|
@@ -17872,7 +18233,7 @@
|
|
|
17872
18233
|
templates: templates
|
|
17873
18234
|
});
|
|
17874
18235
|
var makeWidget = withInsights(connectHits)(specializedRenderer, function () {
|
|
17875
|
-
return
|
|
18236
|
+
return P(null, containerNode);
|
|
17876
18237
|
});
|
|
17877
18238
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
17878
18239
|
escapeHTML: escapeHTML,
|
|
@@ -17889,14 +18250,14 @@
|
|
|
17889
18250
|
options = _ref.options,
|
|
17890
18251
|
cssClasses = _ref.cssClasses,
|
|
17891
18252
|
setValue = _ref.setValue;
|
|
17892
|
-
return
|
|
18253
|
+
return h("select", {
|
|
17893
18254
|
className: classnames(cssClasses.select),
|
|
17894
18255
|
onChange: function onChange(event) {
|
|
17895
18256
|
return setValue(event.target.value);
|
|
17896
18257
|
},
|
|
17897
18258
|
value: "".concat(currentValue)
|
|
17898
18259
|
}, options.map(function (option) {
|
|
17899
|
-
return
|
|
18260
|
+
return h("option", {
|
|
17900
18261
|
className: classnames(cssClasses.option),
|
|
17901
18262
|
key: option.label + option.value,
|
|
17902
18263
|
value: "".concat(option.value)
|
|
@@ -17923,9 +18284,9 @@
|
|
|
17923
18284
|
}) || {},
|
|
17924
18285
|
currentValue = _ref3.value;
|
|
17925
18286
|
|
|
17926
|
-
|
|
18287
|
+
P(h("div", {
|
|
17927
18288
|
className: cssClasses.root
|
|
17928
|
-
},
|
|
18289
|
+
}, h(Selector, {
|
|
17929
18290
|
cssClasses: cssClasses,
|
|
17930
18291
|
currentValue: currentValue,
|
|
17931
18292
|
options: items,
|
|
@@ -17961,7 +18322,7 @@
|
|
|
17961
18322
|
cssClasses: cssClasses
|
|
17962
18323
|
});
|
|
17963
18324
|
var makeWidget = connectHitsPerPage(specializedRenderer, function () {
|
|
17964
|
-
return
|
|
18325
|
+
return P(null, containerNode);
|
|
17965
18326
|
});
|
|
17966
18327
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
17967
18328
|
items: items,
|
|
@@ -17975,6 +18336,7 @@
|
|
|
17975
18336
|
var results = _ref.results,
|
|
17976
18337
|
hits = _ref.hits,
|
|
17977
18338
|
bindEvent = _ref.bindEvent,
|
|
18339
|
+
sendEvent = _ref.sendEvent,
|
|
17978
18340
|
hasShowPrevious = _ref.hasShowPrevious,
|
|
17979
18341
|
showPrevious = _ref.showPrevious,
|
|
17980
18342
|
showMore = _ref.showMore,
|
|
@@ -17984,7 +18346,7 @@
|
|
|
17984
18346
|
templateProps = _ref.templateProps;
|
|
17985
18347
|
|
|
17986
18348
|
if (results.hits.length === 0) {
|
|
17987
|
-
return
|
|
18349
|
+
return h(Template, _extends({}, templateProps, {
|
|
17988
18350
|
templateKey: "empty",
|
|
17989
18351
|
rootProps: {
|
|
17990
18352
|
className: classnames(cssClasses.root, cssClasses.emptyRoot)
|
|
@@ -17993,9 +18355,9 @@
|
|
|
17993
18355
|
}));
|
|
17994
18356
|
}
|
|
17995
18357
|
|
|
17996
|
-
return
|
|
18358
|
+
return h("div", {
|
|
17997
18359
|
className: cssClasses.root
|
|
17998
|
-
}, hasShowPrevious &&
|
|
18360
|
+
}, hasShowPrevious && h(Template, _extends({}, templateProps, {
|
|
17999
18361
|
templateKey: "showPreviousText",
|
|
18000
18362
|
rootTagName: "button",
|
|
18001
18363
|
rootProps: {
|
|
@@ -18003,10 +18365,10 @@
|
|
|
18003
18365
|
disabled: isFirstPage,
|
|
18004
18366
|
onClick: showPrevious
|
|
18005
18367
|
}
|
|
18006
|
-
})),
|
|
18368
|
+
})), h("ol", {
|
|
18007
18369
|
className: cssClasses.list
|
|
18008
18370
|
}, hits.map(function (hit, position) {
|
|
18009
|
-
return
|
|
18371
|
+
return h(Template, _extends({}, templateProps, {
|
|
18010
18372
|
templateKey: "item",
|
|
18011
18373
|
rootTagName: "li",
|
|
18012
18374
|
rootProps: {
|
|
@@ -18016,9 +18378,10 @@
|
|
|
18016
18378
|
data: _objectSpread2(_objectSpread2({}, hit), {}, {
|
|
18017
18379
|
__hitIndex: position
|
|
18018
18380
|
}),
|
|
18019
|
-
bindEvent: bindEvent
|
|
18381
|
+
bindEvent: bindEvent,
|
|
18382
|
+
sendEvent: sendEvent
|
|
18020
18383
|
}));
|
|
18021
|
-
})),
|
|
18384
|
+
})), h(Template, _extends({}, templateProps, {
|
|
18022
18385
|
templateKey: "showMoreText",
|
|
18023
18386
|
rootTagName: "button",
|
|
18024
18387
|
rootProps: {
|
|
@@ -18030,9 +18393,15 @@
|
|
|
18030
18393
|
};
|
|
18031
18394
|
|
|
18032
18395
|
var defaultTemplates$6 = {
|
|
18033
|
-
empty:
|
|
18034
|
-
|
|
18035
|
-
|
|
18396
|
+
empty: function empty() {
|
|
18397
|
+
return 'No results';
|
|
18398
|
+
},
|
|
18399
|
+
showPreviousText: function showPreviousText() {
|
|
18400
|
+
return 'Show previous results';
|
|
18401
|
+
},
|
|
18402
|
+
showMoreText: function showMoreText() {
|
|
18403
|
+
return 'Show more results';
|
|
18404
|
+
},
|
|
18036
18405
|
item: function item(data) {
|
|
18037
18406
|
return JSON.stringify(data, null, 2);
|
|
18038
18407
|
}
|
|
@@ -18070,7 +18439,7 @@
|
|
|
18070
18439
|
return;
|
|
18071
18440
|
}
|
|
18072
18441
|
|
|
18073
|
-
|
|
18442
|
+
P(h(InfiniteHitsWithInsightsListener, {
|
|
18074
18443
|
cssClasses: cssClasses,
|
|
18075
18444
|
hits: hits,
|
|
18076
18445
|
results: results,
|
|
@@ -18140,7 +18509,7 @@
|
|
|
18140
18509
|
renderState: {}
|
|
18141
18510
|
});
|
|
18142
18511
|
var makeWidget = withInsights(connectInfiniteHits)(specializedRenderer, function () {
|
|
18143
|
-
return
|
|
18512
|
+
return P(null, containerNode);
|
|
18144
18513
|
});
|
|
18145
18514
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18146
18515
|
escapeHTML: escapeHTML,
|
|
@@ -18152,9 +18521,26 @@
|
|
|
18152
18521
|
});
|
|
18153
18522
|
};
|
|
18154
18523
|
|
|
18524
|
+
/** @jsx h */
|
|
18155
18525
|
var defaultTemplates$7 = {
|
|
18156
|
-
item:
|
|
18157
|
-
|
|
18526
|
+
item: function item(_ref) {
|
|
18527
|
+
var cssClasses = _ref.cssClasses,
|
|
18528
|
+
url = _ref.url,
|
|
18529
|
+
label = _ref.label,
|
|
18530
|
+
count = _ref.count;
|
|
18531
|
+
return h("a", {
|
|
18532
|
+
className: cx$1(cssClasses.link),
|
|
18533
|
+
href: url
|
|
18534
|
+
}, h("span", {
|
|
18535
|
+
className: cx$1(cssClasses.label)
|
|
18536
|
+
}, label), h("span", {
|
|
18537
|
+
className: cx$1(cssClasses.count)
|
|
18538
|
+
}, formatNumber(count)));
|
|
18539
|
+
},
|
|
18540
|
+
showMoreText: function showMoreText(_ref2) {
|
|
18541
|
+
var isShowingMore = _ref2.isShowingMore;
|
|
18542
|
+
return isShowingMore ? 'Show less' : 'Show more';
|
|
18543
|
+
}
|
|
18158
18544
|
};
|
|
18159
18545
|
|
|
18160
18546
|
var withUsage$D = createDocumentationMessageGenerator({
|
|
@@ -18191,7 +18577,7 @@
|
|
|
18191
18577
|
url: createURL(facetValue.value)
|
|
18192
18578
|
});
|
|
18193
18579
|
});
|
|
18194
|
-
|
|
18580
|
+
P(h(RefinementList$1, {
|
|
18195
18581
|
createURL: createURL,
|
|
18196
18582
|
cssClasses: cssClasses,
|
|
18197
18583
|
facetValues: facetValues,
|
|
@@ -18264,7 +18650,7 @@
|
|
|
18264
18650
|
showMore: showMore
|
|
18265
18651
|
});
|
|
18266
18652
|
var makeWidget = connectMenu(specializedRenderer, function () {
|
|
18267
|
-
return
|
|
18653
|
+
return P(null, containerNode);
|
|
18268
18654
|
});
|
|
18269
18655
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18270
18656
|
attribute: attribute,
|
|
@@ -18291,15 +18677,15 @@
|
|
|
18291
18677
|
},
|
|
18292
18678
|
selectedValue = _ref2.value;
|
|
18293
18679
|
|
|
18294
|
-
return
|
|
18680
|
+
return h("div", {
|
|
18295
18681
|
className: classnames(cssClasses.root, _defineProperty({}, cssClasses.noRefinementRoot, items.length === 0))
|
|
18296
|
-
},
|
|
18682
|
+
}, h("select", {
|
|
18297
18683
|
className: cssClasses.select,
|
|
18298
18684
|
value: selectedValue,
|
|
18299
18685
|
onChange: function onChange(event) {
|
|
18300
18686
|
refine(event.target.value);
|
|
18301
18687
|
}
|
|
18302
|
-
},
|
|
18688
|
+
}, h(Template, _extends({}, templateProps, {
|
|
18303
18689
|
templateKey: "defaultOption",
|
|
18304
18690
|
rootTagName: "option",
|
|
18305
18691
|
rootProps: {
|
|
@@ -18307,7 +18693,7 @@
|
|
|
18307
18693
|
className: cssClasses.option
|
|
18308
18694
|
}
|
|
18309
18695
|
})), items.map(function (item) {
|
|
18310
|
-
return
|
|
18696
|
+
return h(Template, _extends({}, templateProps, {
|
|
18311
18697
|
templateKey: "item",
|
|
18312
18698
|
rootTagName: "option",
|
|
18313
18699
|
rootProps: {
|
|
@@ -18321,8 +18707,14 @@
|
|
|
18321
18707
|
}
|
|
18322
18708
|
|
|
18323
18709
|
var defaultTemplates$8 = {
|
|
18324
|
-
item:
|
|
18325
|
-
|
|
18710
|
+
item: function item(_ref) {
|
|
18711
|
+
var label = _ref.label,
|
|
18712
|
+
count = _ref.count;
|
|
18713
|
+
return "".concat(label, " (").concat(formatNumber(count), ")");
|
|
18714
|
+
},
|
|
18715
|
+
defaultOption: function defaultOption() {
|
|
18716
|
+
return 'See all';
|
|
18717
|
+
}
|
|
18326
18718
|
};
|
|
18327
18719
|
|
|
18328
18720
|
var withUsage$E = createDocumentationMessageGenerator({
|
|
@@ -18349,7 +18741,7 @@
|
|
|
18349
18741
|
return;
|
|
18350
18742
|
}
|
|
18351
18743
|
|
|
18352
|
-
|
|
18744
|
+
P(h(MenuSelect, {
|
|
18353
18745
|
cssClasses: cssClasses,
|
|
18354
18746
|
items: items,
|
|
18355
18747
|
refine: refine,
|
|
@@ -18396,7 +18788,7 @@
|
|
|
18396
18788
|
templates: templates
|
|
18397
18789
|
});
|
|
18398
18790
|
var makeWidget = connectMenu(specializedRenderer, function () {
|
|
18399
|
-
return
|
|
18791
|
+
return P(null, containerNode);
|
|
18400
18792
|
});
|
|
18401
18793
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18402
18794
|
attribute: attribute,
|
|
@@ -18408,8 +18800,24 @@
|
|
|
18408
18800
|
});
|
|
18409
18801
|
};
|
|
18410
18802
|
|
|
18803
|
+
/** @jsx h */
|
|
18411
18804
|
var defaultTemplates$9 = {
|
|
18412
|
-
item:
|
|
18805
|
+
item: function item(_ref) {
|
|
18806
|
+
var cssClasses = _ref.cssClasses,
|
|
18807
|
+
attribute = _ref.attribute,
|
|
18808
|
+
label = _ref.label,
|
|
18809
|
+
isRefined = _ref.isRefined;
|
|
18810
|
+
return h("label", {
|
|
18811
|
+
className: cssClasses.label
|
|
18812
|
+
}, h("input", {
|
|
18813
|
+
type: "radio",
|
|
18814
|
+
className: cssClasses.radio,
|
|
18815
|
+
name: attribute,
|
|
18816
|
+
defaultChecked: isRefined
|
|
18817
|
+
}), h("span", {
|
|
18818
|
+
className: cssClasses.labelText
|
|
18819
|
+
}, label));
|
|
18820
|
+
}
|
|
18413
18821
|
};
|
|
18414
18822
|
|
|
18415
18823
|
var withUsage$F = createDocumentationMessageGenerator({
|
|
@@ -18438,7 +18846,7 @@
|
|
|
18438
18846
|
return;
|
|
18439
18847
|
}
|
|
18440
18848
|
|
|
18441
|
-
|
|
18849
|
+
P(h(RefinementList$1, {
|
|
18442
18850
|
createURL: createURL,
|
|
18443
18851
|
cssClasses: cssClasses,
|
|
18444
18852
|
facetValues: items,
|
|
@@ -18498,7 +18906,7 @@
|
|
|
18498
18906
|
templates: templates
|
|
18499
18907
|
});
|
|
18500
18908
|
var makeWidget = connectNumericMenu(specializedRenderer, function () {
|
|
18501
|
-
return
|
|
18909
|
+
return P(null, containerNode);
|
|
18502
18910
|
});
|
|
18503
18911
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18504
18912
|
attribute: attribute,
|
|
@@ -18523,11 +18931,11 @@
|
|
|
18523
18931
|
};
|
|
18524
18932
|
}
|
|
18525
18933
|
|
|
18526
|
-
return
|
|
18934
|
+
return h("div", {
|
|
18527
18935
|
className: classnames(props.cssClasses.root, _defineProperty({}, props.cssClasses.noRefinementRoot, props.nbPages <= 1))
|
|
18528
|
-
},
|
|
18936
|
+
}, h("ul", {
|
|
18529
18937
|
className: props.cssClasses.list
|
|
18530
|
-
}, props.showFirst &&
|
|
18938
|
+
}, props.showFirst && h(PaginationLink, {
|
|
18531
18939
|
ariaLabel: "First",
|
|
18532
18940
|
className: props.cssClasses.firstPageItem,
|
|
18533
18941
|
isDisabled: props.isFirstPage,
|
|
@@ -18536,7 +18944,7 @@
|
|
|
18536
18944
|
createURL: props.createURL,
|
|
18537
18945
|
cssClasses: props.cssClasses,
|
|
18538
18946
|
createClickHandler: createClickHandler
|
|
18539
|
-
}), props.showPrevious &&
|
|
18947
|
+
}), props.showPrevious && h(PaginationLink, {
|
|
18540
18948
|
ariaLabel: "Previous",
|
|
18541
18949
|
className: props.cssClasses.previousPageItem,
|
|
18542
18950
|
isDisabled: props.isFirstPage,
|
|
@@ -18546,7 +18954,7 @@
|
|
|
18546
18954
|
cssClasses: props.cssClasses,
|
|
18547
18955
|
createClickHandler: createClickHandler
|
|
18548
18956
|
}), props.pages.map(function (pageNumber) {
|
|
18549
|
-
return
|
|
18957
|
+
return h(PaginationLink, {
|
|
18550
18958
|
key: pageNumber,
|
|
18551
18959
|
ariaLabel: "".concat(pageNumber + 1),
|
|
18552
18960
|
className: props.cssClasses.pageItem,
|
|
@@ -18557,7 +18965,7 @@
|
|
|
18557
18965
|
cssClasses: props.cssClasses,
|
|
18558
18966
|
createClickHandler: createClickHandler
|
|
18559
18967
|
});
|
|
18560
|
-
}), props.showNext &&
|
|
18968
|
+
}), props.showNext && h(PaginationLink, {
|
|
18561
18969
|
ariaLabel: "Next",
|
|
18562
18970
|
className: props.cssClasses.nextPageItem,
|
|
18563
18971
|
isDisabled: props.isLastPage,
|
|
@@ -18566,7 +18974,7 @@
|
|
|
18566
18974
|
createURL: props.createURL,
|
|
18567
18975
|
cssClasses: props.cssClasses,
|
|
18568
18976
|
createClickHandler: createClickHandler
|
|
18569
|
-
}), props.showLast &&
|
|
18977
|
+
}), props.showLast && h(PaginationLink, {
|
|
18570
18978
|
ariaLabel: "Last",
|
|
18571
18979
|
className: props.cssClasses.lastPageItem,
|
|
18572
18980
|
isDisabled: props.isLastPage,
|
|
@@ -18590,14 +18998,14 @@
|
|
|
18590
18998
|
cssClasses = _ref.cssClasses,
|
|
18591
18999
|
createURL = _ref.createURL,
|
|
18592
19000
|
createClickHandler = _ref.createClickHandler;
|
|
18593
|
-
return
|
|
19001
|
+
return h("li", {
|
|
18594
19002
|
className: classnames(cssClasses.item, className, isDisabled && cssClasses.disabledItem, isSelected && cssClasses.selectedItem)
|
|
18595
|
-
}, isDisabled ?
|
|
19003
|
+
}, isDisabled ? h("span", {
|
|
18596
19004
|
className: cssClasses.link,
|
|
18597
19005
|
dangerouslySetInnerHTML: {
|
|
18598
19006
|
__html: label
|
|
18599
19007
|
}
|
|
18600
|
-
}) :
|
|
19008
|
+
}) : h("a", {
|
|
18601
19009
|
className: cssClasses.link,
|
|
18602
19010
|
"aria-label": ariaLabel,
|
|
18603
19011
|
href: createURL(pageNumber),
|
|
@@ -18646,7 +19054,7 @@
|
|
|
18646
19054
|
}
|
|
18647
19055
|
};
|
|
18648
19056
|
|
|
18649
|
-
|
|
19057
|
+
P(h(Pagination, {
|
|
18650
19058
|
createURL: createURL,
|
|
18651
19059
|
cssClasses: cssClasses,
|
|
18652
19060
|
currentPage: currentRefinement,
|
|
@@ -18748,7 +19156,7 @@
|
|
|
18748
19156
|
scrollToNode: scrollToNode
|
|
18749
19157
|
});
|
|
18750
19158
|
var makeWidget = connectPagination(specializedRenderer, function () {
|
|
18751
|
-
return
|
|
19159
|
+
return P(null, containerNode);
|
|
18752
19160
|
});
|
|
18753
19161
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18754
19162
|
totalPages: totalPages,
|
|
@@ -18758,23 +19166,23 @@
|
|
|
18758
19166
|
});
|
|
18759
19167
|
};
|
|
18760
19168
|
|
|
18761
|
-
var t$
|
|
19169
|
+
var t$2,r$1,u$1,i,o$1=0,c$1=[],f$1=[],e$2=l.__b,a$1=l.__r,v$1=l.diffed,l$1=l.__c,m$2=l.unmount;function d$1(t,u){l.__h&&l.__h(r$1,t,o$1||u),o$1=0;var i=r$1.__H||(r$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:f$1}),i.__[t]}function p$1(n){return o$1=1,y$1(z$1,n)}function y$1(n,u,i){var o=d$1(t$2++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):z$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$1,!r$1.u)){r$1.u=!0;var c=r$1.shouldComponentUpdate;r$1.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});return u.every(function(n){return !n.__N})?!c||c.call(this,n,t,r):!u.every(function(n){if(!n.__N)return !0;var t=n.__[0];return n.__=n.__N,n.__N=void 0,t===n.__[0]})&&(!c||c.call(this,n,t,r))};}return o.__N||o.__}function h$1(u,i){var o=d$1(t$2++,3);!l.__s&&w$1(o.__H,i)&&(o.__=u,o.i=i,r$1.__H.__h.push(o));}function _$1(n){return o$1=5,F(function(){return {current:n}},[])}function F(n,r){var u=d$1(t$2++,7);return w$1(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function b$1(){for(var t;t=c$1.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(j$1),t.__H.__h.forEach(k$1),t.__H.__h=[];}catch(r){t.__H.__h=[],l.__e(r,t.__v);}}l.__b=function(n){r$1=null,e$2&&e$2(n);},l.__r=function(n){a$1&&a$1(n),t$2=0;var i=(r$1=n.__c).__H;i&&(u$1===r$1?(i.__h=[],r$1.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=f$1,n.__N=n.i=void 0;})):(i.__h.forEach(j$1),i.__h.forEach(k$1),i.__h=[])),u$1=r$1;},l.diffed=function(t){v$1&&v$1(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==c$1.push(o)&&i===l.requestAnimationFrame||((i=l.requestAnimationFrame)||function(n){var t,r=function(){clearTimeout(u),g$1&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$1&&(t=requestAnimationFrame(r));})(b$1)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==f$1&&(n.__=n.__V),n.i=void 0,n.__V=f$1;})),u$1=r$1=null;},l.__c=function(t,r){r.some(function(t){try{t.__h.forEach(j$1),t.__h=t.__h.filter(function(n){return !n.__||k$1(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l.__e(u,t.__v);}}),l$1&&l$1(t,r);},l.unmount=function(t){m$2&&m$2(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{j$1(n);}catch(n){r=n;}}),r&&l.__e(r,u.__v));};var g$1="function"==typeof requestAnimationFrame;function j$1(n){var t=r$1,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$1=t;}function k$1(n){var t=r$1;n.__c=n.__(),r$1=t;}function w$1(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function z$1(n,t){return "function"==typeof t?t(n):t}
|
|
18762
19170
|
|
|
18763
19171
|
function Panel(props) {
|
|
18764
19172
|
var _cx;
|
|
18765
19173
|
|
|
18766
|
-
var _useState =
|
|
19174
|
+
var _useState = p$1(props.isCollapsed),
|
|
18767
19175
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18768
19176
|
isCollapsed = _useState2[0],
|
|
18769
19177
|
setIsCollapsed = _useState2[1];
|
|
18770
19178
|
|
|
18771
|
-
var _useState3 =
|
|
19179
|
+
var _useState3 = p$1(false),
|
|
18772
19180
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
18773
19181
|
isControlled = _useState4[0],
|
|
18774
19182
|
setIsControlled = _useState4[1];
|
|
18775
19183
|
|
|
18776
|
-
var bodyRef =
|
|
18777
|
-
|
|
19184
|
+
var bodyRef = _$1(null);
|
|
19185
|
+
h$1(function () {
|
|
18778
19186
|
var node = bodyRef.current;
|
|
18779
19187
|
|
|
18780
19188
|
if (!node) {
|
|
@@ -18791,17 +19199,17 @@
|
|
|
18791
19199
|
setIsCollapsed(props.isCollapsed);
|
|
18792
19200
|
}
|
|
18793
19201
|
|
|
18794
|
-
return
|
|
19202
|
+
return h("div", {
|
|
18795
19203
|
className: classnames(props.cssClasses.root, (_cx = {}, _defineProperty(_cx, props.cssClasses.noRefinementRoot, props.hidden), _defineProperty(_cx, props.cssClasses.collapsibleRoot, props.collapsible), _defineProperty(_cx, props.cssClasses.collapsedRoot, isCollapsed), _cx)),
|
|
18796
19204
|
hidden: props.hidden
|
|
18797
|
-
}, props.templates.header &&
|
|
19205
|
+
}, props.templates.header && h("div", {
|
|
18798
19206
|
className: props.cssClasses.header
|
|
18799
|
-
},
|
|
19207
|
+
}, h(Template, {
|
|
18800
19208
|
templates: props.templates,
|
|
18801
19209
|
templateKey: "header",
|
|
18802
19210
|
rootTagName: "span",
|
|
18803
19211
|
data: props.data
|
|
18804
|
-
}), props.collapsible &&
|
|
19212
|
+
}), props.collapsible && h("button", {
|
|
18805
19213
|
className: props.cssClasses.collapseButton,
|
|
18806
19214
|
"aria-expanded": !isCollapsed,
|
|
18807
19215
|
onClick: function onClick(event) {
|
|
@@ -18811,17 +19219,17 @@
|
|
|
18811
19219
|
return !prevIsCollapsed;
|
|
18812
19220
|
});
|
|
18813
19221
|
}
|
|
18814
|
-
},
|
|
19222
|
+
}, h(Template, {
|
|
18815
19223
|
templates: props.templates,
|
|
18816
19224
|
templateKey: "collapseButtonText",
|
|
18817
19225
|
rootTagName: "span",
|
|
18818
19226
|
data: {
|
|
18819
19227
|
collapsed: isCollapsed
|
|
18820
19228
|
}
|
|
18821
|
-
}))),
|
|
19229
|
+
}))), h("div", {
|
|
18822
19230
|
className: props.cssClasses.body,
|
|
18823
19231
|
ref: bodyRef
|
|
18824
|
-
}), props.templates.footer &&
|
|
19232
|
+
}), props.templates.footer && h(Template, {
|
|
18825
19233
|
templates: props.templates,
|
|
18826
19234
|
templateKey: "footer",
|
|
18827
19235
|
rootProps: {
|
|
@@ -18846,7 +19254,7 @@
|
|
|
18846
19254
|
hidden = _ref2.hidden,
|
|
18847
19255
|
collapsible = _ref2.collapsible,
|
|
18848
19256
|
collapsed = _ref2.collapsed;
|
|
18849
|
-
|
|
19257
|
+
P(h(Panel, {
|
|
18850
19258
|
cssClasses: cssClasses,
|
|
18851
19259
|
hidden: hidden,
|
|
18852
19260
|
collapsible: collapsible,
|
|
@@ -18982,7 +19390,7 @@
|
|
|
18982
19390
|
}
|
|
18983
19391
|
},
|
|
18984
19392
|
dispose: function dispose() {
|
|
18985
|
-
|
|
19393
|
+
P(null, containerNode);
|
|
18986
19394
|
|
|
18987
19395
|
if (typeof widget.dispose === 'function') {
|
|
18988
19396
|
var _widget$dispose;
|
|
@@ -19106,12 +19514,12 @@
|
|
|
19106
19514
|
|
|
19107
19515
|
/** @jsx h */
|
|
19108
19516
|
|
|
19109
|
-
var _ref2 =
|
|
19517
|
+
var _ref2 = h("path", {
|
|
19110
19518
|
fill: "#5468FF",
|
|
19111
19519
|
d: "M78.99.94h16.6a2.97 2.97 0 012.96 2.96v16.6a2.97 2.97 0 01-2.97 2.96h-16.6a2.97 2.97 0 01-2.96-2.96V3.9A2.96 2.96 0 0179 .94"
|
|
19112
19520
|
});
|
|
19113
19521
|
|
|
19114
|
-
var _ref3 =
|
|
19522
|
+
var _ref3 = h("path", {
|
|
19115
19523
|
fill: "#FFF",
|
|
19116
19524
|
d: "M89.63 5.97v-.78a.98.98 0 00-.98-.97h-2.28a.98.98 0 00-.97.97V6c0 .09.08.15.17.13a7.13 7.13 0 013.9-.02c.08.02.16-.04.16-.13m-6.25 1L83 6.6a.98.98 0 00-1.38 0l-.46.46a.97.97 0 000 1.38l.38.39c.06.06.15.04.2-.02a7.49 7.49 0 011.63-1.62c.07-.04.08-.14.02-.2m4.16 2.45v3.34c0 .1.1.17.2.12l2.97-1.54c.06-.03.08-.12.05-.18a3.7 3.7 0 00-3.08-1.87c-.07 0-.14.06-.14.13m0 8.05a4.49 4.49 0 110-8.98 4.49 4.49 0 010 8.98m0-10.85a6.37 6.37 0 100 12.74 6.37 6.37 0 000-12.74"
|
|
19117
19525
|
});
|
|
@@ -19120,15 +19528,15 @@
|
|
|
19120
19528
|
var url = _ref.url,
|
|
19121
19529
|
theme = _ref.theme,
|
|
19122
19530
|
cssClasses = _ref.cssClasses;
|
|
19123
|
-
return
|
|
19531
|
+
return h("div", {
|
|
19124
19532
|
className: cssClasses.root
|
|
19125
|
-
},
|
|
19533
|
+
}, h("a", {
|
|
19126
19534
|
href: url,
|
|
19127
19535
|
target: "_blank",
|
|
19128
19536
|
className: cssClasses.link,
|
|
19129
19537
|
"aria-label": "Search by Algolia",
|
|
19130
19538
|
rel: "noopener noreferrer"
|
|
19131
|
-
},
|
|
19539
|
+
}, h("svg", {
|
|
19132
19540
|
height: "1.2em",
|
|
19133
19541
|
className: cssClasses.logo,
|
|
19134
19542
|
viewBox: "0 0 168 24" // This style is necessary as long as it's not included in InstantSearch.css.
|
|
@@ -19137,10 +19545,10 @@
|
|
|
19137
19545
|
style: {
|
|
19138
19546
|
width: 'auto'
|
|
19139
19547
|
}
|
|
19140
|
-
},
|
|
19548
|
+
}, h("path", {
|
|
19141
19549
|
fill: theme === 'dark' ? '#FFF' : '#5D6494',
|
|
19142
19550
|
d: "M6.97 6.68V8.3a4.47 4.47 0 00-2.42-.67 2.2 2.2 0 00-1.38.4c-.34.26-.5.6-.5 1.02 0 .43.16.77.49 1.03.33.25.83.53 1.51.83a7.04 7.04 0 011.9 1.08c.34.24.58.54.73.89.15.34.23.74.23 1.18 0 .95-.33 1.7-1 2.24a4 4 0 01-2.6.81 5.71 5.71 0 01-2.94-.68v-1.71c.84.63 1.81.94 2.92.94.58 0 1.05-.14 1.39-.4.34-.28.5-.65.5-1.13 0-.29-.1-.55-.3-.8a2.2 2.2 0 00-.65-.53 23.03 23.03 0 00-1.64-.78 13.67 13.67 0 01-1.11-.64c-.12-.1-.28-.22-.46-.4a1.72 1.72 0 01-.39-.5 4.46 4.46 0 01-.22-.6c-.07-.23-.1-.48-.1-.75 0-.91.33-1.63 1-2.17a4 4 0 012.57-.8c.97 0 1.8.18 2.47.52zm7.47 5.7v-.3a2.26 2.26 0 00-.5-1.44c-.3-.35-.74-.53-1.32-.53-.53 0-.99.2-1.37.58a2.9 2.9 0 00-.72 1.68h3.91zm1 2.79v1.4c-.6.34-1.38.51-2.36.51a4.02 4.02 0 01-3-1.13 4.04 4.04 0 01-1.11-2.97c0-1.3.34-2.32 1.02-3.06a3.38 3.38 0 012.6-1.1c1.03 0 1.85.32 2.46.96.6.64.9 1.57.9 2.78 0 .33-.03.68-.09 1.04h-5.31c.1.7.4 1.24.89 1.61.49.38 1.1.56 1.85.56.86 0 1.58-.2 2.15-.6zm6.61-1.78h-1.21c-.6 0-1.05.12-1.35.36-.3.23-.46.53-.46.89 0 .37.12.66.36.88.23.2.57.32 1.02.32.5 0 .9-.15 1.2-.43.3-.28.44-.65.44-1.1v-.92zm-4.07-2.55V9.33a4.96 4.96 0 012.5-.55c2.1 0 3.17 1.03 3.17 3.08V17H22.1v-.96c-.42.68-1.15 1.02-2.19 1.02-.76 0-1.38-.22-1.84-.66-.46-.44-.7-1-.7-1.68 0-.78.3-1.38.88-1.81.59-.43 1.4-.65 2.46-.65h1.34v-.46c0-.55-.13-.97-.4-1.25-.26-.29-.7-.43-1.32-.43-.86 0-1.65.24-2.35.72zm9.34-1.93v1.42c.39-1 1.1-1.5 2.12-1.5.15 0 .31.02.5.05v1.53c-.23-.1-.48-.14-.76-.14-.54 0-.99.24-1.34.71a2.8 2.8 0 00-.52 1.71V17h-1.57V8.91h1.57zm5 4.09a3 3 0 00.76 2.01c.47.53 1.14.8 2 .8.64 0 1.24-.18 1.8-.53v1.4c-.53.32-1.2.48-2 .48a3.98 3.98 0 01-4.17-4.18c0-1.16.38-2.15 1.14-2.98a4 4 0 013.1-1.23c.7 0 1.34.15 1.92.44v1.44a3.24 3.24 0 00-1.77-.5A2.65 2.65 0 0032.33 13zm7.92-7.28v4.58c.46-1 1.3-1.5 2.5-1.5.8 0 1.42.24 1.9.73.48.5.72 1.17.72 2.05V17H43.8v-5.1c0-.56-.14-.99-.43-1.29-.28-.3-.65-.45-1.1-.45-.54 0-1 .2-1.42.6-.4.4-.61 1.02-.61 1.85V17h-1.56V5.72h1.56zM55.2 15.74c.6 0 1.1-.25 1.5-.76.4-.5.6-1.16.6-1.95 0-.92-.2-1.62-.6-2.12-.4-.5-.92-.74-1.55-.74-.56 0-1.05.22-1.5.67-.44.45-.66 1.13-.66 2.06 0 .96.22 1.67.64 2.14.43.47.95.7 1.57.7zM53 5.72v4.42a2.74 2.74 0 012.43-1.34c1.03 0 1.86.38 2.51 1.15.65.76.97 1.78.97 3.05 0 1.13-.3 2.1-.92 2.9-.62.81-1.47 1.21-2.54 1.21s-1.9-.45-2.46-1.34V17h-1.58V5.72H53zm9.9 11.1l-3.22-7.9h1.74l1 2.62 1.26 3.42c.1-.32.48-1.46 1.15-3.42l.91-2.63h1.66l-2.92 7.87c-.78 2.07-1.96 3.1-3.56 3.1-.28 0-.53-.02-.73-.07v-1.34c.17.04.35.06.54.06 1.03 0 1.76-.57 2.17-1.7z"
|
|
19143
|
-
}), _ref2, _ref3,
|
|
19551
|
+
}), _ref2, _ref3, h("path", {
|
|
19144
19552
|
fill: theme === 'dark' ? '#FFF' : '#5468FF',
|
|
19145
19553
|
d: "M120.92 18.8c-4.38.02-4.38-3.54-4.38-4.1V1.36l2.67-.42v13.25c0 .32 0 2.36 1.71 2.37v2.24zm-10.84-2.18c.82 0 1.43-.04 1.85-.12v-2.72a5.48 5.48 0 00-1.57-.2c-.3 0-.6.02-.9.07-.3.04-.57.12-.81.24-.24.11-.44.28-.58.49a.93.93 0 00-.22.65c0 .63.22 1 .61 1.23.4.24.94.36 1.62.36zm-.23-9.7c.88 0 1.62.11 2.23.33.6.22 1.09.53 1.44.92.36.4.61.92.76 1.48.16.56.23 1.17.23 1.85v6.87a21.69 21.69 0 01-4.68.5c-.69 0-1.32-.07-1.9-.2a4 4 0 01-1.46-.63 3.3 3.3 0 01-.96-1.13 4.3 4.3 0 01-.34-1.8 3.13 3.13 0 011.43-2.63c.45-.3.95-.5 1.54-.62a8.8 8.8 0 013.79.05v-.44c0-.3-.04-.6-.11-.87a1.78 1.78 0 00-1.1-1.22 3.2 3.2 0 00-1.15-.2 9.75 9.75 0 00-2.95.46l-.33-2.19a11.43 11.43 0 013.56-.53zm52.84 9.63c.82 0 1.43-.05 1.85-.13V13.7a5.42 5.42 0 00-1.57-.2c-.3 0-.6.02-.9.07-.3.04-.57.12-.81.24-.24.12-.44.28-.58.5a.93.93 0 00-.22.65c0 .63.22.99.61 1.23.4.24.94.36 1.62.36zm-.23-9.7c.88 0 1.63.11 2.23.33.6.22 1.1.53 1.45.92.35.39.6.92.76 1.48.15.56.23 1.18.23 1.85v6.88c-.41.08-1.03.19-1.87.31-.83.12-1.77.18-2.81.18-.7 0-1.33-.06-1.9-.2a4 4 0 01-1.47-.63c-.4-.3-.72-.67-.95-1.13a4.3 4.3 0 01-.34-1.8c0-.66.13-1.08.38-1.53.26-.45.61-.82 1.05-1.1.44-.3.95-.5 1.53-.62a8.8 8.8 0 013.8.05v-.43c0-.31-.04-.6-.12-.88-.07-.28-.2-.52-.38-.73a1.78 1.78 0 00-.73-.5c-.3-.1-.68-.2-1.14-.2a9.85 9.85 0 00-2.95.47l-.32-2.19a11.63 11.63 0 013.55-.53zm-8.03-1.27a1.62 1.62 0 000-3.24 1.62 1.62 0 100 3.24zm1.35 13.22h-2.7V7.27l2.7-.42V18.8zm-4.72 0c-4.38.02-4.38-3.54-4.38-4.1l-.01-13.34 2.67-.42v13.25c0 .32 0 2.36 1.72 2.37v2.24zm-8.7-5.9a4.7 4.7 0 00-.74-2.79 2.4 2.4 0 00-2.07-1 2.4 2.4 0 00-2.06 1 4.7 4.7 0 00-.74 2.8c0 1.16.25 1.94.74 2.62a2.4 2.4 0 002.07 1.02c.88 0 1.57-.34 2.07-1.02a4.2 4.2 0 00.73-2.63zm2.74 0a6.46 6.46 0 01-1.52 4.23c-.49.53-1.07.94-1.76 1.22-.68.29-1.73.45-2.26.45a6.6 6.6 0 01-2.25-.45 5.1 5.1 0 01-2.88-3.13 7.3 7.3 0 01-.01-4.84 5.13 5.13 0 012.9-3.1 5.67 5.67 0 012.22-.42c.81 0 1.56.14 2.24.42.69.29 1.28.69 1.75 1.22.49.52.87 1.15 1.14 1.89a7 7 0 01.43 2.5zm-20.14 0c0 1.11.25 2.36.74 2.88.5.52 1.13.78 1.91.78a4.07 4.07 0 002.12-.6V9.33c-.19-.04-.99-.2-1.76-.23a2.67 2.67 0 00-2.23 1 4.73 4.73 0 00-.78 2.8zm7.44 5.27c0 1.82-.46 3.16-1.4 4-.94.85-2.37 1.27-4.3 1.27-.7 0-2.17-.13-3.34-.4l.43-2.11c.98.2 2.27.26 2.95.26 1.08 0 1.84-.22 2.3-.66.46-.43.68-1.08.68-1.94v-.44a5.2 5.2 0 01-2.54.6 5.6 5.6 0 01-2.01-.36 4.2 4.2 0 01-2.58-2.71 9.88 9.88 0 01.02-5.35 4.92 4.92 0 012.93-2.96 6.6 6.6 0 012.43-.46 19.64 19.64 0 014.43.66v10.6z"
|
|
19146
19554
|
}))));
|
|
@@ -19161,7 +19569,7 @@
|
|
|
19161
19569
|
if (isFirstRendering) {
|
|
19162
19570
|
var _widgetParams$theme = widgetParams.theme,
|
|
19163
19571
|
theme = _widgetParams$theme === void 0 ? 'light' : _widgetParams$theme;
|
|
19164
|
-
|
|
19572
|
+
P(h(PoweredBy, {
|
|
19165
19573
|
cssClasses: cssClasses,
|
|
19166
19574
|
url: url,
|
|
19167
19575
|
theme: theme
|
|
@@ -19200,7 +19608,7 @@
|
|
|
19200
19608
|
cssClasses: cssClasses
|
|
19201
19609
|
});
|
|
19202
19610
|
var makeWidget = connectPoweredBy(specializedRenderer, function () {
|
|
19203
|
-
return
|
|
19611
|
+
return P(null, containerNode);
|
|
19204
19612
|
});
|
|
19205
19613
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
19206
19614
|
theme: theme
|
|
@@ -19231,7 +19639,7 @@
|
|
|
19231
19639
|
var cssClasses = _ref.cssClasses,
|
|
19232
19640
|
templates = _ref.templates,
|
|
19233
19641
|
items = _ref.items;
|
|
19234
|
-
return
|
|
19642
|
+
return h(Template, {
|
|
19235
19643
|
templateKey: "default",
|
|
19236
19644
|
templates: templates,
|
|
19237
19645
|
rootProps: {
|
|
@@ -19260,7 +19668,7 @@
|
|
|
19260
19668
|
templates = _ref2.templates;
|
|
19261
19669
|
return function (_ref3) {
|
|
19262
19670
|
var items = _ref3.items;
|
|
19263
|
-
|
|
19671
|
+
P(h(QueryRuleCustomData, {
|
|
19264
19672
|
cssClasses: cssClasses,
|
|
19265
19673
|
templates: templates,
|
|
19266
19674
|
items: items
|
|
@@ -19298,7 +19706,7 @@
|
|
|
19298
19706
|
templates: templates
|
|
19299
19707
|
});
|
|
19300
19708
|
var makeWidget = connectQueryRules(specializedRenderer, function () {
|
|
19301
|
-
|
|
19709
|
+
P(null, containerNode);
|
|
19302
19710
|
});
|
|
19303
19711
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
19304
19712
|
transformItems: transformItems
|
|
@@ -19369,14 +19777,14 @@
|
|
|
19369
19777
|
var isDisabled = min && max ? min >= max : false;
|
|
19370
19778
|
var hasRefinements = Boolean(minValue || maxValue);
|
|
19371
19779
|
var rootClassNames = classnames(cssClasses.root, _defineProperty({}, cssClasses.noRefinement, !hasRefinements));
|
|
19372
|
-
return
|
|
19780
|
+
return h("div", {
|
|
19373
19781
|
className: rootClassNames
|
|
19374
|
-
},
|
|
19782
|
+
}, h("form", {
|
|
19375
19783
|
className: cssClasses.form,
|
|
19376
19784
|
onSubmit: this.onSubmit
|
|
19377
|
-
},
|
|
19785
|
+
}, h("label", {
|
|
19378
19786
|
className: cssClasses.label
|
|
19379
|
-
},
|
|
19787
|
+
}, h("input", {
|
|
19380
19788
|
className: classnames(cssClasses.input, cssClasses.inputMin),
|
|
19381
19789
|
type: "number",
|
|
19382
19790
|
min: min,
|
|
@@ -19386,15 +19794,15 @@
|
|
|
19386
19794
|
onInput: this.onInput('min'),
|
|
19387
19795
|
placeholder: min === null || min === void 0 ? void 0 : min.toString(),
|
|
19388
19796
|
disabled: isDisabled
|
|
19389
|
-
})),
|
|
19797
|
+
})), h(Template, _extends({}, templateProps, {
|
|
19390
19798
|
templateKey: "separatorText",
|
|
19391
19799
|
rootTagName: "span",
|
|
19392
19800
|
rootProps: {
|
|
19393
19801
|
className: cssClasses.separator
|
|
19394
19802
|
}
|
|
19395
|
-
})),
|
|
19803
|
+
})), h("label", {
|
|
19396
19804
|
className: cssClasses.label
|
|
19397
|
-
},
|
|
19805
|
+
}, h("input", {
|
|
19398
19806
|
className: classnames(cssClasses.input, cssClasses.inputMax),
|
|
19399
19807
|
type: "number",
|
|
19400
19808
|
min: min,
|
|
@@ -19404,7 +19812,7 @@
|
|
|
19404
19812
|
onInput: this.onInput('max'),
|
|
19405
19813
|
placeholder: max === null || max === void 0 ? void 0 : max.toString(),
|
|
19406
19814
|
disabled: isDisabled
|
|
19407
|
-
})),
|
|
19815
|
+
})), h(Template, _extends({}, templateProps, {
|
|
19408
19816
|
templateKey: "submitText",
|
|
19409
19817
|
rootTagName: "button",
|
|
19410
19818
|
rootProps: {
|
|
@@ -19417,15 +19825,19 @@
|
|
|
19417
19825
|
}]);
|
|
19418
19826
|
|
|
19419
19827
|
return RangeInput;
|
|
19420
|
-
}(
|
|
19828
|
+
}(d);
|
|
19421
19829
|
|
|
19422
19830
|
var withUsage$L = createDocumentationMessageGenerator({
|
|
19423
19831
|
name: 'range-input'
|
|
19424
19832
|
});
|
|
19425
19833
|
var suit$l = component('RangeInput');
|
|
19426
19834
|
var defaultTemplates$c = {
|
|
19427
|
-
separatorText:
|
|
19428
|
-
|
|
19835
|
+
separatorText: function separatorText() {
|
|
19836
|
+
return 'to';
|
|
19837
|
+
},
|
|
19838
|
+
submitText: function submitText() {
|
|
19839
|
+
return 'Go';
|
|
19840
|
+
}
|
|
19429
19841
|
};
|
|
19430
19842
|
|
|
19431
19843
|
var renderer$g = function renderer(_ref) {
|
|
@@ -19461,7 +19873,7 @@
|
|
|
19461
19873
|
min: minValue !== -Infinity && minValue !== rangeMin ? minValue : undefined,
|
|
19462
19874
|
max: maxValue !== Infinity && maxValue !== rangeMax ? maxValue : undefined
|
|
19463
19875
|
};
|
|
19464
|
-
|
|
19876
|
+
P(h(RangeInput, {
|
|
19465
19877
|
min: rangeMin,
|
|
19466
19878
|
max: rangeMax,
|
|
19467
19879
|
step: step,
|
|
@@ -19527,7 +19939,7 @@
|
|
|
19527
19939
|
renderState: {}
|
|
19528
19940
|
});
|
|
19529
19941
|
var makeWidget = connectRange(specializedRenderer, function () {
|
|
19530
|
-
return
|
|
19942
|
+
return P(null, containerNode);
|
|
19531
19943
|
});
|
|
19532
19944
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
19533
19945
|
attribute: attribute,
|
|
@@ -19585,14 +19997,14 @@
|
|
|
19585
19997
|
}
|
|
19586
19998
|
|
|
19587
19999
|
function Button(props) {
|
|
19588
|
-
return
|
|
20000
|
+
return h("button", _extends({}, props, {
|
|
19589
20001
|
type: "button"
|
|
19590
20002
|
}));
|
|
19591
20003
|
} // Preact doesn't have builtin types for Style, JSX.HTMLAttributes['style'] is just object
|
|
19592
20004
|
// maybe migrate to csstype later?
|
|
19593
20005
|
|
|
19594
20006
|
|
|
19595
|
-
var _ref6 =
|
|
20007
|
+
var _ref6 = h("div", {
|
|
19596
20008
|
className: "rheostat-background"
|
|
19597
20009
|
});
|
|
19598
20010
|
|
|
@@ -19622,7 +20034,7 @@
|
|
|
19622
20034
|
values: _this.props.values
|
|
19623
20035
|
});
|
|
19624
20036
|
|
|
19625
|
-
_defineProperty(_assertThisInitialized(_this), "rheostat",
|
|
20037
|
+
_defineProperty(_assertThisInitialized(_this), "rheostat", y());
|
|
19626
20038
|
|
|
19627
20039
|
_this.getPublicState = _this.getPublicState.bind(_assertThisInitialized(_this));
|
|
19628
20040
|
_this.getSliderBoundingBox = _this.getSliderBoundingBox.bind(_assertThisInitialized(_this));
|
|
@@ -20126,7 +20538,7 @@
|
|
|
20126
20538
|
className = _this$state6.className,
|
|
20127
20539
|
handlePos = _this$state6.handlePos,
|
|
20128
20540
|
values = _this$state6.values;
|
|
20129
|
-
return
|
|
20541
|
+
return h("div", {
|
|
20130
20542
|
className: className,
|
|
20131
20543
|
ref: this.rheostat,
|
|
20132
20544
|
onClick: disabled ? undefined : this.handleClick,
|
|
@@ -20141,7 +20553,7 @@
|
|
|
20141
20553
|
left: "".concat(pos, "%"),
|
|
20142
20554
|
position: 'absolute'
|
|
20143
20555
|
};
|
|
20144
|
-
return
|
|
20556
|
+
return h(Handle, {
|
|
20145
20557
|
"aria-valuemax": _this7.getMaxValue(idx),
|
|
20146
20558
|
"aria-valuemin": _this7.getMinValue(idx),
|
|
20147
20559
|
"aria-valuenow": values[idx],
|
|
@@ -20162,7 +20574,7 @@
|
|
|
20162
20574
|
return null;
|
|
20163
20575
|
}
|
|
20164
20576
|
|
|
20165
|
-
return
|
|
20577
|
+
return h(ProgressBar, {
|
|
20166
20578
|
className: "rheostat-progress",
|
|
20167
20579
|
key: "progress-bar-".concat(idx),
|
|
20168
20580
|
style: _this7.getProgressStyle(idx)
|
|
@@ -20176,7 +20588,7 @@
|
|
|
20176
20588
|
left: "".concat(pos, "%"),
|
|
20177
20589
|
position: 'absolute'
|
|
20178
20590
|
};
|
|
20179
|
-
return
|
|
20591
|
+
return h(PitComponent, {
|
|
20180
20592
|
key: "pit-".concat(n),
|
|
20181
20593
|
style: pitStyle
|
|
20182
20594
|
}, n);
|
|
@@ -20185,7 +20597,7 @@
|
|
|
20185
20597
|
}]);
|
|
20186
20598
|
|
|
20187
20599
|
return Rheostat;
|
|
20188
|
-
}(
|
|
20600
|
+
}(d);
|
|
20189
20601
|
|
|
20190
20602
|
_defineProperty(Rheostat, "defaultProps", {
|
|
20191
20603
|
className: '',
|
|
@@ -20218,14 +20630,14 @@
|
|
|
20218
20630
|
var shouldDisplayValue = [0, 50, 100].includes(positionValue);
|
|
20219
20631
|
var value = children;
|
|
20220
20632
|
var pitValue = Math.round(parseInt(value, 10) * 100) / 100;
|
|
20221
|
-
return
|
|
20633
|
+
return h("div", {
|
|
20222
20634
|
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
20223
20635
|
marginLeft: positionValue === 100 ? '-2px' : 0
|
|
20224
20636
|
}),
|
|
20225
20637
|
className: classnames('rheostat-marker', 'rheostat-marker-horizontal', {
|
|
20226
20638
|
'rheostat-marker-large': shouldDisplayValue
|
|
20227
20639
|
})
|
|
20228
|
-
}, shouldDisplayValue &&
|
|
20640
|
+
}, shouldDisplayValue && h("div", {
|
|
20229
20641
|
className: 'rheostat-value'
|
|
20230
20642
|
}, pitValue));
|
|
20231
20643
|
};
|
|
@@ -20265,9 +20677,9 @@
|
|
|
20265
20677
|
'rheostat-handle-lower': props['data-handle-key'] === 0,
|
|
20266
20678
|
'rheostat-handle-upper': props['data-handle-key'] === 1
|
|
20267
20679
|
});
|
|
20268
|
-
return
|
|
20680
|
+
return h("div", _extends({}, props, {
|
|
20269
20681
|
className: className
|
|
20270
|
-
}), tooltips &&
|
|
20682
|
+
}), tooltips && h("div", {
|
|
20271
20683
|
className: "rheostat-tooltip"
|
|
20272
20684
|
}, value));
|
|
20273
20685
|
};
|
|
@@ -20337,9 +20749,9 @@
|
|
|
20337
20749
|
min: min,
|
|
20338
20750
|
max: max
|
|
20339
20751
|
});
|
|
20340
|
-
return
|
|
20752
|
+
return h("div", {
|
|
20341
20753
|
className: classnames(cssClasses.root, _defineProperty({}, cssClasses.disabledRoot, this.isDisabled))
|
|
20342
|
-
},
|
|
20754
|
+
}, h(Rheostat, {
|
|
20343
20755
|
handle: this.createHandleComponent(tooltips),
|
|
20344
20756
|
onChange: this.handleChange,
|
|
20345
20757
|
min: min,
|
|
@@ -20355,7 +20767,7 @@
|
|
|
20355
20767
|
}]);
|
|
20356
20768
|
|
|
20357
20769
|
return Slider;
|
|
20358
|
-
}(
|
|
20770
|
+
}(d);
|
|
20359
20771
|
|
|
20360
20772
|
var withUsage$M = createDocumentationMessageGenerator({
|
|
20361
20773
|
name: 'range-slider'
|
|
@@ -20391,7 +20803,7 @@
|
|
|
20391
20803
|
// backward compatible so we still need to pass [-Infinity, Infinity]
|
|
20392
20804
|
|
|
20393
20805
|
var values = [minFinite > maxRange ? maxRange : minFinite, maxFinite < minRange ? minRange : maxFinite];
|
|
20394
|
-
|
|
20806
|
+
P(h(Slider, {
|
|
20395
20807
|
cssClasses: cssClasses,
|
|
20396
20808
|
refine: refine,
|
|
20397
20809
|
min: minRange,
|
|
@@ -20450,7 +20862,7 @@
|
|
|
20450
20862
|
cssClasses: cssClasses
|
|
20451
20863
|
});
|
|
20452
20864
|
var makeWidget = connectRange(specializedRenderer, function () {
|
|
20453
|
-
return
|
|
20865
|
+
return P(null, containerNode);
|
|
20454
20866
|
});
|
|
20455
20867
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
20456
20868
|
attribute: attribute,
|
|
@@ -20463,8 +20875,58 @@
|
|
|
20463
20875
|
});
|
|
20464
20876
|
};
|
|
20465
20877
|
|
|
20878
|
+
/** @jsx h */
|
|
20879
|
+
|
|
20880
|
+
function ItemWrapper(_ref) {
|
|
20881
|
+
var children = _ref.children,
|
|
20882
|
+
count = _ref.count,
|
|
20883
|
+
value = _ref.value,
|
|
20884
|
+
url = _ref.url,
|
|
20885
|
+
cssClasses = _ref.cssClasses;
|
|
20886
|
+
|
|
20887
|
+
if (count) {
|
|
20888
|
+
return h("a", {
|
|
20889
|
+
className: cx$1(cssClasses.link),
|
|
20890
|
+
"aria-label": "".concat(value, " & up"),
|
|
20891
|
+
href: url
|
|
20892
|
+
}, children);
|
|
20893
|
+
}
|
|
20894
|
+
|
|
20895
|
+
return h("div", {
|
|
20896
|
+
className: cx$1(cssClasses.link),
|
|
20897
|
+
"aria-label": "".concat(value, " & up"),
|
|
20898
|
+
disabled: true
|
|
20899
|
+
}, children);
|
|
20900
|
+
}
|
|
20901
|
+
|
|
20466
20902
|
var defaultTemplates$d = {
|
|
20467
|
-
item:
|
|
20903
|
+
item: function item(_ref2) {
|
|
20904
|
+
var count = _ref2.count,
|
|
20905
|
+
value = _ref2.value,
|
|
20906
|
+
url = _ref2.url,
|
|
20907
|
+
stars = _ref2.stars,
|
|
20908
|
+
cssClasses = _ref2.cssClasses;
|
|
20909
|
+
return h(ItemWrapper, {
|
|
20910
|
+
count: count,
|
|
20911
|
+
value: value,
|
|
20912
|
+
url: url,
|
|
20913
|
+
cssClasses: cssClasses
|
|
20914
|
+
}, stars.map(function (isFull, index) {
|
|
20915
|
+
return h("svg", {
|
|
20916
|
+
key: index,
|
|
20917
|
+
className: cx$1([cx$1(cssClasses.starIcon), cx$1(isFull ? cssClasses.fullStarIcon : cssClasses.emptyStarIcon)]),
|
|
20918
|
+
"aria-hidden": "true",
|
|
20919
|
+
width: "24",
|
|
20920
|
+
height: "24"
|
|
20921
|
+
}, h("use", {
|
|
20922
|
+
xlinkHref: isFull ? '#ais-RatingMenu-starSymbol' : '#ais-RatingMenu-starEmptySymbol'
|
|
20923
|
+
}));
|
|
20924
|
+
}), h("span", {
|
|
20925
|
+
className: cx$1(cssClasses.label)
|
|
20926
|
+
}, "& Up"), count && h("span", {
|
|
20927
|
+
className: cx$1(cssClasses.count)
|
|
20928
|
+
}, formatNumber(count)));
|
|
20929
|
+
}
|
|
20468
20930
|
};
|
|
20469
20931
|
|
|
20470
20932
|
var withUsage$N = createDocumentationMessageGenerator({
|
|
@@ -20472,11 +20934,11 @@
|
|
|
20472
20934
|
});
|
|
20473
20935
|
var suit$n = component('RatingMenu');
|
|
20474
20936
|
|
|
20475
|
-
var _ref3$1 =
|
|
20937
|
+
var _ref3$1 = h("path", {
|
|
20476
20938
|
d: "M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z"
|
|
20477
20939
|
});
|
|
20478
20940
|
|
|
20479
|
-
var _ref4 =
|
|
20941
|
+
var _ref4 = h("path", {
|
|
20480
20942
|
d: "M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z"
|
|
20481
20943
|
});
|
|
20482
20944
|
|
|
@@ -20500,20 +20962,20 @@
|
|
|
20500
20962
|
return;
|
|
20501
20963
|
}
|
|
20502
20964
|
|
|
20503
|
-
|
|
20965
|
+
P(h(RefinementList$1, {
|
|
20504
20966
|
createURL: createURL,
|
|
20505
20967
|
cssClasses: cssClasses,
|
|
20506
20968
|
facetValues: items,
|
|
20507
20969
|
templateProps: renderState.templateProps,
|
|
20508
20970
|
toggleRefinement: refine
|
|
20509
|
-
},
|
|
20971
|
+
}, h("svg", {
|
|
20510
20972
|
style: "display:none;"
|
|
20511
|
-
},
|
|
20973
|
+
}, h("symbol", {
|
|
20512
20974
|
id: suit$n({
|
|
20513
20975
|
descendantName: 'starSymbol'
|
|
20514
20976
|
}),
|
|
20515
20977
|
viewBox: "0 0 24 24"
|
|
20516
|
-
}, _ref3$1),
|
|
20978
|
+
}, _ref3$1), h("symbol", {
|
|
20517
20979
|
id: suit$n({
|
|
20518
20980
|
descendantName: 'starEmptySymbol'
|
|
20519
20981
|
}),
|
|
@@ -20612,7 +21074,7 @@
|
|
|
20612
21074
|
templates: templates
|
|
20613
21075
|
});
|
|
20614
21076
|
var makeWidget = connectRatingMenu(specializedRenderer, function () {
|
|
20615
|
-
return
|
|
21077
|
+
return P(null, containerNode);
|
|
20616
21078
|
});
|
|
20617
21079
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
20618
21080
|
attribute: attribute,
|
|
@@ -20622,16 +21084,101 @@
|
|
|
20622
21084
|
});
|
|
20623
21085
|
};
|
|
20624
21086
|
|
|
21087
|
+
/** @jsx h */
|
|
21088
|
+
|
|
21089
|
+
var _ref2$1 = h("path", {
|
|
21090
|
+
d: "M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
|
|
21091
|
+
});
|
|
21092
|
+
|
|
21093
|
+
var _ref4$1 = h("path", {
|
|
21094
|
+
d: "M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"
|
|
21095
|
+
});
|
|
21096
|
+
|
|
21097
|
+
var _ref6$1 = h("g", {
|
|
21098
|
+
fill: "none",
|
|
21099
|
+
fillRule: "evenodd"
|
|
21100
|
+
}, h("g", {
|
|
21101
|
+
transform: "translate(1 1)",
|
|
21102
|
+
strokeWidth: "2"
|
|
21103
|
+
}, h("circle", {
|
|
21104
|
+
strokeOpacity: ".5",
|
|
21105
|
+
cx: "18",
|
|
21106
|
+
cy: "18",
|
|
21107
|
+
r: "18"
|
|
21108
|
+
}), h("path", {
|
|
21109
|
+
d: "M36 18c0-9.94-8.06-18-18-18"
|
|
21110
|
+
}, h("animateTransform", {
|
|
21111
|
+
attributeName: "transform",
|
|
21112
|
+
type: "rotate",
|
|
21113
|
+
from: "0 18 18",
|
|
21114
|
+
to: "360 18 18",
|
|
21115
|
+
dur: "1s",
|
|
21116
|
+
repeatCount: "indefinite"
|
|
21117
|
+
}))));
|
|
21118
|
+
|
|
20625
21119
|
var defaultTemplate = {
|
|
20626
|
-
reset:
|
|
20627
|
-
|
|
20628
|
-
|
|
21120
|
+
reset: function reset(_ref) {
|
|
21121
|
+
var cssClasses = _ref.cssClasses;
|
|
21122
|
+
return h("svg", {
|
|
21123
|
+
className: cssClasses.resetIcon,
|
|
21124
|
+
viewBox: "0 0 20 20",
|
|
21125
|
+
width: "10",
|
|
21126
|
+
height: "10"
|
|
21127
|
+
}, _ref2$1);
|
|
21128
|
+
},
|
|
21129
|
+
submit: function submit(_ref3) {
|
|
21130
|
+
var cssClasses = _ref3.cssClasses;
|
|
21131
|
+
return h("svg", {
|
|
21132
|
+
className: cssClasses.submitIcon,
|
|
21133
|
+
width: "10",
|
|
21134
|
+
height: "10",
|
|
21135
|
+
viewBox: "0 0 40 40"
|
|
21136
|
+
}, _ref4$1);
|
|
21137
|
+
},
|
|
21138
|
+
loadingIndicator: function loadingIndicator(_ref5) {
|
|
21139
|
+
var cssClasses = _ref5.cssClasses;
|
|
21140
|
+
return h("svg", {
|
|
21141
|
+
className: cssClasses.loadingIcon,
|
|
21142
|
+
width: "16",
|
|
21143
|
+
height: "16",
|
|
21144
|
+
viewBox: "0 0 38 38",
|
|
21145
|
+
stroke: "#444"
|
|
21146
|
+
}, _ref6$1);
|
|
21147
|
+
}
|
|
20629
21148
|
};
|
|
20630
21149
|
|
|
21150
|
+
/** @jsx h */
|
|
20631
21151
|
var defaultTemplates$e = {
|
|
20632
|
-
item:
|
|
20633
|
-
|
|
20634
|
-
|
|
21152
|
+
item: function item(_ref) {
|
|
21153
|
+
var cssClasses = _ref.cssClasses,
|
|
21154
|
+
count = _ref.count,
|
|
21155
|
+
value = _ref.value,
|
|
21156
|
+
highlighted = _ref.highlighted,
|
|
21157
|
+
isRefined = _ref.isRefined,
|
|
21158
|
+
isFromSearch = _ref.isFromSearch;
|
|
21159
|
+
return h("label", {
|
|
21160
|
+
className: cx$1(cssClasses.label)
|
|
21161
|
+
}, h("input", {
|
|
21162
|
+
type: "checkbox",
|
|
21163
|
+
className: cx$1(cssClasses.checkbox),
|
|
21164
|
+
value: value,
|
|
21165
|
+
defaultChecked: isRefined
|
|
21166
|
+
}), h("span", {
|
|
21167
|
+
className: cx$1(cssClasses.labelText),
|
|
21168
|
+
dangerouslySetInnerHTML: isFromSearch ? {
|
|
21169
|
+
__html: highlighted
|
|
21170
|
+
} : undefined
|
|
21171
|
+
}, !isFromSearch && highlighted), h("span", {
|
|
21172
|
+
className: cx$1(cssClasses.count)
|
|
21173
|
+
}, formatNumber(count)));
|
|
21174
|
+
},
|
|
21175
|
+
showMoreText: function showMoreText(_ref2) {
|
|
21176
|
+
var isShowingMore = _ref2.isShowingMore;
|
|
21177
|
+
return isShowingMore ? 'Show less' : 'Show more';
|
|
21178
|
+
},
|
|
21179
|
+
searchableNoResults: function searchableNoResults() {
|
|
21180
|
+
return 'No results';
|
|
21181
|
+
}
|
|
20635
21182
|
};
|
|
20636
21183
|
|
|
20637
21184
|
var withUsage$O = createDocumentationMessageGenerator({
|
|
@@ -20676,7 +21223,7 @@
|
|
|
20676
21223
|
return;
|
|
20677
21224
|
}
|
|
20678
21225
|
|
|
20679
|
-
|
|
21226
|
+
P(h(RefinementList$1, {
|
|
20680
21227
|
createURL: createURL,
|
|
20681
21228
|
cssClasses: cssClasses,
|
|
20682
21229
|
facetValues: items,
|
|
@@ -20828,7 +21375,7 @@
|
|
|
20828
21375
|
showMore: showMore
|
|
20829
21376
|
});
|
|
20830
21377
|
var makeWidget = connectRefinementList(specializedRenderer, function () {
|
|
20831
|
-
return
|
|
21378
|
+
return P(null, containerNode);
|
|
20832
21379
|
});
|
|
20833
21380
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
20834
21381
|
attribute: attribute,
|
|
@@ -20852,9 +21399,9 @@
|
|
|
20852
21399
|
isRelevantSorted = _ref.isRelevantSorted,
|
|
20853
21400
|
isVirtualReplica = _ref.isVirtualReplica,
|
|
20854
21401
|
refine = _ref.refine;
|
|
20855
|
-
return isVirtualReplica ?
|
|
21402
|
+
return isVirtualReplica ? h("div", {
|
|
20856
21403
|
className: cssClasses.root
|
|
20857
|
-
},
|
|
21404
|
+
}, h(Template, {
|
|
20858
21405
|
templateKey: "text",
|
|
20859
21406
|
templates: templates,
|
|
20860
21407
|
rootProps: {
|
|
@@ -20863,7 +21410,7 @@
|
|
|
20863
21410
|
data: {
|
|
20864
21411
|
isRelevantSorted: isRelevantSorted
|
|
20865
21412
|
}
|
|
20866
|
-
}),
|
|
21413
|
+
}), h("button", {
|
|
20867
21414
|
type: "button",
|
|
20868
21415
|
className: cssClasses.button,
|
|
20869
21416
|
onClick: function onClick() {
|
|
@@ -20873,7 +21420,7 @@
|
|
|
20873
21420
|
refine(undefined);
|
|
20874
21421
|
}
|
|
20875
21422
|
}
|
|
20876
|
-
},
|
|
21423
|
+
}, h(Template, {
|
|
20877
21424
|
rootTagName: "span",
|
|
20878
21425
|
templateKey: "button",
|
|
20879
21426
|
templates: templates,
|
|
@@ -20884,7 +21431,9 @@
|
|
|
20884
21431
|
};
|
|
20885
21432
|
|
|
20886
21433
|
var defaultTemplates$f = {
|
|
20887
|
-
text:
|
|
21434
|
+
text: function text() {
|
|
21435
|
+
return '';
|
|
21436
|
+
},
|
|
20888
21437
|
button: function button(_ref) {
|
|
20889
21438
|
var isRelevantSorted = _ref.isRelevantSorted;
|
|
20890
21439
|
return isRelevantSorted ? 'See all results' : 'See relevant results';
|
|
@@ -20904,7 +21453,7 @@
|
|
|
20904
21453
|
var isRelevantSorted = _ref2.isRelevantSorted,
|
|
20905
21454
|
isVirtualReplica = _ref2.isVirtualReplica,
|
|
20906
21455
|
refine = _ref2.refine;
|
|
20907
|
-
|
|
21456
|
+
P(h(RelevantSort, {
|
|
20908
21457
|
cssClasses: cssClasses,
|
|
20909
21458
|
templates: templates,
|
|
20910
21459
|
isRelevantSorted: isRelevantSorted,
|
|
@@ -20945,7 +21494,7 @@
|
|
|
20945
21494
|
templates: templates
|
|
20946
21495
|
});
|
|
20947
21496
|
var makeWidget = connectRelevantSort(specializedRenderer, function () {
|
|
20948
|
-
|
|
21497
|
+
P(null, containerNode);
|
|
20949
21498
|
});
|
|
20950
21499
|
return _objectSpread2(_objectSpread2({}, makeWidget({})), {}, {
|
|
20951
21500
|
$$widgetType: 'ais.relevantSort'
|
|
@@ -20971,7 +21520,7 @@
|
|
|
20971
21520
|
var refine = _ref2.refine,
|
|
20972
21521
|
query = _ref2.query,
|
|
20973
21522
|
isSearchStalled = _ref2.isSearchStalled;
|
|
20974
|
-
|
|
21523
|
+
P(h(SearchBox, {
|
|
20975
21524
|
query: query,
|
|
20976
21525
|
placeholder: placeholder,
|
|
20977
21526
|
autofocus: autofocus,
|
|
@@ -21064,7 +21613,7 @@
|
|
|
21064
21613
|
showLoadingIndicator: showLoadingIndicator
|
|
21065
21614
|
});
|
|
21066
21615
|
var makeWidget = connectSearchBox(specializedRenderer, function () {
|
|
21067
|
-
return
|
|
21616
|
+
return P(null, containerNode);
|
|
21068
21617
|
});
|
|
21069
21618
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
21070
21619
|
queryHook: queryHook
|
|
@@ -21090,9 +21639,9 @@
|
|
|
21090
21639
|
return;
|
|
21091
21640
|
}
|
|
21092
21641
|
|
|
21093
|
-
|
|
21642
|
+
P(h("div", {
|
|
21094
21643
|
className: cssClasses.root
|
|
21095
|
-
},
|
|
21644
|
+
}, h(Selector, {
|
|
21096
21645
|
cssClasses: cssClasses,
|
|
21097
21646
|
currentValue: currentRefinement,
|
|
21098
21647
|
options: options,
|
|
@@ -21133,7 +21682,7 @@
|
|
|
21133
21682
|
cssClasses: cssClasses
|
|
21134
21683
|
});
|
|
21135
21684
|
var makeWidget = connectSortBy(specializedRenderer, function () {
|
|
21136
|
-
return
|
|
21685
|
+
return P(null, containerNode);
|
|
21137
21686
|
});
|
|
21138
21687
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
21139
21688
|
container: containerNode,
|
|
@@ -21151,9 +21700,9 @@
|
|
|
21151
21700
|
templateProps = _ref.templateProps,
|
|
21152
21701
|
rest = _objectWithoutProperties(_ref, ["nbHits", "nbSortedHits", "cssClasses", "templateProps"]);
|
|
21153
21702
|
|
|
21154
|
-
return
|
|
21703
|
+
return h("div", {
|
|
21155
21704
|
className: classnames(cssClasses.root)
|
|
21156
|
-
},
|
|
21705
|
+
}, h(Template, _extends({}, templateProps, {
|
|
21157
21706
|
templateKey: "text",
|
|
21158
21707
|
rootTagName: "span",
|
|
21159
21708
|
rootProps: {
|
|
@@ -21178,24 +21727,70 @@
|
|
|
21178
21727
|
});
|
|
21179
21728
|
var suit$s = component('Stats');
|
|
21180
21729
|
var defaultTemplates$g = {
|
|
21181
|
-
text:
|
|
21730
|
+
text: function text(props) {
|
|
21731
|
+
return "".concat(props.areHitsSorted ? getSortedResultsSentence(props) : getResultsSentence(props), " found in ").concat(props.processingTimeMS, "ms");
|
|
21732
|
+
}
|
|
21182
21733
|
};
|
|
21183
21734
|
|
|
21184
|
-
|
|
21185
|
-
var
|
|
21186
|
-
|
|
21187
|
-
|
|
21188
|
-
|
|
21189
|
-
|
|
21190
|
-
|
|
21191
|
-
|
|
21192
|
-
|
|
21193
|
-
|
|
21194
|
-
|
|
21195
|
-
|
|
21196
|
-
|
|
21197
|
-
|
|
21198
|
-
|
|
21735
|
+
function getSortedResultsSentence(_ref) {
|
|
21736
|
+
var nbHits = _ref.nbHits,
|
|
21737
|
+
hasNoSortedResults = _ref.hasNoSortedResults,
|
|
21738
|
+
hasOneSortedResults = _ref.hasOneSortedResults,
|
|
21739
|
+
hasManySortedResults = _ref.hasManySortedResults,
|
|
21740
|
+
nbSortedHits = _ref.nbSortedHits;
|
|
21741
|
+
var suffix = "sorted out of ".concat(formatNumber(nbHits));
|
|
21742
|
+
|
|
21743
|
+
if (hasNoSortedResults) {
|
|
21744
|
+
return "No relevant results ".concat(suffix);
|
|
21745
|
+
}
|
|
21746
|
+
|
|
21747
|
+
if (hasOneSortedResults) {
|
|
21748
|
+
return "1 relevant result ".concat(suffix);
|
|
21749
|
+
}
|
|
21750
|
+
|
|
21751
|
+
if (hasManySortedResults) {
|
|
21752
|
+
return "".concat(formatNumber(nbSortedHits || 0), " relevant results ").concat(suffix);
|
|
21753
|
+
}
|
|
21754
|
+
|
|
21755
|
+
return '';
|
|
21756
|
+
}
|
|
21757
|
+
|
|
21758
|
+
function getResultsSentence(_ref2) {
|
|
21759
|
+
var nbHits = _ref2.nbHits,
|
|
21760
|
+
hasNoResults = _ref2.hasNoResults,
|
|
21761
|
+
hasOneResult = _ref2.hasOneResult,
|
|
21762
|
+
hasManyResults = _ref2.hasManyResults;
|
|
21763
|
+
|
|
21764
|
+
if (hasNoResults) {
|
|
21765
|
+
return 'No results';
|
|
21766
|
+
}
|
|
21767
|
+
|
|
21768
|
+
if (hasOneResult) {
|
|
21769
|
+
return '1 result';
|
|
21770
|
+
}
|
|
21771
|
+
|
|
21772
|
+
if (hasManyResults) {
|
|
21773
|
+
return "".concat(formatNumber(nbHits), " results");
|
|
21774
|
+
}
|
|
21775
|
+
|
|
21776
|
+
return '';
|
|
21777
|
+
}
|
|
21778
|
+
|
|
21779
|
+
var renderer$n = function renderer(_ref3) {
|
|
21780
|
+
var renderState = _ref3.renderState,
|
|
21781
|
+
cssClasses = _ref3.cssClasses,
|
|
21782
|
+
containerNode = _ref3.containerNode,
|
|
21783
|
+
templates = _ref3.templates;
|
|
21784
|
+
return function (_ref4, isFirstRendering) {
|
|
21785
|
+
var hitsPerPage = _ref4.hitsPerPage,
|
|
21786
|
+
nbHits = _ref4.nbHits,
|
|
21787
|
+
nbSortedHits = _ref4.nbSortedHits,
|
|
21788
|
+
areHitsSorted = _ref4.areHitsSorted,
|
|
21789
|
+
nbPages = _ref4.nbPages,
|
|
21790
|
+
page = _ref4.page,
|
|
21791
|
+
processingTimeMS = _ref4.processingTimeMS,
|
|
21792
|
+
query = _ref4.query,
|
|
21793
|
+
instantSearchInstance = _ref4.instantSearchInstance;
|
|
21199
21794
|
|
|
21200
21795
|
if (isFirstRendering) {
|
|
21201
21796
|
renderState.templateProps = prepareTemplateProps({
|
|
@@ -21206,7 +21801,7 @@
|
|
|
21206
21801
|
return;
|
|
21207
21802
|
}
|
|
21208
21803
|
|
|
21209
|
-
|
|
21804
|
+
P(h(Stats, {
|
|
21210
21805
|
cssClasses: cssClasses,
|
|
21211
21806
|
hitsPerPage: hitsPerPage,
|
|
21212
21807
|
nbHits: nbHits,
|
|
@@ -21229,12 +21824,12 @@
|
|
|
21229
21824
|
|
|
21230
21825
|
|
|
21231
21826
|
var stats = function stats(widgetParams) {
|
|
21232
|
-
var
|
|
21233
|
-
container =
|
|
21234
|
-
|
|
21235
|
-
userCssClasses =
|
|
21236
|
-
|
|
21237
|
-
templates =
|
|
21827
|
+
var _ref5 = widgetParams || {},
|
|
21828
|
+
container = _ref5.container,
|
|
21829
|
+
_ref5$cssClasses = _ref5.cssClasses,
|
|
21830
|
+
userCssClasses = _ref5$cssClasses === void 0 ? {} : _ref5$cssClasses,
|
|
21831
|
+
_ref5$templates = _ref5.templates,
|
|
21832
|
+
templates = _ref5$templates === void 0 ? {} : _ref5$templates;
|
|
21238
21833
|
|
|
21239
21834
|
if (!container) {
|
|
21240
21835
|
throw new Error(withUsage$S('The `container` option is required.'));
|
|
@@ -21254,7 +21849,7 @@
|
|
|
21254
21849
|
renderState: {}
|
|
21255
21850
|
});
|
|
21256
21851
|
var makeWidget = connectStats(specializedRenderer, function () {
|
|
21257
|
-
return
|
|
21852
|
+
return P(null, containerNode);
|
|
21258
21853
|
});
|
|
21259
21854
|
return _objectSpread2(_objectSpread2({}, makeWidget({})), {}, {
|
|
21260
21855
|
$$widgetType: 'ais.stats'
|
|
@@ -21266,11 +21861,11 @@
|
|
|
21266
21861
|
refine = _ref.refine,
|
|
21267
21862
|
cssClasses = _ref.cssClasses,
|
|
21268
21863
|
templateProps = _ref.templateProps;
|
|
21269
|
-
return
|
|
21864
|
+
return h("div", {
|
|
21270
21865
|
className: cssClasses.root
|
|
21271
|
-
},
|
|
21866
|
+
}, h("label", {
|
|
21272
21867
|
className: cssClasses.label
|
|
21273
|
-
},
|
|
21868
|
+
}, h("input", {
|
|
21274
21869
|
className: cssClasses.checkbox,
|
|
21275
21870
|
type: "checkbox",
|
|
21276
21871
|
checked: currentRefinement.isRefined,
|
|
@@ -21279,7 +21874,7 @@
|
|
|
21279
21874
|
isRefined: !event.target.checked
|
|
21280
21875
|
});
|
|
21281
21876
|
}
|
|
21282
|
-
}),
|
|
21877
|
+
}), h(Template, _extends({}, templateProps, {
|
|
21283
21878
|
rootTagName: "span",
|
|
21284
21879
|
rootProps: {
|
|
21285
21880
|
className: cssClasses.labelText
|
|
@@ -21290,7 +21885,10 @@
|
|
|
21290
21885
|
};
|
|
21291
21886
|
|
|
21292
21887
|
var defaultTemplates$h = {
|
|
21293
|
-
labelText:
|
|
21888
|
+
labelText: function labelText(_ref) {
|
|
21889
|
+
var name = _ref.name;
|
|
21890
|
+
return name;
|
|
21891
|
+
}
|
|
21294
21892
|
};
|
|
21295
21893
|
|
|
21296
21894
|
var withUsage$T = createDocumentationMessageGenerator({
|
|
@@ -21317,7 +21915,7 @@
|
|
|
21317
21915
|
return;
|
|
21318
21916
|
}
|
|
21319
21917
|
|
|
21320
|
-
|
|
21918
|
+
P(h(ToggleRefinement, {
|
|
21321
21919
|
cssClasses: cssClasses,
|
|
21322
21920
|
currentRefinement: value,
|
|
21323
21921
|
templateProps: renderState.templateProps,
|
|
@@ -21374,7 +21972,7 @@
|
|
|
21374
21972
|
templates: templates
|
|
21375
21973
|
});
|
|
21376
21974
|
var makeWidget = connectToggleRefinement(specializedRenderer, function () {
|
|
21377
|
-
return
|
|
21975
|
+
return P(null, containerNode);
|
|
21378
21976
|
});
|
|
21379
21977
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
21380
21978
|
attribute: attribute,
|
|
@@ -21407,9 +22005,9 @@
|
|
|
21407
22005
|
transcript = voiceListeningState.transcript,
|
|
21408
22006
|
isSpeechFinal = voiceListeningState.isSpeechFinal,
|
|
21409
22007
|
errorCode = voiceListeningState.errorCode;
|
|
21410
|
-
return
|
|
22008
|
+
return h("div", {
|
|
21411
22009
|
className: cssClasses.root
|
|
21412
|
-
},
|
|
22010
|
+
}, h(Template, {
|
|
21413
22011
|
templateKey: "buttonText",
|
|
21414
22012
|
rootTagName: "button",
|
|
21415
22013
|
rootProps: {
|
|
@@ -21428,7 +22026,7 @@
|
|
|
21428
22026
|
isBrowserSupported: isBrowserSupported
|
|
21429
22027
|
},
|
|
21430
22028
|
templates: templates
|
|
21431
|
-
}),
|
|
22029
|
+
}), h(Template, {
|
|
21432
22030
|
templateKey: "status",
|
|
21433
22031
|
rootProps: {
|
|
21434
22032
|
className: cssClasses.status
|
|
@@ -21445,22 +22043,93 @@
|
|
|
21445
22043
|
}));
|
|
21446
22044
|
};
|
|
21447
22045
|
|
|
21448
|
-
|
|
22046
|
+
/** @jsx h */
|
|
22047
|
+
|
|
22048
|
+
var _ref2$2 = h(p, null, h("line", {
|
|
22049
|
+
x1: "1",
|
|
22050
|
+
y1: "1",
|
|
22051
|
+
x2: "23",
|
|
22052
|
+
y2: "23"
|
|
22053
|
+
}), h("path", {
|
|
22054
|
+
d: "M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"
|
|
22055
|
+
}), h("path", {
|
|
22056
|
+
d: "M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"
|
|
22057
|
+
}), h("line", {
|
|
22058
|
+
x1: "12",
|
|
22059
|
+
y1: "19",
|
|
22060
|
+
x2: "12",
|
|
22061
|
+
y2: "23"
|
|
22062
|
+
}), h("line", {
|
|
22063
|
+
x1: "8",
|
|
22064
|
+
y1: "23",
|
|
22065
|
+
x2: "16",
|
|
22066
|
+
y2: "23"
|
|
22067
|
+
}));
|
|
22068
|
+
|
|
22069
|
+
var _ref3$2 = h("path", {
|
|
22070
|
+
d: "M19 10v2a7 7 0 0 1-14 0v-2"
|
|
22071
|
+
});
|
|
22072
|
+
|
|
22073
|
+
var _ref4$2 = h("line", {
|
|
22074
|
+
x1: "12",
|
|
22075
|
+
y1: "19",
|
|
22076
|
+
x2: "12",
|
|
22077
|
+
y2: "23"
|
|
22078
|
+
});
|
|
22079
|
+
|
|
22080
|
+
var _ref5 = h("line", {
|
|
22081
|
+
x1: "8",
|
|
22082
|
+
y1: "23",
|
|
22083
|
+
x2: "16",
|
|
22084
|
+
y2: "23"
|
|
22085
|
+
});
|
|
22086
|
+
|
|
22087
|
+
var ButtonInnerElement = function ButtonInnerElement(_ref) {
|
|
22088
|
+
var status = _ref.status,
|
|
22089
|
+
errorCode = _ref.errorCode,
|
|
22090
|
+
isListening = _ref.isListening;
|
|
22091
|
+
|
|
21449
22092
|
if (status === 'error' && errorCode === 'not-allowed') {
|
|
21450
|
-
return
|
|
22093
|
+
return _ref2$2;
|
|
21451
22094
|
}
|
|
21452
22095
|
|
|
21453
|
-
return
|
|
22096
|
+
return h(p, null, h("path", {
|
|
22097
|
+
d: "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z",
|
|
22098
|
+
fill: isListening ? 'currentColor' : 'none'
|
|
22099
|
+
}), _ref3$2, _ref4$2, _ref5);
|
|
21454
22100
|
};
|
|
21455
22101
|
|
|
21456
22102
|
var defaultTemplates$i = {
|
|
21457
|
-
buttonText: function buttonText(
|
|
21458
|
-
var status =
|
|
21459
|
-
errorCode =
|
|
21460
|
-
isListening =
|
|
21461
|
-
return "
|
|
22103
|
+
buttonText: function buttonText(_ref6) {
|
|
22104
|
+
var status = _ref6.status,
|
|
22105
|
+
errorCode = _ref6.errorCode,
|
|
22106
|
+
isListening = _ref6.isListening;
|
|
22107
|
+
return h("svg", {
|
|
22108
|
+
width: "16",
|
|
22109
|
+
height: "16",
|
|
22110
|
+
viewBox: "0 0 24 24",
|
|
22111
|
+
fill: "none",
|
|
22112
|
+
stroke: "currentColor"
|
|
22113
|
+
/* eslint-disable react/no-unknown-property */
|
|
22114
|
+
// Preact supports kebab case attributes, and using camel case would
|
|
22115
|
+
// require using `preact/compat`.
|
|
22116
|
+
// @TODO: reconsider using the `react` ESLint preset
|
|
22117
|
+
,
|
|
22118
|
+
"stroke-width": "2",
|
|
22119
|
+
"stroke-linecap": "round",
|
|
22120
|
+
"stroke-linejoin": "round"
|
|
22121
|
+
/* eslint-enable react/no-unknown-property */
|
|
22122
|
+
|
|
22123
|
+
}, h(ButtonInnerElement, {
|
|
22124
|
+
status: status,
|
|
22125
|
+
errorCode: errorCode,
|
|
22126
|
+
isListening: isListening
|
|
22127
|
+
}));
|
|
21462
22128
|
},
|
|
21463
|
-
status:
|
|
22129
|
+
status: function status(_ref7) {
|
|
22130
|
+
var transcript = _ref7.transcript;
|
|
22131
|
+
return h("p", null, transcript);
|
|
22132
|
+
}
|
|
21464
22133
|
};
|
|
21465
22134
|
|
|
21466
22135
|
var withUsage$U = createDocumentationMessageGenerator({
|
|
@@ -21477,7 +22146,7 @@
|
|
|
21477
22146
|
isListening = _ref2.isListening,
|
|
21478
22147
|
toggleListening = _ref2.toggleListening,
|
|
21479
22148
|
voiceListeningState = _ref2.voiceListeningState;
|
|
21480
|
-
|
|
22149
|
+
P(h(VoiceSearch, {
|
|
21481
22150
|
cssClasses: cssClasses,
|
|
21482
22151
|
templates: templates,
|
|
21483
22152
|
isBrowserSupported: isBrowserSupported,
|
|
@@ -21524,7 +22193,7 @@
|
|
|
21524
22193
|
templates: templates
|
|
21525
22194
|
});
|
|
21526
22195
|
var makeWidget = connectVoiceSearch(specializedRenderer, function () {
|
|
21527
|
-
return
|
|
22196
|
+
return P(null, containerNode);
|
|
21528
22197
|
});
|
|
21529
22198
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
21530
22199
|
container: containerNode,
|