PageSourceSearch

https://host.tablesready.com/manager/manager-settings-resources.1.44.2.js

js tablesready.com collected 2026-09-30 17:37:53 UTC 189,852 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkmanager=self.webpackChunkmanager||[]).push([[9802],{
1"./apps/manager/src/app/settings/preferences/resources/resources.module.ts":(Un,Ie,u)=>{u.r(Ie),u.d(Ie,{ResourcesModule:()=>Rn});var j=u("./node_modules/@angular/common/fesm2022/common_module-Dx7dWex5.mjs"),d=u("./node_modules/@angular/forms/fesm2022/forms.mjs"),we=u("./node_modules/@angular/cdk/fesm2022/overlay-module-BUj0D19H.mjs"),le=u("./node_modules/@ionic/angular/fesm2020/ionic-angular.mjs"),$=u("./node_modules/@ng-bootstrap/ng-bootstrap/fesm2020/ng-bootstrap.mjs"),Re=u("./node_modules/@ng-select/ng-select/fesm2020/ng-select-ng-select.mjs"),me=u("./node_modules/angulartics2/fesm2020/angulartics2.mjs"),_=u("./libs/common-ui/src/index.ts"),fe=u("./libs/frontend-button-group-control/src/index.ts"),X=u("./libs/frontend-canvas/src/index.ts"),M=u("./libs/frontend-icons/src/index.ts"),Je=u("./libs/frontend-auth/src/index.ts"),ee=u("./libs/frontend-alerts-bar/src/index.ts"),Fe=u("./libs/frontend-dropdown/src/index.ts"),B=u("./libs/frontend-modal/src/index.ts"),Qe=u("./libs/frontend-pull-refresh/src/lib/frontend-pull-refresh.module.ts"),$e=u("./libs/frontend-fixed-button/src/index.ts"),ce=u("./libs/frontend-paid-feature-alert/src/index.ts"),Y=u("./libs/frontend-draggable-list/src/index.ts"),e=u("./node_modules/@angular/core/fesm2022/core.mjs"),q=u("./node_modules/rxjs/dist/esm/internal/Subscription.js"),g=u("./node_modules/rxjs/dist/esm/internal/operators/tap.js"),T=u("./node_modules/rxjs/dist/esm/internal/operators/take.js"),P=u("./node_modules/rxjs/dist/esm/internal/operators/catchError.js"),w=u("./node_modules/rxjs/dist/esm/internal/observable/of.js"),et=u("./node_modules/rxjs/dist/esm/internal/operators/startWith.js"),tt=u("./node_modules/rxjs/dist/esm/internal/operators/debounceTime.js"),be=u("./node_modules/rxjs/dist/esm/internal/operators/delay.js"),Ee=u("./node_modules/rxjs/dist/esm/internal/observable/combineLatest.js"),I=u("./node_modules/rxjs/dist/esm/internal/operators/filter.js"),ge=u("./node_modules/uuid/dist/v4.js"),y=u("./apps/shared/core/index.ts"),C=u("./apps/shared/floor-plans/index.ts"),W=u("./apps/shared/floor-plan/enums/index.ts"),ot=u("./apps/shared/user/functions/index.ts"),Ce=u("./libs/frontend-store/src/index.ts"),nt=u("./libs/frontend-theme-switch/src/index.ts"),it=u("./libs/frontend-nav-sidebar/src/index.ts"),ve=u("./libs/frontend-restrictions/src/index.ts");const st={sizes:[{name:"Small",value:C.z.small},{name:"Medium",value:C.z.medium},{name:"Large",value:C.z.large},{name:"Custom",value:C.z.custom}],shapes:[{name:"Square",value:y.DO.square},{name:"Circle",value:y.DO.circle},{name:"Rectangular",value:y.DO.rectangular}]},de={[C.z.small]:"1-2",[C.z.medium]:"2-4",[C.z.large]:"4-6+"},pe={[C.z.small]:1,[C.z.medium]:2,[C.z.large]:4},ne={[C.z.small]:2,[C.z.medium]:4,[C.z.large]:6};var O=u("./apps/manager/src/app/services/index.ts"),ie=u("./libs/common-ui/src/lib/components/form-validation/control-messages.component.ts"),te=u("./libs/frontend-icons/src/lib/icon/icon.component.ts"),_e=u("./libs/frontend-modal/src/lib/frontend-modal-header.directive.ts"),ke=u("./libs/frontend-modal/src/lib/frontend-modal-content.directive.ts"),xe=u("./libs/frontend-modal/src/lib/frontend-modal-footer.directive.ts"),se=u("./libs/common-ui/src/lib/components/switcher/switcher.component.ts");function rt(s,a){if(1&s&&(e.j41(0,"form",9)(1,"div",10)(2,"div",11)(3,"label",12),e.EFF(4,"FLOORPLAN NAME*"),e.k0s(),e.nrm(5,"input",13)(6,"control-messages",14),e.k0s(),e.j41(7,"div",15),e.nrm(8,"tablesready-switcher",16),e.j41(9,"label",17),e.EFF(10,"Set as default"),e.k0s()()()()),2&s){const t=e.XpG();e.Y8G("formGroup",t.form),e.R7$(6),e.Y8G("control",t.nameControl)}}function at(s,a){if(1&s&&(e.j41(0,"div",18)(1,"h2"),e.EFF(2),e.k0s(),e.j41(3,"div",15),e.nrm(4,"tablesready-switcher",19),e.j41(5,"label",20),e.EFF(6,"Yes, delete resources"),e.k0s()()()),2&s){const t=e.XpG();e.R7$(2),e.SpI("You are about to delete floorplan \u201c",t.item.name,"\u201d. Do you want to delete all its tables as well?"),e.R7$(2),e.Y8G("formControl",t.deleteResources)}}function lt(s,a){if(1&s){const t=e.RV6();e.j41(0,"p",21),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.mode=n.modalMode.delete)}),e.EFF(1,"Delete floorplan"),e.k0s()}}function ct(s,a){if(1&s){const t=e.RV6();e.qex(0),e.j41(1,"button",22),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.submit())}),e.EFF(2),e.k0s(),e.j41(3,"button",23),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.close())}),e.EFF(4,"Cancel"),e.k0s(),e.bVm()}if(2&s){const t=e.XpG();e.R7$(2),e.JRh(t.mode===t.modalMode.add?"Add":"Save Changes")}
1}function dt(s,a){if(1&s){const t=e.RV6();e.qex(0),e.j41(1,"button",24),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.submit())}),e.EFF(2,"Confirm"),e.k0s(),e.j41(3,"button",23),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.mode=n.modalMode.edit)}),e.EFF(4,"Decline"),e.k0s(),e.bVm()}}var Z=function(s){return s.add="Add",s.edit="Edit",s.delete="Delete",s}(Z||{});let Me=(()=>{var s;class a{constructor(o,n,i){this.validationService=o,this.formBuilder=n,this.modalController=i,this.mode=Z.add,this.defaultChecked=!1,this.modalMode=Z,this.deleteResources=new d.MJ(!1,d.k0.required),this.icon=M.z9}get nameControl(){return this.form.get("name")}ngOnInit(){let o={id:"",locationId:"",name:"",default:this.defaultChecked};if(this.mode===Z.edit&&void 0!==this.item&&(o=this.item),this.form=this.formBuilder.group({id:o.id,name:[o.name,[d.k0.required,d.k0.pattern(_.Vh),this.checkFloorPlanNameIsUnique()]],default:o.default}),this.defaultChecked){const n=this.form.get("default");n.setValue(!0),n.disable()}}close(){this.modalController.dismiss()}submit(){this.validationService.validateForm(this.form),this.form.valid&&void 0!==this.onClose&&this.onClose(this.mode,this.form.getRawValue(),this,this.deleteResources.value)}checkFloorPlanNameIsUnique(){return o=>{const n=o.value;return-1!==this.floorplans.findIndex(r=>r.name.toLowerCase()===n.toLowerCase()&&r.id!==this.item?.id)?{recordAvailability:!0}:null}}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(_.Bm),e.rXU(d.ok),e.rXU(B.ft))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-floorplan-modal"]],inputs:{mode:"mode",item:"item",defaultChecked:"defaultChecked",floorplans:"floorplans",onClose:"onClose"},standalone:!1,decls:11,vars:7,consts:[["modalHeader","",1,"px-3","py-2","d-flex","flex-row","justify-content-between","align-items-center","w-100"],[1,"m-0"],["classes","close-btn",3,"click","icon"],["modalContent",""],[3,"formGroup",4,"ngIf"],["class","field-container pb-3 pt-4",4,"ngIf"],["class","delete m-0 color-danger",3,"click",4,"ngIf"],["modalFooter","",1,"actions"],[4,"ngIf"],[3,"formGroup"],[1,"field-container","pb-4"],[1,"field-item"],["for","name",1,"floorplan-builder-label"],["id","name","formControlName","name","placeholder","Enter floorplan name","type","text",1,"form-control"],[3,"control"],[1,"field-item","d-flex","pt-3","align-items-center"],["id","setDefault","formControlName","default"],["for","setDefault",1,"mb-0","ml-2"],[1,"field-container","pb-3","pt-4"],["id","deleteResources",3,"formControl"],["for","deleteResources",1,"mb-0","ml-2"],[1,"delete","m-0","color-danger",3,"click"],["ngbAutoFocus","",1,"btn","btn-info","mr-2","px-5",3,"click"],[1,"btn","btn-danger","ml-2","px-5",3,"click"],[1,"btn","btn-info","mr-2","px-5",3,"click"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"h5",1),e.EFF(2),e.k0s(),e.j41(3,"tr-icon",2),e.bIt("click",function(){return i.close()}
1),e.k0s()(),e.j41(4,"section",3),e.DNE(5,rt,11,2,"form",4)(6,at,7,2,"div",5)(7,lt,2,0,"p",6),e.k0s(),e.j41(8,"div",7),e.DNE(9,ct,5,1,"ng-container",8)(10,dt,5,0,"ng-container",8),e.k0s()),2&n&&(e.R7$(2),e.SpI("",i.mode," floorplan"),e.R7$(),e.Y8G("icon",i.icon.cancel),e.R7$(2),e.Y8G("ngIf",i.mode!==i.modalMode.delete),e.R7$(),e.Y8G("ngIf",i.mode===i.modalMode.delete),e.R7$(),e.Y8G("ngIf",i.mode===i.modalMode.edit),e.R7$(2),e.Y8G("ngIf",i.mode!==i.modalMode.delete),e.R7$(),e.Y8G("ngIf",i.mode===i.modalMode.delete))},dependencies:[j.bT,ie.f,d.qT,d.me,d.BC,d.cb,d.l_,d.j4,d.JD,te.R,_e.u,ke.Y,xe._,se.H],styles:["section[_ngcontent-%COMP%]{padding:0 1rem}h4[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:600}h2[_ngcontent-%COMP%]{font-weight:400}.actions[_ngcontent-%COMP%]{padding:1rem;display:flex;justify-content:center}.actions[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{width:50%;box-sizing:border-box}.delete[_ngcontent-%COMP%]{font-weight:600;cursor:pointer}"]}))}return s(),a})();var z=function(s){return s.tables="tables",s.sections="sections",s}(z||{}),V=function(s){return s.resources="General Settings",s.floors="Floorplan Setup",s}(V||{}),G=function(s){return s.order="order",s.name="name",s.category="category",s}(G||{}),pt=u("./libs/frontend-breakpoints/src/lib/frontend-breakpoints.service.ts"),Pe=u("./libs/common-ui/src/lib/components/tabs/tabs.component.ts"),ut=u("./libs/frontend-canvas/src/lib/canvas.component.ts"),ht=u("./libs/frontend-canvas/src/lib/floorplan-switcher/floorplan-switcher.component.ts"),mt=u("./libs/frontend-paid-feature-alert/src/lib/components/frontend-paid-feature-alert/frontend-paid-feature-alert.component.ts"),Be=u("./libs/frontend-floorplan-warnings/src/lib/frontend-floorplan-warnings/frontend-floorplan-warnings.component.ts");const ft=(s,a,t)=>["item border-shape-border drag-table",s,a,t];function bt(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",4)(1,"div",5),e.bIt("mousedown",function(n){const i=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.dragElement(n,i.shape,i.size))})("touchstart",function(n){const i=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.dragElement(n,i.shape,i.size))}),e.j41(2,"p",6),e.EFF(3),e.k0s()()()}if(2&s){const t=a.$implicit,o=e.XpG();e.R7$(),e.Y8G("ngClass",e.sMw(2,ft,t.shape,t.size,o.disabled?"disabled":"background-shape")),e.R7$(2),e.JRh(o.sizeText[t.size])}}let gt=(()=>{var s;class a{constructor(){this.elementDragged=new e.bkB,this.sizeText=de,this.disabled=!1,this.sizes=C.z,this.tables=[{size:C.z.small,shape:y.DO.square},{size:C.z.medium,shape:y.DO.square},{size:C.z.large,shape:y.DO.square},{size:C.z.small,shape:y.DO.circle},{size:C.z.medium,shape:y.DO.circle},{size:C.z.large,shape:y.DO.circle},{size:C.z.small,shape:y.DO.rectangular},{size:C.z.medium,shape:y.DO.rectangular},{size:C.z.large,shape:y.DO.rectangular}]}dragElement(o,n,i){let r=0,l=0;o instanceof MouseEvent?(r=o.clientX,l=o.clientY):window.TouchEvent&&o instanceof TouchEvent&&o.touches?.length>0&&(r=o.touches[0].clientX,l=o.touches[0].clientY),this.elementDragged.emit({shape:n,size:i,objectType:y.oY.table,x:r,y:l})}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-tables"]],inputs:{sizeText:"sizeText",disabled:"disabled"},outputs:{elementDragged:"elementDragged"},standalone:!1,decls:7,vars:1,consts:[[1,"pt-3"],[1,"user-select-none"],[1,"tables"],["class","floorplan-table background-hover",4,"ngFor","ngForOf"],[1,"floorplan-table","background-hover"],[1,"user-select-none",3,"mousedown","touchstart","ngClass"],[1,"color-shape-text","user-select-none"]],template:function(n,i){1&n&&(e.j41(0,"section",0)(1,"h2",1),e.EFF(2,"Tables"),e.k0s(),e.j41(3,"p",1),e.EFF(4,"Drag and drop objects on the canvas. You may change the actual size of the object and rotate it once placed."),e.k0s(),e.j41(5,"div",2),e.DNE(6,bt,4,6,"div",3),e.k0s()()),2&n&&(e.R7$(6),e.Y8G("ngForOf",i.tables))},dependencies:[j.YU,j.Sq],styles:[".tables[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;flex-wrap:wrap}.disabled[_ngcontent-%COMP%]{pointer-events:none!important}.drag-table[_ngcontent-%COMP%]{webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.floorplan-table[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:center;align-items:center;height:110px;width:110px;margin-bottom:1rem;border-radius:4px}.floorplan-table[_ngcontent-%COMP%]   .item[_ngcontent-%COMP%]{border:1px solid;
1display:flex;justify-content:center;align-items:center}.floorplan-table[_ngcontent-%COMP%]   .item[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;padding:0;text-align:center;font-size:10px;pointer-events:none}.floorplan-table[_ngcontent-%COMP%]   .circle[_ngcontent-%COMP%]{border-radius:50%}.floorplan-table[_ngcontent-%COMP%]   .square.small[_ngcontent-%COMP%], .floorplan-table[_ngcontent-%COMP%]   .circle.small[_ngcontent-%COMP%]{width:60px;height:60px}.floorplan-table[_ngcontent-%COMP%]   .square.medium[_ngcontent-%COMP%], .floorplan-table[_ngcontent-%COMP%]   .circle.medium[_ngcontent-%COMP%]{width:75px;height:75px}.floorplan-table[_ngcontent-%COMP%]   .square.large[_ngcontent-%COMP%], .floorplan-table[_ngcontent-%COMP%]   .circle.large[_ngcontent-%COMP%]{width:90px;height:90px}.floorplan-table[_ngcontent-%COMP%]   .rectangular.small[_ngcontent-%COMP%]{width:75px;height:60px}.floorplan-table[_ngcontent-%COMP%]   .rectangular.medium[_ngcontent-%COMP%]{width:90px;height:60px}.floorplan-table[_ngcontent-%COMP%]   .rectangular.large[_ngcontent-%COMP%]{width:115px;height:60px}"]}))}return s(),a})();var Te=u("./node_modules/rxjs/dist/esm/internal/Subject.js"),J=u("./node_modules/rxjs/dist/esm/internal/operators/switchMap.js"),Ct=u("./node_modules/rxjs/dist/esm/internal/operators/map.js");const Ge=(s,a)=>{s&&(s.value<0&&s.setValue(0),s.value>360&&s.setValue(360),a.emit(Number(s.value)))};let vt=(()=>{var s;class a{constructor(o){this.modalController=o,this.icon=M.z9,this.deleteResources=new d.MJ(!0,d.k0.required),this.AppIcon=M.z9}close(){this.modalController.dismiss()}delete(){this.modalController.dismiss(!!this.deleteResources?.value)}cancel(){this.modalController.dismiss(0)}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(B.ft))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-delete-table-modal"]],inputs:{resourceName:"resourceName"},standalone:!1,decls:16,vars:3,consts:[["modalHeader","",1,"px-3","py-2","d-flex","flex-row","justify-content-between","align-items-center","w-100"],[1,"my-1"],["classes","close-btn",3,"click","icon"],["modalContent","",1,"field-container","p-3"],[1,"field-item","d-flex","mt-3","align-items-center"],["id","flooplan-delete-resources",3,"formControl"],[1,"mb-0","ml-2"],["modalFooter","",1,"actions","w-100","p-3"],[1,"btn","btn-info","mr-2","px-5",3,"click"],[1,"btn","btn-danger","ml-2","px-5",3,"click"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"h4",1),e.EFF(2,"Delete table"),e.k0s(),e.j41(3,"tr-icon",2),e.bIt("click",function(){return i.cancel()}),e.k0s()(),e.j41(4,"div",3)(5,"h2"),e.EFF(6),e.k0s(),e.j41(7,"div",4),e.nrm(8,"tablesready-switcher",5),e.j41(9,"p",6),e.EFF(10,"Yes, delete the resource"),e.k0s()()(),e.j41(11,"div",7)(12,"button",8),e.bIt("click",function(){return i.delete()}),e.EFF(13,"Confirm"),e.k0s(),e.j41(14,"button",9),e.bIt("click",function(){return i.cancel()}),e.EFF(15,"Decline"),e.k0s()()),2&n&&(e.R7$(3),e.Y8G("icon",i.icon.cancel),e.R7$(3),e.SpI("You are about to remove ",i.resourceName," from the floorplan. Do you want to delete the underlying resource as well?"),e.R7$(2),e.Y8G("formControl",i.deleteResources))},dependencies:[d.BC,d.l_,te.R,_e.u,ke.Y,xe._,se.H],styles:["section[_ngcontent-%COMP%]{padding:2rem}h4[_ngcontent-%COMP%]{font-size:1.5rem;font-weight:600}h2[_ngcontent-%COMP%]{font-weight:400}.actions[_ngcontent-%COMP%]{display:flex;justify-content:center}.actions[_ngcontent-%COMP%]   .btn[_ngcontent-%COMP%]{width:50%}.delete[_ngcontent-%COMP%]{font-weight:600;cursor:pointer}"]}))}return s(),a})();var _t=u("./libs/frontend-button-group-control/src/lib/button-group-control.component.ts"),ue=u("./libs/frontend-dropdown/src/lib/components/frontend-dropdown/frontend-dropdown.component.ts"),De=u("./node_modules/@angular/cdk/fesm2022/scrolling.mjs");function kt(s,a){if(1&s&&(e.j41(0,"div",6),e.nrm(1,"tr-icon",7),e.j41(2,"p",8),e.EFF(3,"You may select existing tables (not in Floorplan) or create new ones."),e.k0s()()),2&s){const t=e.XpG();e.R7$(),e.Y8G("icon",t.icon.infoHeavy)}}function xt(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",11)(1,"tablesready-btn-group-control",44),e.bIt("btnClick",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.resourceSelectModeChange(n))}),e.k0s()()}if(2&s){const t=e.XpG(2);e.R7$(),e.Y8G("control",t.resourceSelectModeControl)("items",t.resourceOptions)("buttonType",t.buttonGroupColors.success)}}function Tt(s,a){if(1&s){const t=e.RV6();e.j41(0,"frontend-dropdown",45),e.bIt("ngModelChange",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.resourceChangeById(n))}),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("multiple",!1)("items",t.availableResources)("forceMobileDropdown",!0)("clearable",!0)}}function yt(s,a){1&s&&e.nrm(0,"input",46)}function jt(s,a){if(1&s&&(e.j41(0,"div",47)(1,"div",48)(2,"div",49),e.EFF(3,"Public Availability"),e.k0s(),e.j41(4,"div",50)(5,"div",51)(6,"p",52),e.EFF(7,"Public Check-In"),e.k0s(),e.nrm(8,"tablesready-switcher",53),e.k0s(),e.j41(9,"div",54)(10,"p",52),e.EFF(11),e.nI1(12,"titlecase"),e.k0s(),e.nrm(13,"tablesready-switcher",55),e.k0s()()(),e.j41(14,"div",11)(15,"label",12),e.
1EFF(16,"Service"),e.k0s(),e.nrm(17,"frontend-dropdown",56)(18,"control-messages",15),e.k0s(),e.j41(19,"div",11)(20,"label",12),e.EFF(21,"Section (optional)"),e.k0s(),e.nrm(22,"frontend-dropdown",57),e.k0s()()),2&s){const t=e.XpG(2);e.R7$(11),e.SpI("Public ",e.bMT(12,9,t.reservationsLabel),""),e.R7$(6),e.Y8G("items",t.services)("multiple",!0)("clearable",!0),e.R7$(),e.Y8G("control",t.serviceControl),e.R7$(4),e.Y8G("items",t.sections)("forceMobileDropdown",!0)("multiple",!1)("clearable",!0)}}function St(s,a){if(1&s){const t=e.RV6();e.j41(0,"button",58),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.duplicateTable(n.tableId))}),e.EFF(1,"Duplicate table"),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("ngbTooltip",t.disableDuplicateBtnTooltip)("disabled",t.form.touched)}}function At(s,a){if(1&s){const t=e.RV6();e.j41(0,"button",59),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.delete(n.tableId))}),e.EFF(1,"Delete table"),e.k0s()}}function It(s,a){if(1&s){const t=e.RV6();e.j41(0,"form",9),e.DNE(1,xt,2,3,"div",10),e.j41(2,"div",11)(3,"label",12),e.EFF(4,"Resource name"),e.k0s(),e.DNE(5,Tt,1,4,"frontend-dropdown",13)(6,yt,1,0,"input",14),e.nrm(7,"control-messages",15)(8,"control-messages",15),e.k0s(),e.j41(9,"div",16)(10,"div",17)(11,"label",18),e.EFF(12,"Capacity Min"),e.k0s(),e.j41(13,"input",19,0),e.bIt("blur",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.checkMinCapacity(n.minCapacityControl.value))})("change",function(){e.eBV(t);const n=e.sdS(14),i=e.sdS(20),r=e.XpG();return e.Njj(r.capacityChange(n.value,i.value))}),e.k0s(),e.nrm(15,"control-messages",15),e.k0s(),e.j41(16,"div",17)(17,"label",20),e.EFF(18,"Capacity Max"),e.k0s(),e.j41(19,"input",21,1),e.bIt("blur",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.checkMaxCapacity(n.maxCapacityControl.value))})("change",function(){e.eBV(t);const n=e.sdS(14),i=e.sdS(20),r=e.XpG();return e.Njj(r.capacityChange(n.value,i.value))}),e.k0s(),e.nrm(21,"control-messages",15),e.k0s()(),e.j41(22,"div",22)(23,"label",23),e.EFF(24,"Full resource info"),e.k0s(),e.j41(25,"a",24),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.changeInfoVisibility())}),e.nrm(26,"tr-icon",25),e.k0s()(),e.DNE(27,jt,23,11,"div",26),e.j41(28,"div",27)(29,"label",28),e.EFF(30,"Element info"),e.k0s()(),e.j41(31,"div",11)(32,"label",29),e.EFF(33,"Size"),e.k0s(),e.j41(34,"tablesready-btn-group-control",30),e.bIt("btnClick",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.sizeChanged.emit(n))}),e.k0s()(),e.j41(35,"div",11)(36,"label",31),e.EFF(37,"Shape"),e.k0s(),e.j41(38,"tablesready-btn-group-control",32),e.bIt("btnClick",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.shapeChanged.emit(n))}),e.k0s()(),e.j41(39,"div",11)(40,"label",12),e.EFF(41,"Rotate table"),e.k0s()(),e.j41(42,"div",33)(43,"div",6)(44,"p",34),e.EFF(45,"ANGLE"),e.k0s(),e.j41(46,"input",35),e.bIt("change",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.angleChanged(n.form.get("rotation"),n.rotationAngleChanged))}),e.k0s()(),e.j41(47,"a",24),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.resetAngle())}),e.EFF(48,"Reset"),e.k0s()(),e.j41(49,"div",36),e.DNE(50,St,2,2,"button",37)(51,At,2,0,"button",38),e.k0s(),e.j41(52,"div",39)(53,"div",40)(54,"button",41),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.saveTable())}),e.EFF(55),e.k0s()(),e.j41(56,"div",42)(57,"button",43),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.cancel())}),e.EFF(58,"Cancel"),e.k0s()()()()}if(2&s){const t=e.XpG();e.Y8G("formGroup",t.form),e.R7$(),e.Y8G("ngIf",!t.isEditMode),e.R7$(4),e.Y8G("ngIf",!t.isEditMode&&(null==t.resourceSelectModeControl?null:t.resourceSelectModeControl.value)===t.resourceSelectModeEnum.Existing),e.R7$(),e.Y8G("ngIf",t.isEditMode||(null==t.resourceSelectModeControl?null:t.resourceSelectModeControl.value)===t.resourceSelectModeEnum.New),e.R7$(),e.Y8G("control",t.resourceIdControl),e.R7$(),e.Y8G("control",t.resourceNameControl),e.R7$(5),e.Y8G("min",t.minCapacityValue)("max",t.maxCapacityControl.value),e.R7$(2),e.Y8G("control",t.minCapacityControl),e.R7$(4),e.Y8G("min",t.minCapacityControl.value),e.R7$(2),e.Y8G("control",t.maxCapacityControl),e.R7$(5),e.Y8G("icon",t.fullInfoVisible?t.icon.arrowUp:t.icon.arrowDown),e.R7$(),e.Y8G("ngIf",t.fullInfoVisible),e.R7$(7),e.Y8G("control",null==t.form?null:t.form.get("size"))("items",t.tableInfoData.sizes)("buttonType",t.buttonGroupColors.success),e.R7$(4),e.Y8G("control",null==t.form?null:t.form.get("shape"))("items",t.tableInfoData.shapes)("buttonType",t.buttonGroupColors.success),e.R7$(12),e.Y8G("ngIf",t.isEditMode),e.R7$(),e.Y8G("ngIf",t.isEditMode),e.R7$(4),e.JRh(t.isEditMode?"Save":"Add")}}var D=function(s){return s.New="New",s.Existing="Existing",s}(D||{});let wt=(()=>{var s;class a{constructor(o,n,i,r,l){this.fb=o,this.tableService=n,this.validationService=i,this.alertsService=r,this.modalController=l,this.resourceChanged=new e.bkB,this.formClosed=new e.bkB,this.tableRemoved=new e.bkB,this.nameChanged=new e.bkB,this.capacityChanged=new e.bkB,this.shapeChanged=new e.bkB,this.sizeChanged=new e.bkB,this.rotationAngleChanged=new e.bkB,this.formTouched=new e.bkB,this.services=[],this.resources=[],this.sections=[],this.size=C.z.small,this.shape=y.DO.square,this.isEditMode=!1,this.reservationsLabel="reservations",this.duplicatedTable=!1,this.icon=M.z9,this.newResourceName="",this.availableResources=[],this.buttonGroupColors=fe.y0,this.fullInfoVisible=!1,this.tableInfoData=st,this.resourceSelectModeEnum=D,this.resourceSelectModeControl=new d.MJ(D.New),this.resourceOptions=[{name:"New",value:D.New},{name:"Existing",value:D.Existing}],this.minCapacityValue=0,this.lastTableId="",this.setAvailableResourcesForTableId$=new Te.B,this.subscriptions=new q.yU,this.angleChanged=Ge;const c=this.setAvailableResourcesForTableId$.pipe((0,J.n)(p=>this.tableService.floorPlanIdToTablesMap$.pipe((0,Ct.T)(h=>({currentTableId:p,floorPlanWithTables:h}))))).subscribe(({currentTableId:p,floorPlanWithTables:h})=>{const m=[];
1Object.entries(h).forEach(([,f])=>{f.forEach(x=>{x.id!==p&&m.push(x.resourceId)})}),this.availableResources=this.resources.filter(f=>f.enabled&&!m.includes(f._id))});this.subscriptions.add(c)}setAvailableResourcesForTableId(o){this.setAvailableResourcesForTableId$.next(o)}ngOnInit(){this.fullInfoVisible=!this.isEditMode}ngOnChanges(o){o.tableId&&this.tableId!==this.lastTableId&&(this.init(),this.lastTableId=this.tableId),["rotation","size","shape","sectionId"].forEach(i=>{o[i]&&(this.form?.get(i)?.setValue(o[i].currentValue),void 0!==o[i].previousValue&&(this.form?.markAllAsTouched(),this.formTouched.emit(!0)))})}duplicateTable(o){const n=this.tableService.savedTables.find(i=>i.id===o);n&&this.onTableDuplicate(n)}delete(o){const n=this.tableService.savedTables.find(i=>i.id===o);n&&this.modalController.create(vt,{resourceName:n.name},B.jQ.default,!1).pipe((0,T.s)(1),(0,P.W)(i=>(0,w.of)(i)),(0,I.p)(i=>0!==i&&void 0!==i),(0,g.M)(i=>{this.isEditMode&&void 0!==this.onTableDelete&&this.onTableDelete(this.tableId,this.floorPlanId),i&&void 0!==this.onResourceDelete&&this.onResourceDelete(n.resourceId),this.tableRemoved.emit(this.tableId),this.formClosed.emit(!1)})).subscribe()}ngOnDestroy(){this.subscriptions.unsubscribe()}saveTable(){if(this.validationService.validateForm(this.form),!(this.onCreate&&this.onSave&&this.onResourceCreate&&this.form.valid))return;if(this.resourceSelectModeControl.value===D.New&&!this.isEditMode)return void this.createResourceAndSaveTable();const o=this.resourceIdControl?.value;if(null===o)return;const n=this.sectionIdControl?.value,i=this.resources.find(c=>c._id===o);if(this.resourceWasUpdated(i))return void this.updateResourceAndSaveTable(i);const l=this.getAttributes(o);this.lastTableId=void 0,this.isEditMode?(this.onSave(this.tableId,this.floorPlanId,i.name,l,n),this.formClosed.emit(!1)):(this.onCreate(i.name,l,n),this.formClosed.emit(!1))}cancel(){!this.isEditMode||this.form.touched?this.modalController.create(_.M$,{options:{content:"Leave the form? Changes that you made will not be saved.",title:"Cancel table changes",closeBtnText:"Cancel"}}).pipe((0,T.s)(1),(0,I.p)(o=>o?.response),(0,g.M)(()=>{this.isEditMode||this.tableRemoved.emit(this.tableId),this.formClosed.emit(!0)})).subscribe():this.formClosed.emit(!0)}resetAngle(){this.form.markAsTouched(),this.rotationControl.setValue(0),this.rotationAngleChanged.emit(0)}changeInfoVisibility(){this.fullInfoVisible=!this.fullInfoVisible}resourceSelectModeChange(o){if(o===D.New)this.resourceIdControl.removeValidators(d.k0.required),this.resourceNameControl.removeValidators(d.k0.required),this.resourceNameControl.setValue(this.newResourceName),this.nameChanged.emit(this.resourceNameControl.value);else if(this.resourceIdControl.setValidators(d.k0.required),this.resourceNameControl.setValidators(d.k0.required),this.resourceIdControl.value){const n=this.resources.find(i=>i._id===this.resourceIdControl.value);this.nameChanged.emit(n.name)}else this.nameChanged.emit(this.newResourceName);this.resourceIdControl.updateValueAndValidity(),this.resourceNameControl.updateValueAndValidity()}resourceChangeById(o){const n=this.resources.find(i=>i._id===o);n&&this.resourceChange(n)}resourceChange(o){if(!this.isEditMode){if(this.resourceSelectModeChange(this.resourceSelectModeControl.value),this.resourceSelectModeControl.value===D.Existing){const n=o?.capacity.min||pe[this.size],i=o?.capacity.max||ne[this.size],r=this.services.filter(l=>o?.services.includes(l._id)).map(l=>l._id);return this.serviceControl.setValue(r),this.resourceNameControl.setValue(o?.name||this.newResourceName),this.minCapacityControl.setValue(n),this.maxCapacityControl.setValue(i),this.publicCheckInControl.setValue(o?.availability.waitlist),this.reservationsControl.setValue(o?.availability.reservations),this.resourceChanged.emit(o),this.capacityChanged.emit(`${n}-${i}`),void this.formTouched.emit(!0)}if(this.minCapacityControl.setValue(o?.capacity.min||pe[this.size]),this.maxCapacityControl.setValue(o?.capacity.max||ne[this.size]),this.publicCheckInControl.setValue(o?.availability.waitlist),this.reservationsControl.setValue(o?.availability.reservations),this.sectionIdControl.setValue(this.sectionId),this.formTouched.emit(!0),this.resourceSelectModeControl.value===D.New)return void this.resourceNameControl.setValue(o.name);this.serviceControl.setValue([])}}capacityChange(o,n){this.capacityChanged.emit(`${o}-${n}`),this.formTouched.emit(!0)}checkMinCapacity(o){o<this.minCapacityValue&&this.minCapacityControl.setValue(this.minCapacityValue),o>this.maxCapacityControl.value&&this.minCapacityControl.setValue(this.maxCapacityControl.value)}checkMaxCapacity(o){o<this.minCapacityControl.value&&this.maxCapacityControl.setValue(this.minCapacityControl.value)}get resourceNameControl(){return this.form.get("resourceName")}get resourceIdControl(){return this.form.get("resourceId")}get minCapacityControl(){return this.form.get("minCapacity")}get maxCapacityControl(){return this.form.get("maxCapacity")}get publicCheckInControl(){return this.form.get("availability").get("publicCheckIn")}get reservationsControl(){return this.form.get("availability").get("reservations")}get serviceControl(){return this.form.get("service")}get sectionIdControl(){return this.form.get("sectionId")}get rotationControl(){return this.form.get("rotation")}get disableDuplicateBtnTooltip(){return this.form.touched?"You need to save or discard changes before duplicating this table":""}init(){this.setAvailableResourcesForTableId(this.tableId),this.baseResource={_id:"baseResource",name:this.generatedTableName,enabled:!0,description:"",category:"",availability:{waitlist:!0,reservations:!0},capacity:{min:pe[this.size],max:ne[this.size]},restaurant:this.locationId,order:0,services:[]};let o=pe[this.size],n=ne[this.size],i=1===this.services.length?[this.services[0]._id]:[],r=!0,l=!0,c="",p=null,h=ne[this.size];if(void 0!==this.resourceId){const k=this.resources.find(A=>A._id===this.resourceId);if(k){this.duplicatedTable&&(this.baseResource.availability.waitlist=k.availability.waitlist,this.baseResource.availability.reservations=k.availability.reservations,this.baseResource.capacity.min=k.capacity.min,this.baseResource.capacity.max=k.capacity.max),p=this.duplicatedTable?p:this.resourceId;const A=[];for(const K of this.services)k.services.includes(K._id)&&A.push(K._id);o=k.capacity.min,n=k.capacity.max,h=k.capacity.max,i=A,r=k.availability.waitlist,l=k.availability.reservations,c=this.duplicatedTable?c:k.name}}this.newResourceName=""===c?this.baseResource.name:c,this.form=this.fb.group({resourceId:[p,[d.k0.required]],resourceName:[c,this.isEditMode?[d.k0.required]:[]],minCapacity:[o,[d.k0.required,d.k0.min(0),d.k0.max(h)]],maxCapacity:[n,[d.k0.required,d.k0.min(1)]],availability:this.fb.group({publicCheckIn:[r],reservations:[l]}),service:[i,[d.k0.required]],sectionId:[this.sectionId],size:[this.size,[d.k0.required]],shape:[this.shape,[d.k0.required]],rotation:[this.rotation||0,[d.k0.required,d.k0.min(0),d.k0.max(360)]],width:[this.width||0],height:[this.height||0],top:[this.top||0],left:[this.left||0]}),this.formTouched.emit(!1);const m=this.resourceNameControl.valueChanges.pipe((0,g.M)(k=>{(this.isEditMode||this.resourceSelectModeControl.value===D.New)&&(this.newResourceName=k,this.nameChanged.emit(k),this.resourceNameControl.markAsTouched())})).subscribe();this.subscriptions.add(m);const f=this.maxCapacityControl.valueChanges.pipe((0,g.M)(k=>{this.minCapacityControl.clearValidators(),this.minCapacityControl.setValidators([d.k0.min(0),d.k0.max(k),d.k0.required]),this.minCapacityControl.updateValueAndValidity()})).subscribe();this.subscriptions.add(f),null===p&&this.resourceChange(this.baseResource);const x=this.publicCheckInControl.valueChanges.pipe((0,g.M)(()=>this.form.get("availability").markAsTouched())).subscribe();this.subscriptions.add(x);const S=this.reservationsControl.valueChanges.pipe((0,g.M)(()=>this.form.get("availability").markAsTouched())).subscribe();this.subscriptions.add(S);const H=this.form.valueChanges.subscribe(()=>{this.formTouched.emit(this.form.touched)});this.subscriptions.add(H)}updateResourceAndSaveTable(o){let n=this.resourceNameControl.value;this.resourceIdControl.value&&this.resourceSelectModeControl.value===D.Existing&&(n=this.resources.find(r=>this.resourceIdControl.value===r._id).name);const i={_id:o._id,name:n,capacity:{min:this.minCapacityControl.value,max:this.maxCapacityControl.value},availability:{waitlist:this.publicCheckInControl.value,reservations:this.reservationsControl.value},services:this.serviceControl.value,description:o.description};this.isEditMode&&(o.name=i.name),this.onResourceUpdate(i).pipe((0,g.M)(()=>{this.createOrUpdateTable(o)}),(0,P.W)(()=>(this.alertsService.addError("Error updating resource"),(0,w.of)(null)))).subscribe()}createResourceAndSaveTable(){this.onResourceCreate({name:this.resourceNameControl.value,enabled:!0,capacity:{min:this.minCapacityControl.value,max:this.maxCapacityControl.value},availability:{waitlist:this.publicCheckInControl.value,reservations:this.reservationsControl.value},category:"",services:this.serviceControl.value,restaurant:this.locationId,description:"",order:this.resources.length+1}).pipe((0,g.M)(n=>{this.createOrUpdateTable(n)}),(0,P.W)(()=>(this.alertsService.addError("Error creating new resource"),(0,w.of)(null)))).subscribe()}createOrUpdateTable(o){const n=this.getAttributes(o._id),i=this.sectionIdControl?.value;this.isEditMode?this.onSave(this.tableId,this.floorPlanId,o.name,n,i):this.onCreate(o.name,n,i),this.formClosed.emit
1(!1)}getAttributes(o){return{resourceId:o,shape:this.form.get("shape")?.value||y.DO.rectangular,size:this.form.get("size")?.value||C.z.custom,rotation:this.rotationControl?.value||0,width:this.width||50,height:this.height||50,top:this.top||1,left:this.left||1}}resourceWasUpdated(o){return!!o._id&&(this.isEditMode&&this.resourceNameControl.dirty||this.resourceIdControl.dirty||this.minCapacityControl.dirty||this.maxCapacityControl.dirty||this.publicCheckInControl.dirty||this.reservationsControl.dirty||this.sectionIdControl.dirty||this.serviceControl.dirty)}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(d.ok),e.rXU(O.lU),e.rXU(_.Bm),e.rXU(ee.nB),e.rXU(B.ft))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-add-table-form"]],inputs:{services:"services",resources:"resources",sections:"sections",size:"size",shape:"shape",isEditMode:"isEditMode",resourceId:"resourceId",sectionId:"sectionId",rotation:"rotation",width:"width",height:"height",top:"top",left:"left",tableId:"tableId",floorPlanId:"floorPlanId",locationId:"locationId",reservationsLabel:"reservationsLabel",generatedTableName:"generatedTableName",duplicatedTable:"duplicatedTable",onCreate:"onCreate",onTableDelete:"onTableDelete",onTableDuplicate:"onTableDuplicate",onResourceDelete:"onResourceDelete",onSave:"onSave",onResourceCreate:"onResourceCreate",onResourceUpdate:"onResourceUpdate"},outputs:{resourceChanged:"resourceChanged",formClosed:"formClosed",tableRemoved:"tableRemoved",nameChanged:"nameChanged",capacityChanged:"capacityChanged",shapeChanged:"shapeChanged",sizeChanged:"sizeChanged",rotationAngleChanged:"rotationAngleChanged",formTouched:"formTouched"},standalone:!1,features:[e.OA$],decls:5,vars:2,consts:[["minInput",""],["maxInput",""],["cdkScrollable","",1,"pt-2"],[1,"mt-2","mb-2"],["class","d-flex flex-row align-items-center",4,"ngIf"],["class","pt-2",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-row","align-items-center"],[1,"pr-2","info",3,"icon"],[1,"mb-0","user-select-none"],[1,"pt-2",3,"formGroup"],["class","form-group",4,"ngIf"],[1,"form-group"],[1,"table-label","floorplan-builder-label","user-select-none"],["elementId","table-name","bindValue","_id","bindLabel","name","formControlName","resourceId","placeholder","Select an existing resource","noItemsText","No available resources. Create a new one",3,"multiple","items","forceMobileDropdown","clearable","ngModelChange",4,"ngIf"],["type","text","class","form-control","formControlName","resourceName","placeholder","Enter resource name","required","",4,"ngIf"],[3,"control"],[1,"row","form-group"],[1,"col","form-group"],["for","table-min-capacity",1,"table-label","floorplan-builder-label","user-select-none"],["id","table-min-capacity","type","number","formControlName","minCapacity",1,"form-control",3,"blur","change","min","max"],["for","table-max-capacity",1,"table-label","floorplan-builder-label","user-select-none"],["id","table-max-capacity","type","number","formControlName","maxCapacity",1,"form-control",3,"blur","change","min"],[1,"form-group","d-flex","flex-row","justify-content-between","mb-0"],[1,"control-label","user-select-none"],[3,"click"],[3,"icon"],["class","w-100",4,"ngIf"],[1,"form-group","mb-0"],[1,"control-label","floorplan-builder-label","user-select-none"],["for","table-size",1,"table-label","floorplan-builder-label","user-select-none"],["id","table-size","bindName","name","bindValue","value",3,"btnClick","control","items","buttonType"],["for","table-shape",1,"table-label","floorplan-builder-label","user-select-none"],["id","table-shape","bindName","name","bindValue","value",3,"btnClick","control","items","buttonType"],[1,"form-group","d-flex","flex-row","align-items-center"],[1,"mb-0","pr-2","user-select-none"],["type","number","step","1","formControlName","rotation","placeholder","Enter rotation angle",1,"form-control","rotation-angle",3,"change"],[1,"d-flex","flex-row","justify-content-between","align-items-center"],["class","btn btn-link-info user-select-none",3,"ngbTooltip","disabled","click",4,"ngIf"],["class","btn btn-link-danger user-select-none",3,"click",4,"ngIf"],[1,"d-flex","justify-content-between","mt-4"],[1,"form-group","col","mb-0","pl-0"],[1,"btn","btn-info","w-100","user-select-none",3,"click"],[1,"form-group","col","mb-0","pr-0"],[1,"btn","btn-danger","w-100","user-select-none",3,"click"],["id","resource-option","bindName","name","bindValue","value",1,"mb-3",3,"btnClick","control","items","buttonType"],["elementId","table-name","bindValue","_id","bindLabel","name","formControlName","resourceId","placeholder","Select an existing resource","noItemsText","No available resources. Create a new one",3,"ngModelChange","multiple","
1items","forceMobileDropdown","clearable"],["type","text","formControlName","resourceName","placeholder","Enter resource name","required","",1,"form-control"],[1,"w-100"],["formGroupName","availability",1,"form-group"],[1,"table-label","floorplan-builder-label","mb-2","user-select-none"],[1,"d-flex","flex-column"],[1,"d-flex","flex-row","align-items-center","justify-content-between","mb-2"],[1,"mb-0"],["formControlName","publicCheckIn","id","public-checkin-checkbox"],[1,"d-flex","flex-row","align-items-center","justify-content-between"],["formControlName","reservations","id","reservation-checkbox"],["elementId","serviceDropdown","bindLabel","name","bindValue","_id","placeholder","Choose service","formControlName","service",3,"items","multiple","clearable"],["bindLabel","name","bindValue","id","elementId","sectionsDropdown","placeholder","Choose section","formControlName","sectionId",3,"items","forceMobileDropdown","multiple","clearable"],[1,"btn","btn-link-info","user-select-none",3,"click","ngbTooltip","disabled"],[1,"btn","btn-link-danger","user-select-none",3,"click"]],template:function(n,i){1&n&&(e.j41(0,"section",2)(1,"h2",3),e.EFF(2,"Resource info"),e.k0s(),e.DNE(3,kt,4,1,"div",4)(4,It,59,22,"form",5),e.k0s()),2&n&&(e.R7$(3),e.Y8G("ngIf",!i.isEditMode),e.R7$(),e.Y8G("ngIf",void 0!==i.form))},dependencies:[j.bT,ie.f,_t.e,d.qT,d.me,d.Q0,d.BC,d.cb,d.YS,d.VZ,d.zX,d.j4,d.JD,d.$R,te.R,$.md,ue.L,De.uv,se.H,j.PV],styles:['@charset "UTF-8";section[_ngcontent-%COMP%]{margin-bottom:2rem}.info[_ngcontent-%COMP%]{width:1.5rem}.table-label[_ngcontent-%COMP%]{font-size:12px;text-transform:uppercase;font-weight:400}a[_ngcontent-%COMP%]{color:var(--cc-link)!important}a[_ngcontent-%COMP%]:hover{text-decoration:underline}.rotation-angle[_ngcontent-%COMP%]{width:6.85rem;margin-right:1rem}.rotation-angle[_ngcontent-%COMP%]:after{display:inline-block;content:"\\b0";width:10px;height:10px;color:var(--cc-primary-text)}']}))}return s(),a})(),Rt=(()=>{var s;class a{constructor(){this.sizeText=de,this.disabled=!1,this.elementDragged=new e.bkB,this.shapes=y.DO}dragElement(o,n){let i=0,r=0;o instanceof MouseEvent?(i=o.clientX,r=o.clientY):window.TouchEvent&&o instanceof TouchEvent&&o.touches?.length>0&&(i=o.touches[0].clientX,r=o.touches[0].clientY),this.elementDragged.emit({shape:n,objectType:y.oY.object,size:C.z.medium,x:i,y:r})}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-floorplan-objects"]],inputs:{sizeText:"sizeText",disabled:"disabled"},outputs:{elementDragged:"elementDragged"},standalone:!1,decls:14,vars:4,consts:[[1,"pt-4"],[1,"user-select-none"],[1,"tablesready-objects","background-hover"],[1,"tablesready-object"],[1,"tablesready-objects-rectangular","drag-table",3,"mousedown","touchstart"],[1,"mb-0","user-select-none"],[1,"tablesready-objects-circle","drag-table",3,"mousedown","touchstart"]],template:function(n,i){1&n&&(e.j41(0,"section",0)(1,"h2",1),e.EFF(2,"Objects"),e.k0s(),e.j41(3,"p",1),e.EFF(4,"The object is flexible you may use it for a bar, host stand, dividers, etc."),e.k0s(),e.j41(5,"div",2)(6,"div",3)(7,"div",4),e.bIt("mousedown",function(l){return i.dragElement(l,i.shapes.rectangular)})("touchstart",function(l){return i.dragElement(l,i.shapes.rectangular)}),e.j41(8,"p",5),e.EFF(9,"Label"),e.k0s()()(),e.j41(10,"div",3)(11,"div",6),e.bIt("mousedown",function(l){return i.dragElement(l,i.shapes.circle)})("touchstart",function(l){return i.dragElement(l,i.shapes.circle)}),e.j41(12,"p",5),e.EFF(13,"Label"),e.k0s()()()()()),2&n&&(e.R7$(7),e.AVh("disabled",i.disabled),e.R7$(4),e.AVh("disabled",i.disabled))},styles:["section[_ngcontent-%COMP%]{margin-bottom:2rem}.disabled[_ngcontent-%COMP%]{pointer-events:none}.tablesready-object[_ngcontent-%COMP%]{margin:1rem;display:flex;flex-direction:row;align-items:center;justify-content:center}.tablesready-objects[_ngcontent-%COMP%]{border-radius:4px;height:93px;display:flex;width:100%;flex-direction:row;align-items:center;justify-content:center}.tablesready-objects[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{pointer-events:none}
1.tablesready-objects-rectangular[_ngcontent-%COMP%]{border:1px solid var(--cc-shape-border);display:flex;justify-content:center;align-items:center;width:108px;height:57px;background:repeating-linear-gradient(-60deg,#D4D9E9 0,#D4D9E9 1px,transparent 1px,transparent 5px)}.tablesready-objects-circle[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;border:1px solid var(--cc-shape-border);border-radius:50%;width:57px;height:57px;background:repeating-linear-gradient(-60deg,#D4D9E9 0,#D4D9E9 1px,transparent 1px,transparent 5px)}"]}))}return s(),a})();function Ft(s,a){if(1&s){const t=e.RV6();e.j41(0,"button",16),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.delete())}),e.EFF(1,"Delete object"),e.k0s()}}let Et=(()=>{var s;class a{constructor(o,n,i){this.validationService=o,this.formBuilder=n,this.modalController=i,this.width=0,this.height=0,this.left=0,this.top=0,this.shape=y.DO.rectangular,this.floorPlanId="",this.name="",this.isEditMode=!1,this.formTouched=new e.bkB,this.formClosed=new e.bkB,this.nameChange=new e.bkB,this.tableRemoved=new e.bkB,this.rotationChange=new e.bkB,this.lastObjectId="",this.updateObjectTransform$=new Te.B,this.subscriptions=new q.yU,this.angleChanged=Ge}init(){this.form=this.formBuilder.group({name:[""],shape:[this.shape],rotation:[0,[d.k0.required,d.k0.min(0),d.k0.max(360)]]});const o=this.form.valueChanges.subscribe(()=>{this.formTouched.emit(this.form.touched)});this.subscriptions.add(o)}delete(){this.modalController.create(_.M$,{options:{content:"Are you sure you want to delete the object",title:"Confirm object deletion",closeBtnText:"Cancel"}}).pipe((0,T.s)(1),(0,I.p)(o=>o?.response),(0,g.M)(()=>{this.onDelete&&(this.onDelete(this.objectId,this.floorPlanId),this.formClosed.emit(!1))})).subscribe()}ngOnChanges(o){o.objectId&&this.objectId!==this.lastObjectId&&(this.init(),this.lastObjectId=this.objectId),["name","rotation","shape"].forEach(i=>{o[i]&&o[i].currentValue!==o[i].previousValue&&(this.form?.get(i)?.setValue(o[i].currentValue,{emitEvent:!1}),void 0!==o[i].previousValue&&this.formTouched.emit(!0))})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.formClosed.complete(),this.tableRemoved.complete(),this.rotationChange.complete()}saveObject(){if(this.validationService.validateForm(this.form),!this.onCreate||!this.onSave||!this.form.valid)return;const o=this.form.get("name")?.value,n={shape:this.form.get("shape")?.value||y.DO.rectangular,size:C.z.custom,width:this.width||50,height:this.height||50,top:this.top||1,left:this.left||1,rotation:this.form.get("rotation")?.value||0};this.lastObjectId=void 0,this.isEditMode?(this.onSave(this.objectId,this.floorPlanId,o,n),this.formClosed.emit(!1)):(this.onCreate(o,n),this.formClosed.emit(!1))}resetAngle(){this.form.get("rotation").setValue(0),this.rotationChange.emit(0),this.formTouched.emit(!0)}cancel(){!this.isEditMode||this.form.touched?this.modalController.create(_.M$,{options:{content:"Leave the form? Changes that you made will not be saved.",title:"Cancel object changes",closeBtnText:"Cancel"}}).pipe((0,T.s)(1),(0,I.p)(o=>o?.response),(0,g.M)(()=>{this.isEditMode||this.tableRemoved.emit(this.objectId),this.formClosed.emit(!0)})).subscribe():this.formClosed.emit(!0)}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(_.Bm),e.rXU(d.ok),e.rXU(B.ft))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-floorplan-add-object-form"]],inputs:{rotation:"rotation",width:"width",height:"height",left:"left",top:"top",shape:"shape",floorPlanId:"floorPlanId",objectId:"objectId",name:"name",isEditMode:"isEditMode",onCreate:"onCreate",onDelete:"onDelete",onSave:"onSave"},outputs:{formTouched:"formTouched",formClosed:"formClosed",nameChange:"nameChange",tableRemoved:"tableRemoved",rotationChange:"rotationChange"},standalone:!1,features:[e.OA$],decls:24,vars:3,consts:[[1,"mt-3"],[3,"formGroup"],[1,"form-group"],["for","table-name",1,"object-label","floorplan-builder-label","user-select-none"],["id","table-name","type","text","formControlName","name","placeholder","Enter name",1,"form-control",3,"change"],[1,"form-group","mb-2"],[1,"object-label","floorplan-builder-label","user-select-none"],[1,"d-flex","flex-row","align-items-center"],[1,"mb-0","pr-2"],["type","number","formControlName","rotation","placeholder","Enter rotation angle",1,"form-control","rotation-angle",3,"change"],[1,"user-select-none",3,"click"],["class","btn btn-link-danger user-select-none",3,"click",4,"ngIf"],[1,"row","pt-2"],[1,"form-group","col"],[1,"btn","btn-info","w-100","user-select-none",3,"click"],[1,"btn","btn-danger","w-100","user-select-none",3,"click"],[1,"btn","btn-link-danger","user-select-none",3,"click"]],template:function(n,i){1&n&&(e.j41(0,"section",0)(1,"form",1)(2,"div",2)(3,"label",3),e.EFF(4,"Object name"),e.k0s(),e.j41(5,"input",4),e.bIt("change",function(){let l;return i.nameChange.emit(null==(l=i.form.get("name"))?null:l.value)}),e.k0s()(),e.j41(6,"div",5)(7,"label",6),e.EFF(8,"Rotate object"),e.k0s(),e.j41(9,"div",7)(10,"div",7)(11,"p",8),e.EFF(12,"ANGLE"),e.k0s(),e.j41(13,"input",9),e.bIt("change",function(){return i.angleChanged(i.form.get("rotation"),i.rotationChange)}),e.k0s()(),e.j41(14,"a",10),e.bIt("click",function(){return i.resetAngle()}),e.EFF(15,"Reset"),e.k0s()()(),e.DNE(16,Ft,2,0,"button",11),e.j41(17,"div",12)(18,"div",13)(19,"button",14),e.bIt("click",function(){return i.saveObject()}),e.EFF(20),e.k0s()(),e.j41(21,"div",13)(22,"button",15),e.bIt("click",function(){return i.cancel()}),e.EFF(23,"Cancel"),e.k0s()()()()()),2&n&&(e.R7$(),e.Y8G("formGroup",i.form),e.R7$(15),e.Y8G("ngIf",i.isEditMode),e.R7$(4),e.JRh(i.isEditMode?"Save":"Add"))},dependencies:[j.bT,d.qT,d.me,d.Q0,d.BC,d.cb,d.j4,d.JD],styles:["section[_ngcontent-%COMP%]{margin-bottom:2rem}.rotation-angle[_ngcontent-%COMP%]{width:6.85rem;margin-right:1rem}a[_ngcontent-%COMP%]{color:var(--cc-link)!important}a[_ngcontent-%COMP%]:hover{text-decoration:underline}.object-label[_ngcontent-%COMP%]{font-size:12px;text-transform:uppercase;font-weight:400}"]}))}return s(),a})();const ye="#FFB800";var N=u("./apps/shared/resource/enums/index.ts");const Mt=[{name:"Random",value:N.W.Random},{name:"Alphabetical",value:N.W.Alphabetical},{name:"Resources sort order",value:N.W.ResourcesSortOrder},{name:"Round Robin",value:N.W.RoundRobin}],Pt=["order","name","category"],Bt=[{name:"Auto-assign",value:N.C.auto},{name:"Suggest",value:N.C.suggestion}];var Ot=u("./libs/common-ui/src/lib/components/utils/directives/trim-spaces.directive.ts"),Vt=u("./apps/manager/src/app/sett
1ings/components/color-picker/color-picker.component.ts");function Gt(s,a){if(1&s){const t=e.RV6();e.j41(0,"button",19),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.delete())}),e.EFF(1,"Delete"),e.k0s()}}function Dt(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",7,1)(2,"div",8)(3,"form",9)(4,"p",10),e.EFF(5,"tables"),e.k0s(),e.nrm(6,"frontend-dropdown",11)(7,"control-messages",12),e.j41(8,"p",10),e.EFF(9,"section name"),e.k0s(),e.nrm(10,"input",13)(11,"control-messages",12),e.j41(12,"p",10),e.EFF(13,"section color"),e.k0s(),e.nrm(14,"tablesready-color-picker",14)(15,"control-messages",12),e.k0s(),e.j41(16,"div",15),e.DNE(17,Gt,2,0,"button",16),e.j41(18,"button",17),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.save())}),e.EFF(19,"Save"),e.k0s(),e.j41(20,"button",18),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.cancelEdit())}),e.EFF(21,"Cancel"),e.k0s()()()()}if(2&s){const t=e.XpG();e.R7$(3),e.Y8G("formGroup",t.form),e.R7$(3),e.AVh("is-invalid",t.tablesControl.touched&&t.tablesControl.invalid),e.Y8G("items",t.availableTables)("multiple",!0)("clearable",!0),e.R7$(),e.Y8G("control",t.tablesControl),e.R7$(4),e.Y8G("control",t.nameControl),e.R7$(4),e.Y8G("control",t.sectionColorControl),e.R7$(2),e.Y8G("ngIf",void 0!==t.editSectionId),e.R7$(),e.Y8G("disabled",!t.form.valid),e.R7$(2),e.Y8G("ngClass",void 0!==t.editSectionId?"btn-outline-danger":"btn-danger")}}function Nt(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",22)(1,"p",23),e.EFF(2),e.k0s(),e.j41(3,"p",24),e.EFF(4),e.k0s(),e.j41(5,"tr-icon",25),e.bIt("click",function(){const n=e.eBV(t).$implicit,i=e.XpG(2);return e.Njj(i.edit(n))}),e.k0s()()}if(2&s){const t=a.$implicit,o=e.XpG(2);e.R7$(2),e.JRh(t.name),e.R7$(2),e.JRh(o.sectionTableCountById[t.id]),e.R7$(),e.Y8G("icon",o.icon.edit)}}function Xt(s,a){if(1&s&&(e.j41(0,"div",20),e.DNE(1,Nt,6,3,"div",21),e.k0s()),2&s){const t=e.XpG(),o=e.sdS(2);e.xc7("height",t.windowHeight-(t.contentHeight+o.offsetHeight+16)+"px)"),e.R7$(),e.Y8G("ngForOf",t.sections)}}let Yt=(()=>{var s;class a{constructor(o,n,i){this.formBuilder=o,this.modalController=n,this.validationService=i,this.selectTable=new e.bkB,this.editModeChange=new e.bkB,this.selectionColorChange=new e.bkB,this.tableInputIdsChange=new e.bkB,this.tables=[],this.sections=[],this.windowHeight=window.innerHeight,this.contentHeight=100,this.disabled=!1,this.icon=M.z9,this.availableTables=[],this.sectionTableCountById={},this.selectedColor=ye,this.editSectionOpen=!1,this.subscriptions=new q.yU}get tablesControl(){return this.form.get("tables")}get nameControl(){return this.form.get("name")}get sectionColorControl(){return this.form.get("sectionColor")}edit(o){this.disabled||(this.editSectionId=o.id,this.editModeChange.emit(o.id),this.nameControl.setValue(o.name),this.sectionColorControl.setValue(o.color),this.editSectionOpen=!0,this.filterAvailableTables(),this.tableInputIdsChange.emit(o.tableIds))}ngOnDestroy(){this.subscriptions.unsubscribe()}delete(){this.onSectionDelete&&this.modalController.create(_.M$,{options:{content:"Are you sure you want to delete this section?",title:"Confirm deletion",closeBtnText:"Cancel"}}).pipe((0,T.s)(1),(0,I.p)(o=>o?.response),(0,g.M)(()=>{this.onSectionDelete(this.editSectionId,()=>{this.cancelEdit()})})).subscribe()}ngOnChanges(o){(o.tables||o.sections)&&this.filterAvailableTables()}tableInputItemsChange(o){this.tableInputIdsChange.emit(o.map(n=>n.id))}canvasTableSelectionChanges({id:o,selected:n}){if(!this.editSectionOpen)return void this.selectTable.emit(o);const i=this.tablesControl.value,r=i.findIndex(l=>l===o);!n&&-1!==r&&i.splice(r,1),n&&!i.includes(o)&&i.push(o),this.tablesControl.setValue(i,{emitEvent:!1})}ngOnInit(){this.form=this.formBuilder.group({tables:[[]],name:["",[d.k0.required,this.checkSectionNameIsUnique()]],sectionColor:[ye,[d.k0.required]]});const o=this.sectionColorControl.valueChanges.pipe((0,g.M)(i=>{console.log(i),this.selectionColorChange.emit(i)})).subscribe();this.subscriptions.add(o);const n=this.tablesControl.valueChanges.pipe((0,g.M)(i=>{const r=[];for(const l of this.tables)i.includes(l.id)&&r.push(l);this.tableInputItemsChange(r)})).subscribe();this.subscriptions.add(n)}addSection(){this.disabled||(this.editSectionOpen=!0,this.resetForm(),this.editModeChange.emit(""))}cancelEdit(){this.editSectionId=void 0,this.selectedColor=ye,this.resetForm(),this.filterAvailableTables(),this.editModeChange.emit(void 0),this.editSectionOpen=!1}resetForm(){this.tablesControl.setValue([]),this.nameControl.setValue(""),this.form.markAllAsTouched()}save(){this.validationService.validateForm(this.form);const o=this.form.get("name")?.value;if(!this.form.valid||!this.onSectionClose||null!==this.validateSectionName(o))return;const{name:n,tables:i,sectionColor:r}=this.form.getRawValue();void 0===this.editSectionId?this.onSectionClose(!0,()=>{this.cancelEdit()})(n,i,r):this.onSectionClose(!1,()=>{this.cancelEdit()})(n,i,r,this.editSectionId)}filterAvailableTables(){const o={},n=[],i=[];this.sectionTableCountById={}
1,this.tables.forEach(r=>{o[r.id]=[r,this.resourcesMap.get(r.resourceId)]}),Object.entries(o).forEach(([,[r,l]])=>{l?.enabled&&n.push(r)}),this.sections.forEach(r=>{let l=0,c=0,p=0;r.tableIds.forEach(h=>{if(!o[h])return;const[,m]=o[h];l+=1,c+=m.capacity.min,p+=m.capacity.max}),this.sectionTableCountById[r.id]=`${l} tables ${c}-${p} guests`,r.id!==this.editSectionId&&i.push(...r.tableIds)}),this.availableTables=n.filter(r=>!i.includes(r.id))}checkSectionNameIsUnique(){return o=>{const n=o.value;return-1!==this.sections.findIndex(r=>r.name.toLowerCase()===n.toLowerCase()&&r.id!==this.editSectionId)?{recordAvailability:!0}:null}}validateSectionName(o){let n=null;return-1!==this.sections.findIndex(i=>i.name.toLowerCase()===o.toLowerCase()&&i.id!==this.editSectionId)&&(n={recordAvailability:!0}),n}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(d.ok),e.rXU(B.ft),e.rXU(_.Bm))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-sections"]],inputs:{resourcesMap:"resourcesMap",tables:"tables",sections:"sections",windowHeight:"windowHeight",contentHeight:"contentHeight",disabled:"disabled",onSectionClose:"onSectionClose",onSectionDelete:"onSectionDelete"},outputs:{selectTable:"selectTable",editModeChange:"editModeChange",selectionColorChange:"selectionColorChange",tableInputIdsChange:"tableInputIdsChange"},standalone:!1,features:[e.OA$],decls:9,vars:4,consts:[["topSection",""],["editSection",""],[1,"top-section",3,"hidden"],[1,"mt-3","mb-2","user-select-none"],[1,"btn","btn-info","w-100","user-select-none",3,"click","disabled"],["class","edit-form",4,"ngIf"],["class","sections",3,"height",4,"ngIf"],[1,"edit-form"],[1,"background-canvas","h-100"],[3,"formGroup"],[1,"floorplan-builder-label","user-select-none"],["bindValue","id","name","services","bindLabel","name","clearAllText","Clear","formControlName","tables",1,"mb-2",3,"items","multiple","clearable"],[3,"control"],["id","input-modal-name","type","text","formControlName","name","name","name","noWhitespace","","required","","trTrimSpaces","",1,"form-control","mb-2"],["width","100%","formControlName","sectionColor"],[1,"actions","d-flex","mt-2"],["class","btn btn-danger w-100 mr-2 user-select-none",3,"click",4,"ngIf"],[1,"btn","btn-info","w-100","mr-1","user-select-none",3,"click","disabled"],[1,"btn","ml-1","w-100","user-select-none",3,"click","ngClass"],[1,"btn","btn-danger","w-100","mr-2","user-select-none",3,"click"],[1,"sections"],["class","section-item background-canvas",4,"ngFor","ngForOf"],[1,"section-item","background-canvas"],[1,"title","user-select-none"],[1,"tables","color-primary","user-select-none"],[1,"edit",3,"click","icon"]],template:function(n,i){if(1&n){const r=e.RV6();e.j41(0,"section")(1,"div",2,0)(3,"p",3),e.EFF(4,'To create a section press the "Add section" button. Choose tables from the list or select on the canvas.'),e.k0s(),e.j41(5,"button",4),e.bIt("click",function(){return e.eBV(r),e.Njj(i.addSection())}),e.EFF(6,"+ Add section"),e.k0s()(),e.DNE(7,Dt,22,12,"div",5)(8,Xt,2,3,"div",6),e.k0s()}2&n&&(e.R7$(),e.Y8G("hidden",i.editSectionOpen),e.R7$(4),e.Y8G("disabled",i.disabled),e.R7$(2),e.Y8G("ngIf",i.editSectionOpen),e.R7$(),e.Y8G("ngIf",!i.editSectionOpen))},dependencies:[j.bT,ie.f,d.qT,d.me,d.BC,d.cb,d.YS,d.j4,d.JD,te.R,j.YU,j.Sq,Ot.X,ue.L,Vt.Z],styles:["[_nghost-%COMP%]{height:100%}section[_ngcontent-%COMP%]{padding:0 24px;height:100%}.section-color[_ngcontent-%COMP%]{position:relative;width:100%}.edit-form[_ngcontent-%COMP%]{height:100%;position:relative;margin-top:1rem;overflow-y:auto;border-radius:4px}.edit-form[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{padding:.5rem}.edit-form[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{text-transform:uppercase;font-size:.75rem;margin:0 0 .5rem}.section-item[_ngcontent-%COMP%]{padding:.5rem .7rem;box-sizing:border-box;border-radius:.5rem;margin-bottom:.75rem;position:relative}.section-item[_ngcontent-%COMP%]   .edit[_ngcontent-%COMP%]{top:.75rem;right:.75rem;cursor:pointer;position:absolute}.section-item[_ngcontent-%COMP%]   .title[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;margin:0}.section-item[_ngcontent-%COMP%]   .tables[_ngcontent-%COMP%]{margin:0}.sections[_ngcontent-%COMP%]{display:flex;flex-direction:column;overflow-y:auto;margin:1rem 0 0;padding:0}.color-picker[_ngcontent-%COMP%]{background:orange}"]}))}return s(),a})();const Ne=["graphCanvas"],zt=["popoutContent"];function Ut(s,a){if(1&s&&(e.j41(0,"div",28),e.nrm(1,"frontend-paid-feature-alert",29),e.k0s()),2&s){const t=e.XpG();e.R7$(),e.Y8G("user",t.user)("visible",!t.isOnBusinessPlan)("plansAlertData",t.plansAlertData)}}function Ht(s,a){if(1&s&&e.nrm(0,"tr-icon",30),2&s){const t=e.XpG();e.Y8G("icon",t.icon.multiSelect)("color",t.iconColor.blue)("size",t.iconSize.medium)}}function Lt(s,a){if(1&s&&e.nrm(0,"tr-icon",30),2&s){const t=e.XpG();
1e.Y8G("icon",t.icon.cancel)("color",t.iconColor.blue)("size",t.iconSize.medium)}}function Wt(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",32)(1,"tablesready-tables",33),e.bIt("elementDragged",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.saveTableData(n))}),e.k0s(),e.j41(2,"tablesready-floorplan-objects",33),e.bIt("elementDragged",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.saveTableData(n))}),e.k0s()()}if(2&s){const t=e.XpG(2),o=e.sdS(17),n=e.sdS(19);e.xc7("height","calc("+(o.offsetHeight-n.offsetHeight)+"px)"),e.R7$(),e.Y8G("disabled",!t.isOnBusinessPlan),e.R7$(),e.Y8G("disabled",!t.isOnBusinessPlan)}}function Kt(s,a){if(1&s&&(e.qex(0),e.DNE(1,Wt,3,4,"div",31),e.bVm()),2&s){const t=e.XpG(),o=e.sdS(30);e.R7$(),e.Y8G("ngIf",!t.openedAddTableForm&&!t.openedAddObjectForm)("ngIfElse",o)}}function qt(s,a){if(1&s&&e.nrm(0,"tr-icon",36),2&s){const t=e.XpG(2);e.Y8G("icon",t.icon.arrowLeft)}}function Zt(s,a){if(1&s&&e.nrm(0,"tr-icon",36),2&s){const t=e.XpG(2);e.Y8G("icon",t.icon.arrowRight)}}function Jt(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",34),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.popoutHidden=!n.popoutHidden)}),e.DNE(1,qt,1,1,"tr-icon",35)(2,Zt,1,1,"tr-icon",35),e.k0s()}if(2&s){const t=e.XpG(),o=e.sdS(17);e.xc7("right",t.popoutHidden||t.isDraggingObject?0:o.offsetWidth,"px"),e.R7$(),e.Y8G("ngIf",t.popoutHidden),e.R7$(),e.Y8G("ngIf",!t.popoutHidden)}}function Qt(s,a){if(1&s){const t=e.RV6();e.j41(0,"tablesready-add-table-form",39),e.bIt("resourceChanged",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.resourceChanged(n))})("formClosed",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onTableFormClose(n))})("tableRemoved",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.removeObjectFromCanvas(n))})("nameChanged",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.changeTableText(n))})("capacityChanged",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.changeTableText(void 0,n))})("shapeChanged",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.changeTableSizeOrShape(i.selectedSize,n))})("sizeChanged",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.changeTableSizeOrShape(n,i.selectedShape))})("rotationAngleChanged",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.changeTableRotation(n))})("formTouched",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.setTableFormTouched(n))}),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("width",t.width)("height",t.height)("left",t.left)("top",t.top)("size",t.selectedSize)("shape",t.selectedShape)("resourceId",t.selectedResourceId)("sectionId",t.selectedObjectSectionId?t.selectedObjectSectionId:null)("rotation",t.rotation)("isEditMode",t.isObjectEditMode)("locationId",t.locationId)("reservationsLabel",t.reservationsLabel)("onCreate",t.onTableCreateClose)("onSave",t.onTableSaveClose)("resources",t.resources)("services",t.floorPlanTableService.services)("generatedTableName",t.generatedTableName)("duplicatedTable",t.duplicatedTable)("onTableDelete",t.onObjectDeleteClose)("onResourceDelete",t.onDeleteResource)("onResourceCreate",t.onCreateResource)("onResourceUpdate",t.onUpdateResource)("onTableDuplicate",t.onTableDuplicate)("sections",t.floorPlanTableService.savedSections)("tableId",t.selectedObjectId)("floorPlanId",t.selectedFloorPlanId)}}function $t(s,a){if(1&s){const t=e.RV6();e.j41(0,"tablesready-floorplan-add-object-form",40),e.bIt("formClosed",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onObjectFormClosed(n))})("nameChange",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.changeObjectText(n))})("tableRemoved",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.removeObjectFromCanvas(n))})("rotationChange",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.changeTableRotation(n))})("formTouched",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.setObjectFormTouched(n))}),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("objectId",t.selectedObjectId)("name",t.objectName)("width",t.width)("height",t.height)("left",t.left)("top",t.top)("shape",t.selectedShape)("floorPlanId",t.selectedFloorPlanId)("rotation",t.rotation)("onCreate",t.onObjectAddClose)("onSave",t.onObjectSaveClose)("onDelete",t.onObjectDeleteClose)("isEditMode",t.isObjectEditMode)}}function eo(s,a){if(1&s&&(e.j41(0,"div",32),e.DNE(1,Qt,1,26,"tablesready-add-table-form",37)(2,$t,1,13,"tablesready-floorplan-add-object-form",38),e.k0s()),2&s){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.openedAddTableForm),e.R7$(),e.Y8G("ngIf",t.openedAddObjectForm)}}let to=(()=>{var s;class a{constructor(o,n,i,r,l,c,p,h,m,f,x,S,H,k,A,K){this.floorPlanTableService=o,this.cdr=n,this.alertsService=i,this.windowHeightService=r,this.themeSwitch=l,this.breakpointService=c,this.pageIdentifyService=p,this.authRestaurantService=h,this.itemService=m,this.service=f,this.servicesService=x,this.modalController=S,this.errorHandler=H,this.resourceApiService=k,this.pricePlansRestrictionsService=A,this.planRestrictionsAlertService=K,this.left
1LayoutOffsetPx=0,this.tabs=[z.tables,z.sections],this.tabValues=z,this.openedAddTableForm=!1,this.openedAddObjectForm=!1,this.enabledResources=!1,this.enabledServices=!1,this.enabledServicesCount=0,this.isObjectEditMode=!1,this.isOnFreePlan=!0,this.isOnBusinessPlan=!1,this.tabsHeight=64,this.rotation=0,this.width=0,this.height=0,this.left=0,this.top=0,this.isFloorPlansLoading=!0,this.isTable=!1,this.allowSectionMultiSelection=!1,this.tablesLoaded=!1,this.isDraggingObject=!1,this.multiTransformSelectMode=!1,this.duplicatedTable=!1,this.icon=M.z9,this.rightSidebarBreakpoint=!1,this.contentAreaHeight=window.innerHeight,this.iconSize=M.Gs,this.iconColor=M.eA,this.popoutHidden=!0,this.confirmChangesDialogOpen=!1,this.reservationsLabel="reservations",this.autoZoomed=!1,this.floorPlanTablesCount=0,this.tableAddFormTouched=!1,this.objectAddFormTouched=!1,this.subscriptions=new q.yU,this.getItems=b=>this.floorPlanTableService.getItems(b).pipe((0,g.M)(({tables:v})=>{if(this.floorPlanTablesCount=v.length,this.tablesLoaded=!0,!this.autoZoomed){if(!this.autoZoomed&&0===v.length)return void(this.autoZoomed=!0);setTimeout(()=>{v.length>0&&(this.canvas.autoZoom(v),this.autoZoomed=!0)})}})),this.onDeleteResource=b=>{this.resourceApiService.delete(b).pipe((0,T.s)(1)).subscribe()},this.onObjectDeleteClose=(b,v)=>{this.itemService.deleteById(b).pipe((0,T.s)(1)).subscribe(()=>{this.popoutHidden=!0,this.hideForm(),this.canvas.onFloorChange(v,"builder onObjectDeleteClose()")})},this.onTableDuplicate=b=>{if(this.tableAddFormTouched)return void this.alertsService.addWarning("you need to save or discard changes before duplicating this table.","Warning: ");this.duplicatedTable=!0;const v=this.resources.find(F=>F._id===b.resourceId);this.generatedTableName=`Table ${this.findAvailableTableName(this.floorPlanTablesCount+1)}`,this.canvas.addTable((0,ge.A)(),this.generatedTableName,`${v.capacity.min}-${v.capacity.max}`,"",b.width,b.height,this.top,this.left,b.shape,!1,!1,0,b.rotation,void 0,this.selectedObjectSectionId,!0)},this.onObjectSaveClose=(b,v,F,E)=>{const L={id:b,floorPlanId:v,type:W.Z.object,name:String(F),...E,getAttributes:()=>E};this.itemService.updateById(L).pipe((0,T.s)(1)).subscribe(()=>{this.canvas.setObjectAsModifiedById(b),this.popoutHidden=!0,this.hideForm(),this.canvas.onFloorChange(v,"onObjectSaveClose() after updateById()")})},this.onTransformUpdate=(b,v,F,E)=>{this.itemService.updatePartialById(b,v,F).pipe((0,T.s)(1),(0,g.M)(()=>{v===W.Z.table&&this.handleSectionUpdateForTable(b,E,!1,this.selectedObjectSectionId)})).subscribe()},this.onTableSaveClose=(b,v,F,E,L)=>{const oe={id:b,floorPlanId:v,type:W.Z.table,name:String(F),...E,getAttributes:()=>E};this.itemService.updateById(oe).pipe((0,T.s)(1),(0,g.M)(ae=>{this.canvas.setObjectAsModifiedById(b),this.handleSectionUpdateForTable(b,L,!0,this.selectedObjectSectionId)})).subscribe()},this.onSectionDelete=(b,v)=>{this.itemService.deleteById(b).pipe((0,T.s)(1)).subscribe(()=>{this.canvas.onFloorChange(this.selectedFloorPlanId,"builder after section deleteById()",v)})},this.afterSectionClose=(b=!1)=>{this.hideForm(b),this.setTableFormTouched(!1),this.canvas.onFloorChange(this.selectedFloorPlanId,"builder afterSectionClose()")},this.onTableFormClose=(b=!1)=>{this.hideForm(),this.setTableFormTouched(!1),this.duplicatedTable=!1,b&&this.canvas.onFloorChange(this.selectedFloorPlanId,"builder onTableFormClose()")},this.onObjectFormClosed=(b=!1)=>{this.hideForm(),this.setObjectFormTouched(!1),b&&this.canvas.onFloorChange(this.selectedFloorPlanId,"builder onObjectFormClosed()")},this.onObjectAddClose=(b,v)=>{const F={type:W.Z.object,name:String(b),...v,getAttributes:()=>v};this.itemService.create(this.selectedFloorPlanId,F).pipe((0,T.s)(1),(0,g.M)(()=>{this.popoutHidden=!0,this.hideForm()}),(0,P.W)(E=>(this.errorHandler.handleError(E),(0,w.of)(null)))).subscribe(E=>{this.canvas.setObjectAsModifiedById(E.id),this.canvas.onFloorChange(this.selectedFloorPlanId,"builder onObjectAddClose() after item creation")})},this.onTableCreateClose=(b,v,F)=>{const E={type:W.Z.table,name:String(b),...v,getAttributes:()=>v};this.itemService.create(this.selectedFloorPlanId,E).pipe((0,T.s)(1),(0,g.M)(L=>{this.handleSectionUpdateForTable(L.id,F);const oe=this.floorPlanTableService.floorPlans.findIndex(Ae=>Ae.id===this.selectedFloorPlanId);if(-1===oe)return;const ae=[...this.floorPlanTableService.floorPlans];ae[oe].tablesCount+=1,this.floorPlanTableService.floorPlans=ae}),(0,P.W)(L=>(this.errorHandler.handleError(L),(0,w.of)(null)))).subscribe()},this.onCreateResource=b=>this.resourceApiService.create(b),this.onUpdateResource=b=>this.resourceApiService.edit(b),this.addFloorPlan=()=>{!this.enabledResources||!this.enabledServices||!this.isOnBusinessPlan||this.modalController.create(Me,{defaultChecked:0===this.floorPlansCount,floorplans:this.floorPlanTableService.floorPlans,onClose:(b,v,F)=>{this.modalSave(b,v,F)}}).pipe((0,T.s)(1)).subscribe()},this.pageIdentifyService.setup(X.GO)}ngAfterViewInit(){const o=this.breakpointService.observeFloorPlanRightSidebar().subscribe(l=>{this.popoutHidden=!this.rightSidebarBreakpoint,this.rightSidebarBreakpoint=l});this.subscriptions.add(o);
1const n=this.breakpointService.mainNavSidebarWidth$.subscribe(l=>{this.leftLayoutOffsetPx=l});this.subscriptions.add(n),this.windowHeightService.init();const r=this.windowHeightService.height$.pipe((0,et.Z)(window.innerHeight),(0,tt.B)(200)).subscribe(()=>{this.cdr.detectChanges(),setTimeout(()=>{this.canvas.redrawScrollbars("FloorPlanBuilderComponent AfterViewInit() height sub"),this.canvas.setCanvasDimensions()})});this.subscriptions.add(r)}toggleMultiTransformMode(){this.canvas.deselectAllObjects(),this.multiTransformSelectMode=!this.multiTransformSelectMode}setTableFormTouched(o){this.tableAddFormTouched=o}setObjectFormTouched(o){this.objectAddFormTouched=o}sectionEditModeChange(o){this.allowSectionMultiSelection=void 0!==o,this.selectedSectionId=o,void 0===o&&this.canvas.deselectAllObjects()}handleSectionUpdateForTable(o,n,i=!0,r){let l,c;this.floorPlanTableService.savedSections.forEach(m=>{m.id===n&&(c=m),m.tableIds.includes(o)&&(l=m)});const p=c?.id===l?.id;if(p&&!i)return;if(p)return void this.afterSectionClose(!0);const h=()=>{if(!c)return void this.afterSectionClose(!0);const{name:m,tableIds:f,color:x}=c;this.onSectionCloseHandler(!1,()=>{this.afterSectionClose(!0)})(m,[...f,o],x,n)};if(l){const{name:m,color:f}=l,x=l.tableIds.filter(S=>S!==o);this.onSectionCloseHandler(!1,()=>{h()})(m,x,f,r)}else h()}floorChanged(o){o!==this.selectedFloorPlanId&&(this.hideForm(),this.selectedFloorPlanId=o)}onSectionClose(){return(o,n)=>this.onSectionCloseHandler(o,()=>{this.afterSectionClose(!0),n&&n()})}resourceChanged(o){!this.selectedObjectId||!o||(this.canvas.setResourceId(this.selectedObjectId,o._id),this.canvas.setTableTextPropName("id",this.selectedObjectId,!0,!1,0,o.name))}ngOnInit(){this.windowHeightService.init(),this.windowHeightService.height$.subscribe(c=>{this.contentAreaHeight=c,this.canvas.redrawScrollbars("FloorPlanBuilderComponent ngOnInit() height sub")}),this.activeTab=z.tables;const o=this.floorPlanTableService.floorPlans$.subscribe(()=>{this.isFloorPlansLoading=!1});this.subscriptions.add(o);const n=this.themeSwitch.themeChange$.pipe((0,be.c)(1)).subscribe(()=>{this.hideForm(!0)});this.subscriptions.add(n);const i=(0,Ee.z)([this.authRestaurantService.select(),this.servicesService.selectAllEnabled()]).pipe((0,g.M)(([c,p])=>{this.user=c,this.enabledResources=c.location.resourceSettings.enabled,this.enabledServices=c.location.serviceSettings.enabled,this.enabledServicesCount=p.filter(h=>h.enabled).length})).subscribe();this.subscriptions.add(i);const r=this.authRestaurantService.selectAndDetectLocationChanges().pipe((0,g.M)(c=>{const{account:p,location:h}=c;this.locationId=h._id,this.reservationsLabel=h.displayOptions?.labels?.reservation_plural??this.reservationsLabel,this.isOnFreePlan=(0,ot.t)(c),this.isOnBusinessPlan=this.pricePlansRestrictionsService.availableForBusinessPlan(p.subscriptionType,h.recurly),this.plansAlertData=this.planRestrictionsAlertService.getAlertData(p.subscriptionType,p.recurly,h.recurly),this.trialCompleted=p.recurly?.trial})).subscribe();this.subscriptions.add(r);const l=this.floorPlanTableService.resources$.pipe((0,g.M)(c=>{this.resources=c})).subscribe();this.subscriptions.add(l)}onPlanEdit(o){this.isOnBusinessPlan&&this.modalController.create(Me,{defaultChecked:1===this.floorPlansCount,mode:Z.edit,item:o,floorplans:this.floorPlanTableService.floorPlans,onClose:(n,i,r,l)=>{this.modalSave(n,i,r,l)}}).pipe((0,T.s)(1)).subscribe()}onCanvasClicked(){if(this.activeTab===z.sections)return;const o=this.lastSelectedObjectId;void 0!==o&&this.leaveFormModal().pipe((0,g.M)(n=>{null===n&&this.hideForm(),n&&!n.response&&(this.lastSelectedObjectId=o,this.confirmChangesDialogOpen=!1,this.canvas.selectTableById(o),this.canvas.detectChanges())}),(0,I.p)(n=>n?.response)).subscribe(({response:n})=>{n&&(this.hideForm(),this.canvas.onFloorChange(this.selectedFloorPlanId,"builder onCanvasClicked()"))})}onObjectSelected(o){const n=this.lastSelectedObjectId;if(this.selectedObjectId=o.id,this.selectedResourceId=this.duplicatedTable?this.selectedResourceId:o.resourceId,this.selectedObjectSectionId=o.sectionId,this.left=o.left,this.top=o.top,this.selectedSize=o.size,this.width=o.width,this.height=o.height,this.isTable=o.isTable,this.selectedShape=o.shape,this.objectName=o.name,this.rotation=Number(o.rotation.toFixed(0)),this.popoutHidden=!this.rightSidebarBreakpoint||void 0===this.selectedObjectId,this.isObjectEditMode=-1!==(o.isTable?this.floorPlanTableService.savedTables:this.floorPlanTableService.savedObjects).findIndex(r=>
1r.id===this.selectedObjectId),this.openedAddTableForm=!this.selectedSectionId&&o.isTable,this.openedAddObjectForm=!this.selectedSectionId&&!o.isTable,this.activeTab!==z.tables||this.selectedObjectId===n||void 0===n||this.confirmChangesDialogOpen)this.lastSelectedObjectId=o.id;else{if(this.isTable&&!this.tableAddFormTouched||!this.isTable&&!this.objectAddFormTouched)return this.openedAddTableForm=!1,this.openedAddObjectForm=!1,this.lastSelectedObjectId=o.id,void setTimeout(()=>{this.openedAddTableForm=o.isTable,this.openedAddObjectForm=!o.isTable;const c=this.floorPlanTableService.savedTables.findIndex(h=>h.id===n),p=this.floorPlanTableService.savedObjects.findIndex(h=>h.id===n);c<0&&p<0&&this.canvas.removeObject(n)});this.confirmChangesDialogOpen=!0,this.leaveFormModal().pipe((0,g.M)(c=>{c&&!c.response&&(this.lastSelectedObjectId=n,this.confirmChangesDialogOpen=!1,this.canvas.selectTableById(n),this.canvas.detectChanges())}),(0,I.p)(c=>c?.response)).subscribe(c=>{this.openedAddTableForm=!1,this.openedAddObjectForm=!1,setTimeout(()=>{this.canvas.onFloorChange(this.selectedFloorPlanId,"builder onObjectSelected",()=>{this.lastSelectedObjectId=o.id,this.confirmChangesDialogOpen=!1,this.canvas.selectTableById(o.id),this.canvas.detectChanges()})})})}}fromSectionsToTables(o){this.activeTab=z.tables,setTimeout(()=>{this.canvas.selectTableById(o),this.canvas.detectChanges()})}saveTableData(o){this.selectedShape=o.shape,this.selectedSize=o.size,this.selectedCanvasObject=o.objectType}changeObjectText(o){this.canvas.setObjectText(this.selectedObjectId,o)}changeTableText(o,n){this.canvas.setTableTextPropName("id",this.selectedObjectId,!0,!1,0,o,n)}changeTableSizeOrShape(o,n){this.selectedSize=de[o],this.selectedShape=n;let i=this.width,r=this.height;if(o!==C.z.custom)i=X.z1[n][o].width,r=X.z1[n][o].height;else if(o===C.z.custom&&n===y.DO.square&&i!==r){const l=i>=r?i:r;i=l,r=l}this.canvas.setObjectShape(this.selectedObjectId,this.selectedShape,i,r)}changeTableRotation(o){this.canvas.setTableRotation(this.selectedObjectId,o)}dropElement([o,n]){const i=this.canvas.getZoom(),r=o/i,l=n/i;if(this.selectedCanvasObject===y.oY.object){let p=108,h=57;this.selectedShape===y.DO.circle&&(p=57,h=57),this.objectName="",this.canvas.addObject((0,ge.A)(),"",p,h,r,l,this.selectedShape,!0)}this.selectedCanvasObject===y.oY.table&&(this.generatedTableName=`Table ${this.findAvailableTableName(this.floorPlanTablesCount+1)}`,this.canvas.addTable((0,ge.A)(),this.generatedTableName,de[this.selectedSize],"",X.z1[this.selectedShape][this.selectedSize].width,X.z1[this.selectedShape][this.selectedSize].height,r,l,this.selectedShape,!1,!1,0,void 0,void 0,"",!0)),this.selectedResourceId=null}findAvailableTableName(o){let n=!1;const i=this.floorPlanTableService.resourceIdToTableDataMap;return this.resources.forEach(r=>{const l=i[r._id];n||l?.floorPlanId!==this.selectedFloorPlanId||r.name===`Table ${o}`&&(n=!0)}),n?this.findAvailableTableName(o+1):o}autoSave(o){o.isTable&&-1===this.floorPlanTableService.savedTables.findIndex(i=>i.id===o.id)||!o.isTable&&-1===this.floorPlanTableService.savedObjects.findIndex(i=>i.id===o.id)||this.onTransformUpdate(o.id,o.isTable?W.Z.table:W.Z.object,{width:o.width,height:o.height,top:o.top,left:o.left,size:o.size,shape:o.shape,rotation:o.rotation},o.sectionId)}hideForm(o=!0){this.selectedObjectId=void 0,this.lastSelectedObjectId=void 0,this.openedAddTableForm=!1,this.openedAddObjectForm=!1,this.popoutHidden=o,setTimeout(()=>{this.canvas.deselectAllObjects()})}removeObjectFromCanvas(o){this.canvas.removeObject(o),this.selectedObjectId=null}onChangeTab(o){this.activeTab===z.tables&&(this.openedAddTableForm||this.openedAddObjectForm)?this.leaveFormModal().pipe((0,I.p)(n=>null===n||n?.response),(0,g.M)(()=>{this.activeTab=o,this.hideForm(this.popoutHidden),this.canvas.onFloorChange(this.selectedFloorPlanId,"builder onChangeTab()")})).subscribe():this.activeTab=o}get floorPlansCount(){return this.floorPlanTableService.floorPlans?.length||0}ngOnDestroy(){this.pageIdentifyService.remove(X.GO),this.subscriptions.unsubscribe()}onSectionCloseHandler(o,n){return(i,r,l,c)=>{const p={name:i,color:l,tableIds:r,type:W.Z.section,getAttributes:()=>({color:l,tableIds:r})},h={...p,id:c,floorPlanId:this.selectedFloorPlanId,getAttributes:()=>({color:l,tableIds:r})};this.allowSectionMultiSelection=!1,this.canvas.deselectAllObjects();let m=this.itemService.create(this.selectedFloorPlanId,p);o||(m=this.itemService.updateById(h)),m.pipe((0,T.s)(1),(0,be.c)(1)).subscribe(()=>{n&&n()})}}modalSave(o,n,i,r){let l=this.service.create({name:n.name,default:n.default});o===Z.edit&&(l=this.service.updateById(n.id,{name:n.name,default:n.default})),o===Z.delete&&(l=this.service.deleteById(n.id,r)),l.pipe((0,T.s)(1),(0,P.W)(c=>(this.errorHandler.handleError(c),(0,w.of)(!1))),(0,I.p)(c=>!1!==c)).subscribe(()=>{i.close()})}leaveFormModal(){return!this.isObjectEditMode||this.tableAddFormTouched||this.objectAddFormTouched?this.modalController.create(_.M$,{options:{content:"Leave the form? Changes that you made will not be saved.",title:`Cancel  ${this.isTable?"table":"object"} changes`,closeBtnText:"Cancel"}},B.jQ.default,!1).pipe((0,T.s)(1)):(0,w.of)(null)}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(O.lU),e.rXU(e.gRc),e.rXU(ee.nB),e.rXU(it.p2),e.rXU(nt.X7),e.rXU(pt.m),e.rXU(_.iE),e.rXU(Ce.Zz),e.rXU(O.EI),e.rXU(O.DR),e.rXU(O.gj),e.rXU(B.ft),e.rXU(_.qk),e.rXU(O.WL),e.rXU(ve.C),e.rXU(O.An))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-floor-plan"]],viewQuery:function(n,i){if
1(1&n&&(e.GBs(Ne,7,X.IB),e.GBs(Ne,7,e.aKT),e.GBs(zt,7,e.aKT)),2&n){let r;e.mGM(r=e.lsd())&&(i.canvas=r.first),e.mGM(r=e.lsd())&&(i.canvasRef=r.first),e.mGM(r=e.lsd())&&(i.popoutEl=r.first)}},standalone:!1,features:[e.Jv_([_.qk,O.lU,_.iE])],decls:31,vars:58,consts:[["sectionRef",""],["graphCanvas",""],["popoutContent",""],["contentTop",""],["sections",""],["displayForms",""],[1,"background-background"],["class","alert-absolute background-background",4,"ngIf"],[1,"fullscreen-cover"],[3,"showTablesWarning","showFloorPlanAddWarning","showFloorPlansWarning","enabledResources","enabledServices","enabledServicesCount","floorplansAction"],[1,"wrapper"],[1,"d-flex","justify-content-between","flex-row","align-items-start","h-100"],[1,"canvas-wrapper"],[3,"planEdit","objectSelected","floorChanged","dropNewObject","objectMultiSelected","clickedOnCanvas","htmlDragStart","objectDragStart","objectDragEnd","multiTransformSelectModeChange","canvasId","leftLayoutOffsetPx","getItems","showFloorsEdit","customMultiSelectEnabled","allowObjectCustomSelection","multiTransformSelectMode","selectedObjectId","resourcesMap","transformEnabled","floorPlanItems","canvasAreaHeightPx","customSelectMode","allowOnlySectionIdSelection","allowCustomSelection","isOnFreePlan"],[1,"d-flex","align-items-center"],[3,"floorChange","editPlan","items","showEditButton","disabled"],["ngbTooltip","Select multiple tables",1,"btn","font-weight-bold","btn-outline-info","ml-2","background-background","multi-btn",3,"click","disabled","disableTooltip"],[3,"icon","color","size",4,"ngIf"],[1,"popout","border-border",3,"open"],[1,"popout-content","background-background"],[1,"content-top"],[1,"d-flex","flex-row","justify-content-end","align-items-center"],[1,"btn","btn-info",3,"click","disabled"],[3,"changeTab","tabs","activeTab","boldText"],[4,"ngIf"],[1,"tab-content","px-0",3,"hidden"],[3,"editModeChange","selectionColorChange","tableInputIdsChange","selectTable","windowHeight","resourcesMap","sections","tables","onSectionClose","onSectionDelete","contentHeight","disabled"],["slot","fixed","class","popout-tip background-background",3,"right","click",4,"ngIf"],[1,"alert-absolute","background-background"],["classes","mt-3",3,"user","visible","plansAlertData"],[3,"icon","color","size"],["class","tab-content",3,"height",4,"ngIf","ngIfElse"],[1,"tab-content"],[3,"elementDragged","disabled"],["slot","fixed",1,"popout-tip","background-background",3,"click"],[3,"icon",4,"ngIf"],[3,"icon"],[3,"width","height","left","top","size","shape","resourceId","sectionId","rotation","isEditMode","locationId","reservationsLabel","onCreate","onSave","resources","services","generatedTableName","duplicatedTable","onTableDelete","onResourceDelete","onResourceCreate","onResourceUpdate","onTableDuplicate","sections","tableId","floorPlanId","resourceChanged","formClosed","tableRemoved","nameChanged","capacityChanged","shapeChanged","sizeChanged","rotationAngleChanged","formTouched",4,"ngIf"],[3,"objectId","name","width","height","left","top","shape","floorPlanId","rotation","onCreate","onSave","onDelete","isEditMode","formClosed","nameChange","tableRemoved","rotationChange","formTouched",4,"ngIf"],[3,"resourceChanged","formClosed","tableRemoved","nameChanged","capacityChanged","shapeChanged","sizeChanged","rotationAngleChanged","formTouched","width","height","left","top","size","shape","resourceId","sectionId","rotation","isEditMode","locationId","reservationsLabel","onCreate","onSave","resources","services","generatedTableName","duplicatedTable","onTableDelete","onResourceDelete","onResourceCreate","onResourceUpdate","onTableDuplicate","sections","tableId","floorPlanId"],[3,"formClosed","nameChange","tableRemoved","rotationChange","formTouched","objectId","name","width","height","left","top","shape","floorPlanId","rotation","onCreate","onSave","onDelete","isEditMode"]],template:function(n,i){if(1&n){const r=e.RV6();e.j41(0,"section",6,0),e.DNE(2,Ut,2,3,"div",7),e.j41(3,"div",8),e.nrm(4,"lib-frontend-floorplan-warnings",9),e.j41(5,"div",10)(6,"div",11)(7,"div",12)(8,"frontend-canvas",13,1),e.bIt("planEdit",function(c){return e.eBV(r),e.Njj(i.onPlanEdit(c))})("objectSelected",function(c){return e.eBV(r),e.Njj(i.onObjectSelected(c))})("floorChanged",function(c){return e.eBV(r),e.Njj(i.floorChanged(c))})("dropNewObject",function(c){return e.eBV(r),e.Njj(i.dropElement(c))})("objectMultiSelected",function(c){e.eBV(r);const p=e.sdS(27);return e.Njj(p.canvasTableSelectionChanges(c))})("clickedOnCanvas",function(){return e.eBV(r),e.Njj(i.onCanvasClicked())})("htmlDragStart",function(){return e.eBV(r),e.Njj(i.popoutHidden=!0)})("objectDragStart",function(){return e.eBV(r),e.Njj(i.isDraggingObject=!0)})("objectDragEnd",function(c){return e.eBV(r),i.isDraggingObject=!1,e.Njj(i.autoSave(c))})("multiTransformSelectModeChange",function(c){return e.eBV(r),i.onCanvasClicked(),e.Njj(i.multiTransformSelectMode=c)}),e.j41(10,"div",14)(11,"tablesready-floorplan-switcher",15),e.bIt("floorChange",function(c){e.eBV(r);const p=e.sdS(9);return p.floorPlanId=c,e.Njj(p.onFloorChange(c,"builder floorplan switcher"))})("editPlan",function(c){e.eBV(r);const p=e.sdS(9);return e.Njj(p.planEdit.emit(c))}),e.k0s(),e.j41(12,"button",16),e.bIt("click",function(){return e.eBV(r),i.onCanvasClicked(),e.Njj(i.toggleMultiTransformMode())}),e.DNE(13,Ht,1,3,"tr-icon",17)(14,Lt,1,3,"tr-icon",17),e.k0s()()()(),e.j41(15,"div",18)(16,"div",19,2)(18,"div",20,3)(20,"div",21)(21,"button",22),e.bIt("click",function(){return e.eBV(r),e.Njj(i.addFloorPlan())}),e.EFF(22,"+ Add floor plan"),e.k0s()(),e.j41(23,"tablesready-tabs",23),e.bIt("changeTab",function(c){e.eBV(r);const p=e.sdS(27);return i.onChangeTab(c),e.Njj(p.cancelEdit())}),e.k0s()(),e.DNE(24,Kt,2,2,"ng-container",24),e.j41(25,"div",25)(26,"tablesready-sections",26,4),e.bIt("editModeChange",function(c){return e.eBV(r),e.Njj(i.sectionEditModeChange(c))})("selectionColorChange",function(c){e.eBV(r);const p=e.sdS(9);return e.Njj(p.setMultiselectColor(c))})("tableInputIdsChange",function(c){e.eBV(r);const p=e.sdS(9);return e.Njj(p.selectTablesByIds(c))})("selectTable",function(c){return e.eBV(r),e.Njj(i.fromSectionsToTables(c))}),e.k0s()()()()()()()(),e.DNE(28,Jt,3,4,"div",27)(29,eo,3,2,"ng-template",null,5,e.C5r)}if(2&n){const r=e.sdS(1),l=e.sdS(9),c=e.sdS(17),p=e.sdS(19);e.R7$(2),e.Y8G("ngIf",!i.isOnBusinessPlan),e.R7$(2),e.Y8G("showTablesWarning",!1)("showFloorPlanAddWarning",0===i.floorPlansCount)("showFloorPlansWarning",!1)("enabledResources",i.enabledResources)("enabledServices",i.enabledServices)("enabledServicesCount",i.enabledServicesCount)("floorplansAction",i.addFloorPlan),e.R7$(4),e.AVh("no-events",i.confirmChangesDialogOpen),e.Y8G("canvasId","canvas-builder")("leftLayoutOffsetPx",i.leftLayoutOffsetPx)("getItems",i.getItems)("showFloorsEdit",!0)("customMultiSelectEnabled",!0)("allowObjectCustomSelection",!0)("multiTransformSelectMode",i.multiTransformSelectMode)("selectedObjectId",i.selectedObjectId)("resourcesMap",i.floorPlanTableService.resourcesMap)("transformEnabled",i.activeTab===i.tabValues.tables)("floorPlanItems",i.floorPlanTableService.floorPlans)("canvasAreaHeightPx",r.offsetHeight-12)("customSelectMode",i.activeTab===i.tabValues.sections)("allowOnlySectionIdSelection",i.allowSectionMultiSelection?i.selectedSectionId:void 0)("allowCustomSelection",i.activeTab===i.tabValues.sections)("isOnFreePlan",!i.isOnBusinessPlan),e.R7$(3),e.Y8G("items",i.floorPlanTableService.floorPlans)("showEditButton",l.showFloorsEdit)("disabled",!i.isOnBusinessPlan),e.R7$(),e.Y8G("disabled",!i.isOnBusinessPlan)("disableTooltip",!i.isOnBusinessPlan),e.R7$(),e.Y8G("ngIf",!i.multiTransformSelectMode),e.R7$(),e.Y8G("ngIf",i.multiTransformSelectMode),e.R7$(),e.xc7("height","100%")("min-height","100%"),e.AVh("invisible",i.isFloorPlansLoading)("hidden",i.popoutHidden||i.isDraggingObject),e.R7$(6),e.Y8G("disabled",!i.isOnBusinessPlan),e.R7$(2),e.Y8G("tabs",i.tabs)("activeTab",i.activeTab)("boldText",!0),e.R7$(),e.Y8G("ngIf",i.activeTab===i.tabValues.tables),e.R7$(),e.xc7("height","calc("+(c.offsetHeight-p.offsetHeight)+"px)"),e.Y8G("hidden",i.activeTab!==i.tabValues.sections),e.R7$(),e.Y8G("windowHeight",i.contentAreaHeight)("resourcesMap",i.floorPlanTableService.resourcesMap)("sections",i.floorPlanTableService.savedSections)("tables",i.floorPlanTableService.savedTables)("onSectionClose",i.onSectionClose())("onSectionDelete",i.onSectionDelete)("contentHeight",(i.popoutHidden?i.tabsHeight+40:0)+p.offsetHeight)("disabled",!i.isOnBusinessPlan),e.R7$(2),e.Y8G("ngIf",i.floorPlansCount>0)}},dependencies:[Pe.O,ut.I,ht.W,j.bT,te.R,$.md,mt.w,Be.M,gt,wt,Rt,Et,Yt],styles:[".no-events[_ngcontent-%COMP%]{pointer-events:none}section[_ngcontent-%COMP%]{height:100%;overflow-y:auto;position:relative;box-sizing:border-box}.fullscreen-cover[_ngcontent-%COMP%]{position:absolute;top:0;left:0;height:100%;width:100%}.alert-absolute[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;padding:0 1rem;box-sizing:border-box;z-index:1000}.wrapper[_ngcontent-%COMP%]{padding:0 1rem!important;height:100%;display:flex;flex-direction:column;overflow:hidden}.tab-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;overflow-y:scroll;overflow-x:hidden;padding:0 10px 24px 24px}.multi-btn[_ngcontent-%COMP%]{width:2.5rem;height:2.5rem;z-index:20}.content-top[_ngcontent-%COMP%]{padding:24px 10px 0 24px}.canvas-wrapper[_ngcontent-%COMP%]{width:100%;display:flex;min-width:20rem;flex-direction:column}.popout[_ngcontent-%COMP%]{z-index:30;top:0;right:0;position:relative;box-sizing:border-box}.popout.open[_ngcontent-%COMP%]{border-left:1px solid}.popout-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:26rem;min-width:26rem;height:100%;padding:0;box-sizing:border-box}.popout-tip[_ngcontent-%COMP%]{z-index:29;cursor:pointer;box-shadow:0 0 6px #03030326;-webkit-box-shadow:0 0 6px 0 rgba(3,3,3,.1490196078);-moz-box-shadow:0 0 6px 0 rgba(3,3,3,.1490196078);position:fixed;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem;top:50%;padding:1rem .5rem}h1[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:var(--cc-link)!important;text-decoration:none!important;-webkit-user-select:none;user-select:none}h1[_ngcontent-%COMP%]   a.disabled[_ngcontent-%COMP%]{color:var(--cc-disabled)!important}h1[_ngcontent-%COMP%]   a.disabled[_ngcontent-%COMP%]:hover{text-decoration:none!important}h1[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:hover{text-decoration:underline!important}@media (min-width: 1401px){.popout[_ngcontent-%COMP%]{right:0!important;border-left:0}.popout-tip[_ngcontent-%COMP%]{display:none}}@media (max-width: 1400px){.popout-tip[_ngcontent-%COMP%]{display:flex}.popout-content[_ngcontent-%COMP%]{padding:0 1rem 0 0}.popout[_ngcontent-%COMP%]{position:absolute}.popout.hidden[_ngcontent-%COMP%]   .popout-content[_ngcontent-%COMP%]{width:0!important}.popout.hidden[_ngcontent-%COMP%]{overflow:hidden;width:0!important}}"]}))}return s(),a})();var oo=u("./node_modules/@angular/common/fesm2022/xhr-BfNfxNDv.mjs"),no=u("./node_modules/@angular/common/fesm2022/dom_tokens-rA0ACyx7.mjs");
1const io=["dialogPopup"],so=["hueSlider"],ro=["alphaSlider"];function ao(s,a){if(1&s&&e.nrm(0,"div"),2&s){const t=e.XpG();e.ZvI("arrow arrow-",t.cpUsePosition,""),e.xc7("left",t.cpArrowPosition)("top",t.arrowTop,"px")}}function lo(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",28),e.bIt("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onColorChange(n))})("dragStart",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onDragStart("saturation-lightness"))})("dragEnd",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onDragEnd("saturation-lightness"))}),e.nrm(1,"div",16),e.k0s()}if(2&s){const t=e.XpG();e.xc7("background-color",t.hueSliderColor),e.Y8G("rgX",1)("rgY",1),e.R7$(),e.xc7("top",null==t.slider?null:t.slider.v,"px")("left",null==t.slider?null:t.slider.s,"px")}}function co(s,a){1&s&&(e.qSk(),e.j41(0,"svg",29),e.nrm(1,"path",30)(2,"path",31),e.k0s())}function po(s,a){if(1&s){const t=e.RV6();e.j41(0,"button",32),e.bIt("click",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAddPresetColor(n,i.selectedColor))}),e.EFF(1),e.k0s()}if(2&s){const t=e.XpG();e.HbH(t.cpAddColorButtonClass),e.Y8G("disabled",t.cpPresetColors&&t.cpPresetColors.length>=t.cpMaxPresetColorsLength),e.R7$(),e.SpI(" ",t.cpAddColorButtonText," ")}}function uo(s,a){1&s&&e.nrm(0,"div",33)}function ho(s,a){if(1&s){const t=e.RV6();e.j41(0,"input",39),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAlphaInput(n))}),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("rg",1)("value",null==t.cmykText?null:t.cmykText.a)}}function mo(s,a){1&s&&(e.j41(0,"div"),e.EFF(1,"A"),e.k0s())}function fo(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",34)(1,"div",35)(2,"input",36),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onCyanInput(n))}),e.k0s(),e.j41(3,"input",36),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onMagentaInput(n))}),e.k0s(),e.j41(4,"input",36),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onYellowInput(n))}),e.k0s(),e.j41(5,"input",36),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onBlackInput(n))}),e.k0s(),e.DNE(6,ho,1,2,"input",37),e.k0s(),e.j41(7,"div",35)(8,"div"),e.EFF(9,"C"),e.k0s(),e.j41(10,"div"),e.EFF(11,"M"),e.k0s(),e.j41(12,"div"),e.EFF(13,"Y"),e.k0s(),e.j41(14,"div"),e.EFF(15,"K"),e.k0s(),e.DNE(16,mo,2,0,"div",38),e.k0s()()}if(2&s){const t=e.XpG();e.xc7("display",3!==t.format?"none":"block"),e.R7$(2),e.Y8G("rg",100)("value",null==t.cmykText?null:t.cmykText.c),e.R7$(),e.Y8G("rg",100)("value",null==t.cmykText?null:t.cmykText.m),e.R7$(),e.Y8G("rg",100)("value",null==t.cmykText?null:t.cmykText.y),e.R7$(),e.Y8G("rg",100)("value",null==t.cmykText?null:t.cmykText.k),e.R7$(),e.Y8G("ngIf","disabled"!==t.cpAlphaChannel),e.R7$(10),e.Y8G("ngIf","disabled"!==t.cpAlphaChannel)}}function bo(s,a){if(1&s){const t=e.RV6();e.j41(0,"input",39),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAlphaInput(n))}),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("rg",1)("value",null==t.hslaText?null:t.hslaText.a)}}function go(s,a){1&s&&(e.j41(0,"div"),e.EFF(1,"A"),e.k0s())}function Co(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",40)(1,"div",35)(2,"input",41),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onHueInput(n))}),e.k0s(),e.j41(3,"input",36),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onSaturationInput(n))}),e.k0s(),e.j41(4,"input",36),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onLightnessInput(n))}),e.k0s(),e.DNE(5,bo,1,2,"input",37),e.k0s(),e.j41(6,"div",35)(7,"div"),e.EFF(8,"H"),e.k0s(),e.j41(9,"div"),e.EFF(10,"S"),e.k0s(),e.j41(11,"div"),e.EFF(12,"L"),e.k0s(),e.DNE(13,go,2,0,"div",38),e.k0s()()}if(2&s){const t=e.XpG();e.xc7("display",2!==t.format?"none":"block"),e.R7$(2),e.Y8G("rg",360)("value",null==t.hslaText?null:t.hslaText.h),e.R7$(),e.Y8G("rg",100)("value",null==t.hslaText?null:t.hslaText.s),e.R7$(),e.Y8G("rg",100)("value",null==t.hslaText?null:t.hslaText.l),e.R7$(),e.Y8G("ngIf","disabled"!==t.cpAlphaChannel),e.R7$(8),e.Y8G("ngIf","disabled"!==t.cpAlphaChannel)}}function vo(s,a){if(1&s){const t=e.RV6();e.j41(0,"input",39),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAlphaInput(n))}),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("rg",1)("value",null==t.rgbaText?null:t.rgbaText.a)}}function _o(s,a){1&s&&(e.j41(0,"div"),e.EFF(1,"A"),e.k0s())}function ko(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",42)(1,"div",35)(2,"input",43),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onRedInput(n))}),e.k0s(),e.j41(3,"input",43),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onGreenInput(n))}),e.k0s(),e.j41(4,"input",43),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onBlueInput(n))}),e.k0s(),e.DNE(5,vo,1,2,"input",37),e.k0s(),e.j41(6,"div",35)(7,"div"),e.EFF(8,"R"),e.k0s(),e.j41(9,"div"),e.EFF(10,"G"),e.k0s(),e.j41(11,"div"),e.EFF(12,"B"),e.k0s(),e.DNE(13,_o,2,0,"div",38),e.k0s()()}if(2&s){const t=e.XpG();e.xc7("display",1!==t.format?"none":"block"),e.R7$(2),e.Y8G("rg",255)("value",null==t.rgbaText?null:t.rgbaText.r),e.R7$(),e.Y8G("rg",255)("value",null==t.rgbaText?null:t.rgbaText.g),e.R7$(),e.Y8G("rg",255)("value",null==t.rgbaText?null:t.rgbaText.b),e.R7$(),e.Y8G("ngIf","disabled"!==t.cpAlphaChannel),e.R7$(8),e.Y8G("ngIf","disabled"!==t.cpAlphaChannel)}}function xo(s,a){if(1&s){const t=e.RV6();e.j41(0,"input",39),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAlphaInput(n))}),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("rg",1)("value",t.hexAlpha)}}function To(s,a){1&s&&(e.j41(0,"div"),e.EFF(1,"A"),e.k0s())}function yo(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",44)(1,"div",35)(2,"input",45),e.bIt("blur",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onHexInput(null))})("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onHexInput(n))}),e.k0s(),e.DNE(3,xo,1,2,"input",37),e.k0s(),e.j41(4,"div",35)(5,"div"),e.EFF(6,"Hex"),e.k0s(),e.DNE(7,To,2,0,"div",38),e.k0s()()}if(2&s){const t=e.XpG();e.xc7("display",0!==t.format?"none":"block"),e.AVh("hex-alpha","forced"===t.cpAlphaChannel),e.R7$(2),e.Y8G("value",t.hexText),e.R7$(),e.Y8G("ngIf","forced"===t.cpAlphaChannel),e.R7$(4),e.Y8G("ngIf","forced"===t.cpAlphaChannel)}}function jo(s,a){if(1&s){const t=e.RV6();e.j41(0,"input",39),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAlphaInput(n))}),e.k0s()}if(2&s){const t=e.XpG(2);e.Y8G("rg",1)("value",null==t.hslaText?null:t.hslaText.a)}}function So(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",46)(1,"div",35)(2,"input",36),e.bIt("keyup.enter",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onAcceptColor(n))})("newValue",function(n){e.eBV(t);const i=e.XpG();return e.Njj(i.onValueInput(n))}),e.k0s(),e.DNE(3,jo,1,2,"input",37),e.k0s(),e.j41(4,"div",35)(5,"div"),e.EFF(6,"V"),e.k0s(),e.j41(7,"div"),e.EFF(8,"A"),e.k0s()()()}if(2&s){const t=e.XpG();e.R7$(2),e.Y8G("rg",100)("value",null==t.hslaText?null:t.hslaText.l),e.R7$(),e.Y8G("ngIf","disabled"!==t.cpAlphaChannel)}}function Ao(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",47)(1,"span",48),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onFormatToggle(-1))}),e.k0s(),e.j41(2,"span",48),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.onFormatToggle(1))}),e.k0s()()}}function Io(s,a){if(1&s){const t=e.RV6();e.j41(0,"span",55),e.bIt("click",function(n){e.eBV(t);const i=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onRemovePresetColor(n,i))}),e.k0s()}if(2&s){const t=e.XpG(4);e.HbH(t.cpRemoveColorButtonClass)}}function wo(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",53),e.bIt("click",function(){const n=e.eBV(t).$implicit,i=e.XpG(3);return e.Njj(i.setColorFromString(n))}),e.DNE(1,Io,1,3,"span",54),e.k0s()}if(2&s){const t=a.$implicit,o=e.XpG(3);e.xc7("background-color",t),e.R7$(),e.Y8G("ngIf",o.cpAddColorButton)}}function Ro(s,a){if(1&s&&(e.j41(0,"div"),e.DNE(1,wo,2,3,"div",52),e.k0s()),2&s){const t=e.XpG(2);e.HbH(t.cpPresetColorsClass),e.R7$(),e.Y8G("ngForOf",t.cpPresetColors)}}function Fo(s,a){if(1&s&&(e.j41(0,"div"),e.EFF(1),e.k0s()),2&s){const t=e.XpG(2);e.HbH(t.cpPresetEmptyMessageClass),e.R7$(),e.JRh(t.cpPresetEmptyMessage)}}function Eo(s,a){if(1&s&&(e.j41(0,"div",49),e.nrm(1,"hr"),e.j41(2,"div",50),e.EFF(3),e.k0s(),e.DNE(4,Ro,2,4,"div",51)(5,Fo,2,4,"div",51),e.k0s()),2&s){const t=e.XpG();e.R7$(3),e.JRh(t.cpPresetLabel),e.R7$(),e.Y8G("ngIf",null==t.cpPresetColors?null:t.cpPresetColors.length),e.R7$(),e.Y8G("ngIf",!(null!=t.cpPresetColors&&t.cpPresetColors.length)&&t.cpAddColorButton)}}function Mo(s,a){if(1&s){const t=e.RV6();e.j41(0,"button",58),e.bIt("click",function(n){e.eBV(t);const i=e.XpG(2);
1return e.Njj(i.onCancelColor(n))}),e.EFF(1),e.k0s()}if(2&s){const t=e.XpG(2);e.HbH(t.cpCancelButtonClass),e.R7$(),e.JRh(t.cpCancelButtonText)}}function Po(s,a){if(1&s){const t=e.RV6();e.j41(0,"button",58),e.bIt("click",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.onAcceptColor(n))}),e.EFF(1),e.k0s()}if(2&s){const t=e.XpG(2);e.HbH(t.cpOKButtonClass),e.R7$(),e.JRh(t.cpOKButtonText)}}function Bo(s,a){if(1&s&&(e.j41(0,"div",56),e.DNE(1,Mo,2,4,"button",57)(2,Po,2,4,"button",57),e.k0s()),2&s){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.cpCancelButton),e.R7$(),e.Y8G("ngIf",t.cpOKButton)}}function Oo(s,a){1&s&&e.eu8(0)}function Vo(s,a){if(1&s&&(e.j41(0,"div",59),e.DNE(1,Oo,1,0,"ng-container",60),e.k0s()),2&s){const t=e.XpG();e.R7$(),e.Y8G("ngTemplateOutlet",t.cpExtraTemplate)}}var R=function(s){return s[s.HEX=0]="HEX",s[s.RGBA=1]="RGBA",s[s.HSLA=2]="HSLA",s[s.CMYK=3]="CMYK",s}(R||{});class U{r;g;b;a;constructor(a,t,o,n){this.r=a,this.g=t,this.b=o,this.a=n}}class he{h;s;v;a;constructor(a,t,o,n){this.h=a,this.s=t,this.v=o,this.a=n}}class Q{h;s;l;a;constructor(a,t,o,n){this.h=a,this.s=t,this.l=o,this.a=n}}class re{c;m;y;k;a;constructor(a,t,o,n,i=1){this.c=a,this.m=t,this.y=o,this.k=n,this.a=i}}let No=(()=>{class s{rg;text;newValue=new e.bkB;inputChange(t){const o=t.target.value;if(void 0===this.rg)this.newValue.emit(o);else{const n=parseFloat(o);this.newValue.emit({v:n,rg:this.rg})}}static \u0275fac=function(o){return new(o||s)};static \u0275dir=e.FsC({type:s,selectors:[["","text",""]],hostBindings:function(o,n){1&o&&e.bIt("input",function(r){return n.inputChange(r)})},inputs:{rg:"rg",text:"text"},outputs:{newValue:"newValue"}})}return s})(),Xo=(()=>{class s{elRef;listenerMove;listenerStop;rgX;rgY;slider;dragEnd=new e.bkB;dragStart=new e.bkB;newValue=new e.bkB;mouseDown(t){this.start(t)}touchStart(t){this.start(t)}constructor(t){this.elRef=t,this.listenerMove=o=>this.move(o),this.listenerStop=()=>this.stop()}move(t){t.preventDefault(),this.setCursor(t)}start(t){this.setCursor(t),t.stopPropagation(),document.addEventListener("mouseup",this.listenerStop),document.addEventListener("touchend",this.listenerStop),document.addEventListener("mousemove",this.listenerMove),document.addEventListener("touchmove",this.listenerMove),this.dragStart.emit()}stop(){document.removeEventListener("mouseup",this.listenerStop),document.removeEventListener("touchend",this.listenerStop),document.removeEventListener("mousemove",this.listenerMove),document.removeEventListener("touchmove",this.listenerMove),this.dragEnd.emit()}getX(t){const o=this.elRef.nativeElement.getBoundingClientRect();return(void 0!==t.pageX?t.pageX:t.touches[0].pageX)-o.left-window.pageXOffset}getY(t){const o=this.elRef.nativeElement.getBoundingClientRect();return(void 0!==t.pageY?t.pageY:t.touches[0].pageY)-o.top-window.pageYOffset}setCursor(t){const o=this.elRef.nativeElement.offsetWidth,n=this.elRef.nativeElement.offsetHeight,i=Math.max(0,Math.min(this.getX(t),o)),r=Math.max(0,Math.min(this.getY(t),n));void 0!==this.rgX&&void 0!==this.rgY?this.newValue.emit({s:i/o,v:1-r/n,rgX:this.rgX,rgY:this.rgY}):void 0===this.rgX&&void 0!==this.rgY?this.newValue.emit({v:r/n,rgY:this.rgY}):void 0!==this.rgX&&void 0===this.rgY&&this.newValue.emit({v:i/o,rgX:this.rgX})}static \u0275fac=function(o){return new(o||s)(e.rXU(e.aKT))};static \u0275dir=e.FsC({type:s,selectors:[["","slider",""]],hostBindings:function(o,n){1&o&&e.bIt("mousedown",function(r){return n.mouseDown(r)})("touchstart",function(r){return n.touchStart(r)})},inputs:{rgX:"rgX",rgY:"rgY",slider:"slider"},outputs:{dragEnd:"dragEnd",dragStart:"dragStart",newValue:"newValue"}})}return s})();class Xe{h;s;v;a;constructor(a,t,o,n){this.h=a,this.s=t,this.v=o,this.a=n}}class Ye{h;s;v;a;constructor(a,t,o,n){this.h=a,this.s=t,this.v=o,this.a=n}}let Yo=(()=>{class s{active=null;setActive(t){this.active&&this.active!==t&&"inline"!==this.active.cpDialogDisplay&&this.active.closeDialog(),this.active=t}hsva2hsla(t){const o=t.h,n=t.s,i=t.v,r=t.a;if(0===i)return new Q(o,0,0,r);if(0===n&&1===i)return new Q(o,1,1,r);{const l=i*(2-n)/2;return new Q(o,i*n/(1-Math.abs(2*l-1)),l,r)}}hsla2hsva(t){const o=Math.min(t.h,1),n=Math.min(t.s,1),i=Math.min(t.l,1),r=Math.min(t.a,1);if(0===i)return new he(o,0,0,r);{const l=i+n*(1-Math.abs(2*i-1))/2;return new he(o,2*(l-i)/l,l,r)}}hsvaToRgba(t){let o,n,i;const r=t.h,l=t.s,c=t.v,p=t.a,h=Math.floor(6*r),m=6*r-h,f=c*(1-l),x=c*(1-m*l),S=c*(1-(1-m)*l);switch(h%6){case 0:o=c,n=S,i=f;break;case 1:o=x,n=c,i=f;break;case 2:o=f,n=c,i=S;break;case 3:o=f,n=x,i=c;break;case 4:o=S,n=f,i=c;break;case 5:o=c,n=f,i=x;break;default:o=0,n=0,i=0}return new U(o,n,i,p)}cmykToRgb(t){return new U((1-t.c)*(1-t.k),(1-t.m)*(1-t.k),(1-t.y)*(1-t.k),t.a)}rgbaToCmyk(t){const o=1-Math.max(t.r,t.g,t.b);return 1===o?new re(0,0,0,1,t.a):new re((1-t.r-o)/(1-o),(1-t.g-o)/(1-o),(1-t.b-o)/(1-o),o,t.a)}rgbaToHsva(t){let o,n;const i=Math.min(t.r,1),r=Math.min(t.g,1),l=Math.min(t.b,1),c=Math.min(t.a,1),p=Math.max(i,r,l),h=Math.min(i,r,l),m=p,f=p-h;if(n=0===p?0:f/p,p===h)o=0;else{switch(p){case i:o=(r-l)/f+(r<l?6:0);break;case r:o=(l-i)/f+2;break;case l:o=(i-r)/f+4;break;default:o=0}o/=6}return new he(o,n,m,c)}rgbaToHex(t,o){let n="#"+(16777216|t.r<<16|t.g<<8|t.b).toString(16).substr(1);return o&&(n+=(256|Math.round(255*t.a)).toString(16).substr(1)),n}normalizeCMYK(t){return new re(t.c/100,t.m/100,t.y/100,t.k/100,t.a)}denormalizeCMYK(t){return new re(Math.floor(100*t.c),Math.floor(100*t.m),Math.floor(100*t.y),Math.floor(100*t.k),t.a)}denormalizeRGBA(t){return new U(Math.round(255*t.r),Math.round(255*t.g),Math.round(255*t.b),t.a)}stringToHsva(t="",o=!1){let n=null;t=(t||"").toLowerCase();const i=[{re:/(rgb)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*%?,\s*(\d{1,3})\s*%?(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(r){return new U(parseInt(r[2],10)/255,parseInt(r[3],10)/255,parseInt(r[4],10)/255,isNaN(parseFloat(r[5]))?1:parseFloat(r[5]))}},{re:/(hsl)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(r){return new Q(parseInt(r[2],10)/360,parseInt(r[3],10)/100,parseInt(r[4],10)/100,isNaN(parseFloat(r[5]))?1:parseFloat(r[5]))}}];i.push(o?{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})?$/,parse:function(r){return new U(parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255,parseInt(r[4]||"FF",16)/255)}}:{re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,parse:function(r){return new U(parseInt(r[1],16)/255,parseInt(r[2],16)/255,parseInt(r[3],16)/255,1)}}),i.push({re:/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,parse:function(r){return new U(parseInt(r[1]+r[1],16)/255,parseInt(r[2]+r[2],16)/255,parseInt(r[3]+r[3],16)/255,1)}});for(const r in i)if(i.hasOwnProperty(r)){const l=i[r],c=l.re.exec(t),p=c&&l.parse(c);
1if(p)return p instanceof U?n=this.rgbaToHsva(p):p instanceof Q&&(n=this.hsla2hsva(p)),n}return n}outputFormat(t,o,n){switch("auto"===o&&(o=t.a<1?"rgba":"hex"),o){case"hsla":const i=this.hsva2hsla(t),r=new Q(Math.round(360*i.h),Math.round(100*i.s),Math.round(100*i.l),Math.round(100*i.a)/100);return t.a<1||"always"===n?"hsla("+r.h+","+r.s+"%,"+r.l+"%,"+r.a+")":"hsl("+r.h+","+r.s+"%,"+r.l+"%)";case"rgba":const l=this.denormalizeRGBA(this.hsvaToRgba(t));return t.a<1||"always"===n?"rgba("+l.r+","+l.g+","+l.b+","+Math.round(100*l.a)/100+")":"rgb("+l.r+","+l.g+","+l.b+")";default:const c="always"===n||"forced"===n;return this.rgbaToHex(this.denormalizeRGBA(this.hsvaToRgba(t)),c)}}static \u0275fac=function(o){return new(o||s)};static \u0275prov=e.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();const ze=typeof window<"u"&&"ontouchstart"in window;let zo=(()=>{class s{ngZone;elRef;cdRef;document;platformId;service;isIE10=!1;cmyk;hsva;width;height;cmykColor;outputColor;initialColor;fallbackColor;listenerResize;listenerMouseDown;directiveInstance;sliderH;sliderDimMax;directiveElementRef;dialogArrowSize=10;dialogArrowOffset=15;dialogInputFields=[R.HEX,R.RGBA,R.HSLA,R.CMYK];useRootViewContainer=!1;show;hidden;top;left;position;format;slider;hexText;hexAlpha;cmykText;hslaText;rgbaText;arrowTop;selectedColor;hueSliderColor;alphaSliderColor;cpWidth;cpHeight;cpColorMode;cpCmykEnabled;cpAlphaChannel;cpOutputFormat;cpDisableInput;cpDialogDisplay;cpIgnoredElements;cpSaveClickOutside;cpCloseClickOutside;cpPosition;cpUsePosition;cpPositionOffset;cpOKButton;cpOKButtonText;cpOKButtonClass;cpCancelButton;cpCancelButtonText;cpCancelButtonClass;cpEyeDropper;eyeDropperSupported;cpPresetLabel;cpPresetColors;cpPresetColorsClass;cpMaxPresetColorsLength;cpPresetEmptyMessage;cpPresetEmptyMessageClass;cpAddColorButton;cpAddColorButtonText;cpAddColorButtonClass;cpRemoveColorButtonClass;cpArrowPosition;cpTriggerElement;cpExtraTemplate;dialogElement;hueSlider;alphaSlider;handleEsc(t){this.show&&"popup"===this.cpDialogDisplay&&this.onCancelColor(t)}handleEnter(t){this.show&&"popup"===this.cpDialogDisplay&&this.onAcceptColor(t)}constructor(t,o,n,i,r,l){this.ngZone=t,this.elRef=o,this.cdRef=n,this.document=i,this.platformId=r,this.service=l,this.eyeDropperSupported=(0,oo.UE)(this.platformId)&&"EyeDropper"in this.document.defaultView}ngOnInit(){this.slider=new Xe(0,0,0,0),this.sliderDimMax=new Ye(this.hueSlider.nativeElement.offsetWidth||140,this.cpWidth,130,this.alphaSlider.nativeElement.offsetWidth||140),this.format=this.cpCmykEnabled?R.CMYK:"rgba"===this.cpOutputFormat?R.RGBA:"hsla"===this.cpOutputFormat?R.HSLA:R.HEX,this.listenerMouseDown=n=>{this.onMouseDown(n)},this.listenerResize=()=>{this.onResize()},this.openDialog(this.initialColor,!1)}ngOnDestroy(){this.closeDialog()}ngAfterViewInit(){230===this.cpWidth&&"inline"!==this.cpDialogDisplay||(this.sliderDimMax=new Ye(this.hueSlider.nativeElement.offsetWidth||140,this.cpWidth,130,this.alphaSlider.nativeElement.offsetWidth||140),this.updateColorPicker(!1),this.cdRef.detectChanges())}openDialog(t,o=!0){this.service.setActive(this),this.width||(this.cpWidth=this.directiveElementRef.nativeElement.offsetWidth),this.height||(this.height=320),this.setInitialColor(t),this.setColorFromString(t,o),this.openColorPicker()}closeDialog(){this.closeColorPicker()}setupDialog(t,o,n,i,r,l,c,p,h,m,f,x,S,H,k,A,K,b,v,F,E,L,oe,ae,Ae,Fn,En,Mn,Pn,Bn,On,Vn,Gn,Dn,Nn,Xn,Yn,zn){this.setInitialColor(n),this.setColorMode(p),this.isIE10=10===function Do(){let s="";typeof navigator<"u"&&(s=navigator.userAgent.toLowerCase());const a=s.indexOf("msie ");return a>0&&parseInt(s.substring(a+5,s.indexOf(".",a)),10)}(),this.directiveInstance=t,this.directiveElementRef=o,this.cpDisableInput=x,this.cpCmykEnabled=h,this.cpAlphaChannel=m,this.cpOutputFormat=f,this.cpDialogDisplay=l,this.cpIgnoredElements=S,this.cpSaveClickOutside=H,this.cpCloseClickOutside=k,this.useRootViewContainer=A,this.width=this.cpWidth=parseInt(i,10),this.height=this.cpHeight=parseInt(r,10),this.cpPosition=K,this.cpPositionOffset=parseInt(b,10),this.cpOKButton=Fn,this.cpOKButtonText=Mn,this.cpOKButtonClass=En,this.cpCancelButton=Pn,this.cpCancelButtonText=On,this.cpCancelButtonClass=Bn,this.cpEyeDropper=Xn,this.fallbackColor=c||"#fff",this.setPresetConfig(F,E),this.cpPresetColorsClass=L,this.cpMaxPresetColorsLength=oe,this.cpPresetEmptyMessage=ae,this.cpPresetEmptyMessageClass=Ae,this.cpAddColorButton=Vn,this.cpAddColorButtonText=Dn,this.cpAddColorButtonClass=Gn,this.cpRemoveColorButtonClass=Nn,this.cpTriggerElement=Yn,this.cpExtraTemplate=zn,v||(this.dialogArrowOffset=0),"inline"===l&&(this.dialogArrowSize=0,this.dialogArrowOffset=0),"hex"===f&&"always"!==m&&"forced"!==m&&(this.cpAlphaChannel="disabled")}setColorMode(t){switch(t.toString().toUpperCase()){case"1":case"C":case"COLOR":default:this.cpColorMode=1;break;case"2":case"G":case"GRAYSCALE":this.cpColorMode=2;break;case"3":case"P":case"PRESETS":this.cpColorMode=3}}setInitialColor(t){this.initialColor=t}setPresetConfig(t,o){this.cpPresetLabel=t,this.cpPresetColors=o}setColorFromString(t,o=!0,n=!0){let i;"always"===this.cpAlphaChannel||"forced"===this.cpAlphaChannel?(i=this.service.stringToHsva(t,!0),!i&&!this.hsva&&(i=this.service.stringToHsva(t,!1))):i=this.service.stringToHsva(t,!1),!i&&!this.hsva&&(i=this.service.stringToHsva(this.fallbackColor,!1)),i&&(this.hsva=i,this.sliderH=this.hsva.h,"hex"===this.cpOutputFormat&&"disabled"===this.cpAlphaChannel&&(this.hsva.a=1),this.updateColorPicker(o,n))}onResize(){"fixed"===this.position?this.setDialogPosition():"inline"!==this.cpDialogDisplay&&this.closeColorPicker()}onDragEnd(t){this.directiveInstance.sliderDragEnd({slider:t,color:this.outputColor})}onDragStart(t){this.directiveInstance.sliderDragStart({slider:t,color:this.outputColor})}onMouseDown(t){this.show&&!this.isIE10&&"popup"===this.cpDialogDisplay&&t.target!==this.directiveElementRef.nativeElement&&!this.isDescendant(this.elRef.nativeElement,t.target)&&!this.isDescendant(this.directiveElementRef.nativeElement,t.target)&&0===this.cpIgnoredElements.filter(o=>o===t.target).length&&this.ngZone.run(()=>{this.cpSaveClickOutside?this.directiveInstance.colorSelected(this.outputColor):(this.hsva=null,this.setColorFromString(this.initialColor,!1),this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.initialColor),this.directiveInstance.colorCanceled()),this.cpCloseClickOutside&&this.closeColorPicker()})}onAcceptColor(t){t.stopPropagation(),this.outputColor&&this.directiveInstance.colorSelected(this.outputColor),"popup"===this.cpDialogDisplay&&this.closeColorPicker()}
1onCancelColor(t){this.hsva=null,t.stopPropagation(),this.directiveInstance.colorCanceled(),this.setColorFromString(this.initialColor,!0),"popup"===this.cpDialogDisplay&&(this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.initialColor,!0),this.closeColorPicker())}onEyeDropper(){this.eyeDropperSupported&&(new window.EyeDropper).open().then(o=>{this.setColorFromString(o.sRGBHex,!0)})}onFormatToggle(t){const o=this.dialogInputFields.length-(this.cpCmykEnabled?0:1),n=((this.dialogInputFields.indexOf(this.format)+t)%o+o)%o;this.format=this.dialogInputFields[n]}onColorChange(t){this.hsva.s=t.s/t.rgX,this.hsva.v=t.v/t.rgY,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"lightness",value:this.hsva.v,color:this.outputColor}),this.directiveInstance.sliderChanged({slider:"saturation",value:this.hsva.s,color:this.outputColor})}onHueChange(t){this.hsva.h=t.v/t.rgX,this.sliderH=this.hsva.h,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"hue",value:this.hsva.h,color:this.outputColor})}onValueChange(t){this.hsva.v=t.v/t.rgX,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"value",value:this.hsva.v,color:this.outputColor})}onAlphaChange(t){this.hsva.a=t.v/t.rgX,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"alpha",value:this.hsva.a,color:this.outputColor})}onHexInput(t){if(null===t)this.updateColorPicker();else{t&&"#"!==t[0]&&(t="#"+t);let o=/^#([a-f0-9]{3}|[a-f0-9]{6})$/gi;"always"===this.cpAlphaChannel&&(o=/^#([a-f0-9]{3}|[a-f0-9]{6}|[a-f0-9]{8})$/gi);const n=o.test(t);n&&(t.length<5&&(t="#"+t.substring(1).split("").map(i=>i+i).join("")),"forced"===this.cpAlphaChannel&&(t+=Math.round(255*this.hsva.a).toString(16)),this.setColorFromString(t,!0,!1)),this.directiveInstance.inputChanged({input:"hex",valid:n,value:t,color:this.outputColor})}}onRedInput(t){const o=this.service.hsvaToRgba(this.hsva),n=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;n&&(o.r=t.v/t.rg,this.hsva=this.service.rgbaToHsva(o),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"red",valid:n,value:o.r,color:this.outputColor})}onBlueInput(t){const o=this.service.hsvaToRgba(this.hsva),n=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;n&&(o.b=t.v/t.rg,this.hsva=this.service.rgbaToHsva(o),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"blue",valid:n,value:o.b,color:this.outputColor})}onGreenInput(t){const o=this.service.hsvaToRgba(this.hsva),n=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;n&&(o.g=t.v/t.rg,this.hsva=this.service.rgbaToHsva(o),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"green",valid:n,value:o.g,color:this.outputColor})}onHueInput(t){const o=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;o&&(this.hsva.h=t.v/t.rg,this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"hue",valid:o,value:this.hsva.h,color:this.outputColor})}onValueInput(t){const o=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;o&&(this.hsva.v=t.v/t.rg,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"value",valid:o,value:this.hsva.v,color:this.outputColor})}onAlphaInput(t){const o=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;o&&(this.hsva.a=t.v/t.rg,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"alpha",valid:o,value:this.hsva.a,color:this.outputColor})}onLightnessInput(t){const o=this.service.hsva2hsla(this.hsva),n=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;n&&(o.l=t.v/t.rg,this.hsva=this.service.hsla2hsva(o),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"lightness",valid:n,value:o.l,color:this.outputColor})}onSaturationInput(t){const o=this.service.hsva2hsla(this.hsva),n=!isNaN(t.v)&&t.v>=0&&t.v<=t.rg;n&&(o.s=t.v/t.rg,this.hsva=this.service.hsla2hsva(o),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"saturation",valid:n,value:o.s,color:this.outputColor})}onCyanInput(t){!isNaN(t.v)&&t.v>=0&&t.v<=t.rg&&(this.cmyk.c=t.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"cyan",valid:!0,value:this.cmyk.c,color:this.outputColor})}onMagentaInput(t){!isNaN(t.v)&&t.v>=0&&t.v<=t.rg&&(this.cmyk.m=t.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"magenta",valid:!0,value:this.cmyk.m,color:this.outputColor})}onYellowInput(t){!isNaN(t.v)&&t.v>=0&&t.v<=t.rg&&(this.cmyk.y=t.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"yellow",valid:!0,value:this.cmyk.y,color:this.outputColor})}onBlackInput(t){!isNaN(t.v)&&t.v>=0&&t.v<=t.rg&&(this.cmyk.k=t.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"black",valid:!0,value:this.cmyk.k,color:this.outputColor})}onAddPresetColor(t,o){t.stopPropagation(),this.cpPresetColors.filter(n=>n===o).length||(this.cpPresetColors=this.cpPresetColors.concat(o),this.directiveInstance.presetColorsChanged(this.cpPresetColors))}onRemovePresetColor(t,o){t.stopPropagation(),this.cpPresetColors=this.cpPresetColors.filter(n=>n!==o),this.directiveInstance.presetColorsChanged(this.cpPresetColors)}openColorPicker(){this.show||(this.show=!0,this.hidden=!0,setTimeout(()=>{this.hidden=!1,this.setDialogPosition(),this.cdRef.detectChanges()},0),this.directiveInstance.stateChanged(!0),this.isIE10||this.ngZone.runOutsideAngular(()=>{ze?document.addEventListener("touchstart",this.listenerMouseDown):document.addEventListener("mousedown",this.listenerMouseDown)}),window.addEventListener("resize",this.listenerResize))}closeColorPicker(){this.show&&(this.show=!1,this.directiveInstance.stateChanged(!1),this.isIE10||(ze?document.removeEventListener("touchstart",this.listenerMouseDown):document.removeEventListener("mousedown",this.listenerMouseDown)),window.removeEventListener("resize",this.listenerResize),this.cdRef.destroyed||this.cdRef.detectChanges())}updateColorPicker(t=!0,o=!0,n=!1){if(this.sliderDimMax){let i,r,l;2===this.cpColorMode&&(this.hsva.s=0);const c=this.outputColor;if(r=this.service.hsva2hsla(this.hsva),this.cpCmykEnabled?(n?(l=this.service.cmykToRgb(this.service.n
1ormalizeCMYK(this.cmyk)),this.hsva=this.service.rgbaToHsva(l)):(l=this.service.hsvaToRgba(this.hsva),this.cmyk=this.service.denormalizeCMYK(this.service.rgbaToCmyk(l))),l=this.service.denormalizeRGBA(l),this.sliderH=this.hsva.h):l=this.service.denormalizeRGBA(this.service.hsvaToRgba(this.hsva)),i=this.service.denormalizeRGBA(this.service.hsvaToRgba(new he(this.sliderH||this.hsva.h,1,1,1))),o&&(this.hslaText=new Q(Math.round(360*r.h),Math.round(100*r.s),Math.round(100*r.l),Math.round(100*r.a)/100),this.rgbaText=new U(l.r,l.g,l.b,Math.round(100*l.a)/100),this.cpCmykEnabled&&(this.cmykText=new re(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k,Math.round(100*this.cmyk.a)/100)),this.hexText=this.service.rgbaToHex(l,"always"===this.cpAlphaChannel),this.hexAlpha=this.rgbaText.a),"auto"===this.cpOutputFormat&&this.format!==R.RGBA&&this.format!==R.CMYK&&this.format!==R.HSLA&&this.hsva.a<1&&(this.format=this.hsva.a<1?R.RGBA:R.HEX),this.hueSliderColor="rgb("+i.r+","+i.g+","+i.b+")",this.alphaSliderColor="rgb("+l.r+","+l.g+","+l.b+")",this.outputColor=this.service.outputFormat(this.hsva,this.cpOutputFormat,this.cpAlphaChannel),this.selectedColor=this.service.outputFormat(this.hsva,"rgba",null),this.format!==R.CMYK)this.cmykColor="";else if("always"===this.cpAlphaChannel||"enabled"===this.cpAlphaChannel||"forced"===this.cpAlphaChannel){const p=Math.round(100*this.cmyk.a)/100;this.cmykColor=`cmyka(${this.cmyk.c},${this.cmyk.m},${this.cmyk.y},${this.cmyk.k},${p})`}else this.cmykColor=`cmyk(${this.cmyk.c},${this.cmyk.m},${this.cmyk.y},${this.cmyk.k})`;this.slider=new Xe((this.sliderH||this.hsva.h)*this.sliderDimMax.h-8,this.hsva.s*this.sliderDimMax.s-8,(1-this.hsva.v)*this.sliderDimMax.v-8,this.hsva.a*this.sliderDimMax.a-8),t&&c!==this.outputColor&&(this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.outputColor))}}setDialogPosition(){if("inline"===this.cpDialogDisplay)this.position="relative";else{let n,t="static",o="",i=null,r=null,l=this.directiveElementRef.nativeElement.parentNode;const c=this.dialogElement.nativeElement.offsetHeight;for(;null!==l&&"HTML"!==l.tagName;){if(n=window.getComputedStyle(l),t=n.getPropertyValue("position"),o=n.getPropertyValue("transform"),"static"!==t&&null===i&&(i=l),o&&"none"!==o&&null===r&&(r=l),"fixed"===t){i=r;break}l=l.parentNode}const p=this.createDialogBox(this.directiveElementRef.nativeElement,"fixed"!==t);if(this.useRootViewContainer||"fixed"===t&&(!i||i instanceof HTMLUnknownElement))this.top=p.top,this.left=p.left;else{null===i&&(i=l);const A=this.createDialogBox(i,"fixed"!==t);this.top=p.top-A.top,this.left=p.left-A.left}"fixed"===t&&(this.position="fixed");let h=this.cpPosition;const m=this.dialogElement.nativeElement.getBoundingClientRect();switch("auto"===this.cpPosition&&(h=function Go(s,a){let t="right",o="bottom";const{height:n,width:i}=s,{top:r,left:l}=a,c=r+a.height,p=l+a.width,h=r-n<0,m=c+n>(window.innerHeight||document.documentElement.clientHeight),f=l-i<0,x=p+i>(window.innerWidth||document.documentElement.clientWidth);return m&&(o="top"),h&&(o="bottom"),f&&(t="right"),x&&(t="left"),h&&m&&f&&x?["left","right","top","bottom"].reduce((k,A)=>s[k]>s[A]?k:A):f&&x?h?"bottom":m||r>c?"top":"bottom":h&&m?f?"right":x||l>p?"left":"right":`${o}-${t}`}(m,this.cpTriggerElement.nativeElement.getBoundingClientRect())),this.arrowTop="top"===h?c-1:void 0,this.cpArrowPosition=void 0,h){case"top":this.top-=c+this.dialogArrowSize,this.left+=this.cpPositionOffset/100*p.width-this.dialogArrowOffset;break;case"bottom":this.top+=p.height+this.dialogArrowSize,this.left+=this.cpPositionOffset/100*p.width-this.dialogArrowOffset;break;case"top-left":case"left-top":this.top-=c-p.height+p.height*this.cpPositionOffset/100,this.left-=this.cpWidth+this.dialogArrowSize-2-this.dialogArrowOffset;break;case"top-right":case"right-top":this.top-=c-p.height+p.height*this.cpPositionOffset/100,this.left+=p.width+this.dialogArrowSize-2-this.dialogArrowOffset;break;case"left":case"bottom-left":case"left-bottom":this.top+=p.height*this.cpPositionOffset/100-this.dialogArrowOffset,this.left-=this.cpWidth+this.dialogArrowSize-2;break;default:this.top+=p.height*this.cpPositionOffset/100-this.dialogArrowOffset,this.left+=p.width+this.dialogArrowSize-2}const f=window.innerHeight,x=window.innerWidth,S=this.elRef.nativeElement.getBoundingClientRect();this.top+m.height>f&&(this.top=f-m.height,this.cpArrowPosition=S.x/2-20),this.left+m.width>x&&(this.left=x-m.width,this.cpArrowPosition=S.x/2-20),this.cpUsePosition=h}}isDescendant(t,o){let n=o.parentNode;for(;null!==n;){if(n===t)return!0;n=n.parentNode}return!1}createDialogBox(t,o){const{top:n,left:i}=t.getBoundingClientRect();return{top:n+(o?window.pageYOffset:0),left:i+(o?window.pageXOffset:0),width:t.offsetWidth,height:t.offsetHeight}}static \u0275fac=function(o){return new(o||s)(e.rXU(e.SKi),e.rXU(e.aKT),e.rXU(e.gRc),e.rXU(no.q),e.rXU(e.Agw),e.rXU(Yo))};static \u0275cmp=e.VBU({type:s,selectors:[["color-picker"]],viewQuery:function(o,n){if(1&o&&(e.GBs(io,7),e.GBs(so,7),e.GBs(ro,7)),2&o){let i;e.mGM(i=e.lsd())&&(n.dialogElement=i.first),e.mGM(i=e.lsd())&&(n.hueSlider=i.first),e.mGM(i=e.lsd())&&(n.alphaSlider=i.first)}},hostBindings:function(o,n){1&o&&e.bIt("keyup.esc",function(r){return n.handleEsc(r)},!1,e.EBC)("keyup.enter",function(r){return n.handleEnter(r)},!1,e.EBC)},decls:30,vars:51,consts:[["dialogPopup",""],["hueSlider",""],["valueSlider",""],["alphaSl
1ider",""],[1,"color-picker",3,"click"],[3,"left","class","top",4,"ngIf"],["class","saturation-lightness",3,"slider","rgX","rgY","background-color","newValue","dragStart","dragEnd",4,"ngIf"],[1,"hue-alpha","box"],[1,"left"],[1,"selected-color-background"],[1,"selected-color",3,"click"],["class","eyedropper-icon","xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#000000",4,"ngIf"],["type","button",3,"class","disabled","click",4,"ngIf"],[1,"right"],["style","height: 16px;",4,"ngIf"],[1,"hue",3,"newValue","dragStart","dragEnd","slider","rgX"],[1,"cursor"],[1,"value",3,"newValue","dragStart","dragEnd","slider","rgX"],[1,"alpha",3,"newValue","dragStart","dragEnd","slider","rgX"],["class","cmyk-text",3,"display",4,"ngIf"],["class","hsla-text",3,"display",4,"ngIf"],["class","rgba-text",3,"display",4,"ngIf"],["class","hex-text",3,"hex-alpha","display",4,"ngIf"],["class","value-text",4,"ngIf"],["class","type-policy",4,"ngIf"],["class","preset-area",4,"ngIf"],["class","button-area",4,"ngIf"],["class","extra-template",4,"ngIf"],[1,"saturation-lightness",3,"newValue","dragStart","dragEnd","slider","rgX","rgY"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#000000",1,"eyedropper-icon"],["d","M0 0h24v24H0V0z","fill","none"],["d","M17.66 5.41l.92.92-2.69 2.69-.92-.92 2.69-2.69M17.67 3c-.26 0-.51.1-.71.29l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42l-2.34-2.34c-.2-.19-.45-.29-.7-.29zM6.92 19L5 17.08l8.06-8.06 1.92 1.92L6.92 19z"],["type","button",3,"click","disabled"],[2,"height","16px"],[1,"cmyk-text"],[1,"box"],["type","number","pattern","[0-9]*","min","0","max","100",3,"keyup.enter","newValue","text","rg","value"],["type","number","pattern","[0-9]+([\\.,][0-9]{1,2})?","min","0","max","1","step","0.1",3,"text","rg","value","keyup.enter","newValue",4,"ngIf"],[4,"ngIf"],["type","number","pattern","[0-9]+([\\.,][0-9]{1,2})?","min","0","max","1","step","0.1",3,"keyup.enter","newValue","text","rg","value"],[1,"hsla-text"],["type","number","pattern","[0-9]*","min","0","max","360",3,"keyup.enter","newValue","text","rg","value"],[1,"rgba-text"],["type","number","pattern","[0-9]*","min","0","max","255",3,"keyup.enter","newValue","text","rg","value"],[1,"hex-text"],[3,"blur","keyup.enter","newValue","text","value"],[1,"value-text"],[1,"type-policy"],[1,"type-policy-arrow",3,"click"],[1,"preset-area"],[1,"preset-label"],[3,"class",4,"ngIf"],["class","preset-color",3,"backgroundColor","click",4,"ngFor","ngForOf"],[1,"preset-color",3,"click"],[3,"class","click",4,"ngIf"],[3,"click"],[1,"button-area"],["type","button",3,"class","click",4,"ngIf"],["type","button",3,"click"],[1,"extra-template"],[4,"ngTemplateOutlet"]],template:function(o,n){if(1&o){const i=e.RV6();e.j41(0,"div",4,0),e.bIt("click",function(l){return e.eBV(i),e.Njj(l.stopPropagation())}),e.DNE(2,ao,1,7,"div",5)(3,lo,2,8,"div",6),e.j41(4,"div",7)(5,"div",8),e.nrm(6,"div",9),e.j41(7,"div",10),e.bIt("click",function(){return e.eBV(i),e.Njj(n.eyeDropperSupported&&n.cpEyeDropper&&n.onEyeDropper())}),e.DNE(8,co,3,0,"svg",11),e.k0s(),e.DNE(9,po,2,5,"button",12),e.k0s(),e.j41(10,"div",13),e.DNE(11,uo,1,0,"div",14),e.j41(12,"div",15,1),e.bIt("newValue",function(l){return e.eBV(i),e.Njj(n.onHueChange(l))})("dragStart",function(){return e.eBV(i),e.Njj(n.onDragStart("hue"))})("dragEnd",function(){return e.eBV(i),e.Njj(n.onDragEnd("hue"))}),e.nrm(14,"div",16),e.k0s(),e.j41(15,"div",17,2),e.bIt("newValue",function(l){return e.eBV(i),e.Njj(n.onValueChange(l))})("dragStart",function(){return e.eBV(i),e.Njj(n.onDragStart("value"))})("dragEnd",function(){return e.eBV(i),e.Njj(n.onDragEnd("value"))}),e.nrm(17,"div",16),e.k0s(),e.j41(18,"div",18,3),e.bIt("newValue",function(l){return e.eBV(i),e.Njj(n.onAlphaChange(l))})("dragStart",function(){return e.eBV(i),e.Njj(n.onDragStart("alpha"))})("dragEnd",function(){return e.eBV(i),e.Njj(n.onDragEnd("alpha"))}),e.nrm(20,"div",16),e.k0s()()(),e.DNE(21,fo,17,12,"div",19)(22,Co,14,10,"div",20)(23,ko,14,10,"div",21)(24,yo,8,7,"div",22)(25,So,9,3,"div",23)(26,Ao,3,0,"div",24)(27,Eo,6,3,"div",25)(28,Bo,3,2,"div",26)(29,Vo,2,1,"div",27),e.k0s()}2&o&&(e.xc7("display",n.show?"block":"none")("visibility",n.hidden?"hidden":"visible")("top",n.top,"px")("left",n.left,"px")("position",n.position)("height",n.cpHeight,"px")("width",n.cpWidth,"px"),e.AVh("open",n.show),e.R7$(2),e.Y8G("ngIf","popup"===n.cpDialogDisplay),e.R7$(),e.Y8G("ngIf",1===(n.cpColorMode||1)),e.R7$(4),e.xc7("background-color",n.selectedColor)("cursor",n.eyeDropperSupp
1orted&&n.cpEyeDropper?"pointer":null),e.R7$(),e.Y8G("ngIf",n.eyeDropperSupported&&n.cpEyeDropper),e.R7$(),e.Y8G("ngIf",n.cpAddColorButton),e.R7$(2),e.Y8G("ngIf","disabled"===n.cpAlphaChannel),e.R7$(),e.xc7("display",1===(n.cpColorMode||1)?"block":"none"),e.Y8G("rgX",1),e.R7$(2),e.xc7("left",null==n.slider?null:n.slider.h,"px"),e.R7$(),e.xc7("display",2===(n.cpColorMode||1)?"block":"none"),e.Y8G("rgX",1),e.R7$(2),e.xc7("right",null==n.slider?null:n.slider.v,"px"),e.R7$(),e.xc7("display","disabled"===n.cpAlphaChannel?"none":"block")("background-color",n.alphaSliderColor),e.Y8G("rgX",1),e.R7$(2),e.xc7("left",null==n.slider?null:n.slider.a,"px"),e.R7$(),e.Y8G("ngIf",!n.cpDisableInput&&1===(n.cpColorMode||1)),e.R7$(),e.Y8G("ngIf",!n.cpDisableInput&&1===(n.cpColorMode||1)),e.R7$(),e.Y8G("ngIf",!n.cpDisableInput&&1===(n.cpColorMode||1)),e.R7$(),e.Y8G("ngIf",!n.cpDisableInput&&1===(n.cpColorMode||1)),e.R7$(),e.Y8G("ngIf",!n.cpDisableInput&&2===(n.cpColorMode||1)),e.R7$(),e.Y8G("ngIf",!n.cpDisableInput&&1===(n.cpColorMode||1)),e.R7$(),e.Y8G("ngIf",(null==n.cpPresetColors?null:n.cpPresetColors.length)||n.cpAddColorButton),e.R7$(),e.Y8G("ngIf",n.cpOKButton||n.cpCancelButton),e.R7$(),e.Y8G("ngIf",n.cpExtraTemplate))},dependencies:[Xo,No,j.MD,j.Sq,j.bT,j.T3],styles:['.color-picker{position:absolute;z-index:1000;width:230px;height:auto;border:#777 solid 1px;cursor:default;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff}.color-picker *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;font-size:11px}.color-picker input{width:0;height:26px;min-width:0;font-size:13px;text-align:center;color:#000}.color-picker input:invalid,.color-picker input:-moz-ui-invalid,.color-picker input:-moz-submit-invalid{box-shadow:none}.color-picker input::-webkit-inner-spin-button,.color-picker input::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.color-picker .arrow{position:absolute;z-index:999999;width:0;height:0;border-style:solid}.color-picker .arrow.arrow-top{left:8px;border-width:10px 5px;border-color:#777 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .arrow.arrow-bottom{top:-20px;left:8px;border-width:10px 5px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #777 rgba(0,0,0,0)}.color-picker .arrow.arrow-top-left,.color-picker .arrow.arrow-left-top{right:-21px;bottom:8px;border-width:5px 10px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #777}.color-picker .arrow.arrow-top-right,.color-picker .arrow.arrow-right-top{bottom:8px;left:-20px;border-width:5px 10px;border-color:rgba(0,0,0,0) #777 rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .arrow.arrow-left,.color-picker .arrow.arrow-left-bottom,.color-picker .arrow.arrow-bottom-left{top:8px;right:-21px;border-width:5px 10px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #777}.color-picker .arrow.arrow-right,.color-picker .arrow.arrow-right-bottom,.color-picker .arrow.arrow-bottom-right{top:8px;left:-20px;border-width:5px 10px;border-color:rgba(0,0,0,0) #777 rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .cursor{position:relative;width:16px;height:16px;border:#222 solid 2px;border-radius:50%;cursor:default}.color-picker .box{display:flex;padding:4px 8px}.color-picker .left{position:relative;padding:16px 8px}.color-picker .right{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;padding:12px 8px}.color-picker .button-area{padding:0 16px 16px;text-align:right}.color-picker .button-area button{margin-left:8px}.color-picker .preset-area{padding:4px 15px}.color-picker .preset-area .preset-label{overflow:hidden;width:100%;padding:4px;font-size:11px;white-space:nowrap;text-align:left;text-overflow:ellipsis;color:#555}.color-picker .preset-area .preset-color{position:relative;display:inline-block;width:18px;height:18px;margin:4px 6px 8px;border:#a9a9a9 solid 1px;border-radius:25%;cursor:pointer}.color-picker .preset-area .preset-empty-message{min-height:18px;margin-top:4px;margin-bottom:8px;font-style:italic;text-align:center}.color-picker .hex-text{width:100%;padding:4px 8px;font-size:11px}.color-picker .hex-text .box{padding:0 24px 8px 8px}.color-picker .hex-text .box div{float:left;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center;color:#555;clear:left}.color-picker .hex-text .box input{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;padding:1px;border:#a9a9a9 solid 1px}.color-picker .hex-alpha .box div:first-child,.color-picker .hex-alpha .box input:first-child{flex-grow:3;margin-right:8px}.color-picker .cmyk-text,.color-picker .hsla-text,.color-picker .rgba-text,.color-picker .value-text{width:100%;padding:4px 8px;font-size:11px}.color-picker .cmyk-text .box,.color-picker .hsla-text .box,.color-picker .rgba-text .box{padding:0 24px 8px 8px}.color-picker .value-text .box{padding:0 8px 8px}.color-picker .cmyk-text .box div,.color-picker .hsla-text .box div,.color-picker .rgba-text .box div,.color-picker .value-text .box div{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;margin-right:8px;text-align:center;color:#555}.color-picker .cmyk-text .box div:last-child,.color-picker .hsla-text .box div:last-child,.color-picker .rgba-text .box div:last-child,.color-picker .value-text .box div:last-child{margin-right:0}.color-picker .cmyk-text .box input,.color-picker .hsla-text .box input,.color-picker .rgba-text .box input,.color-picker .value-text .box input{float:left;-webkit-flex:1;-ms-flex:1;flex:1;padding:1px;margin:0 8px 0 0;border:#a9a9a9 solid 1px}.color-picker .cmyk-text .box input:last-child,.color-picker .hsla-text .box input:last-child,.color-picker .rgba-text .box input:last-child,.color-picker .value-text .box input:last-child{margin-right:0}.color-picker .hue-alpha{align-items:center;margin-bottom:3px}.color-picker .hue{direction:ltr;width:100%;height:16px;margin-bottom:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAA
1CXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwkUFWbCCAAAAFxJREFUaN7t0kEKg0AQAME2x83/n2qu5qCgD1iDhCoYdpnbQC9bbY1qVO/jvc6k3ad91s7/7F1/csgPrujuQ17BDYSFsBAWwgJhISyEBcJCWAgLhIWwEBYIi2f7Ar/1TCgFH2X9AAAAAElFTkSuQmCC)}.color-picker .value{direction:rtl;width:100%;height:16px;margin-bottom:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAACTklEQVR42u3SYUcrABhA4U2SkmRJMmWSJklKJiWZZpKUJJskKUmaTFImKZOUzMySpGRmliRNJilJSpKSJEtmSpIpmWmSdO736/6D+x7OP3gUCoWCv1cqlSQlJZGcnExKSgqpqamkpaWRnp5ORkYGmZmZqFQqsrKyyM7OJicnh9zcXNRqNXl5eeTn56PRaCgoKKCwsJCioiK0Wi3FxcWUlJRQWlpKWVkZ5eXlVFRUUFlZiU6no6qqiurqampqaqitraWurg69Xk99fT0GgwGj0UhDQwONjY00NTXR3NxMS0sLra2ttLW10d7ejslkwmw209HRQWdnJ11dXXR3d9PT00Nvby99fX309/czMDDA4OAgFouFoaEhrFYrw8PDjIyMMDo6ytjYGDabjfHxcSYmJpicnGRqagq73c709DQzMzPMzs4yNzfH/Pw8DocDp9OJy+XC7XazsLDA4uIiS0tLLC8vs7KywurqKmtra3g8HrxeLz6fD7/fz/r6OhsbG2xubrK1tcX29jaBQICdnR2CwSC7u7vs7e2xv7/PwcEBh4eHHB0dcXx8zMnJCaenp5ydnXF+fs7FxQWXl5dcXV1xfX3Nzc0Nt7e33N3dEQqFuL+/5+HhgXA4TCQS4fHxkaenJ56fn3l5eeH19ZVoNMrb2xvv7+98fHwQi8WIx+N8fn6SSCT4+vri+/ubn58ffn9/+VcKgSWwBJbAElgCS2AJLIElsASWwBJYAktgCSyBJbAElsASWAJLYAksgSWwBJbAElgCS2AJLIElsP4/WH8AmJ5Z6jHS4h8AAAAASUVORK5CYII=)}.color-picker .alpha{direction:ltr;width:100%;height:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwYQlZMa3gAAAWVJREFUaN7tmEGO6jAQRCsOArHgBpyAJYGjcGocxAm4A2IHpmoWE0eBH+ezmFlNvU06shJ3W6VEelWMUQAIIF9f6qZpimsA1LYtS2uF51/u27YVAFZVRUkEoGHdPV/sIcbIEIIkUdI/9Xa7neyv61+SWFUVAVCSct00TWn2fv6u3+Ecfd3tXzy/0+nEUu+SPjo/kqzrmiQpScN6v98XewfA8/lMkiLJ2WxGSUopcT6fM6U0NX9/frfbjev1WtfrlZfLhYfDQQHG/AIOlnGwjINlHCxjHCzjYJm/TJWdCwquJXseFFzGwDNNeiKMOJTO8xQdDQaeB29+K9efeLaBo9J7vdvtJj1RjFFjfiv7qv95tjx/7leSQgh93e1ffMeIp6O+YQjho/N791t1XVOSSI7N//K+4/GoxWLBx+PB5/Op5XLJ+/3OlJJWqxU3m83ovv5iGf8KjYNlHCxjHCzjYBkHy5gf5gusvQU7U37jTAAAAABJRU5ErkJggg==)}.color-picker .type-policy{position:absolute;top:218px;right:12px;width:16px;height:24px;background-size:8px 16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAgCAYAAAAffCjxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACewAAAnsB01CO3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIASURBVEiJ7ZY9axRRFIafsxMStrLQJpAgpBFhi+C9w1YSo00I6RZ/g9vZpBf/QOr4GyRgkSKNSrAadsZqQGwCkuAWyRZJsySwvhZ7N/vhzrgbLH3Ld8597jlzz50zJokyxXH8DqDVar0qi6v8BbItqSGpEcfxdlmsFWXkvX8AfAVWg3UKPEnT9GKujMzsAFgZsVaCN1VTQd77XUnrgE1kv+6935268WRpzrnHZvYRWC7YvC3pRZZl3wozqtVqiyH9IgjAspkd1Gq1xUJQtVrdB9ZKIAOthdg/Qc65LUk7wNIMoCVJO865rYFhkqjX6/d7vV4GPJwBMqofURS5JEk6FYBer/eeYb/Mo9WwFnPOvQbeAvfuAAK4BN4sAJtAG/gJIElmNuiJyba3EGNmZiPeZuEVmVell/Y/6N+CzDn3AXhEOOo7Hv/3BeAz8IzQkMPnJbuPx1wC+yYJ7/0nYIP5S/0FHKdp+rwCEEXRS/rf5Hl1Gtb2M0iSpCOpCZzPATmX1EySpHMLAsiy7MjMDoHrGSDXZnaYZdnRwBh7J91utwmczAA6CbG3GgPleX4jqUH/a1CktqRGnuc3hSCAMB32gKspkCtgb3KCQMmkjeP4WNJThrNNZval1WptTIsv7JtQ4tmIdRa8qSoEpWl6YWZNoAN0zKxZNPehpLSBZv2t+Q0CJ9lLnARQLAAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-position:center}.color-picker .type-policy .type-policy-arrow{display:block;width:100%;height:50%}.color-picker .selected-color{position:absolute;top:16px;left:8px;width:40px;height:40px;border:1px solid #a9a9a9;border-radius:50%}.color-picker .selected-color-background{width:40px;height:40px;border-radius:50%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAh0lEQVRYR+2W0QlAMQgD60zdfwOdqa8TmI/wQMr5K0I5bZLIzLOa2nt37VVVbd+dDx5obgCC3KBLwJ2ff4PnVidkf+ucIhw80HQaCLo3DMH3CRK3iFsmAWVl6hPNDwt8EvNE5q+YuEXcMgkonVM6SdyCoEvAnZ8v1Hjx817MilmxSUB5rdLJDycZgUAZUch/AAAAAElFTkSuQmCC)}.color-picker .saturation-lightness{direction:ltr;width:100%;height:130px;border:none;cursor:pointer;touch-action:manipulation;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACCCAYAAABSD7T3AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmp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zfwDifz6phT1MPgAAAABJRU5ErkJggg==)}.color-picker .cp-add-color-button-class{position:absolute;display:inline;padding:0;margin:3px -3px;border:0;cursor:pointer;background:transparent}.color-picker .cp-add-color-button-class:hover{text-decoration:underline}.color-picker .cp-add-color-button-class:disabled{cursor:not-allowed;color:#999}.color-picker .cp-add-color-button-class:disabled:hover{text-decoration:none}.color-picker .cp-remove-color-button-class{position:absolute;top:-5px;right:-5px;display:block;width:10px;height:10px;border-radius:50%;cursor:pointer;text-align:center;background:#fff;box-shadow:1px 1px 5px #333}.color-picker .cp-remove-color-button-class:before{content:"x";position:relative;bottom:3.5px;display:inline-block;font-size:10px}.color-picker .eyedropper-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);fill:#fff;mix-blend-mode:exclusion}\n'],encapsulation:2})}return s})();var Ue=u("./apps/manager/src/app/settings/components/color-picker/color-picker.module.ts"),Uo=u("./libs/frontend-checkbox-group/src/index.ts");let Ho=(()=>{var s;class a{static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)},this.\u0275mod=e.$C({type:a}),this.\u0275inj=e.G2t({imports:[zo,_.jr,X.b3,$.oi,_.gx,Re.MQ,fe.nd,d.X1,M.Dn,Uo.R,d.YN,_.uh,_.iZ,$.n8,Fe.K2,le.bv,B.qz,ce.$S,we.m,Be.M,_.$y,Ue.M]}))}return s(),a})();var Lo=u("./node_modules/@angular/cdk/fesm2022/drag-drop.mjs"),Wo=u("./node_modules/rxjs/dist/esm/internal/BehaviorSubject.js"),Ko=u("./node_modules/rxjs/dist/esm/internal/operators/distinctUntilChanged.js"),je=u("./node_modules/rxjs/dist/esm/internal/operators/concatMap.js"),qo=u("./node_modules/rxjs/dist/esm/internal/operators/repeat.js");function Zo(s,a){if(1&s&&(e.j41(0,"div",9)(1,"div",10)(2,"label",32),e.EFF(3,"Services"),e.k0s()(),e.j41(4,"div",12),e.nrm(5,"frontend-dropdown",34),e.k0s()()),2&s){const t=e.XpG(2);e.R7$(5),e.Y8G("items",t.services)("multiple",!0)("clearable",!0)}}function Jo(s,a){if(1&s&&(e.j41(0,"form",7)(1,"div",8)(2,"div",9)(3,"div",10)(4,"label",11),e.EFF(5,"Name *"),e.k0s(),e.j41(6,"p"),e.EFF(7,"The display name for this resource."),e.k0s()(),e.j41(8,"div",12)(9,"div",13),e.nrm(10,"input",14),e.j41(11,"label",15)(12,"em"),e.EFF(13),e.k0s()()(),e.nrm(14,"control-messages",16),e.k0s()(),e.j41(15,"div",9)(16,"div",10)(17,"label",17),e.EFF(18,"Description"),e.k0s()(),e.j41(19,"div",12),e.nrm(20,"textarea",18),e.k0s()(),e.j41(21,"div",19)(22,"div",10)(23,"label",20),e.EFF(24,"Capacity"),e.k0s(),e.j41(25,"p"),e.EFF(26,"The min and max number of people this resource can accommodate."),e.k0s()(),e.j41(27,"div",12)(28,"div",13)(29,"label",21),e.EFF(30,"Min"),e.k0s(),e.nrm(31,"input",22),e.j41(32,"label",23),e.
1EFF(33,"Max"),e.k0s(),e.nrm(34,"input",24),e.k0s()()(),e.j41(35,"div",25)(36,"div",10)(37,"label",26),e.EFF(38,"Public Availability"),e.k0s(),e.j41(39,"p"),e.EFF(40),e.k0s()(),e.j41(41,"div",12)(42,"div",27)(43,"label",28),e.nrm(44,"tablesready-switcher",29),e.EFF(45," Check-In "),e.k0s()(),e.j41(46,"div",27)(47,"label",28),e.nrm(48,"tablesready-switcher",30),e.EFF(49),e.nI1(50,"titlecase"),e.k0s()()()(),e.DNE(51,Zo,6,3,"div",31),e.j41(52,"div",9)(53,"div",10)(54,"label",32),e.EFF(55,"Category"),e.k0s(),e.j41(56,"p"),e.EFF(57,"Used for grouping resources in the display when not using floor plans."),e.k0s()(),e.j41(58,"div",12),e.nrm(59,"frontend-dropdown",33),e.k0s()()()()),2&s){const t=e.XpG();e.Y8G("formGroup",t.resourceForm),e.R7$(10),e.AVh("is-invalid",t.nameControl.invalid&&t.nameControl.touched),e.R7$(3),e.JRh(t.enabledControl.value?"":"Disabled"),e.R7$(),e.Y8G("control",t.nameControl),e.R7$(17),e.AVh("is-invalid",t.capacityMinControl.invalid&&t.capacityMinControl.touched),e.R7$(3),e.AVh("is-invalid",t.capacityMaxControl.invalid&&t.capacityMaxControl.touched),e.R7$(6),e.SpI("Controls whether the public can pick this resource for walk-ins and/or ",t.reservationsLabel,". Internal users can always assign it."),e.R7$(9),e.SpI(" ",e.bMT(50,16,t.reservationsLabel)," "),e.R7$(2),e.Y8G("ngIf",t.services.length),e.R7$(8),e.Y8G("items",t.categories)("addTag",!0)("clearable",!0)("plainValues",!0)}}let Qo=(()=>{var s;class a{constructor(o,n){this.modalController=o,this.fb=n,this.icon=M.z9,this.selectedServices=[],this.subscriptions=new q.yU,this.defaultCapacityValue=1}ngOnInit(){let o=!1;this.title="Add",this.services=this.availableServices,this.resource&&Object.keys(this.resource)?.length>0&&(this.title="Edit",o=!0),o?this.selectedServices=this.services.filter(i=>this.resource.services.includes(i._id)).map(i=>i._id):(this.resource={name:"",enabled:!0,description:"",availability:{waitlist:!0,reservations:!0},capacity:{min:this.defaultCapacityValue,max:this.defaultCapacityValue},category:"",order:this.resourceCount},this.resourceSettings.services.length>0&&(this.selectedServices=this.resourceSettings.services)),this.resourceForm=this.fb.group({name:[this.resource.name,[d.k0.required,d.k0.maxLength(50)]],enabled:[this.resource.enabled],description:[this.resource.description||""],capacity:this.fb.group({min:[this.resource.capacity.min,[d.k0.required,d.k0.min(0),d.k0.max(this.resource.capacity.max)]],max:[this.resource.capacity.max,[d.k0.required,d.k0.min(1)]]}),availability:this.fb.group({waitlist:[this.resource.availability.waitlist],reservations:[this.resource.availability.reservations]}),services:[this.selectedServices||[]],category:[this.resource.category]});const n=this.capacityMaxControl.valueChanges.subscribe(i=>{this.capacityMinControl.clearValidators(),this.capacityMinControl.setValidators([d.k0.required,d.k0.min(0),d.k0.max(i)]),this.capacityMinControl.updateValueAndValidity()});this.subscriptions.add(n)}get nameControl(){return this.resourceForm.get("name")}get enabledControl(){return this.resourceForm.get("enabled")}get capacityMinControl(){return this.resourceForm.get("capacity.min")}get capacityMaxControl(){return this.resourceForm.get("capacity.max")}confirm(o){this.resource._id&&(o._id=this.resource._id),o.category=o.category||"",this.modalController.dismiss(o)}cancel(){this.modalController.dismiss()}ngOnDestroy(){this.subscriptions.unsubscribe()}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(B.ft),e.rXU(d.ze))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-add-edit-resource"]],inputs:{resource:"resource",resourceCount:"resourceCount",availableServices:"availableServices",categories:"categories",resourceSettings:"resourceSettings",reservationsLabel:"reservationsLabel"},standalone:!1,decls:10,vars:4,consts:[["modalHeader","",1,"modal-header","py-2"],[1,"mb-0"],["classes","ml-auto py-1 px-2",3,"click","icon"],["modalContent","","class","tr-form-services pl-2 pr-2","novalidate","",3,"formGroup",4,"ngIf"],["modalFooter","",1,"modal-footer"],["type","submit","angularticsCategory","settings","angulartics2On","click","angularticsAction","Confirm Add/Edit Resource",1,"btn","btn-info",3,"click","disabled"],["type","button","angularticsCategory","waitlist","angulartics2On","click","angularticsAction","Cancel Add/Edit Resource",1,"btn","btn-danger",3,"click"],["modalContent","","novalidate","",1,"tr-form-services","pl-2","pr-2",3,"formGroup"],[1,"modal-body"],[1,"row","form-group"],[1,"col-xs-12","col-sm-5"],["for","service-name",1,"lead","col-form-label"],[1,"col-xs-12","col-sm-7","mt-2"],[1,"d-flex"],["type","text","id","service-name","formControlName","name","name","resourceName","placeholder","Enter name",1,"form-control"],["for","service-name",1,"col-form-label","ml-2","danger"],[3,"control"],["for","service-description",1,"lead","col-form-label"],["rows","2","id","service-description","formControlName","description","name","resourceDescription","placeholder","Optional",1,"form-control","minh-50"],["formGroupName","capacity",1,"row","form-group"],["for","resource-capacity-min",1,"lead","col-form-label"],["for","resource-capacity-min",1,"lead","col-form-label","mr-2"],["type","number","id","resource-capacity-min","formControlName","min","name","resourceCapacityMin",1,"form-control"],["for","resource-capacity-max",1,"lead","col-form-label","mx-2"],["type","number","id","resource-capacity-max","formControlName","max","name","resourceCapacityMax",1,"form-control"],["formGroupName","availability",1,"row","form-group"],["for","resource-availability-waitlist",1,"col-form-label","lead"],[1,"form-check"],[1,"form-check-label","mb-2"],["id","resource-availability-waitlist","formControlName","waitlist",1,"mr-2"],["id","resource-availability-reservations","formControlName","reservations",1,"mr-2"],["class","row form-group",4,"ngIf"],[1,"col-form-label","lead"],["elementId","category-dropdown","formControlName","category","placeholder","Select category",1,"w-100",3,"items","addTag","clearable","plainValues"],["elementId","resource-availability-services","bindLabel","name","bindValue","_id","formControlName","services","placeholder","Select services",1,"w-100",3,"items","multiple","clearable"]],template:function(n,i){1&n&&(e.j41(0,"div",0)(1,"h2",1),e.EFF(2),e.k0s(),e.j41(3,"tr-icon",2),e.bIt("click",function(){return i.cancel()}),e.k0s()(),e.DNE(4,Jo,60,18,"form",3),e.j41(5,"div",4)(6,"button",5),e.bIt("click",function(){return i.confirm(i.resourceForm.value)}),e.EFF(7,"Confirm"),e.k0s(),e.j41(8,"button",6),e.bIt("click",function(){return i.cancel()}),e.EFF(9,"Cancel"),e.k0s()()),2&n&&(e.R7$(2),e.SpI("",i.title," Resource"),e.R7$(),e.Y8G("icon",i.icon.cancel),e.R7$(),e.Y8G("ngIf",i.resourceForm),e.R7$(2),e.Y8G("disabled",i.resourceForm.pristine||!i.resourceForm.valid))},dependencies:[te.R,j.bT,d.qT,d.me,d.Q0,d.BC,d.cb,d.j4,d.JD,d.$R,ie.f,me.l$,se.H,ue.L,_e.u,ke.Y,xe._,j.PV],styles:[".error-messages[_ngcontent-%COMP%]{color:var(--cc-danger);font-size:80%}table[_ngcontent-%COMP%]{margin-bottom:1rem}table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]{border-bottom:1px solid var(--cc-border)}table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:first-child, table[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:last-child{border-bottom:0}.notions[_ngcontent-%COMP%]{border-top:1px solid var(--cc-border);margin:0 -1rem;padding:.5rem 1rem}input.form-control.is-invalid[_ngcontent-%COMP%]{padding:.375rem .75rem!important}"]}))}return s(),a})();const en=[{name:"Manual order",value:G.order},{name:"Name",value:G.name},{name:"Category",value:G.category}];let Se=(()=>{var s;class a{constructor(){this.tabsEnabledSource$=new Te.B,this.tabsEnabled$=this.tabsEnabledSource$.asObservable()}setTabsState(o){this.tabsEnabledSource$.next(o)}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)},this.\u0275prov=e.jDH({token:a,factory:a.\u0275fac}))}return s(),a})();
1var tn=u("./apps/manager/src/app/settings/settings-actions.service.ts"),He=u("./libs/frontend-navigation/src/lib/frontend-navigation.service.ts"),on=u("./node_modules/ngx-device-detector/fesm2022/ngx-device-detector.mjs"),Le=u("./node_modules/@angular/cdk/fesm2022/breakpoints-observer-CljOfYGy.mjs"),nn=u("./libs/frontend-draggable-list/src/lib/frontend-draggable-list.component.ts"),sn=u("./libs/common-ui/src/lib/components/common-radio-group/common-radio-group.component.ts");const rn=["resourceNameColumn"],an=["serviceNameColumn"],ln=["serviceNameCellTemplate"],cn=["capacityCellTemplate"],dn=["categoryCellTemplate"],pn=["actionsCellTemplate"],un=s=>({"add-resource-handset":s});function hn(s,a){if(1&s&&(e.j41(0,"div",11)(1,"div",12)(2,"label",27),e.EFF(3,"Assign services"),e.k0s(),e.j41(4,"p"),e.EFF(5,"Select services and add it to all resources."),e.k0s()(),e.j41(6,"div",28),e.nrm(7,"frontend-dropdown",31),e.k0s()()),2&s){const t=e.XpG(3);e.R7$(7),e.Y8G("items",t.services)("multiple",!0)("clearable",!0)}}function mn(s,a){if(1&s&&(e.j41(0,"div")(1,"div",11)(2,"div",12)(3,"label",20),e.EFF(4,"Resource label"),e.k0s(),e.j41(5,"p"),e.EFF(6,"What is a resource called? E.g., Table, Room, Employee, Lane, etc."),e.k0s()(),e.j41(7,"div",21),e.nrm(8,"input",22)(9,"control-messages",23),e.k0s()(),e.j41(10,"div",11)(11,"div",12)(12,"label",24),e.EFF(13," Display on Waitlist "),e.nrm(14,"br"),e.EFF(15),e.nI1(16,"titlecase"),e.k0s()(),e.j41(17,"div",14),e.nrm(18,"tablesready-switcher",25),e.k0s()(),e.DNE(19,hn,8,3,"div",26),e.j41(20,"div",11)(21,"div",12)(22,"label",27),e.EFF(23),e.k0s()(),e.j41(24,"div",28),e.nrm(25,"frontend-dropdown",29),e.k0s()(),e.j41(26,"div",11)(27,"div",12)(28,"label",27),e.EFF(29),e.k0s()(),e.j41(30,"div",28),e.nrm(31,"frontend-dropdown",30),e.k0s()()()),2&s){const t=e.XpG(2);e.R7$(8),e.AVh("is-invalid",t.resourcesForm.get("label").invalid&&t.resourcesForm.get("label").touched),e.R7$(),e.Y8G("control",t.resourcesForm.get("label")),e.R7$(6),e.SpI(" & ",e.bMT(16,9,t.who.location.displayOptions.labels.reservation_plural)," pages "),e.R7$(4),e.Y8G("ngIf",t.who.location.serviceSettings.enabled),e.R7$(4),e.SpI("",t.who.location.resourceSettings.label," Assignment Prioritization Method"),e.R7$(2),e.Y8G("items",t.resourcePrioritizationMethods),e.R7$(4),e.SpI("Select ",t.who.location.resourceSettings.label," Auto-assignment Mode"),e.R7$(2),e.Y8G("items",t.resourceSuggestionOptions)}}function fn(s,a){if(1&s&&e.nrm(0,"span",39),2&s){const t=e.XpG(3);e.Y8G("ngbTooltip",t.sortByText)}}function bn(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",8)(1,"div",32)(2,"div",32)(3,"h2",33),e.EFF(4,"Resources"),e.k0s(),e.j41(5,"div",32),e.nrm(6,"common-radio-group",34),e.DNE(7,fn,1,1,"span",35),e.k0s()(),e.j41(8,"button",36),e.bIt("click",function(){e.eBV(t);const n=e.XpG(2);return e.Njj(n.addEditResource())}),e.EFF(9,"+ Add resource"),e.k0s()(),e.j41(10,"div",37)(11,"frontend-draggable-list",38),e.bIt("fieldMoved",function(n){e.eBV(t);const i=e.XpG(2);return e.Njj(i.moveResourceInArray(n))}),e.k0s()()()}if(2&s){const t=e.XpG(2),o=e.sdS(17);e.R7$(),e.Y8G("ngClass",t.isDesktop?"flex-row justify-content-between align-items-center":"flex-column"),e.R7$(),e.Y8G("ngClass",t.isDesktop?"flex-row align-items-center":"flex-column justify-content-center"),e.R7$(3),e.Y8G("ngClass",t.isDesktop?"flex-row align-items-center":"flex-column justify-content-center pb-3"),e.R7$(),e.Y8G("items",t.resourceOrderItems),e.R7$(),e.Y8G("ngIf",t.isDesktop)("ngIfElse",o),e.R7$(),e.Y8G("ngClass",e.eq3(11,un,!t.isDesktop)),e.R7$(3),e.Y8G("data",t.resources)("columns",t.columns)("fullSize",t.isDesktop)("dragAndDropAllowed",t.dragAndDropAllowed)}}function gn(s,a){if(1&s){const t=e.RV6();e.j41(0,"form",10)(1,"div",11)(2,"div",12)(3,"label",13),e.EFF(4,"Enable Resources"),e.k0s(),e.j41(5,"p"),e.EFF(6,"Enable the Resources feature."),e.k0s()(),e.j41(7,"div",14),e.nrm(8,"tablesready-switcher",15),e.k0s()(),e.DNE(9,mn,32,11,"div",16),e.j41(10,"div",11)(11,"div",17)(12,"button",18),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.saveResourcesSettings())}),e.EFF(13,"Save"),e.k0s()()(),e.DNE(14,bn,12,13,"div",19),e.k0s()}if(2&s){const t=e.XpG();e.Y8G("formGroup",t.resourcesForm),e.R7$(9),e.Y8G("ngIf",t.resourcesForm.get("enabled").value),e.R7$(3),e.Y8G("disabled",t.resourcesForm.pristine||!t.resourcesForm.valid),e.R7$(2),e.Y8G("ngIf",t.showResourcesList)}}function Cn(s,a){if(1&s&&e.nrm(0,"span",40),2&s){const t=e.XpG();e.Y8G("innerText",(t.resourceSettings.label||"RESOURCE").toUpperCase()+" NAME")}}function vn(s,a){if(1&s&&e.nrm(0,"span",40),2&s){const t=e.XpG();
1e.Y8G("innerText",(t.serviceSettings.label||"SERVICES").toUpperCase())}}function _n(s,a){if(1&s&&e.nrm(0,"span",40),2&s){const t=a.item,o=e.XpG();e.Y8G("innerText",o.getServiceNames(t.services))}}function kn(s,a){if(1&s&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&s){const t=a.item;e.R7$(),e.Lme("",t.capacity.min," - ",t.capacity.max,"")}}function xn(s,a){if(1&s&&e.nrm(0,"span",40),2&s){const t=a.item;e.Y8G("innerText",""!==t.category?t.category:"-")}}function Tn(s,a){if(1&s){const t=e.RV6();e.j41(0,"div",41)(1,"button",42),e.bIt("click",function(){const n=e.eBV(t).item,i=e.XpG();return e.Njj(i.addEditResource(n))}),e.k0s(),e.j41(2,"button",43),e.bIt("click",function(){const n=e.eBV(t).item,i=e.XpG();return e.Njj(i.deleteResource(n))}),e.k0s()()}}function yn(s,a){if(1&s&&e.nrm(0,"span",40),2&s){const t=e.XpG();e.Y8G("innerText",t.sortByText)}}let jn=(()=>{var s;class a{constructor(o,n,i,r,l,c,p,h,m,f,x,S,H,k,A,K,b){this.service=o,this.alertsService=n,this.servicesService=i,this.resourcesService=r,this.modalController=l,this.whoService=c,this.fb=p,this.cdr=h,this.authRestaurantService=m,this.resourceApiService=f,this.errorHandlerService=x,this.pricePlansRestrictionsService=S,this.paidService=H,this.actionsService=k,this.navService=A,this.deviceDetectorService=K,this.breakpointObserver=b,this.resources=[],this.icon=M.z9,this.color=M.eA,this.size=M.Gs,this.showCategories=!1,this.isReorder=!1,this.isDesktop=!0,this.resourcesCategories=new Set,this.selectedServices=[],this.services=[],this.sort=Pt,this.resourcePrioritizationMethods=Mt,this.resourceSuggestionOptions=Bt,this.columns=[],this.resourceOrderItems=en,this.dragAndDropAllowed=!0,this.isLocationOnBusinessPlan=!1,this.subscriptions=new q.yU,this.updateResourceAvailability$=new Wo.t(null)}get sortByText(){return`Sort your ${this.resourceSettings?.label?.toLowerCase()||"resource"}s. If \u201c${this.resourceSettings?.label||"resource"} Assignment Prioritization Method\u201d is \u201cSort order,\u201d they will be displayed in this order throughout the app.`}get enabledControl(){return this.resourcesForm.get("enabled")}get showResourcesList(){return this.resourceSettings.enabled&&this.enabledControl.value}ngOnInit(){const o=this.deviceDetectorService.getDeviceInfo(),i="Macintosh"===o.device&&"tablet"===o.deviceType?2*Y.Tx:Y.Tx,r=this.actionsService.routeAction$.subscribe(h=>{h===this.navService.currentUrl&&this.addEditResource()});this.subscriptions.add(r);const l=this.authRestaurantService.select().pipe((0,I.p)(h=>void 0!==h.location),(0,g.M)(h=>{this.resources=[],this.who=h,this.isLocationOnBusinessPlan=this.pricePlansRestrictionsService.availableForBusinessPlan(h.account.subscriptionType,h.location.recurly)}),(0,J.n)(()=>this.resourcesService.selectAllSorted()),(0,g.M)(h=>{this.resources=h,this.resourceSettings={...this.who.location.resourceSettings,services:this.who.location.resourceSettings.services||[]};const m=this.resourceSettings.sort||G.name;this.dragAndDropAllowed=m===G.order,this.showCategories=m===G.category,this.isReorder=m===G.category||m===G.name,this.previousSelectedServices=[...this.resourceSettings.services||[]],this.serviceSettings={...this.who.location.serviceSettings},this.createdCategories(),this.cdr.detectChanges()}),(0,J.n)(()=>this.servicesService.selectAllEnabled()),(0,Ko.F)(),(0,g.M)(h=>{this.services=h,this.selectedServices=this.services.filter(f=>this.resourceSettings.services.includes(f._id)).map(f=>f._id),this.resourcesForm||this.initForm();const m=!!this.isLocationOnBusinessPlan&&this.resourceSettings.enabled;this.resourcesForm.get("enabled").setValue(m,{emitEvent:!1}),this.cdr.detectChanges()}),(0,P.W)(h=>(this.errorHandlerService.handleError(h),(0,w.of)(null)))).subscribe();this.subscriptions.add(l);const c=this.updateResourceAvailability$.pipe((0,I.p)(h=>!!h),(0,je.H)(h=>{const{_id:m,enabled:f}=h;return this.resourceApiService.edit({_id:m,enabled:f})}),(0,g.M)(()=>{const{enabled:h}=this.updateResourceAvailability$.getValue();this.alertsService.addSuccess(`${this.resourceSettings.label||"Resource"} ${h?"enabled":"disabled"}`,"Success: ")}),(0,P.W)(h=>(this.alertsService.addError(h?.message,"Error: "),h)),(0,qo.u)()).subscribe();this.subscriptions.add(c);const p=this.breakpointObserver.observe([`(max-width: ${i}px)`]).pipe((0,g.M)(({matches:h})=>{this.isDesktop=!h,this.cdr.detectChanges()})).subscribe();this.subscriptions.add(p)}ngAfterViewInit(){this.columns=((s,a,t,o,n,i)=>[{key:"name",title:"RESOURCES NAME",dataType:Y.c7.string,headerTemplateRef:this.resourceNameTemplateRef,width:100},{key:"services",title:"SERVICE",dataType:Y.c7.custom,headerTemplateRef:this.serviceNameTemplateRef,cellTemplateRef:this.serviceNameCellTemplateRef,width:100},{key:"capacity",title:"CAPACITY",dataType:Y.c7.custom,cellTemplateRef:this.capacityCellTemplateRef,width:100},{key:"category",title:"CATEGORY",dataType:Y.c7.custom,cellTemplateRef:this.categoryCellTemplateRef,width:100},{key:"enabled",title:"STATUS",dataType:Y.c7.toggle,toggleCallback:i,width:75},{key:"actions",title:"ACTIONS",dataType:Y.c7.custom,cellTemplateRef:this.actionsCellTemplateRef,width:100}])(0,0,0,0,0,n=>{const{_id:i,enabled:r}=n;this.updateResourceAvailability$.next({_id:i,enabled:r})}),this.cdr.markForCheck()}getServiceNames(o){if(!o||!o.length||!this.services)return"-";const i=this.services.filter(r=>o.includes(r._id)).map(r=>r.name);return i&&i.length?i.length>1?i.join(", "):i[0]:"-"}addEditResource(o){this.modalController.create(Qo,{resource:o,resourceCount:this.resources.length,availableServices:this.services,categories:Array.from(this.resourcesCategories),resourceSettings:this.resourceSettings,reservationsLabel:this.who.location.displayOptions.labels.reservation_plural}).pipe((0,T.s)(1)).subscribe(n=>{if(n){if(!n._id)return void this.saveResource(n);this.updateResource(n)}})}updateResource(o){this.resourceApiService.edit(o).pipe((0,g.M)(()=>{this.resources=this.resources.map(n=>n._id===o._id?{...o}:n),this.cdr.detectChanges(),this.alertsService.addSuccess("","Updated Resource")}),(0,P.W)(n=>(this.errorHandlerService.handleError(n),(0,w.of)(null)))).subscribe()}saveResource(o){let n=0;this.resources.length&&(n=(Math.max(...this.resources.map(({order:i}
1)=>i))||0)+1),o.order=n,this.resourceApiService.create(o).pipe((0,P.W)(i=>(this.errorHandlerService.handleError(i),(0,w.of)(null)))).subscribe()}deleteResource(o){o._id?this.modalController.create(_.M$,{options:{title:`Delete ${this.resourceSettings.label}`,content:`Are you sure you want to delete ${o.name}?`}}).pipe((0,T.s)(1),(0,I.p)(n=>n?.response),(0,J.n)(()=>this.resourceApiService.delete(o._id)),(0,g.M)(()=>{this.resources=this.resources.filter(n=>n._id!==o._id),this.cdr.detectChanges(),this.alertsService.addSuccess(o.name,"Deleted: ")}),(0,P.W)(n=>(this.errorHandlerService.handleError(n),(0,w.of)(null)))).subscribe():this.alertsService.add({type:ee.XS.danger,heading:"Error:",body:"Resource not yet saved. Nothing to delete."})}moveResourceInArray(o){if(o.previousIndex===o.currentIndex)return;const n=[...this.resources];(0,Lo.HD)(this.resources,o.previousIndex,o.currentIndex);const i=this.resources.map((r,l)=>({_id:r._id,order:l}));this.updateBulk(i,n)}updateResourceSettings(o){this.service.setTabsState(!0),this.whoService.updateResourceSettings(o).pipe((0,g.M)(()=>{this.alertsService.addSuccess("Resources Settings","Updated: "),this.service.setTabsState(!1)}),(0,P.W)(n=>(this.errorHandlerService.handleError(n),this.service.setTabsState(!1),(0,w.of)(null)))).subscribe()}createdCategories(){this.resources.forEach(o=>{o.category&&""!==o.category.trim()&&this.resourcesCategories.add(o.category)})}saveResourcesSettings(){const o=this.resourcesForm.value;this.resourcesForm.markAsPristine(),this.resourceSettings.services=o.services||[],this.editServicesInResourceBulk(),o.sort||delete o.sort,o.sortByName=!o.sort,this.updateResourceSettings(o)}editServicesInResourceBulk(){this.resourcesForm.markAsPristine();const o=this.previousSelectedServices.filter(r=>!this.resourceSettings.services.includes(r)),n=this.resourceSettings.services.filter(r=>!this.previousSelectedServices.includes(r));if(0===o.length&&0===n.length)return;const i=this.updateServicesInResources(n,o,this.resourceSettings.services);this.updateBulk(i)}updateServicesInResources(o,n,i){return this.resources.map(r=>(i.length&&!r.services.length&&(r.services=[...i]),n.length&&(r.services=r.services.filter(l=>!n.includes(l))),o.length&&(r.services=[...new Set(r.services.concat(o))]),r))}ngOnDestroy(){this.subscriptions.unsubscribe()}updateBulk(o,n){this.resourceApiService.updateBulk(o).pipe((0,P.W)(i=>(this.errorHandlerService.handleError(i),void 0!==n&&(this.resources=n),(0,w.of)(null)))).subscribe()}initForm(){this.resourcesForm=this.fb.group({enabled:[this.resourceSettings.enabled||!1],label:[this.resourceSettings.label||"",d.k0.required],showOnPages:[this.resourceSettings.showOnPages||!1],sort:[this.resourceSettings.sort||G.name],services:[this.selectedServices||[]],resourceAllocation:[this.resourceSettings.resourceAllocation||N.W.Random],resourceSuggestion:[this.resourceSettings.resourceSuggestion||N.C.auto]});const o=this.resourcesForm.get("enabled").valueChanges.pipe((0,I.p)(i=>i&&!this.isLocationOnBusinessPlan),(0,J.n)(()=>this.paidService.freePlanLocationModalDisplay(this.who)),(0,g.M)(()=>{this.resourcesForm.get("enabled").setValue(!1,{emitEvent:!1}),this.cdr.detectChanges()})).subscribe();this.subscriptions.add(o);const n=this.resourcesForm.get("sort").valueChanges.pipe((0,g.M)(i=>{const r={...this.resourceSettings,sort:i};this.dragAndDropAllowed=i===G.order,this.resourcesForm.markAsPristine(),this.updateResourceSettings(r)})).subscribe();this.subscriptions.add(n)}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(Se),e.rXU(ee.nB),e.rXU(O.gj),e.rXU(O.pQ),e.rXU(B.ft),e.rXU(O.kQ),e.rXU(d.ze),e.rXU(e.gRc),e.rXU(Ce.Zz),e.rXU(O.WL),e.rXU(_.qk),e.rXU(ve.C),e.rXU(ce.k8),e.rXU(tn.U),e.rXU(He.o),e.rXU(on.Kg),e.rXU(Le.B))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-resources-page"]],viewQuery:function(n,i){if(1&n&&(e.GBs(rn,5,e.C4Q),e.GBs(an,5,e.C4Q),e.GBs(ln,5,e.C4Q),e.GBs(cn,5,e.C4Q),e.GBs(dn,5,e.C4Q),e.GBs(pn,5,e.C4Q)),2&n){let r;e.mGM(r=e.lsd())&&(i.resourceNameTemplateRef=r.first),e.mGM(r=e.lsd())&&(i.serviceNameTemplateRef=r.first),e.mGM(r=e.lsd())&&(i.serviceNameCellTemplateRef=r.first),e.mGM(r=e.lsd())&&(i.capacityCellTemplateRef=r.first),e.mGM(r=e.lsd())&&(i.categoryCellTemplateRef=r.first),e.mGM(r=e.lsd())&&(i.actionsCellTemplateRef=r.first)}},inputs:{resources:"resources"},standalone:!1,features:[e.Jv_([_.qk])],decls:18,vars:1,consts:[["resourceNameColumn",""],["serviceNameColumn",""],["serviceNameCellTemplate",""],["capacityCellTemplate",""],["categoryCellTemplate",""],["actionsCellTemplate",""],["mobileDescription",""],["cdkScrollable","",1,"background-background","px-3","pb-3"],[1,"pt-3"],["role","form","novalidate","",3,"formGroup",4,"ngIf"],["role","form","novalidate","",3,"formGroup"],[1,"row","form-group"],[1,"col-sm-5","col-md-5","col-lg-5","col-xl-4"],["for","resources-enabled",1,"col-form-label","lead"],[1,"col-sm-7","col-md-7","col-lg-7","col-xl-5","mt-2"],["id","resources-enabled","formControlName","enabled"],[4,"ngIf"],[1,"col-sm-3","offset-sm-3","offset-md-2"],["angularticsCategory","settings","angulartics2On","click","angularticsAction","Save Resources Settings",1,"btn","btn-info",3,"click","disabled"],["class","pt-3",4,"ngIf"],["for","resources-label",1,"lead","col-form-label"],[1,"col-sm-5","col-md-5","col-lg-3","mt-2"],["type","text","id","resources-label","formControlName","label","name","servicesSettingsLabel",1,"form-control"],[3,"control"],["for","resources-show-on-pages",1,"col-form-label","lead"],["id","resources-show-on-pages","formControlName","showOnPages"],["class","row form-group",4,"ngIf"],[1,"lead","col-form-label"],[1,"col-sm-5","col-md-5","col-lg-5","col-xl-5","mt-2"],["elementId","settings-resource-allocation","formControlName","resourceAllocation","bindLabel","name","bindValue","value",1,"w-100",3,"items"],["elementId","settings-resource-suggestion","formControlName","resourceSuggestion","bindLabel","name","bindValue","value",1,"w-100",3,"items"],["formControlName","services","placeholder","Select services",1,"w-100",3,"items","multiple","clearable"],[1,"d-flex",3,"ngClass"],[1,"mb-0","pr-2"],["formControlName","sort","uncheckedButtonClass","btn-outline-info","checkedButtonClass","btn-info","groupId","resource-order-filters",3,"items"],["class","bi bi-info-circle-fill pl-2 cursor-help","container","body",3,"ngbTooltip",4,"ngIf","ngIfElse"],[1,"btn","btn-info","add-resource",3,"click","ngClass"],[1,"overflow-auto"],[3,"fieldMoved","data","columns","fullSize","dragAndDropAllowed"],["container","body",1,"bi","bi-info-circle-fill","pl-2","cursor-help",3,"ngbTooltip"],[3,"innerText"],[1,"d-flex","justify-content-center"],["angularticsCategory","settings","angulartics2On","click","angularticsAction","Edit Resource",1,"btn","btn-outline-success","bi","bi-pencil-fill",3,"click"],["angularticsCategory","settings","angulartics2On","click","angularticsAction","Delete Resource",1,"btn","btn-outline-danger","ml-2","bi","bi-bucket-fill",3,"click"]],template:function(n,i){1&n&&(e.j41(0,"section",7)(1,"h1",8),e.EFF(2,"Resources Settings"),e.k0s(),e.DNE(3,gn,15,4,"form",9),e.k0s(),e.DNE(4,Cn,1,1,"ng-template",null,0,e.C5r)(6,vn,1,1,"ng-template",null,1,e.C5r)(8,_n,1,1,"ng-template",null,2,e.C5r)(10,kn,2,2,"ng-template",null,3,e.C5r)(12,xn,1,1,"ng-template",null,4,e.C5r)(14,Tn,3,0,"ng-template",null,5,e.C5r)(16,yn,1,1,"ng-template",null,6,e.C5r)),2&n&&(e.R7$(3),e.Y8G("ngIf",i.resourcesForm))},dependencies:[j.YU,j.bT,d.qT,d.me,d.BC,d.cb,d.j4,d.JD,ie.f,$.md,me.l$,se.H,ue.L,De.uv,nn.l,sn.V,j.PV],styles:["section[_ngcontent-%COMP%]{overflow-y:auto;padding-right:1rem;box-sizing:border-box}@media (max-width: 992px){.add-resource[_ngcontent-%COMP%]{width:35%;align-self:flex-end}}@media (max-width: 1400px){.add-resource-handset[_ngcontent-%COMP%]{width:35%;align-self:flex-end}}@media (max-width: 576px){.add-resource-handset[_ngcontent-%COMP%]{width:100%}}"],changeDetection:0}))}return s(),a})();var We=u("./node_modules/@angular/router/fesm2022/router_module-DTJgGWLd.mjs"),Sn=u("./apps/manager/src/app/guards/index.ts"),Ke=u("./node_modules/@angular/cdk/fesm2022/layout.mjs"),qe=u("./node_modules/rxjs/dist/esm/internal/operators/finalize.js"),An=u("./node_modules/rxjs/dist/esm/internal/observable/from.js"),Ze=u("./node_modules/@angular/router/fesm2022/router-Dwfin
15Au.mjs");const In=[{path:"",component:(()=>{var s;class a{constructor(o,n,i,r,l,c,p,h,m,f){this.service=o,this.navService=n,this.router=i,this.modalController=r,this.whoService=l,this.alertsService=c,this.authRestaurantService=p,this.breakpointObserver=h,this.pricePlansRestrictionsService=m,this.paidService=f,this.tabs=[V.resources],this.disabledTabs=!1,this.resourcesEnabled=!1,this.availableForBusinessPlan=!1,this.subscription=new q.yU}ngOnInit(){const o="/settings/preferences/resources";this.activeTab=V.resources;const n=this.service.tabsEnabled$.subscribe(r=>{this.disabledTabs=r});this.subscription.add(n);const i=(0,Ee.z)([this.authRestaurantService.select(),this.breakpointObserver.observe([Ke.Rp.Handset,Ke.Rp.HandsetLandscape])]).pipe((0,g.M)(([r,{matches:l}])=>{this.user=r;const c=r.account.features.floorPlan,p=this.tabs.includes(V.floors);if(this.availableForBusinessPlan=this.pricePlansRestrictionsService.availableForBusinessPlan(r.account.subscriptionType,r.location.recurly),this.resourceSettings={...r.location.resourceSettings,services:r.location.resourceSettings.services||[]},!c||p||l)p&&(!c||l)&&(this.tabs=[V.resources],this.activeTab=V.resources,this.router.navigateByUrl(`${o}/list`));else{this.tabs=[V.resources,V.floors];const h=this.navService.currentUrl.replace(o,"");this.activeTab="/floorplan"===h?V.floors:V.resources}}),(0,J.n)(()=>this.navService.navEvents$),(0,g.M)(r=>{r.url.includes("/floorplan")&&this.user&&!this.user.account.features.floorPlan&&this.router.navigateByUrl(`${o}/list`)})).subscribe();this.subscription.add(i)}onChangeTab(o){const n=this.authRestaurantService.get(),i=n.location.resourceSettings;if(i.enabled||o!==V.floors)this.tabChanged(o);else{if(!this.availableForBusinessPlan)return void this.confirmEnableResourcesModal(n).pipe((0,T.s)(1),(0,I.p)(r=>r?.response),(0,J.n)(()=>this.paidService.freePlanLocationModalDisplay(this.user)),(0,I.p)(({isConfirmed:r})=>!r),(0,g.M)(()=>this.tabChanged(o))).subscribe();this.confirmEnableResourcesModal(n).pipe((0,T.s)(1),(0,I.p)(r=>r?.response),(0,je.H)(()=>this.whoService.updateResourceSettings({enabled:!0,label:i.label||"Table",showOnPages:i.showOnPages||!1,sort:i.sort||"name",services:[],resourceAllocation:this.resourceSettings.resourceAllocation||N.W.Random,resourceSuggestion:this.resourceSettings.resourceSuggestion||N.C.auto})),(0,g.M)(()=>this.alertsService.addSuccess("Resources enabled successfully!")),(0,P.W)(()=>(this.alertsService.addError("Error enabling resources"),(0,w.of)(null))),(0,qe.j)(()=>{this.tabChanged(o)})).subscribe()}}ngOnDestroy(){this.subscription.unsubscribe()}tabChanged(o){let n="list";o===V.floors&&(n="floorplan"),(0,w.of)(!0).pipe((0,be.c)(1),(0,je.H)(()=>(0,An.H)(this.router.navigateByUrl(`settings/preferences/resources/${n}`))),(0,T.s)(1),(0,qe.j)(()=>{this.activeTab=o})).subscribe()}confirmEnableResourcesModal(o){return this.modalController.create(_.M$,{options:{title:`Enable ${o.location.resourceSettings.label} Management`,content:`Would you like to enable ${o.location.resourceSettings.label} Management in order to create and manage floorplans?`,closeBtnText:"Cancel",confirmBtnText:"Enable"}})}static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)(e.rXU(Se),e.rXU(He.o),e.rXU(Ze.Ix),e.rXU(B.ft),e.rXU(O.kQ),e.rXU(ee.nB),e.rXU(Ce.Zz),e.rXU(Le.B),e.rXU(ve.C),e.rXU(ce.k8))},this.\u0275cmp=e.VBU({type:a,selectors:[["tablesready-resources"]],standalone:!1,decls:6,vars:6,consts:[["tabsRef",""],[1,"px-3"],[3,"changeTab","tabs","activeTab","disabled"],[3,"forceOverscroll"]],template:function(n,i){if(1&n){const r=e.RV6();e.j41(0,"ion-header")(1,"div",1,0)(3,"tablesready-tabs",2),e.bIt("changeTab",function(c){return e.eBV(r),e.Njj(i.onChangeTab(c))}),e.k0s()()(),e.j41(4,"ion-content",3),e.nrm(5,"router-outlet"),e.k0s()}if(2&n){const r=e.sdS(2);e.R7$(3),e.Y8G("tabs",i.tabs)("activeTab",i.activeTab)("disabled",i.disabledTabs),e.R7$(),e.xc7("max-height","calc(100% - "+r.offsetHeight+"px"),e.Y8G("forceOverscroll",!1)}},dependencies:[Ze.n3,Pe.O,le.W9,le.eU],encapsulation:2}))}return s(),a})(),canActivate:[Sn.xW],data:{scopes:["manager:write"]},children:[{path:"floorplan",component:to},{path:"list",component:jn},{path:"",pathMatch:"full",redirectTo:"list"}]}];let wn=(()=>{var s;class a{static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)},this.\u0275mod=e.$C({type:a}),this.\u0275inj=e.G2t({imports:[We.iI.forChild(In),We.iI]}))}return s(),a})(),Rn=(()=>{var s;class a{static#e=s=()=>(this.\u0275fac=function(n){return new(n||a)},this.\u0275mod=e.$C({type:a}),this.\u0275inj=e.G2t({providers:[Se],imports:[Ho,M.Dn,j.MD,d.YN,d.X1,Je.r,ee.k_,_.gx,$.UN,Re.MQ,me.KF,wn,_.jr,X.b3,fe.nd,_.uh,_.$y,le.bv,Fe.K2,B.qz,Qe.x,$e.z,we.m,ce.$S,Ue.M,Y.Ez,_.y9]}))}return s(),a})()}
1}]);
2//# sourceMappingURL=manager-settings-resources.1.44.2.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.