instantsearch.js 4.44.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 +28 -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/connectors/hits-per-page/connectHitsPerPage.js +3 -1
- package/cjs/connectors/numeric-menu/connectNumericMenu.js +27 -2
- package/cjs/connectors/rating-menu/connectRatingMenu.js +10 -4
- package/cjs/connectors/sort-by/connectSortBy.js +3 -1
- 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/clear-refinements.js +2 -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 +171 -29
- package/dist/instantsearch.development.js +1430 -671
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +171 -29
- package/dist/instantsearch.production.min.d.ts +171 -29
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Answers/Answers.d.ts +2 -2
- package/es/components/Hits/Hits.d.ts +3 -3
- package/es/components/Hits/Hits.js +3 -1
- package/es/components/InfiniteHits/InfiniteHits.d.ts +3 -3
- 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/connectors/answers/connectAnswers.d.ts +2 -2
- package/es/connectors/autocomplete/connectAutocomplete.d.ts +2 -2
- package/es/connectors/hits-per-page/connectHitsPerPage.d.ts +5 -0
- package/es/connectors/hits-per-page/connectHitsPerPage.js +3 -1
- package/es/connectors/numeric-menu/connectNumericMenu.d.ts +8 -0
- package/es/connectors/numeric-menu/connectNumericMenu.js +27 -2
- package/es/connectors/rating-menu/connectRatingMenu.d.ts +2 -0
- package/es/connectors/rating-menu/connectRatingMenu.js +10 -4
- package/es/connectors/sort-by/connectSortBy.d.ts +5 -0
- package/es/connectors/sort-by/connectSortBy.js +3 -1
- 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/insights/client.d.ts +2 -2
- package/es/lib/utils/createSendEventForHits.d.ts +3 -3
- 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/connector.d.ts +2 -2
- 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/clear-refinements.js +2 -2
- 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 +7 -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) :
|
|
@@ -297,6 +297,63 @@
|
|
|
297
297
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
301
|
+
var it;
|
|
302
|
+
|
|
303
|
+
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
304
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
305
|
+
if (it) o = it;
|
|
306
|
+
var i = 0;
|
|
307
|
+
|
|
308
|
+
var F = function () {};
|
|
309
|
+
|
|
310
|
+
return {
|
|
311
|
+
s: F,
|
|
312
|
+
n: function () {
|
|
313
|
+
if (i >= o.length) return {
|
|
314
|
+
done: true
|
|
315
|
+
};
|
|
316
|
+
return {
|
|
317
|
+
done: false,
|
|
318
|
+
value: o[i++]
|
|
319
|
+
};
|
|
320
|
+
},
|
|
321
|
+
e: function (e) {
|
|
322
|
+
throw e;
|
|
323
|
+
},
|
|
324
|
+
f: F
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
var normalCompletion = true,
|
|
332
|
+
didErr = false,
|
|
333
|
+
err;
|
|
334
|
+
return {
|
|
335
|
+
s: function () {
|
|
336
|
+
it = o[Symbol.iterator]();
|
|
337
|
+
},
|
|
338
|
+
n: function () {
|
|
339
|
+
var step = it.next();
|
|
340
|
+
normalCompletion = step.done;
|
|
341
|
+
return step;
|
|
342
|
+
},
|
|
343
|
+
e: function (e) {
|
|
344
|
+
didErr = true;
|
|
345
|
+
err = e;
|
|
346
|
+
},
|
|
347
|
+
f: function () {
|
|
348
|
+
try {
|
|
349
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
350
|
+
} finally {
|
|
351
|
+
if (didErr) throw err;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
|
|
300
357
|
function clone(value) {
|
|
301
358
|
if (typeof value === 'object' && value !== null) {
|
|
302
359
|
return _merge(Array.isArray(value) ? [] : {}, value);
|
|
@@ -6650,146 +6707,685 @@
|
|
|
6650
6707
|
compiler.template = compiler.Template;
|
|
6651
6708
|
var hogan = compiler;
|
|
6652
6709
|
|
|
6653
|
-
|
|
6654
|
-
// that lambdas in Mustache are supposed to accept a second argument of
|
|
6655
|
-
// `render` to get the rendered value, not the literal `{{value}}`. But
|
|
6656
|
-
// this is currently broken (see https://github.com/twitter/hogan.js/issues/222).
|
|
6657
|
-
function transformHelpersToHogan() {
|
|
6658
|
-
var helpers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6659
|
-
var compileOptions = arguments.length > 1 ? arguments[1] : undefined;
|
|
6660
|
-
var data = arguments.length > 2 ? arguments[2] : undefined;
|
|
6661
|
-
return Object.keys(helpers).reduce(function (acc, helperKey) {
|
|
6662
|
-
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, helperKey, function () {
|
|
6663
|
-
var _this = this;
|
|
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;
|
|
6664
6711
|
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6712
|
+
function cx() {
|
|
6713
|
+
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6714
|
+
classNames[_key] = arguments[_key];
|
|
6715
|
+
}
|
|
6669
6716
|
|
|
6670
|
-
|
|
6671
|
-
};
|
|
6672
|
-
}));
|
|
6673
|
-
}, {});
|
|
6717
|
+
return classNames.filter(Boolean).join(' ') || undefined;
|
|
6674
6718
|
}
|
|
6675
6719
|
|
|
6676
|
-
function
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
data = _ref.data,
|
|
6682
|
-
bindEvent = _ref.bindEvent;
|
|
6683
|
-
var template = templates[templateKey];
|
|
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];
|
|
6684
6725
|
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6726
|
+
for (var key in source) {
|
|
6727
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
6728
|
+
target[key] = source[key];
|
|
6729
|
+
}
|
|
6730
|
+
}
|
|
6731
|
+
}
|
|
6688
6732
|
|
|
6689
|
-
|
|
6690
|
-
|
|
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];
|
|
6691
6752
|
}
|
|
6692
6753
|
|
|
6693
|
-
|
|
6694
|
-
return hogan.compile(template, compileOptions).render(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
6695
|
-
helpers: transformedHelpers
|
|
6696
|
-
})).replace(/[ \n\r\t\f\xA0]+/g, function (spaces) {
|
|
6697
|
-
return spaces.replace(/(^|\xA0+)[^\xA0]+/g, '$1 ');
|
|
6698
|
-
}).trim();
|
|
6754
|
+
return target;
|
|
6699
6755
|
}
|
|
6700
6756
|
|
|
6701
|
-
|
|
6702
|
-
// published as a major version.
|
|
6703
|
-
// Relying on the `find` polyfill on user-land, which before was only required for niche use-cases,
|
|
6704
|
-
// was decided as too risky.
|
|
6705
|
-
// @MAJOR Replace with the native `Array.prototype.find` method
|
|
6706
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
|
|
6707
|
-
function find$1(items, predicate) {
|
|
6708
|
-
var value;
|
|
6757
|
+
var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose$2;
|
|
6709
6758
|
|
|
6710
|
-
|
|
6711
|
-
|
|
6759
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
6760
|
+
if (source == null) return {};
|
|
6761
|
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
6762
|
+
var key, i;
|
|
6712
6763
|
|
|
6713
|
-
|
|
6714
|
-
|
|
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];
|
|
6715
6772
|
}
|
|
6716
6773
|
}
|
|
6717
6774
|
|
|
6718
|
-
return
|
|
6775
|
+
return target;
|
|
6719
6776
|
}
|
|
6720
6777
|
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
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
|
+
}
|
|
6725
6796
|
|
|
6726
|
-
|
|
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
|
+
};
|
|
6727
6836
|
}
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
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]';
|
|
6731
6891
|
}
|
|
6732
6892
|
|
|
6733
|
-
return value;
|
|
6893
|
+
return Object.prototype.toString.call(value);
|
|
6734
6894
|
}
|
|
6735
6895
|
|
|
6736
|
-
function
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
return resultsFacet.name === attribute;
|
|
6746
|
-
});
|
|
6747
|
-
var count;
|
|
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
|
+
*/
|
|
6748
6905
|
|
|
6749
|
-
if (type === 'hierarchical') {
|
|
6750
|
-
(function () {
|
|
6751
|
-
var facetDeclaration = state.getHierarchicalFacetByName(attribute);
|
|
6752
|
-
var nameParts = name.split(facetDeclaration.separator);
|
|
6753
6906
|
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
};
|
|
6907
|
+
function isPlainObject(value) {
|
|
6908
|
+
if (!isObjectLike(value) || getTag(value) !== '[object Object]') {
|
|
6909
|
+
return false;
|
|
6910
|
+
}
|
|
6759
6911
|
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
});
|
|
6764
|
-
};
|
|
6912
|
+
if (Object.getPrototypeOf(value) === null) {
|
|
6913
|
+
return true;
|
|
6914
|
+
}
|
|
6765
6915
|
|
|
6766
|
-
|
|
6767
|
-
_loop(i);
|
|
6768
|
-
}
|
|
6916
|
+
var proto = value;
|
|
6769
6917
|
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
} else {
|
|
6773
|
-
count = facet && facet.data && facet.data[res.name];
|
|
6918
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
6919
|
+
proto = Object.getPrototypeOf(proto);
|
|
6774
6920
|
}
|
|
6775
6921
|
|
|
6776
|
-
|
|
6777
|
-
|
|
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
|
+
}, {});
|
|
6778
6943
|
}
|
|
6779
6944
|
|
|
6780
|
-
if (
|
|
6781
|
-
|
|
6945
|
+
if (Array.isArray(input)) {
|
|
6946
|
+
return input.map(recursiveEscape);
|
|
6782
6947
|
}
|
|
6783
6948
|
|
|
6784
|
-
return
|
|
6949
|
+
return _objectSpread2(_objectSpread2({}, input), {}, {
|
|
6950
|
+
value: replaceTagsAndEscape(input.value)
|
|
6951
|
+
});
|
|
6785
6952
|
}
|
|
6786
6953
|
|
|
6787
|
-
function
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
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
|
+
|
|
7238
|
+
// We add all our template helper methods to the template as lambdas. Note
|
|
7239
|
+
// that lambdas in Mustache are supposed to accept a second argument of
|
|
7240
|
+
// `render` to get the rendered value, not the literal `{{value}}`. But
|
|
7241
|
+
// this is currently broken (see https://github.com/twitter/hogan.js/issues/222).
|
|
7242
|
+
function transformHelpersToHogan() {
|
|
7243
|
+
var helpers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7244
|
+
var compileOptions = arguments.length > 1 ? arguments[1] : undefined;
|
|
7245
|
+
var data = arguments.length > 2 ? arguments[2] : undefined;
|
|
7246
|
+
return Object.keys(helpers).reduce(function (acc, helperKey) {
|
|
7247
|
+
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, helperKey, function () {
|
|
7248
|
+
var _this = this;
|
|
7249
|
+
|
|
7250
|
+
return function (text) {
|
|
7251
|
+
var render = function render(value) {
|
|
7252
|
+
return hogan.compile(value, compileOptions).render(_this);
|
|
7253
|
+
};
|
|
7254
|
+
|
|
7255
|
+
return helpers[helperKey].call(data, text, render);
|
|
7256
|
+
};
|
|
7257
|
+
}));
|
|
7258
|
+
}, {});
|
|
7259
|
+
}
|
|
7260
|
+
|
|
7261
|
+
function renderTemplate(_ref) {
|
|
7262
|
+
var templates = _ref.templates,
|
|
7263
|
+
templateKey = _ref.templateKey,
|
|
7264
|
+
compileOptions = _ref.compileOptions,
|
|
7265
|
+
helpers = _ref.helpers,
|
|
7266
|
+
data = _ref.data,
|
|
7267
|
+
bindEvent = _ref.bindEvent,
|
|
7268
|
+
sendEvent = _ref.sendEvent;
|
|
7269
|
+
var template = templates[templateKey];
|
|
7270
|
+
|
|
7271
|
+
if (typeof template !== 'string' && typeof template !== 'function') {
|
|
7272
|
+
throw new Error("Template must be 'string' or 'function', was '".concat(_typeof(template), "' (key: ").concat(templateKey, ")"));
|
|
7273
|
+
}
|
|
7274
|
+
|
|
7275
|
+
if (typeof template === 'function') {
|
|
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);
|
|
7287
|
+
}
|
|
7288
|
+
|
|
7289
|
+
var transformedHelpers = transformHelpersToHogan(helpers, compileOptions, data);
|
|
7290
|
+
return hogan.compile(template, compileOptions).render(_objectSpread2(_objectSpread2({}, data), {}, {
|
|
7291
|
+
helpers: transformedHelpers
|
|
7292
|
+
})).replace(/[ \n\r\t\f\xA0]+/g, function (spaces) {
|
|
7293
|
+
return spaces.replace(/(^|\xA0+)[^\xA0]+/g, '$1 ');
|
|
7294
|
+
}).trim();
|
|
7295
|
+
}
|
|
7296
|
+
|
|
7297
|
+
// We aren't using the native `Array.prototype.find` because the refactor away from Lodash is not
|
|
7298
|
+
// published as a major version.
|
|
7299
|
+
// Relying on the `find` polyfill on user-land, which before was only required for niche use-cases,
|
|
7300
|
+
// was decided as too risky.
|
|
7301
|
+
// @MAJOR Replace with the native `Array.prototype.find` method
|
|
7302
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
|
|
7303
|
+
function find$1(items, predicate) {
|
|
7304
|
+
var value;
|
|
7305
|
+
|
|
7306
|
+
for (var i = 0; i < items.length; i++) {
|
|
7307
|
+
value = items[i]; // inlined for performance: if (Call(predicate, thisArg, [value, i, list])) {
|
|
7308
|
+
|
|
7309
|
+
if (predicate(value, i, items)) {
|
|
7310
|
+
return value;
|
|
7311
|
+
}
|
|
7312
|
+
}
|
|
7313
|
+
|
|
7314
|
+
return undefined;
|
|
7315
|
+
}
|
|
7316
|
+
|
|
7317
|
+
function unescapeFacetValue$3(value) {
|
|
7318
|
+
if (typeof value === 'string') {
|
|
7319
|
+
return value.replace(/^\\-/, '-');
|
|
7320
|
+
}
|
|
7321
|
+
|
|
7322
|
+
return value;
|
|
7323
|
+
}
|
|
7324
|
+
function escapeFacetValue$4(value) {
|
|
7325
|
+
if (typeof value === 'number' && value < 0 || typeof value === 'string') {
|
|
7326
|
+
return String(value).replace(/^-/, '\\-');
|
|
7327
|
+
}
|
|
7328
|
+
|
|
7329
|
+
return value;
|
|
7330
|
+
}
|
|
7331
|
+
|
|
7332
|
+
function getRefinement$1(state, type, attribute, name) {
|
|
7333
|
+
var resultsFacets = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
7334
|
+
var res = {
|
|
7335
|
+
type: type,
|
|
7336
|
+
attribute: attribute,
|
|
7337
|
+
name: name,
|
|
7338
|
+
escapedValue: escapeFacetValue$4(name)
|
|
7339
|
+
};
|
|
7340
|
+
var facet = find$1(resultsFacets, function (resultsFacet) {
|
|
7341
|
+
return resultsFacet.name === attribute;
|
|
7342
|
+
});
|
|
7343
|
+
var count;
|
|
7344
|
+
|
|
7345
|
+
if (type === 'hierarchical') {
|
|
7346
|
+
(function () {
|
|
7347
|
+
var facetDeclaration = state.getHierarchicalFacetByName(attribute);
|
|
7348
|
+
var nameParts = name.split(facetDeclaration.separator);
|
|
7349
|
+
|
|
7350
|
+
var getFacetRefinement = function getFacetRefinement(facetData) {
|
|
7351
|
+
return function (refinementKey) {
|
|
7352
|
+
return facetData[refinementKey];
|
|
7353
|
+
};
|
|
7354
|
+
};
|
|
7355
|
+
|
|
7356
|
+
var _loop = function _loop(i) {
|
|
7357
|
+
facet = facet && facet.data && find$1(Object.keys(facet.data).map(getFacetRefinement(facet.data)), function (refinement) {
|
|
7358
|
+
return refinement.name === nameParts[i];
|
|
7359
|
+
});
|
|
7360
|
+
};
|
|
7361
|
+
|
|
7362
|
+
for (var i = 0; facet !== undefined && i < nameParts.length; ++i) {
|
|
7363
|
+
_loop(i);
|
|
7364
|
+
}
|
|
7365
|
+
|
|
7366
|
+
count = facet && facet.count;
|
|
7367
|
+
})();
|
|
7368
|
+
} else {
|
|
7369
|
+
count = facet && facet.data && facet.data[res.name];
|
|
7370
|
+
}
|
|
7371
|
+
|
|
7372
|
+
if (count !== undefined) {
|
|
7373
|
+
res.count = count;
|
|
7374
|
+
}
|
|
7375
|
+
|
|
7376
|
+
if (facet && facet.exhaustive !== undefined) {
|
|
7377
|
+
res.exhaustive = facet.exhaustive;
|
|
7378
|
+
}
|
|
7379
|
+
|
|
7380
|
+
return res;
|
|
7381
|
+
}
|
|
7382
|
+
|
|
7383
|
+
function getRefinements(results, state) {
|
|
7384
|
+
var includesQuery = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7385
|
+
var refinements = [];
|
|
7386
|
+
var _state$facetsRefineme = state.facetsRefinements,
|
|
7387
|
+
facetsRefinements = _state$facetsRefineme === void 0 ? {} : _state$facetsRefineme,
|
|
7388
|
+
_state$facetsExcludes = state.facetsExcludes,
|
|
6793
7389
|
facetsExcludes = _state$facetsExcludes === void 0 ? {} : _state$facetsExcludes,
|
|
6794
7390
|
_state$disjunctiveFac = state.disjunctiveFacetsRefinements,
|
|
6795
7391
|
disjunctiveFacetsRefinements = _state$disjunctiveFac === void 0 ? {} : _state$disjunctiveFac,
|
|
@@ -6918,62 +7514,6 @@
|
|
|
6918
7514
|
}
|
|
6919
7515
|
}
|
|
6920
7516
|
|
|
6921
|
-
function noop() {}
|
|
6922
|
-
|
|
6923
|
-
/**
|
|
6924
|
-
* Logs a warning when this function is called, in development environment only.
|
|
6925
|
-
*/
|
|
6926
|
-
var deprecate = function deprecate(fn, message) {
|
|
6927
|
-
return fn;
|
|
6928
|
-
};
|
|
6929
|
-
/**
|
|
6930
|
-
* Logs a warning
|
|
6931
|
-
* This is used to log issues in development environment only.
|
|
6932
|
-
*/
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
var warn = noop;
|
|
6936
|
-
/**
|
|
6937
|
-
* Logs a warning if the condition is not met.
|
|
6938
|
-
* This is used to log issues in development environment only.
|
|
6939
|
-
*/
|
|
6940
|
-
|
|
6941
|
-
var _warning = noop;
|
|
6942
|
-
|
|
6943
|
-
{
|
|
6944
|
-
warn = function warn(message) {
|
|
6945
|
-
// eslint-disable-next-line no-console
|
|
6946
|
-
console.warn("[InstantSearch.js]: ".concat(message.trim()));
|
|
6947
|
-
};
|
|
6948
|
-
|
|
6949
|
-
deprecate = function deprecate(fn, message) {
|
|
6950
|
-
var hasAlreadyPrinted = false;
|
|
6951
|
-
return function () {
|
|
6952
|
-
if (!hasAlreadyPrinted) {
|
|
6953
|
-
hasAlreadyPrinted = true;
|
|
6954
|
-
warn(message);
|
|
6955
|
-
}
|
|
6956
|
-
|
|
6957
|
-
return fn.apply(void 0, arguments);
|
|
6958
|
-
};
|
|
6959
|
-
};
|
|
6960
|
-
|
|
6961
|
-
_warning = function warning(condition, message) {
|
|
6962
|
-
if (condition) {
|
|
6963
|
-
return;
|
|
6964
|
-
}
|
|
6965
|
-
|
|
6966
|
-
var hasAlreadyPrinted = _warning.cache[message];
|
|
6967
|
-
|
|
6968
|
-
if (!hasAlreadyPrinted) {
|
|
6969
|
-
_warning.cache[message] = true;
|
|
6970
|
-
warn(message);
|
|
6971
|
-
}
|
|
6972
|
-
};
|
|
6973
|
-
|
|
6974
|
-
_warning.cache = {};
|
|
6975
|
-
}
|
|
6976
|
-
|
|
6977
7517
|
/**
|
|
6978
7518
|
* A typed version of Object.keys, to use when looping over a static object
|
|
6979
7519
|
* inspired from https://stackoverflow.com/a/65117465/3185307
|
|
@@ -7123,223 +7663,64 @@
|
|
|
7123
7663
|
var capitalizedWidget = capitalize(widgets[0]);
|
|
7124
7664
|
return "virtual".concat(capitalizedWidget, "({ /* ... */ })");
|
|
7125
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")) ;
|
|
7126
|
-
}
|
|
7127
|
-
|
|
7128
|
-
function getPropertyByPath(object, path) {
|
|
7129
|
-
var parts = Array.isArray(path) ? path : path.split('.');
|
|
7130
|
-
return parts.reduce(function (current, key) {
|
|
7131
|
-
return current && current[key];
|
|
7132
|
-
}, object);
|
|
7133
|
-
}
|
|
7134
|
-
|
|
7135
|
-
// This is the `Number.isFinite()` polyfill recommended by MDN.
|
|
7136
|
-
// We do not provide any tests for this function.
|
|
7137
|
-
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#Polyfill
|
|
7138
|
-
function isFiniteNumber(value) {
|
|
7139
|
-
return typeof value === 'number' && isFinite(value);
|
|
7140
|
-
}
|
|
7141
|
-
|
|
7142
|
-
/**
|
|
7143
|
-
* This implementation is taken from Lodash implementation.
|
|
7144
|
-
* See: https://github.com/lodash/lodash/blob/master/isPlainObject.js
|
|
7145
|
-
*/
|
|
7146
|
-
function getTag(value) {
|
|
7147
|
-
if (value === null) {
|
|
7148
|
-
return value === undefined ? '[object Undefined]' : '[object Null]';
|
|
7149
|
-
}
|
|
7150
|
-
|
|
7151
|
-
return Object.prototype.toString.call(value);
|
|
7152
|
-
}
|
|
7153
|
-
|
|
7154
|
-
function isObjectLike(value) {
|
|
7155
|
-
return _typeof(value) === 'object' && value !== null;
|
|
7156
|
-
}
|
|
7157
|
-
/**
|
|
7158
|
-
* Checks if `value` is a plain object.
|
|
7159
|
-
*
|
|
7160
|
-
* A plain object is an object created by the `Object`
|
|
7161
|
-
* constructor or with a `[[Prototype]]` of `null`.
|
|
7162
|
-
*/
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
function isPlainObject(value) {
|
|
7166
|
-
if (!isObjectLike(value) || getTag(value) !== '[object Object]') {
|
|
7167
|
-
return false;
|
|
7168
|
-
}
|
|
7169
|
-
|
|
7170
|
-
if (Object.getPrototypeOf(value) === null) {
|
|
7171
|
-
return true;
|
|
7172
|
-
}
|
|
7173
|
-
|
|
7174
|
-
var proto = value;
|
|
7175
|
-
|
|
7176
|
-
while (Object.getPrototypeOf(proto) !== null) {
|
|
7177
|
-
proto = Object.getPrototypeOf(proto);
|
|
7178
|
-
}
|
|
7179
|
-
|
|
7180
|
-
return Object.getPrototypeOf(value) === proto;
|
|
7181
|
-
}
|
|
7182
|
-
|
|
7183
|
-
function range(_ref) {
|
|
7184
|
-
var _ref$start = _ref.start,
|
|
7185
|
-
start = _ref$start === void 0 ? 0 : _ref$start,
|
|
7186
|
-
end = _ref.end,
|
|
7187
|
-
_ref$step = _ref.step,
|
|
7188
|
-
step = _ref$step === void 0 ? 1 : _ref$step;
|
|
7189
|
-
// We can't divide by 0 so we re-assign the step to 1 if it happens.
|
|
7190
|
-
var limitStep = step === 0 ? 1 : step; // In some cases the array to create has a decimal length.
|
|
7191
|
-
// We therefore need to round the value.
|
|
7192
|
-
// Example:
|
|
7193
|
-
// { start: 1, end: 5000, step: 500 }
|
|
7194
|
-
// => Array length = (5000 - 1) / 500 = 9.998
|
|
7195
|
-
|
|
7196
|
-
var arrayLength = Math.round((end - start) / limitStep);
|
|
7197
|
-
return _toConsumableArray(Array(arrayLength)).map(function (_, current) {
|
|
7198
|
-
return start + current * limitStep;
|
|
7199
|
-
});
|
|
7200
|
-
}
|
|
7201
|
-
|
|
7202
|
-
function isPrimitive(obj) {
|
|
7203
|
-
return obj !== Object(obj);
|
|
7204
|
-
}
|
|
7205
|
-
|
|
7206
|
-
function isEqual(first, second) {
|
|
7207
|
-
if (first === second) {
|
|
7208
|
-
return true;
|
|
7209
|
-
}
|
|
7210
|
-
|
|
7211
|
-
if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') {
|
|
7212
|
-
return first === second;
|
|
7213
|
-
}
|
|
7214
|
-
|
|
7215
|
-
if (Object.keys(first).length !== Object.keys(second).length) {
|
|
7216
|
-
return false;
|
|
7217
|
-
}
|
|
7218
|
-
|
|
7219
|
-
for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {
|
|
7220
|
-
var key = _Object$keys[_i];
|
|
7221
|
-
|
|
7222
|
-
if (!(key in second)) {
|
|
7223
|
-
return false;
|
|
7224
|
-
}
|
|
7225
|
-
|
|
7226
|
-
if (!isEqual(first[key], second[key])) {
|
|
7227
|
-
return false;
|
|
7228
|
-
}
|
|
7229
|
-
}
|
|
7230
|
-
|
|
7231
|
-
return true;
|
|
7232
|
-
}
|
|
7233
|
-
|
|
7234
|
-
/**
|
|
7235
|
-
* This implementation is taken from Lodash implementation.
|
|
7236
|
-
* See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js
|
|
7237
|
-
*/
|
|
7238
|
-
// Used to map characters to HTML entities.
|
|
7239
|
-
var htmlEscapes = {
|
|
7240
|
-
'&': '&',
|
|
7241
|
-
'<': '<',
|
|
7242
|
-
'>': '>',
|
|
7243
|
-
'"': '"',
|
|
7244
|
-
"'": '''
|
|
7245
|
-
}; // Used to match HTML entities and HTML characters.
|
|
7246
|
-
|
|
7247
|
-
var regexUnescapedHtml = /[&<>"']/g;
|
|
7248
|
-
var regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);
|
|
7249
|
-
/**
|
|
7250
|
-
* Converts the characters "&", "<", ">", '"', and "'" in `string` to their
|
|
7251
|
-
* corresponding HTML entities.
|
|
7252
|
-
*/
|
|
7253
|
-
|
|
7254
|
-
function escape$1(value) {
|
|
7255
|
-
return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {
|
|
7256
|
-
return htmlEscapes[character];
|
|
7257
|
-
}) : value;
|
|
7258
|
-
}
|
|
7259
|
-
|
|
7260
|
-
/**
|
|
7261
|
-
* This implementation is taken from Lodash implementation.
|
|
7262
|
-
* See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js
|
|
7263
|
-
*/
|
|
7264
|
-
// Used to map HTML entities to characters.
|
|
7265
|
-
var htmlEscapes$1 = {
|
|
7266
|
-
'&': '&',
|
|
7267
|
-
'<': '<',
|
|
7268
|
-
'>': '>',
|
|
7269
|
-
'"': '"',
|
|
7270
|
-
''': "'"
|
|
7271
|
-
}; // Used to match HTML entities and HTML characters.
|
|
7272
|
-
|
|
7273
|
-
var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;
|
|
7274
|
-
var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);
|
|
7275
|
-
/**
|
|
7276
|
-
* Converts the HTML entities "&", "<", ">", '"', and "'" in `string` to their
|
|
7277
|
-
* characters.
|
|
7278
|
-
*/
|
|
7666
|
+
}
|
|
7279
7667
|
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
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);
|
|
7284
7673
|
}
|
|
7285
7674
|
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
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
|
|
7294
7687
|
|
|
7295
|
-
|
|
7296
|
-
return
|
|
7688
|
+
var arrayLength = Math.round((end - start) / limitStep);
|
|
7689
|
+
return _toConsumableArray(Array(arrayLength)).map(function (_, current) {
|
|
7690
|
+
return start + current * limitStep;
|
|
7691
|
+
});
|
|
7297
7692
|
}
|
|
7298
7693
|
|
|
7299
|
-
function
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, key, recursiveEscape(input[key])));
|
|
7303
|
-
}, {});
|
|
7304
|
-
}
|
|
7694
|
+
function isPrimitive(obj) {
|
|
7695
|
+
return obj !== Object(obj);
|
|
7696
|
+
}
|
|
7305
7697
|
|
|
7306
|
-
|
|
7307
|
-
|
|
7698
|
+
function isEqual(first, second) {
|
|
7699
|
+
if (first === second) {
|
|
7700
|
+
return true;
|
|
7308
7701
|
}
|
|
7309
7702
|
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
}
|
|
7313
|
-
}
|
|
7703
|
+
if (isPrimitive(first) || isPrimitive(second) || typeof first === 'function' || typeof second === 'function') {
|
|
7704
|
+
return first === second;
|
|
7705
|
+
}
|
|
7314
7706
|
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
// instead we make a shallow copy and we assign the escaped values on it.
|
|
7319
|
-
hits = hits.map(function (_ref) {
|
|
7320
|
-
var hit = _extends({}, _ref);
|
|
7707
|
+
if (Object.keys(first).length !== Object.keys(second).length) {
|
|
7708
|
+
return false;
|
|
7709
|
+
}
|
|
7321
7710
|
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
}
|
|
7711
|
+
for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {
|
|
7712
|
+
var key = _Object$keys[_i];
|
|
7325
7713
|
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7714
|
+
if (!(key in second)) {
|
|
7715
|
+
return false;
|
|
7716
|
+
}
|
|
7329
7717
|
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7718
|
+
if (!isEqual(first[key], second[key])) {
|
|
7719
|
+
return false;
|
|
7720
|
+
}
|
|
7333
7721
|
}
|
|
7334
7722
|
|
|
7335
|
-
return
|
|
7336
|
-
}
|
|
7337
|
-
function escapeFacets(facetHits) {
|
|
7338
|
-
return facetHits.map(function (h) {
|
|
7339
|
-
return _objectSpread2(_objectSpread2({}, h), {}, {
|
|
7340
|
-
highlighted: replaceTagsAndEscape(h.highlighted)
|
|
7341
|
-
});
|
|
7342
|
-
});
|
|
7723
|
+
return true;
|
|
7343
7724
|
}
|
|
7344
7725
|
|
|
7345
7726
|
function concatHighlightedParts(parts) {
|
|
@@ -7350,32 +7731,6 @@
|
|
|
7350
7731
|
}).join('');
|
|
7351
7732
|
}
|
|
7352
7733
|
|
|
7353
|
-
function getHighlightedParts(highlightedValue) {
|
|
7354
|
-
var highlightPostTag = TAG_REPLACEMENT.highlightPostTag,
|
|
7355
|
-
highlightPreTag = TAG_REPLACEMENT.highlightPreTag;
|
|
7356
|
-
var splitByPreTag = highlightedValue.split(highlightPreTag);
|
|
7357
|
-
var firstValue = splitByPreTag.shift();
|
|
7358
|
-
var elements = !firstValue ? [] : [{
|
|
7359
|
-
value: firstValue,
|
|
7360
|
-
isHighlighted: false
|
|
7361
|
-
}];
|
|
7362
|
-
splitByPreTag.forEach(function (split) {
|
|
7363
|
-
var splitByPostTag = split.split(highlightPostTag);
|
|
7364
|
-
elements.push({
|
|
7365
|
-
value: splitByPostTag[0],
|
|
7366
|
-
isHighlighted: true
|
|
7367
|
-
});
|
|
7368
|
-
|
|
7369
|
-
if (splitByPostTag[1] !== '') {
|
|
7370
|
-
elements.push({
|
|
7371
|
-
value: splitByPostTag[1],
|
|
7372
|
-
isHighlighted: false
|
|
7373
|
-
});
|
|
7374
|
-
}
|
|
7375
|
-
});
|
|
7376
|
-
return elements;
|
|
7377
|
-
}
|
|
7378
|
-
|
|
7379
7734
|
var hasAlphanumeric = new RegExp(/\w/i);
|
|
7380
7735
|
function getHighlightFromSiblings(parts, i) {
|
|
7381
7736
|
var _parts, _parts2;
|
|
@@ -8028,6 +8383,10 @@
|
|
|
8028
8383
|
});
|
|
8029
8384
|
}
|
|
8030
8385
|
|
|
8386
|
+
function cx$1(cssClasses) {
|
|
8387
|
+
return Array.isArray(cssClasses) ? cssClasses.filter(Boolean).join(' ') : cssClasses || '';
|
|
8388
|
+
}
|
|
8389
|
+
|
|
8031
8390
|
var withUsage = createDocumentationMessageGenerator({
|
|
8032
8391
|
name: 'index-widget'
|
|
8033
8392
|
});
|
|
@@ -8578,7 +8937,7 @@
|
|
|
8578
8937
|
instantSearchInstance.renderState = _objectSpread2(_objectSpread2({}, instantSearchInstance.renderState), {}, _defineProperty({}, parentIndexName, _objectSpread2(_objectSpread2({}, instantSearchInstance.renderState[parentIndexName]), renderState)));
|
|
8579
8938
|
}
|
|
8580
8939
|
|
|
8581
|
-
var version$1 = '4.
|
|
8940
|
+
var version$1 = '4.46.0';
|
|
8582
8941
|
|
|
8583
8942
|
var NAMESPACE = 'ais';
|
|
8584
8943
|
var component = function component(componentName) {
|
|
@@ -8763,11 +9122,15 @@
|
|
|
8763
9122
|
return getCookie(ANONYMOUS_TOKEN_COOKIE_KEY);
|
|
8764
9123
|
}
|
|
8765
9124
|
|
|
9125
|
+
function formatNumber(value, numberLocale) {
|
|
9126
|
+
return value.toLocaleString(numberLocale);
|
|
9127
|
+
}
|
|
9128
|
+
|
|
8766
9129
|
function hoganHelpers(_ref) {
|
|
8767
9130
|
var numberLocale = _ref.numberLocale;
|
|
8768
9131
|
return {
|
|
8769
|
-
formatNumber: function formatNumber(value, render) {
|
|
8770
|
-
return Number(render(value))
|
|
9132
|
+
formatNumber: function formatNumber$1(value, render) {
|
|
9133
|
+
return formatNumber(Number(render(value)), numberLocale);
|
|
8771
9134
|
},
|
|
8772
9135
|
highlight: function highlight$1(options, render) {
|
|
8773
9136
|
try {
|
|
@@ -11437,8 +11800,6 @@
|
|
|
11437
11800
|
};
|
|
11438
11801
|
}
|
|
11439
11802
|
|
|
11440
|
-
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;
|
|
11441
|
-
|
|
11442
11803
|
/** @jsx h */
|
|
11443
11804
|
|
|
11444
11805
|
var findInsightsTarget = function findInsightsTarget(startElement, endElement, validator) {
|
|
@@ -11500,9 +11861,9 @@
|
|
|
11500
11861
|
}
|
|
11501
11862
|
};
|
|
11502
11863
|
|
|
11503
|
-
return
|
|
11864
|
+
return h("div", {
|
|
11504
11865
|
onClick: handleClick
|
|
11505
|
-
},
|
|
11866
|
+
}, h(BaseComponent, props));
|
|
11506
11867
|
}
|
|
11507
11868
|
|
|
11508
11869
|
return WithInsightsListener;
|
|
@@ -11612,6 +11973,7 @@
|
|
|
11612
11973
|
results = _ref5.results,
|
|
11613
11974
|
createURL = _ref5.createURL,
|
|
11614
11975
|
helper = _ref5.helper;
|
|
11976
|
+
var canRefine = results ? results.nbHits > 0 : false;
|
|
11615
11977
|
return {
|
|
11616
11978
|
items: transformItems(normalizeItems(state), {
|
|
11617
11979
|
results: results
|
|
@@ -11621,7 +11983,8 @@
|
|
|
11621
11983
|
state: state,
|
|
11622
11984
|
createURL: createURL
|
|
11623
11985
|
}),
|
|
11624
|
-
hasNoResults:
|
|
11986
|
+
hasNoResults: !canRefine,
|
|
11987
|
+
canRefine: canRefine,
|
|
11625
11988
|
widgetParams: widgetParams
|
|
11626
11989
|
};
|
|
11627
11990
|
},
|
|
@@ -12245,12 +12608,35 @@
|
|
|
12245
12608
|
});
|
|
12246
12609
|
}
|
|
12247
12610
|
|
|
12611
|
+
var hasNoResults = results ? results.nbHits === 0 : true;
|
|
12612
|
+
var preparedItems = prepareItems(state);
|
|
12613
|
+
var allIsSelected = true;
|
|
12614
|
+
|
|
12615
|
+
var _iterator = _createForOfIteratorHelper(preparedItems),
|
|
12616
|
+
_step;
|
|
12617
|
+
|
|
12618
|
+
try {
|
|
12619
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
12620
|
+
var item = _step.value;
|
|
12621
|
+
|
|
12622
|
+
if (item.isRefined && decodeURI(item.value) !== '{}') {
|
|
12623
|
+
allIsSelected = false;
|
|
12624
|
+
break;
|
|
12625
|
+
}
|
|
12626
|
+
}
|
|
12627
|
+
} catch (err) {
|
|
12628
|
+
_iterator.e(err);
|
|
12629
|
+
} finally {
|
|
12630
|
+
_iterator.f();
|
|
12631
|
+
}
|
|
12632
|
+
|
|
12248
12633
|
return {
|
|
12249
12634
|
createURL: connectorState.createURL(state),
|
|
12250
|
-
items: transformItems(
|
|
12635
|
+
items: transformItems(preparedItems, {
|
|
12251
12636
|
results: results
|
|
12252
12637
|
}),
|
|
12253
|
-
hasNoResults:
|
|
12638
|
+
hasNoResults: hasNoResults,
|
|
12639
|
+
canRefine: !(hasNoResults && allIsSelected),
|
|
12254
12640
|
refine: connectorState.refine,
|
|
12255
12641
|
sendEvent: connectorState.sendEvent,
|
|
12256
12642
|
widgetParams: widgetParams
|
|
@@ -13306,13 +13692,15 @@
|
|
|
13306
13692
|
};
|
|
13307
13693
|
}
|
|
13308
13694
|
|
|
13695
|
+
var hasNoResults = results ? results.nbHits === 0 : true;
|
|
13309
13696
|
return {
|
|
13310
13697
|
currentRefinement: state.index,
|
|
13311
13698
|
options: transformItems(items, {
|
|
13312
13699
|
results: results
|
|
13313
13700
|
}),
|
|
13314
13701
|
refine: connectorState.setIndex,
|
|
13315
|
-
hasNoResults:
|
|
13702
|
+
hasNoResults: hasNoResults,
|
|
13703
|
+
canRefine: !hasNoResults && items.length > 0,
|
|
13316
13704
|
widgetParams: widgetParams
|
|
13317
13705
|
};
|
|
13318
13706
|
},
|
|
@@ -13516,8 +13904,11 @@
|
|
|
13516
13904
|
});
|
|
13517
13905
|
}
|
|
13518
13906
|
|
|
13519
|
-
|
|
13520
|
-
|
|
13907
|
+
var refinementIsApplied = false;
|
|
13908
|
+
var totalCount = 0;
|
|
13909
|
+
var facetResults = results === null || results === void 0 ? void 0 : results.getFacetValues(attribute, {});
|
|
13910
|
+
|
|
13911
|
+
if (results && facetResults) {
|
|
13521
13912
|
var maxValuesPerFacet = facetResults.length;
|
|
13522
13913
|
var maxDecimalPlaces = getFacetsMaxDecimalPlaces(facetResults);
|
|
13523
13914
|
var maxFacets = Math.pow(10, maxDecimalPlaces) * max;
|
|
@@ -13531,6 +13922,7 @@
|
|
|
13531
13922
|
|
|
13532
13923
|
var _loop = function _loop(star) {
|
|
13533
13924
|
var isRefined = refinedStar === star;
|
|
13925
|
+
refinementIsApplied = refinementIsApplied || isRefined;
|
|
13534
13926
|
var count = facetResults.filter(function (f) {
|
|
13535
13927
|
return Number(f.name) >= star && Number(f.name) <= max;
|
|
13536
13928
|
}).map(function (f) {
|
|
@@ -13538,6 +13930,7 @@
|
|
|
13538
13930
|
}).reduce(function (sum, current) {
|
|
13539
13931
|
return sum + current;
|
|
13540
13932
|
}, 0);
|
|
13933
|
+
totalCount += count;
|
|
13541
13934
|
|
|
13542
13935
|
if (refinedStar && !isRefined && count === 0) {
|
|
13543
13936
|
// skip count==0 when at least 1 refinement is enabled
|
|
@@ -13567,10 +13960,11 @@
|
|
|
13567
13960
|
}
|
|
13568
13961
|
|
|
13569
13962
|
facetValues = facetValues.reverse();
|
|
13963
|
+
var hasNoResults = results ? results.nbHits === 0 : true;
|
|
13570
13964
|
return {
|
|
13571
13965
|
items: facetValues,
|
|
13572
|
-
hasNoResults:
|
|
13573
|
-
canRefine:
|
|
13966
|
+
hasNoResults: hasNoResults,
|
|
13967
|
+
canRefine: (!hasNoResults || refinementIsApplied) && totalCount > 0,
|
|
13574
13968
|
refine: connectorState.toggleRefinementFactory(helper),
|
|
13575
13969
|
sendEvent: sendEvent,
|
|
13576
13970
|
createURL: connectorState.createURLFactory({
|
|
@@ -15788,6 +16182,11 @@
|
|
|
15788
16182
|
}, {
|
|
15789
16183
|
key: "render",
|
|
15790
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") ;
|
|
15791
16190
|
var RootTagName = this.props.rootTagName;
|
|
15792
16191
|
var useCustomCompileOptions = this.props.useCustomCompileOptions[this.props.templateKey];
|
|
15793
16192
|
var compileOptions = useCustomCompileOptions ? this.props.templatesConfig.compileOptions : {};
|
|
@@ -15797,7 +16196,8 @@
|
|
|
15797
16196
|
compileOptions: compileOptions,
|
|
15798
16197
|
helpers: this.props.templatesConfig.helpers,
|
|
15799
16198
|
data: this.props.data,
|
|
15800
|
-
bindEvent: this.props.bindEvent
|
|
16199
|
+
bindEvent: this.props.bindEvent,
|
|
16200
|
+
sendEvent: this.props.sendEvent
|
|
15801
16201
|
});
|
|
15802
16202
|
|
|
15803
16203
|
if (content === null) {
|
|
@@ -15806,7 +16206,11 @@
|
|
|
15806
16206
|
return null;
|
|
15807
16207
|
}
|
|
15808
16208
|
|
|
15809
|
-
|
|
16209
|
+
if (_typeof(content) === 'object') {
|
|
16210
|
+
return h(RootTagName, this.props.rootProps, content);
|
|
16211
|
+
}
|
|
16212
|
+
|
|
16213
|
+
return h(RootTagName, _extends({}, this.props.rootProps, {
|
|
15810
16214
|
dangerouslySetInnerHTML: {
|
|
15811
16215
|
__html: content
|
|
15812
16216
|
}
|
|
@@ -15815,7 +16219,7 @@
|
|
|
15815
16219
|
}]);
|
|
15816
16220
|
|
|
15817
16221
|
return Template;
|
|
15818
|
-
}(
|
|
16222
|
+
}(d);
|
|
15819
16223
|
|
|
15820
16224
|
_defineProperty(Template, "defaultProps", defaultProps);
|
|
15821
16225
|
|
|
@@ -15825,13 +16229,13 @@
|
|
|
15825
16229
|
templateProps = _ref.templateProps,
|
|
15826
16230
|
createURL = _ref.createURL,
|
|
15827
16231
|
refine = _ref.refine;
|
|
15828
|
-
return
|
|
16232
|
+
return h("div", {
|
|
15829
16233
|
className: classnames(cssClasses.root, _defineProperty({}, cssClasses.noRefinementRoot, items.length === 0))
|
|
15830
|
-
},
|
|
16234
|
+
}, h("ul", {
|
|
15831
16235
|
className: cssClasses.list
|
|
15832
|
-
},
|
|
16236
|
+
}, h("li", {
|
|
15833
16237
|
className: classnames(cssClasses.item, _defineProperty({}, cssClasses.selectedItem, items.length === 0))
|
|
15834
|
-
},
|
|
16238
|
+
}, h(Template, _extends({}, templateProps, {
|
|
15835
16239
|
templateKey: "home",
|
|
15836
16240
|
rootTagName: "a",
|
|
15837
16241
|
rootProps: {
|
|
@@ -15844,17 +16248,17 @@
|
|
|
15844
16248
|
}
|
|
15845
16249
|
}))), items.map(function (item, idx) {
|
|
15846
16250
|
var isLast = idx === items.length - 1;
|
|
15847
|
-
return
|
|
16251
|
+
return h("li", {
|
|
15848
16252
|
key: item.label + idx,
|
|
15849
16253
|
className: classnames(cssClasses.item, _defineProperty({}, cssClasses.selectedItem, isLast))
|
|
15850
|
-
},
|
|
16254
|
+
}, h(Template, _extends({}, templateProps, {
|
|
15851
16255
|
templateKey: "separator",
|
|
15852
16256
|
rootTagName: "span",
|
|
15853
16257
|
rootProps: {
|
|
15854
16258
|
className: cssClasses.separator,
|
|
15855
16259
|
'aria-hidden': true
|
|
15856
16260
|
}
|
|
15857
|
-
})), isLast ? item.label :
|
|
16261
|
+
})), isLast ? item.label : h("a", {
|
|
15858
16262
|
className: cssClasses.link,
|
|
15859
16263
|
href: createURL(item.value),
|
|
15860
16264
|
onClick: function onClick(event) {
|
|
@@ -15866,8 +16270,12 @@
|
|
|
15866
16270
|
};
|
|
15867
16271
|
|
|
15868
16272
|
var defaultTemplates = {
|
|
15869
|
-
home:
|
|
15870
|
-
|
|
16273
|
+
home: function home() {
|
|
16274
|
+
return 'Home';
|
|
16275
|
+
},
|
|
16276
|
+
separator: function separator() {
|
|
16277
|
+
return '>';
|
|
16278
|
+
}
|
|
15871
16279
|
};
|
|
15872
16280
|
|
|
15873
16281
|
var withUsage$t = createDocumentationMessageGenerator({
|
|
@@ -15896,7 +16304,7 @@
|
|
|
15896
16304
|
return;
|
|
15897
16305
|
}
|
|
15898
16306
|
|
|
15899
|
-
|
|
16307
|
+
P(h(Breadcrumb, {
|
|
15900
16308
|
canRefine: canRefine,
|
|
15901
16309
|
cssClasses: cssClasses,
|
|
15902
16310
|
createURL: createURL,
|
|
@@ -15953,7 +16361,7 @@
|
|
|
15953
16361
|
templates: templates
|
|
15954
16362
|
});
|
|
15955
16363
|
var makeWidget = connectBreadcrumb(specializedRenderer, function () {
|
|
15956
|
-
return
|
|
16364
|
+
return P(null, containerNode);
|
|
15957
16365
|
});
|
|
15958
16366
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
15959
16367
|
attributes: attributes,
|
|
@@ -15970,9 +16378,9 @@
|
|
|
15970
16378
|
refine = _ref.refine,
|
|
15971
16379
|
cssClasses = _ref.cssClasses,
|
|
15972
16380
|
templateProps = _ref.templateProps;
|
|
15973
|
-
return
|
|
16381
|
+
return h("div", {
|
|
15974
16382
|
className: cssClasses.root
|
|
15975
|
-
},
|
|
16383
|
+
}, h(Template, _extends({}, templateProps, {
|
|
15976
16384
|
templateKey: "resetLabel",
|
|
15977
16385
|
rootTagName: "button",
|
|
15978
16386
|
rootProps: {
|
|
@@ -15987,7 +16395,9 @@
|
|
|
15987
16395
|
};
|
|
15988
16396
|
|
|
15989
16397
|
var defaultTemplates$1 = {
|
|
15990
|
-
resetLabel:
|
|
16398
|
+
resetLabel: function resetLabel() {
|
|
16399
|
+
return 'Clear refinements';
|
|
16400
|
+
}
|
|
15991
16401
|
};
|
|
15992
16402
|
|
|
15993
16403
|
var withUsage$u = createDocumentationMessageGenerator({
|
|
@@ -16002,7 +16412,7 @@
|
|
|
16002
16412
|
templates = _ref.templates;
|
|
16003
16413
|
return function (_ref2, isFirstRendering) {
|
|
16004
16414
|
var refine = _ref2.refine,
|
|
16005
|
-
|
|
16415
|
+
canRefine = _ref2.canRefine,
|
|
16006
16416
|
instantSearchInstance = _ref2.instantSearchInstance;
|
|
16007
16417
|
|
|
16008
16418
|
if (isFirstRendering) {
|
|
@@ -16014,10 +16424,10 @@
|
|
|
16014
16424
|
return;
|
|
16015
16425
|
}
|
|
16016
16426
|
|
|
16017
|
-
|
|
16427
|
+
P(h(ClearRefinements, {
|
|
16018
16428
|
refine: refine,
|
|
16019
16429
|
cssClasses: cssClasses,
|
|
16020
|
-
hasRefinements:
|
|
16430
|
+
hasRefinements: canRefine,
|
|
16021
16431
|
templateProps: renderState.templateProps
|
|
16022
16432
|
}), containerNode);
|
|
16023
16433
|
};
|
|
@@ -16056,7 +16466,7 @@
|
|
|
16056
16466
|
templates: templates
|
|
16057
16467
|
});
|
|
16058
16468
|
var makeWidget = connectClearRefinements(specializedRenderer, function () {
|
|
16059
|
-
return
|
|
16469
|
+
return P(null, containerNode);
|
|
16060
16470
|
});
|
|
16061
16471
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
16062
16472
|
includedAttributes: includedAttributes,
|
|
@@ -16109,23 +16519,23 @@
|
|
|
16109
16519
|
var CurrentRefinements = function CurrentRefinements(_ref2) {
|
|
16110
16520
|
var items = _ref2.items,
|
|
16111
16521
|
cssClasses = _ref2.cssClasses;
|
|
16112
|
-
return
|
|
16522
|
+
return h("div", {
|
|
16113
16523
|
className: cssClasses.root
|
|
16114
|
-
},
|
|
16524
|
+
}, h("ul", {
|
|
16115
16525
|
className: cssClasses.list
|
|
16116
16526
|
}, items.map(function (item, index) {
|
|
16117
|
-
return
|
|
16527
|
+
return h("li", {
|
|
16118
16528
|
key: "".concat(item.indexName, "-").concat(item.attribute, "-").concat(index),
|
|
16119
16529
|
className: cssClasses.item
|
|
16120
|
-
},
|
|
16530
|
+
}, h("span", {
|
|
16121
16531
|
className: cssClasses.label
|
|
16122
16532
|
}, capitalize(item.label), ":"), item.refinements.map(function (refinement) {
|
|
16123
|
-
return
|
|
16533
|
+
return h("span", {
|
|
16124
16534
|
key: createItemKey(refinement),
|
|
16125
16535
|
className: cssClasses.category
|
|
16126
|
-
},
|
|
16536
|
+
}, h("span", {
|
|
16127
16537
|
className: cssClasses.categoryLabel
|
|
16128
|
-
}, refinement.attribute === 'query' ?
|
|
16538
|
+
}, refinement.attribute === 'query' ? h("q", null, refinement.label) : refinement.label), h("button", {
|
|
16129
16539
|
className: cssClasses.delete,
|
|
16130
16540
|
onClick: handleClick(item.refine.bind(null, refinement))
|
|
16131
16541
|
}, "\u2715"));
|
|
@@ -16149,7 +16559,7 @@
|
|
|
16149
16559
|
var _ref2 = widgetParams,
|
|
16150
16560
|
container = _ref2.container,
|
|
16151
16561
|
cssClasses = _ref2.cssClasses;
|
|
16152
|
-
|
|
16562
|
+
P(h(CurrentRefinements, {
|
|
16153
16563
|
cssClasses: cssClasses,
|
|
16154
16564
|
items: items
|
|
16155
16565
|
}), container);
|
|
@@ -16191,7 +16601,7 @@
|
|
|
16191
16601
|
}), userCssClasses.delete)
|
|
16192
16602
|
};
|
|
16193
16603
|
var makeWidget = connectCurrentRefinements(renderer$2, function () {
|
|
16194
|
-
return
|
|
16604
|
+
return P(null, containerNode);
|
|
16195
16605
|
});
|
|
16196
16606
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
16197
16607
|
container: containerNode,
|
|
@@ -16205,8 +16615,12 @@
|
|
|
16205
16615
|
};
|
|
16206
16616
|
|
|
16207
16617
|
var defaultTemplates$2 = {
|
|
16208
|
-
header:
|
|
16209
|
-
|
|
16618
|
+
header: function header() {
|
|
16619
|
+
return '';
|
|
16620
|
+
},
|
|
16621
|
+
loader: function loader() {
|
|
16622
|
+
return '';
|
|
16623
|
+
},
|
|
16210
16624
|
item: function item(_item) {
|
|
16211
16625
|
return JSON.stringify(_item);
|
|
16212
16626
|
}
|
|
@@ -16217,9 +16631,9 @@
|
|
|
16217
16631
|
isLoading = _ref.isLoading,
|
|
16218
16632
|
cssClasses = _ref.cssClasses,
|
|
16219
16633
|
templateProps = _ref.templateProps;
|
|
16220
|
-
return
|
|
16634
|
+
return h("div", {
|
|
16221
16635
|
className: classnames(cssClasses.root, _defineProperty({}, cssClasses.emptyRoot, hits.length === 0))
|
|
16222
|
-
},
|
|
16636
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16223
16637
|
templateKey: "header",
|
|
16224
16638
|
rootProps: {
|
|
16225
16639
|
className: cssClasses.header
|
|
@@ -16228,15 +16642,15 @@
|
|
|
16228
16642
|
hits: hits,
|
|
16229
16643
|
isLoading: isLoading
|
|
16230
16644
|
}
|
|
16231
|
-
})), isLoading ?
|
|
16645
|
+
})), isLoading ? h(Template, _extends({}, templateProps, {
|
|
16232
16646
|
templateKey: "loader",
|
|
16233
16647
|
rootProps: {
|
|
16234
16648
|
className: cssClasses.loader
|
|
16235
16649
|
}
|
|
16236
|
-
})) :
|
|
16650
|
+
})) : h("ul", {
|
|
16237
16651
|
className: cssClasses.list
|
|
16238
16652
|
}, hits.map(function (hit, position) {
|
|
16239
|
-
return
|
|
16653
|
+
return h(Template, _extends({}, templateProps, {
|
|
16240
16654
|
templateKey: "item",
|
|
16241
16655
|
rootTagName: "li",
|
|
16242
16656
|
rootProps: {
|
|
@@ -16274,7 +16688,7 @@
|
|
|
16274
16688
|
return;
|
|
16275
16689
|
}
|
|
16276
16690
|
|
|
16277
|
-
|
|
16691
|
+
P(h(Answers, {
|
|
16278
16692
|
cssClasses: cssClasses,
|
|
16279
16693
|
hits: hits,
|
|
16280
16694
|
isLoading: isLoading,
|
|
@@ -16328,7 +16742,7 @@
|
|
|
16328
16742
|
renderState: {}
|
|
16329
16743
|
});
|
|
16330
16744
|
var makeWidget = connectAnswers(specializedRenderer, function () {
|
|
16331
|
-
return
|
|
16745
|
+
return P(null, containerNode);
|
|
16332
16746
|
});
|
|
16333
16747
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
16334
16748
|
attributesForPrediction: attributesForPrediction,
|
|
@@ -16439,7 +16853,7 @@
|
|
|
16439
16853
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
16440
16854
|
onClick = _ref.onClick,
|
|
16441
16855
|
children = _ref.children;
|
|
16442
|
-
return
|
|
16856
|
+
return h("button", {
|
|
16443
16857
|
className: className,
|
|
16444
16858
|
onClick: onClick,
|
|
16445
16859
|
disabled: disabled
|
|
@@ -16454,9 +16868,9 @@
|
|
|
16454
16868
|
checked = _ref.checked,
|
|
16455
16869
|
onToggle = _ref.onToggle,
|
|
16456
16870
|
children = _ref.children;
|
|
16457
|
-
return
|
|
16871
|
+
return h("label", {
|
|
16458
16872
|
className: classNameLabel
|
|
16459
|
-
},
|
|
16873
|
+
}, h("input", {
|
|
16460
16874
|
className: classNameInput,
|
|
16461
16875
|
type: "checkbox",
|
|
16462
16876
|
checked: checked,
|
|
@@ -16476,36 +16890,36 @@
|
|
|
16476
16890
|
onRefineClick = _ref.onRefineClick,
|
|
16477
16891
|
onClearClick = _ref.onClearClick,
|
|
16478
16892
|
templateProps = _ref.templateProps;
|
|
16479
|
-
return
|
|
16893
|
+
return h(p, null, enableRefine && h("div", null, enableRefineControl && h("div", {
|
|
16480
16894
|
className: cssClasses.control
|
|
16481
|
-
}, isRefineOnMapMove || !hasMapMoveSinceLastRefine ?
|
|
16895
|
+
}, isRefineOnMapMove || !hasMapMoveSinceLastRefine ? h(GeoSearchToggle, {
|
|
16482
16896
|
classNameLabel: classnames(cssClasses.label, _defineProperty({}, cssClasses.selectedLabel, isRefineOnMapMove)),
|
|
16483
16897
|
classNameInput: cssClasses.input,
|
|
16484
16898
|
checked: isRefineOnMapMove,
|
|
16485
16899
|
onToggle: onRefineToggle
|
|
16486
|
-
},
|
|
16900
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16487
16901
|
templateKey: "toggle",
|
|
16488
16902
|
rootTagName: "span"
|
|
16489
|
-
}))) :
|
|
16903
|
+
}))) : h(GeoSearchButton, {
|
|
16490
16904
|
className: cssClasses.redo,
|
|
16491
16905
|
disabled: !hasMapMoveSinceLastRefine,
|
|
16492
16906
|
onClick: onRefineClick
|
|
16493
|
-
},
|
|
16907
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16494
16908
|
templateKey: "redo",
|
|
16495
16909
|
rootTagName: "span"
|
|
16496
|
-
})))), !enableRefineControl && !isRefineOnMapMove &&
|
|
16910
|
+
})))), !enableRefineControl && !isRefineOnMapMove && h("div", {
|
|
16497
16911
|
className: cssClasses.control
|
|
16498
|
-
},
|
|
16912
|
+
}, h(GeoSearchButton, {
|
|
16499
16913
|
className: classnames(cssClasses.redo, _defineProperty({}, cssClasses.disabledRedo, !hasMapMoveSinceLastRefine)),
|
|
16500
16914
|
disabled: !hasMapMoveSinceLastRefine,
|
|
16501
16915
|
onClick: onRefineClick
|
|
16502
|
-
},
|
|
16916
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16503
16917
|
templateKey: "redo",
|
|
16504
16918
|
rootTagName: "span"
|
|
16505
|
-
})))), enableClearMapRefinement && isRefinedWithMap &&
|
|
16919
|
+
})))), enableClearMapRefinement && isRefinedWithMap && h(GeoSearchButton, {
|
|
16506
16920
|
className: cssClasses.reset,
|
|
16507
16921
|
onClick: onClearClick
|
|
16508
|
-
},
|
|
16922
|
+
}, h(Template, _extends({}, templateProps, {
|
|
16509
16923
|
templateKey: "reset",
|
|
16510
16924
|
rootTagName: "span"
|
|
16511
16925
|
})))));
|
|
@@ -16689,7 +17103,7 @@
|
|
|
16689
17103
|
});
|
|
16690
17104
|
}
|
|
16691
17105
|
|
|
16692
|
-
|
|
17106
|
+
P(h(GeoSearchControls, {
|
|
16693
17107
|
cssClasses: cssClasses,
|
|
16694
17108
|
enableRefine: enableRefine,
|
|
16695
17109
|
enableRefineControl: enableRefineControl,
|
|
@@ -16709,14 +17123,25 @@
|
|
|
16709
17123
|
}), container.querySelector(".".concat(cssClasses.tree)));
|
|
16710
17124
|
};
|
|
16711
17125
|
|
|
17126
|
+
/** @jsx h */
|
|
17127
|
+
|
|
17128
|
+
var _ref = h("p", null, "Your custom HTML Marker");
|
|
17129
|
+
|
|
16712
17130
|
var defaultTemplates$3 = {
|
|
16713
|
-
HTMLMarker:
|
|
16714
|
-
|
|
16715
|
-
|
|
16716
|
-
|
|
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
|
+
}
|
|
16717
17143
|
};
|
|
16718
17144
|
|
|
16719
|
-
/* global google EventListener */
|
|
16720
17145
|
var createHTMLMarker = function createHTMLMarker(googleReference) {
|
|
16721
17146
|
var HTMLMarker = /*#__PURE__*/function (_googleReference$maps) {
|
|
16722
17147
|
_inherits(HTMLMarker, _googleReference$maps);
|
|
@@ -16760,7 +17185,12 @@
|
|
|
16760
17185
|
_this.element = document.createElement('div');
|
|
16761
17186
|
_this.element.className = className;
|
|
16762
17187
|
_this.element.style.position = 'absolute';
|
|
16763
|
-
|
|
17188
|
+
|
|
17189
|
+
if (_typeof(template) === 'object') {
|
|
17190
|
+
P(template, _this.element);
|
|
17191
|
+
} else {
|
|
17192
|
+
_this.element.innerHTML = template;
|
|
17193
|
+
}
|
|
16764
17194
|
|
|
16765
17195
|
_this.setMap(map);
|
|
16766
17196
|
|
|
@@ -16978,7 +17408,7 @@
|
|
|
16978
17408
|
var createMarker = !customHTMLMarker ? createBuiltInMarker : createCustomHTMLMarker;
|
|
16979
17409
|
var markerOptions = !customHTMLMarker ? builtInMarker : customHTMLMarker;
|
|
16980
17410
|
var makeWidget = connectGeoSearch(renderer$4, function () {
|
|
16981
|
-
return
|
|
17411
|
+
return P(null, containerNode);
|
|
16982
17412
|
});
|
|
16983
17413
|
return _objectSpread2(_objectSpread2({}, makeWidget(_objectSpread2(_objectSpread2({}, otherWidgetParams), {}, {
|
|
16984
17414
|
renderState: {},
|
|
@@ -17007,7 +17437,7 @@
|
|
|
17007
17437
|
templateKey = _ref.templateKey,
|
|
17008
17438
|
templateData = _ref.templateData,
|
|
17009
17439
|
subItems = _ref.subItems;
|
|
17010
|
-
return
|
|
17440
|
+
return h("li", {
|
|
17011
17441
|
className: className,
|
|
17012
17442
|
onClick: function onClick(originalEvent) {
|
|
17013
17443
|
handleClick({
|
|
@@ -17016,7 +17446,7 @@
|
|
|
17016
17446
|
originalEvent: originalEvent
|
|
17017
17447
|
});
|
|
17018
17448
|
}
|
|
17019
|
-
},
|
|
17449
|
+
}, h(Template, _extends({}, templateProps, {
|
|
17020
17450
|
templateKey: templateKey,
|
|
17021
17451
|
data: templateData
|
|
17022
17452
|
})), subItems);
|
|
@@ -17058,7 +17488,7 @@
|
|
|
17058
17488
|
focused: false
|
|
17059
17489
|
});
|
|
17060
17490
|
|
|
17061
|
-
_defineProperty(_assertThisInitialized(_this), "input",
|
|
17491
|
+
_defineProperty(_assertThisInitialized(_this), "input", y());
|
|
17062
17492
|
|
|
17063
17493
|
_defineProperty(_assertThisInitialized(_this), "onInput", function (event) {
|
|
17064
17494
|
var _this$props = _this.props,
|
|
@@ -17173,16 +17603,16 @@
|
|
|
17173
17603
|
showLoadingIndicator = _this$props4.showLoadingIndicator,
|
|
17174
17604
|
templates = _this$props4.templates,
|
|
17175
17605
|
isSearchStalled = _this$props4.isSearchStalled;
|
|
17176
|
-
return
|
|
17606
|
+
return h("div", {
|
|
17177
17607
|
className: cssClasses.root
|
|
17178
|
-
},
|
|
17608
|
+
}, h("form", {
|
|
17179
17609
|
action: "",
|
|
17180
17610
|
role: "search",
|
|
17181
17611
|
className: cssClasses.form,
|
|
17182
17612
|
noValidate: true,
|
|
17183
17613
|
onSubmit: this.onSubmit,
|
|
17184
17614
|
onReset: this.onReset
|
|
17185
|
-
},
|
|
17615
|
+
}, h("input", {
|
|
17186
17616
|
ref: this.input,
|
|
17187
17617
|
value: this.state.query,
|
|
17188
17618
|
disabled: this.props.disabled,
|
|
@@ -17199,7 +17629,7 @@
|
|
|
17199
17629
|
onInput: this.onInput,
|
|
17200
17630
|
onBlur: this.onBlur,
|
|
17201
17631
|
onFocus: this.onFocus
|
|
17202
|
-
}),
|
|
17632
|
+
}), h(Template, {
|
|
17203
17633
|
templateKey: "submit",
|
|
17204
17634
|
rootTagName: "button",
|
|
17205
17635
|
rootProps: {
|
|
@@ -17212,7 +17642,7 @@
|
|
|
17212
17642
|
data: {
|
|
17213
17643
|
cssClasses: cssClasses
|
|
17214
17644
|
}
|
|
17215
|
-
}),
|
|
17645
|
+
}), h(Template, {
|
|
17216
17646
|
templateKey: "reset",
|
|
17217
17647
|
rootTagName: "button",
|
|
17218
17648
|
rootProps: {
|
|
@@ -17225,7 +17655,7 @@
|
|
|
17225
17655
|
data: {
|
|
17226
17656
|
cssClasses: cssClasses
|
|
17227
17657
|
}
|
|
17228
|
-
}), showLoadingIndicator &&
|
|
17658
|
+
}), showLoadingIndicator && h(Template, {
|
|
17229
17659
|
templateKey: "loadingIndicator",
|
|
17230
17660
|
rootTagName: "span",
|
|
17231
17661
|
rootProps: {
|
|
@@ -17241,7 +17671,7 @@
|
|
|
17241
17671
|
}]);
|
|
17242
17672
|
|
|
17243
17673
|
return SearchBox;
|
|
17244
|
-
}(
|
|
17674
|
+
}(d);
|
|
17245
17675
|
|
|
17246
17676
|
_defineProperty(SearchBox, "defaultProps", defaultProps$1);
|
|
17247
17677
|
|
|
@@ -17266,7 +17696,7 @@
|
|
|
17266
17696
|
|
|
17267
17697
|
_this = _super.call(this, props);
|
|
17268
17698
|
|
|
17269
|
-
_defineProperty(_assertThisInitialized(_this), "searchBox",
|
|
17699
|
+
_defineProperty(_assertThisInitialized(_this), "searchBox", y());
|
|
17270
17700
|
|
|
17271
17701
|
_this.handleItemClick = _this.handleItemClick.bind(_assertThisInitialized(_this));
|
|
17272
17702
|
return _this;
|
|
@@ -17295,7 +17725,7 @@
|
|
|
17295
17725
|
root = _this$props$cssClasse.root,
|
|
17296
17726
|
cssClasses = _objectWithoutProperties(_this$props$cssClasse, ["root"]);
|
|
17297
17727
|
|
|
17298
|
-
subItems =
|
|
17728
|
+
subItems = h(RefinementList, _extends({}, this.props, {
|
|
17299
17729
|
// We want to keep `root` required for external usage but not for the
|
|
17300
17730
|
// sub items.
|
|
17301
17731
|
cssClasses: cssClasses,
|
|
@@ -17326,7 +17756,7 @@
|
|
|
17326
17756
|
}
|
|
17327
17757
|
|
|
17328
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));
|
|
17329
|
-
return
|
|
17759
|
+
return h(RefinementListItem, {
|
|
17330
17760
|
templateKey: "item",
|
|
17331
17761
|
key: key,
|
|
17332
17762
|
facetValueToRefine: facetValue.value,
|
|
@@ -17420,7 +17850,7 @@
|
|
|
17420
17850
|
var _this2 = this;
|
|
17421
17851
|
|
|
17422
17852
|
var showMoreButtonClassName = classnames(this.props.cssClasses.showMore, _defineProperty({}, this.props.cssClasses.disabledShowMore, !(this.props.showMore === true && this.props.canToggleShowMore)));
|
|
17423
|
-
var showMoreButton = this.props.showMore === true &&
|
|
17853
|
+
var showMoreButton = this.props.showMore === true && h(Template, _extends({}, this.props.templateProps, {
|
|
17424
17854
|
templateKey: "showMoreText",
|
|
17425
17855
|
rootTagName: "button",
|
|
17426
17856
|
rootProps: {
|
|
@@ -17433,9 +17863,9 @@
|
|
|
17433
17863
|
}
|
|
17434
17864
|
}));
|
|
17435
17865
|
var shouldDisableSearchBox = this.props.searchIsAlwaysActive !== true && !(this.props.isFromSearch || !this.props.hasExhaustiveItems);
|
|
17436
|
-
var searchBox = this.props.searchFacetValues &&
|
|
17866
|
+
var searchBox = this.props.searchFacetValues && h("div", {
|
|
17437
17867
|
className: this.props.cssClasses.searchBox
|
|
17438
|
-
},
|
|
17868
|
+
}, h(SearchBox, {
|
|
17439
17869
|
ref: this.searchBox,
|
|
17440
17870
|
placeholder: this.props.searchPlaceholder,
|
|
17441
17871
|
disabled: shouldDisableSearchBox,
|
|
@@ -17454,30 +17884,47 @@
|
|
|
17454
17884
|
,
|
|
17455
17885
|
searchAsYouType: false
|
|
17456
17886
|
}));
|
|
17457
|
-
var facetValues = this.props.facetValues && this.props.facetValues.length > 0 &&
|
|
17887
|
+
var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && h("ul", {
|
|
17458
17888
|
className: this.props.cssClasses.list
|
|
17459
17889
|
}, this.props.facetValues.map(this._generateFacetItem, this));
|
|
17460
|
-
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, {
|
|
17461
17891
|
templateKey: "searchableNoResults",
|
|
17462
17892
|
rootProps: {
|
|
17463
17893
|
className: this.props.cssClasses.noResults
|
|
17464
17894
|
}
|
|
17465
17895
|
}));
|
|
17466
17896
|
var rootClassName = classnames(this.props.cssClasses.root, _defineProperty({}, this.props.cssClasses.noRefinementRoot, !this.props.facetValues || this.props.facetValues.length === 0), this.props.className);
|
|
17467
|
-
return
|
|
17897
|
+
return h("div", {
|
|
17468
17898
|
className: rootClassName
|
|
17469
17899
|
}, this.props.children, searchBox, facetValues, noResults, showMoreButton);
|
|
17470
17900
|
}
|
|
17471
17901
|
}]);
|
|
17472
17902
|
|
|
17473
17903
|
return RefinementList;
|
|
17474
|
-
}(
|
|
17904
|
+
}(d);
|
|
17475
17905
|
|
|
17476
17906
|
_defineProperty(RefinementList$1, "defaultProps", defaultProps$2);
|
|
17477
17907
|
|
|
17908
|
+
/** @jsx h */
|
|
17478
17909
|
var defaultTemplates$4 = {
|
|
17479
|
-
item:
|
|
17480
|
-
|
|
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
|
+
}
|
|
17481
17928
|
};
|
|
17482
17929
|
|
|
17483
17930
|
var withUsage$z = createDocumentationMessageGenerator({
|
|
@@ -17509,7 +17956,7 @@
|
|
|
17509
17956
|
return;
|
|
17510
17957
|
}
|
|
17511
17958
|
|
|
17512
|
-
|
|
17959
|
+
P(h(RefinementList$1, {
|
|
17513
17960
|
createURL: createURL,
|
|
17514
17961
|
cssClasses: cssClasses,
|
|
17515
17962
|
facetValues: items,
|
|
@@ -17646,7 +18093,7 @@
|
|
|
17646
18093
|
renderState: {}
|
|
17647
18094
|
});
|
|
17648
18095
|
var makeWidget = connectHierarchicalMenu(specializedRenderer, function () {
|
|
17649
|
-
return
|
|
18096
|
+
return P(null, containerNode);
|
|
17650
18097
|
});
|
|
17651
18098
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
17652
18099
|
attributes: attributes,
|
|
@@ -17667,11 +18114,12 @@
|
|
|
17667
18114
|
var results = _ref.results,
|
|
17668
18115
|
hits = _ref.hits,
|
|
17669
18116
|
bindEvent = _ref.bindEvent,
|
|
18117
|
+
sendEvent = _ref.sendEvent,
|
|
17670
18118
|
cssClasses = _ref.cssClasses,
|
|
17671
18119
|
templateProps = _ref.templateProps;
|
|
17672
18120
|
|
|
17673
18121
|
if (results.hits.length === 0) {
|
|
17674
|
-
return
|
|
18122
|
+
return h(Template, _extends({}, templateProps, {
|
|
17675
18123
|
templateKey: "empty",
|
|
17676
18124
|
rootProps: {
|
|
17677
18125
|
className: classnames(cssClasses.root, cssClasses.emptyRoot)
|
|
@@ -17680,12 +18128,12 @@
|
|
|
17680
18128
|
}));
|
|
17681
18129
|
}
|
|
17682
18130
|
|
|
17683
|
-
return
|
|
18131
|
+
return h("div", {
|
|
17684
18132
|
className: cssClasses.root
|
|
17685
|
-
},
|
|
18133
|
+
}, h("ol", {
|
|
17686
18134
|
className: cssClasses.list
|
|
17687
18135
|
}, hits.map(function (hit, index) {
|
|
17688
|
-
return
|
|
18136
|
+
return h(Template, _extends({}, templateProps, {
|
|
17689
18137
|
templateKey: "item",
|
|
17690
18138
|
rootTagName: "li",
|
|
17691
18139
|
rootProps: {
|
|
@@ -17695,13 +18143,16 @@
|
|
|
17695
18143
|
data: _objectSpread2(_objectSpread2({}, hit), {}, {
|
|
17696
18144
|
__hitIndex: index
|
|
17697
18145
|
}),
|
|
17698
|
-
bindEvent: bindEvent
|
|
18146
|
+
bindEvent: bindEvent,
|
|
18147
|
+
sendEvent: sendEvent
|
|
17699
18148
|
}));
|
|
17700
18149
|
})));
|
|
17701
18150
|
};
|
|
17702
18151
|
|
|
17703
18152
|
var defaultTemplates$5 = {
|
|
17704
|
-
empty:
|
|
18153
|
+
empty: function empty() {
|
|
18154
|
+
return 'No results';
|
|
18155
|
+
},
|
|
17705
18156
|
item: function item(data) {
|
|
17706
18157
|
return JSON.stringify(data, null, 2);
|
|
17707
18158
|
}
|
|
@@ -17734,7 +18185,7 @@
|
|
|
17734
18185
|
return;
|
|
17735
18186
|
}
|
|
17736
18187
|
|
|
17737
|
-
|
|
18188
|
+
P(h(HitsWithInsightsListener, {
|
|
17738
18189
|
cssClasses: cssClasses,
|
|
17739
18190
|
hits: receivedHits,
|
|
17740
18191
|
results: results,
|
|
@@ -17782,7 +18233,7 @@
|
|
|
17782
18233
|
templates: templates
|
|
17783
18234
|
});
|
|
17784
18235
|
var makeWidget = withInsights(connectHits)(specializedRenderer, function () {
|
|
17785
|
-
return
|
|
18236
|
+
return P(null, containerNode);
|
|
17786
18237
|
});
|
|
17787
18238
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
17788
18239
|
escapeHTML: escapeHTML,
|
|
@@ -17799,14 +18250,14 @@
|
|
|
17799
18250
|
options = _ref.options,
|
|
17800
18251
|
cssClasses = _ref.cssClasses,
|
|
17801
18252
|
setValue = _ref.setValue;
|
|
17802
|
-
return
|
|
18253
|
+
return h("select", {
|
|
17803
18254
|
className: classnames(cssClasses.select),
|
|
17804
18255
|
onChange: function onChange(event) {
|
|
17805
18256
|
return setValue(event.target.value);
|
|
17806
18257
|
},
|
|
17807
18258
|
value: "".concat(currentValue)
|
|
17808
18259
|
}, options.map(function (option) {
|
|
17809
|
-
return
|
|
18260
|
+
return h("option", {
|
|
17810
18261
|
className: classnames(cssClasses.option),
|
|
17811
18262
|
key: option.label + option.value,
|
|
17812
18263
|
value: "".concat(option.value)
|
|
@@ -17833,9 +18284,9 @@
|
|
|
17833
18284
|
}) || {},
|
|
17834
18285
|
currentValue = _ref3.value;
|
|
17835
18286
|
|
|
17836
|
-
|
|
18287
|
+
P(h("div", {
|
|
17837
18288
|
className: cssClasses.root
|
|
17838
|
-
},
|
|
18289
|
+
}, h(Selector, {
|
|
17839
18290
|
cssClasses: cssClasses,
|
|
17840
18291
|
currentValue: currentValue,
|
|
17841
18292
|
options: items,
|
|
@@ -17871,7 +18322,7 @@
|
|
|
17871
18322
|
cssClasses: cssClasses
|
|
17872
18323
|
});
|
|
17873
18324
|
var makeWidget = connectHitsPerPage(specializedRenderer, function () {
|
|
17874
|
-
return
|
|
18325
|
+
return P(null, containerNode);
|
|
17875
18326
|
});
|
|
17876
18327
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
17877
18328
|
items: items,
|
|
@@ -17885,6 +18336,7 @@
|
|
|
17885
18336
|
var results = _ref.results,
|
|
17886
18337
|
hits = _ref.hits,
|
|
17887
18338
|
bindEvent = _ref.bindEvent,
|
|
18339
|
+
sendEvent = _ref.sendEvent,
|
|
17888
18340
|
hasShowPrevious = _ref.hasShowPrevious,
|
|
17889
18341
|
showPrevious = _ref.showPrevious,
|
|
17890
18342
|
showMore = _ref.showMore,
|
|
@@ -17894,7 +18346,7 @@
|
|
|
17894
18346
|
templateProps = _ref.templateProps;
|
|
17895
18347
|
|
|
17896
18348
|
if (results.hits.length === 0) {
|
|
17897
|
-
return
|
|
18349
|
+
return h(Template, _extends({}, templateProps, {
|
|
17898
18350
|
templateKey: "empty",
|
|
17899
18351
|
rootProps: {
|
|
17900
18352
|
className: classnames(cssClasses.root, cssClasses.emptyRoot)
|
|
@@ -17903,9 +18355,9 @@
|
|
|
17903
18355
|
}));
|
|
17904
18356
|
}
|
|
17905
18357
|
|
|
17906
|
-
return
|
|
18358
|
+
return h("div", {
|
|
17907
18359
|
className: cssClasses.root
|
|
17908
|
-
}, hasShowPrevious &&
|
|
18360
|
+
}, hasShowPrevious && h(Template, _extends({}, templateProps, {
|
|
17909
18361
|
templateKey: "showPreviousText",
|
|
17910
18362
|
rootTagName: "button",
|
|
17911
18363
|
rootProps: {
|
|
@@ -17913,10 +18365,10 @@
|
|
|
17913
18365
|
disabled: isFirstPage,
|
|
17914
18366
|
onClick: showPrevious
|
|
17915
18367
|
}
|
|
17916
|
-
})),
|
|
18368
|
+
})), h("ol", {
|
|
17917
18369
|
className: cssClasses.list
|
|
17918
18370
|
}, hits.map(function (hit, position) {
|
|
17919
|
-
return
|
|
18371
|
+
return h(Template, _extends({}, templateProps, {
|
|
17920
18372
|
templateKey: "item",
|
|
17921
18373
|
rootTagName: "li",
|
|
17922
18374
|
rootProps: {
|
|
@@ -17926,9 +18378,10 @@
|
|
|
17926
18378
|
data: _objectSpread2(_objectSpread2({}, hit), {}, {
|
|
17927
18379
|
__hitIndex: position
|
|
17928
18380
|
}),
|
|
17929
|
-
bindEvent: bindEvent
|
|
18381
|
+
bindEvent: bindEvent,
|
|
18382
|
+
sendEvent: sendEvent
|
|
17930
18383
|
}));
|
|
17931
|
-
})),
|
|
18384
|
+
})), h(Template, _extends({}, templateProps, {
|
|
17932
18385
|
templateKey: "showMoreText",
|
|
17933
18386
|
rootTagName: "button",
|
|
17934
18387
|
rootProps: {
|
|
@@ -17940,9 +18393,15 @@
|
|
|
17940
18393
|
};
|
|
17941
18394
|
|
|
17942
18395
|
var defaultTemplates$6 = {
|
|
17943
|
-
empty:
|
|
17944
|
-
|
|
17945
|
-
|
|
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
|
+
},
|
|
17946
18405
|
item: function item(data) {
|
|
17947
18406
|
return JSON.stringify(data, null, 2);
|
|
17948
18407
|
}
|
|
@@ -17980,7 +18439,7 @@
|
|
|
17980
18439
|
return;
|
|
17981
18440
|
}
|
|
17982
18441
|
|
|
17983
|
-
|
|
18442
|
+
P(h(InfiniteHitsWithInsightsListener, {
|
|
17984
18443
|
cssClasses: cssClasses,
|
|
17985
18444
|
hits: hits,
|
|
17986
18445
|
results: results,
|
|
@@ -18050,7 +18509,7 @@
|
|
|
18050
18509
|
renderState: {}
|
|
18051
18510
|
});
|
|
18052
18511
|
var makeWidget = withInsights(connectInfiniteHits)(specializedRenderer, function () {
|
|
18053
|
-
return
|
|
18512
|
+
return P(null, containerNode);
|
|
18054
18513
|
});
|
|
18055
18514
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18056
18515
|
escapeHTML: escapeHTML,
|
|
@@ -18062,9 +18521,26 @@
|
|
|
18062
18521
|
});
|
|
18063
18522
|
};
|
|
18064
18523
|
|
|
18524
|
+
/** @jsx h */
|
|
18065
18525
|
var defaultTemplates$7 = {
|
|
18066
|
-
item:
|
|
18067
|
-
|
|
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
|
+
}
|
|
18068
18544
|
};
|
|
18069
18545
|
|
|
18070
18546
|
var withUsage$D = createDocumentationMessageGenerator({
|
|
@@ -18101,7 +18577,7 @@
|
|
|
18101
18577
|
url: createURL(facetValue.value)
|
|
18102
18578
|
});
|
|
18103
18579
|
});
|
|
18104
|
-
|
|
18580
|
+
P(h(RefinementList$1, {
|
|
18105
18581
|
createURL: createURL,
|
|
18106
18582
|
cssClasses: cssClasses,
|
|
18107
18583
|
facetValues: facetValues,
|
|
@@ -18174,7 +18650,7 @@
|
|
|
18174
18650
|
showMore: showMore
|
|
18175
18651
|
});
|
|
18176
18652
|
var makeWidget = connectMenu(specializedRenderer, function () {
|
|
18177
|
-
return
|
|
18653
|
+
return P(null, containerNode);
|
|
18178
18654
|
});
|
|
18179
18655
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18180
18656
|
attribute: attribute,
|
|
@@ -18201,15 +18677,15 @@
|
|
|
18201
18677
|
},
|
|
18202
18678
|
selectedValue = _ref2.value;
|
|
18203
18679
|
|
|
18204
|
-
return
|
|
18680
|
+
return h("div", {
|
|
18205
18681
|
className: classnames(cssClasses.root, _defineProperty({}, cssClasses.noRefinementRoot, items.length === 0))
|
|
18206
|
-
},
|
|
18682
|
+
}, h("select", {
|
|
18207
18683
|
className: cssClasses.select,
|
|
18208
18684
|
value: selectedValue,
|
|
18209
18685
|
onChange: function onChange(event) {
|
|
18210
18686
|
refine(event.target.value);
|
|
18211
18687
|
}
|
|
18212
|
-
},
|
|
18688
|
+
}, h(Template, _extends({}, templateProps, {
|
|
18213
18689
|
templateKey: "defaultOption",
|
|
18214
18690
|
rootTagName: "option",
|
|
18215
18691
|
rootProps: {
|
|
@@ -18217,7 +18693,7 @@
|
|
|
18217
18693
|
className: cssClasses.option
|
|
18218
18694
|
}
|
|
18219
18695
|
})), items.map(function (item) {
|
|
18220
|
-
return
|
|
18696
|
+
return h(Template, _extends({}, templateProps, {
|
|
18221
18697
|
templateKey: "item",
|
|
18222
18698
|
rootTagName: "option",
|
|
18223
18699
|
rootProps: {
|
|
@@ -18231,8 +18707,14 @@
|
|
|
18231
18707
|
}
|
|
18232
18708
|
|
|
18233
18709
|
var defaultTemplates$8 = {
|
|
18234
|
-
item:
|
|
18235
|
-
|
|
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
|
+
}
|
|
18236
18718
|
};
|
|
18237
18719
|
|
|
18238
18720
|
var withUsage$E = createDocumentationMessageGenerator({
|
|
@@ -18259,7 +18741,7 @@
|
|
|
18259
18741
|
return;
|
|
18260
18742
|
}
|
|
18261
18743
|
|
|
18262
|
-
|
|
18744
|
+
P(h(MenuSelect, {
|
|
18263
18745
|
cssClasses: cssClasses,
|
|
18264
18746
|
items: items,
|
|
18265
18747
|
refine: refine,
|
|
@@ -18306,7 +18788,7 @@
|
|
|
18306
18788
|
templates: templates
|
|
18307
18789
|
});
|
|
18308
18790
|
var makeWidget = connectMenu(specializedRenderer, function () {
|
|
18309
|
-
return
|
|
18791
|
+
return P(null, containerNode);
|
|
18310
18792
|
});
|
|
18311
18793
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18312
18794
|
attribute: attribute,
|
|
@@ -18318,8 +18800,24 @@
|
|
|
18318
18800
|
});
|
|
18319
18801
|
};
|
|
18320
18802
|
|
|
18803
|
+
/** @jsx h */
|
|
18321
18804
|
var defaultTemplates$9 = {
|
|
18322
|
-
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
|
+
}
|
|
18323
18821
|
};
|
|
18324
18822
|
|
|
18325
18823
|
var withUsage$F = createDocumentationMessageGenerator({
|
|
@@ -18348,7 +18846,7 @@
|
|
|
18348
18846
|
return;
|
|
18349
18847
|
}
|
|
18350
18848
|
|
|
18351
|
-
|
|
18849
|
+
P(h(RefinementList$1, {
|
|
18352
18850
|
createURL: createURL,
|
|
18353
18851
|
cssClasses: cssClasses,
|
|
18354
18852
|
facetValues: items,
|
|
@@ -18408,7 +18906,7 @@
|
|
|
18408
18906
|
templates: templates
|
|
18409
18907
|
});
|
|
18410
18908
|
var makeWidget = connectNumericMenu(specializedRenderer, function () {
|
|
18411
|
-
return
|
|
18909
|
+
return P(null, containerNode);
|
|
18412
18910
|
});
|
|
18413
18911
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18414
18912
|
attribute: attribute,
|
|
@@ -18433,11 +18931,11 @@
|
|
|
18433
18931
|
};
|
|
18434
18932
|
}
|
|
18435
18933
|
|
|
18436
|
-
return
|
|
18934
|
+
return h("div", {
|
|
18437
18935
|
className: classnames(props.cssClasses.root, _defineProperty({}, props.cssClasses.noRefinementRoot, props.nbPages <= 1))
|
|
18438
|
-
},
|
|
18936
|
+
}, h("ul", {
|
|
18439
18937
|
className: props.cssClasses.list
|
|
18440
|
-
}, props.showFirst &&
|
|
18938
|
+
}, props.showFirst && h(PaginationLink, {
|
|
18441
18939
|
ariaLabel: "First",
|
|
18442
18940
|
className: props.cssClasses.firstPageItem,
|
|
18443
18941
|
isDisabled: props.isFirstPage,
|
|
@@ -18446,7 +18944,7 @@
|
|
|
18446
18944
|
createURL: props.createURL,
|
|
18447
18945
|
cssClasses: props.cssClasses,
|
|
18448
18946
|
createClickHandler: createClickHandler
|
|
18449
|
-
}), props.showPrevious &&
|
|
18947
|
+
}), props.showPrevious && h(PaginationLink, {
|
|
18450
18948
|
ariaLabel: "Previous",
|
|
18451
18949
|
className: props.cssClasses.previousPageItem,
|
|
18452
18950
|
isDisabled: props.isFirstPage,
|
|
@@ -18456,7 +18954,7 @@
|
|
|
18456
18954
|
cssClasses: props.cssClasses,
|
|
18457
18955
|
createClickHandler: createClickHandler
|
|
18458
18956
|
}), props.pages.map(function (pageNumber) {
|
|
18459
|
-
return
|
|
18957
|
+
return h(PaginationLink, {
|
|
18460
18958
|
key: pageNumber,
|
|
18461
18959
|
ariaLabel: "".concat(pageNumber + 1),
|
|
18462
18960
|
className: props.cssClasses.pageItem,
|
|
@@ -18467,7 +18965,7 @@
|
|
|
18467
18965
|
cssClasses: props.cssClasses,
|
|
18468
18966
|
createClickHandler: createClickHandler
|
|
18469
18967
|
});
|
|
18470
|
-
}), props.showNext &&
|
|
18968
|
+
}), props.showNext && h(PaginationLink, {
|
|
18471
18969
|
ariaLabel: "Next",
|
|
18472
18970
|
className: props.cssClasses.nextPageItem,
|
|
18473
18971
|
isDisabled: props.isLastPage,
|
|
@@ -18476,7 +18974,7 @@
|
|
|
18476
18974
|
createURL: props.createURL,
|
|
18477
18975
|
cssClasses: props.cssClasses,
|
|
18478
18976
|
createClickHandler: createClickHandler
|
|
18479
|
-
}), props.showLast &&
|
|
18977
|
+
}), props.showLast && h(PaginationLink, {
|
|
18480
18978
|
ariaLabel: "Last",
|
|
18481
18979
|
className: props.cssClasses.lastPageItem,
|
|
18482
18980
|
isDisabled: props.isLastPage,
|
|
@@ -18500,14 +18998,14 @@
|
|
|
18500
18998
|
cssClasses = _ref.cssClasses,
|
|
18501
18999
|
createURL = _ref.createURL,
|
|
18502
19000
|
createClickHandler = _ref.createClickHandler;
|
|
18503
|
-
return
|
|
19001
|
+
return h("li", {
|
|
18504
19002
|
className: classnames(cssClasses.item, className, isDisabled && cssClasses.disabledItem, isSelected && cssClasses.selectedItem)
|
|
18505
|
-
}, isDisabled ?
|
|
19003
|
+
}, isDisabled ? h("span", {
|
|
18506
19004
|
className: cssClasses.link,
|
|
18507
19005
|
dangerouslySetInnerHTML: {
|
|
18508
19006
|
__html: label
|
|
18509
19007
|
}
|
|
18510
|
-
}) :
|
|
19008
|
+
}) : h("a", {
|
|
18511
19009
|
className: cssClasses.link,
|
|
18512
19010
|
"aria-label": ariaLabel,
|
|
18513
19011
|
href: createURL(pageNumber),
|
|
@@ -18556,7 +19054,7 @@
|
|
|
18556
19054
|
}
|
|
18557
19055
|
};
|
|
18558
19056
|
|
|
18559
|
-
|
|
19057
|
+
P(h(Pagination, {
|
|
18560
19058
|
createURL: createURL,
|
|
18561
19059
|
cssClasses: cssClasses,
|
|
18562
19060
|
currentPage: currentRefinement,
|
|
@@ -18658,7 +19156,7 @@
|
|
|
18658
19156
|
scrollToNode: scrollToNode
|
|
18659
19157
|
});
|
|
18660
19158
|
var makeWidget = connectPagination(specializedRenderer, function () {
|
|
18661
|
-
return
|
|
19159
|
+
return P(null, containerNode);
|
|
18662
19160
|
});
|
|
18663
19161
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
18664
19162
|
totalPages: totalPages,
|
|
@@ -18668,23 +19166,23 @@
|
|
|
18668
19166
|
});
|
|
18669
19167
|
};
|
|
18670
19168
|
|
|
18671
|
-
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}
|
|
18672
19170
|
|
|
18673
19171
|
function Panel(props) {
|
|
18674
19172
|
var _cx;
|
|
18675
19173
|
|
|
18676
|
-
var _useState =
|
|
19174
|
+
var _useState = p$1(props.isCollapsed),
|
|
18677
19175
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18678
19176
|
isCollapsed = _useState2[0],
|
|
18679
19177
|
setIsCollapsed = _useState2[1];
|
|
18680
19178
|
|
|
18681
|
-
var _useState3 =
|
|
19179
|
+
var _useState3 = p$1(false),
|
|
18682
19180
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
18683
19181
|
isControlled = _useState4[0],
|
|
18684
19182
|
setIsControlled = _useState4[1];
|
|
18685
19183
|
|
|
18686
|
-
var bodyRef =
|
|
18687
|
-
|
|
19184
|
+
var bodyRef = _$1(null);
|
|
19185
|
+
h$1(function () {
|
|
18688
19186
|
var node = bodyRef.current;
|
|
18689
19187
|
|
|
18690
19188
|
if (!node) {
|
|
@@ -18701,17 +19199,17 @@
|
|
|
18701
19199
|
setIsCollapsed(props.isCollapsed);
|
|
18702
19200
|
}
|
|
18703
19201
|
|
|
18704
|
-
return
|
|
19202
|
+
return h("div", {
|
|
18705
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)),
|
|
18706
19204
|
hidden: props.hidden
|
|
18707
|
-
}, props.templates.header &&
|
|
19205
|
+
}, props.templates.header && h("div", {
|
|
18708
19206
|
className: props.cssClasses.header
|
|
18709
|
-
},
|
|
19207
|
+
}, h(Template, {
|
|
18710
19208
|
templates: props.templates,
|
|
18711
19209
|
templateKey: "header",
|
|
18712
19210
|
rootTagName: "span",
|
|
18713
19211
|
data: props.data
|
|
18714
|
-
}), props.collapsible &&
|
|
19212
|
+
}), props.collapsible && h("button", {
|
|
18715
19213
|
className: props.cssClasses.collapseButton,
|
|
18716
19214
|
"aria-expanded": !isCollapsed,
|
|
18717
19215
|
onClick: function onClick(event) {
|
|
@@ -18721,17 +19219,17 @@
|
|
|
18721
19219
|
return !prevIsCollapsed;
|
|
18722
19220
|
});
|
|
18723
19221
|
}
|
|
18724
|
-
},
|
|
19222
|
+
}, h(Template, {
|
|
18725
19223
|
templates: props.templates,
|
|
18726
19224
|
templateKey: "collapseButtonText",
|
|
18727
19225
|
rootTagName: "span",
|
|
18728
19226
|
data: {
|
|
18729
19227
|
collapsed: isCollapsed
|
|
18730
19228
|
}
|
|
18731
|
-
}))),
|
|
19229
|
+
}))), h("div", {
|
|
18732
19230
|
className: props.cssClasses.body,
|
|
18733
19231
|
ref: bodyRef
|
|
18734
|
-
}), props.templates.footer &&
|
|
19232
|
+
}), props.templates.footer && h(Template, {
|
|
18735
19233
|
templates: props.templates,
|
|
18736
19234
|
templateKey: "footer",
|
|
18737
19235
|
rootProps: {
|
|
@@ -18756,7 +19254,7 @@
|
|
|
18756
19254
|
hidden = _ref2.hidden,
|
|
18757
19255
|
collapsible = _ref2.collapsible,
|
|
18758
19256
|
collapsed = _ref2.collapsed;
|
|
18759
|
-
|
|
19257
|
+
P(h(Panel, {
|
|
18760
19258
|
cssClasses: cssClasses,
|
|
18761
19259
|
hidden: hidden,
|
|
18762
19260
|
collapsible: collapsible,
|
|
@@ -18892,7 +19390,7 @@
|
|
|
18892
19390
|
}
|
|
18893
19391
|
},
|
|
18894
19392
|
dispose: function dispose() {
|
|
18895
|
-
|
|
19393
|
+
P(null, containerNode);
|
|
18896
19394
|
|
|
18897
19395
|
if (typeof widget.dispose === 'function') {
|
|
18898
19396
|
var _widget$dispose;
|
|
@@ -19016,12 +19514,12 @@
|
|
|
19016
19514
|
|
|
19017
19515
|
/** @jsx h */
|
|
19018
19516
|
|
|
19019
|
-
var _ref2 =
|
|
19517
|
+
var _ref2 = h("path", {
|
|
19020
19518
|
fill: "#5468FF",
|
|
19021
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"
|
|
19022
19520
|
});
|
|
19023
19521
|
|
|
19024
|
-
var _ref3 =
|
|
19522
|
+
var _ref3 = h("path", {
|
|
19025
19523
|
fill: "#FFF",
|
|
19026
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"
|
|
19027
19525
|
});
|
|
@@ -19030,15 +19528,15 @@
|
|
|
19030
19528
|
var url = _ref.url,
|
|
19031
19529
|
theme = _ref.theme,
|
|
19032
19530
|
cssClasses = _ref.cssClasses;
|
|
19033
|
-
return
|
|
19531
|
+
return h("div", {
|
|
19034
19532
|
className: cssClasses.root
|
|
19035
|
-
},
|
|
19533
|
+
}, h("a", {
|
|
19036
19534
|
href: url,
|
|
19037
19535
|
target: "_blank",
|
|
19038
19536
|
className: cssClasses.link,
|
|
19039
19537
|
"aria-label": "Search by Algolia",
|
|
19040
19538
|
rel: "noopener noreferrer"
|
|
19041
|
-
},
|
|
19539
|
+
}, h("svg", {
|
|
19042
19540
|
height: "1.2em",
|
|
19043
19541
|
className: cssClasses.logo,
|
|
19044
19542
|
viewBox: "0 0 168 24" // This style is necessary as long as it's not included in InstantSearch.css.
|
|
@@ -19047,10 +19545,10 @@
|
|
|
19047
19545
|
style: {
|
|
19048
19546
|
width: 'auto'
|
|
19049
19547
|
}
|
|
19050
|
-
},
|
|
19548
|
+
}, h("path", {
|
|
19051
19549
|
fill: theme === 'dark' ? '#FFF' : '#5D6494',
|
|
19052
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"
|
|
19053
|
-
}), _ref2, _ref3,
|
|
19551
|
+
}), _ref2, _ref3, h("path", {
|
|
19054
19552
|
fill: theme === 'dark' ? '#FFF' : '#5468FF',
|
|
19055
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"
|
|
19056
19554
|
}))));
|
|
@@ -19071,7 +19569,7 @@
|
|
|
19071
19569
|
if (isFirstRendering) {
|
|
19072
19570
|
var _widgetParams$theme = widgetParams.theme,
|
|
19073
19571
|
theme = _widgetParams$theme === void 0 ? 'light' : _widgetParams$theme;
|
|
19074
|
-
|
|
19572
|
+
P(h(PoweredBy, {
|
|
19075
19573
|
cssClasses: cssClasses,
|
|
19076
19574
|
url: url,
|
|
19077
19575
|
theme: theme
|
|
@@ -19110,7 +19608,7 @@
|
|
|
19110
19608
|
cssClasses: cssClasses
|
|
19111
19609
|
});
|
|
19112
19610
|
var makeWidget = connectPoweredBy(specializedRenderer, function () {
|
|
19113
|
-
return
|
|
19611
|
+
return P(null, containerNode);
|
|
19114
19612
|
});
|
|
19115
19613
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
19116
19614
|
theme: theme
|
|
@@ -19141,7 +19639,7 @@
|
|
|
19141
19639
|
var cssClasses = _ref.cssClasses,
|
|
19142
19640
|
templates = _ref.templates,
|
|
19143
19641
|
items = _ref.items;
|
|
19144
|
-
return
|
|
19642
|
+
return h(Template, {
|
|
19145
19643
|
templateKey: "default",
|
|
19146
19644
|
templates: templates,
|
|
19147
19645
|
rootProps: {
|
|
@@ -19170,7 +19668,7 @@
|
|
|
19170
19668
|
templates = _ref2.templates;
|
|
19171
19669
|
return function (_ref3) {
|
|
19172
19670
|
var items = _ref3.items;
|
|
19173
|
-
|
|
19671
|
+
P(h(QueryRuleCustomData, {
|
|
19174
19672
|
cssClasses: cssClasses,
|
|
19175
19673
|
templates: templates,
|
|
19176
19674
|
items: items
|
|
@@ -19208,7 +19706,7 @@
|
|
|
19208
19706
|
templates: templates
|
|
19209
19707
|
});
|
|
19210
19708
|
var makeWidget = connectQueryRules(specializedRenderer, function () {
|
|
19211
|
-
|
|
19709
|
+
P(null, containerNode);
|
|
19212
19710
|
});
|
|
19213
19711
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
19214
19712
|
transformItems: transformItems
|
|
@@ -19279,14 +19777,14 @@
|
|
|
19279
19777
|
var isDisabled = min && max ? min >= max : false;
|
|
19280
19778
|
var hasRefinements = Boolean(minValue || maxValue);
|
|
19281
19779
|
var rootClassNames = classnames(cssClasses.root, _defineProperty({}, cssClasses.noRefinement, !hasRefinements));
|
|
19282
|
-
return
|
|
19780
|
+
return h("div", {
|
|
19283
19781
|
className: rootClassNames
|
|
19284
|
-
},
|
|
19782
|
+
}, h("form", {
|
|
19285
19783
|
className: cssClasses.form,
|
|
19286
19784
|
onSubmit: this.onSubmit
|
|
19287
|
-
},
|
|
19785
|
+
}, h("label", {
|
|
19288
19786
|
className: cssClasses.label
|
|
19289
|
-
},
|
|
19787
|
+
}, h("input", {
|
|
19290
19788
|
className: classnames(cssClasses.input, cssClasses.inputMin),
|
|
19291
19789
|
type: "number",
|
|
19292
19790
|
min: min,
|
|
@@ -19296,15 +19794,15 @@
|
|
|
19296
19794
|
onInput: this.onInput('min'),
|
|
19297
19795
|
placeholder: min === null || min === void 0 ? void 0 : min.toString(),
|
|
19298
19796
|
disabled: isDisabled
|
|
19299
|
-
})),
|
|
19797
|
+
})), h(Template, _extends({}, templateProps, {
|
|
19300
19798
|
templateKey: "separatorText",
|
|
19301
19799
|
rootTagName: "span",
|
|
19302
19800
|
rootProps: {
|
|
19303
19801
|
className: cssClasses.separator
|
|
19304
19802
|
}
|
|
19305
|
-
})),
|
|
19803
|
+
})), h("label", {
|
|
19306
19804
|
className: cssClasses.label
|
|
19307
|
-
},
|
|
19805
|
+
}, h("input", {
|
|
19308
19806
|
className: classnames(cssClasses.input, cssClasses.inputMax),
|
|
19309
19807
|
type: "number",
|
|
19310
19808
|
min: min,
|
|
@@ -19314,7 +19812,7 @@
|
|
|
19314
19812
|
onInput: this.onInput('max'),
|
|
19315
19813
|
placeholder: max === null || max === void 0 ? void 0 : max.toString(),
|
|
19316
19814
|
disabled: isDisabled
|
|
19317
|
-
})),
|
|
19815
|
+
})), h(Template, _extends({}, templateProps, {
|
|
19318
19816
|
templateKey: "submitText",
|
|
19319
19817
|
rootTagName: "button",
|
|
19320
19818
|
rootProps: {
|
|
@@ -19327,15 +19825,19 @@
|
|
|
19327
19825
|
}]);
|
|
19328
19826
|
|
|
19329
19827
|
return RangeInput;
|
|
19330
|
-
}(
|
|
19828
|
+
}(d);
|
|
19331
19829
|
|
|
19332
19830
|
var withUsage$L = createDocumentationMessageGenerator({
|
|
19333
19831
|
name: 'range-input'
|
|
19334
19832
|
});
|
|
19335
19833
|
var suit$l = component('RangeInput');
|
|
19336
19834
|
var defaultTemplates$c = {
|
|
19337
|
-
separatorText:
|
|
19338
|
-
|
|
19835
|
+
separatorText: function separatorText() {
|
|
19836
|
+
return 'to';
|
|
19837
|
+
},
|
|
19838
|
+
submitText: function submitText() {
|
|
19839
|
+
return 'Go';
|
|
19840
|
+
}
|
|
19339
19841
|
};
|
|
19340
19842
|
|
|
19341
19843
|
var renderer$g = function renderer(_ref) {
|
|
@@ -19371,7 +19873,7 @@
|
|
|
19371
19873
|
min: minValue !== -Infinity && minValue !== rangeMin ? minValue : undefined,
|
|
19372
19874
|
max: maxValue !== Infinity && maxValue !== rangeMax ? maxValue : undefined
|
|
19373
19875
|
};
|
|
19374
|
-
|
|
19876
|
+
P(h(RangeInput, {
|
|
19375
19877
|
min: rangeMin,
|
|
19376
19878
|
max: rangeMax,
|
|
19377
19879
|
step: step,
|
|
@@ -19437,7 +19939,7 @@
|
|
|
19437
19939
|
renderState: {}
|
|
19438
19940
|
});
|
|
19439
19941
|
var makeWidget = connectRange(specializedRenderer, function () {
|
|
19440
|
-
return
|
|
19942
|
+
return P(null, containerNode);
|
|
19441
19943
|
});
|
|
19442
19944
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
19443
19945
|
attribute: attribute,
|
|
@@ -19495,14 +19997,14 @@
|
|
|
19495
19997
|
}
|
|
19496
19998
|
|
|
19497
19999
|
function Button(props) {
|
|
19498
|
-
return
|
|
20000
|
+
return h("button", _extends({}, props, {
|
|
19499
20001
|
type: "button"
|
|
19500
20002
|
}));
|
|
19501
20003
|
} // Preact doesn't have builtin types for Style, JSX.HTMLAttributes['style'] is just object
|
|
19502
20004
|
// maybe migrate to csstype later?
|
|
19503
20005
|
|
|
19504
20006
|
|
|
19505
|
-
var _ref6 =
|
|
20007
|
+
var _ref6 = h("div", {
|
|
19506
20008
|
className: "rheostat-background"
|
|
19507
20009
|
});
|
|
19508
20010
|
|
|
@@ -19532,7 +20034,7 @@
|
|
|
19532
20034
|
values: _this.props.values
|
|
19533
20035
|
});
|
|
19534
20036
|
|
|
19535
|
-
_defineProperty(_assertThisInitialized(_this), "rheostat",
|
|
20037
|
+
_defineProperty(_assertThisInitialized(_this), "rheostat", y());
|
|
19536
20038
|
|
|
19537
20039
|
_this.getPublicState = _this.getPublicState.bind(_assertThisInitialized(_this));
|
|
19538
20040
|
_this.getSliderBoundingBox = _this.getSliderBoundingBox.bind(_assertThisInitialized(_this));
|
|
@@ -20036,7 +20538,7 @@
|
|
|
20036
20538
|
className = _this$state6.className,
|
|
20037
20539
|
handlePos = _this$state6.handlePos,
|
|
20038
20540
|
values = _this$state6.values;
|
|
20039
|
-
return
|
|
20541
|
+
return h("div", {
|
|
20040
20542
|
className: className,
|
|
20041
20543
|
ref: this.rheostat,
|
|
20042
20544
|
onClick: disabled ? undefined : this.handleClick,
|
|
@@ -20051,7 +20553,7 @@
|
|
|
20051
20553
|
left: "".concat(pos, "%"),
|
|
20052
20554
|
position: 'absolute'
|
|
20053
20555
|
};
|
|
20054
|
-
return
|
|
20556
|
+
return h(Handle, {
|
|
20055
20557
|
"aria-valuemax": _this7.getMaxValue(idx),
|
|
20056
20558
|
"aria-valuemin": _this7.getMinValue(idx),
|
|
20057
20559
|
"aria-valuenow": values[idx],
|
|
@@ -20072,7 +20574,7 @@
|
|
|
20072
20574
|
return null;
|
|
20073
20575
|
}
|
|
20074
20576
|
|
|
20075
|
-
return
|
|
20577
|
+
return h(ProgressBar, {
|
|
20076
20578
|
className: "rheostat-progress",
|
|
20077
20579
|
key: "progress-bar-".concat(idx),
|
|
20078
20580
|
style: _this7.getProgressStyle(idx)
|
|
@@ -20086,7 +20588,7 @@
|
|
|
20086
20588
|
left: "".concat(pos, "%"),
|
|
20087
20589
|
position: 'absolute'
|
|
20088
20590
|
};
|
|
20089
|
-
return
|
|
20591
|
+
return h(PitComponent, {
|
|
20090
20592
|
key: "pit-".concat(n),
|
|
20091
20593
|
style: pitStyle
|
|
20092
20594
|
}, n);
|
|
@@ -20095,7 +20597,7 @@
|
|
|
20095
20597
|
}]);
|
|
20096
20598
|
|
|
20097
20599
|
return Rheostat;
|
|
20098
|
-
}(
|
|
20600
|
+
}(d);
|
|
20099
20601
|
|
|
20100
20602
|
_defineProperty(Rheostat, "defaultProps", {
|
|
20101
20603
|
className: '',
|
|
@@ -20128,14 +20630,14 @@
|
|
|
20128
20630
|
var shouldDisplayValue = [0, 50, 100].includes(positionValue);
|
|
20129
20631
|
var value = children;
|
|
20130
20632
|
var pitValue = Math.round(parseInt(value, 10) * 100) / 100;
|
|
20131
|
-
return
|
|
20633
|
+
return h("div", {
|
|
20132
20634
|
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
20133
20635
|
marginLeft: positionValue === 100 ? '-2px' : 0
|
|
20134
20636
|
}),
|
|
20135
20637
|
className: classnames('rheostat-marker', 'rheostat-marker-horizontal', {
|
|
20136
20638
|
'rheostat-marker-large': shouldDisplayValue
|
|
20137
20639
|
})
|
|
20138
|
-
}, shouldDisplayValue &&
|
|
20640
|
+
}, shouldDisplayValue && h("div", {
|
|
20139
20641
|
className: 'rheostat-value'
|
|
20140
20642
|
}, pitValue));
|
|
20141
20643
|
};
|
|
@@ -20175,9 +20677,9 @@
|
|
|
20175
20677
|
'rheostat-handle-lower': props['data-handle-key'] === 0,
|
|
20176
20678
|
'rheostat-handle-upper': props['data-handle-key'] === 1
|
|
20177
20679
|
});
|
|
20178
|
-
return
|
|
20680
|
+
return h("div", _extends({}, props, {
|
|
20179
20681
|
className: className
|
|
20180
|
-
}), tooltips &&
|
|
20682
|
+
}), tooltips && h("div", {
|
|
20181
20683
|
className: "rheostat-tooltip"
|
|
20182
20684
|
}, value));
|
|
20183
20685
|
};
|
|
@@ -20247,9 +20749,9 @@
|
|
|
20247
20749
|
min: min,
|
|
20248
20750
|
max: max
|
|
20249
20751
|
});
|
|
20250
|
-
return
|
|
20752
|
+
return h("div", {
|
|
20251
20753
|
className: classnames(cssClasses.root, _defineProperty({}, cssClasses.disabledRoot, this.isDisabled))
|
|
20252
|
-
},
|
|
20754
|
+
}, h(Rheostat, {
|
|
20253
20755
|
handle: this.createHandleComponent(tooltips),
|
|
20254
20756
|
onChange: this.handleChange,
|
|
20255
20757
|
min: min,
|
|
@@ -20265,7 +20767,7 @@
|
|
|
20265
20767
|
}]);
|
|
20266
20768
|
|
|
20267
20769
|
return Slider;
|
|
20268
|
-
}(
|
|
20770
|
+
}(d);
|
|
20269
20771
|
|
|
20270
20772
|
var withUsage$M = createDocumentationMessageGenerator({
|
|
20271
20773
|
name: 'range-slider'
|
|
@@ -20301,7 +20803,7 @@
|
|
|
20301
20803
|
// backward compatible so we still need to pass [-Infinity, Infinity]
|
|
20302
20804
|
|
|
20303
20805
|
var values = [minFinite > maxRange ? maxRange : minFinite, maxFinite < minRange ? minRange : maxFinite];
|
|
20304
|
-
|
|
20806
|
+
P(h(Slider, {
|
|
20305
20807
|
cssClasses: cssClasses,
|
|
20306
20808
|
refine: refine,
|
|
20307
20809
|
min: minRange,
|
|
@@ -20360,7 +20862,7 @@
|
|
|
20360
20862
|
cssClasses: cssClasses
|
|
20361
20863
|
});
|
|
20362
20864
|
var makeWidget = connectRange(specializedRenderer, function () {
|
|
20363
|
-
return
|
|
20865
|
+
return P(null, containerNode);
|
|
20364
20866
|
});
|
|
20365
20867
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
20366
20868
|
attribute: attribute,
|
|
@@ -20373,8 +20875,58 @@
|
|
|
20373
20875
|
});
|
|
20374
20876
|
};
|
|
20375
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
|
+
|
|
20376
20902
|
var defaultTemplates$d = {
|
|
20377
|
-
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
|
+
}
|
|
20378
20930
|
};
|
|
20379
20931
|
|
|
20380
20932
|
var withUsage$N = createDocumentationMessageGenerator({
|
|
@@ -20382,11 +20934,11 @@
|
|
|
20382
20934
|
});
|
|
20383
20935
|
var suit$n = component('RatingMenu');
|
|
20384
20936
|
|
|
20385
|
-
var _ref3$1 =
|
|
20937
|
+
var _ref3$1 = h("path", {
|
|
20386
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"
|
|
20387
20939
|
});
|
|
20388
20940
|
|
|
20389
|
-
var _ref4 =
|
|
20941
|
+
var _ref4 = h("path", {
|
|
20390
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"
|
|
20391
20943
|
});
|
|
20392
20944
|
|
|
@@ -20410,20 +20962,20 @@
|
|
|
20410
20962
|
return;
|
|
20411
20963
|
}
|
|
20412
20964
|
|
|
20413
|
-
|
|
20965
|
+
P(h(RefinementList$1, {
|
|
20414
20966
|
createURL: createURL,
|
|
20415
20967
|
cssClasses: cssClasses,
|
|
20416
20968
|
facetValues: items,
|
|
20417
20969
|
templateProps: renderState.templateProps,
|
|
20418
20970
|
toggleRefinement: refine
|
|
20419
|
-
},
|
|
20971
|
+
}, h("svg", {
|
|
20420
20972
|
style: "display:none;"
|
|
20421
|
-
},
|
|
20973
|
+
}, h("symbol", {
|
|
20422
20974
|
id: suit$n({
|
|
20423
20975
|
descendantName: 'starSymbol'
|
|
20424
20976
|
}),
|
|
20425
20977
|
viewBox: "0 0 24 24"
|
|
20426
|
-
}, _ref3$1),
|
|
20978
|
+
}, _ref3$1), h("symbol", {
|
|
20427
20979
|
id: suit$n({
|
|
20428
20980
|
descendantName: 'starEmptySymbol'
|
|
20429
20981
|
}),
|
|
@@ -20522,7 +21074,7 @@
|
|
|
20522
21074
|
templates: templates
|
|
20523
21075
|
});
|
|
20524
21076
|
var makeWidget = connectRatingMenu(specializedRenderer, function () {
|
|
20525
|
-
return
|
|
21077
|
+
return P(null, containerNode);
|
|
20526
21078
|
});
|
|
20527
21079
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
20528
21080
|
attribute: attribute,
|
|
@@ -20532,16 +21084,101 @@
|
|
|
20532
21084
|
});
|
|
20533
21085
|
};
|
|
20534
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
|
+
|
|
20535
21119
|
var defaultTemplate = {
|
|
20536
|
-
reset:
|
|
20537
|
-
|
|
20538
|
-
|
|
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
|
+
}
|
|
20539
21148
|
};
|
|
20540
21149
|
|
|
21150
|
+
/** @jsx h */
|
|
20541
21151
|
var defaultTemplates$e = {
|
|
20542
|
-
item:
|
|
20543
|
-
|
|
20544
|
-
|
|
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
|
+
}
|
|
20545
21182
|
};
|
|
20546
21183
|
|
|
20547
21184
|
var withUsage$O = createDocumentationMessageGenerator({
|
|
@@ -20586,7 +21223,7 @@
|
|
|
20586
21223
|
return;
|
|
20587
21224
|
}
|
|
20588
21225
|
|
|
20589
|
-
|
|
21226
|
+
P(h(RefinementList$1, {
|
|
20590
21227
|
createURL: createURL,
|
|
20591
21228
|
cssClasses: cssClasses,
|
|
20592
21229
|
facetValues: items,
|
|
@@ -20738,7 +21375,7 @@
|
|
|
20738
21375
|
showMore: showMore
|
|
20739
21376
|
});
|
|
20740
21377
|
var makeWidget = connectRefinementList(specializedRenderer, function () {
|
|
20741
|
-
return
|
|
21378
|
+
return P(null, containerNode);
|
|
20742
21379
|
});
|
|
20743
21380
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
20744
21381
|
attribute: attribute,
|
|
@@ -20762,9 +21399,9 @@
|
|
|
20762
21399
|
isRelevantSorted = _ref.isRelevantSorted,
|
|
20763
21400
|
isVirtualReplica = _ref.isVirtualReplica,
|
|
20764
21401
|
refine = _ref.refine;
|
|
20765
|
-
return isVirtualReplica ?
|
|
21402
|
+
return isVirtualReplica ? h("div", {
|
|
20766
21403
|
className: cssClasses.root
|
|
20767
|
-
},
|
|
21404
|
+
}, h(Template, {
|
|
20768
21405
|
templateKey: "text",
|
|
20769
21406
|
templates: templates,
|
|
20770
21407
|
rootProps: {
|
|
@@ -20773,7 +21410,7 @@
|
|
|
20773
21410
|
data: {
|
|
20774
21411
|
isRelevantSorted: isRelevantSorted
|
|
20775
21412
|
}
|
|
20776
|
-
}),
|
|
21413
|
+
}), h("button", {
|
|
20777
21414
|
type: "button",
|
|
20778
21415
|
className: cssClasses.button,
|
|
20779
21416
|
onClick: function onClick() {
|
|
@@ -20783,7 +21420,7 @@
|
|
|
20783
21420
|
refine(undefined);
|
|
20784
21421
|
}
|
|
20785
21422
|
}
|
|
20786
|
-
},
|
|
21423
|
+
}, h(Template, {
|
|
20787
21424
|
rootTagName: "span",
|
|
20788
21425
|
templateKey: "button",
|
|
20789
21426
|
templates: templates,
|
|
@@ -20794,7 +21431,9 @@
|
|
|
20794
21431
|
};
|
|
20795
21432
|
|
|
20796
21433
|
var defaultTemplates$f = {
|
|
20797
|
-
text:
|
|
21434
|
+
text: function text() {
|
|
21435
|
+
return '';
|
|
21436
|
+
},
|
|
20798
21437
|
button: function button(_ref) {
|
|
20799
21438
|
var isRelevantSorted = _ref.isRelevantSorted;
|
|
20800
21439
|
return isRelevantSorted ? 'See all results' : 'See relevant results';
|
|
@@ -20814,7 +21453,7 @@
|
|
|
20814
21453
|
var isRelevantSorted = _ref2.isRelevantSorted,
|
|
20815
21454
|
isVirtualReplica = _ref2.isVirtualReplica,
|
|
20816
21455
|
refine = _ref2.refine;
|
|
20817
|
-
|
|
21456
|
+
P(h(RelevantSort, {
|
|
20818
21457
|
cssClasses: cssClasses,
|
|
20819
21458
|
templates: templates,
|
|
20820
21459
|
isRelevantSorted: isRelevantSorted,
|
|
@@ -20855,7 +21494,7 @@
|
|
|
20855
21494
|
templates: templates
|
|
20856
21495
|
});
|
|
20857
21496
|
var makeWidget = connectRelevantSort(specializedRenderer, function () {
|
|
20858
|
-
|
|
21497
|
+
P(null, containerNode);
|
|
20859
21498
|
});
|
|
20860
21499
|
return _objectSpread2(_objectSpread2({}, makeWidget({})), {}, {
|
|
20861
21500
|
$$widgetType: 'ais.relevantSort'
|
|
@@ -20881,7 +21520,7 @@
|
|
|
20881
21520
|
var refine = _ref2.refine,
|
|
20882
21521
|
query = _ref2.query,
|
|
20883
21522
|
isSearchStalled = _ref2.isSearchStalled;
|
|
20884
|
-
|
|
21523
|
+
P(h(SearchBox, {
|
|
20885
21524
|
query: query,
|
|
20886
21525
|
placeholder: placeholder,
|
|
20887
21526
|
autofocus: autofocus,
|
|
@@ -20974,7 +21613,7 @@
|
|
|
20974
21613
|
showLoadingIndicator: showLoadingIndicator
|
|
20975
21614
|
});
|
|
20976
21615
|
var makeWidget = connectSearchBox(specializedRenderer, function () {
|
|
20977
|
-
return
|
|
21616
|
+
return P(null, containerNode);
|
|
20978
21617
|
});
|
|
20979
21618
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
20980
21619
|
queryHook: queryHook
|
|
@@ -21000,9 +21639,9 @@
|
|
|
21000
21639
|
return;
|
|
21001
21640
|
}
|
|
21002
21641
|
|
|
21003
|
-
|
|
21642
|
+
P(h("div", {
|
|
21004
21643
|
className: cssClasses.root
|
|
21005
|
-
},
|
|
21644
|
+
}, h(Selector, {
|
|
21006
21645
|
cssClasses: cssClasses,
|
|
21007
21646
|
currentValue: currentRefinement,
|
|
21008
21647
|
options: options,
|
|
@@ -21043,7 +21682,7 @@
|
|
|
21043
21682
|
cssClasses: cssClasses
|
|
21044
21683
|
});
|
|
21045
21684
|
var makeWidget = connectSortBy(specializedRenderer, function () {
|
|
21046
|
-
return
|
|
21685
|
+
return P(null, containerNode);
|
|
21047
21686
|
});
|
|
21048
21687
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
21049
21688
|
container: containerNode,
|
|
@@ -21061,9 +21700,9 @@
|
|
|
21061
21700
|
templateProps = _ref.templateProps,
|
|
21062
21701
|
rest = _objectWithoutProperties(_ref, ["nbHits", "nbSortedHits", "cssClasses", "templateProps"]);
|
|
21063
21702
|
|
|
21064
|
-
return
|
|
21703
|
+
return h("div", {
|
|
21065
21704
|
className: classnames(cssClasses.root)
|
|
21066
|
-
},
|
|
21705
|
+
}, h(Template, _extends({}, templateProps, {
|
|
21067
21706
|
templateKey: "text",
|
|
21068
21707
|
rootTagName: "span",
|
|
21069
21708
|
rootProps: {
|
|
@@ -21088,24 +21727,70 @@
|
|
|
21088
21727
|
});
|
|
21089
21728
|
var suit$s = component('Stats');
|
|
21090
21729
|
var defaultTemplates$g = {
|
|
21091
|
-
text:
|
|
21730
|
+
text: function text(props) {
|
|
21731
|
+
return "".concat(props.areHitsSorted ? getSortedResultsSentence(props) : getResultsSentence(props), " found in ").concat(props.processingTimeMS, "ms");
|
|
21732
|
+
}
|
|
21092
21733
|
};
|
|
21093
21734
|
|
|
21094
|
-
|
|
21095
|
-
var
|
|
21096
|
-
|
|
21097
|
-
|
|
21098
|
-
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21106
|
-
|
|
21107
|
-
|
|
21108
|
-
|
|
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;
|
|
21109
21794
|
|
|
21110
21795
|
if (isFirstRendering) {
|
|
21111
21796
|
renderState.templateProps = prepareTemplateProps({
|
|
@@ -21116,7 +21801,7 @@
|
|
|
21116
21801
|
return;
|
|
21117
21802
|
}
|
|
21118
21803
|
|
|
21119
|
-
|
|
21804
|
+
P(h(Stats, {
|
|
21120
21805
|
cssClasses: cssClasses,
|
|
21121
21806
|
hitsPerPage: hitsPerPage,
|
|
21122
21807
|
nbHits: nbHits,
|
|
@@ -21139,12 +21824,12 @@
|
|
|
21139
21824
|
|
|
21140
21825
|
|
|
21141
21826
|
var stats = function stats(widgetParams) {
|
|
21142
|
-
var
|
|
21143
|
-
container =
|
|
21144
|
-
|
|
21145
|
-
userCssClasses =
|
|
21146
|
-
|
|
21147
|
-
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;
|
|
21148
21833
|
|
|
21149
21834
|
if (!container) {
|
|
21150
21835
|
throw new Error(withUsage$S('The `container` option is required.'));
|
|
@@ -21164,7 +21849,7 @@
|
|
|
21164
21849
|
renderState: {}
|
|
21165
21850
|
});
|
|
21166
21851
|
var makeWidget = connectStats(specializedRenderer, function () {
|
|
21167
|
-
return
|
|
21852
|
+
return P(null, containerNode);
|
|
21168
21853
|
});
|
|
21169
21854
|
return _objectSpread2(_objectSpread2({}, makeWidget({})), {}, {
|
|
21170
21855
|
$$widgetType: 'ais.stats'
|
|
@@ -21176,11 +21861,11 @@
|
|
|
21176
21861
|
refine = _ref.refine,
|
|
21177
21862
|
cssClasses = _ref.cssClasses,
|
|
21178
21863
|
templateProps = _ref.templateProps;
|
|
21179
|
-
return
|
|
21864
|
+
return h("div", {
|
|
21180
21865
|
className: cssClasses.root
|
|
21181
|
-
},
|
|
21866
|
+
}, h("label", {
|
|
21182
21867
|
className: cssClasses.label
|
|
21183
|
-
},
|
|
21868
|
+
}, h("input", {
|
|
21184
21869
|
className: cssClasses.checkbox,
|
|
21185
21870
|
type: "checkbox",
|
|
21186
21871
|
checked: currentRefinement.isRefined,
|
|
@@ -21189,7 +21874,7 @@
|
|
|
21189
21874
|
isRefined: !event.target.checked
|
|
21190
21875
|
});
|
|
21191
21876
|
}
|
|
21192
|
-
}),
|
|
21877
|
+
}), h(Template, _extends({}, templateProps, {
|
|
21193
21878
|
rootTagName: "span",
|
|
21194
21879
|
rootProps: {
|
|
21195
21880
|
className: cssClasses.labelText
|
|
@@ -21200,7 +21885,10 @@
|
|
|
21200
21885
|
};
|
|
21201
21886
|
|
|
21202
21887
|
var defaultTemplates$h = {
|
|
21203
|
-
labelText:
|
|
21888
|
+
labelText: function labelText(_ref) {
|
|
21889
|
+
var name = _ref.name;
|
|
21890
|
+
return name;
|
|
21891
|
+
}
|
|
21204
21892
|
};
|
|
21205
21893
|
|
|
21206
21894
|
var withUsage$T = createDocumentationMessageGenerator({
|
|
@@ -21227,7 +21915,7 @@
|
|
|
21227
21915
|
return;
|
|
21228
21916
|
}
|
|
21229
21917
|
|
|
21230
|
-
|
|
21918
|
+
P(h(ToggleRefinement, {
|
|
21231
21919
|
cssClasses: cssClasses,
|
|
21232
21920
|
currentRefinement: value,
|
|
21233
21921
|
templateProps: renderState.templateProps,
|
|
@@ -21284,7 +21972,7 @@
|
|
|
21284
21972
|
templates: templates
|
|
21285
21973
|
});
|
|
21286
21974
|
var makeWidget = connectToggleRefinement(specializedRenderer, function () {
|
|
21287
|
-
return
|
|
21975
|
+
return P(null, containerNode);
|
|
21288
21976
|
});
|
|
21289
21977
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
21290
21978
|
attribute: attribute,
|
|
@@ -21317,9 +22005,9 @@
|
|
|
21317
22005
|
transcript = voiceListeningState.transcript,
|
|
21318
22006
|
isSpeechFinal = voiceListeningState.isSpeechFinal,
|
|
21319
22007
|
errorCode = voiceListeningState.errorCode;
|
|
21320
|
-
return
|
|
22008
|
+
return h("div", {
|
|
21321
22009
|
className: cssClasses.root
|
|
21322
|
-
},
|
|
22010
|
+
}, h(Template, {
|
|
21323
22011
|
templateKey: "buttonText",
|
|
21324
22012
|
rootTagName: "button",
|
|
21325
22013
|
rootProps: {
|
|
@@ -21338,7 +22026,7 @@
|
|
|
21338
22026
|
isBrowserSupported: isBrowserSupported
|
|
21339
22027
|
},
|
|
21340
22028
|
templates: templates
|
|
21341
|
-
}),
|
|
22029
|
+
}), h(Template, {
|
|
21342
22030
|
templateKey: "status",
|
|
21343
22031
|
rootProps: {
|
|
21344
22032
|
className: cssClasses.status
|
|
@@ -21355,22 +22043,93 @@
|
|
|
21355
22043
|
}));
|
|
21356
22044
|
};
|
|
21357
22045
|
|
|
21358
|
-
|
|
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
|
+
|
|
21359
22092
|
if (status === 'error' && errorCode === 'not-allowed') {
|
|
21360
|
-
return
|
|
22093
|
+
return _ref2$2;
|
|
21361
22094
|
}
|
|
21362
22095
|
|
|
21363
|
-
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);
|
|
21364
22100
|
};
|
|
21365
22101
|
|
|
21366
22102
|
var defaultTemplates$i = {
|
|
21367
|
-
buttonText: function buttonText(
|
|
21368
|
-
var status =
|
|
21369
|
-
errorCode =
|
|
21370
|
-
isListening =
|
|
21371
|
-
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
|
+
}));
|
|
21372
22128
|
},
|
|
21373
|
-
status:
|
|
22129
|
+
status: function status(_ref7) {
|
|
22130
|
+
var transcript = _ref7.transcript;
|
|
22131
|
+
return h("p", null, transcript);
|
|
22132
|
+
}
|
|
21374
22133
|
};
|
|
21375
22134
|
|
|
21376
22135
|
var withUsage$U = createDocumentationMessageGenerator({
|
|
@@ -21387,7 +22146,7 @@
|
|
|
21387
22146
|
isListening = _ref2.isListening,
|
|
21388
22147
|
toggleListening = _ref2.toggleListening,
|
|
21389
22148
|
voiceListeningState = _ref2.voiceListeningState;
|
|
21390
|
-
|
|
22149
|
+
P(h(VoiceSearch, {
|
|
21391
22150
|
cssClasses: cssClasses,
|
|
21392
22151
|
templates: templates,
|
|
21393
22152
|
isBrowserSupported: isBrowserSupported,
|
|
@@ -21434,7 +22193,7 @@
|
|
|
21434
22193
|
templates: templates
|
|
21435
22194
|
});
|
|
21436
22195
|
var makeWidget = connectVoiceSearch(specializedRenderer, function () {
|
|
21437
|
-
return
|
|
22196
|
+
return P(null, containerNode);
|
|
21438
22197
|
});
|
|
21439
22198
|
return _objectSpread2(_objectSpread2({}, makeWidget({
|
|
21440
22199
|
container: containerNode,
|