1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9216],{18238:function(e,t,r){"use strict";var a,s=r(67294);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(null,arguments)}t.Z=function(e){return s.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),a||(a=s.createElement("path",{fill:"#2E3C2E",fillRule:"evenodd",d:"M.667 8a7.333 7.333 0 1 1 14.667 0A7.333 7.333 0 0 1 .667 8M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2m0 5.333c.369 0 .667.298.667.666v2.667a.667.667 0 1 1-1.333 0V7.999c0-.368.298-.666.666-.666m0-1.334a.667.667 0 1 0 0-1.333.667.667 0 0 0 0 1.333",clipRule:"evenodd"})))}},20640:function(e,t,r){"use strict";var a=r(11742),s={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var r,n,l,i,o,c,d,u,f=!1;t||(t={}),l=t.debug||!1;try{if(o=a(),c=document.createRange(),d=document.getSelection(),(u=document.createElement("span")).textContent=e,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",function(r){if(r.stopPropagation(),t.format){if(r.preventDefault(),void 0===r.clipboardData){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=s[t.format]||s.default;window.clipboardData.setData(a,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e)}t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))}),document.body.appendChild(u),c.selectNodeContents(u),d.addRange(c),!document.execCommand("copy"))throw Error("copy command was unsuccessful");f=!0}catch(a){l&&console.error("unable to copy using execCommand: ",a),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(a){l&&console.error("unable to copy using clipboardData: ",a),l&&console.error("falling back to prompt"),r="message"in t?t.message:"Copy to clipboard: #{key}, Enter",n=(/mac os x/i.test(navigator.userAgent)?"â":"Ctrl")+"+C",i=r.replace(/#{\s*key\s*}/g,n),window.prompt(i,e)}}finally{d&&("function"==typeof d.removeRange?d.removeRange(c):d.removeAllRanges()),u&&document.body.removeChild(u),o()}return f}},39940:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/elado/[slug]",function(){return r(79164)}])},17218:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});/** 2 * @license lucide-react v0.314.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */let a=(0,r(64370).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},19710:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});/** 7 * @license lucide-react v0.314.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */let a=(0,r(64370).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},44954:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});/** 12 * @license lucide-react v0.314.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */let a=(0,r(64370).Z)("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]])},26848:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});/** 17 * @license lucide-react v0.314.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */let a=(0,r(64370).Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},14671:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var a=r(20640),s=r.n(a),n=r(67294),l=function(e){void 0===e&&(e={});
21var t=(0,n.useState)(e),r=t[0],a=t[1];return[r,(0,n.useCallback)(function(e){a(function(t){return Object.assign({},t,e instanceof Function?e(t):e)})},[])]},i=function(){var e,t,r=(e=(0,n.useRef)(!1),t=(0,n.useCallback)(function(){return e.current},[]),(0,n.useEffect)(function(){return e.current=!0,function(){e.current=!1}},[]),t),a=l({value:void 0,error:void 0,noUserInteraction:!0}),i=a[0],o=a[1];return[i,(0,n.useCallback)(function(e){if(r())try{if("string"!=typeof e&&"number"!=typeof e){var t,a,n=Error("Cannot copy typeof "+typeof e+" to clipboard, must be a string");o({value:e,error:n,noUserInteraction:!0});return}if(""===e){var n=Error("Cannot copy empty string to clipboard.");o({value:e,error:n,noUserInteraction:!0});return}a=e.toString(),t=s()(a),o({value:a,error:void 0,noUserInteraction:t})}catch(e){o({value:a,error:e,noUserInteraction:t})}},[])]}},85057:function(e,t,r){"use strict";r.d(t,{Lu:function(){return w},Rc:function(){return v},yZ:function(){return y},zx:function(){return N}});var a=r(30202),s=r(10777),n=r(11163),l=r(67294),i=r(83153),o=r(70598),c=r(92214),d=r(2472),u=r(2809),f=r(40867),m=r(6815),p=r(30920);let x=async e=>{let t=(0,u.aF)("/product-offers",e),r=await c.h.get(t);return(0,d.JH)(r)},h=async e=>{if(!e.product_id)throw Error("No product id");let t=await c.h.get("/product-offers/product-filter",{params:e});return(0,d.JH)(t)},g=(e,t)=>{let{page:r,...a}=t,s={...a,page:r+1};if(e.prefetchQuery({queryKey:[...m.l.product_offers,s],queryFn:()=>x(s),staleTime:i.I_}),r>1){let t={...a,page:r-1};e.prefetchQuery({queryKey:[...m.l.product_offers,t],queryFn:()=>x(t),staleTime:i.I_})}},v=(e,t)=>{let r=(0,a.NL)();(null==t?void 0:t.disablePrefetch)||g(r,e);let n=(null==t?void 0:t.productIdToSearch)?()=>h({...e,product_id:t.productIdToSearch}):()=>x(e);return(0,s.a)({queryKey:[...m.l.product_offers,e],queryFn:n,initialData:null==t?void 0:t.initialData,staleTime:1e4,refetchOnMount:!0})},j=async e=>{if(!e)throw Error("No slug");let t=await c.h.get("/product-offers/".concat(e));return(0,d.JH)(t)},y=e=>(0,s.a)({queryKey:[...m.l.product_offers,{slug:e.slug}],queryFn:()=>j(e.slug),enabled:!!e.slug,initialData:{data:e},staleTime:1e4,refetchOnMount:!0}),b=()=>{let e=(0,o.M5)(),t=(0,f.H1)("name"),r=(0,f.H1)("all"),a=(0,f.H1)("skin_care"),s=(0,f.H1)("makeup"),n=(0,f.H1)("body_care");return{page:e,skin_care:a,makeup:s,body_care:n,spf:(0,f.H1)("spf"),perfumes:(0,f.H1)("perfumes"),others:(0,f.H1)("others"),all:r,name:t}},N=e=>{let t=(0,n.useRouter)(),{page:r,name:a,all:s,skin_care:l,makeup:i,body_care:o,spf:c,perfumes:d,others:u}=b(),f={page:r||1,"filter[search]":a||void 0,sort:"-created_at",per_page:18},m=Object.fromEntries([..."true"===l?[e.skin_care]:[],..."true"===i?[e.makeup]:[],..."true"===o?[e.body_care]:[],..."true"===c?[e.spf]:[],..."true"===d?[e.perfumes]:[],..."true"===u?[e.others]:[]].map((e,t)=>["filter[category][".concat(t,"]"),e]));return{query:v("true"===s?f:{...f,...m}),changePage:e=>{t.push({pathname:p._.marketplace,query:{page:e,name:a,all:s,skin_care:l,makeup:i,body_care:o,spf:c,perfumes:d,others:u}})}}},w=e=>{let{name:t,all:r,skin_care:a,makeup:s,body_care:n,spf:i,perfumes:o,others:c}=b();(0,l.useEffect)(()=>{e({name:t||"",all:"false"!==r,skin_care:"false"!==a,makeup:"false"!==s,body_care:"false"!==n,spf:"false"!==i,perfumes:"false"!==o,others:"false"!==c})},[e,t,r,a,s,n,i,o,c])}},53795:function(e,t,r){"use strict";r.d(t,{q:function(){return b},s:function(){return N}});var a=r(85893),s=r(6311),n=r(98964),l=r(97788),i=r(20052),o=r(87917),c=r(97358),d=r(85884),u=r(47042),f=r(49455),m=r(33839),p=r(82417),x=r(701),h=r(48755),g=r(15147),v=r(55716),j=r(93436),y=r(36524);let b=e=>{var t,r,m;let x=(0,l.ws)(),{t:b}=(0,s.$G)("common",{keyPrefix:"product_detail"}),{className:N,comment:w,setReplyTo:_,scrollToReplyForm:C}=e,{data:k}=(0,i.J1)(),O=(0,v.U)(null==k?void 0:k.data).getUserId(),z=(0,g.t)(w).belongsToUser(O),E=(0,v.U)(null==w?void 0:w.user).isMigrated(),D=(0,v.U)(null!==(r=w.user)&&void 0!==r?r:w.author).getUserTags(x),R=null===(t=w.comment)||void 0===t?void 0:t.split(" "),[q,S,P]=(0,n.EQ)(R).with(n.P.array(n.P.string),e=>{var t;let r=null!==(t=e.shift())&&void 0!==t?t:"",a=(null==r?void 0:r[0])==="@";return[r,e.join(" "),a]}).otherwise(()=>["","",!1]);return(0,a.jsxs)("div",{className:(0,h.cn)("mb-0.5 w-full rounded-md rounded-t-md bg-white p-4",N),children:[(0,a.jsxs)("div",{className:"mb-4 flex justify-between flex-col gap-2 md:flex-row",children:[(0,a.jsx)("div",{className:"flex gap-4",children:(0,a.jsx)(o.zG,{comment:w})}),(0,a.jsxs)("div",{className:"flex flex-col items-start gap-2 md:items-end",children:[(0,a.jsxs)("span",{className:"flex gap-2 text-xs text-forest-green-500/40",children:[(0,j.nQ)(w.created_at),(0,a.jsx)(d.q,{children:z&&e.item?(0,a.jsx)(u.G,{comment:w,item:e.item}):null})]}),(0,a.jsxs)("div",{className:"overflow-hidden",children:[(0,a.jsx)(c.$,{tags:D,isUserMigrated:E,type:"comment"}),(0,a.jsx)(f.Q,{user:null!==(m=w.author)&&void 0!==m?m:w.user})]})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:justify-between",children:[(0,a.jsxs)("p",{className:"text text-sm",children:[(0,a.jsxs)("span",{className:(0,h.cn)(P&&"font-bold"),children:[q," "]}),S]}),(0,a.jsxs)("div",{className:"flex gap-1",children:[!e.noReply&&(0,a.jsx)(p.zx,{variant:"outline",className:"h-8 text-sm font-medium text-forest-green-500",onClick:()=>{var t,r;e.parentComment&&(null==_||_(e.parentComment)),null==C||C();let a=null===(t=w.user)||void 0===t?void 0:t.username;null!=a&&""!==a&&null!=e.form&&e.form.setValue("text","@"+(null===(r=w.user)||void 0===r?void 0:r.username)+" ")},children:b("reply_button","Reply")}),null!=w.id?(0,a.jsx)(y.u,{commentId:w.id}):null]})]})]})},N=()=>(0,a.jsxs)("div",{className:"mb-0.5 w-full rounded-md rounded-t-md bg-white p-4",children:[(0,a.jsxs)("div",{className:"mb-4 flex justify-between",children:[(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,a.jsx)(x.O,{className:"size-6 rounded-full md:h-10 md:w-10"}),(0,a.jsx)(x.O,{className:"h-3 w-24 md:h-4"})]}),(0,a.jsx)(x.O,{className:"h-4 w-24"})]}),(0,a.jsx)(m.L,{size:4}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-1 flex-col gap-1.5 md:justify-between",children:[(0,a.jsx)(x.O,{className:"h-4 w-full"}),(0,a.jsx)(x.O,{className:"h-4 w-full"}),(0,a.jsx)(x.O,{className:"h-4 w-2/3"})]}),(0,a.jsx)("div",{children:(0,a.jsx)(x.O,{className:"h-8 w-24"})})]})]})},11671:function(e,t,r){"use strict";r.d(t,{I:function(){return l}});var a=r(5152),s=r.n(a),n=r(79209);let l=s()(()=>Promise.all([r.e(9707),r.e(4647),r.e(8665)]).then(r.bind(r,11116)).then(e=>e.ImagePopover),{loadableGenerated:{webpack:()=>[11116]},ssr:!1,loading:n.c0})},76006:function(e,t,r){"use strict";r.d(t,{f:function(){return o}});var a=r(85893),s=r(66261),n=r(24071),l=r(68894),i=r(48755);let o=e=>{let{changePage:t,forcePage:r,pageCount:o}=e,c=()=>{null!=e.scrollTo&&s.OK.scrollTo(e.scrollTo,{duration:500,smooth:"easeInOutQuint",offset:-100})},d=e=>{t(e+1),c()},u=[r-1,r,r+1].map(e=>e+1).filter(e=>e>=1&&e<=o);if(2===r&&u.unshift(1),r===o-3&&u.push(o),o<=1)return null;let f=l.gs?"bg-primary-500":"bg-cz-red-300 text-white";return(0,a.jsx)(n.tl,{children:(0,a.jsxs)(n.ng,{children:[(0,a.jsx)(n.kO,{onClick:()=>{0!==r&&(t(1),c())},"aria-disabled":0===r,className:(0,i.cn)(0===r&&"opacity-40 pointer-events-none")}),(0,a.jsx)(n.dN,{onClick:()=>{0!==r&&(t(r),c())},"aria-disabled":0===r,className:(0,i.cn)(0===r&&"opacity-40 pointer-events-none")}),o>5&&r>2&&(0,a.jsx)(n.Dj,{}),u.map(e=>(0,a.jsx)(n.nt,{className:e===r+1?f:"",onClick:()=>d(e-1),children:e},e)),o>5&&r<o-3&&(0,a.jsx)(n.Dj,{}),(0,a.jsx)(n.$0,{onClick:()=>{r!==o-1&&(t(r+2),c())},"aria-disabled":r===o-1,className:(0,i.cn)(r===o-1&&"opacity-40 pointer-events-none")}),(0,a.jsx)(n.Zv,{onClick:()=>{r!==o-1&&(t(o),c())},"aria-disabled":r===o-1,className:(0,i.cn)(r===o-1&&"opacity-40 pointer-events-none")})]})})}},16575:function(e,t,r){"use strict";r.d(t,{U:function(){return d}});var a=r(85893),s=r(41664),n=r.n(s),l=r(11163),i=r(24071),o=r(68894),c=r(48755);let d=e=>{let t=(0,l.useRouter)(),{forcePage:r,pageCount:s,baseRoute:d}=e,u=[r-1,r,r+1].map(e=>e+1).filter(e=>e>=1&&e<=s),f=s>5&&r<s-3,m=s>5&&r>2;return(2===r&&u.unshift(1),r===s-3&&u.push(s),s<=1)?null:(0,a.jsx)(i.tl,{children:(0,a.jsxs)(i.ng,{children:[(0,a.jsx)(n(),{href:{pathname:null!=d?d:t.pathname,query:{...t.query,page:1}}
21,"aria-disabled":0===r,className:(0,c.cn)(0===r&&"pointer-events-none"),children:(0,a.jsx)(i.kO,{className:(0,c.cn)(0===r&&"opacity-40")})}),(0,a.jsx)(n(),{href:{pathname:null!=d?d:t.pathname,query:{...t.query,page:r}},"aria-disabled":0===r,className:(0,c.cn)(0===r&&"pointer-events-none"),children:(0,a.jsx)(i.dN,{className:(0,c.cn)(0===r&&"opacity-40")})}),m&&(0,a.jsx)(i.Dj,{}),u.map(e=>(0,a.jsx)(n(),{href:{pathname:null!=d?d:t.pathname,query:{...t.query,page:e}},children:(0,a.jsx)(i.nt,{className:e===r+1?o.gs?"bg-primary-500":"bg-cz-red-300 text-white":"",children:e})},e)),f&&(0,a.jsx)(i.Dj,{}),(0,a.jsx)(n(),{href:{pathname:null!=d?d:t.pathname,query:{...t.query,page:r+2}},"aria-disabled":r===s-1,className:(0,c.cn)(r===s-1&&"pointer-events-none"),children:(0,a.jsx)(i.$0,{className:(0,c.cn)(r===s-1&&"opacity-40")})}),(0,a.jsx)(n(),{href:{pathname:null!=d?d:t.pathname,query:{...t.query,page:s}},"aria-disabled":r===s-1,className:(0,c.cn)(r===s-1&&"pointer-events-none"),children:(0,a.jsx)(i.Zv,{className:(0,c.cn)(r===s-1&&"opacity-40")})})]})})}},11609:function(e,t,r){"use strict";r.d(t,{O:function(){return l}});var a=r(85893),s=r(61027),n=r(30920);let l=e=>{let{tags:t,secondaryTags:r}=e;if(!((null==t?void 0:t.length)||(null==r?void 0:r.length)))return null;let l=n._.productCategories;return(0,a.jsxs)("div",{className:"flex flex-col gap-2 ",children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:null==t?void 0:t.map(e=>(0,a.jsx)(s.Ct,{variant:"profile",href:"".concat(l,"/").concat(e.slug,"?utm_source=").concat("product-page"),children:e.name},e.name))}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:null==r?void 0:r.map(e=>(0,a.jsx)(s.Ct,{variant:"profile",children:e},e))})]})}},45670:function(e,t,r){"use strict";r.d(t,{o:function(){return a}});let a=r(57178).f},21064:function(e,t,r){"use strict";r.d(t,{Ol:function(){return o},Zb:function(){return i},aY:function(){return c},eW:function(){return d}});var a=r(85893),s=r(67294),n=r(68894),l=r(48755);let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("bg-card text-card-foreground rounded-md border shadow-sm",r),...s})});i.displayName="Card";let o=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5",r),...s})});o.displayName="CardHeader",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",!n.gs&&"font-mango",r),...s})}).displayName="CardTitle",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("p",{ref:t,className:(0,l.cn)("text-muted-foreground text-sm",r),...s})}).displayName="CardDescription";let c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("",r),...s})});c.displayName="CardContent";let d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,l.cn)("flex items-center",r),...s})});d.displayName="CardFooter"},24071:function(e,t,r){"use strict";r.d(t,{tl:function(){return h},ng:function(){return g},Dj:function(){return w},kO:function(){return y},nt:function(){return v},Zv:function(){return N},$0:function(){return b},dN:function(){return j}});var a,s,n=r(85893),l=r(47553),i=r(20245),o=r(18534),c=(r(41664),r(67294)),d=(r(82417),r(68894));function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(null,arguments)}var f=function(e){return c.createElement("svg",u({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),a||(a=c.createElement("path",{stroke:"#2E3C2E",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m11 17-5-5 5-5M18 17l-5-5 5-5"})))};function m(){return(m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(null,arguments)}var p=function(e){return c.createElement("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),s||(s=c.createElement("path",{stroke:"#2E3C2E",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m13 17 5-5-5-5M6 17l5-5-5-5"})))},x=r(48755);let h=e=>{let{className:t,...r}=e;return(0,n.jsx)("nav",{role:"navigation","aria-label":"pagination",className:(0,x.cn)("mx-auto flex w-full justify-center",t),...r})},g=c.forwardRef((e,t)=>
21{let{className:r,...a}=e;return(0,n.jsx)("ul",{ref:t,className:(0,x.cn)("flex flex-row items-center gap-1 xs:gap-2 lg:gap-4",r),...a})});g.displayName="PaginationContent";let v=c.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("li",{ref:t,className:(0,x.cn)("flex min-h-8 min-w-8 cursor-pointer items-center justify-center rounded-full bg-white px-1 hover:bg-primary-500",!d.gs&&"hover:bg-cz-red-300 hover:text-white",r),...a})});v.displayName="PaginationItem";let j=e=>{let{className:t,...r}=e;return(0,n.jsx)(v,{"aria-label":"Go to previous page",className:(0,x.cn)(t),...r,children:(0,n.jsx)(l.Z,{className:"size-6 text-forest-green-500"})})};j.displayName="PaginationPrevious";let y=e=>{let{className:t,...r}=e;return(0,n.jsx)(v,{"aria-label":"Go to first page",className:(0,x.cn)(t),...r,children:(0,n.jsx)(f,{className:"size-6 text-forest-green-500"})})};y.displayName="PaginationFirst";let b=e=>{let{className:t,...r}=e;return(0,n.jsx)(v,{"aria-label":"Go to next page",className:(0,x.cn)(t),...r,children:(0,n.jsx)(i.Z,{className:"size-6 text-forest-green-500"})})},N=e=>{let{className:t,...r}=e;return(0,n.jsx)(v,{"aria-label":"Go to last page",className:(0,x.cn)(t),...r,children:(0,n.jsx)(p,{className:"size-6 text-forest-green-500"})})},w=e=>{let{className:t,...r}=e;return(0,n.jsxs)("span",{"aria-hidden":!0,className:(0,x.cn)("flex size-9 items-center justify-center",t),...r,children:[(0,n.jsx)(o.Z,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"More pages"})]})}},42890:function(e,t,r){"use strict";r.d(t,{Bw:function(){return p},DI:function(){return u},Ph:function(){return d},Ql:function(){return x},i4:function(){return m},ki:function(){return f}});var a=r(85893),s=r(7678),n=r(51568),l=r(3785),i=r(67294),o=r(68894),c=r(48755);let d=s.fC,u=s.ZA,f=s.B4,m=i.forwardRef((e,t)=>{let{className:r,children:l,...i}=e;return(0,a.jsxs)(s.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-forest-green-500 bg-white px-3 py-2 text-sm placeholder:text-forest-green-200 outline-none aria-expanded:outline-2 aria-expanded:outline-bg-darker disabled:cursor-not-allowed disabled:opacity-50",!o.gs&&"aria-expanded:outline-0",r),...i,children:[l,(0,a.jsx)(s.JO,{asChild:!0,children:(0,a.jsx)(n.Z,{className:"std-icon"})})]})});m.displayName=s.xz.displayName;let p=i.forwardRef((e,t)=>{let{className:r,children:n,position:l="popper",...i}=e;return(0,a.jsx)(s.h_,{children:(0,a.jsx)(s.VY,{ref:t,className:(0,c.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-background text-forest-green-500 shadow-md max-h-[var(--radix-popper-available-height)]","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",!o.gs&&"bg-bg-cz",r),position:l,...i,children:(0,a.jsx)(s.l_,{className:(0,c.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})})});p.displayName=s.VY.displayName,i.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,a.jsx)(s.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",r),...n})}).displayName=s.__.displayName;let x=i.forwardRef((e,t)=>{let{className:r,children:n,...i}=e;return(0,a.jsxs)(s.ck,{ref:t,className:(0,c.cn)("relative hover:cursor-pointer hover:bg-bg-darker focus:bg-bg-darkerflex w-full cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none focus:text-forest-green-500 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",!o.gs&&"hover:bg-cz-gray-300 hover:text-white focus:text-white focus:bg-cz-gray-300",r),...i,children:[(0,a.jsx)("span",{className:"absolute left-2 top-1/2 flex h-3.5 w-3.5 -translate-y-1/2 items-center justify-center",children:(0,a.jsx)(s.wU,{children:(0,a.jsx)(l.Z,{className:"size-4"})})}),(0,a.jsx)(s.eT,{children:n})]})});x.displayName=s.ck.displayName,i.forwardRef((e,t)=>
21{let{className:r,...n}=e;return(0,a.jsx)(s.Z0,{ref:t,className:(0,c.cn)("bg-muted -mx-1 my-1 h-px",r),...n})}).displayName=s.Z0.displayName},28105:function(e,t,r){"use strict";r.d(t,{Ce:function(){return c},_v:function(){return u},aJ:function(){return d},pn:function(){return i},u:function(){return o}});var a=r(85893),s=r(82590),n=r(67294),l=r(48755);let i=s.zt,o=s.fC,c=s.Eh,d=n.forwardRef((e,t)=>(0,a.jsx)(s.xz,{ref:t,type:"button",...e}));d.displayName=s.xz.displayName;let u=n.forwardRef((e,t)=>{let{className:r,sideOffset:n=4,...i}=e;return(0,a.jsx)(s.VY,{ref:t,sideOffset:n,className:(0,l.cn)("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md",r),...i})});u.displayName=s.VY.displayName},84151:function(e,t,r){"use strict";r.d(t,{x:function(){return c}});var a=r(85893),s=r(41664),n=r.n(s),l=r(52066),i=r(48755),o=r(55716);let c=e=>{let{user:t,className:r}=e;if(!t)return null;let s=(0,o.U)(t).getProfileUrl(),c=(0,o.U)(t).isMigrated();return(0,a.jsx)(n(),{href:s,className:(0,i.cn)(c&&"pointer-events-none"),"aria-disabled":c,children:(0,a.jsxs)("div",{className:(0,i.cn)("flex items-center gap-2 px-2 py-1",r),children:[e.noImage||c?null:(0,a.jsx)(l.nZ,{user:t}),(0,a.jsx)("p",{className:(0,i.cn)("text-sm font-medium text-forest-green-500",e.paragraphClassName),children:t.username})]})})}},73138:function(e,t,r){"use strict";r.d(t,{B:function(){return i},V:function(){return o}});var a=r(85893),s=r(11163),n=r(76006),l=r(16575);function i(e,t,r,i){var o,c;let d=null!==(o=null==e?void 0:e.per_page)&&void 0!==o?o:0,u=Math.min(null!==(c=null==e?void 0:e.last_page)&&void 0!==c?c:0,Math.floor(1e4/d)),f=(0,s.useRouter)(),m=null==e?void 0:e.current_page;return m&&t?r?(0,a.jsx)(l.U,{forcePage:m-1,pageCount:u,baseRoute:i}):(0,a.jsx)(n.f,{forcePage:m-1,changePage:e=>{f.push({pathname:null!=i?i:f.pathname,query:{...f.query,page:e}})},pageCount:u}):null}function o(e,t,r,s,l){var i,o,c;let d=null!==(i=null==r?void 0:r.per_page)&&void 0!==i?i:0,u=null!==(o=null==r?void 0:r.last_page)&&void 0!==o?o:0,f=null!==(c=null==r?void 0:r.total)&&void 0!==c?c:0;return(null==r?void 0:r.current_page)&&s&&0!==f?(0,a.jsx)(n.f,{forcePage:e-1,changePage:t,pageCount:Math.min(u,Math.floor(1e4/d)),scrollTo:l}):null}},79164:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return eH},default:function(){return eK}});var a=r(85893),s=r(11163),n=r(75652),l=r(20052),i=r(72984),o=r(69485),c=r(69617),d=r(99384),u=r(24511),f=r(7978),m=r(85057),p=r(11671),x=r(11609),h=r(61027);let g=()=>(0,a.jsx)("div",{className:"flex flex-col items-start gap-3 md:hidden",children:(0,a.jsx)(h.Ct,{bgColor:"beige",children:"New"})});var v=r(74755),j=r(48755);let y=e=>{let{data:t,title:r,className:s}=e;return(0,a.jsxs)("div",{className:(0,j.cn)("flex items-center justify-between border-b border-forest-green-200 py-4",s),children:[(0,a.jsx)("p",{className:"text-sm font-medium text-forest-green-300",children:r}),(0,a.jsx)("p",{className:"text-sm font-medium text-forest-green-500 text-end",children:t})]})},b=e=>{let{data:t,title:r,className:s}=e;return(0,a.jsxs)("div",{className:(0,j.cn)("flex items-center justify-between border-b border-forest-green-200 py-4",s),children:[(0,a.jsx)("p",{className:"text-sm font-medium text-forest-green-300",children:r}),t]})};var N=r(85457),w=r(84151),_=r(43524),C=r(18974);let k=e=>{let{user:t}=e;if(!t)return null;let r=(null==t?void 0:t.rating)!=null?Math.round(100*t.rating)/100:void 0;return(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(w.x,{className:"p-0",user:t,noImage:!0,paragraphClassName:"underline"}),(0,a.jsx)(O,{stars:r,numberOfSales:t.sales})]})},O=e=>{let{stars:t,numberOfSales:r}=e,{t:s}=(0,C.LD)("marketplace.product_offer");return null==t&&null==r?null:(0,a.jsxs)(a.Fragment,{children:[null!=t&&(0,a.jsxs)("div",{className:"flex items-center gap-2 border-l border-badge-beige pl-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-forest-green-500",children:t}),(0,a.jsx)(_.T,{stars:t})]}),null!=r&&(0,a.jsx)("div",{className:"border-l border-badge-beige pl-2",children:(0,a.jsx)("p",{className:"text-sm font-medium text-forest-green-500",children:s("number_of_sales",{count:r})})})]})};var z=r(93436);let E=e=>{let{t}=(0,C.LD)("marketplace.product_offer"),{productOffer:r}=e,s=(0,z.cQ)(r.expire_at),n=(0,z.cQ)(r.purchased_at),l=(0,z.cQ)(r.created_at);return(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(N.w,{size:"h2",children:r.name}),(null==r?void 0:r.size)!=null&&(0,a.jsx)("p",{className:"text-sm text-forest-green-400",children:r.size})]}),(0,a.jsx)(v.M,{description:r.description,maxLines:3,contentClassName:"space-y-2",alwaysShowButton:!0}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"lg:hidden",children:(0,a.jsx)(b,{title:t("seller","Seller"),data:(0,a.jsx)(w.x,{className:"p-0",user:r.created_by,noImage:!0,paragraphClassName:"underline"})})}),(0,a.jsx)("div",{className:"hidden lg:block",children:(0,a.jsx)(b,{title:t("seller","Seller"),data:(0,a.jsx)(k,{user:r.created_by})})}),(0,a.jsxs)("div",{className:"flex w-full flex-col xl:flex-row xl:justify-between xl:gap-10",children:[(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)(y,{title:t("delivery","Delivery"),data:r.shipping_payment}),(0,a.jsx)(y,{title:t("uploaded_at","Uploaded"),data:l}),(0,a.jsx)(y,{title:t("condition","Condition"),data:r.used})]}),null!=n||null!=s?(0,a.jsxs)("div",{className:"w-full",children:[null!=n&&(0,a.jsx)(y,{title:t("date_of_purchase","Date of purchase"),data:n}),null!=s&&(0,a.jsx)(y,{title:t("date_of_expiry","Date of expiry"),data:s})]}):null]})]})]})};var D=r(26030),R=r(6311),q=r(41664),S=r.n(q),P=r(91444),Z=r(98964),T=r(30202),U=r(98029),A=r(98807),M=r(82583),I=r(92214),L=r(2472),H=r(6815),K=r(30920);let V=async e=>{if(!e)throw Error("No product offer uuid");if(!await (0,A.getAccessToken)())throw Error("No token");let t=await I.h.get("/product-offers/".concat(e,"/reserve"));return(0,L.JH)(t)},B=async e=>{if(!await (0,A.getAccessToken)())throw Error("No token");let{buyerUuid:t,offerUuid:r,accept:a}=e,s=await I.h.get("/product-offers/".concat(r,"/").concat(a?"confirm-reservation":"decline-reservation","/").concat(t));return(0,L.JH)(s)},F=(e,t)=>{let r=(0,s.useRouter)(),a=(0,T.NL)();return(0,U.D)({mutationFn:B,onSuccess:()=>{a.invalidateQueries({queryKey:[...H.l.product_offers,{slug:e}]}),null==t||t()},onError:e=>{let t=(0,L.e$)(e),a=e.message.toLowerCase();"no token"===a?r.push({pathname:K._.signin,query:{next:r.asPath}}):"unauthenticated"===a?P.Am.error("You are not authorized to do this action"):P.Am.error(null==t?void 0:t.message)}})};var Q=r(26848);let G=e=>{let{title:t,description:r}=e;return(0,a.jsxs)("div",{className:"rounded-md bg-sunset-yellow-100 p-4",children:[""!==t&&(0,a.jsxs)("div",{className:"mb-4 flex items-start gap-2 md:gap-4",children:[(0,a.jsx)(Q.Z,{}),(0,a.jsx)(N.w,{size:"h4",children:t})]}),(0,a.jsx)("p",{className:"text-sm text-forest-green-400",children:r})]})};var J=r(28154),W=r(12378);let $=e=>{let{children:t,trigger:r,closeModal:s,openModal:n,isOpen:l}=e;return(0,a.jsxs)(W.Vq,{modal:!0,open:l,children:[(0,a.jsx)(W.hg,{asChild:!0,onClick:n,children:r}),(0,a.jsxs)(W.cZ,{className:"fixed h-auto max-h-screen max-w-[650px] -translate-x-1/2 -translate-y-1/2 overflow-y-auto bg-white md:max-h-[90vh]",
21withCloseBtn:!1,children:[(0,a.jsx)("button",{className:"absolute right-4 top-4",onClick:s,children:(0,a.jsx)(J.Z,{})}),t]})]})};var Y=r(82417),X=r(701),ee=r(40180),et=r(13880),er=r(56312),ea=r(44954),es=r(87536),en=r(1604),el=r(98493);let ei=async e=>{if(!e.product_offer_id)throw Error("Product offer id is required");await (0,el.S)();let t=await I.h.post("/report/product-offer",e);return(0,L.JH)(t)},eo=()=>{let{t:e}=(0,C.LD)("Marketplace.report");return(0,U.D)({mutationFn:ei,onSuccess:()=>{P.Am.success(e("report_success_toast"))},onError:L.pE})};var ec=r(60546),ed=r(10996),eu=r(23494),ef=r(2809);let em=e=>{let{productOffer:t}=e,{t:r}=(0,C.LD)("Marketplace.report"),{closeModal:s,setIsOpen:n,isOpen:i}=(0,et.E)(),o=(0,l.O1)(t),c=eo(),d=en.z.object({description:en.z.string({required_error:r("description_required","Description is required")}).min(1)}),u=(0,es.cI)({mode:"onBlur",resolver:(0,er.F)(d),defaultValues:{description:""}});if(o)return null;let f=u.formState.isValid;return(0,a.jsxs)(ec.aR,{open:i,onOpenChange:n,children:[(0,a.jsx)(ec.vW,{className:"flex size-12 items-center justify-center rounded-full bg-error-100",children:(0,a.jsx)(ea.Z,{className:"size-5 text-error-400"})}),(0,a.jsxs)(ec._T,{className:"sm:max-w-[26.75rem]",children:[(0,a.jsx)(ec.CI,{}),(0,a.jsx)(ec.f$,{children:(0,a.jsx)(N.w,{size:"h2",children:r("report_item_title","Suspicious product for sale")})}),(0,a.jsx)(ec.yT,{className:"text-lg text-forest-green-500",children:r("report_item_description","Please explain what you think is the problem with the product (e.g. it is not uploaded to the right data sheet, it is not a real product, etc.). We treat the identity of the whistleblower confidentiality.")}),(0,a.jsx)(ed.l0,{...u,children:(0,a.jsxs)("form",{className:"mt-2 flex flex-col",onSubmit:u.handleSubmit(e=>{(0,ef.s4)(e,t),c.mutate({product_offer_id:t.id,description:e.description}),s(),u.reset({description:""})}),children:[(0,a.jsx)(ed.Wi,{control:u.control,name:"description",render:e=>{let{field:t}=e;return(0,a.jsxs)(ed.xJ,{className:"flex flex-col",children:[(0,a.jsx)(ed.lX,{className:"text-sm font-medium text-forest-green-500",children:r("description_label","Description")}),(0,a.jsx)(eu.K,{value:t.value,onChange:t.onChange,className:"h-[11rem] rounded-md bg-white px-3 py-2 text-base placeholder:font-light",placeholder:r("description_placeholder","Write a description of the error.")}),(0,a.jsx)(ed.zG,{})]})}}),(0,a.jsxs)(ec.xo,{children:[(0,a.jsx)(ec.le,{className:"w-full",asChild:!0,children:(0,a.jsx)(Y.zx,{variant:"outline",className:"w-full",type:"button",children:r("cancel_button","Cancel")})}),(0,a.jsx)(Y.zx,{type:"submit",className:"w-full",disabled:!f,children:r("submit_button","Report")})]})]})})]})]})};var ep=r(54676),ex=r(79421),eh=r(24218),eg=r(602);let ev=e=>{let t=(0,l.O1)(e.productOffer),r=e.productOffer.status===ex.R;return t&&r?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(eh.E,{type:"edit",triggerElement:(0,a.jsx)(Y.zx,{variant:"ghost",className:"size-12 shrink-0 rounded-full bg-forest-green-100 p-0",children:(0,a.jsx)(ep.Z,{className:"size-5"})}),productOffer:e.productOffer}),(0,a.jsx)(eg.v,{productOffer:e.productOffer})]}):null},ej=e=>{var t;let{t:r}=(0,C.LD)("marketplace"),{data:s}=(0,m.yZ)(e.productOffer),n=null==s?void 0:s.data,l=(0,f.A)(e.productOffer.product).getProductUrl(),i=null!==(t=null==n?void 0:n.status)&&void 0!==t?t:e.productOffer.status,o="RESERVED"===i;return(0,a.jsxs)("div",{className:"flex w-full flex-col gap-4 md:w-auto",children:[(0,a.jsx)(ey,{productOffer:e.productOffer}),(0,a.jsxs)("div",{className:"flex flex-col items-start gap-6 xl:flex-row xl:justify-between",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 xl:flex-row",children:[(0,a.jsx)(eN,{productOffer:e.productOffer,isReserved:o,isClosed:"CLOSED"===i}),(0,a.jsx)(Y.zx,{variant:"outline",asChild:!0,className:"px-8",children:(0,a.jsx)(S(),{href:l,rel:(0,f.A)(e.productOffer.product).getProductUrlRel(),target:(0,f.A)(e.productOffer.product).getProductUrlTarget(),onClick:(0,f.A)(e.productOffer.product).openInternalUrl,children:r("show_product_button","Show product page")})})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(ev,{productOffer:e.productOffer,isReserved:o}),(0,a.jsx)(em,{productOffer:e.productOffer})]})]})]})},ey=e=>{let{t}=(0,C.LD)("marketplace.product_offer"),{data:r,isLoading:s}=(0,m.yZ)(e.productOffer),n=null==r?void 0:r.data;return s?(0,a.jsx)(X.O,{className:"h-9 w-32"}):(0,a.jsx)(N.w,{size:"h2",children:t("price_label",{price:null==n?void 0:n.price})})},eb=e=>{var t,r;let{closeModal:s,productOffer:n}=e,{t:i}=(0,C.LD)("marketplace.product_offer"),o=function(e){let{t}=(0,C.LD)("marketplace.product_offer"),r=(0,l.J1)(),a=null==e?void 0:e.slug,s=(0,T.NL)();return(0,U.D)({mutationFn:V,onSuccess:()=>{var n,l,i,o,c,d;s.invalidateQueries({queryKey:[...H.l.product_offers,{slug:a}]}),(0,M.BX)("marketplace_purchase_item",{user_id:null===(n=r.data)||void 0===n?void 0:n.data.id,currency:"HUF",value:null==e?void 0:e.price,transaction_id:null==e?void 0:null===(l=e.id)||void 0===l?void 0:l.toString(),ecommerce:{items:[{item_id:null==e?void 0:e.id,item_name:null==e?void 0:e.name,price:null==e?void 0:e.price,item_brand:null==e?void 0:null===(o=e.product)||void 0===o?void 0:null===(i=o.brand)||void 0===i?void 0:i.title,quantity:1,item_category:(0,f.A)(null==e?void 0:e.product).getProductCategoryName(),seller_id:null==e?void 0:null===(c=e.created_by)||void 0===c?void 0:c.id,seller_name:null==e?void 0:null===(d=e.created_by)||void 0===d?void 0:d.username}]}}),P.Am.success(t("reserve_toast_message","Product is reserved!"))},onError:L.pE})}(n),c=(0,z.cQ)(null==n?void 0:n.expire_at),d=(0,z.cQ)(null==n?void 0:n.purchased_at);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-6 flex flex-col gap-8",children:[(0,a.jsx)(N.w,{size:"h4",children:i("order_confirmation","Order confirmation")}),(0,a.jsx)(N.w,{size:"h2",children:n.name})]}),(0,a.jsxs)("div",{className:"mb-4 flex flex-col",children:[(0,a.jsx)(y,{title:i("size","Size"),data:null!==(r=n.size)&&void 0!==r?r:"-"}),(0,a.jsx)(y,{title:i("date_of_purchase","Date of purchase"),data:null!=d?d:"-"}),(0,a.jsx)(y,{title:i("date_of_expiry","Date of expiry"),data:null!=c?c:"-"}),(0,a.jsx)(y,{title:i("seller","Seller"),data:null===(t=n.created_by)||void 0===t?void 0:t.username}),(0,a.jsx)(y,{title:i("price","Price"),data:(0,a.jsx)("span",{className:"font-bold",children:n.price})}),(0,a.jsx)(y,{title:i("condition","Condition"),data:null==n?void 0:n.used})]}),(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 md:mb-8",children:[(0,a.jsx)(G,{title:i("info_box_1_title","Attention, buying and selling takes place in a NEW way!"),description:i("info_box_1_description","From now on, not only buyers can choose the seller, but also vice versa. The sellers can still reject the sale after indicating your intention to buy! (On the other hand, you cannot change your mind after pressing this button, so only press it if you really want to buy the product.)")}),(0,a.jsx)(G,{title:i("info_box_2_title","What happens after pressing the buy button?"),description:i("info_box_2_description","After pressing the button, the product will be reserved and we will send an email to the seller that you would like to buy their product. The seller can then decide whether to approve the sale or not. Whatever the seller decides, you will receive an email from Kr\xe9mmania about the result. If the sale is also OK from the seller's side, you can discuss the details of the sale directly with each other's email address. After the purchase is made, there will be a reminder on your profile to rate the purchase and the seller. Thank y
21ou for your help. :)")}),(0,a.jsx)("div",{className:"rounded-md bg-sunset-yellow-100 p-4",children:(0,a.jsx)("p",{className:"text-sm text-forest-green-400",children:(0,a.jsx)(R.cC,{t:i,i18nKey:"info_box_3_description",defaultValue:"Kr\xe9mm\xe1nia is not responsible for the quality, safety and legal compliance of the products advertised on the site and undertakes no obligation to check these products. Furthermore, Kr\xe9mm\xe1nia is not responsible for the authenticity of the products advertised for sale on the site, or for the fact that buyers can actually buy and sellers can actually sell the products, and cannot ensure that users can finalize the transaction between themselves. Kr\xe9mmania excludes all other claims for compensation, whether direct or indirect <0>You can find the full ASZF</0> for Kr\xe9mman\xedas sales and purchases here.",components:[(0,a.jsx)("a",{className:"text-button-blue underline",href:"https://kremmania.hu/piacteraszf",target:"_blank",rel:"noreferrer"},0)]})})})]}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)(Y.zx,{variant:"outline",className:"w-full",onClick:s,children:i("cancel_button","Cancel")}),(0,a.jsx)(Y.zx,{variant:"primary",className:"w-full",onClick:()=>{o.mutate(n.uuid),s()},children:i("confirm_button","Confirm")})]})]})},eN=e=>{let{t}=(0,C.LD)("marketplace.product_offer"),r=(0,l.O1)(e.productOffer),{isOpen:s,openModal:n,closeModal:i}=(0,et.E)(),{signinUrl:o,isSuccess:c,isLoading:d}=(0,ee.kC)(s);if(e.isReserved||e.isClosed){let{text:r,toastText:s}=(0,Z.EQ)(!!e.isReserved).with(!0,()=>({text:t("reserved","Reserved"),toastText:t("toast_already_closed","This transaction is closed.")})).with(!1,()=>({text:t("closed","Closed"),toastText:t("toast_already_closed","This transaction is closed.")})).exhaustive();return(0,a.jsx)(Y.zx,{variant:"secondary",className:"gap-1 px-8",onClick:()=>{P.Am.error(s)},children:(0,a.jsx)("p",{children:r})})}return r?null:d?(0,a.jsxs)(Y.KA,{className:"flex gap-1 bg-success-400 px-8 text-white hover:bg-success-500",children:[(0,a.jsx)(D.Z,{className:"animate-spin"}),(0,a.jsx)("p",{children:t("buy_from_seller","Buy from seller")})]}):c?(0,a.jsx)($,{closeModal:i,openModal:n,isOpen:s,trigger:(0,a.jsx)(Y.zx,{className:"w-full bg-success-400 px-12 text-white hover:bg-success-500 md:w-auto",children:t("buy_from_seller","Buy from seller")}),children:(0,a.jsx)(eb,{closeModal:i,productOffer:e.productOffer})}):(0,a.jsx)(Y.zx,{asChild:!0,className:"bg-success-400 px-12 text-white hover:bg-success-500",children:(0,a.jsx)(S(),{href:o,children:t("buy_from_seller","Buy from seller")})})};var ew=r(43124),e_=r(40867);function eC(){let e=(0,s.useRouter)();return()=>{e.replace({pathname:e.pathname,query:{...e.query,accepted:void 0,user:void 0,offer:void 0}})}}let ek=e=>{let{productOffer:t}=e,r=eC(),s=(0,e_.H1)("accepted"),n=(0,e_.H1)("user"),l=(0,e_.H1)("offer"),{isOpen:i,openModal:o,setIsOpen:c}=(0,et.E)(),d=F(t.slug,()=>{o(),r()});return(0,e_.US)("1"===s&&null!=n&&null!=l,()=>{null!=n&&null!=l&&d.mutate({buyerUuid:n,offerUuid:l,accept:!0})}),(0,a.jsx)(W.Vq,{open:i,onOpenChange:c,children:(0,a.jsxs)(W.cZ,{className:"bg-white sm:max-w-[425px]",children:[(0,a.jsxs)(W.fK,{children:[(0,a.jsx)(W.$N,{children:"Purchase is accepted"}),(0,a.jsx)(W.Be,{children:"You have accepted the purchase."})]}),(0,a.jsx)(W.cN,{children:(0,a.jsx)(ew.GG,{children:(0,a.jsx)(Y.zx,{type:"submit",variant:"outline",className:"px-12",children:"OK"})})})]})})},eO=e=>{let{productOffer:t}=e,r=eC(),s=(0,e_.H1)("accepted"),n=(0,e_.H1)("user"),l=(0,e_.H1)("offer"),{isOpen:i,openModal:o,setIsOpen:c}=(0,et.E)(),d=F(t.slug,()=>{o(),r()});return(0,e_.US)("0"===s&&null!=n&&null!=l,()=>{null!=n&&null!=l&&d.mutate({buyerUuid:n,offerUuid:l,accept:!1})}),(0,a.jsx)(W.Vq,{open:i,onOpenChange:c,children:(0,a.jsxs)(W.cZ,{className:"bg-white sm:max-w-[425px]",children:[(0,a.jsxs)(W.fK,{children:[(0,a.jsx)(W.$N,{children:"Purchase is declined"}),(0,a.jsx)(W.Be,{children:"You have declined the purchase."})]}),(0,a.jsx)(W.cN,{children:(0,a.jsx)(ew.GG,{children:(0,a.jsx)(Y.zx,{type:"submit",variant:"outline",className:"px-12",children:"OK"})})})]})})},ez=e=>{let{data:t}=(0,m.yZ)(e.productOffer),r=null==t?void 0:t.data;return(0,a.jsxs)("div",{className:"section-content mt-4 flex w-full flex-col gap-5 md:flex-row md:gap-10",children:[(0,a.jsx)(ek,{productOffer:r}),(0,a.jsx)(eO,{productOffer:r}),(0,a.jsx)(p.I,{images:r.images}),(0,a.jsx)(g,{}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col justify-around ga
21p-5",children:[(0,a.jsx)(x.O,{}),(0,a.jsx)(E,{productOffer:r}),(0,a.jsx)(ej,{productOffer:r})]})]})};var eE=r(67294),eD=r(26213),eR=r(28105),eq=r(18238);let eS=e=>{let{productOffer:t}=e,{t:r}=(0,C.LD)("marketplace.comment_box"),{isSuccess:n}=(0,ee.nu)(),l=(0,s.useRouter)(),i=(0,e_.H1)("comment"),o=en.z.object({comment:en.z.string({required_error:r("comment_required_text","Comment is required")}).min(1,r("comment_min_text","Comment must be at least 1 character"))}),c=(0,es.cI)({mode:"onBlur",resolver:(0,er.F)(o),defaultValues:{comment:""}}),d=(0,eD.N7)(t);return(0,eE.useEffect)(()=>{i&&(c.setValue("comment",i),c.trigger(),l.replace({pathname:l.pathname,query:{...l.query,comment:void 0}},void 0,{shallow:!0}))},[c,i,l]),(0,a.jsx)(ed.l0,{...c,children:(0,a.jsxs)("form",{className:"flex h-fit flex-col rounded-lg bg-primary-300 py-4 px-2 sm:p-4 md:p-6 lg:p-4 xl:p-6",onSubmit:c.handleSubmit(e=>{if(!n){l.push({pathname:K._.signin,query:{next:l.asPath,comment:e.comment}});return}d.mutate({comment:e.comment,product_offer_id:t.id}),c.reset({comment:""})}),children:[(0,a.jsxs)("div",{className:"mb-6 flex items-center gap-2 ",children:[(0,a.jsx)(N.w,{size:"h2",className:"text-3xl font-bold",children:r("title","Add comment")}),(0,a.jsx)(eR.pn,{children:(0,a.jsxs)(eR.u,{delayDuration:100,children:[(0,a.jsx)(eR.aJ,{children:(0,a.jsx)(eq.Z,{})}),(0,a.jsx)(eR._v,{sideOffset:10,className:"bg-forest-green-500 text-white",children:(0,a.jsx)("p",{children:r("tooltip_text","Add your comment to this Marketplace item")})})]})})]}),(0,a.jsx)(ed.Wi,{control:c.control,name:"comment",render:e=>{let{field:t}=e;return(0,a.jsxs)(ed.xJ,{className:"flex flex-col",children:[(0,a.jsx)(ed.lX,{className:"text-forest-green-500",children:r("comment_label","Comment")}),(0,a.jsx)(eu.K,{value:t.value,onChange:t.onChange,className:"h-[11rem] placeholder:font-light",placeholder:r("comment_placeholder","Enter your comment")}),(0,a.jsx)(ed.zG,{})]})}}),(0,a.jsx)(Y.zx,{type:"submit",disabled:c.formState.isSubmitting,className:"mt-6",children:r("submit_button","Submit")})]})})};var eP=r(53795),eZ=r(42890),eT=r(63445);let eU=()=>{let e=(0,eT.y)().t;return[{value:"-created_at",label:e("comments.sorting.newest")},{value:"created_at",label:e("comments.sorting.oldest")}]},eA=e=>{var t;let{productOffer:r}=e,{t:s}=(0,C.LD)("marketplace.comments"),[n,l]=(0,eE.useState)("-created_at"),{commentData:i,isLoading:o,isSuccess:c,paginationElement:d}=(0,eD.Te)(r.slug,n),u=c&&(null==i?void 0:null===(t=i.data)||void 0===t?void 0:t.length)===0;return(0,a.jsxs)("div",{className:"section-content pb-2 pt-14",children:[(0,a.jsx)(N.w,{size:"h2",className:"mb-6 text-3xl",children:s("title","Comments")}),(0,a.jsx)(eI,{sortBy:n,setSortBy:l}),(0,a.jsxs)("div",{className:"mb-10 grid grid-cols-1 gap-10 lg:grid-cols-product-detail-reviews",children:[(0,a.jsxs)("div",{children:[u?(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-forest-green-500",children:s("no_comment","No comments yet")})}):null,(0,a.jsx)(eM,{commentData:i,isLoading:o})]}),(0,a.jsx)(eS,{productOffer:r})]}),(0,a.jsx)("div",{className:"mt-10",children:d})]})},eM=e=>{let{commentData:t,isLoading:r}=e,s=null==t?void 0:t.data;return r?Array.from({length:6},(e,t)=>t).map(e=>(0,a.jsx)(eP.s,{},e)):null==s?void 0:s.map(e=>(0,a.jsx)(eP.q,{parentComment:e,comment:e,noReply:!0,item:"product-offer"},e.id))},eI=e=>{let{sortBy:t,setSortBy:r}=e,{t:s}=(0,C.LD)("marketplace.comments");return(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-forest-green-500/40",children:s("sort_by")}),(0,a.jsxs)(eZ.Ph,{defaultValue:"-created_at",onValueChange:r,value:t,children:[(0,a.jsx)(eZ.i4,{className:"w-fit border-none bg-transparent text-forest-green-500",children:(0,a.jsx)(eZ.ki,{})}),(0,a.jsx)(eZ.Bw,{className:"flex flex-col gap-5 bg-white",children:eU().map(e=>(0,a.jsx)(eZ.Ql,{value:e.value,className:"text-sm text-forest-green-500",children:e.label},e.value))})]})]})};var eL=r(66547),eH=!0;function eK(e){let{t}=(0,C.LD)("marketplace"),r=(0,l.J1)(),m=(0,s.useRouter)(),{adScriptJsx:p,adsReady:x}=(0,n.M)(eL._i.marketplace);return(0,eL.h3)(x,[...c.rd]),(0,e_.US)(!0,()=>{var t,a,s,n,l,i,o,c,d;(0,M.BX)("marketplace_view_item",{user_id:null===(t=r.data)||void 0===t?void 0:t.data.id,ecommerce:{currency:"HUF",value:null===(a=e.productOffer)||void 0===a?void 0:a.price,items:[{item_id:null===(s=e.productOffer)||void 0===s?void 0:s.id,item_name:null===(n=e.productOffer)||void 0===n?void 0:n.name,price:null===(l=e.productOffer)||void 0===l?void 0:l.price,item_brand:null===(o=e.productOffer.product)||void 0===o?void 0:null===(i=o.brand)||void 0===i?void 0:i.title,quantity:1,item_category:(0,f.A)(e.productOffer.product).getProductCategoryName(),seller_id:null===(c=e.productOffer.created_by)||void 0===c?void 0:c.id,seller_name:null===(d=e.productOffer.created_by)||void 0===d?void 0:d.username}]}})}),(0,a.jsxs)(c.Ar,{header:(0,a.jsx)(o.h,{}),footer:(0,a.jsx)(i.$,{}),mainClassName:"mb-20 3xl:max-w-screen-3xl 3xl:mx-auto w-full",children:[p,(0,a.jsx)(u.V,{title:t("page_title","Marketplace")}),(0,a.jsx)(d.V,{description:t("page_description","Kremmania Marketplace"),canonical:m.asPath}),(0,a.jsx)(ez,{productOffer:e.productOffer}),(0,a.jsx)(eA,{productOffer:e.productOffer})]})}},11742:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],a=0;a<e.rangeCount;a++)r.push(e.getRangeAt(a));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||r.forEach(function(t){e.addRange(t)}
21),t&&t.focus()}}},57898:function(e,t,r){"use strict";r.d(t,{D:function(){return s}});var a=r(67294);function s(e){let t=(0,a.useRef)({value:e,previous:e});return(0,a.useMemo)(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}}},function(e){e.O(0,[9226,6859,5675,4878,723,9619,3995,919,2590,99,9316,1375,6392,4608,9293,9421,2888,9774,179],function(){return e(e.s=39940)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.