-
Notifications
You must be signed in to change notification settings - Fork 0
/
381.2387c4ad0befe545.js
1 lines (1 loc) · 61.4 KB
/
381.2387c4ad0befe545.js
1
"use strict";(self.webpackChunkhotel_booking=self.webpackChunkhotel_booking||[]).push([[381],{1381:(Lt,F,d)=>{d.r(F),d.d(F,{HotelOwnerModule:()=>Et});var p=d(6814),h=d(4112),e=d(5879),v=d(102),x=d(1506),Z=d(7034);const D=function(t){return{hidden:t}},J=function(){return["/owner/profile"]},E=function(){return["/owner/all-hotels"]},L=function(){return["/owner/booking-list"]},Q=function(){return["/owner/add-hotel"]},P=function(){return["/user"]};let j=(()=>{class t{constructor(o,n,i){this.sharedService=o,this.ownerDataServiec=n,this.tosterService=i,this.isSidenavOpen=!1,this.subscription=this.sharedService.isSidenavOpen$.subscribe(l=>{this.isSidenavOpen=l})}logout(){this.ownerDataServiec.logout(),this.tosterService.showSuccess("Logout Successful","Goodbye! See you soon.")}ngOnDestroy(){this.subscription.unsubscribe()}toggleSidenav(){this.sharedService.toggleSidenav()}static#e=this.\u0275fac=function(n){return new(n||t)(e.Y36(v.N),e.Y36(x.U),e.Y36(Z.b))};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-sidenav"]],decls:22,vars:13,consts:[[1,"h-full","absolute","inset-0","md:relative","md:flex","flex-col","w-64","bg-mySkyBlue","z-50","md:z-0",3,"ngClass"],[1,"flex","items-center","justify-start","px-8","h-16","bg-sky-700","text-white"],[1,"font-bold","uppercase"],[1,"fas","fa-tachometer-alt","fa-fw","mr-2"],[1,"flex","flex-col","flex-1","overflow-y-auto"],[1,"flex-1","px-2","py-4","bg-mySkyBlue"],["routerLinkActive","active",1,"flex","items-center","px-4","py-2","text-white","hover:bg-sky-500",3,"routerLink","click"],[1,"fas","fa-user","fa-fw","mr-2"],["routerLinkActive","active",1,"flex","items-center","px-4","py-2","mt-2","text-white","hover:bg-sky-500",3,"routerLink","click"],[1,"fas","fa-hotel","fa-fw","mr-2"],[1,"fas","fa-book","fa-fw","mr-2"],[1,"fas","fa-plus","fa-fw","mr-2"],[1,"flex","items-center","px-4","py-2","mt-2","text-white","hover:bg-sky-500",3,"routerLink","click"],[1,"fas","fa-sign-out-alt","fa-fw","mr-2"]],template:function(n,i){1&n&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span",2),e._UZ(3,"i",3),e._uU(4," Dashbord"),e.qZA()(),e.TgZ(5,"div",4)(6,"nav",5)(7,"a",6),e.NdJ("click",function(){return i.toggleSidenav()}),e._UZ(8,"i",7),e._uU(9," Profile "),e.qZA(),e.TgZ(10,"a",8),e.NdJ("click",function(){return i.toggleSidenav()}),e._UZ(11,"i",9),e._uU(12," All Hotels "),e.qZA(),e.TgZ(13,"a",8),e.NdJ("click",function(){return i.toggleSidenav()}),e._UZ(14,"i",10),e._uU(15," Bookings "),e.qZA(),e.TgZ(16,"a",8),e.NdJ("click",function(){return i.toggleSidenav()}),e._UZ(17,"i",11),e._uU(18," Add Hotel "),e.qZA(),e.TgZ(19,"a",12),e.NdJ("click",function(){return i.logout()}),e._UZ(20,"i",13),e._uU(21," Logout "),e.qZA()()()()),2&n&&(e.Q6J("ngClass",e.VKq(6,D,!i.isSidenavOpen)),e.xp6(7),e.Q6J("routerLink",e.DdM(8,J)),e.xp6(3),e.Q6J("routerLink",e.DdM(9,E)),e.xp6(3),e.Q6J("routerLink",e.DdM(10,L)),e.xp6(3),e.Q6J("routerLink",e.DdM(11,Q)),e.xp6(3),e.Q6J("routerLink",e.DdM(12,P)))},dependencies:[p.mk,h.rH,h.Od]})}return t})();function G(t,r){1&t&&(e.ynx(0),e.O4$(),e.TgZ(1,"svg",7),e._UZ(2,"path",8),e.qZA(),e.BQk())}function z(t,r){1&t&&(e.O4$(),e.TgZ(0,"svg",7),e._UZ(1,"path",9),e.qZA())}let $=(()=>{class t{constructor(o){this.sharedService=o,this.isSidenavOpen=!1}ngOnInit(){this.sharedService.isSidenavOpen$.subscribe(o=>{this.isSidenavOpen=o})}toggleSidenav(){this.sharedService.toggleSidenav(),this.sharedService.isSidenavOpen$.subscribe(o=>{this.isSidenavOpen=o})}static#e=this.\u0275fac=function(n){return new(n||t)(e.Y36(v.N))};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-navbar"]],decls:9,vars:2,consts:[[1,"w-full","flex","items-center","justify-between","md:justify-center","md:items-center","h-16","pr-2","bg-white","border-b","border-gray-200"],[1,"flex","ml-2","md:ml-0","items-center","justify-center"],["src","https://mytravel.madrasthemes.com/wp-content/uploads/2022/04/logo-white.svg","alt","Logo",1,"mr-2","h-10","w-10","bg-mySkyBlue","rounded-full"],[1,"text-mySkyBlue","font-bold","text-3xl"],[1,"md:hidden","text-gray-500","focus:outline-none","focus:text-gray-700",3,"click"],[4,"ngIf","ngIfElse"],["hamburgerIcon",""],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor",1,"h-6","w-6"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M6 18L18 6M6 6l12 12"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M4 6h16M4 12h16M4 18h16"]],template:function(n,i){if(1&n&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"img",2),e.TgZ(3,"span",3),e._uU(4,"MyTravel"),e.qZA()(),e.TgZ(5,"button",4),e.NdJ("click",function(){return i.toggleSidenav()}),e.YNc(6,G,3,0,"ng-container",5),e.YNc(7,z,2,0,"ng-template",null,6,e.W1O),e.qZA()()),2&n){const l=e.MAs(8);e.xp6(6),e.Q6J("ngIf",i.isSidenavOpen)("ngIfElse",l)}},dependencies:[p.O5]})}return t})(),R=(()=>{class t{static#e=this.\u0275fac=function(n){return new(n||t)};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-dashboard"]],decls:6,vars:0,consts:[[1,"relative","flex","h-screen","bg-gray-100"],[1,"flex","flex-col","flex-1","overflow-y-auto"],[1,"relative","p-4","bg-slate-300","overflow-x-hidden"]],template:function(n,i){1&n&&(e.TgZ(0,"div",0),e._UZ(1,"app-sidenav"),e.TgZ(2,"div",1),e._UZ(3,"app-navbar"),e.TgZ(4,"div",2),e._UZ(5,"router-outlet"),e.qZA()()())},dependencies:[h.lC,j,$],styles:["mat-list-item[_ngcontent-%COMP%]{cursor:pointer}"]})}return t})();var a=d(6223),I=d(2282),H=d(8468),K=d(74),W=d(8014);function X(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"Full Name is required"),e.qZA())}function V(t,r){if(1&t&&(e.TgZ(0,"div",49),e.YNc(1,X,2,0,"div",50),e.qZA()),2&t){const o=e.oxw(2);let n;e.xp6(1),e.Q6J("ngIf",null==(n=o.registrationForm.get("name"))?null:n.getError)}}function ee(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"Email is required"),e.qZA())}function te(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1," Please enter a valid email address. "),e.qZA())}function oe(t,r){if(1&t&&(e.TgZ(0,"div",49),e.YNc(1,ee,2,0,"div",50),e.YNc(2,te,2,0,"div",50),e.qZA()),2&t){const o=e.oxw(2);let n,i;e.xp6(1),e.Q6J("ngIf",null==(n=o.registrationForm.get("email"))?null:n.hasError("required")),e.xp6(1),e.Q6J("ngIf",(null==(i=o.registrationForm.get("email"))?null:i.hasError("email"))&&(null==(i=o.registrationForm.get("email"))?null:i.touched))}}function ne(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"Phone Number is required"),e.qZA())}function ie(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1," Please enter a valid phone number. "),e.qZA())}function re(t,r){if(1&t&&(e.TgZ(0,"div",49),e.YNc(1,ne,2,0,"div",50),e.YNc(2,ie,2,0,"div",50),e.qZA()),2&t){const o=e.oxw(2);let n,i;e.xp6(1),e.Q6J("ngIf",null==(n=o.registrationForm.get("phoneNumber"))?null:n.hasError("required")),e.xp6(1),e.Q6J("ngIf",(null==(i=o.registrationForm.get("phoneNumber"))?null:i.hasError("pattern"))&&(null==(i=o.registrationForm.get("phoneNumber"))?null:i.touched))}}function le(t,r){1&t&&(e.TgZ(0,"div",51),e._uU(1," Phone number must be at least 10 numbers long. "),e.qZA())}function ae(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"Address is required"),e.qZA())}function se(t,r){if(1&t&&(e.TgZ(0,"div",49),e.YNc(1,ae,2,0,"div",50),e.qZA()),2&t){const o=e.oxw(2);let n;e.xp6(1),e.Q6J("ngIf",null==(n=o.registrationForm.get("address"))?null:n.hasError("required"))}}function de(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"Password is required"),e.qZA())}function ue(t,r){if(1&t&&(e.TgZ(0,"div",49),e.YNc(1,de,2,0,"div",50),e.qZA()),2&t){const o=e.oxw(2);let n;e.xp6(1),e.Q6J("ngIf",null==(n=o.registrationForm.get("password"))?null:n.hasError("required"))}}function ce(t,r){1&t&&(e.TgZ(0,"div",51),e._uU(1," Password must be at least 8 characters long. "),e.qZA())}function me(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"Confirm Password is required"),e.qZA())}function ge(t,r){if(1&t&&(e.TgZ(0,"div",49),e.YNc(1,me,2,0,"div",50),e.qZA()),2&t){const o=e.oxw(2);let n;e.xp6(1),e.Q6J("ngIf",null==(n=o.registrationForm.get("confirmPassword"))?null:n.hasError("required"))}}function pe(t,r){1&t&&(e.TgZ(0,"div",51),e._uU(1," Passwords do not match "),e.qZA())}function he(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"ID Card is required"),e.qZA())}function fe(t,r){if(1&t&&(e.TgZ(0,"div",52),e.YNc(1,he,2,0,"div",50),e.qZA()),2&t){const o=e.oxw(2);let n;e.xp6(1),e.Q6J("ngIf",null==(n=o.registrationForm.get("idCard"))?null:n.hasError("required"))}}function _e(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"You must agree to the terms"),e.qZA())}function ve(t,r){if(1&t&&(e.TgZ(0,"div",53),e.YNc(1,_e,2,0,"div",50),e.qZA()),2&t){const o=e.oxw(2);let n;e.xp6(1),e.Q6J("ngIf",null==(n=o.registrationForm.get("agreeTerms"))?null:n.hasError("requiredTrue"))}}function xe(t,r){if(1&t){const o=e.EpF();e.TgZ(0,"div",1)(1,"div",2)(2,"h4",3),e._uU(3,"Login"),e.qZA(),e.TgZ(4,"p",4),e._uU(5,"Already gave an account ?"),e.qZA(),e.TgZ(6,"a")(7,"button",5),e.NdJ("click",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.loginClick())}),e._uU(8,"Login"),e.qZA()(),e.TgZ(9,"div",6),e._UZ(10,"img",7),e.qZA()(),e.TgZ(11,"div",8)(12,"div",9)(13,"div",10)(14,"h4",11),e._uU(15,"Sign Up"),e.qZA(),e.TgZ(16,"form",12),e.NdJ("ngSubmit",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.submitForm())}),e.TgZ(17,"div",13)(18,"div",14)(19,"span",15),e._UZ(20,"i",16),e.qZA(),e._UZ(21,"input",17),e.qZA(),e.YNc(22,V,2,1,"div",18),e.qZA(),e.TgZ(23,"div",13)(24,"div",14)(25,"span",15),e._UZ(26,"i",19),e.qZA(),e._UZ(27,"input",20),e.qZA(),e.YNc(28,oe,3,2,"div",18),e.qZA(),e.TgZ(29,"div",13)(30,"div",14)(31,"span",15),e._UZ(32,"i",21),e.qZA(),e._UZ(33,"input",22),e.qZA(),e.YNc(34,re,3,2,"div",18),e.YNc(35,le,2,0,"div",23),e.qZA(),e.TgZ(36,"div",13)(37,"div",14)(38,"span",15),e._UZ(39,"i",24),e.qZA(),e._UZ(40,"input",25),e.qZA(),e.YNc(41,se,2,1,"div",18),e.qZA(),e.TgZ(42,"div",13)(43,"div",14)(44,"span",15),e._UZ(45,"i",26),e.qZA(),e._UZ(46,"input",27),e.qZA(),e.YNc(47,ue,2,1,"div",18),e.YNc(48,ce,2,0,"div",23),e.qZA(),e.TgZ(49,"div",13)(50,"div",14)(51,"span",15),e._UZ(52,"i",26),e.qZA(),e.TgZ(53,"input",28),e.NdJ("keyup",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.ConfirmPass())}),e.qZA()(),e.YNc(54,ge,2,1,"div",18),e.YNc(55,pe,2,0,"div",23),e.qZA(),e.TgZ(56,"div",13)(57,"label",29),e._uU(58,"Upload ID Card"),e.qZA(),e.TgZ(59,"div",30)(60,"label",31)(61,"span",32),e._UZ(62,"i",33),e.qZA(),e.TgZ(63,"span",34),e._uU(64,"Choose a file"),e.qZA(),e.TgZ(65,"input",35),e.NdJ("change",function(i){e.CHM(o);const l=e.oxw();return e.KtG(l.onFileChange(i))}),e.qZA()()(),e.YNc(66,fe,2,1,"div",36),e.qZA(),e.TgZ(67,"div",37)(68,"label",38),e._UZ(69,"input",39),e.TgZ(70,"span",40),e._uU(71,"I agree to the terms and conditions"),e.qZA()(),e.YNc(72,ve,2,1,"div",41),e.qZA(),e.TgZ(73,"button",42),e._uU(74,"Register"),e.qZA()(),e.TgZ(75,"p",43),e._uU(76,"Or Sign up with social platforms"),e.qZA(),e.TgZ(77,"ul",44)(78,"li",45)(79,"a",46),e._UZ(80,"i",47),e.qZA()(),e.TgZ(81,"li",45)(82,"a",46),e._UZ(83,"i",48),e.qZA()()()()()()()}if(2&t){const o=e.oxw();let n,i,l,s,c,f,w,_,m,g;e.xp6(16),e.Q6J("formGroup",o.registrationForm),e.xp6(6),e.Q6J("ngIf",(null==(n=o.registrationForm.get("name"))?null:n.invalid)&&((null==(n=o.registrationForm.get("name"))?null:n.dirty)||(null==(n=o.registrationForm.get("name"))?null:n.touched))),e.xp6(6),e.Q6J("ngIf",(null==(i=o.registrationForm.get("email"))?null:i.invalid)&&((null==(i=o.registrationForm.get("email"))?null:i.dirty)||(null==(i=o.registrationForm.get("email"))?null:i.touched))),e.xp6(6),e.Q6J("ngIf",(null==(l=o.registrationForm.get("phoneNumber"))?null:l.invalid)&&((null==(l=o.registrationForm.get("phoneNumber"))?null:l.dirty)||(null==(l=o.registrationForm.get("phoneNumber"))?null:l.touched))),e.xp6(1),e.Q6J("ngIf",(null==(s=o.registrationForm.get("phoneNumber"))?null:s.hasError("maxLength"))&&((null==(s=o.registrationForm.get("phoneNumber"))?null:s.touched)||(null==(s=o.registrationForm.get("phoneNumber"))?null:s.dirty))),e.xp6(6),e.Q6J("ngIf",(null==(c=o.registrationForm.get("address"))?null:c.invalid)&&((null==(c=o.registrationForm.get("address"))?null:c.dirty)||(null==(c=o.registrationForm.get("address"))?null:c.touched))),e.xp6(6),e.Q6J("ngIf",(null==(f=o.registrationForm.get("password"))?null:f.invalid)&&((null==(f=o.registrationForm.get("password"))?null:f.dirty)||(null==(f=o.registrationForm.get("password"))?null:f.touched))),e.xp6(1),e.Q6J("ngIf",(null==(w=o.registrationForm.get("password"))?null:w.hasError("minlength"))&&(null==(w=o.registrationForm.get("password"))?null:w.touched)),e.xp6(6),e.Q6J("ngIf",(null==(_=o.registrationForm.get("confirmPassword"))?null:_.invalid)&&((null==(_=o.registrationForm.get("confirmPassword"))?null:_.dirty)||(null==(_=o.registrationForm.get("confirmPassword"))?null:_.touched))),e.xp6(1),e.Q6J("ngIf",(null==o.registrationForm.controls.confirmPassword?null:o.registrationForm.controls.confirmPassword.dirty)&&!o.isMatch),e.xp6(11),e.Q6J("ngIf",(null==(m=o.registrationForm.get("idCard"))?null:m.invalid)&&((null==(m=o.registrationForm.get("idCard"))?null:m.dirty)||(null==(m=o.registrationForm.get("idCard"))?null:m.touched))),e.xp6(6),e.Q6J("ngIf",(null==(g=o.registrationForm.get("agreeTerms"))?null:g.invalid)&&((null==(g=o.registrationForm.get("agreeTerms"))?null:g.dirty)||(null==(g=o.registrationForm.get("agreeTerms"))?null:g.touched)))}}let we=(()=>{class t{constructor(o,n,i,l,s){this.fb=o,this.hotelOwnerService=n,this.router=i,this.ownerDataService=l,this.tosterService=s,this.toggle=new e.vpe,this.showSignUp=!0}ngOnInit(){this.initForm()}initForm(){this.registrationForm=this.fb.group({id:["",a.kI.required],name:["",a.kI.required],email:["",[a.kI.required,a.kI.email]],phoneNumber:["",[a.kI.required,a.kI.pattern(/^\+?\d{1,10}$/),a.kI.maxLength(10)]],password:["",[a.kI.required,a.kI.minLength(8)]],confirmPassword:["",a.kI.required],address:["",a.kI.required],idCard:[null,a.kI.required],agreeTerms:[!1,a.kI.requiredTrue],hotels:this.fb.array([]),bookings:this.fb.array([])}),this.registrationForm.get("confirmPassword")?.setValidators([a.kI.required,this.passwordMatch.bind(this)]),this.registrationForm.get("email")?.valueChanges.subscribe(o=>{this.registrationForm.patchValue({id:o},{emitEvent:!1})})}passwordMatch(o){const n=this.registrationForm.get("password")?.value;return n===o.value?null:{passwordMismatch:!0}}ConfirmPass(){this.isMatch=this.registrationForm.get("password")?.value===this.registrationForm.get("confirmPassword")?.value}onFileChange(o){const n=o.target,i=document.getElementById("file-chosen");i&&(i.textContent=n.files?.length?n.files[0].name:"Choose a file")}submitForm(){if(console.log("submit"),this.registrationForm.valid){const o=this.registrationForm.value;this.hotelOwnerService.addOwner(o).subscribe(n=>{this.tosterService.showSuccess("Registration Successful","Welcome, "+o.username),this.ownerDataService.setOwnerId(o.id),setTimeout(()=>{this.router.navigateByUrl("/owner/profile")},300),console.log("Owner added successfully:",n),this.registrationForm.reset()},n=>{this.tosterService.showError("Error Adding Owner","An error occurred while adding the owner."),console.error("Error adding owner:",n)})}else this.tosterService.showWarning("Invalid Form","Please fill in the required fields.")}loginClick(){this.showSignUp=!1,this.toggle.emit()}static#e=this.\u0275fac=function(n){return new(n||t)(e.Y36(a.qu),e.Y36(v.N),e.Y36(h.F0),e.Y36(x.U),e.Y36(Z.b))};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-signup"]],outputs:{toggle:"toggle"},decls:1,vars:1,consts:[["class","flex flex-col md:flex-row justify-center items-center",4,"ngIf"],[1,"flex","flex-col","md:flex-row","justify-center","items-center"],[1,"w-full","md:w-1/2","lg:w-1/2","pr-4","pl-4","bg-gray","p-12","text-center"],[1,"text-center","fw-bolder","fs-2"],[1,"mb-3","fs-7"],[1,"inline-block","align-middle","text-center","select-none","border-2","whitespace-no-wrap","rounded-full","py-2","px-4","text-mySkyBlue","font-bold","border-mySkyBlue","hover:bg-mySkyBlue","hover:text-white",3,"click"],[1,"img-cover","p-6"],["src","https://t4.ftcdn.net/jpg/04/29/45/07/360_F_429450700_NqhpLA6sUnkUqOhpumJXG87Mn7Q9u9O8.jpg","alt",""],[1,"w-full","md:w-1/2","lg:w-1/2","pr-4","pl-4"],[1,"w-full","flex","flex-wrap","md:flex"],[1,"md:w-2/3","pr-4","pl-4","p-6","w-full","m-auto","text-center","justify-center","items-center"],[1,"text-center","fw-bolder","mb-4","fs-2"],[3,"formGroup","ngSubmit"],[1,"relative","w-full","mb-4"],[1,"flex","items-stretch","rounded","border-[1px]","border-gray-300"],[1,"p-2","bg-slate-100"],[1,"fas","fa-user","bg-transparent"],["type","text","formControlName","name","placeholder","Enter Full Name","aria-label","name","aria-describedby","basic-addon1",1,"block","w-full","border-none","outline-none","shadow-none","py-1","px-2","bg-slate-100","hover:bg-white","focus:bg-white"],["class","text-red-500 text-sm bg-white rounded p-2 shadow-lg transition duration-400 absolute -top-5 right-0",4,"ngIf"],[1,"fas","fa-envelope","bg-transparent"],["type","email","formControlName","email","placeholder","Enter Email","aria-label","email","aria-describedby","basic-addon1",1,"block","w-full","border-none","outline-none","shadow-none","py-1","px-2","bg-slate-100","hover:bg-white","focus:bg-white"],[1,"fas","fa-phone","bg-transparent"],["type","tel","formControlName","phoneNumber","placeholder","Enter Phone Number","aria-label","phoneNumber","aria-describedby","basic-addon1",1,"block","w-full","border-none","outline-none","shadow-none","py-1","px-2","bg-slate-100","hover:bg-white","focus:bg-white"],["class","text-red-500 text-sm bg-white rounded p-2 shadow-lg transition duration-400 absolute -bottom-5 right-0",4,"ngIf"],[1,"fas","fa-map-marker-alt","bg-transparent"],["type","text","formControlName","address","placeholder","Enter Address","aria-label","address","aria-describedby","basic-addon1",1,"block","w-full","border-none","outline-none","shadow-none","py-1","px-2","bg-slate-100","hover:bg-white","focus:bg-white"],[1,"fas","fa-lock","bg-transparent"],["type","password","formControlName","password","placeholder","Enter Password","aria-label","Password","aria-describedby","basic-addon1",1,"block","w-full","border-none","outline-none","shadow-none","py-1","px-2","bg-slate-100","hover:bg-white","focus:bg-white"],["type","password","formControlName","confirmPassword","placeholder","Confirm Password","aria-label","confirmPassword","aria-describedby","basic-addon1",1,"block","w-full","border-none","outline-none","shadow-none","py-1","px-2","bg-slate-100","hover:bg-white","focus:bg-white",3,"keyup"],["for","idCard",1,"block","text-sm","text-left","font-medium","text-gray-700"],[1,"flex","items-center","mt-1"],["for","idCard",1,"flex","items-center","px-2","py-1","bg-slate-100","border","rounded-md","cursor-pointer"],[1,"p-2","bg-slate-100","text-gray-700"],[1,"fas","fa-id-card"],["id","file-chosen",1,"ml-2","text-sm","font-medium","text-gray-700"],["type","file","formControlName","idCard","id","idCard","accept",".jpg, .jpeg, .png",1,"hidden",3,"change"],["class","text-red-500 text-sm bg-white rounded p-2 mt-1 shadow-lg transition duration-400",4,"ngIf"],[1,"relative","w-full","mb-4","text-left"],[1,"inline-flex","items-center"],["type","checkbox","formControlName","agreeTerms"],[1,"ml-2"],["class","text-red-500 text-sm bg-white rounded p-2 shadow-lg transition duration-400",4,"ngIf"],["type","submit",1,"move-up","inline-block","align-middle","text-center","select-none","border","font-normal","whitespace-no-wrap","rounded","no-underline","py-3","px-4","leading-tight","text-xl","fw-bold","fs-7","bg-mySkyBlue","text-white","hover:bg-blue-600","w-full"],[1,"text-center","py-4","fw-bold","text-sm"],[1,"flex","flex-wrap","items-center","justify-center","mx-auto"],[1,"float-start","px-3"],["href",""],[1,"text-2xl","fab","fa-facebook","text-myGrayBlack","move-up","hover:text-mySkyBlue"],[1,"text-2xl","fab","fa-google","text-myGrayBlack","move-up","hover:text-mySkyBlue"],[1,"text-red-500","text-sm","bg-white","rounded","p-2","shadow-lg","transition","duration-400","absolute","-top-5","right-0"],[4,"ngIf"],[1,"text-red-500","text-sm","bg-white","rounded","p-2","shadow-lg","transition","duration-400","absolute","-bottom-5","right-0"],[1,"text-red-500","text-sm","bg-white","rounded","p-2","mt-1","shadow-lg","transition","duration-400"],[1,"text-red-500","text-sm","bg-white","rounded","p-2","shadow-lg","transition","duration-400"]],template:function(n,i){1&n&&e.YNc(0,xe,84,12,"div",0),2&n&&e.Q6J("ngIf",i.showSignUp)},dependencies:[p.O5,a._Y,a.Fj,a.Wl,a.JJ,a.JL,a.sg,a.u]})}return t})();function be(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"Full Name is required"),e.qZA())}function Ze(t,r){if(1&t&&(e.TgZ(0,"div",51),e.YNc(1,be,2,0,"div",16),e.qZA()),2&t){const o=e.oxw(2);let n;e.xp6(1),e.Q6J("ngIf",null==(n=o.loginForm.get("email"))?null:n.getError)}}function Te(t,r){1&t&&(e.TgZ(0,"div"),e._uU(1,"Password is required"),e.qZA())}function ye(t,r){if(1&t&&(e.TgZ(0,"div",51),e.YNc(1,Te,2,0,"div",16),e.qZA()),2&t){const o=e.oxw(2);let n;e.xp6(1),e.Q6J("ngIf",null==(n=o.loginForm.get("password"))?null:n.getError)}}function ke(t,r){if(1&t){const o=e.EpF();e.TgZ(0,"div",24)(1,"div",25)(2,"h4",26),e._uU(3,"Register"),e.qZA(),e.TgZ(4,"p",27),e._uU(5,"Register Now and Fell the New Digital World"),e.qZA(),e.TgZ(6,"a")(7,"button",28),e.NdJ("click",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.toggleSection())}),e._uU(8,"Sign Up"),e.qZA()(),e.TgZ(9,"div",29),e._UZ(10,"img",30),e.qZA()(),e.TgZ(11,"div",31)(12,"div",32)(13,"div",33)(14,"h4",34),e._uU(15,"Login"),e.qZA(),e.TgZ(16,"form",35),e.NdJ("ngSubmit",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.submitLogin())}),e.TgZ(17,"div",36)(18,"div",37)(19,"span",38),e._UZ(20,"i",39),e.qZA(),e._UZ(21,"input",40),e.qZA(),e.YNc(22,Ze,2,1,"div",41),e.qZA(),e.TgZ(23,"div",36)(24,"div",37)(25,"span",38),e._UZ(26,"i",42),e.qZA(),e._UZ(27,"input",43),e.qZA(),e.YNc(28,ye,2,1,"div",41),e.qZA(),e.TgZ(29,"button",44),e._uU(30,"Login"),e.qZA()(),e.TgZ(31,"p",45),e._uU(32,"Or Sign in with social platforms"),e.qZA(),e.TgZ(33,"ul",46)(34,"li",47)(35,"a",48),e._UZ(36,"i",49),e.qZA()(),e.TgZ(37,"li",47)(38,"a",48),e._UZ(39,"i",50),e.qZA()()()()()()()}if(2&t){const o=e.oxw();let n,i;e.xp6(16),e.Q6J("formGroup",o.loginForm),e.xp6(6),e.Q6J("ngIf",(null==(n=o.loginForm.get("email"))?null:n.invalid)&&((null==(n=o.loginForm.get("email"))?null:n.dirty)||(null==(n=o.loginForm.get("email"))?null:n.touched))),e.xp6(6),e.Q6J("ngIf",(null==(i=o.loginForm.get("password"))?null:i.invalid)&&((null==(i=o.loginForm.get("password"))?null:i.dirty)||(null==(i=o.loginForm.get("password"))?null:i.touched)))}}function Ae(t,r){if(1&t){const o=e.EpF();e.TgZ(0,"div")(1,"app-signup",52),e.NdJ("toggle",function(){e.CHM(o);const i=e.oxw();return e.KtG(i.toggleSection())}),e.qZA()()}}function Ce(t,r){if(1&t&&(e.TgZ(0,"div",54)(1,"div",55)(2,"div",56),e.O4$(),e.TgZ(3,"svg",57),e._UZ(4,"path",58)(5,"path",59),e.qZA(),e.kcU(),e.TgZ(6,"div",60)(7,"p",61),e._uU(8),e.qZA(),e.TgZ(9,"div")(10,"h3",62),e._uU(11),e.qZA(),e.TgZ(12,"p",63),e._uU(13),e.qZA()()()(),e._UZ(14,"div",64),e.qZA()()),2&t){const o=e.oxw().$implicit;e.xp6(8),e.Oqu(o.content),e.xp6(3),e.Oqu(o.author),e.xp6(2),e.Oqu(o.position)}}function Ue(t,r){1&t&&e.YNc(0,Ce,15,3,"ng-template",53)}let qe=(()=>{class t{constructor(o,n,i,l,s,c){this.fb=o,this.hotelOwnerService=n,this.router=i,this.ownerDataService=l,this.tosterService=s,this.ownerAuthService=c,this.showSignUp=!1,this.testimonialData=[{content:"Using the travel booking website has significantly improved our business. The platform's efficiency and customer reach are unparalleled. Managing our hotel is now a breeze. Highly recommended!",author:"Satisfied Hotelier",position:"Manager, Luxury Suites"},{content:"The travel booking website has been a key factor in our business growth. Its user-friendly design and effective features have made a positive impact on our hotel operations. A must-have for hotel owners!",author:"Thriving Hotel Manager",position:"Director, Comfort Inns"},{content:"Our experience with the travel booking website has been outstanding. It has not only simplified our booking process but also attracted a diverse clientele. We're extremely pleased with the results!",author:"Delighted Hotel Owner",position:"CEO, Grand Residences"},{content:"The travel booking website is a game-changer for hotel owners. Its intuitive interface and comprehensive features have enhanced our business strategy. Highly recommended for those aiming for success!",author:"Pleased Hotel Manager",position:"COO, Serene Stays"},{content:"Our decision to use the travel booking website has proven to be highly beneficial. It has streamlined our booking procedures and brought in a steady stream of guests. A fantastic tool for hotel owners!",author:"Happy Hotel Manager",position:"Manager, Tranquil Inns"},{content:"We've witnessed remarkable growth since implementing the travel booking website. Its impact on our hotel's success is undeniable. A valuable asset for any hotel owner looking to thrive in the industry!",author:"Content Hotel Executive",position:"Executive Director, Blissful Retreats"}],this.customOptions={loop:!0,mouseDrag:!1,touchDrag:!1,pullDrag:!1,dots:!1,navSpeed:700,navText:["",""],autoplay:!0,autoplayTimeout:2e3,autoplaySpeed:800,responsive:{0:{items:1},600:{items:2},800:{items:3},1e3:{items:3}},nav:!0},this.loginForm=this.fb.group({email:["",a.kI.required],password:["",a.kI.required]})}submitLogin(){if(this.loginForm.valid){const{email:o,password:n}=this.loginForm.value;this.ownerAuthService.login(o,n).subscribe(i=>{const l=i.token;console.log("Token:",l),this.ownerDataService.storeToken(l);const s=this.ownerAuthService.getUserIdFromToken(l);console.log("User ID:",s),this.ownerDataService.setOwnerId(s);const c=this.ownerAuthService.isAuthenticated(l);console.log("Is Authenticated:",c),c?(this.tosterService.showSuccess("Login Successful","Welcome back, "+o),setTimeout(()=>{this.router.navigateByUrl("/owner/profile")},300)):(this.tosterService.showError("Authentication Failed","Invalid token or user not authenticated."),console.error("Authentication failed"))},i=>{this.tosterService.showError("Login Failed","An error occurred while logging in."),console.error("Login failed",i)})}else this.tosterService.showWarning("Invalid Form","Please fill in the required fields."),this.markFormGroupTouched(this.loginForm)}markFormGroupTouched(o){Object.values(o.controls).forEach(n=>{n instanceof a.cw?this.markFormGroupTouched(n):n.markAsTouched()})}toggleSection(){this.showSignUp=!this.showSignUp}generateFakeLoop(o){return new Array(o).fill(0).map((n,i)=>i)}static#e=this.\u0275fac=function(n){return new(n||t)(e.Y36(a.qu),e.Y36(v.N),e.Y36(h.F0),e.Y36(x.U),e.Y36(Z.b),e.Y36(I.L))};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-login"]],decls:35,vars:4,consts:[[1,"w-full","h-[80vh]","relative"],["id","background-Dark",1,"fixed","inset-0","w-full","h-[80vh]","z-[-1]"],[1,"absolute","inset-0","bg-black",2,"opacity","60%"],["src","https://img.theculturetrip.com/wp-content/uploads/2021/02/d9fc611f.jpg","alt","",1,"w-full","h-[80vh]","object-cover"],["data-wow-delay","0.1s",1,"text-center","flex","flex-col","items-center","justify-center","wow","fadeInUp","pt-5","mx-auto","my-4"],[1,"section-title","text-center","text-white","text-2xl","font-serif"],[1,"text-white","capitalize","font-serif"],[1,"hidden","md:inline-block","text-mySkyBlue","font-bold","capitalize","bg-white","p-2","ml-2","rounded"],[1,"inline-block","md:hidden","text-mySkyBlue","font-bold","capitalize","bg-white","p-2","ml-2","rounded"],[1,"container","hidden","md:block","bg-white","mt-6","rounded","bg-no-repeat","bg-cover"],[1,"text-gray-900","mt-4","text-2xl","capitalize","font-medium"],[1,"text-mySkyBlue","mt-4","text-xl","font-bold"],[1,"block","md:hidden","bg-white","p-1","text-mySkyBlue","mt-4","text-xl","font-bold"],[1,"bg-white","w-screen","border-b-[1px]"],[1,"max-w-full","text-myGrayBlack","mx-auto","sm:px-4"],["class","flex flex-col md:flex-row justify-center items-center",4,"ngIf"],[4,"ngIf"],["id","testimonials",1,"bg-slate-100","py-10"],[1,"container","mx-auto","text-center"],[1,"text-3xl","font-bold","m-0","p-0","text-center","text-myGrayBlack"],[1,"text-mySkyBlue","text-2xl","font-bold"],[1,"mt-4","rounded"],[3,"options"],[4,"ngFor","ngForOf"],[1,"flex","flex-col","md:flex-row","justify-center","items-center"],[1,"w-full","md:w-1/2","lg:w-1/2","pr-4","pl-4","bg-gray","p-12","text-center"],[1,"text-center","fw-bolder","fs-2"],[1,"mb-3","fs-7"],[1,"inline-block","align-middle","text-center","select-none","border-2","whitespace-no-wrap","rounded-full","py-2","px-4","text-mySkyBlue","font-bold","border-mySkyBlue","hover:bg-mySkyBlue","hover:text-white",3,"click"],[1,"img-cover","p-6"],["src","https://t4.ftcdn.net/jpg/04/29/45/07/360_F_429450700_NqhpLA6sUnkUqOhpumJXG87Mn7Q9u9O8.jpg","alt",""],[1,"w-full","md:w-1/2","lg:w-1/2","pr-4","pl-4"],[1,"w-full","flex","flex-wrap","md:flex"],[1,"md:w-2/3","pr-4","pl-4","p-6","w-full","m-auto","text-center","justify-center","items-center"],[1,"text-center","fw-bolder","mb-4","fs-2"],[3,"formGroup","ngSubmit"],[1,"relative","w-full","mb-4"],[1,"flex","items-stretch","rounded","border-[1px]","border-gray-300"],[1,"p-2","bg-slate-100"],[1,"fas","fa-user","bg-transparent"],["type","text","formControlName","email","placeholder","Enter Email","aria-label","email","aria-describedby","basic-addon1",1,"block","w-full","border-none","outline-none","shadow-none","py-1","px-2","bg-slate-100","hover:bg-white","focus:bg-white"],["class","text-red-500 text-sm bg-white rounded p-2 shadow-lg transition duration-400 absolute -top-5 right-0",4,"ngIf"],[1,"fas","fa-lock","bg-transparent"],["type","text","formControlName","password","placeholder","Enter Password","aria-label","password","aria-describedby","basic-addon1",1,"block","w-full","border-none","outline-none","shadow-none","py-1","px-2","bg-slate-100","hover:bg-white","focus:bg-white"],["type","submit",1,"move-up","inline-block","align-middle","text-center","select-none","border","font-normal","whitespace-no-wrap","rounded","no-underline","py-3","px-4","leading-tight","text-xl","fw-bold","fs-7","bg-mySkyBlue","text-white","hover:bg-blue-600","w-full"],[1,"text-center","py-4","fw-bold","text-sm"],[1,"flex","flex-wrap","items-center","justify-center","mx-auto"],[1,"float-start","px-3"],["href",""],[1,"text-2xl","fab","fa-facebook","text-myGrayBlack","move-up","hover:text-mySkyBlue"],[1,"text-2xl","fab","fa-google","text-myGrayBlack","move-up","hover:text-mySkyBlue"],[1,"text-red-500","text-sm","bg-white","rounded","p-2","shadow-lg","transition","duration-400","absolute","-top-5","right-0"],[3,"toggle"],["carouselSlide",""],[1,"flex","justify-center","items-center","lg:px-10","mt-10","px-4"],[1,"bg-white","hover:shadow-indigo-300","hover:shadow-lg","rounded-lg","border"],[1,"flex","justify-center","items-start","flex-col","p-5"],["xmlns","http://www.w3.org/2000/svg","width","30","height","30","fill","none","stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","2","viewBox","0 0 24 24",1,"icon","icon-tabler","icon-tabler-quote","rotate-180","text-sky-500"],["stroke","none","d","M0 0h24v24H0z"],["d","M10 11H6a1 1 0 01-1-1V7a1 1 0 011-1h3a1 1 0 011 1v6c0 2.667-1.333 4.333-4 5M19 11h-4a1 1 0 01-1-1V7a1 1 0 011-1h3a1 1 0 011 1v6c0 2.667-1.333 4.333-4 5"],[1,"flex","justify-center","items-start","flex-col","text-left","gap-5"],[1,"italic","text-sm","md:text-base"],[1,"text-xl","md:text-2xl","font-semibold"],[1,"text-xs","md:text-sm"],[1,"bg-sky-500","p-0.5","rounded-b-lg"]],template:function(n,i){1&n&&(e.TgZ(0,"div",0)(1,"div",1),e._UZ(2,"div",2)(3,"img",3),e.qZA(),e._UZ(4,"app-header"),e.TgZ(5,"div",4)(6,"p",5),e._uU(7,"Unlock Business Opportunities"),e.qZA(),e.TgZ(8,"h1",6),e._uU(9," Elevate Your Business with "),e.TgZ(10,"span",7),e._uU(11,"MyTravel"),e.qZA()(),e.TgZ(12,"span",8),e._uU(13,"MyTravel"),e.qZA(),e.TgZ(14,"div",9)(15,"p",10),e._uU(16," Join us and transform your hotel into a thriving business! Create an account to showcase your property, attract guests, and maximize your revenue. "),e.qZA(),e.TgZ(17,"p",11),e._uU(18,"Your Success Story Starts Here."),e.qZA()(),e.TgZ(19,"p",12),e._uU(20,"Your Success Story Starts Here."),e.qZA()()(),e.TgZ(21,"section",13)(22,"div",14),e.YNc(23,ke,40,3,"div",15),e.YNc(24,Ae,2,0,"div",16),e.qZA()(),e.TgZ(25,"section",17)(26,"div",18)(27,"h2",19),e._uU(28,"What Our Clients Say"),e.qZA(),e.TgZ(29,"span",20),e._uU(30,"____"),e.qZA(),e.TgZ(31,"div",21)(32,"owl-carousel-o",22),e.YNc(33,Ue,1,0,null,23),e.qZA()()()(),e._UZ(34,"app-footer")),2&n&&(e.xp6(23),e.Q6J("ngIf",!i.showSignUp),e.xp6(1),e.Q6J("ngIf",i.showSignUp),e.xp6(8),e.Q6J("options",i.customOptions),e.xp6(1),e.Q6J("ngForOf",i.testimonialData))},dependencies:[p.sg,p.O5,a._Y,a.Fj,a.JJ,a.JL,a.sg,a.u,H.Fy,H.Mp,K.G,W.c,we]})}return t})();var u=d(5313),b=d(3566),k=d(3365),Y=d(2096),Se=d(4664),Ne=d(9397),Fe=d(6306),T=d(4170),B=d(2296),O=d(617),N=d(2032);function Ie(t,r){1&t&&(e.TgZ(0,"th",17),e._uU(1," ID "),e.qZA())}function He(t,r){if(1&t&&(e.TgZ(0,"td",18),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.hij(" ",o.id," ")}}function Ye(t,r){1&t&&(e.TgZ(0,"th",17),e._uU(1," Name "),e.qZA())}function Be(t,r){if(1&t&&(e.TgZ(0,"td",18),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.hij(" ",o.hotelName," ")}}function Oe(t,r){1&t&&(e.TgZ(0,"th",17),e._uU(1," Location "),e.qZA())}function Me(t,r){if(1&t&&(e.TgZ(0,"td",18),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.hij(" ",o.hotelLocation," ")}}function De(t,r){1&t&&(e.TgZ(0,"th",17),e._uU(1," Price "),e.qZA())}function Je(t,r){if(1&t&&(e.TgZ(0,"td",18),e._uU(1),e.ALo(2,"currency"),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.hij(" ",e.gM2(2,1,o.price,"INR","symbol","1.0-2")," ")}}function Ee(t,r){1&t&&(e.TgZ(0,"th",17),e._uU(1," Image "),e.qZA())}function Le(t,r){if(1&t&&(e.TgZ(0,"td",18),e._UZ(1,"img",19),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Q6J("src",o.image,e.LSH)}}function Qe(t,r){1&t&&(e.TgZ(0,"th",20),e._uU(1," Actions "),e.qZA())}function Pe(t,r){if(1&t){const o=e.EpF();e.TgZ(0,"td",18)(1,"button",21),e.NdJ("click",function(){const l=e.CHM(o).$implicit,s=e.oxw();return e.KtG(s.editHotel(l))}),e.TgZ(2,"mat-icon"),e._uU(3,"edit"),e.qZA()(),e.TgZ(4,"button",22),e.NdJ("click",function(){const l=e.CHM(o).$implicit,s=e.oxw();return e.KtG(s.deleteHotel(l))}),e.TgZ(5,"mat-icon"),e._uU(6,"delete"),e.qZA()()()}}function je(t,r){1&t&&e._UZ(0,"tr",23)}function Ge(t,r){1&t&&e._UZ(0,"tr",24)}const ze=function(){return[5,10,25,100]};let $e=(()=>{class t{constructor(o,n,i,l){this.hotelService=o,this.ownerDataService=n,this.router=i,this.tosterService=l,this.displayedColumns=["id","name","location","image","price","actions"],this.ownerId=this.ownerDataService.getOwnerId(),this.fetchHotels()}fetchHotels(){(0,Y.of)(this.ownerDataService.getOwnerId()).pipe((0,Se.w)(o=>this.hotelService.getHotelsForOwner(o)),(0,Ne.b)(o=>{this.dataSource=new u.by(o),this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort}),(0,Fe.K)(o=>(console.error("Error fetching hotels:",o),(0,Y.of)([])))).subscribe()}applyFilter(o){this.dataSource.filter=o.target.value.trim().toLowerCase(),this.dataSource.paginator&&this.dataSource.paginator.firstPage()}editHotel(o){this.router.navigate(["/owner/add-hotel",{mode:"edit",hotelId:o.id}])}deleteHotel(o){console.log("Delete hotel:",o),this.hotelService.deleteHotel(o.id,this.ownerId).subscribe({next:()=>{console.log("Hotel deleted successfully"),this.tosterService.showSuccess("Hotel Deleted","The hotel has been deleted successfully."),this.hotelService.getHotelsForOwner(this.ownerId).subscribe(n=>{this.dataSource.data=n})},error:n=>{this.tosterService.showError("Error Deleting Hotel","An error occurred while deleting the hotel."),console.error("Error deleting hotel",n)}})}static#e=this.\u0275fac=function(n){return new(n||t)(e.Y36(v.N),e.Y36(x.U),e.Y36(h.F0),e.Y36(Z.b))};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-hotel-list"]],viewQuery:function(n,i){if(1&n&&(e.Gf(k.NW,5),e.Gf(b.YE,5)),2&n){let l;e.iGM(l=e.CRH())&&(i.paginator=l.first),e.iGM(l=e.CRH())&&(i.sort=l.first)}},decls:26,vars:5,consts:[[1,"w-full","h-screen"],[1,"example-form-field","w-full"],["matInput","","placeholder","Search Hotels",3,"keyup"],[1,"overflow-x-scroll"],["mat-table","","matSort","",1,"mat-elevation-z8",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","name"],["matColumnDef","location"],["matColumnDef","price"],["matColumnDef","image"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[3,"pageSizeOptions"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["alt","Hotel Image",2,"width","50px","height","50px",3,"src"],["mat-header-cell",""],["mat-icon-button","","color","primary",3,"click"],["mat-icon-button","","color","warn",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(n,i){1&n&&(e.TgZ(0,"div",0)(1,"mat-form-field",1)(2,"input",2),e.NdJ("keyup",function(s){return i.applyFilter(s)}),e.qZA()(),e.TgZ(3,"div",3)(4,"table",4),e.ynx(5,5),e.YNc(6,Ie,2,0,"th",6),e.YNc(7,He,2,1,"td",7),e.BQk(),e.ynx(8,8),e.YNc(9,Ye,2,0,"th",6),e.YNc(10,Be,2,1,"td",7),e.BQk(),e.ynx(11,9),e.YNc(12,Oe,2,0,"th",6),e.YNc(13,Me,2,1,"td",7),e.BQk(),e.ynx(14,10),e.YNc(15,De,2,0,"th",6),e.YNc(16,Je,3,6,"td",7),e.BQk(),e.ynx(17,11),e.YNc(18,Ee,2,0,"th",6),e.YNc(19,Le,2,1,"td",7),e.BQk(),e.ynx(20,12),e.YNc(21,Qe,2,0,"th",13),e.YNc(22,Pe,7,0,"td",7),e.BQk(),e.YNc(23,je,1,0,"tr",14),e.YNc(24,Ge,1,0,"tr",15),e.qZA()(),e._UZ(25,"mat-paginator",16),e.qZA()),2&n&&(e.xp6(4),e.Q6J("dataSource",i.dataSource),e.xp6(19),e.Q6J("matHeaderRowDef",i.displayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",i.displayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,ze)))},dependencies:[T.KE,B.RK,O.Hw,u.BZ,u.fO,u.as,u.w1,u.Dz,u.nj,u.ge,u.ev,u.XQ,u.Gk,b.YE,b.nU,k.NW,N.Nt,p.H9]})}return t})();var Re=d(5986);function Ke(t,r){if(1&t&&e._UZ(0,"img",47),2&t){e.oxw();const o=e.MAs(44);e.Q6J("src",o.value,e.LSH)}}function We(t,r){1&t&&e._UZ(0,"img",48)}function Xe(t,r){1&t&&(e.TgZ(0,"small",14),e._UZ(1,"i",49),e._uU(2,"Wifi"),e.qZA())}function Ve(t,r){1&t&&(e.TgZ(0,"small",14),e._UZ(1,"i",50),e._uU(2,"Pool"),e.qZA())}function et(t,r){1&t&&(e.TgZ(0,"small",14),e._UZ(1,"i",51),e._uU(2,"TV"),e.qZA())}function tt(t,r){1&t&&(e.TgZ(0,"small"),e._UZ(1,"i",52),e._uU(2,"Parking"),e.qZA())}function ot(t,r){1&t&&(e.TgZ(0,"mat-error"),e._uU(1," Image URL is "),e.TgZ(2,"strong"),e._uU(3,"required"),e.qZA()())}function nt(t,r){1&t&&(e.TgZ(0,"mat-error"),e._uU(1," Name is "),e.TgZ(2,"strong"),e._uU(3,"required"),e.qZA()())}function it(t,r){1&t&&(e.TgZ(0,"mat-error"),e._uU(1," Location is "),e.TgZ(2,"strong"),e._uU(3,"required"),e.qZA()())}function rt(t,r){1&t&&(e.TgZ(0,"mat-error"),e._uU(1," Description is "),e.TgZ(2,"strong"),e._uU(3,"required"),e.qZA()())}function lt(t,r){1&t&&(e.TgZ(0,"mat-error"),e._uU(1," Number of beds is "),e.TgZ(2,"strong"),e._uU(3,"required"),e.qZA()())}function at(t,r){1&t&&(e.TgZ(0,"mat-error"),e._uU(1," Number of baths is "),e.TgZ(2,"strong"),e._uU(3,"required"),e.qZA()())}function st(t,r){1&t&&(e.TgZ(0,"mat-error"),e._uU(1," Price is "),e.TgZ(2,"strong"),e._uU(3,"required"),e.qZA()())}let M=(()=>{class t{constructor(o,n,i,l,s){this.fb=o,this.hotelService=n,this.ownerDataService=i,this.route=l,this.tosterService=s,this.wifiEnabled=!1,this.privatePool=!1,this.tv=!1,this.freeParking=!1,this.ownerId="",this.ownerId=this.ownerDataService.getOwnerId(),console.log("add hotel"+this.ownerId)}ngOnInit(){this.initializeForm(),this.subscribeToFormChanges(),this.route.params.subscribe(o=>{"edit"===o.mode&&o.hotelId&&(this.hotelID=o.hotelId,this.hotelService.getHotelById(o.hotelId).subscribe(n=>{this.addHotelForm.patchValue(n)}))})}initializeForm(){this.addHotelForm=this.fb.group({image:["",a.kI.required],hotelName:["",a.kI.required],hotelLocation:["",a.kI.required],description:["",a.kI.required],beds:[null,a.kI.required],bath:[null,a.kI.required],price:[null,[a.kI.required]],wifiEnabled:[!1],privatePool:[!1],tv:[!1],freeParking:[!1]})}subscribeToFormChanges(){this.addHotelForm.valueChanges.subscribe(o=>{this.wifiEnabled=o.wifiEnabled,this.privatePool=o.privatePool,this.tv=o.tv,this.freeParking=o.freeParking})}onSubmit(){if(this.addHotelForm.valid){const o=this.addHotelForm.value;this.isEditMode()?this.hotelService.updateHotel(this.ownerId,this.hotelID,o).subscribe(()=>{console.log("Hotel edited successfully"),this.tosterService.showSuccess("Hotel Edit Successful","The hotel details have been updated."),this.resetForm()},n=>{this.tosterService.showError("Error Editing Hotel","An error occurred while editing the hotel."),console.error("Error editing hotel",n)}):this.hotelService.addHotelForOwner(this.ownerId,o).subscribe(n=>{this.hotelService.updateOwnerHotels(this.ownerId,n.id).subscribe(()=>{this.tosterService.showSuccess("Hotel Added","Your new hotel has been added."),console.log("Hotel added successfully"),this.addHotelForm.reset(),this.addHotelForm.markAsPristine(),this.addHotelForm.markAsUntouched()},l=>{this.tosterService.showError("Error Updating Owner Hotels","An error occurred while updating owner hotels."),console.error("Error updating owner hotels",l)})},n=>{this.tosterService.showError("Error Adding Hotel","An error occurred while adding the hotel."),console.error("Error adding hotel",n)})}else this.markFormGroupTouched(this.addHotelForm),this.tosterService.showWarning("Invalid Form","Please fill in the required fields.")}isEditMode(){return"edit"===this.route.snapshot.params.mode}resetForm(){this.addHotelForm.reset(),this.addHotelForm.markAsPristine(),this.addHotelForm.markAsUntouched()}markFormGroupTouched(o){Object.values(o.controls).forEach(n=>{n instanceof a.cw?this.markFormGroupTouched(n):n.markAsTouched()})}static#e=this.\u0275fac=function(n){return new(n||t)(e.Y36(a.qu),e.Y36(v.N),e.Y36(x.U),e.Y36(h.gz),e.Y36(Z.b))};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-add-hotel"]],decls:100,vars:19,consts:[[1,"w-full","h-full","flex","flex-col","md:flex-row","items-start","justify-between"],[1,"lg:w-1/2","p-4","md:w-1/2","w-full","mb-4"],[1,""],[1,"room-item","shadow","rounded","overflow-hidden","bg-white"],[1,"relative"],["class","max-w-full h-auto","alt","",3,"src",4,"ngIf"],["class","max-w-full h-auto","src","https://thumbs.dreamstime.com/b/hotel-bed-room-21064950.jpg","alt","",4,"ngIf"],[1,"absolute","start-0","top-100","translate-middle-y","bg-mySkyBlue","text-white","rounded","py-1","px-3","ms-4"],[1,"p-6","mt-2"],[1,"flex","justify-between","mb-3"],[1,"mb-0"],[1,"ps-2"],[1,"fa","fa-star","text-mySkyBlue"],[1,"flex","mb-3"],[1,"border-end","me-3","pe-3"],[1,"fa","fa-bed","text-mySkyBlue","me-2"],[1,"fa","fa-bath","text-mySkyBlue","me-2"],["class","border-end me-3 pe-3",4,"ngIf"],[4,"ngIf"],[1,"text-body","mb-3"],[1,"flex","justify-between"],["href","",1,"inline-block","align-middle","text-center","select-none","border","font-normal","whitespace-no-wrap","no-underline","leading-tight","text-xs","bg-mySkyBlue","text-white","hover:bg-mySkyBlue","rounded","py-2","px-4","move-up"],["href","",1,"inline-block","align-middle","text-center","select-none","border","font-normal","whitespace-no-wrap","no-underline","leading-tight","text-xs","bg-gray-800","text-white","hover:bg-gray-900","rounded","py-2","px-4","move-up"],[1,"w-full","flex","flex-wrap","items-center","gap-2","justify-between","example-container",3,"formGroup","ngSubmit"],[1,"w-full"],[1,"w-full","example-container"],["type","text","matInput","","formControlName","image","placeholder","Enter the image URL"],["image",""],["type","text","matInput","","formControlName","hotelName","placeholder","Ex. John Doe"],["hotelName",""],["type","text","matInput","","formControlName","hotelLocation","placeholder","Enter the hotel location"],["hotelLocation",""],["matInput","","formControlName","description","placeholder","Enter a description"],["description",""],["type","number","matInput","","formControlName","beds","placeholder","Enter the number of beds"],["beds",""],["type","number","matInput","","formControlName","bath","placeholder","Enter the number of baths"],["bath",""],["type","number","matInput","","formControlName","price","placeholder","Enter the price"],["price",""],[1,"w-full","flex","flex-wrap","items-center","justify-center","gap-2"],["formControlName","wifiEnabled",1,"example-container"],["formControlName","privatePool",1,"example-container"],["formControlName","tv",1,"example-container"],["formControlName","freeParking",1,"example-container"],[1,"flex","w-full","justify-center","items-center"],["type","submit",1,"inline-block","align-middle","text-center","select-none","border","whitespace-no-wrap","no-underline","leading-tight","text-sm","bg-mySkyBlue","text-white","font-semibold","hover:bg-mySkyBlue","rounded","py-2","px-4","move-up"],["alt","",1,"max-w-full","h-auto",3,"src"],["src","https://thumbs.dreamstime.com/b/hotel-bed-room-21064950.jpg","alt","",1,"max-w-full","h-auto"],[1,"fa","fa-wifi","text-mySkyBlue","me-2"],[1,"fa","fa-swimming-pool","text-mySkyBlue","me-2"],[1,"fa","fa-tv","text-mySkyBlue","me-2"],[1,"fa","fa-car","text-mySkyBlue","me-2"]],template:function(n,i){if(1&n&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),e.YNc(5,Ke,1,1,"img",5),e.YNc(6,We,1,0,"img",6),e.TgZ(7,"small",7),e._uU(8),e.qZA()(),e.TgZ(9,"div",8)(10,"div",9)(11,"h5",10),e._uU(12),e.qZA(),e.TgZ(13,"div",11),e._UZ(14,"small",12)(15,"small",12)(16,"small",12)(17,"small",12)(18,"small",12),e.qZA()(),e.TgZ(19,"div",13)(20,"small",14),e._UZ(21,"i",15),e._uU(22),e.qZA(),e.TgZ(23,"small",14),e._UZ(24,"i",16),e._uU(25),e.qZA(),e.YNc(26,Xe,3,0,"small",17),e.YNc(27,Ve,3,0,"small",17),e.YNc(28,et,3,0,"small",17),e.YNc(29,tt,3,0,"small",18),e.qZA(),e.TgZ(30,"p",19),e._uU(31),e.qZA(),e.TgZ(32,"div",20)(33,"a",21),e._uU(34,"View Detail"),e.qZA(),e.TgZ(35,"a",22),e._uU(36,"Book Now"),e.qZA()()()()()(),e.TgZ(37,"div",1)(38,"form",23),e.NdJ("ngSubmit",function(){return i.onSubmit()}),e.TgZ(39,"div",24)(40,"mat-form-field",25)(41,"mat-label"),e._uU(42,"Image URL"),e.qZA(),e._UZ(43,"input",26,27),e.YNc(45,ot,4,0,"mat-error",18),e.qZA()(),e.TgZ(46,"div",24)(47,"mat-form-field",25)(48,"mat-label"),e._uU(49,"Hotel Name"),e.qZA(),e._UZ(50,"input",28,29),e.YNc(52,nt,4,0,"mat-error",18),e.qZA()(),e.TgZ(53,"div",24)(54,"mat-form-field",25)(55,"mat-label"),e._uU(56,"Hotel Location"),e.qZA(),e._UZ(57,"input",30,31),e.YNc(59,it,4,0,"mat-error",18),e.qZA()(),e.TgZ(60,"div",24)(61,"mat-form-field",25)(62,"mat-label"),e._uU(63,"Description"),e.qZA(),e._UZ(64,"textarea",32,33),e.YNc(66,rt,4,0,"mat-error",18),e.qZA()(),e.TgZ(67,"div",24)(68,"mat-form-field",25)(69,"mat-label"),e._uU(70,"Number of Beds"),e.qZA(),e._UZ(71,"input",34,35),e.YNc(73,lt,4,0,"mat-error",18),e.qZA()(),e.TgZ(74,"div",24)(75,"mat-form-field",25)(76,"mat-label"),e._uU(77,"Number of Bath"),e.qZA(),e._UZ(78,"input",36,37),e.YNc(80,at,4,0,"mat-error",18),e.qZA()(),e.TgZ(81,"div",24)(82,"mat-form-field",25)(83,"mat-label"),e._uU(84,"Price (INR)"),e.qZA(),e._UZ(85,"input",38,39),e.YNc(87,st,4,0,"mat-error",18),e.qZA()(),e.TgZ(88,"div",40)(89,"mat-checkbox",41),e._uU(90,"WiFi"),e.qZA(),e.TgZ(91,"mat-checkbox",42),e._uU(92,"Private Pool"),e.qZA(),e.TgZ(93,"mat-checkbox",43),e._uU(94,"TV"),e.qZA(),e.TgZ(95,"mat-checkbox",44),e._uU(96,"Free Parking"),e.qZA()(),e.TgZ(97,"div",45)(98,"button",46),e._uU(99,"Add Hotel"),e.qZA()()()()()),2&n){const l=e.MAs(44),s=e.MAs(51),c=e.MAs(65),f=e.MAs(72),w=e.MAs(79),_=e.MAs(86);let m,g,A,C,U,q,S;e.xp6(5),e.Q6J("ngIf",l.value),e.xp6(1),e.Q6J("ngIf",!l.value),e.xp6(2),e.hij("",_.value?_.value:"1000","\u20b9/Night"),e.xp6(4),e.Oqu(s.value?s.value:"Junior Suite"),e.xp6(10),e.Oqu(f.value?f.value:2),e.xp6(3),e.Oqu(w.value?w.value:4),e.xp6(1),e.Q6J("ngIf",i.wifiEnabled),e.xp6(1),e.Q6J("ngIf",i.privatePool),e.xp6(1),e.Q6J("ngIf",i.tv),e.xp6(1),e.Q6J("ngIf",i.freeParking),e.xp6(2),e.Oqu(c.value?c.value:"Erat ipsum justo amet duo et elitr dolor, est duo duo eos lorem sed diam stet diam sed stet lorem"),e.xp6(7),e.Q6J("formGroup",i.addHotelForm),e.xp6(7),e.Q6J("ngIf",(null==(m=i.addHotelForm.get("image"))?null:m.hasError("required"))&&(null==(m=i.addHotelForm.get("image"))?null:m.touched)),e.xp6(7),e.Q6J("ngIf",(null==(g=i.addHotelForm.get("hotelName"))?null:g.hasError("required"))&&(null==(g=i.addHotelForm.get("hotelName"))?null:g.touched)),e.xp6(7),e.Q6J("ngIf",(null==(A=i.addHotelForm.get("hotelLocation"))?null:A.hasError("required"))&&(null==(A=i.addHotelForm.get("hotelLocation"))?null:A.touched)),e.xp6(7),e.Q6J("ngIf",(null==(C=i.addHotelForm.get("description"))?null:C.hasError("required"))&&(null==(C=i.addHotelForm.get("description"))?null:C.touched)),e.xp6(7),e.Q6J("ngIf",(null==(U=i.addHotelForm.get("beds"))?null:U.hasError("required"))&&(null==(U=i.addHotelForm.get("beds"))?null:U.touched)),e.xp6(7),e.Q6J("ngIf",(null==(q=i.addHotelForm.get("bath"))?null:q.hasError("required"))&&(null==(q=i.addHotelForm.get("bath"))?null:q.touched)),e.xp6(7),e.Q6J("ngIf",(null==(S=i.addHotelForm.get("price"))?null:S.hasError("required"))&&(null==(S=i.addHotelForm.get("price"))?null:S.touched))}},dependencies:[p.O5,a._Y,a.Fj,a.wV,a.JJ,a.JL,a.sg,a.u,T.KE,T.hX,T.TO,Re.oG,N.Nt],styles:[".example-container[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%] + mat-form-field[_ngcontent-%COMP%]{margin-left:8px}.example-right-align[_ngcontent-%COMP%]{text-align:right}input.example-right-align[_ngcontent-%COMP%]::-webkit-outer-spin-button, input.example-right-align[_ngcontent-%COMP%]::-webkit-inner-spin-button{display:none}input.example-right-align[_ngcontent-%COMP%]{-moz-appearance:textfield}.example-tel-input-container[_ngcontent-%COMP%]{display:flex}.example-tel-input-element[_ngcontent-%COMP%]{border:none;background:none;padding:0;outline:none;font:inherit;text-align:center;color:currentcolor}.example-tel-input-spacer[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s}"]})}return t})();var dt=d(5516),ut=d(9862);let ct=(()=>{class t{constructor(o){this.http=o,this.apiUrl=`${dt.N.API_ENDPOINT}/bookings`}createBooking(o){return this.http.post(this.apiUrl,o)}getBookingsByOwner(o){return this.http.get(`${this.apiUrl}?ownerId=${o}`)}getBookings(){return this.http.get(this.apiUrl)}deleteBooking(o){return this.http.delete(`${this.apiUrl}/${o}`)}static#e=this.\u0275fac=function(n){return new(n||t)(e.LFG(ut.eN))};static#t=this.\u0275prov=e.Yz7({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function mt(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"ID"),e.qZA())}function gt(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(o.id)}}function pt(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"Full Name"),e.qZA())}function ht(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(o.fullName)}}function ft(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"Email"),e.qZA())}function _t(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(o.email)}}function vt(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"Phone Number"),e.qZA())}function xt(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(o.phoneNumber)}}function wt(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"Rooms"),e.qZA())}function bt(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(o.rooms)}}function Zt(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"Date Check-In"),e.qZA())}function Tt(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.ALo(2,"date"),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,o.dateCheckIn))}}function yt(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"Date Check-Out"),e.qZA())}function kt(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.ALo(2,"date"),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,o.dateCheckOut))}}function At(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"Total Price"),e.qZA())}function Ct(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.ALo(2,"currency"),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(e.gM2(2,1,o.totalPrice,"INR","symbol","1.0-2"))}}function Ut(t,r){1&t&&(e.TgZ(0,"th",21),e._uU(1,"Hotel Name"),e.qZA())}function qt(t,r){if(1&t&&(e.TgZ(0,"td",22),e._uU(1),e.qZA()),2&t){const o=r.$implicit;e.xp6(1),e.Oqu(o.hotelName)}}function St(t,r){1&t&&(e.TgZ(0,"th",23),e._uU(1,"Actions"),e.qZA())}function Nt(t,r){if(1&t){const o=e.EpF();e.TgZ(0,"td",22)(1,"button",24),e.NdJ("click",function(){const l=e.CHM(o).$implicit,s=e.oxw();return e.KtG(s.deleteBooking(l))}),e.TgZ(2,"mat-icon"),e._uU(3,"delete"),e.qZA()()()}}function Ft(t,r){1&t&&e._UZ(0,"tr",25)}function It(t,r){1&t&&e._UZ(0,"tr",26)}const Ht=function(){return[5,10,25,100]};let Yt=(()=>{class t{constructor(o,n){this.bookingsService=o,this.ownerDataService=n,this.displayedColumns=["id","fullName","email","phoneNumber","rooms","dateCheckIn","dateCheckOut","totalPrice","hotelName","actions"];const i=this.ownerDataService.getOwnerId();this.bookingsService.getBookingsByOwner(i).subscribe(l=>{this.dataSource=new u.by(l),this.dataSource.paginator=this.paginator,this.dataSource.sort=this.sort})}applyFilter(o){this.dataSource.filter=o.target.value.trim().toLowerCase(),this.dataSource.paginator&&this.dataSource.paginator.firstPage()}editBooking(o){console.log("Edit booking:",o)}deleteBooking(o){console.log("Delete booking:",o)}static#e=this.\u0275fac=function(n){return new(n||t)(e.Y36(ct),e.Y36(x.U))};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-manage-bookings"]],viewQuery:function(n,i){if(1&n&&(e.Gf(k.NW,5),e.Gf(b.YE,5)),2&n){let l;e.iGM(l=e.CRH())&&(i.paginator=l.first),e.iGM(l=e.CRH())&&(i.sort=l.first)}},decls:38,vars:5,consts:[[1,"w-full","h-screen"],[1,"example-form-field","w-full"],["matInput","","placeholder","Search Hotels",3,"keyup"],[1,"overflow-x-scroll"],["mat-table","","matSort","",1,"mat-elevation-z8",3,"dataSource"],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","fullName"],["matColumnDef","email"],["matColumnDef","phoneNumber"],["matColumnDef","rooms"],["matColumnDef","dateCheckIn"],["matColumnDef","dateCheckOut"],["matColumnDef","totalPrice"],["matColumnDef","hotelName"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[3,"pageSizeOptions"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","","color","warn",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(n,i){1&n&&(e.TgZ(0,"div",0)(1,"mat-form-field",1)(2,"input",2),e.NdJ("keyup",function(s){return i.applyFilter(s)}),e.qZA()(),e.TgZ(3,"div",3)(4,"table",4),e.ynx(5,5),e.YNc(6,mt,2,0,"th",6),e.YNc(7,gt,2,1,"td",7),e.BQk(),e.ynx(8,8),e.YNc(9,pt,2,0,"th",6),e.YNc(10,ht,2,1,"td",7),e.BQk(),e.ynx(11,9),e.YNc(12,ft,2,0,"th",6),e.YNc(13,_t,2,1,"td",7),e.BQk(),e.ynx(14,10),e.YNc(15,vt,2,0,"th",6),e.YNc(16,xt,2,1,"td",7),e.BQk(),e.ynx(17,11),e.YNc(18,wt,2,0,"th",6),e.YNc(19,bt,2,1,"td",7),e.BQk(),e.ynx(20,12),e.YNc(21,Zt,2,0,"th",6),e.YNc(22,Tt,3,3,"td",7),e.BQk(),e.ynx(23,13),e.YNc(24,yt,2,0,"th",6),e.YNc(25,kt,3,3,"td",7),e.BQk(),e.ynx(26,14),e.YNc(27,At,2,0,"th",6),e.YNc(28,Ct,3,6,"td",7),e.BQk(),e.ynx(29,15),e.YNc(30,Ut,2,0,"th",6),e.YNc(31,qt,2,1,"td",7),e.BQk(),e.ynx(32,16),e.YNc(33,St,2,0,"th",17),e.YNc(34,Nt,4,0,"td",7),e.BQk(),e.YNc(35,Ft,1,0,"tr",18),e.YNc(36,It,1,0,"tr",19),e.qZA()(),e._UZ(37,"mat-paginator",20),e.qZA()),2&n&&(e.xp6(4),e.Q6J("dataSource",i.dataSource),e.xp6(31),e.Q6J("matHeaderRowDef",i.displayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",i.displayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,Ht)))},dependencies:[T.KE,B.RK,O.Hw,u.BZ,u.fO,u.as,u.w1,u.Dz,u.nj,u.ge,u.ev,u.XQ,u.Gk,b.YE,b.nU,k.NW,N.Nt,p.H9,p.uU]})}return t})(),Bt=(()=>{class t{constructor(o,n){this.ownerDataService=o,this.hotelServices=n,this.ownerId="",this.totalHotels=0,this.totalBookings=0,this.todayDate="",this.ownerId=this.ownerDataService.getOwnerId()}ngOnInit(){this.hotelServices.getHotelsForOwner(this.ownerId).subscribe(o=>{this.totalHotels=o.length}),this.hotelServices.getBookingsForOwner(this.ownerId).subscribe(o=>{this.totalBookings=o.length}),this.todayDate=this.getCurrentDate()}getCurrentDate(){return(new Date).toLocaleDateString("en-US")}static#e=this.\u0275fac=function(n){return new(n||t)(e.Y36(x.U),e.Y36(v.N))};static#t=this.\u0275cmp=e.Xpm({type:t,selectors:[["app-profile"]],decls:83,vars:3,consts:[[1,"container","flex","flex-col","gap-4","items-center","justify-center"],[1,"flex","flex-wrap","items-center","justify-center","gap-2"],[1,"w-full","px-6","sm:w-full","md:w-full","lg:w-[45%]"],[1,"flex","items-center","px-5","py-6","shadow-sm","rounded-md","bg-slate-100"],[1,"p-3","rounded-full","bg-indigo-600","bg-opacity-75"],[1,"fas","fa-hotel","text-2xl","fa-fw","text-white"],[1,"mx-5"],[1,"text-2xl","font-semibold","text-gray-700"],[1,"text-gray-500"],[1,"w-full","px-6","sm:w-full","md:w-full","lg:w-[45%]","sm:mt-0"],[1,"p-3","rounded-full","bg-orange-600","bg-opacity-75"],[1,"fas","fa-book","fa-fw","h-8","w-8","text-2xl","text-white"],[1,"w-full","px-6","sm:w-full","md:w-full","lg:w-[45%]","xl:mt-0"],[1,"p-3","rounded-full","bg-pink-600","bg-opacity-75"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor",1,"h-8","w-8","text-white"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"],[1,"p-3","rounded-full","bg-green-400"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M12 6v6l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"],[1,"bgw","w-full","flex","items-center","justify-center","flex-col","gap-4"],[1,"text-2xl","font-bold","text-myGray","capitalize"],[1,"w-full","flex","flex-wrap","gap2"],[1,"group","mb-2","relative","cursor-pointer","overflow-hidden","bg-white","px-6","pt-10","pb-8","shadow-xl","ring-1","ring-gray-900/5","transition-all","duration-300","hover:-translate-y-1","hover:shadow-2xl","sm:mx-auto","sm:max-w-sm","sm:rounded-lg","sm:px-10"],[1,"absolute","top-10","z-0","h-20","w-20","rounded-full","bg-sky-500","transition-all","duration-300","group-hover:scale-[10]"],[1,"relative","z-10","mx-auto","max-w-md"],[1,"grid","h-20","w-20","place-items-center","rounded-full","bg-sky-500","transition-all","duration-300","group-hover:bg-sky-400"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke-width","1.5","stroke","currentColor",1,"h-10","w-10","text-white","transition-all"],["stroke-linecap","round","stroke-linejoin","round","d","M8.625 9.75a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 01.778-.332 48.294 48.294 0 005.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"],[1,"space-y-6","pt-5","text-lg","leading-7","text-gray-600","transition-all","duration-300","group-hover:text-white/90"],[1,"pt-5","text-base","font-semibold","leading-7"],["href","#",1,"text-sky-500","transition-all","duration-300","group-hover:text-white"],[1,"group","relative","cursor-pointer","overflow-hidden","bg-white","px-6","pt-10","pb-8","shadow-xl","ring-1","ring-gray-900/5","transition-all","duration-300","hover:-translate-y-1","hover:shadow-2xl","sm:mx-auto","sm:max-w-sm","sm:rounded-lg","sm:px-10"]],template:function(n,i){1&n&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),e._UZ(5,"i",5),e.qZA(),e.TgZ(6,"div",6)(7,"h4",7),e._uU(8),e.qZA(),e.TgZ(9,"div",8),e._uU(10,"Total Hotels"),e.qZA()()()(),e.TgZ(11,"div",9)(12,"div",3)(13,"div",10),e._UZ(14,"i",11),e.qZA(),e.TgZ(15,"div",6)(16,"h4",7),e._uU(17),e.qZA(),e.TgZ(18,"div",8),e._uU(19,"Total Bookings"),e.qZA()()()(),e.TgZ(20,"div",12)(21,"div",3)(22,"div",13),e.O4$(),e.TgZ(23,"svg",14),e._UZ(24,"path",15),e.qZA()(),e.kcU(),e.TgZ(25,"div",6)(26,"h4",7),e._uU(27,"678"),e.qZA(),e.TgZ(28,"div",8),e._uU(29,"Total Visit"),e.qZA()()()(),e.TgZ(30,"div",12)(31,"div",3)(32,"div",16),e.O4$(),e.TgZ(33,"svg",14),e._UZ(34,"path",17),e.qZA()(),e.kcU(),e.TgZ(35,"div",6)(36,"h4",7),e._uU(37),e.qZA(),e.TgZ(38,"div",8),e._uU(39,"Date"),e.qZA()()()()(),e.TgZ(40,"div",18)(41,"h2",19),e._uU(42,"Tips for Business Growth"),e.qZA(),e.TgZ(43,"div",20)(44,"div",21),e._UZ(45,"span",22),e.TgZ(46,"div",23)(47,"span",24),e.O4$(),e.TgZ(48,"svg",25),e._UZ(49,"path",26),e.qZA()(),e.kcU(),e.TgZ(50,"div",27)(51,"p"),e._uU(52,"Use Online Marketing: Take advantage of social media and online travel sites to reach more people."),e.qZA()(),e.TgZ(53,"div",28)(54,"p")(55,"a",29),e._uU(56,"Read the docs \u2192 "),e.qZA()()()()(),e.TgZ(57,"div",21),e._UZ(58,"span",22),e.TgZ(59,"div",23)(60,"span",24),e.O4$(),e.TgZ(61,"svg",25),e._UZ(62,"path",26),e.qZA()(),e.kcU(),e.TgZ(63,"div",27)(64,"p"),e._uU(65,"Improve Customer Experience: Provide personalized services and create memorable moments for your guests."),e.qZA()(),e.TgZ(66,"div",28)(67,"p")(68,"a",29),e._uU(69,"Read the docs \u2192 "),e.qZA()()()()(),e.TgZ(70,"div",30),e._UZ(71,"span",22),e.TgZ(72,"div",23)(73,"span",24),e.O4$(),e.TgZ(74,"svg",25),e._UZ(75,"path",26),e.qZA()(),e.kcU(),e.TgZ(76,"div",27)(77,"p"),e._uU(78,"Get Feedback from Customers: Listen to guest reviews to enhance your services and quickly address any concerns."),e.qZA()(),e.TgZ(79,"div",28)(80,"p")(81,"a",29),e._uU(82,"Read the docs \u2192 "),e.qZA()()()()()()()()),2&n&&(e.xp6(8),e.Oqu(i.totalHotels),e.xp6(9),e.Oqu(i.totalBookings),e.xp6(20),e.Oqu(i.todayDate))}})}return t})();var Ot=d(2437);const y=(t,r)=>{const n=(0,e.f3M)(h.F0),i=(0,e.f3M)(I.L),s=(0,e.f3M)(Ot.u).get("authToken");return!(!s||!i.isAuthenticated(s))||(n.navigateByUrl("owner/login"),!1)},Mt=[{path:"",component:R,children:[{path:"",redirectTo:"profile",pathMatch:"full"},{path:"profile",component:Bt,canActivate:[y]},{path:"all-hotels",component:$e,canActivate:[y]},{path:"add-hotel",component:M,canActivate:[y]},{path:"add-hotel/:mode/:hotelId",component:M,canActivate:[y]},{path:"booking-list",component:Yt,canActivate:[y]}]},{path:"login",component:qe}];let Dt=(()=>{class t{static#e=this.\u0275fac=function(n){return new(n||t)};static#t=this.\u0275mod=e.oAB({type:t});static#o=this.\u0275inj=e.cJS({imports:[h.Bz.forChild(Mt),h.Bz]})}return t})();var Jt=d(6707);let Et=(()=>{class t{static#e=this.\u0275fac=function(n){return new(n||t)};static#t=this.\u0275mod=e.oAB({type:t});static#o=this.\u0275inj=e.cJS({imports:[p.ez,Dt,Jt.m]})}return t})()}}]);