(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7905,8537],{97786:function(t,e,n){var r=n(71811),o=n(40327);t.exports=function(t,e){e=r(e,t);for(var n=0,i=e.length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},80531:function(t,e,n){var r=n(62705),o=n(29932),i=n(1469),l=n(33448),s=1/0,a=r?r.prototype:void 0,c=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(l(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-s?"-0":n}},71811:function(t,e,n){var r=n(1469),o=n(15403),i=n(55514),l=n(79833);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(l(t))}},15403:function(t,e,n){var r=n(1469),o=n(33448),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!!("number"==n||"symbol"==n||"boolean"==n||null==t||o(t))||l.test(t)||!i.test(t)||null!=e&&t in Object(e)}},24523:function(t,e,n){var r=n(88306);t.exports=function(t){var e=r(t,function(t){return 500===n.size&&n.clear(),t}),n=e.cache;return e}},55514:function(t,e,n){var r=n(24523),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,l=r(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)}),e});t.exports=l},40327:function(t,e,n){var r=n(33448),o=1/0;t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-o?"-0":e}},27361:function(t,e,n){var r=n(97786);t.exports=function(t,e,n){var o=null==t?void 0:r(t,e);return void 0===o?n:o}},64721:function(t,e,n){var r=n(42118),o=n(98612),i=n(47037),l=n(40554),s=n(52628),a=Math.max;t.exports=function(t,e,n,c){t=o(t)?t:s(t),n=n&&!c?l(n):0;var u=t.length;return n<0&&(n=a(u+n,0)),i(t)?n<=u&&t.indexOf(e,n)>-1:!!u&&r(t,e,n)>-1}},88306:function(t,e,n){var r=n(83369);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var l=t.apply(this,r);return n.cache=i.set(o,l)||i,l};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},79833:function(t,e,n){var r=n(80531);t.exports=function(t){return null==t?"":r(t)}},95159:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/products/[slug]",function(){return n(75085)}])},55752:function(t,e,n){"use strict";n.d(e,{W:function(){return i}});var r=n(85893);n(67294);var o=n(86640);let i=t=>{let{className:e,maxWidth:n,children:i}=t,l="number"==typeof n?"".concat(null==n?void 0:n.toString(),"px"):({sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px"})[n];return(0,r.jsx)("div",{style:{maxWidth:null!=l?l:"80rem"},className:(0,o.cn)("mx-auto w-full px-4",e),children:i})}},8647:function(t,e,n){"use strict";n.d(e,{k:function(){return i}});var r=n(85893),o=n(86640);function i(t){let{align:e="start",direction:n="row",justify:i="start",wrap:l=!1,className:s,children:a,gap:c,as:u="div",...d}=t,f="flex ".concat({row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"}[n]," ").concat({start:"items-start",end:"items-end",baseline:"items-baseline",stretch:"items-stretch",center:"items-center"}[e]," ").concat({normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:" justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"}[i]," ").concat(l?"flex-wrap":""," gap-").concat(c||0," ");return(0,r.jsx)(u,{className:(0,o.cn)(f,s),...d,children:a})}},4331:function(t,e,n){"use strict";n.d(e,{k:function(){return r.k}});var r=n(8647)},77066:function(t,e,n){"use strict";n.d(e,{r:function(){return i},P:function(){return l}});var r=n(85893),o=n(86640);function i(t){let{columns:e=1,gap:n=0,align:i="stretch",justify:l="start",className:s,children:a}=t,c="grid w-full ".concat({none:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-1",12:"grid-cols-12"}[e]||"grid-cols-1"," ").concat({start:"items-start",end:"items-end",baseline:"items-baseline",stretch:"items-stretch",center:"items-center"}[i]," ").concat({normal:"justify-items-normal",start:"justify-items-start",end:"justify-items-end",center:"justify-items-center",between:" justify-items-between",around:"justify-items-around",evenly:"justify-items-evenly",stretch:"justify-items-stretch"}[l]," gap-").concat(null!=n?n:0);return(0,r.jsx)("div",{className:(0,o.cn)(c,s),children:a})}function l(t){let{span:e="auto",className:n,children:i}=t;return(0,r.jsx)("div",{className:(0,o.cn)("w-auto ".concat({auto:"col-span-auto",1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"}[e]),n),children:i})}},40858:function(t,e,n){"use strict";n.d(e,{P4:function(){return i.P},W2:function(){return o.W},kC:function(){return r.k},rj:function(){return i.r}});var r=n(4331),o=n(55752),i=n(77066)},84170:function(t,e,n){"use strict";n.d(e,{L:function(){return p},f:function(){return f}});var r=n(85893),o=n(67294),i=n(94901),l=n(22779),s=n(64721),a=n.n(s),c=n(18446),u=n.n(c);let d=(0,o.createContext)({products:null,addToBag:null,addWishlist:()=>{},cart:null,favorited:!1,favorites:null,fetchCollections:()=>{},getPriceDisplay:()=>0,id:null,isAddingToBag:!1,isScript:!1,options:{},price:0,productCollection:null,selected:null,selectedOpt:null,setCart:()=>{},setId:()=>{},setOptions:()=>{},setPrice:()=>{},setSelectedOpt:()=>{},setWishlist:()=>{},wishlist:{productIds:[]}});function f(t){let{children:e}=t,[n,s]=(0,o.useState)(null),[c,f]=(0,o.useState)(null),[p,v]=(0,o.useState)(!1),[m,h]=(0,o.useState)({}),[g,w]=(0,o.useState)([]),[x,y]=(0,o.useState)(null),[j,E]=(0,o.useState)(0),[b,k]=(0,o.useState)({productIds:[]}),[I,S]=(0,o.useState)(!1),[_,N]=(0,o.useState)(null),[P,C]=(0,o.useState)(null),[O,A]=(0,o.useState)(null),D="PSecwid__".concat("25550022","PSfavorites"),[L,M]=(0,o.useState)(!1),[z,B]=(0,o.useState)(0),[T,W]=(0,o.useState)(!1);(0,o.useEffect)(()=>{null!==_&&fetch("/api/ecwid/products/".concat(_)).then(t=>t.json()).then(t=>{t&&f(t.result)}).catch(t=>{})},[_]),(0,o.useMemo)(()=>{let t=null;if(g.length){var e;let n=c&&(null==c?void 0:c.combinations),r=null===(e=n[0])||void 0===e?void 0:e.options.map(t=>t.name),o=null==g?void 0:g.sort((t,e)=>(null==r?void 0:r.indexOf(t.name))-(null==r?void 0:r.indexOf(e.name))),i=o.filter(t=>a()(r,t.name)),l=n.flatMap(t=>{t.options.length;let e=t.options.map(t=>({name:t.name,value:t.value}));if(u()(e,i))return t}).find(t=>t);n.flatMap(t=>{let e=t.options.map(t=>({name:t.name,value:t.value}));if(u()(e,o))return t}).find(t=>t),g.flatMap(t=>n.flatMap(e=>e.options.map(n=>{if(e.options.length<2&&u()({name:n.name,value:n.value},t))return e}))).find(t=>t),l&&y(l),t=g}return t},[g,c]),(0,o.useEffect)(()=>{window.ec=window.ec||{},window.ec.config=window.ec.config||{},window.ec.config.storefrontUrls=window.ec.config.storefrontUrls||{},["/cart"].includes(location.pathname)&&(window.ec.config.storefrontUrls.cleanUrls=!0,window.ec.config.storefrontUrls.queryBasedCleanUrls=!0),window.ec.config.store_main_page_url="".concat("https://www.hickoryhardware.com","/cart"),window.ecwid_script_defer=!0,"/cart"===location.pathname&&(window._xnext_initialization_scripts=[{widgetType:"ProductBrowser",id:"ecwid-shop-store",arg:["id=ecwid-shop-store"]}]),function(){if("undefined"!=typeof Ecwid)try{Ecwid.OnAPILoaded.add(function(){Ecwid.init()})}catch(t){}else B(t=>t+1)}()},[]),(0,o.useEffect)(()=>{if(localStorage.getItem(D)){M(!0);let t=JSON.parse(localStorage.getItem(D));t.productIds.length>0&&(k(e=>({...e,productIds:t.productIds})),S(!!a()(t.productIds,_)))}},[_,L]),(0,o.useEffect)(()=>{(async()=>{let t=JSON.parse(localStorage.getItem(D));if(null==t?void 0:t.productIds)try{let e={ids:null==t?void 0:t.productIds},n=await l.i3.fetch('*[_type=="mainProduct" && ecwidProductId in $ids && !(_id in path("drafts.**"))]',e).then(t=>t),r=await fetch("/api/ecwid/products/search?productIds=".concat(t.productIds)),o=await r.json(),i=null==n?void 0:n.map(t=>{var e;return null===(e=o.items)||void 0===e?void 0:e.map(e=>{if(e.id===t.ecwidProductId)return{...t,...e,ecwidId:e.id,price:e.defaultDisplayedPriceFormatted}}).flat()}).flat().filter(t=>void 0!==t);C(i)}catch(t){}})()},[L]);let R=async t=>{A((await fetch("/api/ecwid/products/search?productIds=".concat(t)).then(t=>t.json())).items)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Provider,{value:{cart:n,setCart:s,products:c,options:m,setOptions:h,price:j,setPrice:E,addToBag:(t,e)=>{v(!0);let n={...t,callback:function(t){t?i.A.success("Product was successfully added to your cart"):i.A.error("There was an error adding this product to your cart."),v(!1)}};e&&Object.keys(e).length&&(n.options=e),setTimeout(()=>{"undefined"!=typeof Ecwid&&Ecwid.Cart.addProduct(n)},1e3)},isAddingToBag:p,getPriceDisplay:t=>{let e="$".concat(t);return"undefined"!=typeof Ecwid&&Ecwid.OnAPILoaded.add(function(){e=Ecwid.formatCurrency(t)}),e},setWishlist:k,wishlist:b,setId:N,id:_,favorited:I,addWishlist:t=>{let e=null==b?void 0:b.productIds,n=a()(e,t)?e.filter(e=>e!==t):e.concat(t);k(t=>({...t,productIds:n})),S(!a()(e,t)),localStorage.setItem(D,JSON.stringify({productIds:n}))},favorites:P,fetchCollections:R,productCollection:O,setSelectedOpt:w,selectedOpt:g,selected:x,isScript:T},children:e}),(0,r.jsx)("div",{style:{zIndex:1},children:(0,r.jsx)(i.I,{delay:5e3,position:"top-center"})})]})}function p(){return(0,o.useContext)(d)}},22779:function(t,e,n){"use strict";n.d(e,{i3:function(){return l}});var r=n(27688),o=n(58495),i=n(34155);(0,r.e)(o.v);let l=(0,r.e)(o.v);(0,r.e)({...o.v,useCdn:!1,token:"sk7Lc8pj1TjSMTDYKjg7Bv2vIfXizQ4PBMDGZoD6kL4JCPJSSFHsHKgEqzGLed84q0BvzqhgpIrwtg1Zk4D7nvJBoPtXNW7Eh8XiXZclZ2wtfh9BwTj79SP1MZlRdukF6q3DcvEC34dJkoZqrDE12c90MOzzbecQ5xmLqygzu7VrNjXKoCtt"}),(0,r.e)({...o.v,useCdn:!1,token:i.env.SANITY_API_WRITE_TOKEN})},19805:function(t,e,n){"use strict";n.r(e);var r=n(85893),o=n(67294),i=n(41664),l=n.n(i),s=n(9008),a=n.n(s),c=n(40858),u=n(40135);e.default=o.memo(function(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a(),{children:(0,r.jsx)("title",{children:"404: Page not found"})}),(0,r.jsxs)("section",{children:[(0,r.jsx)("div",{className:"skew skew-top mr-for-radius",children:(0,r.jsx)("svg",{className:"w-full h-8 text-gray-50 md:h-12 lg:h-20",viewBox:"0 0 10 10",preserveAspectRatio:"none",children:(0,r.jsx)("polygon",{fill:"currentColor",points:"0 0 10 10 0 10"})})}),(0,r.jsx)("div",{className:"skew skew-top ml-for-radius",children:(0,r.jsx)("svg",{className:"w-full h-8 text-gray-50 md:h-12 lg:h-20",viewBox:"0 0 10 10",preserveAspectRatio:"none",children:(0,r.jsx)("polygon",{fill:"currentColor",points:"0 10 10 0 10 10"})})}),(0,r.jsx)("div",{className:"py-20 radius-for-skewed bg-gray-50",children:(0,r.jsx)(c.W2,{children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)(u.xv,{fontSize:"4xl",weight:"bold",className:"mb-6 text-primary",children:"Whoops!"}),(0,r.jsx)(u.X6,{type:"h3",fontSize:"4xl",className:"mb-2",weight:"bold",children:"Something went wrong!"}),(0,r.jsx)(u.xv,{muted:!0,className:"mb-8",children:"Sorry, but we are unable to open this page"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(l(),{className:"inline-block w-full px-6 py-2 mb-2 font-bold leading-loose rounded-l-xl rounded-t-xl bg-primary-foreground text-gray-50 hover:bg-primary lg:mb-0 lg:mr-4 lg:w-auto",href:"/",children:"Go back to Homepage"}),(0,r.jsx)("a",{className:"inline-block w-full px-6 py-2 font-bold leading-loose bg-white rounded-l-xl rounded-t-xl hover:bg-gray-50 lg:w-auto",href:"#",children:"Try Again"})]})]})})}),(0,r.jsx)("div",{className:"skew skew-bottom mr-for-radius",children:(0,r.jsx)("svg",{className:"w-full h-8 text-gray-50 md:h-12 lg:h-20",viewBox:"0 0 10 10",preserveAspectRatio:"none",children:(0,r.jsx)("polygon",{fill:"currentColor",points:"0 0 10 0 0 10"})})}),(0,r.jsx)("div",{className:"skew skew-bottom ml-for-radius",children:(0,r.jsx)("svg",{className:"w-full h-8 text-gray-50 md:h-12 lg:h-20",viewBox:"0 0 10 10",preserveAspectRatio:"none",children:(0,r.jsx)("polygon",{fill:"currentColor",points:"0 0 10 0 10 10"})})})]})]})})},75085:function(t,e,n){"use strict";n.r(e),n.d(e,{__N_SSG:function(){return j},default:function(){return E}});var r=n(85893),o=n(67294),i=n(11163),l=n(70386),s=n(72535),a=n(1641),c=n(19805),u=n(47503),d=n(74975),f=n(71146),p=n(33640),v=n(37081),m=n(84170),h=n(27361),g=n.n(h);function w(t){let{data:e}=t,{commonSections:n,name:i,ecwidProductId:l,price:s,description:a,sections:c,_id:u,_type:d}=e,h=(0,o.useContext)(p.z),w=null==n?void 0:n.sections,x=null==c?void 0:c.map(t=>{var e,r,o;let i=null==n?void 0:null===(e=n.sections)||void 0===e?void 0:e.findIndex(t=>{var e;return null==t?void 0:null===(e=t._type)||void 0===e?void 0:e.includes("slotProductInfo")}),l={variant:null==n?void 0:null===(o=n.sections)||void 0===o?void 0:null===(r=o[i])||void 0===r?void 0:r.variant};return(null==t?void 0:t._type)==="slotProductInfo"&&(null==t?void 0:t.variant)==="defaultVariant"?{...t,...l}:t});if(c){let t=null==c?void 0:c.filter(t=>(null==t?void 0:t._type)!=="slotProductInfo");w=(null==t?void 0:t.length)!==0?x:null==c?void 0:c.reduce((t,e)=>{var r,o;let i=null==n?void 0:null===(r=n.sections)||void 0===r?void 0:r.findIndex(t=>{var e;return null==t?void 0:null===(e=t._type)||void 0===e?void 0:e.includes("slotProductInfo")});return(null==e?void 0:e.variant)==="defaultVariant"&&(e.variant=null===(o=t[i])||void 0===o?void 0:o.variant),-1!==i&&(t[i]=e),t},[...null==n?void 0:n.sections])}return(0,r.jsx)(r.Fragment,{children:w&&(null==w?void 0:w.map((t,n)=>{let o=(null==t?void 0:t._type)==="slotCart"?"cartSection":(null==t?void 0:t._type)==="slotWishlist"?"wishlistSection":(null==t?void 0:t._type)==="slotProductInfo"?"productInfo":null==t?void 0:t._type,c=null===f.z||void 0===f.z?void 0:f.z[o],p=(null==t?void 0:t._type)==="slotProductInfo"?{id:u,type:d}:{id:null==t?void 0:t._id,type:null==t?void 0:t._type};return c?(0,r.jsx)(v.Z,{document:p,showInlineEditor:h,children:(0,r.jsx)(m.f,{children:(0,r.jsx)(c,{template:{bg:"gray",color:"webriq"},product:{name:i,ecwidProductId:l,price:s,description:a},swellProduct:g()(e,"swellProduct"),data:t})})},n):null}))})}function x(t){let{data:e}=t,n=null==e?void 0:e.productData;return n?(null==e?void 0:e.productData)&&(0,r.jsx)(w,{data:{...n,swellProduct:null==e?void 0:e.swellProduct}}):null}function y(t){var e;let{data:n,slug:o,token:i=null}=t,l=(0,s.u)(i,a.jE,{slug:o}),c=(null==l?void 0:l[0])||l;return c?(0,r.jsxs)(r.Fragment,{children:[(!c||!(null==c?void 0:c.sections)||(null==c?void 0:null===(e=c.sections)||void 0===e?void 0:e.length)===0)&&(0,r.jsx)(d.Y,{}),(null==n?void 0:n.productData)&&(0,r.jsx)(w,{data:c})]}):null}var j=!0,E=o.memo(function(t){var e;let{data:n,preview:s,token:a,source:d}=t,f=(0,i.useRouter)().query.slug;return((0,o.useEffect)(()=>{"undefined"!=typeof Ecwid&&Ecwid.init()},[]),null==n?void 0:null===(e=n.swellProduct)||void 0===e?void 0:e.id)?s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.a,{}),(0,r.jsx)(l.Dz,{fallback:"Loading...",children:(0,r.jsx)(p.Z,{showInlineEditor:"studio"===d,children:(0,r.jsx)(y,{data:n,token:a||null,slug:f})})})]}):(0,r.jsx)(x,{data:n}):(0,r.jsx)(c.default,{})})},11163:function(t,e,n){t.exports=n(73035)},94901:function(t,e,n){"use strict";n.d(e,{A:function(){return b},I:function(){return j}});var r,o,i,l=n(67294),s=l.memo(function(){return l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},l.createElement("g",{transform:"translate(.077 .077)"},l.createElement("g",null,l.createElement("path",{fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M3.719 7.884L6.235 10.4l3.032-3.032 2.774-2.774"}))))}),a=l.memo(function(){return l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},l.createElement("g",{transform:"translate(.077 .077)"},l.createElement("g",null,l.createElement("path",{fill:"#fff",d:"M10.915 9.98l2.853-2.846a.666.666 0 00-.942-.942L9.979 9.044 7.133 6.191a.666.666 0 00-.942.942L9.044 9.98 6.19 12.826a.666.666 0 10.942.942l2.846-2.853 2.846 2.853a.666.666 0 10.942-.942z",transform:"translate(-2.017 -2.018)"}))))}),c=l.memo(function(){return l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},l.createElement("g",{transform:"translate(-1533 -39)"},l.createElement("g",{fill:"#fff",transform:"translate(-.358 -1.639)"},l.createElement("circle",{cx:"1.134",cy:"1.134",r:"1.134",transform:"rotate(180 771.246 22.823)"}),l.createElement("path",{d:"M1 0a1 1 0 00-1 1v5a1 1 0 002 0V1a1 1 0 00-1-1z",transform:"rotate(180 771.17 26.882)"}))))}),u=l.memo(function(){return l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},l.createElement("g",{transform:"rotate(180 774.5 27.5)"},l.createElement("g",{fill:"#fff",transform:"translate(-.358 -1.639)"},l.createElement("circle",{cx:"1.134",cy:"1.134",r:"1.134",transform:"rotate(180 771.246 22.823)"}),l.createElement("path",{d:"M1 0a1 1 0 00-1 1v5a1 1 0 002 0V1a1 1 0 00-1-1z",transform:"rotate(180 771.17 26.882)"}))))}),d=function(t){switch(t.type){case"error":return l.createElement(a,null);case"info":return l.createElement(c,null);case"warning":return l.createElement(u,null);default:return l.createElement(s,null)}};function f(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}f(":root {\n  --toast-default: #8b1dd0;\n  --toast-success: #27d0b2;\n  --toast-error: #c52965;\n  --toast-info: #004eff;\n  --toast-warning: #d0761d;\n  --toast-black: #221d26;\n  --toast-white: #ffffff;\n}\n\n.toast {\n  padding: 15px;\n  min-width: 300px;\n  max-width: 400px;\n  color: var(--toast-white);\n  display: flex;\n  align-items: flex-start;\n  line-height: 1.6;\n  font-size: 14px;\n  border-radius: 15px;\n}\n\n.toast.default {\n  background-color: var(--toast-default);\n}\n\n.toast.success {\n  background-color: var(--toast-success);\n}\n\n.toast.error {\n  background-color: var(--toast-error);\n}\n\n.toast.info {\n  background-color: var(--toast-info);\n}\n\n.toast.warning {\n  background-color: var(--toast-warning);\n}\n\n.toast .content {\n  flex: 1;\n}\n\n.toast .content p {\n  padding: 0;\n  margin: 0;\n}\n\n.toast .close {\n  margin-left: 10px;\n  width: 22px;\n  height: 22px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background-color: rgba(255, 255, 255, 0);\n  transition: all 100ms ease-in-out;\n  border-radius: 8px;\n  cursor: pointer;\n}\n\n.toast .close:hover {\n  background-color: rgba(255, 255, 255, 0.2);\n}\n\n.toast .icon {\n  margin-right: 10px;\n  width: 22px;\n  height: 22px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background-color: rgba(255, 255, 255, 0.2);\n  border-radius: 8px;\n}\n");var p=function(t){var e=t.id,n=t.content,r=t.type,o=t.config,i=(o=void 0===o?{}:o).backgroundColor,s=o.color,c=t.onClose;return l.createElement("div",{className:"toast "+r,style:{backgroundColor:i}},l.createElement("div",{className:"icon"},d({type:r})),l.createElement("div",{className:"content"},l.createElement("p",{style:{color:s}},n)),l.createElement("div",{className:"close",onClick:function(){return c(e)}},l.createElement(a,null)))};function v(){return(v=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var m={toasts:[]},h=function(t,e){switch(e.type){case"ADD":return v({},t,{toasts:[].concat(t.toasts,[e.toast])});case"REMOVE":return v({},t,{toasts:[].concat(t.toasts.filter(function(t){return t.id!==e.id}))});case"REMOVE_ALL":return v({},t,{toasts:[]});default:throw Error()}},g=function(){var t=(0,l.useReducer)(h,m),e=t[0],n=t[1];return v({},e,{dispatch:n})},w=(r=new Map,{on:function(t,e){r.has(t)||r.set(t,[]),r.get(t).push(e)},emit:function(t,e){r.has(t)&&r.get(t).forEach(function(t){return t(e)})},off:function(){r.clear()}}),x=function(t){var e=t.content,n=t.type,r=t.config;return{id:Math.random().toString(36).substr(2,10),content:e,type:n,config:r}};(o=i||(i={})).SHOW="show",o.HIDE="hide",o.HIDE_ALL="hideAll";var y=function(t){var e=t.dispatch,n=t.delay;w.on(i.SHOW,function(t){e({type:"ADD",toast:t}),n&&setTimeout(function(){e({type:"REMOVE",id:t.id})},n)}),w.on(i.HIDE,function(t){return e({type:"REMOVE",id:t})}),w.on(i.HIDE_ALL,function(){return e({type:"REMOVE_ALL"})})};f(".toastContainer {\n  overflow: hidden;\n  overflow-x: auto;\n  display: grid;\n  grid-gap: 20px;\n  position: fixed;\n  user-select: none;\n}\n\n.top-left {\n  top: 20px;\n  left: 20px;\n}\n\n.top-center {\n  top: 20px;\n  left: 50%;\n  transform: translate(-50%, 0);\n}\n\n.top-right {\n  top: 20px;\n  right: 20px;\n}\n\n.bottom-left {\n  bottom: 20px;\n  left: 20px;\n}\n\n.bottom-center {\n  bottom: 20px;\n  left: 50%;\n  transform: translate(-50%, 0);\n}\n\n.bottom-right {\n  bottom: 20px;\n  right: 20px;\n}\n");var j=function(t){var e=t.position,n=t.delay,r=g(),o=r.toasts,s=r.dispatch;(0,l.useEffect)(function(){return y({dispatch:s,delay:n}),function(){w.off()}},[s,n]);var a=(0,l.useCallback)(function(t){w.emit(i.HIDE,t)},[]);return l.createElement("div",{className:"toastContainer "+(void 0===e?"bottom-left":e)},o.map(function(t){return l.createElement(p,Object.assign({key:t.id},t,{onClose:a}))}))},E=function(t){var e=v({},t);return w.emit(i.SHOW,x(v({},e)))},b=function(t,e){return E({content:t,type:"default",config:e})};b.success=function(t,e){return E({content:t,type:"success",config:e})},b.error=function(t,e){return E({content:t,type:"error",config:e})},b.info=function(t,e){return E({content:t,type:"info",config:e})},b.warn=function(t,e){return E({content:t,type:"warning",config:e})},b.hideAll=function(){return w.emit(i.HIDE_ALL)}}},function(t){t.O(0,[5445,232,8159,133,5675,1664,4822,2192,1792,1840,2971,7546,7438,135,9089,2888,9774,179],function(){return t(t.s=95159)}),_N_E=t.O()}]);