1import{d as E,aT as W,o as j,a as s,b as v,p as l,aQ as M,S as d,c as g,au as H,w as m,m as z,t as _,f as t,s as L,r as C,U as V,e6 as X,cd as q,L as R,$ as F,F as S,e as f,cF as J,v as A,av as Q,a$ as Y,d_ as P,af as I,X as Z,aO as G,z as O,ab as K,e7 as N,aY as p,q as U,cZ as ee,e8 as te,bc as se,e9 as ie,cJ as ae,aS as ne,ea as le,aM as oe,aa as re}from"./index-DcSVvNrM.js";import{u as B}from"./useLocale-BECgx5XS.js";import{u as ce,R as ue,I as de}from"./useLeaveReviewForm-B43VXZof.js";const ve={class:"expandable-text"},me=["innerHTML"],he=E({__name:"ExpandableText",props:{text:{},maxLines:{}},setup(e){const{t:i}=W(),o=C(null),r=C(!0),c=C(!1);function n(){o.value!=null&&(c.value=o.value.scrollHeight>o.value.clientHeight+1)}function h(){r.value=!r.value}return j(()=>{n()}),(w,b)=>(s(),v("div",ve,[l("div",{ref_key:"rootEl",ref:o,class:d(["expandable-text__content",{"expandable-text__content--collapsed":r.value}]),style:M({"--line-count":e.maxLines}),innerHTML:e.text},null,14,me),c.value?(s(),g(H,{key:0,class:"expandable-text__toggle",onClick:h},{default:m(()=>[z(_(r.value?t(i)("common.readMore"):t(i)("common.collapse")),1)]),_:1})):L("",!0)]))}}),we=V(he,[["__scopeId","data-v-90587103"]]),fe=E({__name:"StringSwitch",props:{height:{},isStatic:{type:Boolean}},setup(e){const i=C(),o=X(),r=Object.keys(o),c=C(0),n=A(()=>r.length>0?r[c.value]:void 0),h=C(!1);function w(){c.value=(c.value+1)%r.length}function b(){h.value&&Q(()=>{w()})}return j(()=>{r.length>1&&q(i,([k])=>{h.value=k.isIntersecting,h.value&&w()})}),(k,T)=>e.isStatic?(s(!0),v(S,{key:0},R(t(r),a=>F(k.$slots,a,{key:a})),128)):(s(),v("div",{key:1,ref_key:"root",ref:i,class:"string-switch",style:M({height:`${e.height}px`})},[f(J,{"enter-from-class":"string-switch__inner--enter-from","enter-active-class":"string-switch__inner--enter-active","enter-to-class":"string-switch__inner--enter-to","leave-active-class":"string-switch__inner--leave-active","leave-to-class":"string-switch__inner--leave-to",onAfterEnter:b},{default:m(()=>[F(k.$slots,n.value,{key:n.value,class:"string-switch__inner"})]),_:3})],4))}}),$=16,ge=E({__name:"SchoolRatingPanel",props:{school:{}},setup(e){const i=e,{t:o,p:r}=B(),{leaveReview:c,AVAILABLE_SCORES:n}=ce(()=>i.school),{trackEvent:h}=Y(),w=[...n].reverse(),b=A(()=>{const a=Object.values(i.school.ratingDistribution).reduce((x,u)=>x+u,0),y={};for(const[x,u]of Object.entries(i.school.ratingDistribution))y[Number(x)]=a>0?Number((u/a*100).toFixed(1)):0;return y});function k(a){const y=i.school.rating??0-a+1;return y>=1?$:y<=0?0:y*$}function T(a){h("Courses School â Rating Panel â Click"),c(a)}return(a,y)=>(s(),g(t(P),null,{default:m(()=>{var x;return[l("div",{class:d(a.$style.panel)},[l("div",{class:d(a.$style.summary)},[l("div",{class:d(a.$style.summary__value)},_(((x=e.school.rating)==null?void 0:x.toFixed(1))??"0"),3),l("div",{class:d(a.$style.summary__stars)},[l("div",null,[(s(!0),v(S,null,R(t(n),u=>(s(),g(t(I),{key:u,name:"star_filled",width:$,height:$}))),128))]),l("div",null,[(s(!0),v(S,null,R(t(n),u=>(s(),v("div",{key:u,style:M({width:`${k(u)}px`})},[f(t(I),{name:"star_filled",width:$,height:$})],4))),128))])],2),l("div",{class:d(a.$style.summary__reviews)},_(t(r)("courses.reviewCounter",e.school.reviewCount)),3)],2),l("div",{class:d(a.$style.distribution)},[(s(!0),v(S,null,R(t(w),u=>(s(),v(S,{key:u},[l("div",{class:d(a.$style.distribution__stars)},[(s(!0),v(S,null,R(u,D=>(s(),g(t(I),{key:D,name:"star_filled",width:12,height:12}))),128))],2),l("div",{class:d(a.$style.distribution__bar)},[l("div",{style:M({width:`${b.value[u]??0}%`})},null,4)],2)],64))),128))],2),l("div",{class:d(a.$style.review),onClick:y[0]||(y[0]=u=>T())},[l("div",{class:d(a.$style.review__title)},_(t(o)("courses.rate")),3),f(ue,{options:t(n),"onUpdate:score":T},null,8,["options"])],2)],2)]}),_:1}))}}),ye="xqFWYQ4X",_e="NxPXbFIp",be="TAVgJluc",ke="taWWLssU",xe="Xrgwbe57",$e="jdY2t-8o",Se="zna89mrl",Le="gayD1Wvm",Ce={panel:ye,summary__value:_e,summary__stars:be,summary__reviews:ke,distribution:xe,distribution__stars:$e,distribution__bar:Se,review:Le,"underlay-in":"hSTsx0J6","modal-enter"
1:"nc16I0L2","modal-enter-slide":"sjl4mrDm"},Re={$style:Ce},Ee=V(ge,[["__cssModules",Re]]),Ie={class:"review-item__author"},Me={key:1,class:"review-item__school"},Te=["title"],Oe={class:"review-item__rating"},Ve=["href"],Ae={class:"review-item__text"},Be=E({__name:"ReviewItem",props:{review:{},withSchool:{type:Boolean,default:!0}},setup(e){const i=e,{t:o}=B(),{open:r,close:c}=Z(),{isWiderThanContent:n}=G(),h=A(()=>{if(!(!i.withSchool||!O(i.review.school)))return{image:ne({uuid:i.review.school.avatarLeonardoUuid??i.review.school.iconLeonardoUuid,width:20,height:20}),link:O(i.review.school.slug)?N(i.review.school.slug):void 0}});function w(){r(de,{title:o("courses.verified.title"),subtitle:o("courses.verified.subtitle"),onClose:()=>{c()}})}return(b,k)=>(s(),g(t(P),{class:"review-item"},{default:m(()=>[l("div",Ie,[f(t(se),{id:e.review.user.id,avatar:e.review.user.avatar,"avatar-sticker":h.value,"is-allow-video-avatar":e.review.user.isPlus,"avatar-size":40,name:e.review.user.name,"badge-id":e.review.user.badgeId,"favorite-collectible":e.review.user.favoriteCollectible,url:t(te)(i.review.user)},{secondary:m(()=>[e.withSchool&&e.review.school&&t(O)(e.review.school.slug)?(s(),g(t(K),{key:0,to:t(N)(e.review.school.slug),class:"review-item__school"},{default:m(()=>[z(_(e.review.school.title),1)]),_:1},8,["to"])):e.withSchool&&e.review.school?(s(),v("span",Me,_(e.review.school.title),1)):L("",!0),f(t(p),null,{default:m(()=>[f(t(fe),{height:18,"is-static":t(n)},U({first:m(()=>[l("div",null,[f(t(ee),{date:e.review.dateCreated},null,8,["date"])])]),_:2},[e.review.isVerified||e.review.isAiSummarized?{name:"second",fn:m(()=>[e.review.isVerified?(s(),v("div",{key:0,class:"review-item__verified",onClick:w},_(t(o)("courses.verified.label")),1)):e.review.isAiSummarized?(s(),v("div",{key:1,class:"review-item__ai-label",title:t(o)("courses.aiLabelTitle")},_(t(o)("courses.aiLabel")),9,Te)):L("",!0)]),key:"0"}:void 0]),1032,["is-static"])]),_:1})]),_:1},8,["id","avatar","avatar-sticker","is-allow-video-avatar","name","badge-id","favorite-collectible","url"]),l("div",Oe,[f(ie,{value:e.review.rating,precision:0},null,8,["value"])])]),e.review.course?(s(),v("a",{key:0,href:e.review.course.url,target:"_blank",rel:"nofollow",class:"review-item__course"},[l("span",null,_(e.review.course.title),1),f(t(I),{name:"arrow_up_right",width:16,height:16})],8,Ve)):L("",!0),l("div",Ae,[f(t(we),{text:t(ae)(e.review.text),"max-lines":5},null,8,["text"])])]),_:1}))}}),Fe=E({__name:"Reviews",props:{items:{},title:{},school:{},sorting:{},sortingOptions:{},isLoading:{type:Boolean},isEnded:{type:Boolean},loadMore:{type:Function}},setup(e){const{t:i}=B();return(o,r)=>(s(),g(t(le),{items:e.items,"is-loading":e.isLoading,"is-handle-ugc-links-with-router":!0,"is-ended":e.isEnded||e.loadMore===void 0,"is-present":e.isLoading||e.items.length>0,"skeleton-items-count":3,"load-more":e.loadMore,"stub-text":t(i)("courses.feed.reviewsStub"),"sorting-options":e.sortingOptions,"active-sorting":e.sorting,behavior:"manual",class:d(o.$style.reviews)},U({item:m(({data:c})=>[(s(),g(Be,{key:c.data.id,review:c.data,"with-school":e.school===void 0},null,8,["review","with-school"]))]),"item-skeleton":m(()=>[f(t(re),{schema:({circle:c,bar:n,gapX:h,gapY:w,fillX:b})=>[[[c("20px")],[h("8px")],[n("100px"),b()],[n("45px")]],[w("20px"),n("66%"),n("33%")],[w("30px"),n("100px")],[w("5px")],[[n("175px","20px"),b()],[n("90px","34px")]]]},null,8,["schema"])]),_:2},[e.title||e.school?{name:"header",fn:m(()=>[e.school?(s(),g(Ee,{key:0,school:e.school,class:d(o.$style.reviews__rating)},null,8,["school","class"])):L("",!0),e.title?(s(),g(t(oe),{key:1,title:e.title},null,8,["title"])):L("",!0)]),key:"0"}:void 0]),1032,["items","is-loading","is-ended","is-present","load-more","stub-text","sorting-options","active-sorting","class"]))}}),Ne="hjRX5wUy",je="_31WBQkj6",ze={reviews:Ne,reviews__rating:je,"underlay-in":"FC0OuqvT","modal-enter":"-lswwuuv","modal-enter-slide":"_6XMiekrj"},Pe={$style:ze},He=V(Fe,[["__cssModules",Pe]]);export{He as R};
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.