PageSourceSearch

https://fontedavida.com.br/assets/Single-DTIsopyA.js

js fontedavida.com.br collected 2026-09-26 18:04:35 UTC 7,265 bytes, 1 lines download raw bytes

1import{A as u}from"./readingPlan-DTBcYAS7.js";import{_ as U,b as k,c as a,o as n,a as o,g as h,F as g,s as y,d as I,e as f,w,Z as b,t as c,a1 as N,ak as M,T as S,n as P}from"./index-sUPB-bMu.js";const T={name:"PlanSingle",props:{planUUID:{type:String,required:!0},subscriptionUuid:{type:String,required:!1,default:""},planName:{type:String,required:!1,default:""},description:{type:String,required:!1,default:""}},data(){return{showDropdown:!1,plan:[],checkIns:[],loading:!1,viewMore:!1,loadingSubscribe:!1,progress:{completionPercentage:null,goalsCompleted:null,goalsTotal:null},alertBox:{type:null,message:null}}},computed:{lastCheckGoalUuid(){const t=this.checkIns.flatMap(i=>i.goals).filter(i=>i.checkInUuid&&i.goalUuid);return t.length>0?t.at(-1).goalUuid:null},isEmbed(){return!!this.$route.name.startsWith("embed")},planDescription(){return this.description||this.plan.description},isMyPlan(){return!!this.subscriptionUuid}},created(){this.$useHead({title:this.$t("VIDEOS.INDEX.TITLE")})},async mounted(){window.addEventListener("click",this.onClick),this.isMyPlan?await this.getMyPlan():await this.getPlan()},beforeUnmount(){window.removeEventListener("click",this.onClick)},methods:{async getPlan(){try{this.loading=!0;const e=await u.getReadinPlan(this.planUUID);this.plan=e.data.data}catch{this.alertBox={type:"error",message:this.$t("GLOBAL.ERROR.GENERIC_ERROR")}}finally{this.loading=!1}},async getMyPlan(){try{this.loading=!0;const e=[u.getMyReadinPlansCheckIns(this.subscriptionUuid),u.getMyReadinPlansProgress(this.subscriptionUuid)];this.description||e.push(u.getReadinPlan(this.planUUID));const[t,i,m]=await Promise.all(e);m&&(this.plan=m?.data?.data),this.progress=i.data.data,this.checkIns=t.data.data}catch{this.alertBox={type:"error",message:this.$t("GLOBAL.ERROR.GENERIC_ERROR")}}finally{this.loading=!1,this.$nextTick(()=>{requestAnimationFrame(()=>{this.scrollToElement()})})}},toggleDropdown(){this.showDropdown=!this.showDropdown},onClick(e){const t=this.$refs.dropdown,i=this.$refs.dropdownButton;this.isMyPlan&&!i?.contains(e.target)&&!t?.contains(e.target)&&(this.showDropdown=!1)},routeNameDelete(){return this.$route.name.startsWith("embed")?"embedDeletePlan":"deletePlan"},async subscribe(){try{this.loadingSubscribe=!0,await u.postSubscribePlan(this.planUUID),this.goToMyPlansPage()}catch(e){if(e.response.data.error==="Subscription already created"){this.goToMyPlansPage();return}}finally{this.loadingSubscribe=!1}},async postCheckIn(e){try{this.loading=!0,await u.postCheckInGoal(e),await this.getMyPlan()}catch{}finally{this.loading=!1}},async deleteCheckIn(e){try{this.loading=!0,await u.deleteCheckInGoal(e),await this.getMyPlan()}catch{}finally{this.loading=!1}},async replaceToMyPlan(){await this.getMyPlan();const e=this.$route.name.startsWith("embed")?"embedPlansSingle":"plansSingle";this.$router.replace({name:e,params:{planUUID:this.planUUID},query:{isMyPlan:!0}})},goToMyPlansPage(){const e=this.$route.name.startsWith("embed")?"embedPlansAll":"plansAll";this.$router.replace({name:e,query:{page:"MyPlans"}})},hasCheckIn(e){return e.some(t=>t.goals.some(i=>i.checkIn.length))},getTotalChecks(e){return e.reduce((t,i)=>t+i.goals.reduce((m,s)=>m+s.checkIn.length,0),0)},scrollToElement(){const e=document.getElementById(this.lastCheckGoalUuid);if(e){const i=e.getBoundingClientRect().top+window.scrollY-122;window.scrollTo({top:i,behavior:"smooth"})}}}},L={key:0,class:"loading"},B={class:"loading__title"},A={class:"loading__list"},G={key:1,class:"plan-page"},x={class:"header"},O={key:0,class:"header__menu"},j={ref:"dropdown",class:"header__menu__dropdown"},q={class:"title"},V={key:0,class:"description_container"},W={key:1,class:"progress-wrapper"},F=["max","value"],H={key:2,class:"button-wrapper item-padding"},z={class:"list__title"},X=["id","target","href"],Y={class:"objective__title"},Z={class:"list__title"},J=["id"],K=["target","href","onClick"],Q={class:"objective__title"};function $(e,t,i,m,s,l){const v=k("SkeletonElement"),E=k("PageContentHeader"),p=k("SvgElement"),C=k("RouterLink"),D=k("AlertBox");return s.loading?(n(),a("div",L,[o("div",B,[h(v,{height:"100%"})]),o("div",A,[(n(),a(g,null,y(6,(d,_)=>o("div",{key:_,class:"loading__button"},[h(v,{height:"100%"})])),64))])])):(n(),a("div",G,[o("div",x,[h(E,{padded:!0},{default:w(()=>
1[b(c(e.$t("READING_PLAN.MODULE_NAME")),1)]),_:1}),l.isMyPlan?(n(),a("div",O,[o("div",{ref:"dropdownButton",onClick:t[0]||(t[0]=(...d)=>l.toggleDropdown&&l.toggleDropdown(...d))},[h(p,{class:"header__menu__icon",name:"ThreeDots"})],512),h(S,{name:"fade",appear:""},{default:w(()=>[N(o("div",j,[h(C,{class:"header__menu__dropdown__item",to:{name:l.routeNameDelete(),params:{planUUID:i.subscriptionUuid}}},{default:w(()=>[h(p,{name:"TrashCanThin",title:"Delete"}),b(" "+c(e.$t("READING_PLAN.SINGLE.BUTTON.DELETE")),1)]),_:1},8,["to"])],512),[[M,s.showDropdown]])]),_:1})])):f("",!0)]),s.alertBox.message?(n(),I(D,{key:0,type:s.alertBox.type},{default:w(()=>[b(c(s.alertBox.message),1)]),_:1},8,["type"])):(n(),a(g,{key:1},[o("h4",q,c(s.plan.title||i.planName),1),l.planDescription?(n(),a("div",V,[o("p",{class:P(["description",{"description__line-clamp":!s.viewMore}])},c(l.planDescription),3),l.planDescription.length>300?(n(),a("p",{key:0,class:"see-more-btn",onClick:t[1]||(t[1]=d=>s.viewMore=!s.viewMore)},c(s.viewMore?e.$t("READING_PLAN.SINGLE.VIEW_LESS"):e.$t("READING_PLAN.SINGLE.VIEW_MORE")),1)):f("",!0)])):f("",!0),l.isMyPlan?(n(),a("div",W,[o("progress",{id:"file",max:s.progress.goalsTotal,value:s.progress.goalsCompleted},null,8,F),o("small",null,c(s.progress.completionPercentage)+"%",1),s.progress.completionPercentage===100?(n(),I(p,{key:0,name:"CheckCircle",type:"other",class:"check-icon",width:"1rem",he
1igth:"1rem"})):f("",!0)])):(n(),a("div",H,[o("button",{class:P(["button btn btn--color-primary",{"btn--loading":s.loadingSubscribe}]),onClick:t[2]||(t[2]=(...d)=>l.subscribe&&l.subscribe(...d))},c(e.$t("READING_PLAN.SINGLE.BUTTON.START")),3)])),t[3]||(t[3]=o("div",{class:"separator"},null,-1)),l.isMyPlan?(n(!0),a(g,{key:4},y(s.checkIns,(d,_)=>(n(),a("div",{key:_,class:"list item-padding"},[o("h5",Z,c(d.objectiveTitle),1),(n(!0),a(g,null,y(d.goals,r=>(n(),a("div",{id:r.goalUuid,key:r.goalUuid,class:"wrapper"},[h(p,{name:r.checkedIn?"CheckCheckedRetangular":"CheckEmptyRetangular",title:"select",class:"objective__check",onClick:R=>r.checkedIn?l.deleteCheckIn(r.checkInUuid):l.postCheckIn(r.goalUuid)},null,8,["name","onClick"]),o("a",{class:"objective",target:l.isEmbed?void 0:"_blank",rel:"noopener noreferrer",href:r.goalLink,onClick:R=>!r.checkedIn&&l.postCheckIn(r.goalUuid)},[o("p",Q,c(r.goalTitle),1),h(p,{class:"objective__chevron",name:"ChevronRight",title:"More",width:"0.8rem",height:"0.8rem"})],8,K)],8,J))),128))]))),128)):(n(!0),a(g,{key:3},y(s.plan.objectives,(d,_)=>(n(),a("div",{key:_,class:"list item-padding"},[o("h5",z,c(d.title),1),(n(!0),a(g,null,y(d.goals,r=>(n(),a("a",{id:r.uuid,key:r.uuid,class:"objective",target:l.isEmbed?void 0:"_blank",rel:"noopener noreferrer",href:r.link},[o("p",Y,c(r.title),1),h(p,{class:"objective__chevron",name:"ChevronRight",title:"More",width:"0.8rem",height:"0.8rem"})],8,X))),128))]))),128))],64))]))}const se=U(T,[["render",$],["__scopeId","data-v-4cbea6da"]]);export{se 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.