1"use strict";(self.webpackChunkpaid=self.webpackChunkpaid||[]).push([[546],{2546:(D,f,s)=>{s.r(f),s.d(f,{SelectTestModule:()=>B});var d=s(6362),l=s(3979),m=s(5228),T=s(7138),t=s(3184),u=s(5615),p=s(6001),v=s(2091),S=s(489),y=s(5397),w=s(6618),M=s(2246),x=s(4693),P=s(220),b=s(5185),O=s(4057),A=s(7514);function _(n,i){if(1&n&&(t.TgZ(0,"p",20),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,"cs."+e.text)," ")}}function Z(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14)(1,"div",8),t._UZ(2,"h3",15),t.ALo(3,"translate"),t.qZA(),t.TgZ(4,"div",16)(5,"div",17),t.YNc(6,_,3,3,"p",18),t.ALo(7,"translate"),t.TgZ(8,"button",19),t.NdJ("click",function(){t.CHM(e);const a=t.oxw().$implicit;return t.oxw().createSession(a.id)}),t.TgZ(9,"span"),t._uU(10),t.ALo(11,"translate"),t.qZA(),t._UZ(12,"app-i-arrow"),t.qZA()()()()}if(2&n){const e=t.oxw().$implicit,o=t.oxw();t.xp6(2),t.Q6J("innerHTML",t.lcZ(3,4,"cs."+e.title),t.oJD),t.xp6(4),t.Q6J("ngIf",t.lcZ(7,6,!0+e.text)),t.xp6(2),t.Q6J("disabled",!o.isTestAvailable(e.id)),t.xp6(2),t.hij(" ",t.lcZ(11,8,"cs.Check-in")," ")}}function I(n,i){if(1&n&&(t.ynx(0),t.YNc(1,Z,13,10,"div",13),t.BQk()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("ngIf",e.show)}}function L(n,i){if(1&n&&(t.TgZ(0,"a",24)(1,"span"),t._uU(2),t.ALo(3,"translate"),t.qZA(),t._UZ(4,"app-i-arrow"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("routerLink","/s/"+e.latestResultId+"/r"),t.xp6(2),t.hij(" ",t.lcZ(3,2,"cs.Skip Test")," ")}}function Y(n,i){1&n&&(t.TgZ(0,"a",24)(1,"span"),t._uU(2),t.ALo(3,"translate"),t.qZA(),t._UZ(4,"app-i-arrow"),t.qZA()),2&n&&(t.Q6J("routerLink","/chat/new"),t.xp6(2),t.hij(" ",t.lcZ(3,2,"cs.Skip Test")," "))}function F(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"p",21),t._uU(2),t.ALo(3,"translate"),t.qZA(),t.YNc(4,L,5,4,"a",22),t.YNc(5,Y,5,4,"a",23),t.BQk()),2&n){const e=t.oxw();
1t.xp6(2),t.hij(" ",t.lcZ(3,3,"cs.You can start chatting with your AI companion right away \u2014 but keep in mind, your experience will be more personalized if you take a quick test first.")," "),t.xp6(2),t.Q6J("ngIf",!e.isAiChat),t.xp6(1),t.Q6J("ngIf",e.isAiChat)}}let G=(()=>{class n{constructor(e,o,a,r,c,h){this.dataService=e,this.gtService=o,this.flowTypeService=a,this.router=r,this.busy=c,this.feature=h,this.loading={},this.tests=[],this.leftover=0,this.availableTests=[],this.testSelected=new t.vpe,this.latestResultId=null,this.isAiChat=!1,this.environment=m.N}ngOnInit(){this.isAiChat="ai"===this.flowTypeService.state,this.dataService.$latestResultId.subscribe(e=>{this.latestResultId=e}),this.tests=[{title:"Stress/<br>Burnout",id:"mixed",text:"This test identifies signs of chronic stress or burnout and helps your AI companion recommend strategies for recovery and balance.",show:!0},{title:"Anxiety",id:"anxiety",text:"This test helps detect early signs of anxiety so your AI companion can support you with calming strategies and attention-focused insights.",show:!0},{title:"Depression",id:"depression",text:"This test helps reveal early symptoms of depression and guides your AI companion to offer evidence-based support and stabilization tools.",show:!0},{title:"Concussion",id:"concussion",show:this.feature.isBeta},{title:"PTSD",id:"ptsd",show:this.feature.isBeta}]}createSession(e){this.testSelected.next(e)}isTestAvailable(e){return this.leftover||!this.availableTests.length||this.availableTests.indexOf(e)>-1}createChat(){this.busy.setState(!0),this.gtService.event(NaN).then(),this.dataService.createChat(this.environment.aiUrl).subscribe(e=>(this.busy.setState(!1),this.router.navigate(["chat",e],{state:{name:e,chat:!0}})),e=>{this.busy.setState(!1)})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(p.D),t.Y36(u.z),t.Y36(x.G),t.Y36(l.F0),t.Y36(P.z),t.Y36(b.k))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-choose-test"]],inputs:{leftover:"leftover",availableTests:"availableTests"},outputs:{testSelected:"testSelected"},decls:16,vars:8,consts:[[1,"container-fluid","choose_test"],[1,"container"],[1,"row","mb-5","d-flex"],[1,"col-7"],[1,"header"],[1,"col-5"],[1,"subheader","pl-4",3,"innerHTML"],[1,"row"],[1,"col-8"],[4,"ngFor","ngForOf"],[1,"col-1"],[1,"col-3","align-self-end"],[4,"ngIf"],["class","row item",4,"ngIf"],[1,"row","item"],[1,"title",3,"innerHTML"],[1,"col-4"],[1,"d-flex","flex-column"],["class","description",4,"ngIf"],["href","#",1,"action-btn","hover_action",3,"disabled","click"],[1,"description"],[1,"subheader"],["class"," action-btn_transpatent hover_action ",3,"routerLink",4,"ngIf"],["class"," action-btn_transpatent hover_action",3,"routerLink",4,"ngIf"],[1,"action-btn_transpatent","hover_action",3,"routerLink"]],template:function(e,o){1&e&&(t.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h2",4),t._uU(5),t.ALo(6,"translate"),t.qZA()(),t.TgZ(7,"div",5),t._UZ(8,"p",6),t.ALo(9,"translate"),t.qZA()(),t.TgZ(10,"div",7)(11,"div",8),t.YNc(12,I,2,1,"ng-container",9),t.qZA(),t._UZ(13,"div",10),t.TgZ(14,"div",11),t.YNc(15,F,6,5,"ng-container",12),t.qZA()()()()),2&e&&(t.xp6(5),t.hij(" ",t.lcZ(6,4,"cs.title")," "),t.xp6(3),t.Q6J("innerHTML",t.lcZ(9,6,"cs.subtitle"),t.oJD),t.xp6(4),t.Q6J("ngForOf",o.tests),t.xp6(3),t.Q6J("ngIf",o.latestResultId))},directives:[d.sg,d.O5,O.d,l.yS],pipes:[A.X$],styles:["[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{padding-bottom:100px}[_nghost-%COMP%] .action-btn[_ngcontent-%COMP%] app-i-arrow[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .action-btn[_ngcontent-%COMP%]:hover{text-decoration:underline}[_nghost-%COMP%] .text-opacity-50[_ngcontent-%COMP%]{opacity:.5}[_nghost-%COMP%] .text-opacity-50[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]:hover{text-decoration:none}[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{font-family:ITC Avant Garde Gothic LT,sans-serif;font-style:normal;font-weight:700;font-size:100px;line-height:90%;letter-spacing:-.04em;color:#10082f;margin-top:68px}[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .subheader[_ngcontent-%COMP%]{font-family:Raleway,sans-serif;font-style:normal;font-weight:400;font-size:15px;line-height:135%;color:#10082f;margin-top:75px}[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{padding:40px 0 16px;border-bottom:1px solid #10082F;align-items:center}[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .item[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{font-family:ITC Avant Garde Gothic LT,sans-serif;font-style:normal;font-weight:700;font-size:24px;line-height:90%;letter-spacing:-.04em;color:#10082f;margin:0;font-size:60px}[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .item[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-family:Raleway,sans-serif;font-style:normal;font-weight:400;font-size:12px;line-height:135%;color:#10082f}[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{font-family:ITC Avant Garde Gothic LT,sans-serif;font-style:normal;font-weight:700;font-size:24px;line-height:90%;letter-spacing:-.04em;color:#10082f;margin:16px 0 0;display:flex;width:100%;align-items:center;justify-content:center;gap:8px;padding:7px 0;outline:none;box-shadow:none;color:#fff}[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .action-btn.action-btn_transpatent[_ngcontent-%COMP%]{color:#10082f;background-color:#fff;border:none!important;justify-content:flex-start}[_nghost-%COMP%] .choose_test[_ngcontent-%COMP%] .action-btn_transpatent[_ngcontent-%COMP%]{font-family:ITC Avant Garde Gothic LT,sans-serif;font-style:normal;font-weight:700;font-size:24px;line-height:90%;letter-spacing:-.04em;margin:16px 0 0;display:flex;width:100%;align-items:center;gap:8px;padding:7px 0;outline:none;box-shadow:none;color:#10082f;background-color:#fff;border:none!important;justify-content:flex-start}"]}),n})();var J=s(4e3),z=s(2185);let N=(()=>{class n{constructor(e,o,a,r,c,h,g){this.gtService=e,this.dataService=o,this.auth=a,this.router=r,this.busy=c,this.modalService=h,this.deviceService=g,this.environment=m.N,this.loading=!1,this.testName=null,this.deviceService.isMobile()&&r.navigate(["/"])}ngOnInit(){}
1createSession(e){this.loading=!0,this.gtService.event(e+"_test").then(),this.testName=e,this.dataService.createSession(this.environment.apiUrl,this.auth.userData.uid,this.testName,null).subscribe(o=>(console.log(o),this.router.navigate(["s",o,"t"],{state:{name:e}})),o=>{this.loading=!1,this.busy.setState(!1),this.openErrorModal(o)})}errorText(e){if(!(null==e?void 0:e.error)||!this.isJsonString(null==e?void 0:e.error))return{title:"Oops",text:"Something goes wrong"};{let o={detail:"error"};try{o=(null==e?void 0:e.error)?JSON.parse(null==e?void 0:e.error):{detail:"error"}}catch(a){return{title:"Oops",text:"Something goes wrong"}}switch(null==o?void 0:o.detail){case"subscription-expired":return{title:"You've used all your test sessions for today!",text:"No worries, you can continue exploring with Anima purchase more sessions right now. We're here for you!",link:"#plans"};case"quota-exceeded":return{title:"You've used all your test sessions for today!",text:"No worries, you can continue exploring with Anima tomorrow or purchase more sessions right now. We're here for you!",link:"#plans"};case"buy-more":return{title:"You've used all your test sessions! ",text:"No worries, you can continue your exploration with Anima by purchasing more. We're here for you!",link:"#plans"};case"trial-done":return{title:"You've used your trial session!",text:"No worries, you can continue exploring with Anima by purchasing more sessions right now. We're here for you!",link:"#plans"};case"wait-or-buy":return{title:"Session under calculation",text:"wait please",link:null};default:return{title:"Oops! Something went wrong.",text:"Please try again, or contact us at [email protected] if the issue persists.",link:null}}}}isJsonString(e){try{JSON.parse(e)}catch(o){return!1}return!0}openErrorModal(e){const o=this.modalService.open(T.y,{centered:!0,windowClass:"modal modal-stop",backdrop:"static",keyboard:!0}),{title:a,text:r,link:c}=this.errorText(e);return o.componentInstance.text=r,o.componentInstance.title=a,o.componentInstance.link=c,o.result.then(h=>{},()=>{})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(u.z),t.Y36(p.D),t.Y36(v.e),t.Y36(l.F0),t.Y36(S.z),t.Y36(y.FF),t.Y36(w.x0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-select-test"]],decls:4,vars:2,consts:[[3,"testSelected"],[3,"loading","text"]],template:function(e,o){1&e&&(t._UZ(0,"app-nav"),t.TgZ(1,"app-choose-test",0),t.NdJ("testSelected",function(r){return o.createSession(r)}),t.qZA(),t._UZ(2,"lib-preloader",1)(3,"app-footer")),2&e&&(t.xp6(2),t.Q6J("loading",o.loading)("text","Setting up..."))},directives:[M.r,G,J.T,z.c],styles:[""]}),n})();var C=s(4929),U=s(6317),k=s(166),Q=s(5703);const j=[{path:"",component:N,canActivate:[(()=>{class n{constructor(e,o,a,r,c,h,g){this.auth=e,this.data=o,this.router=a,this.modalService=r,this.gtService=c,this.flowTypeService=h,this.payed=g,this.canProceed=new U.X(!1)}canActivate(){return this.check()}check(){return(0,C.mG)(this,void 0,void 0,function*(){return!(!(yield this.isLoggedIn())&&!(yield this.openAuthModal()))&&((yield this.freeTrial())?(this.gtService.event("free_trial").then(),!0):!!(yield this.isPayed())||this.router.navigate(["/pricing"]))})}userData(){return new Promise((e,o)=>{this.auth.userSubscription().subscribe(a=>{const r=a.payload.data();r&&e(r)},o)})}freeTrial(){var e;const a=(null===(e=this.auth.userState)||void 0===e?void 0:e.trial)&&!("ai"===this.flowTypeService.state)||!1;return new Promise(r=>r(a))}isLoggedIn(){return(0,C.mG)(this,void 0,void 0,function*(){return new Promise(e=>e(this.auth.userData))})}isPayed(){return new Promise(e=>{e(this.payed.isPayed())})}openAuthModal(){const e=this.modalService.open(k.T,{centered:!0,size:"md",windowClass:"modal login",backdrop:"static",keyboard:!0});return e.componentInstance.data={},e.result}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(v.e),t.LFG(p.D),t.LFG(l.F0),t.LFG(y.FF),t.LFG(u.z),t.LFG(x.G),t.LFG(Q.q))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})()]}];let R=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[[l.Bz.forChild(j)],l.Bz]}),n})(),B=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[[d.ez,R]]}),n})()}}]); 2//# sourceMappingURL=546.2ac71fe49d7ff567.js.map
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.