1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9730],{1945:(e,t,a)=>{"use strict";a.d(t,{ProductCard:()=>j});var i=a(95155),d=a(79374),r=a(37206),s=a(5772),l=a(39100),c=a(12115);let n=(0,r.default)(()=>a.e(3872).then(a.bind(a,53872)).then(e=>e.ProductQuickAdd),{loadableGenerated:{webpack:()=>[53872]},loading:()=>(0,i.jsx)("button",{className:"wd-add-bag-mobile wd-quick-add-trigger",disabled:!0,type:"button",children:"Loading..."}),ssr:!1});function o({bundleText:e,productHref:t,productId:a,selectedFit:d=""}){let[r,s]=(0,c.useState)(null),[l,u]=(0,c.useState)(!1),[p,m]=(0,c.useState)(""),[h,w]=(0,c.useState)(0);async function g(){if(Number.isInteger(a)&&!(a<=0)&&!l){if(r)return void w(e=>e+1);u(!0),m("");try{let e=await fetch(`/api/storefront/quick-add/${a}`,{headers:{Accept:"application/json"}}),t=await e.json().catch(()=>null);if(!e.ok||!t?.product)throw Error("Could not load product options.");s(t.product),w(e=>e+1)}catch(e){m(e instanceof Error?e.message:"Could not load product options.")}finally{u(!1)}}}return r?(0,i.jsx)(n,{bundleText:e,openSignal:h,product:r,productHref:t,selectedFit:d}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{"aria-describedby":p?`quick-add-error-${a}`:void 0,className:"wd-add-bag-mobile wd-quick-add-trigger",disabled:l,onClick:g,type:"button",children:l?"Loading...":"Add to bag"}),p?(0,i.jsx)("span",{className:"wd-quick-add__message",id:`quick-add-error-${a}`,role:"status",children:p}):null]})}var u=a(73321),p=a(87521),m=a(55802);function h({currentPath:e,initialSaved:t,productId:a}){let d=(0,u.useRouter)(),[r,s]=(0,c.useState)(t),[l,n]=(0,c.useTransition)(),o=!Number.isInteger(a)||a<=0||l;return(0,i.jsx)("button",{"aria-label":r?"Remove from wishlist":"Add to wishlist","aria-pressed":r,className:r?"wd-wishlist is-saved":"wd-wishlist",disabled:o,onClick:function(t){t.preventDefault(),t.stopPropagation(),o||n(async()=>{let t=await fetch("/api/wishlist/toggle",{body:JSON.stringify({next:e,productId:a}),headers:{"Content-Type":"application/json"},method:"POST"}),i=await t.json().catch(()=>null);if(401===t.status&&i?.loginUrl){window.location.href=i.loginUrl;return}t.ok&&i?.ok&&(i.metaEvent&&((0,m.Jz)(i.metaEvent.eventName,i.metaEvent.payload,i.metaEvent.eventId),(0,p.XN)("add_to_wishlist",(0,p.lC)(i.metaEvent.payload))),s(!!i.wishlisted),d.refresh())})},title:a>0?r?"Remove from wishlist":"Add to wishlist":"Wishlist is available on live products",type:"button",children:(0,i.jsx)("span",{className:"wd-wishlist__icon","aria-hidden":"true"})})}var w=a(30357),g=a(32029),b=a(38239),x=a(2537),f=a(98500),_=a.n(f);let N=(0,r.default)(()=>a.e(3872).then(a.bind(a,53872)).then(e=>e.ProductQuickAdd),{loadableGenerated:{webpack:()=>[53872]},loading:()=>(0,i.jsx)("button",{className:"wd-add-bag-mobile wd-quick-add-trigger",disabled:!0,type:"button",children:"Add to bag"}),ssr:!1});function j({analyticsIndex:e,analyticsListId:t,analyticsListName:a,currentPath:r="/products",enableQuickAdd:c=!0,footerAction:n,imageFetchPriority:u,imageLoading:m="lazy",isWishlisted:f=!1,quickAddMode:v="inline",product:y}){var k,C,P;let R,z,S=(0,b.Nb)(y.fitType,y.fitLabel)||("regular"===(R=new URL(r,"https://wilddragon.local").searchParams.get("fit"))||"oversize"===R?R:""),L=(0,b.ug)(S,y.bundle),I=(0,b.eh)(y.title,S),E=(0,b.iO)(y.category,S),U=Number.isInteger(y.id)?Number(y.id):0,q=(k=y.slug??"sample-tee",C=S,P=y,z=new URL(`/product/${k}`,"https://wilddragon.local"),C&&(0,x.iL)(z.searchParams,C,P),`${z.pathname}${z.search}`),A=t&&a?{id:t,name:a}:void 0,H=A?(0,g.ur)(y,r,e,A):null,T=Array.from(new Set([...y.imageUrls??[],y.imageUrl].filter(e=>"string"==typeof e&&e.length>0))).slice(0,4),$=T[0]??"",F=y.variants?.map(e=>({name:e.colorName?.trim()||"Color",value:e.colorHex||"#111111"})).filter((e,t,a)=>e.name&&a.findIndex(t=>t.name===e.name)===t).slice(0,4)??[],G=c&&"inline"===v?{art:y.art,dailyDeal:y.dailyDeal,design:y.design,discount:y.discount,id:U||void 0,imageUrl:y.imageUrl,imageUrls:T,measurementNote:y.measurementNote,mrp:y.mrp,price:y.price,slug:y.slug,sizeChartFitDescription:y.sizeChartFitDescription,sizeChartFitLabel:y.sizeChartFitLabel,sizeChartJson:y.sizeChartJson,sizeChartUnit:y.sizeChartUnit,sizeGuide:y.sizeGuide,title:I,variants:y.variants?.map(e=>({colorHex:e.colorHex,colorName:e.colorName,discount:e.discount,fitLabel:e.fitLabel,fitType:e.fitType,id:e.id,mrp:e.mrp,price:e.price,salePrice:e.salePrice,sizeLabel:e.sizeLabel,stockQty:e.stockQty}))}:null;return(0,i.jsxs)("article",{className:"wd-product-card",children:[(0,i.jsx)("div",{className:"wd-product-card__image",children:(0,i.jsx)(_(),{"aria-label":`View ${I}`,className:"wd-product-card__image-link",href:q,onClick:D,prefetch:!1,children:$?(0,i.jsx)("div",{className:"wd-product-card__image-rail","aria-label":`${I} images`,children:(0,i.jsx)(s.default,{alt:I,decoding:"async",fetchPriority:u,height:488,loading:m,quality:50,sizes:"(max-width: 760px) 50vw, (max-width: 1180px) 25vw, 280px",src:$,width:384})}):(0,i.jsx)(l.K,{art:y.art,design:y.design})})}),(0,i.jsxs)("div",{className:"wd-product-card__body",children:[(0,i.jsxs)("div",{className:"wd-product-card__meta",children:[(0,i.jsxs)("div",{className:"wd-product-card__title-row",children:[(0,i.jsx)("h3",{className:"wd-product-card__title",children:(0,i.jsx)(_(),{href:q,onClick:D,prefetch:!1,style:{color:"inherit",textDecoration:"none"},children:I})}),(0,i.jsx)(h,{currentPath:r,initialSaved:f,productId:U})]}),(0,i.jsx)("div",{className:"wd-product-card__category",children:E})]}),F.length>0?(0,i.jsx)("span",{className:"wd-product-card__swatches","aria-label":"Available colors",children:F.map(e=>(0,i.jsx)("i",{"aria-label":e.name,style:{backgroundColor:e.value},title:e.name},e.name))}):null,(0,i.jsxs)("div",{className:"wd-price-row",children:[(0,i.jsx)("span",{className:"wd-price",children:y.price}),(0,i.jsx)(d.E,{sale:y.activeSale})]}),L?(0,i.jsxs)("div",{className:"wd-bundle-line",children:[(0,i.jsx)(w.gq,{className:"wd-offer-icon"}),(0,i.jsx)("span",{className:"wd-bundle-primary",children:L})]}):null,(0,i.jsx)("span",{className:"wd-fabric-badge",children:"100% Cotton"}),c&&"deferred"===v?(0,i.jsx)(o,{bundleText:L,productHref:q,productId:U,selectedFit:S}):G?(0,i.jsx)(N,{bundleText:L,product:G,productHref:q,selectedFit:S}):null,n?(0,i.jsx)("div",{className:"wd-product-card__footer-action",children:n}):null]})]});function D(){H&&A&&(0,p.XN)("select_item",{currency:"INR",item_list_id:A.id,item_list_name:A.name,items:[H],value:(0,g.o0)([H])})}}},11329:e=>{e.exports={relatedSection:"ProductRelatedRail_relatedSection__G0QMi",sectionHead:"ProductRelatedRail_sectionHead__dJ_rN",relatedGrid:"ProductRelatedRail_relatedGrid__wiUqI",emptyRelated:"ProductRelatedRail_emptyRelated__NEeLx"}},59730:(e,t,a)=>{"use strict";a.r(t),a.d(t,{ProductRelatedSection:()=>n});var i=a(95155),d=a(1945),r=a(81117),s=a(11329),l=a.n(s);function c({currentPath:e,products:t,wishlistedProductIds:a}
1){let s=new Set(a);return 0===t.length?(0,i.jsx)("div",{className:l().emptyRelated,children:(0,i.jsx)("strong",{children:"No similar products found."})}):(0,i.jsxs)("div",{className:`wd-product-grid wd-product-grid--carousel ${l().relatedGrid}`,children:[(0,i.jsx)(r.f,{currentPath:e,listId:"related_products",listName:"Related products",products:t}),t.map((t,a)=>(0,i.jsx)(d.ProductCard,{analyticsIndex:a,analyticsListId:"related_products",analyticsListName:"Related products",currentPath:e,enableQuickAdd:!1,isWishlisted:!!t.id&&s.has(t.id),product:t},t.slug??t.id??t.title))]})}function n({currentPath:e,products:t,wishlistedProductIds:a}){return(0,i.jsxs)("section",{className:l().relatedSection,"aria-label":"Related products",children:[(0,i.jsx)("div",{className:l().sectionHead,children:(0,i.jsx)("h2",{children:"You may also like"})}),(0,i.jsx)(c,{currentPath:e,products:t,wishlistedProductIds:a})]})}}}]);
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.