import{b as J}from"./chunk-5JFAGJ5Y.js";import"./chunk-AQDUOXUN.js";import{s as K}from"./chunk-LHJFDW2A.js";import{B as H,g as z,m as Y}from"./chunk-J3Q5GF64.js";import{a as Z}from"./chunk-FE65AIAB.js";import{Ab as A,Bb as C,Cc as x,Ga as d,Lb as U,Ma as h,Mb as W,Nc as X,Ra as y,Rg as B,Tb as w,Ub as b,Vb as v,Wf as j,Xa as M,aa as g,db as N,ga as s,ha as c,ic as k,if as O,kf as Q,mb as o,nb as i,ob as u,od as V,ra as R,sb as $,ub as m,vb as p,wb as S,wg as q,xb as I,yb as G}from"./chunk-WOSO3QBJ.js";import{i as T}from"./chunk-C2HMJUB7.js";var ee=["modal"];function te(r,_){r&1&&(o(0,"li"),m(1,5),u(2,"strong"),p(),i());}function ne(r,_){r&1&&(o(0,"li"),m(1,6),u(2,"strong"),p(),i());}function oe(r,_){if(r&1){let n=$();o(0,"div",7)(1,"h4",8),S(2,1),i(),o(3,"button",9),A("click",function(){let t=s(n).close;return c(t());}),u(4,"my-global-icon",10),i()(),o(5,"div",11),u(6,"img",12),o(7,"div",13),S(8,2),i(),o(9,"p"),m(10,3),u(11,"strong"),p(),i(),o(12,"ul"),M(13,te,3,0,"li",14)(14,ne,3,0,"li",14),i()(),o(15,"div",15)(16,"my-peertube-checkbox",16),v("ngModelChange",function(t){s(n);let a=C();return b(a.stopDisplayModal,t)||(a.stopDisplayModal=t),c(t);}),i(),o(17,"input",17),A("click",function(){let t=s(n).close;return c(t());})("key.enter",function(){let t=s(n).close;return c(t());}),i(),o(18,"a",18),A("click",function(){let t=s(n).close;return c(t());})("key.enter",function(){let t=s(n).close;return c(t());}),S(19,4),i()();}if(r&2){let n=C();d(2),I(n.instanceName),G(2),d(11),N("ngIf",!n.hasAccountAvatar(n.user)),d(),N("ngIf",!n.hasAccountDescription(n.user)),d(2),w("ngModel",n.stopDisplayModal);}}var Te=(()=>{let _=class _{userService=g(B);modalService=g(K);notifier=g(j);serverService=g(q);modal=h("modal");created=R();stopDisplayModal=!1;ref;user;LS_KEYS={NO_ACCOUNT_SETUP_WARNING_MODAL:"no_account_setup_warning_modal"};ngOnInit(){this.created.emit();}get instanceName(){return this.serverService.getHTMLConfig().instance.name;}hasAccountAvatar(e){return e.account.avatars.length!==0;}hasAccountDescription(e){return!!e.account.description;}shouldOpen(e){return!(this.modalService.hasOpenModals()||e.noAccountSetupWarningModal===!0||O.getItem(this.LS_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL)==="true"||this.hasAccountAvatar(e)&&this.hasAccountDescription(e)||this.userService.hasSignupInThisSession());}show(e){this.user=e,!this.ref&&(this.ref=this.modalService.open(this.modal(),{centered:!0,backdrop:"static",keyboard:!1,size:"md"}),this.ref.result.finally(()=>{this.stopDisplayModal===!0&&this.doNotOpenAgain();}));}doNotOpenAgain(){O.setItem(this.LS_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL,"true"),this.userService.updateMyProfile({noAccountSetupWarningModal:!0}).subscribe({next:()=>Q.info("We will not open the account setup modal again."),error:e=>this.notifier.error(e.message)});}};T(_,"\u0275fac",function(t){return new(t||_)();}),T(_,"\u0275cmp",y({type:_,selectors:[["my-account-setup-warning-modal"]],viewQuery:function(t,a){t&1&&U(a.modal,ee,5),t&2&&W();},outputs:{created:"created"},decls:2,vars:0,consts:()=>{let e;e="\u0110\xF3ng ph\u01B0\u01A1ng th\u1EE9c";let t;t="Kh\xF4ng hi\u1EC7n l\u1EA1i n\u1EEFa";let a;a="\u0110\xF3ng";let f;f="Ch\xE0o m\u1EEBng b\u1EA1n \u0111\u1EBFn v\u1EDBi "+"\uFFFD0\uFFFD"+"!";let E;E="H\xE3y b\u1EAFt \u0111\u1EA7u thi\u1EBFt l\u1EADp h\u1ED3 s\u01A1 c\u1EE7a b\u1EA1n!";let F;F="Gi\xFAp ki\u1EC3m duy\u1EC7t vi\xEAn v\xE0 nh\u1EEFng ng\u01B0\u1EDDi d\xF9ng kh\xE1c bi\u1EBFt "+"\uFFFD#11\uFFFD"+"b\u1EA1n l\xE0 ai"+"\uFFFD/#11\uFFFD"+" b\u1EB1ng c\xE1ch:";let P;P="Thi\u1EBFt l\u1EADp";let D;D="T\u1EA3i l\xEAn "+"\uFFFD#2\uFFFD"+"\u1EA3nh \u0111\u1EA1i di\u1EC7n"+"\uFFFD/#2\uFFFD"+"";let L;return L="B\u1ED5 sung "+"\uFFFD#2\uFFFD"+"m\xF4 t\u1EA3 b\u1EA3n th\xE2n"+"\uFFFD/#2\uFFFD"+"",[["modal",""],f,E,F,P,D,L,[1,"modal-header"],[1,"modal-title"],["title",e,1,"border-0","p-0",3,"click"],["iconName","cross"],[1,"modal-body"],["src","/client/assets/images/mascot/happy.svg","alt","",1,"mascot"],[1,"subtitle"],[4,"ngIf"],[1,"modal-footer","inputs"],["inputName","stopDisplayModal","labelText",t,3,"ngModelChange","ngModel"],["type","button","role","button","value",a,1,"peertube-button","secondary-button",3,"click","key.enter"],["routerLink","/my-account","rel","noopener noreferrer","ngbAutofocus","",1,"peertube-button-link","primary-button",3,"click","key.enter"]];},template:function(t,a){t&1&&M(0,oe,20,4,"ng-template",null,0,k);},dependencies:[X,x,Z,J,H,z,Y,V],styles:[`.modal-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center}.mascot-fw[_ngcontent-%COMP%]{width:170px}.mascot[_ngcontent-%COMP%]{display:block;width:170px;height:220px;margin-inline-end:calc(1.325rem + .9vw)}@media (min-width: 1200px){.mascot[_ngcontent-%COMP%]{margin-inline-end:2rem}}.subtitle[_ngcontent-%COMP%]{font-weight:600;margin-bottom:10px}li[_ngcontent-%COMP%]{margin-bottom:10px}
/*# sourceMappingURL=account-setup-warning-modal.component-IIZUPN6Y.css.map */`]}));let r=_;return r;})();export{Te as AccountSetupWarningModalComponent};/**i18n:b44b17e72e4b9ae03afb92709eafda64a985c0c8f0453c865708cceafe42f927*///# sourceMappingURL=chunk-CB4BSJPS.js.map