-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path9345.290db26d0ab6032e.js
1 lines (1 loc) · 13.8 KB
/
9345.290db26d0ab6032e.js
1
"use strict";(self.webpackChunkcheapflightclient=self.webpackChunkcheapflightclient||[]).push([[9345],{29345:(k,f,s)=>{s.r(f),s.d(f,{LoginComponent:()=>U});var p=s(36895),n=s(24006),_=s(76188),h=s(94700),C=s(83700),v=s(27898),d=s(72506),m=s(44143),c=s(28746),e=s(94650),i=s(82761),g=s(46779);function x(o,a){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 r=e.oxw();e.xp6(8),e.hij(" ",r.error," ")}}function w(o,a){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 E(o,a){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 b(o,a){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,a){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,a){if(1&o){const r=e.EpF();e.TgZ(0,"cf-icon",38),e.NdJ("click",function(){e.CHM(r);const l=e.oxw();return e.KtG(l.showPassword=!l.showPassword)}),e.qZA()}}function A(o,a){if(1&o){const r=e.EpF();e.TgZ(0,"cf-icon",39),e.NdJ("click",function(){e.CHM(r);const l=e.oxw();return e.KtG(l.showPassword=!l.showPassword)}),e.qZA()}}function Z(o,a){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,a){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(r,t,l,u,D,I){this.formBuilder=t,this.route=l,this.router=u,this.authenticationService=D,this.recaptchaV3Service=I,this.isLoading=!1,this.submitted=!1,this.showPassword=!1,this.patten="^[A-Za-z0-9-]+$",r.registerIcons([d.bLw,d.MwJ,d.$S]),this.authenticationService.currentUserValue&&this.router.navigate(["/admin"])}ngOnInit(){const r=localStorage.getItem("reminiscentUser");let t=null;r&&(t=JSON.parse(r)),this.loginForm=this.formBuilder.group({agentCode:[(null==t?void 0:t.agentCode)||"",[n.kI.required,n.kI.pattern(this.patten)]],username:[(null==t?void 0:t.username)||"",[n.kI.required,n.kI.pattern(this.patten)]],password:["",n.kI.required],rememberMe:[(null==t?void 0:t.rememberMe)||!1,n.kI.required]}),this.authenticationService.getCurrentIp().subscribe({next:l=>{this.ipAddress=l.ip},error:l=>{console.log(l)}}),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 r=this.loginForm.value;this.isLoading=!0,this.recaptchaV3Service.execute("importantAction").subscribe(t=>{const l={agentCode:r.agentCode,ip:this.ipAddress,password:r.password,recaptcha:t,userName:r.username,rememberMe:r.rememberMe};this.authenticationService.authen(l).pipe((0,c.x)(()=>this.isLoading=!1)).subscribe({next:u=>{u.success?(this.error="",localStorage.setItem("currentUser",JSON.stringify(u)),l.rememberMe?localStorage.setItem("reminiscentUser",JSON.stringify({agentCode:l.agentCode,username:l.userName,rememberMe:l.rememberMe})):localStorage.removeItem("reminiscentUser"),this.authenticationService.currentUserSubject.next(u),this.router.navigate([this.returnUrl])):this.error=u.objectError.errorDescription.vi},error:u=>{this.error=u.error.objectError.errorDescription.vi}})})}checkedChange(r){var t;null===(t=this.loginForm.get("rememberMe"))||void 0===t||t.setValue(r)}resetPassword(){this.router.navigate(["reset-password"])}}return o.\u0275fac=function(r){return new(r||o)(e.Y36(d.KNP),e.Y36(n.qu),e.Y36(i.gz),e.Y36(i.F0),e.Y36(g.r),e.Y36(h.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(r,t){1&r&&(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,x,9,1,"div",12),e.TgZ(15,"form",13),e.NdJ("ngSubmit",function(){return t.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,E,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,b,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(u){return t.checkedChange(u)}),e._uU(38," L\u01b0u \u0111\u0103ng nh\u1eadp 30 ng\xe0y "),e.qZA(),e.TgZ(39,"a",25),e.NdJ("click",function(){return t.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: 25.02.02"),e.qZA()()()()()),2&r&&(e.xp6(14),e.Q6J("ngIf",t.error),e.xp6(1),e.Q6J("formGroup",t.loginForm),e.xp6(2),e.Q6J("disabled",t.isLoading)("status",t.loginForm.controls.agentCode.invalid&&(t.loginForm.controls.agentCode.dirty||t.loginForm.controls.agentCode.touched)?"error":"default"),e.xp6(4),e.Q6J("ngIf",t.loginForm.controls.agentCode.hasError("required")&&(t.loginForm.controls.agentCode.touched||t.loginForm.controls.agentCode.dirty)),e.xp6(1),e.Q6J("ngIf",t.loginForm.controls.agentCode.hasError("pattern")&&(t.loginForm.controls.agentCode.touched||t.loginForm.controls.agentCode.dirty)),e.xp6(1),e.Q6J("disabled",t.isLoading)("status",t.loginForm.controls.username.invalid&&(t.loginForm.controls.username.dirty||t.loginForm.controls.username.touched)?"error":"default"),e.xp6(4),e.Q6J("ngIf",t.loginForm.controls.username.hasError("required")&&(t.loginForm.controls.username.touched||t.loginForm.controls.username.dirty)),e.xp6(1),e.Q6J("ngIf",t.loginForm.controls.username.hasError("pattern")&&(t.loginForm.controls.username.touched||t.loginForm.controls.username.dirty)),e.xp6(1),e.Q6J("disabled",t.isLoading)("status",t.loginForm.controls.password.invalid&&(t.loginForm.controls.password.dirty||t.loginForm.controls.password.touched)?"error":"default"),e.xp6(3),e.Q6J("type",t.showPassword?"text":"password"),e.xp6(1),e.Q6J("ngIf",!t.showPassword),e.xp6(1),e.Q6J("ngIf",t.showPassword),e.xp6(1),e.Q6J("ngIf",t.loginForm.controls.password.hasError("required")&&(t.loginForm.controls.password.touched||t.loginForm.controls.password.dirty)),e.xp6(2),e.Q6J("checked",!!t.loginForm.controls.rememberMe.value),e.xp6(4),e.Q6J("ngClass",e.VKq(19,L,t.isLoading)),e.xp6(1),e.Q6J("ngIf",t.isLoading))},dependencies:[_.aw,n.u5,n._Y,n.Fj,n.JJ,n.JL,n.UX,n.sg,n.u,p.O5,p.mk,h.a,h.lQ,C.N8,C.Xq,m.j$,m.ND,m.BN,m.v2,v.u,d.AxE,d.Sm8],encapsulation:2}),o})()},27898:(k,f,s)=>{s.d(f,{u:()=>m});var p=s(36895),n=s(94650),_=s(24006),h=s(72506);function C(c,e){if(1&c&&(n.O4$(),n.TgZ(0,"svg",4),n._UZ(1,"path",5),n.qZA()),2&c){const i=n.oxw();n.ekj("fill-neutral-gray-1",i.disabled)("stroke-neutral-gray-3",i.disabled)("w-5","medium"==i.size)("h-5","medium"==i.size)}}function v(c,e){if(1&c&&(n.O4$(),n.TgZ(0,"svg",4),n._UZ(1,"path",6)(2,"path",7),n.qZA()),2&c){const i=n.oxw();n.ekj("!text-neutral-gray-3",i.disabled)("w-5","medium"==i.size)("h-5","medium"==i.size)}}const d=["*"];let m=(()=>{class c{constructor(i){this.cfIconRegister=i,this.checked=!1,this.size="small",this.disabled=!1,this.checkChange=new n.vpe,this.doubleClick=new n.vpe,this.onChange=()=>{},this.onTouched=()=>{},i.registerIcons([h.aCG,h.llu])}toggle(){this.disabled||(this.checked=!this.checked,this.checkChange.emit(this.checked),this.onChange(this.checked),this.onTouched())}onDoubleClick(){this.doubleClick.emit()}writeValue(i){this.checked=i}registerOnChange(i){this.onChange=i}registerOnTouched(i){this.onTouched=i}setDisabledState(i){this.disabled=i}}return c.\u0275fac=function(i){return new(i||c)(n.Y36(h.KNP))},c.\u0275cmp=n.Xpm({type:c,selectors:[["cf-checkbox"]],inputs:{checked:"checked",size:"size",disabled:"disabled"},outputs:{checkChange:"checkChange",doubleClick:"doubleClick"},standalone:!0,features:[n._Bn([{provide:_.JU,useExisting:(0,n.Gpc)(()=>c),multi:!0}]),n.jDz],ngContentSelectors:d,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(i,g){1&i&&(n.F$t(),n.TgZ(0,"div",0),n.NdJ("click",function(){return g.toggle()})("dblclick",function(){return g.onDoubleClick()}),n.YNc(1,C,2,8,"svg",1),n.YNc(2,v,3,6,"svg",2),n.TgZ(3,"div",3),n.Hsn(4),n.qZA()()),2&i&&(n.ekj("!text-primary-2-4",g.checked)("pointer-events-none",g.disabled),n.xp6(1),n.Q6J("ngIf",!g.checked),n.xp6(1),n.Q6J("ngIf",g.checked),n.xp6(1),n.ekj("!text-neutral-gray-4",g.disabled))},dependencies:[h.AxE,p.O5],encapsulation:2,changeDetection:0}),c})()}}]);