PageSourceSearch

https://web.suivo.com/app/2146.98e5e68f44eac47f.js

js suivo.com collected 2026-10-02 14:39:25 UTC 78,788 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksuivo_web=self.webpackChunksuivo_web||[]).push([[2146],{36769:(w,y,r)=>{r.d(y,{i:()=>_t});var t=r(73664),C=r(27208),a=r(89417),l=r(23294),F=r(70152),E=r(60516),f=r(30054),S=r(31163);class b{}var g=r(2615),R=r(17705),x=r(73807),O=r(31843),X=r(57743),D=r(51727),A=r(21189),J=r(72200),j=r(48926),Y=r(86806),H=r(70754),W=r(7283),K=r(44977),z=r(94582),Q=r(34098),Z=r(86907),q=r(89151),tt=r(77120),v=r(61967);const P=d=>({fullScreen:d}),$=d=>({"full-height":d}),et=(d,k)=>({"fa-expand":d,"fa-compress":k}),V=d=>({"has-error":d});function U(d,k){if(1&d){const o=t.RV6();t.j41(0,"h3"),t.EFF(1),t.nI1(2,"translate"),t.nrm(3,"span",5),t.k0s(),t.j41(4,"div",6)(5,"div",7)(6,"label"),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.nrm(9,"input",8)(10,"show-errors",9),t.k0s()(),t.j41(11,"div",10)(12,"div",11)(13,"div",12)(14,"div",13)(15,"div",14)(16,"suivo-map",15),t.bIt("locationChanged",function(u){g.eBV(o);const T=t.XpG(2);return g.Njj(T.locationChanged(u))})("locationPositionChanged",function(u){g.eBV(o);const T=t.XpG(2);return g.Njj(T.locationPositionChanged(u))}),t.k0s(),t.j41(17,"div",16),t.bIt("click",function(){g.eBV(o);const u=t.XpG(2);return g.Njj(u.toggleFullScreen())}),t.nrm(18,"i",17),t.k0s()(),t.j41(19,"div",18)(20,"div",19)(21,"div",20),t.nrm(22,"input",21),t.EFF(23),t.nI1(24,"translate"),t.k0s(),t.nrm(25,"input",22),t.j41(26,"div",20),t.EFF(27),t.nI1(28,"distanceUnitLabel"),t.k0s()(),t.j41(29,"div",19)(30,"div",20),t.EFF(31),t.nI1(32,"translate"),t.k0s(),t.nrm(33,"input",23),t.k0s(),t.j41(34,"div",19)(35,"div",20),t.EFF(36),t.nI1(37,"translate"),t.k0s(),t.nrm(38,"input",24),t.k0s()(),t.nrm(39,"show-errors",9)(40,"show-errors",25)(41,"show-errors",25),t.k0s()()()(),t.j41(42,"label"),t.EFF(43),t.nI1(44,"translate"),t.k0s(),t.j41(45,"div",26)(46,"div",7)(47,"label",27),t.nrm(48,"input",28)(49,"span",29),t.k0s(),t.j41(50,"label",30),t.EFF(51),t.nI1(52,"translate"),t.k0s()()(),t.j41(53,"div",6)(54,"div",7),t.nrm(55,"address-form",31),t.k0s()(),t.j41(56,"h3"),t.EFF(57),t.nI1(58,"translate"),t.k0s()}if(2&d){const o=t.XpG(2);t.R7$(),t.SpI("",t.bMT(2,25,"permission.ITEM_LOCATION_INFO")," "),t.R7$(6),t.JRh(t.bMT(8,27,"allpages.name")),t.R7$(3),t.Y8G("control",o.description),t.R7$(),t.Y8G("ngClass",t.eq3(43,P,o.fullScreen)),t.R7$(),t.Y8G("ngClass",t.eq3(45,$,o.fullScreen)),t.R7$(),t.Y8G("ngClass",t.eq3(47,$,o.fullScreen)),t.R7$(),t.Y8G("ngClass",t.eq3(49,$,o.fullScreen)),t.R7$(2),t.Y8G("mapKey",o.mapKey)("location",o.mapData),t.R7$(2),t.Y8G("ngClass",t.l_i(51,et,!o.fullScreen,o.fullScreen)),t.R7$(2),t.Y8G("ngClass",t.eq3(54,V,o.buffer.invalid)),t.R7$(3),t.SpI(" ",t.bMT(24,29,"myLocations.map.controls.buffer"),"\xa0 "),t.R7$(4),t.JRh(t.bMT(28,31,"radiusShort")),t.R7$(2),t.Y8G("ngClass",t.eq3(56,V,o.longitude.invalid)),t.R7$(2),t.JRh(t.bMT(32,33,"allpages.location.longitude")),t.R7$(3),t.Y8G("ngClass",t.eq3(58,V,o.latitude.invalid)),t.R7$(2),t.JRh(t.bMT(37,35,"allpages.location.latitude")),t.R7$(3),t.Y8G("control",o.buffer),t.R7$(),t.Y8G("control",o.longitude)("errorMessage","allpages.error.location.coordinate.invalid"),t.R7$(),t.Y8G("control",o.latitude)("errorMessage","allpages.error.location.coordinate.invalid"),t.R7$(2),t.JRh(t.bMT(44,37,"allpages.form.address")),t.R7$(8),t.SpI("\xa0",t.bMT(52,39,"myLocations.form.description.overwriteAddress")),t.R7$(6),t.JRh(t.bMT(58,41,"myLocations.form.attributes"))}}function ot(d,k){if(1&d){const o=t.RV6();t.j41(0,"input",46),t.bIt("change",function(){g.eBV(o);const u=t.XpG(3);return g.Njj(u.enableFormControl(u.setColor,u.color))}),t.k0s()}}
1function nt(d,k){if(1&d){const o=t.RV6();t.j41(0,"input",47),t.bIt("change",function(){g.eBV(o);const u=t.XpG(3);return g.Njj(u.enableFormControl(u.setEntityType,u.entityType))}),t.k0s()}}function G(d,k){if(1&d&&(t.j41(0,"label"),t.EFF(1),t.k0s()),2&d){const o=t.XpG(4);t.R7$(),t.JRh(null==o.commentOptions?null:o.commentOptions.comment1)}}function it(d,k){1&d&&(t.j41(0,"label"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&d&&(t.R7$(),t.JRh(t.bMT(2,1,"myLocations.form.description.comment1")))}function st(d,k){if(1&d&&(t.j41(0,"label"),t.EFF(1),t.k0s()),2&d){const o=t.XpG(4);t.R7$(),t.JRh(null==o.commentOptions?null:o.commentOptions.comment2)}}function at(d,k){1&d&&(t.j41(0,"label"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&d&&(t.R7$(),t.JRh(t.bMT(2,1,"myLocations.form.description.comment2")))}function rt(d,k){if(1&d&&(t.j41(0,"div",6)(1,"div",7)(2,"label"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.nrm(5,"input",48)(6,"show-errors",9),t.k0s()(),t.j41(7,"div",6)(8,"div",7),t.nVh(9,G,2,1,"label"),t.nVh(10,it,3,3,"label"),t.nrm(11,"input",49),t.k0s()(),t.j41(12,"div",6)(13,"div",7),t.nVh(14,st,2,1,"label"),t.nVh(15,at,3,3,"label"),t.nrm(16,"input",50),t.k0s()()),2&d){const o=t.XpG(3);t.R7$(3),t.JRh(t.bMT(4,6,"myLocations.form.description.fax")),t.R7$(3),t.Y8G("control",o.fax),t.R7$(3),t.vxM(null!=o.commentOptions&&o.commentOptions.comment1?9:-1),t.R7$(),t.vxM(null!=o.commentOptions&&o.commentOptions.comment1?-1:10),t.R7$(4),t.vxM(null!=o.commentOptions&&o.commentOptions.comment2?14:-1),t.R7$(),t.vxM(null!=o.commentOptions&&o.commentOptions.comment2?-1:15)}}function lt(d,k){if(1&d){const o=t.RV6();t.j41(0,"input",51),t.bIt("change",function(){g.eBV(o);const u=t.XpG(3);return g.Njj(u.enableFormControl(u.setStartDate,u.startDate))}),t.k0s()}}function ct(d,k){if(1&d){const o=t.RV6();t.j41(0,"input",52),t.bIt("change",function(){g.eBV(o);const u=t.XpG(3);return g.Njj(u.enableFormControl(u.setStopDate,u.stopDate))}),t.k0s()}}function dt(d,k){if(1&d){const o=t.RV6();t.j41(0,"input",53),t.bIt("change",function(){g.eBV(o);const u=t.XpG(3);return g.Njj(u.enableFormControl(u.setOnlyGeoFencing,u.onlyGeoFencing))}),t.k0s()}}function ht(d,k){if(1&d){const o=t.RV6();t.j41(0,"input",54),t.bIt("change",function(){g.eBV(o);const u=t.XpG(3);return g.Njj(u.enableFormControl(u.setAlwaysShowOnMap,u.alwaysShowOnMap))}),t.k0s()}}function ut(d,k){if(1&d&&(t.j41(0,"div",6)(1,"div",7)(2,"label"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.nrm(5,"input",55)(6,"show-errors",9),t.k0s()()),2&d){const o=t.XpG(3);t.R7$(3),t.JRh(t.bMT(4,2,"allpages.externalReference")),t.R7$(3),t.Y8G("control",o.externalReference)}}function mt(d,k){if(1&d&&(t.j41(0,"div",6)(1,"div",7)(2,"label"),t.nVh(3,ot,1,0,"input",32),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"div",33),t.nrm(7,"suivo-color-picker",34),t.k0s()()(),t.j41(8,"div",6)(9,"div",7)(10,"label"),t.nVh(11,nt,1,0,"input",35),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.nrm(14,"entity-type-select",36),t.k0s()(),t.nVh(15,rt,17,8),t.j41(16,"div",6)(17,"div",7)(18,"label"),t.nVh(19,lt,1,0,"input",37),t.EFF(20),t.nI1(21,"translate"),t.k0s(),t.nrm(22,"date-input",38)(23,"show-errors",9),t.k0s()(),t.j41(24,"div",6)(25,"div",7)(26,"label"),t.nVh(27,ct,1,0,"input",39),t.EFF(28),t.nI1(29,"translate"),t.k0s(),t.nrm(30,"date-input",40)(31,"show-errors",9),t.k0s()(),t.j41(32,"div",26)(33,"div",7)(34,"label"),t.nVh(35,dt,1,0,"input",41),t.EFF(36),t.nI1(37,"translate"),t.k0s(),t.j41(38,"div")(39,"label",42),t.nrm(40,"input",43)(41,"span",29),t.k0s()()()(),t.j41(42,"div",6)(43,"div",7)(44,"label"),t.nVh(45,ht,1,0,"input",44),t.EFF(46),t.nI1(47,"translate"),t.k0s(),t.j41(48,"div")(49,"label",42),t.nrm(50,"input",45)(51,"span",29),t.k0s()()()(),t.nVh(52,ut,7,4,"div",6)),2&d){const o=t.XpG(2);t.R7$(3),t.vxM(o.isBatchEdit?3:-1),t.R7$(),t.SpI(" ",t.bMT(5,24,"settings.groups.color")," "),t.R7$(7),t.vxM(o.isBatchEdit?11:-1),t.R7$(),t.SpI(" ",t.bMT(13,26,"allpages.type")," "),t.R7$(2),t.Y8G("placeholder","allpages.type")("entityTypes",o.entityTypes),t.R7$(),t.vxM(o.isBatchEdit?-1:15),t.R7$(4),t.vxM(o.isBatchEdit?19:-1),t.R7$(),t.SpI(" ",t.bMT(21,28,"allpages.date.start")," "),t.R7$(2),t.Y8G("optional",!0)("includeTime",!0)("hidePreviousNext",!0),t.R7$(),t.Y8G("control",o.startDate),t.R7$(4),t.vxM(o.isBatchEdit?27:-1),t.R7$(),t.SpI(" ",t.bMT(29,30,"allpages.date.stop")," "),t.R7$(2),t.Y8G("optional",!0)("includeTime",!0)("hidePreviousNext",!0),t.R7$(),t.Y8G("control",o.stopDate),t.R7$(4),t.vxM(o.isBatchEdit?35:-1),t.R7$(),t.SpI(" ",t.bMT(37,32,"myLocations.form.attributes.geoFencingOnly")," "),t.R7$(9),t.vxM(o.isBatchEdit?45:-1),t.R7$(),t.SpI(" ",t.bMT(47,34,"myLocations.form.description.alwaysShowOnMap")," "),t.R7$(6),t.vxM(o.isBatchEdit?-1:52)}}function pt(d,k){if(1&d){const o=t.RV6();t.j41(0,"button",58),t.bIt("click",function(){g.eBV(o);const u=t.XpG(3);return g.Njj(u.resetLocation(u.location))}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}
12&d&&(t.R7$(),t.JRh(t.bMT(2,1,"allpages.button.reset")))}function ft(d,k){if(1&d){const o=t.RV6();t.j41(0,"div",4)(1,"div",7),t.nVh(2,pt,3,3,"button",56),t.j41(3,"success-submit-button",57),t.bIt("onButtonClick",function(){g.eBV(o);const u=t.XpG(2);return g.Njj(u.saveLocation())}),t.k0s()()()}if(2&d){const o=t.XpG(2);t.R7$(2),t.vxM(o.isBatchEdit?-1:2),t.R7$(),t.Y8G("success",o.success)("failed",o.failed)("buttonDisabled",!o.locationForm.dirty||!o.locationForm.valid||o.saving)("alignRight",!0)}}function Ct(d,k){if(1&d&&(t.j41(0,"div",1)(1,"div",2)(2,"form",3),t.nVh(3,U,59,60),t.nVh(4,mt,53,36),t.k0s()(),t.nVh(5,ft,4,5,"div",4),t.k0s()),2&d){const o=t.XpG();t.R7$(2),t.Y8G("formGroup",o.locationForm),t.R7$(),t.vxM(o.isBatchEdit?-1:3),t.R7$(),t.vxM(o.fullScreen?-1:4),t.R7$(),t.vxM(o.fullScreen?-1:5)}}let _t=(()=>{class d{static{this.DEFAULT_COLOR="#8a1ed5"}static{this.DEFAULT_BUFFER=100}onKeyDown(o){if(13===o.keyCode)return!1}constructor(o,c,u,T,L,I,N){this.fb=o,this.permissionService=c,this.distanceService=u,this.mapHelperService=T,this.locationService=L,this.mapEventsHelper=I,this.changeDetector=N,this.numericValidator=a.k0.pattern("^[0-9]+[0-9]*$"),this.latitudeValidator=a.k0.pattern("^(\\+|-)?(?:90(?:(?:\\.0{1,7})?)|(?:[0-9]|[1-8][0-9])(?:(?:\\.[0-9]{1,7})?))$"),this.longitudeValidator=a.k0.pattern("^(\\+|-)?(?:180(?:(?:\\.0{1,7})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\\.[0-9]{1,7})?))$"),this.onEdit=new t.bkB,this.onFullScreen=new t.bkB,this.onSave=new t.bkB,this.onCreateEvent=new t.bkB,this.onLocationLoaded=new t.bkB,this.mapKey="myLocations",this.fullScreen=!1,this.objectKeys=Object.keys,this.loading=!0,this.locationService.getLocationAttributes().subscribe(B=>{this.entityTypes=B.entityTypes,this.commentOptions={comment1:B.comment1Label,comment2:B.comment2Label},this.loading=!1,this.changeDetector.markForCheck(),this.locationForm||this.setupForm()})}ngOnInit(){this.isBatchEdit=this.allSelected||this.entities&&this.entities.length>0,this.changeDetector.markForCheck(),this.loading||this.setupForm()}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe(),this.startDateSubscription&&this.startDateSubscription.unsubscribe(),this.stopDateSubscription&&this.stopDateSubscription.unsubscribe(),this.longitudeSubscription&&this.longitudeSubscription.unsubscribe(),this.latitudeSubscription&&this.latitudeSubscription.unsubscribe(),this.bufferSubscription&&this.bufferSubscription.unsubscribe(),this.hasBufferSubscription&&this.hasBufferSubscription.unsubscribe(),this.addressSubscription&&this.addressSubscription.unsubscribe(),this.geocoderOptionsSubscription&&this.geocoderOptionsSubscription.unsubscribe()}saveLocation(){if(this.locationForm.valid)if(this.saving=!0,this.failed=!1,this.changeDetector.markForCheck(),this.isBatchEdit)this.locationService.batchLocations(this.getLocationBatchRequest()).subscribe(o=>{this.saving=!1,this.changeDetector.markForCheck(),(0,E.hX)(o)||0===Object.keys(o).length?(this.success=!0,this.changeDetector.markForCheck(),this.onSave.emit(this.location),setTimeout(()=>{this.success=!1,this.changeDetector.markForCheck()},3e3)):this.setErrors(o)});else{let o=this.getLocationToSave();this.locationService.saveLocation(o).subscribe(c=>{this.saving=!1,this.changeDetector.markForCheck(),c.errors&&0!=Object.keys(c.errors).length?(this.failed=!0,this.setErrors(c.errors)):(this.success=!0,this.location=o,this.locationId||(this.location.id=c.id,this.onCreateEvent.emit(this.location)),this.changeDetector.markForCheck(),this.resetLocation(o),this.onSave.emit(this.location),setTimeout(()=>{this.success=!1,this.changeDetector.markForCheck()},3e3))})}}resetLocation(o){o&&(o.address||(o.address=new C.pV),!o.address.coordinate&&!o.address.longitude&&o.entryPoint&&(o.address.coordinate=o.entryPoint)),this.locationForm.reset({description:o?o.description:null,geoJson:o?o.geoJson:null,point:!o||!!o.point,hasBuffer:!o||!!o.point||!(0,E.hX)(o.buffer),buffer:o?this.bufferInUserUnit(o):this.defaultBufferInUserUnit(),longitude:o?this.parseLonLat(o.address.coordinate.longitude):null,latitude:o?this.parseLonLat(o.address.coordinate.latitude):null,overwriteAddress:!!o&&o.id,address:o?o.address:null,color:o?o.color:d.DEFAULT_COLOR,entityType:o?o.entityType:null,fax:o?o.fax:null,comment1:o?o.comment1:null,comment2:o?o.comment2:null,startDate:o&&o.hasStartDate?new Date(o.startDate):null,stopDate:o&&o.hasStopDate?new Date(o.stopDate):null,onlyGeoFencing:!!o&&!!o.onlyGeoFencing,alwaysShowOnMap:!!o&&!!o.alwaysShowOnMap,externalReference:o?o.externalReference:null},{emitEvent:!1}),o?this.address.enable({emitEvent:!1}):this.address.disable({emitEvent:!1}),this.enableDisableHasBuffer(),o?this.setLocationMapData(o):this.mapData=null,this.onEdit.emit(!1)}
1locationChanged(o){if(o&&(o.coordinate||o.entryPoint)){let c=o.coordinate||o.entryPoint;this.longitude.setValue(this.parseLonLat(c.longitude),{emitEvent:!1}),this.latitude.setValue(this.parseLonLat(c.latitude),{emitEvent:!1}),this.point.setValue(o.point),this.geoJson.setValue(o.geoJson),this.locationForm.markAsDirty()}else this.longitude.setValue(null),this.latitude.setValue(null),this.point.setValue(!0),this.address.setValue(new C.pV),this.overwriteAddress.setValue(!1);this.enableDisableHasBuffer()}locationPositionChanged(o){this.longitude.setValue(this.parseLonLat(o.longitude),{emitEvent:!1}),this.latitude.setValue(this.parseLonLat(o.latitude),{emitEvent:!1}),this.longitude.markAsDirty(),this.latitude.markAsDirty(),this.point.value&&(this.geoJson.setValue(JSON.stringify(this.mapHelperService.coordinateToGeoJson(o))),this.geoJson.markAsDirty())}enableFormControl(o,c){o.value?c.enable():c.disable()}toggleFullScreen(){this.fullScreen=!this.fullScreen,this.onFullScreen.emit(this.fullScreen)}setupForm(){this.locationForm=this.fb.group({color:d.DEFAULT_COLOR,entityType:null,startDate:null,stopDate:null,onlyGeoFencing:!1,alwaysShowOnMap:!1},{validators:this.periodValidator()}),this.isBatchEdit?(this.locationForm.addControl("setOnlyGeoFencing",this.fb.control(!1)),this.locationForm.addControl("setAlwaysShowOnMap",this.fb.control(!1)),this.locationForm.addControl("setColor",this.fb.control(!1)),this.locationForm.addControl("setStartDate",this.fb.control(!1)),this.locationForm.addControl("setStopDate",this.fb.control(!1)),this.locationForm.addControl("setEntityType",this.fb.control(!1))):(this.locationForm.addControl("description",this.fb.control(null,a.k0.required)),this.locationForm.addControl("geoJson",this.fb.control(null,a.k0.required)),this.locationForm.addControl("point",this.fb.control(!0)),this.locationForm.addControl("hasBuffer",this.fb.control({value:!0,disabled:!0})),this.locationForm.addControl("buffer",this.fb.control(this.defaultBufferInUserUnit(),[this.numericValidator,a.k0.max(1e5)])),this.locationForm.addControl("longitude",this.fb.control(null,this.longitudeValidator)),this.locationForm.addControl("latitude",this.fb.control(null,this.latitudeValidator)),this.locationForm.addControl("overwriteAddress",this.fb.control(null)),this.locationForm.addControl("address",this.fb.control({value:null,disabled:!0})),this.locationForm.addControl("fax",this.fb.control(null,f.U)),this.locationForm.addControl("comment1",this.fb.control(null)),this.locationForm.addControl("comment2",this.fb.control(null)),this.locationForm.addControl("externalReference",this.fb.control(null)),"true"===this.permissionService.getPreference("block_edit_external_reference")&&this.externalReference.disable({emitEvent:!1}),this.addressSubscription=this.overwriteAddress.valueChanges.subscribe(o=>{o?this.address.enable({emitEvent:!1}):this.address.disable({emitEvent:!1})}),this.longitudeSubscription=this.longitude.valueChanges.pipe((0,l.F)(),(0,F.B)(500)).subscribe(o=>{this.isValidNumericValue(this.latitude.value)&&this.isValidNumericValue(o)&&this.updateCoordinate({longitude:this.parseLonLat(+o),latitude:this.parseLonLat(+this.latitude.value)})}),this.latitudeSubscription=this.latitude.valueChanges.pipe((0,l.F)(),(0,F.B)(500)).subscribe(o=>{this.isValidNumericValue(this.longitude.value)&&this.isValidNumericValue(o)&&this.updateCoordinate({longitude:this.parseLonLat(+this.longitude.value),latitude:this.parseLonLat(o)})}),this.bufferSubscription=this.buffer.valueChanges.pipe((0,l.F)(),(0,F.B)(500)).subscribe(o=>{this.buffer.valid&&this.isValidNumericValue(this.longitude.value)&&this.isValidNumericValue(this.latitude.value)&&this.isValidNumericValue(this.buffer.value)&&this.setLocationMapData(this.getLocationFromFormData())}),this.hasBufferSubscription=this.hasBuffer.valueChanges.subscribe(o=>{this.setLocationMapData(this.getLocationFromFormData())}),this.geocoderOptionsSubscription=this.mapEventsHelper.geocoderOptionsChanges$.subscribe(o=>{this.mapKey===o.mapKey&&((0,E.hX)(this.point.value)&&this.point.setValue(!0),this.point.value&&this.geoJson.setValue(this.mapHelperService.coordinateToGeoJson(o.geoSearchData.coordinate),{emitEvent:!1}),this.enableDisableHasBuffer(),this.overwriteAddress.value||this.address.setValue(Object.assign(new C.pV,o.geoSearchData.address,{coordinate:o.geoSearchData.coordinate})),this.longitude.setValue(this.parseLonLat(o.geoSearchData.coordinate.longitude),{emitEvent:!1}),this.latitude.setValue(this.parseLonLat(o.geoSearchData.coordinate.latitude),{emitEvent:!1}),this.setDestinationMapData(o.geoSearchData))}),(0,E.hX)(this.locationId)?(0,E.hX)(this.coordinate)||this.resetLocation(this.getLocationFromFormData({longitude:this.parseLonLat(this.coordinate.longitude?this.coordinate.longitude:this.coordinate.lon),latitude:this.parseLonLat(this.coordinate.latitude?this.coordinate.latitude:this.coordinate.lat)})):(this.locationLoading=!0,this.changeDetector.markForCheck(),this.locationService.getLocation(this.locationId).subscribe(o=>{this.location=o,this.resetLocation(o),this.onLocationLoaded.emit(o),this.locationLoading=!1,this.changeDetector.markForCheck()}))),this.startDateSubscription=this.startDate.valueChanges.pipe((0,l.F)(),(0,F.B)(500)).subscribe(o=>{this.stopDate.updateValueAndValidity()}),this.stopDateSubscription=this.stopDate.valueChanges.pipe((0,l.F)(),(0,F.B)(500)).subscribe(o=>{this.startDate.updateValueAndValidity()}),this.formSubscription=this.locationForm.valueChanges.subscribe(()=>{this.onEdit.emit(this.locationForm.dirty)})}enableDisableHasBuffer(){this.point.value?(this.hasBuffer.setValue(!0,{emitEvent:!1}),this.hasBuffer.disable({emitEvent:!1})):this.hasBuffer.enable({emitEvent:!1})}setDestinationMapData(o){this.mapData=Object.assign(new S.CY,{locationType:this.point.value?S.iF.DEFAULT_LOCATION:S.iF.ENTRY_POINT,name:o.name,coordinate:o.coordinate,color:this.color.value,point:this.point.value,entryPoint:o.coordinate,radius:(0,E.hX)(this.buffer.value)?this.point.value?d.DEFAULT_BUFFER:null:this.distanceService.metresFromYards(this.buffer.value),geoJson:this.point.value?this.mapHelperService.coordinateToGeoJson(o.coordinate):this.geoJson.value}),this.changeDetector.markForCheck()}setLocationMapData(o){this.mapData=Object.assign(new S.CY,{locationType:o.point?S.iF.DEFAULT_LOCATION:S.iF.ENTRY_POINT,radiu
1s:o.buffer?o.buffer:o.point?d.DEFAULT_BUFFER:null,color:o.color,name:o.description,geoJson:o.geoJson,id:o.id,entryPoint:o.point?null:o.entryPoint,point:o.point,coordinate:o.entryPoint}),this.changeDetector.markForCheck()}getLocationFromFormData(o){let c=new C.aZ;return c.point=this.point.value,c.color=this.color.value,c.bufferInUserUnit=this.hasBuffer.value?this.buffer.value:null,c.buffer=this.hasBuffer.value?this.distanceService.metresFromYards(this.buffer.value):null,c.entryPoint=o||{longitude:this.parseLonLat(+this.longitude.value),latitude:this.parseLonLat(+this.latitude.value)},c.geoJson=this.geoJson.value,c.color=this.color.value,c}updateCoordinate(o){this.point.value&&this.geoJson.setValue(JSON.stringify(this.mapHelperService.coordinateToGeoJson(o))),this.setLocationMapData(this.getLocationFromFormData(o))}bufferInUserUnit(o){return(0,E.hX)(o.bufferInUserUnit)?this.distanceService.yardsFromMetres(o.buffer):o.bufferInUserUnit}defaultBufferInUserUnit(){return this.distanceService.yardsFromMetres(d.DEFAULT_BUFFER)}parseLonLat(o){if(!(0,E.hX)(o)){let c=Math.pow(10,7);return Math.round(o*c)/c}return o}periodValidator(){return o=>{if(!o||!o.value)return null;const c=o.get("startDate"),u=o.get("stopDate");if(!c.value||!u.value)return c.value||c.setErrors(null),u.value||u.setErrors(null),null;const T={invalid:{message:"allpages.error.date.invalid"}},L=new Date(c.value.valueOf()),I=new Date(u.value.valueOf());L.setSeconds(0),L.setMilliseconds(0),I.setSeconds(0),I.setMilliseconds(0);const N=L.getTime()>=I.getTime();return N?(c.setErrors(T),u.setErrors(T)):(c.setErrors(null),u.setErrors(null)),N?T:null}}getLocationToSave(){let o=new C.xp;o.longitude=this.longitude.value,o.latitude=this.latitude.value;let c=new C.aZ;return c.id=this.locationId,c.description=this.description.value,c.point=this.point.value,c.onlyGeoFencing=this.onlyGeoFencing.value,c.address=this.address.value,c.address.coordinate=o,c.fax=this.fax.value,c.comment1=this.comment1.value,c.comment2=this.comment2.value,c.alwaysShowOnMap=this.alwaysShowOnMap.value,c.geoJson="string"==typeof this.geoJson.value?this.geoJson.value:JSON.stringify(this.geoJson.value),c.bufferInUserUnit=this.buffer.value,c.buffer=this.distanceService.metresFromYards(this.buffer.value),c.point||(c.entryPoint=o),c.color=this.color.value,c.entityType=this.entityType.value,c.startDate=this.startDate.value,c.stopDate=this.stopDate.value,c.hasStartDate=!!c.startDate,c.hasStopDate=!!c.stopDate,c.externalReference=this.externalReference.value,c}getLocationBatchRequest(){let o=new b;return o.allSelected=this.allSelected,o.fences=this.allSelected?null:this.entities,o.uuid=this.uuid,this.setOnlyGeoFencing.value&&(o.onlyGeoFencing=this.onlyGeoFencing.value),this.setAlwaysShowOnMap.value&&(o.alwaysShowOnMap=this.alwaysShowOnMap.value),this.setColor.value&&(o.color=this.color.value),this.setStartDate.value&&(o.hasStartDate=!!this.startDate.value,o.startDate=this.startDate.value),this.setStopDate.value&&(o.hasStopDate=!!this.stopDate.value,o.stopDate=this.stopDate.value),this.setEntityType.value&&(o.entityType=this.entityType.value),o}setErrors(o){Object.keys(o).forEach(c=>{this.locationForm.get(c).setErrors({server:{message:o[c]}})}),this.changeDetector.markForCheck()}isValidNumericValue(o){return!(0,E.hX)(o)&&""!==o.toString().trim()&&!isNaN(+o)}get description(){return this.locationForm.get("description")}get geoJson(){return this.locationForm.get("geoJson")}get point(){return this.locationForm.get("point")}get hasBuffer(){return this.locationForm.get("hasBuffer")}get buffer(){return this.locationForm.get("buffer")}get longitude(){return this.locationForm.get("longitude")}get latitude(){return this.locationForm.get("latitude")}get overwriteAddress(){return this.locationForm.get("overwriteAddress")}get address(){return this.locationForm.get("address")}get color(){return this.locationForm.get("color")}get entityType(){return this.locationForm.get("entityType")}get fax(){return this.locationForm.get("fax")}get comment1(){return this.locationForm.get("comment1")}get comment2(){return this.locationForm.get("comment2")}get startDate(){return this.locationForm.get("startDate")}get stopDate(){return this.locationForm.get("stopDate")}get onlyGeoFencing(){return this.locationForm.get("onlyGeoFencing")}get alwaysShowOnMap(){return this.locationForm.get("alwaysShowOnMap")}get externalReference(){return this.locationForm.get("externalReference")}get setOnlyGeoFencing(){return this.locationForm.get("setOnlyGeoFencing")}get setAlwaysShowOnMap(){return this.locationForm.get("setAlwaysShowOnMap")}get setColor(){return this.locationForm.get("setColor")}get setStartDate(){return this.locationForm.get("setStartDate")}get setStopDate(){return this.locationForm.get("setStopDate")}get setEntityType(){return this.locationForm.get("setEntityType")}static{this.\u0275fac=function(c){return new(c||d)(t.rXU(a.ze),t.rXU(x.n),t.rXU(O.T),t.rXU(X.m),t.rXU(D.N),t.rXU(A.r),t.rXU(R.gRc))}}static{this.\u0275cmp=t.VBU({type:d,selectors:[["locations-form"]],hostBindings:function(c,u){1&c&&t.bIt("keydown",function(L){return u.onKeyDown(L)})},inputs:{allSelected:"allSelected",entities:"entities",uuid:"uuid",locationId:"locationId",coordinate:"coordinate"},outputs:{onEdit:"onEdit",onFullScreen:"onFullScreen",onSave:"onSave",onCreateEvent:"onCreateEvent",onLocationLoaded:"onLocationLoaded"},standalone:!1,decls:2,vars:4,consts:[[3,"loading","size","center"],[1,"locationFormContainer"],[1,"locationForm"],[3,"formGroup"],[1,"row","locationButtons"],["field-required",""],[1,"row","form-group"],[1,"col-12"],["type","text","formControlName","description",1,"form-control"],[3,"control"],[3,"ngClass"],[1,"row",3,"ngClass"],[1,"col-12",3,"ngClass"],[1,"geocoderContainer","form-group",3,"ngClass"],[1,"mapContainer"],[3,"locationChanged","locationPositionChanged","mapKey","location"],[1,"fullScreenMap","googleButton",3,"click"],[1,"fas",3,"ngClass"],[1,"mapFormContainer"],[1,"input-group","input-group-sm",3,"ngClass"],[1,"input-group-text"],["type","checkbox","checked","checked","formControlName","hasBuffer"],["type","text","formControlName","buffer",1,"form-control"],["type","text","formControlName","longitude",1,"form-control"],["type","text","formControlName","latitude",1,"form-control"],[3,"control","errorMessage"],[1,"row"],[1,"switch","small","float-start"],["type","checkbox","formControlName","overwriteAddress","id","overwriteAddress"],[1,"slider","round"],["for","overwriteAddress"],["formControlName","address"],["type","checkbox","formControlName","setColor"],[1,"colorContainer"],["formControlName","color"],["type","checkbox","formControlName","setEntityType"],["formControlName","entityType",3,"placeholder","entityTypes"],["type","checkbox","formControlName","setStartDate"],["formControlName","startDate",3,"optional","includeTime","hidePreviousNext"],["type","checkbox","formControlName","setStopDate"],["formControlName","stopDate",3,"optional","includeTime","hidePreviousNext"],["type","checkbox","formControlName","setOnlyGeoFencing"],[1,"switch","small"],["type","checkbox","formControlName","onlyGeoFencing"],["type","checkbox","formControlName","setAlwaysShowOnMap"],["type","checkbox","formControlName","alwaysShowOnMap"],["type","checkbox","formControlName","setColor",3,"change"],["type","checkbox","formControlName","setEntityType",3,"change"],["type","text","formControlName","fax",1,"form-control"],["type","text","formControlName","comment1",1,"form-control"],["type","text","formControlName","comment2",1,"form-control"],["type","checkbox","formControlName","setStartDate",3,"change"],["type","checkbox","formControlName","setStopDate",3,"change"],["type","checkbox","formControlName","setOnlyGeoFencing",3,"change"],["type","checkbox","formControlName","setAlwaysShowOnMap",3,"change"],["type","text","formControlName","externalReference",1,"form-control"],["type","button",1,"btn","btn-sm","float-start"],[3,"onButtonClick","success","failed","buttonDisabled","alignRight"],["type","button",1,"btn","btn-sm","float-start",3,"click"]],template:function(c,u){1&c&&(t.nrm(0,"progress-indicator",0),t.nVh(1,Ct,6,4,"div",1)),2&c&&(t.Y8G("loading",u.loading||u.locationLoading)("size",30)("center",!0),t.R7$(),t.vxM(u.loading||u.locationLoading?-1:1))},dependencies:[J.YU,a.qT,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,j.w,Y.l,H.Z,W.L,K.G,z.O,Q.T,Z.E,q.i,tt.D,v.i],styles:[".locationFormContainer[_ngcontent-%COMP%]{display:flex;display:-ms-flexbox;flex-direction:column;height:100%}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]{flex:1 1 auto;-ms-flex:1 1 auto;overflow-y:auto;overflow-x:hidden;height:calc(100% - 41px)}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   date-input[_ngcontent-%COMP%]{display:block}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .mapFormContainer[_ngcontent-%COMP%]{padding:5px;border:1px solid var(--colors-general-soft-grey);border-top:none;display:flex;flex-wrap:nowrap;flex-direction:row;align-items:flex-start}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .mapFormContainer[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]{margin:0 5px 0 0}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .mapFormContainer[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{padding-left:8px;padding-right:8px}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .mapFormContainer[_ngcontent-%COMP%]   .input-group[_ngcontent-%COMP%]:not(:first-of-type){margin-left:10px}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .mapFormContainer[_ngcontent-%COMP%]   .input-group[_ngcontent-%COMP%]:first-of-type{flex-wrap:nowrap}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .mapFormContainer[_ngcontent-%COMP%]   .input-group[_ngcontent-%COMP%]:first-of-type   input[type=text][_ngcontent-%COMP%]{width:50px}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .mapContainer[_ngcontent-%COMP%]{position:relative;flex:1 1 auto;-ms-flex:1 1 auto;height:350px}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .mapContainer[_ngcontent-%COMP%]   .fullScreenMap[_ngcontent-%COMP%]{position:absolute;top:6px;right:0;z-index:1}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .fullScreen[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .fullScreen[_ngcontent-%COMP%]   .mapContainer[_ngcontent-%COMP%]{height:calc(100% - 50px)}.locationFormContainer[_ngcontent-%COMP%]   .locationForm[_ngcontent-%COMP%]   .colorContainer[_ngcontent-%COMP%]{position:relative}.locationFormContainer[_ngcontent-%COMP%]   .locationButtons[_ngcontent-%COMP%]{flex:0 0 auto;-ms-flex:0 0 auto}"],changeDetection:0})}}return d})()},63251:(w,y,r)=>{r.d(y,{I:()=>l});var t=r(13693),C=r(2615),a=r(29330);let l=(()=>{class F extends t.S{static{this.statusCodesUrl="../protected/settings/account/statusCodes/list.json"}static{this.statusCodesSaveUrl="../protected/settings/account/statusCodes/save.json"}static{this.statusCodesDeleteUrl="../protected/settings/account/statusCodes/delete.json"}static{this.statusCodesLocationUrl="../protected/settings/account/statusCodes/location.json"}static{this.statusCodesLocationSaveUrl="../protected/settings/account/statusCodes/location/save.json"}constructor(f){super(F),this.http=f}getStatusCodes(f){return this.http.get(F.statusCodesUrl,{params:f})}saveStatusCode(f){return this.http.post(F.statusCodesSaveUrl,f)}deleteStatusCode(f){return this.http.post(F.statusCodesDeleteUrl,{id:f})}getLocationStatusCodes(f){return this.http.get(F.statusCodesLocationUrl,{params:{fenceId:f}})}setLocationStatusCode(f){return this.http.post(F.statusCodesLocationSaveUrl,f)}static{this.\u0275fac=function(S){return new(S||F)(C.KVO(a.Qq))}}static{this.\u0275prov=C.jDH({token:F,factory:F.\u0275fac,providedIn:"root"})}}return F})()},72146:(w,y,r)=>{r.r(y),r.d(y,{LocationEditComponent:()=>Ut});var t=r(73664),C=r(60516),a=r(27208),l=r(2615),F=r(17705),E=r(87531),f=r(52003),S=r(6009),p=r(72200),b=r(57515),_=r(23891),g=r(11847),R=r(39006),x=r(86136),O=r(8476),X=r(87788),D=r(73807),A=r(32146),J=r(32986),j=r(77120);function Y(n,m){if(1&n){const e=t.RV6();t.j41(0,"button",6),t.bIt("click",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.loadLocationForm())}),t.nrm(1,"i",7),t.EFF(2),t.nI1(3,"translate"),t.k0s()}2&n&&(t.R7$(2),t.SpI(" ",t.bMT(3,1,"fuelEconomy.form.createNew")," "))}function H(n,m){if(1&n){const e=t.RV6();t.j41(0,"i",11),t.bIt("click",function(i){l.eBV(e);const h=t.XpG().$implicit,M=t.XpG();return l.Njj(M.showQrCode(h.code,i))}),t.k0s()}}function W(n,m){if(1&n){const e=t.RV6();t.j41(0,"i",12),t.nI1(1,"translate"),t.bIt("click",function(){l.eBV(e);const i=t.XpG().$implicit,h=t.XpG();return l.Njj(h.loadLocationForm(i))}),t.k0s()}2&n&&t.Y8G("title",t.mNQ(t.bMT(1,2,"allpages.button.edit")))}function K(n,m){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.nVh(4,H,1,0,"i",8),t.k0s(),t.j41(5,"td"),t.EFF(6),t.k0s(),t.j41(7,"td",9),t.nVh(8,W,2,4,"i",10),t.k0s()()),2&n){const e=m.$implicit,s=t.XpG();t.R7$(2),t.JRh(e.description),t.R7$(2),t.vxM(e.code?4:-1),t.R7$(2),t.Lme("",null==e.start?null:e.start.date," - ",null==e.stop?null:e.stop.date),t.R7$(2),t.vxM(s.canEditLocations?8:-1)}}function z(n,m){if(1&n){const e=t.RV6();t.j41(0,"span",11),t.bIt("click",function(i){l.eBV(e);const h=t.XpG().$implicit,M=t.XpG();return l.Njj(M.showQrCode(h.code,i))}),t.k0s()}}function Q(n,m){if(1&n){const e=t.RV6();t.j41(0,"i",12),t.nI1(1,"translate"),t.bIt("click",function(){l.eBV(e);const i=t.XpG().$implicit,h=t.XpG();return l.Njj(h.loadLocationForm(i))}),t.k0s()}2&n&&t.Y8G("title",t.mNQ(t.bMT(1,2,"allpages.button.edit")))}function Z(n,m){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.nVh(4,z,1,0,"span",8),t.k0s(),t.j41(5,"td"),t.EFF(6),t.k0s(),t.j41(7,"td",9),t.nVh(8,Q,2,4,"i",10),t.k0s()()),2&n){const e=m.$implicit,s=t.XpG();t.R7$(2),t.JRh(e.description),t.R7$(2),t.vxM(e.code?4:-1),t.R7$(2),t.Lme("",null==e.start?null:e.start.date," - ",null==e.stop?null:e.stop.date),t.R7$(2),t.vxM(s.canEditLocations?8:-1)}}function q(n,m){if(1&n){const e=t.RV6();t.j41(0,"qr-code-popup",13),t.bIt("onClose",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.codePopup.visible=!1)}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("ngStyle",e.codePopup.position)("qrCode",e.codePopup.code)}}let tt=(()=>{class n{set groupType(e){let s=e!=this.groupType;this._groupType=e,!this.loading&&!(0,C.hX)(this.id)&&s&&this.loadLocations(this.id)}set id(e){this._id=e,!this.loading&&!(0,C.hX)(this.groupType)&&this.loadLocations(e)}constructor(e,s,i,h){this.costStockLocationService=e,this.sortService=s,this.permissionService=i,this.stylesService=h,this.onSelect=new t.bkB,this.groupTypeType=a.MH,this.codePopup={visible:!1}}loadLocations(e){this.loading=!0,this.costStockLocationService.getEntityCostStockLocations(e,this.groupType,this.linkGroupType).subscribe(s=>{this.locations=s.locations?this.sortService.sort(s.locations,"description",!1,!0):null,this.inactiveLocations=s.inactiveLocations?this.sortService.sort(s.inactiveLocations,"description",!1,!0):null,this.loading=!1})}loadLocationForm(e){this.onSelect.emit({id:e?e.id:null,groupType:this.groupType})}showQrCode(e,s){let i=this.stylesService.getCssProperty("--navigation-header-height").replace("px","");
1this.codePopup.visible=!0,this.codePopup.code=e,this.codePopup.position={top:s.clientY-(+i+60)+30+"px",left:0,right:"auto"}}get canAddLocations(){return this.permissionService.get("COST_STOCK_LOCATION_VIEW")&&this.permissionService.get("COST_STOCK_LOCATION_ADD")}get canEditLocations(){return this.permissionService.get("COST_STOCK_LOCATION_VIEW")&&this.permissionService.get("COST_STOCK_LOCATION_EDIT")}get groupType(){return this._groupType}get id(){return this._id}static{this.\u0275fac=function(s){return new(s||n)(t.rXU(O.G),t.rXU(X.a),t.rXU(D.n),t.rXU(A.Y))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["entity-cost-stock-locations"]],inputs:{groupType:"groupType",linkGroupType:"linkGroupType",id:"id"},outputs:{onSelect:"onSelect"},standalone:!1,decls:45,vars:26,consts:[[1,"row"],[1,"col-12"],[1,"btn","btn-sm","float-end","nomargin"],[1,"locationListContainer"],[1,"table"],[3,"ngStyle","qrCode"],[1,"btn","btn-sm","float-end","nomargin",3,"click"],[1,"fas","fa-plus"],[1,"fas","fa-qrcode","attention"],[1,"text-right"],[1,"fas","fa-pen","action",3,"title"],[1,"fas","fa-qrcode","attention",3,"click"],[1,"fas","fa-pen","action",3,"click","title"],[3,"onClose","ngStyle","qrCode"]],template:function(s,i){1&s&&(t.j41(0,"div",0)(1,"div",1),t.nVh(2,Y,4,3,"button",2),t.k0s()(),t.j41(3,"div",3)(4,"h3"),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"table",4)(8,"thead")(9,"tr")(10,"th"),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.j41(13,"th"),t.EFF(14),t.nI1(15,"translate"),t.k0s(),t.j41(16,"th"),t.EFF(17),t.nI1(18,"translate"),t.k0s(),t.nrm(19,"th"),t.k0s()(),t.j41(20,"tbody"),t.Z7z(21,K,9,5,"tr",null,t.fX1),t.k0s()()(),t.nrm(23,"hr"),t.j41(24,"div",3)(25,"h3"),t.EFF(26),t.nI1(27,"translate"),t.k0s(),t.j41(28,"table",4)(29,"thead")(30,"tr")(31,"th"),t.EFF(32),t.nI1(33,"translate"),t.k0s(),t.j41(34,"th"),t.EFF(35),t.nI1(36,"translate"),t.k0s(),t.j41(37,"th"),t.EFF(38),t.nI1(39,"translate"),t.k0s(),t.nrm(40,"th"),t.k0s()(),t.j41(41,"tbody"),t.Z7z(42,Z,9,5,"tr",null,t.fX1),t.k0s()()(),t.nVh(44,q,1,2,"qr-code-popup",5)),2&s&&(t.R7$(2),t.vxM(i.canAddLocations?2:-1),t.R7$(3),t.SpI(" ",t.bMT(6,10,i.groupType===i.groupTypeType.COST_LOCATION?"permission.PAGE_COST_LOCATIONS":"permission.PAGE_STOCK_LOCATIONS")," "),t.R7$(6),t.JRh(t.bMT(12,12,"allpages.description")),t.R7$(3),t.JRh(t.bMT(15,14,"settings.person.QR_CODE")),t.R7$(3),t.JRh(t.bMT(18,16,"allpages.period")),t.R7$(4),t.Dyx(i.locations),t.R7$(5),t.JRh(t.bMT(27,18,"interactiveView.activity.inactive")),t.R7$(6),t.JRh(t.bMT(33,20,"allpages.description")),t.R7$(3),t.JRh(t.bMT(36,22,"settings.person.QR_CODE")),t.R7$(3),t.JRh(t.bMT(39,24,"allpages.period")),t.R7$(4),t.Dyx(i.inactiveLocations),t.R7$(2),t.vxM(i.codePopup.visible?44:-1))},dependencies:[p.B3,J.C,j.D],styles:[".locationListContainer[_ngcontent-%COMP%]{height:auto}.locationListContainer[_ngcontent-%COMP%]:not(:last-of-type){margin-bottom:20px}"]})}}return n})();var v=r(89417),P=r(97059),$=r(35110),et=r(77278),V=r(48926),U=r(86806),ot=r(44977),nt=r(34098);const G=n=>({"has-error":n});function it(n,m){1&n&&(t.j41(0,"h3"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.JRh(t.bMT(2,1,"checkinAtWork.sites.edit")))}function st(n,m){1&n&&(t.j41(0,"h3"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&n&&(t.R7$(),t.JRh(t.bMT(2,1,"checkinAtWork.sites.register")))}function at(n,m){if(1&n&&(t.j41(0,"div",11),t.nrm(1,"div",15),t.j41(2,"div",16),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"div",16),t.EFF(6),t.nI1(7,"date"),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(3),t.SpI("",t.bMT(4,2,"allpages.date.start"),":"),t.R7$(3),t.JRh(t.i5U(7,4,e.resetTimeClockSite.begin,"dd/MM/yyyy"))}}function rt(n,m){if(1&n&&(t.j41(0,"div",11),t.nrm(1,"div",15),t.j41(2,"div",16),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"div",16),t.EFF(6),t.nI1(7,"date"),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(3),t.SpI("",t.bMT(4,2,"allpages.date.stop"),":"),t.R7$(3),t.JRh(t.i5U(7,4,e.resetTimeClockSite.end,"dd/MM/yyyy"))}}function lt(n,m){if(1&n&&(t.j41(0,"div",1)(1,"div",11)(2,"div",14),t.EFF(3),t.nI1(4,"translate"),t.k0s()(),t.j41(5,"div",11),t.nrm(6,"div",15),t.j41(7,"div",16),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.j41(10,"div",16),t.EFF(11),t.k0s()(),t.j41(12,"div",11),t.nrm(13,"div",15),t.j41(14,"div",16),t.EFF(15),t.nI1(16,"translate"),t.k0s(),t.j41(17,"div",16),t.EFF(18),t.k0s()(),t.j41(19,"div",11),t.nrm(20,"div",15),t.j41(21,"div",16),t.EFF(22),t.nI1(23,"translate"),t.k0s(),t.j41(24,"div",16),t.EFF(25),t.k0s()(),t.nVh(26,at,8,7,"div",11),t.nVh(27,rt,8,7,"div",11),t.k0s()),2&n){const e=t.XpG();t.R7$(3),t.SpI(" ",t.bMT(4,9,"checkinAtWork.sites.error.timeClock.confirm")," "),t.R7$(5),t.SpI("",t.bMT(9,11,"allpages.description"),":"),t.R7$(3),t.JRh(e.resetTimeClockSite.description),t.R7$(4),t.SpI("",t.bMT(16,13,"checkinAtWork.sites.rszNumber"),":"),t.R7$(3),t.JRh(e.resetTimeClockSite.registrationNr),t.R7$(4),t.SpI("",t.bMT(23,15,"checkinAtWork.sites.fence"),":"),t.R7$(3),t.JRh(e.resetTimeClockSite.fenceDescription),t.R7$(),t.vxM(e.resetTimeClockSite.begin?26:-1),t.R7$(),t.vxM(e.resetTimeClockSite.end?27:-1)}}function ct(n,m){if(1&n&&(t.j41(0,"div",2)(1,"div",7)(2,"label"),t.nrm(3,"input",17),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nrm(6,"search-dropdown",18)(7,"show-errors",6),t.k0s()(),t.j41(8,"div",2)(9,"div",7)(10,"label"),t.nrm(11,"input",19),t.EFF(12),t.nI1(13,"translate"),t.k0s()()()),2&n){const e=t.XpG();t.R7$(4),t.SpI(" ",t.bMT(5,4,"checkinAtWork.sites.timeClock")," "),t.R7$(2),t.Y8G("options",e.timeClockOptions),t.R7$(),t.Y8G("control",e.timeClockId),t.R7$(5),t.SpI(" ",t.bMT(13,6,"checkinAtWork.checkin.site.rename")," ")}}function dt(n,m){if(1&n&&(t.j41(0,"div",2)(1,"div",20)(2,"label"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.nrm(5,"date-input",21)(6,"show-errors",22),t.k0s(),t.j41(7,"div",20)(8,"label"),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.nrm(11,"date-input",23)(12,"show-errors",22),t.k0s()()),2&n){const e=t.XpG();t.R7$(),t.Y8G("ngClass",t.eq3(14,G,e.hasError(e.begin))),t.R7$(2),t.JRh(t.bMT(4,10,"allpages.date.start")),t.R7$(2),t.Y8G("hidePreviousNext",!0)("optional",!0),t.R7$(),t.Y8G("control",e.begin),t.R7$(),t.Y8G("ngClass",t.eq3(16,G,e.hasError(e.end))),t.R7$(2),t.JRh(t.bMT(10,12,"allpages.date.stop")),t.R7$(2),t.Y8G("hidePreviousNext",!0)("optional",!0),t.R7$(),t.Y8G("control",e.end)}}function ht(n,m){if(1&n){const e=t.RV6();t.j41(0,"button",24),t.bIt("click",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.resetSite())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&n&&(t.R7$(),t.JRh(t.bMT(2,1,"allpages.button.reset")))}let ut=(()=>{class n{set site(e){e&&(this._site=e,setTimeout(()=>{this.setSiteForm(e)}))}get site(){return this._site}constructor(e,s){this.checkinAtWorkService=e,this.permissionService=s,this.onCancel=ne
1w t.bkB,this.onEdit=new t.bkB,this.onSave=new t.bkB,this.contractor=!0,this.resetTimeClockSite=null}ngOnInit(){this.siteForm=this.createSiteForm(),"true"===this.permissionService.getPreference("block_edit_external_reference")&&this.externalReference.disable({emitEvent:!1}),this.catchHasTimeClockChanges(),this.catchSiteFormChanges(),this.loadTimeClocks()}cancelSite(){this.onCancel.emit()}hasError(e){return e&&e.errors&&(e.dirty||e.touched)}resetSite(){this.setSiteForm(this._site)}saveSite(){if(Object.values(this.siteForm.controls).forEach(h=>{h.markAsTouched()}),this.siteForm.invalid&&!this.timeClockId.invalid)return;this.buttonDisabled=!0,this.failed=!1;const e={description:this.description.value,reference:this.reference.value,externalReference:this.externalReference.value,registrationNr:this.registrationNr.value,timeClockId:this.hasTimeClock.value?this.timeClockId.value:null,fenceId:this.site.fenceId,begin:this.begin.value?this.fixPeriod(this.begin.value,!1):null,end:this.end.value?this.fixPeriod(this.end.value,!1):null};this.site.id&&(e.id=this.site.id);const s=(0,C.hX)(this.resetTimeClockSite)?null:this.resetTimeClockSite.id;let i=new P.nW;i.site=e,i.renameTimeClock=this.renameTimeClock.value,i.resetTimeClockSite=s,this.checkinAtWorkService.saveSite(i).subscribe(h=>{this.buttonDisabled=!1,h.errors?(this.failed=!0,this.setErrors(h.errors),h.timeClockSite&&this.hasTimeClock.value&&(this.resetTimeClockSite=Object.assign(h.timeClockSite,{fenceDescription:h.fenceDescription}))):(this.renameTimeClock.value&&this.loadTimeClocks(),this.siteSaved=!0,this.onSave.emit(),this.resetSite(),setTimeout(()=>{this.siteSaved=!1},3e3))})}catchHasTimeClockChanges(){this.hasTimeClock.valueChanges.subscribe(e=>{e?this.timeClockId.enable():this.timeClockId.disable(),this.timeClockId.setValue(null)})}catchSiteFormChanges(){this.siteForm.valueChanges.subscribe(()=>{this.onEdit.emit(this.siteForm.dirty)})}createSiteForm(){return new v.J3({description:new v.hs("",v.k0.required),reference:new v.hs(""),externalReference:new v.hs(""),registrationNr:ne
1w v.hs("",v.k0.required),hasTimeClock:new v.hs(!1),timeClockId:new v.hs({value:"",disabled:!0}),renameTimeClock:new v.hs(!1),begin:new v.hs(null),end:new v.hs(null)},this.validateDates())}fixPeriod(e,s){return e.setHours(s?23:0),e.setMinutes(s?59:0),e.setSeconds(s?59:0),e.setMilliseconds(0),e}loadTimeClocks(){this.checkinAtWorkService.getTimeClocks().subscribe(e=>{this.timeClocks=e;let s=new $.wy;s.items=this.timeClocks,s.descriptionKey="label",s.valueKey="value",this.timeClockOptions=s})}setErrors(e){Object.keys(e).forEach(s=>{this.siteForm.controls[s].setErrors({server:{message:e[s]}})})}setSiteForm(e){this.resetTimeClockSite=null,this.siteForm.reset({description:e.description,reference:e.reference,externalReference:e.externalReference,registrationNr:e.registrationNr,hasTimeClock:!(0,C.hX)(e.timeClockId),timeClockId:e.timeClockId,renameTimeClock:!1,begin:e.begin,end:e.end}),this.contractor?this.description.enable():this.description.disable(),this.contractor?this.reference.enable():this.reference.disable(),this.contractor?this.registrationNr.enable():this.registrationNr.disable(),setTimeout(()=>{this.begin.markAsPristine(),this.end.markAsPristine(),this.onEdit.emit(this.siteForm.dirty)},250)}validateDates(){return e=>{if(!e||!e.value)return null;const s=e.get("begin"),i=e.get("end");if(!s.value||!i.value)return s.setErrors(null),i.setErrors(null),null;const h={invalid:{message:"allpages.error.date.invalid"}},M=new Date(s.value.valueOf()),gt=new Date(i.value.valueOf());M.setSeconds(0),M.setMilliseconds(0),gt.setSeconds(0),gt.setMilliseconds(0);const vt=M.getTime()>=gt.getTime();return vt?(s.setErrors(h),i.setErrors(h)):(s.setErrors(null),i.setErrors(null)),vt?h:null}}get begin(){return this.siteForm.get("begin")}get description(){return this.siteForm.get("description")}get end(){return this.siteForm.get("end")}get externalReference(){return this.siteForm.get("externalReference")}get hasTimeClock(){return this.siteForm.get("hasTimeClock")}get isDisabled(){return this.siteForm.invalid&&!this.timeClockId.invalid||!this.siteForm.dirty&&!this.siteForm.touched||this.buttonDisabled}get reference(){return this.siteForm.get("reference")}get registrationNr(){return this.siteForm.get("registrationNr")}get renameTimeClock(){return this.siteForm.get("renameTimeClock")}get timeClockId(){return this.siteForm.get("timeClockId")}static{this.\u0275fac=function(s){return new(s||n)(t.rXU(et.x),t.rXU(D.n))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["checkin-site-form"]],inputs:{site:"site"},outputs:{onCancel:"onCancel",onEdit:"onEdit",onSave:"onSave"},standalone:!1,decls:40,vars:33,consts:[["novalidate","",3,"formGroup"],[1,"alert","alert-danger"],[1,"row","form-group"],[1,"col-12",3,"ngClass"],["field-required",""],["type","text","formControlName","description",1,"form-control"],[3,"control"],[1,"col-12"],["type","text","formControlName","reference",1,"form-control"],["type","text","formControlName","registrationNr",1,"form-control"],["formControlName","externalReference",1,"form-control"],[1,"row"],[1,"btn","btn-sm","float-start"],[3,"click","success","failed","buttonDisabled","alignRight"],[1,"col-md-12"],[1,"col-md-1"],[1,"col-md-5"],["type","checkbox","formControlName","hasTimeClock"],["formControlName","timeClockId",3,"options"],["type","checkbox","formControlName","renameTimeClock"],[1,"col-6",3,"ngClass"],["formControlName","begin",3,"hidePreviousNext","optional"],[2,"display","block","clear","both","margin-left","15px",3,"control"],["formControlName","end",3,"hidePreviousNext","optional"],[1,"btn","btn-sm","float-start",3,"click"]],template:function(s,i){1&s&&(t.j41(0,"form",0),t.nVh(1,it,3,3,"h3"),t.nVh(2,st,3,3,"h3"),t.nVh(3,lt,28,17,"div",1),t.j41(4,"div",2)(5,"div",3)(6,"label"),t.EFF(7),t.nI1(8,"translate"),t.k0s(),t.nrm(9,"span",4)(10,"input",5)(11,"show-errors",6),t.k0s()(),t.j41(12,"div",2)(13,"div",7)(14,"label"),t.EFF(15),t.nI1(16,"translate"),t.k0s(),t.nrm(17,"input",8)(18,"show-errors",6),t.k0s()(),t.j41(19,"div",2)(20,"div",3)(21,"label"),t.EFF(22),t.nI1(23,"translate"),t.k0s(),t.nrm(24,"span",4)(25,"input",9)(26,"show-errors",6),t.k0s()(),t.nVh(27,ct,14,8),t.nVh(28,dt,13,18,"div",2),t.j41(29,"div",2)(30,"div",7)(31,"label"),t.EFF(32),t.nI1(33,"translate"),t.k0s(),t.nrm(34,"input",10)(35,"show-errors",6),t.k0s()(),t.j41(36,"div",11)(37,"div",7),t.nVh(38,ht,3,3,"button",12),t.j41(39,"success-submit-button",13),t.bIt("click",function(){return i.saveSite()}),t.k0s()()()()),2&s&&(t.Y8G("formGroup",i.siteForm),t.R7$(),t.vxM(i.site.id?1:-1),t.R7$(),t.vxM(i.site.id?-1:2),t.R7$(),t.vxM(i.resetTimeClockSite?3:-1),t.R7$(2),t.Y8G("ngClass",t.eq3(29,G,i.hasError(i.description))),t.R7$(2),t.JRh(t.bMT(8,21,"allpages.description")),t.R7$(4),t.Y8G("control",i.description),t.R7$(4),t.JRh(t.bMT(16,23,"checkinAtWork.sites.reference")),t.R7$(3),t.Y8G("control",i.reference),t.R7$(2),t.Y8G("ngClass",t.eq3(31,G,i.hasError(i.registrationNr))),t.R7$(2),t.JRh(t.bMT(23,25,"checkinAtWork.sites.rszNumber")),t.R7$(4),t.Y8G("control",i.registrationNr),t.R7$(),t.vxM(i.timeClocks&&i.timeClocks.length?27:-1),t.R7$(),t.vxM(i.contractor?28:-1),t.R7$(4),t.JRh(t.bMT(33,27,"allpages.externalReference")),t.R7$(3),t.Y8G("control",i.externalReference),t.R7$(3),t.vxM(i.site.id?38:-1),t.R7$(),t.Y8G("success",i.siteSaved)("failed",i.failed)("buttonDisabled",i.isDisabled)("al
1ignRight",!0))},dependencies:[p.YU,v.qT,v.me,v.Zm,v.BC,v.cb,v.j4,v.JD,V.w,U.l,$.Hq,ot.G,nt.T,p.vh,j.D],styles:["h3[_ngcontent-%COMP%]{margin-top:0;margin-bottom:10px}date-input[_ngcontent-%COMP%]{display:block}"]})}}return n})();var mt=r(51727);function pt(n,m){if(1&n){const e=t.RV6();t.j41(0,"button",5),t.bIt("click",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.upsertSite())}),t.nrm(1,"i",6),t.EFF(2),t.nI1(3,"translate"),t.k0s()}2&n&&(t.R7$(2),t.SpI(" ",t.bMT(3,1,"checkinAtWork.sites.register")," "))}function ft(n,m){if(1&n){const e=t.RV6();t.j41(0,"i",9),t.nI1(1,"translate"),t.bIt("click",function(){l.eBV(e);const i=t.XpG().$implicit,h=t.XpG();return l.Njj(h.upsertSite(i))}),t.k0s()}2&n&&t.Y8G("title",t.mNQ(t.bMT(1,2,"allpages.button.edit")))}function Ct(n,m){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.EFF(6),t.k0s(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td",7),t.nVh(10,ft,2,4,"i",8),t.k0s()()),2&n){const e=m.$implicit,s=t.XpG();t.R7$(2),t.JRh(e.description),t.R7$(2),t.JRh(e.reference),t.R7$(2),t.JRh(e.registrationNr),t.R7$(2),t.Lme("",null==e.begin?null:e.begin.date," - ",null==e.end?null:e.end.date),t.R7$(2),t.vxM(s.canEditSites?10:-1)}}function _t(n,m){if(1&n){const e=t.RV6();t.j41(0,"i",9),t.nI1(1,"translate"),t.bIt("click",function(){l.eBV(e);const i=t.XpG().$implicit,h=t.XpG();return l.Njj(h.upsertSite(i))}),t.k0s()}2&n&&t.Y8G("title",t.mNQ(t.bMT(1,2,"allpages.button.edit")))}function d(n,m){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.EFF(6),t.k0s(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td",7),t.nVh(10,_t,2,4,"i",8),t.k0s()()),2&n){const e=m.$implicit,s=t.XpG();t.R7$(2),t.JRh(e.description),t.R7$(2),t.JRh(e.reference),t.R7$(2),t.JRh(e.registrationNr),t.R7$(2),t.Lme("",null==e.begin?null:e.begin.date," - ",null==e.end?null:e.end.date),t.R7$(2),t.vxM(s.canEditSites?10:-1)}}let k=(()=>{class n{set entityId(e){this._entityId=e,e&&this.loadCheckinSites(e)}constructor(e,s){this.locationService=e,this.permissionService=s,this.onSelect=new t.bkB}loadCheckinSites(e){this.locationService.getLocationCheckinSites(e).subscribe(s=>{this.siteData=s})}upsertSite(e){const s=e||Object.assign(new P.$y,{fenceId:this.entityId});this.onSelect.emit(s)}get canAddSites(){return this.permissionService.get("SITE_VIEW")&&this.permissionService.get("SITE_ADD")}get canEditSites(){return this.permissionService.get("SITE_VIEW")&&this.permissionService.get("SITE_EDIT")}get entityId(){return this._entityId}static{this.\u0275fac=function(s){return new(s||n)(t.rXU(mt.N),t.rXU(D.n))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["location-checkin-info"]],inputs:{entityId:"entityId"},outputs:{onSelect:"onSelect"},standalone:!1,decls:46,vars:31,consts:[[1,"row"],[1,"col-12"],[1,"btn","btn-sm","float-end","nomargin"],[1,"sitesListContainer"],[1,"sitesList"],[1,"btn","btn-sm","float-end","nomargin",3,"click"],[1,"fas","fa-plus"],[1,"text-right"],[1,"fas","fa-pen","action",3,"title"],[1,"fas","fa-pen","action",3,"click","title"]],template:function(s,i){1&s&&(t.j41(0,"div",0)(1,"div",1),t.nVh(2,pt,4,3,"button",2),t.k0s()(),t.j41(3,"div",3)(4,"h3"),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"table",4)(8,"tr")(9,"th"),t.EFF(10),t.nI1(11,"translate"),t.k0s(),t.j41(12,"th"),t.EFF(13),t.nI1(14,"translate"),t.k0s(),t.j41(15,"th"),t.EFF(16),t.nI1(17,"translate"),t.k0s(),t.j41(18,"th"),t.EFF(19),t.nI1(20,"translate"),t.k0s(),t.nrm(21,"th"),t.k0s(),t.Z7z(22,Ct,11,6,"tr",null,t.fX1),t.k0s()(),t.nrm(24,"hr"),t.j41(25,"div",3)(26,"h3"),t.EFF(27),t.nI1(28,"translate"),t.k0s(),t.j41(29,"table",4)(30,"tr")(31,"th"),t.EFF(32),t.nI1(33,"translate"),t.k0s(),t.j41(34,"th"),t.EFF(35),t.nI1(36,"translate"),t.k0s(),t.j41(37,"th"),t.EFF(38),t.nI1(39,"translate"),t.k0s(),t.j41(40,"th"),t.EFF(41),t.nI1(42,"translate"),t.k0s(),t.nrm(43,"th"),t.k0s(),t.Z7z(44,d,11,6,"tr",null,t.fX1),t.k0s()()),2&s&&(t.R7$(2),t.vxM(i.canAddSites?2:-1),t.R7$(3),t.SpI(" ",t.bMT(6,11,"permission.ITEM_SITES")," "),t.R7$(5),t.JRh(t.bMT(11,13,"allpages.description")),t.R7$(3),t.JRh(t.bMT(14,15,"workOrders.reference")),t.R7$(3),t.JRh(t.bMT(17,17,"checkinAtWork.sites.rszNumber")),t.R7$(3),t.JRh(t.bMT(20,19,"allpages.period")),t.R7$(3),t.Dyx(null==i.siteData?null:i.siteData.sites),t.R7$(5),t.JRh(t.bMT(28,21,"checkinAtWork.sites.inactive")),t.R7$(5),t.JRh(t.bMT(33,23,"allpages.description")),t.R7$(3),t.JRh(t.bMT(36,25,"w
1orkOrders.reference")),t.R7$(3),t.JRh(t.bMT(39,27,"checkinAtWork.sites.rszNumber")),t.R7$(3),t.JRh(t.bMT(42,29,"allpages.period")),t.R7$(3),t.Dyx(null==i.siteData?null:i.siteData.inactiveSites))},dependencies:[j.D],styles:[".sitesListContainer[_ngcontent-%COMP%]{height:auto}.sitesListContainer[_ngcontent-%COMP%]:not(:last-of-type){margin-bottom:20px}.sitesList[_ngcontent-%COMP%]{width:100%;border-collapse:separate;border-spacing:0 5px}.sitesList[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], .sitesList[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-bottom:1px solid var(--colors-general-soft-grey);padding-bottom:5px;vertical-align:top}h3[_ngcontent-%COMP%]{margin-top:5px}"]})}}return n})();var o=r(50364),c=r(9728),u=r(63251),T=r(96945);const L=n=>({"has-error":n});function I(n,m){1&n&&(t.j41(0,"tr")(1,"td",3)(2,"em"),t.EFF(3),t.nI1(4,"translate"),t.k0s()()()),2&n&&(t.R7$(3),t.JRh(t.bMT(4,1,"allpages.none")))}function N(n,m){if(1&n){const e=t.RV6();t.j41(0,"td")(1,"i",4),t.bIt("click",function(){l.eBV(e);const i=t.XpG().$implicit,h=t.XpG(2);return l.Njj(h.removeStatusCode(i))}),t.k0s()()}}function B(n,m){if(1&n&&(t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.nVh(3,N,2,0,"td"),t.k0s()),2&n){const e=m.$implicit,s=t.XpG(2);t.R7$(2),t.JRh(e.code),t.R7$(),t.vxM(s.canEditCodes?3:-1)}}function Ft(n,m){if(1&n&&t.Z7z(0,B,4,2,"tr",null,t.fX1),2&n){const e=t.XpG();t.Dyx(e.locationCodes)}}function bt(n,m){if(1&n){const e=t.RV6();t.j41(0,"tr")(1,"td",3)(2,"button",5),t.bIt("click",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.createStatusCode())}),t.EFF(3),t.nI1(4,"translate"),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(2),t.Y8G("disabled",e.addNewCode),t.R7$(),t.JRh(t.bMT(4,2,"myLocations.codes.add"))}}function kt(n,m){if(1&n){const e=t.RV6();t.j41(0,"div",2),t.nrm(1,"hr"),t.j41(2,"h3"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"div",6)(6,"div",7),t.nrm(7,"input",8),t.j41(8,"label",9),t.EFF(9),t.nI1(10,"translate"),t.k0s(),t.nrm(11,"autocomplete-dropdown",10)(12,"show-errors",11),t.k0s()(),t.j41(13,"div",6)(14,"div",7),t.nrm(15,"input",12),t.j41(16,"label",13),t.EFF(17),t.nI1(18,"translate"),t.k0s(),t.nrm(19,"translatable-field",14)(20,"show-errors",11),t.k0s()(),t.j41(21,"div",6)(22,"div",15)(23,"button",16),t.bIt("click",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.resetStatusCode())}),t.EFF(24),t.nI1(25,"translate"),t.k0s(),t.j41(26,"success-submit-button",17),t.bIt("click",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.saveStatusCode())}),t.k0s()()()()}if(2&n){const e=t.XpG();t.Y8G("formGroup",e.statusCodeForm),t.R7$(3),t.JRh(t.bMT(4,17,"myLocations.codes.add")),t.R7$(3),t.Y8G("ngClass",t.eq3(25,L,e.hasError(e.existingCode))),t.R7$(),t.Y8G("value",!0),t.R7$(2),t.JRh(t.bMT(10,19,"myLocations.codes.existing")),t.R7$(2),t.Y8G("type",e.timesheetAutocompleteType.PROJECT)("withoutFenceOnly",!0),t.R7$(),t.Y8G("control",e.existingCode),t.R7$(2),t.Y8G("ngClass",t.eq3(27,L,e.hasError(e.newCode))),t.R7$(),t.Y8G("value",!1),t.R7$(2),t.JRh(t.bMT(18,21,"myLocations.codes.new")),t.R7$(3),t.Y8G("control",e.newCode),t.R7$(4),t.JRh(t.bMT(25,23,"allpages.button.cancel")),t.R7$(2),t.Y8G("success",e.statusCodeSaved)("buttonDisabled",e.statusCodeForm.invali
1d||e.buttonDisabled)("buttonText","allpages.button.add")("alignRight",!0)}}let Et=(()=>{class n{constructor(e,s,i,h){this.statusCodesService=e,this.permissionService=s,this.translationService=i,this.sortService=h,this.onEdit=new t.bkB,this.onSave=new t.bkB,this.timesheetAutocompleteType=o.tr}ngOnInit(){this.loadStatusCodes(),this.statusCodeForm=this.createStatusCodeForm(),this.catchUseExistingChanges(),this.catchStatusCodeFormChanges()}catchUseExistingChanges(){this.useExisting.valueChanges.subscribe(e=>{e?(this.existingCode.enable(),this.newCode.reset(new c.G),this.newCode.disable()):(this.existingCode.reset(""),this.existingCode.disable(),this.newCode.enable())})}catchStatusCodeFormChanges(){this.statusCodeForm.valueChanges.subscribe(()=>{this.statusCodeForm.dirty&&this.onEdit.emit(!0)})}createStatusCode(){this.addNewCode=!0}createStatusCodeForm(){return new v.J3({useExisting:new v.hs(!0),existingCode:new v.hs("",v.k0.required),newCode:new v.hs({value:new c.G,disabled:!0},n.codeValidator)})}hasError(e){return e&&e.errors&&(e.dirty||e.touched)}loadStatusCodes(){this.statusCodesService.getLocationStatusCodes(this.entityId).subscribe(e=>{this.locationCodes=e?this.sortService.sort(e,"code",!1,!0):null})}removeStatusCode(e){confirm(this.translationService.get("myLocations.codes.confirmRemove"))&&this.statusCodesService.setLocationStatusCode({fenceId:this.entityId,statusCode:e.id,remove:!0}).subscribe(i=>{this.loadStatusCodes()})}resetStatusCode(){this.addNewCode=!1,this.statusCodeForm.reset({useExisting:!0,existingCode:null,newCode:new c.G}),this.onEdit.emit(!1)}saveStatusCode(){if(Object.values(this.statusCodeForm.controls).forEach(s=>{s.markAsTouched()}
1),this.statusCodeForm.invalid)return;this.buttonDisabled=!0,this.failed=!1;let e={fenceId:this.entityId,remove:!1};this.useExisting.value?e.statusCode=this.existingCode.value:(e.newCode=this.newCode.value.label,e.translations=this.newCode.value.translations),this.statusCodesService.setLocationStatusCode(e).subscribe(s=>{this.buttonDisabled=!1,s.errors?(this.failed=!0,this.setErrors(s.errors)):(this.statusCodeSaved=!0,this.onSave.emit(),this.onEdit.emit(!1),setTimeout(()=>{this.statusCodeSaved=!1,this.loadStatusCodes(),this.resetStatusCode()},2e3))})}setErrors(e){let s=null;"code"in e&&(s={server:{message:this.translationService.get(e.code)}}),this.useExisting.value?this.existingCode.setErrors(s):this.newCode.setErrors(s)}static codeValidator(e){return e.value&&e.value.label&&0!=e.value.label.length?null:{required:{value:e.value}}}get canAddCodes(){return!0===this.permissionService.get("ADVANCED_ID_CODE_ADD")}get canEditCodes(){return!0===this.permissionService.get("ADVANCED_ID_CODE_EDIT")}get existingCode(){return this.statusCodeForm.get("existingCode")}get newCode(){return this.statusCodeForm.get("newCode")}get useExisting(){return this.statusCodeForm.get("useExisting")}static{this.\u0275fac=function(s){return new(s||n)(t.rXU(u.I),t.rXU(D.n),t.rXU(E.L),t.rXU(X.a))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["location-codes-form"]],inputs:{entityId:"entityId"},outputs:{onEdit:"onEdit",onSave:"onSave"},standalone:!1,decls:7,vars:4,consts:[[1,"codeListContainer"],[1,"table"],[1,"statusCodeForm",3,"formGroup"],["colspan","2"],[1,"fas","fa-trash-alt","fa-pull-right","action",3,"click"],[1,"btn","btn-sm",3,"click","disabled"],[1,"row","form-group"],[1,"col-12",3,"ngClass"],["id","useExisting","type","radio","formControlName","useExisting",3,"value"],["for","useExisting"],["formControlName","existingCode",3,"type","withoutFenceOnly"],[3,"control"],["id","useNew","type","radio","formControlName","useExisting",3,"value"],["for","useNew"],["formControlName","newCode"],[1,"col-12"],[1,"btn","btn-sm","float-start",3,"click"],[3,"click","success","buttonDisabled","buttonText","alignRight"]],template:function(s,i){1&s&&(t.j41(0,"div",0)(1,"table",1)(2,"tbody"),t.nVh(3,I,5,3,"tr"),t.nVh(4,Ft,2,0),t.nVh(5,bt,5,4,"tr"),t.k0s()()(),t.nVh(6,kt,27,29,"div",2)),2&s&&(t.R7$(3),t.vxM(i.locationCodes?-1:3),t.R7$(),t.vxM(i.locationCodes?4:-1),t.R7$(),t.vxM(i.canAddCodes?5:-1),t.R7$(),t.vxM(i.addNewCode?6:-1))},dependencies:[p.YU,v.me,v.Fm,v.BC,v.cb,v.j4,v.JD,V.w,U.l,c.b,T.r,j.D],styles:[".codeListContainer[_ngcontent-%COMP%]   .table[_ngcontent-%COMP%]{width:100%}"]})}}return n})();var St=r(36769);const yt=n=>({active:n});function Tt(n,m){if(1&n&&t.EFF(0),2&n){const e=t.XpG(2);t.Lme(" ",e.locationName," (",e.location,") ")}}function Rt(n,m){if(1&n){const e=t.RV6();t.j41(0,"i",13),t.bIt("click",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.cancelLocationEdit())}),t.k0s()}}function Lt(n,m){if(1&n&&(t.j41(0,"h2"),t.nVh(1,Tt,1,2),t.nVh(2,Rt,1,0,"i",12),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.vxM(e.locationName?1:-1),t.R7$(),t.vxM(e.hideCloseButton?-1:2)}}function xt(n,m){if(1&n){const e=t.RV6();t.j41(0,"li",15),t.bIt("click",function(){const i=l.eBV(e).$implicit,h=t.XpG(3);return l.Njj(h.setActiveFlow(i))}),t.j41(1,"a"),t.EFF(2),t.nI1(3,"translate"),t.k0s()()}if(2&n){const e=m.$implicit,s=t.XpG(3);t.Y8G("ngClass",t.eq3(4,yt,s.isActiveFlow(e))),t.R7$(2),t.JRh(t.bMT(3,2,e.title))}}function jt(n,m){if(1&n&&t.Z7z(0,xt,4,6,"li",14,t.fX1),2&n){const e=t.XpG(2);t.Dyx(e.actions)}}function It(n,m){if(1&n){const e=t.RV6();t.j41(0,"li",16),t.bIt("click",function(){l.eBV(e);const i=t.XpG(2);return l.Njj(i.toggleBack(null!=i.costStockLocation))}),t.j41(1,"a"),t.nrm(2,"i",17),t.EFF(3),t.nI1(4,"translate"),t.k0s()()}2&n&&(t.R7$(3),t.SpI("\xa0",t.bMT(4,1,"allpages.button.back")))}function Mt(n,m){if(1&n&&(t.j41(0,"ul",2),t.nVh(1,jt,2,0),t.nVh(2,It,5,3,"li"),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.vxM(e.checkinSite||e.costStockLocationForm?-1:1),t.R7$(),t.vxM(e.costStockLocationForm||e.checkinSite?2:-1)}}function Ot(n,m){if(1&n){const e=t.RV6();t.j41(0,"locations-form",18),t.bIt("onEdit",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.setHasEdit(i))})("onFullScreen",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.detectFullScreen(i))})("onSave",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.refreshFunction.emit(!1))})("onCreateEvent",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.onCreateLocation(i))})("onLocationLoaded",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.onLocationLoaded(i))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("locationId",e.location)("coordinate",e.coordinate)}}function Dt(n,m){if(1&n){const e=t.RV6();t.j41(0,"location-checkin-info",19),t.bIt("onSelect",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.toggleSiteForm(i))}),t.k0s()}if(2&n){const e=t.XpG();
1t.Y8G("entityId",e.location)}}function $t(n,m){if(1&n){const e=t.RV6();t.j41(0,"checkin-site-form",20),t.bIt("onEdit",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.setHasEdit(i))})("onSave",function(){l.eBV(e);const i=t.XpG();return i.refreshFunction.emit(!0),l.Njj(i.toggleSiteForm(null,!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("site",e.checkinSite)}}function Vt(n,m){if(1&n){const e=t.RV6();t.j41(0,"responsible-contact",21),t.bIt("onEdit",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.setHasEdit(i))})("onSaveEvent",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.refreshFunction.emit(!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("entityId",e.location)("groupType",e.groupType.LOCATION)}}function Gt(n,m){if(1&n){const e=t.RV6();t.j41(0,"location-codes-form",22),t.bIt("onEdit",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.setHasEdit(i))})("onSave",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.refreshFunction.emit(!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("entityId",e.location)}}function Nt(n,m){if(1&n){const e=t.RV6();t.j41(0,"suivo-entity-groups",23),t.bIt("onEdit",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.setHasEdit(i))})("onSave",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.refreshFunction.emit(!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("entityId",e.location)("group",e.groupType.LOCATION)}}function wt(n,m){if(1&n){const e=t.RV6();t.j41(0,"custom-fields-data",24),t.bIt("onEdit",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.setHasEdit(i))})("onSaveEvent",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.refreshFunction.emit(!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("entityId",e.location)("group",e.groupType.LOCATION)}}function Bt(n,m){if(1&n){const e=t.RV6();t.j41(0,"avatar-settings",25),t.bIt("onEdit",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.setHasEdit(i))})("onAvatarSave",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.refreshFunction.emit(!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("entityId",e.location)("groupId","LOCATION")}}function Xt(n,m){if(1&n){const e=t.RV6();t.j41(0,"entity-cost-stock-locations",26),t.bIt("onSelect",function(i){l.eBV(e);const h=t.XpG();return l.Njj(h.toggleCostStockLocationForm(i))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("linkGroupType",e.groupType.LOCATION)("id",e.location)("groupType",e.costLocation?e.groupType.COST_LOCATION:e.groupType.STOCK_LOCATION)}}function Pt(n,m){if(1&n){const e=t.RV6();t.j41(0,"cost-stock-location-form",27),t.bIt("refreshFunction",function(){l.eBV(e);const i=t.XpG();return l.Njj(i.toggleCostStockLocationForm(null,!0))}),t.k0s()}if(2&n){const e=t.XpG();t.Y8G("linkedLocation",e.location)("type",e.costStockLocation.groupType)("locationId",e.costStockLocation.id)}}let Ut=(()=>{class n{set activeFlow(e){this._activeFlow=e,!this.actions&&e&&(e.location?e.location.id?this.location=e.location.id:e.location.coordinate&&(this.coordinate=e.location.coordinate):e.closeOnSave&&(this.closeOnSave=!0),this.actions=this.settingsService.getAvailableLocationActions(this.location),e.action||this.setActiveFlow(this.getFlow("locationInfo")))}constructor(e,s,i,h){this.cdRef=e,this.translationService=s,this.globalEvents=i,this.settingsService=h,this.cancelEdit=new t.bkB,this.fullScreenEdit=new t.bkB,this.saveEdit=new t.bkB,this.refreshFunction=new t.bkB,this.hasEditFunction=new t.bkB,this.groupType=a.MH}cancelLocationEdit(){(!this.hasEdit||confirm(this.translationService.get("settings.admin.change.confirm")))&&(this.cancelEdit.emit(!1),this.setHasEdit(!1))}setHasEdit(e){this.hasEdit=e,this.hasEditFunction.emit(e)}detectFullScreen(e){this.fullScreenEdit.emit(e)}onCreateLocation(e){if(this.location=e.id,this.locationName=e.description,this.setHasEdit(!1),this.activeFlow={location:{description:this.locationName,id:this.location},action:"locationInfo"},this.actions=this.settingsService.getAvailableLocationActions(e.id),this.refreshFunction.emit(!1),this.closeOnSave){let s=new a.tI;s.hasChanges=!0,s.locationId=this.location,this.globalEvents.setEntityOptions(s),this.globalEvents.setEntityOptions(new a.SW(null))}}isActiveFlow(e){return this.activeFlow.action===e.action}setActiveFlow(e){(!this.hasEdit||confirm(this.translationService.get("settings.admin.change.confirm")))&&(this.activeFlow=e,this.setHasEdit(!1))}toggleSiteForm(e,s){if(s||!this.hasEdit||confirm(this.translationService.get("settings.admin.change.confirm"))){let i=e;(0,C.hX)(e)||((0,C.hX)(e.begin)||(i.begin=new Date(e.begin.millis)),(0,C.hX)(e.end)||(i.end=new Date(e.end.millis))),this.checkinSite=(0,C.hX)(i)?null:i,this.setHasEdit(!1)}}toggleCostStockLocationForm(e,s){(s||!this.hasEdit||confirm(this.translationService.get("settings.admin.change.confirm")))&&(this.costStockLocation=(0,C.hX)(e)?
1null:e,this.setHasEdit(!1))}toggleBack(e){e?this.toggleCostStockLocationForm():(!this.hasEdit||confirm(this.translationService.get("settings.admin.change.confirm")))&&(this.checkinSite=null,this.setHasEdit(!1))}onLocationLoaded(e){this.location=e.id,this.locationName=e.description}getFlow(e){return this.actions.find(function(s){return s.action===e})}get avatarConfig(){return"avatarConfig"===this.activeFlow.action}get checkinInfo(){return"checkinInfo"===this.activeFlow.action&&(0,C.hX)(this.checkinSite)}get customFields(){return"customFields"===this.activeFlow.action}get groups(){return"groups"===this.activeFlow.action}get locationContact(){return"locationContact"===this.activeFlow.action}get locationInfo(){return"locationInfo"===this.activeFlow.action}get statusCodes(){return"statusCodes"===this.activeFlow.action}get costLocation(){return"costLocations"===this.activeFlow.action&&(0,C.hX)(this.costStockLocation)}get stockLocation(){return"stockLocations"===this.activeFlow.action&&(0,C.hX)(this.costStockLocation)}get costStockLocationForm(){return!(0,C.hX)(this.costStockLocation)}get activeFlow(){return this._activeFlow}static{this.\u0275fac=function(s){return new(s||n)(t.rXU(F.gRc),t.rXU(E.L),t.rXU(f.g),t.rXU(S.h))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["location-edit"]],inputs:{activeFlow:"activeFlow",locationName:"locationName",hideCloseButton:"hideCloseButton"},outputs:{cancelEdit:"cancelEdit",fullScreenEdit:"fullScreenEdit",saveEdit:"saveEdit",refreshFunction:"refreshFunction",hasEditFunction:"hasEditFunction"},standalone:!1,decls:15,vars:12,consts:[[1,"location-edit-container"],[1,"location-edit-nav"],[1,"nav","nav-pills"],[1,"location-edit-content"],[3,"locationId","coordinate"],[3,"entityId"],[3,"site"],[3,"entityId","groupType"],[3,"entityId","group"],[3,"entityId","groupId"],[3,"linkGroupType","id","groupType"],[3,"linkedLocation","type","locationId"],[1,"float-end","fas","fa-times","action"],[1,"float-end","fas","fa-times","action",3,"click"],[3,"ngClass"],[3,"click","ngClass"],[3,"click"],[1,"fas","fa-arrow-left"],[3,"onEdit","onFullScreen","onSave","onCreateEvent","onLocationLoaded","locationId","coordinate"],[3,"onSelect","entityId"],[3,"onEdit","onSave","site"],[3,"onEdit","onSaveEvent","entityId","groupType"],[3,"onEdit","onSave","entityId"],[3,"onEdit","onSave","entityId","group"],[3,"onEdit","onSaveEvent","entityId","group"],[3,"onEdit","onAvatarSave","entityId","groupId"],[3,"onSelect","linkGroupType","id","groupType"],[3,"refreshFunction","linkedLocation","type","locationId"]],template:function(s,i){1&s&&(t.j41(0,"div",0)(1,"div",1),t.nVh(2,Lt,3,2,"h2"),t.nVh(3,Mt,3,2,"ul",2),t.k0s(),t.j41(4,"div",3),t.nVh(5,Ot,1,2,"locations-form",4),t.nVh(6,Dt,1,1,"location-checkin-info",5),t.nVh(7,$t,1,1,"checkin-site-form",6),t.nVh(8,Vt,1,2,"responsible-contact",7),t.nVh(9,Gt,1,1,"location-codes-form",5),t.nVh(10,Nt,1,2,"suivo-entity-groups",8),t.nVh(11,wt,1,2,"custom-fields-data",8),t.nVh(12,Bt,1,2,"avatar-settings",9),t.nVh(13,Xt,1,3,"entity-cost-stock-locations",10),t.nVh(14,Pt,1,3,"cost-stock-location-form",11),t.k0s()()),2&s&&(t.R7$(2),t.vxM(i.locationName||!i.hideCloseButton?2:-1),t.R7$(),t.vxM(i.location?3:-1),t.R7$(2),t.vxM(i.locationInfo?5:-1),t.R7$(),t.vxM(i.checkinInfo?6:-1),t.R7$(),t.vxM(i.checkinSite?7:-1),t.R7$(),t.vxM(i.locationContact?8:-1),t.R7$(),t.vxM(i.statusCodes?9:-1),t.R7$(),t.vxM(i.groups?10:-1),t.R7$(),t.vxM(i.customFields?11:-1),t.R7$(),t.vxM(i.avatarConfig?12:-1),t.R7$(),t.vxM(i.costLocation||i.stockLocation?13:-1),t.R7$(),t.vxM(i.costStockLocationForm?14:-1))},dependencies:[p.YU,b.W,_.y,g.Y,R.V,x._,tt,ut,k,Et,St.i,j.D],styles:[".location-edit-container[_ngcontent-%COMP%]{display:flex;display:-ms-flex;flex-direction:column;height:100%}.location-edit-container[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin-top:0}.location-edit-container[_ngcontent-%COMP%]   .location-edit-nav[_ngcontent-%COMP%]{flex:0 0 auto;-ms-flex:0 0 auto}.location-edit-container[_ngcontent-%COMP%]   .location-edit-content[_ngcontent-%COMP%]{flex:1 1 auto;-ms-flex:1 1 auto;height:100%;overflow-x:hidden;overflow-y:auto}"]})}}return n})()},77278:(w,y,r)=>{r.d(y,{x:()=>E});var t=r(13693),C=r(60516),a=r(2615),l=r(29330),F=r(87054);let E=(()=>{class f extends t.S{static{this.checkinSitesListUrl="../protected/component/checkinAtWork/sites.json"}static{this.siteDetailsUrl="../protected/component/checkinAtWork/sitesDetail.json"}static{this.siteDetailCheckinsUrl="../protected/component/checkinAtWork/sitesDetail/checkins.json"}static{this.deleteCheckinUrl="../protected/component/checkinAtWork/identification/delete.json"}static{this.sendCheckinUrl="../protected/component/checkinAtWork/identification/send.json"}static{this.confirmCheckinUrl="../protected/component/checkinAtWork/identification/confirm.json"}static{this.deleteSiteUrl="../protected/component/checkinAtWork/site/delete.json"}
1static{this.sendAllCheckinsUrl="../protected/component/checkinAtWork/identification/sendAll.json"}static{this.saveManualCheckinUrl="../protected/component/checkinAtWork/manuallyCheckin/save.json"}static{this.manualCheckinEntitiesUrl="../protected/component/checkinAtWork/manuallyCheckin/entities.json"}static{this.saveSiteUrl="../protected/component/checkinAtWork/site/save.json"}static{this.siteEditDetailUrl="../protected/component/checkinAtWork/edit/detail.json"}static{this.timeClocksUrl="../protected/component/checkinAtWork/site/timeClocks.json"}static{this.saveSitesUrl="../protected/component/checkinAtWork/site/batch.json"}constructor(p,b){super(f),this.http=p,this.globalHelper=b}getSitesList(p){return this.http.post(f.checkinSitesListUrl,p)}getSiteDetails(p,b){let _={date:this.globalHelper.formatDate(b),siteId:p};return this.http.get(f.siteDetailsUrl,{params:_})}getSiteDetailCheckins(p){return this.http.post(f.siteDetailCheckinsUrl,p)}confirmCheckin(p){return this.http.post(f.confirmCheckinUrl,{id:p})}deleteCheckin(p){return this.http.post(f.deleteCheckinUrl,{id:p})}sendCheckin(p){return this.http.post(f.sendCheckinUrl,{id:p})}deleteSite(p){return this.http.post(f.deleteSiteUrl,{id:p})}sendAllOpenIdentifications(p){return this.http.post(f.sendAllCheckinsUrl,{id:p})}saveManualCheckin(p){return this.http.post(f.saveManualCheckinUrl,p)}getManuallyCheckinEntities(){return this.http.get(f.manualCheckinEntitiesUrl)}saveSite(p){return this.http.post(f.saveSiteUrl,p)}getSiteEditDetail(p){let b=null;return(0,C.hX)(p)||(b={siteId:p}),this.http.get(f.siteEditDetailUrl,b?{params:b}:void 0)}getTimeClocks(){return this.http.get(f.timeClocksUrl)}saveSites(p){return this.http.post(f.saveSitesUrl,p)}static{this.\u0275fac=function(b){return new(b||f)(a.KVO(l.Qq),a.KVO(F.$))}}static{this.\u0275prov=a.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}}return f})()},94582:(w,y,r)=>{r.d(y,{O:()=>S});var t=r(2615),C=r(89417),a=r(73664),l=r(17705),F=r(38215),E=r(77120);function f(p,b){if(1&p&&(a.j41(0,"option",12),a.EFF(1),a.k0s()),2&p){const _=b.$implicit;a.Y8G("value",_.key),a.R7$(),a.JRh(_.value)}}let S=(()=>{class p{constructor(_,g,R){this.fb=_,this.geocodingService=g,this.changeDetector=R,this.onChange=()=>{},this.onTouched=()=>{},this.geocodingService.getCountries().subscribe(x=>{this.countries=Object.keys(x).map(O=>({key:O,value:x[O]})),this.countryCallback&&(this.countryCallback(),delete this.countryCallback),this.changeDetector.markForCheck()}),this.addressForm=this.fb.group({street:null,number:null,zip:null,city:null,country:null}),this.formSubscription=this.addressForm.valueChanges.subscribe(x=>{this.onChange(x)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}registerOnChange(_){this.onChange=_}registerOnTouched(_){this.onTouched=_}setDisabledState(_){_?(this.street.disable({emitEvent:!1}),this.number.disable({emitEvent:!1}),this.zip.disable({emitEvent:!1}),this.city.disable({emitEvent:!1}),this.country.disable({emitEvent:!1})):(this.street.enable({emitEvent:!1}),this.number.enable({emitEvent:!1}),this.zip.enable({emitEvent:!1}),this.city.enable({emitEvent:!1}),this.country.enable({emitEvent:!1}))}writeValue(_){this.setAddress(_)}setAddress(_){this.addressForm.reset({street:_?_.street:null,number:_?_.number:null,zip:_?_.zip:null,city:_?_.city:null,country:_?this.getCountry(_.country):null},{emitEvent:!1})}getCountry(_){if(this.countries){if(_){if(_.length>2){let g=this.countries.find(R=>R.value.toLowerCase()===_.toLowerCase());return g?g.key:null}return _.toLowerCase()}}else this.countryCallback=()=>{this.country.setValue(this.getCountry(_),{emitEvent:!1})};return null}get street(){return this.addressForm.get("street")}get number(){return this.addressForm.get("number")}get zip(){return this.addressForm.get("zip")}get city(){return this.addressForm.get("city")}get country(){return this.addressForm.get("country")}static{this.\u0275fac=function(g){return new(g||p)(a.rXU(C.ze),a.rXU(F.l),a.rXU(l.gRc))}}static{this.\u0275cmp=a.VBU({type:p,selectors:[["address-form"]],standalone:!1,features:[a.Jv_([{provide:C.kq,useExisting:(0,t.Rfq)(()=>p),multi:!0}])],decls:32,vars:17,consts:[[3,"formGroup"],[1,"row","mb-2","gx-2"],[1,"col-9"],["type","text","formControlName","street",1,"form-control"],[1,"col-3"],["type","text","formControlName","number",1,"form-control"],["type","text","formControlName","zip",1,"form-control"],[1,"col-5"],["type","text","formControlName","city",1,"form-control"],[1,"col-4"],["formControlName","country",1,"form-select"],["disabled","",3,"value"],[3,"value"]],template:function(g,R){1&g&&(a.j41(0,"form",0)(1,"div",1)(2,"div",2)(3,"label"),a.EFF(4),a.nI1(5,"translate"),a.k0s(),a.nrm(6,"input",3),a.k0s(),a.j41(7,"div",4)(8,"label"),a.EFF(9),a.nI1(10,"translate"),a.k0s(),a.nrm(11,"input",5),a.k0s()(),a.j41(12,"div",1)(13,"div",4)(14,"label"),a.EFF(1
15),a.nI1(16,"translate"),a.k0s(),a.nrm(17,"input",6),a.k0s(),a.j41(18,"div",7)(19,"label"),a.EFF(20),a.nI1(21,"translate"),a.k0s(),a.nrm(22,"input",8),a.k0s(),a.j41(23,"div",9)(24,"label"),a.EFF(25),a.nI1(26,"translate"),a.k0s(),a.j41(27,"select",10)(28,"option",11),a.EFF(29,"---"),a.k0s(),a.Z7z(30,f,2,2,"option",12,a.fX1),a.k0s()()()()),2&g&&(a.Y8G("formGroup",R.addressForm),a.R7$(4),a.JRh(a.bMT(5,7,"allpages.location.street")),a.R7$(5),a.JRh(a.bMT(10,9,"allpages.location.number")),a.R7$(6),a.JRh(a.bMT(16,11,"allpages.location.zip")),a.R7$(5),a.JRh(a.bMT(21,13,"allpages.location.city")),a.R7$(5),a.JRh(a.bMT(26,15,"allpages.location.country")),a.R7$(3),a.Y8G("value",null),a.R7$(2),a.Dyx(R.countries))},dependencies:[C.qT,C.xH,C.y7,C.me,C.wz,C.BC,C.cb,C.j4,C.JD,E.D],encapsulation:2,changeDetection:0})}}return p})()},97059:(w,y,r)=>{r.d(y,{$y:()=>C,Qo:()=>E,nW:()=>F});class C{}class F{}class E{}}}]);

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.