1import{a1 as S,af as b,cC as z,c as x,r as s,a3 as C,Y as P,a4 as R,ah as D,M as c,N as a,a5 as l,ai as V,an as A,al as j,D as y}from"./CqWH0BZP.js";import{u as q}from"./DtysEf6Z.js";import{p as B}from"./DefO3alU.js";import"./DuPoDUne.js";import"./wdic_FQ1.js";import"./DQE77ral.js";import"./D1nErt21.js";import"./DFiheZjC.js";import"./DRNKrJGC.js";import"./BoA7liN9.js";import"./7SBfHb3l.js";import"./PyyIl4xt.js";import"./uHKR0ql4.js";import"./Dl-x8CJl.js";import"./DT6pKBTi.js";import"./D0mAmvsc.js";import"./BCFd6tDZ.js";import"./C3h9HDah.js";const N={key:0,class:"pdp-v2-description"},O={key:0,class:"pdp-v2-description__loading"},F=["innerHTML"],I=["aria-label"],U=S({__name:"Description",props:{element:{type:Object,required:!0}},async setup(g){let d,v;const _=g,{t:p}=b(),{product:u,initPdpV2Product:M}=q();[d,v]=z(()=>M()),await d,v();const f=_.element.extra,h=_.element.extra?.customText?.value?.productDetailSection,k=x(()=>f?.descriptionShowMoreText?.value??h?.descriptionShowMoreText??p("ecommerce.common.show_more")),L=x(()=>f?.descriptionShowLessText?.value??h?.descriptionShowLessText??p("ecommerce.common.show_less")),t=s(!1),r=s(null),n=s(0),w=s(""),o=s(!1);let i;const m=()=>{r.value&&setTimeout(()=>{r.value&&(n.value=r.value.scrollHeight)},100)},E=()=>{if(!u.value?.description){o.value=!0,n.value=0;return}const e=document.createElement("div");e.innerHTML=B.sanitize(u.value.description),e.querySelectorAll("*").forEach(T=>T.removeAttribute("style")),w.value=e.innerHTML,o.value=!0,y(()=>m())},H=()=>{t.value=!t.value};return C(()=>{E(),P(()=>t.value,()=>y(m));const e=()=>{i&&clearTimeout(i),i=setTimeout(m,200)};window.addEventListener("resize",e),R(()=>{i&&clearTimeout(i),window.removeEventListener("resize",e)})}),(e,T)=>D(u)?.description?(c(),a("div",N,[o.value?l("",!0):(c(),a("div",O)),o.value?(c(),a("div",{key:1,ref_key:"descriptionRef",ref:r,class:V([t.value?"pdp-v2-description__content--full":"pdp-v2-description__content",{"pdp-v2-description__content--clamped":!t.value&&n.value>=350}]),innerHTML:w.value},null,10,F)):l("",!0),n.value>=350&&o.value?(c(),a("a",{key:2,href:"#",class:"pdp-v2-description__toggle",role:"button","aria-label":D(p)("ecommerce.common.toggle_description"),onClick:A(H,["prevent"])},j(t.value?L.value:k.value),9,I)):l("",!0)])):l("",!0)}}),le=Object.assign(U,{__name:"PreviewElementsEcommercePdpV2Description"});export{le 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.