1"use strict";(self.webpackChunkmy_geotab=self.webpackChunkmy_geotab||[]).push([[575],{20766(e,t,i){i.d(t,{U0m:()=>o.U0,s5_:()=>o.s5,_sX:()=>o._s,wgL:()=>o.wg,pWU:()=>o.pW,mUr:()=>o.mU,Zfm:()=>o.Zf,btW:()=>o.bt,zf$:()=>o.zf,qnL:()=>o.qn,nQT:()=>o.nQ,NXF:()=>J,iv9:()=>d,BCG:()=>c,W8q:()=>o.W8,vSB:()=>o.vS,r0x:()=>xo,hAo:()=>p,a1S:()=>y,All:()=>o.Al,PEO:()=>o.PE,AMW:()=>o.AM,eXm:()=>o.eX,yB_:()=>o.yB,io4:()=>o.io,_0V:()=>o._0,ed$:()=>o.ed,gNQ:()=>o.gN,ULL:()=>h,_qg:()=>m,UEZ:()=>o.UE,miS:()=>S,O0E:()=>o.O0,qXs:()=>k,Lwe:()=>M,NBR:()=>C,w42:()=>x,SZC:()=>o.SZ,aGV:()=>o.aG,KvT:()=>B,lvf:()=>o.lv,UFE:()=>o.UF,tFs:()=>o.tF,f3v:()=>o.f3,evJ:()=>o.ev,$CC:()=>Z.$C,gyb:()=>re,GxJ:()=>o.Gx,XFm:()=>o.XF,CUm:()=>o.CU,hlV:()=>o.hl,ZAc:()=>o.ZA,jaV:()=>o.j,ymx:()=>o.ym,D3_:()=>q,IPJ:()=>Mo.I,k4W:()=>ie,wRL:()=>Y,L64:()=>o.L6,ZVw:()=>Q.ZV,xnm:()=>o.xn,PpF:()=>o.Pp,n6T:()=>o.n6,RzJ:()=>L,U4V:()=>o.U4,kD9:()=>o.kD,zeK:()=>P,hn8:()=>H,_Pk:()=>o._P,vYd:()=>I,DUw:()=>o.DU,gQD:()=>D,tlz:()=>o.tl,$Lg:()=>o.$L,a2t:()=>o.a2,_8c:()=>o._8,xd3:()=>n,qYS:()=>X,K1c:()=>o.K1,YcK:()=>U,QsA:()=>o.Qs,rTw:()=>o.rT,QWW:()=>o.QW,qJO:()=>o.qJ,N0j:()=>o.N0,fS9:()=>o.fS,uye:()=>o.uy,CHm:()=>O,Sb8:()=>E,Bnz:()=>o.Bn,Ih8:()=>o.Ih,sni:()=>o.sn,xQj:()=>z,AIj:()=>F,VZ4:()=>o.VZ,ixE:()=>o.ix,nIc:()=>o.nI,oZf:()=>o.oZ,YCA:()=>w,eTh:()=>o.eT,qWx:()=>K,q_Q:()=>G,oIN:()=>o.oI,Hnl:()=>o.Hn,oUJ:()=>o.oU,CSO:()=>T,OSu:()=>o.OS,fzj:()=>o.fz,Hnt:()=>o._K,c2Z:()=>o.c2,QoU:()=>_,kc4:()=>A,Jyt:()=>o.Jy,dqK:()=>o.dq,_Tr:()=>o._T,TiI:()=>o.Ti,NM_:()=>o.NM,R1u:()=>N,aRb:()=>o.aR,nGG:()=>o.nG,Mn4:()=>o.Mn,c0f:()=>o.c0,N3J:()=>b,$Ds:()=>o.$D,bEC:()=>o.bE,PvV:()=>o.Pv,JQ7:()=>o.JQ,c5S:()=>o.c5,KVE:()=>j,C1g:()=>o.C1,mG7:()=>g,JXW:()=>W,xpl:()=>V,PNY:()=>o.PN,kUb:()=>v,nJI:()=>o.nJ});var o=i(71372);function n(e,t){let i=(t||"00:00").split(":"),o=e.toReverseOffsetDateTime((e=>{let t=new Date("string"==typeof e?e:e.valueOf());return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t})(new Date)).getTime();return o+=60*+i[0]*60*1e3+60*+i[1]*1e3,e.toShortTime(new Date(o))}const a=5*o.eX,s=8*o.eX,r=["D","PC","PC_Exempted","YM","Work","WorkExemption"],l=["D","INT_D","PC","INT_PC","PC_Exempted","YM","Work","WorkExemption"],d=["ON","OFF","SB","D","YM","PC","PC_Exempted","WT"],c=["ON","OFF","SB","D","YM","PC","PC_Exempted","WT","INT_D","INT_PC"],u=["Automatic","Unassigned"],m="NoUserId",h="NoDeviceId",y="HosEnabled",p="HosDisabled",f="SituationalDrivingClear";function g(e,t,i){t&&i&&t.coDrivers&&t.driver!==m&&i.driver!==m&&(t.coDrivers=e?t.coDrivers.filter((e=>e.id!==t.driver.id)):t.coDrivers.filter((e=>e.id!==i.driver.id)))}function v(e,t,i,a){let s=i?e.translateKey("ruleSetCustomStartOfDay"):"{0}",r=(0,o.K1)(t,e.translateKey),l=s.replace("{0}",r);return i?l.replace("{1}",n(e,a)):l}function D(e,t,i,a){let s=i?e.translateKey("ruleSetChangedToCustomStartOfDay"):e.translateKey("ruleSetChangedTo"),r=(0,o.K1)(t,e.translateKey),l=s.replace("{0}",r);return i?l.replace("{1}",n(e,a)):l}function w(e){return{ON:!0,OFF:!0,D:!0,SB:!0,INT_PC:!0,INT_D:!0,PC:!0,PC_Exempted:!0,YM:!0,WT:!0,Login:!0,Logoff:!0,Certify:!0,Work:!0,Rest:!0}[e]}function b(e){return!(!e||!(e===m||e.id&&e.id===m))}function S(e,t){return!(!e||!t)&&(e===m?t===m:t!==m&&e.id===t.id)}function C(e,t,i){var o=["SB","OFF",""];return i||o.push("ON"),!!(o.indexOf(e||"")>-1||("D"===e||"ON"===e)&&R(t))}function T(e){return e&&(e===h||e.id&&e.id===h)}function x(e,t,i){return!!o.U0.some((t=>t===e))||(R(t)?T(i)?["ON","OFF"]:["D","ON","SB","OFF","HosEnabled","HosDisabled"]:["ON","SB","OFF"]).indexOf(e)>-1}function k(e,t){return!("INT_D"===e.status||!R(e.origin)||t||!M(e))}function M(e){return!(["Login","Logoff","Certify","PC","PC_Exempted","INT_PC","INT_D","EnginePowerupPC","EngineShutdownPC","YM","WT","Authority","CanadaCycleOne","CanadaCycleTwo","OperatingZoneCanadaSouthOf60","OperatingZoneCanadaNorthOf60","OperatingZoneAmerica"].indexOf(e.status)>-1)}function R(e){return u.every((t=>e!==t))}function E(e){return u.some((t=>e.origin===t))}function A(e,t){return("Requested"===e.state||!(!e.modifications||!e.modifications.some((e=>"Requested"===e.state))))&&(t||!e.placeholder)}function _(e){return e.modifications&&!e.modifications.some((e=>"Active"===e.state))}function X(e,t=!1){const i={on:"#A36B0D",sb:"#E32943",d:"#328812",int_d:"#328812",off:"#777772",def:"#4376c8",ignored:"#777772"};return i.work=i.on,i.rest=i.off,t?i.ignored:i[e.toLowerCase()]||i.def}function O(e){return e===y||e===p}function P(e){return e/1.60934}function L(e){return 1.60934*e}function I(e,t,i=!1){let o,n=0;for(o=0;o<e.length;++o){let a=new Date(e[o].dateTime);if(n=t.getTime()-a.getTime(),n<=0){if(i){if(0===o)return null;if(o>0)return e[o-1]}if(!i){if(o===e.length-1)return 0===n?null:e[o];if(o<e.length-1)return e[o+(0===n?1:0)]}}if(o===e.length-1&&i&&n>0)return e[o]}return null}function N(e){return function(e){return function(e){return"PC"===e||"PC_Exempted"===e||"INT_PC"===e}(e)||"YM"===e}(e)||"WT"===e}function B(e){return"PC_Exempted"===e?"PC":e}function F(e){return l.indexOf(e.status)>-1}function W(e,t=!1,i=!1){let o=e.driver!==m;return!function(e){return r.indexOf(e.status)>-1}(e)||!t&&!o||("ON"===e.status||"Rest"===e.status)&&e.placeholder&&i}function H(e,t,i,o="Manual",n){return{dateTime:e.toISOString(),device:t.device,driver:t.driver,status:i,coDrivers:null!=n?n:t.coDrivers,origin:o}}function U(e,t){let i=new Date(t.dateTime),o=I(e,i,!0);return o&&N(o.status)?H(new Date(i.getTime()-10),o,f):null}const z=(e,t,i)=>{const o=i.getTime(),n=t.getTime();if(o===n)return 0===e;return e/1e3/((o-n)/36e5)<250&&e>=0};function $(e){let t=e.device,i="string"==typeof t?void 0:t.id;return String(i)}const q=function(e){let t={};for(let i=0;i<e.length;i++){let o=e[i],n=$(o);n in t?t[n].push(o):t[n]=[o]}return t},V=function(e){Object.keys(e).forEach((t=>{e[t].sort(((e,t)=>new Date(e.activeFrom).getTime()-new Date(t.activeFrom).getTime()))}))},G=function(e,t){if(!e)return!1;let i=new Date,o=new Date(t.dateTime),n=function(e){let n=new Date(e.activeFrom),r=new Date(e.activeTo);return r="ON"===t.status?new Date(r.getTime()+s):r,o>=n&&o<=r&&i.getTime()-r.getTime()>a};for(let t=0;t<e.length;t++)if(n(e[t]))return!0;return!1},K=function(e,t){if(!e)return!1;
1const i=new Date,o=t.driveLog.status,n=new Date(t.driveLog.dateTime),r=t.stopLog.status,l=new Date(t.stopLog.dateTime),d=function(e,t,o){const n=new Date(e.activeFrom),l=t===r?new Date(new Date(e.activeTo).getTime()+s):new Date(e.activeTo);return o>=n&&o<=l&&i.getTime()-l.getTime()>a};let c=[];const u=e.find((e=>d(e,o,n)));if(u){c.push(u);const t=new Date(u.activeFrom);let i=!1;for(let o=0;o<e.length;o++){const n=new Date(e[o].activeFrom);if(!(e[o].id===u.id||n<t)){if(d(e[o],r,l)){c.push(e[o]),i=!0;break}if(n>l)break;c.push(e[o])}}if(c.length>0){if(1===c.length)return d(c[0],r,l);if(!i)return!1;for(let e=0;e<c.length-1;e++){const t=c[e],i=c[e+1];if(i&&new Date(i.activeFrom).getTime()-new Date(t.activeTo).getTime()>s)return!1}return!0}}return!1},Y=e=>e&&(e.id||e)||void 0,j=function(e,t,i,n,a){let s=t.reduce(((e,t)=>(e[(0,o.ev)(t.verifyDateTime,i.toLocalDateTime)]=t,e)),{});e.forEach((e=>{if(e.placeholder){let t=i.toLocalDateTime(new Date(e.dateTime),n),r=s[(0,o.f3)(t)];!r||e.editDateTime&&!(r.dateTime>e.editDateTime)||a&&A(e,!0)||(e.verifyDateTime=r.dateTime)}}))};var Z=i(71703),Q=i(26157);const J="â";function ee(e,t,i,n){let a=(0,o.O0)(e.cycleRest)||0,s={rest:(0,o.aG)((0,o.O0)(e.rest)||0,i,n),driving:(0,o.aG)((0,o.O0)(e.driving)||0,i,n),duty:(0,o.aG)((0,o.O0)(e.duty)||0,i,n),workday:(0,o.aG)((0,o.O0)(e.workday)||0,i,n),cycle:(0,o.aG)((0,o.O0)(e.cycle)||0,i,n),cycleRest:a<24?(0,o.aG)(a,i,n):t.replace("{0}",Math.ceil(a/24).toString()),cycleDuty:(0,o.aG)((0,o.O0)(e.dutySinceCycleRest)||0,i,n),cycleDriving:(0,o.aG)((0,o.O0)(e.cycleDriving)||0,i,n)};return e.restLabel&&(s.restLabel=(0,o.aG)((0,o.O0)(e.restLabel)||0,i,n)),s}function te(e){return e.toLowerCase().indexOf("canada")>-1}function ie(e,t,i,n,a=o.ed.HOUR_UNIT,s=o.ed.MINUTE_UNIT,r=o.ed.ALTERNATE_DRIVING_BREAK_DURATION,l=o.ed.ALTERNATE_DRIVING_BREAK,d=o.ed.ALTERNATE_DRIVING_BREAK_IN,c='<sp
1an><svg class="svgIcon big" role="img" fill="#419253"><use xlink:href=\'#drive-check\'></use></svg></span>'){let u=(0,o.Cb)(e.cycleSummaries),m=(null==u?void 0:u.consecutiveRest)?(0,o.PN)(u.consecutiveRest)/o.Al:0,{isDrivingBreakComplete:h,drivingBreakDuration:y,drivingBreakDurationLabel:p}=function(e,t,i,n,a,s){let r=e?(0,o.PN)(e)/o.Al:0,l=r>=(t?(0,o.PN)(t)/o.Al:.5),d="";if(t){let e=(0,o.aG)((0,o.O0)(t)||0,a,s);d=l?n.replace("{0}",e):i.replace("{0}",e)}else d=l?o.ed.DRIVING_BREAK:o.ed.DRIVING_BREAK_DURATION;return{isDrivingBreakComplete:l,drivingBreakDuration:r,drivingBreakDurationLabel:d}}(e.availability.drivingBreakDuration,e.availability.restLabel,r,l,a,s),f=(0,o.tl)(t),g=(null==f?void 0:f.config.cycle)&&(!i||(0,o.gR)(i.status))&&0!==m,v=function(e,t,i,n){let a=null==e?void 0:e.config.rest,s=void 0===t.availability.rest?0:(0,o.PN)(t.availability.rest);return a&&a.onDutyCountTowardRest&&(null==i?void 0:i.status)&&(0,o.N2)(i.status)&&0!==n&&a.betweenRestLimit&&(0,o.FL)(t)&&(a.betweenRestLimit===s||a.betweenRestLimit-s>=6e4)}(f,e,i,y),D=(0,o.O0)(e.offDutyNeeded),w=(0,o.O0)(e.restBreakNeeded);return{availability:e.availability,availabilityOutput:ee(e.availability,n,a,s),displayCycleRestDuration:!!g&&m<=100,cycleRestDuration:(0,o.aG)(m,a,s,!0),cycleRestDurationMs:m,isDrivingBreak:v,drivingBreakDuration:h?c:(0,o.aG)(y,a,s,!0),drivingBreakDurationMs:h?void 0:y,drivingBreakDurationLabel:p,drivingBreakInLabel:e.availability.restLabel?d.replace("{0}",(0,o.aG)((0,o.O0)(e.availability.restLabel)||0,a,s)):o.ed.DRIVING_BREAK_IN,restBreakNeeded:!!w||te(t),restBreakNeededHours:w?(0,o.aG)(w,a,s):void 0,restBreakNeededMs:null!=w?w:void 0,offDutyNeeded:!!D||te(t),offDutyNeededHours:D?(0,o.aG)(D,a,s):void 0,offDutyNeededMs:null!=D?D:void 0}}const oe={"#drive-bed":"Rest duration icon","#drive-coffee":"Driving break duration icon","#drive-stop":"Driving break in icon","#drive-steering-wheel":"Driving left icon","#drive-briefcase":"Duty left icon","#drive-tools":"Workday left icon","#drive-ccw":"Cycle icon","#drive-truck":"Cycle driving icon","#drive-clock":"Cycle rest icon","#drive-ok":"Complete","#drive-off":"Off duty required icon"},ne=(e,t,i,o,n,a,s)=>{var r;let l=function(e){switch(e){case"avail-rest-duration":case"avail-drive-break-duration":case"needed-break":return"#drive-coffee";case"avail-rest":case"avail-alternate-rest":return"#drive-stop";case"avail-driving":return"#drive-steering-wheel";case"avail-duty":case"avail-cycleDuty":return"#drive-briefcase";case"avail-workday":return"#drive-tools";case"avail-cycle":return"#drive-ccw";case"avail-cycleDriving":return"#drive-truck";case"avail-cycleRest":return"#drive-clock";case"needed-off":return"#drive-off";default:return 0===e.indexOf("avail-drive-break-duration")?"#drive-coffee":0===e.indexOf("avail-alternate-rest")?"#drive-stop":""}}(t),d={htmlId:t,name:e,label:i,value:o,icon:{href:l,ariaLabel:null!==(r=oe[l])&&void 0!==r?r:""}};return null!=n&&(d.ms=n),a&&(d.skipTranslateLabel=!0),s&&(d.limitsDrivingRange=!0),d},ae={cycleRestDuration:(e,t)=>{if(e.displayCycleRestDuration)return ne("cycleRestDuration","avail-rest-duration",o.ed.REST_DURATION,e.cycleRestDuration)},drivingBreakDuration:(e,t)=>{if(e.isDrivingBreak){let[t,i,o]=e.availabilityOutput.restLabel?[`avail-drive-break-duration-${e.availabilityOutput.restLabel}`,e.drivingBreakDurationLabel,!0]:["avail-drive-break-duration",e.drivingBreakDurationLabel,!1];return ne("drivingBreakDuration",t,i,e.drivingBreakDuration,e.drivingBreakDurationMs,o)}},rest:(e,t)=>{if(void 0===t.rest)return;let[i,n,a]=e.availabilityOutput.restLabel?[`avail-alternate-rest-${e.availabilityOutput.restLabel}`,e.drivingBreakInLabel,!0]:["avail-rest",o.ed.DRIVING_BREAK_IN,!1];return ne("rest",i,n,e.availabilityOutput.rest,t.rest,a)},driving:(e,t)=>void 0===e.availability.driving?void 0:ne("driving","avail-driving",o.ed.DRIVING_LEFT,e.availabilityOutput.driving,t.driving),duty:(e,t)=>void 0===e.availability.duty?void 0:ne("duty","avail-duty",o.ed.DUTY_LEFT,e.availabilityOutput.duty,t.duty),workday:(e,t)=>void 0===e.availability.workday?void 0:ne("workday","avail-workday",o.ed.WORKDAY_LEFT,e.availabilityOutput.workday,t.workday),cycle:(e,t)=>
1void 0===e.availability.cycle?void 0:ne("cycle","avail-cycle",o.ed.CYCLE_LEFT,e.availabilityOutput.cycle,t.cycle),cycleDriving:(e,t)=>void 0===e.availability.cycleDriving?void 0:ne("cycleDriving","avail-cycleDriving",o.ed.CYCLE_DRIVING_LEFT,e.availabilityOutput.cycleDriving,t.cycleDriving),cycleRest:(e,t)=>void 0===e.availability.cycleRest?void 0:ne("cycleRest","avail-cycleRest",o.ed.TIME_LEFT_UNTIL_24_HOUR_REST,e.availabilityOutput.cycleRest,t.cycleRest),cycleDuty:(e,t)=>void 0===e.availability.dutySinceCycleRest?void 0:ne("cycleDuty","avail-cycleDuty",o.ed.DUTY_LEFT_UNTIL_24_HOUR_REST,e.availabilityOutput.cycleDuty,t.dutySinceCycleRest),dailyRestNeeded:(e,t)=>{var i;if(e.restBreakNeeded)return ne("dailyRestNeeded","needed-break",o.ed.REST_REQUIRED,null!==(i=e.restBreakNeededHours)&&void 0!==i?i:J,e.restBreakNeededMs)},dailyOffNeeded:(e,t)=>{var i;if(e.offDutyNeeded)return ne("dailyOffNeeded","needed-off",o.ed.OFF_DUTY_REQUIRED,null!==(i=e.offDutyNeededHours)&&void 0!==i?i:J,e.offDutyNeededMs)}},se=e=>void 0!==e,re=(e,t={})=>{var i;let n=["cycleRestDuration","drivingBreakDuration","rest","driving","duty","workday","cycle","cycleDriving","cycleRest","cycleDuty","dailyRestNeeded","dailyOffNeeded"].map((i=>ae[i](e,t))).filter(se),a=null!==(i=(0,o.Io)(e.availability).name)&&void 0!==i?i:"driving",s=n.find((e=>e.name===a));return s&&(s.limitsDrivingRange=!0),n};function le(e,t){const i=function(e){var t,i;return e.isCanada?"symmetric":"asymmetric"===(null===(t=e.splitConfig)||void 0===t?void 0:t.type)?"asymmetric":"symmetric"===(null===(i=e.splitConfig)||void 0===i?void 0:i.type)?"symmetric":void 0}(e),o=!0===e.isCanada;return{geometry:i,violationPreventsSplitCompletion:!!o||"symmetric"!==i&&("asymmetric"===i&&t.enablePreventSplitCompleteWhenViolationFix),violationRecalculatesWorkday:null!=i&&(t.enablePreventSplitCompleteWhenViolationFix||o&&t.enableCanadaViolationRecalculatesWorkdayFix),violationPreventsNewFreeze:o&&t.enableCanadaViolationPreventsNewFreezeFix,failedSplitRecalculatesWorkday:"asymmetric"===i||null!=i&&!t.disableUnfreezeSBSplitNotCompleteFix,canadaViolationRecalcOnViolation:o&&t.enableCanadaViolationRecalculatesWorkdayFix}}const de=(e,t)=>{e.customCodes.disableCycleResetPeriod||e.cycle.hasStarted&&(e.cycle.cycleResetPeriod={fromDate:ce(e),eligibleForResetDate:t})},ce=e=>new Date(e.nextDate.getTime()-e.cycle.cycleConsecutiveOffCount),ue=e=>{for(let t=e.cycles.length-1;t>=0;t--){const i=e.cycles[t].cycleResetPeriod;if(i)return me(i)?i:void 0}},me=e=>void 0===e.toDate,he="EmergencyResponseExemptionEnabled",ye=e=>(null==e?void 0:e.status)===he||"EmergencyResponseExemptionDisabled"===(null==e?void 0:e.status),pe=(e,t)=>e.find((e=>e.start.getTime()<=t.getTime()&&t.getTime()<e.end.getTime())),fe=(e,t)=>void 0!==pe(e,t),ge=(e,t)=>{const i=new Set;return(t||[]).concat(e.filter(ye)).filter((e=>{const t=(e=>{var t;const i=(0,o.DP)(null==e?void 0:e.dateTime);return`${null!==(t=null==e?void 0:e.id)&&void 0!==t?t:""}|${i instanceof Date?i.getTime():String(null==e?void 0:e.dateTime)}|${null==e?void 0:e.status}`})(e);return!i.has(t)&&(i.add(t),!0)}))},ve=e=>{if(!e.customCodes.enableEmergencyResponseExemption)return e.emergencyResponsePeriods=[],void(e.emergencyResponseSuppressedViolations=[]);e.emergencyResponsePeriods=((e,t,i)=>{const n=e.filter(ye).map((e=>({at:(0,o.DP)(e.dateTime),status:e.status}))).sort(((e,t)=>e.at.getTime()-t.at.getTime())),a=[];let s;const r=e=>{s&&e.getTime()>s.getTime()&&a.push({start:s,end:e}),s=void 0};for(const e of n){if(s){const n=(0,o.W_)(s,t,i);e.at.getTime()>=n.getTime()&&r(n)}e.status===he?s=null!=s?s:e.at:s&&r(e.at)}return s&&r((0,o.W_)(s,t,i)),a})(e.emergencyResponseLogs,e.toLocalTime,e.toUtcTime)},De=(e,t)=>{if(void 0===t)return e.emergencyResponseLogs;const i=(0,o.Zv)(e.nextDate,e.toLocalTime,e.toUtcTime);return n=e.emergencyResponseLogs,a=t.getTime()<i.getTime()?t:i,n.filter((e=>(0,o.DP)(e.dateTime).getTime()>=a.getTime()));var n,a},we=e=>{const t=(i=e.emergencyResponsePeriods,n=e.nextDate,null===(a=pe(i,n))||void 0===a?void 0:a.end);var i,n,a;if(void 0!==t)return{exemptionEnd:t,driverDayBoundary:(0,o.W_)(e.nextDate,e.toLocalTime,e.toUtcTime)}},be=(e,t)=>
1{const i=we(e);if(void 0===i)return;const o=i.driverDayBoundary.getTime()-e.nextDate.getTime();for(const e of Object.keys(t))"number"==typeof t[e]&&(t[e]=Math.max(t[e],o))},Se=(e,t)=>{-1===e.emergencyResponseSuppressedViolations.indexOf(t)&&e.emergencyResponseSuppressedViolations.push(t)},Ce=(e,t)=>{const i=e.emergencyResponseSuppressedViolations.indexOf(t);-1!==i&&e.emergencyResponseSuppressedViolations.splice(i,1)},Te=(e,t,i)=>{const o=[];let n=t.getTime();const a=i.getTime();for(const t of e)if(!(t.end.getTime()<=n||t.start.getTime()>=a)&&(n<t.start.getTime()&&o.push({start:new Date(n),end:new Date(Math.min(t.start.getTime(),a))}),n=Math.max(n,t.end.getTime()),n>=a))break;return n<a&&o.push({start:new Date(n),end:new Date(a)}),o},xe=(e,t,i,o,n)=>{const a=((e,t,i)=>{if(0===e.emergencyResponsePeriods.length)return;return t.getTime()===i.getTime()?fe(e.emergencyResponsePeriods,t)?[]:void 0:e.emergencyResponsePeriods.some((e=>e.start.getTime()<i.getTime()&&t.getTime()<e.end.getTime()))?Te(e.emergencyResponsePeriods,t,i):void 0})(e,i,o);if(void 0===a)return!1;a.forEach(((i,s)=>{n(i.start,i.end);const r=s<a.length-1,l=i.end.getTime()<o.getTime();(r||l)&&Ki(e,t,i.end)}));const s=a[a.length-1];return(!s||s.end.getTime()<o.getTime())&&Se(e,t),!0},ke=e=>{const t=((e,t,i)=>{const o=e.find((e=>e.start.getTime()>=t.getTime()&&e.start.getTime()<=i.getTime()));return null==o?void 0:o.start})(e.emergencyResponsePeriods,e.currentDate,e.nextDate);if(!t)return;const i=Object.keys(e.currentViolations);for(const o of i){const i=e.currentViolations[o];i&&i.fromDate.getTime()<t.getTime()&&(Ki(e,o,t),Se(e,o))}},Me={kind:"draining"},Re={kind:"frozen"},Ee={kind:"unknown"},Ae=(e,t,i,o)=>{if(void 0===t)return;const n=we(e);if(void 0===n)return;const{exemptionEnd:a,driverDayBoundary:s}=n,r=s.getTime()-e.nextDate.getTime();if(t>=r)return;const l=a.getTime()<s.getTime(),d=l?{factorName:"emergencyResponseExemptionEnd",label:"emergency response exemption ends",date:a}:{factorName:"emergencyResponseDriverDayBoundary",label:"emergency response day boundary",date:s},c=()=>{return l?void 0!==o?(e=a,n=o,new Date(Math.max(e.getTime(),n.getTime()))):t<=0||"frozenFrom"===i.kind&&i.at.getTime()<a.getTime()&&i.value<=0?a:void 0:s;var e,n},u=()=>({transition:d,exhaustion:c()}),m=e=>({factorName:"emergencyResponseFloorRelease",label:"emergency response floor releases",date:new Date(s.getTime()-Math.max(0,e))}),h=e=>e.date.getTime()<d.date.getTime()?{transition:e,exhaustion:void 0}:u();switch(i.kind){case"draining":return u();case"frozen":return h(m(t));case"frozenFrom":{if(i.at.getTime()>=d.date.getTime())return u();const e=m(i.value);return h(e.date.getTime()<i.at.getTime()?Object.assign(Object.assign({},e),{date:i.at}):e)}case"unknown":return{transition:void 0,exhaustion:l?void 0:s}}},_e=2*o.Al,Xe=(e,t)=>!(!e.workday.start||!e.workday.end)&&(t.getTime()>e.workday.start.getTime()&&t.getTime()<=e.workday.end.getTime()+(e.config.bigDayBonus||0)),Oe=e=>{let t=e.config.bigDayMaxPerCycle||1;return!e.workday.end||e.cycle.bigDayCount<t},Pe=e=>{var t;let i=null!==(t=e.deferralTime)&&void 0!==t?t:0;switch(e.deferralStatus){case"DayOne":return i;case"DayTwo":return-i;default:return 0}},Le=e=>(null==e?void 0:e.isAdverseLogApplied)?_e:0,Ie=(e,t)=>{let i=!1,o=!1;if(e.workday.eligibleReducedRestPeriods&&e.workday.eligibleReducedRestPeriods.length>0){let t=e.workday.eligibleReducedRestPeriods[e.workday.eligibleReducedRestPeriods.length-1];t.start&&!t.end&&(i=!0,o=e.reducedRestLogs.some((e=>t.start&&e.dateTime>t.start)))}const n=["Workday","Driving","Duty","Rest"];let a=n.some((t=>t in e.currentViolations))||((e,t)=>e.emergencyResponseSuppressedViolations.some((e=>-1!==t.indexOf(e))))(e,n);return Ne(e)&&e.workday.hasStarted&&!a&&(i&&!o||t>0)},Ne=e=>{var t,i;if(!e.current||!e.lastReducedRestApplyDate)return!0;let n=(null===(i=null===(t=e.config.workday)||void 0===t?void 0:t.exemptionReducedRest)||void 0===i?void 0:i.daysBetweenUse)||7;return(0,o.qi)(e.current.dateTime,e.lastReducedRestApplyDate,e.toLocalTime)>=n},Be=e=>void 0===e.workday.start||void 0===e.config.workday||void 0===e.config.workday.workdayMaximum||void 0===e.config.bigDayBonus||new Date(e.work
1day.start.getTime()+e.config.workday.workdayMaximum+e.config.bigDayBonus)<e.nextDate,Fe=(e,t)=>{var i;let n={nextWorkdayStart:void 0,restAmountToBeDeferred:0},a=t?li(e,t):e.workday;if(!(e.current&&(null===(i=e.config.workday)||void 0===i?void 0:i.offDutyMinimum)&&(null==a?void 0:a.start)&&a.eligibleReducedRestPeriods&&0!==a.eligibleReducedRestPeriods.length))return n;let s=null!=t?t:(0,o.DP)(e.current.dateTime);for(let t=a.eligibleReducedRestPeriods.length-1;t>=0;t--){let i=a.eligibleReducedRestPeriods[t];if(i.start&&i.end&&i.start.getTime()>a.start.getTime()&&i.start.getTime()<=s.getTime()){n.nextWorkdayStart=i.end,n.restAmountToBeDeferred=e.config.workday.offDutyMinimum-(i.end.getTime()-i.start.getTime());break}}return n},We=(e,t)=>{var i;null===(i=e.workday.end)||void 0===i||i.setTime(e.workday.end.getTime()+t),void 0!==e.workday.workdayExtended?e.workday.workdayExtended+=t:e.workday.workdayExtended=t},He=(e,t)=>{void 0!==e.workday.drivingLimit&&(e.workday.drivingLimit+=t,e.workday.drivingExtended=t)},Ue=(e,t)=>{void 0!==e.workday.dutyLimit&&(e.workday.dutyLimit+=t)},ze=e=>{var t,i;const o=e.hasAdverse?_e:0,n=e.hasAdverse?_e:0;let a=0;if(e.hasBigDay&&e.hasAdverse){const i=e.adverseDoesNotExtendWorkday?0:_e,o=null!==(t=e.bigDayExtensionAmount)&&void 0!==t?t:0;a=Math.max(i,o)-Math.min(i,o)}else!e.hasAdverse||e.hasBigDay||e.adverseDoesNotExtendWorkday?e.hasBigDay&&!e.hasAdverse&&(a=null!==(i=e.bigDayExtensionAmount)&&void 0!==i?i:0):a=_e;return{driving:o,workday:a,duty:n}},$e=(e,t)=>{let i;if(t)if(void 0===e.workday.endOfLastBreak)i=t;else{i=t-(e.nextDate.getTime()-e.workday.endOfLastBreak.getTime())}return i},qe=(e,t)=>{var i,o;if(!e||void 0===(null===(i=t.daily)||void 0===i?void 0:i.driveMaximum))return;let n=t.daily.driveMaximum+Pe(e)+Le(e);if("DayTwo"===e.deferralStatus){const i=2*t.daily.driveMaximum;n=Math.min(n,i-(null!==(o=e.yesterdayDriveCount)&&void 0!==o?o:0))}return n},Ve=(e,t)=>{var i;if(e&&void 0!==(null===(i=t.daily)||void 0===i?void 0:i.dutyMaximum))return t.daily.dutyMaximum+Pe(e)+Le(e)},Ge=(e,t)=>{let i=qe(e,t);return void 0===i?void 0:i-e.driveCount},Ke=(e,t)=>{let i=Ve(e,t);return void 0===i?void 0:i-e.onDutyCount},Ye=(e,t)=>{var i;if(e&&void 0!==(null===(i=t.daily)||void 0===i?void 0:i.offDutyMinimum))return t.daily.offDutyMinimum-Pe(e)-Le(e)},je=(e,t,i=!1)=>{let o=Ye(e,t);if(void 0===o)return;let n=o-e.offDutyCount;return i?n:Math.max(0,n)},Ze=e=>{const t=Ye(e.day,e.config),i=je(e.day,e.config);if(void 0!==t&&void 0!==i){if(ni(e)){const o=ai(e);if(o>t||o>e.day.offDutyCount)return Math.max(i,o)}return i}},Qe=(e,t)=>{var i;if(!e||void 0===(null===(i=t.rest)||void 0===i?void 0:i.dailyRestMinimum))return;let o=t.rest.dailyRestMinimum-Le(e);return"DayOne"===e.deferralStatus&&void 0!==e.deferralTime&&(o-=e.deferralTime),o},Je=(e,t,i=!1)=>{var o;let n=Qe(e,t);if(void 0===n)return;let a=n-(null!==(o=e.restCount)&&void 0!==o?o:0);return i?a:Math.max(0,a)},et=e=>{let t=Qe(e.day,e.config),i=Je(e.day,e.config);if(void 0!==t&&void 0!==i)return i},tt=e=>void 0!==e,it={Workday:(0,o.e6)((e=>{let t=si(e);if(!e.config.workday||!t)return;let i,n=(0,o.tb)(e.exemption16HLogs,"Exemption16H");return i=e.workday.start&&e.workday.end&&e.workday.hasStarted?e.workday.end.getTime()-e.nextDate.getTime():t,e.config.bigDayBonus&&e.workday.end&&n&&Xe(e,n.dateTime)&&Oe(e)&&(e.exemption16HLogs=e.exemption16HLogs.filter((e=>e.id!==n.id)),e.cycle.bigDayCount+=1,void 0===e.workday.drivingExtended&&(i+=e.config.bigDayBonus,e.workday.workdayExtended=e.workday.workdayExtended?e.workday.workdayExtended+e.config.bigDayBonus:e.config.bigDayBonus,e.workday.end.setTime(e.workday.end.getTime()+e.config.bigDayBonus),e.day.bigDayExemptionUsed=!0,e.workday.is16HourExemptionApplied=!0)),i})),Driving:(0,o.e6)((e=>{let t;return void 0!==e.workday.driveCount&&void 0!==e.workday.drivingLimit?t=e.work
1day.drivingLimit-e.workday.driveCount:e.config.workday&&void 0!==e.config.workday.driveMaximum&&(t=e.config.workday.driveMaximum),t})),Duty:(0,o.e6)((e=>{let t;return void 0!==e.workday.onDutyCount&&void 0!==e.workday.dutyLimit?t=e.workday.dutyLimit-e.workday.onDutyCount:e.config.workday&&void 0!==e.config.workday.dutyMaximum&&(t=e.config.workday.dutyMaximum),t})),Rest:(0,o.e6)((e=>{if(e.config.rest&&e.config.rest)return e.config.rest.onDutyCountTowardRest&&void 0!==e.workday.timeUntilMustRest?e.workday.timeUntilMustRest:$e(e,e.config.rest.betweenRestLimit)})),Cycle:(0,o.e6)((e=>{var t,i;if(void 0!==(null===(t=e.config.cycle)||void 0===t?void 0:t.cycleStatuses))return;let o=e.cycle.cycleMaximum||(null===(i=e.config.cycle)||void 0===i?void 0:i.cycleMaximum);return o?o-e.cycle.onDutyCount:void 0})),CycleDriving:(0,o.e6)((e=>{let t=(e=>{var t;let i=null===(t=e.config.cycle)||void 0===t?void 0:t.cycleDrivingMaximum;if(i)return i-e.cycle.driveCount})(e),i=(e=>{let t=e.config.cycle;if(!t)return;let i=t.maxPercentDriving;if(t.cycleDays&&i){let i=24*(t.cycleDays-e.cycle.days)*o.Al;return i+=e.cycle.onDutyCount,i+=(0,o.Or)(e),Math.trunc(.5*i)-e.cycle.driveCount}})(e),n=[t,i].filter(tt);return n.length?Math.min(...n):void 0})),CycleRest:(0,o.e6)((e=>{var t;let i,n=e.config.cycle;if(!n)return;let a=null!==(t=n.cycleRestPeriods)&&void 0!==t?t:1,s=a>1?n.cycleDays:n.cycleRestDays;if(s&&e.cycle.completedRestPeriodDates.length>0){let t=new Date(e.cycle.completedRestPeriodDates[0].getTime());const n=Math.min(e.cycle.completedRestPeriodDates.length,a);t.setDate(t.getDate()+s-(a-(n-1))),t=(0,o.W_)(t,e.toLocalTime,e.toUtcTime),i=t.getTime()-e.nextDate.getTime()}return i})),CycleEnd:(0,o.e6)((e=>{let t=e.config.cycle;if(!t||!t.nonRolling||!t.cycleDays)return;if(e.cycle.days>t.cycleDays){let i=new Date(e.nextDate);return i.setDate(i.getDate()-(e.cycle.days-t.cycleDays)),(0,o.W_)(i,e.toLocalTime,e.toUtcTime).getTime()-e.nextDate.getTime()}let i=new Date(e.nextDate);return i.setDate(i.getDate()+(t.cycleDays-e.cycle.days)),(0,o.W_)(i,e.toLocalTime,e.toUtcTime).getTime()-e.nextDate.getTime()})),DutySinceCycleRest:(0,o.e6)((e=>{let t,i=e.config.cycle&&e.config.cycle.dutyMaximumSinceCycleRest;return i&&(t=i-e.cycle.dutyCountSince24HourRestPeriod),t})),DailyDriving:(0,o.e6)((e=>Ge(e.day,e.config))),DailyDuty:(0,o.e6)((e=>Ke(e.day,e.config))),DailyOff:(0,o.e6)((e=>{var t,i,n,a;const s=Ze(e);if(0===s&&(null===(i=null===(t=e.config)||void 0===t?void 0:t.daily)||void 0===i?void 0:i.offDutyMinimum)){let t,i=0;if("DayOne"===e.day.deferralStatus){const t=null!==(n=e.day.deferralTime)&&void 0!==n?n:0,o=null!==(a=Ye(e.day,e.config))&&void 0!==a?a:0,s=Math.max(0,e.day.offDutyCount-o);i=t>s?t-s:t}if(e.customCodes.disableDstDailyAvailabilityFix){const i=new Date(e.nextDate);i.setDate(i.getDate()+1),t=(0,o.W_)(i,e.toLocalTime,e.toUtcTime)}else t=(0,o.Zv)(e.nextDate,e.toLocalTime,e.toUtcTime,2);return t.getTime()-e.nextDate.getTime()-e.config.daily.offDutyMinimum-i}return void 0===s?void 0:(0,o.Or)(e)-s})),DailyRest:(0,o.e6)((e=>{var t,i;const n=et(e);if(0===n&&(null===(i=null===(t=e.config)||void 0===t?void 0:t.rest)||void 0===i?void 0:i.dailyRestMinimum)){let t;if(e.customCodes.disableDstDailyAvailabilityFix){const i=new Date(e.nextDate);i.setDate(i.getDate()+1),t=(0,o.W_)(i,e.toLocalTime,e.toUtcTime)}else t=(0,o.Zv)(e.nextDate,e.toLocalTime,e.toUtcTime,2);return t.getTime()-e.nextDate.getTime()-e.config.rest.dailyRestMinimum}return void 0===n?void 0:(0,o.Or)(e)-n}))},ot=(e,t=!1)=>{let i={};for(let o of Object.keys(it)){let n=it[o](e,t);void 0!==n&&(i[o]=n)}return be(e,i),i};var nt=i(13054);const at=e=>{let t=e.filter((e=>"number"==typeof e));return 0===t.length?void 0:Math.min(...t)},st=(e,t)=>{var i;if(!(null===(i=e.config.rest)||void 0===i?void 0:i.earlyRestBreaks))return{rest:t.Rest};let n=(e=>{var t;let i,n,a=null===(t=e.config.rest)||void 0===t?void 0:t.earlyRestBreaks;if(a&&0!==a.length){for(let t=0;t<a.length;t++){let s=$e(e,a[t].betweenRestLimit);if(s&&s>0){i=s,n=(0,o.Pv)(a[t].restBreakMinimum);break}}return{rest:i,label:n}}})(e);return void 0===(null==n?void 0:n.rest)?{rest:t.Rest,restLabel:(0,o.Pv)(e.config.rest.restBreakMinimum)}:{rest:n.rest,restLabel:n.label}},rt=(e,t)=>{let i=((e,t)=>{if(void 0===e.Duty)return;let i=[e.Duty,e.DutySinceCycleRest,t],o=at(i);return void 0===o?void 0:Math.max(0,o)})(t,(e=>{var t;let i=e.nextDateIndex===e.day.dateIndex;if(e.isInit&&i&&void 0!==(null===(t=e.config.daily)||void 0===t?void 0:t.dutyMaximum)){let t=je(e.day,e.config,!0);if(void 0!==t){let i=(0,o.Or)(e)-t;o.oP.indexOf(e.current.status)>-1&&e.day.unCountedOff&&(i+=e.day.unCountedOff);let n=Ke(e.day,e.config);return Math.min(null!=n?n:i,i)}return Ke(e.day,e.config)}})(e)),n=((e,t,i)=>{let o=at([e,t,i]);return void 0===o?void 0:Math.max(0,o)})(t.Cycle,t.CycleRest,t.CycleEnd),a=((e,t,i)=>{if(void 0===e.Driving)return;let o=[e.Driving,e.Workday,e.DailyDriving,e.CycleDriving,t,i],n=at(o);return void 0===n?void 0:Math.max(0,n)})(t,i,n),{rest:s,restLabel:r}=st(e,t);return{duty:i,driving:a,cycle:n,rest:s,restLabel:r}},lt=(e,t=!1)=>{var i;let{hosRecap:n,hosCycleAvailabilities:a}=e.isFlagEnabled&&e.isFlagEnabled(nt.u.DISABLE_CYCLE_GAIN_CALCULATION)?(0,o.RG)(e,t):(0,o.sV)(e,t),s={recap:n};void 0!==a&&(s.cycleAvailabilities=a);let r=(e=>{var t,i;let o=ot(e,!0),n={cycleRest:o.CycleRest,dutySinceCycleRest:o.DutySinceCycleRest,workday:o.Workday,cycleDriving:o.CycleDriving,dailyOff:o.DailyOff,dailyDriving:o.DailyDriving,dailyDuty:o.DailyDuty},a=rt(e,o);return n.duty=a.duty,n.rest=a.rest,n.restLabel=a.restLabel,n.driving=a.driving,((null===(t=e.config.cycle)||void 0===t?void 0:t.cycleMaximum)||(null===(i=e.config.cycle)||void 0===i?void 0:i.cycleDrivingMaximum))&&(n.cycle=a.cycle),be(e,n),Object.keys(n).forEac
1h((e=>void 0===n[e]&&delete n[e])),n})(e);(null===(i=e.config.rest)||void 0===i?void 0:i.onDutyCountTowardRest)&&void 0!==e.workday.consecutiveRestCount&&(r.drivingBreakDuration=e.workday.consecutiveRestCount),((e,t)=>{var i,o,n,a,s;let r=e.workday.hasStarted,l=(null===(i=e.next)||void 0===i?void 0:i.status)&&e.next.status.match(/^(OFF|SB|PC)$/);if(e.config.railroadExempt&&(t.isRailroadExemptionAvailable=r&&!ri(e)&&(null===(o=e.config.cycle)||void 0===o?void 0:o.cycleMaximum)===e.cycle.cycleMaximum),e.workday.drivingLimit&&(t.isAdverseDrivingExemptionAvailable=!l,t.isAdverseDrivingApplied=void 0!==e.workday.drivingExtended&&e.workday.drivingExtended>0),e.config.bigDayBonus&&(null===(n=e.config.workday)||void 0===n?void 0:n.workdayMaximum)&&(t.is16HourExemptionAvailable=r&&!Be(e)&&Oe(e)),null===(a=e.config.workday)||void 0===a?void 0:a.exemptionReducedRest){let i=Fe(e);t.exemptionReducedRest={isAvailable:Ie(e,i.restAmountToBeDeferred),restAmountToBeDeferred:i.restAmountToBeDeferred}}if(null!=e.config.splitConfig){let i=e.workdays[e.workdays.length-2];t.isSplittingWorkday=!!i&&!0===i.completedSplitSB}e.isInit&&e.config.rest&&void 0!==e.config.rest.dailyRestMinimum&&void 0!==e.config.daily&&(t.isOffDutyDeferralExemptionAvailable=!1!==(null===(s=e.config.daily)||void 0===s?void 0:s.deferralAllowed)&&e.workday.hasStarted&&(void 0===e.day.deferralStatus||"None"===e.day.deferralStatus||void 0===e.day.deferralTime))})(e,s);for(let e in r){let t=e,i=r[t];void 0!==i&&(s[t]="number"==typeof i?(0,o.Pv)(i):i)}return{availability:s,preciseAvailability:r}},dt={Workday:e=>it.Workday(e,!0),Driving:e=>it.Driving(e,!0),Duty:e=>it.Duty(e,!0),Rest:e=>it.Rest(e,!0),Cycle:e=>it.Cycle(e,!0),CycleDriving:e=>it.CycleDriving(e,!0),CycleRest:e=>it.CycleRest(e,!0),CycleEnd:e=>it.CycleEnd(e,!0),DutySinceCycleRest:e=>it.DutySinceCycleRest(e,!0),DailyDriving:e=>it.DailyDriving(e,!0),DailyDuty:e=>it.DailyDuty(e,!0),DailyOff:e=>it.DailyOff(e,!0),DailyRest:e=>it.DailyRest(e,!0)};var ct=i(67620);function ut(e,t,i,n=[],a=0,s=0){const r=function(e){return{availability:Object.assign({},e.availability),preciseAvailability:void 0===e.preciseAvailability?void 0:Object.assign({},e.preciseAvailability),violations:[...e.violations]}}(e);if(void 0===t)return r;const l=function(e){var t;const i=null===(t=e.workdaySummaries)||void 0===t?void 0:t[e.workdaySummaries.length-1];if(void 0===i||!0!==i.isInProgress)return;if(void 0===i.fromDate||void 0===i.toDate)return;return i}(e);if(void 0===l)return r;const d=t+i+a,c=function(e,t){const i=e.fromDate.getTime()+t;return e.toDate.getTime()-i}(l,d);if(c<=0)return r;const u=function(e,t,i){const n=Math.max(function(e,t){const i=void 0===e?0:(0,o.PN)(e);return Math.max(0,i-t)}(e.availability.workday,t),i),a=function(e,t){const i=void 0===e?0:(0,o.PN)(e);return Math.min(i,t)}(e.availability.driving,n);e.availability.workday=(0,o.Pv)(n),e.availability.driving=(0,o.Pv)(a),void 0!==e.preciseAvailability&&(e.preciseAvailability.workday=n,e.preciseAvailability.driving=a);return e}(r,c,s),m=new Date(l.fromDate.getTime()+d);return u.violations=function(e,t,i){const o=i.filter((e=>e.end.getTime()>t.getTime())).map((e=>function(e,t){const i=Math.max(e.start.getTime(),t.getTime());return{type:"Workday",fromDate:new Date(i),toDate:e.end}}(e,t)));return[...e.filter((e=>!function(e,t){if("Workday"!==e.type)return!1;return t.some((t=>function(e,t){if(void 0===e.toDate)return!1;const i=t.fromDate.getTime()>=e.fromDate.getTime();if(!i)return!1;if(void 0===t.toDate)return!0;return t.toDate.getTime()<=e.toDate.getTime()}(t,e)))}(e,o))),...o]}(u.violations,m,n),u}class mt{underlyingTrajectory(e){return this.isConsuming(e)?Me:Re}nextDayBoundary(e){return new Date(e.nextDate.getTime()+(0,o.Or)(e))}cycleResetDate(e){var t,i;const{cycleRestartMinimum:n}=null!==(t=e.config.cycle)&&void 0!==t?t:{};if(!(-1!==o.oP.indexOf(null===(i=e.current)||void 0===i?void 0:i.status))||!n||e.cycle.pauseCountingCycleOff||e.cycle.cycleConsecutiveOffCount>=n)return;const a=n-e.cycle.cycleConsecutiveOffCount;return new Date(e.currentDate.getTime()+a)}compute(e){const t=this.availabilityFactors(e),i=this.exhaustion(e),o=fe(e.emergencyResponsePeriods,e.nextDate)?Ae(e,this.rawAvailability(e),this.underlyingTrajectory(e),i):void 0;if(void 0===t&&void 0===o)return;const n=Object.assign({},null!=t?t:{});(null==o?void 0:o.transition)&&o.transition.date.getTime()>e.nextDate.getTime()&&(n[o.transition.factorName]={factor:()=>o.transition.date,label:o.transition.label});const{winner:a,snapshot:s}=(e=>{let t;const i={};for(const o of Object.keys(e)){const{factor:n,label:a}=e[o],s=n();i[o]={date:s},void 0!==s&&(void 0===t||s.getTime()<t.date.getTime())&&(t={date:s,label:a})}return{winner:t,snapshot:i}})(n),r=o?o.exhaustion:i;return{isConsuming:!!o||this.isConsuming(e),nextAvailabilityEvent:a?{date:a.date,label:a.label}
1:void 0,nextExhaustionEvent:r?{date:r,label:"exhaustion"}:void 0,factors:s}}}const ht=(e,t,i,n)=>{const a=e.days.length,s=e.cycle.days;let r=i;for(let i=0;i<t;i++){if(i>0&&(r=(0,o.W_)(r,e.toLocalTime,e.toUtcTime)),s+i+1<t)continue;const l=a-t+i;if(!(l<0)&&(!(l<a-e.cycle.days)&&n(l)))return r}};class yt extends mt{conditions(e){var t,i,n,a;const s=it.Cycle(e,!1),r=-1!==o.cm.indexOf(null===(t=e.current)||void 0===t?void 0:t.status),l=null===(i=e.config.cycle)||void 0===i?void 0:i.cycleDays,d=void 0!==l&&e.cycle.days>=l?l:e.cycle.days,c=e.days.slice(-d).some((e=>{var t;return(null!==(t=e.onDutyCount)&&void 0!==t?t:0)>0})),u=null!==(a=null===(n=e.config.cycle)||void 0===n?void 0:n.cycleMaximum)&&void 0!==a?a:0;return{avail:s,isConsuming:r,hasDutyInCurrentCycle:c,cycleResetIsNoOp:(e.cycle.cycleMaximum||u)-e.cycle.onDutyCount===u}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return this.conditions(e).isConsuming}exhaustion(e){const t=this.conditions(e);if(void 0!==t.avail)return t.isConsuming&&t.avail>0?new Date(e.currentDate.getTime()+t.avail):void 0}availabilityFactors(e){var t,i;const o=this.conditions(e);if(void 0===o.avail)return;const n={},a=this.nextDayBoundary(e),s=null===(t=e.config.cycle)||void 0===t?void 0:t.cycleDays,r=!0===(null===(i=e.config.cycle)||void 0===i?void 0:i.nonRolling),l=this.cycleResetDate(e),d=(()=>{if(!s||r)return;const t=ht(e,s,a,(t=>{var i,o;return(null!==(o=null===(i=e.days[t])||void 0===i?void 0:i.onDutyCount)&&void 0!==o?o:0)>0}));return void 0===t||void 0!==l&&t.getTime()>=l.getTime()?void 0:t})();d&&(n.cycleWindowShift={factor:()=>d,label:"cycle window shift"});const c=o.hasDutyInCurrentCycle&&!o.cycleResetIsNoOp?l:void 0;return c&&(n.cycleReset={factor:()=>c,label:"cycle reset"}),n}}class pt extends mt{conditions(e){var t,i,n,a,s;const r=it.CycleDriving(e,!1),l="D"===(null===(t=e.current)||void 0===t?void 0:t.status),d=-1!==o.oP.indexOf(null===(i=e.current)||void 0===i?void 0:i.status),c=null===(n=e.config.cycle)||void 0===n?void 0:n.cycleDays,u=void 0!==c&&e.cycle.days>=c?c:e.cycle.days,m=e.days.slice(-u).some((e=>{var t;return(null!==(t=e.driveCount)&&void 0!==t?t:0)>0}));return{avail:r,isConsuming:l,isOffDuty:d,hasDrivingInCurrentCycle:m,hasCyclePercentConstraint:!(!(null===(a=e.config.cycle)||void 0===a?void 0:a.cycleDays)||!(null===(s=e.config.cycle)||void 0===s?void 0:s.maxPercentDriving))}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return this.conditions(e).isConsuming}exhaustion(e){const t=this.conditions(e);if(void 0!==t.avail)return t.isConsuming&&t.avail>0?new Date(e.currentDate.getTime()+t.avail):void 0}availabilityFactors(e){var t,i;const o=this.conditions(e);if(void 0===o.avail)return;const n={},a=this.nextDayBoundary(e),s=null===(t=e.config.cycle)||void 0===t?void 0:t.cycleDays,r=!0===(null===(i=e.config.cycle)||void 0===i?void 0:i.nonRolling),l=this.cycleResetDate(e),d=(()=>{if(!s||r)return;const t=ht(e,s,a,(t=>{var i,o;return(null!==(o=null===(i=e.days[t])||void 0===i?void 0:i.driveCount)&&void 0!==o?o:0)>0}));return void 0===t||void 0!==l&&t.getTime()>=l.getTime()?void 0:t})();d&&(n.cycleWindowShift={factor:()=>d,label:"cycle window shift"});const c=o.hasDrivingInCurrentCycle?l:void 0;c&&(n.cycleReset={factor:()=>c,label:"cycle reset"});const u=(()=>{var t;if(!o.isOffDuty||!o.hasCyclePercentConstraint)return;const i=null===(t=e.config.cycle)||void 0===t?void 0:t.cycleDrivingMaximum;if(!i)return;const n=864e5*(s-e.cycle.days)+e.cycle.onDutyCount,r=a.getTime()+n-2*i;return r<=e.currentDate.getTime()?new Date(e.currentDate.getTime()):void 0!==l&&r>=l.getTime()?void 0:new Date(r)})();return u&&(n.cyclePercentCrossing={factor:()=>u,label:"cycle percent crossing"}),n}}class ft extends mt{conditions(e){return{cycleEndRaw:it.CycleEnd(e,!1)}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).cycleEndRaw}isConsuming(e){return!0}exhaustion(e){const{cycleEndRaw:t}=this.conditions(e);if(void 0!==t)return t>0?new Date(e.currentDate.getTime()+t):void 0}availabilityFactors(e){const{cycleEndRaw:t}=this.conditions(e);if(void 0===t)return;const i=this.cycleResetDate(e);return{cycleRestart:{factor:()=>i,label:"cycle restart"}}}}class gt extends mt{conditions(e){var t,i,n,a,s,r;const l=it.CycleRest(e,!1),d=-1!==o.oP.indexOf(null===(t=e.current)||void 0===t?void 0:t.status),c=null!==(i=e.cycle.pauseCountingCycleOff)&&void 0!==i&&i,u=(null!==(a=null===(n=e.cycleRestartDatesFromOtherRulesets)||void 0===n?void 0:n.length)&&void 0!==a?a:0)>0&&e.cycleRestartDatesFromOtherRulesets.some((t=>t.getTime()<=e.nextDate.getTime())),m=null===(s=e.config.cycle)||void 0===s?void 0:s.cycleRestMinimum,h=null!==(r=e.cycle.cycleConsecutiveOffCount)&&void 0!==r?r:0,y=void 0!==m&&h<m;let p;return p=d?c?"OffDutyPaused":u?"OffDutyOtherRuleset":y?"OffDutyPreQualify":"OffDutySliding":"OnDuty",{avail:l,isOffDuty:d,pauseCountingCycleOff:c,otherRulesetActive:u,isPreQualify:y,stateKind:p}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return!0}exhaustion(e){const t=this.conditions(e);if(void 0!==t.avail)return t.avail>0?new Date(e.nextDate.getTime()+t.avail):void 0}availabilityFactors(e){var t,i;const n=this.conditions(e);if(void 0===n.avail)return;const a={};switch(n.stateKind){case"OnDuty":case"OffDutyPaused":return{};case"OffDutyOtherRuleset":{const t=e.cycle.completedRestPeriodDates;if(t.length>0&&t[t.length-1].getTime()===e.nextDate.getTime()){const t=(0,o.W_)(e.currentDate,e.toLocalTime,e.toUtcTime);a.nextDayBoundary={factor:()=>t,label:"day boundary"}}else a.nextDayBoundary={factor:()=>{},label:"day boundary"};return a}case"OffDutyPreQualify":{const o=e.config.cycle.cycleRestMinimum,n=null===(t=e.config.cycle)||void 0===t?void 0:t.cycleRestartMinimum,s=null!==(i=e.cycle.cycleConsecutiveOffCount)&&void 0!==i?i:0,r=new Date(e.nextDate.getTime()+(o-s));let l;return a.restPeriodComplete={factor:()=>r,label:"rest period complete"},void 0!==n&&s<n&&(l=new Date(e.nextDate.getTime()+(n-s))),a.cycleRestart={factor:()=>l,label:"cycle restart"},a}case"OffDutySliding":{const t=e.cycle.completedRestPeriodDates,i=t.length>0&&t[t.length-1].getTime()===e.nextDate.getTime()?(0,o.W_)(e.currentDate,e.toLocalTime,e.toUtcTime):void 0;return a.nextDayBoundary={factor:()=>i,label:"day boundary"},a}}}}class vt extends mt{conditions(e){var t,i;const o=it.DailyDriving(e,!1),n="D"===(null===(t=e.current)||void 0===t?void 0:t.status),a=e.day.driveCount>0,s=null===(i=e.config.daily)||void 0===i?void 0:i.driveMaximum;return{avail:o,isConsuming:n,hasActivity:a,isAtConfigMax:void 0!==s&&o===s}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return this.conditions(e).isConsuming}exhaustion(e){const{avail:t,isConsuming:i}=this.conditions(e);if(void 0===t)return;const n=(0,o.Or)(e);return i&&t>0&&t<n?new Date(e.nextDate.getTime()+t):void 0}availabilityFactors(e){const t=this.conditions(e);if(void 0===t.avail)return;const i=t.isConsuming||t.hasActivity||!t.isAtConfigMax?this.nextDayBoundary(e):void 0;return{nextDayBoundary:{factor:()=>i,label:"day boundary"}}}}class Dt extends mt{conditions(e){var t,i;const n=it.DailyDuty(e,!1),a=-1!==o.cm.indexOf(null===(t=e.current)||void 0===t?void 0:t.status),s=e.day.onDutyCount>0,r=null===(i=e.config.daily)||void 0===i?void 0:i.dutyMaximum;return{avail:n,isConsuming:a,hasActivity:s,isAtConfigMax:void 0!==r&&n===r}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return this.conditions(e).isConsuming}exhaustion(e){const{avail:t,isConsuming:i}=this.conditions(e);if(void 0===t)return;const n=(0,o.Or)(e);return i&&t>0&&t<n?new Date(e.nextDate.getTime()+t):void 0}availabilityFactors(e){const t=this.conditions(e);if(void 0===t.avail)return;const i=t.isConsuming||t.hasActivity||!t.isAtConfigMax?this.nextDayBoundary(e):void 0;return{nextDayBoundary:{factor:()=>i,label:"day boundary"}}}}class wt extends mt{conditions(e){var t,i,n,a;const s=it.DailyOff(e,!1),r=Ze(e),l=-1!==o.oP.indexOf(null===(t=e.current)||void 0===t?void 0:t.status),d=null!==(a=null===(n=null===(i=e.config)||void 0===i?void 0:i.rest)||void 0===n?void 0:n.restBreakMinimum)&&void 0!==a?a:0,c=ni(e),u=c?ai(e):0,m=e.workday.consecutiveOffStartTime;return{avail:s,offDutyNeeded:r,requirementMet:0===(null!=r?r:0),isOffDuty:l,work
1dayDominating:c&&u>=(null!=r?r:0),breakMidProgress:void 0!==m&&m.getTime()<e.nextDate.getTime(),credited:void 0===e.day.consecutiveOff||0===d||e.day.consecutiveOff>=d}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){const t=this.conditions(e);return!!t.requirementMet||(!t.isOffDuty||!t.workdayDominating&&!t.credited)}exhaustion(e){const t=this.conditions(e);if(void 0===t.avail||void 0===t.offDutyNeeded)return;const i=(0,o.Or)(e),n=t.avail>0&&t.avail<i?new Date(e.nextDate.getTime()+t.avail):void 0;return(t.requirementMet||t.isOffDuty)&&(t.requirementMet||!t.isOffDuty||t.workdayDominating||t.credited)?t.requirementMet&&!t.isOffDuty&&t.avail>0?new Date(e.nextDate.getTime()+t.avail):void 0:n}availabilityFactors(e){var t,i,o,n,a,s,r,l,d;const c=this.conditions(e);if(void 0===c.avail||void 0===c.offDutyNeeded)return;const u=this.nextDayBoundary(e);if(c.requirementMet&&!c.isOffDuty)return{};if(c.requirementMet){const n=null!==(o=null===(i=null===(t=e.config)||void 0===t?void 0:t.rest)||void 0===i?void 0:i.restBreakMinimum)&&void 0!==o?o:0,a=new Date(u.getTime()+n);return{creditEvent:{factor:()=>a,label:"credit threshold"}}}if(!c.isOffDuty)return{nextDayBoundary:{factor:()=>u,label:"day boundary"}};if(c.workdayDominating&&!c.breakMidProgress)return{coverageGap:{factor:()=>e.nextDate,label:"now (coverage gap)"}};if(c.workdayDominating){const t=null!==(n=e.workday.offDutyMinimum)&&void 0!==n?n:0,i=new Date(e.workday.consecutiveOffStartTime.getTime()+t);return{nextDayBoundary:{factor:()=>u,label:"day boundary"},workdayReset:{factor:()=>i,label:"workday reset"}}}if(!c.credited){const t=null!==(r=null===(s=null===(a=e.config)||void 0===a?void 0:a.rest)||void 0===s?void 0:s.restBreakMinimum)&&void 0!==r?r:0,i=e.currentDate.getTime()-(null!==(l=e.day.consecutiveOff)&&void 0!==l?l:0),o=new Date(i+t),n=(null!==(d=c.avail)&&void 0!==d?d:0)+t;return((e,t,i)=>{const o=we(e);return!(void 0===o||t.getTime()>=o.exemptionEnd.getTime())&&i<o.driverDayBoundary.getTime()-t.getTime()})(e,o,n)?{nextDayBoundary:{factor:()=>u,label:"day boundary"}}:{nextDayBoundary:{factor:()=>u,label:"day boundary"},creditEvent:{factor:()=>o,label:"credit threshold"}}}const m=new Date(e.nextDate.getTime()+c.offDutyNeeded);return{nextDayBoundary:{factor:()=>u,label:"day boundary"},requirementMet:{factor:()=>m,label:"requirement met"}}}}class bt extends mt{conditions(e){var t,i,n,a,s,r,l,d,c,u,m;const h=it.DailyRest(e,!1),y=et(e),p=-1!==o.oP.indexOf(null===(t=e.current)||void 0===t?void 0:t.status),f=null!==(a=null===(n=null===(i=e.config)||void 0===i?void 0:i.rest)||void 0===n?void 0:n.restBreakMinimum)&&void 0!==a?a:0,g=null!==(s=e.workday.consecutiveOffCount)&&void 0!==s?s:0,v="WT"===(null===(r=e.current)||void 0===r?void 0:r.status)&&!1===(null===(l=e.config.workday)||void 0===l?void 0:l.consecutiveOffCountIncludesWt)?null!==(d=e.workday.consecutiveWtCount)&&void 0!==d?d:0:g,D=e.workday.consecutiveOffStartTime,w=null!==(u=null===(c=e.day.restInfo)||void 0===c?void 0:c.some((e=>e.isTemp)))&&void 0!==u&&u,b=void 0!==D&&D.getTime()+f<=e.nextDate.getTime(),S=0===(null!=y?y:0),C=f>0&&g<f&&!w&&!b,T=!(void 0===D&&0===v),x=void 0!==(null===(m=e.current)||void 0===m?void 0:m.dateTime);let k,M;if(k=S&&!p?"RequirementMetOnDuty":S?"RequirementMetOffDutyAtBoundary":p?C?T?"OffDutyUncredited":x?"OffDutyUncreditedAtBoundary":"OffDutyUncreditedNoLog":"OffDutyCredited":"OnDuty","RequirementMetOnDuty"===k){M=0===Qe(e.day,e.config)}return{avail:h,restNeeded:y,requirementMet:S,isOffDuty:p,uncredited:C,hasAnchor:T,hasCurrentLog:x,stateKind:k,exemptionZeroedRequirement:M}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return"OffDutyCredited"!==this.conditions(e).stateKind}exhaustion(e){const t=this.conditions(e);if(void 0!==t.avail){if("OnDuty"===t.stateKind||"OffDutyUncreditedAtBoundary"===t.stateKind||"OffDutyUncredited"===t.stateKind){const i=(0,o.Or)(e);if(t.avail>0&&t.avail<i)return new Date(e.nextDate.getTime()+t.avail)}return"RequirementMetOnDuty"===t.stateKind&&!t.exemptionZeroedRequirement&&t.avail>0?new Date(e.nextDate.getTime()+t.avail):void 0}}availabilityFactors(e){var t,i,o,n,a,s,r,l;const d=this.conditions(e);if(void 0===d.avail||void 0===d.restNeeded)return;const c=this.nextDayBoundary(e);switch(d.stateKind){case"RequirementMetOnDuty":return d.exemptionZeroedRequirement?{requirementMetBoundary:{factor:()=>c,label:"day boundary"}}:{};case"RequirementMetOffDutyAtBoundary":case"OffDutyUncreditedAtBoundary":return{coverageGap:{factor:()=>e.nextDate,label:"now (coverage gap)"}};case"OnDuty":return{nextDayBoundary:{factor:()=>c,label:"day boundary"}};case"OffDutyUncreditedNoLog":return{};case"OffDutyUncredited":{const d=null!==(o=null===(i=null===(t=e.config)||void 0===t?void 0:t.rest)||void 0===i?void 0:i.restBreakMinimum)&&void 0!==o?o:0,u=null!==(n=e.workday.consecutiveOffCount)&&void 0!==n?n:0,m="WT"===(null===(a=e.current)||void 0===a?void 0:a.status)&&!1===(null===(s=e.config.workday)||void 0===s?void 0:s.consecutiveOffCountIncludesWt)?null!==(r=e.workday.consecutiveWtCount)&&void 0!==r?r:0:u,h=null===(l=e.work
1day.consecutiveOffStartTime)||void 0===l?void 0:l.getTime(),y=null!=h?h:e.nextDate.getTime()-m,p=new Date(y+d);return{nextDayBoundary:{factor:()=>c,label:"day boundary"},creditEvent:{factor:()=>p,label:"credit threshold"}}}case"OffDutyCredited":{const t=new Date(e.nextDate.getTime()+d.restNeeded);return{nextDayBoundary:{factor:()=>c,label:"day boundary"},requirementMet:{factor:()=>t,label:"requirement met"}}}}}}const St=["Workday","Driving","Duty"],Ct=e=>St.some((t=>t in e.currentViolations))||e.emergencyResponseSuppressedViolations.some((e=>-1!==St.indexOf(e)));class Tt extends mt{conditions(e){var t,i,n,a,s;const r=it.Driving(e,!1),l="D"===(null===(t=e.current)||void 0===t?void 0:t.status),d=-1!==o.oP.indexOf(null===(i=e.current)||void 0===i?void 0:i.status),c=(null!==(n=e.workday.driveCount)&&void 0!==n?n:0)>0;return{avail:r,isConsuming:l,isOffDuty:d,hasDrivingInWorkday:c,isAtBaseMax:!c&&r===(null!==(s=null===(a=e.config.workday)||void 0===a?void 0:a.driveMaximum)&&void 0!==s?s:0)}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return this.conditions(e).isConsuming}exhaustion(e){const{avail:t,isConsuming:i}=this.conditions(e);if(void 0!==t&&i)return t>0?new Date(e.nextDate.getTime()+t):void 0}availabilityFactors(e){const t=this.conditions(e);if(void 0===t.avail)return;if(!t.isConsuming&&!t.isOffDuty)return;if(t.isConsuming)return{};if(t.isAtBaseMax)return;const i={},n=(e=>{var t,i,n,a;if(-1===o.oP.indexOf(null===(t=e.current)||void 0===t?void 0:t.status)||!(e=>{var t,i;return"WT"!==(null===(t=e.current)||void 0===t?void 0:t.status)||!1!==(null===(i=e.config.workday)||void 0===i?void 0:i.consecutiveOffCountIncludesWt)})(e))return{date:void 0,isStable:!0};const s=e.workday.offDutyMinimum;if(void 0===s)return{date:void 0,isStable:!0};const r=e.workday.consecutiveOffStartTime;if(!r)return{date:e.nextDate,isStable:!1};if((null===(i=e.config.workday)||void 0===i?void 0:i.exemptionReducedRest)&&!e.workday.isExemptionReducedRestApplied)return{date:e.nextDate,isStable:!1};const l=null!==(a=null===(n=e.config.workday)||void 0===n?void 0:n.offDutyMinimum)&&void 0!==a?a:s,d=Math.min(s,l),c=new Date(r.getTime()+d);return c<=e.nextDate?{date:void 0,isStable:!0}:{date:c,isStable:!0}})(e);if(n.date){i[n.isStable?"offDutyReset":"UNKNOWN_offDutyResetCoverageGap"]={factor:()=>n.date,label:"workday reset"}}const a=(e=>{var t;if("SB"!==(null===(t=e.current)||void 0===t?void 0:t.status)||e.intermediateSplitConfig.violationPreventsSplitCompletion&&Ct(e))return;const i=e.config.splitConfig,n=e.workday.splitSB;if("symmetric"!==(null==i?void 0:i.type)||!n||!n.inSleeper||2!==n.periods.length)return;const{splitMinimum:a,splitTotal:s}=i,r=n.periods[0],l=n.periods[1],d=(0,o.cl)(r);if(d<a)return;const c=Math.max(a,s-d);return(0,o.cl)(l)>=c?void 0:new Date(l.fromDate.getTime()+c)})(e);a&&(i.passengerSplitReset={factor:()=>a,label:"split sleeper restart"});const s=(e=>{var t,i;if(-1===o.oP.indexOf(null===(t=e.current)||void 0===t?void 0:t.status)||"WT"===(null===(i=e.current)||void 0===i?void 0:i.status))return;if(e.customCodes.enablePreventSplitCompleteWhenViolationFix&&Ct(e))return;const n=e.workday.propertySplitSB,a=e.config.splitConfig;return n&&a&&"asymmetric"===a.type?e.nextDate:void 0})(e);return s&&(i.UNKNOWN_splitPropertyResetCoverageGap={factor:()=>s,label:"split sleeper restart"}),0!==Object.keys(i).length?i:void 0}}const xt=(e,t)=>
1{var i;const o=e.config.rest;if(null==o?void 0:o.restBreakMinimum)return(null!==(i=o.earlyRestBreaks)&&void 0!==i?i:[]).reduce(((i,o)=>void 0!==e.workday.endOfLastBreak&&t.getTime()-e.workday.endOfLastBreak.getTime()>o.betweenRestLimit?i:Math.min(i,o.restBreakMinimum)),o.restBreakMinimum)};class kt extends mt{conditions(e){var t,i,o,n;const a=it.Rest(e,!1),s=!0===(null===(t=e.config.rest)||void 0===t?void 0:t.onDutyCountTowardRest),r=s?e.workday.consecutiveRestCount:e.workday.consecutiveOffCount,l=s?e.workday.consecutiveRestStartTime:e.workday.consecutiveOffStartTime;return{avail:a,isConsuming:"D"===(null===(i=e.current)||void 0===i?void 0:i.status),restBreakMinimum:null===(o=e.config.rest)||void 0===o?void 0:o.restBreakMinimum,isOnDutyCountTowardRest:s,consecutiveBreakTime:r,breakStartTime:l,effectiveBreakMinimum:void 0===l?void 0:xt(e,l),restBreakMaximum:null===(n=e.config.rest)||void 0===n?void 0:n.betweenRestLimit}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return this.conditions(e).isConsuming}underlyingTrajectory(e){return this.conditions(e).isOnDutyCountTowardRest?super.underlyingTrajectory(e):Me}exhaustion(e){const{avail:t,isConsuming:i}=this.conditions(e);if(void 0!==t&&i)return t>0?new Date(e.nextDate.getTime()+t):void 0}availabilityFactors(e){var t;const i=this.conditions(e);if(void 0===i.avail)return;if(i.isConsuming)return{};if(!i.restBreakMinimum)return;if(void 0===i.breakStartTime||void 0===i.effectiveBreakMinimum)return;if(!i.consecutiveBreakTime&&!i.isOnDutyCountTowardRest&&!((e,t)=>void 0!==t&&fe(e.emergencyResponsePeriods,e.nextDate)&&t<(0,o.Or)(e))(e,i.avail))return;if((null!==(t=i.consecutiveBreakTime)&&void 0!==t?t:0)>=i.restBreakMinimum)return;if(void 0!==i.restBreakMaximum&&i.avail>=i.restBreakMaximum)return;const n=new Date(i.breakStartTime.getTime()+i.effectiveBreakMinimum);return{breakQualify:{factor:()=>n,label:"break qualifies"}}}}class Mt extends mt{conditions(e){var t,i,n,a,s;return{avail:it.Duty(e,!1),isOnDuty:-1!==o.cm.indexOf(null===(t=e.current)||void 0===t?void 0:t.status),splitSBInProgress:!(!(null===(i=e.workday.splitSB)||void 0===i?void 0:i.inSleeper)&&!(null===(n=e.workday.propertySplitSB)||void 0===n?void 0:n.inSleeper)),breakMidProgress:void 0!==e.workday.consecutiveOffStartTime&&e.workday.consecutiveOffStartTime.getTime()<e.nextDate.getTime(),isErrPending:!!(e.reducedRestLogs&&e.reducedRestLogs.length>0),dutyLimit:null!==(a=e.workday.dutyLimit)&&void 0!==a?a:null===(s=e.config.workday)||void 0===s?void 0:s.dutyMaximum}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return this.conditions(e).isOnDuty}exhaustion(e){const t=this.conditions(e);if(void 0!==t.avail&&t.isOnDuty)return t.avail>0?new Date(e.nextDate.getTime()+t.avail):void 0}breakOpeningResetDate(e,t){var i,o,n,a;const s=e.workday.consecutiveOffStartTime,r=e.workday.offDutyMinimum,l=void 0!==t.avail&&void 0!==t.dutyLimit&&t.avail<t.dutyLimit,d="WT"!==(null===(i=e.current)||void 0===i?void 0:i.status)||!1!==(null===(o=e.config.workday)||void 0===o?void 0:o.consecutiveOffCountIncludesWt);if(void 0!==s&&void 0!==r&&l&&d&&!t.isErrPending&&r===(null===(n=e.config.workday)||void 0===n?void 0:n.offDutyMinimum)&&"asymmetric"!==(null===(a=e.config.splitConfig)||void 0===a?void 0:a.type))return new Date(s.getTime()+r)}availabilityFactors(e){var t,i,o,n,a;const s=this.conditions(e);if(void 0===s.avail)return;if(s.isOnDuty)return{};if(s.splitSBInProgress)return{UNKNOWN_splitSb:{factor:()=>e.nextDate,label:"coverage gap"}};if(s.breakMidProgress){if(s.isErrPending){const n=null!==(o=null===(i=null===(t=e.config.workday)||void 0===t?void 0:t.exemptionReducedRest)||void 0===i?void 0:i.offDutyMinimum)&&void 0!==o?o:0,a=void 0!==s.dutyLimit&&s.avail<s.dutyLimit?new Date(e.workday.consecutiveOffStartTime.getTime()+n):void 0;return a?{workdayResetErr:{factor:()=>a,label:"workday reset"}}:{}}const r=s.dutyLimit,l="WT"!==(null===(n=e.current)||void 0===n?void 0:n.status)||!1!==(null===(a=e.config.workday)||void 0===a?void 0:a.consecutiveOffCountIncludesWt),d=void 0!==r&&s.avail<r,c=l&&d&&void 0!==e.workday.offDutyMinimum?new Date(e.work
1day.consecutiveOffStartTime.getTime()+e.workday.offDutyMinimum):void 0;return c?{workdayReset:{factor:()=>c,label:"workday reset"}}:{}}const r=this.breakOpeningResetDate(e,s);return Object.assign({UNKNOWN_noAnchor:{factor:()=>e.nextDate,label:"coverage gap"}},r?{workdayReset:{factor:()=>r,label:"workday reset"}}:{})}}class Rt extends mt{conditions(e){var t,i,n,a,s;const r=it.DutySinceCycleRest(e,!1),l=-1!==o.cm.indexOf(null===(t=e.current)||void 0===t?void 0:t.status),d=-1!==o.oP.indexOf(null===(i=e.current)||void 0===i?void 0:i.status),c=null===(n=e.config.cycle)||void 0===n?void 0:n.cycleRestMinimum,u=null!==(a=e.cycle.cycleConsecutiveOffCount)&&void 0!==a?a:0;return{avail:r,isOnDuty:l,canQualify:d&&void 0!==c&&!e.cycle.pauseCountingCycleOff&&u<c&&(null!==(s=e.cycle.dutyCountSince24HourRestPeriod)&&void 0!==s?s:0)>0,cycleRestMinimum:c,cycleConsecutiveOffCount:u}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){return this.conditions(e).isOnDuty}exhaustion(e){const{avail:t,isOnDuty:i}=this.conditions(e);if(void 0!==t&&i)return t>0?new Date(e.currentDate.getTime()+t):void 0}availabilityFactors(e){const t=this.conditions(e);if(void 0!==t.avail){if(t.isOnDuty)return{};if(t.canQualify){const i=e.currentDate.getTime()-t.cycleConsecutiveOffCount,o=new Date(i+t.cycleRestMinimum);return{cycleRestQualifying:{factor:()=>o,label:"break qualifies"}}}return{}}}}class Et extends mt{symmetricSplitShape(e){var t,i,n;const a={holding:!1,draining:!1,at:void 0,value:void 0},s=e.config.splitConfig,r=null===(t=e.workday.splitSB)||void 0===t?void 0:t.periods,l=e.workday.start,d=e.workday.end,c=si(e);if("symmetric"!==(null==s?void 0:s.type)||!(null===(i=e.workday.splitSB)||void 0===i?void 0:i.inSleeper)||void 0===r||void 0===l||void 0===d||void 0===c)return a;const u=r[r.length-1],m=r[0];if(void 0===u||u.toDate.getTime()!==e.nextDate.getTime())return a;const h=(0,o.cl)(m);if(1===r.length){const t=l.getTime()+c-u.fromDate.getTime();if(h>=s.splitMinimum)return d.getTime()===l.getTime()+c+h?{holding:!0,draining:!1,at:void 0,value:t}:a;return e.intermediateSplitConfig.violationPreventsNewFreeze&&Ct(e)?a:{holding:!1,draining:!1,at:new Date(u.fromDate.getTime()+s.splitMinimum),value:t}}return 2!==r.length||h<s.splitMinimum||d.getTime()!==l.getTime()+c+h?a:e.intermediateSplitConfig.violationPreventsSplitCompletion&&Ct(e)?{holding:!1,draining:!0,at:void 0,value:void 0}:void 0!==(null===(n=e.config.workday)||void 0===n?void 0:n.workdayMaximumWhenSplitSB)?a:{holding:!1,draining:!1,at:new Date(u.fromDate.getTime()+s.splitTotal-h),value:m.toDate.getTime()+c-u.fromDate.getTime()}}conditions(e){var t,i,o,n,a,s,r,l;const d=it.Workday(e,!1),c=null!==(t=e.workday.hasStarted)&&void 0!==t&&t,u=!(!(null===(i=e.workday.splitSB)||void 0===i?void 0:i.inSleeper)&&!(null===(o=e.workday.propertySplitSB)||void 0===o?void 0:o.inSleeper)),m=void 0!==e.workday.consecutiveOffStartTime&&e.workday.consecutiveOffStartTime.getTime()<=e.nextDate.getTime(),h=e.config.splitConfig,y="asymmetric"===(null==h?void 0:h.type),p="symmetric"===(null==h?void 0:h.type),f=y||p&&(u||"SB"===(null===(n=e.current)||void 0===n?void 0:n.status)),g=this.symmetricSplitShape(e),v=!!(e.reducedRestLogs&&e.reducedRestLogs.length>0),D=!1!==(null===(a=e.config.workday)||void 0===a?void 0:a.wtExtendsWorkday);return{avail:d,workdayHasStarted:c,isInSleeperBerthNow:u,hasSbInstability:f,sbFreezeHolding:g.holding,sbDrainingThroughSplit:g.draining,sbFreezeAt:g.at,sbFreezeValue:g.value,breakMidProgress:m,isErrPending:v,offDutyMinimum:e.workday.offDutyMinimum,configOffDutyMinimum:null===(s=e.config.workday)||void 0===s?void 0:s.offDutyMinimum,consecutiveOffStartTime:e.workday.consecutiveOffStartTime,workdayEnd:e.workday.end,isWtActive:"WT"===(null===(r=e.current)||void 0===r?void 0:r.status),consecutiveOffCountIncludesWt:!1!==(null===(l=e.config.workday)||void 0===l?void 0:l.consecutiveOffCountIncludesWt),wtExtendsWorkday:D}}extractConditions(e){return this.conditions(e)}rawAvailability(e){return this.conditions(e).avail}isConsuming(e){const t=this.conditions(e),i=t.wtExtendsWorkday&&t.isWtActive&&t.work
1dayHasStarted&&void 0!==t.workdayEnd;return t.workdayHasStarted&&!t.hasSbInstability&&!i}underlyingTrajectory(e){const t=this.conditions(e);return t.hasSbInstability?t.sbFreezeHolding?Re:t.sbDrainingThroughSplit?Me:void 0!==t.sbFreezeAt&&void 0!==t.sbFreezeValue?{kind:"frozenFrom",at:t.sbFreezeAt,value:t.sbFreezeValue}:Ee:super.underlyingTrajectory(e)}exhaustion(e){const t=this.conditions(e);if(!t.workdayHasStarted||void 0===t.avail||!t.workdayEnd||t.hasSbInstability)return;return t.wtExtendsWorkday&&t.isWtActive&&void 0!==t.workdayEnd?void 0:t.avail>0?t.workdayEnd:void 0}workdayResetDate(e,t){if(!(!t.isWtActive||t.consecutiveOffCountIncludesWt)||void 0===t.offDutyMinimum||void 0===t.consecutiveOffStartTime)return;const i=t.consecutiveOffStartTime.getTime()+t.offDutyMinimum;if(void 0===t.configOffDutyMinimum||i<=this.nextDayBoundary(e).getTime())return new Date(i);const o=t.consecutiveOffStartTime.getTime()+t.configOffDutyMinimum;return new Date(Math.max(this.nextDayBoundary(e).getTime(),o))}availabilityFactors(e){var t,i,o;const n=this.conditions(e);if(void 0!==n.avail){if(!n.workdayHasStarted)return{};if(n.hasSbInstability){const t={UNKNOWN_splitSb:{factor:()=>e.nextDate,label:"coverage gap"}},i=n.sbFreezeHolding||n.sbDrainingThroughSplit||void 0!==n.sbFreezeAt?this.workdayResetDate(e,n):void 0;return i&&(t.workdayReset={factor:()=>i,label:"workday reset"}),t}if(n.breakMidProgress){if(n.isErrPending){const a=null!==(o=null===(i=null===(t=e.config.workday)||void 0===t?void 0:t.exemptionReducedRest)||void 0===i?void 0:i.offDutyMinimum)&&void 0!==o?o:0,s=void 0!==n.consecutiveOffStartTime?new Date(n.consecutiveOffStartTime.getTime()+a):void 0;return s?{workdayResetErr:{factor:()=>s,label:"workday reset"}}:{}}const a=this.workdayResetDate(e,n);return a?{workdayReset:{factor:()=>a,label:"workday reset"}}:{}}return{}}}}const At=e=>t=>{var i,o;const n=e(t);if(n)return{isConsuming:n.isConsuming,nextAvailabilityEventDate:null===(i=n.nextAvailabilityEvent)||void 0===i?void 0:i.date,nextExhaustionEventDate:null===(o=n.nextExhaustionEvent)||void 0===o?void 0:o.date}},_t={Rest:{kind:"implemented",computeResult:e=>(new kt).compute(e),extractConditions:e=>(new kt).extractConditions(e)},Driving:{kind:"implemented",computeResult:e=>
1(new Tt).compute(e),extractConditions:e=>(new Tt).extractConditions(e)},Duty:{kind:"implemented",computeResult:e=>(new Mt).compute(e),extractConditions:e=>(new Mt).extractConditions(e)},Cycle:{kind:"implemented",computeResult:e=>(new yt).compute(e),extractConditions:e=>(new yt).extractConditions(e)},CycleDriving:{kind:"implemented",computeResult:e=>(new pt).compute(e),extractConditions:e=>(new pt).extractConditions(e)},DailyDriving:{kind:"implemented",computeResult:e=>(new vt).compute(e),extractConditions:e=>(new vt).extractConditions(e)},DailyDuty:{kind:"implemented",computeResult:e=>(new Dt).compute(e),extractConditions:e=>(new Dt).extractConditions(e)},DailyOff:{kind:"implemented",computeResult:e=>(new wt).compute(e),extractConditions:e=>(new wt).extractConditions(e)},DailyRest:{kind:"implemented",computeResult:e=>(new bt).compute(e),extractConditions:e=>(new bt).extractConditions(e)},CycleRest:{kind:"implemented",computeResult:e=>(new gt).compute(e),extractConditions:e=>(new gt).extractConditions(e)},DutySinceCycleRest:{kind:"implemented",computeResult:e=>(new Rt).compute(e),extractConditions:e=>(new Rt).extractConditions(e)},Workday:{kind:"implemented",computeResult:e=>(new Et).compute(e),extractConditions:e=>(new Et).extractConditions(e)},CycleEnd:{kind:"implemented",computeResult:e=>(new ft).compute(e),extractConditions:e=>(new ft).extractConditions(e)}},Xt=e=>{},Ot=(()=>{const e={};for(const t in _t){const i=_t[t];e[t]="implemented"===i.kind?At(i.computeResult):Xt}return e})(),Pt=((()=>{const e={};for(const t in _t){const i=_t[t];e[t]="implemented"===i.kind?{computeResult:i.computeResult,extractConditions:i.extractConditions}:void 0}})(),e=>!!(!e.workday.completedSplitSB&&e.workday.splitSB&&e.workday.splitSB.periods.length>0)),Lt=e=>{e.workday.splitLogs||(e.workday.splitLogs=[]);const t=e.workday.splitLogs,i=t.length>0?t[t.length-1].dateTime:void 0;(!i||e.currentDate>i)&&t.push(e.current)},It=(e,t,i)=>{var o;const n=si(e),a=e.config.workday;if(!(t&&e.workday&&e.workday.start&&a&&n&&e.workday.splitLogs&&e.workday.splitLogs.length&&i))return;if(!((e,t)=>{let i=!0;return e.currentViolations.Workday&&(e.currentViolations.Workday.fromDate.getTime()>=t.getTime()?(delete e.currentViolations.Workday,Ce(e,"Workday")):i=!1),i})(e,e.workday.splitLogs[0].dateTime))return;return{workdayEnd:e.workday.start.getTime()+n+(null!==(o=e.workday.workdayExtended)&&void 0!==o?o:0),workdayMaximum:n,splitLogs:e.workday.splitLogs,workdayConfig:a}},Nt=(e,t)=>{let i=e.workday.splitLogs||[],o=i.length>0?i[i.length-1].dateTime:void 0;e.logs=i.concat(e.logs.filter((e=>!o||e.dateTime>o))),e.i=0,e.allocatedCountIndex=i.length,e.next=e.logs[0],e.workday.completedSplitSB=!0,e.cycle.pauseCountingCycleOff=!0,gi(e,e.next.dateTime,!1,e.workday.isAdverseLogApplied,t),e.workday.earnedSplitExclusion=Bt(t)},Bt=e=>{if(void 0===e||!("periods"in e))return;const t=e.periods[e.periods.length-1];return void 0!==t?t.toDate.getTime()-t.fromDate.getTime():void 0},Ft=e=>{var t,i,n;const a="symmetric"===(null===(t=e.config.splitConfig)||void 0===t?void 0:t.type)?e.config.splitConfig:void 0,s=It(e,!!(null===(i=e.workday.splitSB)||void 0===i?void 0:i.periods.length),!!a);if(!s||!a)return;const{workdayMaximum:r,splitLogs:l}=s;let d=s.workdayEnd,c=e.config.bigDayBonus&&e.workday.workdayExtended?(r+e.workday.workdayExtended)/o.Al:0,u=0,m=0,h=e.intermediateSplitConfig.violationRecalculatesWorkday&&Ct(e);for(let t=0;t<l.length-1;t++){let i=l[t],o=l[t+1].dateTime;if(m="SB"===i.status?m+o.getTime()-i.dateTime.getTime():0,!h&&e.splitSBDuringReset&&m>u){let t=m>=a.splitMinimum,i=e.splitSBDuringReset+m>=a.splitTotal;t&&i&&(d+=m-u),u=m}if("D"===i.status&&o.getTime()>d){let t=new Date(Math.max(i.dateTime.getTime(),d));$i(e,i.id,"Workday",t,o,c),null===(n=e.workday.end)||void 0===n||n.setTime(d+c);break}}},Wt=(e,t,i)=>{for(i?t.periods[t.periods.length-1].toDate=e.nextDate:t.periods.push({fromDate:e.currentDate,toDate:e.nextDate});t.periods.length>2;)t.periods.shift()},Ht=(e,t)=>2===e.periods.length?e.periods.map((e=>(0,o.cl)(e))).reduce((function(e,i){return i>=t?e+i:e}),0):void 0,Ut=(e,t,i,o)=>
1{if(!(e<t))return Math.max(i,o-e)},zt=(e,t)=>{e.workday&&t.periods.length>0&&Lt(e)},$t=(e,t,i)=>e>=t&&(void 0===i||e<i),qt=(e,t)=>{let i="SB"===e.current.status;i&&(0!==t.sbPeriods.length&&t.inSleeper?t.sbPeriods[t.sbPeriods.length-1].toDate=new Date(e.nextDate.getTime()):t.sbPeriods.push({fromDate:new Date(e.currentDate.getTime()),toDate:new Date(e.nextDate.getTime())})),0!==t.offDutyPeriods.length&&t.inOffDuty?t.offDutyPeriods[t.offDutyPeriods.length-1].toDate=new Date(e.nextDate.getTime()):t.offDutyPeriods.push({fromDate:new Date(e.currentDate.getTime()),toDate:new Date(e.nextDate.getTime())}),t.inOffDuty=!0,t.inSleeper=i},Vt=(e,t)=>e.offDutyPeriods.filter((e=>((e,t)=>(0,o.cl)(e)>=t)(e,t))),Gt=(e,t)=>{var i;return-1!==(null!==(i=e.sleeperStartsPairedWithAnEarlierSmallSplit)&&void 0!==i?i:[]).indexOf(t.fromDate.getTime())},Kt=(e,t)=>{var i;const o=null!==(i=e.sleeperStartsPairedWithAnEarlierSmallSplit)&&void 0!==i?i:[];e.sleeperStartsPairedWithAnEarlierSmallSplit=o.concat(t.fromDate.getTime())},Yt=e=>!e.customCodes.disableUsaPropertySplitPairingReuseFix,jt=(e,t,i,n,a)=>{if(e.intermediateSplitConfig.violationPreventsSplitCompletion&&Ct(e))return{isSplitCompleted:!1};const s=Vt(t,i);for(let r of((e,t)=>{return Yt(e)?(i=t,[...i].sort(((e,t)=>t.toDate.getTime()-e.toDate.getTime()))):t;var i})(e,s))for(let s of t.sbPeriods.filter((e=>$t((0,o.cl)(e),n,a))))if((0,o.cl)(r)+(0,o.cl)(s)>=10*o.Al){if(r.toDate<s.fromDate){if(Yt(e)){if(Gt(e,s))continue;Kt(e,s)}e.workday.splitLogs=e.workday.splitLogs&&e.workday.splitLogs.filter((e=>e.dateTime>=r.toDate)),t.offDutyPeriods=[],t.sbPeriods=[s];const i=(0,o.cl)(r),a=new Date(s.fromDate.getTime()+n),l=new Date(s.fromDate.getTime()+(10*o.Al-i)),d=a>l?a:l;return{isSplitCompleted:!0,workdayResetInfo:{type:"asymmetricSplitSleeperBerth",periods:[{type:"offDuty",fromDate:r.fromDate,toDate:r.toDate},{type:"sleeperBerth",fromDate:s.fromDate,toDate:s.toDate}],eligibleForResetDate:d}}}if(r.fromDate>s.toDate){e.workday.splitLogs=e.workday.splitLogs&&e.workday.splitLogs.filter((e=>e.dateTime>=s.toDate)),t.sbPeriods=[],t.offDutyPeriods=[r];const n=(0,o.cl)(s),a=new Date(r.fromDate.getTime()+i),l=new Date(r.fromDate.getTime()+(10*o.Al-n)),d=a>l?a:l;return{isSplitCompleted:!0,workdayResetInfo:{type:"asymmetricSplitSleeperBerth",periods:[{type:"sleeperBerth",fromDate:s.fromDate,toDate:s.toDate},{type:"offDuty",fromDate:r.fromDate,toDate:r.toDate}],eligibleForResetDate:d}}}}return{isSplitCompleted:!1}},Zt=(e,t,i)=>{var n;if(!e.workday.start||!e.workday.end||e.workday.is16HourExemptionApplied||e.exemption16HLogs.filter((t=>Xe(e,t.dateTime)&&Oe(e))).length>0)return;let a=((e,t)=>{let i=t.onlyFreezeBigPeriods?t.bigSplitMin:t.smallSplitMin;const n=(t.onlyFreezeBigPeriods?e.sbPeriods:e.offDutyPeriods).map((e=>(0,o.cl)(e))).filter((e=>$t(e,i,t.bigSplitMax)));return n.length?Math.max.apply(Math,n):0})(t,i);const s=si(e);if(a&&s){let t=null!==(n=e.workday.workdayExtended)&&void 0!==n?n:0;e.workday.end.setTime(e.workday.start.getTime()+s+a+t)}},Qt=(e,t)=>{e.workday&&(t.offDutyPeriods.length>0||t.sbPeriods.length>0?Lt(e):e.workday.splitLogs=[])},Jt=e=>{if("DayOne"===e.day.deferralStatus||"DayTwo"===e.day.deferralStatus)return;const t=e.intermediateSplitConfig.geometry;"symmetric"===t?(e=>{let t=e.workday.splitSB;const i=e.config.splitConfig;if(!t||"symmetric"!==(null==i?void 0:i.type))return;let{splitMinimum:n,splitTotal:a}=i,s=t.inSleeper;if(t.inSleeper="SB"===e.current.status,t.inSleeper){Wt(e,t,s);const i=si(e);let a=t.periods[0]&&(0,o.cl)(t.periods[0]);!(i&&e.workday.start&&e.workday.end&&a&&a>=n)||e.intermediateSplitConfig.violationPreventsNewFreeze&&Ct(e)||e.workday.end.setTime(e.workday.start.getTime()+i+a)}else{t.periods=t.periods.filter((e=>(0,o.cl)(e)>=n));let i=Ht(t,n);i&&i<a&&(t.periods.splice((0,o.cl)(t.periods[0])<(0,o.cl)(t.periods[1])?0:1),e.workday.splitLogs=[])}if(zt(e,t),e.intermediateSplitConfig.violationPreventsSplitCompletion&&Ct(e))return;let r=Ht(t,n);if(r&&r>=a){let i;if(e.workday.lastSBPeriodMinimum=Ut((0,o.cl)(t.periods[0]),n,n,a),2===t.periods.length){const o=t.periods[1],a=e.workday.lastSBPeriodMinimum||n;i={type:"symmetricSplitSleeperBerth",periods:[{type:"sleeperBerth",fromDate:t.periods[0].fromDate,toDate:t.periods[0].toDate},{type:"sleeperBerth",fromDate:t.periods[1].fromDate,toDate:t.periods[1].toDate}],eligibleForResetDate:new Date(o.fromDate.getTime()+a)}}Nt(e,i)}})(e):"asymmetric"===t&&(e=>{var t;let i=e.workday.propertySplitSB,n=e.propertySplitSubConfig,a=null===(t=e.config.workday)||void 0===t?void 0:t.offDutyMinimum;if(!i||!n||void 0===a||0===e.duration)return;-1!==o.oP.indexOf(e.current.status)&&"WT"!==e.current.status?(qt(e,i),Zt(e,i,n)):(i.inOffDuty=!1,i.inSleeper=!1,i.offDutyPeriods=i.offDutyPeriods.filter((e=>n&&(0,o.cl)(e)>=n.smallSplitMin)),i.sbPeriods=i.sbPeriods.filter((t=>n&&e.workday.offDutyMinimum&&$t((0,o.cl)(t),n.bigSplitMin,n.bigSplitMax))));
1let{isSplitCompleted:s,workdayResetInfo:r}=jt(e,i,n.smallSplitMin,n.bigSplitMin,n.bigSplitMax);Qt(e,i),s&&Nt(e,r)})(e)},ei=e=>{var t,i,n;const a=e.intermediateSplitConfig.geometry;if("asymmetric"===a){if(!e.workday.completedSplitSB&&e.intermediateSplitConfig.failedSplitRecalculatesWorkday&&(e=>{var t,i;const n=e.propertySplitSubConfig,a=It(e,!!(null===(t=e.workday.propertySplitSB)||void 0===t?void 0:t.offDutyPeriods.length),!!n);if(!a||!n)return;const{workdayMaximum:s,splitLogs:r,workdayConfig:l}=a;let d=a.workdayEnd,c=e.config.bigDayBonus&&e.workday.workdayExtended?(s+e.workday.workdayExtended)/o.Al:void 0,u=0,m=0,h=e.intermediateSplitConfig.violationRecalculatesWorkday&&Ct(e);for(let t=0;t<r.length-1;t++){let a=r[t],s=r[t+1].dateTime;if(h||-1===o.oP.indexOf(a.status))if("D"===a.status){if(m=0,s.getTime()>d){let t=new Date(Math.max(a.dateTime.getTime(),d));$i(e,a.id,"Workday",t,s,c)}}else e.customCodes.disableUnfreezeSBSplitNotCompleteFix||-1===o.cm.indexOf(a.status)||(m=0);else e.customCodes.disableRemoveOrTrimViolationsAfter16hException&&"D"!==a.status&&(null===(i=e.currentViolations.Workday)||void 0===i||delete i.lastDriveToDate),m+=s.getTime()-a.dateTime.getTime(),m>=n.smallSplitMin&&e.splitSBDuringReset&&e.splitSBDuringReset+m>=l.offDutyMinimum&&u<m&&(d-=u,u=m,d+=u)}Ki(e,"Workday",e.currentDate)})(e),ri(e)){e.workday.completedSplitSB=!1,e.workday.hasStarted&&(e.splitSBDuringReset=0);let i=null===(t=e.workday.propertySplitSB)||void 0===t?void 0:t.sbPeriods;if(i&&i.length>0){let t=Math.max.apply(Math,i.map((e=>(0,o.cl)(e))));e.propertySplitSubConfig&&t>=e.propertySplitSubConfig.bigSplitMin&&(e.customCodes.enableUsaPreventWorkdayResetPairingForward||(e.splitSBDuringReset=t))}}}else if("symmetric"===a)if(e.intermediateSplitConfig.failedSplitRecalculatesWorkday){if(Ft(e),ri(e)){e.workday.completedSplitSB=!1,e.workday.hasStarted&&(e.splitSBDuringReset=0);let t=null===(i=e.workday.splitSB)||void 0===i?void 0:i.periods;if(t&&t.length>0){let i=new Date(e.nextDate.getTime()-e.workday.consecutiveOffCount),a=t.filter((e=>e.fromDate.getTime()>=i.getTime())),s=Math.max.apply(Math,a.map((e=>(0,o.cl)(e)))),r="symmetric"===(null===(n=e.config.splitConfig)||void 0===n?void 0:n.type)?e.config.splitConfig:void 0;s&&(null==r?void 0:r.splitMinimum)&&s>=r.splitMinimum&&(e.customCodes.enableUsaPreventWorkdayResetPairingForward&&!e.config.isCanada||(e.splitSBDuringReset=s))}}}else e.intermediateSplitConfig.canadaViolationRecalcOnViolation&&Ct(e)&&Ft(e)},ti=3*o.Al,ii=6*o.Al;let oi;const ni=e=>{var t,i;return("DayOne"===e.day.deferralStatus||"DayTwo"===e.day.deferralStatus)&&(!!(null===(t=e.config.workday)||void 0===t?void 0:t.offDutyMinimum)&&(null===(i=e.config.workday)||void 0===i?void 0:i.offDutyMinimum)!==e.workday.offDutyMinimum&&0!==e.workday.offDutyMinimum)},ai=e=>e.workday.offDutyMinimum?Math.max(0,e.workday.offDutyMinimum-e.workday.consecutiveOffCount):0,si=e=>{if(e.config.workday)return e.config.workday.workdayMaximumWhenSplitSB&&Pt(e)||e.config.workday.workdayMaximumWhenSplitSB&&!e.workday.completedSplitSB&&e.workday.splitSB&&e.workday.splitSB.periods.length>0?e.config.workday.workdayMaximumWhenSplitSB:e.config.workday.workdayMaximum},ri=e=>!!e.workday.offDutyMinimum&&e.workday.consecutiveOffCount>=e.workday.offDutyMinimum,li=(e,t)=>{let i;if(e.workdays.length>0)for(let o=e.workdays.length-1;o>=0;o--){let n=e.workdays[o];if(n.start&&n.start.getTime()<=t.getTime()){i=n;break}}return i};let di=(e,t,i,n=void 0)=>{let a,s,r=n||{},l=t.filter((e=>"ExemptionOffDutyDeferral"===e.status));for(a of l)s=(0,o.bh)(a.dateTime,e),i?r[s]?("None"===r[s].deferralStatus&&"DayOne"===a.deferralStatus||"DayOne"===r[s].deferralStatus&&"None"===a.deferralStatus)&&(r[s]={deferralStatus:"DayOne",requiredDeferralLog:"None",deferralMinutes:Math.max(a.deferralMinutes,r[s].deferralMinutes)}):r[s]={deferralStatus:a.deferralStatus,deferralMinutes:a.deferralMinutes}:r[s]||(r[s]=a);return r},ci=(e,t)=>{var i;e.cycle.fromDate.getTime()!==t.getTime()&&(e.cycle.hasStarted||e.cycles.pop(),e.cycle={fromDate:new Date(t.getTime()),toDate:new Date(t.getTime()+((null===(i=e.config.cycle)||void 0===i?void 0:i.cycleDays)||0)*o.qn),dutyCountSince24HourRestPeriod:0,cycleConsecutiveOffCount:0,driveCount:0,onDutyCount:0,days:1,bigDayCount:0,hasStarted:!1,pauseCountingCycleOff:!1,completedRestPeriodDates:[],cycleMaximum:0},e.config.cycle&&e.config.cycle.cycleRestMinimum&&e.cycle.completedRestPeriodDates.push(new Date(t.getTime())),e.cycles.length>0&&(e.cycles[e.cycles.length-1].toDate=e.cycle.fromDate),e.cycles.push(e.cycle),e.config.cycle&&e.config.cycle.cycleMaximum&&(e.cycle.cycleMaximum=e.config.cycle.cycleMaximum))},ui=(e,t,i,n=!1)=>
1{if(e.day.dateIndex===i)return;let a=n?t:(0,o.Zv)(t,e.toLocalTime,e.toUtcTime);if(e.day.date>=a)return;let s=e.day;e.day={dateIndex:i,date:a,driveCount:0,onDutyCount:0,offDutyCount:0,statusCounts:{},hoursInCycle:0},e.days.push(e.day),e.cycle.days+=1,(e=>{if(e.config.cycle&&e.config.cycle.cycleDays&&e.cycle.days>e.config.cycle.cycleDays&&!e.config.cycle.nonRolling){let t=e.days[e.days.length-e.config.cycle.cycleDays-1];t&&(e.cycle.driveCount-=t.driveCount,e.cycle.onDutyCount-=t.onDutyCount,t.bigDayExemptionUsed&&(e.cycle.bigDayCount-=1),t.isRailroadLogApplied&&(e.cycle.cycleMaximum-=ii)),e.cycle.days-=1}})(e),mi(e),hi(e,s),"DayTwo"===s.deferralStatus&&Si(e,void 0)},mi=e=>{e.config.daily&&(e.config.daily.offDutyMinimum&&(e.day.consecutiveOff=0,e.day.unCountedOff=0),e.config.rest&&e.config.rest.dailyRestMinimum&&(e.day.restCount=0,e.day.restInfo=[]))},hi=(e,t)=>{var i;if(!e.config.daily||"DayOne"!==t.deferralStatus||void 0===t.deferralTime)return;let o=t.deferralTime;if(t.offDutyCount>0){const n=Math.max(0,t.offDutyCount-(null!==(i=Ye(t,e.config))&&void 0!==i?i:0));o>n&&(o-=n)}e.customCodes.enableAutoCreateNoneDeferralLog?e.day.deferralLogRequired="DayTwo":e.day.deferralLogNeeded=!0,e.day.deferralStatus="DayTwo",e.day.deferralTime=o,e.day.yesterdayDriveCount=t.driveCount},yi=(e,t)=>{var i;if(!1===(null===(i=e.config.daily)||void 0===i?void 0:i.deferralAllowed))return;let n=e.deferralLogs[t],a=e.days[e.days.length-2];if(e.customCodes.enableAutoCreateNoneDeferralLog&&"None"!==e.day.deferralStatus){let i=(!n||n&&"None"!==n.requiredDeferralLog&&"None"!==n.deferralStatus)&&"DayTwo"===(null==a?void 0:a.deferralStatus)&&!!(null==a?void 0:a.deferralTime),o="None"===(null==n?void 0:n.deferralStatus)||i;i&&void 0===e.day.deferralStatus&&(e.day.deferralLogRequired="None");let s=n&&"DayOne"===(null==n?void 0:n.deferralStatus)||"DayOne"===e.day.deferralStatus;o&&!s&&(s||(e.day.deferralStatus="None",e.day.deferralTime=0),delete e.deferralLogs[t])}if(!n)return;let s=a&&"DayOne"===a.deferralStatus?a.deferralTime:void 0;if(void 0!==s)n?(void 0===e.day.deferralTime&&(e.day.deferralTime=n.deferralMinutes*o.eX),e.day.deferralStatus="DayTwo",e.customCodes.enableAutoCreateNoneDeferralLog?delete e.day.deferralLogRequired:e.day.deferralLogNeeded=!1):(e.day.deferralTime=s,e.day.deferralStatus="DayTwo",e.customCodes.enableAutoCreateNoneDeferralLog?e.day.deferralLogRequired="DayTwo":e.day.deferralLogNeeded=!0);else{let t=n.deferralMinutes*o.eX;"DayOne"===n.deferralStatus&&(e.day.deferralTime=t,e.customCodes.enableAutoCreateNoneDeferralLog?void 0!==e.day.deferralStatus&&delete e.day.deferralLogRequired:e.day.deferralLogNeeded=!1,e.day.deferralStatus="DayOne")}delete e.deferralLogs[t]},pi=e=>{var t,i,n;let a=null===(t=e.config.workday)||void 0===t?void 0:t.offDutyMinimum;if(!(null===(i=e.config.workday)||void 0===i?void 0:i.exemptionReducedRest)||!e.workday.hasStarted||0===e.reducedRestLogs.length||!a)return;let s=e.reducedRestLogs[0];if(s.dateTime>e.nextDate)return;if(e.reducedRestLogs.length>=2){let t=e.reducedRestLogs.findIndex((t=>t.dateTime>e.nextDate));t>=1&&e.reducedRestLogs.splice(0,t)}let r,{restAmountToBeDeferred:l,nextWorkdayStart:d}=Fe(e,s.dateTime);if(!(l<=0)){if(d&&e.workdays.length>0&&(null===(n=e.config.workday)||void 0===n?void 0:n.exemptionReducedRest)){const t=fi(e.workday,d);if(t&&"offDutyMinimum"===t.type){const i=e.config.workday.exemptionReducedRest.offDutyMinimum;r=Object.assign(Object.assign({},t),{eligibleForResetDate:new Date(t.fromDate.getTime()+i)})}else r=t}if(e.reducedRestLogs.shift(),e.workday.isExemptionReducedRestApplied=!0,e.workday.prevLastReducedRestApplyDate=e.lastReducedRestApplyDate,(e=>{var t;let i=si(e);if(!i||!e.workday.start)return;e.workday.splitSB={inSleeper:!1,periods:[]};let o=e.workday.workdayExtended||0;null===(t=e.workday.end)||void 0===t||t.setTime(e.workday.start.getTime()+i+o)})(e),e.lastReducedRestApplyDate=s.dateTime,e.workday.offDutyMinimum&&(e.work
1day.offDutyMinimum-=l),e.workday.reducedRestUsed=l/o.eX,d){let t=d;e.logs=e.logs.filter((e=>!t||e.dateTime>=t)),e.i=0,e.next=e.logs[0],gi(e,d,!1,e.workday.isAdverseLogApplied,r)}}},fi=(e,t)=>{const i=e.consecutiveOffCount||0,o=e.offDutyMinimum||0;if(i<=0||o<=0)return;const n=e.consecutiveOffStartTime||new Date(t.getTime()-i),a=new Date(n.getTime()+o);return{type:"offDutyMinimum",fromDate:n,eligibleForResetDate:a,toDate:t}},gi=(e,t,i,o,n)=>{var a,s;let r,l,d,c,u,m,h,y=0,p=0,f=e.workday.completedSplitSB;if(o&&e.workday.adverseLogStart&&t<e.workday.adverseLogStart&&(r=e.workday.drivingExtended,c=e.workday.workdayExtended),null===(a=e.config.workday)||void 0===a?void 0:a.exemptionReducedRest){m=e.workday.hasStarted&&e.workday.reducedRestUsed&&!e.workday.isExemptionReducedRestApplied?void 0:e.workday.reducedRestUsed}e.workday.hasStarted?f||(y=e.workday.consecutiveOffCount,p=e.workday.consecutiveWtCount):(e.workdays.pop(),void 0!==e.workday.drivingExtended&&(r=e.workday.drivingExtended,l=e.workday.drivingLimit,d=e.workday.dutyLimit),void 0!==e.workday.workdayExtended&&(c=e.workday.workdayExtended),h=e.workday.earnedSplitExclusion,e.config.railroadExempt&&(null===(s=e.config.cycle)||void 0===s?void 0:s.cycleMaximum)&&e.config.cycle.cycleMaximum!==e.cycle.cycleMaximum&&(c=(c||0)+ti),ni(e)&&(u=e.workday.offDutyMinimum),y=e.workday.consecutiveOffCount,p=e.workday.consecutiveWtCount),delete e.workday.splitLogs,Ki(e,"Workday",e.currentDate),Ki(e,"Driving",e.currentDate),Ki(e,"Duty",e.currentDate),Ki(e,"Rest",e.currentDate);const g=e.workdays.length>0?e.workdays[e.workdays.length-1]:void 0;g&&n&&!g.resetInfo&&(g.resetInfo=n);const v=e.config.splitConfig,D="asymmetric"===(null==v?void 0:v.type)&&!v.onlyFreezeBigPeriods;e.workday={hasStarted:i,consecutiveOffCount:y,consecutiveWtCount:p,drivingExtended:r,workdayExtended:c,endOfLastBreak:t,completedSplitSB:!!D&&f,earnedSplitExclusion:h,offDutyMinimum:u,reducedRestUsed:m},vi(e,t,l,d,u)},vi=(e,t,i,o,n)=>{var a;(null===(a=e.config.rest)||void 0===a?void 0:a.onDutyCountTowardRest)&&(e.workday.timeUntilMustRest=e.config.rest.betweenRestLimit,e.workday.consecutiveRestCount=0,e.workday.consecutiveRestStartTime=void 0),e.config.workday&&(e.workday.start=t,Di(e,t),wi(e,i),bi(e,o),Si(e,n),(e=>{var t;"symmetric"!==(null===(t=e.config.splitConfig)||void 0===t?void 0:t.type)?e.workday.propertySplitSB={inOffDuty:!1,inSleeper:!1,sbPeriods:[],offDutyPeriods:[]}:e.workday.splitSB={inSleeper:!1,periods:[]}})(e),e.workdays.push(e.workday))},Di=(e,t)=>{const i=si(e);if(i){let n=e.workday.workdayExtended||0,a=0;e.workday.reducedRestUsed&&(a=e.workday.isExemptionReducedRestApplied?-e.workday.reducedRestUsed*o.eX:e.workday.reducedRestUsed*o.eX),e.workday.end=new Date(t.getTime()+i+n+a)}},wi=(e,t)=>{var i,o;(null===(o=null===(i=null==e?void 0:e.config)||void 0===i?void 0:i.workday)||void 0===o?void 0:o.driveMaximum)&&(e.workday.drivingLimit=t||e.config.workday.driveMaximum+(e.workday.drivingExtended||0),e.workday.driveCount=0)},bi=(e,t)=>{var i,o;(null===(o=null===(i=null==e?void 0:e.config)||void 0===i?void 0:i.workday)||void 0===o?void 0:o.dutyMaximum)&&(e.workday.dutyLimit=t||e.config.workday.dutyMaximum),e.workday.onDutyCount=0},Si=(e,t)=>{var i,n,a,s;if(void 0!==t)e.workday.offDutyMinimum=t;else if("DayTwo"===e.day.deferralStatus&&(null===(i=e.config.workday)||void 0===i?void 0:i.offDutyMinimum)&&e.day.deferralTime)e.workday.offDutyMinimum=(null===(n=e.config.workday)||void 0===n?void 0:n.offDutyMinimum)+e.day.deferralTime;else if(null===(s=null===(a=null==e?void 0:e.config)||void 0===a?void 0:a.workday)||void 0===s?void 0:s.offDutyMinimum){let t=0;e.workday.reducedRestUsed&&(t=e.workday.isExemptionReducedRestApplied?-e.workday.reducedRestUsed*o.eX:e.workday.reducedRestUsed*o.eX),e.workday.offDutyMinimum=e.config.workday.offDutyMinimum+t}},Ci=e=>{let t=e.current.status,i=-1!==o.cm.indexOf(t);if(!i&&-1===o.oP.indexOf(t))return;let n=!!e.config.daily,a="D"===t;if(e.currentDateIndex===e.nextDateIndex){ui(e,e.currentDate,e.currentDateIndex),n&&yi(e,e.currentDateIndex);let o=e.duration;return void Ti(e,t,o,i,a)}let s=new Date(e.currentDate.getTime()),r=0,l=e.duration,d=!1;for(;s<=e.nextDate;){if(r++>=1e5)throw new Error(`Infinite loop detected: startDate: ${new Date(e.currentDate.getTime()).toISOString()}, loopDate: ${s.toISOString()}`);let c=(0,o.bh)(s,e.toLocalTime);ui(e,s,c,d),n&&yi(e,c);let u=s.getTime();s=new Date((0,o.W_)(s,e.toLocalTime,e.toUtcTime).getTime());let m=Math.min(s.getTime()-u,l);m>0&&(l-=m,Ti(e,t,m,i,a)),d=!0}},Ti=(e,t,i,n,a)=>{i>0&&(void 0===e.day.statusCounts[t]?e.day.statusCounts[t]=i:"PC_Exempted"===t?e.day.statusCounts.PC+=i:e.day.statusCounts[t]+=i,n?(e.day.onDutyCount+=i,e.cycle.onDutyCount+=i,e.cycle.dutyCountSince24HourRestPeriod+=i,a&&(e.day.driveCount+=i,e.cycle.driveCount+=i),void 0!==e.day.consecutiveOff&&void 0!==e.day.unCountedOff&&(e.day.consecutiveOff
1=0,e.day.unCountedOff=0)):(void 0!==e.day.consecutiveOff&&void 0!==e.day.unCountedOff&&(e.day.consecutiveOff+=i,e.day.unCountedOff+=i),e.config.rest&&e.day.unCountedOff&&e.day.consecutiveOff&&e.day.consecutiveOff>=e.config.rest.restBreakMinimum&&(no(e,e.day.unCountedOff),e.day.unCountedOff=0)),e.day.hoursInCycle=(0,o.l$)(e.cycle,e.config))},xi=e=>{if(e.config.rest&&e.config.rest.restBreakMinimum)if(void 0!==e.workday.consecutiveRestCount&&(!e.workday.hasStarted||e.workday.consecutiveRestCount>=e.config.rest.restBreakMinimum))e.workday.timeUntilMustRest=e.config.rest.betweenRestLimit,e.workday.endOfLastBreak=new Date(e.nextDate.getTime());else if(!e.workday.hasStarted||e.workday.consecutiveOffCount>=e.config.rest.restBreakMinimum)e.workday.endOfLastBreak=new Date(e.nextDate.getTime());else if(e.config.rest.earlyRestBreaks)for(let t=0;t<e.config.rest.earlyRestBreaks.length;t++){let i=e.config.rest.earlyRestBreaks[t],o=!!e.workday.endOfLastBreak&&e.current.dateTime.getTime()-e.workday.endOfLastBreak.getTime()>i.betweenRestLimit;if(void 0!==e.workday.consecutiveRestCount&&(!e.workday.hasStarted||!o&&e.workday.consecutiveRestCount>=i.restBreakMinimum)){e.workday.timeUntilMustRest=e.config.rest.betweenRestLimit,e.workday.endOfLastBreak=new Date(e.nextDate.getTime());break}}},ki=(e,t,i=!1)=>{var n;let a=e.config.rest&&e.config.rest.restBreakMinimum,s=e.workday.consecutiveWtCount,r=a&&(e.workday.consecutiveOffCount>=a||s>=a),l=!i&&"WT"===e.current.status&&"WT"===e.next.status,d=e=>-1===o.cm.indexOf(e)&&"WT"!==e,c=!i&&d(e.current.status)&&d(e.next.status);if(!a||!e.day.restInfo||!r||l||c)return;let u=e.nextDate.getTime(),m=u-e.workday.consecutiveOffCount-s,h=(0,o.qi)(new Date(m),e.nextDate,e.toLocalTime),y=s>0?s:t;for(;h>=0&&y>0;){let t=0===h,a=e.days[e.days.length-1-h],r=Je(a,e.config);if(void 0!==a&&a.restInfo&&void 0!==a.restCount&&void 0!==r&&(t||r>0)){let l=a.date.getTime(),d=(0,o.W_)(a.date,e.toLocalTime,e.toUtcTime).getTime(),c=Math.max(l,m),h=Math.min(d,u);r=Math.max(0,r+(null!==(n=a.deferralTime)&&void 0!==n?n:0));let p=Math.min(y,h-c,r);if(p>0){let n=t&&(0,o.Zv)(a.date,e.toLocalTime,e.toUtcTime).getTime()!==(0,o.Zv)(new Date(m),e.toLocalTime,e.toUtcTime).getTime()&&void 0!==e.config.workday&&h-c>=e.config.workday.offDutyMinimum&&h-c-p<e.config.workday.offDutyMinimum,[r,l]=n?[new Date(u-p),new Date(u)]:[new Date(c),new Date(c+p)],d=i&&t,f=s>0;a.restInfo.push({fromDate:r,toDate:l,isTemp:d,isWt:f}),a.restCount+=p,y-=p,d&&(f?e.workday.consecutiveWtCount-=p:e.workday.consecutiveOffCount-=p)}}h-=1}},Mi=e=>{if(!e.config.workday||void 0===e.config.workday.workdayMaximum||void 0===e.config.workday.driveMaximum||void 0===e.config.workday.dutyMaximum||!e.config.rest||void 0===e.config.rest.dailyRestMinimum)return;let t=(t,i)=>{let o=t.onDutyCount&&i.onDutyCount&&t.onDutyCount+i.onDutyCount;if(!e.config.workday||!e.config.workday.dutyMaximum||void 0===o||o>e.config.workday.dutyMaximum)return!0;let n=t.driveCount&&i.driveCount&&t.driveCount+i.driveCount;if(!e.config.workday||!e.config.workday.driveMaximum||void 0===n||n>e.config.workday.driveMaximum)return!0;let a=t.start&&e.config.workday.workdayMaximum&&t.start.getTime()+e.config.workday.workdayMaximum,s=a&&i.endOfLastDLog&&i.endOfLastDLog.getTime()>a;return!(a&&!s)},i=(t,i,n)=>{let a=Qe(t,e.config),s=Je(t,e.config);if(void 0===t.restCount||void 0===a||void 0===s||!t.restInfo)return[];let r=t.date.getTime(),l=(0,o.W_)(t.date,e.toLocalTime,e.toUtcTime).getTime(),d=[];for(let e=0;e<t.restInfo.length;e++){let a=t.restInfo[e];(0,o.ZY)(i,n,a.fromDate,a.toDate)?s+=a.toDate.getTime()-a.fromDate.getTime():d.push(a)}let c=Math.max(r,i.getTime()),u=Math.min(l,c+s);return u-c<s?[]:[...d,{fromDate:new Date(c),toDate:new Date(u)}]},n=[],a={};e.pastViolations.forEach(((t,i)=>{let s=(0,o.bh)(t.fromDate,e.toLocalTime);"DailyRest"===t.type?n.push({violationIndex:i,dateIndex:s}):["DailyDriving","DailyDuty","DailyOff"].some((e=>e===t.type))&&(a[s]=1)})),n=n.filter((e=>!a[e.dateIndex])),n.sort(((e,t)=>t.violationIndex-e.violationIndex)),n.forEach((n=>((n,a)=>{let s;if(!(s=e.days.find((e=>e.dateIndex===a))))return;let r=[];
1r=e.workdays.filter((t=>t.start&&t.end&&(0,o.ZY)(t.start,t.end,s.date,new Date((0,o.W_)(s.date,e.toLocalTime,e.toUtcTime).getTime()-1e3))));let l=r.length+(e.workdays[0].start&&e.workdays[0].start.getTime()>s.date.getTime()?1:0);if(2===l||3===l){let t=r[r.length-1];if(!t)return;let i=e.workdays.indexOf(t,r.length-1),o=e.workdays[i+1];if(!o)return;r.push(o)}for(let o=0;o<r.length-1;o++){let a=r[o],l=r[o+1];if(!a||!l||!a.endOfLastBreak||t(a,l))continue;let d=new Date(a.endOfLastBreak.getTime()-a.consecutiveOffCount),c=i(s,d,a.endOfLastBreak),u=Qe(s,e.config);if(c.length&&u&&void 0!==s.restCount){e.pastViolations.splice(n,1),s.restInfo=[...c],s.restCount=u;break}}})(n.violationIndex,n.dateIndex)))},Ri=e=>{if(e.workday.offDutyMinimum){let t=e.config.rest&&e.config.rest.restBreakMinimum;if(!e.workday.hasStarted||ri(e)){ei(e),e.customCodes.disableMergeOverlappingRestInfoFix?(e=>{let t=Je(e.day,e.config);if(!e.day.restInfo||!t||void 0===e.day.restCount||0===e.workday.consecutiveOffCount)return;if(e.workdays.length&&e.workday.start&&e.workday.start.getTime()<=e.day.date.getTime())return;let i=new Date(e.nextDate.getTime()-e.workday.consecutiveOffCount);if((0,o.bh)(e.nextDate,e.toLocalTime)!==(0,o.bh)(i,e.toLocalTime))return;const n=(0,o.nL)(e.day.date,new Date((0,o.W_)(e.day.date,e.toLocalTime,e.toUtcTime).getTime()-1e3),i,new Date(i.getTime()+t));n&&(e.day.restCount+=t,e.day.restInfo.push(n))})(e):(e=>{let t=Je(e.day,e.config);if(!e.day.restInfo||!t||void 0===e.day.restCount||0===e.workday.consecutiveOffCount)return;if(!e.workdays.length||!e.workday.start)return;if(e.workday.start.getTime()<=e.day.date.getTime())return;if(!(e.workdays.length>=2))return;let i=-1!==o.oP.indexOf(e.current.status),n=e.workdays[e.workdays.length-2],a=n.start&&n.start.getTime()<=e.day.date.getTime(),s=e.nextDate.getTime()-e.workday.consecutiveOffCount,r=n.endOfLastBreak&&n.endOfLastBreak.getTime()>=s;if(i&&a&&r)return;let l=new Date(e.nextDate.getTime()-e.workday.consecutiveOffCount);if((0,o.bh)(e.nextDate,e.toLocalTime)!==(0,o.bh)(l,e.toLocalTime))return;let d=(0,o.nL)(e.day.date,new Date((0,o.W_)(e.day.date,e.toLocalTime,e.toUtcTime).getTime()-1e3),l,new Date(l.getTime()+t));if(d){for(let t=0;t<e.day.restInfo.length;t++){const i=e.day.restInfo[t];if(d.fromDate.getTime()===i.fromDate.getTime()){e.day.restCount-=i.toDate.getTime()-i.fromDate.getTime(),e.day.restInfo.splice(t,1);break}}t=Je(e.day,e.config),t&&(d=(0,o.nL)(e.day.date,new Date((0,o.W_)(e.day.date,e.toLocalTime,e.toUtcTime).getTime()-1e3),l,new Date(l.getTime()+t)),d&&(e.day.restCount+=t,e.day.restInfo.push(d)))}})(e);const t=e.workdays.length>0?fi(e.workday,e.nextDate):void 0;gi(e,e.nextDate,!1,void 0,t)}else if(t&&e.workday.consecutiveOffCount>=t){let t=Ei(e);ki(e,t)}}},Ei=e=>{var t;if(-1===o.oP.indexOf(e.current.status))return 0;let i=e.workday.consecutiveOffCount,n=e.workdays[e.workdays.length-2];if(n)if(n.completedSplitSB&&n.endOfLastBreak&&void 0!==n.lastSBPeriodMinimum){if(n.splitSB&&(null===(t=n.splitSB.periods)||void 0===t?void 0:t.length)>=2){let t=n.splitSB.periods[1],a=new Date(e.nextDate.getTime()-e.workday.consecutiveOffCount);(0,o.ZY)(new Date(a),e.nextDate,t.fromDate,t.toDate)&&(i-=n.lastSBPeriodMinimum)}}else e.workday.hasStarted||void 0===n.offDutyMinimum||(i-=n.offDutyMinimum);return Math.max(0,i)},Ai=(e,t)=>{const i=e.workdays.length>1?e.workdays[e.workdays.length-2]:void 0;if(!(null==i?void 0:i.resetInfo))return;if(i.isExemptionReducedRestApplied)return void _i(e,t);const n=(e=>{if("offDutyMinimum"===e.type)return e;if("asymmetricSplitSleeperBerth"===e.type||"symmetricSplitSleeperBerth"===e.type){const t=e.periods;return t.length>1?t[1]:t[0]}})(i.resetInfo);if(!n)return;if(n.toDate.getTime()!==e.current.dateTime.getTime())return;const a="offDutyMinimum"===i.resetInfo.type?"offDuty":n.type;((e,t)=>{const i=-1!==o.oP.indexOf(e),n="SB"===e;return"offDuty"===t&&i||n})(e.current.status,a)&&(n.toDate=new Date(t))},_i=(e,t)=>{var i,n,a;if(e.customCodes.disableErrRestReconciliationFix||e.workday.hasStarted||void 0===e.workday.reducedRestUsed||e.workday.isExemptionReducedRestApplied||!(null===(i=e.config.workday)||void 0===i?void 0:i.offDutyMinimum)||!(null===(n=e.config.workday.exemptionReducedRest)||void 0===n?void 0:n.offDutyMinimum))return;const s=e.workday.consecutiveOffCount,r=e.config.workday.offDutyMinimum,l=e.config.workday.exemptionReducedRest.offDutyMinimum,d=e.workdays[e.workdays.length-2];if(s>=r)e.workday.reducedRestUsed=void 0,(null==d?void 0:d.isExemptionReducedRestApplied)&&(d.isExemptionReducedRestApplied=!1,d.reducedRestUsed=void 0,e.lastReducedRestApplyDate=d.prevLastReducedRestApplyDate);else if(s>=l){const t=(r-s)/o.eX;e.workday.reducedRestUsed=t,(null==d?void 0:d.isExemptionReducedRestApplied)&&(d.reducedRestUsed=t)}"offDutyMinimum"===(null===(a=null==d?void 0:d.resetInfo)||void 0===a?void 0:a.type)&&(d.resetInfo.toDate=new Date(t.getTime()))},Xi=e=>{var t,i,o,n;if(e.cycle.pauseCountingCycleOff||(e.cycle.cycleConsecutiveOffCount+=e.duration),e.customCodes.disableErrRestReconciliationFix&&Ii(e,!0),e.workday.consecutiveOffCount="WT"!==e.current.status||!1!==(null===(t=e.config.workday)||void 0===t?void 0:t.consecutiveOffCountIncludesWt)?e.duration+e.workday.consecutiveOffCount:0,e.workday.consecutiveWtCount="WT"===e.current.status?e.workday.consecutiveWtCount+e.duration:0,e.workday.consecutiveOffCount!==e.duration||"WT"===e.current.status&&!1===(null===(i=e.config.workday)||void 0===i?void 0:i.consecutiveOffCountIncludesWt)||(e.work
1day.consecutiveOffStartTime=e.current.dateTime),e.customCodes.disableErrRestReconciliationFix||Li(e,!0),void 0!==e.workday.consecutiveRestCount&&(e.workday.consecutiveRestCount+=e.duration,(null===(o=e.config.rest)||void 0===o?void 0:o.onDutyCountTowardRest)&&e.workday.consecutiveRestCount===e.duration&&(e.workday.consecutiveRestStartTime=e.current.dateTime)),xi(e),Ai(e,e.nextDate),void 0!==e.workday.offDutyMinimum){let t=e.i>=e.logs.length,i=e.workday.hasStarted&&!t?Ei(e)-e.workday.offDutyMinimum:Ei(e);ki(e,i,t)}let a=e.config.cycle;if(a){if(a.cycleRestartMinimum)if(e.cycle.cycleConsecutiveOffCount>=a.cycleRestartMinimum){if(e.config.resetPreviousCycle&&e.cycle.hasStarted){let t=e.cycle.cycleConsecutiveOffCount-a.cycleRestartMinimum,i=new Date(e.nextDate.getTime()-t);e.rulesetDateRanges.some((e=>null!==e.start&&null!==e.end&&e.start<=i&&e.end>=i))&&(e.cycle.completedRestartDate=i)}de(e,((e,t)=>new Date(ce(e).getTime()+t))(e,a.cycleRestartMinimum)),ci(e,e.nextDate)}else if(null===(n=e.cycleRestartDatesFromOtherRulesets)||void 0===n?void 0:n.length){let t=e.cycleRestartDatesFromOtherRulesets[e.cycleRestartDatesFromOtherRulesets.length-1];t.getTime()<=e.nextDate.getTime()&&(de(e,t),ci(e,e.nextDate))}a.cycleRestMinimum&&e.cycle.cycleConsecutiveOffCount>=a.cycleRestMinimum&&(Oi(e),e.cycle.dutyCountSince24HourRestPeriod=0)}},Oi=e=>{var t;const i=e.config.cycle;if(!i)return;const o=null!==(t=i.cycleRestPeriods)&&void 0!==t?t:1;if(1===o)e.cycle.completedRestPeriodDates[0]=new Date(e.nextDate.getTime());else if(i.cycleRestMinimum){const t=Math.floor(e.cycle.cycleConsecutiveOffCount/i.cycleRestMinimum);let n=e.cycle.completedRestPeriodDates.length>0?e.cycle.completedRestPeriodDates[e.cycle.completedRestPeriodDates.length-1].getTime():0,a=e.nextDate.getTime()-n>=i.cycleRestMinimum||t>=o;for(let n=t-1;n>=0;n--){let s=new Date(e.nextDate.getTime()-n*i.cycleRestMinimum);if(a)e.cycle.completedRestPeriodDates.length===o&&e.cycle.completedRestPeriodDates.shift(),e.cycle.completedRestPeriodDates.push(s);else{let o=t>1&&e.cycle.cycleConsecutiveOffCount%i.cycleRestMinimum==0?0:1;e.cycle.completedRestPeriodDates[e.cycle.completedRestPeriodDates.length-o-n]=s}}}},Pi=e=>{var t;!1!==(null===(t=e.config.workday)||void 0===t?void 0:t.wtExtendsWorkday)&&e.workday.hasStarted&&e.workday.end&&"WT"===e.current.status&&e.workday.end.setTime(e.workday.end.getTime()+e.duration)},Li=(e,t=!1)=>{var i;if(e.config.workday&&e.config.workday.exemptionReducedRest)if(t){if(e.workday.consecutiveOffCount!==e.duration||"WT"===e.current.status&&!(null===(i=e.config.workday)||void 0===i?void 0:i.consecutiveOffCountIncludesWt)||(e.workday.eligibleReducedRestPeriods||(e.workday.eligibleReducedRestPeriods=[]),e.workday.eligibleReducedRestPeriods.push({start:e.current.dateTime})),e.workday.eligibleReducedRestPeriods&&e.workday.eligibleReducedRestPeriods.length>0){let t=e.workday.eligibleReducedRestPeriods[e.workday.eligibleReducedRestPeriods.length-1];const i=e.config.workday.exemptionReducedRest.offDutyMinimum,o=e.config.workday.offDutyMinimum;t.start&&!t.end&&e.workday.consecutiveOffCount>=i&&e.workday.consecutiveOffCount<o&&(t.end=new Date(t.start.getTime()+e.workday.consecutiveOffCount))}}else{if(!e.workday.eligibleReducedRestPeriods||0===e.workday.eligibleReducedRestPeriods.length)return;let t=e.workday.eligibleReducedRestPeriods[e.workday.eligibleReducedRestPeriods.length-1];t.start&&!t.end&&e.workday.eligibleReducedRestPeriods.pop()}},Ii=(e,t=!1)=>{var i,n;if(!e.config.workday||!e.config.workday.exemptionReducedRest)return;if(t)0!==e.workday.consecutiveOffCount||"WT"===e.current.status&&!(null===(i=e.config.workday)||void 0===i?void 0:i.consecutiveOffCountIncludesWt)||(e.workday.eligibleReducedRestPeriods||(e.workday.eligibleReducedRestPeriods=[]),e.workday.eligibleReducedRestPeriods.push({start:e.current.dateTime}));else{if(!e.workday.eligibleReducedRestPeriods||0===e.workday.eligibleReducedRestPeriods.length)return;let t=e.workday.eligibleReducedRestPeriods[e.workday.eligibleReducedRestPeriods.length-1];const i=e.config.workday.exemptionReducedRest.offDutyMinimum,o=e.config.workday.offDutyMinimum;
1t.start&&!t.end&&(e.workday.consecutiveOffCount>=i&&e.workday.consecutiveOffCount<o?t.end=e.current.dateTime:e.workday.eligibleReducedRestPeriods.pop())}if(-1!==o.oP.indexOf(e.current.status)&&e.workday.eligibleReducedRestPeriods&&e.workday.eligibleReducedRestPeriods.length>0){let t=e.workday.eligibleReducedRestPeriods[e.workday.eligibleReducedRestPeriods.length-1];const i=e.config.workday.exemptionReducedRest.offDutyMinimum;if(t.start&&!t.end){("WT"!==e.current.status||!1!==(null===(n=e.config.workday)||void 0===n?void 0:n.consecutiveOffCountIncludesWt)?e.duration+e.workday.consecutiveOffCount:0)>=i&&(t.end=e.nextDate)}}},Ni=e=>{var t,i,n;if(e.customCodes.disableErrRestReconciliationFix?Ii(e):Li(e),Ai(e,e.currentDate),(e=>{const t=ue(e);t&&(t.toDate=new Date(e.currentDate.getTime()))})(e),e.cycle.cycleConsecutiveOffCount=0,e.workday.consecutiveOffCount=0,e.workday.consecutiveWtCount=0,e.workday.consecutiveOffStartTime=void 0,null===(t=e.cycleRestartDatesFromOtherRulesets)||void 0===t?void 0:t.length)for(let t=(null===(i=e.cycleRestartDatesFromOtherRulesets)||void 0===i?void 0:i.length)-1;t>=0;t--){e.cycleRestartDatesFromOtherRulesets[t].getTime()<=e.currentDate.getTime()&&e.cycleRestartDatesFromOtherRulesets.splice(t,1)}e.cycle.hasStarted||(e.cycle.fromDate=new Date(e.currentDate.getTime()),e.cycle.toDate=new Date(e.currentDate.getTime()+((null===(n=e.config.cycle)||void 0===n?void 0:n.cycleDays)||0)*o.qn),e.config.cycle&&e.config.cycle.cycleRestMinimum&&(e.cycle.completedRestPeriodDates=[new Date(e.currentDate.getTime())]),e.cycle.hasStarted=!0),e.workday.hasStarted?(e.workday.hasStarted=!0,e.workday.consecutiveOffCount=0,e.workday.consecutiveOffStartTime=void 0):gi(e,e.currentDate,!0,void 0),void 0!==e.workday.consecutiveRestCount&&("D"!==e.current.status?(e.workday.consecutiveRestCount+=e.duration,e.workday.consecutiveRestCount===e.duration&&(e.workday.consecutiveRestStartTime=e.current.dateTime)):(e.workday.consecutiveRestCount=0,e.workday.consecutiveRestStartTime=void 0,void 0!==e.workday.timeUntilMustRest&&(e.workday.timeUntilMustRest-=e.duration)),xi(e)),void 0!==e.workday.onDutyCount&&(e.workday.onDutyCount+=e.duration),"D"===e.current.status&&(void 0!==e.workday.driveCount&&(e.workday.driveCount+=e.duration),e.workday.endOfLastDLog=e.nextDate)},Bi=(e,t,i)=>{let o=e.currentViolations[i];if(!t||!o)return;if(!o.drivingPeriods)return void delete e.currentViolations[i];let n=[];for(const e of o.drivingPeriods){if(e.toDate&&e.toDate.getTime()<=t.getTime())continue;let i=new Date(Math.max(e.fromDate.getTime(),t.getTime()));n.push({fromDate:i,toDate:e.toDate})}o.drivingPeriods=n,0!==n.length?e.customCodes.disableRemoveOrTrimViolationsAfter16hException?Gi(o,n[0].fromDate,e.next.Date):Vi(o):delete e.currentViolations[i]},Fi=e=>{if(e.customCodes.disableExemptionLogsInteractionRefactor)(e=>{if(e.workday.end&&e.workday.hasStarted&&!e.workday.workdayExtended&&e.config.bigDayBonus&&!(e.exemption16HLogs.length>0&&e.exemption16HLogs[0].dateTime.getTime()>e.nextDate))for(;e.exemption16HLogs.length>0&&e.exemption16HLogs[0].dateTime.getTime()<=e.workday.end.getTime()+e.config.bigDayBonus;){let t=e.exemption16HLogs.shift().dateTime;if(Xe(e,t)&&Oe(e)){let t=e.workday.end.getTime()+e.config.bigDayBonus;return e.workday.end.setTime(t),void 0!==e.workday.workdayExtended?e.workday.workdayExtended+=e.config.bigDayBonus:e.workday.workdayExtended=e.config.bigDayBonus,e.cycle.bigDayCount+=1,e.day.bigDayExemptionUsed=!0,e.workday.is16HourExemptionApplied=!0,void(e.customCodes.disableRemoveOrTrimViolationsAfter16hException||Bi(e,e.workday.end,"Workday"))}}})(e);else if(e.workday.end&&e.workday.hasStarted&&e.config.bigDayBonus&&!(e.exemption16HLogs.length>0&&e.exemption16HLogs[0].dateTime.getTime()>e.nextDate))for(;e.exemption16HLogs.length>0&&e.exemption16HLogs[0].dateTime.getTime()<=e.workday.end.getTime()+e.config.bigDayBonus;){let t=e.exemption16HLogs.shift().dateTime;if(Xe(e,t)&&Oe(e)){if(e.workday.is16HourExemptionApplied)continue;const t={hasAdverse:e.workday.isAdverseLogApplied,hasBigDay:!0,adverseDoesNotExtendWorkday:e.config.adverseDoesNotExtendWorkday,bigDayExtensionAmount:e.config.bigDayBonus},i=ze(t);return We(e,i.workday),e.cycle.bigDayCount+=1,e.day.bigDayExemptionUsed=!0,e.workday.is16HourExemptionApplied=!0,void(e.customCodes.disableRemoveOrTrimViolationsAfter16hException||Bi(e,e.workday.end,"Workday"))}}},Wi=(e,t)=>Hi(e,t),Hi=(e,t)=>{let i=!!e.workday.start&&e.workday.start.getTime()<=t.getTime(),o=t.getTime()<e.currentDate.getTime();return(e.current===e.next?t.getTime()<=e.next.dateTime.getTime():t.getTime()<e.next.dateTime.getTime())&&(i||o)},Ui=e=>{if(e.customCodes.disableExemptionLogsInteractionRefactor)(e=>{var t,i;if(0!==e.adverseLogs.length&&e.config.workday&&void 0!==e.workday.drivingLimit)for(;0!==e.adverseLogs.length&&Wi(e,e.adverseLogs[0].dateTime);){let o=e.adverseLogs.shift();e.workday.adverseLogStart=o.dateTime,e.workday.isAdverseLogApplied=!0,void 0===e.workday.drivingExtended&&(e.work
1day.drivingLimit+=_e,e.workday.drivingExtended=_e,!0!==e.config.adverseDoesNotExtendWorkday&&(e.config.bigDayBonus&&e.workday.is16HourExemptionApplied&&(null===(t=e.workday.end)||void 0===t||t.setTime(e.workday.end.getTime()-e.config.bigDayBonus),e.workday.is16HourExemptionApplied=!1,e.day.bigDayExemptionUsed=!1),e.workday.workdayExtended=(e.workday.workdayExtended||0)+_e,null===(i=e.workday.end)||void 0===i||i.setTime(e.workday.end.getTime()+_e)),void 0!==e.workday.dutyLimit&&(e.workday.dutyLimit+=_e),e.day.isAdverseLogApplied=!0,Qi(e))}})(e);else if(0!==e.adverseLogs.length&&e.config.workday&&!e.workday.isAdverseLogApplied)for(;0!==e.adverseLogs.length&&Wi(e,e.adverseLogs[0].dateTime);){let t=e.adverseLogs.shift();if(e.workday.adverseLogStart=t.dateTime,e.workday.isAdverseLogApplied)continue;const i={hasAdverse:!0,hasBigDay:e.workday.is16HourExemptionApplied,adverseDoesNotExtendWorkday:e.config.adverseDoesNotExtendWorkday,bigDayExtensionAmount:e.config.bigDayBonus},o=ze(i);He(e,o.driving),Ue(e,o.duty),We(e,o.workday),e.workday.isAdverseLogApplied=!0,e.day.isAdverseLogApplied=!0,Qi(e)}},zi=e=>{var t,i;if(0!==e.railroadLogs.length&&e.config.workday)for(;0!==e.railroadLogs.length&&Wi(e,e.railroadLogs[0].dateTime);)e.railroadLogs.shift(),e.day.isRailroadLogApplied=!0,e.cycle.cycleMaximum+=ii,null===(t=e.cycle.toDate)||void 0===t||t.setTime(e.cycle.toDate.getTime()+ii),void 0!==e.workday&&(e.workday.workdayExtended=(e.workday.workdayExtended||0)+ti,null===(i=e.workday.end)||void 0===i||i.setTime(e.workday.end.getTime()+ti),Qi(e))},$i=(e,t,i,o,n,a)=>{xe(e,i,o,n,((o,n)=>qi(e,t,i,o,n,a)))||qi(e,t,i,o,n,a)},qi=(e,t,i,n,a,s)=>{0===e.logs.length||e.pastViolations.some((e=>e.type===i&&e.fromDate.getTime()===n.getTime()))||e.rulesetDateRanges.forEac
1h((r=>{if((!r.end||n<r.end)&&(!a||!r.start||a>r.start)){let l=e.currentViolations[i]||{drivingDuration:(0,o.Pv)(0),logId:t,reason:"",fromDate:n,type:i};e.currentViolations[i]=l,e.config.workday&&Pt(e)&&e.config.workday.workdayMaximum&&e.config.workday.workdayMaximumWhenSplitSB&&(l.hoursLimit=(e.config.workday.workdayMaximumWhenSplitSB-e.config.workday.workdayMaximum)/o.Al),s&&!l.hoursLimit&&(l.fromDate<n&&(l.fromDate=n),l.hoursLimit=s);let d=n;r.start&&n<r.start&&(d=r.start,l.fromDate=d);let c=a;r.end&&(!a||a>r.end)&&(c=r.end,l.toDate=r.end,delete e.currentViolations[i],e.pastViolations.push(l)),e.customCodes.disableRemoveOrTrimViolationsAfter16hException?Gi(l,d,c):(l.drivingPeriods||(l.drivingPeriods=[]),((e,t)=>{for(const i of t)if(i.fromDate.getTime()===e.fromDate.getTime())return void(i.toDate=new Date(Math.max(e.toDate.getTime(),i.toDate.getTime())));t.push(e)})({fromDate:new Date(d),toDate:new Date(c)},l.drivingPeriods),Vi(l))}}))},Vi=e=>{if(!e.drivingPeriods||0===e.drivingPeriods.length)return;e.fromDate=new Date(Math.min(...e.drivingPeriods.map((e=>e.fromDate.getTime()))));const t=e.drivingPeriods.map((e=>e.toDate.getTime()-e.fromDate.getTime())).reduce(((e,t)=>e+t),0);e.drivingDuration=(0,o.Pv)(t)},Gi=(e,t,i)=>{let n=void 0===e.lastDriveToDate?t:new Date(Math.max(t.getTime(),e.lastDriveToDate.getTime()));e.drivingDuration=(0,o.Pv)((0,o.PN)(e.drivingDuration)+(i.getTime()-n.getTime())),e.lastDriveToDate=new Date(i)},Ki=(e,t,i)=>{if(Ce(e,t),e.currentViolations[t]){let o=e.currentViolations[t];delete e.currentViolations[t];let n=null;for(let t=e.rulesetDateRanges.length-1;t>=0;t--){let i=e.rulesetDateRanges[t];if(e.customCodes.disableOngoingViolationRulesetFix){if(i.start&&i.end&&i.end>=o.fromDate&&i.start<=o.fromDate){n=i.end;break}}else if(i.start&&i.start<=o.fromDate&&(!i.end||i.end>=o.fromDate)){n=i.end;break}}o.toDate=n?new Date(Math.min(i.getTime(),n.getTime())):i,e.pastViolations.push(o)}},Yi=(e,t,i)=>{let n=(0,o.Zv)(i.date,e.toLocalTime,e.toUtcTime),a=(0,o.W_)(i.date,e.toLocalTime,e.toUtcTime),s=new Date(a.getTime()-(()=>{var o;let n=0,a=Je(i,e.config);return n="DailyRest"===t&&a&&i.restCount?a:null!==(o=je(i,e.config))&&void 0!==o?o:0,n})());((e,t)=>fe(e.emergencyResponsePeriods,t))(e,s)||e.rulesetDateRanges.forEac
1h((i=>{var r,l,d,c,u;let m=null!==(r=i.end)&&void 0!==r?r:new Date(1e3+Math.max(a.getTime(),null!==(u=null===(c=null===(d=null===(l=e.logs)||void 0===l?void 0:l[e.logs.length-1])||void 0===d?void 0:d.dateTime)||void 0===c?void 0:c.getTime())&&void 0!==u?u:0,(new Date).getTime()));i.start&&!(0,o.ZY)(i.start,m,s,a)||e.pastViolations.push({type:t,fromDate:n,toDate:new Date(a.getTime()-1e3),reason:"",drivingDuration:(0,o.Pv)(0)})}))},ji=(e,t,i)=>{let n=i(e.day,e.config);if(void 0!==n&&n<0){let i=new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+n)),a=(0,o.W_)(i,e.toLocalTime,e.toUtcTime);$i(e,e.current.id,t,i,a),Ki(e,t,a)}},Zi=(e,t,i,n)=>{let a;ji(e,t,n);for(let n=e.days.length-2;n>=0;n--){if(a=e.days[n],a.dateIndex===e.currentDateIndex)break;var s=i(a);if(void 0===s)return;let r=new Date(a.date.getTime()+s),l=(0,o.W_)(a.date,e.toLocalTime,e.toUtcTime);$i(e,e.current.id,t,r,l),Ki(e,t,l)}if(void 0===a)return;let r=n(a,e.config);if(void 0!==r&&r<0){let i=(0,o.W_)(a.date,e.toLocalTime,e.toUtcTime),n=new Date(Math.max(e.currentDate.getTime(),i.getTime()+r));$i(e,e.current.id,t,n,i),Ki(e,t,i)}},Qi=e=>{if(e.config.workday&&void 0!==e.workday.drivingLimit&&void 0!==e.workday.driveCount){let t=it.Driving(e);if(void 0===t)return;t<0?"D"===e.current.status&&$i(e,e.current.id,"Driving",new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+t)),e.nextDate):(e.workday.hasStarted&&delete e.currentViolations.Driving,Ki(e,"Driving",e.currentDate))}},Ji=e=>{var t;if(!e.current)return;(null===(t=e.workday)||void 0===t?void 0:t.completedSplitSB)&&e.allocatedCountIndex>e.i||((e=>{let t=it.Cycle(e);void 0!==t&&(t<0?"D"===e.current.status&&$i(e,e.current.id,"Cycle",new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+t)),e.nextDate):Ki(e,"Cycle",e.currentDate))})(e),(e=>{let t=it.CycleDriving(e);void 0!==t&&(t<0?"D"===e.current.status&&$i(e,e.current.id,"CycleDriving",new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+t)),e.nextDate):Ki(e,"CycleDriving",e.currentDate))})(e),(e=>{let t=it.CycleRest(e);void 0!==t&&(t<0?"D"===e.current.status&&$i(e,e.current.id,"CycleRest",new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+t)),e.nextDate):Ki(e,"CycleRest",e.currentDate))})(e),(e=>{let t=it.CycleEnd(e);void 0!==t&&(t<0?"D"===e.current.status&&$i(e,e.current.id,"CycleEnd",new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+t)),e.nextDate):Ki(e,"CycleEnd",e.currentDate))})(e),(e=>{var t;const i="DailyDriving";let o=e.nextDateIndex!==e.day.dateIndex,n=qe(e.day,e.config);o||void 0===n||"D"!==(null===(t=e.current)||void 0===t?void 0:t.status)||(e.currentDateIndex!==e.nextDateIndex?Zi(e,i,(t=>qe(t,e.config)),Ge):ji(e,i,Ge))})(e),(e=>{var t,i;const o="DailyDuty";let n=e.nextDateIndex!==e.day.dateIndex;e.isInit&&!n&&void 0!==(null===(t=e.config.daily)||void 0===t?void 0:t.dutyMaximum)&&"D"===(null===(i=e.current)||void 0===i?void 0:i.status)&&(e.currentDateIndex!==e.nextDateIndex?Zi(e,o,(t=>Ve(t,e.config)),Ke):ji(e,o,Ke))})(e),(e=>{let t=it.DutySinceCycleRest(e);void 0!==t&&(t<0?"D"===e.current.status&&$i(e,e.current.id,"DutySinceCycleRest",new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+t)),e.nextDate):Ki(e,"DutySinceCycleRest",e.currentDate))})(e)),Qi(e),(e=>{let t=it.Duty(e);void 0!==t&&(t<0?"D"===e.current.status&&$i(e,e.current.id,"Duty",new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+t)),e.nextDate):Ki(e,"Duty",e.currentDate))})(e),(e=>{var t;if(!e.config.workday)return;const i=si(e);if(i&&e.workday.end){if(Fi(e),Ui(e),zi(e),Pt(e)&&!e.workday.workdayExtended&&e.config.workday.workdayMaximumWhenSplitSB){const o=i-(null!==(t=e.config.workday.workdayMaximum)&&void 0!==t?t:i);void 0!==e.workday.workdayExtended?e.workday.workdayExtended+=o:e.workday.workdayExtended=o}if((e=>!!e.workday.end&&e.nextDate.getTime()-e.workday.end.getTime()>0)(e)){if("D"===e.current.status){let t;e.config.bigDayBonus&&e.workday.workdayExtended&&(t=(i+e.workday.workdayExtended)/o.Al),$i(e,e.current.id,"Workday",new Date(Math.max(e.currentDate.getTime(),e.workday.end.getTime())),e.nextDate,t)}}else e.workday.hasStarted&&delete e.currentViolations.Workday,Ki(e,"Workday",e.currentDate)}})(e),(e=>{if(!e.config.rest)return;let t=it.Rest(e);void 0!==t&&(t<0?"D"===e.current.status&&$i(e,e.current.id,"Rest",new Date(Math.max(e.currentDate.getTime(),e.nextDate.getTime()+t)),e.nextDate):Ki(e,"Rest",e.currentDate))})(e)},eo=(e,t)=>{if(!e.config.daily)return;const i=new Set,n=new Set;e.pastViolations.forEach((t=>{"DailyOff"===t.type&&i.add((0,o.bh)(t.fromDate,e.toLocalTime)),"DailyRest"===t.type&&n.add((0,o.bh)(t.fromDate,e.toLocalTime))})),(t?e.days.filter((e=>e.date.getTime()>
1=t.getTime())):e.days).forEach((t=>{!i.has(t.dateIndex)&&((e,t)=>{const i=je(t,e.config,!0);if(e.day.date===t.date){let n=(0,o.Or)(e);return void 0!==t.unCountedOff&&void 0!==i&&t.unCountedOff+n<i}return void 0!==i&&i+(()=>{var i,o,n;if("DayOne"!==t.deferralStatus)return 0;const a=null!==(i=Je(t,e.config,!0))&&void 0!==i?i:0,s=Math.max(0,-a);if(e.customCodes.disableDeferralRestSubtractionFix)return s;const r=(null!==(o=t.offDutyCount)&&void 0!==o?o:0)-(null!==(n=Ye(t,e.config))&&void 0!==n?n:0);return r>0?Math.min(s,r):s})()>0})(e,t)&&Yi(e,"DailyOff",t),!n.has(t.dateIndex)&&((e,t)=>{if(void 0===t.restCount)return!1;let i=Je(t,e.config,!0);if(e.day.date===t.date){let n=(0,o.Or)(e);return void 0!==t.unCountedOff&&void 0!==i&&t.unCountedOff+n<i}return void 0!==i&&i>0})(e,t)&&Yi(e,"DailyRest",t)}))},to=e=>e.days.map((t=>{let i;return e.customCodes.enableAutoCreateNoneDeferralLog?t.deferralStatus&&void 0!==t.deferralTime&&(i={time:(0,o.Pv)(t.deferralTime),status:t.deferralStatus,requiredDeferralLogStatus:t.deferralLogRequired}):t.deferralStatus&&void 0!==t.deferralLogNeeded&&void 0!==t.deferralTime&&(i={time:(0,o.Pv)(t.deferralTime),status:t.deferralStatus,deferralLogRequired:t.deferralLogNeeded}),{dateTime:e.toLocalTime(t.date),onTotal:t.statusCounts.ON?(0,o.Pv)(t.statusCounts.ON):void 0,offTotal:t.statusCounts.OFF?(0,o.Pv)(t.statusCounts.OFF):void 0,driveTotal:t.statusCounts.D?(0,o.Pv)(t.statusCounts.D):void 0,sleeperBerthTotal:t.statusCounts.SB?(0,o.Pv)(t.statusCounts.SB):void 0,personalConveyanceTotal:t.statusCounts.PC?(0,o.Pv)(t.statusCounts.PC):void 0,yardMoveTotal:t.statusCounts.YM?(0,o.Pv)(t.statusCounts.YM):void 0,waitTimeTotal:t.statusCounts.WT?(0,o.Pv)(t.statusCounts.WT):void 0,restInfos:t.restInfo?t.restInfo.map((e=>({fromDate:e.fromDate,toDate:e.toDate}))):t.restInfo,deferralInfo:i,hoursInCycle:(0,o.Pv)(t.hoursInCycle)}})),io=e=>e.workdays.map((e=>{var t;let i={fromDate:e.start,toDate:e.end,driveExtension:e.drivingExtended?(0,o.Pv)(e.drivingExtended):void 0,workdayExtension:e.workdayExtended?(0,o.Pv)(e.workdayExtended,!0):void 0,driveCount:e.driveCount?(0,o.Pv)(e.driveCount):void 0,onDutyCount:e.onDutyCount?(0,o.Pv)(e.onDutyCount):void 0};e.resetInfo&&(i.resetInfo=e.resetInfo);const n=null===(t=e.resetInfo)||void 0===t?void 0:t.eligibleForResetDate;return n&&e.start?(i.onDutyIntervals=oi.getAllIntervals({start:e.start.getTime(),end:n.getTime()}).map((e=>({start:new Date(e.start),end:new Date(e.end)}))),i):(i.isInProgress=!0,i)})),oo=e=>{const t=e.cycles.filter((e=>e.hasStarted)),i=e.cycles[e.cycles.length-1],n=i&&!i.hasStarted&&t.length>0;return t.map(((a,s)=>{let r=a.cycleConsecutiveOffCount;return!e.customCodes.disablePrevCycleRestDurationCountingFix&&n&&s===t.length-1&&(r+=i.cycleConsecutiveOffCount),{dateTime:a.fromDate,consecutiveRest:(0,o.Pv)(r),cycleResetPeriod:a.cycleResetPeriod}}))},no=(e,t)=>{e.day.offDutyCount+=t},ao=(e,t,i,n,a,s,r,l,d)=>{var c,u;let m=[...l].sort(((e,t)=>t.getTime()-e.getTime()));if(r){(e=>{var t;e.cycles=e.cycles.map((e=>(e.toDate=(0,o.DP)(e.toDate),e.fromDate=(0,o.DP)(e.fromDate),e.completedRestPeriodDates=e.completedRestPeriodDates.map((e=>(0,o.DP)(e))),e.cycleResetPeriod&&(e.cycleResetPeriod.fromDate=(0,o.DP)(e.cycleResetPeriod.fromDate),e.cycleResetPeriod.eligibleForResetDate=(0,o.DP)(e.cycleResetPeriod.eligibleForResetDate),e.cycleResetPeriod.toDate=(0,o.DP)(e.cycleResetPeriod.toDate)),e))),e.workdays=e.workdays.map((e=>{var t;return e.start=(0,o.DP)(e.start),e.end=(0,o.DP)(e.end),e.endOfLastDLog=(0,o.DP)(e.endOfLastDLog),e.endOfLastBreak=(0,o.DP)(e.endOfLastBreak),e.prevLastReducedRestApplyDate=(0,o.DP)(e.prevLastReducedRestApplyDate),e.eligibleReducedRestPeriods=null===(t=e.eligibleReducedRestPeriods)||void 0===t?void 0:t.map((e=>(e.start=(0,o.DP)(e.start),e.end=(0,o.DP)(e.end),e))),e})),e.days=e.days.map((e=>{var t;return e.date=(0,o.DP)(e.date),e.restInfo=null===(t=e.restInfo)||void 0===t?void 0:t.map((e=>(e.toDate=(0,o.DP)(e.toDate),e.fromDate=(0,o.DP)(e.fromDate),e))),e})),e.pastViolations=e.pastViolations.map((e=>(e.fromDate=(0,o.DP)(e.fromDate),e.toDate=(0,o.DP)(e.toDate),e))),e.cycleRestartDatesFromOtherRulesets=null===(t=e.cycleRestartDatesFromOtherRulesets)||void 0===t?void 0:t.map((e=>(0,o.DP)(e)))})(r);let{pastViolations:l,currentViolations:u}=(e=>{let t=[],i={};for(let o of e.pastViolations)void 0!==o.toDate?t.push(o):i[o.type]=o;return{pastViolations:t,currentViolations:i}})(r),h=r.days[r.days.length-1],y=r.workdays[r.workdays.length-1];if(h&&void 0!==h.restCount&&h.restInfo&&h.restInfo.length>0){let e=h.restInfo[h.restInfo.length-1];if(e.isTemp){h.restInfo.pop();let t=(0,o.DP)(e.toDate).getTime()-(0,o.DP)(e.fromDate).getTime();h.restCount-=t,e.isWt?y.consecutiveWtCount+=t:y.consecutiveOffCount+=t}}
1return{config:n.config,i:0,allocatedCountIndex:-1,current:r.current,next:r.next,currentDate:r.currentDate,nextDate:r.nextDate,duration:r.duration,currentDateIndex:r.currentDateIndex,nextDateIndex:r.nextDateIndex,currentViolations:u,pastViolations:l,workday:y||{hasStarted:!1,consecutiveOffCount:0,consecutiveWtCount:0,consecutiveRestCount:0},day:h||{dateIndex:"",date:new Date(0),driveCount:0,onDutyCount:0,offDutyCount:0,statusCounts:{},hoursInCycle:0},cycle:r.cycles[r.cycles.length-1]||{fromDate:new Date(0),dutyCountSince24HourRestPeriod:0,cycleConsecutiveOffCount:0,driveCount:0,onDutyCount:0,days:0,bigDayCount:0,hasStarted:!1,pauseCountingCycleOff:!1,completedRestPeriodDates:[],cycleMaximum:0},workdays:r.workdays,days:r.days,cycles:r.cycles,exemption16HLogs:(r.exemption16HLogs||[]).concat(a.filter((e=>"Exemption16H"===e.status))),adverseLogs:(r.adverseLogs||[]).concat(a.filter((e=>"AdverseWeather"===e.status))),railroadLogs:(r.railroadLogs||[]).concat(a.filter((e=>"RailroadExemption"===e.status))),emergencyResponseLogs:ge(a,r.emergencyResponseLogs),emergencyResponsePeriods:[],emergencyResponseSuppressedViolations:r.emergencyResponseSuppressedViolations||[],deferralLogs:di(e,a,d.enableAutoCreateNoneDeferralLog,r.deferralLogs),reducedRestLogs:(r.reducedRestLogs||[]).concat(a.filter((e=>"ExemptionReducedRest"===e.status))),logs:[...i],rulesetDateRanges:s,isInit:r.isInit,splitSBDuringReset:r.splitSBDuringReset,toLocalTime:e,toUtcTime:t,propertySplitSubConfig:"asymmetric"===(null===(c=n.config.splitConfig)||void 0===c?void 0:c.type)?n.config.splitConfig:void 0,intermediateSplitConfig:le(n.config,d),cycleRestartDatesFromOtherRulesets:m,customCodes:d}}return{config:n.config,i:0,allocatedCountIndex:-1,current:void 0,next:void 0,currentDate:new Date(0),nextDate:new Date(0),duration:0,currentDateIndex:"",nextDateIndex:"",currentViolations:{},pastViolations:[],workday:{hasStarted:!1,consecutiveOffCount:0,consecutiveWtCount:0},day:{dateIndex:"",date:new Date(0),driveCount:0,onDutyCount:0,offDutyCount:0,statusCounts:{},hoursInCycle:0},cycle:{fromDate:new Date(0),dutyCountSince24HourRestPeriod:0,cycleConsecutiveOffCount:0,driveCount:0,onDutyCount:0,days:0,bigDayCount:0,hasStarted:!1,pauseCountingCycleOff:!1,completedRestPeriodDates:[],cycleMaximum:0},workdays:[],days:[],cycles:[],exemption16HLogs:a.filter((e=>"Exemption16H"===e.status)),adverseLogs:a.filter((e=>"AdverseWeather"===e.status)),railroadLogs:a.filter((e=>"RailroadExemption"===e.status)),emergencyResponseLogs:ge(a),emergencyResponsePeriods:[],emergencyResponseSuppressedViolations:[],deferralLogs:di(e,a,d.enableAutoCreateNoneDeferralLog),reducedRestLogs:a.filter((e=>"ExemptionReducedRest"===e.status)),logs:[...i],rulesetDateRanges:s,isInit:!1,splitSBDuringReset:0,toLocalTime:e,toUtcTime:t,propertySplitSubConfig:"asymmetric"===(null===(u=n.config.splitConfig)||void 0===u?void 0:u.type)?n.config.splitConfig:void 0,intermediateSplitConfig:le(n.config,d),cycleRestartDatesFromOtherRulesets:m,customCodes:d}},so=(e,t)=>{if(void 0===t)return{next:e.next,adverseLogs:e.adverseLogs,exemption16HLogs:e.exemption16HLogs,railroadLogs:e.railroadLogs,emergencyResponseLogs:De(e,void 0),emergencyResponseSuppressedViolations:e.emergencyResponseSuppressedViolations,deferralLogs:e.deferralLogs,isInit:e.isInit,pastViolations:e.pastViolations,cycles:e.cycles,workdays:e.workdays,days:e.days,splitSBDuringReset:e.splitSBDuringReset,intermediateSplitConfig:e.intermediateSplitConfig};let i=(0,o.Zv)(t,e.toLocalTime,e.toUtcTime);return{next:e.next,adverseLogs:e.adverseLogs,exemption16HLogs:e.exemption16HLogs,railroadLogs:e.railroadLogs,emergencyResponseLogs:De(e,i),emergencyResponseSuppressedViolations:e.emergencyResponseSuppressedViolations,deferralLogs:e.deferralLogs,isInit:e.isInit,pastViolations:e.pastViolations.filter((e=>!e.toDate||e.toDate>t)),cycles:e.cycles.filter((e=>!e.toDate||e.toDate>t)),workdays:e.workdays.filter((e=>!e.end||e.end>t)),days:e.days.filter((e=>!e.date||e.date>=i)),splitSBDuringReset:e.splitSBDuringReset,intermediateSplitConfig:e.intermediateSplitConfig}},ro=e=>{e.cycle.pauseCountingCycleOff&&(e.cycle.pauseCountingCycleOff=!1)},lo=e=>{e.next=e.logs[0],e.i=1;let t=new Date(e.logs[0].dateTime),i=(0,o.bh)(t,e.toLocalTime);ui(e,t,i),yi(e,i),e.nextDateIndex=i;let n=(0,o.Zv)(t,e.toLocalTime,e.toUtcTime).getTime(),a=Math.max(0,t.getTime()-n);e.day.statusCounts.OFF=a,no(e,a),((e,t,i)=>{let o=Qe(e.day,e.config),n=Je(e.day,e.config);if(void 0!==o&&void 0!==n&&e.config.rest&&void 0!==e.day.restCount&&void 0!==e.day.restInfo){let a=Math.min(n,i-o);a>0&&(e.day.restCount+=a,e.day.restInfo.push({fromDate:new Date(t),toDate:new Date(t+a)}))}})(e,n,a),ci(e,t),gi(e,t,!1,void 0),e.isInit=!0},co=(e,t,i=!1,n=!1,a=!1,s=!1)=>{let{availability:r,preciseAvailability:l}
1=lt(e,i),d={violations:e.pastViolations.map(o.Vz),availability:r,preciseAvailability:l,daySummaries:to(e),workdaySummaries:io(e),cycleSummaries:oo(e)};n&&(d.discreteAvailability=ot(e)),a&&(d.nextHosEventDate=(e=>{const t=Object.keys(dt).map((t=>dt[t](e))).filter((e=>void 0!==e));let i=0;return t.length>0&&(i=t.some((e=>e<=0))?0:Math.min(...t)),new Date(e.currentDate.getTime()+i)})(e)),s&&(d.nextAvailabilityEventDates=(e=>{const t={};for(const i in Ot){const o=i,n=Ot[o](e);void 0!==n&&(t[o]=n)}return t})(e));let c=(e=>{let t,i,n=Je(e.day,e.config);e.isInit&&void 0!==n&&(t=n);let a=je(e.day,e.config);return e.isInit&&void 0!==a&&(i=Math.max(a,"DayTwo"===e.day.deferralStatus?ai(e):0)),{restBreakNeeded:void 0!==t?(0,o.Pv)(t):void 0,offDutyNeeded:void 0!==i?(0,o.Pv)(i):void 0}})(e);c.restBreakNeeded&&(d.restBreakNeeded=c.restBreakNeeded),c.offDutyNeeded&&(d.offDutyNeeded=c.offDutyNeeded),e.config.resetPreviousCycle&&0!==e.cycle.onDutyCount&&(d.rulesetsThatCannotChange=[t]),e.next&&(d.currentDutyStatus=e.next.status);let u=(e=>{var t;let i=null===(t=e.config.workday)||void 0===t?void 0:t.offDutyMinimum;const n=e.config.splitConfig;if(!(e.customCodes.enablePreventSplitCompleteWhenViolationFix&&n&&i&&e.current&&-1!==["OFF","SB","PC"].indexOf(e.current.status)))return;let a=i;if("symmetric"===n.type){let t=e.workday.splitSB;if(!t||!t.inSleeper)return;Ct(e)||(a=t.periods.slice(0,-1).map((e=>(0,o.cl)(e))).reduce(((e,t)=>e-t),i))}else if("asymmetric"===n.type){let t=e.workday.propertySplitSB,n=e.propertySplitSubConfig;if(t&&n){let n=t.offDutyPeriods;Ct(e)||(a=n.slice(0,-1).reduce(((e,t)=>e-(0,o.cl)(t)),i))}}return Math.max(0,a)})(e);return u&&(d.remainingSplitDuration=u),uo(e,d),d};const uo=(e,t)=>{var i,n,a;if(e.customCodes.disableNonSplitAvailability)return;const s=ut(t,null===(i=e.config.workday)||void 0===i?void 0:i.workdayMaximum,null!==(n=e.workday.workdayExtended)&&void 0!==n?n:0,mo(e),null!==(a=e.workday.earnedSplitExclusion)&&void 0!==a?a:0,fe(e.emergencyResponsePeriods,e.nextDate)?(0,o.Or)(e):0);t.nonSplitAvailability=s.availability,t.nonSplitPreciseAvailability=s.preciseAvailability,t.nonSplitViolations=s.violations},mo=e=>{if(!e.workday.start||!e.workday.end||0===e.logs.length)return[];const t=e.currentDate.getTime();return new ct.A(e.logs,["D"],void 0,void 0,t).getAllIntervals({start:e.workday.start.getTime(),end:Math.max(e.workday.end.getTime(),t)}).reduce(((t,i)=>(Te(e.emergencyResponsePeriods,new Date(i.start),new Date(i.end)).forEach((e=>{t.push({start:e.start,end:e.end})})),t)),[])};function ho(e,t,i,n,a,s,r,l,d,c,u,m=!1,h=!1,y=!1,p=[],f=!1,g=!1){let v=ao(a,s,t,i,n,l,c,p,d);return ve(v),oi=new ct.A(v.logs,o.cm),((e,t)=>{if(void 0===t)return;let i=e.logs.length?e.logs[e.logs.length-1]:e.next;if(i){let o=JSON.parse(JSON.stringify(i));o.dateTime=t,o.dummyLog=!0,e.logs.push(o)}})(v,e),!(null==c?void 0:c.isInit)&&v.logs.length>0&&lo(v),c&&v.adverseLogs.length>0&&Ui(v),v.next&&(e=>{for(var t;e.i<=e.logs.length;e.i++)e.current=e.next,e.next=e.i<e.logs.length?e.logs[e.i]:e.current,e.currentDate=(0,o.DP)(e.current.dateTime),e.nextDate=(0,o.DP)(e.next.dateTime),e.duration=e.nextDate.getTime()-e.currentDate.getTime(),e.currentDateIndex=null!==(t=e.nextDateIndex)&&void 0!==t?t:(0,o.bh)(e.currentDate,e.toLocalTime),e.nextDateIndex=(0,o.bh)(e.nextDate,e.toLocalTime),e.allocatedCountIndex<e.i&&(Ci(e),e.allocatedCountIndex=e.i,ro(e)),e.customCodes.disableRemoveOrTrimViolationsAfter16hException&&"D"!==e.current.status&&Object.keys(e.currentViolations).forEach((t=>delete e.currentViolations[t].lastDriveToDate)),-1!==o.oP.indexOf(e.current.status)?Xi(e):-1!==o.cm.indexOf(e.current.status)&&(ro(e),Ni(e)),Ui(e),zi(e),Jt(e),Ri(e),pi(e),Pi(e),Ji(e),ke(e)})(v),0===v.logs.length&&(Ui(v),zi(v),Ji(v)),eo(v,u),v.pastViolations=[...v.pastViolations,...Object.keys(v.currentViolations).map((e=>v.currentViolations[e]))],Mi(v),{validation:co(v,r,m,h,y,g),state:f?v:so(v,u)}}let yo=(e,t)=>{t<=24*o.Al?e.hoursLimit=t/o.Al:e.daysLimit=t/o.qn},po=e=>{"Work"!==e.current.status&&"WorkExemption"!==e.current.status||e.timePeriodList.forEach((t=>{let i,o,n=e.workRestCounts[t];if(n.restPeriod&&n.restPeriod.restMinimum&&n.restPeriod.countRequired&&(o=fo(e,n)),n.workPeriod&&n.workPeriod.workMaximum&&n.workPeriod.workCount&&(i=n.workPeriod.workMaximum-n.workPeriod.workCount),o&&o<0){let i={fromDate:new Date(e.nextDate.getTime()+o),toDate:e.nextDate,logId:e.current.id,type:"EwdRest"};yo(i,t),e.violations.push(i)}if(i&&i<0){let o={fromDate:new Date(e.nextDate.getTime()+i),toDate:e.nextDate,logId:e.current.id,type:"EwdWork"};yo(o,t),e.violations.push(o)}}))},fo=(e,t)=>{if(void 0===t.restPeriod||void 0===t.restPeriod.restMinimum||void 0===t.restPeriod.countRequired||void 0===t.restPeriod.restSegments)return;let i=t.restPeriod.countRequired-t.restPeriod.restSegments.length,o=t.restPeriod.restMinimum*Math.max(i,0),n=0;for(let t=0;t<e.logs.length;t++)if(e.logs[t].id===e.current.id){n=t;break}return"Rest"===e.current.status&&e.current.dateTime===e.logs[n].dateTime&&i>0?t.toDate.getTime()-e.currentDate.getTime()-o:t.toDate.getTime()-e.nextDate.getTime()-o},go=e=>{e.workExemptionCount=0,e.consecutiveRestCount=0,e.timePeriodList.forEach((t=>{let i=e.workRestCounts[t].workPeriod;void 0!==i&&void 0!==i.workCount&&(i.workCount+=e.duration)}))},vo=(e,t)=>{let i=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),n=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return i>n?-1:(n-i)/(24*o.Al)},Do=(e,t)=>{var i;let n=Math.max(null!==(i=(e=>{let t;return e.duration<7*o.Al?t=0:e.currentDate.getHours()<=1?t=vo(e.currentDate,e.nextDate)+1:e.currentDate.getHours()<=22&&e.nextDate.getHours()>=5&&(t=vo(e.currentDate,e.nextDate)),t})(e))&&void 0!==i?i:NaN,(e=>e.duration<24*o.Al?0:vo(e.currentDate,e.nextDate))(e));if(n>0&&void 0!==t.nightRestBreakCount){if(t.nightRestBreakCount+=n,void 0!==t.consecutiveNightRestBreakCount){e.lastNightRestBreakDate&&e.nextDate.getTime()>e.lastNightRestBreakDate.getTime()&&1===vo(e.lastNightRestBreakDate,e.nextDate)&&(t.consecutiveNightRestBreakCount=Math.max(t.consecutiveNightRestBreakCount,1)+n),n>=2&&(t.consecutiveNightRestBreakCount+=n)}e.lastNightRestBreakDate=e.nextDate}},wo=e=>{e.workExemptionCount=0,e.consecutiveRestCount+=e.duration,e.timePeriodList.forEach((t=>{let i=e.workRestCounts[t].restPeriod,o=e.workRestCounts[t].workPeriod;if(void 0!==i){if(i.nightRestBreakCountRequired&&i.consecutiveNightRestBreakCountRequired&&Do(e,i),i.restMinimum&&i.restSegments&&e.duration>=i.restMinimum){let t=Math.floor(e.duration/i.restMinimum);for(let o=0;o<t;o++){let t={startDate:new Date(e.currentDate.getTime()+o*i.restMinimum),toDate:new Date(e.currentDate.getTime()+(o+1)*i.restMinimum)};i.restSegments.push(t)}}if((e=>{let t,i,o;return t=i=o=!0,e&&e.restMinimum&&e.countRequired&&void 0!==e.restSegments&&(t=e.restSegments.length>=e.countRequired),void 0!==e.nightRestBreakCount&&void 0!==e.nightRestBreakCountRequired&&(i=e.nightRestBreakCount>=e.nightRestBreakCountRequired),void 0!==e.consecutiveNightRestBreakCount&&void 0!==e.consecutiveNightRestBreakCountRequired&&(o=e.consecutiveNightRestBreakCount>=e.consecutiveNightRestBreakCountRequired),t&&i&&o})(i)){if(i.restMinimum&&i.countRequired&&void 0!==i.restSegments)if(i.countRequired>1){let o=i.restSegments.length-i.countRequired;e.workRestCounts[t].startDate=i.restSegments[o].toDate,e.workRestCounts[t].toDate=new Date(i.restSegments[o].toDate.getTime()+t),i.restSegments=i.restSegments.slice(i.restSegments.length-i.countRequired+1)}
1else i.restSegments=[],e.workRestCounts[t].startDate=e.nextDate,e.workRestCounts[t].toDate=new Date(e.nextDate.getTime()+t);void 0!==i.nightRestBreakCount&&void 0!==i.consecutiveNightRestBreakCount&&(i.nightRestBreakCount=0,i.consecutiveNightRestBreakCount=0),o&&(o.workCount=0)}}}))},bo=e=>{if(e.consecutiveRestCount=0,e.workExemptionCount>0)e.workExemptionCount+=e.duration;else if(e.currentDate.getDate()>e.lastExemptionDate.getDate()||e.currentDate.getTime()-e.lastExemptionDate.getTime()>o.qn)e.lastExemptionDate=e.currentDate,e.workExemptionCount+=e.duration;else{let t={fromDate:e.currentDate,toDate:e.nextDate,logId:e.current.id,type:"EwdWorkExemption"};e.violations.push(t)}if(e.workExemptionCount>1*o.Al){let t={fromDate:new Date(e.lastExemptionDate.getTime()+1*o.Al),toDate:e.nextDate,logId:e.current.id,type:"EwdWorkExemption"};e.violations.push(t)}else;};function So(e,t,i){let n={violations:[],ewdAvailability:[],cycleSummaries:[],availability:(0,o.j)("None")};if(t.length<=0)return{validation:n,state:void 0};let a=((e,t)=>{let i={logs:e,config:t.config,timePeriodList:[],current:void 0,next:void 0,currentDate:new Date(0),nextDate:new Date(0),duration:0,violations:[],workRestCounts:{},lastExemptionDate:new Date(0),lastNightRestBreakDate:new Date(0),workExemptionCount:0,consecutiveRestCount:0};return i.config.workRestConfig&&i.config.workRestConfig.forEach((t=>{let o=t.timePeriod;i.timePeriodList.push(o);let n={},a={},s=t.workPeriod,r=t.restPeriod;s&&s.workMaximum&&(n={workCount:0,workMaximum:s.workMaximum}),r&&(r.restMinimum&&r.countRequired&&(a={restSegments:[],restMinimum:r.restMinimum,countRequired:r.countRequired}),r&&r.nightRestBreakCount&&(a.nightRestBreakCount=0,a.nightRestBreakCountRequired=r.nightRestBreakCount),r&&r.consecutiveNightRestBreakCount&&(a.consecutiveNightRestBreakCount=0,a.consecutiveNightRestBreakCountRequired=r.consecutiveNightRestBreakCount));let l={startDate:e[0].dateTime,toDate:new Date(e[0].dateTime.getTime()+o),workPeriod:n,restPeriod:a};i.workRestCounts[o]=l})),i.timePeriodList=i.timePeriodList.sort(((e,t)=>e-t)),i})(t,i);((e,t)=>{if(void 0===t&&e.logs.length>1)return;let i=e.logs.length?e.logs[e.logs.length-1]:e.next;if(i){let o=void 0===t?i.dateTime:t,n=JSON.parse(JSON.stringify(i));n.dateTime=o,n.dummyLog=!0,e.logs.push(n)}})(a,e);let s=a.logs.filter((e=>!0===e.dummyLog)).length;s<1&&(s=1);for(let e=0;a.logs.length-s>e;e++){switch(a.current=a.logs[e],a.next=a.logs[e+1],a.currentDate=a.current.dateTime,a.nextDate=a.next.dateTime,a.duration=a.nextDate.getTime()-a.currentDate.getTime(),a.current.status){case"Work":go(a);break;case"Rest":wo(a);break;case"WorkExemption":bo(a)}po(a)}return((e,t)=>{let i=[];e.timePeriodList.forEach((t=>{let n=e.workRestCounts[t],a={timePeriod:t,startDate:n.startDate,toDate:n.toDate};e.consecutiveRestCount>0&&(a.rested=(0,o.Pv)(e.consecutiveRestCount));let s=fo(e,n);if(n.workPeriod&&n.workPeriod.workMaximum&&void 0!==n.workPeriod.workCount){let e=n.workPeriod.workMaximum-n.workPeriod.workCount;s=void 0!==s?Math.max(Math.min(s,e),0):Math.max(e,0)}n.restPeriod&&void 0!==n.restPeriod.nightRestBreakCount&&(a.nightRestBreakCount=n.restPeriod.nightRestBreakCount),n.restPeriod&&void 0!==n.restPeriod.consecutiveNightRestBreakCount&&(a.consecutiveNightRestBreakCount=n.restPeriod.consecutiveNightRestBreakCount),a.timeUntilMustRest=void 0!==s?(0,o.Pv)(s):void 0,i.push(a)})),t.ewdAvailability=i})(a,n),n.violations=a.violations,a.next&&(n.currentDutyStatus=a.next.status),{validation:n,state:void 0}}const Co=["ON","OFF","SB","D","YM","PC","PC_Exempted","WT"],To=["Work","Rest","WorkExemption"];class xo{getRuleSetValidationOrder(e,t){let i=Object.keys(e),o={},n=(0,Q.ZV)(t);return i.forEach((t=>{let i=e[t].hosRuleSet.id.replace("HosRuleSet","");o[t]=n[i]?n[i].config:void 0})),i.sort(((e,t)=>{var i,n,a,s;let r=o[e],l=o[t];return(null!==(n=null===(i=null==r?void 0:r.cycle)||void 0===i?void 0:i.cycleRestartMinimum)&&void 0!==n?n:0)-(null!==(s=null===(a=null==l?void 0:l.cycle)||void 0===a?void 0:a.cycleRestartMinimum)&&void 0!==s?s:0)}))}getRuleSetDateRanges(e){let t={};for(let i=0,o=e.length;i<o;i++){let n=e[i],a=new Date(n.dateTime),s=i<o-1?e[i+1]:null,r=s?new Date(s.dateTime):null,l=this.getRuleSetKey(n);l in t?t[l].push({start:a,end:r}):t[l]=[{start:a,end:r}]}return t}reverseResultDateTimeOffSet(e,t){let i=e=>e?t(e):null;return e.violations=e.violations.map((e=>(e.toDate=i(e.toDate),e.fromDate=i(e.fromDate),e))),e.availability&&e.availability.recap&&e.availability.recap.map((e=>(e.dateTime=t(e.dateTime),e))),e.ewdAvailability&&e.ewdAvailability.map((e=>(e.startDate=i(e.startDate),e.toDate=i(e.toDate),e))),e.availability&&void 0!==e.availability.cycleAvailabilities&&e.availability.cycleAvailabilities.map((e=>(e.dateTime=t(e.dateTime),e))),e.daySummaries&&(e.daySummaries=e.daySummaries.map((e=>(e.restInfos&&(e.restInfos=e.restInfos.map((e=>(e.toDate=i(e.toDate),e.fromDate=i(e.fromDate),e)))),e)))),e.workdaySummaries&&(e.work
1daySummaries=e.workdaySummaries.map((e=>(e.toDate=i(e.toDate),e.fromDate=i(e.fromDate),e)))),e.cycleSummaries&&(e.cycleSummaries=e.cycleSummaries.map((e=>(e.dateTime=i(e.dateTime),e)))),e}sortFunc(e,t){return e.dateTime>t.dateTime?1:e.dateTime<t.dateTime?-1:0}simplifyAndLocalizeLog(e,t){let i={dateTime:t?t(e.dateTime):new Date(e.dateTime),id:e.id,status:e.status};return"ExemptionOffDutyDeferral"===i.status&&(i.deferralStatus=e.deferralStatus,i.deferralMinutes=e.deferralMinutes),i}getDistinctRuleSets(e){let t={};for(let o of e){if(!o.hosRuleSet||!o.hosRuleSet.id)throw new Error("Invalid user ruleset provided: "+JSON.stringify(e));var i=this.getRuleSetKey(o);t.hasOwnProperty(i)||(t[i]=o)}return t}populateViolationReasons(e,t){if(t&&e.violations.length>0){let i=(0,o.j)(t),n=void 0!==i.cycle?(0,o.PN)(i.cycle)/o.Al:void 0,a=void 0!==i.cycleDriving?(0,o.PN)(i.cycleDriving)/o.Al:void 0,s=void 0!==i.workday?(0,o.PN)(i.workday)/o.Al:(0,o.e5)(t),r=void 0!==i.duty?(0,o.PN)(i.duty)/o.Al:void 0,l=void 0!==i.driving?(0,o.PN)(i.driving)/o.Al:void 0,d=void 0!==i.rest?(0,o.PN)(i.rest)/o.Al:void 0,c=void 0!==i.dutySinceCycleRest?(0,o.PN)(i.dutySinceCycleRest)/o.Al:void 0,u=t.config.rest&&t.config.rest.dailyRestMinimum?t.config.rest.dailyRestMinimum/o.Al:0,m=t.config.daily&&t.config.daily.offDutyMinimum?t.config.daily.offDutyMinimum/o.Al:0,h=t.config.cycle&&t.config.cycle.cycleDays||0,y=(t.config.cycle&&t.config.cycle.cycleRestMinimum||0)/o.Al,p=t.config.cycle&&t.config.cycle.cycleRestDays||0;e.violations.forEach((e=>{var i,f;switch(e.type){case"Cycle":e.daysLimit=h,e.hoursLimit=n;break;case"Workday":e.hoursLimit||(e.hoursLimit=s);break;case"Duty":case"DailyDuty":e.hoursLimit=r;break;case"Driving":case"DailyDriving":e.hoursLimit=l;break;case"Rest":e.hoursLimit=d;break;case"DailyRest":e.hoursLimit=u;break;case"DailyOff":e.hoursLimit=m;break;case"DutySinceCycleRest":e.hoursLimit=c;break;case"CycleRest":e.hoursLimit=y,e.daysLimit=p,e.periodsLimit=null!==(f=null===(i=t.config.cycle)||void 0===i?void 0:i.cycleRestPeriods)&&void 0!==f?f:1;break;case"CycleDriving":e.daysLimit=h,e.hoursLimit=a;break;case"CycleEnd":e.daysLimit=h}e.reason=(0,o.C1)(e)}))}}isForEWD(e){var t;let i=e.length>0&&e[e.length-1],n=i&&(null===(t=null==i?void 0:i.hosRuleSet)||void 0===t?void 0:t.id);if("string"!=typeof n)return!1;let a=n.replace("HosRuleSet","")||void 0;return!!a&&-1!==o.kQ.indexOf(a)}calculateAvailabilityAndViolationsAndState(e,t,i,n,a,s,r,l,d,c=!1,u=!1,m=!1,h=[],y=!1,p=!1){let f,g=t.hosRuleSet.id.replace("HosRuleSet",""),v=-1!==o.kQ.indexOf(g),D=(0,Q.dZ)(g,s.disableTexasShortHaulRulesetCorrection);if(!D)return{validation:(0,o.jU)(g),state:void 0};let w=this.timeSpanParse(t.startOfDay)||0,b=e=>{let t=this.dstCalculator.toLocalDateTime(e,d,!0);return w?new Date(t.getTime()-w):t},S=e=>{let t=this.dstCalculator.toReverseOffsetDateTime(e,d,!0);return w?new Date(t.getTime()+w):t};if(v){let t=So(e,i,D),o=e=>this.dstCalculator.toReverseOffsetDateTime(e,d,!0);f={validation:this.reverseResultDateTimeOffSet(t.validation,o),state:t.state}}else f=ho(e,i,D,n,b,S,t,a,s,r,l,c,u,m,h,y,p),this.populateViolationReasons(f.validation,D);return f}getRuleSetKey(e){return e.startOfDay?e.hosRuleSet.id+e.startOfDay:e.hosRuleSet.id+"00:00:00"}constructor(e){this.dstCalculator=e,this.timeSpanParse=t=>t?e.timeSpanParse(t).getTime():void 0}validateHos(e){return this.validate(e.logs,e.ruleSets,e.dummyLogDate,e.customCodes,e.timeZoneId,e.fromDate,e.getAllRecaps,e.getDiscreteAvailability,e.getNextAvailabilityEvent,e.getNextHosEventDate)}validateHosWithState(e){return this.validateWithState(e.logs,e.ruleSets,e.dummyLogDate,e.customCodes,e.timeZoneId,e.prevState,e.fromDate)}validate(e,t,i,o,n,a,s=!1,r=!1,l=!1,d=!1){return this.validateWithState(e,t,i,o,n,void 0,a,s,r,d,!1,l).validation}jsonDateParser(e,t){return(0,o.DP)(t)}validateWithState(e,t,i,n,a,s,r,l=!1,d=!1,c=!1,u=!1,m=!1){var h,y,p;if(!a){const o={driverTimeZone:a,dummyDate:i,fromDate:r,logsCount:null!==(h=null==e?void 0:e.length)&&void 0!==h?h:0,userRulesetsCount:null!==(y=null==t?void 0:t.length)&&void 0!==y?y:0,firstLog:(null==e?void 0:e[0])?{dateTime:e[0].dateTime,status:e[0].status}:null,lastLog:(null==e?void 0:e.length)>0?{dateTime:e[e.length-1].dateTime,status:e[e.length-1].status}
1:null,firstRuleset:(null==t?void 0:t[0])?{id:null===(p=t[0].hosRuleSet)||void 0===p?void 0:p.id,dateTime:t[0].dateTime}:null};throw new Error(`Driver's timezone must be provided to EngineCalculator.Validate. Debug: ${JSON.stringify(o)}`)}let f=e=>this.dstCalculator.toLocalDateTime(e,a);t.sort(this.sortFunc);let g,v,D=[],w=[],b=[],S=(0,o.jU)("None"),C=s;e.sort(o.SZ),i&&(g=new Date(i)),r&&(v=new Date(r)),"string"==typeof C&&(C=JSON.parse(C,this.jsonDateParser)),this.isForEWD(t)?(i&&(g=f(i)),this.filterAndLocalizeEwdLogs(e,g,D,t,b,f)):this.filterAndLocalizeHosLogs(e,g,D,w,t,b);let T=this.getDistinctRuleSets(b);const x=Object.assign(Object.assign({},o.G1),n);let k=x.disableCycleRestartUsedInFollowingValidations?Object.keys(T):this.getRuleSetValidationOrder(T,x.disableTexasShortHaulRulesetCorrection),M=[],R=S,E=b.length?b[b.length-1]:null,A=E&&this.getRuleSetKey(E),_=[],X=[],O=this.getRuleSetDateRanges(b),P=[],L={};return k.forEach((e=>{var t,i;if(!T.hasOwnProperty(e))return;let o=T[e],n=C&&"string"!=typeof C?C[e]:void 0,s=O[e],r=this.calculateAvailabilityAndViolationsAndState(g,o,D,w,s,x,n,v,a,l,d,c,M,u,m);L[e]=r.state,x.disableCycleRestartUsedInFollowingValidations||null===(t=r.state)||void 0===t||t.cycles.forEach((e=>{void 0!==e.completedRestartDate&&M.push(e.completedRestartDate)})),r.validation.violations.length>0&&(_=_.concat(r.validation.violations));const h=null!==(i=r.validation.nonSplitViolations)&&void 0!==i?i:r.validation.violations;h.length>0&&(X=X.concat(h)),r.validation.rulesetsThatCannotChange&&r.validation.rulesetsThatCannotChange.length>0&&(P=P.concat(r.validation.rulesetsThatCannotChange)),null!==E&&e===A&&(R=r.validation)})),0!==P.length&&(R.rulesetsThatCannotChange=P),r&&R.daySummaries&&(R.daySummaries=R.daySummaries.filter((e=>f(r).toISOString()<=e.dateTime.toISOString()))),R.violations=_,void 0!==R.nonSplitViolations&&(R.nonSplitViolations=X),{validation:R,stateByRuleset:L}}isOffDutyStatus(e){return o.oP.some((t=>t===e))}filterAndLocalizeHosLogs(e,t,i,o,n,a){for(let n of e){if(!0===n.isIgnored)continue;let e=this.simplifyAndLocalizeLog(n);t&&e.dateTime>t||(Co.indexOf(e.status)>-1?i.push(e):o.push(e))}let s;for(s of n)t&&new Date(s.dateTime)>t||a.push(s)}filterAndLocalizeEwdLogs(e,t,i,o,n,a){let s,r;for(let o of e){if(!0===o.isIgnored)continue;let e=o.status,n=this.simplifyAndLocalizeLog(o,a);t&&n.dateTime>t||(void 0===s||s!==n.status)&&To.indexOf(e)>-1&&(i.push(n),s=e)}for(r of o){let e=a(r.dateTime);t&&e>t||n.push({dateTime:e,hosRuleSet:r.hosRuleSet,startOfDay:r.startOfDay})}}}var ko;!function(e){e.Android="Android",e.IOS="IOS"}(ko||(ko={}));var Mo=i(50780)},13054(e,t,i){var o;i.d(t,{u:()=>o}),function(e){e.ENABLE_AUTO_CREATE_NONE_DEFERRAL_LOG="DRIVE.ENABLE_AUTO_CREATE_NONE_DEFERRAL_LOG",e.ENABLE_PREVENT_SPLIT_COMPLETE_WHEN_VIOLATION_FIX="ENABLE_PREVENT_SPLIT_COMPLETE_WHEN_VIOLATION_FIX",e.DISABLE_REMOVE_OR_TRIM_VIOLATIONS_AFTER_16H_EXEMPTION="DRIVE.DISABLE_REMOVE_OR_TRIM_VIOLATIONS_AFTER_16H_EXEMPTION.KILLSWITCH",e.DISABLE_UNFREEZE_SB_SPLIT_NOT_COMPLETE_FIX="DISABLE_UNFREEZE_SB_SPLIT_NOT_COMPLETE_FIX",e.DISABLE_CYCLE_RESTART_USED_IN_FOLLOWING_VALIDATIONS="HOS.DISABLE_CYCLE_RESTART_USED_IN_FOLLOWING_VALIDATIONS",e.DISABLE_CYCLE_GAIN_CALCULATION="DISABLE_CYCLE_GAIN_CALCULATION",e.DISABLE_EXEMPTION_LOGS_INTERACTION_REFACTOR="DRIVE.DISABLE_EXEMPTION_LOGS_INTERACTION_REFACTOR.KILLSWITCH",e.DISABLE_ONGOING_VIOLATION_RULESET_FIX="HOS.DISABLE_ONGOING_VIOLATION_RULESET_FIX.KILLSWITCH",e.DISABLE_MERGE_OVERLAPPING_REST_INFO_FIX="HOS.DISABLE_MERGE_OVERLAPPING_REST_INFO_FIX.KILLSWITCH",e.DISABLE_PREV_CYCLE_REST_DURATION_COUNTING_FIX="HOS.DISABLE_PREV_CYCLE_REST_DURATION_COUNTING_FIX.KILLSWITCH",e.DISABLE_DEFERRAL_REST_SUBTRACTION_FIX="HOS.DISABLE_DEFERRAL_REST_SUBTRACTION_FIX.KILLSWITCH",e.DISABLE_ERR_REST_RECONCILIATION="HOS.DISABLE_ERR_REST_RECONCILIATION.KILLSWITCH",e.DISABLE_DST_DAILY_AVAILABILITY_FIX="HOS.DISABLE_DST_DAILY_AVAILABILITY_FIX.KILLSWITCH",e.DISABLE_USA_PROPERTY_SPLIT_PAIRING_REUSE_FIX="HOS.DISABLE_USA_PROPERTY_SPLIT_PAIRING_REUSE_FIX.KILLSWITCH",e.ENABLE_NEXT_AVAILABILITY_EVENT_DATE="HOS.ENABLE_NEXT_AVAILABILITY_EVENT_DATE.RELEASE",e.ENABLE_USA_PREVENT_WORKDAY_RESET_PAIRING_FORWARD="HOS.ENABLE_USA_PREVENT_WORKDAY_RESET_PAIRING_FORWARD.RELEASE",e.ENABLE_CANADA_VIOLATION_RECALCULATES_WORKDAY_FIX="HOS.ENABLE_CANADA_VIOLATION_RECALCULATES_WORKDAY_FIX.RELEASE",e.ENABLE_CANADA_VIOLATION_PREVENTS_NEW_FREEZE_FIX="HOS.ENABLE_CANADA_VIOLATION_PREVENTS_NEW_FREEZE_FIX.RELEASE",e.DISABLE_NON_SPLIT_AVAILABILITY="HOS.DISABLE_NON_SPLIT_AVAILABILITY.KILLSWITCH",e.DISABLE_TEXAS_SHORT_HAUL_RULESET_CORRECTION="HOS.DISABLE_TEXAS_SHORT_HAUL_RULESET_CORRECTION.KILLSWITCH",e.DISABLE_CYCLE_RESET_PERIOD="HOS.DISABLE_CYCLE_RESET_PERIOD.KILLSWITCH",e.ENABLE_DRIVER_LOGS_REQUESTED_STATE="HOS.ENABLE_DRIVER_LOGS_REQUESTED_STATE.RELEASE",e.DISABLE_PRESERVE_UNEDITED_LOG_LOCATION="HOS.DISABLE_PRESERVE_UNEDITED_LOG_LOCATION.KILLSWITCH",e.ENABLE_EMERGENCY_RESPONSE_EXEMPTION="HOS.ENABLE_EMERGENCY_RESPONSE_EXEMPTION.RELEASE"}(o||(o={}))},71703(e,t,i){i.d(t,{$C:()=>v,Gb:()=>s,Rc:()=>d,Zq:()=>x,rH:()=>k,wT:()=>a});var o=i(71372);const n=e=>"function"==typeof e.group,a=["OFF","SB","D","ON"],s=["Rest","Work"],r={rowStatuses:[...a],allowedStatuses:[...o._0],yPositions:{timesRowTopPercent:5,gridTopPercent:7}},l=e=>r.rowStatuses.length/e.length,d=(e,t,i=!1)=>{let o=.2*e/l(t);return i?o+T:o},c="svg",u={fillColor:"white",outerLineColor:"black",innerLineColor:"#C4C4C4",approvedColor:"green",modifiedColor:"yellow"},m="hos-graph-desc",h="hos-graph-grid",y="hos-graph-content",p="hos-graph-connecting-lines",f="bar-hos-graph-status",g="hour-pattern",v=()=>Math.floor(1e6*Math.random()),D=e=>{let t=e.getHours();return`${t%12||12}${t>=12?"PM":"AM"}`};class w{constructor(){this.styleNames={fillColor:"fill",fillPattern:"fill",strokeColor:"stroke",strokeWidth:"stroke-width",fillOpacity:"fill-opacity",mask:"mask",horizontalCornerRadius:"rx",verticalCornerRadius:"ry"},this.id=`graph_${v()}`,this.listeners=[]}getMaskDefinition(){let e=document.createElementNS(w.svgURI,"defs"),t=document.createElementNS(w.svgURI,"pattern"),i=document.createElementNS(w.svgURI,"rect"),o=document.createElementNS(w.svgURI,"mask"),n=document.createElementNS(w.svgURI,"rect");return i.setAttribute("width","4"),i.setAttribute("height","8"),i.setAttribute("transform","translate(0,0)"),i.setAttribute("fill","white"),t.setAttribute("width","8"),t.setAttribute("height","8"),t.setAttribute("id","pattern-stripe"),t.setAttribute("patternUnits","userSpaceOnUse"),t.setAttribute("patternTransform","rotate(45)"),o.setAttribute("id","mask-stripe"),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("fill","url(#pattern-stripe)"),t.appendChild(i),o.appendChild(n),e.setAttribute("id","definitions"),e.appendChild(t),e.appendChild(o),e}addListener(e,t,i,o){let n=t=>
1{("click"===t.type||"keyup"===t.type&&13===t.keyCode)&&o(e)};this.listeners.push({eventType:t,target:i,listener:n}),i.addEventListener(t,n,!1)}getDrawContainer(e){return e&&this.svgObject.querySelector(`#${e}`)||this.svgObject}isStyleName(e){return Object.prototype.hasOwnProperty.call(this.styleNames,e)}createCanvas(e,t){this.width=e,this.height=t,this.svgObject=document.createElementNS(w.svgURI,"svg"),this.svgObject.setAttribute("class","svgGraph"),this.svgObject.setAttribute("width","100%"),this.svgObject.setAttribute("height","100%"),this.svgObject.setAttribute("viewBox",`0 0 ${e} ${t}`),this.svgObject.setAttribute("preserveAspectRatio","none"),this.svgObject.setAttribute("role","group"),this.svgObject.setAttribute("tabindex","0"),this.svgObject.appendChild(this.getMaskDefinition()),this.svgObject.setAttribute("id",this.id.toString())}getCanvas(){return this.svgObject}setCanvas(e){let t=(e.getAttribute("viewBox")||"0 0 0 0").split(" ");this.width=+t[2],this.height=+t[3],this.svgObject=e,this.svgObject.setAttribute("id",this.id.toString())}setDescriptorId(e){let t=this.getDrawContainer(h);t.setAttribute("aria-labelledby",e),t.setAttribute("role","figure")}getWidth(){return this.width}getHeight(){return this.height}rect(e,t,i,o,n,a="",s="",r=null,l,d){let c=document.createElementNS(w.svgURI,"rect"),u=Object.keys(n).map((e=>{if(!this.isStyleName(e))return null;let t=this.styleNames[e],i=n[e];return"fillPattern"===e&&(i=`url(#${i})`),t?`${t}: ${i};`:null})).filter((e=>null!==e)).join("");if(c.setAttribute("x",`${e}`),c.setAttribute("y",`${t}`),c.setAttribute("width",`${i}`),c.setAttribute("height",`${o}`),c.setAttribute("style",u),s&&c.setAttribute("class",s),a&&r){let e=document.createElementNS(w.svgURI,"a");e.appendChild(c),c=e,c.setAttribute("xlink:href","#"),c.setAttribute("role","link"),l?c.setAttribute("aria-describedby",l):c.setAttribute("aria-label",`HOS graph element ${a}`),this.addListener(a,"click",c,r),this.addListener(a,"keyup",c,r)}else c.setAttribute("aria-hidden","true");a&&c.setAttribute("id",a),(d?this.getDrawContainer(d):this.svgObject).appendChild(c)}line(e,t,i,o,n,a=1.5,s){let r=document.createElementNS("http://www.w3.org/2000/svg","line");r.setAttribute("x1",`${e}`),r.setAttribute("y1",`${t}`),r.setAttribute("x2",`${i}`),r.setAttribute("y2",`${o}`),r.setAttribute("stroke",n),r.setAttribute("stroke-width",`${a}`),r.setAttribute("aria-hidden","true"),(s?this.getDrawContainer(s):this.svgObject).appendChild(r)}text(e,t,i,o,n="normal",a="",s="black",r,l){let d=document.createElementNS(w.svgURI,"text"),c=`font-size: ${o}px; font-weight: ${n}; fill: ${s};`;d.setAttribute("style",c),d.setAttribute("x",`${e}`),d.setAttribute("y",`${t}`),d.setAttribute("aria-hidden","true"),d.textContent=i,r&&d.setAttribute("id",r),a&&d.setAttribute("class",a),(l?this.getDrawContainer(l):this.svgObject).appendChild(d)}group(e,t={},i){let o=document.createElementNS(w.svgURI,"g");o.setAttribute("id",e);for(let e in t)o.setAttribute(e,t[e]);(i?this.getDrawContainer(i):this.svgObject).appendChild(o)}pattern(e=0,t=0,i=0,o=0,n="",a){let s=document.createElementNS(w.svgURI,"pattern");s.setAttribute("x",`${e}`),s.setAttribute("y",`${t}`),s.setAttribute("width",`${i}`),s.setAttribute("height",`${o}`),s.setAttribute("patternUnits","userSpaceOnUse"),s.setAttribute("id",n),(a?this.getDrawContainer(a):this.svgObject).appendChild(s)}removeListeners(){this.listeners&&this.listeners.forEach((({target:e,eventType:t,listener:i})=>{e.removeEventListener(t,i,!1)}))}}w.svgURI="http://www.w3.org/2000/svg";class b{constructor(){this.margin=0,this.patterns={},this.clickHandlers=[],this.onClick=e=>{this.clickHandlers.forEach((t=>{let i=this.canvas.getBoundingClientRect();e.x>=t.x1+i.left&&e.y>=t.y1+i.top&&e.x<=t.x2+i.left&&e.y<=t.y2+i.top&&t.handler(t.id)}))}}createCanvas(e,t){this.width=e,this.height=t,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.canvas.setAttribute("width",`${e+this.margin}px`),this.canvas.setAttribute("height",`${t+this.margin}px`),this.canvas.setAttribute("tabindex","0"),this.canvas.addEventListener("click",this.onClick,!1)}getCanvas(){return this.canvas}setCanvas(e){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.width=parseFloat(this.canvas.getAttribute("width")||"0"),this.width=parseFloat(this.canvas.getAttribute("height")||"0")}setLabel(e){this.canvas.setAttribute("aria-label",e)}setDescriptorId(e){this.canvas.setAttribute("aria-labelledby",e)}getWidth(){return this.width-2*this.margin}getHeight(){return this.height-2*this.margin}rect(e,t,i,o,n,a,s,r,l,d){this.ctx.strokeStyle=n.strokeColor||"black",this.ctx.lineWidth=n&&n.strokeWidth?n.strokeWidth/2:1,n.fillColor&&(this.ctx.globalAlpha=n.fillOpacity||1,this.ctx.fillStyle=n.fillColor,this.ctx.fillRect(e+this.margin,t+this.margin,i,o)),n.fillPattern&&(this.ctx.globalAlpha=n.fillOpacity||1,this.ctx.fillStyle=this.patterns[n.fillPattern],this.ctx.translate(e+this.margin,t+this.margin),this.ctx.fillRect(0,0,i,o),this.ctx.translate(-e-this.margin,-t-this.margin)),this.ctx.globalAlpha=1,n.strokeWidth&&this.ctx.strokeRect(e+this.margin,t+this.margin,i,o),a&&r&&this.clickHandlers.push({id:a,x1:e+this.margin,y1:t+this.margin,x2:e+this.margin+i,y2:t+this.margin+o,handler:r})}line(e,t,i,o,n="black",a=1,s){this.ctx.strokeStyle=n,this.ctx.lineWidth=a/2,this.ctx.beginPath(),this.ctx.moveTo(e+this.margin,t+this.margin),this.ctx.lineTo(i+this.margin,o+this.margin),this.ctx.stroke()}text(e,t,i,o,n="normal",a="",s="black",r,l){this.ctx.fillStyle=s,this.ctx.font=`${n} ${o}px Sans-Serif`,this.ctx.fillText(i,e+this.margin,t+this.margin)}pattern(e,t,i,o,n="",a,s){if(!s)return;let r=this.ctx.createPattern(s,"repeat");this.patterns[n]=r}removeListeners(){this.canvas.removeEventListener("click",this.onClick,!1)}}class S{static isCacheMatch(e,t,i,o,n){let a=t.containerWidth||e.clientWidth,s=S.containerWidth===a,r=S.driver===(t.driver||c),l=t.color||u,d=S.colorScheme.innerLineColor===l.innerLineColor&&S.c
1olorScheme.outerLineColor===l.outerLineColor,m=t.xStartPercentage||5,h=S.xStartPercentage===m,y=S.skipHours===t.skipHours,p=S.isBold===t.fontBold,f=S.shortTimeFormat===t.shortTimeFormat,g=S.colsHeaders===i.join(),v=S.rowsQty===o,D=S.legendHeight===n;return s&&r&&d&&y&&h&&p&&f&&g&&v&&D}constructor(e,t,i,o,n){this.grid=null,S.containerWidth=t.containerWidth||e.clientWidth,S.driver=t.driver||c,S.colorScheme=t.color||u,S.xStartPercentage=t.xStartPercentage||5,S.skipHours=t.skipHours,S.isBold=!!t.fontBold,S.shortTimeFormat=t.shortTimeFormat,S.rowsQty=i,S.colsHeaders=o.join(),S.legendHeight=n}set(e){this.grid=e.cloneNode(!0)}get(){return this.grid&&this.grid.cloneNode(!0)}static getInstance(e,t,i,o,n){let a=S.instance&&S.isCacheMatch(e,t,i,o,n)?S.instance:new S(e,t,o,i,n);return S.instance=a,a}}class C{createContainer(){this.el=document.createElement("DIV"),this.el.setAttribute("id",this.id),this.el.setAttribute("class",m),this.el.style.display="none";let e=document.createElement("SPAN");e.setAttribute("role","title"),e.textContent=this.translate("Duty Status Graph and HOS Logs"),this.list=document.createElement("UL"),this.el.appendChild(e),this.el.appendChild(this.list)}addRow(e){let t=document.createElement("LI");t.setAttribute("class",`${m}__item`),t.textContent=e,this.list.appendChild(t)}translateTmpl(e,...t){let i=e.reduce(((e,t,i)=>e+`{${i-1}}`+t.replace(/\s+/gm," ")));return this.translate(i.replace(/(\/r)|(\/n)/gm,"")).replace(/\{(\d)\}/gm,((e,i)=>String(t[Number(i)])))}constructor(e){this.translate=e,this.id=`hosGraphDescriptor_${v()}`,this.createContainer()}addStatusRow(e,t,i){let o=void 0!==t.hours?`${t.hours} ${this.translate("hours")}`:"",n=void 0!==t.minutes?`${t.minutes} ${this.translate("{minutes}m").replace("{minutes}","")}`:"",a=void 0!==t.seconds?`${t.seconds} ${this.translate("seconds")}`:"";this.addRow(this.translateTmpl`Total ${i[e]} duration: ${o} ${n} ${a}`)}pasteInto(e){e.appendChild(this.el)}}const T=30;function x(){let e,t,i,a,s,m=[0,0,0,0,0],v=(e,i,o,n)=>{let a=o||"htt",s=e.getTime(),r=i.getTime(),l=t.options.getLocalDateTime||(e=>"string"==typeof e?new Date(e):e),d=t.data.driverTimeZone,c=s,u=[];for(;c<=r;){let e=l(new Date(c),d).getTime();u.push(e),c+=36e5}return a.indexOf("tt")>-1&&(a=a.replace(":mm ","")),u.map((e=>n(new Date(e),a)))},x=()=>m,k=e=>Math.round(e%1*60||0),M=e=>Math.floor(e),R=()=>{let e=x(),t=e.reduce(((e,t)=>e+t))/36e5,i=[[0,0],[0,0],[0,0],[0,0],[0,0]],o=(e,t)=>{let o=i.reduce(((e,t)=>[e[0]+t[0],e[1]+t[1]]));return Math.round(60*(e-o[0]-t)-o[1])};for(let n=e.length-1;n>=0;n--){let a=e[n]/36e5,s=M(a),r=0;if(n>0)r=k(a);else if(0===n)for(let n=0;n<5;n++)if(e[n]>0){i[n][1]+=o(t,s),0===n&&(r=i[n][1]);break}i[n]=[s,r]}for(let e=0,t=i.length;e<t;e++)60===i[e][1]&&(i[e][1]=0,i[e][0]++);return i},E=function(e=!1,t=!1,i=!1,o=!1,n=!1,a=!1,s){let r={strokeColor:s.outerLineColor,strokeWidth:1};return n&&(r.mask="url(#mask-stripe)"),i?(r.fillColor="red",r.fillOpacity=.5):o?(r.fillColor="#008eff",r.fillOpacity=.5):(r.fillOpacity=.4,r.fillColor=a||e||t?a||e?s.approvedColor:s.modifiedColor:s.outerLineColor),r},A=e=>{switch(e){case"OFF":case"Rest":return"#777772";case"SB":return"#E32943";case"D":return"#328812";case"ON":case"Work":return"#A36B0D";default:return"#4376C8"}},_=e=>{switch(e){case"OFF":return O("Total Off Duty: {0}");case"SB":return O("Total Sleeper Berth: {0}");case"D":return O("Total Drive: {0}");case"ON":return O("Total On Duty: {0}");case"WT":return O("Total Wait time: {0}");case"Work":return O("Total Work: {0}");case"Rest":return O("Total Rest: {0}");default:return`Total ${e} {0}`}},X=(e,t)=>`${e}${O("h")} ${t}${O("{minutes}m").replace("{minutes}","")}`,O=e=>t.options.translate&&t.options.translate(e)||`**${e}`,P=()=>{s&&s.removeListeners(),s="canvas"===(t.options.driver||c)?new b:new w;let x=t.options.isEwd,P=(t.data.data||[]).filter((e=>a.indexOf(e.status)>-1));P.some((e=>"WT"===e.status))&&-1===i.indexOf("WT")&&i.push("WT");let N=i.length,F=v(t.data.fromDate,t.data.toDate,t.options.shortTimeFormat||"htt",t.options.parseDateToString||D),W=F.length-1,$=e.querySelectorAll("svg.svgGraph"),q=t.options.color||u,V=(e,t)=>(t.getTime()-e.getTime())/36e5,G=(e,t)=>e.getTime()-t.getTime()>0,K=(e,t)=>e.getTime()-t.getTime()<0,Y=(e,t)=>
1{if(t.toDate&&K(t.toDate,e.fromDate)||e.toDate&&G(t.fromDate,e.toDate))return null;let i=G(e.fromDate,t.fromDate)?e.fromDate:t.fromDate,o=e.toDate&&t.toDate?K(e.toDate,t.toDate)?e.toDate:t.toDate:e.toDate||t.toDate||new Date;return{fromDate:new Date(i.getTime()),toDate:new Date(o.getTime())}},j=t.options.xStartPercentage||5,Z=(e=>{let t=l(e),i=r.yPositions;return{timesRowTopPercent:i.timesRowTopPercent*t,gridTopPercent:i.gridTopPercent*t}})(i),Q=Z.gridTopPercent,J=t.options.fontScale||4.3,ee=t.options.fontBold?"bold":"normal",te=.87,ie=(e,i,o,n,a,r,l,d,c,u="")=>{let m,h,y=`hos-graph-bar ${u}`,p=V(e,i)*fe;p=p>0?p:1;let g=ye+V(be,e)*fe;return r||l?(m=pe+ge*o+ge*te,h=.13*ge):(m=pe+ge*o+.13*ge,h=.74*ge),function(e,i,o,n,a,r,l,d){let c=r&&t.options.getBarDescriptorId&&t.options.getBarDescriptorId(r,!1);s.rect(e,i,o,n,a,r,l,t.clickHandler||null,c,d)}(g,m,p,h,E(n||!1,a||!1,r,l,c||!1,x,q),d,y,`${f}_${o}`),p},oe=(100-j-8)/W,ne=(100-Q)/N;for(let t=0;t<$.length;t++)e.removeChild($[t]);let ae=function(e){let i=t.options.includeVerified,o=t.options.includeEdited,n=t.options.includePcYm,a=t.options.includeViolations,s=t.options.includeBreaks,r=t.options.includeWorkExemption,l=[];return i&&l.push({labels:[O("Certified")],style:E(!0,!1,!1,!1,!1,x,e),id:"certified"},{labels:[O("Uncertified")],style:E(!1,!1,!1,!1,!1,x,e),id:"uncertified"}),o&&l.push({labels:[O("Edited")],style:E(!1,!0,!1,!1,!1,x,e),id:"edited"}),n&&l.push({labels:[O("Personal Conveyance")],style:E(!1,!1,!1,!1,!0,x,e),id:"pc"},{labels:[O("Yard move")],style:E(!1,!1,!1,!1,!0,x,e),id:"ym"}),a&&l.push({labels:[O("Violation")],style:E(!1,!1,!0,!1,!1,x,e),id:"violation"}),s&&l.push({labels:[O("Qualifying break")],style:E(!1,!1,!1,!0,!1,x,e),id:"q-break"}),r&&l.push({labels:[O("Work Exemption")],style:E(!1,!1,!1,!1,!0,x,e),id:"work-exemption"}),l}(q),se=t.options.containerWidth||e.clientWidth,re=t.options.showLegend?B(se,ae,J):null,le=re?re.height:0;le+=T,e.style.height=`${d(se,i)+le}px`;let de=()=>{let e=t.options.customGraphColors||A;n(s)&&(s.group(h),s.group(y));const a="hos-graph-times";n(s)&&s.group(a,void 0,h),(()=>{let e=n(s)?s:new b,t=`${s.getCanvas().id}_${g}`;if(n(e)?e.pattern(ye+.75,pe,fe,ge,t,"definitions"):e.createCanvas(fe,ge),e.line(fe-.75,0,fe-.75,ge,q.innerLineColor,1,t),!n(e)){let i=e.getCanvas();s.pattern(void 0,void 0,void 0,void 0,t,void 0,i)}})();for(let r=0;r<N;r++){let l=`grid-hos-graph-status_${r}`;n(s)&&(s.group(l,void 0,h),s.group(`${f}_${r}`,void 0,y));let d,c=Z.timesRowTopPercent*me,u=`${s.getCanvas().id}_${g}`;s.rect(ye,pe+r*ge,fe*W,ge,{fillPattern:u,strokeColor:q.innerLineColor,strokeWidth:1},void 0,"hos-graph-status-row",void 0,void 0,l);for(let n=0;n<=W;n++)if(0===r&&(t.options.skipHours&&n%t.options.skipHours!=0||(d=F[n],s.text(ye-ve/2+fe*n-1,c,d,ve/1.3,ee,"graphLabel",q.outerLineColor,void 0,a))),0===n){let t=e(i[r]),n=ge,a=.06*ge,c=.5*ge;d=-1!==o._0.indexOf(i[r])?O(i[r]):i[r];let u=pe+(r+.5)*ge-c/2,m=we(d,ve.toString(),ee);s.rect(0,u,n,c,{fillColor:t,horizontalCornerRadius:a,verticalCornerRadius:a},void 0,void 0,void 0,void 0,l),s.text((n-m)/2,u+.75*c,d,ve,ee,"graphLabel graphStatus","white",void 0,l)}s.rect(ye+W*fe+he,pe+r*ge,6*he||0,ge,{fillColor:q.fillColor},void 0,void 0,void 0,void 0,l)}n(s)&&s.group("hos-graph-situational-driving-highlight",void 0,y),n(s)&&s.group(p,void 0,y)},ce=S.getInstance(e,t.options,F,N,le),ue=ce.get();ue?(n(s),s.setCanvas(ue)):s.createCanvas(se,e.clientHeight);let me=(s.getHeight()-le)/100,he=s.getWidth()/100,ye=Math.floor(he*j),pe=Math.floor(me*Q),fe=Math.floor(he*oe),ge=Math.floor(me*ne),ve=((De=ge)>45?.3*De:.35*De)||0;var De;let we=(e,t,i)=>{let o=document.createElement("span");o.style.fontSize=`${t}px`,o.style.fontWeight=i,o.style.position="absolute",o.style.top="-100px",o.innerHTML=e,document.body.appendChild(o);let n=o.clientWidth;return document.body.removeChild(o),Math.ceil(n)};ue||(de(),ce.set(s.getCanvas())),re&&H(re,ae,pe+N*ge+re.rowGap/2);let be=new Date(t.data.fromDate.toISOString()),Se=new Date(t.data.toDate.toISOString()),Ce=new Date;Se.getTime()>Ce.getTime()&&(Se=Ce);let Te=t.data.renderUntil,xe=Te instanceof Date&&!isNaN(Te.getTime())?Te.getTime():void 0,ke=!1;void 0!==xe&&xe<Se.getTime()&&(Se=new Date(xe),ke=!0);let Me=(e=>{let t=(e||[]).map((e=>Object.assign({},e)));return t.sort(((e,t)=>{let i=e.fromDate,o=t.fromDate;return i.getTime()-o.getTime()})),t})(t.violations),Re=L(t.breaks),Ee=I(ke?P.filter((e=>new Date(e.dateTime).getTime()<Se.getTime())):P,Se),Ae=t.options.includeVerified;Ee.forEach(((e,t)=>{t>0&&((e,t,i)=>
1{let o=ye+V(be,e)*fe,n=pe+ge*t+.13*ge,a=pe+ge*i+.13*ge;s.line(o,n,o,a,q.outerLineColor,1,p)})(e.fromDate,Ee[t-1].index,e.index),ie(e.fromDate,e.toDate,e.index,!Ae||e.isVerified,e.isEdited,!1,!1,e.logId,e.isSituation),function(e,t,i,o,n,a){let s=e,r=null,l=["D","Work","WorkExemption"];if(0!==a.length)do{let d=a[0];for(;d&&d.toDate&&K(d.toDate,s);)a.shift(),d=a[0];if(d&&(r=Y({fromDate:s,toDate:t},{fromDate:d.fromDate,toDate:d.toDate}),r&&r.toDate)){if(r.toDate!==e&&l.indexOf(o)>-1&&(G(r.toDate,r.fromDate)&&ie(r.fromDate,r.toDate,i,!1,!1,!0,!1,n,!1,"violation-bar"),s=r.toDate),!d.toDate||G(d.toDate,r.toDate))break;a.shift()}}while(a.length>0&&r)}(e.fromDate,e.toDate,e.index,e.logStatus,e.logId,Me),function(e,t,o,n,a){let s=e,r=null;if(0!==a.length)do{let l=a[0];for(;l&&l.toDate&&K(l.toDate,s);)a.shift(),l=a[0];if(l&&(r=Y({fromDate:s,toDate:t},{fromDate:l.fromDate,toDate:l.toDate}),r&&r.toDate)){if(r.toDate!==e&&"OFF"===i[o]&&(G(r.toDate,r.fromDate)&&ie(r.fromDate,r.toDate,o,!1,!1,!1,!0,n,!1,"break-bar"),s=r.toDate),!l.toDate||G(l.toDate,r.toDate))break;a.shift()}}while(a.length>0&&r)}(e.fromDate,e.toDate,e.index,e.logId,Re)})),m=Ee.reduce(((e,t)=>{let i=t.toDate.valueOf()-t.fromDate.valueOf();return i<0&&(i=["Work","WorkExemption"].indexOf(t.logStatus)>-1?9e5:0),e[t.index]+=i,e}),m);let _e=new C(O);s.setDescriptorId(_e.id);let[Xe,Oe,Pe]=function(e,t){let o=R(),n=(e,t,i,o)=>e+t*i+o+.13*i,a=(e,t,i)=>e+t*i+.6*i;ve=(e=>.3*e)(ge);for(let r=0;r<N;r++){let l=`${f}_${r}`,d=n(ye,W,fe,he),c=a(pe,r,ge),u=X(o[r][0],o[r][1]);s.text(d,c,u,ve,"bold",void 0,e,void 0,l),t.addStatusRow(r,{hours:o[r][0],minutes:o[r][1]},i)}return[n(ye,W,fe,he),ve,pe+(N-1)*ge+ge]}(q.outerLineColor,_e);(()=>{let e=R();if(e&&i){let t=O("HOS Graph showing:");for(let o=0;o<N;o++){let[n,a]=e[o];t+=` ${_(i[o]).replace("{0}",X(n,a))},`}let o=U();t+=` ${O("Grand total: {0}").replace("{0}",X(M(o),k(o)))}`,s.getCanvas().setAttribute("aria-label",t)}})(),z(Xe,Oe,Pe,q),_e.pasteInto(e),e.appendChild(s.getCanvas())},L=e=>{let t=(e||[]).map((e=>Object.assign({},e)));return t.sort(((e,t)=>{let i=e.fromDate,o=t.fromDate;return i.getTime()-o.getTime()})),t},I=function(e,t){let o=[];for(let n=1;n<=e.length;n++){let a=e[n-1],s=a.status,r=new Date(a.dateTime),l=e[n]?new Date(e[n].dateTime):t,d=!1;"YM"===s?(d=!0,s="ON"):"PC"===s||"PC_Exempted"===s?(d=!0,s="OFF"):"WorkExemption"===s&&(d=!0,s="Work"),o.push({fromDate:r,toDate:l,logStatus:s,index:i.indexOf(s),isVerified:!!a.verifyDateTime,isEdited:!!a._isEdited,logId:a.id,isSituation:d})}return o},N=function(){void 0!==t&&s&&s.removeListeners()},B=(e,t,i)=>{let o=.002*e*i*(e<700?1.5:1),n=.5*o,a=1.5*o,s=(e=>{let i=W(t),o=document.createElement("span");o.style.fontSize=`${e}px`,o.style.position="absolute",o.style.top="-100px",o.innerHTML=i.toUpperCase(),document.body.appendChild(o);let n=o.clientWidth;return document.body.removeChild(o),Math.ceil(n)})(o)+n+a+o,r=Math.floor(e/s),l=o,d=Math.ceil(t.length/r),c=1.5*o,u=t.reduce(((e,t,i,o)=>{let n=e,a=i*r,s=o.slice(a,a+r);return n+F(s)}),0);return{width:e,fontSize:o,rectSide:a,spaceBetween:n,leftMargin:.05*e,rowGap:c,rowInterval:l,labelsInterval:1.2*l,columnInterval:s,columns:r,labelRows:Math.ceil(t.length/r),rows:u,height:u*l+c*d}},F=e=>e.reduce(((e,t)=>{let i=Array.isArray(t)?t.length:t.labels.length;return e<i?i:e}),0),W=e=>{let t=e=>e.reduce(((e,i)=>"string"!=typeof i?e.concat(t(Array.isArray(i)?i:i.labels)):(e.push(i),e)),[]);return t(e).reduce(((e,t)=>e.length<t.length?t:e))},H=(e,i,o)=>{let n=((e,t)=>{let i=[];for(let o=0;o<e.length;o+=t.columns)i.push(e.slice(o,o+t.columns));return i})(i,e);((e,i,o)=>{let n=1;e.forEach(((e,a)=>{let r=F(e);e.forEach(((e,l)=>{let d=e.labels.length;e.labels.forEach(((c,u)=>{let m=(r-d)*i.rowInterval/2,h=t.options.fontBold?"bold":"normal",y=i.spaceBetween+i.rectSide+l*i.columnInterval+i.leftMargin,p=o+n*i.rowInterval+u*i.labelsInterval+a*i.rowGap+m;s.text(y,p,c.toUpperCase(),i.fontSize,h,"graphLabel",e.style.strokeColor,`legend-${e.id}-label`)}))})),n+=F(e)}))})(n,e,o+T),((e,t,i)=>{let o=0;e.forEach(((e,n)=>{let a=F(e);e.forEach(((e,r)=>{let l=(a-1)*t.rowInterval/2,d=r*t.columnInterval+t.leftMargin,c=i+o*t.rowInterval+n*t.rowGap+l;s.rect(d,c,t.rectSide,t.rectSide,e.style,`legend-${e.id}-rect`)})),o+=F(e)}))})(n,e,o+T)},U=()=>x().reduce(((e,t)=>e+t))/36e5,z=(e,t,i,o)=>{let n=U();s.line(e,i,s.getWidth()-20,i,o.outerLineColor,2,h),s.text(e,i+1.2*t,X(M(n),k(n)),t,"bold","graphLabel",o.outerLineColor,"bar-hos-graph-status_totalHours",h)};return{createGraph:(o,n,s={},l,d=[],h=[])=>{N(),m=[0,0,0,0,0],t={data:n,violations:s.includeViolations?d:[],breaks:s.includeBreaks?h:[],clickHandler:l,options:Object.assign(Object.assign({},{statuses:[...r.rowStatuses],allStatuses:[...r.allowedStatuses],isEwd:!1,driver:c,color:u,xStartPercentage:5,showLegend:!0,getLocalDateTime:e=>"string"==typeof e?new Date(e):e}),s)}
1,e=o,i=t.options.statuses||[],a=t.options.allStatuses||[],P()},removeHandlers:N,graphState:i=>{if(null!=i){let o=e.querySelectorAll("svg.svgGraph");if(m=[0,0,0,0,0],1!==o.length)throw 0===o.length?new Error(O("No graph found.")):new Error(O("More than one graph in the same container"));t=i,P()}return t},getStatusCounters:x,getTotalHours:U,getHoursAndMinutesFromStatusCounters:R}}let k=["No graph found.","More than one graph in the same container","Total {0} duration: {1} {2} {3}","Duty Status Graph and HOS Logs","h","{minutes}m","hours","seconds","HOS Graph showing:","Total Off Duty: {0}","Total Sleeper Berth: {0}","Total Drive: {0}","Total On Duty: {0}","Total Wait time: {0}","Total Work: {0}","Total Rest: {0}","Grand total: {0}"]},71372(e,t,i){i.d(t,{$D:()=>vt,$L:()=>Ze,AM:()=>_,Al:()=>y,Bn:()=>we,C1:()=>de,CU:()=>Ne,Cb:()=>it,DP:()=>ct,DU:()=>Rt,FL:()=>dt,G1:()=>ze,Gx:()=>Ue,Hn:()=>De,Ih:()=>Te,Io:()=>tt,JQ:()=>ae,Jy:()=>ut,K1:()=>L,L6:()=>st,Mn:()=>Pe,N0:()=>pe,N2:()=>kt,NM:()=>Je,O0:()=>et,OS:()=>ie,Or:()=>H,PE:()=>w,PN:()=>Ge,Pp:()=>wt,Pv:()=>qe,QW:()=>Y,Qs:()=>Se,RG:()=>q,SZ:()=>St,Ti:()=>te,U0:()=>x,U4:()=>Qe,UE:()=>J,UF:()=>m,VZ:()=>Ee,Vz:()=>Ke,W8:()=>l,W_:()=>W,XF:()=>at,ZA:()=>ft,ZY:()=>U,Zf:()=>X,Zv:()=>B,_0:()=>g,_8:()=>fe,_K:()=>oe,_P:()=>Be,_T:()=>ge,_s:()=>k,a2:()=>Le,aG:()=>xt,aR:()=>ve,bE:()=>Ve,bh:()=>I,bt:()=>C,c0:()=>Xe,c2:()=>se,c5:()=>re,cl:()=>nt,cm:()=>c,dq:()=>mt,e5:()=>Fe,e6:()=>Et,eT:()=>_e,eX:()=>h,ed:()=>Ct,ev:()=>Dt,f3:()=>gt,fS:()=>Ae,fz:()=>ne,gN:()=>E,gR:()=>Mt,hl:()=>rt,io:()=>f,ix:()=>Re,j:()=>We,jU:()=>He,kD:()=>Ie,kQ:()=>M,l$:()=>$,lv:()=>u,mU:()=>R,n6:()=>lt,nG:()=>Me,nI:()=>ke,nJ:()=>yt,nL:()=>z,nQ:()=>P,oI:()=>be,oP:()=>d,oU:()=>ht,oZ:()=>ot,pW:()=>v,qJ:()=>ye,qi:()=>N,qn:()=>p,rT:()=>Z,s5:()=>O,sV:()=>V,sn:()=>Ce,tF:()=>pt,tb:()=>j,tl:()=>Ye,uy:()=>xe,vS:()=>D,wg:()=>T,xn:()=>Q,yB:()=>S,ym:()=>bt,zf:()=>b});var o=i(43376),n=i(50780),a=i(26157),s=i(67620);const r=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*))(?:Z|(\+|-)([\d|:]*))?$/;var l;!function(e){e.DayOne="1",e.DayTwo="2",e.None="0"}(l||(l={}));const d=["OFF","SB","PC","PC_Exempted","WT"],c=["ON","D","YM"],u=["DrivingWhileInExemption","DrivingStoppedWhileInExemption"],m=["YM","PC"],h=6e4,y=60*h,p=24*y,f=["ON","OFF","D","SB"],g=f.concat(["YM","PC","PC_Exempted","WT"]),v=["Authority"],D=["Exemption16H","AdverseWeather","ExemptionOffDutyDeferral","RailroadExemption","ExemptionReducedRest","EmergencyResponseExemptionEnabled","EmergencyResponseExemptionDisabled"],w=["INT_D","INT_PC","INT_CoDriver"],b=D.concat(["Connected","Disconnected"]),S=["Login","Logoff","Certify","EnginePowerup","EngineShutdown","EnginePowerupPC","EngineShutdownPC","PowerCompliance","EngineSyncCompliance","TimingCompliance","PositioningCompliance","DataRecordingCompliance","DataTransferCompliance","OtherCompliance","MissingElementCompliance","UnidentifiedDrivingCompliance","SituationalDrivingClear","MaxPCLimitReached","DrivingWhileInExemption","DrivingStoppedWhileInExemption"],C=["CanadaCycleOne","CanadaCycleTwo","OperatingZoneCanadaSouthOf60","OperatingZoneCanadaNorthOf60","OperatingZoneAmerica"],T=["Work","Rest"],x=T.concat(["WorkExemption"]),k=g.concat(x),M=["AustraliaStandardHoursSoloExemptionHours"],R=["HosRuleSetCanadaCycleOne","HosRuleSetCanadaCycleTwo","HosRuleSetCanadaCycleOneTeam","HosRuleSetCanadaCycleTwoTeam","HosRuleSetCanadaNorthOf60CycleOne","HosRuleSetCanadaNorthOf60CycleTwo","HosRuleSetCanadaNorthOf60CycleOneTeam","HosRuleSetCanadaNorthOf60CycleTwoTeam","HosRuleSetCanadaOil","HosRuleSetCanadaNorthOf60Oil","HosRuleSetCanadaOilTeam","HosRuleSetCanadaNorthOf60OilTeam","HosRuleSetCanadaBCLoggingTruck","HosRuleSetAlberta"],E=["D","ON","INT_D","EnginePowerup","EngineShutdown"],A=["EnginePowerup","EngineShutdown","EnginePowerupPC","EngineShutdownPC"],_=["PowerCompliance","EngineSyncCompliance","TimingCompliance","PositioningCompliance","DataRecordingCompliance","DataTransferCompliance","OtherCompliance","MissingElementCompliance","UnidentifiedDrivingCompliance"],X=75,O=g.concat(v).concat(w).c
1oncat(b).concat(S),P=["HosRuleSetNone","HosRuleSetNone8Day","HosRuleSetNoneCanada","HosRuleSetNoneCanadaNorthOf60"];function L(e,t,i=!1){if("string"==typeof e){let o=e.replace("HosRuleSet",""),n=(0,a.ZV)(i)[o];return t(n?n.name:o)}return t(e.name)}function I(e,t){let i=t(e);return i.getFullYear()+"-"+(i.getMonth()+1)+"-"+i.getDate()}function N(e,t,i){let o=i(e),n=i(t),a=e=>e.getTime()-36e5*e.getHours()-6e4*e.getMinutes()-1e3*e.getSeconds()-e.getMilliseconds();return Math.round(Math.abs((a(o)-a(n))/p))}function B(e,t,i,o=0){let n=F(e,t,i,o),a=F(n,t,i,1);return n.getTime()===a.getTime()?F(e,t,i,o,!0):n}function F(e,t,i,o=0,n=!1){let a=t(e);return i(new Date(a.getFullYear(),a.getMonth(),a.getDate()+o,n?1:0))}function W(e,t,i){return B(e,t,i,1)}const H=e=>W(e.nextDate,e.toLocalTime,e.toUtcTime).getTime()-e.nextDate.getTime();function U(e,t,i,o){return e.getTime()<o.getTime()&&i.getTime()<t.getTime()}function z(e,t,i,o){const n=Math.max(e.getTime(),i.getTime()),a=Math.min(t.getTime(),o.getTime());return n<a?{fromDate:new Date(n),toDate:new Date(a)}:void 0}function $(e,t){return t.cycle&&t.cycle.cycleStatuses&&1===t.cycle.cycleStatuses.length&&"D"===t.cycle.cycleStatuses[0]?e.driveCount:e.onDutyCount}function q(e,t=!1){var i,o,n;let a={hosRecap:[],hosCycleAvailabilities:void 0};if(0===e.cycle.days)return a;let s=[],r=e.config.cycle&&e.config.cycle.cycleStatuses&&1===e.config.cycle.cycleStatuses.length&&"D"===e.config.cycle.cycleStatuses[0],l=e.config.cycle&&e.config.cycle.cycleDays;if(!l)return a;let d=t?0:e.days.length-e.cycle.days,c=e.days[d];for(;c;)s.push({dateTime:c.date,duration:r?c.driveCount:c.onDutyCount}),c=e.days[++d];a.hosRecap=s.map((e=>({dateTime:e.dateTime,duration:qe(e.duration)})));let u=e.cycle.cycleMaximum||(null===(i=e.config.cycle)||void 0===i?void 0:i.cycleMaximum);if(!s||0===s.length||!u)return a;let m=[],h=s.map((e=>e.duration)),y=h.reduce(((e,t)=>e+t)),p=new Date(s[s.length-1].dateTime.getTime());for(;h.length<l;)h.unshift(0);for(let t of h)if(p=new Date(p.getTime()),p.setDate(p.getDate()+1),y-=t,(null===(o=e.config.cycle)||void 0===o?void 0:o.cycleMaximum)&&e.cycle.toDate&&p.getTime()>(null===(n=e.cycle.toDate)||void 0===n?void 0:n.getTime())&&(u=e.config.cycle.cycleMaximum),m.push({dateTime:p,available:qe(M
1ath.max(0,u-y))}),y<=0)break;return a.hosCycleAvailabilities=m,a}function V(e,t=!1){var i,o,n;let a={hosRecap:[],hosCycleAvailabilities:void 0};if(0===e.cycle.days)return a;let s=e.config.cycle&&e.config.cycle.cycleStatuses&&1===e.config.cycle.cycleStatuses.length&&"D"===e.config.cycle.cycleStatuses[0],r=null===(i=e.config.cycle)||void 0===i?void 0:i.cycleDays,l=!!(null===(o=e.config.cycle)||void 0===o?void 0:o.nonRolling);if(!r)return a;let d=Math.max(0,t?0:e.days.length-(e.cycle.days+(l?0:r))),c=e.days.slice(d,e.days.length).map((e=>({dateTime:e.date,duration:s?e.driveCount:e.onDutyCount}))),u=e.cycle.cycleMaximum||(null===(n=e.config.cycle)||void 0===n?void 0:n.cycleMaximum)||0,m=0,h=0;for(;m<c.length;){let e=c[m];h+=e.duration,!l&&m>=r&&(h-=c[m-r].duration),e.cycleTotal=h,u>0&&(e.cycleRemaining=u-h),m++}return t||(c=c.slice(-e.cycle.days)),{hosRecap:c.map((e=>{let t={dateTime:e.dateTime,duration:qe(e.duration)};return void 0!==e.cycleTotal&&(t.cycleTotal=qe(e.cycleTotal)),void 0!==e.cycleRemaining&&(t.cycleRemaining=qe(e.cycleRemaining)),t})),hosCycleAvailabilities:l?G(e,u):K(e,c)}}function G(e,t){var i;if(!t)return;let o=null===(i=e.config.cycle)||void 0===i?void 0:i.cycleDays,n=o&&e.cycle.days>o?0:Math.max(0,t-$(e.cycle,e.config)),a=e.days[e.days.length-1];if(!a)return;let s=new Date(a.date.getTime());return s.setDate(s.getDate()+1),[{dateTime:s,available:qe(n),gain:qe(0)}]}function K(e,t){var i,o,n,a;let s=null===(i=e.config.cycle)||void 0===i?void 0:i.cycleDays,r=e.cycle.cycleMaximum||(null===(o=e.config.cycle)||void 0===o?void 0:o.cycleMaximum);if(!t||0===t.length||!s||!r)return;let l=t.map((e=>e.duration));const d=s-l.length;d>0&&(l=new Array(d).fill(0).concat(l));let c=[],u=new Date(t[t.length-1].dateTime.getTime()),m=l.reduce(((e,t)=>e+t));c.push({dateTime:u,available:Math.max(0,r-m)});for(let t of l){u=new Date(u.getTime()),u.setDate(u.getDate()+1),m-=t,(null===(n=e.config.cycle)||void 0===n?void 0:n.cycleMaximum)&&e.cycle.toDate&&u.getTime()>(null===(a=e.cycle.toDate)||void 0===a?void 0:a.getTime())&&(r=e.config.cycle.cycleMaximum);let i=Math.max(0,r-m);if(c.push({dateTime:u,available:i}),m<=0)break}for(let e=1;e<c.length;e++){let t=c[e],i=c[e-1];t.diff=t.available-i.available}return c.splice(1).map((e=>{var t;return{dateTime:e.dateTime,available:qe(e.available),gain:qe(null!==(t=e.diff)&&void 0!==t?t:0)}}))}function Y(e,t=!1){var i,o;let n=je(e);return-1===M.indexOf(n)&&!!(null===(o=null===(i=(0,a.ZV)(t)[n])||void 0===i?void 0:i.config)||void 0===o?void 0:o.exempt)}function j(e,t){for(let i=e.length-1,o=0;i>=o;i--)if(e[i].status===t)return e[i]}function Z(e,t=!1){let i=Ye(e,t);return!(!i||!i.config.customStartOfDay)}new Set(["CanadaCycleOne","CanadaCycleTwo","CanadaCycleOneTeam","CanadaCycleTwoTeam","CanadaNorthOf60CycleOne","CanadaNorthOf60CycleTwo","CanadaNorthOf60CycleOneTeam","CanadaNorthOf60CycleTwoTeam","CanadaOil","CanadaOilTeam","CanadaBCLoggingTruck"]);function Q(e=!1){let t={},i=(0,a.ZV)(e);for(let e in i)i.hasOwnProperty(e)&&(t[e]=i[e]);return t}class J{constructor(e,t,i){this.dateTime=new Date,this.hosRuleSet={id:"HosRuleSetNone"},"string"==typeof e?e&&(this.hosRuleSet={id:e}):e&&(this.id=e.id,this.user=e.user?Object.assign({},e.user):void 0,this.dateTime=e.dateTime,this.hosRuleSet=Object.assign({},e.hosRuleSet),this.startOfDay=e.startOfDay),i&&(this.user={id:i}),t&&!this.startOfDay&&Z(je(this.hosRuleSet.id))&&(this.startOfDay=t||"00:00:00"),Z(je(this.hosRuleSet.id))&&(this.startOfDay=t||this.startOfDay||"00:00:00")}toJSON(){return{id:this.id,user:Object.assign({},this.user),hosRuleSet:Object.assign({},this.hosRuleSet),dateTime:this.dateTime,startOfDay:this.startOfDay}}}let ee=function(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[e[i]]=i);return t};function te(e,t){return!((e&&e.hosRuleSet.id)===(t&&t.hosRuleSet.id)&&e.startOfDay===t.startOfDay)}function ie(e){return e in ce||e in ue}function oe(e){return e in me||e in he}function ne(e){return"string"==typeof e&&-1!==e.indexOf("OilTransport")}function ae(e){return ne(e)?ue[e]:e}function se(e){return"string"==typeof e&&-1!==e.indexOf("OilWell")}function re(e){return se(e)?he[e]:e}var le={cycle:{shortString:"HourCycleOnDutyLimitViolation",longString:"Maximum {0} hour(s) on duty in {1} days violation"},cycleDriving:{shortString:"HourCycleDrivingLimitViolation",longString:"Maximum {0} hour(s) driving in {1} days violation"},rest:{shortString:"HourRestLimitViolation",longString:"Driving without required break after {0}-hour driving violation"},dailyRest:{shortString:"HourDailyRestLimitViolation",longString:"Minimum {0}-hour rest per day violation"},driving:{shortString:"HourDrivingLimitViolation",longString:"Maximum {0}-hour driving limit violation"},dailyDriving:{shortString:"HourDailyDrivingLimitViolation",longString:"Maximum {0} hour(s) driving per day violation"},duty:{shortString:"HourOnDutyLimitViolation",longString:"Maximum {0}-hour on-duty limit violation"},dailyDuty:{shortString:"HourDailyOnDutyLimitViolation",longString:"Maximum {0} hour(s) on-duty per day violation"},dailyOff:{shortString:"HourDailyOffLimitViolation",longString:"Minimum {0}-hour off-duty per day violation"},workday:{shortString:"HourWorkdayLimitViolation",longString:"Maximum {0}-hour workday limit violation"},dutySinceCycleRest:{shortString:"DutySinceCycleRestViolation",longString:"Maximum {0} hour(s) on-duty since cycle rest violation."},cycleRest:{shortString:"CycleRestViolation",longString:"Driving without {0} period(s) of {1}-hour consecutive off-duty in the preceding {2} days."},australiaWorkHours:{shortString:"AustraliaWorkViolationHours",longString:"Work time violation. Exceeded the Work limit for the peri
1od of {0} hours."},australiaWorkDays:{shortString:"AustraliaWorkViolationDays",longString:"Work time violation. Exceeded the Work limit for the period of {0} days."},australiaRestHours:{shortString:"AustraliaRestViolationHours",longString:"Rest violation. Insufficient Rest for the period of {0} hours."},australiaRestDays:{shortString:"AustraliaRestViolationDays",longString:"Rest violation. Insufficient Rest for the period of {0} days."},australiaWorkExemption:{shortString:"AustraliaWorkExemptionViolation",longString:"Work Exemption violation"},cycleEnd:{shortString:"CycleEndViolation",longString:"Driving after {0}-day cycle period expiration violation"}};function de(e,t=(e=>e),i=!1){const o=e.periodsLimit||"",n=e.hoursLimit||"",a=e.daysLimit||"",[s,r]=function(e){let t="0",i=e.hoursLimit?"hours":"days";if(e.hoursLimit){let i=Math.floor(e.hoursLimit),o="";60*e.hoursLimit%60==30&&(o=" 1/2"),t=`${i}${o}`}else e.daysLimit&&(t=`${e.daysLimit}`);return[t,i]}(e);let l=e=>e[i?"shortString":"longString"];switch(e.type){case"Cycle":return t(l(le.cycle)).replace("{0}",`${n}`).replace("{1}",`${a}`);case"Workday":return t(l(le.workday)).replace("{0}",`${n}`);case"Duty":return t(l(le.duty)).replace("{0}",`${n}`);case"DailyDuty":return t(l(le.dailyDuty)).replace("{0}",`${n}`);case"Driving":return t(l(le.driving)).replace("{0}",`${n}`);case"DailyDriving":return t(l(le.dailyDriving)).replace("{0}",`${n}`);case"Rest":return t(l(le.rest)).replace("{0}",`${n}`);case"DailyRest":return t(l(le.dailyRest)).replace("{0}",`${n}`);case"DailyOff":return t(l(le.dailyOff)).replace("{0}",`${n}`);case"DutySinceCycleRest":return t(l(le.dutySinceCycleRest)).replace("{0}",`${n}`);case"CycleRest":return t(l(le.cycleRest)).replace("{0}",`${o}`).replace("{1}",`${n}`).replace("{2}",`${a}`);case"EwdRest":return t(l("hours"===r?le.australiaRestHours:le.australiaRestDays)).replace("{0}",s);case"EwdWork":return t(l("hours"===r?le.australiaWorkHours:le.australiaWorkDays)).replace("{0}",s);case"EwdWorkExemption":return t(l(le.australiaWorkExemption));case"CycleDriving":return t(l(le.cycleDriving)).replace("{0}",`${n}`).replace("{1}",`${a}`);case"CycleEnd":return t(l(le.cycleEnd)).replace("{0}",`${a}`);default:return""}}var ce={HosRuleSetAmerica7Day:"HosRuleSetOilTransport7Day",HosRuleSetAmerica7DayBig:"HosRuleSetOilTransport7DayBig",HosRuleSetAmerica8Day:"HosRuleSetOilTransport8Day",HosRuleSetAmerica8DayBig:"HosRuleSetOilTransport8DayBig",HosRuleSetAmericaShortHaul:"HosRuleSetOilTransportShortHaul",HosRuleSetAmericaShortHaul8Day:"HosRuleSetOilTransportShortHaul8Day",HosRuleSetAmericaShortHaul14hrWorkday:"HosRuleSetOilTransportShortHaul14hrWorkday",HosRuleSetAmericaShortHaul8Day14hrWorkday:"HosRuleSetOilTransportShortHaul8Day14hrWorkday",HosRuleSetAmericaTexas:"HosRuleSetOilTransportTexas",HosRuleSetAmericaNoRestRequirement7Day:"HosRuleSetOilTransportNoRestRequirement7Day",HosRuleSetAmericaNoRestRequirement7DayBig:"HosRuleSetOilTransportNoRestRequirement7DayBig",HosRuleSetAmericaNoRestRequirement8Day:"HosRuleSetOilTransportNoRestRequirement8Day",HosRuleSetAmericaNoRestRequirement8DayBig:"HosRuleSetOilTransportNoRestRequirement8DayBig",HosRuleSetCalifornia8day:"HosRuleSetOilTransportCalifornia8day",HosRuleSetCaliforniaProperty:"HosRuleSetOilTransportCaliforniaProperty",HosRuleSetAmerica7DaySleeper:"HosRuleSetOilTransport7DaySleeper",HosRuleSetAmerica7DayBigSleeper:"HosRuleSetOilTransport7DayBigSleeper",HosRuleSetAmerica8DaySleeper:"HosRuleSetOilTransport8DaySleeper",HosRuleSetAmerica8DayBigSleeper:"HosRuleSetOilTransport8DayBigSleeper",HosRuleSetAmericaNoRestRequirement7DaySleeper:"HosRuleSetOilTransportNoRestRequirement7DaySleeper",HosRuleSetAmericaNoRestRequirement7DayBigSleeper:"HosRuleSetOilTransportNoRestRequirement7DayBigSleeper",HosRuleSetAmericaNoRestRequirement8DaySleeper:"HosRuleSetOilTransportNoRestRequirement8DaySleeper",HosRuleSetAmericaNoRestRequirement8DayBigSleeper:"HosRuleSetOilTransportNoRestRequirement8DayBigSleeper"},ue=ee(ce),me={HosRuleSetAmerica7Day:"HosRuleSetOilWell7Day",HosRuleSetAmerica7DayBig:"HosRuleSetOilWell7DayBig",HosRuleSetAmerica8Day:"HosRuleSetOilWell8Day",HosRuleSetAmerica8DayBig:"HosRuleSetOilWell8DayBig",HosRuleSetAmericaTexas:"HosRuleSetOilWellTexas",HosRuleSetAmericaNoRestRequirement7Day:"HosRuleSetOilWellNoRestRequirement7Day",HosRuleSetAmericaNoRestRequirement7DayBig:"HosRuleSetOilWellNoRestRequirement7DayBig",HosRuleSetAmericaNoRestRequirement8Day:"HosRuleSetOilWellNoRestRequirement8Day",HosRuleSetAmericaNoRestRequirement8DayBig:"HosRuleSetOilWellNoRestRequirement8DayBig",HosRuleSetCalifornia8day:"HosRuleSetOilWellCalifornia8day",HosRuleSetCaliforniaProperty:"HosRuleSetOilWellCaliforniaProperty",HosRuleSetAmerica7DaySleeper:"HosRuleSetOilWell7DaySleeper",HosRuleSetAmerica7DayBigSleeper:"HosRuleSetOilWell7DayBigSleeper",HosRuleSetAmerica8DaySleeper:"HosRuleSetOilWell8DaySleeper",HosRuleSetAmerica8DayBigSleeper:"HosRuleSetOilWell8DayBigSleeper",HosRuleSetAmericaNoRestRequirement7DaySleeper:"HosRuleSetOilWellNoRestRequirement7DaySleeper",HosRuleSetAmericaNoRestRequirement7DayBigSleeper:"HosRuleSetOilWellNoRestRequirement7DayBigSleeper",HosRuleSetAmericaNoRestRequirement8DaySleeper:"HosRuleSetOilWellNoRestRequirement8DaySleeper",HosRuleSetAmericaNoRestRequirement8DayBigSleeper:"HosRuleSetOilWellNoRestRequirement8DayBigSleeper"},he=ee(me);function ye(e){return ne(e)?ue[e]:ie(e)?ce[e]:e}function pe(e){return se(e)?he[e]:ie(e)?me[e]:e}function fe(e=!1){let t={},i=(0,a.ZV)(e);for(let e in i)i.hasOwnProperty(e)&&(t[e]=i[e].name);return t}function ge(e){return"Requested"===e.state}function ve(e){return!(function(e){return!e.driver||"string"!=typeof e.driver&&"NoUserId"===e.driver.id||!!e.requestedEdit&&"Active"===e.requestedEdit.state&&!!e.requestedEdit.driver&&"string"!=typeof e.requestedEdit.driver&&"NoUserId"===e.requestedEdit.driver.id}(e)||function(e){return"Remove"===e.modified||"Inactive"===e.state||"Rejected"===e.state}(e)||_e(e)||De(e)||function(e){return ge(e)||!!e.requestedEdit&&!function(e){return e.isTransitioning}(e)&&("Requested"===e.requestedEdit.state||"Transitioning"===e.requestedEdit.state)}(e))}function De(e){return _.indexOf(e.status)>-1}function we(e){return["Certify"].indexOf(e.status)>-1}function be(e){return["Login","Logoff"].indexOf(e.status)>-1}function Se(e){return!!e.annotations&&e.annotations.length>0}function Ce(e){return C.some((t=>t===e.status))}function Te(e){return b.some((t=>t===e.status))||"RuleSetChange"===e.status}function xe(e){return v.some((t=>t===e.status))}function ke(e,t){return Me(e)&&(t||!ge(e))}function Me(e){return k.some((t=>t===e.status))}function Re(e){return D.some((t=>t===e.status))}
1function Ee(e){return A.some((t=>t===e.status))}function Ae(e){return x.some((t=>t===e.status))}function _e(e){return w.some((t=>t===e.status))}function Xe(e){return!k.concat(D).concat(v).some((t=>t===e.status))}const Oe=["MotionStopped","HosEnabled","HosDisabled","MaxPCLimitReached","Authority","RailroadExemption","WorkExemption","AdverseWeather","ExemptionReducedRest","Exemption16H","DrivingWhileInExemption","DrivingStoppedWhileInExemption","EmergencyResponseExemptionEnabled","EmergencyResponseExemptionDisabled"].concat(["Connected","Disconnected","WT","Work","Rest"]);function Pe(e){return!Oe.some((t=>t===e.status))}function Le(e,t=!1){let i="HosRuleSet",o=e;0===o.indexOf(i)&&(o=o.replace(i,""));let n=(0,a.ZV)(t);return n[o]?n[o].name:o}function Ie(e,t=!1){if(e){let i=(0,a.ZV)(t)[e];return i&&i.config&&i.config.logRetentionDays||a.Dz}return a.Dz}function Ne(e,t=!1){var i;if(!e)return a.Dz;return null===(i=("string"==typeof e?(0,a.ZV)(t)[e]:e).config.cycle)||void 0===i?void 0:i.cycleDays}function Be(e){return e&&e.indexOf("CanadaNorthOf60")>-1?"2":e&&(e.indexOf("Canada")>-1||e.indexOf("Alberta")>-1)?"1":e?"3":""}function Fe(e,t=!1){let i="string"==typeof e?(0,a.ZV)(t)[e]:e,o=0;if(!i)return 0;let n=i.config;return n.workday&&n.workday.workdayMaximum&&(o=n.workday.workdayMaximum/y),o}function We(e,t=!1,i=!1){let o="string"==typeof e?(0,a.ZV)(i)[e]:e,n={recap:[]};if(o){let e=o.config;return e.rest&&(e.rest.betweenRestLimit?n.rest=qe(e.rest.betweenRestLimit):e.rest.dailyRestMinimum&&(n.rest=qe(24*y-e.rest.dailyRestMinimum))),e.cycle&&(e.cycle.cycleMaximum&&(n.cycle=qe(e.cycle.cycleMaximum)),e.cycle.cycleDrivingMaximum&&(n.cycleDriving=qe(e.cycle.cycleDrivingMaximum)),e.cycle.dutyMaximumSinceCycleRest&&(n.dutySinceCycleRest=qe(e.cycle.dutyMaximumSinceCycleRest)),e.cycle.cycleRestDays&&(n.cycleRest=qe(e.cycle.cycleRestDays*p))),e.workday&&(e.workday.dutyMaximum&&(n.duty=qe(e.workday.dutyMaximum)),e.workday.workdayMaximum&&(n.workday=qe(e.workday.workdayMaximum)),e.workday.driveMaximum&&(n.driving=qe(e.workday.driveMaximum))),function(e,t,i=!1){if(!t.daily)return e;const o=i?2:1;t.daily.driveMaximum&&(e.dailyDriving=qe(t.daily.driveMaximum*o));t.daily.dutyMaximum&&(e.dailyDuty=qe(t.daily.dutyMaximum*o));t.daily.offDutyMinimum&&(e.dailyOff=qe(t.daily.offDutyMinimum*o))}(n,e,t),n}return n}function He(e){return{violations:[],availability:We(e),cycleSummaries:[]}}function Ue(){return R}const ze={enableAutoCreateNoneDeferralLog:!1,enablePreventSplitCompleteWhenViolationFix:!1,disableRemoveOrTrimViolationsAfter16hException:!1,disableUnfreezeSBSplitNotCompleteFix:!1,disableExemptionLogsInteractionRefactor:!1,disableOngoingViolationRulesetFix:!1,disableMergeOverlappingRestInfoFix:!1,disableCycleRestartUsedInFollowingValidations:!1,disablePrevCycleRestDurationCountingFix:!1,disableDeferralRestSubtractionFix:!1,disableErrRestReconciliationFix:!1,disableDstDailyAvailabilityFix:!1,disableUsaPropertySplitPairingReuseFix:!1,enableUsaPreventWorkdayResetPairingForward:!1,enableCanadaViolationRecalculatesWorkdayFix:!1,enableCanadaViolationPreventsNewFreezeFix:!1,disableNonSplitAvailability:!1,disableTexasShortHaulRulesetCorrection:!1,disableCycleResetPeriod:!1,enableEmergencyResponseExemption:!1};function $e(e,t){let i=e;for(;i.length<t;)i="0"+i;return i}function qe(e,t=!1){if(!t&&e<=0)return"00:00:00";let i=e/1e3,o=i/60,n=o/60,a=~~(e%1e3),s=~~(i%60),r=~~(o%60),l=~~(n%24),d=~~(n/24),c=0===d?"":`${d.toString()}.`,u=0===a?"":`.${$e(a.toString(),3)}`;return`${c}${$e(l.toString(),2)}:${$e(r.toString(),2)}:${$e(s.toString(),2)}${u}`}function Ve(e,t=2){if(e<=0)return`${$e("0",t)}:00`;let i=e/1e3/60,o=~~(i%60);return`${$e((~~(i/60)).toString(),t)}:${$e(o.toString(),2)}`}function Ge(e){let t=0,i="string"==typeof e?e:e.toString(),o="-"===i.charAt(0);o&&(i=i.slice(1));let n,a=i.split(":"),s=a[0],r=parseInt(a[1],10),l=(a[2]||"0.0").split("."),d=parseInt(l[0],10);if(2===l.length){let e=l[1].concat("000");n=parseInt(e.substring(0,3),10)||0}else n=0;let c,u=s.split(".");return 2===u.length?(t=parseInt(u[0],10),c=parseInt(u[1],10)):c=parseInt(s,10),(o?-1:1)*(1e3*(60*(60*(24*t+c)+r)+d)+n)}function Ke(e){return{type:e.type,fromDate:e.fromDate,toDate:e.toDate,logId:e.logId,reason:e.reason,drivingDuration:e.drivingDuration,hoursLimit:e.hoursLimit,daysLimit:e.daysLimit}}let Ye=(e,t=!1)=>{let i=e.replace("HosRuleSet","");return(0,a.ZV)(t)[i]},je=e=>e.replace("HosRuleSet",""),Ze=e=>"HosRuleSet"+e;function Qe(e,t){let i=e.filter((e=>Je(e.hosRuleSet.id))).sort(((e,t)=>e.dateTime>t.dateTime?-1:1));if(!t)return i[0];{let e="string"==typeof t?t:t.toISOString();for(let t=0;t<i.length;t++)if(i[t].dateTime<e)return i[t]}}function Je(e){let t=Ye(e);return!(!t||!t.config.resetPreviousCycle)}function et(e){if(void 0===e)return;return Ge(e)/36e5}function tt(e){let t=1/0;const i=["driving","cycle","cycleDriving","rest","duty","workday"];let o=e=>i.some((t=>t===e)),n="";for(let i in e){if(!o(i))continue;let a=et(e[i]);void 0!==a&&a<t&&(t=a,n=i)}return{min:t,name:n}}function it(e){return e.length>0?e.sort(((e,t)=>e.dateTime>t.dateTime?-1:1))[0]:void 0}function ot(e){return!!e&&!!e.match(/Canada|Alberta/gi)}function nt(e){return e.toDate.getTime()-e.fromDate.getTime()}function at(e,t){if(e&&e.indexOf("Malfunction")>-1)switch(t){case"PowerCompliance":return"P";case"EngineSyncCompliance":return"E";case"TimingCompliance":return"T";case"PositioningCompliance":return"L";case"DataRecordingCompliance":return"R";case"DataTransferCompliance":return"S";default:return"O"}else switch(t){case"PowerCompliance":return"1";case"EngineSyncCompliance":return"2";case"MissingElementCompliance":return"3";case"DataTransferCompliance":return"4";case"UnidentifiedDrivingCompliance":return"5";default:return"6"}}function st(e){if(e){if(ot(e))return"CANELD";if(-1!==M.indexOf(e))return"EWD"}return"ELD"}function rt(e,t,i){if(i){let o=function(e,t){let i=0;return null==t||t.forEach((t=>{t.dateTime.getTime()===e.getTime()&&(i=Ge(t.hoursInCycle))})),i}(e,t),n=Ge(i)-o;return n=Math.max(0,n),n=Math.min(14*p,n),o=Math.min(14*p,o),[Ve(o,3),Ve(n,3)]}return["N/A","N/A"]}function lt(e,t,i){if(0===e.length)return Ve(0);const o={start:t.getTime(),end:i.getTime()},n=e.find((e=>e.isInProgress));if((null==n?void 0:n.fromDate)&&n.fromDate.getTime()<i.getTime()){return Ve(n.onDutyCount?Ge(n.onDutyCount):0)}let a,r=0;for(const t of e){const e=(t.onDutyIntervals||[]).map((e=>({start:e.start.getTime(),end:e.end.getTime()}))).map((e=>({start:Math.max(e.start,o.start),end:Math.min(e.end,o.end)}))).filter((e=>e.end>e.start)),i=s.A.getTotalDuration(e);i>0&&i>=r&&(r=i,a=t)}return Ve((null==a?void 0:a.onDutyCount)?Ge(a.onDutyCount):0)}
1function dt(e){let t=e.workdaySummaries||[],i=t.length?t[t.length-1]:void 0;return void 0!==i&&(void 0!==i.driveCount&&Ge(i.driveCount)>0)}function ct(e){return"string"==typeof e&&r.exec(e)?new Date(e):e}function ut(e){return"PositioningCompliance"===e.status}function mt(e){return ut(e)&&("Diagnostic"===e.malfunction||"SystemDiagnosticClear"===e.malfunction)}function ht(e){return"MotionStopped"===e.status}function yt(e){if(e.length<=10)return e;let t=0,i=0,n=[],a=e.sort(((e,t)=>(0,o.H)(t.dateTime,e.dateTime)));for(let e=a.length-1;e>=0&&(10!==t||10!==i);e--){let o=a[e];o.malfunction&&(o.malfunction.indexOf("Diagnostic")>-1?t<10&&(t++,n.push(o)):o.malfunction.indexOf("Malfunction")>-1&&i<10&&(i++,n.push(o)))}return n}function pt(e,t,i,a){let s=e.sort(((e,t)=>(0,o.H)(t.dateTime,e.dateTime)));const r=["malfunction","diagnostic"];let l={malfunction:{},diagnostic:{}},d={malfunction:{},diagnostic:{}},c=[],u=0;return Object.keys(t).sort().forEach((e=>{for(;u<s.length;u++){let o=s[u],r=i.toShortDate(o.dateTime,a,"yyyy-MM-dd");if(r>e)break;if(!mt(o)&&o.malfunction){let e=o.malfunction.indexOf("Malfunction")>-1?"malfunction":"diagnostic",i=l[e],a=(0,n.I)(o.device)||"NoDeviceId";if(t.hasOwnProperty(r)&&t[r].indexOf(a)>-1){c.push(o);let t=i[a];(null==t?void 0:t.length)&&(d[e][r]=t[t.length-1])}i.hasOwnProperty(a)||(i[a]=[]),o.malfunction.indexOf("Clear")>-1?i[a]=i[a].filter((e=>e.status!==o.status)):i[a].push(o)}}r.forEach((i=>{let o=l[i];t[e].forEach((t=>{let n=o[t];if(null==n?void 0:n.length){let t=d[i][e],o=n[n.length-1];(!t||t.dateTime<o.dateTime)&&(d[i][e]=o)}}))}))})),[c,d]}function ft(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function gt(e){return`${e.getFullYear()}-${`0${e.getMonth()+1}`.slice(-2)}-${`0${e.getDate()}`.slice(-2)}`}function vt(e){return e.endsWith("00:00:00.000Z")}function Dt(e,t){if(vt(e))return e.substring(0,10);return gt(t(new Date(e)))}function wt(e,t){let i={};return e.forEach((e=>{if(we(e)&&e.verifyDateTime){let o=Dt(e.verifyDateTime,t);(!i.hasOwnProperty(o)||i[o].dateTime>e.dateTime)&&(i[o]=e)}})),i}function bt(e,t,i){let o,n,a=(e,t,i,o)=>{let n=e[e.length-1];n&&n.deviceId===t&&i.getTime()-n.toDate.getTime()<=30*h?n.toDate=o:e.push({deviceId:t,fromDate:i,toDate:o})},s=[],r=t.id;"NoUserId"===r&&(r="UnknownDriverId");let l=e=>r===e||r===e.id;return e.forEach((e=>{o&&n&&e.device.id===o||!l(e.driver)?o&&n&&e.device.id===o&&!l(e.driver)&&(a(s,o,n,new Date(e.dateTime)),o=void 0,n=void 0):(o&&n&&a(s,o,n,new Date(e.dateTime)),o=e.device.id,n=new Date(e.dateTime))})),o&&n&&a(s,o,n,i),s}function St(e,t){if(typeof e.dateTime!=typeof t.dateTime)throw new Error("Invalid date sort parameter types");return e.dateTime>t.dateTime?1:e.dateTime<t.dateTime?-1:e.sequence&&t.sequence?e.sequence>t.sequence?1:e.sequence<t.sequence?-1:0:e.sequence?-1:t.sequence?1:0}var Ct;function Tt(e,t,i,o=!1){let n=function(e,t){let i=parseFloat(e.toString()),o=Math.floor(i),n=t?Math.floor(60*(i-o)):Math.ceil(60*(i-o));60===n&&(o+=1,n=0);let a="";return o>0&&(a=`${o}{0} `),`${a}${n}{1}`}(e,o);return n.replace("{0}",t).replace("{1}",i)}function xt(e,t=Ct.HOUR_UNIT,i=Ct.MINUTE_UNIT,o=!1){return Tt(e,t,i,o)}function kt(e){return["ON","YM","OFF","PC","WT","SB","PC_Exempted"].indexOf(e)>-1}function Mt(e){return["OFF","SB","PC","PC_Exempted","WT","Rest"].indexOf(e)>-1}!function(e){e.STATUS="Status",e.REST_DURATION="Rest duration",e.DRIVING_BREAK_IN="Break required in",e.ALTERNATE_DRIVING_BREAK_IN="{0} Break required in",e.DRIVING_BREAK="Break",e.ALTERNATE_DRIVING_BREAK="{0} Break",e.DRIVING_BREAK_DURATION="Break duration",e.ALTERNATE_DRIVING_BREAK_DURATION="{0} Break duration",e.DRIVING_LEFT="Driving left",e.DUTY_LEFT="Duty left",e.WORKDAY_LEFT="Workday left",e.CYCLE_LEFT="Cycle left",e.CYCLE_DRIVING_LEFT="Cycle driving left",e.TIME_LEFT_UNTIL_24_HOUR_REST="Time left until 24-hour rest",e.DUTY_LEFT_UNTIL_24_HOUR_REST="Duty left until 24-hour rest",e.REST_REQUIRED="Rest required",e.OFF_DUTY_REQUIRED="Off-duty required",e.DAYS_STRING="{0} days",e.MINUTES_STRING="{minutes}m",e.HOUR_UNIT="h",e.MINUTE_UNIT="m",e.DAYS_UNIT="d",e.SECONDS_UNIT="s",e.USER="User",e.DRIVE_APP_HOURS_OF_SERVICE="Drive App Hours of Service",e.TAP_TO_LOGIN="Tap to log in",e.TAP_TO_COMPLETE_WORKFLOW="Tap to complete workflow",e.COMPLIANCE="Compliance",e.Unknown="Unknown"}(Ct||(Ct={}));const Rt=(e,t,i)=>{let o=g.slice();
1return e&&(o=o.concat(x)),t&&(o=o.concat(w)),i&&(o=o.concat(v).concat(b).concat(S)),o},Et=e=>(t,i=!1)=>{const o=e(t);return i&&void 0!==o&&o<0?0:o}},26157(e,t,i){i.d(t,{Dz:()=>s,ZV:()=>c,dZ:()=>u});const o=36e5,n={SYMMETRIC_2_10:{type:"symmetric",splitMinimum:72e5,splitTotal:36e6},SYMMETRIC_4_8:{type:"symmetric",splitMinimum:4*o,splitTotal:8*o},SYMMETRIC_2_8:{type:"symmetric",splitMinimum:72e5,splitTotal:8*o},ASYMMETRIC_7_2:{type:"asymmetric",smallSplitMin:72e5,bigSplitMin:7*o,splitTotal:36e6},ASYMMETRIC_CALIFORNIA:{type:"asymmetric",smallSplitMin:72e5,bigSplitMin:8*o,bigSplitMax:36e6,splitTotal:36e6,onlyFreezeBigPeriods:!0}},a=864e5,s=8,r={None:{name:"No Ruleset (USA 7-day cycle)",config:{cycle:{cycleDays:7},logRetentionDays:7}},None8Day:{name:"No Ruleset (USA 8-day cycle)",config:{cycle:{cycleDays:8},logRetentionDays:7}},NoneCanada:{name:"No Ruleset (Canada South of 60°N)",config:{isCanada:!0,cycle:{cycleDays:7},logRetentionDays:14}},NoneCanadaNorthOf60:{name:"No Ruleset (Canada North of 60°N)",config:{isCanada:!0,cycle:{cycleDays:7},logRetentionDays:14}},America7Day:{name:"USA Property 60-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},America7DaySleeper:{name:"USA Property 60-hour/7-day with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},America7DayBig:{name:"USA Property 60-hour/7-day (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,logRetentionDays:7}},America7DayBigSleeper:{name:"USA Property 60-hour/7-day with split sleeper (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},America8Day:{name:"USA Property 70-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},America8DaySleeper:{name:"USA Property 70-hour/8-day with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},America8DayBig:{name:"USA Property 70-hour/8-day (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,logRetentionDays:7}},America8DayBigSleeper:{name:"USA Property 70-hour/8-day with split sleeper (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},AmericaShortHaul:{name:"USA Property Short-haul 60-hour/7-day 12hr Workday",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},AmericaShortHaulBig:{name:"USA Property Short-haul 60-hour/7-day 12hr Workday (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,exempt:!0}},AmericaShortHaul8Day:{name:"USA Property Short-haul 70-hour/8-day 12hr Workday",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},AmericaShortHaul8DayBig:{name:"USA Property Short-haul 70-hour/8-day 12hr Workday (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,exempt:!0}},AmericaShortHaul14hrWorkday:{name:"USA Property Short-haul 60-hour/7-day 14hr Workday",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},AmericaShortHaul8Day14hrWorkday:{name:"USA Property Short-haul 70-hour/8-day 14hr Workday",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},America7DayPassenger:{name:"USA Passenger 60-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:216e6},workday:{driveMaximum:36e6,dutyMaximum:54e6,offDutyMinimum:288e5},logRetentionDays:7,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8,adverseDoesNotExtendWorkday:!0}},America8DayPassenger:{name:"USA Passenger 70-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:252e6},workday:{driveMaximum:36e6,dutyMaximum:54e6,offDutyMinimum:288e5},logRetentionDays:7,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8,adverseDoesNotExtendWorkday:!0}},AmericaShortHaulPassenger:{name:"USA Passenger Short-haul 60-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:216e6},workday:{driveMaximum:36e6,dutyMaximum:504e5,offDutyMinimum:288e5},logRetentionDays:7,exempt:!0,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8,adverseDoesNotExtendWorkday:!0}},AmericaShortHaulPassenger8Day:{name:"USA Passenger Short-haul 70-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:252e6},workday:{driveMaximum:36e6,dutyMaximum:432e5,offDutyMinimum:288e5},logRetentionDays:7,exempt:!0,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8,adverseDoesNotExtendWorkday:!0}},CanadaBCLoggingTruck:{name:"BC Logging Truck",config:{isCanada:!0,cycle:{cycleDays:7,cycleMaximum:288e6,cycleDrivingMaximum:234e6,cycleRestMinimum:864e5,cycleRestDays:7},daily:{driveMaximum:468e5,dutyMaximum:54e6,deferralAllowed:!1},workday:{driveMaximum:468e5,dutyMaximum:54e6,workdayMaximum:54e6,offDutyMinimum:324e5},logRetentionDays:14,customStartOfDay:!0,adverseDoesNotExtendWorkday:!0}},CanadaCycleOne:{name:"Canada Cycle 1 (7 day) South of 60°N",config:{isCanada:!0,cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1296e5,cycleRestMinimum:864e5,cycleRestDays:14},daily:{driveMaximum:468e5,dutyMaximum:504e5,offDutyMinimum:36e6},workday:{driveMaximum:468e5,dutyMaximum:504e5,workdayMaximum:576e5,offDutyMinimum:288e5},rest:{restBreakMinimum:18e5,dailyRestMinimum:72e5},logRetentionDays:14,splitType:"canada",splitConfig:n.SYMMETRIC_2_10,customStartOfDay:!0,resetPreviousCycle:!0,adverseDoesNotExtendWorkday:!0}},CanadaCycleTwo:{name:"Canada Cycle 2 (14 day) South of 60°N",config:{isCanada:!0,cycle:{cycleDays:14,cycleMaximum:432e6,cycleRestartMinimum:2592e5,cycleRestMinimum:864e5,cycleRestDays:14,dutyMaximumSinceCycleRest:252e6},daily:{driveMaximum:468e5,dutyMaximum:504e5,offDutyMinimum:36e6},workday:{driveMaximum:468e5,dutyMaximum:504e5,workdayMaximum:576e5,offDutyMinimum:288e5},rest:{restBreakMinimum:18e5,dailyRestMinimum:72e5},logRetentionDays:14,splitType:"canada",splitConfig:n.SYMMETRIC_2_10,customStartOfDay:!0,resetPreviousCycle:!0,adverseDoesNotExtendWorkday:!0}},CanadaCycleOneTeam:{name:"Canada Team Cycle 1 (7 day) South of 60°N",config:{isCanada:!0,cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1296e5,cycleRestMinimum:864e5,cycleRestDays:14},daily:{driveMaximum:468e5,dutyMaximum:504e5,offDutyMinimum:36e6},workday:{driveMaximum:468e5,dutyMaximum:504e5,workdayMaximum:576e5,offDutyMinimum:288e5},rest:{restBreakMinimum:18e5,dailyRestMinimum:72e5},logRetentionDays:14,splitType:"canadateam",splitConfig:n.SYMMETRIC_4_8,customStartOfDay:!0,resetPreviousCycle:!0,adverseDoesNotExtendWorkday:!0}},CanadaCycleTwoTeam:{name:"Canada Team Cycle 2 (14 day) South of 60°N",config:{isCanada:!0,cycle:{cycleDays:14,cycleMaximum:432e6,cycleRestartMinimum:2592e5,cycleRestMinimum:864e5,cycleRestDays:14,dutyMaximumSinceCycleRest:252e6},daily:{driveMaximum:468e5,dutyMaximum:504e5,offDutyMinimum:36e6},workday:{driveMaximum:468e5,dutyMaximum:504e5,workdayMaximum:576e5,offDutyMinimum:288e5},rest:{restBreakMinimum:18e5,dailyRestMinimum:72e5},logRetentionDays:14,splitType:"canadateam",splitConfig:n.SYMMETRIC_4_8,customStartOfDay:!0,resetPreviousCycle:!0,adverseDoesNotExtendWorkday:!0}},CanadaNorthOf60CycleOne:{name:"Canada Cycle 1 (7 day) North of 60°N",config:{isCanada:!0,cycle:{cycleDays:7,cycleMaximum:288e6,cycleRestartMinimum:1296e5,cycleRestMinimum:864e5,cycleRestDays:14},workday:{driveMaximum:54e6,dutyMaximum:648e5,workdayMaximum:72e6,workdayMaximumWhenSplitSB:648e5,offDutyMinimum:288e5},logRetentionDays:14,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8,resetPreviousCycle:!0,adverseDoesNotExtendWorkday:!0}},CanadaNorthOf60CycleTwo:{name:"Canada Cycle 2 (14 day) North of 60°N",config:{isCanada:!0,cycle:{cycleDays:14,cycleMaximum:432e6,cycleRestartMinimum:2592e5,cycleRestMinimum:864e5,cycleRestDays:14,dutyMaximumSinceCycleRest:288e6},workday:{driveMaximum:54e6,dutyMaximum:648e5,workdayMaximum:72e6,workdayMaximumWhenSplitSB:648e5,offDutyMinimum:288e5},logRetentionDays:14,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8,resetPreviousCycle:!0,adverseDoesNotExtendWorkday:!0}},CanadaNorthOf60CycleOneTeam:{name:"Canada Team Cycle 1 (7 day) North of 60°N",config:{isCanada:!0,cycle:{cycleDays:7,cycleMaximum:288e6,cycleRestartMinimum:1296e5,cycleRestMinimum:864e5,cycleRestDays:14},workday:{driveMaximum:54e6,dutyMaximum:648e5,workdayMaximum:72e6,workdayMaximumWhenSplitSB:648e5,offDutyMinimum:288e5},logRetentionDays:14,splitType:"canadanorthteam",splitConfig:n.SYMMETRIC_4_8,resetPreviousCycle:!0,adverseDoesNotExtendWorkday:!0}},CanadaNorthOf60CycleTwoTeam:{name:"Canada Team Cycle 2 (14 day) North of 60°N",config:{isCanada:!0,cycle:{cycleDays:14,cycleMaximum:432e6,cycleRestartMinimum:2592e5,cycleRestMinimum:864e5,cycleRestDays:14,dutyMaximumSinceCycleRest:288e6},workday:{driveMaximum:54e6,dutyMaximum:648e5,workdayMaximum:72e6,workdayMaximumWhenSplitSB:648e5,offDutyMinimum:288e5},logRetentionDays:14,splitType:"canadanorthteam",splitConfig:n.SYMMETRIC_4_8,resetPreviousCycle:!0,adverseDoesNotExtendWorkday:!0}},CaliforniaProperty:{name:"California Property Intrastate",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},CaliforniaPropertyShortHaul:{name:"California Property Short-haul",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:432e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},CaliforniaPassenger:{name:"California Passenger Intrastate",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:36e6,dutyMaximum:54e6,offDutyMinimum:288e5},logRetentionDays:7,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8}},CaliforniaFlammableLiquid:{name:"California Flammable Liquid",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:36e6,workdayMaximum:576e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},CaliforniaFlammableLiquidWithRestRequirement:{name:"California Flammable Liquid with rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:36e6,workdayMaximum:576e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:18e6},logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}}
1,CaliforniaSchoolPupil:{name:"California School Pupil",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:36e6,workdayMaximum:576e5,offDutyMinimum:288e5},logRetentionDays:7}},CaliforniaSchoolPupilWithRestRequirement:{name:"California School Pupil with rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:36e6,workdayMaximum:576e5,offDutyMinimum:288e5},rest:{restBreakMinimum:18e5,betweenRestLimit:18e6},logRetentionDays:7}},CaliforniaFarmProduct:{name:"California Farm Product",config:{cycle:{cycleDays:8,cycleMaximum:4032e5,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,dutyMaximum:576e5,offDutyMinimum:288e5},logRetentionDays:7}},CaliforniaFarmProductWithRestRequirement:{name:"California Farm Product with rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:4032e5,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,dutyMaximum:576e5,offDutyMinimum:288e5},rest:{restBreakMinimum:18e5,betweenRestLimit:18e6},logRetentionDays:7}},OilTransport7Day:{name:"USA Property 60-hour/7-day 24-hour restart",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},OilTransport7DaySleeper:{name:"USA Property 60-hour/7-day with split sleeper and 24-hour restart",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilTransport7DayBig:{name:"USA Property 60-hour/7-day 24-hour restart (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,logRetentionDays:7}},OilTransport7DayBigSleeper:{name:"USA Property 60-hour/7-day with split sleeper and 24-hour restart (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilTransport8Day:{name:"USA Property 70-hour/8-day 24-hour restart",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},OilTransport8DaySleeper:{name:"USA Property 70-hour/8-day with split sleeper and 24-hour restart",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilTransport8DayBig:{name:"USA Property 70-hour/8-day 24-hour restart (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,logRetentionDays:7}},OilTransport8DayBigSleeper:{name:"USA Property 70-hour/8-day with split sleeper and 24-hour restart (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilTransportShortHaul:{name:"USA Property Short-haul 60-hour/7-day 12hr Workday 24-hour restart",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},OilTransportShortHaulBig:{name:"USA Property Short-haul 60-hour/7-day 12hr Workday 24-hour restart (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,exempt:!0}},OilTransportShortHaul8Day:{name:"USA Property Short-haul 70-hour/8-day 12hr Workday 24-hour restart",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},OilTransportShortHaul8DayBig:{name:"USA Property Short-haul 70-hour/8-day 12hr Workday 24-hour restart (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,exempt:!0}},OilTransportShortHaul14hrWorkday:{name:"USA Property Short-haul 60-hour/7-day 14hr Workday 24-hour restart",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},OilTransportShortHaul8Day14hrWorkday:{name:"USA Property Short-haul 70-hour/8-day 14hr Workday 24-hour restart",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}}
1,OilTransportCalifornia8day:{name:"California Oil Transport Property Intrastate with rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:864e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:18e6},logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},OilTransportCaliforniaProperty:{name:"California Oil Transport Property Intrastate",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:864e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},AmericaSalesperson:{name:"USA Salesperson",config:{cycle:{cycleDays:7,cycleDrivingMaximum:144e6,cycleMaximum:144e6,cycleStatuses:["D"],cycleRestartMinimum:1224e5,maxPercentDriving:.5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},AmericaSalespersonNonCdlShortHaul:{name:"USA Salesperson Non-CDL Short Haul",config:{cycle:{cycleDays:7,cycleDrivingMaximum:144e6,cycleMaximum:144e6,cycleStatuses:["D"],cycleRestartMinimum:1224e5,maxPercentDriving:.5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,bigDayMaxPerCycle:2,bigDayBonus:72e5,bigDayIgnoresCycleReset:!0,exempt:!0}},OilWell7Day:{name:"USA Oil Well 60-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},oilwell:!0,logRetentionDays:7}},OilWell7DaySleeper:{name:"USA Oil Well 60-hour/7-day with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},oilwell:!0,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilWell7DayBig:{name:"USA Oil Well 60-hour/7-day (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,oilwell:!0,logRetentionDays:7}},OilWell7DayBigSleeper:{name:"USA Oil Well 60-hour/7-day (16-hour exemption) with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,oilwell:!0,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilWell8Day:{name:"USA Oil Well 70-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},oilwell:!0,logRetentionDays:7}},OilWell8DaySleeper:{name:"USA Oil Well 70-hour/8-day with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},oilwell:!0,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilWell8DayBig:{name:"USA Oil Well 70-hour/8-day (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,oilwell:!0,logRetentionDays:7}},OilWell8DayBigSleeper:{name:"USA Oil Well 70-hour/8-day (16-hour exemption) with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},bigDayBonus:72e5,oilwell:!0,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilWellCalifornia8day:{name:"California Oil Well Property Intrastate with rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:864e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:18e6},oilwell:!0,logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},OilWellCaliforniaProperty:{name:"California Oil Well Property Intrastate",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:864e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},oilwell:!0,logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},AmericaTexas:{name:"Texas Intrastate",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,dutyMaximum:54e6,offDutyMinimum:288e5},logRetentionDays:7,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8}}
1,AmericaTexasShortHaul:{name:"Texas Short-Haul 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,dutyMaximum:54e6,offDutyMinimum:288e5},logRetentionDays:7,exempt:!0,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8}},AmericaTexasShortHaul8Day:{name:"Texas Short-Haul 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,dutyMaximum:54e6,offDutyMinimum:288e5},logRetentionDays:7,exempt:!0,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8}},OilTransportTexas:{name:"USA Texas Oil Transport 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:432e5,dutyMaximum:54e6,offDutyMinimum:288e5},logRetentionDays:7,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8}},OilWellTexas:{name:"USA Texas Oil Well 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:432e5,dutyMaximum:54e6,offDutyMinimum:288e5},oilwell:!0,logRetentionDays:7,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8}},Florida7Day:{name:"USA Florida 70-hour/7-Day",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},Florida8Day:{name:"USA Florida 80-hour/8-Day",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},FloridaShortHaul7Day:{name:"USA Florida Short-haul 70-hour/7-Day",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:432e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},FloridaShortHaul8Day:{name:"USA Florida Short-haul 80-hour/8-Day",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:432e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},America7DayNo34h:{name:"USA Property 60-hour/7-day without 34-hour restart",config:{cycle:{cycleDays:7,cycleMaximum:216e6},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},America7DayNo34hSleeper:{name:"USA Property 60-hour/7-day without 34-hour restart with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},America8DayNo34h:{name:"USA Property 70-hour/8-day without 34-hour restart",config:{cycle:{cycleDays:8,cycleMaximum:252e6},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},America8DayNo34hSleeper:{name:"USA Property 70-hour/8-day without 34-hour restart with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},AmericaShortHaulNo34h:{name:"USA Property Short-haul 60-hour/7-day without 34-hour restart",config:{cycle:{cycleDays:7,cycleMaximum:216e6},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},AmericaShortHaulNo34hBig:{name:"USA Property Short-haul 60-hour/7-day without 34-hour restart (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,exempt:!0}},AmericaShortHaul8DayNo34h:{name:"USA Property Short-haul 70-hour/8-day without 34-hour restart",config:{cycle:{cycleDays:8,cycleMaximum:252e6},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,exempt:!0}},AmericaShortHaul8DayNo34hBig:{name:"USA Property Short-haul 70-hour/8-day without 34-hour restart (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,exempt:!0}},BrazilShortHaul:{name:"Brazil Property Short-haul",config:{cycle:{cycleDays:7},workday:{dutyMaximum:288e5,offDutyMinimum:396e5},rest:{restBreakMinimum:18e5,betweenRestLimit:198e5},logRetentionDays:7,exempt:!0}},CarrierExemption:{name:"Carrier Exemption",config:{logRetentionDays:14,exempt:!0}},AmericaNonCdlShortHaul7Day:{name:"Non-CDL Short-haul 60-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,bigDayMaxPerCycle:2,bigDayBonus:72e5,bigDayIgnoresCycleReset:!0}},AmericaNonCdlShortHaul8Day:{name:"Non-CDL Short-haul 70-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,bigDayMaxPerCycle:2,bigDayBonus:72e5,bigDayIgnoresCycleReset:!0}},WashingtonIntrastate7Day:{name:"Washington Intrastate Logging/Dumptruck 80-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:288e6,cycleRestartMinimum:864e5},workday:{driveMaximum:432e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,bigDayMaxPerCycle:2,bigDayBonus:72e5,bigDayIgnoresCycleReset:!0}},WashingtonIntrastate8Day:{name:"Washington Intrastate Logging/Dumptruck 90-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:324e6,cycleRestartMinimum:864e5},workday:{driveMaximum:432e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,bigDayMaxPerCycle:2,bigDayBonus:72e5,bigDayIgnoresCycleReset:!0}},AmericaNoRestRequirement7Day:{name:"USA Property 60-hour/7-day without rest requirement",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7}},AmericaNoRestRequirement7DaySleeper:{name:"USA Property 60-hour/7-day without rest requirement with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},AmericaNoRestRequirement7DayBig:{name:"USA Property 60-hour/7-day (16-hour exemption) without rest requirement",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7}},AmericaNoRestRequirement7DayBigSleeper:{name:"USA Property 60-hour/7-day without rest requirement with split sleeper (16-hour exemption)",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},AmericaNoRestRequirement8Day:{name:"USA Property 70-hour/8-day without rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7}},AmericaNoRestRequirement8DaySleeper:{name:"USA Property 70-hour/8-day without rest requirement with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},AmericaNoRestRequirement8DayBig:{name:"USA Property 70-hour/8-day (16-hour exemption) without rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7}},AmericaNoRestRequirement8DayBigSleeper:{name:"USA Property 70-hour/8-day without rest requirement with split sleeper (16-hour exemption)",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}}
1,OilTransportNoRestRequirement7Day:{name:"USA Oil Transport 60-hour/7-day without rest requirement",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7}},OilTransportNoRestRequirement7DaySleeper:{name:"USA Oil Transport 60-hour/7-day without rest requirement with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilTransportNoRestRequirement7DayBig:{name:"USA Oil Transport 60-hour/7-day (16-hour exemption) without rest requirement",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7}},OilTransportNoRestRequirement7DayBigSleeper:{name:"USA Oil Transport 60-hour/7-day (16-hour exemption) without rest requirement with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilTransportNoRestRequirement8Day:{name:"USA Oil Transport 70-hour/8-day without rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7}},OilTransportNoRestRequirement8DaySleeper:{name:"USA Oil Transport 70-hour/8-day without rest requirement with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilTransportNoRestRequirement8DayBig:{name:"USA Oil Transport 70-hour/8-day (16-hour exemption) without rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7}},OilTransportNoRestRequirement8DayBigSleeper:{name:"USA Oil Transport 70-hour/8-day (16-hour exemption) without rest requirement with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilWellNoRestRequirement7Day:{name:"USA Oil Well 60-hour/7-day without rest requirement",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},oilwell:!0,logRetentionDays:7}},OilWellNoRestRequirement7DaySleeper:{name:"USA Oil Well 60-hour/7-day without rest requirement with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},oilwell:!0,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilWellNoRestRequirement7DayBig:{name:"USA Oil Well 60-hour/7-day (16-hour exemption) without rest requirement",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},oilwell:!0,bigDayBonus:72e5,logRetentionDays:7}},OilWellNoRestRequirement7DayBigSleeper:{name:"USA Oil Well 60-hour/7-day (16-hour exemption) without rest requirement with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},oilwell:!0,bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilWellNoRestRequirement8Day:{name:"USA Oil Well 70-hour/8-day without rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},oilwell:!0,logRetentionDays:7}},OilWellNoRestRequirement8DaySleeper:{name:"USA Oil Well 70-hour/8-day without rest requirement with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},oilwell:!0,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},OilWellNoRestRequirement8DayBig:{name:"USA Oil Well 70-hour/8-day (16-hour exemption) without rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},oilwell:!0,bigDayBonus:72e5,logRetentionDays:7}},OilWellNoRestRequirement8DayBigSleeper:{name:"USA Oil Well 70-hour/8-day (16-hour exemption) without rest requirement with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:864e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},oilwell:!0,bigDayBonus:72e5,logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}}
1,NorthDakota7Day:{name:"North Dakota 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6},workday:{driveMaximum:432e5,workdayMaximum:54e6,offDutyMinimum:288e5},logRetentionDays:7}},SouthCarolina7Day:{name:"South Carolina 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:288e5},logRetentionDays:7}},SouthCarolina8Day:{name:"South Carolina 80-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:288e6},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:288e5},logRetentionDays:7}},MarylandShortHaul7Day:{name:"Maryland Short Haul 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:288e5},logRetentionDays:7}},MarylandShortHaul8Day:{name:"Maryland Short Haul 80-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:288e6},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:288e5},logRetentionDays:7}},NorthDakotaShortHaul7Day:{name:"North Dakota Short Haul 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6},workday:{driveMaximum:432e5,workdayMaximum:432e5,offDutyMinimum:288e5},logRetentionDays:7}},AlaskaPassenger7Day:{name:"Alaska Passenger 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6},workday:{driveMaximum:54e6,dutyMaximum:72e6,offDutyMinimum:288e5},logRetentionDays:7}},AlaskaPassenger8Day:{name:"Alaska Passenger 80-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:288e6},workday:{driveMaximum:54e6,dutyMaximum:72e6,offDutyMinimum:288e5},logRetentionDays:7}},AlaskaProperty7Day:{name:"Alaska Property 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6},workday:{driveMaximum:54e6,workdayMaximum:72e6,offDutyMinimum:36e6},logRetentionDays:7}},AlaskaProperty7DaySleeper:{name:"Alaska Property 70-hour/7-day with split sleeper",config:{cycle:{cycleDays:7,cycleMaximum:252e6},workday:{driveMaximum:54e6,workdayMaximum:72e6,offDutyMinimum:36e6},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},AlaskaProperty8Day:{name:"Alaska Property 80-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:54e6,workdayMaximum:72e6,offDutyMinimum:36e6},logRetentionDays:7}},AlaskaProperty8DaySleeper:{name:"Alaska Property 80-hour/8-day with split sleeper",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:54e6,workdayMaximum:72e6,offDutyMinimum:36e6},logRetentionDays:7,splitType:"property",splitConfig:n.ASYMMETRIC_7_2}},Nebraska7day:{name:"Nebraska 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:288e5},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},Nebraska8day:{name:"Nebraska 80-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:288e5},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},California8day:{name:"California Property Intrastate with rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:18e6},logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},CaliforniaPropertyShortHaulWithRest:{name:"California Property Short-haul with rest requirement",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:432e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:18e6},logRetentionDays:7,splitType:"californiaProperty",splitConfig:n.ASYMMETRIC_CALIFORNIA}},Oregon7day:{name:"Oregon 70-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},Oregon8day:{name:"Oregon 80-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:288e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,workdayMaximum:576e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7}},CanadaOil:{name:"Canada South of 60°N Oil Permit",config:{isCanada:!0,cycle:{cycleDays:24,cycleRestartMinimum:2592e5,cycleRestMinimum:864e5,cycleRestPeriods:3,cycleRestDays:23},daily:{driveMaximum:468e5,dutyMaximum:504e5,offDutyMinimum:36e6,deferralAllowed:!1},workday:{driveMaximum:468e5,dutyMaximum:504e5,workdayMaximum:576e5,offDutyMinimum:288e5,wtExtendsWorkday:!1,consecutiveOffCountIncludesWt:!1},rest:{restBreakMinimum:18e5,dailyRestMinimum:72e5},logRetentionDays:24,splitType:"canada",splitConfig:n.SYMMETRIC_2_10,customStartOfDay:!0,adverseDoesNotExtendWorkday:!0,oilwell:!0}},CanadaNorthOf60Oil:{name:"Canada North of 60°N Oil Permit",config:{isCanada:!0,cycle:{cycleDays:24,cycleRestartMinimum:2592e5,cycleRestMinimum:864e5,cycleRestPeriods:3,cycleRestDays:23},daily:{deferralAllowed:!1},workday:{driveMaximum:54e6,dutyMaximum:648e5,workdayMaximum:72e6,offDutyMinimum:288e5,wtExtendsWorkday:!1,consecutiveOffCountIncludesWt:!1},logRetentionDays:24,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8,adverseDoesNotExtendWorkday:!0,oilwell:!0}},CanadaOilTeam:{name:"Canada South of 60°N Oil Permit Team",config:{isCanada:!0,cycle:{cycleDays:24,cycleRestartMinimum:2592e5,cycleRestMinimum:864e5,cycleRestPeriods:3,cycleRestDays:23},daily:{driveMaximum:468e5,dutyMaximum:504e5,offDutyMinimum:36e6,deferralAllowed:!1},workday:{driveMaximum:468e5,dutyMaximum:504e5,workdayMaximum:576e5,offDutyMinimum:288e5,wtExtendsWorkday:!1,consecutiveOffCountIncludesWt:!1},rest:{restBreakMinimum:18e5,dailyRestMinimum:72e5},logRetentionDays:24,splitType:"canadateam",splitConfig:n.SYMMETRIC_4_8,customStartOfDay:!0,adverseDoesNotExtendWorkday:!0,oilwell:!0}},CanadaNorthOf60OilTeam:{name:"Canada North of 60°N Oil Permit Team",config:{isCanada:!0,cycle:{cycleDays:24,cycleRestartMinimum:2592e5,cycleRestMinimum:864e5,cycleRestPeriods:3,cycleRestDays:23},daily:{deferralAllowed:!1},workday:{driveMaximum:54e6,dutyMaximum:648e5,workdayMaximum:72e6,offDutyMinimum:288e5,wtExtendsWorkday:!1,consecutiveOffCountIncludesWt:!1},logRetentionDays:24,splitType:"canadateam",splitConfig:n.SYMMETRIC_4_8,adverseDoesNotExtendWorkday:!0,oilwell:!0}},America7DayRailroad:{name:"USA Railroad 60-hour/7-day",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7,splitType:"noSplit",railroadExempt:!0}},America8DayRailroad:{name:"USA Railroad 70-hour/8-day",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:396e5,workdayMaximum:504e5,offDutyMinimum:36e6},rest:{restBreakMinimum:18e5,betweenRestLimit:288e5,onDutyCountTowardRest:!0},logRetentionDays:7,splitType:"noSplit",railroadExempt:!0}},Alberta:{name:"Alberta",config:{isCanada:!0,workday:{driveMaximum:468e5,dutyMaximum:54e6,offDutyMinimum:288e5,exemptionReducedRest:{daysBetweenUse:7,offDutyMinimum:144e5}},rest:{restBreakMinimum:18e5,betweenRestLimit:216e5,earlyRestBreaks:[{restBreakMinimum:6e5,betweenRestLimit:144e5}],onDutyCountTowardRest:!0},splitType:"passenger",splitConfig:n.SYMMETRIC_2_8,logRetentionDays:14,adverseDoesNotExtendWorkday:!0}},MalaysiaDrivingHours:{name:"Malaysia Driving Hours",config:{cycle:{cycleRestMinimum:864e5,cycleRestDays:6},workday:{workdayMaximum:432e5,driveMaximum:288e5,offDutyMinimum:432e5},rest:{restBreakMinimum:18e5,betweenRestLimit:144e5},logRetentionDays:14,adverseDoesNotExtendWorkday:!0}},AustraliaStandardHoursSoloExemptionHours:{name:"Australia Standard Hours Solo with Exemption Hours",config:{logRetentionDays:s,workRestConfig:[{timePeriod:198e5,restPeriod:{restMinimum:9e5,countRequired:1},workPeriod:{workMaximum:189e5}},{timePeriod:288e5,restPeriod:{restMinimum:9e5,countRequired:2},workPeriod:{workMaximum:27e6}},{timePeriod:396e5,restPeriod:{restMinimum:9e5,countRequired:4},workPeriod:{workMaximum:36e6}},{timePeriod:1*a,restPeriod:{restMinimum:252e5,countRequired:1},workPeriod:{workMaximum:432e5}},{timePeriod:7*a,restPeriod:{restMinimum:864e5,countRequired:1},workPeriod:{workMaximum:2592e5}},{timePeriod:14*a,restPeriod:{nightRestBreakCount:4,consecutiveNightRestBreakCount:2},workPeriod:{workMaximum:5184e5}}],exempt:!0}}}
1,l={AmericaTexasShortHaul:{name:"Texas Short-haul 60-hour/7-day Intrastate",config:{cycle:{cycleDays:7,cycleMaximum:216e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,offDutyMinimum:288e5,workdayMaximum:504e5},logRetentionDays:7,exempt:!0,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8}},AmericaTexasShortHaul8Day:{name:"Texas Short-haul 70-hour/8-day Intrastate",config:{cycle:{cycleDays:8,cycleMaximum:252e6,cycleRestartMinimum:1224e5},workday:{driveMaximum:432e5,offDutyMinimum:288e5,workdayMaximum:504e5},logRetentionDays:7,exempt:!0,splitType:"passenger",splitConfig:n.SYMMETRIC_2_8}}},d=Object.assign(Object.assign({},r),l);function c(e=!1){return e?d:r}function u(e,t=!1){return c(t)[e]}},43376(e,t,i){i.d(t,{H:()=>o});const o=function(e,t){if(typeof e!=typeof t)throw new Error("Incomparable Types");return e instanceof Date&&t instanceof Date?e.getTime()===t.getTime()?0:e>t?-1:1:e===t?0:e>t?-1:1}},67620(e,t,i){var o;i.d(t,{A:()=>s}),function(e){e[e.RED=0]="RED",e[e.BLACK=1]="BLACK"}(o||(o={}));class n{constructor(e,t,i,o,n){this.interval=e,this.color=t,this.parent=i,this.left=o,this.right=n,this.maxEnd=e.end}}class a{findMergeable(e,t,i){if(e===this.nil)return;e.interval.start<=t.end&&e.interval.end>=t.start&&i.push(e.interval),e.left!==this.nil&&e.left.maxEnd>=t.start&&this.findMergeable(e.left,t,i),e.right!==this.nil&&e.interval.start<=t.end&&this.findMergeable(e.right,t,i)}searchOverlapping(e,t,i){if(e===this.nil)return;e.interval.start<t.end&&e.interval.end>t.start&&i.push(e.interval),e.left!==this.nil&&e.left.maxEnd>t.start&&this.searchOverlapping(e.left,t,i),e.right!==this.nil&&e.interval.start<t.end&&this.searchOverlapping(e.right,t,i)}inOrderTraversal(e,t){e!==this.nil&&(this.inOrderTraversal(e.left,t),t.push(e.interval),this.inOrderTraversal(e.right,t))}findNodeByStart(e){let t=this.root;for(;t!==this.nil;){if(e===t.interval.start)return t;t=e<t.interval.start?t.left:t.right}return null}updateMaxEnd(e){e!==this.nil&&(e.maxEnd=Math.max(e.interval.end,e.left.maxEnd,e.right.maxEnd))}propagateMaxEndUpdate(e){let t=e;for(;t!==this.nil;)this.updateMaxEnd(t),t=t.parent}leftRotate(e){const t=e.right;e.right=t.left,t.left!==this.nil&&(t.left.parent=e),t.parent=e.parent,e.parent===this.nil?this.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,this.updateMaxEnd(e),this.updateMaxEnd(t)}rightRotate(e){const t=e.left;e.left=t.right,t.right!==this.nil&&(t.right.parent=e),t.parent=e.parent,e.parent===this.nil?this.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,this.updateMaxEnd(e),this.updateMaxEnd(t)}rbInsert(e){let t=this.nil,i=this.root;for(;i!==this.nil;)t=i,i=e.interval.start<i.interval.start?i.left:i.right;e.parent=t,t===this.nil?this.root=e:e.interval.start<t.interval.start?t.left=e:t.right=e,e.left=this.nil,e.right=this.nil,e.color=o.RED,this.insertFixup(e)}insertFixup(e){let t=e;for(;t.parent.color===o.RED;)if(t.parent===t.parent.parent.left){const e=t.parent.parent.right;e.color===o.RED?(t.parent.color=o.BLACK,e.color=o.BLACK,t.parent.parent.color=o.RED,t=t.parent.parent):(t===t.parent.right&&(t=t.parent,this.leftRotate(t)),t.parent.color=o.BLACK,t.parent.parent.color=o.RED,this.rightRotate(t.parent.parent))}else{const e=t.parent.parent.left;e.color===o.RED?(t.parent.color=o.BLACK,e.color=o.BLACK,t.parent.parent.color=o.RED,t=t.parent.parent):(t===t.parent.left&&(t=t.parent,this.rightRotate(t)),t.parent.color=o.BLACK,t.parent.parent.color=o.RED,this.leftRotate(t.parent.parent))}this.root.color=o.BLACK,this.propagateMaxEndUpdate(t)}transplant(e,t){e.parent===this.nil?this.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.parent=e.parent}minimum(e){let t=e;for(;t.left!==this.nil;)t=t.left;return t}deleteNode(e){let t,i,n=e,a=n.color;e.left===this.nil?(t=e.right,i=e.parent,this.transplant(e,e.right)):e.right===this.nil?(t=e.left,i=e.parent,this.transplant(e,e.left)):(n=this.minimum(e.right),a=n.color,t=n.right,n.parent===e?(t.parent=n,i=n):(i=n.parent,this.transplant(n,n.right),n.right=e.right,n.right.parent=n),this.transplant(e,n),n.left=e.left,n.left.parent=n,n.c
1olor=e.color),a===o.BLACK&&this.deleteFixup(t),this.propagateMaxEndUpdate(i)}deleteFixup(e){let t=e;for(;t!==this.root&&t.color===o.BLACK;)if(t===t.parent.left){let e=t.parent.right;e.color===o.RED&&(e.color=o.BLACK,t.parent.color=o.RED,this.leftRotate(t.parent),e=t.parent.right),e.left.color===o.BLACK&&e.right.color===o.BLACK?(e.color=o.RED,t=t.parent):(e.right.color===o.BLACK&&(e.left.color=o.BLACK,e.color=o.RED,this.rightRotate(e),e=t.parent.right),e.color=t.parent.color,t.parent.color=o.BLACK,e.right.color=o.BLACK,this.leftRotate(t.parent),t=this.root)}else{let e=t.parent.left;e.color===o.RED&&(e.color=o.BLACK,t.parent.color=o.RED,this.rightRotate(t.parent),e=t.parent.left),e.right.color===o.BLACK&&e.left.color===o.BLACK?(e.color=o.RED,t=t.parent):(e.left.color===o.BLACK&&(e.right.color=o.BLACK,e.color=o.RED,this.leftRotate(e),e=t.parent.left),e.color=t.parent.color,t.parent.color=o.BLACK,e.left.color=o.BLACK,this.rightRotate(t.parent),t=this.root)}t.color=o.BLACK}constructor(){this.nil=new n({start:-1,end:-1},o.BLACK,{},{},{}),this.nil.parent=this.nil,this.nil.left=this.nil,this.nil.right=this.nil,this.nil.maxEnd=-1/0,this.root=this.nil}insert(e){if(e.start>=e.end)return;let t=Object.assign({},e);const i=[];this.findMergeable(this.root,e,i);for(const e of i)t.start=Math.min(t.start,e.start),t.end=Math.max(t.end,e.end);for(const e of i){const t=this.findNodeByStart(e.start);t&&this.deleteNode(t)}const a=new n(t,o.RED,this.nil,this.nil,this.nil);this.rbInsert(a)}remove(e){if(e.start>=e.end)return;const t=this.query(e),i=[];for(const o of t)o.start<e.start&&i.push({start:o.start,end:e.start}),o.end>e.end&&i.push({start:e.end,end:o.end});for(const e of t){const t=this.findNodeByStart(e.start);t&&this.deleteNode(t)}for(const e of i)this.insert(e)}query(e){if(e.start>=e.end)return[];const t=[];return this.searchOverlapping(this.root,e,t),t.sort(((e,t)=>e.start-t.start))}queryAndTrim(e){const t=this.query(e);if(0===t.length)return[];const i=[],o=t[0],n=Math.max(o.start,e.start),a=Math.min(o.end,e.end);n<a&&i.push({start:n,end:a});for(let e=1;e<t.length-1;e++)i.push(t[e]);if(t.length>1){const o=t[t.length-1],n=Math.max(o.start,e.start),a=Math.min(o.end,e.end);n<a&&i.push({start:n,end:a})}return i}getIntervals(){const e=[];return this.inOrderTraversal(this.root,e),e}}class s{createPeriodsFromLogs(e,t){if(e&&0!==e.length){for(let t=0;t<e.length-1;t++){const i=e[t];if(this.managedStatusesSet.has(i.status)){const o=e[t+1];this.disjointIntervalSet.insert({start:i.dateTime.getTime(),end:o.dateTime.getTime()})}}if(e.length>=1&&t){const i=e[e.length-1];this.managedStatusesSet.has(i.status)&&this.disjointIntervalSet.insert({start:i.dateTime.getTime(),end:t})}}}doesIntervalDurationQualify(e){const t=e.end-e.start;return(!this.minDuration||t>=this.minDuration)&&(!this.maxDuration||t<=this.maxDuration)}constructor(e,t,i,o,n){if(this.minDuration=i,this.maxDuration=o,!Array.isArray(e))throw new Error("logs must be an array");if(!Array.isArray(t))throw new Error("managedStatuses must be an array");if(void 0!==i&&i<0)throw new Error("minDuration cannot be negative");if(void 0!==o&&o<0)throw new Error("maxDuration cannot be negative");if(void 0!==i&&void 0!==o&&i>o)throw new Error("minDuration cannot be greater than maxDuration");if(void 0!==n&&n<0)throw new Error("endTime cannot be negative");for(let t=0;t<e.length;t++){const i=e[t];if(!i||"string"!=typeof i.status||!(i.dateTime instanceof Date)||isNaN(i.dateTime.getTime()))throw new Error(`Invalid log entry at index ${t}: must have valid status and dateTime`)}this.disjointIntervalSet=new a,this.managedStatusesSet=new Set(t),this.createPeriodsFromLogs(e,n)}getQualifiedIntervals(e){return this.disjointIntervalSet.queryAndTrim(e).filter((e=>this.doesIntervalDurationQualify(e)))}getAllIntervals(e){return this.disjointIntervalSet.queryAndTrim(e)}static getTotalDuration(e){return e.reduce(((e,t)=>e+(t.end-t.start)),0)}}},50780(e,t,i){i.d(t,{I:()=>o});const o=e=>e&&"NoDeviceId"!==e?e.id:null},10080(e,t,i){function o(e,t){if(isNaN(e))return e;if(isNaN(t))return t;const i=e%t;if(isNaN(i))return NaN;if(0===i&&e<0)return-0;let o=i-Math.abs(t)*function(e){if(e<0)return-1;if(e>0)return 1;return 0}(e);if(Math.abs(o)===Math.abs(i)){const n=e/t,a=Math.round(n);return Math.abs(a)>Math.abs(n)?o:i}return Math.abs(o)<Math.abs(i)?o:i}i.d(t,{a:()=>o})},8008(e,t,i){i.d(t,{$B:()=>a,IN:()=>n,Np:()=>r,P$:()=>f,TP:()=>v,X:()=>y,Xv:()=>p,Xx:()=>g,ZA:()=>o,ft:()=>m,ne:()=>u,rB:()=>s,rk:()=>h});i(4125);const o=e=>{let t=e[0]||{lat:0,lng:0};return e.reduce(((e,t)=>(e.nlat<t.lat&&(e.nlat=t.lat),e.slat>t.lat&&(e.slat=t.lat),e.elng<t.lng&&(e.elng=t.lng),e.wlng>t.lng&&(e.wlng=t.lng),e)),{slat:t.lat,nlat:t.lat,wlng:t.lng,elng:t.lng})};function n(e,t){let i=Math.abs(e.wlng-e.elng)*t,o=Math.abs(e.nlat-e.slat)*t;return 0===i&&0===o&&(i=o=.001),a(e,o,i)}const a=(e,t,i)=>({nlat:e.nlat+t,slat:e.slat-t,elng:e.elng+i,wlng:e.wlng-i}),s=(e,t)=>t.every((t=>l(e,t))),r=(e,t)=>{let i=t.length;for(let o=0;o<i;++o){if(l(e,t[o]))return!0;
1if(o>0&&d(e,t[o-1],t[o]))return!0}return!1},l=(e,t)=>t.x<=e.ne.lng&&t.x>=e.sw.lng&&t.y<=e.ne.lat&&t.y>=e.sw.lat,d=(e,t,i)=>{const o=c(t.x,t.y,i.x,i.y,e.sw.lng,e.sw.lat,e.ne.lng,e.sw.lat),n=c(t.x,t.y,i.x,i.y,e.ne.lng,e.sw.lat,e.ne.lng,e.ne.lat),a=c(t.x,t.y,i.x,i.y,e.sw.lng,e.ne.lat,e.ne.lng,e.ne.lat),s=c(t.x,t.y,i.x,i.y,e.sw.lng,e.sw.lat,e.sw.lng,e.ne.lat);return o||n||a||s},c=(e,t,i,o,n,a,s,r)=>{const l=(r-a)*(i-e)-(s-n)*(o-t);if(0===l)return!1;const d=((s-n)*(t-a)-(r-a)*(e-n))/l,c=((i-e)*(t-a)-(o-t)*(e-n))/l;return d>=0&&d<=1&&c>=0&&c<=1},u=e=>({lat:(e.ne.lat+e.sw.lat)/2,lng:(e.ne.lng+e.sw.lng)/2}),m=e=>e<-90?-90:e>90?90:e,h=e=>e<-180?-180:e>180?180:e,y=(e,t)=>{let i=e.defaultMapEngine;return(t.customWebMapProviderList||[]).some((e=>e.id===i))?i:t.mapProvider},p=(e,t)=>t.mapProvider!==e,f=e=>{try{return JSON.parse(e||"{}")}catch(e){return{}}},g=(e,t)=>JSON.stringify(Object.assign(Object.assign({},f(e)),t)),v=e=>{if(!e||"string"!=typeof e)return!1;try{const t=JSON.parse(e);return t&&"object"==typeof t&&!Array.isArray(t)}catch(e){return!1}}},4125(e,t,i){i.d(t,{Aq:()=>T,Bt:()=>r,GK:()=>f,Jq:()=>d,Nn:()=>w,Pe:()=>D,_K:()=>h,bE:()=>g,bR:()=>l,dT:()=>x,e4:()=>b,gS:()=>y,jx:()=>C,lM:()=>c,mM:()=>S,oQ:()=>s,w7:()=>m,xw:()=>p,y0:()=>v,zn:()=>u});var o=i(86397),n=i(10080);const a=-180;var s,r;!function(e){e.ROAD="roadmap",e.SATELLITE="satellite"}(s||(s={})),function(e){e.DARK="dark",e.LIGHT="light"}(r||(r={}));class l{constructor(e,t){this.x=e,this.y=t}}class d{constructor(e,t){this.lat=e,this.lng=t}}const c=e=>{let t=e.ne.lng>e.sw.lng?e.sw.lng:e.sw.lng-360,i=e.ne.lat;return{x:t,y:i,width:e.ne.lng>t?e.ne.lng-t:180+e.ne.lng+(180-t),height:e.sw.lat-i}},u=e=>{const t=e.y+e.height,i=e.y;if(e.width>=360)return{left:a,bottom:t,right:180,top:i};var o=e.x,s=e.x+e.width;return o<a&&(s=(o=(0,n.a)(o,360))+e.width),s>180&&(s=(0,n.a)(s,360)),{left:o,bottom:t,right:s,top:i}},m=e=>new h(e.y+e.height,e.x,e.y,e.x+e.width);class h{constructor(e,t,i,o){this.sw=new d(e,t),this.ne=new d(i,o)}}class y{constructor(){this.events=(0,o.Ay)()}load(e){this.events.fireEvent("load",this,e)}viewportChanged(e){this.events.fireEvent("viewportChanged",this,e)}zoomChanged(e){this.events.fireEvent("zoomChanged",this,e)}layerChanged(e){this.events.fireEvent("layerChanged",this,e)}endPan(e){this.events.fireEvent("endPan",this,e)}typeChanged(e){this.events.fireEvent("typeChanged",this,e)}setPointsOfInterestVisibility(e){}async captureBasemap(){return null}}function p(){return{legs:[],wayPoints:[],stat:[]}}class f{isFake(){return!1}}class g extends f{constructor(){super(...arguments),this.maxAmountOfPoints=0}isFake(){return!0}calcRoute(){return Promise.resolve({legs:[],wayPoints:[],stat:[]})}}class v{get shown(){return!1}set shown(e){}isFake(){return!1}update(){}}class D extends v{get shown(){return!1}set shown(e){}isFake(){return!0}update(){}}function w(e){return Math.abs(e)<180?e:e>0?(e+180)%360-180:(e-180)%360+180}function b(e,t){return Math.abs(t-e)>=360?[a,180]:[w(e),w(t)]}function S(e,t){let i=360*Math.round(e/360),o=360*Math.round(t/360);if(i===o)return i;let n=Math.abs(o-i);if(n>360)return i+(n-360);let a=t+180,s=e+180;return(360*Math.floor(a/360)-s)/(t-e)>.5?i:o}class C extends Error{constructor(){super(...arguments),this.isMapError=!0}}const T=e=>e.ne.lng>=e.sw.lng?e.ne.lng-e.sw.lng:e.ne.lng-(e.sw.lng-360),x=(e,t,i)=>e>=i.sw.lat&&e<=i.ne.lat&&t>=i.sw.lng&&t<=i.ne.lng;geotab.commonjs.generateExport("geotab.checkmate.maps.providers.mapCore").fromRectangleF=m},2643(e,t,i){function o(){var e=[];return{add:function(t){t&&(e.push(t),t.always((t=>()=>{e=e.filter((e=>e!==t))})(t)))},count:()=>e.length,last:()=>e[e.length-1],abort:function(){for(let t=e.length-1;t>=0;t--)e[t].abort()}}}i.d(t,{Z:()=>o})},10340(e,t,i){i.d(t,{T:()=>a});var o=i(92191),n=i(77789);function a(e,t,i){var a,s,r=(0,o.vt)("div",{class:"confirmDialog"}),l=i||{},d=(0,n.K)(r,{id:l.id||void 0,isModal:!0,addCloseButton:!!(null==i?void 0:i.addCloseButton),width:l.width||400,removeOnClose:!!l.removeOnClose,useZenithMobileView:!!l.useZenithMobileView,parentNode:e||document.body,classes:l.classes,zIndex:l.zIndex,buttons:[{name:"cancel",click:function(){c(s)}},{name:"ok",className:"geo-button geo-button--action dialogConfirmed",click:function(){c(a)}}]},t),c=function(e){e&&e(),d.close()},u=function(e,t,i,o){l.allowHTMLContent?r.innerHTML=t:r.textContent=t,d.title.set(e),d.buttons[1].set(i),o&&d.buttons[0].set(o),r.setAttribute("tabindex","-1"),r.setAttribute("role","alert")};if(l.titleIcon){let e=d.element.querySelector(".geo-dialog__header"),t=(0,o.yr)(l.titleIcon,"confirmDialog__title-icon");t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),null==e||e.insertBefore(t,e.firstChild)}return{confirm:function(e,t,i,o,n,l){5===arguments.length?(u(e,t,i),a=o,s=n):(u(e,t,i,o),a=n,s=l),d.show(null),r.focus()},isVisible:()=>d.isShown(),hideNegativeButton:()=>{d.buttons[0].hide()},close:()=>d.close(),destroy:()=>{d.destroy()}}}},55528(e,t,i){i.d(t,{AR:()=>r,Jg:()=>s,pJ:()=>a,vz:()=>n});var o=i(44654);const n=e=>e.filter(o.WI).reduce(((e,t)=>{const i=t.baseId;return e[i]?(e[i].push(t),e):(e[i]=[t],e)}),{}),a=e=>e.filter(o.WI).reduce(((e,t)=>(e[t.id]=t,e)),{}),s=(e,t)=>e.map((e=>{return Object.assign(Object.assign({},e),{name:(i=e.diagnosticId,t[i]||"")});var i})),r=(e,t,i,o)=>e?{parentId:o.id,name:t,displayMeasurementProfileDetails:{displayDetails:i.map((e=>Object.assign(Object.assign({},e),{profileId:null,version:null,id:null,name:null})))}}:Object.assign(Object.assign({},o),{name:null!=t?t:o.name,displayMeasurementProfileDetails:{displayDetails:i.map((e=>Object.assign(Object.assign({},e),{version:null,name:null})))}})},55719(e,t,i){i.d(t,{S:()=>s});var o=i(92191),n=i(20766);const a=(e,t,i,o)=>{let a=i?e.translateKey("ChangedRuleSetAnnotationCustomStartOfDay"):e.translateKey("ChangedRuleSetAnnotation"),s=(0,n.K1c)(t,e.translateKey),r=a.replace("{0}",s).replace("{1}",e.toShortDateTime(new Date));return i?r.replace("{2}",(0,n.xd3)(e,o)):r};function s(e,t,i,n,s,r,l){return""===r?Promise.resolve(!0):t.getItemsByValue({fromDate:new Date,toDate:new Date,includeBoundaryLogs:!0,statuses:["D","ON","SB","OFF","YM","PC","PC_Exempted","WT"],userSearch:{id:l}}).then((function(t){let d=n.hosRuleSet.id,c=[a(e,d,s,n.startOfDay),r],u=new Date(Date.now()-c.length),m=c.reduce(((e,t)=>(t&&e.push(((e,t,i)=>({driver:{id:t},comment:e.replace(/[\r\n|\r|\n]+/," "),dateTime:(i||new Date).toISOString()}))(t,l,u)),u.setMilliseconds(u.getMilliseconds()+1),e)),[]);if(t&&t.length>0){let e;return t.sort(((e,t)=>e.dateTime>t.dateTime?-1:1)),e=(0,o.X$)({},t[0]),e.annotations=e.annotations||[],m.forEach((t=>{e.annotations.push(t)})),i.setItem(e)}return i.addItem({dateTime:new Date,status:"OFF",device:"NoDeviceId",driver:{id:l},origin:"Manual",annotations:m})}))}},47689(e,t,i){i.d(t,{G:()=>n});var o=i(20766);function n(e,t,i){let n=e=>"string"==typeof e?new Date(e).getTime():e.getTime();if(!(0,o.NM_)(e.hosRuleSet.id))return Promise.resolve({isValid:!0});let a=e.dateTime?new Date("string"==typeof e.dateTime?e.dateTime:e.dateTime.getTime()):new Date,s=new Date(a.getTime());return s.setMonth(s.getMonth()-1),i.getItemsByValue({userSearch:{id:e.user.id},fromDate:s.toISOString(),toDate:a.toISOString()}).then((i=>{let a=i;
1e.id&&(a=a.filter((t=>e.id!==t.id))),a.sort(((e,t)=>e.dateTime>t.dateTime?1:-1));let s=a.length&&(0,o.U4V)(a,e.dateTime);return a.length&&s?(i=>{let a={isValid:!0};return n(i.dateTime)>=n(e.dateTime)?Promise.resolve(a):t("Get",{typeName:"DriverRegulation",search:{userSearch:{id:e.user.id},fromDate:i.dateTime,toDate:e.dateTime}}).then((t=>{let n=t&&t[0];return n&&n.rulesetsThatCannotChange&&n.rulesetsThatCannotChange.length>0&&(a.ruleSetToComplete=i,i.hosRuleSet.id!==e.hosRuleSet.id?(0,o.CUm)((0,o.tlz)(i.hosRuleSet.id))!==(0,o.CUm)((0,o.tlz)(e.hosRuleSet.id))&&(a.invalidProperty="hosRuleSet",a.isValid=!1):!i.startOfDay&&"00:00:00"===e.startOfDay||i.startOfDay===e.startOfDay||(a.invalidProperty="startOfDay",a.isValid=!1)),Promise.resolve(a)}))})(new o.UEZ(s)):Promise.resolve({isValid:!0})}))}},2766(e,t,i){i.d(t,{Ay:()=>r,bv:()=>a,fm:()=>s});var o=i(92191),n=i(44654);const a="alert-field-error__text",s=e=>`\n<div class="alert-field-error error-message">\n <svg class="geo-icon alert-field-error icon-attention geotabButtonIcons" focusable="false">\n <use xlink:href="#geo-attention"></use>\n </svg>\n <span>${e}</span>\n</div>`.trim();class r{constructor(){this.messageIds=[]}createAttentionIcon(){return(0,o.wt)("attention","alert-field-error icon-attention","false")}getCurrentErrorMessageField(e){return("DIV"===e.nodeName?e:e.parentNode).querySelector(".error-message")}displayFailed(e){var t;let i=e.id||(0,n.$C)(),s=e.field.classList.contains("wide-field"),r=e.field.parentElement||e.field,l="";s&&r.classList.contains("zenith-form__field")?l="error-grid-wrapper":s&&(l="error-wrapper");let d=(0,o.vt)("div",{id:i,role:"alert",class:`alert-field-error error-message ${l}`});const c=this.getCurrentErrorMessageField(e.field);if(c){if(c.textContent===e.message)return c.id;c.remove()}const u=(0,o.vt)("span");u.innerHTML=e.message;const m="DIV"===e.field.nodeName?e.field:e.field.parentNode,h=e.errorElementContainer||m;if(!e.ignoreErrorClass)if(m.classList.contains("combo-box-error")){let e=m.childNodes[0];!e.classList.contains(a)&&e.classList.add(a)}else!e.field.classList.contains(a)&&e.field.classList.add(a);h.append(d);const y=["INPUT","SELECT","TEXTAREA"].includes(e.field.nodeName)?e.field:null!==(t=e.field.querySelector("input, select, textarea"))&&void 0!==t?t:e.field;return y.setAttribute("aria-describedby",i),y.setAttribute("aria-invalid","true"),d.append(this.createAttentionIcon()),d.append(u),d.style.display="block",this.messageIds.push(i),i}hideMessage(e){var t;const i=document.getElementById(e);-1!==this.messageIds.indexOf(e)&&this.messageIds.splice(this.messageIds.indexOf(e),1);const o=document.querySelector(`[aria-describedby="${e}"]`);o&&(o.removeAttribute("aria-describedby"),o.removeAttribute("aria-invalid")),i&&i.parentNode.classList.remove(a),i&&(null===(t=i.parentNode.querySelector(".alert-field-error__text"))||void 0===t||t.classList.remove(a)),i&&i.parentNode.removeChild(i)}hideMessages(){this.messageIds.length&&this.messageIds.slice(0).forEach((e=>this.hideMessage(e)))}}},69971(e,t,i){i.d(t,{A:()=>a});var o=i(92191),n=i(44654);class a{displayMessage(e,t=!1){var i,a,s;let r=e.id||(0,n.$C)(),l=(0,o.vt)("div",{id:r,class:`alert alert--${t?"error":"success"} inlineSaveMessage`,role:t?"alert":"status"},{display:"none"}),d=e.container||this.defaultContainer;this.delay=e.hideDelay||this.delay,this.hideMessages(),l.textContent=e.message||"";const c=(null===(i=e.field)||void 0===i?void 0:i.title)?`${null===(a=e.field)||void 0===a?void 0:a.title} `:"";if(l.ariaLabel=`${c}${null!==(s=e.message)&&void 0!==s?s:""}`,e.list){let t=(0,o.vt)("ul");e.list.reduce(((e,t)=>{let i=(0,o.vt)("li");return i.textContent=t,e.appendChild(i),e}),t),l.appendChild(t)}return d&&d.insertBefore(l,d.firstChild),this.messageIds.push(r),this.timerId&&clearTimeout(this.timerId),l.style.display="block",e.field&&e.field.focus(),t&&!e.preventAutoHide&&(this.timerId=setTimeout((()=>{this.hideMessage(r),e.callback&&e.callback(r)}),this.delay)),r}constructor(e,t){this.messageIds=[],this.delay=5e3,this.defaultContainer=e,t&&(this.delay=t.hideDelay||this.delay)}displaySaved(e){return this.displayMessage(e)}displayFailed(e){return this.displayMessage(e,!0)}hideMessage(e=""){let t=document.getElementById(e);-1!==this.messageIds.indexOf(e)&&this.messageIds.splice(this.messageIds.indexOf(e),1),t&&t.parentNode.removeChild(t)}hideMessages(){this.messageIds.length&&this.messageIds.forEach((e=>e&&this.hideMessage(e)))}unload(){this.hideMessages(),clearTimeout(this.timerId)}}},11937(e,t,i){i.d(t,{A:()=>m});var o=i(86397),n=i(92191),a=i(44654),s=i(31129),r=i(721);const l=(0,a.dB)([13]),d=(0,a.dB)([27,9]),c=(0,a.dB)([38]),u=(0,a.dB)([40]);class m extends o.FZ{renderOption(e,t,i){return`${t&&t.section!==e.section?this.renderSeparator():""}<li id="${(0,a.$C)()}" data-id="${(0,a.z)(e.value)}" class="custom-select__option${e.disabled?" custom-select__option--disabled":""}" role="option" aria-label="${(0,a.z)(e.label)}" ${e.disabled?"aria-disabled=true":""}>${i}</li>`}renderSeparator(){return'<li class="custom-select__separator" role="separator" aria-disabled="true"></li>'}searchSelected(e){let t=e;for(;t&&t!==this.selectList&&!t.hasAttribute("data-id");)t=t.parentElement;if(!t.hasAttribute("data-id"))return;let i=t.getAttribute("data-id");return this.items.filter((e=>e.value===i))[0]}toggleList(e){if(this.isShown!==e){if(this.options.wide&&e&&(this.selectListWrapper.style.width=Math.max(this.parent.offsetWidth,30)+"px"),this.isShown=e,(0,n.jY)(this.selectListWrapper,this.shownModifier,e),this.selectList.setAttribute("aria-expanded",e.toString()),e)return this.selectElt.blur(),this.selectList.focus(),this.selectList.addEventListener("keydown",this.scrollUp,!1),this.selectList.addEventListener("keydown",this.scrollDown,!1),this.selectList.addEventListener("keyup",this.moveUp,!1),this.selectList.addEventListener("keyup",this.moveDown,!1),this.selectList.addEventListener("keypress",this.enterFn,!1),this.selectList.addEventListener("keyup",this.escapeFn,!1),this.global.addEventListener("click",this.clickOutside,!1),this.nextSelection=this.selection,void(void 0!==this.selection&&this.select(this.selection));this.selectElt.focus(),this.selectList.removeEventListener("keydown",this.scrollUp,!1),this.selectList.removeEventListener("keydown",this.scrollDown,!1),this.selectList.removeEventListener("keyup",this.moveUp,!1),this.selectList.removeEventListener("keyup",this.moveDown,!1),this.selectList.removeEventListener("keypress",this.enterFn,!1),this.selectList.removeEventListener("keyup",this.escapeFn,!1),this.global.removeEventListener("click",this.clickOutside,!1)}}indexBySelection(e){for(let t=0;t<this.items.length;t++)if(e.value===this.items[t].value)return t;return-1}getNextIndex(e,t,i){let o=e+i;return o<0?t-1:o>=t?0:o}select(e){let t=this.selectList.querySelector(`.${this.selectedModifier}`);t&&(t.classList.remove(this.selectedModifier),this.options.listItemSelectedClass&&t.classList.remove(this.options.listItemSelectedClass),t.removeAttribute("aria-selected"));let i=this.selectList.querySelector(`[data-id="${e.value}"]`);if(i){i.classList.add(this.selectedModifier),this.options.listItemSelectedClass&&i.classList.add(this.options.listItemSelectedClass),i.setAttribute("aria-selected","true"),this.selectList.setAttribute("aria-activedescendant",i.id);let e=Math.round(this.selectList.offsetHeight/2),t=Math.max(i.offsetTop-i.offsetHeight,0);t<this.selectList.scrollTop&&(this.selectList.scrollTop=t-e);let o=this.selectList.scrollTop,n=i.offsetTop+i.offsetHeight;n>o&&(this.selectList.scrollTop=n-i.offsetHeight-e)}}moveSelection(e,t){if(this.nextSelection=this.nextSelection||this.selection,void 0===this.nextSelection)return;let i=this.getNextIndex(this.indexBySelection(this.nextSelection),this.items.length,e);this.nextSelection=this.items[i],this.nextSelection.disabled&&this.nextSelection!==t?this.moveSelection(e,t||this.nextSelection):this.select(this.nextSelection)}moveNext(e){return t=>{t.preventDefault(),this.scrolling=!1,clearTimeout(this.scrollingTimer),this.scrollingTimer=void 0,this.moveSelection(e)}}scrollNext(e){return t=>{t.preventDefault(),this.scrolling?this.moveSelection(e):this.scrollingTimer||(this.scrollingTimer=setTimeout((()=>{this.scrolling=!0,this.moveSelection(e)}),400))}}constructor(e,t,i,o,m,h,y="",p){super(),this.parent=e,this.global=t,this.renderItem=i,this.renderSelectedItem=o,this.items=[],this.isShown=!1,this.scrolling=!1,this.shownModifier="custom-select__wrapper--shown",this.selectedModifier="custom-select__option--selected",this.clickOutside=e=>{let t=e.target;for(;t&&t!==this.parent;)t=t.parentElement;t||this.toggleList(!1)},this.pickItem=e=>{const t=this.searchSelected(e)||this.selection;t&&t.disabled||(this.selection=t,void 0!==this.selection&&(this.value=this.selection.value,this.toggleList(!1),this.fire("change",Object.assign({},this.selection))))},this.options=Object.assign({wide:!1,label:"",listItemSelectedClass:""},m),this.moveUp=u(this.moveNext(1)),this.moveDown=c(this.moveNext(-1)),this.scrollDown=c(this.scrollNext(-1)),this.scrollUp=u(this.scrollNext(1)),this.enterFn=l((()=>{let e=this.selectList.querySelector(`.${this.selectedModifier}:not(.custom-select__option--disabled)`);e&&this.pickItem(e)})),this.escapeFn=d((()=>{this.toggleList(!1),this.selectElt.focus()})),e.classList.add("custom-select"),this.options.wide&&e.classList.add("custom-select--wide"),this.options.useNewUI&&e.classList.add("custom-select--new-ui");let f=(0,n.Kb)((0,s.h$)(this.options.label,(0,a.$C)(),this.options.useNewUI,y,!!p,this.options.buttonId));f.forEach((t=>{e.appendChild(t)})),this.selectListWrapper=f[1],this.selectList=f[1].children[0],this.selectList.addEventListener("click",(e=>{this.pickItem(e.target)}),!1),this.selectElt=f[0],this.selectElt.addEventListener("click",(()=>{this.toggleList(!this.selectListWrapper.classList.contains(this.shownModifier))}),!1),this.selectElt.addEventListener("keyup",this.escapeFn,!1),p?(this.selectListWrapper.querySelector(".custom-select__fixed-item").appendChild(p),p.addEventListener("blur",(()=>this.toggleList(!1)))):this.selectList.addEventListener("blur",(()=>this.toggleList(!1))),this.options.zenithTooltipEnabled&&(0,r.wS)([{parent:this.parent,selector:".zenith-select",position:r._m.Top}],h)}updateItem(e,t=!1,i=!1){var o;this.items=t?i?[...e,...this.items]:[...this.items,...e]:e,this.selectList.innerHTML=this.items.filter((e=>void 0!==e.data)).map(((e,t,i)=>this.renderOption(e,i[t-1],this.renderItem(e.data)))).join("");let n=null===(o=this.selection)||void 0===o?void 0:o.value;n&&!this.items.every((e=>e.value!==n))||(this.value=this.items[0].value)}focus(){this.selectElt.focus()}set disabled(e){this.selectElt.disabled=e,this.toggleList(!1)}get disabled(){return this.selectElt.disabled}set value(e){let t=this.items.filter((t=>t.value===e));t.length>0&&(this.selection=t[0],this.select(this.selection),this.selectElt.innerHTML=this.renderSelectedItem(this.selection.data))}get value(){return this.selection?this.selection.value:""}}},31129(e,t,i){i.d(t,{Ue:()=>o,dd:()=>n,h$:()=>a});const o=(e,t,i)=>`\n<span class="custom-selected-item ${e}" id="${t}" aria-hidden="true">\n <span class="custom-selected-item__name">${i}</span>\n <svg class="custom-selected-item__icon"><use xlink:href="#geo-new-arrow-down"></use></svg>\n</span>\n`.trim(),n=e=>`\n<div class="inline-custom-select ${e}"></div>\n`.trim(),a=(e,t,i=!1,o="",n,a)=>`\n <button aria-haspopup="listbox" aria-controls="${t}" class="custom-select__selection ${i?"":"custom-select__selection--clean"} ${o}" ${a?`id="${a}"`:`aria-label="${e}"`} title="${e}" data-tooltip="${e}"></button>\n <div class="custom-select__wrapper">\n <ul tabindex="-1" role="listbox" id="${t}" class="custom-select__list"></ul>\n ${n?'<div class="custom-select__fixed-item"></div>':""}\n </div>\n`.trim()},79374(e,t,i){i.d(t,{Fj:()=>f,K9:()=>v,OL:()=>g,Vp:()=>u,Vv:()=>m,fA:()=>h,vQ:()=>p});var o=i(35271),n=i(96732),a=i(32449),s=i(8914),r=i(78300),l=i(98922),d=i(92459),c=i(73797);function u(e,t){return e.latitude===t.latitude&&e.longitude===t.longitude}const m=(e,t)=>
1e(r.u.FRONTEND_MAP_TOOLBAR_PROD)||(0,n.jI)(t,a.O5.NEW_MAP_TOOLBAR),h=(e,t)=>m(e,t)||(0,o.l)(e,t);function y(e,t,i){if(0===e.length)return;if(t>e.length-1)return;let o=e[t],n=i(t);for(;e[n];){if(!u(o,e[n]))return e[n];n=i(n)}}function p(e,t){return y(e,t,(e=>e+1))}function f(e,t){return y(e,t,(e=>e-1))}const g=()=>{var e;return"map"===(null===(e=(0,l.K)().hash)||void 0===e?void 0:e.replace("#","").split(",")[0])},v=(e,t)=>(g()||(0,s.Me)())&&(e("RouteList",(0,c.Q8)(c.SD.RoutePlanning))||e("ViewRoute",(0,c.iC)(c.SD.RoutePlanning)))&&(!t||t(d.q.BasicRouting))},48644(e,t,i){i.d(t,{b:()=>n,g:()=>a});var o=i(92191);const n="geoNewUserQuestionnaireInfoClosed";class a{constructor(e,t,i,o){this.container=e,this.translate=t,this.systemSettingsUrl=i,this.storage=o}render(e){this.container.innerHTML=((e,t,i)=>{const o=e?"Questionnaire for new users is enabled.":"Questionnaire for new users is disabled.";return`\n <div class="alert alert--info alert--accented alert--tall">\n <div class="new-user-questionnaire-alert alert__content">\n <div class="new-user-questionnaire-alert__content">\n <span class="new-user-questionnaire-alert__heading">${t("New User Onboarding")}</span>\n <span class="new-user-questionnaire-alert__text">${t(o)}</span>\n </div>\n <a href="${i}" class="new-user-questionnaire-alert__link">${t("View System Settings")}</a>\n </div>\n <button class="alert__close-button alert__close-button--offset-top" title="${t("Close warning")}" aria-label="${t("Close warning")}">\n <svg class="alert__svg-icon"><use xlink:href="#geo-cross-thin"></use></svg>\n </button>\n </div>\n `})(e,this.translate,this.systemSettingsUrl),this.container.querySelector(".alert__close-button").addEventListener("click",(()=>{this.hide(),this.storage.setItem(n,"true",!0)}))}show(){(0,o.L$)(this.container,!0)}hide(){(0,o.L$)(this.container,!1)}}a.translations=["Questionnaire for new users is enabled.","Questionnaire for new users is disabled.","New User Onboarding","View System Settings","Close warning"]},10088(e,t,i){i.d(t,{b:()=>o});const o=(e,t)=>!e&&!t},69949(e,t,i){i.d(t,{F4:()=>n,Mb:()=>
1o,Xx:()=>a,qC:()=>s});const o=["Other","",1,""],n=[["Canada","1",5,"ca","(XXX) XXX-XXXX"],["United States","1",5,"us","(XXX) XXX-XXXX"],["Albania","355",1,"al","XXX XXX XXXX"],["Algeria","213",1,"dz","XXXX XX XX XX"],["Andorra","376",1,"ad","XXX XXX"],["Angola","244",1,"ao","XXX XXX XXX"],["Argentina","54",1,"ar","XXX XX-XXXX-XXXX"],["Armenia","374",1,"am","XXX XXXXXX"],["Australia","61",1,"au","(XXX) XXX-XXXX"],["Austria","43",1,"at","XXXX XXXXXXX"],["Azerbaijan","994",1,"az","XXX XXX XX XX"],["Bahamas","1-242",1,"bs","(XXX) XXX-XXXX"],["Bahrain","973",1,"bh","XXXX XXXX"],["Bangladesh","880",1,"bd","XXXXX-XXXXXX"],["Belarus","375",1,"by","(XX) XXX XX XX"],["Belgium","32",1,"be","XXXX XX XX XX"],["Belize","501",1,"bz","XXX-XXXX"],["Bhutan","975",1,"bt","XX XX XX XX"],["Bolivia","591",1,"bo","X"],["Bosnia and Herzegovina","387",1,"ba","XXX XXX XXX"],["Botswana","267",1,"bw","XX XXX XXX"],["Brazil","55",1,"br","(XX) XXXX-XXXX"],["Bulgaria","359",1,"bg","XXX XXX XXX"],["Burkina Faso","226",1,"bf","XX XX XX XX"],["Cambodia","855",1,"kh","XXX XXX XXX"],["Cameroon","237",1,"cm","X XX XX XX XX"],["Central African Republic","236",1,"cf","XX XX XX XX"],["Chad","235",1,"td","XX XX XX XX"],["Chile","56",1,"cl","(X) XXXX XXXX"],["China","86",1,"cn","XX XXXX XXXX"],["Colombia","57",1,"co","XXX XXXXXXX"],["Costa Rica","506",1,"cr","XXXX XXXX"],["Croatia","385",1,"hr","XXX XXX XXXX"],["Cuba","53",1,"cu","XX XXXXXXX"],["Cyprus","357",1,"cy","XX XXXXXX"],["Czech Republic","420",1,"cz","XXX XXX XXX"],["Democratic Republic of the Congo","243",1,"cd","X"],["Denmark","45",1,"dk","XX XX XX XX"],["Dominican Republic","1",1,"do","(XXX) XXX-XXXX"],["Ecuador","593",1,"ec","XXX XXX XXXX"],["Egypt","20",1,"eg","XXXX XXX XXXX"],["El Salvador","503",1,"sv","XXXX XXXX"],["Estonia","372",1,"ee","XXXX XXXX"],["Ethiopia","251",1,"et","XXX XXX XXXX"],["Finland","358",1,"fi","XXX XXXXXXX"],["France","33",1,"fr","XX XX XX XX XX"],["Gabon","241",1,"ga","XX XX XX XX"],["Georgia","995",1,"ge","XXX XX XX XX"],["Germany","49",1,"de","XX XXXX XXXX"],["Ghana","233",1,"gh","XXX XXX XXXX"],["Greece","30",1,"gr","XXX XXX XXXX"],["Guatemala","502",1,"gt","XXXX XXXX"],["Guinea","224",1,"gn","XXX XX XX XX"],["Guinea-Bissau","245",1,"gw","XXX XXX XXX"],["Guyana","592",1,"gy","XXX XXXX"],["Honduras","504",1,"hn","XXXX-XXXX"],["Hong Kong","852",1,"hk","XXXX XXXX"],["Hungary","36",1,"hu","(XX) XXX XXXX"],["Iceland","354",1,"is","XXX XXXX"],["India","91",1,"in","XXXXXX XXXXX"],["Indonesia","62",1,"id","XXXX-XXX-XXX"],["Ireland","353",1,"ie","XXX XXX XXXX"],["Israel","972",1,"il","XXX-XXX-XXXX"],["Italy","39",1,"it","XXX XXX XXXX"],["Ivory Coast","225",1,"ci","X"],["Jamaica","1",1,"jm","(XXX) XXX-XXXX"],["Japan","81",1,"jp","XXX-XXXX-XXXX"],["Jordan","962",1,"jo","XX XXXX XXXX"],["Kazakhstan","7",1,"kz","X (XXX) XXX XXXX"],["Kenya","254",1,"ke","XXXX XXXXXX"],["Kosovo","383",1,"xk","XXX XXX XXX"],["Laos","856",1,"la","XXX XX XXX XXX"],["Latvia","371",1,"lv","XX XXX XXX"],["Lebanon","961",1,"lb","XX XXX XXX"],["Lesotho","266",1,"ls","XXXX XXXX"],["Liberia","231",1,"lr","XXX XXX XXXX"],["Libya","218",1,"ly","XXX-XXXXXXX"],["Liechtenstein","423",1,"li","XXX XXX XXX"],["Lithuania","370",1,"lt","X"],["Luxembourg","352",1,"lu","XXX XXX XXX"],["Macedonia","389",1,"mk","XXX XXX XXX"],["Madagascar","261",1,"mg","XXX XX XXX XX"],["Malawi","265",1,"mw","XXXX XX XX XX"],["Malaysia","60",1,"my","XXX-XXX XXXX"],["Mali","223",1,"ml","XX XX XX XX"],["Malta","356",1,"mt","XXXX XXXX"],["Mauritania","222",1,"mr","XX XX XX XX"],["Mexico","52",1,"mx","XX XXXX XXXX"],["Moldova","373",1,"md","XXXX XX XXX"],["Monaco","377",1,"mc","XX XX XX XX XX"],["Mongolia","976",1,"mn","XXXX XXXX"],["Montenegro","382",1,"me","XXX XXX XXX"],["Morocco","212",1,"ma","XXXX-XXXXXX"],["Mozambique","258",1,"mz","XX XXX XXXX"],["Myanmar","95",1,"mm","XX XXX XXXX"],["Namibia","264",1,"na","XXX XXX XXXX"],["Nepal","977",1,"np","XXX-XXXXX"],["Netherlands","31",1,"nl","XX XXXXXXXX"],["New Zealand","64",1,"nz","XXX XXX XXXX"],["Nicaragua","505",1,"ni","XXXX XXXX"],["Niger","227",1,"ne","XX XX XX XX"],["Nigeria","234",1,"ng","XXXX XXX XXXX"],["Norway","47",1,"no","XXX XX XXX"],["Oman","968",1,"om","XXXX XXXX"],["Panama","507",1,"pa","XXXX-XXXX"],["Pa
1pua New Guinea","675",1,"pg","XXXX XXXX"],["Paraguay","595",1,"py","XXXX XXXX"],["Peru","51",1,"pe","XXX XXX XXX"],["Philippines","63",1,"ph","XXXX XXX XXXX"],["Poland","48",1,"pl","XXX-XXX-XXX"],["Portugal","351",1,"pt","XXX XXX XXX"],["Qatar","974",1,"qa","XXXX XXXX"],["Republic of the Congo","242",1,"cg","X"],["Romania","40",1,"ro","XXXX XXX XXX"],["Russia","7",1,"ru","XXX XXX-XX-XX"],["Rwanda","250",1,"rw","XXXX XXX XXX"],["San Marino","378",1,"sm","XX XX XX XX"],["Saudi Arabia","966",1,"sa","XXX XXX XXXX"],["Senegal","221",1,"sn","XX XXX XX XX"],["Serbia","381",1,"rs","XXX XXXXXX"],["Sierra Leone","232",1,"sl","(XXX) XXXXXX"],["Singapore","65",1,"sg","XXXX XXXX"],["Slovakia","421",1,"sk","XXXX XXX XXX"],["Slovenia","386",1,"si","XXX XXX XXX"],["South Africa","27",1,"za","XXX XXX XXXX"],["South Korea","82",1,"kr","XXX-XXXX-XXXX"],["South Sudan","211",1,"ss","XXXX XXX XXX"],["Spain","34",1,"es","XXX XX XX XX"],["Sri Lanka","94",1,"lk","XXX XXX XXXX"],["Sudan","249",1,"sd","XXX XXX XXXX"],["Suriname","597",1,"sr","XXX-XXXX"],["Swaziland","268",1,"sz","XXX XXX XX XX"],["Sweden","46",1,"se","XXX-XXX XX XX"],["Switzerland","41",1,"ch","XXXX XXXX"],["Taiwan","886",1,"tw","XXXX XXX XXX"],["Tajikistan","992",1,"tj","XXX XX XXXX"],["Tanzania","255",1,"tz","XXXX XXX XXX"],["Thailand","66",1,"th","XXX XXX XXXX"],["Tunisia","216",1,"tn","XX XXX XXX"],["Turkey","90",1,"tr","XXXX XXX XX XX"],["Turkmenistan","993",1,"tm","X"],["Uganda","256",1,"ug","XXXX XXXXXX"],["Ukraine","380",1,"ua","XXX XXX XXXX"],["United Arab Emirates","971",1,"ae","XXX XXX XXXX"],["United Kingdom","44",1,"gb","XXXXX XXXXXX"],["Uruguay","598",1,"uy","XXX XXX XXX"],["Uzbekistan","998",1,"uz","X"],["Venezuela","58",1,"ve","XXXX-XXXXXX"],["Vietnam","84",1,"vn","XXX XXX XX XX"],["Zambia","260",1,"zm","XXX XXXXXXX"],["Zimbabwe","263",1,"zw","XXX XXX XXXX"]],a=[...n,o],s=a.map((e=>e[0]))},45491(e,t,i){i.d(t,{CO:()=>n,JH:()=>s,M_:()=>a,eQ:()=>l,iK:()=>d,j:()=>r});var o=i(69949);const n=(e,t)=>{let i="",o=e.split("").reverse();for(let e=0;e<t.length&&o.length;e++)i+="X"===t[e]?o.pop():t[e];return i+o.reverse().join("")},a=(e,t)=>{if(!e)return"";if(""===t[1])return e;let i=e.replace(`+${t[1]}`,"").trim();return`+${t[1]} ${n(i,t[4]||"")}`},s=e=>{let t=(e||"").trim();if(t.startsWith("+")){let e=t.slice(1),i=o.F4.filter((([t,i])=>e.startsWith(i)));if(i.length>0){let t=i[0][1];return[`+${t}`,e.slice(t.length).trim()]}}return["",t]},r=(e,t)=>{let i=(e||"").trim(),n=t?"":o.F4[0][1];if(0!==i.length){let e=i.split(" ");n=e.length>1?e[0]:""}return((e,t)=>{if(e){let i=e.trim().replace("+",""),n=o.F4.filter((([e,t])=>t===i));return n.filter((e=>e[3]===t))[0]||n[0]}if(t)return o.F4.filter((e=>e[3]===t))[0]})(n,t)||o.Mb},l=(e,t)=>{if(e){const i=t?`p${t}`:"";return`+${e.replace(/\D/gim,"").trim()}${i}`}return""},d=(e,t,i,o)=>{if(e){let n=a(e,r(e,t||""));if(n)return n+((e,t)=>e?` ${t("ext.")} ${e}`:"")(i,o)}return""}},14724(e,t,i){i.d(t,{Qi:()=>y,TW:()=>h});var o=i(92191),n=i(69949);var a=i(11937),s=i(44654),r=i(45491),l=i(86397),d=i(721);const c=/\D/gi,u=/[^\d#\*]/g,m=/[^\d\(\)-\+\s]/g;class h extends l.FZ{unformat(e,t){if(t[1])return e.replace(c,"");let[i,...o]=e.split(" ");return`${i} ${o.join(" ").replace(m,"")}`}setPhoneNumber(e,t){let i=e;if(t[1])i=this.unformat(e.replace(`+${t[1]}`,"").trim(),t);else{let t=e;i="+"!==t[0]?`+${t}`:t}this.phoneElt.value=i?(0,r.CO)(i,t[4]||""):""}constructor(e,t,i,r=!1,l="",u="",m="",h=!1,y,p,f){super(),this.noExtModifier="phone-number--no-extension",this.content=(0,o.Kb)(((e,t,i,o="")=>`<div class="phone-number noTranslate ${e}" dir="ltr">\n <div class="phone-number__phone">\n <div class="phone-number__code"></div>\n <input id="${t}" class="phone-number__number geotabFormEditField geo-text-input" type="text" ${o?`title="${i(o)}" data-tooltip="${i(o)}"`:""}>\n </div>\n <div class="phone-number__ext-part">\n <label for="phone-number-extension"" class="phone-number__ext-label"></label>\n <input id="phone-number-extension" class="phone-number__ext geotabFormEditField geo-text-input" type="text" pattern="[0-9]*" maxlength="5" ${o?`title="${i(o)}" data-tooltip="${i(o)}"`:""}>\n </div>\n</div>`)(l,u,i,m))[0],y&&(this.onChangeCode=y),p&&(this.onChangeExt=p),f&&(this.onChangePhoneNumberValue=f),this.code=n.F4[0],this.phoneElt=this.content.querySelector(".phone-number__number"),this.phoneElt.addEventListener("input",(()=>
1{this.setPhoneNumber(this.phoneElt.value,this.code),this.fire("change")}),!1),this.extElt=this.content.querySelector(".phone-number__ext"),this.extElt.addEventListener("input",(()=>{this.extElt.value=this.extElt.value.replace(c,""),p&&p(this.extElt.value),this.fire("change")}),!1),this.content.classList.toggle(this.noExtModifier,r),this.content.querySelector(".phone-number__ext-label").textContent=i("Ext."),this.codeSelect=new a.A(this.content.querySelector(".phone-number__code"),t,(e=>`\n <div class="phone-number__code-option code-option">\n <div class="code-option__flag">\n <div class="country-flag country-flag__${e[3]||"other"}"></div>\n </div>\n <span class="code-option__name">${(0,s.z)(i(e[0]))}</span>\n <span class="code-option__code">${(e[1]?"+":"")+(0,s.z)(e[1])}</span>\n </div>`.trim()),(e=>`\n <div class="phone-number__selected-code code-selection">\n <div class="code-selection__flag">\n <div class="country-flag country-flag__${e[3]||"other"}"></div>\n </div>\n <div class="code-selection__arrows">\n <svg class="code-selection__icon code-selection__up"><use xlink:href="#geo-arrow-up"></use></svg>\n <svg class="code-selection__icon code-selection__down"><use xlink:href="#geo-arrow-down"></use></svg>\n </div>\n </div>`.trim()),{label:i("Select country code")},i),this.codeSelect.attach("change",(({data:e})=>{this.code=e,this.setPhoneNumber(this.phoneElt.value,this.code),y&&y(this.code[3]),this.phoneElt.focus(),this.fire("change")})),this.codeSelect.updateItem(n.F4.concat([n.Mb]).map((e=>({value:e[3],section:e[2].toString(),label:`${e[0]}: +${e[1]}`,data:e})))),e.appendChild(this.content),h&&(0,d.wS)([{parent:this.content,selector:".phone-number__number",position:d._m.TopLeft},{parent:this.content,selector:".phone-number__ext",position:d._m.TopRight}],i)}set phone(e){let t=(e.phoneNumber||"").trim();this.code=(0,r.j)(t,e.countryCode||""),this.codeSelect.value=this.code[3],this.setPhoneNumber(t,this.code),this.extElt.value=e.extension||""}get phone(){let e=this.unformat(this.phoneElt.value,this.code).trim(),t=this.code[1]?`+${this.code[1]}`:"";return{countryCode:this.code[3],phoneNumber:e?`${t} ${e}`.trim():"",extension:this.extElt.value.replace(u,"")}}set disabled(e){this.phoneElt.disabled=e,this.extElt.disabled=e,this.codeSelect.disabled=e}get disabled(){return this.phoneElt.disabled}focus(){this.codeSelect.focus()}get input(){return this.phoneElt}}h.translations=["Ext.","Select country code",...n.F4.map((([e])=>e)),n.Mb[0]];class y extends l.FZ{constructor(){super(...arguments),this.disabled=!1}set phone(e){}get phone(){return{countryCode:"",phoneNumber:"",extension:""}}focus(){}get input(){}}},49264(e,t,i){var o;i.d(t,{Q7:()=>s,XZ:()=>o,YN:()=>l,eL:()=>d,tf:()=>r}),function(e){e.Empty="Empty",e.InvalidSymbols="InvalidSymbols",e.Max20Symbols="Max20Symbols",e.Min7Digits="Min7Digits",e.MissingCountryCode="MissingCountryCode",e.WrongPhoneExtension="WrongPhoneExtension"}(o||(o={}));const n=/[^+-\d\s]/,a=(e,t)=>e+(isNaN(+t)?0:1),s=e=>{let t=e.split(" ")[1];return 0===e.length?o.Empty:e.length>20?o.Max20Symbols:-1!==e.search(n)?o.InvalidSymbols:"+"!==e[0]||-1===e.indexOf(" ")?o.MissingCountryCode:t.split("").reduce(a,0)<7?o.Min7Digits:void 0},r=e=>{let t=s(e.phoneNumber);return void 0!==t?t:e.extension.length>5||e.extension.split("").reduce(a,0)<e.extension.length?o.WrongPhoneExtension:void 0},l=(e,t)=>{switch(e){case o.Max20Symbols:return t("Phone numbers cannot exceed 20 characters.");case o.InvalidSymbols:return t("Phone numbers can only contain digits, space
1s, and the characters + and -.");case o.Min7Digits:case o.Empty:return t("Phone numbers must have at least seven digits.");case o.MissingCountryCode:return t("Phone numbers must contain a country code that starts with a + character that is separated by a space from rest part of phone number. For example: +XXX XXXXXXXXX");case o.WrongPhoneExtension:return t("Phone number extensions cannot exceed five characters and must contain only digits.");default:return""}},d=()=>["Phone numbers cannot exceed 20 characters.","Phone numbers must have at least seven digits.","Phone numbers can only contain digits, spaces, and the characters + and -.","Phone numbers must contain a country code that starts with a + character that is separated by a space from rest part of phone number. For example: +XXX XXXXXXXXX","Phone number extensions cannot exceed five characters and must contain only digits."]},721(e,t,i){i.d(t,{_m:()=>d,cf:()=>y,wS:()=>h});var o=i(44654),n=i(2843),a=i(42458),s=i(92191),r=i(98105);const l=(e,t,i,o="")=>`\n<div id="${e}" class="zenith-tooltip ${o} ${i?"zenith-tooltip--mobile":""}" role="tooltip" aria-live="polite">\n <div class="zenith-tooltip__content">\n <p class="zenith-tooltip__text"></p>\n ${i?`\n <button class="zenith-tooltip__close-button geo-button geo-button--tertiary" title="${t("Close")}" aria-label="${t("Close")}">\n <svg class="geo-icon"><use xlink:href="#geo-cross-thin"></use></svg>\n </button>`:""}\n </div>\n</div>`.trim();var d;!function(e){e.Top="top",e.TopLeft="topLeft",e.TopRight="topRight",e.Bottom="bottom",e.BottomLeft="bottomLeft",e.BottomRight="bottomRight",e.Right="right",e.RightTop="rightTop",e.RightBottom="rightBottom",e.Left="left",e.LeftTop="leftTop",e.LeftBottom="leftBottom"}(d||(d={}));const c=12,u={[d.Top]:e=>({x:e.insetInlineStart+e.width/2,y:e.top-c}),[d.TopLeft]:e=>({x:e.insetInlineStart-8,y:e.top-c}),[d.TopRight]:e=>({x:e.insetInlineStart+e.width+8,y:e.top-c}),[d.Bottom]:e=>({x:e.insetInlineStart+e.width/2,y:e.top+e.height+c}),[d.BottomLeft]:e=>({x:e.insetInlineStart-8,y:e.top+e.height+c}),[d.BottomRight]:e=>({x:e.insetInlineStart+e.width+8,y:e.top+e.height+c}),[d.Right]:e=>({x:e.insetInlineStart+e.width+c,y:e.top+e.height/2}),[d.RightTop]:e=>({x:e.insetInlineStart+e.width+c,y:e.top-8}),[d.RightBottom]:e=>({x:e.insetInlineStart+e.width+c,y:e.top+e.height+8}),[d.Left]:e=>({x:e.insetInlineStart-c,y:e.top+e.height/2}),[d.LeftTop]:e=>({x:e.insetInlineStart-c,y:e.top-8}),[d.LeftBottom]:e=>({x:e.insetInlineStart-c,y:e.top+e.height+8})},m={[d.Top]:"zenith-tooltip--top",[d.TopLeft]:"zenith-tooltip--top-left",[d.TopRight]:"zenith-tooltip--top-right",[d.Bottom]:"zenith-tooltip--bottom",[d.BottomLeft]:"zenith-tooltip--bottom-left",[d.BottomRight]:"zenith-tooltip--bottom-right",[d.Right]:"zenith-tooltip--right",[d.RightTop]:"zenith-tooltip--right-top",[d.RightBottom]:"zenith-tooltip--right-bottom",[d.Left]:"zenith-tooltip--left",[d.LeftTop]:"zenith-tooltip--left-top",[d.LeftBottom]:"zenith-tooltip--left-bottom"},h=(e,t)=>{e.forEach((({parent:e,selector:i,position:o})=>{e.querySelectorAll(i).forEach((e=>{e.dataset.tooltip&&!e.dataset.tooltipInitialized&&(e.title="",e.dataset.tooltipInitialized="true",new y(e,document.body,o,t))}))}))};class y{updateTitle(e){const t=this.tooltip.querySelector(".zenith-tooltip__text");if(t.innerHTML="",Array.isArray(e)){const i=(0,s.Kb)("<ul class='zenith-tooltip__content-list'></ul>")[0];e.forEach((e=>{const t=(0,s.Kb)("<li class='zenith-tooltip__content-list-item'></li>")[0];t.textContent=e,i.appendChild(t)})),t.appendChild(i)}else t.textContent=e}locateTooltip(){const e=(0,n.Q)(this.targetElement);if(this.lastKnownMobileState)this.tooltip.style.insetInlineStart=`${window.innerWidth/2-this.tooltip.clientWidth/2+window.scrollX}px`,this.tooltip.style.top=`${e.top+e.height+c}px`;else{const t=u[this.position](e);this.tooltip.style.insetInlineStart=`${t.x}px`,this.tooltip.style.top=`${t.y}px`}}setupAccessibility(){const e=this.targetElement;e.setAttribute("tabindex","0"),e.setAttribute("aria-describedby",this.tooltip.id)}recreateTooltip(){const e=null!==this.tooltip.parentElement,t=this.targetElement.dataset.tooltip;this.shield.shown&&(this.shield.shown=!1,this.shield.unmount()),this.tooltip.remove(),this.position=this.lastKnownMobileState?d.Bottom:this.initialPosition,this.tooltip=(0,s.Kb)(l(this.tooltipId,this.translate,this.lastKnownMobileState,this.customClass))[0],this.tooltip.classList.add(m[this.position]),this.setupTooltipEventListeners(),e&&t&&(this.updateTitle(t),this.relativeParent.appendChild(this.tooltip),this.locateTooltip())}setupTooltipEventListeners(){if(this.lastKnownMobileState){const e=this.targetElement,t=this.tooltip.getElementsByClassName("zenith-tooltip__close-button")[0];null==t||t.addEventListener("click",(t=>{t.stopPropagation(),this.hide(),null==e||e.focus()}))}}setupEventListeners(){const e=this.targetElement;window.addEventListener("resize",this.handleResize),e.addEventListener("pointerover",this.handlePointerOver),e.addEventListener("focusin",this.handleFocusIn),e.addEventListener("touchstart",this.handleTouchStart),e.addEventListener("pointerout",this.handlePointerOut),e.addEventListener("focusout",this.handleFocusOut),e.addEventListener("keydown",this.handleKeyDown),this.relativeParent.addEventListener("wheel",this.handleWheel,{passive:!0}),this.setupTooltipEventListeners()}constructor(e,t=document.body,i=d.Bottom,n,c){this.targetElement=e,this.relativeParent=t,this.position=i,this.translate=n,this.customClass=c,this.handleResize=(0,o.sg)((()=>{const e=(0,a.C)(window);this.lastKnownMobileState!==e?(this.hide(),this.lastKnownMobileState=e,this.recreateTooltip()):this.locateTooltip()}),100),this.handleShieldClick=e=>{e.stopPropagation(),this.hide()},this.showTooltip=e=>{e.stopPropagation();const t=this.targetElement;t.dataset.tooltip&&(this.updateTitle(t.dataset.tooltip),this.show())},this.hideTooltip=e=>{e.stopPropagation(),this.hide()},this.handlePointerOver=e=>{this.lastKnownMobileState||this.showTooltip(e)},this.handleFocusIn=e=>{this.lastKnownMobileState||this.showTooltip(e)},this.handleTouchStart=e=>{this.lastKnownMobileState&&this.showTooltip(e)},this.handlePointerOut=e=>{this.lastKnownMobileState||this.hideTooltip(e)},this.handleFocusOut=e=>{this.lastKnownMobileState||this.hideTooltip(e)},this.handleKeyDown=e=>{"Escape"===e.key&&this.hideTooltip(e)},this.handleWheel=e=>this.hideTooltip(e),this.tooltipId=(0,o.$C)(),this.lastKnownMobileState=(0,a.C)(window),this.shield=new r.e,this.initialPosition=i,this.lastKnownMobileState&&(this.position=d.Bottom),this.tooltip=(0,s.Kb)(l(this.tooltipId,n,this.lastKnownMobileState,c))[0],this.tooltip.classList.add(m[this.position]),this.setupAccessibility(),this.setupEventListeners()}show(){void 0!==this.showTimeoutId&&clearTimeout(this.showTimeoutId),this.relativeParent.querySelectorAll(".zenith-tooltip").forEach((e=>e.remove())),this.showTimeoutId=setTimeout((()=>
1{if(this.relativeParent.appendChild(this.tooltip),this.lastKnownMobileState){this.shield.mount(document.body),this.shield.shown=!0;const e=this.shield.elt;null==e||e.addEventListener("pointerdown",this.handleShieldClick)}this.locateTooltip()}),500)}hide(){if(void 0!==this.showTimeoutId&&(clearTimeout(this.showTimeoutId),this.showTimeoutId=void 0),this.lastKnownMobileState){this.shield.shown=!1;const e=this.shield.elt;null==e||e.removeEventListener("pointerdown",this.handleShieldClick),this.shield.unmount()}this.tooltip.remove()}getContainer(){return this.tooltip}destroy(){this.hide();const e=this.targetElement;window.removeEventListener("resize",this.handleResize),e.removeEventListener("pointerover",this.handlePointerOver),e.removeEventListener("focusin",this.handleFocusIn),e.removeEventListener("touchstart",this.handleTouchStart),e.removeEventListener("pointerout",this.handlePointerOut),e.removeEventListener("focusout",this.handleFocusOut),e.removeEventListener("keydown",this.handleKeyDown),this.relativeParent.removeEventListener("wheel",this.handleWheel),e.removeAttribute("tabindex"),e.removeAttribute("aria-describedby")}}},26098(e,t,i){i.r(t),i.d(t,{default:()=>X});var o=i(92191),n=i(42811),a=i(44654),s=i(73839),r=i(5108),l=i(2643),d=i(69971),c=i(54147),u=i(35761),m=i(20766),h=i(12614),y=i(37744),p=i(13285),f=i(21288),g=i(58660),v=i(60565),D=i(47689),w=i(55719),b=i(39832),S=i(2766),C=i(10088),T=i(76356),x=i(77737),k=i(73797),M=i(18932),R=i(94996),E=i(64828),A=i(13054),_=i(21809);function X(e){let t,i,X=e.shared.uiConfiguration,O=e.shared.notificationCenter,P=function(t){Ce.on(),t&&!t.isAborted&&e.shared.errorHandler(t)},L=!0,I=(0,l.Z)(),N=e.els.options_tabs,B=e.shared.localizer,F=(0,b.Y$)(B),W=F.translateFn(),H=e.shared.entitiesLoader,U=(0,c.A)(e.els.optionsAdminId.parentNode),z=X.hasAccessTo,$=z("EditDistributionList",(0,k.Q8)(k.SD.RuleNotifications)),q=z("OrganizeViews",(0,k.r3)(k.SD.MapViews)),V=e.shared.context.permissions.canViewPage("hosLogs")&&e.shared.context.permissions.canViewPage("hosLog"),G=z("DisplayMap",(0,k.iC)(k.SD.Map)),K=z("FeaturePreviewClearance",(0,k.r3)(k.SD.BetaFeatures)),Y=Object.assign({},e.shared.context.currentUser),j=(0,v.cF)(z),Z=(0,v.tj)(z),Q=!1;const J=new g.v;let ee,te,ie,oe,ne,ae=new u.A([e.els.options_tabs_1,e.els.options_tabs_2,e.els.options_tabs_3,e.els.options_tabs_1,e.els.options_tab_featurePreview,e.els.options_tabs_4],B,{hosAccess:V,fpAccess:K,hasNewsNotificationsAccess:z("NewsNotificationsClearance",(0,k.Q8)(k.SD.SystemCommunications)),hasUserDisplayProfileAccess:j,isFedRamp:e.shared.context.isFedRamp,organizeViewsAccess:q,isCurrentUserEdit:!0,displayMap:G,hasAccessToPage:e.shared.uiConfiguration.pagesSecurity.hasAccessToPage},J,e.shared,(()=>Q)),se={general:0,mapSettings:1,hosSettings:2,featurePreviewSettings:3,systemCommunication:4},re=new S.Ay,le=new d.A(e.els.options_savedMessageId),de=e.toolbar.get("options_save"),ce={}
1,ue=[],me=[],he=!1,ye=function(i){Y&&((0,o.WU)(e.els.optionsAdminId),ae.update({timeZones:ie,displayMap:G,usersOptions:Object.assign({},i),providersSupport:t,systemSettings:ne,isNewUser:!1,highlightGroups:oe,unitProfiles:ue,addInPages:me}),Me())},pe=e=>Object.assign({hosRuleSet:()=>V,mapViews:()=>q},e),fe=function(e,t){var i;Y=Object.assign({},e),(i=Y).isNewsEnabled=i.hasOwnProperty("isNewsEnabled")?i.isNewsEnabled:!!ce[i.id],te=pe(Y),void 0!==t&&(te.isInstallationNotificationEnabled=t.isInstallationNotificationEnabled,te.autoEnrollInNewBetaFeatures=t.autoEnrollInNewBetaFeatures),ye(te)},ge=(0,y.YG)(H.userDisplayProfile.getItemsByValue,j),ve=(0,y.HG)(H.userDisplayProfile.addItem,H.userDisplayProfile.setItem,ge,j,Y.id,z("ManageUserDisplayProfiles",(0,k.Q8)(k.SD.UserDisplayProfile))),De=Z?()=>H.displayMeasurementProfile.getItemsByValue():()=>Promise.resolve([]),we=(0,a.Pm)((()=>(0,f.v)(H.displayUnitOfMeasure.getItemsByValue,e.shared.errorHandler,Z))),be=()=>e.shared.context.addinsStorage.list([T.T.PAGE],!0).then((t=>(0,x.jf)(t,e.shared.localizer.getCultureInfo().language))),Se=function(){let t,o=E.OC.loadWithContext(e.shared.myapi,B).then((e=>{ie=e})).catch(P),n=H.users.getItemById(Y.id).catch(P),a=H.clientSettings.getItemById(Y.id).catch(P),s=H.systemSettings.getItemsByValue().then((function(e){ne=e[0]})),l=V?H.userHosRuleSets.getItemsByValue({userSearch:{id:Y.id},fromDate:new Date,toDate:new Date}):Promise.resolve([]),d=(0,r.FM)(Promise.all([o,a,n,s,l,De(),ge(Y.id,!1,!0),we(),be()]).then((function([,e,o,,n,a,s,r,l]){t=Object.assign(Object.assign({},o),{unitProfile:null==s?void 0:s.profileId}),i=e,ue=a,me=l,J.setUnits(r);let d=n[0]||new m.UEZ;t.hosRuleSet=d.hosRuleSet.id,t.startOfDay=d.startOfDay;let c=t.mapViews.reduce(((e,t)=>e.concat(t.highlightGroups.filter((t=>t&&-1===e.indexOf(t))))),[]);return c.length?Promise.all(c.map((e=>H.groups.getItemById(e)))):Promise.resolve([])})).then((e=>{oe=e,fe(t,i)})).catch(P));I.add(d),U.displayProgress(d)},Ce={on:function(){de.enable()},off:function(){de.disable()}},Te=(e,t)=>
1()=>V&&e.hasRuleSetChanged?(0,w.S)(B,H.dutyStatusLogsWithModifications,H.dutyStatusLogs,t,(0,m.rTw)(t.hosRuleSet.id),e.isExemptAnnotationRequired?e.text:"",t.user.id):Promise.resolve(null),xe=e=>{let t=Object.assign({},e);return t.hosRuleSet=null,delete t.startOfDay,delete t.bookmarks,t},ke=function(){let t=Object.assign(Object.assign({},te),ae.getPageState()),o=function(e,t){let i={};return Object.keys(e).forEach((function(o){t.hasOwnProperty(o)&&(0,a.Hb)(e[o],t[o])||(i[o]=e[o])})),i}(t,te),n=te.isMetric!==ae.getPageState().isMetric,l=Object.keys(o),d=Object.assign({},Y);n&&t.maxPCDistancePerDay&&t.isMetric&&(o.maxPCDistancePerDay=(0,m.RzJ)(t.maxPCDistancePerDay)),n||!t.maxPCDistancePerDay||t.isMetric||(o.maxPCDistancePerDay=(0,m.RzJ)(t.maxPCDistancePerDay)),o.hasOwnProperty("maxPCDistancePerDay")&&(o.maxPCDistancePerDay=""===o.maxPCDistancePerDay?null:1e3*o.maxPCDistancePerDay,d.maxPCDistancePerDay=o.maxPCDistancePerDay);const c=async()=>{if(null==o?void 0:o.hasOwnProperty("language")){const t=e.shared.context.synergyOneTokenProvider;try{await(null==t?void 0:t.terminate())}catch(e){console.error("Failed resetting SynergyOne session due to language change: ",e)}}};let u=(n,u)=>{(function(e){let t=e.hasOwnProperty("language"),i=e.hasOwnProperty("featurePreview"),o=e.hasOwnProperty("isInstallationNotificationEnabled");return(0,p.h)(t,i,o,B.translateKey,document.body)})(o).then((function(){Ce.off(),o.hasOwnProperty("defaultMapType")&&(delete o.defaultMapType,l=Object.keys(o));const t=(0,s.X)((0,a.gn)(o,["isInstallationNotificationEnabled"]),(e=>"boolean"==typeof e)),m=(0,a.gn)(o,["autoEnrollInNewBetaFeatures"]),p=(0,M.c)(Object.assign(Object.assign({},t),m));let f=(0,R.nD)(p)?Promise.resolve():H.clientSettings.setItem(Object.assign({id:d.id},p)),g=(0,r.FM)(Promise.all([H.users.setItem(xe(d)),f,V&&n.hasRuleSetChanged?H.userHosRuleSets.addItem(u):Promise.resolve({}),ve(Y.id,o.unitProfile),c()]).then((([e,t,i,o])=>Promise.all([o,Te(n,u)()])))).done((([e])=>{Y=d,L=!1,void 0!==i&&(o.isInstallationNotificationEnabled&&(i.isInstallationNotificationEnabled=o.isInstallationNotificationEnabled),void 0!==o.autoEnrollInNewBetaFeatures&&(i.autoEnrollInNewBetaFeatures=o.autoEnrollInNewBetaFeatures)),fe(Y,i),le.displaySaved({message:B.translateKey("SavedChanges")}),Ce.on(),O.fireEvent("User.Set",{},[Y.id]),(0,y.AG)(e)&&"None"!==e.event&&O.fireEvent(`UserDisplayProfile.${e.event}`,{},[e.profileId]),(0,h.Qq)(o.language||te.language),(o.hasOwnProperty("language")||o.hasOwnProperty("featurePreview")||o.hasOwnProperty("displayCurrency")||o.hasOwnProperty("isInstallationNotificationEnabled"))&&window.location.reload()})).fail((t=>{Ce.on(),t.isDuplicateException?(le.displayFailed({container:e.els.options_tabs_1,message:B.translateKey("DriverLicenseDuplicateException")}),ee.setActive(0)):P(t)}));I.add(g),U.displayProgress(g),$&&(o.isNewsEnabled&&!ce[d.id]?ce[d.id]={user:{id:d.id},recipientType:"LogNewsPopup"}:delete ce[d.id])})).catch((function(e){e.resetLanguage&&(t.language=te.language,ae.update({usersOptions:t})),e.resetFeaturePreview&&(t.featurePreview=te.featurePreview,ae.update({usersOptions:t})),e.resetInstallationNotification&&(t.isInstallationNotificationEnabled=te.isInstallationNotificationEnabled,ae.update({usersOptions:t}))}))};if(re.hideMessages(),l.length){let i=((e,t)=>({hasRuleSetChanged:(0,m.TiI)(new m.UEZ(t.hosRuleSet,t.startOfDay),new m.UEZ(e.hosRuleSet,e.startOfDay)),isExemptAnnotationRequired:(0,m.QWW)(t.hosRuleSet),text:(t.exemptAnnotation||"").trim()}))(te,t);if((g=i).hasRuleSetChanged&&g.isExemptAnnotationRequired&&0===g.text.length)return void Ee("Add a reason for the exemption",e.els.optionsAdminId.querySelector("#options_exemptAnnotation"),Re);if((te.driverGroups||te.isDriver)&&t.hosRuleSet&&(e=>!(null!==m.nQT&&void 0!==m.nQT?m.nQT:[]).includes(e.hosRuleSet)&&!e.licenseNumber&&!e.licenseProvince)(t))return void Ee(W("options_DriverLicenseRulesetWarning"),e.els.optionsAdminId.querySelector("#options_hosRuleSet"),void 0,!0);if((e=>{var t;return!!(null===(t=e.licenseNumber)||void 0===t?void 0:t.trim())!=!!e.licenseProvince})(t))return void Ee(B.translateKey("DriverLicenseWarning"),e.els.optionsAdminId.querySelector("#options_LicenseNumber"),e.els.options_tabs_1);for(let e=0;e<l.length;e++){let t=l[e];d.hasOwnProperty(t)&&(d[t]=o[t],d.driverGroups&&(d.driverGroups=(d.driverGroups||[]).map((e=>({id:e.id})))))}let n=new m.UEZ(t.hosRuleSet,t.startOfDay,d.id);(i.hasRuleSetChanged?(f=n,(0,D.G)(f,H.call,H.userHosRuleSets).then((t=>
1(t.invalidProperty&&("hosRuleSet"===t.invalidProperty&&t.ruleSetToComplete&&Ee(B.translateKey("RuleSetValidationError").replace("{0}",B.translateKey((0,m.a2t)(t.ruleSetToComplete.hosRuleSet.id))),e.els.optionsAdminId.querySelector("#options_hosRuleSet"),Re),"startOfDay"===t.invalidProperty&&t.ruleSetToComplete&&Ee(B.translateKey("StartOfDayValidationError"),e.els.optionsAdminId.querySelector("#options_dayStart"),Re)),t.isValid)))):Promise.resolve(!0)).then((o=>{(e=>{if(e.isPersonalConveyanceEnabled&&m.mUr.indexOf(e.hosRuleSet)>-1&&e.maxPCDistancePerDay){if("km"===B.getDistanceAbbreviation())return e.maxPCDistancePerDay>m.Zfm;if("mi"===B.getDistanceAbbreviation())return e.maxPCDistancePerDay>(0,m.zeK)(m.Zfm)}return!1})(t)?Ee(B.translateKey("CanadaMaxPCLimitPerDayWarning"),e.els.optionsAdminId.querySelector("#options_maxPCDistancePerDay"),Re):(e=>e.isPersonalConveyanceEnabled&&(isNaN(e.maxPCDistancePerDay)||Number(e.maxPCDistancePerDay)<0))(t)?Ee(B.translateKey("MaxPCLimitPerDayWarning"),e.els.optionsAdminId.querySelector("#options_maxPCDistancePerDay"),Re):o&&u(i,n)})).catch(P)}var f,g};ae.attachEvent("openCustomProfile",(t=>{e.shared.gotoPage("customUnitProfile",t?{id:t}:void 0)}));let Me=function(){ee.toggleTab("options_tabMapSettings",G),ee.toggleTab("options_tabHosSettings",V),ee.toggleTab("options_tabFeaturePreviewSettings",K)},Re=e.els.options_tabs_3,Ee=function(e,t,i,o=!1){if(i&&!o)switch(i.id){case"options_tabs_2":ee.setActive(1);break;case"options_tabs_3":ee.setActive(2);break;default:ee.setActive(0)}t?(re.displayFailed({field:t,message:e}),t.focus()):le.displayFailed({container:i,message:e})};return ee=new n.A(N,{onAfterChange:function(){ae.resize()}}),Me(),e.shared.context.systemSettingsWatcher.attach("MapProviderChange",(({providersPermissions:e})=>{let i={};if(Y){let e=pe(Y);i=Object.assign(Object.assign({},e),ae.getPageState())}t=e,ye(i)})),e.shared.context.addinsStorage.attach("changeAddinsAmount",(async()=>{let e={};if(Y){let t=pe(Y);e=Object.assign(Object.assign({},t),ae.getPageState())}const t=await be();me=t,ye(e)})),e.shared.context.currentUserWatcher.attach("currentUserUpdate",(()=>{L&&he&&Se(),L=!0})),de.click((function(){te&&ke()})),{initialize:function(){return Promise.all([B.translatePage(e.els.optionsAdminId),ae.translate().then((e=>{F.add(e)})),e.shared.ensureFlagsLoaded([A.u.ENABLE_EMERGENCY_RESPONSE_EXEMPTION]).catch(_.Y)]).then((()=>(Q=(0,C.b)(e.shared.context.isFedRamp,(0,a.UP)()),X.supportedMapProviders))).then((e=>{t=e}))},focus:function(){he=!0,re.hideMessages(),Se();const t=e.shared.getUrlState().targetTab;if(t){const e=se[t];e&&ee.setActive(e)}},blur:function(){re.hideMessages(),he=!1,I.abort(),(0,o.jD)(e.els.optionsAdminId),ae.unload()},onCultureInfoChange:a.tE}}},12600(e,t,i){i.d(t,{SN:()=>a,Y_:()=>n});class o{constructor(e,t){this.id=e,this.name=t}}const n={Aoa:new o("Aoa","Angolan kwanza (AOA)"),Ars:new o("Ars","Argentine peso (ARS)"),Aud:new o("Aud","Australian dollar (AUD)"),Brl:new o("Brl","Brazilian real (BRL)"),Gbp:new o("Gbp","British pound (GBP)"),Cad:new o("Cad","Canadian dollar (CAD)"),Clp:new o("Clp","Chilean peso (CLP)"),Cny:new o("Cny","Chinese yuan (CNY)"),Cop:new o("Cop","Colombian peso (COP)"),Eur:new o("Eur","European euro (EUR)"),Gyd:new o("Gyd","Guyanese dollar (GYD)"),Hkd:new o("Hkd","Hong Kong dollar (HKD)"),Inr:new o("Inr","Indian rupee (INR)"),Idr:new o("Idr","Indonesian rupiah (IDR)"),Jpy:new o("Jpy","Japanese yen (JPY)"),Myr:new o("Myr","Malaysian ringgit (MYR)"),Mxn:new o("Mxn","Mexican peso (MXN)"),Mzn:new o("Mzn","Mozambican metical (MZN)"),Nzd:new o("Nzd","New Zealand dollar (NZD)"),Ngn:new o("Ngn","Naira (NGN)"),Nok:new o("Nok","Norwegian krone (NOK)"),Pgk:new o("Pgk","Papua New Guinea kina (PGK)"),Pen:new o("Pen","Peruvian sol (PEN)"),Pln:new o("Pln","Polish Zloty (PLN)"),Php:new o("Php","Philippine peso (PHP)"),Qar:new o("Qar","Qatari riyal (QAR)"),Rub:new o("Rub","Russian rouble (RUB)"),Sar:new o("Sar","Saudi riyal (SAR)"),Sgd:new o("Sgd","Singapore dollar (SGD)"),Zar:new o("Zar","South African rand (ZAR)"),Krw:new o("Krw","South Korean won (KRW)"),Sek:new o("Sek","Swedish krona (SEK)"),Chf:new o("Chf","Swiss franc (CHF)"),Twd:new o("Twd","Taiwanese dollar (TWD)"),Thb:new o("Thb","Thai baht (THB)"),Try:new o("Try","Turkish lira (TRY)"),Usd:new o("Usd","US dollar (USD)")},a=function(){const e={};
1return Object.keys(n).forEach((t=>{const i=n[t];e[i.name]=i.id})),e}},13285(e,t,i){i.d(t,{h:()=>a});var o=i(841),n=i(10340);const a=(e,t,i,a,r)=>{if(e||t||i){var{title:l,body:d,button:c}=s(i,e);return((e,t,i,a,s)=>new Promise(((r,l)=>{let d=(0,n.T)(s,a,{allowHTMLContent:!0,width:430});d.confirm(a(e),a(t),a(i),(()=>{d.close(),r(void 0)}),(()=>{d.close(),l(new o.e3)}))})))(a(l),a(d),a(c),a,r).catch((()=>{var i;return i=e?{resetLanguage:!0}:t?{resetFeaturePreview:!0}:{resetInstallationNotification:!0},Promise.reject(i)}))}return Promise.resolve({})},s=(e,t)=>{let i,o="ReloadPageToTakeEffect",n="ReloadNow";return e?(i="Refresh to Update",o="You must refresh the page to apply the updated settings.",n="Refresh page",{title:i,body:o,button:n}):t?(i="RegionalSettingsChanged",{title:i,body:o,button:n}):(i="ExperimentalSettingsChanged",{title:i,body:o,button:n})}},58660(e,t,i){i.d(t,{v:()=>n});var o=i(55528);class n{constructor(){this.groupedUnits={}}getGroup(e){const t=this.groupedUnits[e];return t||[]}setUnits(e){e&&0!==e.length&&(this.groupedUnits=(0,o.vz)(e))}getFuelEconomyMeasures(){return this.getGroup("UnitOfMeasureKilometersPerLiterId")}getElectricEconomyMeasures(){return this.getGroup("UnitOfMeasureKilometersPerKiloWattHourId")}}},35761(e,t,i){i.d(t,{A:()=>it});var o=i(86397),n=i(92191),a=i(44654),s=i(39832),r=i(34457);var l=i(69971),d=i(20766),c=i(24077),u=i(12600),m=i(65075),h=i(79280);class y extends o.FZ{constructor(e,t,i,o,s){super(),this.featureName=i;let r=(0,n.Kb)(function(e,t,i){const o=(0,a.$C)(),n=(0,a.$C)(),s=(0,a.z)(e);return`<div class="zenith-card" data-feature="${s}">\n <div class="zenith-card__content feature-preview__info">\n <label id="${o}" class="zenith-card__title feature-preview__info-label" data-testid="feature-preview.title.${s}">${(0,a.z)(t)}</label>\n <div id="${n}" class="zenith-card__description">${(0,a.z)(i)}</div>\n </div>\n <div role="radiogroup" class="zenith-card__actions feature-preview__checkbox" aria-labelledby="${o}" aria-describedby="${n}"></div>\n </div>`}(i,o,s))[0],l=r.querySelector(".feature-preview__checkbox");this.switcher=(0,h.Z)(l,t,{labels:{on:t("on"),off:t("off")},onChange:()=>{this.fire("change")},isZenith:!0}),e.appendChild(r)}set checked(e){this.switcher.setValue(e)}get checked(){return this.switcher.isOn()}get name(){return this.featureName}}class p{constructor(e){this.featureName=e,this.checked=!1}get name(){return this.featureName}}var f=i(32449),g=i(10340);class v extends o.FZ{constructor(e,t,i,o,n,a,s,r,l){super(),this.features=f.qT.reduce(((d,c)=>{if(c.visible&&!c.visible(o,n,a,s,r,l))return d;let u=i.filter((e=>e.featureName===c.value));if(u[0]){if(!u[0].isFilled){let e=new p(c.value);return d[e.name]=e,d}let i=new y(e,t,c.value,t(c.title),t(c.description)),o=(0,g.T)(document.body,t,{allowHTMLContent:!0,width:430});return i.attach("change",(()=>{!i.checked&&o.confirm(t(c.title),t("Are you sure you want to turn off this feature?"),t("Turn off"),(()=>{this.fire("change"),o.close()}),(()=>{i.checked=!0,o.close()}))})),d[i.name]=i,d}let m=new y(e,t,c.value,t(w(c.title)),t(w(c.description)));return m.attach("change",(()=>this.fire("change"))),d[m.name]=m,d}),{})}set value(e){let t=e.split(",");Object.keys(this.features).forEach((e=>{let i=this.features[e];i.checked=t.indexOf(i.name)>-1}))}get value(){return Object.keys(this.features).map((e=>{let t=this.features[e];return t.checked?t.name:""})).filter((e=>!!e)).join(",")}enableDisableAll(e){Object.keys(this.features).forEach((t=>{this.features[t].checked=e}))}}class D extends o.FZ{constructor(){super(...arguments),this.features=""}set value(e){this.features=e}get value(){return this.features}}const w=e=>e.split("\n").map((e=>e.trim())).join(" ");let b=f.qT.reduce(((e,t)=>[...e,w(t.title),w(t.description)]),[]).filter((e=>!!e));var S=i(5334);class C extends S.MJ{constructor(e){super(e),this.onChange=e=>{this.elemStateChange(e)},this.el=e.elem}setInnerState(e){return void 0!==e.checked&&(this.el.checked=e.checked),void 0!==e.disabled&&(this.el.disabled=e.disabled),this}getState(){return this.el.checked}setState(e){return this.el.checked=e,e&&(this.el.disabled=!1),this}change(e){return this.el.addEventListener("change",this.onChange,!1),e&&this.el.addEventListener("change",e,!1),this}unchange(e){return this.el.removeEventListener("change",this.onChange,!1),e&&this.el.removeEventListener("change",e,!1),this}}class T{constructor(e,t){this.translate=t,this.controlsConstructors={switcher:S.jw,switchedButtonSet:S.BG,splittedSwitchButtonSet:S.fb,select:S.Yq,text:S.xt,regionSwitcher:S.i_,sortable:S.oy,time:S.Bi,checkbox:C},this.form={}
1,this.getState=e=>e?this.form[e]&&this.form[e].isShown()?this.form[e].getState():null:Object.keys(this.form).reduce(((e,t)=>(this.form[t]&&this.form[t].isShown()&&(e[t]=this.form[t].getState()),e)),{}),this.setState=(e,t)=>{let i="string"==typeof e?null:e;i?Object.keys(this.form).forEach((e=>{i&&i.hasOwnProperty(e)&&null!==i[e]?(this.form[e].setState(i[e]),this.form[e].show()):this.form[e].hide()})):this.form.hasOwnProperty(e)&&this.form[e].setState(t)},this.setInnerState=e=>{Object.keys(e).forEach((t=>{this.form[t]&&this.form[t].setInnerState(e[t])}))},this.localizer=e}add(e,t,i,o,n,a,s){if(!this.form[t]){let r=Object.assign({elemName:t,elem:i,container:o,cget:n,cset:a,localizer:this.localizer},s||{});if("time"===e)r.timeFormat=this.localizer.returnShortTimeFormat();this.form[t]=new this.controlsConstructors[e](r,this.translate)}return this.form[t]}}const x=S.b5;var k=i(13054);function M(e,t,i){return o=>{let s=o.elem,r=()=>s.querySelectorAll("li.sortableItem"),l=e=>e.querySelector("button.options_viewOrganizerList_removeButton"),d=(e,t=a.tE)=>{let i=s.querySelectorAll("li.sortableItem");Array.prototype.forEach.call(i,(i=>{i.querySelector(".itemText_primary").textContent===e&&t(i)}))},c=()=>{let e,t=r(),i=0;Array.prototype.forEach.call(t,(t=>{let o=(0,n.zN)(t);o&&i++,l(t).disabled=!1,o&&!e?(e=t,(0,n.gR)(t,"defaultItem")):(0,n.jo)(t,"defaultItem")})),1===i&&e&&(l(e).disabled=!0)},u=function(e){return e.querySelector(".defaultLabel")},m=()=>{c(),(0,n.WU)(e)};return{onStateSet:()=>{c(),t.hideMessages()},onBeforeItemSave:(e,n,a)=>
1{let s=!0,r=e.querySelector(".inlineEditor_input");return d(a,(t=>{t!==e&&(s=!1)})),s?a?(d(n,(e=>{let t=o.getState(e.id);t&&(t.name=a)})),!0):(t.displayFailed({message:i("The name cannot be empty."),field:r}),!1):(t.displayFailed({message:i("A view with that name already exists. Please enter a unique name for your map view."),field:r}),!1)},onItemSaved:m,onBeforeItemRemove:e=>{let o=e.querySelector(".itemText_primary").textContent;return r().length>1?(d(o,(t=>{t&&t!==e&&t.parentNode.removeChild(t)})),c(),!0):(t.displayFailed({message:i("You cannot remove the default map view.")}),!1)},onEditorShow:e=>{let t=u(e);(0,n.nB)(e,"defaultItem")&&t&&(0,n.jD)(t)},onEditorHide:e=>{let t=u(e);(0,n.nB)(e,"defaultItem")&&t&&(0,n.WU)(t)},onItemRemoved:m}}}var R=i(67677);const E=e=>-1!==e.name.toLowerCase().indexOf("km")&&-1===e.name.toLowerCase().indexOf("gal");var A=i(48173),_=i(95645);var X=i(5241),O=i(721),P=i(78300),L=i(14724),I=i(49264);class N{constructor(e,t,i){this.boundClose=this.close.bind(this),this.boundAcceptModal=this.acceptModal.bind(this),this.onAccept=e;const o=i.htmlFn(t),n=document.createElement("div");n.innerHTML=o;const a=n.firstElementChild;if(a){document.body.appendChild(a),this.modal=document.getElementById(i.modalId);const e=this.modal.querySelector(".geotab-terms-modal");this.closeBtn=document.getElementById(i.closeBtnId),this.acceptBtn=document.getElementById(i.acceptBtnId),this.closeBtn.addEventListener("click",this.boundClose),this.acceptBtn.addEventListener("click",this.boundAcceptModal),this.boundClickOutside=t=>{this.modal&&t.target instanceof Node&&!(null==e?void 0:e.contains(t.target))&&this.modal.classList.contains("popup-modal--visible")&&this.close()},document.addEventListener("click",this.boundClickOutside)}}show(){this.modal.className="popup-modal popup-modal--visible"}close(){this.modal.className="popup-modal popup-modal--not-visible"}acceptModal(){this.onAccept(),this.close()}destroy(){var e,t,i;null===(e=this.closeBtn)||void 0===e||e.removeEventListener("click",this.boundClose),null===(t=this.acceptBtn)||void 0===t||t.removeEventListener("click",this.boundAcceptModal),this.boundClickOutside&&document.removeEventListener("click",this.boundClickOutside),null===(i=this.modal)||void 0===i||i.remove()}}function B(e){return` <div id="myModal" class="popup-modal">\n <div class="geotab-terms-modal">\n <header class="geotab-terms-modal__header">\n <div class="geotab-terms-modal__header-icon-and-title">\n <svg class="geotab-terms-modal__header-info-icon"><use xlink:href="#geo-info-tooltip"></use></svg>\n <p class="zenith-heading-02">${e("Geotab SMS terms")}</p>\n </div>\n <svg id="closeBtn" class="geotab-terms-modal__header-close-icon">\n <use xlink:href="#geo-cross-thin"></use>\n </svg>\n </header>\n <section class="geotab-terms-modal__content">\n <span class="zenith-body-02-short geotab-terms-modal__intro-text">${e("By using the SMS Notification service, you acknowledge and agree as follows: (1) in accordance with applicable law, you have obtained the express consent of each recipient you enroll to receive SMS notifications, if obtained verbally, using a script substantially similar to the suggested verbiage below, and will respect and cooperate with any recipient's request to opt out of receiving SMS notifications; (2) if you are enrolling as a recipient, you hereby consent to receive SMS messages from Geotab in connection with your use of the Geotab solution (subject to your right to opt out); (3) you will comply with the Twilio Acceptable Use Policy, the Twilio Messaging Policy, and any other policies or directives communicated to you by Geotab regarding the content of SMS messages sent, and you understand that these policies prohibit sending messages that are, among other things, unlawful, harmful, abusive, or spam; (4) you understand that the SMS notification services are intended for business use related to your use of the Geotab solution and you will not use them for personal or unrelated purposes; (5) you acknowledge that SMS messages, which may include personally identifiable information, may be filtered by an automated decision-making system or machine-learning platform for the purposes of spam and fraud detection, and
1you will inform each recipient of the same if required by applicable law; and (6) you understand that failure to comply with any of the above provisions is considered a breach of the Geotab End User Agreement, or such other agreement as may exist between you and Geotab with respect to your use of the Geotab solution, and may result in the suspension or termination of your access to the SMS services and/or the Geotab solution.")}</span>\n <span class="zenith-body-02-short geotab-terms-modal__content-block">${e("If you are obtaining consent to receive SMS messages from the recipient verbally, the following is a suggested draft script for obtaining such consent:")}</span>\n <span class="heading-04 geotab-terms-modal__content-block">${e("Introduction")}</span>\n <span class="zenith-body-02-short geotab-terms-modal__content-block">"${e("Hello [Recipient Name], this is [Your Name] from [Customer Company Name]. We are engaging SMS functionality in the Geotab solution. This functionality will send you SMS messages about information necessary for monitoring fleet operations in connection with the Geotab solution.")}"</span>\n <span class="heading-04 geotab-terms-modal__content-block">${e("Obtain Consent")}</span>\n <span class="zenith-body-02-short geotab-terms-modal__content-block">"${e("Would you like to opt-in to receive these SMS messages? You can always opt-out later if you change your mind. Message frequency may vary. Standard message and data rates may apply. You can opt-out at any time by replying STOP to any message.")}"</span>\n <span class="heading-04 geotab-terms-modal__content-block">${e("If End User Consents")}</span>\n <span class="zenith-body-02-short geotab-terms-modal__content-block">"${e("Great! By saying 'Yes,' you consent to receiving SMS messages from [Customer Company Name] related to your use of the Geotab Solution.")}"</span>\n <ul>\n <span class="heading-04">${e("Important Notes")}</span>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Customize the script: Replace the bracketed information with the specific details relevant to the customer.")}</div>\n </li>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Document consent: Maintain a record of the end user's consent, including the date and time.")}</div>\n </li>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Provide clear opt-out instructions: Ensure end users know how to easily opt-out of receiving messages.")}</div>\n </li>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Respect opt-out requests: Immediately cease sending messages to end users who opt-out.")}</div>\n </li>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Comply with all applicable laws: This script is a template and may need to be adjusted to comply with specific anti-spam laws in your jurisdiction. Consult with legal counsel if necessary.")}</div>\n </li>\n </ul>\n </section>\n <footer class="geotab-terms-modal__footer">\n <button id="acceptBtn" class="zenith-button zenith-button--primary">${e("Accept")}</button>\n </footer>\n </div>\n </div>`}function F(e){return` <div id="whatsAppModal" class="popup-modal">\n <div class="geotab-terms-modal">\n <header class="geotab-terms-modal__header">\n <div class="geotab-terms-modal__header-icon-and-title">\n <svg class="geotab-terms-modal__header-info-icon"><use xlink:href="#geo-info-tooltip"></use></svg>\n <p class="zenith-heading-02">${e("Geotab WhatsApp Terms")}</p>\n </div>\n <svg id="whatsAppCloseBtn" class="geotab-terms-modal__header-close-icon">\n <use xlink:href="#geo-cross-thin"></use>\n </svg>\n </header>\n <section class="geotab-terms-modal__content">
1\n <span class="zenith-body-02-short geotab-terms-modal__intro-text">${e("By using the WhatsApp notification service, you acknowledge and agree as follows: (1) in accordance with applicable law, you obtain the express consent of each recipient you enroll to receive WhatsApp notifications, if obtained verbally, using a script substantially similar to the suggested verbiage below, and will respect and cooperate with any recipient's request to opt out of receiving WhatsApp notifications; (2) if you are enrolling as a recipient, you hereby consent to receive WhatsApp messages from Geotab in connection with your use of the Geotab solution (subject to your right to opt out); (3) you will comply with the Meta Acceptable Use Policy, the WhatsApp Business Policy, the Twilio Acceptable Use Policy, the Twilio Messaging Policy and any other policies or directives communicated to you by Geotab regarding the content of WhatsApp messages sent, and you understand that these policies prohibit sending messages that are, among other things, unlawful, harmful, abusive, or constitute spam; (4) you understand that the WhatsApp notification services are intended for business use related to your use of the Geotab solution and you will not use them for personal or unrelated purposes; (5) you acknowledge that WhatsApp messages, which may include personally identifiable information, may be filtered by an automated decision-making system or machine-learning platform for the purposes of spam and fraud detection, and you will inform each recipient of the same if required by applicable law; (6) you acknowledge that the metadata related to the WhatsApp messages, which may include personally identifiable information, may be transferred to the United States, and you will inform each recipient of the same if required by applicable law; and (7) you understand that failure to comply with any of the above provisions is considered a breach of the Geotab End User Agreement, or such other agreement as may exist between you and Geotab with respect to your use of the Geotab solution, and may result in the suspension or termination of your access to the WhatsApp services and/or the Geotab solution.")}</span>\n <span class="zenith-body-02-short geotab-terms-modal__content-block">${e("If you are obtaining consent to receive WhatsApp messages from the recipient verbally, the following is a suggested draft script for obtaining such consent:")}</span>\n <span class="heading-04 geotab-terms-modal__content-block">${e("Introduction")}</span>\n <span class="zenith-body-02-short geotab-terms-modal__content-block">"${e("Hello [Recipient Name], this is [Your Name] from [Customer Company Name]. We are engaging WhatsApp notification functionality in the Geotab solution. This functionality will send you WhatsApp messages about information necessary for monitoring fleet operations in connection with the Geotab solution. The functionality will also include the transfer of metadata related to the messages to the solution provider's facilities in the United States.")}"</span>\n <span class="heading-04 geotab-terms-modal__content-block">${e("Obtain Consent")}</span>\n <span class="zenith-body-02-short geotab-terms-modal__content-block">"${e("Would you like to opt in to receive these WhatsApp messages? You can always opt out later if you change your mind. Message frequency may vary. You can opt out at any time by replying STOP to any message.")}"</span>\n <span class="heading-04 geotab-terms-modal__content-block">${e("If End User Consents")}</span>\n <span class="zenith-body-02-short geotab-terms-modal__content-block">"${e("By saying 'Yes,' you consent to receiving WhatsApp messages from [Customer Company Name] related to your use of the Geotab solution.")}"</span>\n <ul>\n <span class="heading-04">${e("Important Notes")}</span>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Customize the script: Replace the bracketed information with the specific details relevant to the customer.")}</div>\n </li>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Document consent: Maintain a record of the end user's consent, including the date and time.")}</div>\n </li>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Provide clear opt-out instructions: Ensure end users know how to easily opt-out of receiving messages.")}</div>\n </li>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Respect opt-out requests: Immediately cease sending messages to end users who opt-out.")}</div>\n </li>\n <li class="geotab-terms-modal__important-notes-item">\n <p class="dot zenith-body-02-short"></p>\n <div class="zenith-body-02-short">${e("Comply with all applicable laws: This script is a template and may need to be adju
1sted to comply with specific anti-spam laws in your jurisdiction. Consult with legal counsel if necessary.")}</div>\n </li>\n </ul>\n </section>\n <footer class="geotab-terms-modal__footer">\n <button id="whatsAppAcceptBtn" class="zenith-button zenith-button--primary">${e("Accept")}</button>\n </footer>\n </div>\n </div>`}var W=i(8008),H=i(65853),U=i(79374),z=i(92675),$=i(94996),q=i(64828);const V={hosAccess:!1,fpAccess:!0,organizeViewsAccess:!1,displayMap:!1,distributionList:!0,isCurrentUserEdit:!1,timeZones:[],mapTypesOptions:[],isMultipleEdit:!1,usersOptions:{},hasAccessToPage:()=>!0},G=new Date;let K,Y,j,Z,Q,J,ee,te,ie,oe,ne,ae,se,re,le,de,ce,ue,me,he,ye,pe,fe,ge,ve,De,we,be,Se,Ce,Te,xe,ke,Me,Re,Ee,Ae,_e,Xe,Oe,Pe,Le,Ie,Ne,Be,Fe,We,He,Ue,ze,$e,qe,Ve,Ge,Ke,Ye,je,Ze,Qe,Je,et,tt;class it{convertArrayToSelectItems(e){return e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.text]:t.value})),{})}setPhoneIdForLabel(e){null!==e&&e.setAttribute("for","user__phoneNumber")}isPhoneNumberSectionAdded(e){return!!e("user__phoneNumber")}addPhoneNumberSection(e,t,i,o){const n=e("system-communication__phone-number-editor"),a=e("phoneNumber_label");let s=new L.TW(n,document,this.translateKey,!1,"","user__phoneNumber",this.zenithTooltipEnabled?this.translateKey("Enter the user's primary phone number (required if user is a support contact for your organization)."):this.translateKey("A phone number is required for users designated as Support contacts."),this.zenithTooltipEnabled,t,i,o);return this.setPhoneIdForLabel(a),s}setElementVisibility(e,t){e&&(t?e.style.removeProperty("display"):e.style.display="none")}updateNotificationCheckboxState(e,t,i,o){let n=!1;o?n=o.value.trim().length>0:this.communicationTabPhoneNumberEditor&&(n=!!(this.communicationTabPhoneNumberEditor.phone.phoneNumber&&this.communicationTabPhoneNumberEditor.phone.phoneNumber.trim().length>0)),e&&n?t&&(t.disabled=!1):(t&&(t.disabled=!0,t.checked=!1),i&&i.setState(!1))}updateSmsCheckboxState(e){this.updateNotificationCheckboxState(this.smsTermsAccepted,this.smsNotificationCheckboxHtmlElement,xe,e)}updateWhatsAppCheckboxState(e){var t,i,o;const n=null!==(o=null===(i=null===(t=this.communicationTabPhoneNumberEditor)||void 0===t?void 0:t.phone)||void 0===i?void 0:i.phoneNumber)&&void 0!==o?o:"",a=void 0===(0,I.Q7)(n);this.whatsAppNotificationCheckboxHtmlElement&&(this.whatsAppNotificationCheckboxHtmlElement.disabled=!a,this.whatsAppNotificationCheckboxHtmlElement.checked=!1),ke&&ke.setState(!1)}initNotificationCheckbox(e,t){const i=e(t);return i&&(i.checked=!1,i.disabled=!0),i}addTermsModal(e,t,i,o){const n=new N(i,this.translator.translate,o);return e(t).addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),n.show()})),n}addEmptyPhoneNumberSection(){return new L.Qi}resetNotificationCheckbox(e,t,i){const o=this.initNotificationCheckbox(e,t);return i&&i.setState(!1),o}resetSmsTermsCheckbox(e){this.smsTermsAccepted=!1,this.smsNotificationCheckboxHtmlElement=this.resetNotificationCheckbox(e,"sms-notification-checkbox",xe)}enableSmsCheckbox(){this.smsTermsAccepted=!0,this.updateSmsCheckboxState()}attachWhatsAppChangeListener(){this.options.isWhatsAppNotificationsEnabled&&this.whatsAppNotificationCheckboxHtmlElement&&this.whatsAppChangeListenerElement!==this.whatsAppNotificationCheckboxHtmlElement&&(this.whatsAppChangeListenerElement=this.whatsAppNotificationCheckboxHtmlElement,this.whatsAppNotificationCheckboxHtmlElement.addEventListener("change",(()=>{var e;this.whatsAppNotificationCheckboxHtmlElement.checked&&(this.whatsAppNotificationCheckboxHtmlElement.checked=!1,null===(e=this.whatsAppModal)||void 0===e||e.show())})))}enableWhatsAppCheckbox(){this.whatsAppNotificationCheckboxHtmlElement&&!this.whatsAppNotificationCheckboxHtmlElement.disabled&&(this.whatsAppNotificationCheckboxHtmlElement.checked=!0)}handleNotificationRegionChange(e,t,i,o,n){e?(this.setElementVisibility(t,!1),this.setElementVisibility(i,!0),n(o)):t&&(this.setElementVisibility(t,!0),this.setElementVisibility(i,!1))}changeCustomProfile(e){j.setState(e),this.renderCustomProfile(),this.checkFuelUnitsAndMeasureTypeCompatibility()}getLicenseProvinceInnerState(){return{input:{title:this.translateKey("other"),maxLength:2,warning:this.translateKey("Enter an abbreviation for License state/province using only the first two letters.")},select:{title:this.translateKey("NorthAmerica"),items:this.regions}}}getRuleSetId(){return this.options.usersOptions.hosRuleSet}setRuleSetId(e){this.options.usersOptions.hosRuleSet=e}getDefaultRuleSetId(){return this.options.isMultipleEdit?"":"HosRuleSetNone"}toggleHosRuleSetOptions(e){let t=void 0!==e?e:this.getRuleSetId()||this.getDefaultRuleSetId();We.value="",this.setHosRuleSet(t)}applyNewUserRegionalDefaults(e){this.options.isNewUser&&e&&!this.options.isMultipleEdit&&this.applyRegionalDefaults(e)}static isUserProfileMetricIncorrect(e,t){if(!t||!(0,m.Zz)(t))return!1;return e!==(t!==m.EJ.USA)}getTimeFormat(){let e=this.pageForm.getState("timeFormat")||this.options.usersOptions&&this.options.usersOptions.dateFormat,{timeFormat:t}=(0,H.te)(e||"HH:mm");return this.localizer.returnShortTimeFormat(t)}static getDefaultFuelEnergyUnit(e,t){switch(e){case"LitersPer100Km":return"LitersEPer100Km";case"KmPerLiter":return"KmPerLitersE";case"MPGUS":return"MPGEUS";case"MPGImperial":return"MPGEImperial";default:return t?"LitersEPer100Km":"MPGEUS"}}setFedRampSettingsDisplay(){this.isFedRamp&&(me.elem.value=u.Y_.Usd.id,me.elem.disabled=!0,(0,n.jD)(he))}static getElectricEnergyEconomy(e){return e.electricEnergyEconomyUnit||it.getDefaultFuelEnergyUnit(e.fuelEconomyUnit,e.isMetric)}static updateOptions(e,t,i){return 0===e.length?t:e.map(i)}updateDefaultPageOptions(){var e;const t=[{groupName:this.translateKey("Platform Pages:"),items:this.defaultPages}],i=null!==(e=this.options.addInPages)&&void 0!==e?e:[];let o={};i.length>0&&(o=i.reduce(((e,t)=>(e[t.menuName]=t.hash,e)),{}),t.push({groupName:this.translateKey("Add-In Pages:"),items:o}));const n=this.pageForm.getState("defaultPage");fe.setInnerState(t,!1),this.defaultPageOptionIds=Object.values(Object.assign(Object.assign({},this.defaultPages),o));const a=(0,z.zw)(n,this.shared.context.permissions.canViewPage,this.defaultPageOptionIds);fe.setState(a)}constructor(e,t,i,h,y,p){this.containers=e,this.localizer=t,this.options=i,this.economyMeasureHelper=h,this.shared=y,this.isOsanoEnabled=p,this.translator=(0,s.Y$)(this.localizer),this.translateKey=this.translator.translate,this.firstRen
1der=!0,this.defaultPages={},this.defaultPageOptionIds=[],this.currencies=(0,u.SN)(),this.languages={},this.sampleFormats={},this.defaultProfiles=[],this.sampleTimeFormats={},this.firstDayOfWeek=[],this.regions=[],this.mapTypesOptions=[],this.timeZoneNotification=Promise.resolve(void 0),this.smsTermsAccepted=!1,this.whatsAppModal=null,this.whatsAppChangeListenerElement=null,this.customGetSetMethods={metric:{getter:e=>"Metric"===e,setter:e=>e?"Metric":"US"},hosRule:{setter:e=>e&&"HosRuleSetNone"!==e?e:"HosRuleSetAmerica7Day",getter:e=>e||"HosRuleSetNone"},mapEngine:{setter:e=>this.mapTypesOptions.some((t=>t.value===e))?e:this.defaultMapEngine}},this.toggleEnableAllBetaFeatures=e=>{this.features.enableDisableAll&&this.features.enableDisableAll(e)},this.setFeaturePreviewEnrollmentBannerVisibility=e=>{e?(0,n.WU)(this.optionsFeaturePreviewEnrollmentBanner):(0,n.jD)(this.optionsFeaturePreviewEnrollmentBanner)},this.createFeatureForm=e=>{if(this.features)return;const t=this.shared.context.systemSettings.jurisdiction||"";this.features=this.features||this.options.fpAccess?new v(e,this.translateKey,[],this.isFedRamp,this.shared.isFlagEnabled,this.shared.context.permissions.isAppInstalled,t,this.shared.context.systemSettings.enableGreatLakesUi,this.shared.context.systemSettings.databaseTemplate):new D,this.features.attach("change",this.labsChangedHandler.bind(this)),tt.change((e=>{this.toggleEnableAllBetaFeatures(e.isOn()),this.setFeaturePreviewEnrollmentBannerVisibility(e.isOn())}))},this.renderTools=e=>{let t=(i=e[0].parentElement,e=>i.querySelector("#"+e));var i;t("options_measurementSelect")||(e[0].appendChild(this.optionsRegionalSettingsContent),e[0].appendChild(this.optionsUISett
1ingsContent),e[0].appendChild(this.optionsCookiesSettingsContent),e[1].appendChild(this.optionsMapSettingsContent),e[2].appendChild(this.optionsHOSSettingsContent),e[3].appendChild(this.optionsDriverLicenseContent),e[4].appendChild(this.optionsFeaturePreviewContent),e[5].appendChild(this.optionsSystemCommunicationContent));let o=t("sms-notification-confirmation"),a=t("system-communication__phone-number-editor-warning-message"),s=t("whatsapp-notification-confirmation"),r=e=>{const i="ca"!==e&&"us"!==e;this.options.isSmsNotificationsEnabled&&this.handleNotificationRegionChange(i,o,a,t,(e=>this.resetSmsTermsCheckbox(e)))},l=e=>{const i=""!==e;this.options.isSmsNotificationsEnabled&&this.handleNotificationRegionChange(i,o,a,t,(e=>this.resetSmsTermsCheckbox(e)))},c=()=>{this.options.isSmsNotificationsEnabled&&this.resetSmsTermsCheckbox(t)};this.options.isSmsNotificationsEnabled&&(this.smsNotificationCheckboxHtmlElement=this.initNotificationCheckbox(t,"sms-notification-checkbox")),this.options.isWhatsAppNotificationsEnabled&&(this.whatsAppNotificationCheckboxHtmlElement=this.initNotificationCheckbox(t,"whatsapp-notification-checkbox")),this.isPhoneNumberSectionAdded(t)||(this.options.isSmsNotificationsEnabled||this.options.isWhatsAppNotificationsEnabled?(this.communicationTabPhoneNumberEditor=this.addPhoneNumberSection(t,r,l,c),this.options.isSmsNotificationsEnabled&&this.addTermsModal(t,"geotab-terms-modal-item",(()=>this.enableSmsCheckbox()),{htmlFn:B,modalId:"myModal",closeBtnId:"closeBtn",acceptBtnId:"acceptBtn"})):this.addEmptyPhoneNumberSection()),this.options.isWhatsAppNotificationsEnabled&&!this.whatsAppModal&&(this.whatsAppModal=this.addTermsModal(t,"whatsapp-terms-modal-item",(()=>this.enableWhatsAppCheckbox()),{htmlFn:F,modalId:"whatsAppModal",closeBtnId:"whatsAppCloseBtn",acceptBtnId:"whatsAppAcceptBtn"})),this.attachWhatsAppChangeListener();let u=this.options.isSmsNotificationsEnabled,h=this.options.isWhatsAppNotificationsEnabled;if(u||h){let e=t("system-communication__phone-number-editor");if(e){let t=e.querySelector(".phone-number__number");t&&t.addEventListener("input",(()=>{u&&this.updateSmsCheckboxState(t),h&&this.updateWhatsAppCheckboxState(t)}))}}Q=t("options_editUnitProfile"),J=t("options_addUnitProfile"),Z=t("options_customProfileField"),K=t("options_formattedDate"),ae=t("options_formattedTime"),Y=t("options_userTimeZoneOffsetSample"),te=t("options_defaultMapType"),ee=t("options_viewOrganizerList"),Qe=t("options_view-organizer-info-icon"),ie=t("options_hosRuleSet"),oe=ie.parentNode.parentNode,ve=t("options_viewOrganizerInfoBox"),Ke=t("userSettings_maxPCDistancePerDay"),je=t("options_maxPCDistancePerDay"),Ze=t("userSettings_customExemptHosHelper"),he=t("options_currencyDisclaimerMessage");let y=(je&&je).nextElementSibling,p=t("user__phoneNumber"),f=t("phone-number-extension"),g=t("sms-notification-section");if(this.options.isSmsNotificationsEnabled&&(g.style.removeProperty("display"),g.className="system-communication",o.style.removeProperty("display"),p.oninput=()=>{c()}),this.options.isWhatsAppNotificationsEnabled){s.style.removeProperty("display"),this.options.isSmsNotificationsEnabled||(g.style.removeProperty("display"),g.className="system-communication",p.oninput=()=>{c()});let e=g.querySelector("header");e&&this.options.isSmsNotificationsEnabled?e.textContent=this.translateKey("SMS and WhatsApp messages"):e&&!this.options.isSmsNotificationsEnabled&&(e.textContent=this.translateKey("WhatsApp messages"))}let v=t("options_maintenance_parent"),D=t("options_serviceDisruption_parent");v.style.removeProperty("display"),D.style.removeProperty("display"),y.textContent=this.localizer.getDistanceAbbreviation(),se=this.pageForm.add("switchedButtonSet","isMetric",t("options_measurementSelect"),void 0,this.customGetSetMethods.metric.getter,this.customGetSetMethods.metric.setter,{isZenith:!0}).setInnerState(this.measurementSystems),j=this.pageForm.add("select","unitProfile",t("options_unitsProfileSelect")),re=this.pageForm.add("select","fuelEconomyUnit",t("options_fuelEconomySelect")).setInnerState(this.convertArrayToSelectItems(this.fuelEconomyUnits),!1),le=this.pageForm.add("select","electricEnergyEconomyUnit",t("options_energyEconomySelect")).setInnerState([{groupName:this.translateKey("Metric:"),items:this.convertArrayToSelectItems(this.electricEnergyEconomyUnitsMetric)},{groupName:this.translateKey("US/Imperial:"),items:this.convertArrayToSelectItems(this.electricEnergyEconomyUnitsImperial)}],!1),de=this.pageForm.add("select","dateFormat",t("options_dateFormatSelect")).setInnerState(this.sampleFormats),ne=this.pageForm.add("select","timeFormat",t("options_timeFormatSelect")).setInnerState(this.sampleTimeFormats),ce=this.pageForm.add("select","timeZoneId",t("options_userTimeZoneOffset")),Me=this.pageForm.add("select","firstDayOfWeek",t("options_firstDayOfWeek")).setInnerState(this.firstDayOfWeek),ue=this.pageForm.add("select","language",t("options_languageSelect")).setInnerState(this.languages,void 0,!0),me=this.pageForm.add("select","displayCurrency",t("options_currencySelect")).setInnerState(this.currencies),ye=this.pageForm.add("select","defaultMapEngine",te,void 0,void 0,this.customGetSetMethods.mapEngine.setter),pe=this.pageForm.add("sortable","mapViews",ee,void 0,void 0,void 0,{customEventsHandlersInitializer:M(ve,this.inlineSaveMessage,this.translator.translate),isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),fe=this.pageForm.add("select","defaultPage",t("options_defaultPage")),ge=this.pageForm.add("select","hosRuleSet",ie,oe,this.customGetSetMethods.hosRule.getter,this.customGetSetMethods.hosRule.setter).setInnerState(this.getHosRuleOptions()),ie.value="",Xe=t("options_oilTransport_form"),_e=this.pageForm.add("switcher","hosOilTransport",t("options_oilTransport"),void 0,void 0,void 0,{isZenith:!0}),Pe=t("options_oilWell_form"),Oe=this.pageForm.add("switcher","hosOilWell",t("options_oilWell"),void 0,void 0,void 0,{isZenith:!0}),De=this.pageForm.add("switcher","isNewsEnabled",t("options_news"),void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),we=this.pageForm.add("switcher","isEmailReportEnabled",t("options_enableEmailReports"),void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),be=this.pageForm.add("switcher","isMaintenanceNotificationEnabled",t("options_maintenance"),void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),Se=this.pageForm.add("switcher","isServiceDisruptionNotificationsEnabled",t("options_serviceDisruption"),void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),Ne=this.pageForm.add("switcher","isYardMoveEnabled",t("options_yard_move"),void 0,void 0,void 0,{isZenith:!1,zenithTooltipEnabled:this.zenithTooltipEnabled}),He=this.pageForm.add("switcher","isPersonalConveyanceEnabled",t("options_personal_conveyance"),void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),Be=this.pageForm.add("switcher","isAdverseDrivingEnabled",t("options_adverse_driving"),void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),Ue=((e,t,i,o)=>{const n=e.add("switcher","isEmergencyResponseExemptionAllowed",t("options_emergency_response_exemption"),t("userSettings_emergencyResponseExemption"),void 0,void 0,o);return n.toggle(i(k.u.ENABLE_EMERGENCY_RESPONSE_EXEMPTION)),n})(this.pageForm,t,this.shared.isFlagEnabled,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),tt=this.pageForm.add("switcher","autoEnrollInNewBetaFeatures",t("options_autoEnrollInNewBetaFeatures__input"),void 0,void 0,void 0,{isZenith:!0}),ze=this.pageForm.add("switcher","isExemptHOSEnabled",t("options_exempt_hos"),void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),et=this.pageForm.add("switcher","isInstallationNotificationEnabled",t("options_installationNotification"),void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),Ie=t("options_dayStart_form"),Le=this.pageForm.add("time","startOfDay",t("options_dayStart")),Fe=t("options_exemptAnnotation_form"),We=t("options_exemptAnnotation"),Re=this.pageForm.add("text","companyName",t("options_Name")),Ee=this.pageForm.add("text","companyAddress",t("options_Address")),Ae=this.pageForm.add("text","carrierNumber",t("options_CarrierNumber")),$e=this.pageForm.add("text","licenseNumber",t("options_LicenseNumber")),qe=this.pageForm.add("regionSwitcher","licenseProvince",t("options_LicenseProvince"),void 0,void 0,void 0,{isZenith:!0,labelId:"options_LicenseProvinceLabel"}).setInnerState(this.getLicenseProvinceInnerState()),Ye=this.pageForm.add("text","maxPCDistancePerDay",t("options_maxPCDistancePerDay")),Ve=this.pageForm.add("text","authorityName",t("options_AuthorityName")),Ge=this.pageForm.add("text","authorityAddress",t("options_AuthorityAddress")),(this.options.isSmsNotificationsEnabled||this.options.isWhatsAppNotificationsEnabled)&&(Ce=this.pageForm.add("text","phoneNumber",p,void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),Te=this.pageForm.add("text","extension",f,void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}),this.options.isSmsNotificationsEnabled&&(xe=this.pageForm.add("checkbox","smsNotificationsOptIn",this.smsNotificationCheckboxHtmlElement,void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled})),this.options.isWhatsAppNotificationsEnabled&&(ke=this.pageForm.add("checkbox","whatsAppNotificationsOptIn",this.whatsAppNotificationCheckboxHtmlElement,void 0,void 0,void 0,{isZenith:!0,zenithTooltipEnabled:this.zenithTooltipEnabled}))),this.updateAccessRights(this.options),(0,n.L$)(this.optionsCookiesSettingsContent,this.isOsanoEnabled());let w=this.options.displayMap||this.options.organizeViewsAccess&&!this.options.isMultipleEdit;(0,n.L$)(t("options_mapSettings"),w),(0,n.L$)(ee.parentNode,!this.options.isMultipleEdit),(0,n.L$)(t("options_MultiEdit_EnableFeaturePreview"),this.options.isMultipleEdit),(0,n.L$)(t("options_EnableFeaturePreview"),!this.options.isMultipleEdit),(0,n.L$)(this.optionsDriverLicenseContent,!(this.options.isMultipleEdit||!this.options.usersOptions.driverGroups&&!this.options.usersOptions.isDriver)),De.toggle(this.options.distributionList&&!!this.options.hasNewsNotificationsAccess);let b=this.hasAccessToPage("deviceInstallation");if((0,n.L$)(t("options_installationNotification_parent"),b),this.firstRen
1der){if(this.firstRender=!1,!this.zenithTooltipEnabled){const e=new X.sX(this.translator.translate,void 0,O._m.Right);let t=!1;const i=()=>{e.show(Qe,Qe.dataset.tooltip||""),t=!0},o=()=>{e.hide(),t=!1};let n="";Qe.addEventListener("pointerover",(e=>{n=e.pointerType,"touch"!==e.pointerType&&i()})),Qe.addEventListener("click",(()=>{"touch"===n&&(t?o():i())})),Qe.addEventListener("pointerout",(e=>{"touch"!==e.pointerType&&o()})),Qe.addEventListener("focus",i),Qe.addEventListener("blur",o),Qe.addEventListener("keydown",(e=>{"Escape"===e.key&&t&&(e.stopPropagation(),e.preventDefault(),o(),Qe.focus())}))}j.change((()=>{const e=j.getState();this.changeCustomProfile(e)})),J.addEventListener("click",(()=>{this.eventHandler.fireEvent("openCustomProfile",this,[])}),!1),Q.addEventListener("click",(()=>{const e=j.getState();e&&!(0,m.Zz)(e)&&this.eventHandler.fireEvent("openCustomProfile",this,e?[e]:[])}),!1),se.change(this.checkFuelUnitsAndMeasureTypeCompatibility),re.change(this.checkFuelUnitsAndMeasureTypeCompatibility),le.change(this.checkFuelUnitsAndMeasureTypeCompatibility),de.change(this.changeDateFormatSample.bind(this,!!this.options.isMultipleEdit)),ne.change(this.changeTimeFormatSample.bind(this,!!this.options.isMultipleEdit)),ce.change(this.handleTimeZoneChange),ge.change(this.hosRuleChangeHandler),_e.change(this.hosOilTransportChangeHandler),Oe.change(this.hosOilWellChangeHandler),this.eventHandler.attachEvent("userIsDriverChanged",this.driverStateChangeHandler),He.change(this.toggleMaxPCLimitPerDay),ze.change(this.toggleCustomExemptHosHelper)}else(0,n.L$)(Ke,this.options.usersOptions.isPersonalConveyanceEnabled),(0,n.L$)(Ze,this.options.usersOptions.isExemptHOSEnabled);if(je&&(null===this.options.usersOptions.maxPCDistancePerDay||void 0===this.options.usersOptions.maxPCDistancePerDay)||this.options.isNewUser){let e=(e=>e.systemSettings||{})(this.options),t="km"===this.localizer.getDistanceAbbreviation(),i=e&&e.maxPCDistance&&Number(e.maxPCDistance)>-1?Number(e.maxPCDistance)/1e3:0;je.value=t?i.toFixed(1):(0,d.zeK)(i).toFixed(1),!(0,$.nD)(this.options.usersOptions)&&(this.options.usersOptions.maxPCDistancePerDay=e&&e.maxPCDistance?e.maxPCDistance:0)}this.options.systemSettings&&this.createFeatureForm(t("options_featurePreviewForm")),this.hasAccessToPage("customunitprofile")||((0,n.jD)(J),(0,n.jD)(Q))},this.setHosRuleSet=e=>{let t=e,i=(0,d.fzj)(t),o=(0,d.c2Z)(t),a=(0,d.OSu)(t),s=(0,d.Hnt)(t),r=(0,d.QWW)(t);t=(0,d.JQ7)(t),t=(0,d.c5S)(t),(0,n.L$)(Ie,!!t&&this.options.hosAccess&&(0,d.rTw)(t)),(0,n.L$)(Pe,!!t&&this.options.hosAccess&&(s||i)),(0,n.L$)(Xe,!!t&&this.options.hosAccess&&(a||o)),(0,n.L$)(Fe,!!t&&this.options.hosAccess&&r),_e.setState(i),Oe.setState(o),We.value=We.value||"",ie.value=t},this.driverStateChangeHandler=e=>{!(0,$.nD)(this.options.usersOptions)&&(this.options.usersOptions.isDriver=e),e&&!this.options.isMultipleEdit?(0,n.WU)(this.optionsDriverLicenseContent):(0,n.jD)(this.optionsDriverLicenseContent)},this.labsChangedHandler=()=>{this.options.usersOptions&&(this.options.usersOptions.featurePreview=this.features.value),this.pageForm.setInnerState({hosRuleSet:this.getHosRuleOptions()});let e=this.getRuleSetId();ge.setEditState(this.options.isMultipleEdit),e?this.setHosRuleSet(e):ie.value=this.getDefaultRuleSetId()},this.hosRuleChangeHandler=e=>{let t=e?e.target.value:this.getRuleSetId();t&&this.setRuleSetId(t),this.toggleHosRuleSetOptions(t),_e.setState(!1),Oe.setState(!1)},this.hosOilTransportChangeHandler=()=>{let e=this.getRuleSetId();Oe.getState()&&(e&&this.setRuleSetId((0,d.N0j)(e)),Oe.setState(!1)),e&&this.setRuleSetId((0,d.qJO)(e))},this.hosOilWellChangeHandler=()=>{let e=this.getRuleSetId();_e.getState()&&(e&&this.setRuleSetId((0,d.qJO)(e)),_e.setState(!1)),e&&this.setRuleSetId((0,d.N0j)(e))},this.getHosRuleOptions=()=>((e=!1,t=(e=>e))=>{const i=(0,d.xnm)(e);return Object.keys(i).filter((e=>-1===e.indexOf("OilTransport")&&-1===e.indexOf("OilWell"))).map((e=>({id:(0,d.$Lg)(e),name:i[e].name}))).sort(((e,i)=>t(e.name).localeCompare(t(i.name))))})(this.shared.isFlagEnabled(k.u.DISABLE_TEXAS_SHORT_HAUL_RULESET_CORRECTION),this.translateKey),this.checkMapForUser=(e,t)=>{let i=!1;for(let o=0;o<t.length;o++)if(t[o].value===e){i=!0;break}return i},this.applyRegionalDefaults=e=>{const t=q.OC.getTimezoneById(e);if(t){let{dateFormat:e,timeFormat:i}=(0,H.te)(t.dateFormat||"");(0,$.kZ)(t.isMetric)||se.setState(t.isMetric),t.defaultFuelEconomyUnit&&re.setState(t.defaultFuelEconomyUnit),t.defaultElectricEconomyUnit&&le.setState(t.defaultElectricEconomyUnit),t.regionalCurrency&&me.setState(t.regionalCurrency),t.dateFormat&&(de.setState(e),ne.setState(i)),t.defaultDisplayProfile&&this.changeCustomProfile(t.defaultDisplayProfile)}},this.handleTimeZoneChange=()=>{const e=this.pageForm.getState("timeZoneId");e&&(this.options.isMultipleEdit||this.applyRegionalDefaults(e),this.options.isCurrentUserEdit&&(this.timeZoneNotification.then((e=>{e&&e.hide()})),this.timeZoneNotification=(0,c.uq)(this.localizer.getDstCalculator().getUtcOffset(new Date,e),e,(0,c.dC)(!0,this.localizer.translateSentences,this.translateKey,""))),this.updateDisplayTimeAction())},this.updateDisplayTimeAction=()=>{let e=this.pageForm.getState("timeZoneId");e?this.localizer.populateTimeZone(e).then((()=>{Y.textContent=`${this.translateKey("For example,")} ${this.localizer.toShortDateTime(new Date,e,(this.pageForm.getState("dateFormat")||"MM/dd/yy")+" "+(this.pageForm.getState("timeFormat")||"HH:mm:ss"))}`})):Y.textContent=`${this.translateKey("For example,")} ${this.translateKey("differentForEachUser")}`}
1,this.getSwitchedButtonSetOptions=(e,t)=>{let i=0;return e.some(((e,o)=>(i=o,e.value===t)))?e[i]:null},this.hideInconsistencyNotification=()=>{this.inconsistencyNotification&&this.inconsistencyNotification.hide(),this.timeZoneNotification.then((e=>{e&&e.hide()}))},this.cleanFields=()=>{We.value=""},this.toggleMaxPCLimitPerDay=e=>{(0,n.L$)(Ke,e.isOn())},this.toggleCustomExemptHosHelper=e=>{(0,n.L$)(Ze,e.isOn())},this.setupTooltips=()=>{(0,O.wS)([{parent:this.optionsDriverLicenseContent,selector:"#options_LicenseNumber",position:O._m.Top},{parent:this.optionsRegionalSettingsContent,selector:"#options_unitsProfileSelect",position:O._m.TopLeft},{parent:this.optionsRegionalSettingsContent,selector:"#options_editUnitProfile",position:O._m.TopLeft},{parent:this.optionsRegionalSettingsContent,selector:"#options_addUnitProfile",position:O._m.TopLeft},{parent:this.optionsRegionalSettingsContent,selector:"#options_measurementSelect",position:O._m.TopLeft},{parent:this.optionsRegionalSettingsContent,selector:"#options_fuelEconomySelect",position:O._m.Top},{parent:this.optionsRegionalSettingsContent,selector:"#options_energyEconomySelect",position:O._m.Top},{parent:this.optionsRegionalSettingsContent,selector:"#options_currencySelect",position:O._m.Top},{parent:this.optionsRegionalSettingsContent,selector:"#options_currencyDisclaimerMessage a",position:O._m.TopLeft},{parent:this.optionsRegionalSettingsContent,selector:"#options_dateFormatSelect",position:O._m.Top},{parent:this.optionsRegionalSettingsContent,selector:"#options_timeFormatSelect",position:O._m.Top},{parent:this.optionsRegionalSettingsContent,selector:"#options_userTimeZoneOffset",position:O._m.Top},{parent:this.optionsRegionalSettingsContent,selector:"#options_firstDayOfWeek",position:O._m.Top},{parent:this.optionsRegionalSettingsContent,selector:"#options_languageSelect",position:O._m.Top}
1,{parent:this.optionsUISettingsContent,selector:"#options_userCookieSettingsButton",position:O._m.Top},{parent:this.optionsHOSSettingsContent,selector:"#options_hosRuleSet",position:O._m.Top},{parent:this.optionsHOSSettingsContent,selector:"#options_Name",position:O._m.Top},{parent:this.optionsHOSSettingsContent,selector:"#options_Address",position:O._m.Top},{parent:this.optionsHOSSettingsContent,selector:"#options_CarrierNumber",position:O._m.Top},{parent:this.optionsHOSSettingsContent,selector:"#options_maxPCDistancePerDay",position:O._m.Top},{parent:this.optionsHOSSettingsContent,selector:"#options_AuthorityName",position:O._m.Top},{parent:this.optionsHOSSettingsContent,selector:"#options_AuthorityAddress",position:O._m.Top},{parent:this.optionsMapSettingsContent,selector:"#options_defaultMapType",position:O._m.Top},{parent:this.optionsMapSettingsContent,selector:"#options_view-organizer-info-icon",position:O._m.TopLeft}],this.translateKey)},this.checkFuelUnitsAndMeasureTypeCompatibility=()=>{let e=se.getState(),t=re.getState(),i=le.getState(),o=this.getSwitchedButtonSetOptions(this.fuelEconomyUnits,t),n=this.getSwitchedButtonSetOptions(this.measurementSystems,this.customGetSetMethods.metric.setter(e)),s=this.getSwitchedButtonSetOptions(this.electricEnergyEconomyUnitsMetric.concat(this.electricEnergyEconomyUnitsImperial),i),r=""!==e&&""!==t&&""!==i,l=t=>t.compatibility.isMetric!==e;const d=j.getState();if(this.hideInconsistencyNotification(),r&&o&&n&&s&&!(0,m.Bc)(d)&&(l(o)||l(s)||it.isUserProfileMetricIncorrect(e,d))){const e=d&&(0,m.Zz)(d)?`'${this.localizer.translateKey(m.ty[d])}'`:"",t=[o.text,s.text,e].filter(a.WI).join(", "),i=this.translateKey("The electric energy economy measurement units ({0}) are inconsistent with the distance measurement units ({1}).");this.inconsistencyNotification=this.notifier.displayPopupNotification({message:i,placeholders:[{type:"strong",text:t},{type:"strong",text:n.text}],seconds:5e3})}},this.renderCustomProfile=()=>{const e=j.getState();e&&!(0,m.Zz)(e)?(0,n.WU)(Q):(0,n.jD)(Q)},this.changeDateFormatSample=e=>{let t=this.localizer.toShortDate(G,void 0,this.pageForm.getState("dateFormat"));K.textContent=`${this.translateKey("For example,")} ${e?this.translateKey("differentForEachUser"):t}`},this.changeTimeFormatSample=e=>{let t=this.localizer.toShortTime(G,void 0,this.pageForm.getState("timeFormat"));ae.textContent=`${this.translateKey("For example,")} ${e?this.translateKey("differentForEachUser"):t}`,Le.updateTimeFormat(this.getTimeFormat())},this.getPageState=()=>{let e=this.pageForm.getState();e.dateFormat=e.dateFormat+" "+e.timeFormat,e.dateFormat=" "!==e.dateFormat?e.dateFormat:"",delete e.timeFormat,delete e.defaultMapType,e.hosOilTransport&&(e.hosRuleSet=(0,d.qJO)(e.hosRuleSet),delete e.hosOilTransport),e.hosOilWell&&(e.hosRuleSet=(0,d.N0j)(e.hosRuleSet),delete e.hosOilWell),e.hosRuleSet&&(0,d.QWW)(e.hosRuleSet)&&(e.exemptAnnotation=We.value),e.hosRuleSet&&!(0,d.rTw)(e.hosRuleSet)&&(e.startOfDay=void 0),e.mapViews&&e.mapViews.forEach((e=>{e.highlightGroups=e.highlightGroups.map((e=>e.id||e))})),null===e.isInstallationNotificationEnabled&&(e.isInstallationNotificationEnabled=this.options.usersOptions.isInstallationNotificationEnabled),e.whatsAppNotificationsOptIn&&(e.whatsAppPhoneNumber=e.phoneNumber);let t=this.optionsFeaturePreviewContent.querySelector("#options_MultiEdit_EnableFeaturePreview");return e.featurePreview=this.options.isMultipleEdit&&t.checked?void 0:this.features.value,e},this.lock=()=>{pe.lock()},this.resize=()=>{pe&&pe.resize()},this.unload=()=>{this.cleanFields(),this.hideInconsistencyNotification()},this.fireEvent=(e,t,i)=>{this.eventHandler.fireEvent(e,t,i)},Je=(0,n.Kb)('<div id="optionsPageContent_content" class="options-constructor zenith-form"> <div id="options_savedMessageId"></div> <div id="options_regionalSettings" class="zenith-form-section"> <h2 class="zenith-form-section-title">Regional settings</h2> <div class="zenith-form__field" id="options_customProfileField"> <label for="options_unitsProfileSelect" class="zenith-form__field-label">Profile</label>
1 <div class="zenith-input-combo"> <select id="options_unitsProfileSelect" class="zenith-select" title="Profiles are used to display data in the units you are accustomed to. The features available are also determined by profile." data-tooltip="Profiles are used to display data in the units the user is familiar with. The features available are also determined by profile."></select> <button class="zenith-button zenith-button--tertiary-blue zenith-button--text-icon" id="options_editUnitProfile" title="Profiles are used to display data in the units you are accustomed to. The features available are also determined by profile." data-tooltip="Profiles are used to display data in the units you are accustomed to. The features available are also determined by profile."> <svg class="zenith-icon"><use xlink:href="#geo-pencil"></use></svg> Edit profile </button> <button class="zenith-button zenith-button--tertiary-blue zenith-button--text-icon" id="options_addUnitProfile" title="Profiles are used to display data in the units you are accustomed to. The features available are also determined by profile." data-tooltip="Add a profile to set custom or preferred unit measurements for users."> <svg class="zenith-icon"><use xlink:href="#geo-plus-new"></use></svg> Add Custom Profile </button> </div> </div> <div class="zenith-form__field notFlexible"> <label class="zenith-form__field-label" id="options_distanceMeasurementSystem">Distance measurement system</label> <div class="fullWidth"> <div> <div role="radiogroup" class="geo-switcher zenith-switch" id="options_measurementSelect" aria-labelledby="options_distanceMeasurementSystem" title="Choose how to display speeds and distances. This can be Metric or US/Imperial. You may need to refresh your browser to see the change take effect." data-tooltip="Choose how to display speeds and distances. You may need to refresh your browser to see the changes."></div> </div> </div> </div> <div class="zenith-form__field"> <label for="options_fuelEconomySelect" class="zenith-form__field-label">Fuel economy measurement</label> <span class="flexible"> <select id="options_fuelEconomySelect" class="zenith-select checkmateFormEditField" title="Choose how to display fuel economy. There are four different measurements: liters per 100 kilometers, kilometers per liter, miles per US gallon, or miles per imperial gallon. You may need to refresh your browser for the change to take effect." data-tooltip="Choose how to display fuel economy. You may need to refresh your browser to see the changes."></select> </span> </div> <div class="zenith-form__field"> <label for="options_energyEconomySelect" class="zenith-form__field-label">Electric energy economy measurement</label> <span class="flexible"> <select id="options_energyEconomySelect" class="zenith-select checkmateFormEditField" title=\'Choose how to display electric energy economy. Electric energy economy is a similar measurement to fuel economy, but only for electric energy that is consumed by a plug-in Electric Vehicle (EV). For L-e and MPG-e values, "e" is an abbreviation for the equivalent of electric energy in fuel, in order to compare electric energy economy to your fuel vehicles.\' data-tooltip="Measurement specific to plug-in Electric Vehicles. The âeâ in L-e and MPG-e means the equivalent of electric energy in fuel, to compare electric energy economy to fuel vehicles."></select> </span> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_currencySelect" id="options_currencyInstructionLabel">Currency displayed as</label> <div class="fullWidth"> <div> <select id="options_currencySelect" class="zenith-select checkmateFormEditField" aria-describedby="options_currencyDisclaimerMessage" title="Select the currency to be displayed in the UI and reports." data-tooltip="Choose the currency to be displayed in the user interface and reports."></select> </div> <span class="zenith-form__field__description" id="options_currencyDisclaimerMessage"> The exchange rates used in currency conversions are from the Bank of Canada. For more details, please read our <a class="geo-link geo-link--notification help-ignore" role="link" href="https://docs.google.com/document/d/e/2PACX-1vRNPLp5nRv28R9C29L1S0IBHFkZOsbZ4yHNpL435u0m9vddC-NtEVQ2p80YS03y1aFFdlzPA_2AYfzh/pub" aria-label="Terms and Conditions." title="Cost Currency Coversion Disclaimer" data-tooltip="Review the Maintenance Cost Currency Conversion terms and conditions." target="_blank">Terms and Conditions.</a> </span> </div> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_dateFormatSelect">Date will have the format</label>
1 <div class="zenith-input-holder"> <select id="options_dateFormatSelect" class="zenith-select checkmateFormEditField" aria-describedby="options_formattedDate" title="The format of the date." data-tooltip="Choose how dates will be displayed in the user interface and reports."></select> <span class="zenith-input-assistive-text" id="options_formattedDate"></span> </div> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_timeFormatSelect">Time will have the format</label> <div class="zenith-input-holder"> <select id="options_timeFormatSelect" class="zenith-select checkmateFormEditField" size="1" aria-describedby="options_formattedTime" title="The time format" data-tooltip="Choose how time will be displayed in the user interface and reports."></select> <span class="zenith-input-assistive-text" id="options_formattedTime"></span> </div> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_userTimeZoneOffset">Timezone</label> <div class="zenith-input-holder"> <select id="options_userTimeZoneOffset" class="zenith-select checkmateFormEditField" title="The Timezone offset from UTC for your location. All data will be displayed in this Timezone." data-tooltip="Choose the timezone to match your location for accurate data display." aria-describedby="options_userTimeZoneOffsetSample"></select> <span class="zenith-input-assistive-text" id="options_userTimeZoneOffsetSample"></span> </div> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_firstDayOfWeek">Week starts on</label> <select id="options_firstDayOfWeek" class="zenith-select checkmateFormEditField" title="The first day of the calendar week." data-tooltip="Select the day your week starts on to ensure accurate reporting."></select> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_languageSelect">Language</label> <div> <select id="options_languageSelect" class="zenith-select checkmateFormEditField" title="The language of the application." data-tooltip="Select your preferred language."></select> </div> </div> </div> <div id="options_mapSettings" class="zenith-form-section"> <h2 class="zenith-form-section-title">Map settings</h2> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_defaultMapType">Default map type</label> <select id="options_defaultMapType" class="zenith-select checkmateFormEditField" title="Which map type to show as the default when opening a new map." data-tooltip="Select the map provider used to track your assets."></select> </div> <p id="options_viewOrganizerInfoBox" class="zenith-form__description" style="display:none" role="alert"> <strong>Unsaved changes.</strong> Save these map views and all other changes by using the Save button above. </p> <div class="zenith-form__field notFlexible" id="options_viewOrganizer"> <span class="zenith-form__field-label"> Saved views <svg tabindex="0" role="button" class="zenith-form__field-label-info-icon" id="options_view-organizer-info-icon" aria-label="Information about saved views" aria-describedby="options_saved-views-tooltip" data-tooltip="These are saved map positions. The top view is the default. Drag and drop views to reorder."> <use xlink:href="#geo-info-tooltip"></use> </svg> <span id="options_saved-views-tooltip" role="tooltip" class="visually-hidden">These are saved map positions. The top view is the default. Drag and drop views to reorder.</span> </span> <div id="options_viewOrganizer_content"> <div id="options_viewOrganizerListContainer"> <div class="defaultContainer" title="Saved views"></div> <ul id="options_viewOrganizerList" class="geotabSortableList" title="Saved views"></ul> </div> </div> </div> </div> <div id="options_uiSettings" class="zenith-form-section"> <h2 class="zenith-form-section-title">UI Settings</h2> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_defaultPage">Default page at start-up</label> <select id="options_defaultPage" class="zenith-select checkmateFormEditField" title="This is the initial page shown to a user upon visiting the website." data-tooltip="Choose the page you want to see first when you start the application."></select> </div> </div> <div id="options_uiCookieSettings" class="zenith-form-section"> <h2 class="zenith-form-section-title">Cookie Settings</h2> <div class="zenith-form__field"> <span class="zenith-form__field-label">Cookies needed for basic website functionality</span> <div class="fullWidth"> <div> <button class="zenith-button zenith-button--secondary" id="options_userCookieSettingsButton">Manage cookies</button> </div> <span class="zenith-form__field__description" id="options_userCookieSettingsHelpText">Disabling certain types of cookies may impact your experience on the application.</span> </div> </div> </div> <div id="options_hosSettings" class="zenith-form-section"> <h2 class="zenith-form-section-title">Hours of Service Settings</h2> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_hosRuleSet">Ruleset</label> <select id="options_hosRuleSet" class="zenith-select checkmateFormEditField wide-field" title="This is the ruleset the user will follow when using hours of service." data-tooltip="The ruleset this driver will follow when using Hours of Service."></select> </div> <div class="zenith-form__field notFlexible" id="options_exemptAnnotation_form"> <label class="zenith-form__field-label" for="options_exemptAnnotation">Exemption annotation</label> <textarea id="options_exemptAnnotation" class="geo-textarea checkmateFormEditField wide-field" title="Explanation for the driver\'s exemption."></textarea> </div> <div class="zenith-form__field notFlexible" id="options_oilTransport_form"> <label class="zenith-form__field-label" id="options_oilTransportLabel" title="Toggling this setting to ON allows a driver to restart their cycle in 24-hours. This applies to the transportation of oil field or construction equipment.">24-hour restart</label> <div role="radiogroup" aria-labelledby="options_oilTransportLabel"> <input type="checkbox" id="options_oilTransport" class="checkmateFormEditField"/> </div> </div> <div class="zenith-form__field notFlexible" id="options_oilWell_form"> <label class="zenith-form__field-label" id="options_oilWellLabel" title="Toggling this setting to ON indicates that the ruleset for a specially-trained driver has been modified for servicing oil wells. Waiting time (WT) at natural gas or oil well sites can be recorded as Off-Duty. 24-hour restart is also applied with this setting.">Oil well wait time and 24-hour restart</label> <div role="radiogroup" aria-labelledby="options_oilWellLabel"> <input type="checkbox" id="options_oilWell" class="checkmateFormEditField"/> </div> </div> <div class="zenith-form__field" id="options_dayStart_form"> <label class="zenith-form__field-label" for="options_dayStart" title="The driver\'s start of day.">Start of day</label> <span> <input id="options_dayStart" class="geo-text-input checkmateFormEditField hasDatePicker" value="" type="text" autocomplete="off"/>
1 </span> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_Name">Home terminal</label> <input id="options_Name" class="zenith-input checkmateFormEditField" title="The motor carrier\'s place of business where the driver ordinarily reports for work. This can include a temporary work site designated by the motor carrier." data-tooltip="The name of the place of business where this driver usually reports for work. This can include a temporary work site designated by the motor carrier."/> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_Address">Home terminal address</label> <textarea id="options_Address" rows="6" class="geo-textarea checkmateFormEditField" title="The motor carrier\'s address where the driver ordinarily reports for work." data-tooltip="The address of the place of business where this driver usually reports for work."></textarea> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_CarrierNumber">USDOT Number</label> <input id="options_CarrierNumber" class="geo-text-input checkmateFormEditField" title="Required for ELD data transfers to FMCSA for US enforcement. Values other than the USDOT number will cause the data transfer to fail." data-tooltip="Required for ELD data transfers to FMCSA for US enforcement. Values other than the USDOT number will cause the data transfer to fail."/> </div> <div class="zenith-form__field notFlexible"> <label class="zenith-form__field-label" id="options_yardMoveAllowed">Yard move allowed</label> <div role="radiogroup" aria-labelledby="options_yardMoveAllowed"> <input type="checkbox" id="options_yard_move" title="Toggling this setting to ON allows the driver to apply the yard move exemption." data-tooltip="Toggle On to allow the driver to apply the yard move exemption."/> </div> </div> <div class="zenith-form__field notFlexible"> <label class="zenith-form__field-label" id="options_personalConveyenceAllowed">Personal conveyance allowed</label> <div role="radiogroup" aria-labelledby="options_personalConveyenceAllowed"> <input type="checkbox" id="options_personal_conveyance" aria-labelledby="options_personalConveyenceAllowed" title="Toggling this setting to ON allows the driver to apply the personal conveyance exemption." data-tooltip="Toggle On to allow the driver to apply the personal conveyance exemption."/> </div> </div> <div class="zenith-form__field" id="userSettings_maxPCDistancePerDay" style="display:none"> <label class="zenith-form__field-label" for="options_maxPCDistancePerDay">Maximum personal conveyance distance per day</label> <div class="zenith-input-combo"> <input id="options_maxPCDistancePerDay" min="" type="text" class="geo-text-input zenith-input checkmateFormEditField" title="The maximum distance a driver can travel in personal conveyance before they\'re reminded to end their special driving category. Setting it to 0 means there\'s no limit. This setting takes precedence over the personal conveyance limit in your System Settings." data-tooltip="The maximum distance a driver can travel in personal conveyance before they\'re reminded to end their special driving category. Setting it to 0 means there\'s no limit. This setting takes precedence over the personal conveyance limit in your System Settings."/> <span class="speedUnit">km</span> </div> </div> <div class="zenith-form__field notFlexible"> <label class="zenith-form__field-label" id="options_hosExemptAllowed" title="Toggling this setting to On allows the driver to apply HOS Exempt.">HOS Exempt allowed</label> <div> <div role="radiogroup" aria-labelledby="options_hosExemptAllowed"> <input type="checkbox" id="options_exempt_hos" class="fieldWithoutLabel" title="Toggle On to allow the driver to apply the HOS exemption." data-tooltip="Toggle On to allow the driver to apply the HOS exemption."/> </div> <div id="userSettings_customExemptHosHelper" role="status" class="zenith-form__field__description" style="display:none">The exemption name for HOS Exempt can be customized under System Settings.</div> </div> </div> <div class="zenith-form__field notFlexible"> <label class="zenith-form__field-label" id="options_adverseDrivingConditionsAllowed" title="Enabling this setting allows the driver to apply the Adverse Driving Conditions exemption.">Adverse driving conditions allowed</label> <div role="radiogroup" aria-labelledby="options_adverseDrivingConditionsAllowed"> <input type="checkbox" id="options_adverse_driving" title="Toggle O
1n to allow the driver to apply the adverse driving conditions exemption." data-tooltip="Toggle On to allow the driver to apply the adverse driving conditions exemption."/> </div> </div> <div class="zenith-form__field notFlexible" id="userSettings_emergencyResponseExemption" style="display:none"> <label class="zenith-form__field-label" id="options_emergencyResponseExemptionAllowed" title="Toggle On to allow the driver to apply the emergency response exemption">Emergency response exemption allowed</label> <div role="radiogroup" aria-labelledby="options_emergencyResponseExemptionAllowed"> <input type="checkbox" id="options_emergency_response_exemption" title="Toggle On to allow the driver to apply the emergency response exemption" data-tooltip="Toggle On to allow the driver to apply the emergency response exemption"/> </div> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_AuthorityName">Authority name</label> <input id="options_AuthorityName" class="geo-text-input checkmateFormEditField" title="The motor carrier that the driver works for." data-tooltip="The name of the motor carrier that this driver works for."/> </div> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_AuthorityAddress">Authority address</label> <textarea id="options_AuthorityAddress" rows="6" class="geo-textarea checkmateFormEditField" title="The motor carrier\'s main office address." data-tooltip="The address of the motor carrier that this driver works for."></textarea> </div> </div> <div id="options_systemCommunications" class="options-feature-preview__tab"> <section class="system-communication"> <h2 class="zenith-heading-01">System Communications</h2> <div class="zenith-form__field notFlexible" id="options_email_reports_parent"> <label class="zenith-form__field-label" for="options_enableEmailReports" title="Enable or disable emailed reports for this user.">Receive email reports</label> <div role="radiogroup" aria-labelledby="options_enableEmailReports"> <input type="checkbox" id="options_enableEmailReports" title="Toggle On for this user to receive reports in their email." data-tooltip="Toggle On for this user to receive reports in their email."/> </div> </div> <div class="zenith-form__field notFlexible" id="options_news_parent"> <label class="zenith-form__field-label" for="options_news">Show in-app news notifications</label> <div role="radiogroup" aria-labelledby="options_news_parentLabel"> <input type="checkbox" id="options_news" title="Enable or disable news notifications in the application from your telematics provider." data-tooltip="Toggle On for this user to see new notifications in the application from the Telematics Provider."/> </div> </div> <div class="zenith-form__field notFlexible" id="options_installationNotification_parent"> <label class="zenith-form__field-label" for="options_installationNotification">Show new installation record notification on the Assets page</label> <div role="radiogroup" aria-labelledby="options_installationNotificationLabel"> <input type="checkbox" id="options_installationNotification"/> </div> </div> <div class="zenith-form__field notFlexible" id="options_maintenance_parent" style="display:none"> <label class="zenith-form__field-label" for="options_maintenance">Maintenance notifications</label> <div role="radiogroup" aria-labelledby="options_maintenance_parentLabel"> <input type="checkbox" id="options_maintenance" title="Enable to send this user maintenance notifications from the Telematics Provider in the application." data-tooltip="Enable to send this user maintenance notifications from the Telematics Provider in the application."/> </div> </div> <div class="zenith-form__field notFlexible" id="options_serviceDisruption_parent" style="display:none"> <label class="zenith-form__field-label" for="options_serviceDisruption">Service disruption notifications</label> <div role="radiogroup" aria-labelledby="options_serviceDisruption_parentLabel"> <input type="checkbox" id="options_serviceDisruption" title="Enable to send this user service disruption notifications in the application from the Telematics Provider." data-tooltip="Enable to send this user service disruption notifications in the application from the Telematics Provider."/> </div> </div> </section> <section id="sms-notification-section" style="display:none"> <header class="zenith-heading-01">SMS Notifications</header> <div class="zenith-form__field notFlexible"> <span id="phoneNumber_label">Phone number</span> <div class="system-communication__sms-notification"> <div id="system-communication__phone-number-editor"></div> <div class="system-communication__phone-number-editor-warning-message" id="system-communication__phone-number-editor-warning-message" style="display:none">SMS notifications are currently only available for US and Canada numbers.</div> <div class="system-communication__sms-notification-confirmation" id="sms-notification-confirmation" style="display:none"> <input type="checkbox" id="sms-notification-checkbox"/> <div> <p class="zenith-label-01 system-communication__sms-notification-confirmation-message">By checking this box, you confirm that you have read, understood, and agree to the terms of this acknowledgment for receiving SMS notifications. Message frequency may vary. Standard message and data rates may apply. You can opt out at any time by replying STOP to any message.</p> <ul class="system-communication__sms-notification-policies-links"> <li id="geotab-terms-modal-item" class="system-communication__policies-link"><a href="">Geotab SMS Terms</a></li> <li class="system-communication__policies-link">
1<a href="https://www.twilio.com/en-us/legal/aup" target="_blank">Twilio Acceptable Use Policy</a></li> <li class="system-communication__policies-link"><a href="https://www.twilio.com/en-us/legal/messaging-policy" target="_blank">Twilio Messaging Policy</a></li> </ul> </div> </div> <div class="system-communication__whatsapp-notification-confirmation" id="whatsapp-notification-confirmation" style="display:none"> <input type="checkbox" id="whatsapp-notification-checkbox"/> <div> <p class="zenith-label-01 system-communication__whatsapp-notification-confirmation-message">By providing your phone number and checking this box, you agree to receive WhatsApp messages from Geotab regarding updates and notifications for monitoring fleet operations in connection with the Geotab solution. Messages will be sent from Geotab\'s official WhatsApp account, displayed as Geotab. You can opt out at any time by replying \'STOP\'.</p> <p class="zenith-label-01 system-communication__whatsapp-notification-confirmation-message">Note: This consent is separate from SMS notifications.</p> <ul class="system-communication__whatsapp-notification-policies-links"> <li id="whatsapp-terms-modal-item" class="system-communication__policies-link"><a href="#">Geotab WhatsApp Terms</a></li> <li class="system-communication__policies-link"><a href="https://www.whatsapp.com/legal/business-terms" target="_blank">WhatsApp Business Terms of Service</a></li> <li class="system-communication__policies-link"><a href="https://www.twilio.com/legal/privacy" target="_blank">Twilio Privacy Policy</a></li> <li class="system-communication__policies-link"><a href="https://www.whatsapp.com/legal/privacy-policy" target="_blank">WhatsApp Privacy Policy</a></li> <li class="system-communication__policies-link"><a href="https://www.facebook.com/privacy/policy" target="_blank">Meta Privacy Policy</a></li> </ul> </div> </div> </div> </div> </section> </div> <div id="options_driverLicense" class="zenith-form-section"> <h2 class="zenith-form-section-title">Driver license</h2> <div class="zenith-form__field"> <label class="zenith-form__field-label" for="options_LicenseNumber">Driver license number</label> <input id="options_LicenseNumber" class="geo-text-input wide-field" maxlength="1000" title="Driver\'s license number and License state/province must be set at the same time." data-tooltip="Enter the user\'s driver license number."/> </div> <div class="zenith-form__field"> <label id="options_LicenseProvinceLabel" class="zenith-form__field-label">License state/province</label> <div id="options_LicenseProvince" class="fullWidth"></div> </div> </div> <div id="options_featurePreviewContent"> <div id="options__feature-preview-enrollment-banner" class="options__feature-preview-enrollment-banner" role="status" aria-atomic="true" aria-live="polite"> <div class="options__feature-preview-enrollment-banner__container"> <div class="options__feature-preview-enrollment-banner__header-block"> <svg class="options__feature-preview-enrollment-banner__icon geo-icon geo-icon--large"> <use xlink:href="#geo-info-tooltip"></use> </svg> <div class="options__feature-preview-enrollment-banner__header">Beta Program Enrollment</div> </div> <div class="options__feature-preview-enrollment-banner__message">New beta features will be automatically enabled upon release.</div> </div> </div> <div id="options_featurePreview" class="zenith-form-section options-feature-preview"> <h2 class="zenith-form-section-title">Beta Features</h2> <div> <div id="options_MultiEdit_EnableFeaturePreview_container" class="geo-form__field fieldWithoutLabel singleField options-feature-preview__multiple"> <input id="options_MultiEdit_EnableFeaturePreview" type="checkbox" class="enableButton"/> </div> <div id="options_EnableFeaturePreview"> <div id="options_labs_alert"> <div></div> <div class="zenith-form__description feature-preview-form__header"> <div> <span> Get early access to our newest concepts! These features are still in testing, and are not fully supported yet. Your feedback is valuable to guide future enhancements. <span>For the best experience, try these out with non-critical data.</span> </span> <span class="feature-preview-form__header-tag-holder"> Enabled Beta Features are identified by the Beta tag: <div class="geo-pill"> <svg class="geo-pill__icon geo-icon geo-icon--big"><use xlink:href="#geo-lab"></use></svg> <span>Beta</span> </div> </span> <span id="options_autoEnrollInNewBetaFeatures" class="feature-preview-form__autoEnrollInNewBetaFeatures"> <label id="options_autoEnrollInNewBetaFeatures__label" for="options_autoEnrollInNewBetaFeatures__input">Enroll in the beta program to automatically enable new features when they are released</label> <div role="radiogroup" aria-labelledby="options_autoEnrollInNewBetaFeatures__label"> <input type="checkbox" id="options_autoEnrollInNewBetaFeatures__input" aria-labelledby="options_autoEnrollInNewBetaFeatures__label" title="Enable new beta features automatically"/> </div> </span> </div> </div> </div> <div class="feature-preview-form" id="options_featurePreviewForm"></div> </div> </div> </div> </div> <div class="translatePagePhrases" style="display:none"> <div id="options_localizedText_optionsForSelectedUsers">Options for Selected Users</div> <div id="options_DateFormatForSelectedUsers">different for each user</div> <div id="options_CantRemoveDefaultMapViewMessage">You cannot remove the default map view.</div> <div id="options_FuelUnitIsNotCompatibleWithMeasurementSystem">The fuel economy measurement units ({0}) are inconsistent with the distance measurement units ({1}).</div> <div>The electric energy economy measurement units ({0}) are inconsistent with the distance measurement units ({1}).</div> <div id="options_DriverLicenseRulesetWarning">A valid driver\'s license number and license state or province is required for ELD users. To clear these values, you must select "No Ruleset" in the Ruleset field of the HOS Settings tab.</div> <div>Are you sure you want to turn off this feature?</div> <div>Turn off</div> <div>Electric energy economy measurement</div> <div>Metric</div> <div>US/Imperial</div> <div>Twilio Messaging Policy</div> <div>Twilio Acceptable Use Policy</div> <div>Geotab SMS Terms</div> <div>By checking this box, you confirm that you have read, understood, and agree to the terms of this acknowledgment for receiving SMS notifications. Message frequency may vary. Standard message and data rates may apply. You can opt out at any time by replying STOP to any message.</div> <div>Beta Program Enrollment</div> <div>New beta features will be automatically enabled upon release.</div> <div>SMS and WhatsApp messages</div> <div>WhatsApp messages</div> <div>Geotab WhatsApp Terms</div> <div>WhatsApp Business Terms of Service</div> <div>Twilio Privacy Policy</div> <div>WhatsApp Privacy Policy</div> <div>Meta Privacy Policy</div> <div>By providing your phone number and checking this box, you agree to re
1ceive WhatsApp messages from Geotab regarding updates and notifications for monitoring fleet operations in connection with the Geotab solution. Messages will be sent from Geotab\'s official WhatsApp account, displayed as Geotab. You can opt out at any time by replying \'STOP\'.</div> <div>Note: This consent is separate from SMS notifications.</div> </div> </div> ')[0],this.optionsRegionalSettingsContent=Je.querySelector("#options_regionalSettings"),this.optionsMapSettingsContent=Je.querySelector("#options_mapSettings"),this.optionsUISettingsContent=Je.querySelector("#options_uiSettings"),this.optionsCookiesSettingsContent=Je.querySelector("#options_uiCookieSettings"),this.optionsHOSSettingsContent=Je.querySelector("#options_hosSettings"),this.optionsSystemCommunicationContent=Je.querySelector("#options_systemCommunications"),this.optionsDriverLicenseContent=Je.querySelector("#options_driverLicense"),this.optionsFeaturePreviewContent=Je.querySelector("#options_featurePreviewContent"),this.optionsFeaturePreviewEnrollmentBanner=Je.querySelector("#options__feature-preview-enrollment-banner"),this.localizer=t,this.errorHandler=y.errorHandler,this.store=y.entitiesLoader,this.options=(0,n.X$)(!0,{},V,i||{}),this.notifier=(0,r.Ay)(this.translateKey),this.inlineSaveMessage=new l.A(this.optionsMapSettingsContent),this.eventHandler=(0,o.Ay)(),this.pageForm=new T(this.localizer,this.translator.translate),this.hasAccessToPage=i.hasAccessToPage||(()=>!0),this.isFedRamp=i.isFedRamp||!1,this.defaultPages=[{id:"map",text:"Map"},{id:"dashboard",text:"Dashboard"},{id:"inventory",text:"Assets"},{id:"contact",text:"Support"},{id:"dvirs",text:"Asset Inspection"},{id:"routes",text:"Routing"},{id:"hosLogs",text:"HOS Logs"},{id:"systemSettings",text:"System Settings"},{id:"users",text:"Users"},{id:"about",text:"About"}].reduce(((e,t)=>(y.context.permissions.canViewPage(t.id)&&(e[t.text]=t.id),e)),{}),this.measurementSystems=[{text:this.translateKey("Metric"),value:"Metric"},{text:this.translateKey("USImperial"),value:"US"}],this.fuelEconomyUnits=[{text:this.translateKey("LPer100km"),value:"LitersPer100Km",compatibility:{isMetric:!0}},{text:this.translateKey("kmPerL"),value:"KmPerLiter",compatibility:{isMetric:!0}},{text:this.translateKey("MPGUS"),value:"MPGUS",compatibility:{isMetric:!1}},{text:this.translateKey("MPGImp"),value:"MPGImperial",compatibility:{isMetric:!1}},{text:this.translateKey("KmPerGallon"),value:"KmPerGallon",compatibility:{isMetric:!1}},{text:this.translateKey("GallonPer100Km"),value:"GallonPer100Km",compatibility:{isMetric:!1}}],this.electricEnergyEconomyUnitsMetric=[{text:this.translateKey("LitersEPer100Km"),value:"LitersEPer100Km",compatibility:{isMetric:!0}},{text:this.translateKey("KmPerLitersE"),value:"KmPerLitersE",compatibility:{isMetric:!0}},{text:this.translateKey("KiloWhPer100Km"),value:"KiloWhPer100Km",compatibility:{isMetric:!0}},{text:this.translateKey("WhPerKm"),value:"WhPerKm",compatibility:{isMetric:!0}},{text:this.translateKey("KmPerKiloWh"),value:"KmPerKiloWh",compatibility:{isMetric:!0}},{text:this.translateKey("KiloWhPerKm"),value:"KiloWhPerKm",compatibility:{isMetric:!0}}],this.electricEnergyEconomyUnitsImperial=[{text:this.translateKey("MPGEUS"),value:"MPGEUS",compatibility:{isMetric:!1}},{text:this.translateKey("MPGEImperial"),value:"MPGEImperial",compatibility:{isMetric:!1}},{text:this.translateKey("KiloWhPer100Miles"),value:"KiloWhPer100Miles",compatibility:{isMetric:!1}},{text:this.translateKey("WhPerMile"),value:"WhPerMile",compatibility:{isMetric:!1}},{text:this.translateKey("MilePerKiloWh"),value:"MilePerKiloWh",compatibility:{isMetric:!1}},{text:this.translateKey("KiloWhPerMile"),value:"KiloWhPerMile",compatibility:{isMetric:!1}}],this.sampleFormats=H.kl.reduce(((e,t)=>(e[this.translateKey(t)]=t,e)),{}),this.defaultProfiles=Object.keys(m.ty).reduce(((e,t)=>(e.push({id:t,name:this.translateKey(m.ty[t])}),e)),[]),this.sampleTimeFormats=H.HU.reduce(((e,t)=>(e[this.translateKey(t)]=t,e)),{}),this.firstDayOfWeek=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.shared=y,this.zenithTooltipEnabled=y.isFlagEnabled(P.u.ENABLE_ZENITH_TOOLTIP),this.renderTools(this.containers
1);const f=this.optionsCookiesSettingsContent.querySelector("#options_userCookieSettingsButton");null==f||f.addEventListener("click",(()=>{var e,t;this.isOsanoEnabled()&&(null===(t=null===(e=window.Osano)||void 0===e?void 0:e.cm)||void 0===t||t.showDrawer())})),this.zenithTooltipEnabled&&(this.setupTooltips(),null==Qe||Qe.setAttribute("aria-describedby","options_saved-views-tooltip")),this.newSavedMapViewEnabled=(0,U.fA)(y.isFlagEnabled,this.shared.context.currentUser),this.loadStoreData(ue,qe)}loadStoreData(e,t){return Promise.all([this.store.languages.getItemsByValue(),this.store.regions.getItemsByValue()]).then((([i,o])=>{if(this.languages=i.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.label]:t.value})),{}),this.regions=o.sort(((e,t)=>e.title>t.title?1:-1)),this.refreshLanguageOptions(e),t){const e=t.getState();t.setInnerState(this.getLicenseProvinceInnerState()),t.setState(e||"")}}),this.errorHandler)}refreshLanguageOptions(e){const t=e.getState()||e.elem.getAttribute("value");e.setInnerState(this.languages,void 0,!0),this.options.isMultipleEdit?e.setEditState(!0):t&&e.setState(t)}translate(){return Promise.all([this.localizer.translatePage(Je).then((e=>(this.translator.add(e),e))),this.localizer.translateSentences([...b,...x,"Views are positions on the map that have been saved. The view positioned at the top is the default when opening the map. Drag and drop views to change the order.","For example,","You cannot remove the default map view.","A view with that name already exists. Please enter a unique name for your map view.","The name cannot be empty.","Enter an abbreviation for License state/province using only the first two letters.","Enter the user's driver license number.","Profiles are used to display data in the units the user is familiar with. The features available are also determined by profile.","Add a profile to set custom or preferred unit measurements for users.","Choose how to display speeds and distances. You may need to refresh your browser to see the changes.","Choose how to display fuel economy. You may need to refresh your browser to see the changes.","Measurement specific to plug-in Electric Vehicles. The âeâ in L-e and MPG-e means the equivalent of electric energy in fuel, to compare electric energy economy to fuel vehicles.","Choose the currency to be displayed in the user interface and reports.","Review the Maintenance Cost Currency Conversion terms and conditions.","Choose how dates will be displayed in the user interface and reports.","Choose how time will be displayed in the user interface and reports.","Choose the timezone to match your location for accurate data display.","Select the day your week starts on to ensure accurate reporting.","Select your preferred language.","Choose the page you want to see first when you start the application.","The ruleset this driver will follow when using Hours of Service.","The name of the place of business where this driver usually reports for work. This can include a temporary work site designated by the motor carrier.","The address of the place of business where this driver usually reports for work.","Required for ELD data transfers to FMCSA for US enforcement. Values other than the USDOT number will cause the data transfer to fail.","The name of the motor carrier that this driver works for.","The address of the motor carrier that this driver works for.","Edit map view name","Select the map provider used to track your assets.","These are saved map positions. The top view is the default. Drag and drop views to reorder.","Show new installation record notification on the Assets page","All assets","Geotab SMS terms","By using the SMS Notification service, you acknowledge and agree as follows: (1) in accordance with applicable law, you have obtained the express consent of each recipient you enrol to receive SMS notifications, if obtained verbally using a script substantially similar to the suggested verbage below, and will respect and cooperate with any recipient's request to opt-out of receiving SMS notifications; (2) if you are enrolling as a recipient, you hereby consent to receive SMS messages from Geotab in connection with your use of the Geotab solution (sub
1ject to your right to opt-out); (3) you will comply with the Twilio Acceptable Use Policy, the Twilio Messaging Policy and any other policies or directives communicated to you by Geotab regarding the content of SMS messages sent and you understand that these policies prohibit sending messages that are, among other things, unlawful, harmful, abusive, or spam; (3) you understand that the SMS notification services are intended for business use related to your use of the Geotab solution and you will not use them for personal or unrelated purposes; (4) you acknowledge that SMS messages, which may include personally identifiable information, may be filtered by an automated decision-making system or machine learning platform for the purposes of spam and fraud detection, and you will inform each recipient of the same if required by applicable law; and (4) you understand that failure to comply with any of the above provisions is considered a breach of the Geotab End User Agreement, or such other agreement as may exist between you and Geotab with respect to your use of the Geotab solution, and may result in the suspension or termination of your access to the SMS services and/or the Geotab solution.","If you are obtaining consent to receive SMS messages from the recipient verbally, the following is a suggested draft script for obtaining such consent:","Introduction","Hello [Recipient Name], this is [Your Name] from [Customer Company Name]. We are engaging SMS functionality in the Geotab solution. This functionality will send you SMS messages about information necessary for monitoring fleet operations in connection with the Geotab solution.","Obtain Consent","Would you like to opt-in to receive these SMS messages? You can always opt-out later if you change your mind. Message frequency may vary. Standard message and data rates may apply. You can opt-out at any time by replying STOP to any message.","If End User Consents","Great! By saying 'Yes,' you consent to receiving SMS messages from [Customer Company Name] related to your use of the Geotab Solution.","Important Notes","Customize the script: Replace the bracketed information with the specific details relevant to the customer.","Document consent: Maintain a record of the end user's consent, including the date and time.","Provide clear opt-out instructions: Ensure end users know how to easily opt-out of receiving messages.","Respect opt-out requests: Immediately cease sending messages to end users who opt-out.","Comply with all applicable laws: This script is a template and may need to be adjusted to comply with specific anti-spam laws in your jurisdiction. Consult with legal counsel if necessary.","Accept","Geotab WhatsApp Terms","By using the WhatsApp notification service, you acknowledge and agree as follows: (1) in accordance with applicable law, you obtain the express consent of each recipient you enroll to receive WhatsApp notifications, if obtained verbally, using a script substantially similar to the suggested verbiage below, and will respect and cooperate with any recipient's request to opt out of receiving WhatsApp notifications; (2) if you are enrolling as a recipient, you hereby consent to receive WhatsApp messages from Geotab in connection with your use of the Geotab solution (subject to your right to opt out); (3) you will comply with the Meta Acceptable Use Policy, the WhatsApp Business Policy, the Twilio Acceptable Use Policy, the Twilio Messaging Policy and any other policies or directives communicated to you by Geotab regarding the content of WhatsApp messages sent, and you understand that these policies prohibit sending messages that are, among other things, unlawful, harmful, abusive, or constitute spam; (4) you understand that the WhatsApp notification services are intended for business use related to your use of the Geotab solution and you will not use them for personal or unrelated purposes; (5) you acknowledge that WhatsApp messages, which may include personally identifiable information, may be filtered by an automated decision-making system or machine-learning platform for the purposes of spam and fraud detection, and
1you will inform each recipient of the same if required by applicable law; (6) you acknowledge that the metadata related to the WhatsApp messages, which may include personally identifiable information, may be transferred to the United States, and you will inform each recipient of the same if required by applicable law; and (7) you understand that failure to comply with any of the above provisions is considered a breach of the Geotab End User Agreement, or such other agreement as may exist between you and Geotab with respect to your use of the Geotab solution, and may result in the suspension or termination of your access to the WhatsApp services and/or the Geotab solution.","If you are obtaining consent to receive WhatsApp messages from the recipient verbally, the following is a suggested draft script for obtaining such consent:","Hello [Recipient Name], this is [Your Name] from [Customer Company Name]. We are engaging WhatsApp notification functionality in the Geotab solution. This functionality will send you WhatsApp messages about information necessary for monitoring fleet operations in connection with the Geotab solution. The functionality will also include the transfer of metadata related to the messages to the solution provider's facilities in the United States.","Would you like to opt in to receive these WhatsApp messages? You can always opt out later if you change your mind. Message frequency may vary. You can opt out at any time by replying STOP to any message.","By saying 'Yes,' you consent to receiving WhatsApp messages from [Customer Company Name] related to your use of the Geotab solution.","SMS and WhatsApp messages","WhatsApp messages","Meta WhatsApp Business Policy","Twilio WhatsApp Terms","WhatsApp Business Terms of Service","By checking this box, you actively consent to receive the following types of messages via WhatsApp: fleet management alerts, vehicle status updates, driver notifications, maintenance reminders, service alerts, and system notifications related to your fleet operations. This consent is separate from SMS notifications. Message frequency may vary. Standard data rates may apply based on your mobile plan. You can withdraw consent at any time by replying STOP to any WhatsApp message."]).then((e=>(this.translator.add(e.dict),e.dict)))]).then((([e,t])=>new Map([...Object.entries(e),...t])))}setMaxPCState(e){"km"===this.localizer.getDistanceAbbreviation()?Ye.setState(e.toFixed(1)):Ye.setState((0,d.zeK)(e).toFixed(1))}setPageForm(){this.pageForm.setInnerState({timeZoneId:(this.options.timeZones||[]).reduce(((e,t)=>(e[t.id]=t.id,e)),{})}),this.pageForm.setInnerState({defaultMapEngine:this.mapTypesOptions.reduce(((e,t)=>(e[t.enText]=t.value,e)),{})})}update(e){var t,i,o,s,r,l,d;this.hideInconsistencyNotification(),(()=>{e.usersOptions&&(this.options.usersOptions=null)})(),(()=>{e.addInPages&&(this.options.addInPages=void 0)})(),this.options=(e=>(0,n.X$)(!0,{},this.options||{},e||{}))(e),this.providersSupport=this.options.providersSupport||{getUsableProviders:()=>[]},this.fuelEconomyUnits=it.updateOptions(this.economyMeasureHelper.getFuelEconomyMeasures(),this.fuelEconomyUnits,(e=>({text:(0,A.B5)((0,R.H$)(e.id),this.translateKey),value:(0,R.H$)(e.id),compatibility:{isMetric:E(e)}})));const{metric:c,imperial:u}=this.economyMeasureHelper.getElectricEconomyMeasures().reduce(((e,t)=>((E(t)?e.metric:e.imperial).push(t),e)),{metric:[],imperial:[]});this.electricEnergyEconomyUnitsMetric=it.updateOptions(c,this.electricEnergyEconomyUnitsMetric,(e=>({text:(0,A.L2)((0,R.u8)(e.id),this.translateKey),value:(0,R.u8)(e.id),compatibility:{isMetric:!0}}))),this.electricEnergyEconomyUnitsImperial=it.updateOptions(u,this.electricEnergyEconomyUnitsImperial,(e=>({text:(0,A.L2)((0,R.u8)(e.id),this.translateKey),value:(0,R.u8)(e.id),compatibility:{isMetric:!1}})));let m=this.options.usersOptions,h=(e=>e.systemSettings||{})(this.options),y=this.options.isMultipleEdit;(0,n.jD)(ve);this.pageForm.setInnerState({unitProfile:(e=>{var t;return Array.isArray(e)?e:null!==(t=this.options.unitProfiles)&&void 0!==t?t:[]})(e.unitProfiles).filter((e=>!!e.parentId)).concat(this.defaultProfiles).reduce(((e,t)=>
1(e.push({name:t.name,id:t.id}),e)),[])}),this.updateDefaultPageOptions(),this.mapTypesOptions=this.providersSupport.getUsableProviders().map((e=>({enText:this.localizer.translateKey(e.name||e.id),value:e.id,id:e.id}))),this.pageForm.setInnerState({timeZoneId:(this.options.timeZones||[]).reduce(((e,t)=>(e[t.name]=t.id,e)),{})}),this.pageForm.setInnerState({defaultMapEngine:this.mapTypesOptions.reduce(((e,t)=>(e[t.enText]=t.value,e)),{})}),this.renderTools(this.containers);let p=e=>{let t=(this.options.highlightGroups||[]).filter(a.WI);return e.filter((({settings:e})=>!this.newSavedMapViewEnabled||!(0,W.P$)(e).isLastMapView)).map((e=>Object.assign(Object.assign({},e),{name:e.name,highlightGroups:e.highlightGroups.filter(a.WI).map((e=>{let i=t.filter((t=>t.id===e))[0];return{id:e,name:i?i.name:""}}))})))},f=e=>{e&&this.pageForm.setInnerState({mapViews:p(e)}),(0,n.L$)(ee.parentNode,null!==e&&!y)};if(!(0,$.nD)(m)){let n;this.featurePreview=m.featurePreview||"";let{dateFormat:a,timeFormat:c}=(0,H.te)(m.dateFormat||""),u=m.defaultMapEngine,p=this.checkMapForUser(u,this.mapTypesOptions),g=(()=>p||!e.displayMap?u:this.mapTypesOptions.length&&this.mapTypesOptions[0].value)();te.value=g,f(m.mapViews);const v=e=>e||"";if(j.setState(v(m.unitProfile)),m.timeZoneId&&!this.options.isMultipleEdit){const e=q.OC.getTimezoneById(m.timeZoneId);e&&!m.unitProfile&&e.defaultDisplayProfile&&j.setState(e.defaultDisplayProfile)}this.renderCustomProfile(),se.setState(m.isMetric),re.setState(m.fuelEconomyUnit),le.setState(it.getElectricEnergyEconomy(m)),de.setState(a),this.changeDateFormatSample(!1),ne.setState(c),this.changeTimeFormatSample(!1),ce.setState(m.timeZoneId),this.updateDisplayTimeAction(),Me.setState(m.firstDayOfWeek),ue.setState((0,_.VT)(m.language)),me.setState(m.displayCurrency),this.applyNewUserRegionalDefaults(m.timeZoneId),ye.setState(g);const D=(0,z.zw)(m.defaultPage,this.shared.context.permissions.canViewPage,this.defaultPageOptionIds);fe.setState(D);let w=this.getRuleSetId();this.pageForm.setInnerState({hosRuleSet:this.getHosRuleOptions()}),w||(ie.value=""),n=(e=>null===e||isNaN(e)?null:parseFloat(m.maxPCDistancePerDay)/1e3)(m.maxPCDistancePerDay),w&&this.setHosRuleSet(w),this.setFedRampSettingsDisplay(),De.setState(m.isNewsEnabled),we.setState(m.isEmailReportEnabled),be.setState(null!==(t=m.isMaintenanceNotificationEnabled)&&void 0!==t&&t),Se.setState(null!==(i=m.isServiceDisruptionNotificationsEnabled)&&void 0!==i&&i),et.setState(m.isInstallationNotificationEnabled);let b=e=>y?"":e||"";Re.setState(m.companyName||h.companyName||""),Ee.setState(m.companyAddress||h.companyAddress||""),y&&(m.hosRuleSet=null,m.startOfDay=null,n=null,Ye.setState(""),Re.setState(""),Ee.setState(""),this.featurePreview=""),this.features.value=this.featurePreview,Ae.setState(b(m.carrierNumber)),$e.setState(b(m.licenseNumber)),qe.setState(b(m.licenseProvince)),Ne.setState(m.isYardMoveEnabled||!1),He.setState(m.isPersonalConveyanceEnabled||!1),Be.setState(void 0===m.isAdverseDrivingEnabled||m.isAdverseDrivingEnabled),Ue.setState(m.isEmergencyResponseExemptionAllowed||!1),tt.setState(null!==(o=m.autoEnrollInNewBetaFeatures)&&void 0!==o&&o),this.setFeaturePreviewEnrollmentBannerVisibility(null!==(s=m.autoEnrollInNewBetaFeatures)&&void 0!==s&&s),ze.setState(m.isExemptHOSEnabled||!1),Ve.setState(b(m.authorityName)),Ge.setState(b(m.authorityAddress||h.companyAddress)),null!==n&&this.setMaxPCState(n);let S=(m.startOfDay||"00:00").split(":"),C=new Date,T=new Date(C.getFullYear(),C.getMonth(),C.getDate(),S[0],S[1]);if(Le.setState({val:T,format:this.getTimeFormat()}),this.options.isSmsNotificationsEnabled&&xe.setState(m.smsNotificationsOptIn),this.options.isWhatsAppNotificationsEnabled){ke.setState(m.whatsAppNotificationsOptIn);const e=null!==(d=null===(l=null===(r=this.communicationTabPhoneNumberEditor)||void 0===r?void 0:r.phone)||void 0===l?void 0:l.phoneNumber)&&void 0!==d?d:"";this.whatsAppNotificationCheckboxHtmlElement&&(this.whatsAppNotificationCheckboxHtmlElement.disabled=void 0!==(0,I.Q7)(e))}}y&&(this.options.addBlankOptions=!0),[se,re,le,de,ne,ce,Me,ue,De,we,ye,fe,Ne,He,Be,Ue,ze,ge,et,tt,...this.options.isSmsNotificationsEnabled?[Ce,Te,xe]:[],...this.options.isWhatsAppNotificationsEnabled?[ke]:[],...!this.options.isSmsNotificationsEnabled&&this.options.isWhatsAppNotificationsEnabled?[Ce,Te]:[]].forEac
1h((e=>e.setEditState(this.options.addBlankOptions))),this.options.addBlankOptions&&this.toggleHosRuleSetOptions(""),this.options.addBlankOptions=!1}updateAccessRights(e){(0,n.X$)(this.options,e),e.hosAccess&&this.toggleHosRuleSetOptions(),pe.toggle(e.organizeViewsAccess),(0,n.BM)(Z,"",e.hasUserDisplayProfileAccess),this.updateDefaultPageOptions()}attachEvent(e,t){this.eventHandler.attachEvent(e,t)}getElt(e){return Je.querySelector(e)}}},24077(e,t,i){i.d(t,{X5:()=>l,dC:()=>d,uq:()=>c});var o=i(44654),n=i(34457);if(7818==i.j)var a=i(73797);const s="isUserNotifiedOfTimezone",r=["Your Timezone is currently set to {0}, but your computer Timezone is currently set to {1}. To change your Timezone, go to {LINK}. If this is intentional, please ignore this message.","Your Timezone is currently set to {0}, but your computer Timezone is currently set to {1}. If this is intentional, please ignore this message.","Profile"],l=(e,t,i,o,n,r=!1)=>r?Promise.resolve(void 0):i("UserSettings",(0,a.r3)(a.SD.ChangeYourOwnUserOptions))||i("UserAdmin",(0,a.Q8)(a.SD.UsersAndDrivers))?(o.hasItem(s)||o.setItem(s,!1,!0),o.getItem(s)?Promise.resolve(void 0):c(e,t,((e,i)=>n(t,i,(()=>o.setItem(s,!0,!0)))))):Promise.resolve(void 0),d=(e,t,i,a="")=>(s,l,d=o.tE)=>t([s,l,...r]).then((t=>(0,n.Ay)(i).displayPopupNotification(Object.assign(Object.assign({},((e,t,i,o,n)=>i?{message:o("Your Timezone is currently set to {0}, but your computer Timezone is currently set to {1}. If this is intentional, please ignore this message.").replace("{0}",o(e)).replace("{1}",o(t))}:{message:o("Your Timezone is currently set to {0}, but your computer Timezone is currently set to {1}. To change your Timezone, go to {LINK}. If this is intentional, please ignore this message.").replace("{0}",o(e)).replace("{1}",o(t)),link:{name:o("Profile"),href:n}})(s,l,e,(e=>t.dict.get(e)||i(e)),a)),{dismiss:d})))),c=(e,t,i)=>-(new Date).getTimezoneOffset()===e?Promise.resolve(void 0):i(t,(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return""}})()||"Unknown")},95645(e,t,i){i.d(t,{CO:()=>l,H8:()=>r,Ie:()=>p,VT:()=>y,fv:()=>u,kb:()=>m,mf:()=>c,xw:()=>f,yU:()=>d,z4:()=>h});var o=i(44654),n=i(48644),a=i(58550),s=i(73797);function r(e,t){if(e&&"string"==typeof e.lastAccessDate){let i=new Date(e.lastAccessDate),n=(new Date).getTime()-i.getTime(),a=864e5*(t||0);return!(0,o.JA)(e)&&a>0&&n>a}return!1}function l(e){let t=(new Date).toISOString();return!!e&&e.lockoutUntil>t}function d(e){let t=(0,o.Am)(e.split(",").map((e=>e.trim())).filter((e=>e.length))),i=[];return t.forEach((e=>{const t=e.split(" ");i=[...i,...t]})),(0,o.Am)(i)}function c(e){return e.length>1&&e.some((e=>e.length>1))?e.filter((e=>e.length>1)):e}function u(e,t,i){if(!t)return e;const n=(0,o.Am)(t.split(",").map((e=>e.toLowerCase().trim())).filter((e=>e.length))),a=[],s=[],r=[],l=[];return e.forEach((e=>{const t=`${e.firstName} ${e.lastName}`.toLowerCase(),i=`${e.lastName} ${e.firstName}`.toLowerCase(),o=e.name.toLowerCase(),d=[e.firstName.toLowerCase(),e.lastName.toLowerCase(),e.name.toLowerCase()],c=e.keys.length?e.keys.map((e=>{var t;return null===(t=e.serialNumber)||void 0===t?void 0:t.toLowerCase()})):void 0;let u=!1,m=!1,h=!1;n.forEach((e=>{var n;t===(n=e).trim()||i===n.trim()||o===n.trim()||c&&c.indexOf(n.trim())>-1?u=!0:d.some((t=>t===e.trim().toLowerCase()))?m=!0:(e=>{const t=e.toLowerCase().split(" ");return 1===t.length?d.some((t=>t.startsWith(e.trim()))):t.some((e=>d[0].startsWith(e.trim())))&&t.some((e=>d[1].startsWith(e.trim())))})(e)&&(h=!0)})),u?a.push(e):m?s.push(e):h?r.push(e):l.push(e)})),a.sort(((e,t)=>i*(0,o.UD)(e.name,t.name))),s.sort(((e,t)=>i*(0,o.UD)(e.name,t.name))),r.sort(((e,t)=>i*(0,o.UD)(e.name,t.name))),l.sort(((e,t)=>i*(0,o.UD)(e.name,t.name))),[...a,...s,...r,...l]}const m=(e,t,i)=>!i&&e("SystemSettings",(0,s.r3)(s.SD.SystemSettings))&&!t.getItem(n.b),h=(e,t)=>{let i=Object.assign({},e);return t?(i.iAMMetadata={isIAMVerified:!0,userId:(0,o.$C)()},i):i},y=e=>{var t;return(null===(t=a.Yj.find((t=>t.value.toLowerCase()===e.toLowerCase())))||void 0===t?void 0:t.value)||"en"};var p;!function(e){e.byUser="byName",e.byFirstName="byFirstName",e.byLoginDate="byLoginDate"}(p||(p={}));const f=(e,t,i)=>{let n=e.sort((a=i,s=o.UD,(e,t)=>a*s(e.nameToSort,t.nameToSort)));var a,s;switch(t){case p.byFirstName:n.sort(((e,t)=>i*(0,o.UD)(e.firstName,t.firstName)));break;case p.byUser:n.sort(((e,t)=>i*(0,o.UD)(e.name,t.name)));break;case p.byLoginDate:n.sort(((e,t)=>i*(0,o.H$)(e.lastAccessDate,t.lastAccessDate)))}return n}},935(e,t,i){i.d(t,{b:()=>n,u:()=>o});const o={x:-144.4921875,y:72.04683685302734,width:291.09375,height:-117.4452896118164},n=[{name:"Africa",coords:{x:-53.2177734375,y:37.544578552246094,width:145.546875,height:-72.89779663085938},isContinent:!0},{name:"Asia",coords:{x:18.5888671875,y:56.17002487182617,width:145.546875,height:-66.31195831298828},isContinent:!0},{name:"Australia",coords:{x:106.3916015625,y:-11.523087501525879,width:72.7734375,height:-33.68991470336914},isContinent:!0},{name:"Europe",coords:{x:-23.994140625,y:60.500526428222656,width:72.7734375,height:-25.614595413208008},isContinent:!0},{name:"North America",coords:{x:-172.7490234375,y:68.0897064208984,width:145.546875,height:-52.59367752075195},isContinent:!0},{name:"South America",coords:{x:-129.4189453125,y:14.562317848205566,width:145.546875,height:-68.12873077392578},isContinent:!0},{name:"World",coords:o,isContinent:!1}]},21809(e,t,i){i.d(t,{Y:()=>o});const o=e=>{Promise.all([i.e(7308),i.e(4271)]).then(i.bind(i,14271)).then((({captureNonFatal:t})=>t(e,"feature-flags"))).catch((()=>{}))}},73839(e,t,i){i.d(t,{X:()=>o});const o=(e,t)=>Object.entries(e).filter((([,e])=>t(e))).reduce(((e,[t,i])=>(e[t]=i,e)),{})},48173(e,t,i){i.d(t,{B5:()=>a,Cu:()=>r,L2:()=>o,Y6:()=>n,mF:()=>s});const o=(e,t)=>{switch(e){case"LitersEPer100Km":case"KmPerLitersE":case"KiloWhPer100Km":case"WhPerKm":case"KmPerKiloWh":case"MPGEUS":case"MPGEImperial":case"KiloWhPer100Miles":case"WhPerMile":case"MilePerKiloWh":case"KiloWhPerMile":case"KiloWhPerKm":return t(e);default:return"Unknown Electric Energy Economy Unit"}},n=(e,t)=>{switch(e){case"LitersPer100Km":return t("LitersEPer100Km");case"KmPerLiter":return t("KmPerLitersE");case"MPGUS":return t("MPGEUS");case"MPGImperial":return t("MPGEImperial");case"KmPerGallon":return t("Km/Gallon-e");case"GallonPer100Km":return t("GE/100km");default:return"Unknown Combined Economy Unit"}},a=(e,t)=>{switch(e){case"LitersPer100Km":return t("LPer100km");case"KmPerLiter":return t("kmPerL");case"MPGUS":return t("MPGUS");case"MPGImperial":return t("MPGImp");case"KmPerGallon":return t("KmPerGallon");case"GallonPer100Km":return t("GallonPer100Km");default:return"Unknown Fuel Economy Unit"}},s=(e,t)=>{switch(e){case"LitersPer100Km":case"KmPerLiter":return t("L-e");case"MPGUS":case"KmPerGallon":case"GallonPer100Km":return t("G-e (US)");case"MPGImperial":return t("G-e (Imp)");default:return"Unknown Combined Fuel and Energy Used Unit"}},r=(e,t)=>{switch(e){case"LitersPer100Km":case"KmPerLiter":return t("L");case"MPGUS":case"KmPerGallon":case"GallonPer100Km":return t("G (US)");case"MPGImperial":return t("G (Imp)");default:return"Unknown Fuel Used Unit"}}},18932(e,t,i){i.d(t,{c:()=>o});const o=e=>Object.entries(e).filter((([,e])=>void 0!==e)).reduce(((e,[t,i])=>(e[t]=i,e)),{})},72632(e,t,i){i.d(t,{Cl:()=>l,WI:()=>c,hj:()=>n,oQ:()=>d,xD:()=>s});var o=i(44654);function n(e){return e.split(",").reduce((function(e,t){let i=t.trim();if(i){let t=!/\sdesc$/i.test(i),a=i.replace(/\s.*$/i,"");e.push((o=e.length,n=s(a,t),function(t,i){return n(t,i)||(e.length>
1o+1?e[o+1](t,i):0)}))}var o,n;return e}),[])[0]}const a=function(e,t){let i=e;return t.forEach((function(e){i=null==i?void 0:i[e]})),i};function s(e,t,i){var n=void 0===t||!!t,s=n?1:-1,r=n?-1:1,l=e.split("."),d=void 0===i||!!i?function(e){return"string"==typeof e?e.toLowerCase():e}:o.WI;return function(e,t){var i=d(a(e,l)),o=d(a(t,l));return i>o?s:i<o?r:i!==o?i?r:s:0}}const r=function(e){return function(t,i){return t.reduce((function(t,o){var n=geotab.provide(i,o),a=e?n.id:n;return(t[a]||(t[a]={key:n,items:[]})).items.push(o),t}),{})}},l=(e,t,i)=>{let o=t.split(",")[0].trim().replace(/\s.*$/i,"").split("."),s=[],r={};return e.sort(n(t)).forEach((e=>{let t=a(e,o);t=""+((null==i?void 0:i(t))||t);let n=t.toLowerCase();n in r||(s.push(t),r[n]=!0),s.push(e)})),s};let d=r(!0),c=r(!1)},1628(e,t,i){i.d(t,{A:()=>w});var o=i(92191),n=i(44654),a=i(6502),s=i(12614);const r=function(){let e={mainContainer:null,myTab:null,previousButton:null,nextButton:null,centralPane:null,subCentralPane:null,monthContainer:null,yearContainer:null,timeContainer:null,subTimeContainer:null,timeText:null,hour:null,minutes:null,seconds:null,tContTable:null,zones:null,scheduler:null,subSchedulerContainer:null,calendar:null,tableHead:null,tableBody:null,buttonPanel:null,buttonNow:null,buttonDone:null,amount:null},t=function(){for(let t=0,i=Object.keys(e),o=i.length;t<o;t++)e[i[t]]=null},i=()=>{},n=function(n,a,l,d){let c,u,m,h,y,p,f,g=this,v=document.body,D=function(t){let i=t.target,n=()=>{(0,o.jo)(e.mainContainer,"selectShown"),t.stopImmediatePropagation()};if(!i.datepicker){let o=i;for(;o!==v&&o;){if(o===e.mainContainer)return void n();o=o.parentNode}if(i===v&&w(t.pageX,t.pageY))return void n();r.untrap(t),g.trigger("onHidePicker",t)}},w=(t,i)=>{let{top:o,left:n,height:a,width:s}=e.mainContainer.getBoundingClientRect();return i>=o&&i<=o+a&&t>=n&&t<=n+s},b=function(){q()&&$(e.mainContainer.inputElementLast)},S=function(e,t=0){if(void 0===e)return NaN;const i=parseInt(e,10);return isNaN(i)?t:i},C=function(t){(null==a?void 0:a.isNestedPopup)&&t.preventDefault();let i=this,o=new Date(S(i.dataset.year),S(i.dataset.month),S(i.dataset.day),S(e.hour.value),S(e.minutes.value),S(e.seconds.value));W[he.type](o),$();let n=t?t.currentTarget:null;n&&n.focus(),a.useMonthYearOnlySelectionMode&&T()},T=function(){let t=function(){let t=le||f;const i=S(e.yearContainer.value),o=S(e.monthContainer.value),n=S(e.hour.value),s=S(e.minutes.value),r=S(e.seconds.value);let l=new Date(i,o,t.getDate(),n,s,r);a.useMonthYearOnlySelectionMode&&new Date(i,o,1,n,s,r).getMonth()!==l.getMonth()&&(l=new Date(i,o+1,0,n,s,r));return l}();U(t)&&z(t,(function(){g.trigger("onChange")}))},x=function(e){e.stopPropagation()},k=(e,t=[])=>{let i=e.toLowerCase();for(let e=0,o=t.length;e<o;e++)if(t[e].toLowerCase()===i)return e>11?e-12:e;return null},M={toStringFormat:l,fromStringFormat:d},R=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},E=(e,t)=>{let i=[];if(e&&Array.isArray(e)){let o=1;t&&(o=t);let n=e.length;for(let t=0;t<n;t+=o)i.push(e[t])}return i},A=(e,t)=>{if(!e)return;let i=void 0===t||t;e.style.display=i?"":"none"},_=(e,t={},i={})=>{let o=document.createElement(e);for(let e=0,i=Object.keys(t),n=i.length;e<n;e++){let n=i[e];"class"===n?o.className=t[n]:o.setAttribute(n,t[n])}for(let e=0,t=Object.keys(i),n=t.length;e<n;e++){let n=t[e];o[n]=i[n]}return o},X=(e,t={})=>{for(let i=0,o=Object.keys(t),n=o.length;i<n;i++){let n=o[i];e.setAttribute(n,t[n].toString())}},O=(e,t=[])=>{for(let i=0,o=t.length;i<o;i++)e.removeAttribute(t[i])},P=e=>{e.stopPropagation()},L=t=>{let i=t?"addEventListener":"removeEventListener";v[i]("click",D,!1),v[i]("wheel",D,!1),e.mainContainer[i]("click",x,!1),window[i]("resize",b,!1),e.mainContainer[i]("wheel",P,!1)},I=function(t){let i=t.currentTarget,o=S(i.dataset.day),n=S(i.dataset.month),a=S(i.dataset.year),s=new Date(a,n,o,S(e.hour.value),S(e.minutes.value),S(e.seconds.value));z(s,(()=>{g.trigger("onChange")}))},N=function(e){let t=null!==le?M.toStringFormat(le,he[`${he.type}Format`]):"",i=c.value;if(t!==i)if(e){let e=M.fromStringFormat(i,he[`${he.type}Format`]),t=U(e)?H(e):null;null!==t&&z(t,(()=>{g.trigger("onChange")}))}else c.value=t},B=()=>
1{A(e.buttonPanel,!0),A(e.buttonDone,!0),e.buttonDone.onclick=function(e){c.removeEventListener("focus",ae,!1),c.addEventListener("blur",ne,!1),r.untrap(e),g.trigger("onHidePicker",e),e.stopImmediatePropagation()},A(e.buttonNow,!0),e.buttonNow.onclick=function(){let e=H(he.toLocalDateTime(new Date));z(e,(()=>{g.trigger("onChange")}))}},F=e=>{e.onclick=i,e.disabled=!0,(0,o.gR)(e,"disabled")},W={date:function(t,n=!1){let s=(e,t,i,o)=>new Date(i,t,e,23,59)<(o||f),r=(e,t,i)=>{let o=he.startDateForMaxSelectableDays?he.startDateForMaxSelectableDays:f;return new Date(i,t,e,0,0)>new Date(o.getFullYear(),o.getMonth(),o.getDate()+(he.maxSelectableDays||0),0,0)},l=f,d=le,c=t||null,u=function(e,t,i){let o=i.map(((e,o)=>{let n=_("option");return n.innerText=e.toString(),n.setAttribute("value",(12===i.length?o:e).toString()),n.innerText===t&&n.setAttribute("selected","selected"),n}));e.innerHTML="",o.forEach((t=>{e.appendChild(t)}))},m=1,h=(e,t,i)=>{let o=t===e.getMonth(),n=i===e.getFullYear();return o&&n};N(),B(),n||(A(e.timeContainer,!1),A(e.myTab),A(e.scheduler,!a.useMonthYearOnlySelectionMode&&void 0)),c=c||d||l;let g=he.monthNames[c.getMonth()],v=c.getMonth(),D=c.getFullYear(),w=me.indexOf(he.startOfWeek),b=(S=new Date(D,v,1).getDay())>(x=w)?S-x:7-x+S;var S,x;let k=(M=c,33-new Date(M.getFullYear(),M.getMonth(),33).getDate());var M;let E=e.tableBody.querySelectorAll("button");R(e.tableHead),e.tableHead.appendChild((e=>{let t=he.minDayNames.slice(e),i=_("tr");for(let i=0;i<e;i++)t.push(he.minDayNames[i]);for(let e=0,o=he.minDayNames.length;e<o;e++){let o=_("th",{},{innerHTML:t[e]});i.appendChild(o)}return i})(w)),u(e.monthContainer,g,y),he.selectingMonth?(0,o.gR)(e.monthContainer,"hover"):(e.monthContainer.setAttribute("disabled","disabled"),(0,o.jo)(e.monthContainer,"hover")),u(e.yearContainer,D.toString(),p),he.selectingYear?(0,o.gR)(e.yearContainer,"hover"):(e.yearContainer.setAttribute("disabled","disabled"),(0,o.jo)(e.yearContainer,"hover"));let P=H(new Date(0===v?D-1:D,0===v?11:v-1,1,c.getHours(),c.getMinutes(),c.getSeconds()),!0);e.previousButton.title=`${he.previousMonthLabel} (${he.monthNames[P.getMonth()]} ${P.getFullYear()})`,X(e.previousButton,{"data-day":1,"aria-label":`${he.previousMonthLabel} (${he.monthNames[P.getMonth()]} ${P.getFullYear()})`,"data-month":P.getMonth(),"data-year":P.getFullYear()}),e.previousButton.onclick=C,e.nextButton.onclick=C;let L,W,z=H(new Date(11===v?D+1:D,11===v?0:v+1,1,c.getHours(),c.getMinutes(),c.getSeconds()),!1);e.nextButton.title=`${he.nextMonthLabel} (${he.monthNames[z.getMonth()]} ${z.getFullYear()})`,X(e.nextButton,{"data-day":1,"aria-label":`${he.nextMonthLabel} (${he.monthNames[z.getMonth()]} ${z.getFullYear()})`,"data-month":z.getMonth(),"data-year":z.getFullYear()});for(let e=0;e<E.length;e++){let t=E[e];if(t.className="",t.setAttribute("tabindex","-1"),e<b)if((he.blockPreviousDays||he.maxSelectableDays&&s(m,v,D,he.startDateForMaxSelectableDays))&&F(t),he.showSiblingMonthsDays){let i=new Date(D,v,1-(b-e),0,0,0);X(t,{"data-day":i.getDate(),"data-month":i.getMonth(),"data-year":i.getFullYear(),title:`${y[i.getMonth()]} ${i.getDate()}`,"aria-label":`${y[i.getMonth()]} ${i.getDate()}`}),t.onclick=I,t.textContent=m.toString(),t.textContent=i.getDate().toString(),(0,o.gR)(t,"number"),(0,o.gR)(t,"grey")}else t.onclick=i,O(t,["data-day","data-month","data-year"]),t.innerHTML="",(0,o.gR)(t,"space");else if(m<=k)W||(W=t),he.blockPreviousDays&&s(m,v,D)||he.startDateForMaxSelectableDays&&s(m,v,D,he.startDateForMaxSelectableDays)||he.maxSelectableDays&&r(m,v,D)?F(t):(t.removeAttribute("disabled"),t.onclick=I,(0,o.gR)(t,"number")),t.textContent=m.toString(),X(t,{"data-day":m,"data-month":v,"data-year":D,title:`${y[v]} ${m}`,"aria-label":`${y[v]} ${m}`}),null!==d&&U(d)&&m===d.getDate()?h(d,v,D)&&((0,o.gR)(t,"selected_date"),L=t):U(l)&&m===l.getDate()&&h(l,v,D)&&(0,o.gR)(t,"today_date"),m++;else if(he.showSiblingMonthsDays){let e=new Date(D,v,m,0,0,0);X(t,{"data-day":e.getDate(),"data-month":e.getMonth(),"data-year":e.getFullYear(),title:`${y[e.getMonth()]} ${e.getDate()}`,"aria-label":`${y[e.getMonth()]} ${e.getDate()}`}),he.maxSelectableDays&&r(m,v,D)?F(t):(t.removeAttribute("disabled"),t.onclick=I,(0,o.gR)(t,"number"),(0,o.gR)(t,"grey")),t.textContent=e.getDate().toString(),m++}else t.onclick=i,O(t,["data-day","data-month","data-year"]),t.innerHTML="",(0,o.gR)(t,"space")}L?L.removeAttribute("tabindex"):W.removeAttribute("tabindex"),(()=>{if(!he.showSiblingMonthsDays){let t=e.tableBody.querySelector("tr.datepicker_scheduler_calendar_body_last_row");t&&(t.style.display=t.querySelectorAll(".space").length<7?"table-row":"none")}})(),e.monthContainer.onchange=T,e.yearContainer.onchange=T;let $=e.calendar.querySelectorAll("button");return[].forEach.call($,(e=>{e.onkeydown=function(t){let i=t.which||t.keyCode,o=e.dataset.day,n=e.dataset.month,a=e.dataset.year,s=function(t,i){e.setAttribute("tabindex","-1"),Y(o,n,a,i),t.stopPropagation()};38===i?s(t,-59472e4):40===i?s(t,61488e4):37===i?s(t,-8496e4):39===i&&s(t,8784e4)}})),!0},time:function(t=!1){let i=/\s?(tt|t|TT|T)\s?/.exec(he.timeFormat),n=function(e,t,i){let o=e=>{let t=parseInt(e),i=(t<13?e:e-12)+(t<12?" AM":" PM");return 0===t&&(i+=" (12 AM)"),i},n="";for(let e=0,a=t.length;e<a;e++){let a=t[e];n+=`<option class="select_option" value="${a}">${i?o(a):a}</option>`}e.innerHTML=n};N(),B(),t||(A(e.timeContainer),A(e.myTab,!1),A(e.scheduler,!1));let a=e.tContTable.querySelector(".controls.seconds");if(he.showSeconds?(0,o.jo)(a,"hidden"):(0,o.gR)(a,"hidden"),A(e.tContTable.querySelector(".t_cont_table_row.zones"),he.showZones),R(e.hour),R(e.minutes),R(e.seconds),n(e.hour,u,!(!i||2!==i.length)&&i[1]),n(e.minutes,m),n(e.seconds,h),le){let t=e=>e<10?`0${e}`:e.toString();e.timeText.innerHTML=M.toStringFormat(le,he.timeFormat),e.hour.value=t(le.getHours()),e.minutes.value=t(le.getMinutes()),e.seconds.value=t(le.getSeconds())}return e.hour.onchange=T,e.minutes.onchange=T,e.seconds.onchange=T,!0},datetime:function(t){return W.time(!0),W.date(t,!0),B(),A(e.timeContainer),A(e.myTab),A(e.scheduler,!a.useMonthYearOnlySelectionMode&&void 0),!0}},H=function(e,t){let i=e.getDate(),o=e.getMonth(),n=he.monthNames[o],a=!1,s=(()=>{let e=[],t=he.monthNames;for(let i=0,o=y.length;i<o;i++)e.push(k(y[i],t));return e})(),r=e.getFullYear(),l=r.toString(),d=!1,c=e=>e<10?`0${e}`:e.toString(),f=e.getHours(),g=c(f),v=e.getMinutes(),D=c(v),w=e.getSeconds(),b=c(w),S=e.getMilliseconds()||0,C=(e,t)=>{let i=e.length;if(t<=e[0])return{min:e[0],max:e[1]};if(t>=e[i-1])return{min:e[i-2],max:e[i-1]};for(let o=0;o<i;o++)if(t<e[o])return{min:e[o-1],max:e[o]};return{min:e[0],max:e[1]}},T=e=>t=>t===e;if(null===k(n,y)&&(a=!0),p.some(T(l))||(d=!0),!u.some(T(g))){let e=C(u,f);f=void 0!==t&&t?e.min:e.max}if(!m.some(T(D))){let e=C(m,v);v=void 0!==t&&t?e.min:e.max}if(!h.some(T(b))){let e=C(h,w);w=void 0!==t&&t?e.min:e.max}let x=(()=>
1{if(void 0!==t&&t){if(d)return o=s[s.length-1],r=C(p,r).min,!a&&d&&r===p[0]&&(o=s[0]),new Date(r,o,i,f,v,w);a&&!d&&(o=C(s,o).min)}else{if(a&&d||!a&&d)return o=s[0],r=C(p,r).max,!a&&d&&r===p[p.length-1]&&(o=s[s.length-1]),new Date(r,o,i,f,v,w);a&&!d&&(o=C(s,o).max)}})();return void 0===x?new Date(r,o,i,f,v,w,S):x},U=e=>e&&e instanceof Date&&!isNaN(e.getDate()),z=(e,t)=>{let i;if(e instanceof Date?i=e:e&&(i=(e=>{let t=new Date(e);if(U(t))return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCMilliseconds())})(e)),void 0!==i&&U(i)){let e=H(i),o=!le||e.getTime()!==le.getTime();e.getTime()!==i.getTime()?he.autoCorrectDate&&o&&g.trigger("onChangeDate",le,e):o&&g.trigger("onChangeDate",le,e),t&&t()}},$=function(t){(0,o.AH)(e.mainContainer,{display:"block"});let i=t||c,n=v.getBoundingClientRect(),a=e.mainContainer.getBoundingClientRect(),l=i.getBoundingClientRect(),d=0-v.scrollTop-window.pageYOffset,u=0-v.scrollLeft-window.pageXOffset,m=l.bottom-d,h=(0,s.Pv)()?n.width-l.right+u:l.left-u;m+a.height>n.height&&(m=l.top-d>=a.height?l.top-d-a.height:n.height-2-a.height),h+a.width>n.width&&(h=n.width-2-a.width),e.mainContainer.addEventListener("keydown",Q,!1),i&&i.focus(),(0,o.AH)(e.mainContainer,{top:`${m}px`,insetInlineStart:`${h}px`}),g.trigger("onShowPickerEnd");const y=e.mainContainer.querySelector(".selected_date")||e.mainContainer;r.trap(y)},q=()=>"block"===e.mainContainer.style.display,V=function(e){e.preventDefault(),g.trigger("onShowPicker")},G="http://www.w3.org/2000/svg",K=e=>{let t=document.createElementNS(G,"svg");return t.setAttribute("class","svgIcon rtl-mirror"),t.appendChild(((e,t)=>{let i=document.createElementNS(G,"use");return i.setAttributeNS("http://www.w3.org/1999/xlink","href",`#geo-${e}`),t&&(i.className.baseVal=t),i})(e)),t},Y=(t,i,o,n)=>{let a=new Date(o,i,t),s=new Date(a.getTime()+n);a.getMonth()!==s.getMonth()&&W[he.type](new Date(s.getFullYear(),s.getMonth(),1));let r=(t=>{let i=t.getDate(),o=t.getMonth(),n=t.getFullYear();return e.calendar.querySelector(`button[data-day='${i}'][data-month='${o}'][data-year='${n}']`)})(s);r&&(r.removeAttribute("tabindex"),r.focus())},j=e=>{13===e.keyCode&&(ae(e),e.preventDefault())},Z=e=>{let t=c,i=e?"addEventListener":"removeEventListener";if(e){(0,o.gR)(c,"hasDatePicker");for(let e in he.on)he.on.hasOwnProperty(e)&&g.on(e,he.on[e]);g.on("onHidePicker",J),g.on("onShowPicker",ee),g.on("onChangeDate",te)}else{(0,o.jo)(c,"hasDatePicker");for(let e in he.on)he.on.hasOwnProperty(e)&&g.off(e,he.on[e]);g.off("onHidePicker",J),g.off("onShowPicker",ee),g.off("onChangeDate",te)}document.documentElement&&"ontouchstart"in document.documentElement?(t[i]("touchstart",V,!1),t[i]("touchend",V,!1),t[i]("focus",V,!1),t[i]("input",ie,!1),t[i]("change",oe,!1)):(t[i]("input",ie,!1),t[i]("change",oe,!1),t[i]("click",ae,!1),t[i]("focus",ae,!1),t[i]("keydown",j,!1))},Q=e=>{27===(e.which||e.keyCode)&&(c.removeEventListener("focus",ae,!1),c.addEventListener("blur",ne,!1),r.untrap(e),g.trigger("onHidePicker",e),e.stopPropagation())},J=function(){var t;!(t=!1)&&(0,o.jo)(e.mainContainer,"selectShown"),A(e.timeContainer,t),A(e.myTab,t),A(e.scheduler,!a.useMonthYearOnlySelectionMode&&t),(0,o.AH)(e.mainContainer,{display:"none"}),e.mainContainer.removeEventListener("keydown",Q,!1)},ee=function(){if(f=ue(),e.mainContainer.currentInput=c,le)W[he.type]();else{R(e.hour),R(e.minutes),R(e.seconds),se();let t=""===e.hour.value?0:u[0],i=""===e.minutes.value?0:m[0],o=""===e.seconds.value?0:h[0],n=new Date(f.getFullYear(),f.getMonth(),f.getDate(),t,i,o);z(H(n))}$()},te=function(t,i){let o=M.toStringFormat(i,he[`${he.type}Format`]);le=i,c.value!==o&&(c.value=o),e.mainContainer.currentInput&&e.mainContainer.currentInput!==c||W[he.type](i),g.trigger("onAfterChangeDate",t,i)},ie=function(t){t.preventDefault(),e.mainContainer.inputElementLast=this;let i=this.value.trim(),o=new Date(i),n=he[`${he.type}Format`];if(!U(o)&&/[^\/\s\d:\.-]/.test(i)&&!/tt|TT|T|t|MMMM|MMM|dddd|ddd/.test(n))return void(this.value=i.replace(/[^\/\s\d:\.-]/gi,"").trim());let a=M.fromStringFormat(i,n);U(a)&&z(a,(()=>{g.trigger("onChange")}))},oe=function(){let t=this.value;e.mainContainer.inputElementLast=this;let i=M.fromStringFormat(t,he[`${he.type}Format`]);z(i,(()=>{g.trigger("onChange")}))},ne=function(){c.removeEventListener("blur",ne,!1),c.addEventListener("focus",ae,!1)},ae=function(t){(null==a?void 0:a.isNestedPopup)&&t.preventDefault(),e.mainContainer.inputElementLast=this;let i=e.mainContainer.currentInput===this;("focus"===t.type||"click"===t.type)&&i&&q()||(le&&N(!0),g.trigger("onShowPicker"))},se=function(){y=(e=>{let t=[];if(Array.isArray(e)){let i=e.length;for(let o=0;o<i;o++)t.push(he.monthNames[e[o]-1])}else if(!isNaN(parseInt(e.toString()))){let i=he.monthNames.length,o=1;const n=parseInt(e.toString());n>1&&(o=n);for(let e=0;e<i;e+=o)t.push(he.monthNames[e])}if(!t.length)throw new Error("Unknown range of year!\r\nCheck your datepicker options");return t})(he.rangeMonths),p=function(e){let t=[],i=e;if(Array.isArray(i)){let e=i.length;for(let o=0;o<e;o++)t.push(i[o].toString())}else{let e;if(/c/.test(i)){i=i.replace(/c/gim,""),e=i.split(":");let t=2e3;
1for(let i=0;i<2;i++)/-/.test(e[i])?(e[i]=parseInt(e[i].replace("-","")),e[i]=t-(e[i]||0)):(e[i]=parseInt(e[i].replace("+","")),e[i]=t+(e[i]||0))}else{e=i.split(":");for(let t=0;t<2;t++)e[t]=parseInt(e[t])}if(e[0]>e[1]){let t=e[0];e[0]=e[1],e[1]=t}for(let i=e[0];i<=e[1];i++)t.push(i.toString())}if(!t.length)throw new Error("Unknown range of year!\r\nCheck your datepicker options");return t}(he.rangeYears),u=E(de,he.stepHours),m=E(ce,he.stepMinutes),h=E(ce,he.stepSeconds)},re=e=>{let t=[];for(let i=0;i<e;i++)t.push(i<10?`0${i}`:i.toString());return t},le=null,de=re(24),ce=re(60),ue=()=>he.toLocalDateTime(new Date),me=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],he={dateFormat:"dd/MM/yy",timeFormat:"HH:mm:ss",datetimeFormat:"dd/MM/yy HH:mm:ss",type:"date",on:{},rangeMonths:0,rangeYears:"c-50:c+50",hourText:"Hours",startOfWeek:"Sunday",minutesText:"Minutes",secondsText:"Seconds",zoneText:"Zone",timeText:"Time",currentText:"Now",nextMonthLabel:"Go to next month",previousMonthLabel:"Go to previous month",selectMonth:"Select month",selectYear:"Select year",selectDate:"Select date",selectHour:"Select hour",selectMinute:"Select minute",selectSecond:"Select second",selectTimezone:"Select Timezone",closeText:"Done",showButtonPanel:!1,showNowButton:!0,showSiblingMonthsDays:!1,changeDateOnClickNewYear:!1,minDayNames:["Su","Mo","Tu","We","Th","Fr","St"],shortDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNames:me.slice(),shortMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],autoCorrectDate:!0,selectingMonth:!0,selectingYear:!0,shortYearCutoff:50,stepMinutes:0,stepSeconds:0,stepHours:0,showSeconds:!1,showZones:!1,toLocalDateTime:e=>e};if(f=ue(),g.on=function(e,t){this.selfEventHandlers||(this.selfEventHandlers=[]),this.selfEventHandlers[e]||(this.selfEventHandlers[e]=[]),this.selfEventHandlers[e].push(t)},g.off=function(e,t){let i=this.selfEventHandlers[e];if(!i)return;let o=i.length;for(let e=0;e<o;e++)i[e]===t&&i.splice(e--,1)},g.trigger=function(e,...t){let i=this.selfEventHandlers[e];if(!i)return;let o=i.length;for(let e=0;e<o;e++)i[e].apply(this,t)},he=Object.assign(Object.assign({},he),a||{}),c=(()=>{if("string"==typeof n)return v.querySelector(`#${n}[type='text']`);if(n)return n;throw new Error("Undefined input element")})(),c&&c.setAttribute("autocomplete","off"),c&&c.datepicker)return c.datepicker;e.mainContainer&&e.mainContainer.parentNode?e.amount+=1:(t(),e.mainContainer||(e.mainContainer=_("div",{class:"datepicker_main_container",role:"dialog","aria-modal":"true","aria-label":he.selectDate}),v.appendChild(e.mainContainer)),e.myTab=_("div",{class:"month_year_tab"}),e.mainContainer.appendChild(e.myTab),e.previousButton=_("button",{class:"month_year_tab_button l_button"}),e.previousButton.appendChild(K("arrow-left-old")),e.myTab.appendChild(e.previousButton),e.centralPane=_("div",{class:"central_pane"}),e.myTab.appendChild(e.centralPane),e.nextButton=_("button",{class:"month_year_tab_button r_button"}),e.nextButton.appendChild(K("arrow-right")),e.myTab.appendChild(e.nextButton),e.subCentralPane=_("div",{class:"central_pane_sub"}),e.centralPane.appendChild(e.subCentralPane),e.monthContainer=_("select",{class:"central_pane_month"}),e.monthContainer.setAttribute("aria-label",he.selectMonth),e.subCentralPane.appendChild(e.monthContainer),e.yearContainer=_("select",{class:"central_pane_year"}),e.yearContainer.setAttribute("aria-label",he.selectYear),e.subCentralPane.appendChild(e.yearContainer),function(){let t;e.scheduler=_("div",{class:"scheduler"}),e.mainContainer.appendChild(e.scheduler),e.subSchedulerContainer=_("div",{class:"scheduler_sub"}),e.scheduler.appendChild(e.subSchedulerContainer),t=_("div",{class:"modalWindow"}),e.scheduler.appendChild(t),e.calendar=_("table",{class:"scheduler_calendar"}),e.subSchedulerContainer.appendChild(e.calendar),e.tableHead=_("thead",{class:"calendar_header"}),e.calendar.appendChild(e.tableHead),e.tableBody=_("tbody",{class:"calendar_body"}),(e=>{for(let t=0;t<6;t++){let i=_("tr",{class:t+1===6?"datepicker_scheduler_calendar_body_last_row":""});for(let e=0;e<7;e++){let e=_("td",void 0,void 0),t=_("button",void 0,void 0);e.appendChild(t),i.appendChild(e)}e.appendChild(i)}})(e.tableBody),e.calendar.appendChild(e.tableBody)}(),(()=>{let t=e=>{let t=_("tr",{class:"t_cont_table_row"}),i=_("td",{class:"descr"},{innerHTML:e});return t.appendChild(i),t},i=e=>{let i=t(e.label),n=_("td",{class:"controls"});return(0,o.gR)(i,e.className),n.appendChild(e.element),i.appendChild(n),i};e.timeContainer=_("div",{class:"time_container"}),e.mainContainer.appendChild(e.timeContainer),e.subTimeContainer=_("div",{class:"datepicker_time_container_sub"}),e.timeContainer.appendChild(e.subTimeContainer);let n=_("div",{class:"modalWindow"});e.timeContainer.appendChild(n),e.tContTable=_("table",{class:"t_cont_table"}),e.subTimeContainer.appendChild(e.tContTable),e.timeText=_("span",{class:"t_cont_time_text"}),e.hour=_("select",{class:"select datepicker_time_hour"}),e.hour.setAttribute("aria-label",he.selectHour),e.minutes=_("select",{class:"select datepicker_time_minutes"}),e.minutes.setAttribute("aria-label",he.selectMinute),e.seconds=_("select",{class:"select datepicker_time_seconds"}),e.seconds.setAttribute("aria-label",he.selectSecond),e.zones=_("select",{class:"select datepicker_time_zones"}),e.zones.setAttribute("aria-label",he.selectTimezone);let a=[{className:"time",label:he.timeText,element:e.timeText},{className:"hour",label:he.hourText,element:e.hour},{className:"minutes",label:he.minutesText,element:e.minutes},{className:"seconds",label:he.secondsText,element:e.seconds},{className:"zones",label:he.zoneText,element:e.zones}],s=t(he.timeText),r=a.length-1;for(let t=1;t<r;t++){let o=a[t];if(o.element===e.zones)e.tContTable.appendChild(i(o));else{let e=_("td",{class:"controls "+o.className});if(1!==t&&t!==r-1){let e=_("td",{class:"separator"},{innerHTML:":"});s.appendChild(e)}e.appendChild(o.element),s.appendChild(e)}}e.tContTable.appendChild(s)})(),e.buttonPanel=_("div",{class:"button_panel"}),e.mainContainer.appendChild(e.buttonPanel),e.buttonNow=_("button",{class:"button button_now"},{innerHTML:he.currentText}),e.buttonPanel.appendChild(e.buttonNow),e.buttonDone=_("button",{class:"button button_done"},{innerHTML:he.closeText}),e.buttonPanel.appendChild(e.buttonDone),a.useMonthYearOnlySelectionMode&&(e.buttonPanel.style.border="0"),L(!0),e.amount=1),Z(!0),se();let ye={attachEvent:(e,t)=>
1{g.on(e,t)},detachEvent:(e,t)=>{g.off(e,t)},hide:()=>{g.trigger("onHidePicker")},show:()=>{g.trigger("onShowPicker")},setDate:e=>{z(e)},getDate:()=>null===le?null:new Date(le.getTime()),getOptions:function(e){let t={},i=typeof e;if(void 0===e)return Object.assign({},he);if("string"==typeof e)return he[e]||void 0;if("object"===i)for(let i=0,o=Object.keys(e),n=o.length;i<n;i++){let e=o[i];t[e]=he[e]||void 0}return t},setOptions:function(t){"object"==typeof t&&(Z(!1),he=Object.assign(Object.assign({},he),t),Z(!0),se(),null!==le&&z(le),null!==le&&U(le)&&(e.mainContainer.currentInput===c&&q()&&W[he.type](),N()))},getContainer:function(){return e.mainContainer},clear:()=>{le=null,c.value=""},destroy:function(){Z(!1),e.amount-1==0?(L(!1),v.removeChild(e.mainContainer),t()):e.amount-=1,delete c.datepicker}};return c.datepicker=ye,c.datepicker};const r=new a.A;return(e,t,i,o)=>new n(e,t,i,o)}();var l=i(89073),d=i(85400);const c=e=>(t,i)=>{var o=function(e,t,i){var o,n="(";for(o=e;o<t;o++)n+=o!==t-1?`${i[o]}|`:i[o];return n+=")"},a=[],s="(\\d{1,2})",r="(\\d{2})",l=function(e,t){return function(){return a.push(e),t}},d={d:l("date",s),dd:l("date",r),ddd:l("dateStr",o(0,7,e.shortDayNames)),dddd:l("dateStr",o(0,7,e.dayNames)),M:l("month",s),MM:l("month",r),MMM:l("month",o(0,12,e.shortMonthNames)),MMMM:l("month",o(0,12,e.monthNames)),y:l("yearShort",s),yy:l("yearShort",r),yyyy:l("year","(\\d{3,4})"),h:l("hours",s),hh:l("hours",r),H:l("Hours",s),HH:l("Hours",r),m:l("minutes",s),mm:l("minutes",r),s:l("seconds",s),ss:l("seconds",r),l:l("milliseconds",s),L:l("milliseconds",r),t:l("t",`(${e.dayPeriods.narrow.am}|${e.dayPeriods.narrow.pm})`),tt:l("t",`(${e.dayPeriods.wide.am}|${e.dayPeriods.wide.pm})`),T:l("t",`(${e.dayPeriods.narrow.am.toUpperCase()}|${e.dayPeriods.narrow.pm.toUpperCase()})`),TT:l("t",`(${e.dayPeriods.wide.am.toUpperCase()}|${e.dayPeriods.wide.pm.toUpperCase()})`)};let c=(0,n.z)(i).replace(/d{1,4}|M{1,4}|yy(?:yy)?|y|([HhmsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,(function(e){return e in d?d[e]():e.toString()})),u=new RegExp(c,"g").exec(t);return u&&u.length&&u.length-1===a.length?function(t,i){var o,n={date:null,month:null,year:null,hours:0,minutes:0,seconds:0,milliseconds:0},a=!1,s=new Date;let r=e=>isNaN(e)?null:e;i.forEach((function(i,o){let s=t[o+1],l=parseInt(s),d=isNaN(l);switch(i){case"month":n.month=d?function(e,t){var i=null;return(t||[]).forEach((function(t,o){t.toLowerCase()===e.toLowerCase()&&(i=o>11?o-12:o)})),i}(s,e.shortMonthNames.concat(e.monthNames)):l-1;break;case"year":d||(n.year=((e,t)=>e.length>2?t:2e3+t)(s,l));break;case"yearShort":d||(n.year=(e=>(e<=50?2e3:1900)+e)(l));break;case"Hours":a=!0,n.hours=r(l);break;case"date":case"hours":case"minutes":case"seconds":case"milliseconds":n[i]=r(l);break;case"t":if(!a){let t=((t,i)=>{if(null===t)return null;const{narrow:o,wide:n}=e.dayPeriods,a=[o.am,o.am.toUpperCase(),n.am,n.am.toUpperCase()],s=[o.pm,o.pm.toUpperCase(),n.pm,n.pm.toUpperCase()];return a.includes(i)&&t>=12?t-12:s.includes(i)&&t<12?t+12:null})(n.hours,s);null!==t&&(n.hours=t)}}})),n.date=null!==n.date?n.date:s.getDate(),n.month=null!==n.month?n.month:s.getMonth(),n.year=n.year||s.getFullYear(),n.hours=null!==n.hours?n.hours:0,n.minutes=n.minutes||0,n.seconds=n.seconds||0,n.milliseconds=n.milliseconds||0;let l=!1;for(o in n)if(null===o){l=!0;break}return l?null:new Date(n.year,n.month,n.date,n.hours,n.minutes,n.seconds,n.milliseconds)}(u,a):null};let u,m={date:(0,n.Pm)((()=>(0,l.yD)())),time:(0,n.Pm)((()=>(0,l.zZ)())),datetime:(0,n.Pm)((()=>(0,l.N0)()||(0,l.WW)())),datetimelocal:(0,n.Pm)((()=>(0,l.WW)()))},h=e=>(e||[]).map((e=>e.substring(0,3))),y=["January","February","March","April","May","June","July","August","September","October","November","December"],p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f={datepicker:{clearText:"Clear",clearStatus:"EraseCurrentDate",closeText:"Done",closeStatus:"CloseWithoutChange",prevText:"Prev",prevStatus:"ShowPreviousMonth",nextText:"Next",nextStatus:"ShowNextMonth",currentStatus:"ShowCurrentMonth",monthNames:y.slice(),monthNamesShort:h(y),monthStatus:"ShowDifferentMonth",yearStatus:"ShowDifferentYear",weekStatus:"WeekYear",dayNames:p.slice(),dayNamesShort:h(p),dayStatus:"DayStatus",initStatus:"SelectDate",currentText:"Now",nextMonthLabel:"NextMonthNav",previousMonthLabel:"PrevMonthNav",selectMonth:"SelectMonth",selectYear:"SelectYear",selectDate:"SelectDate",selectHour:"SelectHour",selectMinute:"SelectMinute",selectSecond:"SelectSecond",selectTimezone:"SelectTimezone",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"hh:mm:ss tt",timeSuffix:"",timeOnlyTitle:"Cho
1oseTime",timeText:"Time",hourText:"fullHour",minuteText:"fullMinute",secondText:"fullSecond",millisecText:"Millisecond",timezoneText:"TimeZone"}},g=new a.A,v=function(e,t){!function(e,t){let i=e.datepicker;Object.keys(i).forEach((function(e){if("string"==typeof i[e])i[e]=t(i[e])||i[e];else if(i[e].length){let o=[];for(let n=0;n<i[e].length;n++)o.push(t(i[e][n])||i[e][n]);i[e]=o.slice(0)}}))}(e||{},t.translateKey)},D=(0,n.Pm)((function(){let e=!0;return function(t){if(e){e=!1;let i=t.getCultureInfo()||{dateFormat:"dd/MM/yy HH:mm:ss",firstDayOfWeek:"Sunday"};v(f,t);const{monthNames:o,shortMonthNames:n,dayNames:a,shortDayNames:s}=(0,d.Mo)(t.translateKey,i.language);u={dateFormat:i.dateFormat||"dd/MM/yy",timeFormat:i.timeFormat||"HH:mm:ss",datetimeFormat:i.dateTimeFormat,type:"date",on:{},rangeMonths:0,rangeYears:"c-50:c+50",hourText:f.datepicker.hourText,showSiblingMonthsDays:!0,changeDateOnClickNewYear:!0,startOfWeek:i.firstDayOfWeek,minutesText:f.datepicker.minuteText,secondsText:f.datepicker.secondText,zoneText:f.datepicker.timezoneText,currentText:f.datepicker.currentText,nextMonthLabel:f.datepicker.nextMonthLabel,previousMonthLabel:f.datepicker.previousMonthLabel,selectMonth:f.datepicker.selectMonth,selectYear:f.datepicker.selectYear,selectHour:f.datepicker.selectHour,selectMinute:f.datepicker.selectMinute,selectSecond:f.datepicker.selectSecond,selectDate:f.datepicker.selectDate,selectTimezone:f.datepicker.selectTimezone,closeText:f.datepicker.closeText,timeText:f.datepicker.timeText,monthNames:o,shortMonthNames:n,dayNames:a,minDayNames:s,shortDayNames:s,autoCorrectDate:!0,selectingMonth:!0,selectingYear:!0,shortYearCutoff:50,stepMinutes:0,stepSeconds:0,stepHours:0,showSeconds:!1,showZones:!1,toLocalDateTime:t.toLocalDateTime}}}}));function w(e,t,i){let a;D()(i);let s=(0,o.X$)({},u,t||{});if((0,l.Ts)()&&m[s.type]()){let t="time"===s.type,r=e,l=s.onChange||n.tE,d=i.parseDateToString,c=e=>(e<10?"0":"")+e,u=null,h=function(){if(u=null,s.onChange){let i=this.value,o=new Date(i);i&&!isNaN(o)||(!t||e.value.length<4)&&a.setDate(new Date),l.call(this)}},y={time:{get:e=>new Date(`${(new Date).toDateString()} ${e.replace(/-/g,"/")}`),set:e=>d(e,"HH:mm")},date:{get(e){let t=new Date(e.replace(/-/g,"/"));return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)},set:e=>`${e.getFullYear()}-${c(e.getMonth()+1)}-${c(e.getDate())}`},datetime:{get:e=>new Date(e),set:e=>`${e.getUTCFullYear()}-${c(e.getUTCMonth()+1)}-${c(e.getUTCDate())}T${c(e.getUTCHours())}:${c(e.getUTCMinutes())}`},"datetime-local":{get(e){let t=new Date(`${e}Z`),i=t.getTimezoneOffset();return t.setMinutes(t.getMinutes()+i),t},set:e=>`${e.getFullYear()}-${c(e.getMonth()+1)}-${c(e.getDate())}T${c(e.getHours())}:${c(e.getMinutes())}`},def:{get:e=>new Date(e),set:e=>e.toISOString()}};const p=m.datetimelocal()?"datetime-local":"datetime";let f="datetime"===s.type?p:s.type||"",g=y[f]||y.def;r.addEventListener("change",h,!1),r.setAttribute("type",f),(0,o.gR)(r,"date-picker--native"),a={getDate:()=>{if(!u)return e.value?g.get(e.value||""):null;const t=u instanceof Date?u.getTime():new Date(u).getTime();return isNaN(t)?null:new Date(t)},setDate:function(t){u=t,e.value=g.set("string"==typeof t?new Date(t):t)},clear:function(){u=null,r.value=""},destroy:function(){s.onChange&&r.removeEventListener("change",h,!1)},focus:()=>{e.focus()}}}else{a=r(e,s,i.parseDateToString,c((0,d.Mo)(i.translateKey)));let t=()=>{let e=a.getContainer();g.trap(e);let t=a.getDate()||new Date,i=t.getDate(),o=t.getMonth(),n=t.getFullYear(),s=e.querySelector(`button[data-day='${i}'][data-month='${o}'][data-year='${n}']`);s&&s.focus()},o=e=>{13===(e.which||e.keyCode)&&(a.show(),t())},n=e=>{let i=e.which||e.keyCode;27===i?a.hide():9===i&&(e.preventDefault(),t())};a.attachEvent("onShowPickerEnd",(()=>{e.addEventListener("keydown",o,!1),e.addEventListener("keydown",n,!1)})),a.attachEvent("onHidePicker",(t=>{g.untrap(t),e.removeEventListener("keydown",o,!1),e.removeEventListener("keydown",n,!1)})),a.updateStartDateForMaxSelectableDays=function(e){this.setOptions({startDateForMaxSelectableDays:e})},a.changeDateFormat=function(e){let t=this.getOptions("timeFormat");this.setOptions({datetimeFormat:`${e} ${t}`,dateFormat:e})},a.changeTimeFormat=function(e){let t=this.getOptions("dateFormat");this.setOptions({datetimeFormat:`${t} ${e}`,timeFormat:e})}}return["setDate","getDate","hide","destroy","show","changeDateFormat","changeTimeFormat","clear","updateStartDateForMaxSelectableDays"].forEach((function(e){a[e]=a[e]||n.tE})),a}},30700(e,t,i){i.d(t,{A:()=>d,n:()=>l});var o=i(65706),n=i(44654),a=i(89073),s=i(92191);const r=new Set(["input","textarea","select"]),l=e=>e.hasAttribute("contenteditable")||r.has(e.tagName.toLowerCase());function d(e={}){let t=!1;const i=Object.assign({isElementDraggable:e=>!l(e)},e);var r,d=0,c=0,u=!1,m=[],h=function(e){var t,i="object"==typeof e?"elem":"id";for(t=0;t<m.length;t++)if(m[t][i]===e)return t;return-1},y=(0,a.mC)(),p=function(e){if(!t){var n,a=(0,o.W4)(e),s=document.body;r||(e=>!!e)(n=a.target)&&!i.isElementDraggable(n)||(r=m[h(this)],d=a.pageX,c=a.pageY,e.stopPropagation(),e.preventDefault(),s.addEventListener("selectstart",D,!1),s.addEventListener("mouseup",D,!1),s.addEventListener("mousemove",D,!1),y&&(s.addEventListener("touchmove",D,!1),s.addEventListener("touchend",D,!1)))}},f=function(e){let t=(0,o.W4)(e),i=t.pageX-d,n=t.pageY-c;r&&(e.preventDefault(),e.stopPropagation(),u?r.move.call(r,r.id,i,n,t.pageX,t.pageY,e):(Math.abs(i)>5||Math.abs(n)>5)&&(u=!0,r.start.call(r.elem,r.id,d,c,e),r.move.call(r,r.id,i,n,t.pageX,t.pageY,e)))},g=function(e){var t=document.body;r&&(u=!1,r.end.call(r,e),t.removeEventListener("mouseup",D,!1),t.removeEventListener("mousemove",D,!1),t.removeEventListener("touchend",D,!1),t.removeEventListener("touchmove",D,!1),t.removeEventListener("selectstart",D,!1),r=void 0)},v={mousedown:p,mousemove:f,mouseup:g,touchstart:function(e){p.call(this,e)},touchmove:f,touchend:function(e){g.call(this,e),(0,s.DX)(e.target,e)},selectstart:function(e){e.preventDefault()}},D=function(e){v[e.type].call(this,e)};return{dragEnd:g,attachEvents:function(e=(0,n.$C)(),t,i,o,a){m.push({id:e,elem:t,start:i,move:o,end:a}),t.addEventListener("mousedown",D,!1),y&&t.addEventListener("touchstart",D,!1)},detachEvents:function(e){var t=h(e),i=m[t],o=document.body;i&&(o.removeEventListener("selectstart",D,!1),i.elem.removeEventListener("mousedown",D,!1),o.removeEventListener("mouseup",D,!1),o.removeEventListener("mousemove",D,!1),y&&(i.elem.removeEventListener("touchstart",D,!1),o.removeEventListener("touchend",D,!1),o.removeEventListener("touchmove",D,!1)),m.splice(t,1)
1)},disableDrag:function(e){e.addEventListener("mousedown",(e=>e.stopPropagation())),e.addEventListener("mousemove",(e=>e.stopPropagation())),y&&(e.addEventListener("touchstart",(e=>e.stopPropagation())),e.addEventListener("touchmove",(e=>e.stopPropagation())))},toggleDisable:function(e){g(),t=e}}}},5334(e,t,i){i.d(t,{MJ:()=>u,i_:()=>h,Yq:()=>f,oy:()=>D,fb:()=>y,BG:()=>p,jw:()=>m,b5:()=>b,xt:()=>g,Bi:()=>w,yc:()=>c});var o=i(92191),n=i(79280);class a{updatePlateForm(){(0,o.L$)(this.selectElt,this.switcher.isOn()),(0,o.L$)(this.inputElt,this.switcher.isOff()),this.inputHandler()}constructor(e,t,i=!1,a){this.maxLength=0,this.switcherOptions={},this.inputHandler=()=>{(0,o.L$)(this.maxValueWarning,this.switcher.isOff()&&this.inputElt.value.length>this.maxLength)},this.container=(0,o.Kb)('<div class="regionSwitcher"> <div class="regionSwitcherContainer"> <div role="radiogroup" class="regionCheckboxContainer"> <input type="checkbox" class="regionCheckbox"/> </div> <div class="regionInputContainer"> <input aria-label="License state/province:" type="text" class="checkmateFormEditField geo-text-input otherRegionInput"/> <select aria-label="License state/province:" style="display:none" class="checkmateFormEditField geo-select otherRegionSelect"></select> </div> </div> <div style="display:none" class="warningRegionInput alert alert--error"></div> </div> ')[0],e.appendChild(this.container),this.selectElt=this.container.querySelector(".otherRegionSelect"),this.inputElt=this.container.querySelector(".otherRegionInput"),this.maxValueWarning=this.container.querySelector(".warningRegionInput"),this.switcherElt=this.container.querySelector(".regionCheckbox"),this.switcher=(0,n.Z)(this.switcherElt,t,{onChange:()=>{this.updatePlateForm()},isZenith:i}),a&&this.container.querySelector(".regionCheckboxContainer").setAttribute("aria-labelledby",a)}get options(){return this.switcherOptions}set options(e){this.switcherOptions=Object.assign(Object.assign({},this.switcherOptions),e),e.select&&(this.switcher.onLabel.set(e.select.title),this.selectElt.innerHTML="",e.select.items.forEach((e=>{this.selectElt.appendChild(new Option(e.title,e.value))}))),e.input&&(this.switcher.offLabel.set(e.input.title),this.maxLength=e.input.maxLength||0,this.maxValueWarning.textContent=e.input.warning||"",this.maxLength&&e.input.warning?this.inputElt.addEventListener("input",this.inputHandler,!1):this.inputElt.removeEventListener("input",this.inputHandler,!1))}get value(){return this.switcher.isOn()?this.selectElt.value:this.switcher.isOff()?this.inputElt.value:""}set value(e){if(this.inputElt.value="",this.selectElt.value="",this.switcherOptions.select&&e){let t=this.switcherOptions.select.items.filter((t=>t.value===e)),i=t[0];this.switcher.setValue(t.length>0),i?this.selectElt.value=i.value:this.inputElt.value=e}else this.switcher.setValue(!0);this.updatePlateForm()}}var s=i(44654),r=i(66275),l=i(1628),d=i(721);function c(e,t={}){var i={vertical:"geo-button-set",horizontal:"geo-button-set geo-button-set--horizontal",zenith:"geo-switcher zenith-switch"},n=t.type||"horizontal",a=[],r=t.name||(0,s.$C)(),l=function(e){t.onChange&&t.onChange(e)},d=function(){a.forEach((function(e){e.box.removeEventListener("change",l,!1)})),a.length=0,e.innerHTML=""};return o.jo(e,i.vertical+" "+i.horizontal),o.gR(e,`buttonSet ${i[n]}`),{addOptions:function(t){t&&t.length&&(d(),(a=t.map((function(t){let i=(0,s.$C)(),a=o.vt("input",{type:"radio",name:r,value:t.value,class:"geo-button-set__radio",id:i}),d=o.vt("label",{class:`geo-button-set__label ${"zenith"===n?"zenith-switch__label":""} switcherItem_`+t.value,htmlFor:i});return d.textContent=t.text,a.addEventListener("change",l,!1),e.appendChild(a),e.appendChild(d),{box:a,label:d}})))[0].box.checked=!0)},getValue:function(){for(var e,t=0;t<a.length;++t)if(a[t].box.checked){e=a[t].box.value;break}return e||""},setValue:function(e){for(var t=0;t<a.length;++t)if(a[t].box.checked=!1,a[t].box.value===e){a[t].box.checked=!0;break}a.length&&t===a.length&&(a[0].box.checked=!0)},isChanged:e=>e===this.getValue(),reset:function(){d()}}}class u{createListItems(e,t,i){const o=document.createDocumentFragment();let n,a;if(Array.isArray(e)&&e.length){const{text:t,value:i}=this.parseArrayListItems(e);n=i,a=t}else a=Object.keys(e),i&&a.sort(((e,t)=>e>t?1:-1));for(let i=0;i<a.length;i++)o.appendChild(new Option(t?a[i]:this.localizer.translateKey(a[i]),n?n[i]:e[a[i]]));return o}createListByGroups(e,t,i){const n=o.nB(t,"noTranslate");return t.innerHTML="",e.forEach((e=>{const a=(0,o.vt)("optgroup",{label:e.groupName}),s=this.createListItems(e.items,n,i);a.appendChild(s),t.appendChild(a)})),t}parseArrayListItems(e){return e.every(s.rT)?e.reduce(((e,t)=>(e.text.push(t.name),e.value.push(t.id),e)),{value:[],text:[]}):{text:e,value:e}}
1constructor(e){this.getSetConstructor=e=>t=>e&&""!==t?e(t):t,this.getContainer=e=>{let t=e;for(;t&&t!==document.body&&-1===t.className.indexOf("checkmateField");)t=t.parentElement;return t===document.body?e:t},this.elemStateChange=(...e)=>{this.handlers&&this.handlers.forEach((t=>{t(...e)}))},this.customGet=e=>this.getSetConstructor(this.cget)(e),this.customSet=e=>this.getSetConstructor(this.cset)(e),this.createList=(e,t,i=!0,n=!1)=>{const a=o.nB(t,"noTranslate")||n;if(e.length&&e[0].groupName)return this.createListByGroups(e,t,i);const s=this.createListItems(e,a,i);return t.innerHTML="",t.appendChild(s),t},this.elem=e.elem,this.container=e.container||this.getContainer(e.elem),this.cget=e.cget,this.cset=e.cset,this.localizer=e.localizer,this.dontChangeOption={text:e.localizer.translateKey("DoNotChange"),value:""}}setInnerState(e,t,i){return this}setEditState(){}getState(){}setState(e){return this}resize(){}lock(){}hide(){return this.container.style.display="none",this}show(){return o.WU(this.container),this}isShown(){return"none"!==this.container.style.display}toggle(e){return o.L$(this.container,e),this}change(e){return this.handlers||(this.handlers=[]),this.handlers.push(e),this}unchange(e){let t;for(t=0;t<this.handlers.length;t++)if(e===this.handlers[t]){this.handlers.splice(t,1);break}return this}}class m extends u{constructor(e){super(e);const t=e.zenithTooltipEnabled?this.elem.dataset.tooltip:this.elem.title;this.switcher=(0,n.Z)(this.elem,this.localizer.translateKey,{onChange:e=>{this.elemStateChange(e)},isZenith:e.isZenith,stretched:!!e.stretched,title:t?this.localizer.translateKey(t):void 0,zenithTooltipEnabled:e.zenithTooltipEnabled})}setEditState(e=!1){this.switcher.changeState(e),e&&(this.switcher.setValue(null),this.elemStateChange(this.switcher))}setInnerState(e){return this.setState(e),this}getState(){return this.switcher.isIndeterminate()?"":this.switcher.isOn()}setState(e){return this.switcher.setValue(e),this}change(e){return super.change(e),this}unchange(e){return super.unchange(e),this}}class h extends u{constructor(e){super(e),this.switcher=new a(this.elem,this.localizer.translateKey,e.isZenith||!1,e.labelId)}setInnerState(e){return this.switcher.options=e,this}getState(){return this.switcher.value}setState(e){return this.switcher.value=e,this}}class y extends u{constructor(e){super(e),this.nextControlId="data-nextSelectId";const t={type:"horizontal",name:(0,s.$C)(),onChange:e=>{this.elemStateChange(e)}};this.switcher=c(this.elem,t);let i=this.elem.getAttribute(this.nextControlId),o=i?document.querySelector(`#${i}`):null;if(!o)throw new Error(`Cannot find element id: '${i||"Unknown"}'`);this.switcher2=c(o,t)}setEditState(e=!1){e&&(this.optionsPart1.unshift(this.dontChangeOption),this.switcher.addOptions(this.optionsPart1),this.switcher2.addOptions(this.optionsPart2),this.switcher2.setValue(""),this.switcher.setValue(""))}setInnerState(e){return this.optionsPart1=e[0].slice(),this.optionsPart2=e[1].slice(),this.switcher.addOptions(this.optionsPart1),this.switcher2.addOptions(this.optionsPart2),this}getState(){let e=this.switcher.getValue();return this.customGet(e||this.switcher2.getValue())}setState(e){return-1!==this.optionsPart1.map((e=>e.value)).indexOf(e)?this.switcher.setValue(this.customSet(e)):this.switcher2.setValue(this.customSet(e)),this}change(e){return super.change(e),this}unchange(e){return super.unchange(e),this}}class p extends u{constructor(e){super(e),this.switcher=c(this.elem,{type:e.isZenith?"zenith":"horizontal",isZenith:e.isZenith,onChange:e=>{this.elemStateChange(e)}})}setEditState(e=!1){e&&(this.optionsArray.unshift(this.dontChangeOption),this.switcher.addOptions(this.optionsArray),this.switcher.setValue(""))}setInnerState(e){return this.optionsArray=e.slice(),this.switcher.addOptions(this.optionsArray),this}getState(){return this.customGet(this.switcher.getValue())}setState(e){return this.switcher.setValue(this.customSet(e)),this}change(e){return super.change(e),this}unchange(e){return super.unchange(e),this}}class f extends u{constructor(e){super(e),this.params=e,this.onChange=e=>{this.elemStateChange(e)},this.el=this.params.elem}setEditState(e=!1){let t,i=this.el.querySelectorAll("option[value='']"),n=i.length;e?(0===n&&(t=o.vt("option",{value:this.dontChangeOption.value}),t.textContent=this.dontChangeOption.text,this.el.insertBefore(t,this.el.firstChild)),this.el.value=""):0!==n&&(e=>{let t,i,o=e?e.length:0;for(t=0;t<o;t++)i=e[t],i.parentNode&&i.parentNode.removeChild(i)})(i)}setInnerState(e,t=!0,i=!1){return this.createList(e,this.el,t,i),this}getState(){return this.customGet(this.el.value)}setState(e){return this.el.value=this.customSet(e),this.el.setAttribute("value",e),""===e&&(this.el.selectedIndex=-1),this}change(e){return this.el.addEventListener("change",this.onChange,!1),super.change(e),this}unchange(e){return this.el.removeEventListener("change",this.onChange,!1),super.change(e),this}}class g extends u{constructor(e){super(e),this.onChange=e=>{this.elemStateChange(e)},this.el=e.elem}setInnerState(e){return this.createList(e,this.el),this}getState(){return this.customGet(this.el.value)}setState(e){return this.el.value=this.customSet(e),this}change(e){return this.el.addEventListener("change",this.onChange,!1),super.change(e),this}unchange(e){return this.el.removeEventListener("change",this.onChange,!1),super.change(e),this}}let v=(e,t,i,n,a)=>{let r,l,d,c={maxLength:512,save:()=>!1,show:s.tE,hide:s.tE},u=o.X$(c,a||{}),m=function(){o.WU(i),o.WU(n),r&&(o.jD(r),r.value=""),l&&o.jD(l),d&&o.jD(d),u.hide()},h=function(){u.save(r.value)&&m()},y=function(){m()},p=function(e){e.stopPropagation()};return function(){let i=o.yr("check","geotabButton-svgIcon big"),n=o.yr("close-cross","geotabButton-svgIcon");r=o.vt("input",{type:"text",maxLength:u.maxLength.toString(),"aria-label":e("Edit view name"),class:"checkmateFormEditField geo-text-input inlineEditor_input"});l=o.vt("button",{class:"sortableItemButton geo-button geo-button--icon--large geo-button--action help-ignore inlineEditor_saveButton",title:e("save")});d=o.vt("button",{class:"sortableItemButton geo-button geo-button--icon--large help-ignore inlineEditor_cancelButton",title:e("cancel")}),l.appendChild(i),d.appendChild(n),m(),l.addEventListener("click",h,!1),d.addEventListener("click",y,!1),r.addEventListener("mousedown",p,!1),t.appendChild(r),t.appendChild(l),t.appendChild(d)}(),{show:function(t){const a=t||i.textContent||"";r.value=a,o.jD(i),o.jD(n),o.WU(r),o.WU(l),l.ariaLabel=e("Save {VIEW_NAME}").replace("{VIEW_NAME}",a),o.WU(d),d.ariaLabel=e("Cancel editing {VIEW_NAME}").replace("{VIEW_NAME}",a),r.focus(),u.show()},hide:m,destroy:function(){l.removeEventListener("click",h,!1),d.removeEventListener("click",y,!1),r.removeEventListener("mousedown",p,!1),r.remove(),l.remove(),d.remove()}}};class D extends u{removeItem(e){this.customEventHandlers.onBeforeItemRemove(e)&&(e&&e.parentNode.removeChild(e),this.customEventHandlers.onItemRemoved())}makeDefaulItem(e){let t=e.parentNode;o.WU(this.getItemMakeDefaultButton(t.firstChild)),t.insertBefore(e,t.firstChild);let i=this.getItemMakeDefaultButton(e);o.jD(i),this.setState(this.getState()),this.getItemEditButton(this.elem.firstChild).focus()}constructor(e,t){super(e),this.translate=t,this.idToData={},this.defaultSortableStyles={selector:"LI.sortableItem",applyDraggingStyle:!0},this.customEventHandlers={onStateSet:s.tE,onItemSaved:s.tE,onBeforeItemSave:(...e)=>!0,onBeforeItemRemove:(...e)=>!0,onItemRemoved:s.tE,onEditorShow:s.tE,onEditorHide:s.tE},this.inlineEditors={},this.fakeHandler=s.tE,this.realHandler=this.elemStateChange,this.internalEventHandler=this.fakeHandler,this.listItemHtmlNew=(e,t,i="",o)=>{const n=(0,s.z)(e),a=o("Set {VIEW_NAME} as default").replace("{VIEW_NAME}",n),r=o("Edit {VIEW_NAME}").replace("{VIEW_NAME}",n),l=o("Remove {VIEW_NAME}").replace("{VIEW_NAME}",n);return`<li class='help-ignore sortableItem ${this.isZenith?"zenith-sortable-item":""}' title='${n}' data-tooltip='${n}' id='${(0,s.z)(t)}'>
1\n <span class='hoverIcon'></span>\n <span class='itemText'>\n <span class='itemText_primary'>${o(n)}</span>\n <span class='itemText_secondary'>${(0,s.z)(i)}</span>\n </span>\n <button title='${a}' aria-label='${a}' class='options_viewOrganizerList_makeDefaultButton sortableItemButton geo-button geo-button--icon--large help-ignore'>\n <svg class="svgIcon"><use xlink:href="#geo-check"></use></svg>\n </button>\n <button title='${r}' aria-label='${r}' class='options_viewOrganizerList_renameButton geo-button sortableItemButton geo-button--icon--large help-ignore'>\n <svg class="svgIcon"><use xlink:href="#geo-pencil-icon"></use></svg>\n </button>\n <button title='${l}' aria-label='${l}' class='options_viewOrganizerList_removeButton sortableItemButton geo-button geo-button--icon--large help-ignore'>\n <svg class="svgIcon"><use xlink:href="#geo-close-cross"></use></svg>\n </button>\n </li>`},this.getItems=()=>this.elem.querySelectorAll("li.sortableItem"),this.getItemText=e=>e.querySelector(".itemText_primary"),this.hideElement=e=>{e.classList.add("element-hide")},this.showElement=e=>{e.classList.remove("element-hide")},this.getItemEditButton=e=>e.querySelector("button.options_viewOrganizerList_renameButton"),this.getItemMakeDefaultButton=e=>e.querySelector("button.options_viewOrganizerList_makeDefaultButton"),this.getItemRemoveButton=e=>e.querySelector("button.options_viewOrganizerList_removeButton"),this.clickHandler=e=>{if(this.sortableItems.isSorting())return;let t=o.kp(e.target,"li.sortableItem");if(t){let i=o.kp(e.target,".options_viewOrganizerList_renameButton");i&&!i.disabled&&this.inlineEditors[t.id].show();let n=o.kp(e.target,".options_viewOrganizerList_removeButton");n&&!n.disabled&&this.removeItem(t);let a=o.kp(e.target,".options_viewOrganizerList_makeDefaultButton");a&&!a.disabled&&this.makeDefaulItem(t)}},this.isZenith=!!e.isZenith,this.zenithTooltipEnabled=!!e.zenithTooltipEnabled,this.elem.addEventListener("click",this.clickHandler,!1),this.sortableItems=(0,r.A)(this.elem,((e,t,i)=>{this.customEventHandlers.onItemSaved(),this.internalEventHandler(e,t,i)}),o.X$(this.defaultSortableStyles,e.customSortableStyles||{})),e.customEventsHandlersInitializer&&(this.customEventHandlers=o.X$(this.customEventHandlers,e.customEventsHandlersInitializer(this)))}setInnerState(e){return this.setState(e),this}getState(e){return e?this.idToData[e]:this.customGet(Array.prototype.map.call(this.elem.children,(e=>this.idToData[e.id])).filter(s.WI))}setState(e){let t=this.customSet(e).reduce(((e,t)=>{let i=(0,s.$C)(),o=e;return o+=(0,this.listItemHtmlNew)(t.name,i,t.highlightGroups.map((e=>e.name)).join(", "),this.translate),this.idToData[i]=t,o}),"");this.sortableItems.clear(),this.elem.innerHTML=t,this.sortableItems.update();let i=this.getItems();return Array.prototype.forEach.call(i,(e=>{let t=this.getItemText(e),i=this.getItemEditButton(e),n=this.getItemRemoveButton(e),a=this.getItemMakeDefaultButton(e);this.inlineEditors[e.id]=v(this.translate,e,t,i,{save:i=>{let o=i.trim(),n=t.textContent;return o===n||!!this.customEventHandlers.onBeforeItemSave(e,n,o)&&(this.idToData[e.id]&&(this.idToData[e.id].name=o),e.querySelector(".itemText_primary").textContent=o,this.customEventHandlers.onItemSaved(),!0)},show:()=>{t.parentNode&&o.jD(t.parentNode),n&&o.jD(n),a&&this.hideElement(a),this.customEventHandlers.onEditorShow(e)},hide:()=>{t.parentNode&&o.WU(t.parentNode),n&&o.WU(n),a&&this.showElement(a),this.customEventHandlers.onEditorHide(e)}})})),this.customEventHandlers.onStateSet(),this.zenithTooltipEnabled&&(0,d.wS)([{parent:this.elem,selector:"li",position:d._m.TopLeft},{parent:this.elem,selector:"button",position:d._m.TopRight}],this.translate),this}resize(){this.sortableItems.resize()}change(e){return this.internalEventHandler=this.realHandler,super.change(e),this}unchange(e){return this.internalEventHandler=this.fakeHandler,super.unchange(e),this}lock(){let e=this.getItems();Array.prototype.forEach.call(e,(e=>{let t=this.getItemEditButton(e),i=this.getItemRemoveButton(e),o=this.getItemMakeDefaultButton(e);this.inlineEditors[e.id].hide(),t.disabled=!0,i.disabled=!0,o.disabled=!0}))}}class w extends u{constructor(e){super(e),this.onChange=e=>{this.elemStateChange(e)},this.el=e.elem,this.timePicker=(0,l.A)(this.el,{type:"time",timeFormat:e.timeFormat},e.localizer)}setInnerState(e){return this.createList(e,this.el),this}getState(){let e=this.timePicker.getDate(),t=e=>e<10?`0${e}`:e.toString(),i=e?t(e.getHours()):"00",o=e?t(e.getMinutes()):"00";return this.customGet(`${i}:${o}:00`)}setState(e){return this.timePicker.setDate(e.val),this.updateTimeFormat(e.format),this}change(e){return this.el.addEventListener("change",this.onChange,!1),super.change(e),this}unchange(e){return this.el.removeEventListener("change",this.onChange,!1),super.change(e),this}updateTimeFormat(e){this.timePicker.changeTimeFormat(e)}}const b=["Edit view name","Set {VIEW_NAME} as default","Edit {VIEW_NAME}","Remove {VIEW_NAME}","Cancel editing {VIEW_NAME}","Save {VIEW_NAME}"]},66275(e,t,i){i.d(t,{A:()=>r});var o=i(92191),n=i(44654),a=i(30700);const s="sequenceNumber";function r(e,t,i){const r=Object.assign({selector:"li",emptyElement:"li",draggableSelector:void 0,draggable:!0,showOrder:!1,multiline:!1,addSortableItemStyles:!0,applyDraggingStyle:!1,canSwitch:void 0,beforeSwitch:n.tE,afterSwitch:n.tE,beforeDrag:n.tE,afterDrag:n.tE,onStart:n.tE,onEnd:n.tE},i||{}),l=(0,a.A)(r.draggableOptions);var d,c,u=function(e){var t=window.getComputedStyle(e),i=function(e){var t=parseFloat(e);return isNaN(t)?0:t};return{height:e.offsetHeight,marginHeight:i(t.marginTop)+i(t.marginBottom),width:e.offsetWidth,marginWidth:i(t.marginLeft)+i(t.marginRight),top:e.offsetTop-i(t.marginTop),left
1:e.offsetLeft-i(t.marginLeft)}},m=t||(()=>{}),h=()=>(0,o.vt)(r.emptyElement,{class:"vanillaSortablePlaceHolder"},{display:"none"}),y=h(),p=function(e,t,i){(0,o.AH)(e,{top:i+"px",left:t+"px"})},f=function(e){for(var t=0;t<A.length;t++)if(A[t].dragElem===e||A[t].elem===e)return t;return-1},g=function(e,t,i){e&&(t&&t.parentNode===e?e.insertBefore(i,t):e.appendChild(i))},v=function(t){y||(y=h()),y.parentNode===e&&(y=e.removeChild(y));let i=t?t.nextSibling:e.children[0];return g(e,i,y),y},D=e=>{let t=e.getBoundingClientRect();return{top:t.top-((null==d?void 0:d.top)||0),left:t.left-((null==d?void 0:d.left)||0)}},w=-1,b=function(){var t=e.offsetParent;t?(r.onStart(),w=f(this),c=w,d={top:t.offsetTop-t.scrollTop,left:t.offsetLeft-t.scrollLeft},A.forEach((e=>{x(e)}))):d=null},S=function(t,i,n,a,s){if(!d)return;var l,c=a-d.left,u=s-d.top;let m=A[w];if(m){y&&y.parentNode||(r.beforeDrag(w),h=y,g={position:"absolute",zIndex:5e3,top:(f=m).top+"px",left:f.left+"px",height:f.height+"px",width:f.width+"px"},(0,o.AH)(f.elem,g),(0,o.AH)(h,{display:"inline-block",height:f.height+f.marginHeight+"px",width:f.width+f.marginWidth+"px"}),v(m.elem));if((r.changePosition?r.changePosition:p)(m.elem,m.left+i,m.top+n),function(t,i){let o=d&&e.getBoundingClientRect();return o.top<i&&o.left<t&&o.top+o.height>i&&o.left+o.width>t}(a,s))for(l=0;l<A.length;l++){let e=A[l],t=e.elem,i=D(t),o=m.height<e.height?m.height:e.height,n=m.width<e.width?m.width:e.width;if((r.canSwitch&&r.canSwitch(w,l)||!r.canSwitch)&&l!==w&&i.top<u&&i.left<c&&i.top+o>u&&i.left+n>c){r.beforeSwitch(w,l),v(l<w?A[l-1]?A[l-1].elem:null:e.elem),A.splice(l,0,A.splice(w,1)[0]),w=l,r.afterSwitch(w);break}}}var h,f,g},C=function(){var t=A[w];y.parentNode&&setTimeout((function(){t.elem.parentNode&&(g(e,y,e.removeChild(t.elem)),w!==c&&m(t.elem,c,w)),r.afterDrag(w),y&&y.parentNode&&y.parentNode.removeChild(y),(0,o.AH)(t.elem,{position:"relative",zIndex:0,top:"",left:"",width:"",height:""}),w=-1,c=null,E(),r.onEnd()}),1)},T=function(e){l.detachEvents(e)},x=function(e){let t=u(e.elem);e.height=t.height,e.width=t.width,e.top=t.top,e.left=t.left},k=function(e,t){let i=r.draggableSelector?e.querySelector(r.draggableSelector):e;if(i)return r.draggable&&function(e){l.attachEvents(void 0,e,b,S,C)}(i),r.addSortableItemStyles&&(0,o.gR)(i,"sortableItem"),r.showOrder&&!e.querySelector(`.${s}`)&&R(i,t+1),Object.assign({elem:e,dragElem:i},u(e))},M=()=>Array.prototype.map.call(e.querySelectorAll(r.selector),k).filter((e=>e)),R=function(e,t){let i=(0,o.vt)("span",{class:`${s} checkmateListSequenceNumber`});i.innerText=t,e.insertBefore(i,e.children[0])},E=function(){let t=e.querySelectorAll(`.${s}`);Array.prototype.forEach.call(t,((e,t)=>e.innerText=t+1))},A=M();return(0,o.gR)(e,"vanillaSortableContainer"),r.multiline&&(0,o.gR)(e,"multiline"),r.applyDraggingStyle&&(0,o.gR)(e,"vanillaSortableDraggable"),{clear:function(t){if(w>=0&&l.dragEnd(),t){let e=f(t);e>=0&&(T(A[e].dragElem),A.splice(e,1))}else y&&y.parentNode&&(y=y.parentNode.removeChild(y)),A.forEach((function(e){T(e.dragElem)})),(0,o.jo)(e,"vanillaSortableContainer"),A.length=0},removeDragAndDrop:T,add:function(t){if(t.parentNode===e){let e=k(t,A.length);e&&A.push(e)}},update:function(){A.length=0,(0,o.gR)(e,"vanillaSortableContainer"),y&&y.parentNode&&v(null),A=M(),r.showOrder&&E()},resize:function(e){let t=f(e);t>=0?x(A[t]):A.forEach(x)},count:()=>A.length,isSorting:()=>-1!==w,disable:function(e){l.disableDrag(e)},disableAll:()=>{l.toggleDisable(!0)},enableAll:()=>{l.toggleDisable(!1)}}}},79280(e,t,i){i.d(t,{Z:()=>r});var o=i(92191),n=i(44654),a=i(721);const s="buttonDisabled";function r(e,t,i){var r,l=i||{},d=l.onChange||null,c=((e,t)=>e||{on:t("on")||"***On",off:t("off")||"***Off"})(l.labels,t),u=l.isTriStateButton||!1,m=()=>(0,o.vt)("input",{type:"radio",id:(0,n.$C)(),class:"geo-switcher__input"}),h=e=>`geo-switcher__label centeredLabelText noTranslate ${e?"onLabelSwitcher":"offLabelSwitcher"} ${l.isZenith?"zenith-switch__label":""}`,y=function(e){if(e&&"INPUT"!==e.nodeName){let t={parent:e,containerElement:e,parentClass:""},i=e.children;for(const e of i){const i=e.nodeName;if("LABEL"===i||"INPUT"===i){const o="LABEL"===i?"data-off-label":"data-off-input",n="LABEL"===i?"
1Label":"Element",a=e.getAttribute(o);a?t["true"===a?`off${n}`:`on${n}`]=e:t[t[`on${n}`]?`off${n}`:`on${n}`]=e}}return t}return{parent:e.parentNode,onElement:e,parentClass:e.getAttribute("data-parent-class")||""}}(e),p=l.narrowSwitcherButton?" narrowSwitcher":"",f=y.parent||l.parent||document.body;let g;var v,D;g=y.onElement?y.containerElement?y.onElement:(v=e,D=f.removeChild(v),(0,o.gR)(D,"geo-switcher__input"),D):m();var w=y.offElement||m(),b=c.on,S=c.off,C=y.onLabel,T=y.offLabel,x=(e=>{let t="geo-switcher "+(l.isZenith?"zenith-switch":"");return y.containerElement?((0,o.gR)(y.containerElement,t),y.containerElement):(0,o.vt)("span",{class:t+(e?` ${e}`:""),title:l.title,"data-tooltip":l.title})})(y.parentClass),k=(e,t)=>({get:()=>e.textContent,set:function(i){e.textContent=i||t}}),M=function(e){e.parentNode||x.appendChild(e)},R=function(t){var i=this===g?w:g,o=!0,n=this.checked,a=this.checked;n&&a?i.checked=!1:u||a||a||(this.checked=!0,o=!1),d&&o&&t&&d.call(e||this,r)};g.id=g.id||(0,n.$C)();let E=document.querySelector(`label[for='${g.id}']`);E&&(E.id=E.id||(0,n.$C)(),g.setAttribute("aria-describedby",E.id),w.setAttribute("aria-describedby",E.id)),C||((C=(0,o.vt)("label",{class:h(!0)+p,htmlFor:g.id})).textContent=b),T||((T=(0,o.vt)("label",{class:h(!1)+p,htmlFor:w.id})).textContent=S);let A=(0,n.$C)();if(g.setAttribute("type","radio"),g.setAttribute("name",A),w.setAttribute("name",A),l.labelledBy?(x.setAttribute("role","group"),x.setAttribute("aria-labelledby",l.labelledBy)):function(e){if(!e)return;let t=C.getAttribute("id"),i=T.getAttribute("id");t||(t=(0,n.$C)(),C.setAttribute("id",t)),i||(i=(0,n.$C)(),T.setAttribute("id",i)),g.setAttribute("aria-labelledby",`${e} ${t}`),w.setAttribute("aria-labelledby",`${e} ${i}`)}(l.labelledBy),l.ruleGroupLabel&&(x.setAttribute("role","group"),x.setAttribute("aria-label",l.ruleGroupLabel)),g.addEventListener("change",R,!1),M(g),M(C),w.addEventListener("change",R,!1),M(w),M(T),(0,o.jY)(x,"geo-switcher--stretched",!!l.stretched),l.isZenith){const e=x.querySelectorAll(".geo-switcher-label");for(let t=0,i=e.length;t<i;t++)(0,o.gR)(e[t],"zenith-switch__label")}return g.checked||(w.checked=!0),f!==x&&f.appendChild(x),(null==i?void 0:i.zenithTooltipEnabled)&&(0,a.wS)([{parent:f,selector:".geo-switcher",position:a._m.TopLeft}],t),r={container:x,setValue:function(e){"boolean"==typeof e?(e=>{let t=e?g:w;t.checked||(t.checked=!0,R.call(t,!1))})(e):u&&(w.checked=!1,g.checked=!1,R.call(g,!1))},isOn:function(){return g.checked},isOff:function(){return w.checked},isIndeterminate:function(){return!w.checked&&!g.checked},changeState:function(e){(u=e)?(g.setAttribute("type","checkbox"),w.setAttribute("type","checkbox")):(g.setAttribute("type","radio"),w.setAttribute("type","radio"))},focus:()=>{r.isDisabled()||(g.checked&&g.focus(),w.checked&&w.focus())},disable:function(){g.setAttribute("disabled","disabled"),w.setAttribute("disabled","disabled"),(0,o.gR)(C,s),(0,o.gR)(T,s)},enable:function(){g.removeAttribute("disabled"),w.removeAttribute("disabled"),(0,o.jo)(C,s),(0,o.jo)(T,s)},isDisabled:function(){return!!g.getAttribute("disabled")},destroy:function(){w.removeEventListener("change",R,!1),g.removeEventListener("change",R,!1),C.parentNode&&(C.parentNode.removeChild(C),T.parentNode.removeChild(T)),!y.offElement&&w.parentNode&&w.parentNode.removeChild(w)},onLabel:k(C,c.on),offLabel:k(T,c.off)}}},42811(e,t,i){i.d(t,{A:()=>s});var o=i(92191),n=i(44654),a=i(86397);class s extends a.FZ{getIndexByElem(e){let t=this.tabs.length;for(let i=0;i<t;++i)if(this.tabs[i]===e)return i;return 0}getNextVisibleTab(e,t){let i;for(;i!==e;)if(void 0===i&&(i=e),i+=t,i<0&&(i=this.tabs.length-1),i>=this.tabs.length&&(i=0),(0,o.zN)(this.tabs[i])&&!this.isDisabled(i))return i;return-1}isDisabled(e){return this.tabs[e]&&this.tabs[e].hasAttribute("disabled")}changeIndex(e,t){if(!this.isDisabled(e)){t||this.fire("onBeforeChange",e);let i=this.activePane;this.activate(e),t||this.fire("onAfterChange",{prev:i,current:e})}}activate(e){e!==this.activePane&&(this.panes[e]&&this.panes.forEach((function(t,i){(0,o.jY)(t,"vanilla-tabs__pane--hidden",i!==e)}
1)),this.tabs.forEach(((t,i)=>{let o=i===e;t.setAttribute("tabindex",o?"0":"-1"),t.setAttribute("aria-selected",o?"true":"false")})),this.tabs[this.activePane]&&(0,o.jo)(this.tabs[this.activePane],this.activeTabClass),(0,o.gR)(this.tabs[e],this.activeTabClass),this.tabs[e].focus(),this.activePane=e)}changeTabStyle(e,t){let i=this.tabs[e]?e:this.getIndexById(e);-1===i||this.hiddenTabs.has(i)||(this.tabs[i].style.display=t)}addTab(e,t){(0,o.gR)(e,"vanilla-tabs__tab "+(this.isZenithToolbarEnabled?"vanilla-tabs__zenith-tab":"")),e.addEventListener("click",this.clickHandler,!1),t&&(!e.id&&(e.id=(0,n.$C)()),!t.id&&(t.id=(0,n.$C)()),e.setAttribute("role","tab"),e.setAttribute("aria-controls",t.id),t.setAttribute("role","tabpanel"),t.setAttribute("aria-labelledby",e.id),(0,o.jY)(t,"vanilla-tabs__pane--hidden",!0))}removeTab(e,t){(0,o.jo)(e,"vanilla-tabs__tab "+(this.isZenithToolbarEnabled?"vanilla-tabs__zenith-tab":"")),e.removeEventListener("click",this.clickHandler,!1),t&&(e.removeAttribute("role"),e.removeAttribute("aria-controls"),t.removeAttribute("role"),t.removeAttribute("aria-labelledby"))}switchToAnotherTab(e){if(e===this.activePane){let e=this.getNextVisibleTab(this.activePane,-1);-1!==e&&this.setActive(e)}}constructor(e,t={},i){if(super(),this.container=e,this.options=t,this.isZenithToolbarEnabled=i,this.hiddenTabs=new Set,this.clickHandler=e=>{let t=this.getIndexByElem(e.currentTarget);t!==this.activePane&&this.changeIndex(t)},this.keyDownHandler=e=>{switch(e.keyCode){case 37:{let e=this.getNextVisibleTab(this.activePane,-1);e>-1&&this.changeIndex(e);break}case 36:{let t=this.getNextVisibleTab(-1,1);t>-1&&this.changeIndex(t),e.preventDefault();break}case 39:{let e=this.getNextVisibleTab(this.activePane,1);e>-1&&this.changeIndex(e);break}case 35:{let t=this.getNextVisibleTab(this.tabs.length,-1);t>-1&&this.changeIndex(t),e.preventDefault();break}}},this.activeTabClass=this.isZenithToolbarEnabled?"vanilla-tabs__zenith-tab--selected":"vanilla-tabs__tab--selected",this.tabsHeader=e.querySelector("[data-tabs-header]"),!this.tabsHeader)throw new Error("Invalid tabs markup");let n=t.panesContainer||e;this.tabs=Array.prototype.map.call(this.tabsHeader.querySelectorAll("button"),(e=>e)),this.panes=Array.prototype.filter.call(n.querySelectorAll("[data-tabs-panel]"),(e=>e.parentNode===n)),(0,o.jY)(e,"vanillaTabsContainer",!i),(0,o.gR)(this.tabsHeader,"vanilla-tabs"),this.tabsHeader.setAttribute("role","tablist"),this.tabsHeader.addEventListener("keydown",this.keyDownHandler,!1),this.panes.forEach(((e,t)=>{(0,o.gR)(e,"vanilla-tabs__pane"),e.setAttribute("data-index",t.toString())}
1)),this.tabs.forEach(((e,t)=>{this.addTab(e,this.panes[t])})),this.options.onBeforeChange&&this.attach("onBeforeChange",this.options.onBeforeChange),this.options.onAfterChange&&this.attach("onAfterChange",this.options.onAfterChange),this.activate(0)}getIdByIndex(e){if(this.tabs[e])return this.tabs[e].id}getIndexById(e){let t=this.tabs.length;for(let i=0;i<t;++i)if(this.tabs[i].id===e)return i;return-1}getIndexByNameTab(e){return this.tabs.findIndex((t=>t.getAttribute("data-tabName")===e))}getNameTabByIndex(e){var t;return null===(t=this.tabs[e])||void 0===t?void 0:t.getAttribute("data-tabName")}setActive(e,t){this.changeIndex(e,t)}getActive(){return this.activePane}hideTab(e){let t=this.tabs[e]?e:this.getIndexById(e);this.changeTabStyle(t,"none"),this.switchToAnotherTab(t)}showTab(e){this.changeTabStyle(e,"inline-block")}toggleTab(e,t){const i=this.tabs[e]?e:this.getIndexById(e);return t?(this.hiddenTabs.delete(i),this.changeTabStyle(i,"inline-block")):(this.hideTab(e),this.hiddenTabs.add(i)),-1!==i}showAll(){this.tabs.forEac
1h(((e,t)=>this.changeTabStyle(t,"inline-block")))}enable(e){let t=this.tabs[e]?e:this.getIndexById(e);-1!==t&&this.tabs[t].removeAttribute("disabled")}disable(e){let t=this.tabs[e]?e:this.getIndexById(e);-1!==t&&(this.tabs[t].setAttribute("disabled","disabled"),this.switchToAnotherTab(t))}toggleEnableTab(e,t){const i=this.tabs[e]?e:this.getIndexById(e);return t?this.enable(e):this.disable(e),-1!==i}enableAll(){this.tabs.forEach(((e,t)=>this.enable(t)))}forEachTab(e){this.tabs.forEach(e)}add(e,t){if(!this.tabsHeader)return;(this.options.panesContainer||this.container).appendChild(t),this.panes.push(t),this.tabsHeader.appendChild(e),this.tabs.push(e),this.addTab(e,t)}remove(e){let t=this.getIndexById(e);if(-1!==t){let e=this.tabs[t],i=this.panes[t];this.removeTab(e,i),this.hiddenTabs=new Set([...this.hiddenTabs].filter((e=>e!==t)).map((e=>e>t?e-1:e))),e.parentNode&&e.parentNode.removeChild(e),this.tabs=[...this.tabs.slice(0,t),...this.tabs.slice(t+1)],this.panes=[...this.panes.slice(0,t),...this.panes.slice(t+1)],i.parentNode&&i.parentNode.removeChild(i)}}
1destroy(){this.tabs.forEach((e=>{e.removeEventListener("click",this.clickHandler,!1)})),this.tabs.length=0,this.panes.length=0,this.tabsHeader&&this.tabsHeader.removeEventListener("keydown",this.keyDownHandler,!1)}}},13290(e,t,i){i.d(t,{N5:()=>m,c9:()=>h,Wl:()=>u});var o=i(72632),n=i(86244),a=i(24595),s=i(17348),r=i(39832);const l=(e,t)=>e.map(((e,i)=>Object.assign(Object.assign({},e),{name:t[i]}))),d=e=>e.slice().sort((0,o.hj)("name ASC")),c=async(e,t,i)=>{const o=e.map((({id:e})=>null!=e?e:"")),a=await(async(e,t,i)=>{const o=await(0,r.qt)(e,t,((e,t)=>new n.g((0,s.AJ)("Translate",{sentences:e,language:t}),{signal:i})));return e.map((e=>o(e)))})(o,t,i),c=l(e,a);return d(c)},u=async(e,t,i)=>{const o=e.map((({id:e})=>null!=e?e:"")),a=await new n.g(t.translateSentencesArray(o),{signal:i}),s=l(e,a);return d(s)},m=async(e,t,i)=>{const o=await new n.g(e.call(a.BSZ,{}),{signal:i});return u(o,t,i)},h=async(e,t)=>{const i=await new n.g((0,s.AJ)("GetTimeZones",{}),{signal:t});return c(i,e,t)}},64828(e,t,i){i.d(t,{tR:()=>o.t,h6:()=>h,YG:()=>p,OC:()=>r,wC:()=>o.w});var o=i(77788),n=i(13290);const a=[{id:"Etc/GMT+12",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-12:00:00"},{id:"Etc/GMT+11",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-11:00:00"},{id:"Etc/GMT+10",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-10:00:00"},{id:"Etc/GMT+7",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-07:00:00"},{id:"Etc/GMT+6",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-06:00:00"},{id:"Etc/GMT+5",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-05:00:00"},{id:"Etc/GMT+4",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-04:00:00"},{id:"Etc/GMT+3",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-03:00:00"},{id:"Etc/GMT+2",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-02:00:00"},{id:"Etc/GMT+1",isDaylightSavingTimeSupported:!1,offsetFromUtc:"-01:00:00"},{id:"Etc/GMT",isDaylightSavingTimeSupported:!1,offsetFromUtc:"00:00:00"},{id:"Etc/UTC",isDaylightSavingTimeSupported:!1,offsetFromUtc:"00:00:00"},{id:"Etc/GMT-1",isDaylightSavingTimeSupported:!1,offsetFromUtc:"01:00:00"},{id:"Etc/GMT-2",isDaylightSavingTimeSupported:!1,offsetFromUtc:"02:00:00"},{id:"Etc/GMT-3",isDaylightSavingTimeSupported:!1,offsetFromUtc:"03:00:00"},{id:"Etc/GMT-4",isDaylightSavingTimeSupported:!1,offsetFromUtc:"04:00:00"},{id:"Etc/GMT-5",isDaylightSavingTimeSupported:!1,offsetFromUtc:"05:00:00"},{id:"Etc/GMT-6",isDaylightSavingTimeSupported:!1,offsetFromUtc:"06:00:00"},{id:"Etc/GMT-7",isDaylightSavingTimeSupported:!1,offsetFromUtc:"07:00:00"},{id:"Etc/GMT-8",isDaylightSavingTimeSupported:!1,offsetFromUtc:"08:00:00"},{id:"Etc/GMT-9",isDaylightSavingTimeSupported:!1,offsetFromUtc:"09:00:00"},{id:"Etc/GMT-10",isDaylightSavingTimeSupported:!1,offsetFromUtc:"10:00:00"},{id:"Etc/GMT-11",isDaylightSavingTimeSupported:!1,offsetFromUtc:"11:00:00"},{id:"Etc/GMT-12",isDaylightSavingTimeSupported:!1,offsetFromUtc:"12:00:00"},{id:"Etc/GMT-13",isDaylightSavingTimeSupported:!1,offsetFromUtc:"13:00:00"},{id:"Etc/GMT-14",isDaylightSavingTimeSupported:!1,offsetFromUtc:"14:00:00"}
1,{id:"America/New_York",isDaylightSavingTimeSupported:!0,offsetFromUtc:"-05:00:00",regionalContinent:"NorthAmerica",regionalCurrency:"Usd",dateFormat:"MM/dd/yy hh:mm:ss tt",isMetric:!1,defaultFuelEconomyUnit:"MPGUS",defaultElectricEconomyUnit:"MPGEUS",defaultDisplayProfile:"DisplayMeasurementProfileUnitedStatesId"},{id:"Europe/Paris",isDaylightSavingTimeSupported:!0,offsetFromUtc:"01:00:00",regionalContinent:"Europe",regionalCurrency:"Eur",dateFormat:"dd/MM/yy HH:mm:ss",isMetric:!0,defaultFuelEconomyUnit:"LitersPer100Km",defaultElectricEconomyUnit:"LitersEPer100Km",defaultDisplayProfile:"DisplayMeasurementProfileEuropeId"}];class s{constructor(){this.timezones=null,this.initialized=!1,this.usedFallback=!1,this.loadingPromise=null}async fetchWithRetry(e){let t;for(let i=0;i<s.retryAttempts;i++)try{return await e()}catch(e){t=e,i<s.retryAttempts-1&&await new Promise((e=>{setTimeout(e,s.retryBaseDelayMs*2**i)}))}throw t}persistLastGood(e){try{localStorage.setItem(s.lastGoodKey,JSON.stringify(e))}catch(e){}}readLastGood(){try{const e=localStorage.getItem(s.lastGoodKey);if(!e)return null;const t=JSON.parse(e);return Array.isArray(t)&&t.length>0?t:null}catch(e){return null}}isUsingFallback(){return this.usedFallback}async load(e){return this.initialized&&this.timezones&&!this.usedFallback?this.timezones:(this.loadingPromise||(this.loadingPromise=this.fetchWithRetry(e).then((e=>(this.timezones=e,this.initialized=!0,this.usedFallback=!1,this.loadingPromise=null,this.persistLastGood(e),e))).catch((e=>{this.loadingPromise=null,console.warn("TimeZoneCache: API failed, using fallback timezone list",e);const t=this.readLastGood(),i=null!=t?t:a.map((e=>{var t;return Object.assign(Object.assign({},e),{name:null!==(t=e.id)&&void 0!==t?t:""})}));return this.timezones=i,this.initialized=!0,this.usedFallback=!0,i}))),this.loadingPromise)}async loadWithoutContext(e,t){return this.load((()=>(0,n.c9)(e,t)))}async loadWithContext(e,t,i){return this.load((()=>(0,n.N5)(e,t,i)))}initialize(e){this.timezones=e,this.initialized=!0,this.usedFallback=!1,this.loadingPromise=null}getTimezones(){return this.initialized?this.timezones||[]:(console.warn("TimeZoneCache: Attempting to access timezones before initialization"),[])}getTimezoneById(e){if(this.initialized)return this.getTimezones().find((t=>{var i;return(null===(i=t.id)||void 0===i?void 0:i.toLowerCase())===e.toLowerCase()}));console.warn("TimeZoneCache: Attempting to access timezones before initialization")}isInitialized(){return this.initialized}clear(){this.timezones=null,this.initialized=!1,this.usedFallback=!1,this.loadingPromise=null}}s.lastGoodKey="geotab.timeZones.lastGood.v1",s.retryAttempts=3,s.retryBaseDelayMs=200;const r=new s;var l=i(95478);if(/^(8317|936)$/.test(i.j))var d=i(32716);const c=["America/Phoenix","America/Los_Angeles","America/Indiana/Knox","America/Indianapolis","America/Indiana/Indianapolis","America/Menominee","America/New_York","America/Boise","America/Sitka","America/Indiana/Marengo","America/North_Dakota/New_Salem","America/St_Vincent","America/Chicago","America/Indiana/Winamac","America/North_Dakota/Beulah","America/North_Dakota/Center","America/Detroit","America/Anchorage","America/Indiana/Tell_City","America/Louisville","America/Indiana/Vevay","America/Indiana/Vincennes","America/Shiprock","America/Kentucky/Monticello","America/Denver","America/Indiana/Petersburg","America/Yakutat","America/Juneau","Pacific/Honolulu","America/Nome"],u=["Europe/Dublin","Europe/Lisbon","Europe/Berlin","Europe/Vienna","Europe/Busingen","Europe/Rome","Europe/Luxembourg","Europe/Malta","Europe/Amsterdam","Europe/Stockholm","Europe/Budapest","Europe/Prague","Europe/Bratislava","Europe/Ljubljana","Europe/Paris","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Warsaw","Europe/Zagreb","Europe/Bucharest","Europe/Athens","Europe/Mariehamn","Europe/Sofia","Europe/Tallinn","Europe/Helsinki","Europe/Vilnius","Europe/Riga","Atlantic/Azores","Atlantic/Canary","Atlantic/Madeira","Europe/London","Europe/Guernsey","Europe/Isle_of_Man","Europe/Jersey","Europe/Andorra","Europe/Zurich","Europe/Gibraltar","Europe/Vaduz","Europe/Monaco","Europe/Oslo","Europe/San_Marino","Europe/Vatican","Europe/Tirane","Europe/Podgorica","Europe/Belgrade","Europe/Sarajevo","Europe/Skopje","Europe/Chisinau","Europe/Kiev","Europe/Simferopol","Europe/Uzhgorod","Europe/Zaporozhye","Europe/Istanbul","Europe/Kaliningrad","Europe/Minsk","Europe/Moscow","Europe/Samara","Europe/Volgograd","Atlantic/Reykjavik"],m={[l.c.USA]:c,[l.c.USGov]:c,[l.c.Canada]:["America/Atikokan","America/Blanc-Sablon","America/Cambridge_Bay","America/Creston","America/Dawson","America/Dawson_Creek","America/Edmonton","America/Fort_Nelson","America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Inuvik","America/Iqaluit","America/Moncton","America/Montreal","America/Nipigon","America/Pangnirtung","America/Rainy_River","America/Rankin_Inlet","America/Regina","America/Resolute","America/St_Johns","America/Swift_Current","America/Thunder_Bay","America/Toronto","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yellowknife"],[l.c.Europe]:u,[l.c.Australia]:["Australia/Perth","Australia/Adelaide","Australia/Broken_Hill","Australia/Darwin","Australia/Brisbane","Australia/Lindeman","Australia/Sydney","Australia/Melbourne","Australia/Hobart","Australia/Currie"],[l.c.Brazil]:["America/Araguaina","America/Bahia","America/Belem","America/Boa_Vista","America/Campo_Grande","America/Cuiaba","America/Eirunepe","America/Fortaleza","America/Maceio","America/Manaus","America/Noronha","America/Porto_Velho","America/Recife","America/Rio_Branco","America/Santarem","America/Sao_Paulo"],[l.c.Asia]:["Asia/Calcutta","Asia/Colombo","Asia/Katmandu","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Dhaka","Asia/Thimphu","Asia/Yekaterinburg","Asia/Rangoon","Asia/Bangkok","Asia/Jakarta","Asia/Pontianak","Asia/Phnom_Penh","Asia/Vientiane","Asia/Hovd","Asia/Saigon","Asia/Novosibirsk","Asia/Novokuznetsk","Asia/Omsk","Asia/Shanghai","Asia/Chongqing","Asia/Harbin","Asia/Kashgar","Asia/Urumqi","Asia/Hong_Kong","Asia/Macau","Asia/Krasnoyarsk","Asia/Singapore","Asia/Brunei","Asia/Makassar","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Manila","Asia/Taipei","Asia/Ulaanbaatar","Asia/Choibalsan","Asia/Irkutsk","Asia/Tokyo","Asia/Jayapura","Asia/Dili","Asia/Seoul","Asia/Pyongyang","Asia/Yakutsk","Asia/Khandyga","Asia/Vladivostok","Asia/Sakhalin","Asia/Ust-Nera","Asia/Magadan","Asia/Anadyr","Asia/Kamchatka","Asia/Beirut","Asia/Gaza","Asia/Hebron","Asia/Damascus","Asia/Nicosia","Asia/Jerusalem","Asia/Amman","Asia/Baghdad","Asia/Riyadh","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Aden","Asia/Tehran","Asia/Dubai","Asia/Muscat","Asia/Baku","Asia/Tbilisi","Asia/Yerevan","Asia/Kabul","Asia/Karachi","Asia/Tashkent","Asia/Oral","Asia/Aqtau","Asia/Aqtobe","Asia/Dushanbe","Asia/Ashgabat","Asia/Samarkand","Indian/Maldives","Indian/Cocos"]};function h(e,t){return(m[t]||[]).indexOf(e)>-1}const y=e=>{let t=new Map(e.map((e=>{var t;return[(null===(t=e.id)||void 0===t?void 0:t.toLowerCase())||"",e]})));return[()=>{try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;return e?[e]:[]}catch(e){return[]}},()=>{let t=(new Date).getTimezoneOffset(),i=e=>(1===e.toString().length?"0":"")+e,o=Math.floor(Math.abs(t)/60),n=Math.floor(Math.abs(t)-60*o),a=`${s=t,s>=0?"-":""}${i(o)}:${i(n)}:00`;var s;return e.filter((e=>e.offsetFromUtc===a)).map((e=>e.id||""))},()=>["America/Toronto"]].reduce(((e,i)=>e.length>0?e:i().map((e=>t.get(e.toLowerCase()))).filter((e=>void 0!==e))),[])},p=async e=>{var t;let i=y(e);if(0===i.length)return"America/Toronto";if(1===i.length)return i[0].id||"America/Toronto";let o=i.reduce(((e,t)=>
1{let i=t.regionalContinent;return i&&"Unknown"!==i&&(e[i]=[...e[i]||[],t]),e}),{}),n=Object.keys(o);if(0===n.length)return(null===(t=i[0])||void 0===t?void 0:t.id)||"America/Toronto";if(1===n.length)return o[n[0]][0].id||"America/Toronto";const a=await((e,t)=>navigator.geolocation?new Promise((i=>{navigator.geolocation.getCurrentPosition((o=>{let n=(0,d.M)(o.coords.latitude,o.coords.longitude)||"",a=e[n];i(a?a[0]:t)}),(()=>{i(t)}),{timeout:1e4,enableHighAccuracy:!1,maximumAge:1e6})})):Promise.resolve(t))(o,i[0]);return(null==a?void 0:a.id)||"America/Toronto"}},77788(e,t,i){i.d(t,{t:()=>c,w:()=>u});var o=i(49793),n=i(50405),a=i(43643),s=i(24595),r=i(38707),l=i(13290);const d=(0,n.createContext)(void 0);function c({children:e}){const t=function(){const{localizer:e}=(0,r.Sz)(),{data:t,isLoading:i,error:o}=(0,a.iZ)(Object.assign(Object.assign({},s.BSZ),{readonly:!0})),[d,c]=(0,n.useState)(void 0),[u,m]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{const i=new AbortController;return(async()=>{t?(m(!0),c(await(0,l.Wl)(t,e,i.signal)),m(!1)):c(void 0)})(),()=>{i.abort()}}),[t,e]),{timeZonesMap:(0,n.useMemo)((()=>{var e;return null!==(e=null==d?void 0:d.reduce(((e,t)=>(t.id&&(e[t.id]=t),e)),{}))&&void 0!==e?e:{}}),[d]),timeZones:d,isLoading:i||u,error:o instanceof Error?o:null}}();return(0,o.jsx)(d.Provider,{value:t,children:e})}function u(){const e=(0,n.useContext)(d);if(void 0===e)throw new Error("useTimeZoneInfoContext must be used within a TimeZoneInfoProvider");return e}},32716(e,t,i){if(i.d(t,{M:()=>n}),/^(8317|936)$/.test(i.j))var o=i(935);function n(e,t){return o.b.filter((({isContinent:i,coords:o})=>i&&e>=o.y+o.height&&e<=o.y&&t>=o.x&&t<=o.x+o.width)).map((e=>e.name))[0]}},35271(e,t,i){i.d(t,{l:()=>s});var o=i(96732),n=i(32449),a=i(78300);const s=(e,t)=>e(a.u.CONTEXTUAL_SEARCH_ON_MAP_AND_TRIPS_PAGES)&&(0,o.jI)(t,n.O5.CONTEXTUAL_SEARCH)}}]);
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.