@nyris/nyris-webapp 0.3.31 → 0.3.32

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.
@@ -0,0 +1,3 @@
1
+ /*! For license information please see main.1e8d5e32.chunk.js.LICENSE.txt */
2
+ (this["webpackJsonp@nyris/nyris-webapp"]=this["webpackJsonp@nyris/nyris-webapp"]||[]).push([[0],{205:function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t){e.exports=r(0)},function(e,t){e.exports=r(83)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3);t.Preview=n.default;var a=r(7);t.Capture=a.default,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(14))},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=a(r(0)),c=r(4),l=r(1),u=o(r(5)),s=r(6),f=function(e){return e.dotHover?"pointer":e.tlHover?"nw-resize":e.trHover?"ne-resize":e.blHover?"sw-resize":e.brHover?"se-resize":e.rectHover?"move":"default"};t.default=function(e){var t=e.selection,r=e.image,a=e.maxWidth,o=e.maxHeight,h=e.onSelectionChange,d=e.regions,p=e.dotColor,m=l.getThumbSizeLongestEdge(a,o,r.width,r.height),v=m.w,g=m.h,y=function(e,t,r){var n=r.x1,a=r.x2,o=r.y1,i=r.y2;return{x1:Math.max(n*e,5),x2:Math.min(a*e,e-5),y1:Math.max(o*t,5),y2:Math.min(i*t,t-5)}}(v,g,t),b=y.x1,w=y.y1,x=y.x2,E=y.y2,O=[100,100],C=O[0],j=O[1],L=i.useRef(null),k=i.useState({tlHover:!1,trHover:!1,blHover:!1,brHover:!1,dotHover:!1,rectHover:!1}),S=k[0],N=k[1],M=function(e){var t={};Object.assign(t,S,e),N(t)},_=function(e,t){if(!(t.target instanceof u.default.Stage)){var r=t.target.getAbsolutePosition(),n=r.x,a=r.y,o=t.target.getSize(),i=o.width,c=o.height,l=function(e,t,r,n,a,o){var i=e.x1,c=e.x2,l=e.y1,u=e.y2;switch(t){case"rect":return{x1:r,y1:n,x2:r+a,y2:n+o};case"tl":return{x1:r,y1:n,x2:c,y2:u};case"tr":return{x2:r,y1:n,x1:i,y2:u};case"bl":return{x1:r,y2:n,x2:c,y1:l};case"br":return{x2:r,y2:n,x1:i,y1:l}}}({x1:b,x2:x,y1:w,y2:E},e,n+("rect"!==e?Z:0),a+("rect"!==e?Z:0),i,c),s={x1:l.x1/v,x2:l.x2/v,y1:l.y1/g,y2:l.y2/g};P(s)}};i.useEffect((function(){if(L.current){var e=new u.default.Animation((function(e){if(e&&L.current){var t=40*e.time/1e3;L.current.dashOffset(-t)}}),L.current.getLayer());return e.start(),function(){e&&e.stop()}}}),[L]);var I=_.bind(null,"rect"),R=_.bind(null,"tl"),T=_.bind(null,"tr"),H=_.bind(null,"bl"),F=_.bind(null,"br"),P=function(e){h&&h(e)};if(!r)return null;var V=d.map((function(e,t){var r=e.normalizedRect,n=r.x1,a=r.x2,o=r.y1,i=r.y2,c=v*((a-n)/2+n),l=g*((i-o)/2+o);return{region:e,key:c+"-"+l,x:c,y:l}})),Z=10;return i.default.createElement(c.Stage,{width:v,height:g,style:{cursor:f(S),width:v,height:g,margin:"auto"}},i.default.createElement(c.Layer,{key:"img"},i.default.createElement(c.Image,{image:r,width:v,height:g})),i.default.createElement(c.Layer,{key:"selection"},i.default.createElement(c.Rect,{stroke:"white",opacity:0,strokeWidth:0,x:b,y:w,width:x-b,height:E-w}),i.default.createElement(c.Rect,{stroke:"black",draggable:!0,onDragMove:I,dragBoundFunc:function(e){var t=e.x,r=e.y,n=x-b+5,a=E-w+5;return{x:Math.max(Math.min(t,v-n),5),y:Math.max(Math.min(r,g-a),5)}},onMouseOver:function(){return M({rectHover:!0})},onMouseOut:function(){return M({rectHover:!1})},opacity:0,strokeWidth:2,x:b,y:w,width:x-b,height:E-w,dash:[0,0],ref:L}),i.default.createElement(c.Rect,{fill:"black",opacity:.3,x:0,y:0,width:v,height:w}),i.default.createElement(c.Rect,{fill:"black",opacity:.3,x:0,y:E,width:v,height:g-E}),i.default.createElement(c.Rect,{fill:"black",opacity:.3,x:0,y:w,width:b,height:E-w}),i.default.createElement(c.Rect,{fill:"black",opacity:.3,x:x,y:w,width:v-x,height:E-w})),i.default.createElement(c.Layer,null,i.default.createElement(c.Path,{data:"M2 18V10C2 5.58172 5.58172 2 10 2H18",stroke:"white",strokeWidth:5,lineCap:"round",opacity:1,x:b-3,y:w-3,shadowColor:"#000000",shadowBlur:4,shadowOffset:{x:0,y:0},shadowOpacity:.25}),i.default.createElement(c.Rect,{draggable:!0,onDragMove:R,dragBoundFunc:function(e){var t=e.x,r=e.y;return{x:Math.max(Math.min(t,x-C),0),y:Math.max(Math.min(r,E-j),0)}},onMouseOver:function(){return M({tlHover:!0})},onMouseOut:function(){return M({tlHover:!1})},opacity:1,width:20+Z,height:20+Z,x:b-Z,y:w-Z}),i.default.createElement(c.Path,{data:"M2 2L10 2C14.4183 2 18 5.58172 18 10L18 18",stroke:"white",strokeWidth:5,lineCap:"round",opacity:1,x:x+3,y:w-3,offsetX:20,shadowColor:"#000000",shadowBlur:4,shadowOffset:{x:0,y:0},shadowOpacity:.25}),i.default.createElement(c.Rect,{draggable:!0,onDragMove:T,dragBoundFunc:function(e){var t=e.x,r=e.y;return{x:Math.min(Math.max(t,b+C),v),y:Math.max(Math.min(r,E-j),0)}},onMouseOver:function(){return M({trHover:!0})},onMouseOut:function(){return M({trHover:!1})},opacity:1,width:20+Z,height:20+Z,x:x-Z,y:w-Z,offsetX:20-Z}),i.default.createElement(c.Path,{data:"M18 18L10 18C5.58172 18 2 14.4183 2 10L2 2",stroke:"white",strokeWidth:5,lineCap:"round",opacity:1,x:b-3,y:E+3,offsetY:20,shadowColor:"#000000",shadowBlur:4,shadowOffset:{x:0,y:0},shadowOpacity:.25}),i.default.createElement(c.Rect,{draggable:!0,onDragMove:H,dragBoundFunc:function(e){var t=e.x,r=e.y;return{x:Math.max(Math.min(t,x-C),0),y:Math.min(Math.max(r,w+j),g)}},onMouseOver:function(){return M({blHover:!0})},onMouseOut:function(){return M({blHover:!1})},opacity:1,width:20+Z,height:20+Z,x:b-Z,y:E-Z,offsetY:20-Z}),i.default.createElement(c.Path,{data:"M18 2L18 10C18 14.4183 14.4183 18 10 18L2 18",stroke:"white",strokeWidth:5,lineCap:"round",x:x+3,y:E+3,opacity:1,offsetY:20,offsetX:20,shadowColor:"#000000",shadowBlur:4,shadowOffset:{x:0,y:0},shadowOpacity:.25}),i.default.createElement(c.Rect,{opacity:1,draggable:!0,onDragMove:F,dragBoundFunc:function(e){var t=e.x,r=e.y;return{x:Math.min(Math.max(t,b+C),v),y:Math.min(Math.max(r,w+j),g)}},onMouseOver:function(){return M({brHover:!0})},onMouseOut:function(){return M({brHover:!1})},x:x-Z,y:E-Z,width:20+Z,height:20+Z,offsetY:20-Z,offsetX:20-Z})),i.default.createElement(s.NodeGroup,{data:V,keyAccessor:function(e){return e.key},start:function(e,t){return{opacity:0,x:-100,y:e.y}},enter:function(e,t){return{opacity:[1],x:[e.x],y:e.y,timing:{delay:100*t,duration:300}}}},(function(e){return i.default.createElement(c.Layer,{key:"dots"},e.map((function(e){var t=e.key,r=e.data,a=e.state;return i.default.createElement(c.Circle,n({onClick:function(){P(r.region.normalizedRect),M({dotHover:!1})},onTap:function(){P(r.region.normalizedRect),M({dotHover:!1})},onMouseOver:function(){return M({dotHover:!0})},onMouseOut:function(){return M({dotHover:!1})},key:t,radius:7},a,{stroke:p,fill:"white",strokeWidth:5}))})))})))}},function(e,t){e.exports=r(789)},function(e,t){e.exports=r(454)},function(e,t){e.exports=r(855)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{l(n.next(e))}catch(e){o(e)}}function c(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}l((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=o(r(0));r(8);var l=r(1),u=i(r(12)),s=i(r(13));t.default=function(e){var t=e.onCaptureComplete,r=e.onCaptureCanceled,o=e.useAppText,i=c.useRef(null),f=c.useState(),h=f[0],d=f[1];return c.useEffect((function(){navigator.mediaDevices.getUserMedia({video:{facingMode:"environment",width:640}}).then((function(e){var t=i.current;t&&(t.srcObject=e,d(e))})).catch((function(e){switch(e.name){case"NotFoundError":alert("Camera not found. Try with a file instead.");break;case"NotAllowedError":alert("You have to allow using the camera in order to take pictures. If you are not asked again for permissions, go to site settings and reset permissions there.");break;default:alert("Sorry, something has gone wrong while enabeling the camera. ("+e+")")}}))}),[i]),c.useEffect((function(){return function(){h&&(h.getVideoTracks&&h.getAudioTracks?(h.getVideoTracks().map((function(e){return e.stop()})),h.getAudioTracks().map((function(e){return e.stop()}))):h.stop())}}),[h]),c.default.createElement("div",{className:"nyris-capture-captureUi"},c.default.createElement("video",{autoPlay:!0,playsInline:!0,ref:i,className:"nyris-capture-video"}),c.default.createElement("input",{type:"file",name:"file",id:"capture_file",className:"nyris-capture-inputFile",accept:"image/*",capture:"environment",onChange:function(e){return n(void 0,void 0,void 0,(function(){var r,n;return a(this,(function(a){switch(a.label){case 0:return(r=e.target)&&r.files?[4,l.urlOrBlobToCanvas(r.files[0])]:[3,2];case 1:n=a.sent(),t(n),a.label=2;case 2:return[2]}}))}))}}),c.default.createElement("label",{className:"nyris-capture-app-button",htmlFor:"capture_file"},o),c.default.createElement("button",{className:"nyris-capture-backBtn",onClick:r},c.default.createElement("img",{src:s.default,alt:"back",width:"72"})),c.default.createElement("button",{className:"nyris-capture-searchBtn",onClick:function(){if(i.current){var e=l.elementToCanvas(i.current);t(e)}}},c.default.createElement("img",{src:u.default,alt:"capture"})))}},function(e,t,r){var n=r(9),a=r(10);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.i,a,""]]);n(a,{insert:"head",singleton:!1}),e.exports=a.locals||{}},function(e,t,r){"use strict";var n,a=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),o=[];function i(e){for(var t=-1,r=0;r<o.length;r++)if(o[r].identifier===e){t=r;break}return t}function c(e,t){for(var r={},n=[],a=0;a<e.length;a++){var c=e[a],l=t.base?c[0]+t.base:c[0],u=r[l]||0,s="".concat(l," ").concat(u);r[l]=u+1;var f=i(s),h={css:c[1],media:c[2],sourceMap:c[3]};-1!==f?(o[f].references++,o[f].updater(h)):o.push({identifier:s,updater:m(h,t),references:1}),n.push(s)}return n}function l(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=r.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,s=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function f(e,t,r,n){var a=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=s(t,a);else{var o=document.createTextNode(a),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(o,i[t]):e.appendChild(o)}}function h(e,t,r){var n=r.css,a=r.media,o=r.sourceMap;if(a?e.setAttribute("media",a):e.removeAttribute("media"),o&&btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var d=null,p=0;function m(e,t){var r,n,a;if(t.singleton){var o=p++;r=d||(d=l(t)),n=f.bind(null,r,o,!1),a=f.bind(null,r,o,!0)}else r=l(t),n=h.bind(null,r,t),a=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else a()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n));var r=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var a=i(r[n]);o[a].references--}for(var l=c(e,t),u=0;u<r.length;u++){var s=i(r[u]);0===o[s].references&&(o[s].updater(),o.splice(s,1))}r=l}}}},function(e,t,r){(t=r(11)(!1)).push([e.i,".nyris-capture-app-button {\n position: fixed;\n top: 0;\n right: 0;\n color: white;\n margin: 10px;\n padding: 10px;\n background-color: rgba(255,255,255,0.3);\n border-radius: 2px;\n text-shadow: 1px 1px 3px #000;\n line-height: 1em;\n box-shadow: 1px 1px 3px rgba(0, 0, 0,0.5);\n}\n\n.nyris-capture-inputFile {\n visibility: hidden;\n}\n\n.nyris-capture-captureUi {\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n background-color: black;\n z-index: 10000;\n}\n\n.nyris-capture-video {\n position: fixed;\n min-height: 100%;\n min-width: 100%;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n width: auto;\n height: auto;\n}\n\n.nyris-capture-searchBtn {\n position: fixed;\n bottom: 0;\n right: 0;\n z-index: 10001;\n left: 50%;\n transform: translateX(-50%);\n\n color: black;\n background-color: transparent;\n text-transform: uppercase;\n border: 0;\n margin: auto;\n display: block;\n -webkit-filter: drop-shadow( 1px 1px 5px #000 );\n filter: drop-shadow( 1px 1px 5px #000 );\n\n}\n\n.nyris-capture-backBtn {\n position: fixed;\n bottom: 0;\n left: 0;\n z-index: 10001;\n color: white;\n background-color: transparent;\n border: 0;\n\n text-transform: uppercase;\n border-radius: 50%;\n display: block;\n padding: 0;\n font-size: 16px;\n margin-bottom: 5px;\n margin-left: 5px;\n -webkit-filter: drop-shadow( 1px 1px 5px #000 );\n filter: drop-shadow( 1px 1px 5px #000 );\n}\n\n",""]),e.exports=t},function(e,t,r){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,n,a,o=e[1]||"",i=e[3];if(!i)return o;if(t&&"function"==typeof btoa){var c=(r=i,n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),a="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(a," */")),l=i.sources.map((function(e){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(e," */")}));return[o].concat(l).concat([c]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r})).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var a={};if(n)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(a[i]=!0)}for(var c=0;c<e.length;c++){var l=[].concat(e[c]);n&&a[l[0]]||(r&&(l[2]?l[2]="".concat(r," and ").concat(l[2]):l[2]=r),t.push(l))}},t}},function(e,t,r){"use strict";r.r(t),r.d(t,"ReactComponent",(function(){return l}));var n=r(0);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var o=n.createElement("defs",null,n.createElement("path",{id:"capture_svg__a",d:"M150 540a30 30 0 1160 0 30 30 0 01-60 0z"}),n.createElement("path",{id:"capture_svg__b",d:"M144 540a36 36 0 1172 0 36 36 0 01-72 0zm36 33.95a33.94 33.94 0 100-67.89 33.94 33.94 0 000 67.89z"})),i=n.createElement("use",{fill:"#c00",xlinkHref:"#capture_svg__a",transform:"translate(-144 -504)"}),c=n.createElement("use",{fill:"#c00",fillOpacity:.9,xlinkHref:"#capture_svg__b",opacity:.7,transform:"translate(-144 -504)"});function l(e){return n.createElement("svg",a({width:72,height:72},e),o,i,c)}t.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNzIiIGhlaWdodD0iNzIiIHZpZXdCb3g9IjAgMCA3MiA3MiI+PGRlZnM+PHBhdGggaWQ9IjFoN3JhIiBkPSJNMTUwIDU0MGEzMCAzMCAwIDEgMSA2MCAwIDMwIDMwIDAgMCAxLTYwIDB6Ii8+PHBhdGggaWQ9IjFoN3JiIiBkPSJNMTQ0IDU0MGEzNiAzNiAwIDEgMSA3MiAwIDM2IDM2IDAgMCAxLTcyIDB6bTM2IDMzLjk1YTMzLjk0IDMzLjk0IDAgMSAwIDAtNjcuODkgMzMuOTQgMzMuOTQgMCAwIDAgMCA2Ny44OXoiLz48L2RlZnM+PGc+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTE0NCAtNTA0KSI+PHVzZSBmaWxsPSIjYzAwIiB4bGluazpocmVmPSIjMWg3cmEiLz48L2c+PGcgb3BhY2l0eT0iLjciIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xNDQgLTUwNCkiPjx1c2UgZmlsbD0iI2MwMCIgZmlsbC1vcGFjaXR5PSIuOSIgeGxpbms6aHJlZj0iIzFoN3JiIi8+PC9nPjwvZz48L3N2Zz4="},function(e,t,r){"use strict";r.r(t),r.d(t,"ReactComponent",(function(){return c}));var n=r(0);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var o=n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),i=n.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",fill:"#fff"});function c(e){return n.createElement("svg",a({width:24,height:24},e),o,i)}t.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KICAgIDxwYXRoIGQ9Ik0yMCAxMUg3LjgzbDUuNTktNS41OUwxMiA0bC04IDggOCA4IDEuNDEtMS40MUw3LjgzIDEzSDIwdi0yeiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg=="},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeFileHandler=function(e){return function(t){var r=null,n=t;if(n&&n.target){var a=n.target;if(a.files&&a.files[0]&&(r=a.files[0]),a.value&&(a.value=""),r)return e(r)}var o=t;if(o&&(r=o.dataTransfer&&o.dataTransfer.files[0]),r)return e(r)}}}])},250:function(e,t,r){e.exports=r.p+"static/media/icon_search.373c3cc4.svg"},264:function(e,t,r){e.exports=r.p+"static/media/support3.4a17f96e.svg"},267:function(e,t,r){e.exports=r.p+"static/media/Union.3c6afbb0.svg"},268:function(e,t,r){e.exports=r.p+"static/media/unnamed.f7f1b5cb.png"},415:function(e,t,r){},416:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{l(n.next(e))}catch(t){o(t)}}function c(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}l((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(c){o=[6,c],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(r(724));function c(e,t){return{x1:e.x1*t.w,x2:e.x2*t.w,y1:e.y1*t.h,y2:e.y2*t.h}}function l(e){return{w:e.x2-e.x1,h:e.y2-e.y1}}function u(e){var t=e,r=e;return{w:t.naturalWidth||r.videoWidth||e.width,h:t.naturalHeight||r.videoHeight||e.height}}t.selectFirstCenteredRegion=function(e,t,r){var n=e.filter((function(e){return function(e,t){var r=e[0],n=e[1],a=t[0],o=t[1];return Math.sqrt(Math.pow(r-a,2)+Math.pow(n-o,2))}([.5,.5],function(e){var t=e.x1,r=e.x2,n=e.y1;return[(r-t)/2+t,(e.y2-n)/2+n]}(e.normalizedRect))<t}));return 0===n.length?r:n[0].normalizedRect},t.getUrlParam=function(e){var t=new RegExp("[?&]"+e+"(=([^&#]*))?(&|$|#)","i").exec(window.location.href);return t&&t[2]?(console.log("has value",e,t[2]),decodeURIComponent(t[2])):!!t||void 0},t.getThumbSizeArea=function(e,t,r){var n=e*t,a=Math.sqrt(n*r);return{w:a,h:a/r}},t.getThumbSizeLongestEdge=function(e,t,r,n){return e/t>r/n?{w:r*t/n,h:t}:{w:e,h:n*e/r}},t.scaleRect=c,t.getRectSize=l,t.getRectAspectRatio=function(e,t){var r=l(c(e,t));return r.w/r.h},t.getElementSize=u,t.elementToCanvas=function(e,t,r){var n=u(e),a=n.w,o=n.h,i=r||{x1:0,x2:1,y1:0,y2:1},c=i.x1,l=i.x2,s=i.y1,f=a*c,h=a*(l-c),d=o*s,p=o*(i.y2-s),m=t&&t.w||a,v=t&&t.h||o,g=document.createElement("canvas");g.width=m,g.height=v;var y=g.getContext("2d");if(!y)throw Error("Error converting element to canvas: Can not get 2d context");return y.fillStyle="rgb(255, 255,255)",y.fillRect(0,0,m,v),y.drawImage(e,f,d,h,p,0,0,m,v),g},t.urlOrBlobToCanvas=function(e){return new Promise((function(t,r){i.default(e,(function(e){e?t(e):r()}),{canvas:!0,orientation:!0,crossOrigin:"anonymous"})}))},t.canvasToJpgBlob=function(e,t){return new Promise((function(r,n){e.toBlob((function(e){e?r(e):n()}),"image/jpeg",t)}))},t.cadExtensions=[".stp",".step",".stl",".obj",".glb",".gltf"],t.isCadFile=function(e){return t.cadExtensions.some((function(t){return e.name.endsWith(t)}))},t.isImageFile=function(e){return e.type.startsWith("image/")},t.timePromise=function(e){return n(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(a){switch(a.label){case 0:return t=Date.now(),[4,e];case 1:return r=a.sent(),n=Date.now(),[2,{res:r,durationSeconds:(n-t)/1e3}]}}))}))}},462:function(e,t,r){e.exports=r.p+"static/media/reverse_camera.28c80509.svg"},466:function(e,t,r){e.exports=r.p+"static/media/camera.ae3f4f51.svg"},473:function(e,t,r){e.exports=r.p+"static/media/Icon_Upload.ebf185b4.svg"},476:function(e,t,r){e.exports=r.p+"static/media/email_share.92bbfb8b.svg"},493:function(e,t,r){e.exports=r(854)},722:function(e,t,r){},787:function(e,t,r){},788:function(e,t,r){},83:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function i(e){try{l(n.next(e))}catch(t){o(t)}}function c(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}l((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(c){o=[6,c],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),r(723);var c=r(416),l=i(r(729));!function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(416));var u=function(){function e(e){if(this.httpClient=l.default.create(),!e.apiKey)throw new Error("The api-key is not set.");this.apiKey=e.apiKey;var t=e.baseUrl||"https://api.nyris.io";this.imageMatchingUrl=t+"/find/v1.1",this.cadMatchingUrl=t+"/cad/find/v0.1",this.imageMatchingUrlBySku=t+"/recommend/v1/",this.imageMatchingSubmitManualUrl=t+"/find/v1/manual/",this.feedbackUrl=t+"/feedback/v1/",this.regionProposalUrl=t+"/find/v2/regions/",this.findFilters=t+"/find/v1/filters",this.responseFormat=e.responseFormat||"application/offers.complete+json",this.maxHeight=e.maxHeight||500,this.maxWidth=e.maxWidth||500,this.jpegQuality=e.jpegQuality||.92,this.customSearchRequest=e.customSearchRequest,this.responseHook=e.responseHook,this.xOptions=e.xOptions}return e.prototype.prepareImage=function(e,t){return a(this,void 0,void 0,(function(){var r,n,a,i,l;return o(this,(function(o){switch(o.label){case 0:return r=t||{x1:0,x2:1,y1:0,y2:1},n=c.getElementSize(e),a=c.getRectAspectRatio(r,n),i=c.getThumbSizeArea(this.maxWidth,this.maxHeight,a),l=c.elementToCanvas(e,i,r),[4,c.canvasToJpgBlob(l,this.jpegQuality)];case 1:return[2,o.sent()]}}))}))},e.prototype.getSearchRequestHeaders=function(e){var t={"X-Api-Key":this.apiKey,"Accept-Language":"de,*;q=0.5",Accept:this.responseFormat,"Content-Type":e||"application/octet-stream"},r=[];return this.xOptions&&r.push(this.xOptions),r.length>0&&(t["X-Options"]=r.join(" ")),t},e.prototype.getRegionRequestHeaders=function(e){var t={"X-Api-Key":this.apiKey,"Content-Type":e||"application/octet-stream"},r=[];return this.xOptions&&r.push(this.xOptions),r.length>0&&(t["X-Options"]=r.join(" ")),t},e.prototype.getParams=function(e){return e.geoLocation?{lat:e.geoLocation.lat.toString(),lon:e.geoLocation.lon.toString(),dist:e.geoLocation.dist.toString()}:{}},e.prototype.parseCategoryPredictions=function(e){return Object.entries(e||{}).map((function(e){return{name:e[0],score:e[1]}})).sort((function(e,t){return t.score-e.score}))},e.prototype.parseSearchResult=function(e,t){var r=this.parseCategoryPredictions(e.data.predicted_category),a=e.data.barcodes||[],o=this.responseHook?this.responseHook(e.data):e.data;return{results:"offerInfos"in o?o.offerInfos.map((function(e,t){return n(n({},e),{position:t})})):o.results.map((function(e,t){return{position:t,sku:e.sku,title:e.title,img:e.images&&e.images[0]?{url:e.images[0]}:void 0,l:e.links?e.links.main:void 0,p:e.price?{vi:100*parseFloat(e.price),c:e.price.split(" ")[1]}:void 0,score:e.score}})),requestId:e.headers["x-matching-request"],duration:"durationSeconds"in e.data?e.data.durationSeconds:t,categoryPredictions:r,codes:a}},e.prototype.findByCad=function(e,t){return a(this,void 0,void 0,(function(){var r,n,a,i,l,u;return o(this,(function(o){switch(o.label){case 0:return r=e.type,n=this.getSearchRequestHeaders(r),a=this.getParams(t),[4,c.timePromise(this.httpClient.request({method:"POST",url:this.cadMatchingUrl,data:e,params:a,headers:n,responseType:"json"}))];case 1:return i=o.sent(),l=i.res,u=i.durationSeconds,[2,this.parseSearchResult(l,u)]}}))}))},e.prototype.findByImage=function(e,t,r){return a(this,void 0,void 0,(function(){var n,a,i,l,u,s,f,h,d;return o(this,(function(o){switch(o.label){case 0:return[4,this.prepareImage(e,t.cropRect)];case 1:if(n=o.sent(),this.customSearchRequest)return[2,this.customSearchRequest(n,this.httpClient)];if(a=this.getSearchRequestHeaders("image/jpeg"),i=this.getParams(t),(l=new FormData).append("image",n),r&&r.length>0)for(u=0;u<r.length;u++)for(l.append("filters["+u+"].filterType",r[u].key),s=0;s<r[u].values.length;s++)l.append("filters["+u+"].filterValues["+s+"]",r[u].values[s]);return[4,c.timePromise(this.httpClient.request({method:"POST",url:this.imageMatchingUrl,data:l,params:i,headers:a,responseType:"json"}))];case 2:return f=o.sent(),h=f.res,d=f.durationSeconds,[2,this.parseSearchResult(h,d)]}}))}))},e.prototype.findBySku=function(e,t){return a(this,void 0,void 0,(function(){var r,n,a;return o(this,(function(o){switch(o.label){case 0:return r=this.getSearchRequestHeaders(),n=""+this.imageMatchingUrlBySku+encodeURIComponent(e)+"/"+encodeURIComponent(t),[4,this.httpClient.get(n,{headers:r,responseType:"json"})];case 1:return a=o.sent(),this.responseHook&&(a=this.responseHook),[2,a]}}))}))},e.prototype.findRegions=function(e){return a(this,void 0,void 0,(function(){var t,r,n,a,i,l,u,s;return o(this,(function(o){switch(o.label){case 0:return t=c.getElementSize(e),r=t.w,n=t.h,a=c.getThumbSizeArea(this.maxWidth,this.maxHeight,r/n),i=c.elementToCanvas(e,a),[4,c.canvasToJpgBlob(i,this.jpegQuality)];case 1:return l=o.sent(),u=this.getRegionRequestHeaders("image/jpeg"),[4,this.httpClient.request({method:"POST",url:this.regionProposalUrl,data:l,headers:u})];case 2:return s=o.sent(),[2,s.data.regions.map((function(e){return{classId:e.classId,confidence:e.confidence,normalizedRect:{x1:e.region.left/a.w,x2:e.region.right/a.w,y1:e.region.top/a.h,y2:e.region.bottom/a.h}}}))]}}))}))},e.prototype.sendFeedback=function(e,t,r){return a(this,void 0,void 0,(function(){var a,i;return o(this,(function(o){switch(o.label){case 0:return a={"X-Api-Key":this.apiKey,"Content-Type":"application/json"},i=n({request_id:t,timestamp:new Date,session_id:e},r),[4,this.httpClient.request({method:"POST",url:this.feedbackUrl,headers:a,data:i})];case 1:return o.sent(),[2]}}))}))},e.prototype.getFilters=function(e){return a(this,void 0,void 0,(function(){var t,r;return o(this,(function(n){switch(n.label){case 0:return t=this.getSearchRequestHeaders(),r=this.findFilters+"?limit="+e,[4,this.httpClient.get(r,{headers:t,responseType:"json"})];case 1:return[2,n.sent().data]}}))}))},e.prototype.searchFilters=function(e,t,r){return void 0===r&&(r=100),a(this,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:return n=this.getSearchRequestHeaders(),a=this.findFilters+"/"+e+"/"+t+"?limit="+r,[4,this.httpClient.get(a,{headers:n,responseType:"json"})];case 1:return[2,o.sent().data]}}))}))},e}();t.default=u},852:function(e,t,r){},854:function(e,t,r){"use strict";r.r(t);r(332),r(375);var n=r(0),a=r.n(n),o=r(37),i=r.n(o);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var c=r(206),l=r(891),u=(r(414),r(48)),s=r(92),f=r(43),h=r(5),d=r(17),p=r(8),m=r(894),v=r(263),g=r.n(v),y=r(896),b=r(30),w=r(133),x={x1:0,x2:1,y1:0,y2:1},E=[{value:10,label:"10"},{value:20,label:"20"},{value:30,label:"30"},{value:40,label:"40"},{value:50,label:"50"},{value:60,label:"60"},{value:70,label:"70"},{value:80,label:"80"},{value:90,label:"90"},{value:100,label:"100"}],O={results:[],regions:[],selectedRegion:void 0,requestImage:void 0,fetchingResults:!1,fetchingRegions:!1,filterOptions:[],categoryPredictions:[],codes:[],errorMessage:"",valueTextSearch:{configure:{filters:""},page:1,refinementList:""},resultSearchText:[],filters:[],configureFilter:{},loadingSearchAlgolia:!1,imageThumbSearchInput:"",textSearchInputMobile:"",isShowModalDetailItemMobile:!1,keyFilter:"",preFilterDropdown:!1},C=Object(w.b)({name:"search",initialState:O,reducers:{setSearchResults:function(e,t){var r=t.payload,n=r.results,a=r.requestId,o=r.categoryPredictions,i=r.codes,c=r.duration,l=r.filters;return Object(h.a)(Object(h.a)({},e),{},{filters:l,results:n,requestId:a,categoryPredictions:o,codes:i,duration:c,sessionId:e.sessionId||a,fetchingResults:!1})},setRegions:function(e,t){return Object(h.a)(Object(h.a)({},e),{},{regions:t.payload})},setSelectedRegion:function(e,t){return Object(h.a)(Object(h.a)({},e),{},{selectedRegion:t.payload})},setRequestImage:function(e,t){return Object(h.a)(Object(h.a)({},e),{},{requestImage:{canvas:t.payload,id:Math.random().toString()},regions:[]})},selectionChanged:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{selectedRegion:r})},loadFileSelectRegion:function(e,t){var r=t.payload,n=r.results,a=r.requestId,o=r.categoryPredictions,i=r.codes,c=r.duration;return Object(h.a)(Object(h.a)({},e),{},{results:n,requestId:a,categoryPredictions:o,codes:i,duration:c,sessionId:e.sessionId||a,fetchingRegions:!1})},loadingActionResults:function(e){return Object(h.a)(Object(h.a)({},e),{},{fetchingResults:!0})},loadingActionRegions:function(e){return Object(h.a)(Object(h.a)({},e),{},{fetchingRegions:!0})},searchFileImageNonRegion:function(e,t){var r=t.payload,n=r.results,a=r.requestId,o=r.duration,i=r.categoryPredictions,c=r.codes;return Object(h.a)(Object(h.a)({},e),{},{results:n,requestId:a,duration:o,categoryPredictions:i,codes:c,fetchingResults:!1})},changeValueTextSearch:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{valueTextSearch:r})},resultSearchText:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{resultSearchText:r})},updateResults:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{results:r})},reset:function(e,t){return{results:[],regions:[],selectedRegion:x,requestImage:void 0,fetchingResults:!1,fetchingRegions:!1,filterOptions:[],categoryPredictions:[],codes:[],errorMessage:"",valueTextSearch:{},resultSearchText:[],filters:[],loadingSearchAlgolia:!1,imageThumbSearchInput:"",textSearchInputMobile:"",isShowModalDetailItemMobile:!1,keyFilter:e.keyFilter||"",preFilterDropdown:!1}},onResetRequestImage:function(e,t){return Object(h.a)(Object(h.a)({},e),{},{requestImage:void 0,imageThumbSearchInput:"",results:[],regions:[]})},configureFilter:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{configureFilter:r})},setUpdateSession:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{sessionId:r})},updateResultChangePosition:function(e,t){var r=t.payload.results;return Object(h.a)(Object(h.a)({},e),{},{fetchingResults:!1,results:r})},setError:function(e,t){return Object(h.a)(Object(h.a)({},e),{},{fetchingRegions:!1,fetchingResults:!1,errorMessage:t.payload})},setImageSearchInput:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{imageThumbSearchInput:r})},updateStatusLoading:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{loadingSearchAlgolia:r})},updateValueTextSearchMobile:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{textSearchInputMobile:r})},onToggleModalItemDetail:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{isShowModalDetailItemMobile:r})},setUpdateKeyFilterDesktop:function(e,t){var r=t.payload;return Object(h.a)(Object(h.a)({},e),{},{keyFilter:r})},setPreFilterDropdown:function(e,t){return Object(h.a)(Object(h.a)({},e),{},{preFilterDropdown:t.payload})}}}),j=C.actions,L=j.setSearchResults,k=j.selectionChanged,S=j.setRequestImage,N=(j.loadFileSelectRegion,j.setRegions),M=j.setSelectedRegion,_=j.loadingActionResults,I=(j.loadingActionRegions,j.searchFileImageNonRegion,j.changeValueTextSearch),R=(j.resultSearchText,j.updateResults,j.reset),T=(j.configureFilter,j.setUpdateSession),H=j.updateResultChangePosition,F=(j.setError,j.setImageSearchInput),P=j.updateStatusLoading,V=j.updateValueTextSearchMobile,Z=j.onToggleModalItemDetail,G=j.onResetRequestImage,A=j.setUpdateKeyFilterDesktop,z=j.setPreFilterDropdown,B=C.reducer,D=r(93),U=r(461),q=r.n(U),W=Object(w.b)({name:"auth",initialState:{accessToken:null,name:null,role:null},reducers:{login:function(e,t){},logout:function(e){e.accessToken=null,e.name=null,e.role=null,q.a.remove("token")}}}),Y=W.actions,K=(Y.login,Y.logout,W.reducer);function Q(e){var t=new RegExp("[?&]".concat(e,"(=([^&#]*))?(&|$|#)"),"i").exec(window.location.href);return t&&t[2]?(console.log("has value",e,t[2]),decodeURIComponent(t[2])):!!t||void 0}var J=Object(w.b)({name:"nyris",initialState:{showPart:"start",feedbackState:"hidden"},reducers:{showStart:function(e){return Object(h.a)(Object(h.a)({},e),{},{showPart:"start"})},showCamera:function(e){return Object(h.a)(Object(h.a)({},e),{},{showPart:"camera"})},showResults:function(e){return Object(h.a)(Object(h.a)({},e),{},{showPart:"results"})},showFeedback:function(e){return Object(h.a)(Object(h.a)({},e),{},{feedbackState:"question"})},hideFeedback:function(e){return Object(h.a)(Object(h.a)({},e),{},{feedbackState:"hidden"})},feedbackSubmitPositive:function(e){return Object(h.a)(Object(h.a)({},e),{},{feedbackState:"positive"})},feedbackNegative:function(e){return Object(h.a)(Object(h.a)({},e),{},{feedbackState:"negative"})}}}),X=J.actions,$=(X.showStart,X.showCamera,X.showResults),ee=X.showFeedback,te=(X.hideFeedback,X.feedbackSubmitPositive,X.feedbackNegative,J.reducer),re=Object(h.a)(Object(h.a)({},{xOptions:!1,apiKey:"UNSET",exampleImages:[],preview:!0,regions:!1,maxWidth:500,maxHeight:500,jpegQuality:.92,baseUrl:"https://api.nyris.io",instantRedirectPatterns:["^https?://(www.)?youtube.com/","^https?://(www.)?youtu.be/","^https?://(www.)?vimeo.com/","^https?://(www.)?dailymotion.com/","^https?://(www.)?dai.ly/"],theme:{},field:{ctaLinkField:"",productName:"",productDetails:"",manufacturerNumber:"",productTag:"",warehouseNumber:"",warehouseNumberValue:"",warehouseShelfNumber:"",warehouseShelfNumberValue:"",warehouseStock:"",warehouseStockValue:""}}),settings);re=Object(h.a)(Object(h.a)({},re),{},{apiKey:Q("apiKey")||re.apiKey,xOptions:Q("xOptions")||re.xOptions,regions:Q("use.regions")||re.regions,preview:Q("use.preview")||re.preview});var ne,ae=Object(D.b)({auth:K,settings:function(){return re},search:B,nyris:te}),oe=Object(w.a)({reducer:ae,devTools:!1}),ie=function(){return Object(c.b)()},ce=c.c,le=(r(722),r(415),r(878)),ue=["svgRef","title"];function se(){return(se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function fe(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var he=function(e){var t=e.svgRef,r=e.title,n=fe(e,ue);return a.a.createElement("svg",se({width:28,height:28,viewBox:"0 0 28 28",fill:"currentColor",ref:t},n),r?a.a.createElement("title",null,r):null,ne||(ne=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 24C28 24.5523 27.5523 25 27 25H1C0.447715 25 0 24.5523 0 24V7C0 6.44772 0.447715 6 1 6H7.46L9.17 3.45C9.35398 3.17061 9.66548 3.00173 10 3H18C18.3345 3.00173 18.646 3.17061 18.83 3.45L20.54 6H27C27.5523 6 28 6.44772 28 7V24ZM2 23H26V8H20C19.6655 7.99827 19.354 7.82939 19.17 7.55L17.46 5H10.54L8.83 7.55C8.64602 7.82939 8.33452 7.99827 8 8H2V23ZM14 21C10.6863 21 8 18.3137 8 15C8 11.6863 10.6863 9 14 9C17.3137 9 20 11.6863 20 15C20 18.3137 17.3137 21 14 21ZM14 11C11.7909 11 10 12.7909 10 15C10 17.2091 11.7909 19 14 19C16.2091 19 18 17.2091 18 15C18 12.7909 16.2091 11 14 11Z",fill:"currentColor"})))},de=a.a.forwardRef((function(e,t){return a.a.createElement(he,se({svgRef:t},e))})),pe=(r.p,r(898)),me=r(877),ve=r(78),ge=r.n(ve),ye=r(465),be=r.n(ye),we=r(462),xe=r.n(we),Ee=r(172),Oe=r(463),Ce=r.n(Oe),je=r(83),Le=r.n(je),ke=r(50);function Se(){Se=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var Ne=function(){var e=Object(d.a)(Se().mark((function e(t){var r;return Se().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t instanceof HTMLCanvasElement)){e.next=4;break}e.t0=t,e.next=7;break;case 4:return e.next=6,Object(je.urlOrBlobToCanvas)(t);case 6:e.t0=e.sent;case 7:return r=e.t0,e.abrupt("return",r);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Me=function(e){return 0===e.length?x:e.reduce((function(e,t){return e.confidence=e.confidence||0,t.confidence=t.confidence||0,e.confidence>=t.confidence?e:t})).normalizedRect},_e=function(){var e=Object(d.a)(Se().mark((function e(t,r){var n,a,o;return Se().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Le.a(r),e.next=3,n.findRegions(t);case 3:return a=e.sent,o=Me(a),e.abrupt("return",{selectedRegion:Object(ke.isEqual)(o,x)?x:o,regions:a});case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Ie=function(e){var t=e.image,r=e.settings,n=e.region,a=e.filters,o={};return n&&(o={cropRect:n}),new Le.a(r).findByImage(t,o,a)};function Re(){Re=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var Te,He=function(e){var t,r,o,i,c,l,u=e.isToggle,s=e.onToggleModal,v=Object(n.useRef)(null),g=Object(n.useState)("environment"),y=Object(p.a)(g,2),b=y[0],w=y[1],x=Object(n.useState)(1),E=Object(p.a)(x,2),O=E[0],C=E[1],j=ce((function(e){return e})),k=j.search,I=j.settings,R=Object(f.g)(),T=ie(),H=k.keyFilter,V=Object(n.useCallback)((function(){w((function(e){return"environment"===e?"user":"environment"}))}),[]),G=function(){var e=Object(d.a)(Re().mark((function e(t){var r,n,a,o,i;return Re().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(P(!0)),T(_()),"/result"!==R.location.pathname&&R.push("/result"),e.next=5,Ne(t);case 5:if(n=e.sent,T(S(n)),T(F(t)),T(Z(!1)),A(),!I.regions){e.next=17;break}return e.next=13,_e(n,I);case 13:a=e.sent,T(N(a.regions)),r=a.selectedRegion,T(M(r));case 17:o=[{key:I.visualSearchFilterKey,values:["".concat(H)]}],i=[],Ie({image:n,settings:I,filters:H?o:void 0,region:r}).then((function(e){null===e||void 0===e||e.results.map((function(e){i.push({sku:e.sku,score:e.score})}));var t=Object(h.a)(Object(h.a)({},e),{},{filters:i});T(L(t)),T(P(!1))})).catch((function(e){console.log("error input search",e),T(P(!1))}));case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A=function(){w("environment"),C(1),s()},z=Object(Ee.a)({onDrop:function(){var e=Object(d.a)(Re().mark((function e(t){var r,n,a,o,i;return Re().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],T(P(!0)),T(F(URL.createObjectURL(t[0]))),e.next=5,Ne(t[0]);case 5:if(o=e.sent,T(S(o)),!I.regions){e.next=14;break}return e.next=10,_e(o,I);case 10:i=e.sent,T(N(i.regions)),a=i.selectedRegion,T(M(a));case 14:return e.abrupt("return",Ie({image:o,settings:I,region:a}).then((function(e){null===e||void 0===e||e.results.map((function(e){n.push({sku:e.sku,score:e.score})})),r=Object(h.a)(Object(h.a)({},e),{},{filters:n}),T(L(r)),setTimeout((function(){T(P(!1)),A(),R.push("/result")}),500)})).catch((function(e){console.log("err camera_custom",e),T(P(!1)),A()})));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}).getInputProps;return a.a.createElement(m.a,{className:"box-camera-custom"},a.a.createElement(pe.a,{anchor:"bottom",open:u,onClose:A,className:"modal-togggle-cam"},a.a.createElement(m.a,{className:"wrap-camera"},a.a.createElement("button",{className:"btn-close-modal right",style:{backgroundColor:null===(t=I.theme)||void 0===t?void 0:t.primaryColor},onClick:A},a.a.createElement(ge.a,{style:{fontSize:20,color:"#fff"}})),a.a.createElement("button",{className:"btn-close-modal left",style:{backgroundColor:null===(r=I.theme)||void 0===r?void 0:r.primaryColor},onClick:A},a.a.createElement("svg",{width:"18",height:"10",viewBox:"0 0 18 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.a.createElement("path",{d:"M9 9.5L0 1.60526L1.26 0.5L9 7.28947L16.74 0.5L18 1.60526L9 9.5Z",fill:"white"}))),a.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",height:"100svh",width:"100%"}},a.a.createElement(Ce.a,{audio:!1,height:"100svh",width:"100%",imageSmoothing:!0,screenshotFormat:"image/jpeg",forceScreenshotSourceSize:!0,videoConstraints:Object(h.a)(Object(h.a)({},{width:1080,height:1080,aspectRatio:1.33333333333}),{},{facingMode:b}),ref:v,style:{height:"100%",width:"100%",objectFit:"cover",transform:"scale(".concat(O,")")},screenshotQuality:1},(function(e){var t=e.getScreenshot;return a.a.createElement("button",{onClick:function(){var e=t();G(e)},className:"btn-capture-camera"},a.a.createElement("svg",{width:"63",height:"63",viewBox:"0 0 63 63",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.a.createElement("circle",{cx:"31.5",cy:"31.5",r:"31.5",fill:"white"})))}))),a.a.createElement("button",{className:"btn-switch-camera",onClick:V},a.a.createElement("img",{src:xe.a,alt:"",width:52,height:52})),a.a.createElement("div",{className:"box-scale-camera",style:{backgroundColor:null===(o=I.theme)||void 0===o?void 0:o.secondaryColor}},a.a.createElement("button",{className:"".concat(1===O&&"active"),style:{backgroundColor:1===O?null===(i=I.theme)||void 0===i?void 0:i.primaryColor:""},onClick:function(){return C(1)}},"1"),a.a.createElement("button",{className:"".concat(1.5===O&&"active"),style:{backgroundColor:1.5===O?null===(c=I.theme)||void 0===c?void 0:c.primaryColor:""},onClick:function(){return C(1.5)}},"1.5"),a.a.createElement("button",{className:"".concat(2===O&&"active"),style:{backgroundColor:2===O?null===(l=I.theme)||void 0===l?void 0:l.primaryColor:""},onClick:function(){return C(2)}},"2")),a.a.createElement("div",{className:"wrap-box-input-mobile custom-library"},a.a.createElement("input",Object.assign({id:"icon-button-file",type:"file",style:{display:"none"}},z({accept:"image/png,image/jpeg",onClick:function(e){e.stopPropagation()}}))),a.a.createElement("label",{htmlFor:"icon-button-file"},a.a.createElement(me.a,{color:"primary","aria-label":"upload picture",component:"span",style:{width:32,height:32,borderRadius:"100%",padding:7,backgroundColor:"#F3F3F5"}},a.a.createElement(be.a,{style:{fontSize:20,color:"red"}})))))))},Fe=["svgRef","title"];function Pe(){return(Pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Ve(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var Ze=function(e){var t=e.svgRef,r=e.title,n=Ve(e,Fe);return a.a.createElement("svg",Pe({width:24,height:22,viewBox:"0 0 22 21",style:{enableBackground:"new 0 0 22 20.28"},ref:t},n),r?a.a.createElement("title",null,r):null,Te||(Te=a.a.createElement("path",{className:"st3",d:"M 10.959 1.845 C 11.109 1.845 11.266 1.886 11.408 1.96 L 19.66 6.661 C 19.935 6.825 20.101 7.112 20.101 7.424 L 20.101 15.776 C 20.101 16.111 19.91 16.415 19.61 16.562 L 15.912 18.384 C 15.787 18.449 15.646 18.474 15.513 18.474 C 15.347 18.474 15.189 18.433 15.048 18.343 C 14.782 18.178 14.624 17.9 14.624 17.596 L 14.624 10.041 L 10.959 7.957 L 7.294 10.041 L 7.294 17.605 C 7.294 17.908 7.136 18.196 6.87 18.351 C 6.728 18.441 6.562 18.483 6.405 18.483 C 6.272 18.483 6.13 18.449 6.006 18.392 L 2.307 16.57 C 2.008 16.415 1.817 16.111 1.817 15.776 L 1.817 7.424 C 1.817 7.112 1.983 6.817 2.265 6.661 L 10.519 1.96 C 10.651 1.886 10.801 1.845 10.959 1.845 M 10.959 0.205 C 10.51 0.205 10.069 0.32 9.679 0.541 L 1.426 5.242 C 0.645 5.693 0.155 6.529 0.155 7.424 L 0.155 15.776 C 0.155 16.735 0.695 17.596 1.568 18.031 L 5.266 19.852 C 5.615 20.025 6.014 20.115 6.405 20.115 C 6.878 20.115 7.343 19.984 7.742 19.738 C 8.499 19.278 8.956 18.474 8.956 17.596 L 8.956 10.984 L 10.959 9.844 L 12.962 10.984 L 12.962 17.596 C 12.962 18.474 13.41 19.278 14.175 19.738 C 14.583 19.984 15.039 20.115 15.522 20.115 C 15.912 20.115 16.311 20.025 16.66 19.852 L 20.359 18.031 C 21.231 17.605 21.771 16.735 21.771 15.776 L 21.771 7.424 C 21.771 6.529 21.281 5.693 20.492 5.242 L 12.239 0.541 C 11.848 0.32 11.408 0.205 10.959 0.205 Z",fill:"currentColor",transform:"matrix(0.999999, 0.00121, -0.00121, 0.999999, 0.012302, -0.013258)"})))},Ge=a.a.forwardRef((function(e,t){return a.a.createElement(Ze,Pe({svgRef:t},e))}));r.p;var Ae,ze=function(e){var t,r,o,i=Object(n.useState)(!1),c=Object(p.a)(i,2),l=c[0],s=c[1],h=Object(f.g)(),d=ce((function(e){return e})).settings;return a.a.createElement(m.a,{className:"box-footer-mobile",display:"flex",position:"relative",alignItems:"center",height:"100%"},a.a.createElement(u.c,{style:{width:"70px",display:"flex",justifyContent:"center",height:"100%",alignItems:"center",backgroundColor:"/"===h.location.pathname?"".concat(null===(t=d.theme)||void 0===t?void 0:t.primaryColor,"21"):""},activeClassName:"active",to:"/",className:"nav-link p-0 menu-children rounded-0"},a.a.createElement(Ge,{color:"/"===h.location.pathname?null===(r=d.theme)||void 0===r?void 0:r.primaryColor:"#000"})),a.a.createElement(m.a,{style:{background:null===(o=d.theme)||void 0===o?void 0:o.primaryColor},className:"box-icon-camera-mobile"},a.a.createElement(le.a,{onClick:function(){s(!l)}},a.a.createElement(de,{color:"#FFFF"}))),a.a.createElement(m.a,{className:"box-screenshot-camera"},a.a.createElement(He,{isToggle:l,onToggleModal:function(){s(!l)}})))},Be=r(879),De=["svgRef","title"];function Ue(){return(Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function qe(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var We=function(e){var t=e.svgRef,r=e.title,n=qe(e,De);return a.a.createElement("svg",Ue({width:16,height:16,viewBox:"0 0 16 16",fill:"currentColor",ref:t},n),r?a.a.createElement("title",null,r):null,Ae||(Ae=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 4H12.95C12.7 2.85 11.7 2 10.5 2C9.3 2 8.3 2.85 8.05 4H1V5H8.05C8.3 6.15 9.3 7 10.5 7C11.7 7 12.7 6.15 12.95 5H15V4ZM10.5 6C9.65 6 9 5.35 9 4.5C9 3.65 9.65 3 10.5 3C11.35 3 12 3.65 12 4.5C12 5.35 11.35 6 10.5 6ZM1 12H3.05C3.3 13.15 4.3 14 5.5 14C6.7 14 7.7 13.15 7.95 12H15V11H7.95C7.7 9.85 6.7 9 5.5 9C4.3 9 3.3 9.85 3.05 11H1V12ZM5.5 10C6.35 10 7 10.65 7 11.5C7 12.35 6.35 13 5.5 13C4.65 13 4 12.35 4 11.5C4 10.65 4.65 10 5.5 10Z",fill:"currentColor"})))},Ye=a.a.forwardRef((function(e,t){return a.a.createElement(We,Ue({svgRef:t},e))})),Ke=(r.p,r(882)),Qe=r(901),Je=r(471),Xe=r.n(Je),$e=r(466),et=r.n($e),tt=r(250),rt=r.n(tt),nt=function(){var e=Object(f.h)().search;return Object(n.useMemo)((function(){return new URLSearchParams(e)}),[e])},at=r(897);var ot=function(e){var t=e.children,r=e.openModal,n=void 0!==r&&r,o=e.handleClose,i=e.classNameModal,c=e.classNameComponentChild;return a.a.createElement(at.a,{open:n,onClose:o,className:"modal-container ".concat(i||""),style:{display:"flex",justifyContent:"center",alignItems:"center"}},a.a.createElement("div",{className:c,style:{overflowY:"hidden",maxHeight:"95vh",borderRadius:12}},t))},it=r(112);function ct(){ct=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var lt=function(){var e=Object(d.a)(ct().mark((function e(){var t,r,n,a=arguments;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:10,r=a.length>1?a[1]:void 0,n=new Le.a(r),e.abrupt("return",n.getFilters(t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ut=function(){var e=Object(d.a)(ct().mark((function e(){var t,r,n,a,o,i=arguments;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:"",r=i.length>1?i[1]:void 0,n=i.length>2?i[2]:void 0,a=new Le.a(n),o=r||"",e.abrupt("return",a.searchFilters(t,o));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),st=r(905),ft=r(880),ht=r(881);function dt(e,t){return(null===e||void 0===e?void 0:e.length)>t?(null===e||void 0===e?void 0:e.slice(0,t))+"...":e}function pt(){pt=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var mt=function(e){var t,r,o=e.handleClose,i=ie(),c=ce((function(e){return e})),l=c.settings,u=c.search.keyFilter,s=Object(n.useState)([]),f=Object(p.a)(s,2),h=f[0],v=f[1],g=Object(n.useState)(u||""),y=Object(p.a)(g,2),w=y[0],x=y[1],E=Object(n.useState)(!1),O=Object(p.a)(E,2),C=O[0],j=O[1],L=Object(n.useState)(0),k=Object(p.a)(L,2),S=k[0],N=k[1],M=Object(b.useMediaQuery)({query:"(max-width: 776px)"}),_=function(){var e=Object(d.a)(pt().mark((function e(){var t;return pt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return j(!0),t=lt(1e3,l).then((function(e){var t,r=((null===(t=e.find((function(e){return e.key===l.visualSearchFilterKey})))||void 0===t?void 0:t.values)||[]).sort().reduce((function(e,t){var r=t[0].toLocaleUpperCase();return e[r]?e[r].push(t):e[r]=[t],e}),{});v(r),N(Object.keys(r).length)})).catch((function(e){console.log("err getDataFilterDesktop",e)})).finally((function(){j(!1)})),e.abrupt("return",t);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(n.useEffect)((function(){_()}),[]);var I=function(e,t){x(t)},R=function(){var e=Object(d.a)(pt().mark((function e(t){var r;return pt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return _(),e.abrupt("return");case 3:return e.next=5,ut(l.visualSearchFilterKey,encodeURIComponent(t),l).then((function(e){e.length>0?(v(Object(it.a)({},e[0][0].toLocaleUpperCase(),e)),e.length<=20?N(1):e.length<=40?N(2):N(4)):(v({}),N(4))})).catch((function(e){console.log("err filterSearchHandler",e)}));case 5:return r=e.sent,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=function(){i(A(w)),o()};return a.a.createElement(m.a,{className:"box-child-component-filter-desktop",display:"flex",flexDirection:"column",style:{position:"relative"}},a.a.createElement(Be.a,{style:{color:"#000",fontSize:"24px",fontWeight:700,paddingLeft:M?"0px":"14px",marginBottom:M?"0px":"-8px",marginTop:M?"0px":"24px"}},l.preFilterTitle),a.a.createElement(m.a,{className:"box-top",style:M?{padding:0}:void 0,display:"flex",justifyContent:"space-between",alignItems:"center"},a.a.createElement(m.a,{className:"box-input-search-filter",display:"flex",justifyItems:"center",style:M?{width:"100%"}:void 0},(!w||M)&&a.a.createElement(m.a,{className:"icon-search",style:{marginRight:11},display:"flex",justifyContent:"center",alignItems:"center"},a.a.createElement("img",{style:{maxWidth:"fit-content"},src:rt.a,alt:"",width:18,height:18})),w&&!M&&a.a.createElement(m.a,{display:"flex",className:"box-keyFilter"},a.a.createElement(Be.a,{className:"keyFilter max-line-1"},w),a.a.createElement(le.a,{style:{padding:0},onClick:function(){return x("")}},a.a.createElement(ge.a,{style:{fontSize:12,color:"#2B2C46"}}))),a.a.createElement("input",{className:"input-search-filter",placeholder:"Search",onChange:function(e){R(e.target.value)}})),!M&&a.a.createElement(le.a,{onClick:o},a.a.createElement(ge.a,null))),a.a.createElement(m.a,{style:{margin:"10px 16px"}},w&&M&&a.a.createElement(m.a,{display:"flex",className:"box-keyFilter",style:{display:"inline-flex"}},a.a.createElement(Be.a,{className:"keyFilter"},w),a.a.createElement(le.a,{style:{padding:0},onClick:function(){return x("")}},a.a.createElement(ge.a,{style:{fontSize:12,color:"#2B2C46"}})))),a.a.createElement(m.a,{className:"box-bottom",height:"100%",style:M?{columnCount:1,marginBottom:w?"50px":"0px"}:S<=4?{columnCount:S,height:"100%",paddingBottom:20}:{columnCount:4,paddingBottom:20}},Object.entries(h).map((function(e,t){var r=Object(p.a)(e,2),n=r[0],o=r[1];return a.a.createElement(m.a,{className:"box-group-items",style:S<=4?{width:"fit-content"}:{width:"100%"}},a.a.createElement(Be.a,{style:{fontWeight:"bold",color:"#000",paddingLeft:11}},n),a.a.createElement(st.a,{value:w,exclusive:!0,onChange:I,"aria-label":"",className:"box-btn-group"},o.map((function(e,t){return a.a.createElement(Qe.a,{key:e,title:e,placement:"top",arrow:!0,disableHoverListener:e.length<20},a.a.createElement(ft.a,{value:e,"aria-label":e,className:"item-btn",onChange:function(){x(e)}},dt(e,M?35:20)))}))))})),C&&a.a.createElement(m.a,{style:{columnCount:M?1:4}},Array(12).fill("").map((function(e,t){return a.a.createElement(m.a,{key:t,mb:5},a.a.createElement(ht.a,{animation:"pulse",height:30,width:60}),Array(6).fill("").map((function(e,t){return a.a.createElement(ht.a,{animation:"pulse",height:30})})))}))),Object(ke.isEmpty)(h)&&!C&&a.a.createElement(Be.a,null,"No result found")),w&&!M&&a.a.createElement(m.a,{className:"footer",style:{height:64,marginTop:"auto"},display:"flex"},a.a.createElement(le.a,{className:"button-left",style:{width:"50%",backgroundColor:"#000000",color:"#fff",borderRadius:0,justifyContent:"flex-start"},onClick:function(){return o()}},"Cancel"),a.a.createElement(le.a,{className:"button-right",style:{width:"50%",backgroundColor:null===(t=l.theme)||void 0===t?void 0:t.primaryColor,color:"#fff",borderRadius:0,justifyContent:"flex-start"},onClick:function(){return T()}},"Apply")),w&&M&&a.a.createElement(m.a,{className:"footer",style:{height:64,marginTop:"auto",position:"fixed",bottom:"0px",left:"0px",width:"100vw"},display:"flex"},a.a.createElement(le.a,{className:"button-left",style:{width:"50%",backgroundColor:"#000000",color:"#fff",borderRadius:0,justifyContent:"flex-start"},onClick:function(){return o()}},"Cancel"),a.a.createElement(le.a,{className:"button-right",style:{width:"50%",backgroundColor:null===(r=l.theme)||void 0===r?void 0:r.primaryColor,color:"#fff",borderRadius:0,justifyContent:"flex-start"},onClick:function(){return T()}},"Apply")))},vt=r(90),gt=r(251),yt=r.n(gt);function bt(){bt=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var wt,xt=Object(Ke.a)(Object(n.memo)((function(e){var t,r,o,i,c,l=e.refine,u=e.onToggleFilterMobile,s=ce((function(e){return e})),v=s.search,g=s.settings,y=v.imageThumbSearchInput,w=v.keyFilter,x=Object(n.useRef)(null),E=Object(f.g)(),O=Object(n.useState)(""),C=Object(p.a)(O,2),j=C[0],k=C[1],I=ie(),T=Object(b.useMediaQuery)({query:"(max-width: 776px)"}),H=nt(),V=Object(n.useState)(!1),Z=Object(p.a)(V,2),G=Z[0],z=Z[1],B=Object(vt.b)().t;Object(n.useEffect)((function(){(null===x||void 0===x?void 0:x.current)&&(null===x||void 0===x||x.current.focus())}),[x]),Object(n.useEffect)((function(){var e=H.get("query")||"";Object(ke.isEmpty)(e)||(k(e),l(e),setTimeout((function(){l(e)}),100))}),[H,l]),Object(n.useEffect)((function(){y&&(k(""),l(""),E.push("/result"))}),[y]);var D=Object(n.useCallback)(Object(ke.debounce)((function(e){e?E.push({pathname:"/result",search:"?query=".concat(e)}):E.push("/result")}),500),[]),U=function(){var e=Object(d.a)(bt().mark((function e(t){var r,n,a,o,i,c;return bt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I(P(!0)),I(_()),"/result"!==E.location.pathname&&E.push("/result"),n=[],I(F(URL.createObjectURL(t))),e.next=7,Ne(t);case 7:if(o=e.sent,I(S(o)),i=[{key:g.visualSearchFilterKey,values:["".concat(w)]}],!g.regions){e.next=17;break}return e.next=13,_e(o,g);case 13:c=e.sent,I(N(c.regions)),a=c.selectedRegion,I(M(a));case 17:return e.abrupt("return",Ie({image:o,settings:g,filters:w?i:void 0,region:a}).then((function(e){null===e||void 0===e||e.results.map((function(e){n.push({sku:e.sku,score:e.score})})),r=Object(h.a)(Object(h.a)({},e),{},{filters:n}),I(L(r)),I(P(!1))})).catch((function(e){console.log("error input search",e),I(P(!1))})));case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),q=Object(Ee.a)({onDrop:function(){var e=Object(d.a)(bt().mark((function e(t){var r;return bt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"image/heic"===(r=t[0]).type?yt()({blob:r,toType:"image/png",quality:1}).then((function(e){U(e)})).catch((function(e){console.error("Error converting HEIC to PNG:",e)})):U(t[0]);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}).getInputProps;return a.a.createElement(m.a,{className:"wrap-input-search"},a.a.createElement("div",{style:{padding:10},className:"box-input-search d-flex"},a.a.createElement("form",{noValidate:!0,action:"",role:"search"},a.a.createElement(m.a,{className:"box-inp"},a.a.createElement(m.a,{style:{height:"75%",order:1,paddingLeft:y||w?0:10,marginLeft:w?0:5}},y&&a.a.createElement(m.a,{style:{border:"2px solid ".concat(null===(t=g.theme)||void 0===t?void 0:t.secondaryColor,"c7"),backgroundColor:"".concat(null===(r=g.theme)||void 0===r?void 0:r.secondaryColor,"26"),marginRight:"5px"},className:"box-image-search-thumb",display:"flex"},a.a.createElement("img",{src:y,style:{objectFit:"contain"},alt:"img_search"}),a.a.createElement(Qe.a,{title:"Clear image search",placement:"top",arrow:!0},a.a.createElement("button",{type:"button",onClick:function(){j||(I(R("")),E.push("/")),I(R("")),l(j)}},a.a.createElement(ge.a,{style:{fontSize:20,color:null===(o=g.theme)||void 0===o?void 0:o.secondaryColor}}))))),!j&&a.a.createElement(m.a,{className:"icon-search",style:y?{order:2,marginLeft:5}:{order:2}},a.a.createElement("img",{src:rt.a,alt:"",width:24,height:24})),w&&!T&&a.a.createElement(m.a,{className:"box-key-filter",style:{order:0,marginRight:5,border:"2px solid ".concat(null===(i=g.theme)||void 0===i?void 0:i.secondaryColor,"c7")}},a.a.createElement(Qe.a,{title:w,placement:"top",arrow:!0,disableHoverListener:w.length<16},a.a.createElement(Be.a,null,dt(w,15))),a.a.createElement(Qe.a,{title:"Remove pre-filter",placement:"top",arrow:!0},a.a.createElement(le.a,{onClick:function(){return I(A(""))},style:{padding:"6px 2px"}},a.a.createElement(ge.a,{style:{fontSize:20,color:null===(c=g.theme)||void 0===c?void 0:c.secondaryColor}})))),a.a.createElement("input",{style:{border:"0px",width:"100%",fontSize:14,color:"#2B2C46",fontStyle:"italic"},className:"input-search",placeholder:B("Search"),value:j,onChange:function(e){k(e.currentTarget.value),D(e.currentTarget.value),""===e.currentTarget.value&&(k(""),l(""))},ref:x})),"/result"===E.location.pathname&&j&&a.a.createElement(le.a,{className:"btn-clear-text",onClick:function(){if(y)return k(""),void l("");k(""),l(""),I(R("")),E.push("/")}},a.a.createElement(Qe.a,{title:B("Clear text search"),placement:"top",arrow:!0},a.a.createElement(Xe.a,{style:{fontSize:16,color:"#2B2C46"}}))),T?a.a.createElement(m.a,null,a.a.createElement(le.a,{className:"btn-mobile-filter",onClick:u},a.a.createElement(Ye,{width:18,height:18}))):a.a.createElement("div",{className:"wrap-box-input-mobile d-flex"},g.preFilterOption&&a.a.createElement(Qe.a,{title:"Add or change pre-filter",placement:"top",arrow:!0,style:{backgroundColor:"#000000"}},a.a.createElement(le.a,{onClick:function(){return z(!0)},style:{width:32,height:32,borderRadius:"100%",marginRight:10}},a.a.createElement(Ye,null))),a.a.createElement("input",Object.assign({accept:"image/*",id:"icon-button-file",type:"file",style:{display:"none"}},q({onClick:function(e){e.stopPropagation()}}))),a.a.createElement(Qe.a,{title:B("Search with an image"),placement:"top",arrow:!0},a.a.createElement("label",{htmlFor:"icon-button-file"},a.a.createElement(me.a,{color:"primary","aria-label":"upload picture",component:"span",style:{width:32,height:32,borderRadius:"100%",padding:7}},a.a.createElement("img",{src:et.a,alt:"",width:18,height:18}))))))),g.preFilterOption&&a.a.createElement(ot,{openModal:G,handleClose:function(){return z(!1)},classNameModal:"wrap-filter-destop",classNameComponentChild:"bg-white box-filter-destop"},a.a.createElement(mt,{handleClose:function(){return z(!1)}})))}))),Et=["svgRef","title"];function Ot(){return(Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Ct(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var jt=function(e){var t=e.svgRef,r=e.title,n=Ct(e,Et);return a.a.createElement("svg",Ot({width:24,height:24,viewBox:"0 0 24 24",fill:"none",ref:t},n),r?a.a.createElement("title",null,r):null,wt||(wt=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.3723 22.117C23.719 22.4637 23.719 23.0257 23.3723 23.3723C23.0257 23.719 22.4637 23.719 22.117 23.3723L16.8475 18.1028C16.3904 17.6457 15.6641 17.6208 15.123 17.9745C11.1608 20.5639 5.82363 19.9525 2.55769 16.3754C-0.967972 12.5138 -0.832726 6.56215 2.86471 2.86471C6.56215 -0.832726 12.5138 -0.967972 16.3754 2.55769C19.9525 5.82363 20.5639 11.1608 17.9745 15.123C17.6208 15.6641 17.6457 16.3904 18.1028 16.8475L23.3723 22.117ZM9.79677 1.80687C5.38428 1.80687 1.80725 5.3839 1.80725 9.79639C1.81214 14.2069 5.38631 17.781 9.79677 17.7859C14.2093 17.7859 17.7863 14.2089 17.7863 9.79639C17.7863 5.3839 14.2093 1.80687 9.79677 1.80687Z",fill:"#000"})))},Lt=a.a.forwardRef((function(e,t){return a.a.createElement(jt,Ot({svgRef:t},e))}));r.p;var kt=Object(Ke.a)(Object(n.memo)((function(e){var t,r,o,i,c,l,s,h,d,v,g,y,w,x=e.onToggleFilterMobile,E=e.refine,O=ie(),C=ce((function(e){return e})).search,j=C.imageThumbSearchInput,L=C.textSearchInputMobile,k=C.keyFilter,S=C.preFilterDropdown,N=nt(),M=Object(b.useMediaQuery)({query:"(max-width: 776px)"}),_=Object(n.useRef)(null),I=Object(n.useState)(!1),T=Object(p.a)(I,2),H=T[0],P=T[1],Z=Object(n.useState)(!1),B=Object(p.a)(Z,2),D=B[0],U=B[1],q=Object(f.g)(),W=ce((function(e){return e})).settings;Object(n.useEffect)((function(){var e;"/result"===(null===(e=q.location)||void 0===e?void 0:e.pathname)?U(!0):U(!1)}),[q.location]),Object(n.useEffect)((function(){""!==j&&(q.push("/result"),O(V("")),E(""))}),[j,O,E,q]),Object(n.useEffect)((function(){var e,t;"/result"===(null===(e=q.location)||void 0===e?void 0:e.pathname)||"/"===(null===(t=q.location)||void 0===t?void 0:t.pathname)?P(!0):P(!1)}),[q.location]),Object(n.useEffect)((function(){var e=N.get("query")||"";Object(ke.isEmpty)(e)||(O(V(e)),E(e),setTimeout((function(){E(e)}),100))}),[N,E,O]);var Y=Object(n.useCallback)(Object(ke.debounce)((function(e){e?q.push({pathname:"/result",search:"?query=".concat(e)}):q.push("/result")}),500),[]);return a.a.createElement(m.a,{style:{width:"100%"}},a.a.createElement(m.a,{className:"box-content",style:{display:"flex",alignItems:"center",height:"50px",borderBottom:"1px solid #e9e9ec",background:null===(t=W.theme)||void 0===t?void 0:t.headerColor}},a.a.createElement(u.c,{to:"/",style:{lineHeight:0,paddingLeft:"10px"},onClick:function(){O(R(""))}},a.a.createElement("img",{src:null===(r=W.theme)||void 0===r?void 0:r.appBarLogoUrl,alt:"logo",style:{aspectRatio:1,width:null===(o=W.theme)||void 0===o?void 0:o.logoWidth,height:null===(i=W.theme)||void 0===i?void 0:i.logoHeight}}))),a.a.createElement(m.a,{className:"wrap-header-mobile"},M?a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{style:{display:"flex",alignItems:"center"}},j&&a.a.createElement("div",{style:{border:"2px solid ".concat(null===(c=W.theme)||void 0===c?void 0:c.secondaryColor,"c7"),backgroundColor:"".concat(null===(l=W.theme)||void 0===l?void 0:l.secondaryColor,"26")},className:"box-image-search-thumb-mobile"},a.a.createElement("img",{src:j,style:{maxWidth:"39px",objectFit:"contain"},alt:"img_search"}),a.a.createElement("button",{style:{backgroundColor:"".concat(null===(s=W.theme)||void 0===s?void 0:s.secondaryColor,"26")},onClick:function(){if(L)return O(F("")),void O(G(""));O(R("")),q.push("/")}},a.a.createElement(ge.a,{style:{fontSize:20,color:null===(h=W.theme)||void 0===h?void 0:h.secondaryColor,fontWeight:700}}))),H&&a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{ref:_,id:"box-input-search",className:"d-flex w-100",style:{alignItems:"center"}},!L&&a.a.createElement(m.a,{style:{paddingLeft:"8px",display:"flex",alignItems:"center"}},a.a.createElement(Lt,{width:20,height:20})),a.a.createElement(St,{value:L,onChange:function(e){Y(e.currentTarget.value),""===e.currentTarget.value?(O(V("")),E("")):O(V(e.currentTarget.value))}}),D&&W.postFilterOption&&a.a.createElement(m.a,{className:"box-button-input-mobile"},a.a.createElement(le.a,{className:"btn-mobile-filter",onClick:x},a.a.createElement(Ye,null))),"/"!==(null===(d=q.location)||void 0===d?void 0:d.pathname)&&L&&a.a.createElement(m.a,{className:"btn-close-header",style:{backgroundColor:"#fff"}},a.a.createElement("button",{onClick:function(){if(j)return q.push("/result"),O(V("")),void E("");O(V("")),O(R("")),E(""),q.push("/")},style:{backgroundColor:"#fff",border:0,display:"flex"}},a.a.createElement(ge.a,{style:{fontSize:20,color:null===(v=W.theme)||void 0===v?void 0:v.secondaryColor}}))))),W.preFilterOption&&a.a.createElement(le.a,{onClick:function(){O(z(!S))},style:{order:3,width:32,height:32,borderRadius:"100%",backgroundColor:S||k?"".concat(null===(g=W.theme)||void 0===g?void 0:g.secondaryColor,"26"):"#f3f3f5",margin:"0 12px"}},S?a.a.createElement(ge.a,{style:{fontSize:16,color:null===(y=W.theme)||void 0===y?void 0:y.secondaryColor}}):a.a.createElement(Ye,{color:k?null===(w=W.theme)||void 0===w?void 0:w.secondaryColor:"#000"})))):a.a.createElement(xt,{onToggleFilterMobile:x})),k&&M&&a.a.createElement(m.a,{className:"ml-auto mr-auto",style:{display:"flex",columnGap:"16px",alignItems:"center",marginTop:"12px",marginBottom:"5px",paddingLeft:"16px",paddingRight:"16px"}},a.a.createElement(Be.a,{color:"textPrimary"},"Pre-filter:"),a.a.createElement(m.a,{className:"box-key-filter",style:{display:"inline-flex",border:"2px solid black",borderRadius:3,padding:"2px 5px",background:"#efefef",color:"black",alignItems:"center"}},a.a.createElement(Be.a,null,k),a.a.createElement(le.a,{style:{paddingRight:"0px"},onClick:function(){return O(A(""))}},a.a.createElement(ge.a,{style:{fontSize:16,color:"#2B2C46"}})))))}))),St=function(e){var t=e.value,r=e.onChange;return Object(n.useEffect)((function(){var e=document.getElementById("mobile-input-search"),t=function(t){"Enter"===t.key&&(null===e||void 0===e||e.blur())};return null===e||void 0===e||e.addEventListener("keyup",t,!1),function(){null===e||void 0===e||e.removeEventListener("scroll",t,!1)}}),[]),a.a.createElement("input",{style:{border:"0px",width:"100%",fontSize:14,paddingLeft:"12px",paddingRight:"4px",color:"#2B2C46",fontStyle:"italic",outline:"none"},className:"input-search",placeholder:"Search",value:t,onChange:r,id:"mobile-input-search"})};var Nt=function(){var e,t,r,n=ie(),o=ce((function(e){return e})).settings;return a.a.createElement(m.a,{className:"box-content",display:"flex"},a.a.createElement(u.c,{to:"/",style:{lineHeight:0,paddingLeft:"10px"},onClick:function(){n(R(""))}},a.a.createElement("img",{src:null===(e=o.theme)||void 0===e?void 0:e.appBarLogoUrl,alt:"logo",style:{aspectRatio:1,width:null===(t=o.theme)||void 0===t?void 0:t.logoWidth,height:null===(r=o.theme)||void 0===r?void 0:r.logoHeight}})))},Mt=r(77),_t=r(105),It=r.n(_t),Rt=r(883);var Tt=Object(Rt.a)(Object(n.memo)((function(e){var t=e.children,r=e.type,o=void 0===r?"native":r,i=e.className,c=e.items,l=e.refine,u=Object(n.useCallback)((function(){return l(c)}),[l,c]),s=ce((function(e){return e})).settings;return a.a.createElement(le.a,{type:o,disabled:!c.length,className:i,onClick:u,style:{color:s.theme.secondaryColor,fontWeight:"bold",textTransform:"capitalize",padding:0}},t)}),It.a)),Ht=["children","enabled"];function Ft(e){var t=e.children,r=e.enabled,o=void 0===r||r,i=Object(s.a)(e,Ht),c=Object(n.useState)(),l=Object(p.a)(c,2),u=l[0],f=l[1];return Object(n.useEffect)((function(){f(o)}),[o]),u?a.a.createElement("div",i,t):a.a.createElement(a.a.Fragment,null)}var Pt=r(252),Vt=r.n(Pt),Zt=r(253),Gt=r.n(Zt);function At(e){var t=e.icon,r=e.label,o=(e.labelPosition,e.className,e.classNameLabel),i=void 0===o?"":o,c=Object(n.useState)(""),l=Object(p.a)(c,2),u=l[0],s=l[1];return Object(n.useEffect)((function(){s(t)}),[t]),a.a.createElement("div",{style:{display:"flex",alignItems:"center"}},r&&a.a.createElement("div",{className:i},a.a.createElement(Be.a,{style:{textTransform:"none",fontSize:12,color:"#55566B",fontWeight:600}},r)),"remove"===u?a.a.createElement(Vt.a,{style:{color:"#55566B"}}):a.a.createElement(Gt.a,{style:{color:"#55566B"}}))}var zt=r(113),Bt=r(895),Dt=r(49),Ut=r.n(Dt),qt=r(903),Wt=r(892),Yt={collapsed:function(e){return{height:e?"auto":0,opacity:0,pointerEvents:"none",transitionEnd:{display:"none"}}},expanded:function(e){return{height:"auto",opacity:1,pointerEvents:"auto",display:"block"}}},Kt={ease:[.16,1,.3,1],duration:.6};function Qt(e){var t=e.isCollapsed,r=e.className,n=e.children,o=Object(qt.a)();return a.a.createElement(a.a.Fragment,null,a.a.createElement(Wt.a.div,{key:"collapse",initial:"collapsed",animate:t?"collapsed":"expanded",variants:Yt,className:Ut()("overflow-hidden",r),transition:Kt,custom:o},n))}var Jt=r(179),Xt=r(884),$t=Object(zt.atom)({searchResults:void 0,isSearchStalled:void 0}),er=Object(Jt.selectAtom)($t,(function(e){return e.searchResults}),It.a);Object(Jt.selectAtom)($t,(function(e){return e.isSearchStalled}));Object(Xt.a)(Object(n.memo)((function(e){var t=e.searchResults,r=e.isSearchStalled,a=Object(Jt.useUpdateAtom)($t);return Object(n.useEffect)((function(){a({searchResults:t,isSearchStalled:r})}),[a,t,r]),null}),It.a));var tr=Object(Rt.a)(Object(n.memo)((function(e){var t=e.children,r=e.className,o=e.header,i=e.attributes,c=void 0===i?[]:i,l=e.isOpened,u=void 0!==l&&l,s=(e.items,e.onToggle),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object(n.useMemo)((function(){var t=(null===e||void 0===e?void 0:e.disjunctiveFacets)||[],r=(null===e||void 0===e?void 0:e.hierarchicalFacets)||[];return[].concat(Object(Mt.a)(t),Object(Mt.a)(r))}),[e]),a=Object(n.useMemo)((function(){var e=!t.length;return r.forEach((function(r){null===t||void 0===t||t.forEach((function(t){r.name===t&&r.data&&(e=!0)}))})),e}),[r,t]);return a}(Object(Jt.useAtomValue)(er),c),h=Object(b.useMediaQuery)({query:"(max-width: 776px)"});return a.a.createElement(m.a,null,a.a.createElement("div",{className:Ut()("border-neutral-light",{hidden:!f},r)},a.a.createElement(le.a,{className:"w-full flex items-center justify-between group","aria-expanded":u,style:{paddingLeft:0},onClick:function(e){"function"===typeof s&&s(e)}},a.a.createElement("div",{className:"flex items-center w-full subhead"},a.a.createElement(Be.a,{className:"fw-700",style:{textTransform:"none",fontFamily:"Montserrat !important",fontSize:14}},o||c[0])),!h&&a.a.createElement("div",{className:"text-neutral-dark can-hover:transition-colors can-hover:group-hover:text-neutral-light"},u?a.a.createElement(Vt.a,null):a.a.createElement(Gt.a,null))),a.a.createElement(Qt,{isCollapsed:!u},a.a.createElement("div",{className:"mt-4"},t))))})));function rr(e){var t;return(null===e||void 0===e?void 0:e.attributes)?null===(t=e.options)||void 0===t?void 0:t.attributes.join(":"):null===e||void 0===e?void 0:e.attribute}function nr(e){var t=e.widgets,r=[];return(null===t||void 0===t?void 0:t.length)?t.forEach((function(e){return r.push(rr(e))})):r.push(rr(e)),r.join(":")}function ar(e){return null===e||void 0===e?void 0:e.attribute}var or=["children","onToggle","panelId"];var ir=Object(zt.atom)((function(e){return Boolean(Object.values(e(cr)).find((function(e){return!0===e})))}),(function(e,t,r){var n,a,o=r(e(ir));t(cr,(n=e(cr),a=o,Object.keys(n).reduce((function(e,t){return Object(h.a)(Object(h.a)({},e),{},Object(it.a)({},t,a))}),{})))})),cr=Object(zt.atom)({});function lr(e){var t=e.children,r=e.onToggle,o=e.panelId,i=Object(s.a)(e,or),c=Object(n.useCallback)((function(){return r(o)}),[r,o]);return a.a.createElement(tr,Object.assign({onToggle:c},i),t)}function ur(e){var t,r=e.dynamicWidgets,o=void 0===r||r,i=e.onToogleApplyFillter,c=ce((function(e){return e})).settings,l=c.refinements,u=Object(zt.useAtom)(cr),s=Object(p.a)(u,2),d=s[0],v=s[1],g=Object(zt.useAtom)(ir),y=Object(p.a)(g,2),w=y[0],x=y[1],E=Object(f.g)(),O=Object(b.useMediaQuery)({query:"(max-width: 776px)"});Object(n.useEffect)((function(){v((function(e){return Object(h.a)(Object(h.a)({},e),l.reduce((function(e,t){return Object(h.a)(Object(h.a)({},e),{},Object(it.a)({},nr(t),Boolean(t.isExpanded)))}),{}))}))}),[]);var C=Object(n.useCallback)((function(e){v((function(t){return Object(h.a)(Object(h.a)({},t),{},Object(it.a)({},e,!t[e]))}))}),[v]),j=Object(n.useMemo)((function(){return l.map((function(e){return a.a.createElement(Bt.a,Object.assign({className:"box-refinement-list",attribute:e.attribute},e.options,{translations:{noResults:"No results",placeholder:""},transformItems:function(e){return Object(ke.orderBy)(e,"label","asc")}}))}))}),[l]),L=Object(n.useMemo)((function(){return j.map((function(e,t){var r=l[t],n=nr(r),o=function(e){var t,r=null===(t=e)||void 0===t?void 0:t.widgets,n=[];return(null===r||void 0===r?void 0:r.length)?r.forEach((function(e){return n.push(ar(e))})):n.push(ar(e)),n}(r);return e?a.a.createElement(lr,{key:n,panelId:n,attributes:o,header:r.header,isOpened:O?!d[n]:d[n],onToggle:C},e):a.a.createElement(a.a.Fragment,null)}))}),[j,l,C,d,O]),k=Object(n.useCallback)((function(){x((function(e){return!e}))}),[x]);return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",{className:"wrap-main-header-panel"},!O&&a.a.createElement(m.a,{style:{borderBottom:"1px solid #E0E0E0"}},a.a.createElement(le.a,{className:"text-neutral-darkest",onClick:k,style:{justifyContent:"flex-end"}},a.a.createElement(At,{icon:w?"remove":"add",label:"".concat(w?"Collapse":"Expand"," all")})))),O&&a.a.createElement(m.a,{className:"box-top-filter",style:{paddingBottom:10}},a.a.createElement(Tt,null,"Reset Filters")),a.a.createElement(m.a,{className:"box-center-filter"},a.a.createElement(Ft,{enabled:o},L)),O&&a.a.createElement(m.a,{className:"box-footer-filter"},a.a.createElement(le.a,{className:"text-white",style:{width:"100%",backgroundColor:null===(t=c.theme)||void 0===t?void 0:t.secondaryColor,fontWeight:700,fontSize:14,borderRadius:0},onClick:function(){i(),"/result"!==E.location.pathname&&E.push("/result")}},"APPLY")))}var sr=r(472);function fr(){fr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var hr=r.n(sr).a.create(),dr=function(){var e=Object(d.a)(fr().mark((function e(t){var r,n,a,o;return fr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.apiKey,n=t.baseUrl,a={"X-Api-Key":r},e.next=4,hr.request({method:"POST",url:"".concat(n,"/find/v1/session"),headers:a});case 4:return o=e.sent,e.abrupt("return",o.data.session);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function pr(){pr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var mr=Object(n.memo)((function(e){var t,r,o,i,c,l=e.children,u=ie(),s=ce((function(e){return e})),v=s.settings,w=s.search,x=w.valueTextSearch,E=w.loadingSearchAlgolia,O=w.preFilterDropdown,C=v.algolia,j=C.apiKey,L=C.appId,k=C.indexName,S=Object(b.useMediaQuery)({query:"(max-width: 776px)"}),N=Object(n.useState)(!1),M=Object(p.a)(N,2),_=M[0],R=M[1],H=Object(f.g)(),F=S&&"/result"===(null===(t=H.location)||void 0===t?void 0:t.pathname)||"/"===(null===(r=H.location)||void 0===r?void 0:r.pathname);Object(n.useEffect)((function(){(function(){var e=Object(d.a)(pr().mark((function e(){var t;return pr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dr(v);case 2:t=e.sent,u(T(t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}})()().catch(console.log)}),[]),Object(n.useEffect)((function(){var e;"/"===(null===(e=H.location)||void 0===e?void 0:e.pathname)&&(document.title=v.appTitle||"",u(G("")))}),[H.location]);var P="newVersion";S?(P="mobile",c=ze,i=kt):i=Nt;var V=Object(n.useMemo)((function(){var e=g()(L,j);return e.initIndex(k),Object(h.a)(Object(h.a)({},e),{},{search:function(t){return t.every((function(e){var t,r,n;return!(null===(t=e.params)||void 0===t?void 0:t.query)&&(!(null===(r=e.params)||void 0===r?void 0:r.filters)||(null===(n=e.params)||void 0===n?void 0:n.filters.endsWith("<score=1>")))}))?Promise.resolve({results:t.map((function(){return{hits:[],nbHits:0,nbPages:0,processingTimeMS:0}}))}):e.search(t)}})}),[j,L,k]);return a.a.createElement(m.a,{position:"relative",className:"wrap-mobile"},E&&a.a.createElement(m.a,{className:"box-wrap-loading",style:{zIndex:99999999}},a.a.createElement(m.a,{className:"loadingSpinCT",style:{top:0,bottom:0}},a.a.createElement(m.a,{className:"box-content-spin"}))),a.a.createElement(y.a,{indexName:k,searchClient:V,searchState:x,onSearchStateChange:function(e){e.page&&void 0!==e.query&&u(I(e))}},a.a.createElement("div",{className:"layout-main-".concat(P)},a.a.createElement("div",{className:S?F?"box-header-".concat(P,"-main"):"":"box-header-".concat(P,"-main"),style:Object(h.a)({},"newVersion"===P?{background:null===(o=v.theme)||void 0===o?void 0:o.headerColor}:{})},a.a.createElement(i,{onToggleFilterMobile:function(){R(!_)}})),a.a.createElement("div",{className:"box-body-".concat(P,"-wrap-main")},l),S&&a.a.createElement("div",{className:"footer-wrap-main"},a.a.createElement(c,null))),S&&a.a.createElement(m.a,{className:"box-fillter ".concat(_?"open":"close"," "),position:"absolute"},a.a.createElement(ur,{onToogleApplyFillter:function(){R(!_)}})),S&&O&&a.a.createElement(m.a,{className:"box-fillter open",position:"absolute",style:{top:"97px"}},a.a.createElement("div",{style:{width:S?"100%":"90%"},className:"wrap-filter-destop"},a.a.createElement("div",{className:"bg-white box-filter-destop isMobile"},a.a.createElement(mt,{handleClose:function(){return u(z(!O))}}))))))})),vr=(r(787),r(788),r(264)),gr=r.n(vr),yr=r(205),br=r(473),wr=r.n(br);function xr(){xr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var Er=Object(n.memo)((function(e){var t=Object(f.g)(),r=ie(),o=e.acceptTypes,i=e.onChangeLoading,c=e.isLoading,l=ce((function(e){return e})),u=l.settings,s=l.search.keyFilter,v=Object(n.useState)(!1),g=Object(p.a)(v,2),y=g[0],b=g[1],w=Object(vt.b)().t,x=function(){var e=Object(d.a)(xr().mark((function e(n){var a,o,c,l,f,d;return xr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.push("/result"),r(P(!0)),r(_()),i(!0),o=[],b(!0),r(F(URL.createObjectURL(n))),e.next=9,Ne(n);case 9:if(c=e.sent,r(S(c)),l=[{key:u.visualSearchFilterKey,values:["".concat(s)]}],!u.regions){e.next=19;break}return e.next=15,_e(c,u);case 15:d=e.sent,r(N(d.regions)),f=d.selectedRegion,r(M(f));case 19:return e.abrupt("return",Ie({image:c,settings:u,region:f,filters:s?l:void 0}).then((function(e){return null===e||void 0===e||e.results.map((function(e){o.push({sku:e.sku,score:e.score})})),a=Object(h.a)(Object(h.a)({},e),{},{filters:o}),r(L(a)),b(!1),i(!1),r(P(!1)),r(ee())})));case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=Object(Ee.a)({onDrop:function(){var e=Object(d.a)(xr().mark((function e(t){var r;return xr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"image/heic"===(r=t[0]).type?yt()({blob:r,toType:"image/png",quality:1}).then((function(e){x(e)})).catch((function(e){console.error("Error converting HEIC to PNG:",e)})):x(t[0]);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}),O=E.getRootProps,C=E.getInputProps,j=E.isDragActive;return a.a.createElement(m.a,{className:j||y?"box-content-main-drop":"box-content-main"},c&&a.a.createElement(m.a,{className:"loadingSpinCT"},a.a.createElement(m.a,{className:"box-content-spin"})),a.a.createElement("div",Object.assign({className:"box-border",style:{position:"relative"}},O({onClick:function(e){e.stopPropagation()}})),j?a.a.createElement(m.a,null,a.a.createElement(Be.a,{className:"text-drop-file"},"DRAG ",a.a.createElement("span",{className:"tractor"},"&")," DROP"),a.a.createElement("input",Object.assign({},C({onClick:function(e){e.stopPropagation()}}),{type:"file",name:"file",id:"select_file",placeholder:"Choose photo",accept:o,onChange:Object(yr.makeFileHandler)((function(e){}))}))):a.a.createElement(a.a.Fragment,null,a.a.createElement(m.a,Object.assign({className:"box-content-drop"},O({onClick:function(e){e.stopPropagation()}})),a.a.createElement(m.a,{style:{marginBottom:16}},a.a.createElement("img",{src:wr.a,alt:"",width:48,height:48})),a.a.createElement("label",{htmlFor:"select_file",className:"",style:{color:"#2B2C46",fontSize:14}},a.a.createElement("span",{className:"fw-700",style:{paddingRight:"4px"}},w("Choose an image")),w("or drag it here")),a.a.createElement("input",Object.assign({},C(),{type:"file",name:"file",id:"select_file",className:"inputFile",placeholder:"Choose photo",style:{display:"block"}}))))))})),Or=r(886);var Cr=function(){var e=ce((function(e){return e})).settings,t=Object(n.useState)(!1),r=Object(p.a)(t,2),o=r[0],i=r[1],c=e.algolia,l=c.apiKey,s=c.appId,f=c.indexName;g()(s,l).initIndex(f);var h=Object(b.useMediaQuery)({query:"(max-width: 776px)"}),d=["image/*"].concat(e.cadSearch?je.cadExtensions:[]).join(","),v=Object(Or.a)((function(e){e.hits;return a.a.createElement("div",null)}));return a.a.createElement(m.a,{className:"box-content-main ".concat(o?"loading":"")},h&&a.a.createElement(m.a,{className:"btn-open-support"},a.a.createElement(u.b,{to:"/support",style:{color:"#3E36DC"}},a.a.createElement("img",{src:gr.a,alt:"",width:16,height:16}))),a.a.createElement(m.a,{className:"box-content_top"},a.a.createElement(m.a,{className:"fw-700 text-f32 text-dark2"},a.a.createElement("h1",null,e.headerText)),a.a.createElement("div",{className:"box-input"},a.a.createElement("div",{className:"wrap-input-search"},a.a.createElement("div",{style:{display:"none"}},a.a.createElement(v,null)),a.a.createElement(xt,null)))),a.a.createElement(m.a,{className:"box-content_bottom"},a.a.createElement(Er,{acceptTypes:d,isLoading:o,onChangeLoading:function(e){i(e)}})))},jr=function(e){var t=e.images,r=e.onExampleImageClicked,n=Object(b.useMediaQuery)({query:"(max-width: 776px)"});return 0===t.length?null:a.a.createElement("section",{className:"useExampleImg"},!n&&a.a.createElement(Be.a,{className:"title-box text-center"},"You can also try one of these pictures:"),a.a.createElement("div",{className:"exampleImages d-flex justify-center"},a.a.createElement("div",{className:"exImagesWrap"},t.map((function(e){return a.a.createElement("img",{key:e,src:e,alt:"",onClick:function(){return r(e)}})})))))},Lr=r(265),kr=r(266),Sr=r(149),Nr=r.n(Sr),Mr=function(){function e(){Object(Lr.a)(this,e)}return Object(kr.a)(e,null,[{key:"success",value:function(e){Nr.a.success(e,{duration:3e3,style:{background:"#1E1F31",color:"#fff"}})}}]),e}();function _r(){_r=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var Ir=function(){var e=Object(d.a)(_r().mark((function e(t,r){var n,a,o,i,c;return _r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.search,a=t.settings,o=n.sessionId,i=n.requestId||n.sessionId,e.prev=3,e.next=6,Tr(a,o,i,{event:"feedback",data:{success:r}});case 6:return c=e.sent,Mr.success("Thank you for your feedback."),e.abrupt("return",c);case 11:e.prev=11,e.t0=e.catch(3),console.log(e.t0);case 14:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t,r){return e.apply(this,arguments)}}(),Rr=function(){var e=Object(d.a)(_r().mark((function e(t,r){var n,a;return _r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.search,a=t.settings,e.next=3,Tr(a,n.sessionId,n.requestId,{event:"click",data:{positions:[r]}});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Tr=function(){var e=Object(d.a)(_r().mark((function e(t,r,n,a){var o;return _r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=new Le.a(t),!r||!n){e.next=10;break}return e.prev=2,e.next=5,o.sendFeedback(r,n,a).then((function(e){}));case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),console.log("error sendFeedbackByApi321",e.t0);case 10:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(t,r,n,a){return e.apply(this,arguments)}}();function Hr(){Hr=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var Fr=function(){var e,t=Object(f.g)(),r=ie(),o=ce((function(e){return e})),i=o.settings,c=o.search.keyFilter,l=Object(n.useState)(!1),u=Object(p.a)(l,2),s=u[0],h=u[1];Object(n.useEffect)((function(){r(R(""))}),[r]);var v=function(){var e=Object(d.a)(Hr().mark((function e(n,a){var l,u,s,f,h;return Hr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"/"===(null===(l=t.location)||void 0===l?void 0:l.pathname)&&t.push("/result"),r(P(!0)),r($()),r(_()),r(F(n)),a&&Rr(o,a),e.next=8,Ne(n);case 8:if(u=e.sent,r(S(u)),s=void 0,!i.regions){e.next=18;break}return e.next=14,_e(u,i);case 14:f=e.sent,r(N(f.regions)),s=f.selectedRegion,r(M(s));case 18:h=[{key:i.visualSearchFilterKey,values:["".concat(c)]}],Ie({image:u,settings:i,region:s,filters:c?h:void 0}).then((function(e){r(L(e)),r(P(!1)),r(ee())})).catch((function(e){console.log("err getUrlToCanvasFile mobile",e)}));case 20:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();return a.a.createElement(a.a.Fragment,null,a.a.createElement(m.a,{className:"wrap-content-body",style:{position:"relative"}},a.a.createElement("div",{style:{position:"absolute",top:"1px",height:"100%",width:"100%",zIndex:1,background:"".concat(null===(e=i.theme)||void 0===e?void 0:e.mobileFooterImageColor)}}),a.a.createElement(m.a,{style:{position:"inherit",zIndex:100},className:"title-top"},a.a.createElement(Be.a,{className:"text-center text-white"},"Snap a photo or attach any image in the ",a.a.createElement("br",null)," following formats:"),a.a.createElement(Be.a,{className:"text-center text-white"},"jpg, png, svg, pdf or tiff")),a.a.createElement(m.a,{style:{position:"inherit",zIndex:100},className:"box-drag-mobile"},a.a.createElement(jr,{images:i.exampleImages,onExampleImageClicked:function(e){return v(e)},onToggleModalCamera:function(){h(!s)}})),a.a.createElement(m.a,{className:"box-screenshot-camera"},a.a.createElement(He,{isToggle:s,onToggleModal:function(){h(!s)}}))))},Pr=r(328);Pr.a.use(vt.a).init({resources:{en:{translation:{Search:"Search","Choose an image":"Choose an image","or drag it here":"or drag it here","Manufacturer Number":"Manufacturer Number","Close group":"Close group","Show group":"Show group","Adjust the search frame around your object for improved results":"Adjust the search frame around your object for improved results","Items per page":"Items per page","Search with an image":"Search with an image","Clear text search":"Clear text search"}},de:{translation:{Search:"Suche","Choose an image":"Bild w\xe4hlen","or drag it here":"oder hierhin ziehen","Manufacturer Number":"Herst. Teile-Nr.","Close group":"Schlie\xdfe Gruppe","Show group":"Zeige Gruppe","Adjust the search frame around your object for improved results":"Anpassen des Rahmens f\xfcr bessere Ergebnisse","Items per page":"Artikel pro Seite","Search with an image":"Bildsuche","Clear text search":"Suchtext l\xf6schen"}}},fallbackLng:"en",interpolation:{escapeValue:!1},returnNull:!1});var Vr=function(){var e=ce((function(e){return e.settings.language}));Pr.a.changeLanguage(e);var t=Object(b.useMediaQuery)({query:"(max-width: 776px)"})?Fr:Cr;return a.a.createElement(t,null)},Zr=r(478),Gr=r.n(Zr),Ar=r(479),zr=r.n(Ar),Br=r(480),Dr=r.n(Br),Ur=r(477),qr=r.n(Ur),Wr=r(887);var Yr=r(137),Kr=r.n(Yr),Qr=["children","className","selected","closeIcon"];function Jr(e){var t=e.children,r=e.className,n=(e.selected,e.closeIcon),o=void 0!==n&&n,i=Object(s.a)(e,Qr);return a.a.createElement(le.a,Object.assign({type:"native",className:r},i),t,o&&a.a.createElement(Kr.a,{style:{fontSize:"16px",fontWeight:"bold"}}))}Object(zt.atom)(0);var Xr=Object(Rt.a)((function(e){var t=e.items,r=e.refine,o=e.className,i=e.statusSwitchButton,c=ce((function(e){return e})).settings,l=Object(n.useState)([]),u=Object(p.a)(l,2),s=u[0],f=u[1];Object(n.useEffect)((function(){i&&f(t)}),[t,i]);var h=Object(n.useMemo)((function(){return s.reduce((function(e,t){return[].concat(Object(Mt.a)(e),Object(Mt.a)(function(e,t){var r,n;switch(t.forEach((function(t){(function(e,t){var r=e.attribute;return(null===r||void 0===r?void 0:r.attributes)?(null===r||void 0===r?void 0:r.attributes[0])===t.attribute:r===t.attribute})(t,e)&&(n=t)})),null===(r=n)||void 0===r?void 0:r.type){case"size":case"list":var a;return(null===e||void 0===e||null===(a=e.items)||void 0===a?void 0:a.map((function(e){var t;return{category:null===(t=n)||void 0===t?void 0:t.header,label:e.label,value:e.value}})))||[];default:return[]}}(t,null===c||void 0===c?void 0:c.refinements)))}),[])}),[c,s]);return h.length?a.a.createElement("div",{className:o,style:{marginBottom:h.length>0?"10px":"0px",marginTop:h.length>0?"16px":"0px"}},a.a.createElement("ul",{className:"flex flex-wrap gap-3"},h.map((function(e){return a.a.createElement(Wr.a.li,{key:[e.category,e.label].join(":")},a.a.createElement(Jr,{closeIcon:!0,onClick:function(){return r(e.value)}},e.category&&a.a.createElement("div",{className:"text-f12"},e.category,":"),a.a.createElement("div",{className:"capitalize fw-700",style:{marginLeft:5,textTransform:"capitalize",marginRight:10}},e.label)))})),a.a.createElement("li",{key:"clear",className:Ut()("flex items-center",{hidden:h.length<2})},a.a.createElement(Tt,{className:"text-f12 fw-600"},"Clear all")))):null})),$r=r(888),en=r(889);var tn,rn=Object(en.a)((function(e){var t=e.children;return a.a.createElement($r.a,{container:!0,justifyContent:"space-between",alignItems:"center",style:{height:"100%"}},t,a.a.createElement($r.a,{item:!0,className:"item-notify-right",style:{minWidth:32}}))})),nn=r(327),an=r.n(nn),on=r(267),cn=r.n(on),ln=["svgRef","title"];function un(){return(un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function sn(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var fn,hn,dn,pn=function(e){var t=e.svgRef,r=e.title,n=sn(e,ln);return a.a.createElement("svg",un({width:10,height:11,viewBox:"0 0 10 11",fill:"currentColor",ref:t},n),r?a.a.createElement("title",null,r):null,tn||(tn=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.56905 7.91401C6.92789 7.46225 7.47234 7.19773 8.04926 7.19483C9.10003 7.19483 9.95185 8.04665 9.95185 9.09742C9.95185 10.1482 9.10003 11 8.04926 11C6.99849 11 6.14667 10.1482 6.14667 9.09742C6.14847 8.92726 6.17408 8.75819 6.22277 8.59513L3.44118 6.85616C2.93785 7.48979 2.0888 7.73571 1.32474 7.46917C0.560687 7.20264 0.0488281 6.48196 0.0488281 5.67275C0.0488281 4.86354 0.560687 4.14287 1.32474 3.87633C2.0888 3.60979 2.93785 3.85571 3.44118 4.48934L6.22277 2.75037C6.17408 2.58732 6.14847 2.41825 6.14667 2.24809C6.14083 1.32028 6.80508 0.523574 7.7188 0.36244C8.63252 0.201306 9.52922 0.722744 9.84111 1.59657C10.153 2.4704 9.78909 3.44177 8.97983 3.89559C8.17057 4.34941 7.15198 4.15332 6.56905 3.4315L3.78746 5.17047C3.88883 5.49765 3.88883 5.84785 3.78746 6.17504L6.56905 7.91401ZM9.19066 2.24808C9.19066 1.61762 8.67957 1.10653 8.04911 1.10653C7.41864 1.10653 6.90755 1.61762 6.90755 2.24808C6.90755 2.87855 7.41864 3.38964 8.04911 3.38964C8.67957 3.38964 9.19066 2.87855 9.19066 2.24808ZM1.96089 6.81431C1.33043 6.81431 0.819336 6.30322 0.819336 5.67275C0.819336 5.04229 1.33043 4.5312 1.96089 4.5312C2.59136 4.5312 3.10245 5.04229 3.10245 5.67275C3.10245 6.30322 2.59136 6.81431 1.96089 6.81431ZM6.90755 9.09742C6.90755 9.72788 7.41864 10.239 8.04911 10.239C8.67957 10.239 9.19066 9.72788 9.19066 9.09742C9.19066 8.46695 8.67957 7.95586 8.04911 7.95586C7.41864 7.95586 6.90755 8.46695 6.90755 9.09742Z",fill:"currentColor"})))},mn=a.a.forwardRef((function(e,t){return a.a.createElement(pn,un({svgRef:t},e))})),vn=(r.p,["svgRef","title"]);function gn(){return(gn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function yn(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var bn,wn=function(e){var t=e.svgRef,r=e.title,n=yn(e,vn);return a.a.createElement("svg",gn({width:33,height:32,viewBox:"0 0 33 32",fill:"none",ref:t},n),r?a.a.createElement("title",null,r):null,fn||(fn=a.a.createElement("ellipse",{cx:16.1684,cy:16,rx:16.1684,ry:16,fill:"#F3F3F5"})),hn||(hn=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.0497 9.14286C18.7341 9.14286 18.4783 8.88702 18.4783 8.57143C18.4783 8.25584 18.7341 8 19.0497 8H23.6527C23.9841 8 24.2527 8.26863 24.2527 8.6V13.1368C24.2527 13.4558 23.9942 13.7143 23.6753 13.7143C23.3564 13.7143 23.0979 13.4558 23.0979 13.1368V11.3887C23.0979 10.8557 22.4547 10.5873 22.0758 10.9622L18.545 14.4563C18.3207 14.6783 17.9594 14.678 17.7354 14.4557C17.5085 14.2305 17.5088 13.8635 17.7361 13.6387L21.2435 10.1694C21.6246 9.79241 21.3577 9.14286 20.8215 9.14286H19.0497ZM13.7959 17.5429C14.0199 17.3215 14.3806 17.322 14.6038 17.5442C14.8296 17.7689 14.8291 18.1345 14.6026 18.3585L11.0932 21.8306C10.7121 22.2076 10.9791 22.8571 11.5152 22.8571H13.2872C13.6028 22.8571 13.8587 23.113 13.8587 23.4286C13.8587 23.7441 13.6028 24 13.2872 24H8.68423C8.35286 24 8.08423 23.7313 8.08423 23.4V18.8631C8.08423 18.5442 8.34276 18.2857 8.66167 18.2857C8.98059 18.2857 9.23912 18.5442 9.23912 18.8631V20.612C9.23912 21.1449 9.88207 21.4133 10.261 21.0386L13.7959 17.5429Z",fill:"currentColor"})),dn||(dn=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.23911 13.1368C9.23911 13.4557 8.98058 13.7142 8.66167 13.7142C8.34276 13.7142 8.08423 13.4557 8.08423 13.1368L8.08423 8.59991C8.08423 8.26854 8.35286 7.99991 8.68423 7.99991L13.2872 7.99991C13.6028 7.99991 13.8587 8.25575 13.8587 8.57134C13.8587 8.88693 13.6028 9.14277 13.2872 9.14277L11.5149 9.14277C10.9789 9.14277 10.7119 9.79219 11.0929 10.1693L14.5999 13.6397C14.8276 13.865 14.8273 14.2329 14.5993 14.4578C14.3751 14.6791 14.0146 14.6788 13.7908 14.4571L10.2613 10.9627C9.88241 10.5877 9.23911 10.856 9.23911 11.3891L9.23911 13.1368ZM17.7362 18.3563C17.509 18.1313 17.5096 17.7641 17.7375 17.5399C17.9612 17.3198 18.3202 17.3203 18.5433 17.5411L22.0757 21.0375C22.4545 21.4125 23.0977 21.1441 23.0977 20.611L23.0977 18.8632C23.0977 18.5442 23.3563 18.2857 23.6752 18.2857C23.9941 18.2857 24.2526 18.5442 24.2526 18.8632L24.2526 23.4C24.2526 23.7314 23.984 24 23.6526 24L19.0496 24C18.734 24 18.4782 23.7442 18.4782 23.4286C18.4782 23.113 18.734 22.8571 19.0496 22.8571L20.8226 22.8571C21.3586 22.8571 21.6257 22.2079 21.2448 21.8308L17.7362 18.3563Z",fill:"currentColor"})))},xn=a.a.forwardRef((function(e,t){return a.a.createElement(wn,gn({svgRef:t},e))})),En=(r.p,["svgRef","title"]);function On(){return(On=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Cn(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var jn,Ln=function(e){var t=e.svgRef,r=e.title,n=Cn(e,En);return a.a.createElement("svg",On({width:11,height:11,viewBox:"0 0 11 11",fill:"currentColor",ref:t},n),r?a.a.createElement("title",null,r):null,bn||(bn=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.53059 7.14308H3.81466V9.11675C3.7348 9.90592 4.28699 10.6128 5.04806 10.6957C5.14416 10.7075 5.24128 10.7075 5.33738 10.6957H5.93504C6.19675 10.6882 6.42056 10.4984 6.47941 10.2338V10.1865L6.86009 7.68387L8.20769 5.56415H10.6669V0.0378923H3.43399C0.601741 0.0378923 0.00788307 1.75498 0.00788307 3.19576V5.56415C-0.0719852 6.35332 0.480213 7.06022 1.24128 7.14308C1.33738 7.15493 1.43449 7.15493 1.53059 7.14308ZM8.38276 0.827361H9.90548V4.77469H8.38276V0.827361ZM3.43384 0.827355C1.6142 0.827355 0.769092 1.5813 0.769092 3.19575V5.56415C0.769092 6.13256 0.982271 6.35361 1.53045 6.35361H4.57587V9.11674C4.57587 9.68516 4.78905 9.90621 5.33723 9.90621H5.76739L5.82069 9.51148L6.09858 7.39176L7.6213 5.051V0.827355H3.43384Z",fill:"currentColor"})))},kn=a.a.forwardRef((function(e,t){return a.a.createElement(Ln,On({svgRef:t},e))})),Sn=(r.p,["svgRef","title"]);function Nn(){return(Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Mn(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var _n,In,Rn=function(e){var t=e.svgRef,r=e.title,n=Mn(e,Sn);return a.a.createElement("svg",Nn({width:12,height:11,viewBox:"0 0 12 11",fill:"currentColor",ref:t},n),r?a.a.createElement("title",null,r):null,jn||(jn=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.80278 3.59938H7.51871V1.62572C7.59858 0.836545 7.04638 0.129649 6.28531 0.0467847C6.18921 0.0349422 6.0921 0.0349422 5.996 0.0467847H5.39833C5.13662 0.0542197 4.91282 0.244093 4.85396 0.508622V0.55599L4.47329 3.0586L3.12568 5.17831H0.666504V10.7046H7.89939C10.7316 10.7046 11.3255 8.98748 11.3255 7.54671V5.17831C11.4054 4.38914 10.8532 3.68224 10.0921 3.59938C9.99599 3.58754 9.89888 3.58754 9.80278 3.59938ZM2.95061 9.9151H1.4279V5.96777H2.95061V9.9151ZM7.89954 9.9151C9.71918 9.9151 10.5643 9.16116 10.5643 7.5467V5.1783C10.5643 4.60989 10.3511 4.38884 9.80293 4.38884H6.7575V1.62571C6.7575 1.05729 6.54432 0.836243 5.99615 0.836243H5.56598L5.51268 1.23098L5.23479 3.35069L3.71208 5.69146V9.9151H7.89954Z",fill:"currentColor"})))},Tn=a.a.forwardRef((function(e,t){return a.a.createElement(Rn,Nn({svgRef:t},e))})),Hn=(r.p,r(268)),Fn=r.n(Hn),Pn=r(890),Vn=r(475),Zn=r.n(Vn),Gn=r(273),An=(r(850),r(851),r(852),function(e){var t=e.imgItem,r=e.onSearchImage,o=e.handlerCloseModal,i=Object(b.useMediaQuery)({query:"(max-width: 776px)"}),c=Object(n.useRef)(null),l=Object(n.useRef)(null),u=Object(n.useMemo)((function(){var e=75+58*t.length,r=i?340:400;return e<r?e:r}),[t.length,i]),s=Object(n.useMemo)((function(){return{type:"loop",perPage:1,perMove:1,gap:"1rem",pagination:!1,arrows:!1,width:i?340:370}}),[i]),f=Object(n.useMemo)((function(){return{type:"slide",rewind:!0,gap:"1rem",pagination:!1,fixedWidth:40,fixedHeight:40,cover:!0,focus:"center",isNavigation:!0,arrows:t.length>1,width:u}}),[t.length,u]),h=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t.map((function(t){return a.a.createElement(Gn.b,{key:t.url,className:e?"":"img-container"},a.a.createElement("img",{style:{objectFit:"contain",minHeight:"400px"},alt:"preview",src:t.url,onClick:function(){e||(o(),r(t.url))}}))}))};return a.a.useEffect((function(){var e;c.current&&l.current&&(null===(e=l.current)||void 0===e?void 0:e.splide)&&c.current.sync(l.current.splide)}),[]),a.a.createElement(a.a.Fragment,null,a.a.createElement(Gn.a,{options:s,ref:c},h()),a.a.createElement("div",{className:"thumbs-list ".concat(t.length<=1?"d-none":"")},a.a.createElement(Gn.a,{options:f,ref:l},h(!0))))}),zn=["svgRef","title"];function Bn(){return(Bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Dn(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var Un=function(e){var t=e.svgRef,r=e.title,n=Dn(e,zn);return a.a.createElement("svg",Bn({width:40,height:40,viewBox:"0 0 40 40",fill:"none",ref:t},n),r?a.a.createElement("title",null,r):null,_n||(_n=a.a.createElement("g",{filter:"url(#filter0_d_573_4241)"},a.a.createElement("circle",{cx:20,cy:20,r:16,fill:"url(#paint0_linear_573_4241)"}),a.a.createElement("mask",{id:"path-2-outside-1_573_4241",maskUnits:"userSpaceOnUse",x:11,y:11,width:18,height:18,fill:"black"},a.a.createElement("rect",{fill:"white",x:11,y:11,width:18,height:18}),a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5013 12C12.2249 12 12 12.2249 12 12.5013V16.0246C12 16.301 12.2249 16.5259 12.5013 16.5259H12.5528C12.8292 16.5259 13.0541 16.301 13.0541 16.0246V13.2203C13.0541 13.1003 13.1518 13.0026 13.2718 13.0026H16.0967C16.3731 13.0026 16.598 12.7777 16.598 12.5013C16.598 12.2249 16.3731 12 16.0967 12H12.5013ZM28 16.0246C28 16.301 27.7751 16.5259 27.4987 16.5259H27.4472C27.1708 16.5259 26.9459 16.301 26.9459 16.0246V13.2203C26.9459 13.1003 26.8482 13.0026 26.7282 13.0026H23.9033C23.6269 13.0026 23.402 12.7777 23.402 12.5013C23.402 12.2249 23.6269 12 23.9033 12H27.4987C27.7751 12 28 12.2249 28 12.5013V16.0246ZM28 27.4987C28 27.7751 27.7751 28 27.4987 28H23.9033C23.6269 28 23.402 27.7751 23.402 27.4987C23.402 27.2223 23.6269 26.9974 23.9033 26.9974H26.7282C26.8482 26.9974 26.9459 26.8997 26.9459 26.7797V23.9757C26.9459 23.6993 27.1708 23.4744 27.4472 23.4744H27.4987C27.7751 23.4744 28 23.6993 28 23.9757V27.4987ZM16.0967 28H12.5013C12.2249 28 12 27.7751 12 27.4987V23.9757C12 23.6993 12.2249 23.4744 12.5013 23.4744H12.5528C12.8292 23.4744 13.0541 23.6993 13.0541 23.9757V26.7797C13.0541 26.8997 13.1518 26.9974 13.2718 26.9974H16.0967C16.3731 26.9974 16.598 27.2223 16.598 27.4987C16.598 27.7751 16.3731 28 16.0967 28ZM23.2482 22.3423L24.5784 23.6725C24.8282 23.9223 24.8282 24.3285 24.5784 24.5784C24.4574 24.6993 24.2961 24.7662 24.1253 24.7662C23.9544 24.7662 23.7935 24.6993 23.6725 24.5784L22.342 23.2482L22.2079 23.3374C21.5564 23.7711 20.7931 24.0007 20 24.0007C18.9315 24.0007 17.9272 23.5843 17.1715 22.8289C16.4161 22.0734 15.9997 21.0692 15.9997 20.0003C15.9997 18.9315 16.4161 17.9272 17.1715 17.1715C17.9272 16.4161 18.9315 16 20 16C21.0685 16 22.0731 16.4161 22.8289 17.1715C23.5843 17.9272 24.0003 18.9315 24.0003 20.0003C24.0003 20.7931 23.7712 21.5564 23.3374 22.2079L23.2482 22.3423ZM21.9639 21.879L21.9708 21.8715C22.4535 21.3636 22.719 20.699 22.719 20.0003C22.719 18.501 21.499 17.2813 20 17.2813C18.501 17.2813 17.281 18.5013 17.281 20.0003C17.281 21.4993 18.501 22.7193 20 22.7193C20.699 22.7193 21.3636 22.4534 21.8715 21.9708L21.8787 21.9639L21.8853 21.9561C21.8964 21.9433 21.9079 21.9308 21.9194 21.9193C21.9312 21.9075 21.9433 21.8964 21.9561 21.8856L21.9639 21.879Z"})),a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5013 12C12.2249 12 12 12.2249 12 12.5013V16.0246C12 16.301 12.2249 16.5259 12.5013 16.5259H12.5528C12.8292 16.5259 13.0541 16.301 13.0541 16.0246V13.2203C13.0541 13.1003 13.1518 13.0026 13.2718 13.0026H16.0967C16.3731 13.0026 16.598 12.7777 16.598 12.5013C16.598 12.2249 16.3731 12 16.0967 12H12.5013ZM28 16.0246C28 16.301 27.7751 16.5259 27.4987 16.5259H27.4472C27.1708 16.5259 26.9459 16.301 26.9459 16.0246V13.2203C26.9459 13.1003 26.8482 13.0026 26.7282 13.0026H23.9033C23.6269 13.0026 23.402 12.7777 23.402 12.5013C23.402 12.2249 23.6269 12 23.9033 12H27.4987C27.7751 12 28 12.2249 28 12.5013V16.0246ZM28 27.4987C28 27.7751 27.7751 28 27.4987 28H23.9033C23.6269 28 23.402 27.7751 23.402 27.4987C23.402 27.2223 23.6269 26.9974 23.9033 26.9974H26.7282C26.8482 26.9974 26.9459 26.8997 26.9459 26.7797V23.9757C26.9459 23.6993 27.1708 23.4744 27.4472 23.4744H27.4987C27.7751 23.4744 28 23.6993 28 23.9757V27.4987ZM16.0967 28H12.5013C12.2249 28 12 27.7751 12 27.4987V23.9757C12 23.6993 12.2249 23.4744 12.5013 23.4744H12.5528C12.8292 23.4744 13.0541 23.6993 13.0541 23.9757V26.7797C13.0541 26.8997 13.1518 26.9974 13.2718 26.9974H16.0967C16.3731 26.9974 16.598 27.2223 16.598 27.4987C16.598 27.7751 16.3731 28 16.0967 28ZM23.2482 22.3423L24.5784 23.6725C24.8282 23.9223 24.8282 24.3285 24.5784 24.5784C24.4574 24.6993 24.2961 24.7662 24.1253 24.7662C23.9544 24.7662 23.7935 24.6993 23.6725 24.5784L22.342 23.2482L22.2079 23.3374C21.5564 23.7711 20.7931 24.0007 20 24.0007C18.9315 24.0007 17.9272 23.5843 17.1715 22.8289C16.4161 22.0734 15.9997 21.0692 15.9997 20.0003C15.9997 18.9315 16.4161 17.9272 17.1715 17.1715C17.9272 16.4161 18.9315 16 20 16C21.0685 16 22.0731 16.4161 22.8289 17.1715C23.5843 17.9272 24.0003 18.9315 24.0003 20.0003C24.0003 20.7931 23.7712 21.5564 23.3374 22.2079L23.2482 22.3423ZM21.9639 21.879L21.9708 21.8715C22.4535 21.3636 22.719 20.699 22.719 20.0003C22.719 18.501 21.499 17.2813 20 17.2813C18.501 17.2813 17.281 18.5013 17.281 20.0003C17.281 21.4993 18.501 22.7193 20 22.7193C20.699 22.7193 21.3636 22.4534 21.8715 21.9708L21.8787 21.9639L21.8853 21.9561C21.8964 21.9433 21.9079 21.9308 21.9194 21.9193C21.9312 21.9075 21.9433 21.8964 21.9561 21.8856L21.9639 21.879Z",fill:"currentColor"}),a.a.createElement("path",{d:"M24.5784 23.6725L24.7198 23.531L24.5784 23.6725ZM23.2482 22.3423L23.0815 22.2317L22.9911 22.368L23.1068 22.4837L23.2482 22.3423ZM23.6725 24.5784L23.8139 24.4369L23.8139 24.4369L23.6725 24.5784ZM22.342 23.2482L22.4834 23.1068L22.3676 22.991L22.2312 23.0817L22.342 23.2482ZM22.2079 23.3374L22.0971 23.1708L22.097 23.1709L22.2079 23.3374ZM17.1715 22.8289L17.0301 22.9703L17.0301 22.9703L17.1715 22.8289ZM17.1715 17.1715L17.0301 17.03L17.03 17.0301L17.1715 17.1715ZM22.8289 17.1715L22.9703 17.0301L22.9703 17.03L22.8289 17.1715ZM23.3374 22.2079L23.1709 22.097L23.1707 22.0973L23.3374 22.2079ZM21.9708 21.8715L21.8258 21.7337L21.8231 21.7366L21.9708 21.8715ZM21.9639 21.879L22.092 22.0327L22.1025 22.0239L22.1117 22.0139L21.9639 21.879ZM21.8715 21.9708L22.0093 22.1158L22.0096 22.1155L21.8715 21.9708ZM21.8787 21.9639L22.0168 22.1086L22.025 22.1007L22.0323 22.092L21.8787 21.9639ZM21.8853 21.9561L21.7345 21.8246L21.7316 21.828L21.8853 21.9561ZM21.9194 21.9193L21.7779 21.7779L21.7779 21.7779L21.9194 21.9193ZM21.9561 21.8856L21.828 21.7319L21.8269 21.7329L21.9561 21.8856ZM12.2 12.5013C12.2 12.3354 12.3354 12.2 12.5013 12.2V11.8C12.1145 11.8 11.8 12.1145 11.8 12.5013H12.2ZM12.2 16.0246V12.5013H11.8V16.0246H12.2ZM12.5013 16.3259C12.3354 16.3259 12.2 16.1905 12.2 16.0246H11.8C11.8 16.4114 12.1145 16.7259 12.5013 16.7259V16.3259ZM12.5528 16.3259H12.5013V16.7259H12.5528V16.3259ZM12.8541 16.0246C12.8541 16.1905 12.7187 16.3259 12.5528 16.3259V16.7259C12.9396 16.7259 13.2541 16.4114 13.2541 16.0246H12.8541ZM12.8541 13.2203V16.0246H13.2541V13.2203H12.8541ZM13.2718 12.8026C13.0413 12.8026 12.8541 12.9899 12.8541 13.2203H13.2541C13.2541 13.2108 13.2623 13.2026 13.2718 13.2026V12.8026ZM16.0967 12.8026H13.2718V13.2026H16.0967V12.8026ZM16.398 12.5013C16.398 12.6672 16.2627 12.8026 16.0967 12.8026V13.2026C16.4836 13.2026 16.798 12.8882 16.798 12.5013H16.398ZM16.0967 12.2C16.2627 12.2 16.398 12.3354 16.398 12.5013H16.798C16.798 12.1145 16.4836 11.8 16.0967 11.8V12.2ZM12.5013 12.2H16.0967V11.8H12.5013V12.2ZM27.4987 16.7259C27.8855 16.7259 28.2 16.4114 28.2 16.0246H27.8C27.8 16.1905 27.6646 16.3259 27.4987 16.3259V16.7259ZM27.4472 16.7259H27.4987V16.3259H27.4472V16.7259ZM26.7459 16.0246C26.7459 16.4114 27.0604 16.7259 27.4472 16.7259V16.3259C27.2813 16.3259 27.1459 16.1905 27.1459 16.0246H26.7459ZM26.7459 13.2203V16.0246H27.1459V13.2203H26.7459ZM26.7282 13.2026C26.7377 13.2026 26.7459 13.2108 26.7459 13.2203H27.1459C27.1459 12.9899 26.9586 12.8026 26.7282 12.8026V13.2026ZM23.9033 13.2026H26.7282V12.8026H23.9033V13.2026ZM23.202 12.5013C23.202 12.8882 23.5164 13.2026 23.9033 13.2026V12.8026C23.7373 12.8026 23.602 12.6672 23.602 12.5013H23.202ZM23.9033 11.8C23.5164 11.8 23.202 12.1145 23.202 12.5013H23.602C23.602 12.3354 23.7373 12.2 23.9033 12.2V11.8ZM27.4987 11.8H23.9033V12.2H27.4987V11.8ZM28.2 12.5013C28.2 12.1145 27.8855 11.8 27.4987 11.8V12.2C27.6646 12.2 27.8 12.3354 27.8 12.5013H28.2ZM28.2 16.0246V12.5013H27.8V16.0246H28.2ZM27.4987 28.2C27.8855 28.2 28.2 27.8855 28.2 27.4987H27.8C27.8 27.6646 27.6646 27.8 27.4987 27.8V28.2ZM23.9033 28.2H27.4987V27.8H23.9033V28.2ZM23.202 27.4987C23.202 27.8855 23.5164 28.2 23.9033 28.2V27.8C23.7373 27.8 23.602 27.6646 23.602 27.4987H23.202ZM23.9033 26.7974C23.5164 26.7974 23.202 27.1118 23.202 27.4987H23.602C23.602 27.3328 23.7373 27.1974 23.9033 27.1974V26.7974ZM26.7282 26.7974H23.9033V27.1974H26.7282V26.7974ZM26.7459 26.7797C26.7459 26.7892 26.7377 26.7974 26.7282 26.7974V27.1974C26.9586 27.1974 27.1459 27.0101 27.1459 26.7797H26.7459ZM26.7459 23.9757V26.7797H27.1459V23.9757H26.7459ZM27.4472 23.2744C27.0604 23.2744 26.7459 23.5889 26.7459 23.9757H27.1459C27.1459 23.8098 27.2813 23.6744 27.4472 23.6744V23.2744ZM27.4987 23.2744H27.4472V23.6744H27.4987V23.2744ZM28.2 23.9757C28.2 23.5889 27.8855 23.2744 27.4987 23.2744V23.6744C27.6646 23.6744 27.8 23.8098 27.8 23.9757H28.2ZM28.2 27.4987V23.9757H27.8V27.4987H28.2ZM12.5013 28.2H16.0967V27.8H12.5013V28.2ZM11.8 27.4987C11.8 27.8855 12.1145 28.2 12.5013 28.2V27.8C12.3354 27.8 12.2 27.6646 12.2 27.4987H11.8ZM11.8 23.9757V27.4987H12.2V23.9757H11.8ZM12.5013 23.2744C12.1145 23.2744 11.8 23.5889 11.8 23.9757H12.2C12.2 23.8098 12.3354 23.6744 12.5013 23.6744V23.2744ZM12.5528 23.2744H12.5013V23.6744H12.5528V23.2744ZM13.2541 23.9757C13.2541 23.5889 12.9396 23.2744 12.5528 23.2744V23.6744C12.7187 23.6744 12.8541 23.8098 12.8541 23.9757H13.2541ZM13.2541 26.7797V23.9757H12.8541V26.7797H13.2541ZM13.2718 26.7974C13.2623 26.7974 13.2541 26.7892 13.2541 26.7797H12.8541C12.8541 27.0101 13.0413 27.1974 13.2718 27.1974V26.7974ZM16.0967 26.7974H13.2718V27.1974H16.0967V26.7974ZM16.798 27.4987C16.798 27.1118 16.4836 26.7974 16.0967 26.7974V27.1974C16.2627 27.1974 16.398 27.3328 16.398 27.4987H16.798ZM16.0967 28.2C16.4836 28.2 16.798 27.8855 16.798 27.4987H16.398C16.398 27.6646 16.2627 27.8 16.0967 27.8V28.2ZM24.7198 23.531L23.3896 22.2009L23.1068 22.4837L24.4369 23.8139L24.7198 23.531ZM24.7198 24.7198C25.0477 24.3918 25.0477 23.859 24.7198 23.531L24.4369 23.8139C24.6087 23.9856 24.6087 24.2652 24.4369 24.4369L24.7198 24.7198ZM24.1253 24.9662C24.3492 24.9662 24.5614 24.8782 24.7198 24.7198L24.4369 24.4369C24.3534 24.5205 24.2429 24.5662 24.1253 24.5662V24.9662ZM23.531 24.7198C23.6894 24.8781 23.9012 24.9662 24.1253 24.9662V24.5662C24.0077 24.5662 23.8975 24.5206 23.8139 24.4369L23.531 24.7198ZM22.2006 23.3896L23.5311 24.7198L23.8139 24.4369L22.4834 23.1068L22.2006 23.3896ZM22.3186 23.5039L22.4527 23.4147L22.2312 23.0817L22.0971 23.1708L22.3186 23.5039ZM20 24.2007C20.8321 24.2007 21.634 23.9598 22.3187 23.5039L22.097 23.1709C21.4788 23.5825 20.7542 23.8007 20 23.8007V24.2007ZM17.0301 22.9703C17.8233 23.7632 18.8784 24.2007 20 24.2007V23.8007C18.9846 23.8007 18.0312 23.4054 17.3129 22.6874L17.0301 22.9703ZM15.7997 20.0003C15.7997 21.1223 16.2372 22.1774 17.0301 22.9703L17.3129 22.6874C16.595 21.9695 16.1997 21.0161 16.1997 20.0003H15.7997ZM17.03 17.0301C16.2372 17.8233 15.7997 18.8784 15.7997 20.0003H16.1997C16.1997 18.9846 16.595 18.0311 17.3129 17.3129L17.03 17.0301ZM20 15.8C18.8784 15.8 17.8233 16.2371 17.0301 17.03L17.3129 17.3129C18.0311 16.595 18.9845 16.2 20 16.2V15.8ZM22.9703 17.03C22.177 16.2371 21.1216 15.8 20 15.8V16.2C21.0155 16.2 21.9692 16.595 22.6875 17.3129L22.9703 17.03ZM24.2003 20.0003C24.2003 18.8784 23.7632 17.8233 22.9703 17.0301L22.6874 17.3129C23.4053 18.0311 23.8003 18.9845 23.8003 20.0003H24.2003ZM23.5039 22.3187C23.9598 21.6339 24.2003 20.832 24.2003 20.0003H23.8003C23.8003 20.7542 23.5825 21.4788 23.1709 22.097L23.5039 22.3187ZM23.4149 22.4529L23.504 22.3184L23.1707 22.0973L23.0815 22.2317L23.4149 22.4529ZM21.8231 21.7366L21.8162 21.7442L22.1117 22.0139L22.1185 22.0063L21.8231 21.7366ZM22.519 20.0003C22.519 20.6476 22.2732 21.2629 21.8258 21.7337L22.1158 22.0092C22.6337 21.4643 22.919 20.7504 22.919 20.0003H22.519ZM20 17.4813C21.3886 17.4813 22.519 18.6115 22.519 20.0003H22.919C22.919 18.3905 21.6095 17.0813 20 17.0813V17.4813ZM17.481 20.0003C17.481 18.6118 18.6114 17.4813 20 17.4813V17.0813C18.3905 17.0813 17.081 18.3909 17.081 20.0003H17.481ZM20 22.5193C18.6114 22.5193 17.481 21.3889 17.481 20.0003H17.081C17.081 21.6098 18.3905 22.9193 20 22.9193V22.5193ZM21.7337 21.8258C21.2629 22.2732 20.6476 22.5193 20 22.5193V22.9193C20.7505 22.9193 21.4643 22.6336 22.0093 22.1158L21.7337 21.8258ZM21.7406 21.8193L21.7334 21.8261L22.0096 22.1155L22.0168 22.1086L21.7406 21.8193ZM21.7316 21.828L21.7251 21.8359L22.0323 22.092L22.0389 22.0841L21.7316 21.828ZM21.7779 21.7779C21.7625 21.7933 21.7479 21.8092 21.7345 21.8246L22.036 22.0875C22.0449 22.0773 22.0532 22.0683 22.0608 22.0608L21.7779 21.7779ZM21.8269 21.7329C21.8099 21.7472 21.7937 21.7621 21.7779 21.7779L22.0608 22.0608C22.0686 22.0529 22.0766 22.0456 22.0853 22.0383L21.8269 21.7329ZM21.8359 21.7254L21.828 21.7319L22.0841 22.0392L22.092 22.0327L21.8359 21.7254Z",fill:"currentColor",mask:"url(#path-2-outside-1_573_4241)"}))),In||(In=a.a.createElement("defs",null,a.a.createElement("filter",{id:"filter0_d_573_4241",x:0,y:0,width:40,height:40,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},a.a.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),a.a.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),a.a.createElement("feOffset",null),a.a.createElement("feGaussianBlur",{stdDeviation:2}),a.a.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.333333 0 0 0 0 0.337255 0 0 0 0 0.419608 0 0 0 0.502974 0"}),a.a.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_573_4241"}),a.a.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_573_4241",result:"shape"})),a.a.createElement("linearGradient",{id:"paint0_linear_573_4241",x1:20,y1:4,x2:20,y2:36,gradientUnits:"userSpaceOnUse"},a.a.createElement("stop",{stopColor:"white"}),a.a.createElement("stop",{offset:1,stopColor:"#F4F4F6"})))))},qn=a.a.forwardRef((function(e,t){return a.a.createElement(Un,Bn({svgRef:t},e))})),Wn=(r.p,r(474)),Yn=r.n(Wn);var Kn=function(e){var t,r,o,i,c,l,u,s,f,h,d=e.handlerCloseModal,v=e.dataItem,g=e.onSearchImage,y=e.handlerFeedback,w=Object(n.useState)(!1),x=Object(p.a)(w,2),E=x[0],O=x[1],C=v.sku,j=Object(n.useState)([]),L=Object(p.a)(j,2),k=L[0],S=L[1],N=Object(b.useMediaQuery)({query:"(max-width: 776px)"}),M=ce((function(e){return e})).settings,_=Object(n.useState)("none"),I=Object(p.a)(_,2),R=I[0],T=I[1],H=Object(n.useState)(""),F=Object(p.a)(H,2),P=F[0],V=F[1],Z=v[M.field.productTag];Object(n.useEffect)((function(){v&&(A(v),G(v["image(main_similarity)"]||v.main_image_link))}),[v]);var G=function(e,t){t=t||5e3;var r=new Image;r.onerror=r.onabort=function(){clearTimeout(void 0),V("")},r.onload=function(){return clearTimeout(void 0),void V(e)},r.src=e},A=function(e){var t=function(e){var t=[],r=e;if(!e)return[];for(var n in r)(null===n||void 0===n?void 0:n.includes("image(recognition)"))||(null===n||void 0===n?void 0:n.includes("additional_image_link"))?Object(ke.isEmpty)(r[n])||r[n]&&t.push({url:r[n]}):"image(main_similarity)"!==n&&"main_image_link"!==n||r[n]&&t.push({url:r[n]});return t}(e);S(t)},z=Object(vt.b)().t;return a.a.createElement(m.a,{className:"box-modal-default",borderRadius:12,style:N?{margin:0}:{}},a.a.createElement(m.a,{className:"ml-auto",style:{width:"fit-content",marginRight:4}},a.a.createElement(le.a,{style:{padding:0},onClick:function(){return null===d||void 0===d?void 0:d()}},a.a.createElement(Kr.a,{style:{fontSize:20,color:"#55566B"}}))),a.a.createElement(m.a,{style:{overflowY:"auto",maxHeight:"90svh"}},a.a.createElement(m.a,{className:"box-carosel",style:0===k.length?{display:"flex",justifyContent:"center"}:{}},k.length>0?a.a.createElement(An,{imgItem:k,onSearchImage:g,handlerCloseModal:function(){return null===d||void 0===d?void 0:d()}}):a.a.createElement("img",{src:Fn.a,alt:"image_item",className:"img-style",style:{width:"300px",height:"300px",padding:"8px"}}),!N&&k.length>0&&a.a.createElement(le.a,{className:"icon-style",onClick:function(){if(P.length>1)return g(P),void(null===d||void 0===d||d())}},a.a.createElement(qn,{color:null===(t=M.theme)||void 0===t?void 0:t.secondaryColor}))),a.a.createElement(m.a,{className:"box-content",display:"flex",style:{flexDirection:"column",borderBottomLeftRadius:12,borderBottomRightRadius:12,paddingBottom:19,backgroundColor:"#F3F3F5"}},a.a.createElement(m.a,{className:"box-top"},a.a.createElement($r.a,{container:!0,justifyContent:"space-between"},a.a.createElement($r.a,{item:!0,xs:12},a.a.createElement(Be.a,{className:"text-f13 fw-500 max-line-1"},M.itemIdLabel||"SKU",": ",C),v[M.field.manufacturerNumber]&&a.a.createElement(Be.a,{className:"text-f13 fw-500 max-line-1",style:{marginTop:"12px"}},z("Manufacturer Number"),":"," ",v[M.field.manufacturerNumber]),M.warehouseVariant&&a.a.createElement(Be.a,{className:"text-f13 max-line-1 fw-500",style:{marginTop:12,display:"inline-block"}},a.a.createElement("span",{style:{marginRight:3}},v[M.field.warehouseStock],":"),a.a.createElement("span",{style:{color:v[M.field.warehouseStockValue]?"#00C070":"#c54545",fontWeight:600}},v[M.field.warehouseStockValue]||0)),(Z||M.brandName)&&a.a.createElement(m.a,{borderRadius:16,style:{backgroundColor:"".concat(null===(r=M.theme)||void 0===r?void 0:r.secondaryColor,"26"),width:"fit-content",padding:"3px 5px",marginTop:12}},a.a.createElement(Be.a,{style:{color:null===(o=M.theme)||void 0===o?void 0:o.secondaryColor,fontSize:12,fontWeight:700}},Z||M.brandName)),!M.warehouseVariant&&a.a.createElement(Be.a,{className:N?"fw-600 text-dark":"text-f22 fw-600 text-dark",style:{marginTop:"12px",display:"inline-block",maxWidth:"100%",wordWrap:"break-word"}},v[M.field.productName])),a.a.createElement($r.a,{item:!0,xs:12},v[M.field.productDetails]&&a.a.createElement(m.a,{className:"w-100"},a.a.createElement(le.a,{className:"w-100",style:{display:"flex",justifyContent:"space-between",color:null===(i=M.theme)||void 0===i?void 0:i.secondaryColor,fontSize:14,textTransform:"initial",paddingLeft:5,marginTop:12},onClick:function(){return O((function(e){return!e}))}},"View details",E?a.a.createElement(Yn.a,{htmlColor:null===(c=M.theme)||void 0===c?void 0:c.secondaryColor}):a.a.createElement(Zn.a,{htmlColor:null===(l=M.theme)||void 0===l?void 0:l.secondaryColor})),a.a.createElement(Pn.a,{in:E},a.a.createElement(Be.a,{style:{fontSize:14,paddingTop:5}},v[M.field.productDetails]))),(M.showMoreInfo||M.warehouseVariant)&&a.a.createElement(m.a,{style:{background:"linear-gradient(270deg, ".concat(null===(u=M.theme)||void 0===u?void 0:u.primaryColor,"bb 0%, ").concat(null===(s=M.theme)||void 0===s?void 0:s.primaryColor," 100%)"),boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.25)",borderRadius:4,marginTop:12},display:"flex",justifyContent:"space-between",alignItems:"center",className:"btn-detail-item"},a.a.createElement(le.a,{style:{display:"flex",justifyContent:"space-between",width:"100%",padding:"0px 12px",minHeight:M.warehouseVariant?64:48},onClick:function(){return window.open("".concat(v[M.field.ctaLinkField]),"_blank")}},a.a.createElement(Be.a,{className:"text-f18 fw-700 text-white max-line-2",align:"left",style:{textTransform:M.warehouseVariant?"none":"uppercase",letterSpacing:"0.55px"}},M.warehouseVariant?v[M.field.productName]:M.productCtaText||"MORE INFO"),a.a.createElement("img",{src:cn.a,alt:"",style:{width:23,marginLeft:5}})))))),M.warehouseVariant&&a.a.createElement(m.a,{display:"flex",justifyContent:"space-between",style:{color:"#2B2C46",marginTop:12},gridGap:20},a.a.createElement(m.a,{style:{backgroundColor:"".concat(null===(f=M.theme)||void 0===f?void 0:f.secondaryColor,"26"),padding:"5px 10px",borderRadius:4,width:"100%"}},a.a.createElement("div",{style:{fontSize:15,fontWeight:500}},v[M.field.warehouseNumber]),a.a.createElement("div",{style:{fontSize:17,fontWeight:700}},v[M.field.warehouseNumberValue]||"N/A")),a.a.createElement(m.a,{style:{backgroundColor:"".concat(null===(h=M.theme)||void 0===h?void 0:h.secondaryColor,"26"),padding:"5px 10px",borderRadius:4,width:"100%"}},a.a.createElement("div",{style:{fontSize:15,fontWeight:500}},v[M.field.warehouseShelfNumber]),a.a.createElement("div",{style:{fontSize:17,fontWeight:700}},v[M.field.warehouseShelfNumberValue]||"N/A"))),M.showFeedbackAndShare&&a.a.createElement(m.a,{className:"box-bottom",style:{marginBottom:6,marginTop:28}},a.a.createElement($r.a,{container:!0,justifyContent:M.shareOption?"space-between":"space-around",alignItems:"center"},a.a.createElement($r.a,{item:!0},a.a.createElement(m.a,{display:"flex",alignItems:"center"},a.a.createElement(le.a,{className:"btn-item",onClick:function(){y("like"),T("like")}},a.a.createElement(Tn,{width:30,height:30,color:"like"===R?"#3E36DC":"#000000"})))),a.a.createElement($r.a,{item:!0},a.a.createElement(m.a,{display:"flex",alignItems:"center"},a.a.createElement(le.a,{className:"btn-item",onClick:function(){y("dislike"),T("dislike")}},a.a.createElement(kn,{width:30,height:30,color:"dislike"===R?"#CC1854":"#000000"})))),M.shareOption&&a.a.createElement($r.a,{item:!0},a.a.createElement(m.a,{display:"flex",alignItems:"center"},a.a.createElement(le.a,{className:"btn-item",onClick:function(){return!1}},a.a.createElement(mn,{width:30,height:30,color:"gray"})))))))))},Qn=r(874),Jn=r(326),Xn=r.n(Jn),$n=r(476),ea=r.n($n),ta=function(e){var t=e.dataItem,r=e.isOpen,n=e.setModalState,o=t["image(main_similarity)"]||t.main_image_link;return a.a.createElement(ot,{openModal:r,handleClose:function(){return n(!1)}},a.a.createElement(m.a,{className:"box-modal-default box-modal-share",style:{padding:"4px"}},a.a.createElement(m.a,{className:"ml-auto",style:{width:"fit-content",marginRight:5}},a.a.createElement(le.a,{style:{padding:0},onClick:function(){return n(!1)}},a.a.createElement(Kr.a,{style:{fontSize:16,color:"#55566B"}}))),a.a.createElement(m.a,{className:"box-content-box-share"},a.a.createElement(Be.a,{className:"text-f12 text-gray text-bold",style:{marginBottom:"5px"}},"Share"),o&&a.a.createElement(Qn.a,{component:"form",className:"box-input"},a.a.createElement(m.a,{className:"text-f9 text-gray",style:{width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingRight:"10px"}},o),a.a.createElement(me.a,{color:"secondary","aria-label":"directions",style:{padding:"4px"},onClick:function(){navigator.clipboard.writeText(o)}},a.a.createElement(Xn.a,{style:{fontSize:14}}))),a.a.createElement(Qn.a,{component:"form",className:"box-input",style:{marginTop:"12px",marginBottom:"8px"}},a.a.createElement(m.a,{className:"text-f9 text-gray",style:{width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingRight:"10px",display:"flex",alignItems:"center"}},a.a.createElement("span",{style:{fontWeight:"bold",paddingRight:"4px"}},"SKU:")," ",t.sku),a.a.createElement(me.a,{color:"secondary","aria-label":"directions",style:{padding:"4px"},onClick:function(){navigator.clipboard.writeText(t.sku)}},a.a.createElement(Xn.a,{style:{fontSize:14}}))),a.a.createElement(m.a,{className:"box-media-share",display:"flex",style:{marginTop:"18px"}},a.a.createElement("a",{style:{padding:0},href:"mailto:support@nyris.io?subject=GF-Sparepart-Search&body= ".concat(encodeURIComponent("SKU: "+t.sku+"\r\n"+(o?"Image Link: ".concat(o):""))," ")},a.a.createElement(m.a,{display:"flex",alignItems:"center"},a.a.createElement("img",{width:40,height:40,src:ea.a,alt:"icon_email"})))))))};var ra=Object(n.memo)((function(e){var t,r,o,i,c,l,u,s,f=e.dataItem,h=e.isHover,d=void 0!==h&&h,v=e.onSearchImage,g=e.handlerGroupItem,y=e.handlerFeedback,b=e.isGroupItem,w=e.handlerCloseGroup,x=e.main_image_link,E=e.indexItem,O=ie(),C=Object(n.useState)(""),j=Object(p.a)(C,2),L=j[0],k=j[1],S=ce((function(e){return e})).settings,N=Object(n.useState)(!1),M=Object(p.a)(N,2),_=M[0],I=M[1],R=Object(n.useState)(!1),T=Object(p.a)(R,2),H=T[0],F=T[1],V=Object(n.useState)("none"),G=Object(p.a)(V,2),A=G[0],z=G[1],B=Object(vt.b)().t,D=f.sku,U=f.collap,q=f[S.field.productTag];Object(n.useEffect)((function(){x&&W(x)}),[x]);var W=function(e,t){t=t||5e3;var r=new Image;r.onerror=r.onabort=function(){clearTimeout(void 0),k("")},r.onload=function(){return clearTimeout(void 0),void k(e)},r.src=e};return a.a.createElement(m.a,{className:"wrap-main-item-result"},a.a.createElement(ot,{openModal:_,handleClose:function(e){I(!1)}},a.a.createElement(Kn,{handlerCloseModal:function(){I(!1)},handlerFeedback:y,dataItem:f,onHandlerModalShare:function(){return F(!0)},onSearchImage:function(e){O(P(!0)),v(e)}})),a.a.createElement(ta,{setModalState:F,dataItem:f,isOpen:H}),a.a.createElement(m.a,{className:"box-top"},b&&U&&a.a.createElement(m.a,{className:"btn-show-result"},a.a.createElement(le.a,{onClick:function(){g(f,E)}},B("Show group"),a.a.createElement(an.a,{style:{fontSize:"10px"}}))),b&&!U&&a.a.createElement(m.a,{className:"btn-show-result"},a.a.createElement(le.a,{onClick:function(){w(f,E)}},B("Close group"),a.a.createElement(an.a,{style:{fontSize:"10px"}}))),!d&&a.a.createElement(m.a,{className:"box-icon-modal"},a.a.createElement(le.a,{style:{width:"100%",height:"100%",padding:0,zIndex:9},onClick:function(){return I(!0),O(Z(!0)),O(P(!0)),void setTimeout((function(){O(P(!1))}),400)}},a.a.createElement(xn,{color:null===(t=S.theme)||void 0===t?void 0:t.secondaryColor}))),a.a.createElement(m.a,{className:"box-image"},a.a.createElement(le.a,{style:{width:"100%",height:"100%"},onClick:function(e){e.preventDefault(),L.length>1&&v(x)}},x?a.a.createElement("img",{src:x,key:x,alt:"image_item",className:"img-style",style:{width:"100%",height:"100%",objectFit:"contain"}}):a.a.createElement("img",{src:Fn.a,alt:"image_item",className:"img-style",style:{width:"100%",height:"100%",objectFit:"cover"}})),d&&a.a.createElement(m.a,{className:"box-hover"},a.a.createElement(le.a,null,"View item")))),a.a.createElement(m.a,{className:"box-content",display:"flex",style:{flexDirection:"column",backgroundColor:"#F3F3F5",flexGrow:1}},a.a.createElement(m.a,{className:"box-top",style:{minHeight:"90px"}},a.a.createElement($r.a,{container:!0,justifyContent:"space-between"},a.a.createElement($r.a,{item:!0,xs:12},a.a.createElement(Qe.a,{title:D,placement:"top",arrow:!0,disableHoverListener:(null===D||void 0===D?void 0:D.length)<19||!D},a.a.createElement(Be.a,{className:"text-f12 max-line-1 fw-400",style:{color:"#2B2C46",marginTop:12,display:"inline-block"}},a.a.createElement("span",{style:{marginRight:3}},S.itemIdLabel||"SKU",":"),dt(D,16))),S.warehouseVariant&&a.a.createElement(m.a,null,a.a.createElement(Be.a,{className:"text-f12 max-line-1 fw-400",style:{color:"#2B2C46",display:"inline-block"}},a.a.createElement("span",{style:{marginRight:3}},f[S.field.warehouseStock],":"),a.a.createElement("span",{style:{color:f[S.field.warehouseStockValue]?"#00C070":"#c54545",fontWeight:600}},f[S.field.warehouseStockValue]||0))),(!!q||!!S.brandName)&&a.a.createElement(Qe.a,{title:q,placement:"top",arrow:!0,disableHoverListener:(null===q||void 0===q?void 0:q.length)<22||!q},a.a.createElement(m.a,{style:{background:"".concat(null===(r=S.theme)||void 0===r?void 0:r.secondaryColor,"26"),borderRadius:"6px",display:"flex",width:"fit-content",padding:"2px 5px",marginTop:3}},a.a.createElement(Be.a,{className:"fw-700",style:{color:null===(o=S.theme)||void 0===o?void 0:o.secondaryColor,fontSize:10,letterSpacing:"1px",maxWidth:"160px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},dt(q,22)||S.brandName))),!S.warehouseVariant&&a.a.createElement(Be.a,{className:"text-f13 fw-600 max-line-3",style:{color:"#1E1F31",marginTop:12}},f[S.field.productName])))),a.a.createElement("div",null,(S.showMoreInfo||S.warehouseVariant)&&a.a.createElement(Qe.a,{title:f[S.field.productName],placement:"top",arrow:!0,disableHoverListener:(null===(i=f[S.field.productName])||void 0===i?void 0:i.length)<35||!S.warehouseVariant},a.a.createElement(m.a,{style:{boxShadow:"-2px 2px 4px rgba(170, 171, 181, 0.5)",height:40,background:"linear-gradient(270deg, ".concat(null===(c=S.theme)||void 0===c?void 0:c.primaryColor,"bb 0%, ").concat(null===(l=S.theme)||void 0===l?void 0:l.primaryColor," 100%)"),borderRadius:4,padding:"0px 8px",marginTop:"12px"},display:"flex",justifyItems:"center",alignItems:"center",justifyContent:"space-between"},a.a.createElement(le.a,{style:{display:"flex",justifyContent:"space-between",width:"100%",padding:0},onClick:function(){return window.open("".concat(f[S.field.ctaLinkField]),"_blank")}},a.a.createElement(Be.a,{className:"text-white max-line-2",style:{textTransform:S.warehouseVariant?"none":"uppercase",overflow:"hidden",textOverflow:"ellipsis",fontWeight:S.warehouseVariant?500:700,fontSize:S.warehouseVariant?"11px":"12px",letterSpacing:"0.27px",wordBreak:S.warehouseVariant?"break-all":"normal",maxWidth:"136px",paddingRight:"8px"},align:"left"},S.warehouseVariant?dt(f[S.field.productName],35):S.productCtaText||"MORE INFO"),a.a.createElement("img",{src:cn.a,alt:"more-info",width:20})))),S.warehouseVariant&&a.a.createElement(m.a,{display:"flex",justifyContent:"space-between",style:{color:"#2B2C46",marginTop:"12px"},gridGap:10},a.a.createElement(m.a,{style:{backgroundColor:"".concat(null===(u=S.theme)||void 0===u?void 0:u.secondaryColor,"26"),padding:"5px 10px",borderRadius:4,width:"100%"}},a.a.createElement("div",{style:{fontSize:10,fontWeight:500}},f.custom_id_key_2),a.a.createElement("div",{style:{fontSize:13,fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},f.custom_id_value_2||"N/A")),a.a.createElement(m.a,{style:{backgroundColor:"".concat(null===(s=S.theme)||void 0===s?void 0:s.secondaryColor,"26"),padding:"5px 10px",borderRadius:4,width:"100%"}},a.a.createElement("div",{style:{fontSize:10,fontWeight:500}},f.custom_id_key_1),a.a.createElement("div",{style:{fontSize:13,fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},f.custom_id_value_1||"N/A"))),S.showFeedbackAndShare&&a.a.createElement(m.a,{className:"box-bottom",style:{marginBottom:6,marginTop:12}},a.a.createElement($r.a,{container:!0,justifyContent:S.shareOption?"space-between":"space-around",alignItems:"center"},a.a.createElement($r.a,{item:!0},a.a.createElement(m.a,{display:"flex",alignItems:"center"},a.a.createElement(le.a,{className:"btn-item",style:{padding:"6px"},onClick:function(){y("like"),z("like")}},a.a.createElement(Tn,{width:16,height:16,color:"like"===A?"#3E36DC":"#000000"})))),a.a.createElement($r.a,{item:!0},a.a.createElement(m.a,{display:"flex",alignItems:"center"},a.a.createElement(le.a,{style:{padding:"6px"},className:"btn-item",onClick:function(){y("dislike"),z("dislike")}},a.a.createElement(kn,{width:16,height:16,color:"dislike"===A?"#CC1854":"#000000"})))),S.shareOption&&a.a.createElement($r.a,{item:!0},a.a.createElement(m.a,{display:"flex",alignItems:"center"},a.a.createElement(le.a,{style:{padding:"6px"},className:"btn-item",onClick:function(){return!1}},a.a.createElement(mn,{width:16,height:16,color:"#808080"})))))))))}));var na,aa=Object(Xt.a)(Object(n.memo)((function(e){var t=e.allSearchResults,r=e.getUrlToCanvasFile,o=e.sendFeedBackAction,i=e.moreInfoText,c=e.searchQuery,l=e.requestImage,u=e.isSearchStalled,s=ce((function(e){return e})).search,f=s.loadingSearchAlgolia,d=Object(n.useState)({}),v=Object(p.a)(d,2),g=v[0],y=v[1],b=Object(n.useState)([]),w=Object(p.a)(b,2),x=w[0],E=w[1],O=Object(n.useState)(!1),C=Object(p.a)(O,2),j=C[0],L=C[1];Object(n.useEffect)((function(){u&&L(!0)}),[u]),Object(n.useEffect)((function(){var e;if(null===t||void 0===t||null===(e=t.hits)||void 0===e?void 0:e.length){L(!1);var r=k(null===t||void 0===t?void 0:t.hits);E(r)}else E([])}),[null===t||void 0===t?void 0:t.hits,null===s||void 0===s?void 0:s.valueTextSearch]);var k=function(e){var t=[],r=[],n=e.filter((function(e){return e.group_id&&""!==e.group_id})),a=Object(ke.groupBy)(n,"group_id");return y(a),0===(t=Object.values(a)).length?e:(t.forEach((function(e){var t;e.length>=2?(t=Object(h.a)(Object(h.a)({},e[0]),{},{isGroup:!0,collap:!0}),r.push(t)):(t=Object(h.a)(Object(h.a)({},e[0]),{},{isGroup:!1,collap:null}),r.push(t))})),r)},S=Object(n.useMemo)((function(){return l||s.valueTextSearch.query||u?0!==x.length||f||u||!j&&!l?x.map((function(e,t){return a.a.createElement(m.a,{key:t},a.a.createElement(ra,{dataItem:e,indexItem:t,isHover:!1,onSearchImage:function(e){r(e)},handlerFeedback:function(e){o(e)},handlerGroupItem:function(e,t){return function(e,t){var r=e.group_id,n=Object(Mt.a)(x),a=n.slice(0,t+1);a.filter((function(e){return e.group_id===r}))[0].collap=!1;var o=n.slice(t+1,n.length),i=Object(Mt.a)(g[r]);i.shift(),o=i.concat(o),E(a.concat(o))}(e,t)},handlerCloseGroup:function(e,t){return function(e,t){var r=e.group_id,n=Object(Mt.a)(x),a=n.slice(0,t+1);a.filter((function(e){return e.group_id===r}))[0].collap=!0;var o=n.slice(t+1,n.length);o=o.filter((function(e){return e.group_id!==r})),E(a.concat(o))}(e,t)},isGroupItem:null===e||void 0===e?void 0:e.isGroup,moreInfoText:i,main_image_link:e["image(main_similarity)"]||e.main_image_link}))})):a.a.createElement(m.a,{style:{marginTop:"50px",width:"100%",textAlign:"center"}},"No products were found matching your search criteria."):a.a.createElement(m.a,{style:{marginTop:"50px",width:"100%",textAlign:"center"}},"Please upload an image or enter a keyword to search.")}),[x,c,l,s.valueTextSearch,u,j,f]);return a.a.createElement(a.a.Fragment,null,S)}))),oa=["svgRef","title"];function ia(){return(ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ca(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var la=function(e){var t=e.svgRef,r=e.title,n=ca(e,oa);return a.a.createElement("svg",ia({width:12,height:12,viewBox:"0 0 12 12",fill:"none",ref:t},n),r?a.a.createElement("title",null,r):null,na||(na=a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.66658 10.9888C3.65328 11.6481 4.81331 12 6 12C7.5913 12 9.11742 11.3679 10.2426 10.2426C11.3679 9.11742 12 7.5913 12 6C12 4.81331 11.6481 3.65328 10.9888 2.66658C10.3295 1.67989 9.39246 0.910851 8.2961 0.456725C7.19975 0.0025997 5.99335 -0.11622 4.82946 0.115291C3.66557 0.346802 2.59648 0.918247 1.75736 1.75736C0.918247 2.59648 0.346802 3.66557 0.115291 4.82946C-0.11622 5.99335 0.0025997 7.19975 0.456725 8.2961C0.910851 9.39246 1.67989 10.3295 2.66658 10.9888ZM3.14278 1.72387C3.98852 1.15877 4.98284 0.857145 6 0.857145C7.36397 0.857145 8.67208 1.39898 9.63655 2.36345C10.601 3.32793 11.1429 4.63603 11.1429 6C11.1429 7.01716 10.8412 8.01148 10.2761 8.85722C9.71103 9.70296 8.90782 10.3621 7.96809 10.7514C7.02835 11.1406 5.9943 11.2425 4.99668 11.044C3.99906 10.8456 3.08269 10.3558 2.36345 9.63655C1.64421 8.91731 1.1544 8.00094 0.955964 7.00332C0.757526 6.00571 0.859372 4.97165 1.24862 4.03192C1.63787 3.09218 2.29705 2.28898 3.14278 1.72387ZM6 2.57143C5.87285 2.57143 5.74857 2.60913 5.64285 2.67977C5.53713 2.75041 5.45473 2.85081 5.40608 2.96827C5.35742 3.08574 5.34469 3.215 5.36949 3.3397C5.3943 3.4644 5.45553 3.57895 5.54543 3.66885C5.63534 3.75876 5.74988 3.81999 5.87458 3.84479C5.99929 3.8696 6.12854 3.85686 6.24601 3.80821C6.36348 3.75955 6.46388 3.67715 6.53452 3.57144C6.60515 3.46572 6.64286 3.34143 6.64286 3.21429C6.64286 3.04379 6.57513 2.88028 6.45457 2.75972C6.33401 2.63916 6.1705 2.57143 6 2.57143ZM6.42857 8.57143V5.14286H4.71428V6H5.57143V8.57143H4.28571V9.42857H7.71428V8.57143H6.42857Z",fill:"white"})))},ua=a.a.forwardRef((function(e,t){return a.a.createElement(la,ia({svgRef:t},e))})),sa=(r.p,r(904)),fa=r(899),ha=r(900);function da(){da=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(S){l=function(e,t,r){return e[t]=r}}function u(e,t,r,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new j(a||[]);return n(i,"_invoke",{value:x(e,r,c)}),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(S){return{type:"throw",arg:S}}}e.wrap=u;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(L([])));g&&g!==t&&r.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var a;n(this,"_invoke",{value:function(n,o){function i(){return new t((function(a,i){!function n(a,o,i,c){var l=s(e[a],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}(n,o,a,i)}))}return a=a?a.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(a,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw o;return k()}for(r.method=a,r.arg=o;;){var i=r.delegate;if(i){var c=E(i,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=s(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var a=s(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,f;var o=a.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,n(y,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new w(u(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),l(y,c,"Generator"),l(y,o,(function(){return this})),l(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=L,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:L(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}var pa=Object(Xt.a)(Object(n.memo)((function(e){var t,r,o=ie(),i=Object(n.useRef)(null),c=ce((function(e){return e})),l=c.search,s=c.settings,f=l.requestImage,v=l.regions,g=l.selectedRegion,y=l.keyFilter,w=l.loadingSearchAlgolia,O=l.imageThumbSearchInput,C=null===s||void 0===s?void 0:s.productCtaText,j=Object(n.useState)(!1),I=Object(p.a)(j,2),R=I[0],T=I[1],V=Object(b.useMediaQuery)({query:"(max-width: 776px)"}),G=Object(n.useState)(null),A=Object(p.a)(G,2),z=A[0],B=A[1],D=function(){return i.current.scrollIntoView("-100px")},U=Object(n.useState)(),q=Object(p.a)(U,2),W=q[0],Y=q[1],K=Object(vt.b)().t,Q=Object(n.useState)(!1),J=Object(p.a)(Q,2),X=J[0],te=J[1],re=Object(n.useState)(!1),ne=Object(p.a)(re,2),ae=ne[0],oe=ne[1],ue=Object(n.useRef)(null);Object(n.useEffect)((function(){if(!w&&(O.includes("blob:")||O.includes("data:"))&&ue.current!==O){te(!0);var e=setTimeout((function(){te(!1)}),4e3);return ue.current=O,function(){clearTimeout(e),te(!1)}}}),[O,w]),Object(n.useEffect)((function(){g&&B(g)}),[g]),Object(n.useEffect)((function(){f&&(D(),B(x))}),[f]);var se=Object(n.useCallback)(function(){var e=Object(d.a)(da().mark((function e(t,r){var n;return da().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[{key:s.visualSearchFilterKey,values:["".concat(y)]}],o(_()),e.abrupt("return",Ie({image:t,settings:s,region:r,filters:y?n:void 0}).then((function(e){return o(P(!1)),Object(h.a)({},e)})).catch((function(e){o(P(!1)),console.log("error call api change selection find image",e)})));case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),[s,o,y]),fe=Object(n.useCallback)(Object(ke.debounce)(function(){var e=Object(d.a)(da().mark((function e(t){var r;return da().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(f){e.next=2;break}return e.abrupt("return");case 2:return o(P(!0)),r=f.canvas,se(r,t).then((function(e){o(H(e)),e.results.find((function(e){return e.score>=.65}))||oe(!0),setTimeout((function(){oe(!1)}),4e3)})),e.abrupt("return",o(ee()));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),250),[f,se]),he=function(){var e=Object(d.a)(da().mark((function e(t){return da().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ir(c,"like"===t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),de=function(){var e=Object(d.a)(da().mark((function e(t,r){var n,a,i,l;return da().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(P(!0)),V&&(D(),o(Z(!1))),o($()),o(_()),o(F(t)),e.next=7,Ne(t);case 7:if(n=e.sent,o(S(n)),!r){e.next=12;break}return Rr(c,r),e.abrupt("return");case 12:if(a=void 0,!s.regions){e.next=20;break}return e.next=16,_e(n,s);case 16:i=e.sent,a=i.selectedRegion,o(N(i.regions)),o(M(a));case 20:l=[{key:s.visualSearchFilterKey,values:["".concat(y)]}],Ie({image:n,settings:s,region:a,filters:y?l:void 0}).then((function(e){o(L(e)),o(ee()),o(P(!1))}));case 22:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),pe=f?["sku:DOES_NOT_EXIST<score=1>"]:[],me=(null===l||void 0===l?void 0:l.results)?null===l||void 0===l?void 0:l.results.slice().reverse().map((function(e,t){return"sku:'".concat(e.sku,"'<score=").concat(t,"> ")})):"",ve=[].concat(pe,Object(Mt.a)(me)).join(" OR ");Object(n.useEffect)((function(){if(document.title="Search results",!f&&!Object(ke.isEmpty)(l.valueTextSearch.query)){var e=y?"".concat(s.alogoliaFilterField,":'").concat(y,"'"):"";Y(e)}}),[y,f,l.valueTextSearch.query,s.alogoliaFilterField]),Object(n.useEffect)((function(){if(f){o(P(!0));var e=f.canvas;return se(e).then((function(e){o(H(e))})),o(ee()),function(){}}}),[y]),Object(n.useEffect)((function(){if(f){var e=y?ve?"(".concat(ve,") AND ").concat(s.alogoliaFilterField,":'").concat(y,"'"):"".concat(s.alogoliaFilterField,":'").concat(y,"'"):ve;Y(e)}}),[ve,s.alogoliaFilterField]);var ge=Object(n.useCallback)(Object(ke.debounce)((function(e){o(k(e)),fe(e)}),500),[fe]),ye=Object(n.useMemo)((function(){return v.filter((function(e){return(e.normalizedRect.x1!==z.x1||e.normalizedRect.x2!==z.x2||e.normalizedRect.y1!==z.y1||e.normalizedRect.y2!==z.y2)&&(0!==z.x1||1!==z.x2||0!==z.y1||1!==z.y2)}))}),[z,v]);return a.a.createElement("div",{className:"wrap-main-result loading",id:"wrap-main-result",ref:i},a.a.createElement(a.a.Fragment,null,W&&a.a.createElement(sa.a,{query:l.valueTextSearch.query,filters:W}),a.a.createElement(m.a,{className:"box-wrap-result-component"},!V&&a.a.createElement("div",{className:"box-search"},a.a.createElement(xt,null)),a.a.createElement(m.a,{className:"box-result"},a.a.createElement(a.a.Fragment,null,a.a.createElement(m.a,{className:"btn-open-support"},a.a.createElement(u.b,{to:"/support",style:{color:"#3E36DC"}},a.a.createElement("img",{src:gr.a,alt:"",width:16,height:16}))),!V&&a.a.createElement(a.a.Fragment,null,(!s.postFilterOption&&f||s.postFilterOption)&&a.a.createElement(m.a,{className:"wrap-main-col-left ".concat(R?"toggle":"")},a.a.createElement(m.a,{className:"box-toggle-coloumn"},a.a.createElement(le.a,{style:{color:"#55566b"},onClick:function(){T(!R)}},R?a.a.createElement(qr.a,{style:{fontSize:30}}):a.a.createElement(Gr.a,{style:{fontSize:20}}))),s.preview&&f&&a.a.createElement(m.a,{className:"col-left"},a.a.createElement(m.a,{className:"box-preview"},a.a.createElement(m.a,{className:"preview-item",style:{backgroundColor:"white"}},a.a.createElement(yr.Preview,{key:null===f||void 0===f?void 0:f.id,onSelectionChange:function(e){B(e),ge(e)},image:null===f||void 0===f?void 0:f.canvas,selection:z||x,regions:ye,maxWidth:320,maxHeight:320,dotColor:"#FBD914"}))),(ae||X)&&a.a.createElement(m.a,{className:"box-title_col-left",alignItems:"center",style:{backgroundColor:"#3E36DC",display:"flex",columnGap:"6px",padding:"5px"}},a.a.createElement(ua,null),a.a.createElement(Be.a,{style:{fontSize:10,color:"#fff",width:"280px"}},X?K("Adjust the search frame around your object for improved results"):"Use the cropping tool for improved image accuracy and enhanced results"))),s.postFilterOption&&a.a.createElement(m.a,{className:"col-left__bottom"},a.a.createElement(ur,null)))),a.a.createElement(m.a,{className:"col-right ".concat(s.preview&&"ml-auto mr-auto"," ").concat(V&&"col-right-result-mobile"),style:{paddingTop:y&&V?"105px":V?"60px":"40px"}},a.a.createElement(m.a,{className:"wrap-box-refinements"},a.a.createElement(Xr,{statusSwitchButton:!0})),V&&s.preview&&f&&a.a.createElement(m.a,{className:"col-left",style:{backgroundColor:null===s||void 0===s||null===(t=s.theme)||void 0===t?void 0:t.primaryColor,marginBottom:"15px"}},a.a.createElement(m.a,{className:"box-preview"},a.a.createElement(m.a,{className:"preview-item",style:{backgroundColor:"white"}},a.a.createElement(yr.Preview,{key:null===f||void 0===f?void 0:f.id,onSelectionChange:function(e){B(e),ge(e)},image:null===f||void 0===f?void 0:f.canvas,selection:z||x,regions:ye,maxWidth:320,maxHeight:320,dotColor:"#FBD914"})),(ae||X)&&a.a.createElement(m.a,{className:"box-title_col-left",alignItems:"center",style:{backgroundColor:"#3E36DC",marginBottom:"25px",display:"flex",columnGap:"6px",padding:"5px"}},a.a.createElement(ua,null),a.a.createElement(Be.a,{style:{fontSize:10,color:"#fff",width:"300px"}},X?K("Adjust the search frame around your object for improved results"):"Use the cropping tool for improved image accuracy and enhanced results")))),a.a.createElement(m.a,{className:"box-item-result ml-auto mr-auto"},a.a.createElement(aa,{getUrlToCanvasFile:de,setLoading:!1,sendFeedBackAction:he,moreInfoText:C,requestImage:f,searchQuery:l.valueTextSearch.query}),a.a.createElement(m.a,{className:"pagination-result",style:{width:"100%",margin:"20px auto",padding:"0 20%"}},(null===(r=e.allSearchResults)||void 0===r?void 0:r.hits.length)>0&&(f||l.valueTextSearch.query)&&a.a.createElement(fa.a,{showFirst:!1,translations:{previous:a.a.createElement(zr.a,{style:{color:"#161616"}}),next:a.a.createElement(Dr.a,{style:{color:"#161616"}})}})))))),!V&&a.a.createElement(m.a,null,a.a.createElement(m.a,{className:"box-notify"},a.a.createElement(rn,{search:l},a.a.createElement(m.a,{display:"flex",style:{padding:"0 20px"},className:"box-change-hit-items"},a.a.createElement("span",{style:{paddingRight:"10px"}},K("Items per page"),":"),a.a.createElement(ha.a,{items:E,defaultRefinement:20}))))))))}))),ma=["component","authed"],va=function(e){var t=e.component,r=e.authed,n=Object(s.a)(e,ma);return a.a.createElement(f.b,Object.assign({},n,{render:function(){return r?a.a.createElement(t,null):a.a.createElement(f.a,{to:"/login"})}}))};var ga=Object(n.memo)((function(){return a.a.createElement(f.d,null,a.a.createElement(mr,null,a.a.createElement(f.d,null,a.a.createElement(va,{authed:!0,exact:!0,strict:!0,path:"/",component:Vr}),a.a.createElement(va,{authed:!0,exact:!0,strict:!0,path:"/result",component:pa}))))})),ya=(r(853),r(481)),ba=function(){var e=Object(b.useMediaQuery)({query:"(max-width: 776px)"});return a.a.createElement(Sr.Toaster,{containerStyle:e?{bottom:80}:{top:60},position:e?"bottom-center":"top-right"},(function(e){return a.a.createElement(Sr.ToastBar,{toast:e,style:{padding:0,borderRadius:0}},(function(t){var r=t.icon;return a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{style:{width:5,height:"100%",background:"success"===e.type?"#61d345":"transparent",marginRight:7}}),a.a.createElement("span",{style:{padding:15,display:"inline-flex"}},r,a.a.createElement("span",{style:{fontSize:15,fontWeight:300,margin:"0 10px"}}," ",Object(Sr.resolveValue)(e.message,e)),"loading"!==e.type&&a.a.createElement("span",{style:{display:"flex",alignItems:"center"}},a.a.createElement(Kr.a,{fontSize:"small",style:{cursor:"pointer",marginLeft:10},onClick:function(){return Nr.a.dismiss(e.id)}}))))}))}))};document.title=window.location.host;var wa=Object(ya.a)({overrides:{MuiTooltip:{arrow:{color:"black"},tooltip:{backgroundColor:"black"}}}});i.a.render(a.a.createElement(n.Fragment,null,a.a.createElement(ba,null),a.a.createElement(c.a,{store:oe},a.a.createElement(l.a,{theme:wa},a.a.createElement(u.a,null,a.a.createElement(ga,null))))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[493,1,2]]]);
3
+ //# sourceMappingURL=main.1e8d5e32.chunk.js.map