const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BZco6cza.js","assets/vendor-DJC-2VPc.js","assets/vendor-DXOeSP1F.css","assets/index-DRuTtKnM.css"])))=>i.map(i=>d[i]);
import{F as O,P as n,_ as i,R as t,a1 as l,T as f,Q as c,W as p,a0 as h,X as k,ag as ee,m as o,aM as te,r as d,bU as se,as as B,b as ae,e,a2 as P,a6 as I,a7 as D,az as ie,ad as le,bH as ne}from"./vendor-DJC-2VPc.js";import{j as oe,M as N,bc as ce,cb as re,i as ue,f as _e,cc as me,n as A}from"./index-BZco6cza.js";import{W as de,_ as pe}from"./wishlist-product-item-skeleton-CmlAZ0JF.js";import{P as he}from"./product-skeleton-grid-DjqEhtTY.js";const ge={class:"list-summary__content"},ye={key:0},ve=O({__name:"wishlist-summary",props:{list:{}},setup(w){return(r,L)=>{const V=n("VcPriceDisplay"),g=n("VcWidget");return t(),i(g,{id:"list-summary",class:"list-summary",title:r.$t("common.titles.order_summary")},{default:l(()=>[f("div",ge,[f("span",null,h(r.$t("common.labels.subtotal")),1),r.list.subTotal?(t(),c("span",ye,[k(V,{value:r.list.subTotal},null,8,["value"])])):p("",!0)])]),_:1},8,["title"])}}}),ke={key:0,class:"shared-list__skeleton-mobile"},fe={key:1,class:"shared-list__skeleton-desktop"},Ve={class:"shared-list__items"},be={key:0,class:"shared-list__page-limit"},Ee=O({__name:"shared-list",props:{sharingKey:{}},setup(w){const r=w,L=ie(()=>le(()=>import("./index-BZco6cza.js").then(s=>s.dn),__vite__mapDeps([0,1,2,3]))),{getModuleSettings:V}=oe(N.MODULE_ID),{analytics:g}=ce(),{t:U}=ee(),{listLoading:y,list:a,fetchSharedWishList:K}=re(),{cart:G}=ue(),{continue_shopping_link:E}=V({[N.CONTINUE_SHOPPING_LINK]:"continue_shopping_link"}),H=te(ne);_e({title:o(()=>U("pages.account.list_details.meta.title",[a.value?.name]))});const C=o(()=>({item_list_id:"wishlist",item_list_name:`Wishlist "${a.value?.name}"`,related_id:a.value?.id,related_type:"wishlist"})),R=H.smaller("lg"),W=d(),z=d({}),v=d(6),u=d(1),b=d([]),F=o(()=>se(G.value?.items,"sku")),X=o(()=>b.value.map(s=>me(s,F.value[s.sku]?.quantity))),$=o(()=>Math.ceil((b.value.length??0)/v.value)),M=o(()=>X.value.slice((u.value-1)*v.value,u.value*v.value)),S=o(()=>M.value.length||v.value);function j(s){s&&g("selectItem",s,C.value)}return B(async()=>{await K(r.sharingKey),u.value=1,b.value=ae(a.value?.items)??[]}),B(()=>{const s=a.value?.items?.map(_=>_.product).filter(_=>!!_);s?.length&&g("viewItemList",s,C.value)}),(s,_)=>{const q=n("VcTypography"),x=n("VcPagination"),Q=n("VcWidget"),Y=n("VcLayout"),T=n("VcButton"),J=n("VcEmptyView"),Z=n("VcContainer");return t(),i(Z,{class:"shared-list"},{default:l(()=>[e(a)?.name?(t(),i(q,{key:0,tag:"h1",class:"shared-list__name"},{default:l(()=>[P(h(e(a).name),1)]),_:1})):p("",!0),f("div",{ref_key:"listElement",ref:W,class:"shared-list__content"},[e(y)?(t(),c(I,{key:0},[e(R)?(t(),c("div",ke,[(t(!0),c(I,null,D(S.value,m=>(t(),i(e(he),{key:m}))),128))])):(t(),c("div",fe,[(t(!0),c(I,null,D(S.value,m=>(t(),i(e(de),{key:m,class:"shared-list__skeleton-desktop-item"}))),128))]))],64)):!e(y)&&e(a)?.items?.length?(t(),i(Y,{key:1,"sidebar-position":"right","sticky-sidebar":""},{sidebar:l(()=>[k(ve,{list:e(a)},null,8,["list"])]),default:l(()=>[k(Q,{size:"lg"},{default:l(()=>[f("div",Ve,[k(e(pe),{items:M.value,"pending-items":z.value,editable:!1,navigatable:!1,onLinkClick:j},null,8,["items","pending-items"]),u.value>=e(A)?(t(),c("p",be,h(s.$t("ui_kit.reach_limit.page_limit")),1)):p("",!0),$.value>1?(t(),i(x,{key:1,page:u.value,"onUpdate:page":_[0]||(_[0]=m=>u.value=m),pages:Math.min($.value,e(A)),"scroll-target":W.value,"scroll-offset":60},null,8,["page","pages","scroll-target"])):p("",!0)])]),_:1})]),_:1})):!e(y)&&e(a)?.items?.length===0?(t(),i(J,{key:2,text:s.$t("shared.wishlists.list_details.empty_list"),icon:"outline-lists"},{button:l(()=>[e(E)?(t(),i(T,{key:0,"external-link":e(E)},{default:l(()=>[P(h(s.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1},8,["external-link"])):(t(),i(T,{key:1,to:"/"},{default:l(()=>[P(h(s.$t("shared.wishlists.list_details.empty_list_button")),1)]),_:1}))]),_:1},8,["text"])):!e(y)&&!e(a)?(t(),i(e(L),{key:3})):p("",!0)],512)]),_:1})}}});export{Ee as default};
//# sourceMappingURL=shared-list-DfIoc56Z.js.map
