PageSourceSearch

https://somashop.com/_next/static/chunks/3618.1131d1ade3e48b1c.js

js somashop.com collected 2026-10-02 15:19:07 UTC 13,525 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3618],{33618:(e,i,t)=>{t.r(i),t.d(i,{default:()=>f});var a=t(95155),s=t(12115),r=t(21246),l=t(69730),n=t.n(l),c=t(38434),d=t(2834),u=t(31507),o=t(24846),_=t(22399),m=t(40975),h=t(44747),p=t(56689),v=t(98500),b=t.n(v),x=t(5772);let g=({gallery:e,image:i})=>{let t=(0,s.useRef)(null),l=(0,s.useRef)(null),[n,c]=(0,s.useState)(null);return(0,s.useEffect)(()=>{c(e=>e===l.current?e:l.current)},[e?.length,i]),(0,a.jsx)("div",{className:"custom-slider",children:e?.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.A,{asNavFor:n,ref:t,children:e?.length>0&&e.map(({image:e},i)=>(0,a.jsx)("div",{className:"product__media--preview__items",children:(0,a.jsx)(x.default,{className:"product__media--preview__items--img product_modal_slider_image",src:e,alt:e||"",width:294,height:525,quality:70,sizes:"(max-width: 767px) 100vw, (max-width: 1199px) 100vw, 294px"})},`modal-preview-${i}`))}),(0,a.jsxs)("div",{className:"product-gallery product__media--nav react-slick-slider",children:[(0,a.jsx)(r.A,{ref:l,slidesToShow:3,swipeToSlide:!0,focusOnSelect:!0,infinite:e?.length>3,children:e.map(({image:e},i)=>(0,a.jsx)("div",{className:"product__media--nav__items",children:(0,a.jsx)(x.default,{className:"product__media--nav__items--img product_detail_nav_image",src:e,alt:"product-nav-img",width:294,height:525,quality:70,sizes:"(max-width: 767px) 100vw, (max-width: 1199px) 100vw, 294px"})},"modalslider"+i))}
1),(0,a.jsx)("div",{className:"slider-prev-button",style:{top:"40%",visibility:e?.length>3?"visible":"hidden"},onClick:()=>void l.current?.slickPrev?.()}),(0,a.jsx)("div",{className:"slider-next-button",style:{top:"40%",visibility:e?.length>3?"visible":"hidden"},onClick:()=>void l.current?.slickNext?.()})]})]}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"product__media--preview__items",children:(0,a.jsx)(x.default,{className:"product__media--preview__items--img",src:i,alt:i||"",width:294,height:525,quality:70,sizes:"(max-width: 767px) 100vw, (max-width: 1199px) 100vw, 294px"})})})})},j=({url:e,children:i})=>{let t=!e;return(0,a.jsx)("div",{style:{filter:`grayscale(${t?"100%":"0%"}`},children:s.Children.map(i,i=>s.cloneElement(i,{disabled:t,url:t?"none":e,openShareDialogOnClick:!t}))})},f=({catalogmode:e,isVisible:i,setVisible:t,product:r})=>{let l=(0,d.wA)(),[v,x]=(0,s.useState)(0),[f,w]=(0,s.useState)(0),[y,N]=(0,s.useState)(1),[q,k]=(0,s.useState)([]),[S,C]=(0,s.useState)(!1),[A,F]=(0,s.useState)([]),[E,O]=(0,s.useState)(!1),I=(0,d.d4)(e=>e.wishList),[D,T]=(0,s.useState)(0),[$,P]=(0,s.useState)(r?.qty),z=(0,d.d4)(e=>e.cart.products),[B,Y]=(0,s.useState)(0),[L,R]=(0,s.useState)(0),[V,J]=(0,s.useState)(0),[U,H]=(0,s.use
1State)(0),[M,Q]=(0,s.useState)(0),[W,X]=(0,s.useState)(),[G,K]=(0,s.useState)([]),[Z,ee]=(0,s.useState)([]),[ei,et]=(0,s.useState)(0),[ea,es]=(0,s.useState)(""),[er,el]=(0,s.useState)([]),[en,ec]=(0,s.useState)(!1),[ed,eu]=(0,s.useState)(!1),eo=e=>{e?N(y+1):y>1&&N(y-1)},e_=async e=>{let i=new URLSearchParams;i.append("id",e);let t=await (0,p.LS)("/products/bundleProducts",i);1==t.success&&t.hasOwnProperty("data")?t.data&&el(t.data):el([])};(0,s.useEffect)(()=>{(()=>{if(z.length){let i=[],t=[];r?.id&&(i=z.filter(e=>e.id==r?.id));for(let a=0;a<i.length;a++){let s=i[a];if("Yes"==s.is_variation_product)for(let e=0;e<s.hasCombination.product_variations_values.length;e++)t.push({quantity:s.numberOfItems,attribute_value_id:s.hasCombination.product_variations_values[e].attribute_value_id});if("Yes"==i[a].is_variation_product){var e=i.findIndex(e=>e.hasCombination.id===E.id);e>=0?(i[e].orgiginalquantity,i.filter(e=>e.hasCombination.id==E.id).length?i[e].numberOfItems:E.quantity):E.quantity}else i[a].orgiginalquantity,i[a].numberOfItems}i.length>0&&k(t)}})()},[z]);let em=(e,i)=>{N(1);let t=[...A];if(e||i){let a=t.find(i=>i.attribute_id===e);if(a){let e=t.indexOf(a);t[e].attribute_value_id=i,F(t)}else(t=[...t,{attribute_id:e,attribute_value_id:i}]).sort((e,i)=>e.attribute_value_id>i.attribute_value_id?1:i.attribute_value_id>e.attribute_value_id?-1:0),F(t)}else r?.attributes?.length>0&&(r.attributes.forEach(({attribute:e,attributes:i})=>{i?.length>0&&i.forEach(({attribute_value_id:i},a)=>{0===a&&t.push({attribute_id:e.id,attribute_value_id:i})})}),t.sort((e,i)=>e.attribute_value_id>i.attribute_value_id?1:i.attribute_value_id>e.attribute_value_id?-1:0),F(t))};return(0,s.useEffect)(()=>{if(r?.product_variations_combinations.length>0){let e=r?.product_variations_combinations.length-1;Q(e),r?.product_variations_combinations.sort((e,i)=>e.price-i.price),Y(r?.product_variations_combinations[0].price),J(r?.product_variations_combinations[0].discount_price),R(r?.product_variations_combinations[e].price),H(r?.product_variations_combinations[e].discount_price)}if(I.length&&(void 0!=I.find(e=>e.id==r?.id)?T(1):T(0)),r?.is_variation_product==="Yes"&&C(!0),0===A.length&&em(),z.length>0){let e=z.filter(e=>e.id==r?.id);e.length>0?!0==E?e.filter(e=>e.hasCombination.id==E?.id).length>0&&P(E?.quantity-e[0].numberOfItems):P(r?.qty-e[0].numberOfItems):P(r?.qty)}else r?.product_variations_combinations.length==0?P(r?.qty):!0==E&&P(E?.quantity);e_(r?.id)},[r,z]),(0,s.useEffect)(()=>{A.length>0&&(e=>{let i=r&&[...r.product_variations_combinations],t=[];if(i?.forEach(e=>{t.push({...e,matchIds:e.product_variations_values.map(({attribute_id:e,attribute_value_id:i})=>({attribute_id:e,attribute_value_id:i}))})}),t=t.find(i=>JSON.stringify(i.matchIds.sort((e,i)=>e.attribute_value_id>i.attribute_value_id?1:i.attribute_value_id>e.attribute_value_id?-1:0))===JSON.stringify(e)),z.length){let e=[];
1if(r.id&&(e=z.filter(e=>e.id==r.id)),e.length){let i=e.filter(e=>e.hasCombination.id==t.id);if(i.length)for(let e=0;e<i.length;e++)P(Number(t.quantity)-Number(i[e].numberOfItems));else P(t.quantity)}else P(t?.quantity)}else P(t.quantity);O(t),t?c.Ay.remove():(c.Ay.remove(),c.Ay.error("This product is not available"))})(A)},[A]),(0,s.useEffect)(()=>{let e=0;G.map(i=>{let t=i.hasCombination.discount_price||i.hasCombination.price||i.price||i.old_price;e+=t}),x(e)},[G]),(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:n()("modal cutom-width",{"is-visible":i}),id:"modal1","data-animation":"slideInUp",children:(0,a.jsxs)("div",{className:"modal-dialog quickview__main--wrapper",children:[(0,a.jsx)("header",{className:"modal-header quickview__header",children:(0,a.jsx)("button",{className:"close-modal quickview__close--btn","aria-label":"close modal",onClick:()=>t(!1),children:"✕"})}),(0,a.jsx)("div",{className:"quickview__inner",style:{overflowY:"auto",overflowX:"hidden",height:"80vh"},children:(0,a.jsxs)("div",{className:"row row-cols-lg-2 row-cols-md-2",children:[(0,a.jsx)("div",{className:"col",children:(0,a.jsx)("div",{className:"quickview__product--media product__details--media",children:(0,a.jsx)(g,{gallery:r?.gallery,image:r?.image})})}),(0,a.jsx)("div",{className:"col",children:(0,a.jsx)("div",{className:"quickview__info",children:(0,a.jsxs)("form",{action:"#",children:[(0,a.jsx)("p",{className:"product__details--info__title mb-15",children:r?.name||""}),(0,a.jsxs)("div",{className:"product__items--price",children:[r?.product_variations_combinations.length===0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"current__price",children:(0,a.jsx)(_.A,{price:r.price})}),r?.old_price>0&&r?.price!==r?.old_price&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"price__divided"}),(0,a.jsx)("span",{className:"old__price",children:(0,a.jsx)(_.A,{price:r.old_price})})]})]}),r?.product_variations_combinations.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"current__price",children:(0,a.jsx)(_.A,{price:V||B})}),r?.product_variations_combinations&&r?.product_variations_combinations[0]?.discount_price>0&&r?.product_variations_combinations[0]?.price!==r?.product_variations_combinations[0]?.discount_price&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"price__divided"}),(0,a.jsx)("span",{className:"old__price",children:(0,a.jsx)(_.A,{price:B})})]}),B!==L&&(0,a.jsxs)(a.Fragment,{children:["-",(0,a.jsx)("span",{className:"current__price",children:(0,a.jsx)(_.A,{price:U||L})}),r?.product_variations_combinations&&r?.product_variations_combinations[M]?.discount_price>0&&r?.product_variations_combinations[M]?.price!==r?.product_variations_combinations[M]?.discount_price&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"price__divided"}),(0,a.jsx)("span",{className:"old__price",children:(0,a.jsx)(_.A,{price:L})})]})]})]})]}),(0,a.jsx)("p",{className:"product__details--info__desc mb-30",dangerouslySetInnerHTML:{__html:r?.short_description}}),(0,a.jsxs)("div",{className:"product__variant",children:[r?.attributes.length>0&&r.attributes.map(({attribute:e,attributes:i},t)=>(0,a.jsx)("div",{className:"product__variant--list mb-15",children:(0,a.jsxs)("fieldset",{className:"variant__input--fieldset weight",children:[(0,a.jsxs)("legend",{className:"product__variant--title mb-8",children:[e.name," :"]}),i?.length>0&&i.map(({attribute_value_id:i,attribute_value:l},c)=>{let d=r?.product_variations_combinations.find(e=>e.product_variations_values[t].attribute_value_id==i),u=q.find(e=>e.attribute_value_id==i);return(0,a.jsxs)(s.Fragment,{children:[(0,a.jsx)("input",{id:`${e.name}-${l?.id}`,name:e.id,type:"radio",onChange:t=>em(e.id,i),defaultChecked:0===c,disabled:r?.attributes.length==1&&(d?.quantity<=0||d?.quantity-u?.quantity<=0)}),(0,a.jsxs)("label",{className:n()("variant__size--value red",{disabled:r?.attributes.length==1&&(d?.quantity<=0||d?.quantity-u?.quantity<=0)}),htmlFor:`${e.name}-${l?.id}`,children:[(0,a.jsx)("div",{className:"show-strike"}),l?.attribute_value]})]},l?.attribute_value)})]})},`variant-group-${e?.id??t}`)),"No"==e&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"quickview__variant--list quantity d-flex align-items-center mb-15 spacearround",children:[(0,a.jsxs)("div",{className:"quantity__box",children:[(0,a.jsx)("button",{type:"button",className:n()("quantity__value quickview__value--quantity decrease",{disabled:1===y}),"aria-label":"quantity value",value:"Decrease Value",onClick:e=>{e.preventDefault(),eo()},children:"-"}),(0,a.jsx)("input",{type:"number",className:"quantity__number quickview__value--number",value:y,readOnly:!0,"aria-label":"Quantity"}),(0,a.jsx)("button",{type:"button",className:n()("quantity__value quickview__value--quantity increase",{disabled:$<=y}),"aria-label":"quantity value",value:"Increase Value",onClick:e=>{e.preventDefault(),$>y&&eo(!0)},children:"+"})]}),(0,a.jsx)("button",{className:n()("primary__btn quickview__cart--btn",{disabled:$<=0}),type:"button",onClick:e=>{e.preventDefault(),$>0&&l((0,u.bE)({...r,orgiginalquantity:E?.quantity||r?.qty,price:E?.discount_price||E?.price||r?.price,hasCombination:E,weight:E?.weight||r?.weight,sku:E?.sku||r?.sku},y)),N(1),t(!1)},children:"Add To Cart"})]}),(0,a.jsx)("div",{className:"quickview__variant--list variant__wishlist mb-15",children:(0,a.jsxs)(b(),{className:"variant__wishlist--icon",href:"#",title:"Add to wishlist",onClick:e=>{e.preventDefault(),l((0,o.wv)(r?.id)),t(!1)},"aria-label":"Add to wishlist",children:[(0,a.jsx)("i",{className:n()("fal fa-heart",{activewish:1==D})}),1==D?"Added":"Add"," to Wishlist"]})})]})||""]}
1),(0,a.jsxs)("div",{className:"quickview__social d-flex align-items-center mb-15",children:[(0,a.jsx)("label",{className:"quickview__social--title",children:"Social Share:"}),(0,a.jsxs)("ul",{className:"quickview__social--wrapper mt-0 d-flex",children:[(0,a.jsx)("li",{className:"quickview__social--list",children:(0,a.jsx)(j,{url:r?.image,children:(0,a.jsx)(m.uI,{className:"Demo__some-network__share-button",imageurl:r?.image,children:(0,a.jsx)(m.ik,{size:32,round:!0})})})}),(0,a.jsx)("li",{className:"quickview__social--list",children:(0,a.jsx)(j,{url:r?.image,children:(0,a.jsx)(m.r6,{title:r?.name||"",hashtags:[r?.name,r?.category?.name],pictureurl:r?.image,children:(0,a.jsx)(m.Fi,{size:32,round:!0})})})}),(0,a.jsx)("li",{className:"quickview__social--list",children:(0,a.jsx)(m.oB,{className:"Demo__some-network__share-button",media:r?.image,children:(0,a.jsx)(m.yY,{size:32,round:!0})})})]})]}),(0,a.jsx)("div",{children:er.length&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"product__variant--title mb-8",children:"Frequently Bought Together"}),(0,a.jsx)("div",{className:"product__variant--list",children:er.map((e,i)=>(0,a.jsx)(h.default,{proindex:i,product:e,setProductVisible:ec,setProductBundle:X,setBundleprice:et,totalprice:ei,cartbundle:G,setcartBundle:K,setoutofstock:eu},`bundle-${f}-${e.id}`))}),(0,a.jsxs)("p",{className:"mb-0",children:["Total Price : ",(0,a.jsx)(_.A,{price:v})]}),"No"==e&&(0,a.jsx)("div",{className:"product__variant--list mb-15",children:(0,a.jsxs)("button",{className:"quickview__cart--btn1 primary__btn fullwidth",type:"button",onClick:e=>{e.preventDefault(),G.length>0?!1==ed?(G.forEach((e,i)=>{setTimeout(()=>{l((0,u.bE)({...e,orgiginalquantity:e.hasCombination?.quantity||e?.qty,price:e.hasCombination?.discount_price||e.hasCombination?.price||e?.price,hasCombination:e.hasCombination,weight:e.hasCombination?.weight||e?.weight,sku:e.hasCombination?.sku||e?.sku},1))},100*i)}),w(e=>e+1),K([]),et(0)):(0,c.Ay)("One of the product is out of stock"):(0,c.Ay)("Please select product")},children:[(0,a.jsx)("i",{className:"fal fa-cart-shopping product__items--action__btn--svg"}),"+ Add To Cart"]})})||""]})||""})]})})})]})})]})})})}}}]);

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.