@algolia/recommend-react
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -9,1 +9,2 @@ export * from './FrequentlyBoughtTogether'; | ||
export * from './useTrendingFacets'; | ||
export * from './useTrendingItems'; |
@@ -8,2 +8,3 @@ export * from './FrequentlyBoughtTogether'; | ||
export * from './useRelatedProducts'; | ||
export * from './useTrendingFacets'; | ||
export * from './useTrendingFacets'; | ||
export * from './useTrendingItems'; |
@@ -1,1 +0,1 @@ | ||
export declare const version = "1.5.0"; | ||
export declare const version = "1.6.0"; |
@@ -1,1 +0,1 @@ | ||
export var version = '1.5.0'; | ||
export var version = '1.6.0'; |
@@ -1,3 +0,3 @@ | ||
/*! @algolia/recommend-react 1.5.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/recommend */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend-react"]={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function i(e){var t=e.createElement,n=e.Fragment;return function(e){return 0===e.recommendations.length&&"idle"===e.status?t(e.Fallback,null):t("section",{className:c("auc-Recommend",e.classNames.root)},t(e.Header,{classNames:e.classNames,recommendations:e.recommendations,translations:e.translations,createElement:t,Fragment:n}),t(e.View,null))}}function s(e){var t=e.createElement;return function(e){return!e.recommendations||e.recommendations.length<1?null:e.translations.title?t("h3",{className:c("auc-Recommend-title",e.classNames.title)},e.translations.title):null}}function m(e){var t=e.createElement,n=e.Fragment;return function(e){return t("div",{className:c("auc-Recommend-container",e.classNames.container)},t("ol",{className:c("auc-Recommend-list",e.classNames.list)},e.items.map((function(r){return t("li",{key:r.objectID,className:c("auc-Recommend-item",e.classNames.item)},t(e.itemComponent,{createElement:t,Fragment:n,item:r}))}))))}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],c=!0,i=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){i=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(i)throw a}}return o}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e){var t=e.hits,n=e.maxRecommendations,r=e.nrOfObjs,a={};return t.forEach((function(e){e.forEach((function(e,t){a[e.objectID]?a[e.objectID]={indexSum:a[e.objectID].indexSum+t,nr:a[e.objectID].nr+1}:a[e.objectID]={indexSum:t,nr:1}}))})),function(e,t){for(var n=[],r=0,a=Object.keys(e);r<a.length;r++){var o=a[r];e[o].nr<2&&(e[o].indexSum+=100),n.push({objectID:o,avgOfIndices:e[o].indexSum/t})}return n.sort((function(e,t){return e.avgOfIndices>t.avgOfIndices?1:-1}))}(a,r).reduce((function(e,n){var r=t.flat().find((function(e){return e.objectID===n.objectID}));return r?e.concat(r):e}),[]).slice(0,n&&n>0?n:void 0)}function y(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){var t,n,r,a=e.hits,o=e.maxRecommendations;return(t=function(e,t){return(e._score||0)>(t._score||0)?-1:1},n=a,r=y(n),r.sort(t),r).slice(0,o&&o>0?o:void 0)}var j="1.5.0";function v(e){t.useEffect((function(){e.recommendClient.addAlgoliaAgent("recommend-react","1.5.0")}),[e.recommendClient])}var P=Object.prototype.hasOwnProperty;function w(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&w(e[r],t[r]););return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(P.call(e,n)&&++r&&!P.call(t,n))return!1;if(!(n in t)||!w(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function E(e){var n=O(t.useState((function(){return e})),2),r=n[0],a=n[1];return t.useEffect((function(){!1===w(r,e)&&a(e)}),[e]),r}function D(e){var n=t.useRef(void 0),r=O(t.useState(e),2),a=r[0],o=r[1];return t.useEffect((function(){"stalled"!==a&&n.current&&clearTimeout(n.current),"loading"===a&&(n.current=setTimeout((function(){o("stalled")}),300))}),[a]),{status:a,setStatus:o}}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e){var n=e.indexName,r=e.maxRecommendations,a=e.objectIDs,o=e.queryParameters,c=e.recommendClient,i=e.threshold,s=e.transformItems,m=O(t.useState({recommendations:[]}),2),u=m[0],l=m[1],f=D("loading"),d=f.status,b=f.setStatus,p=E(a),y=E(s),h=E(o);return v({recommendClient:c}),t.useEffect((function(){b("loading"),function(e){var t=e.objectIDs,n=e.recommendClient,r=e.transformItems,a=void 0===r?function(e){return e}:r,o=e.indexName,c=e.maxRecommendations,i=e.queryParameters,s=e.threshold,m=t.map((function(e){return{indexName:o,maxRecommendations:c,objectID:e,queryParameters:i,threshold:s}}));return n.addAlgoliaAgent("recommend-core",j),n.getFrequentlyBoughtTogether(m).then((function(e){return g({maxRecommendations:c,hits:e.results.map((function(e){return e.hits})),nrOfObjs:t.length})})).then((function(e){return{recommendations:a(e)}}))}({indexName:n,maxRecommendations:r,objectIDs:p,queryParameters:h,recommendClient:c,threshold:i,transformItems:y}).then((function(e){l(e),b("idle")}))}),[n,r,p,h,c,b,i,y]),x(x({},u),{},{status:d})}var I,S,R,C=(I={createElement:t.createElement,Fragment:t.Fragment},S=I.createElement,R=I.Fragment,function(e){var t,n,r,c,l,f=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Frequently bought together",sliderLabel:"Frequently bought together products"},e.translations),d=null!==(t=e.classNames)&&void 0!==t?t:{},b=null!==(n=e.children)&&void 0!==n?n:i({createElement:S,Fragment:R}),p=null!==(r=e.fallbackComponent)&&void 0!==r?r:function(){return null},O=null!==(c=e.headerComponent)&&void 0!==c?c:s({createElement:S,Fragment:R}),g=null!==(l=e.view)&&void 0!==l?l:m({createElement:S,Fragment:R});return b({classNames:d,Fallback:function(){return S(p,{Fragment:R,createElement:S})},Header:O,recommendations:e.items,status:e.status,translations:f,View:function(t){return S(g,a({classNames:d,itemComponent:e.itemComponent,items:e.items,translations:f},t))}})});function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A(e){var n=e.fallbackParameters,r=e.indexName,a=e.maxRecommendations,o=e.objectIDs,c=e.queryParameters,i=e.recommendClient,s=e.threshold,m=e.transformItems,u=O(t.useState({recommendations:[]}),2),l=u[0],f=u[1],d=D("loading"),b=d.status,p=d.setStatus,y=E(o),h=E(m),P=E(c),w=E(n);return v({recommendClient:i}),t.useEffect((function(){p("loading"),function(e){var t=e.objectIDs,n=e.recommendClient,r=e.transformItems,a=void 0===r?function(e){return e}:r,o=e.fallbackParameters,c=e.indexName,i=e.maxRecommendations,s=e.queryParameters,m=e.threshold,u=t.map((function(e){return{fallbackParameters:o,indexName:c,maxRecommendations:i,objectID:e,queryParameters:s,threshold:m}}));return n.addAlgoliaAgent("recommend-core",j),n.getRelatedProducts(u).then((function(e){return g({maxRecommendations:i,hits:e.results.map((function(e){return e.hits})),nrOfObjs:t.length})})).then((function(e){return{recommendations:a(e)}}))}({fallbackParameters:w,indexName:r,maxRecommendations:a,objectIDs:y,queryParameters:P,recommendClient:i,threshold:s,transformItems:h}).then((function(e){f(e),p("idle")}))}),[w,r,a,y,P,i,p,s,h]),q(q({},l),{},{status:b})}var T=function(e){var t=e.createElement,n=e.Fragment;return function(e){var r,c,u,f,d,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Related products",sliderLabel:"Related products"},e.translations),p=null!==(r=e.classNames)&&void 0!==r?r:{},O=null!==(c=e.children)&&void 0!==c?c:i({createElement:t,Fragment:n}),g=null!==(u=e.fallbackComponent)&&void 0!==u?u:function(){return null},y=null!==(f=e.headerComponent)&&void 0!==f?f:s({createElement:t,Fragment:n}),h=null!==(d=e.view)&&void 0!==d?d:m({createElement:t,Fragment:n});return O({classNames:p,Fallback:function(){return t(g,{Fragment:n,createElement:t})},Header:y,recommendations:e.items,status:e.status,translations:b,View:function(n){return t(h,a({classNames:p,itemComponent:e.itemComponent,items:e.items,translations:b},n))}})}}({createElement:t.createElement,Fragment:t.Fragment});function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(e){var n=e.fallbackParameters,r=e.indexName,a=e.maxRecommendations,o=e.queryParameters,c=e.recommendClient,i=e.threshold,s=e.transformItems,m=e.facetName,u=O(t.useState({recommendations:[]}),2),l=u[0],f=u[1],d=D("loading"),b=d.status,p=d.setStatus,g=E(s),y=E(o),P=E(n);return v({recommendClient:c}),t.useEffect((function(){p("loading"),function(e){var t=e.recommendClient,n=e.transformItems,r=void 0===n?function(e){return e}:n,a=e.fallbackParameters,o=e.indexName,c=e.maxRecommendations,i=e.queryParameters,s=e.threshold,m=e.facetName,u={fallbackParameters:a,indexName:o,maxRecommendations:c,queryParameters:i,threshold:s,facetName:m};return t.addAlgoliaAgent("recommend-core",j),t.getTrendingFacets([u]).then((function(e){return h({maxRecommendations:c,hits:e.results.map((function(e){return e.hits})).flat()})})).then((function(e){return{recommendations:r(e)}}))}({recommendClient:c,transformItems:g,fallbackParameters:P,indexName:r,maxRecommendations:a,queryParameters:y,threshold:i,facetName:m}).then((function(e){f(e),p("idle")}))}),[P,r,a,y,c,p,i,g,m]),H(H({},l),{},{status:b})}var L=function(e){var t=e.createElement,n=e.Fragment;return function(e){var r,m,u,l,d,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Trending facets",sliderLabel:"Trending facets"},e.translations),p=null!==(r=e.classNames)&&void 0!==r?r:{},O=null!==(m=e.children)&&void 0!==m?m:i({createElement:t,Fragment:n}),g=null!==(u=e.fallbackComponent)&&void 0!==u?u:function(){return null},y=null!==(l=e.headerComponent)&&void 0!==l?l:s({createElement:t,Fragment:n}),h=null!==(d=e.view)&&void 0!==d?d:function(e){var t=e.createElement,n=e.Fragment;return function(e){return t("div",{className:c("auc-Recommend-container",e.classNames.container)},t("ol",{className:c("auc-Recommend-list",e.classNames.list)},e.items.map((function(r){return t("li",{key:r.facetValue,className:c("auc-Recommend-item",e.classNames.item)},t(e.itemComponent,{createElement:t,Fragment:n,item:r}))}))))}}({createElement:t,Fragment:n});return O({classNames:p,Fallback:function(){return t(g,{Fragment:n,createElement:t})},Header:y,recommendations:e.items,status:e.status,translations:b,View:function(n){return t(h,a({classNames:p,itemComponent:e.itemComponent,items:e.items,translations:b},n))}})}}({createElement:t.createElement,Fragment:t.Fragment});function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e){var n=e.fallbackParameters,r=e.indexName,a=e.maxRecommendations,o=e.queryParameters,c=e.recommendClient,i=e.threshold,s=e.transformItems,m=e.facetName,u=e.facetValue,l=O(t.useState({recommendations:[]}),2),f=l[0],d=l[1],b=D("loading"),p=b.status,g=b.setStatus,P=E(s),w=E(o),N=E(n);return v({recommendClient:c}),t.useEffect((function(){g("loading"),function(e){var t=e.recommendClient,n=e.transformItems,r=void 0===n?function(e){return e}:n,a=e.fallbackParameters,o=e.indexName,c=e.maxRecommendations,i=e.queryParameters,s=e.threshold,m=e.facetName,u=e.facetValue,l={fallbackParameters:a,indexName:o,maxRecommendations:c,queryParameters:i,threshold:s,facetName:m,facetValue:u};return t.addAlgoliaAgent("recommend-core",j),t.getTrendingItems([l]).then((function(e){return h({maxRecommendations:c,hits:(t="objectID",n=e.results.map((function(e){return e.hits})).flat(),y(new Map(n.map((function(e){return[e[t],e]}))).values()))});var t,n})).then((function(e){return{recommendations:r(e)}}))}({recommendClient:c,transformItems:P,fallbackParameters:N,indexName:r,maxRecommendations:a,queryParameters:w,threshold:i,facetName:m,facetValue:u}).then((function(e){d(e),g("idle")}))}),[N,r,a,w,c,g,i,P,m,u]),M(M({},f),{},{status:p})}var $=function(e){var t=e.createElement,n=e.Fragment;return function(e){var r,c,u,l,f,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Trending items",sliderLabel:"Trending items"},e.translations),p=null!==(r=e.classNames)&&void 0!==r?r:{},O=null!==(c=e.children)&&void 0!==c?c:i({createElement:t,Fragment:n}),g=null!==(u=e.fallbackComponent)&&void 0!==u?u:function(){return null},y=null!==(l=e.headerComponent)&&void 0!==l?l:s({createElement:t,Fragment:n}),h=null!==(f=e.view)&&void 0!==f?f:m({createElement:t,Fragment:n});return O({classNames:p,Fallback:function(){return t(g,{Fragment:n,createElement:t})},Header:y,recommendations:e.items,status:e.status,translations:b,View:function(n){return t(h,a({classNames:p,itemComponent:e.itemComponent,items:e.items,translations:b},n))}})}}({createElement:t.createElement,Fragment:t.Fragment});function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}e.FrequentlyBoughtTogether=function(e){var t=F(e),n=t.recommendations,o=t.status;return r.default.createElement(C,a({},e,{items:n,status:o}))},e.RelatedProducts=function(e){var t=A(e),n=t.recommendations,o=t.status;return r.default.createElement(T,a({},e,{items:n,status:o}))},e.TrendingFacets=function(e){var t=B(e),n=t.recommendations,o=t.status;return r.default.createElement(L,a({},e,{items:n,status:o}))},e.TrendingItems=function(e){var t=U(e),n=t.recommendations,o=t.status;return r.default.createElement($,a({},e,{items:n,status:o}))},e.useFrequentlyBoughtTogether=F,e.useRecommendations=function(e){var n=e.fallbackParameters,r=e.indexName,a=e.maxRecommendations,o=e.model,c=e.objectIDs,i=e.queryParameters,s=e.recommendClient,m=e.threshold,u=e.transformItems,l=O(t.useState({recommendations:[]}),2),f=l[0],d=l[1],b=D("loading"),p=b.status,y=b.setStatus,h=E(c),P=E(u),w=E(i),N=E(n);return v({recommendClient:s}),t.useEffect((function(){y("loading"),function(e){var t=e.objectIDs,n=e.recommendClient,r=e.transformItems,a=void 0===r?function(e){return e}:r,o=e.fallbackParameters,c=e.indexName,i=e.maxRecommendations,s=e.model,m=e.queryParameters,u=e.threshold,l=t.map((function(e){return{fallbackParameters:o,indexName:c,maxRecommendations:i,model:s,objectID:e,queryParameters:m,threshold:u}}));return n.addAlgoliaAgent("recommend-core",j),n.getRecommendations(l).then((function(e){return g({maxRecommendations:i,hits:e.results.map((function(e){return e.hits})),nrOfObjs:t.length})})).then((function(e){return{recommendations:a(e)}}))}({fallbackParameters:N,indexName:r,maxRecommendations:a,model:o,objectIDs:h,queryParameters:w,recommendClient:s,threshold:m,transformItems:P}).then((function(e){d(e),y("idle")}))}),[N,r,a,o,h,w,s,y,m,P]),G(G({},f),{},{status:p})},e.useRelatedProducts=A,e.useTrendingFacets=B,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
/*! @algolia/recommend-react 1.6.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/recommend */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend-react"]={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a.apply(this,arguments)}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}function i(e){var t=e.createElement,n=e.Fragment;return function(e){return 0===e.recommendations.length&&"idle"===e.status?t(e.Fallback,null):t("section",{className:c("auc-Recommend",e.classNames.root)},t(e.Header,{classNames:e.classNames,recommendations:e.recommendations,translations:e.translations,createElement:t,Fragment:n}),t(e.View,null))}}function s(e){var t=e.createElement;return function(e){return!e.recommendations||e.recommendations.length<1?null:e.translations.title?t("h3",{className:c("auc-Recommend-title",e.classNames.title)},e.translations.title):null}}function m(e){var t=e.createElement,n=e.Fragment;return function(e){return t("div",{className:c("auc-Recommend-container",e.classNames.container)},t("ol",{className:c("auc-Recommend-list",e.classNames.list)},e.items.map((function(r){return t("li",{key:r.objectID,className:c("auc-Recommend-item",e.classNames.item)},t(e.itemComponent,{createElement:t,Fragment:n,item:r}))}))))}}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],c=!0,i=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);c=!0);}catch(e){i=!0,a=e}finally{try{c||null==n.return||n.return()}finally{if(i)throw a}}return o}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e){var t=e.hits,n=e.maxRecommendations,r=e.nrOfObjs,a={};t.forEach((function(e){e.forEach((function(e,t){a[e.objectID]?a[e.objectID]={indexSum:a[e.objectID].indexSum+t,nr:a[e.objectID].nr+1}:a[e.objectID]={indexSum:t,nr:1}}))}));var o=function(e,t){for(var n=[],r=0,a=Object.keys(e);r<a.length;r++){var o=a[r];e[o].nr<2&&(e[o].indexSum+=100),n.push({objectID:o,avgOfIndices:e[o].indexSum/t})}return n.sort((function(e,t){return e.avgOfIndices>t.avgOfIndices?1:-1}))}(a,r);return o.reduce((function(e,n){var r=t.flat().find((function(e){return e.objectID===n.objectID}));return r?e.concat(r):e}),[]).slice(0,n&&n>0?n:void 0)}function y(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){var t,n,r,a=e.hits,o=e.maxRecommendations;return(t=function(e,t){return(e._score||0)>(t._score||0)?-1:1},n=a,r=y(n),r.sort(t),r).slice(0,o&&o>0?o:void 0)}var j="1.6.0";function v(e){t.useEffect((function(){e.recommendClient.addAlgoliaAgent("recommend-react","1.6.0")}),[e.recommendClient])}var P=Object.prototype.hasOwnProperty;function w(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&w(e[r],t[r]););return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(P.call(e,n)&&++r&&!P.call(t,n))return!1;if(!(n in t)||!w(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function E(e){var n=g(t.useState((function(){return e})),2),r=n[0],a=n[1];return t.useEffect((function(){!1===w(r,e)&&a(e)}),[e]),r}function D(e){var n=t.useRef(void 0),r=g(t.useState(e),2),a=r[0],o=r[1];return t.useEffect((function(){"stalled"!==a&&n.current&&clearTimeout(n.current),"loading"===a&&(n.current=setTimeout((function(){o("stalled")}),300))}),[a]),{status:a,setStatus:o}}function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function F(e){var n=e.indexName,r=e.maxRecommendations,a=e.objectIDs,o=e.queryParameters,c=e.recommendClient,i=e.threshold,s=e.transformItems,m=g(t.useState({recommendations:[]}),2),u=m[0],l=m[1],f=D("loading"),d=f.status,b=f.setStatus,p=E(a),y=E(s),h=E(o);return v({recommendClient:c}),t.useEffect((function(){b("loading"),function(e){var t=e.objectIDs,n=e.recommendClient,r=e.transformItems,a=void 0===r?function(e){return e}:r,o=e.indexName,c=e.maxRecommendations,i=e.queryParameters,s=e.threshold,m=t.map((function(e){return{indexName:o,maxRecommendations:c,objectID:e,queryParameters:i,threshold:s}}));return n.addAlgoliaAgent("recommend-core",j),n.getFrequentlyBoughtTogether(m).then((function(e){return O({maxRecommendations:c,hits:e.results.map((function(e){return e.hits})),nrOfObjs:t.length})})).then((function(e){return{recommendations:a(e)}}))}({indexName:n,maxRecommendations:r,objectIDs:p,queryParameters:h,recommendClient:c,threshold:i,transformItems:y}).then((function(e){l(e),b("idle")}))}),[n,r,p,h,c,b,i,y]),x(x({},u),{},{status:d})}var I,S,R,C=(I={createElement:t.createElement,Fragment:t.Fragment},S=I.createElement,R=I.Fragment,function(e){var t,n,r,c,l,f=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Frequently bought together",sliderLabel:"Frequently bought together products"},e.translations),d=null!==(t=e.classNames)&&void 0!==t?t:{},b=null!==(n=e.children)&&void 0!==n?n:i({createElement:S,Fragment:R}),p=null!==(r=e.fallbackComponent)&&void 0!==r?r:function(){return null},g=null!==(c=e.headerComponent)&&void 0!==c?c:s({createElement:S,Fragment:R}),O=null!==(l=e.view)&&void 0!==l?l:m({createElement:S,Fragment:R});return b({classNames:d,Fallback:function(){return S(p,{Fragment:R,createElement:S})},Header:g,recommendations:e.items,status:e.status,translations:f,View:function(t){return S(O,a({classNames:d,itemComponent:e.itemComponent,items:e.items,translations:f,Fragment:R,createElement:S},t))}})});function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A(e){var n=e.fallbackParameters,r=e.indexName,a=e.maxRecommendations,o=e.objectIDs,c=e.queryParameters,i=e.recommendClient,s=e.threshold,m=e.transformItems,u=g(t.useState({recommendations:[]}),2),l=u[0],f=u[1],d=D("loading"),b=d.status,p=d.setStatus,y=E(o),h=E(m),P=E(c),w=E(n);return v({recommendClient:i}),t.useEffect((function(){p("loading"),function(e){var t=e.objectIDs,n=e.recommendClient,r=e.transformItems,a=void 0===r?function(e){return e}:r,o=e.fallbackParameters,c=e.indexName,i=e.maxRecommendations,s=e.queryParameters,m=e.threshold,u=t.map((function(e){return{fallbackParameters:o,indexName:c,maxRecommendations:i,objectID:e,queryParameters:s,threshold:m}}));return n.addAlgoliaAgent("recommend-core",j),n.getRelatedProducts(u).then((function(e){return O({maxRecommendations:i,hits:e.results.map((function(e){return e.hits})),nrOfObjs:t.length})})).then((function(e){return{recommendations:a(e)}}))}({fallbackParameters:w,indexName:r,maxRecommendations:a,objectIDs:y,queryParameters:P,recommendClient:i,threshold:s,transformItems:h}).then((function(e){f(e),p("idle")}))}),[w,r,a,y,P,i,p,s,h]),q(q({},l),{},{status:b})}var T=function(e){var t=e.createElement,n=e.Fragment;return function(e){var r,c,u,f,d,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Related products",sliderLabel:"Related products"},e.translations),p=null!==(r=e.classNames)&&void 0!==r?r:{},g=null!==(c=e.children)&&void 0!==c?c:i({createElement:t,Fragment:n}),O=null!==(u=e.fallbackComponent)&&void 0!==u?u:function(){return null},y=null!==(f=e.headerComponent)&&void 0!==f?f:s({createElement:t,Fragment:n}),h=null!==(d=e.view)&&void 0!==d?d:m({createElement:t,Fragment:n});return g({classNames:p,Fallback:function(){return t(O,{Fragment:n,createElement:t})},Header:y,recommendations:e.items,status:e.status,translations:b,View:function(r){return t(h,a({classNames:p,itemComponent:e.itemComponent,items:e.items,translations:b,Fragment:n,createElement:t},r))}})}}({createElement:t.createElement,Fragment:t.Fragment});function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(e){var n=e.fallbackParameters,r=e.indexName,a=e.maxRecommendations,o=e.queryParameters,c=e.recommendClient,i=e.threshold,s=e.transformItems,m=e.facetName,u=g(t.useState({recommendations:[]}),2),l=u[0],f=u[1],d=D("loading"),b=d.status,p=d.setStatus,O=E(s),y=E(o),P=E(n);return v({recommendClient:c}),t.useEffect((function(){p("loading"),function(e){var t=e.recommendClient,n=e.transformItems,r=void 0===n?function(e){return e}:n,a=e.fallbackParameters,o=e.indexName,c=e.maxRecommendations,i=e.queryParameters,s=e.threshold,m=e.facetName,u={fallbackParameters:a,indexName:o,maxRecommendations:c,queryParameters:i,threshold:s,facetName:m};return t.addAlgoliaAgent("recommend-core",j),t.getTrendingFacets([u]).then((function(e){return h({maxRecommendations:c,hits:e.results.map((function(e){return e.hits})).flat()})})).then((function(e){return{recommendations:r(e)}}))}({recommendClient:c,transformItems:O,fallbackParameters:P,indexName:r,maxRecommendations:a,queryParameters:y,threshold:i,facetName:m}).then((function(e){f(e),p("idle")}))}),[P,r,a,y,c,p,i,O,m]),H(H({},l),{},{status:b})}var L=function(e){var t=e.createElement,n=e.Fragment;return function(e){var r,m,u,l,d,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Trending facets",sliderLabel:"Trending facets"},e.translations),p=null!==(r=e.classNames)&&void 0!==r?r:{},g=null!==(m=e.children)&&void 0!==m?m:i({createElement:t,Fragment:n}),O=null!==(u=e.fallbackComponent)&&void 0!==u?u:function(){return null},y=null!==(l=e.headerComponent)&&void 0!==l?l:s({createElement:t,Fragment:n}),h=null!==(d=e.view)&&void 0!==d?d:function(e){var t=e.createElement,n=e.Fragment;return function(e){return t("div",{className:c("auc-Recommend-container",e.classNames.container)},t("ol",{className:c("auc-Recommend-list",e.classNames.list)},e.items.map((function(r){return t("li",{key:r.facetValue,className:c("auc-Recommend-item",e.classNames.item)},t(e.itemComponent,{createElement:t,Fragment:n,item:r}))}))))}}({createElement:t,Fragment:n});return g({classNames:p,Fallback:function(){return t(O,{Fragment:n,createElement:t})},Header:y,recommendations:e.items,status:e.status,translations:b,View:function(r){return t(h,a({classNames:p,itemComponent:e.itemComponent,items:e.items,translations:b,Fragment:n,createElement:t},r))}})}}({createElement:t.createElement,Fragment:t.Fragment});function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function U(e){var n=e.fallbackParameters,r=e.indexName,a=e.maxRecommendations,o=e.queryParameters,c=e.recommendClient,i=e.threshold,s=e.transformItems,m=e.facetName,u=e.facetValue,l=g(t.useState({recommendations:[]}),2),f=l[0],d=l[1],b=D("loading"),p=b.status,O=b.setStatus,P=E(s),w=E(o),N=E(n);return v({recommendClient:c}),t.useEffect((function(){O("loading"),function(e){var t=e.recommendClient,n=e.transformItems,r=void 0===n?function(e){return e}:n,a=e.fallbackParameters,o=e.indexName,c=e.maxRecommendations,i=e.queryParameters,s=e.threshold,m=e.facetName,u=e.facetValue,l={fallbackParameters:a,indexName:o,maxRecommendations:c,queryParameters:i,threshold:s,facetName:m,facetValue:u};return t.addAlgoliaAgent("recommend-core",j),t.getTrendingItems([l]).then((function(e){return h({maxRecommendations:c,hits:(t="objectID",n=e.results.map((function(e){return e.hits})).flat(),y(new Map(n.map((function(e){return[e[t],e]}))).values()))});var t,n})).then((function(e){return{recommendations:r(e)}}))}({recommendClient:c,transformItems:P,fallbackParameters:N,indexName:r,maxRecommendations:a,queryParameters:w,threshold:i,facetName:m,facetValue:u}).then((function(e){d(e),O("idle")}))}),[N,r,a,w,c,O,i,P,m,u]),M(M({},f),{},{status:p})}var $=function(e){var t=e.createElement,n=e.Fragment;return function(e){var r,c,u,l,f,b=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({title:"Trending items",sliderLabel:"Trending items"},e.translations),p=null!==(r=e.classNames)&&void 0!==r?r:{},g=null!==(c=e.children)&&void 0!==c?c:i({createElement:t,Fragment:n}),O=null!==(u=e.fallbackComponent)&&void 0!==u?u:function(){return null},y=null!==(l=e.headerComponent)&&void 0!==l?l:s({createElement:t,Fragment:n}),h=null!==(f=e.view)&&void 0!==f?f:m({createElement:t,Fragment:n});return g({classNames:p,Fallback:function(){return t(O,{Fragment:n,createElement:t})},Header:y,recommendations:e.items,status:e.status,translations:b,View:function(r){return t(h,a({classNames:p,itemComponent:e.itemComponent,items:e.items,translations:b,Fragment:n,createElement:t},r))}})}}({createElement:t.createElement,Fragment:t.Fragment});function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}e.FrequentlyBoughtTogether=function(e){var t=F(e),n=t.recommendations,o=t.status;return r.default.createElement(C,a({},e,{items:n,status:o}))},e.RelatedProducts=function(e){var t=A(e),n=t.recommendations,o=t.status;return r.default.createElement(T,a({},e,{items:n,status:o}))},e.TrendingFacets=function(e){var t=B(e),n=t.recommendations,o=t.status;return r.default.createElement(L,a({},e,{items:n,status:o}))},e.TrendingItems=function(e){var t=U(e),n=t.recommendations,o=t.status;return r.default.createElement($,a({},e,{items:n,status:o}))},e.useFrequentlyBoughtTogether=F,e.useRecommendations=function(e){var n=e.fallbackParameters,r=e.indexName,a=e.maxRecommendations,o=e.model,c=e.objectIDs,i=e.queryParameters,s=e.recommendClient,m=e.threshold,u=e.transformItems,l=g(t.useState({recommendations:[]}),2),f=l[0],d=l[1],b=D("loading"),p=b.status,y=b.setStatus,h=E(c),P=E(u),w=E(i),N=E(n);return v({recommendClient:s}),t.useEffect((function(){y("loading"),function(e){var t=e.objectIDs,n=e.recommendClient,r=e.transformItems,a=void 0===r?function(e){return e}:r,o=e.fallbackParameters,c=e.indexName,i=e.maxRecommendations,s=e.model,m=e.queryParameters,u=e.threshold,l=t.map((function(e){return{fallbackParameters:o,indexName:c,maxRecommendations:i,model:s,objectID:e,queryParameters:m,threshold:u}}));return n.addAlgoliaAgent("recommend-core",j),n.getRecommendations(l).then((function(e){return O({maxRecommendations:i,hits:e.results.map((function(e){return e.hits})),nrOfObjs:t.length})})).then((function(e){return{recommendations:a(e)}}))}({fallbackParameters:N,indexName:r,maxRecommendations:a,model:o,objectIDs:h,queryParameters:w,recommendClient:s,threshold:m,transformItems:P}).then((function(e){d(e),y("idle")}))}),[N,r,a,o,h,w,s,y,m,P]),G(G({},f),{},{status:p})},e.useRelatedProducts=A,e.useTrendingFacets=B,e.useTrendingItems=U,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@algolia/recommend-react", | ||
"description": "Horizontal slider UI component.", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"license": "MIT", | ||
@@ -32,4 +32,4 @@ "homepage": "https://github.com/algolia/recommend", | ||
"dependencies": { | ||
"@algolia/recommend-core": "1.5.0", | ||
"@algolia/recommend-vdom": "1.5.0", | ||
"@algolia/recommend-core": "1.6.0", | ||
"@algolia/recommend-vdom": "1.6.0", | ||
"dequal": "^2.0.0" | ||
@@ -36,0 +36,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117567
546
+ Added@algolia/recommend-core@1.6.0(transitive)
+ Added@algolia/recommend-vdom@1.6.0(transitive)
- Removed@algolia/recommend-core@1.5.0(transitive)
- Removed@algolia/recommend-vdom@1.5.0(transitive)