1import{u as O,l as H,m as J,p as Q,H as Y,r as C,A as K,c as m,B as U,q as X,Q as Z,o as u,a as g,d as h,e as w,g as s,b as t,f as a,t as o,L as D,M as q,j as tt,F as B,i as st,n as et,h as ot,k as lt,y as it}from"./CmK6CKXe.js";import{E as at}from"./zEHh84nF.js";import{_ as nt}from"./DkKXXcxi.js";import{_ as ct}from"./Dqz4P5cR.js";import"./Ck5zNLXD.js";import{b as dt,a as rt,o as _t,e as ut,aW as ht,s as pt,E as vt}from"./Ca7MhhFG.js";import{u as mt}from"./BrJ0jLXs.js";const gt={ref:"childVideo",class:"w-full",controls:""},wt=["src"],ft={class:"relative swiper-child-card-container fixed-w-container"},bt={key:0,class:"child-card-swiper"},xt={class:"child-profile flex justify-center items-center"},kt={class:"flex items-center text-gray-600 animate-pulse"},yt={class:"text-base md:text-xl"},Ct={key:1,class:"child-card-swiper"},$t={class:"w-full"},St={class:"wvt-child__photo"},Lt=["src","alt"],It={class:"wvt-child__content"},jt={class:"wvt-child__text"},Mt={class:"wvt-child__name font-bold"},Nt={class:"text-base"},Tt={class:"wvt-child__share text-primary-normal my-5"},Dt=["src"],qt={class:"wvt-child__sponsor"},Bt={class:"wvt-child__price text-primary-normal text-lg"},Rt=["src"],Vt={class:"wvt-child__photo"},Et=["src","alt","onClick"],Pt={class:"wvt-child__content"},At={class:"wvt-child__text"},Gt={class:"wvt-child__name font-bold"},Wt={class:"text-base"},zt={class:"wvt-child__share text-primary-normal my-5"},Ft=["onClick"],Ot=["src"],Ht={class:"wvt-child__sponsor"},Jt={class:"wvt-child__price text-primary-normal text-lg"},Qt=["onClick","data-test"],Yt=["src"],os={__name:"ChildCard",props:{campaignId:Number,isCampaign:Boolean,campaignName:String},setup(R){const $=R,V=O(),x=mt(),E=dt(),S=rt(),{t:n,locale:P}=H(),A=J(),L=Q(),k=Y(),f=C(!1),I=C(""),y=C(!0);K($);const G=m(()=>E.isLogin),W=m(()=>V.isMobile),i=m(()=>x.children.data.length>0?x.children.data:[]),z=m(()=>x.children.isLoading);m(()=>S.totalPrice);const{public:{assetsImgBase:d}}=lt(),F=U("hasRoutePath",{maxAge:60*30,secure:!0});X(()=>{y.value=P.value==="zh-TW"});const j=p=>{f.value=!0,I.value=p},M=async(p,e)=>{const b=p.variants[0];let r="regular",_=null;L.path.includes("search")?r="search":L.path.includes("campaign")&&(r="product_campaign",_=$.campaignId);const c=_t(b,p,e);if(ut({...c,wvt_sp_m_code:r,campaign_id:_}),window.dataLayer.push({event:"add_to_cart",ecommerce:{currency:"TWD",value:parseInt(c.quantity)*parseInt(c.price),items:[ht({...c,wvt_sp_m_code:r,campaign_id:_})]}}),window.dataLayer.push({event:"sponsorship_child"}),G.value){const v={formatCart:{...c,wvt_sp_m_code:r,campaign_id:_},from:"userChild"};S.addItemInCart(v)}else{const v=JSON.stringify({...c,wvt_sp_m_code:r,campaign_id:_});F.value="/cart",pt("childToCart",v,"30min"),vt.warning(n("loginRequired")),k.push(A("/login"))}};return(p,e)=>{const b=it,r=at,_=nt,c=Z("big"),v=ct;return u(),g(B,null,[h(_,null,{default:w(()=>[h(r,{"model-value":s(f),"destroy-on-close":"",width:s(W)?"100%":"65%","show-close":!1,class:"child-video",onClose:e[1]||(e[1]=l=>f.value=!1)},{default:w(()=>[h(b,{name:"fa6-solid:xmark",class:"mb-2 text-2xl md:text-3xl md:-mr-8 text-white hover:cursor-pointer",onClick:e[0]||(e[0]=l=>f.value=!1)}),t("video",gt,[t("source",{src:s(I),type:"video/mp4"},null,8,wt),e[5]||(e[5]=a(" Your browser does not support the video tag. "))],512)]),_:1},8,["model-value","width"])]),_:1}),t("div",ft,[s(z)?(u(),g("div",bt,[t("div",xt,[t("div",kt,[h(b,{name:"fa6-solid:children",class:"text-xl md:text-2xl mr-2"}),t("p",yt,o(s(n)("loading")),1)])])])):s(i).length===1?(u(),g("div",Ct,[t("div",$t,[t("div",{class:"wvt-child",style:D({backgroundImage:`url(${s(d)}/sp/${s(y)?"kid_bk2.gif":"kid_bk2_en.png"})`})},[t("div",St,[t("img",{src:s(i)[0].image?s(i)[0].image.link:`${s(d)}/no_picture.jpg`,alt:s(i)[0].image?s(i)[0].image.alt_text:"child image",draggable:"false",class:"cursor-pointer",onClick:e[2]||(e[2]=l=>s(k).push(`/sponsorships/${s(i)[0].id}`))},null,8,Lt)]),t("div",It,[t("div",jt,[t("h3",Mt,o(s(n)("childGreeting")+s(i)[0].child.name),1),t("p",Nt,o(s(i)[0].child.description),1),t("div",Tt,[t("h4",null,o(s(n)("aboutMe")),1),t("ul",null,[t("li",null,[a(o(s(n)("chore"))+"ï¼",1),t("span",null,o(s(i)[0].child.chore_text),1)]),t("li",null,[a(o(s(n)("favoriteThing"))+"ï¼",1),t("span",null,o(s(i)[0].child.favorite_subject_text),1)]),t("li",null,[a(o(s(n)("schoolLevel"))+"ï¼",1),t("span",null,o(s(i)[0].child.school_level_text),1)])])]),t("button",{class:"wvt-child__video wvt-button-index",onClick:e[3]||(e[3]=l=>j(s(i)[0].child.intro_video_link))},[e[6]||(e[6]=a(" çæçå½±ç")),t("img",{class:"object-contain aspect-square w-6",src:`${s(d)}/sp/icon_videoplay.svg`,alt:"video play"},null,8,Dt)])]),t("div",qt,[t("div",Bt,[h(c,{class:"font-bold"},{default:w(()=>
1e[7]||(e[7]=[a("700")])),_:1}),e[8]||(e[8]=a(" å
/æ"))]),t("button",{class:"wvt-button wvt-button-contain wvt-button-index md:!text-lg",onClick:e[4]||(e[4]=q(l=>M(s(i)[0],!0),["stop"])),draggable:"false","data-cy":"sponsor-child","data-test":"sponsor-child-0"},[e[9]||(e[9]=a(" è³å©æ ")),t("img",{class:"object-contain aspect-square w-6",src:`${s(d)}/cart/icon_cart-white.svg`,alt:"cart"},null,8,Rt)])])])],4)])])):s(i).length>1?(u(),tt(v,{key:2,name:"sp-child",slidesNum:s(i).length,class:"child-card-swiper",navigation:"",sp:""},{default:w(()=>[(u(!0),g(B,null,st(s(i),(l,N)=>(u(),g("div",{key:l.id,class:et(["slide",`sp-child-slide sp-child-slide-${N+1}`])},[t("div",{class:"wvt-child",style:D({backgroundImage:`url(${s(d)}/sp/${s(y)?"kid_bk2.gif":"kid_bk2_en.png"})`})},[t("div",Vt,[t("img",{src:l.image?l.image.link:`${s(d)}/no_picture.jpg`,alt:l.image?l.image.alt_text:"child image",draggable:"false",class:"cursor-pointer",onClick:T=>s(k).push(`/sponsorships/${l.id}`)},null,8,Et)]),t("div",Pt,[t("div",At,[t("h3",Gt,o(s(n)("childGreeting")+l.child.name),1),t("p",Wt,o(l.child.description),1),t("div",zt,[t("h4",null,o(s(n)("aboutMe")),1),t("ul",null,[t("li",null,[a(o(s(n)("chore"))+"ï¼",1),t("span",null,o(l.child.chore_text),1)]),t("li",null,[a(o(s(n)("favoriteThing"))+"ï¼",1),t("span",null,o(l.child.favorite_subject_text),1)]),t("li",null,[a(o(s(n)("schoolLevel"))+"ï¼",1),t("span",null,o(l.child.school_level_text),1)])])]),t("button",{class:"wvt-child__video wvt-button-index",onClick:T=>j(l.child.intro_video_link)},[e[10]||(e[10]=a(" çæçå½±ç")),t("img",{class:"object-contain aspect-square w-6",src:`${s(d)}/sp/icon_videoplay.svg`,alt:"video play"},null,8,Ot)],8,Ft)]),t("div",Ht,[t("div",Jt,[h(c,{class:"font-bold"},{default:w(()=>e[11]||(e[11]=[a("700")])),_:1}),e[12]||(e[12]=a(" å
/æ"))]),t("button",{class:"wvt-button wvt-button-contain wvt-button-index md:!text-lg",onClick:q(T=>M(l,!0),["stop"]),draggable:"false","data-cy":"sponsor-child","data-test":`sponsor-child-${N}`},[e[13]||(e[13]=a(" è³å©æ ")),t("img",{class:"object-contain aspect-square w-6",src:`${s(d)}/cart/icon_cart-white.svg`,alt:"cart"},null,8,Yt)],8,Qt)])])],4)],2))),128))]),_:1},8,["slidesNum"])):ot("",!0)])],64)}}};export{os as _};
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.