(()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};t.d({},{t_:()=>R,AJ:()=>A,gw:()=>L,DW:()=>D,qS:()=>B,r4:()=>O,v:()=>C});async function e(t,e){if(R('#tt-carousel[data-type="barrage"]'))return;const{swiperStyle:i,lang:r}=C,n=C.columns[e],o=L("#trustoo-barrage-carousel",t.is_home_active,t.is_product_active,C.otherPageInsert.barrage);if(!o)return;C.barrageSpeed=1e3*t.speed;const a={};1===t.show_reviews?a.is_show_all=1:2===t.show_reviews?a.is_feature=1:5===t.show_reviews&&(C.productId?a.product_id=C.productId:a.is_show_all=1),1!==t.is_show_empty_review&&(a.no_empty=1);const c=await C.request("getReviews",a);let l=null,d=null;if(c[0])return;if(0===c[1].list.length)return;l=c[1].list,d=c[1].total_rating,C.reviewsLists[e]=l;let u="",p="";const v=t;i.textContent+=`\n\t#tt-carousel{\n\t\t--title-color: ${v.title_color};\n\t\t--desc-color: ${v.description_color};\n\t\t--block-bg-color:${v.block_bg_color};\n\t\t--card-bg-color:${t.widget_layout_card_bg_color};\n\t\t--card-radius:${v.card_border_radius}px;\n\t\t--photo-radius: ${t.image_border_radius+"px"};\n\t}\n\t${D(v,"barrage")}\n\t`;const w=l.length;let _=null,g=null;let h="first";w>(C.isMobile?5:10)?(_=l.filter(((t,e)=>e%2==0)),g=l.filter(((t,e)=>e%2!=0))):_=l,g?p=s(g,t,"second"):h="single",u=s(_,t,h);let f="";if(1===t.is_show_description){const e=`${d.total_reviews}`;f=`
${r.card_carousel.barrage.desc.replace("{{total_rating}}",d.rating).replace("{{total_reviews}}",e)}
`}const m=t.write_review_type;o.insertAdjacentHTML("beforeend",`\n
\n
\n\t\t${1===t.is_show_title?`
${r.card_carousel.barrage.title}
`:""}\n\t\t${f}\n\t\t${1===t.show_review_btn?`
${"product"===m?r.write_reviews:r.store_review.write_btn_text}
`:""}\n
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t${u}\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t${p?`
`:""}\n\t\t\t\t\n
\n\t\t\t\n
\n
\n
\n `);const y=R('#tt-carousel[data-type="barrage"] #tt-carousel-list'),$=parseInt(getComputedStyle(y).width);C.isMobile?C.columns[e]=w<=2?1:2:w<5&&w>=3?C.columns[e]=w-1:w<3&&(C.columns[e]=w);const b=C.columns[e]-1,x=452*C.columns[e]+32*b;x<$&&(y.style.width=x+"px",y.style.margin="0 auto"),C.isMobile&&1===w?R(".tt-carousel-row",y).style.width=R(".tt-card",y).style.width="100%":A(".tt-carousel-row",y).forEach((t=>t.style.width=x+"px"))}function s(t,e,s){return t.reduce(((t,i,r)=>{let n="",o="";if(i.resources.length){const t=e.show_photos_option;if(1===t){const t=i.resources[0];o=(2===t.resource_type?t.thumb_src:t.src)||i.product_image_src}else 2===t&&(o=i.product_image_src)}else o=i.product_image_src;let a="",c=r;"single"!==s&&(c=2*r,"second"===s&&(c+=1)),a=o?`
`:O("noImage"),n+=`\n\t\t\t\t${a}\n\t\t\t\t
`,n=`${n}
`;return t+=`\n\t\t\n
\n\t\t
\n\t\t${n}
\n\t\t
\n\t\t
${i.author}
\n\t\t\t
${B(i.star,C)}
\n\t\t
\n\t\t
${i.content}
\n\t\t
\n `}),"")}async function i(t,e){if(R('#tt-carousel[data-type="photo"]'))return;const{swiperStyle:s,lang:i}=C,r=C.columns[e],n=L("#trustoo-photo-carousel",t.is_home_active,t.is_product_active,C.otherPageInsert.photo);if(!n)return;const o={has_resource:1};1===t.show_reviews?o.is_show_all=1:2===t.show_reviews?o.is_feature=1:5===t.show_reviews&&(C.productId?o.product_id=C.productId:o.is_show_all=1),1!==t.is_show_empty_review&&(o.no_empty=1);const a=await C.request("getReviews",o);let c=null,l=null;if(a[0])return;if(0===a[1].list.length)return;c=a[1].list,l=a[1].total_rating,C.reviewsLists[e]=c;const d=c.length;let u="";const p=t;s.textContent+=`\n\t#tt-carousel[data-type=photo]{\n\t\t--btn-bg-color: ${p.scroll_bg_color};\n\t\t--title-color: ${p.title_color};\n\t\t--desc-color: ${p.description_color};\n\t\t--star-bg-color:${p.stars_bg_card_color||"#fff"};\n\t\t--block-bg-color:${p.block_bg_color||"#fff"};\n\t\t--card-radius:${p.card_border_radius}px;\n\t}\n\t#tt-carousel[data-type=photo] .resource-list{\n\t\theight: ${204*(1==p.photo_ratio?1:1.33)}px\n\t}\n\t${D(p,"photo")}\n\t`;const v=t.scroll_buttons_icon_color;c.forEach(((s,i)=>{let r="";1===t.is_show_verified_purchase&&1===s.verified_badge&&(r=C.badgeIconSvg);const n=s.resources[0];if(!n)return;const o=2===n.resource_type?n.thumb_src:n.src,a=2===n.resource_type?O("video"):"",c=`\n\t\t

\n\t\t ${a}\n\t\t
`;u+=`\n\t\t\n
\n\t\t
\n\t\t${c}
\n\t\t
\n\t\t\t
${s.author}
${1===s.verified_badge?r:""}
\n\t\t
${s.content}
\n\t\t
\n `}));let w="";if(1===t.is_show_description){const e=`${l.total_reviews}`;w=`${i.card_carousel.photo.desc.replace("{{total_rating}}",l.rating).replace("{{total_reviews}}",e)}
`}const _=t.write_review_type;n.insertAdjacentHTML("beforeend",`\n
\n
\n\t\t${1===t.is_show_title?`
${i.card_carousel.photo.title}
`:""}\n\t\t${w}\n\t\t${1===t.show_review_btn?`
${"product"===_?i.write_reviews:i.store_review.write_btn_text}
`:""}\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n ${u}\n\t\t\t
\n
\n
\n\t\t\t${d>C.columns[e]?`
${O("scrollBtn",v)}
\n\t\t\t
${O("scrollBtn",v)}
`:""}\n
\n
\n
\n
\n `)}async function r(t,e){if(R('#tt-carousel[data-type="primary"]'))return;let s="initial";const{swiperStyle:i}=C,r=C.columns[e],n=L("#trustoo-card-carousel-widget",t.is_home_active,t.is_product_active,C.otherPageInsert.primary);if(!n)return;const o={};1===t.show_reviews?o.is_show_all=1:2===t.show_reviews?o.is_feature=1:5===t.show_reviews&&(C.productId?o.product_id=C.productId:o.is_show_all=1),1!==t.is_show_empty_review&&(o.no_empty=1);const a=await C.request("getReviews",o);let c=null,l=null;if(a[0])return;if(0===a[1].list.length)return;c=a[1].list,l=a[1].total_rating,C.reviewsLists[e]=c;const d=c.length;d