import{Ao as jx,Br as T$,Ca as dA,Fn as MV,Gn as NV,Hi as Zt,Ja as g,Jn as Nhe,Jt as Hx,Ki as _5,L as Bx,Nr as S$,Ns as rh,Rr as Si,S as Ahe,So as jV,V as CI,Wi as _$,X as D$,Xo as lx,Zs as th,ai as Vj,br as Qc,dc as vm,ei as V,et as DI,hi as Wx,hn as Kn,jt as Gj,k as Bb,n as $B,s as $a,ss as o5,yc as wp,za as fA}from"./chunk-b0nJCs5_.js";import{t as X1}from"./chunk-CDRFWLLW.js";import{A as qn,O as ln,s as Jn}from"./chunk-Cmet2Nw-.js";import{O as sr}from"./chunk-DcB590Yc.js";import"./chunk-BvsfL09w.js";import{t as q}from"./chunk-BpR0ReBf.js";var Z=[`modal`];function ee(_,t){_&1&&(wp(0,`li`),Hx(1,5),th(2,`strong`),Bx(),Bb())}function te(_,t){_&1&&(wp(0,`li`),Hx(1,6),th(2,`strong`),Bx(),Bb())}function ne(_,t){if(_&1){let e=jV();wp(0,`div`,7)(1,`h4`,8),S$(2,1),Bb(),wp(3,`button`,9),rh(`click`,function(){let n=CI(e).close;return DI(n())}),th(4,`my-global-icon`,10),Bb()(),wp(5,`div`,11),th(6,`img`,12),wp(7,`div`,13),S$(8,2),Bb(),wp(9,`p`),Hx(10,3),th(11,`strong`),Bx(),Bb(),wp(12,`ul`),NV(13,ee,3,0,`li`),NV(14,te,3,0,`li`),Bb()(),wp(15,`div`,14)(16,`my-peertube-checkbox`,15),fA(`ngModelChange`,function(n){CI(e);let u=D$();return o5(u.stopDisplayModal,n)||(u.stopDisplayModal=n),DI(n)}),Bb(),Vj(),wp(17,`input`,16),rh(`click`,function(){let n=CI(e).close;return DI(n())})(`key.enter`,function(){let n=CI(e).close;return DI(n())}),Bb(),wp(18,`a`,17),rh(`click`,function(){let n=CI(e).close;return DI(n())})(`key.enter`,function(){let n=CI(e).close;return DI(n())}),S$(19,4),Bb()()}if(_&2){let e=D$();$B(2),jx(e.instanceName),T$(2),$B(11),MV(e.hasAccountAvatar(e.user)?-1:13),$B(),MV(e.hasAccountDescription(e.user)?-1:14),$B(2),dA(`ngModel`,e.stopDisplayModal),Gj()}}var J=class _{userService=g(Qc);modalService=g(sr);notifier=g(Si);serverService=g(Zt);modal=Nhe(`modal`);created=Ahe();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(t){return t.account.avatars.length!==0}hasAccountDescription(t){return!!t.account.description}shouldAutoOpen(t){return!(this.modalService.hasOpenModals()||t.noAccountSetupWarningModal===!0||Kn.getItem(this.LS_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL)===`true`||this.hasAccountAvatar(t)&&this.hasAccountDescription(t)||this.userService.hasSignupInThisSession())}show(t){this.user=t,!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(){Kn.setItem(this.LS_KEYS.NO_ACCOUNT_SETUP_WARNING_MODAL,`true`),this.userService.updateMyProfile({noAccountSetupWarningModal:!0}).subscribe({next:()=>V.info(`We will not open the account setup modal again.`),error:t=>this.notifier.handleError(t)})}static ɵfac=function(e){return new(e||_)};static ɵcmp=$a({type:_,selectors:[[`my-account-setup-warning-modal`]],viewQuery:function(e,i){e&1&&Wx(i.modal,Z,5),e&2&&_$()},outputs:{created:`created`},decls:2,vars:0,consts:()=>{let t;t="關閉此模式";let e;e="不要再顯示這個";let i;i="關閉";let n;n=`歡迎使用 ${`�0�`}，親愛的使用者！`;let u;u="是時候設定您的帳號個人簡介了！";let O;O=`協助管理員與其他使用者認識${`�#11�`}您是誰${`�/#11�`}，透過：`;let f;f="設定";let E;E=`上傳${`�#2�`}大頭照${`�/#2�`}`;let F;return F=`編寫${`�#2�`}描述${`�/#2�`}`,[[`modal`,``],n,u,O,f,E,F,[1,`modal-header`],[1,`modal-title`],[`title`,t,1,`border-0`,`p-0`,3,`click`],[`iconName`,`cross`],[1,`modal-body`],[`src`,`/client/assets/images/mascot/happy.svg`,`alt`,``,1,`mascot`],[1,`subtitle`],[1,`modal-footer`,`inputs`],[`inputName`,`stopDisplayModal`,`labelText`,e,3,`ngModelChange`,`ngModel`],[`type`,`button`,`role`,`button`,`value`,i,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(e,i){e&1&&lx(0,ne,20,4,`ng-template`,null,0,_5)},dependencies:[X1,q,Jn,qn,ln,vm],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}`],changeDetection:1})};export{J as AccountSetupWarningModalComponent};
//# debugId=7128f128-0638-519b-b73f-0591d7c0b159
//# sourceMappingURL=chunk-BiYOtPpE.js.map