1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-0m04IAB-.js","assets/index-Dw2ZczCm.js","assets/index-DW0uGgGb.css","assets/custom-media-element-BTc9lN-c.js","assets/hls-3UaP__zV.js","assets/react-DLUg6AGu.js","assets/index-DIEr2loI.js","assets/react-CJszKgKD.js","assets/react-CY5kEEj3.js","assets/react-CPE8C0xY.js","assets/react-CvrveUdr.js","assets/react-C_oMWzOM.js","assets/react-3UDQzQk-.js","assets/Preview-DBSwImxp.js"])))=>i.map(i=>d[i]); 2import{R as S,r as i,_,b as _e,c as Ne,e as ke,f as Ee,h as Ie,i as Se,k as Re,j as e,N as Z,T as W,G as Te,I as ee,P as Ae,l as Ce,g as Le,p as Oe}from"./index-Dw2ZczCm.js";import{F as Ve}from"./stores-p9n1VgVu.js";import{S as x}from"./skeleton-D7g4hfRh.js";import{P as $e}from"./PopUpNotification-CgsVZKBy.js";import{S as qe,A as Ue,N as ze,P as Fe,K as He,a as Me}from"./navigation-MO3UOE6b.js";import"./skeleton-styles-CX1My2Lh.js";import"./PopUpNotification-styles-BgDT4i-l.js";const me=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,oe=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,de=/\.(m3u8)($|\?)/i,Be=/\.(mpd)($|\?)/i,We=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,De=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,Qe=/vimeo\.com\/(?!progressive_redirect).+/,Ge=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,Xe=/open\.spotify\.com\/(\w+)\/(\w+)/i,Ke=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/,Ye=/tiktok\.com\/(?:@[^/]+\/video\/)?(\d+)(?:\/([\w-]+))?/,H=(t,o)=>{if(Array.isArray(t)){for(const f of t)if(typeof f=="string"&&H(f,o)||H(f.src,o))return!0;return!1}return o(t)},P={html:t=>H(t,o=>me.test(o)||oe.test(o)),hls:t=>H(t,o=>de.test(o)),dash:t=>H(t,o=>Be.test(o)),mux:t=>We.test(t),youtube:t=>De.test(t),vimeo:t=>Qe.test(t)&&!oe.test(t)&&!de.test(t),wistia:t=>Ge.test(t),spotify:t=>Xe.test(t),twitch:t=>Ke.test(t),tiktok:t=>Ye.test(t)},Je=S.forwardRef((t,o)=>{const f=me.test(`${t.src}`)?"audio":"video";return S.createElement(f,{...t,ref:o},t.children)});var Ze=Je;const et=[{key:"hls",name:"hls.js",canPlay:P.hls,canEnablePIP:()=>!0,player:i.lazy(()=>_(()=>import("./react-0m04IAB-.js"),__vite__mapDeps([0,1,2,3,4])))},{key:"dash",name:"dash.js",canPlay:P.dash,canEnablePIP:()=>!0,player:i.lazy(()=>_(()=>import("./react-DLUg6AGu.js"),__vite__mapDeps([5,1,2,3])))},{key:"mux",name:"Mux",canPlay:P.mux,canEnablePIP:()=>!0,player:i.lazy(()=>_(()=>import("./index-DIEr2loI.js"),__vite__mapDeps([6,1,2,4,3])))},{key:"youtube",name:"YouTube",canPlay:P.youtube,player:i.lazy(()=>_(()=>import("./react-CJszKgKD.js"),__vite__mapDeps([7,1,2])))},{key:"vimeo",name:"Vimeo",canPlay:P.vimeo,player:i.lazy(()=>_(()=>import("./react-CY5kEEj3.js"),__vite__mapDeps([8,1,2])))},{key:"wistia",name:"Wistia",canPlay:P.wistia,canEnablePIP:()=>!0,player:i.lazy(()=>_(()=>import("./react-CPE8C0xY.js"),__vite__mapDeps([9,1,2])))},{key:"spotify",name:"Spotify",canPlay:P.spotify,canEnablePIP:()=>!1,player:i.lazy(()=>_(()=>import("./react-CvrveUdr.js"),__vite__mapDeps([10,1,2])))},{key:"twitch",name:"Twitch",canPlay:P.twitch,canEnablePIP:()=>!1,player:i.lazy(()=>_(()=>import("./react-C_oMWzOM.js"),__vite__mapDeps([11,1,2])))}
2,{key:"tiktok",name:"TikTok",canPlay:P.tiktok,canEnablePIP:()=>!1,player:i.lazy(()=>_(()=>import("./react-3UDQzQk-.js"),__vite__mapDeps([12,1,2])))},{key:"html",name:"html",canPlay:P.html,canEnablePIP:()=>!0,player:Ze}];var te=et;const tt={width:"320px",height:"180px",volume:1,playbackRate:1,previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}"},he=S.forwardRef((t,o)=>{const{playing:f,pip:g}=t,h=t.activePlayer,n=i.useRef(null),u=i.useRef(!0);i.useEffect(()=>{var c,b;n.current&&(n.current.paused&&f===!0&&n.current.play(),!n.current.paused&&f===!1&&n.current.pause(),n.current.playbackRate=(c=t.playbackRate)!=null?c:1,n.current.volume=(b=t.volume)!=null?b:1)}),i.useEffect(()=>{var c,b,v,R,a;if(!(!n.current||!globalThis.document)){if(g&&!document.pictureInPictureElement)try{(b=(c=n.current).requestPictureInPicture)==null||b.call(c)}catch{}if(!g&&document.pictureInPictureElement)try{(R=(v=n.current).exitPictureInPicture)==null||R.call(v),(a=document.exitPictureInPicture)==null||a.call(document)}catch{}}},[g]);const N=c=>{var b,v;u.current=!0,(b=t.onReady)==null||b.call(t),(v=t.onLoadStart)==null||v.call(t,c)},$=c=>{var b,v;u.current&&(u.current=!1,(b=t.onStart)==null||b.call(t,c)),(v=t.onPlay)==null||v.call(t,c)};if(!h)return null;const L={};for(const c in t)c.startsWith("on")&&(L[c]=t[c]);return S.createElement(h,{...L,style:t.style,className:t.className,slot:t.slot,ref:i.useCallback(c=>{n.current=c,typeof o=="function"?o(c):o!==null&&(o.current=c)},[o]),src:t.src,crossOrigin:t.crossOrigin,preload:t.preload,controls:t.controls,muted:t.muted,autoPlay:t.autoPlay,loop:t.loop,playsInline:t.playsInline,config:t.config,onLoadStart:N,onPlay:$},t.children)});he.displayName="Player";var at=he;const st=i.lazy(()=>_(()=>import("./Preview-DBSwImxp.js"),__vite__mapDeps([13,1,2]))),F=[],rt=(t,o)=>{const f=h=>{for(const n of[...F,...t])if(h&&n.canPlay(h))return n;return o||null},g=S.forwardRef((h,n)=>{const u={...tt,...h},{src:N,slot:$,className:L,style:c,width:b,height:v,fallback:R,wrapper:a}=u,[q,j]=i.useState(!!u.light);i.useEffect(()=>{u.light?j(!0):j(!1)},[u.light]);const D=k=>{var w;j(!1),(w=u.onClickPreview)==null||w.call(u,k)},Q=k=>{if(!k)return null;const{light:w,playIcon:T,previewTabIndex:E,oEmbedUrl:U,previewAriaLabel:z}=u;return S.createElement(st,{src:k,light:w,playIcon:T,previewTabIndex:E,previewAriaLabel:z,oEmbedUrl:U,onClickPreview:D})},G=k=>{var w,T;const E=f(k);if(!E)return null;const{style:U,width:z,height:m,wrapper:O}=u,Y=(w=u.config)==null?void 0:w[E.key];return S.createElement(at,{...u,ref:n,activePlayer:(T=E.player)!=null?T:E,slot:O?void 0:$,className:O?void 0:L,style:O?{display:"block",width:"100%",height:"100%"}:{display:"block",width:z,height:m,...U},config:Y})},X=a??ue,K=R===!1?ue:i.Suspense;return S.createElement(X,{slot:$,className:L,style:{width:b,height:v,...c}},S.createElement(K,{fallback:R},q?Q(N):G(N)))});return g.displayName="ReactPlayer",g.addCustomPlayer=h=>{F.push(h)},g.removeCustomPlayers=()=>{F.length=0},g.canPlay=h=>{if(h){for(const n of[...F,...t])if(n.canPlay(h))return!0}return!1},g.canEnablePIP=h=>{var n;if(h){for(const u of[...F,...t])if(u.canPlay(h)&&((n=u.canEnablePIP)!=null&&n.call(u)))return!0}return!1},g},ue=({children:t})=>t,lt=te[te.length-1];var it=rt(te,lt);const ft=()=>{var le,ie,ne;const t="https://hq.accenthub.com.ph",o=_e();Ne();const{user:f}=ke(),{GetCartCount:g}=Ee(),{handleLoadCart:h}=Ie(),[n,u]=i.useState(0),N=i.useRef(null),L=((le=Se().state)==null?void 0:le.product)||{},{name:c,desc:b,product_price_range:v}=L,{id:R}=Re(),[a,q]=i.useState(null),[j,D]=i.useState([]),[Q,G]=i.useState([]),[X,K]=i.useState({}),[k,w]=i.useState(1),[T,E]=i.useState([]),[U,z]=i.useState([]),[m,O]=i.useState({}),[Y,nt]=i.useState(!1),[ye,ae]=i.useState(!0),[se,J]=i.useState(!1),[xe,fe]=i.useState(!1),be="https://www.youtube.com/watch?v=2g811Eo7K8U";new URL(be).searchParams.get("v"),i.useEffect(()=>{var s;if(N.current){const r=N.current,l=(s=r.children[0])==null?void 0:s.offsetWidth;l&&(r.scrollLeft=l*n)}},[n]),i.useEffect(()=>{(async()=>{try{const{data:l,message:p}=await Le(`/Products/GetProductsListAllData?product_id=${R}`);if(!l)throw p?new Error(p):new Error("No data returned from API");const d=l[0];q(d||{}),console.log("productData",d),D((d==null?void 0:d.product_images)||[]),z((d==null?void 0:d.product_attribute)||[]);const V=d==null?void 0:d.product_attribute.filter((y,I,C)=>I===C.findIndex(B=>B.branch_name===y.branch_name)),A=await Ve(1,V);(V.length===0||A.length===0)&&(ae(!1),fe(!0));var r=A[0];K(r),G(A||[]);const M=Object.entries(d==null?void 0:d.product_attribute.filter(y=>y.branch_name===r.code).reduce((y,I)=>{const C=`${I.color}_${I.capacity}`;return y[C]||(y[C]=[]),y[C].push(I),y},{})).map(([y,I])=>{const C=I.reduce((B,ce)=>ce.quantity>B.quantity?ce:B);return{key:y,totalQuantity:C.quantity,item:C}}).sort((y,I)=>I.totalQuantity-y.totalQuantity).map(({item:y}
2)=>y);E(M),O(M[0]),ae(!1)}catch{}})()},[R]),t+(a==null?void 0:a.Image);const pe=s=>{if(u(s),N.current){const r=N.current,l=r.children[s];l&&r.scrollTo({left:l.offsetLeft,behavior:"smooth"})}},re=s=>{w(r=>{if(r>=m.quantity&&s!=-1)return m.quantity;const l=r+s;return l>0?l:1})},ge=s=>{var r=Object.entries(U.filter(l=>l.branch_name===s).reduce((l,p)=>{const d=`${p.color}_${p.capacity}`;return l[d]||(l[d]=[]),l[d].push(p),l},{})).map(([l,p])=>{const d=p.reduce((V,A)=>A.quantity>V.quantity?A:V);return{key:l,totalQuantity:d.quantity,item:d}}).sort((l,p)=>p.totalQuantity-l.totalQuantity).map(({item:l})=>l);return r},ve=s=>{var r=ge(s);E(r),O(r[0])},je=({videoUrl:s,index:r,onClick:l})=>{const d=(A=>{const M=/(?:youtube\.com\/(?:watch\?v=|embed\/|v\/)|youtu\.be\/)([^&?]+)/,y=A.match(M);return y?y[1]:null})(s),V=d?`https://img.youtube.com/vi/${d}/hqdefault.jpg`:"https://via.placeholder.com/120?text=Video+Thumbnail";return e.jsx("img",{src:V,alt:`Thumbnail for video ${r}`,style:{width:"120px",height:"120px",aspectRatio:"1/1",cursor:"pointer",objectFit:"fill",borderRadius:"5px"},onClick:()=>l(r)})},we=async()=>{if(!f){o("/login",{state:{redirectTo:`/product/${a.product_id}`}});return}if(!xe&&Object.keys(m).length!==0)try{m.user_id=f==null?void 0:f.user_id,m.ischeck=!1,m.cart_freebie=a==null?void 0:a.product_freebie,m.quantity=k,m.item_name=a==null?void 0:a.name,delete m.attribute_id,delete m.name;const{success:s,message:r}=await Oe("/products/addCart",{model:m});if(s)J(!0),g(),h(),setTimeout(()=>J(!1),3e3);else throw new Error(r)}catch(s){console.error("Error fetching data:",s)}},Pe=()=>{J(!se)};return ye?e.jsx(e.Fragment,{children:e.jsx("div",{className:"container mt-5 product-container",children:e.jsxs("div",{className:"row pt-4",children:[e.jsxs("div",{className:"col-lg-7",children:[c?e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsxs("ol",{className:"breadcrumb",children:[e.jsx("li",{className:"breadcrumb-item",children:e.jsx(Z,{to:"/",className:"text-decoration-none text-muted",children:"Home"})}),e.jsx("li",{className:"breadcrumb-item",children:e.jsx("a",{className:"text-decoration-none text-muted",children:"Products"})}),e.jsx("li",{className:"breadcrumb-item","aria-current":"page",style:{color:"#8A151B"},children:e.jsx(W,{lineCount:1,children:c})})]})}):e.jsx(x,{}),e.jsx(x,{width:"100%",height:"400px"}),e.jsxs("div",{className:"d-flex flex-grow-1",style:{gap:10},children:[e.jsx(x,{width:"200px",height:"100px"}),e.jsx(x,{width:"200px",height:"100px"}),e.jsx(x,{width:"200px",height:"100px"}),e.jsx(x,{width:"200px",height:"100px"})]})]}),e.jsx("div",{className:"col-lg-5 ",children:e.jsxs("div",{className:"d-flex flex-column",style:{height:"100%"},children:[e.jsx("div",{style:{gap:"20px"},children:c?e.jsxs(e.Fragment,{children:[e.jsx("h3",{style:{fontWeight:"bold",color:"black !important"},children:e.jsxs(W,{maxWidth:"100%",children:[" ",c]})}),e.jsx("p",{className:"product-prize mb-2",children:a&&Te((ie=a==null?void 0:a.product_price_range[0])==null?void 0:ie.MinPrice,(ne=a==null?void 0:a.product_price_range[0])==null?void 0:ne.MaxPrice)}),e.jsx("div",{style:{color:"black",textAlign:"justify",wordWrap:"break-word"},className:"description",children:e.jsx("p",{children:b})})]}):e.jsxs(e.Fragment,{children:[e.jsx(x,{width:"400px"}),e.jsx(x,{width:"200px"}),e.jsx(x,{width:"300px"})]})}),e.jsx("br",{}),e.jsxs("div",{style:{gap:"20px"},children:[e.jsx(x,{}),e.jsx(x,{width:"100%"}),e.jsx(x,{}),e.jsx(x,{width:"100%"}),e.jsx(x,{}),e.jsx("br",{}),e.jsx(x,{width:"100%"}),e.jsx("br",{}),e.jsx(x,{width:"100%"})]})]})})]})})}):e.jsxs(e.Fragment,{children:[e.jsx($e,{message:"Added to cart successfully",show:se,setShow:Pe}),e.jsxs("div",{className:"container mt-0 mt-md-5 product-container",children:[e.jsx("br",{}),e.jsxs("div",{className:"row justify-content-center",children:[e.jsx("div",{className:"col-lg-7 col-md-12 d-flex justify-content-center",children:e.jsxs("div",{className:"w-100",children:[e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsxs("ol",{className:"breadcrumb",children:[e.jsx("li",{className:"breadcrumb-item",children:e.jsx(Z,{to:"/",className:"text-decoration-none text-muted",children:"Home"})}),e.jsx("li",{className:"breadcrumb-item",children:c?e.jsx("a",{onClick:()=>o(-1),className:"text-decoration-none text-muted ",style:{cursor:"pointer"},children:"Products"}):e.jsx(Z,{to:"/allproducts",className:"text-decoration-none text-muted",children:"Products"})}),e.jsx("li",{className:"breadcrumb-item","aria-current":"page",style:{color:"#8A151B"},children:e.jsx(W,{lineCount:1,children:a==null?void 0:a.name})})]})}),e.jsxs("div",{className:"mb-3 text-center",style:{width:"100%",overflow:"hidden",position:"relative"},children:[j.length===0&&e.jsx("img",{src:ee,style:{width:"100%",objectFit:"contain",borderRadius:"5px"}}),e.jsx("div",{className:"slide-wrapper",style:{display:"flex",width:`${j.length*100}%`,transform:`translateX(-${n*(100/j.length)}%)`,transition:"transform 0.5s ease-in-out"},children:j.map((s,r)=>e.jsx("div",{className:"main-image",style:{flex:`0 0 ${100/j.length}%`},children:s.img_type===0?e.jsx("img",{src:t+s.image,alt:`Main-${r}`,style:{width:"100%",height:"100%",objectFit:"contain",borderRadius:"5px"},onError:l=>{l.target.onerror=null,l.target.src=ee}}):e.jsx(it,{src:s.image,playing:Y,alt:`Main-${r}`,style:{width:"100%",height:"100%",objectFit:"fill"}})},r))})]}),j.length!==0&&e.jsx("div",{className:"d-flex align-items-center position-relative",children:e.jsx(qe,{slidesPerView:3,navigation:!0,keyboard:!0,centeredSlides:!1,initialSlide:0,breakpoints:{320:{slidesPerView:2,spaceBetween:0}
2,640:{slidesPerView:2,spaceBetween:0},768:{slidesPerView:2,spaceBetween:50},1024:{slidesPerView:4,spaceBetween:50},1366:{slidesPerView:4}},modules:[Ue,ze,Fe,He],className:"mySwiper d-flex",children:j.map((s,r)=>e.jsx(Me,{className:"w-auto",children:e.jsx("div",{onClick:()=>pe(r),style:{flex:"0 0 20%",padding:"5px",cursor:"pointer",border:n===r?"2px solid black":"2px solid white"},children:s.img_type===0?e.jsx("img",{src:t+s.image,alt:`Thumb-${r}`,style:{height:"120px",width:"100%",borderRadius:"5px",objectFit:"fill",aspectRatio:"1/1"},onError:l=>{l.target.onerror=null,l.target.src=ee}}):e.jsx(je,{videoUrl:s.image,index:r})},r)},r))})})]})}),e.jsxs("div",{className:"col-lg-5 col-md-12 mt-3 mt-lg-0",style:{display:"flex",flexDirection:"column"},children:[e.jsx("h3",{style:{fontWeight:"bold",color:"black !important"},children:e.jsxs(W,{maxWidth:"100%",children:[" ",a==null?void 0:a.name]})}),a!=null&&a.IsOnSale?e.jsxs(e.Fragment,{children:[e.jsxs("del",{style:{color:"grey"},children:["â± ",a.Price]}),"Â Â Â ",e.jsxs("b",{className:"product-prize",children:["â± ",(a==null?void 0:a.Price)-(a==null?void 0:a.Price)*.02]})]}):Object.keys(m).length!==0?e.jsx("p",{className:"product-prize mb-2",children:Ae(m==null?void 0:m.price)}):e.jsx("p",{className:"product-prize mb-2",children:Ce(a==null?void 0:a.product_attribute)}),e.jsx("div",{style:{color:"black",textAlign:"justify",wordWrap:"break-word"},className:"description",children:e.jsx("p",{children:a==null?void 0:a.desc})}),e.jsxs("div",{className:"d-flex flex-column position-relative",children:[e.jsxs("div",{className:"form-group mt-3",children:[e.jsx("label",{htmlFor:"dropdown",className:"form-label fw-bold",children:"Select Branch:"}),e.jsx("select",{id:"dropdown",className:"form-select",onChange:s=>ve(s.target.value),children:Q.map((s,r)=>e.jsx("option",{value:s.code,defaultValue:X.code,children:s.name},r))})]}),e.jsxs("div",{className:"form-group mt-3",children:[e.jsx("label",{className:"form-label fw-bold",children:"Select Variant (Color - Capacity):"}),e.jsx("select",{className:"form-select",onChange:s=>{O(JSON.parse(s.target.value))},children:T==null?void 0:T.map((s,r)=>{const l=JSON.stringify(s),p=[s.color,s.capacity].filter(Boolean).join(" - ")||(a==null?void 0:a.name);return e.jsx("option",{value:l,children:p},r)})})]}),e.jsx("br",{}),e.jsxs("div",{className:"size-chart",children:[e.jsx("i",{className:"bi bi-check-lg"}),m.quantity<10?`Only ${m.quantity} left in stock`:`${m.quantity||"No"} available stocks`]}),e.jsx("div",{className:"quantity-selector mt-3",children:e.jsxs("div",{className:"input-group",children:[e.jsx("button",{className:"btn btn-light",onClick:()=>re(-1),style:{width:"40px",borderRadius:"5px",border:"solid 1px black"},children:e.jsx("i",{className:"bi bi-dash-lg quantity-btn"})}),e.jsx("input",{type:"number",className:"form-control text-center",value:k,onChange:s=>w(s.target.value),style:{width:"60px",borderRadius:"5px",color:"black"},min:"1",max:"99",readOnly:!0}),e.jsx("button",{className:"btn btn-light",onClick:()=>re(1),style:{width:"40px",borderRadius:"5px",border:"solid 1px black"},children:e.jsx("i",{className:"bi bi-plus-lg",style:{color:"black"}})})]})}),e.jsxs("div",{className:"sizes",children:[e.jsx("button",{className:"btn btn-dark w-100 mt-3 add-cart",onClick:we,children:"Add to Cart"}),e.jsx("br",{}),e.jsx("br",{})]})]})]})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{className:"rendered-content overflow-auto",dangerouslySetInnerHTML:{__html:a==null?void 0:a.long_desc}})]})]})};export{ft as default};
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.