-
Notifications
You must be signed in to change notification settings - Fork 0
/
9345.581bb33dea6ee8e7.js
1 lines (1 loc) · 13.4 KB
/
9345.581bb33dea6ee8e7.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[9345],{29345:(x,p,s)=>{s.r(p),s.d(p,{LoginComponent:()=>U});var f=s(36895),t=s(24006),h=s(76188),m=s(94700),C=s(83700),_=s(27898),g=s(72506),l=s(44143),d=s(28746),e=s(94650),u=s(82761),v=s(46779);function k(o,c){if(1&o&&(e.TgZ(0,"div",30)(1,"div",31)(2,"div"),e.O4$(),e.TgZ(3,"svg",32),e._UZ(4,"path",33)(5,"path",34)(6,"path",35),e.qZA()(),e.kcU(),e.TgZ(7,"div",36),e._uU(8),e.qZA()()()),2&o){const i=e.oxw();e.xp6(8),e.hij(" ",i.error," ")}}function w(o,c){1&o&&e._UZ(0,"cf-input-hint",37),2&o&&e.Q6J("hint","M\xe3 \u0111\u1ea1i l\xfd kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function b(o,c){1&o&&e._UZ(0,"cf-input-hint",37),2&o&&e.Q6J("hint","M\xe3 \u0111\u1ea1i l\xfd kh\xf4ng \u0111\xfang")}function E(o,c){1&o&&e._UZ(0,"cf-input-hint",37),2&o&&e.Q6J("hint","T\xean \u0111\u0103ng kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function F(o,c){1&o&&e._UZ(0,"cf-input-hint",37),2&o&&e.Q6J("hint","T\xean \u0111\u0103ng nh\u1eadp kh\xf4ng \u0111\xfang")}function y(o,c){if(1&o){const i=e.EpF();e.TgZ(0,"cf-icon",38),e.NdJ("click",function(){e.CHM(i);const r=e.oxw();return e.KtG(r.showPassword=!r.showPassword)}),e.qZA()}}function A(o,c){if(1&o){const i=e.EpF();e.TgZ(0,"cf-icon",39),e.NdJ("click",function(){e.CHM(i);const r=e.oxw();return e.KtG(r.showPassword=!r.showPassword)}),e.qZA()}}function Z(o,c){1&o&&e._UZ(0,"cf-input-hint",37),2&o&&e.Q6J("hint","M\u1eadt kh\u1ea9u kh\xf4ng \u0111\u01b0\u1ee3c \u0111\u1ec3 tr\u1ed1ng")}function T(o,c){1&o&&e._UZ(0,"cf-icon",40)}const L=function(o){return{"opacity-50 pointer-events-none cursor-default":o}};let U=(()=>{class o{constructor(i,n,r,a,I,D){this.formBuilder=n,this.route=r,this.router=a,this.authenticationService=I,this.recaptchaV3Service=D,this.isLoading=!1,this.submitted=!1,this.showPassword=!1,this.patten="^[A-Za-z0-9-]+$",i.registerIcons([g.bLw,g.MwJ,g.$S]),this.authenticationService.currentUserValue&&this.router.navigate(["/admin"])}ngOnInit(){const i=localStorage.getItem("reminiscentUser");let n=null;i&&(n=JSON.parse(i)),this.loginForm=this.formBuilder.group({agentCode:[(null==n?void 0:n.agentCode)||"",[t.kI.required,t.kI.pattern(this.patten)]],username:[(null==n?void 0:n.username)||"",[t.kI.required,t.kI.pattern(this.patten)]],password:["",t.kI.required],rememberMe:[(null==n?void 0:n.rememberMe)||!1,t.kI.required]}),this.authenticationService.getCurrentIp().subscribe({next:r=>{this.ipAddress=r.ip},error:r=>{console.log(r)}}),this.returnUrl=this.route.snapshot.queryParams.returnUrl||"/admin"}get f(){return this.loginForm.controls}onSubmit(){if(this.loginForm.markAllAsTouched(),this.loginForm.invalid||this.isLoading)return;const i=this.loginForm.value;this.isLoading=!0,this.recaptchaV3Service.execute("importantAction").subscribe(n=>{const r={agentCode:i.agentCode,ip:this.ipAddress,password:i.password,recaptcha:n,userName:i.username,rememberMe:i.rememberMe};this.authenticationService.authen(r).pipe((0,d.x)(()=>this.isLoading=!1)).subscribe({next:a=>{a.success?(this.error="",localStorage.setItem("currentUser",JSON.stringify(a)),r.rememberMe?localStorage.setItem("reminiscentUser",JSON.stringify({agentCode:r.agentCode,username:r.userName,rememberMe:r.rememberMe})):localStorage.removeItem("reminiscentUser"),this.authenticationService.currentUserSubject.next(a),this.router.navigate([this.returnUrl])):this.error=a.objectError.errorDescription.vi},error:a=>{this.error=a.error.objectError.errorDescription.vi}})})}checkedChange(i){var n;null===(n=this.loginForm.get("rememberMe"))||void 0===n||n.setValue(i)}resetPassword(){this.router.navigate(["reset-password"])}}return o.\u0275fac=function(i){return new(i||o)(e.Y36(g.KNP),e.Y36(t.qu),e.Y36(u.gz),e.Y36(u.F0),e.Y36(v.r),e.Y36(m.YC))},o.\u0275cmp=e.Xpm({type:o,selectors:[["cf-login"]],standalone:!0,features:[e._Bn([]),e.jDz],decls:47,vars:21,consts:[[1,"notranslate","w-screen","h-screen","!h-[100svh]","relative"],["src","assets/images/login_background.svg","alt","",1,"h-1/2","md:h-[34%]","w-full","object-cover","absolute","bottom-0","left-0","-z-9999"],[1,"absolute","w-full","h-full","top-0","left-0"],[1,"overflow-auto","w-full","h-full","flex","flex-col","justify-between","gap-y-6"],[1,"px-32","flex-1","md:flex-none","flex","justify-center","items-center"],[1,"bg-neutral-white","md:bg-transparent","rounded-xl","shadow-lg","md:shadow-none","py-16","md:py-8","px-8"],[1,"ml-[-15px]","md:ml-0"],["src","assets/logo/flychill_logo.png","alt","",1,"w-[192px]","h-auto"],[1,"md:w-[300px]","w-[360px]","flex","flex-col","gap-y-8"],[1,"flex","flex-col","gap-y-3"],[1,"text-heading-xl","text-neutral-gray-6"],[1,"text-body-md-long","text-neutral-gray-4"],["class","bg-[#FFF8E7] rounded px-4 py-3 flex flex-col gap-y-4",4,"ngIf"],["autocomplete","off",1,"flex","flex-col","gap-y-6",3,"formGroup","ngSubmit"],[1,"flex","flex-col","gap-y-4"],[1,"grow-[400]","!w-full",3,"disabled","status"],["cfLabel",""],["cf-input","","size","medium","autocomplete","off","placeholder","M\xe3 \u0111\u1ea1i l\xfd","type","text","formControlName","agentCode"],["cfHint","",3,"hint",4,"ngIf"],["cf-input","","size","medium","autocomplete","off","placeholder","T\xean \u0111\u0103ng nh\u1eadp","type","text","formControlName","username"],["cf-input","","size","medium","autocomplete","off","placeholder","Nh\u1eadp m\u1eadt kh\u1ea9u","formControlName","password",3,"type"],["cfTailIcon","","class","cursor-pointer text-neutral-gray-4","icon","eye","size","small",3,"click",4,"ngIf"],["cfTailIcon","","class","cursor-pointer text-neutral-gray-4","icon","eye_off","size","small",3,"click",4,"ngIf"],[1,"flex","justify-between","items-center"],["size","medium",3,"checked","checkChange"],[1,"text-body-md-short","text-secondary-3-4","cursor-pointer",3,"click"],["cf-button","","size","medium",1,"flex","justify-center","items-center",3,"ngClass"],["class","text-neutral-white mr-2.5 animate-spin","icon","refresh","size","small",4,"ngIf"],[1,"flex","justify-center","items-center"],[1,"p-2.5","text-body-sm","text-neutral-gray-5"],[1,"bg-[#FFF8E7]","rounded","px-4","py-3","flex","flex-col","gap-y-4"],[1,"flex","items-center","gap-x-2"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M1.23916 18.3887L10.1497 3.95489C10.3277 3.66664 10.594 3.42543 10.92 3.25719C11.246 3.08895 11.6194 3.00005 12 3.00005C12.3806 3.00005 12.754 3.08895 13.08 3.25719C13.406 3.42543 13.6723 3.66664 13.8503 3.95489L22.7608 18.3887C22.9281 18.6611 23.0101 18.9659 22.999 19.2736C22.9879 19.5812 22.8839 19.8811 22.6973 20.1441C22.5106 20.4071 22.2477 20.6241 21.934 20.7741C21.6204 20.9241 21.2667 21.002 20.9075 21H3.08847C2.72962 21.0014 2.37647 20.9231 2.06336 20.7729C1.75026 20.6226 1.48787 20.4055 1.3017 20.1426C1.11553 19.8797 1.01193 19.5801 1.00097 19.2727C0.99001 18.9654 1.07207 18.6608 1.23916 18.3887Z","fill","#FCB40A"],["d","M12 18.75C11.5858 18.75 11.25 18.4143 11.25 18L11.25 17.9901C11.25 17.5758 11.5858 17.2401 12 17.2401C12.4142 17.2401 12.75 17.5758 12.75 17.9901L12.75 18C12.75 18.4143 12.4142 18.75 12 18.75Z","fill","#2C2C2C"],["d","M12 15.75C11.5858 15.75 11.25 15.4142 11.25 15L11.25 8.00002C11.25 7.5858 11.5858 7.25002 12 7.25002C12.4142 7.25002 12.75 7.5858 12.75 8.00002L12.75 15C12.75 15.4142 12.4142 15.75 12 15.75Z","fill","#2C2C2C"],[1,"text-body-md-short"],["cfHint","",3,"hint"],["cfTailIcon","","icon","eye","size","small",1,"cursor-pointer","text-neutral-gray-4",3,"click"],["cfTailIcon","","icon","eye_off","size","small",1,"cursor-pointer","text-neutral-gray-4",3,"click"],["icon","refresh","size","small",1,"text-neutral-white","mr-2.5","animate-spin"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0),e._UZ(1,"img",1),e.TgZ(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6),e._UZ(7,"img",7),e.qZA(),e.TgZ(8,"div",8)(9,"div",9)(10,"div",10),e._uU(11,"Ch\xe0o m\u1eebng tr\u1edf l\u1ea1i"),e.qZA(),e.TgZ(12,"div",11),e._uU(13,"Ch\xe0o b\u1ea1n! Vui l\xf2ng nh\u1eadp th\xf4ng tin \u0111\u0103ng nh\u1eadp"),e.qZA()(),e.YNc(14,k,9,1,"div",12),e.TgZ(15,"form",13),e.NdJ("ngSubmit",function(){return n.onSubmit()}),e.TgZ(16,"div",14)(17,"cf-input-group",15)(18,"label",16),e._uU(19,"M\xe3 \u0111\u1ea1i l\xfd"),e.qZA(),e._UZ(20,"input",17),e.YNc(21,w,1,1,"cf-input-hint",18),e.YNc(22,b,1,1,"cf-input-hint",18),e.qZA(),e.TgZ(23,"cf-input-group",15)(24,"label",16),e._uU(25,"T\xean \u0111\u0103ng nh\u1eadp"),e.qZA(),e._UZ(26,"input",19),e.YNc(27,E,1,1,"cf-input-hint",18),e.YNc(28,F,1,1,"cf-input-hint",18),e.qZA(),e.TgZ(29,"cf-input-group",15)(30,"label",16),e._uU(31,"M\u1eadt kh\u1ea9u"),e.qZA(),e._UZ(32,"input",20),e.YNc(33,y,1,0,"cf-icon",21),e.YNc(34,A,1,0,"cf-icon",22),e.YNc(35,Z,1,1,"cf-input-hint",18),e.qZA()(),e.TgZ(36,"div",23)(37,"cf-checkbox",24),e.NdJ("checkChange",function(a){return n.checkedChange(a)}),e._uU(38," L\u01b0u \u0111\u0103ng nh\u1eadp 30 ng\xe0y "),e.qZA(),e.TgZ(39,"a",25),e.NdJ("click",function(){return n.resetPassword()}),e._uU(40,"Qu\xean m\u1eadt kh\u1ea9u ?"),e.qZA()(),e.TgZ(41,"button",26),e.YNc(42,T,1,0,"cf-icon",27),e._uU(43," \u0110\u0103ng Nh\u1eadp "),e.qZA()()()()(),e.TgZ(44,"div",28)(45,"div",29),e._uU(46,"Version: 24.11.04"),e.qZA()()()()()),2&i&&(e.xp6(14),e.Q6J("ngIf",n.error),e.xp6(1),e.Q6J("formGroup",n.loginForm),e.xp6(2),e.Q6J("disabled",n.isLoading)("status",n.loginForm.controls.agentCode.invalid&&(n.loginForm.controls.agentCode.dirty||n.loginForm.controls.agentCode.touched)?"error":"default"),e.xp6(4),e.Q6J("ngIf",n.loginForm.controls.agentCode.hasError("required")&&(n.loginForm.controls.agentCode.touched||n.loginForm.controls.agentCode.dirty)),e.xp6(1),e.Q6J("ngIf",n.loginForm.controls.agentCode.hasError("pattern")&&(n.loginForm.controls.agentCode.touched||n.loginForm.controls.agentCode.dirty)),e.xp6(1),e.Q6J("disabled",n.isLoading)("status",n.loginForm.controls.username.invalid&&(n.loginForm.controls.username.dirty||n.loginForm.controls.username.touched)?"error":"default"),e.xp6(4),e.Q6J("ngIf",n.loginForm.controls.username.hasError("required")&&(n.loginForm.controls.username.touched||n.loginForm.controls.username.dirty)),e.xp6(1),e.Q6J("ngIf",n.loginForm.controls.username.hasError("pattern")&&(n.loginForm.controls.username.touched||n.loginForm.controls.username.dirty)),e.xp6(1),e.Q6J("disabled",n.isLoading)("status",n.loginForm.controls.password.invalid&&(n.loginForm.controls.password.dirty||n.loginForm.controls.password.touched)?"error":"default"),e.xp6(3),e.Q6J("type",n.showPassword?"text":"password"),e.xp6(1),e.Q6J("ngIf",!n.showPassword),e.xp6(1),e.Q6J("ngIf",n.showPassword),e.xp6(1),e.Q6J("ngIf",n.loginForm.controls.password.hasError("required")&&(n.loginForm.controls.password.touched||n.loginForm.controls.password.dirty)),e.xp6(2),e.Q6J("checked",!!n.loginForm.controls.rememberMe.value),e.xp6(4),e.Q6J("ngClass",e.VKq(19,L,n.isLoading)),e.xp6(1),e.Q6J("ngIf",n.isLoading))},dependencies:[h.aw,t.u5,t._Y,t.Fj,t.JJ,t.JL,t.UX,t.sg,t.u,f.O5,f.mk,m.a,m.lQ,C.N8,C.Xq,l.j$,l.ND,l.BN,l.v2,_.u,g.AxE,g.Sm8],encapsulation:2}),o})()},27898:(x,p,s)=>{s.d(p,{u:()=>g});var f=s(36895),t=s(94650),h=s(72506);function m(l,d){if(1&l&&(t.O4$(),t.TgZ(0,"svg",4),t._UZ(1,"path",5),t.qZA()),2&l){const e=t.oxw();t.ekj("fill-neutral-gray-1",e.disabled)("stroke-neutral-gray-3",e.disabled)("w-5","medium"==e.size)("h-5","medium"==e.size)}}function C(l,d){if(1&l&&(t.O4$(),t.TgZ(0,"svg",4),t._UZ(1,"path",6)(2,"path",7),t.qZA()),2&l){const e=t.oxw();t.ekj("!text-neutral-gray-3",e.disabled)("w-5","medium"==e.size)("h-5","medium"==e.size)}}const _=["*"];let g=(()=>{class l{constructor(e){this.cfIconRegister=e,this.checked=!1,this.size="small",this.disabled=!1,this.checkChange=new t.vpe,this.doubleClick=new t.vpe,e.registerIcons([h.aCG,h.llu])}toggle(){this.checked=!this.checked,this.checkChange.emit(this.checked)}onDoubleClick(){this.doubleClick.emit()}}return l.\u0275fac=function(e){return new(e||l)(t.Y36(h.KNP))},l.\u0275cmp=t.Xpm({type:l,selectors:[["cf-checkbox"]],inputs:{checked:"checked",size:"size",disabled:"disabled"},outputs:{checkChange:"checkChange",doubleClick:"doubleClick"},standalone:!0,features:[t.jDz],ngContentSelectors:_,decls:5,vars:8,consts:[[1,"flex","items-center","gap-x-2","hover","text-neutral-gray-4","hover:text-primary-2-4","focus:text-primary-2-4","cursor-pointer",3,"click","dblclick"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","none","viewBox","0 0 16 16",3,"fill-neutral-gray-1","stroke-neutral-gray-3","w-5","h-5",4,"ngIf"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","none","viewBox","0 0 16 16",3,"!text-neutral-gray-3","w-5","h-5",4,"ngIf"],[1,"text-body-md","text-neutral-black"],["xmlns","http://www.w3.org/2000/svg","width","16","height","16","fill","none","viewBox","0 0 16 16"],["stroke","currentColor","stroke-linejoin","round","stroke-width","1.5","d","M11.333 2.667H4.667a2 2 0 0 0-2 2v6.666a2 2 0 0 0 2 2h6.666a2 2 0 0 0 2-2V4.667a2 2 0 0 0-2-2Z"],["fill","currentColor","stroke","currentColor","stroke-linejoin","round","stroke-width","1.5","d","M11.333 2.667H4.667a2 2 0 0 0-2 2v6.666a2 2 0 0 0 2 2h6.666a2 2 0 0 0 2-2V4.667a2 2 0 0 0-2-2Z"],["stroke","#fff","stroke-linecap","round","stroke-linejoin","round","d","M11.333 5.333 7.133 10l-1.8-2"]],template:function(e,u){1&e&&(t.F$t(),t.TgZ(0,"div",0),t.NdJ("click",function(){return u.toggle()})("dblclick",function(){return u.onDoubleClick()}),t.YNc(1,m,2,8,"svg",1),t.YNc(2,C,3,6,"svg",2),t.TgZ(3,"div",3),t.Hsn(4),t.qZA()()),2&e&&(t.ekj("!text-primary-2-4",u.checked)("pointer-events-none",u.disabled),t.xp6(1),t.Q6J("ngIf",!u.checked),t.xp6(1),t.Q6J("ngIf",u.checked),t.xp6(1),t.ekj("!text-neutral-gray-4",u.disabled))},dependencies:[h.AxE,f.O5],encapsulation:2,changeDetection:0}),l})()}}]);