@trakit/objects 0.0.1 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API/Base.d.ts +3 -2
- package/API/BaseComponent.d.ts +9 -6
- package/API/Codifier.d.ts +11 -1
- package/API/Encoding.d.ts +9 -0
- package/API/Files.d.ts +4 -4
- package/API/Functions.d.ts +26 -21
- package/API/Geography/Functions.d.ts +4 -0
- package/API/Geography/Interfaces.d.ts +19 -14
- package/API/Geography/LatLng.d.ts +9 -1
- package/API/Geography/LatLngBounds.d.ts +2 -1
- package/API/Geography/Position.d.ts +23 -11
- package/API/Geography/StreetAddress.d.ts +3 -2
- package/API/Geometry/Functions.d.ts +1 -1
- package/API/Geometry/Point.d.ts +4 -3
- package/API/Geometry/Radial.d.ts +5 -4
- package/API/Geometry/Rectangle.d.ts +3 -7
- package/API/Geometry/Size.d.ts +8 -2
- package/API/Interfaces/IAuditable.d.ts +31 -0
- package/API/Interfaces/IDeserializable.d.ts +2 -1
- package/API/Interfaces/ILabelled.d.ts +2 -1
- package/API/Interfaces/IRequestable.d.ts +5 -1
- package/API/Objects.d.ts +0 -28
- package/API/SearchPattern.d.ts +3 -2
- package/API/TimeSpan.d.ts +7 -38
- package/API/Timezone.d.ts +3 -3
- package/API/Types.d.ts +18 -0
- package/Accounts/Contact.d.ts +10 -10
- package/Accounts/Machine.d.ts +14 -6
- package/Accounts/Permissions/Permission.d.ts +3 -3
- package/Accounts/Permissions/PermissionEscalation.d.ts +11 -3
- package/Accounts/Permissions/PermissionEscalationState.d.ts +5 -3
- package/Accounts/Session.d.ts +2 -2
- package/Accounts/User.d.ts +10 -10
- package/Accounts/UserAdvanced.d.ts +2 -2
- package/Accounts/UserGeneral.d.ts +5 -5
- package/Accounts/UserGroup.d.ts +3 -3
- package/Accounts/UserNotifications.d.ts +2 -2
- package/Assets/Asset.d.ts +56 -24
- package/Assets/AssetAdvanced.d.ts +8 -20
- package/Assets/AssetAttribute.d.ts +2 -2
- package/Assets/AssetDispatch.d.ts +5 -12
- package/Assets/AssetGeneral.d.ts +44 -24
- package/Assets/AssetPlaceStatus.d.ts +2 -2
- package/Behaviours/Behaviour.d.ts +4 -4
- package/Behaviours/BehaviourLog.d.ts +3 -3
- package/Behaviours/BehaviourParameter.d.ts +2 -1
- package/Behaviours/BehaviourScript.d.ts +4 -4
- package/Billing/BillableBase.d.ts +3 -3
- package/Billing/BillableSmsProfile.d.ts +2 -2
- package/Billing/BillingProfile.d.ts +3 -3
- package/Billing/Hosting/BillableHostingBase.d.ts +2 -2
- package/Billing/Hosting/BillableHostingDiscount.d.ts +2 -1
- package/Billing/Hosting/BillableHostingLicense.d.ts +2 -1
- package/Billing/Hosting/BillableHostingRule.d.ts +2 -1
- package/Billing/Report/BillingReport.d.ts +3 -3
- package/Billing/Report/BillingReportBreakdown.d.ts +2 -2
- package/Billing/Report/BillingReportHostingSummary.d.ts +2 -2
- package/Billing/Report/BillingReportLicenseBreakdown.d.ts +2 -2
- package/Billing/Report/BillingReportServiceBreakdown.d.ts +2 -2
- package/Billing/Report/BillingReportSummary.d.ts +2 -2
- package/Companies/ColourStyle.d.ts +2 -2
- package/Companies/Company.d.ts +48 -33
- package/Companies/CompanyDirectory.d.ts +10 -5
- package/Companies/CompanyGeneral.d.ts +10 -5
- package/Companies/{CompanyPolicies.d.ts → CompanyPolicy.d.ts} +9 -4
- package/Companies/CompanyReseller.d.ts +14 -9
- package/Companies/{CompanyStyles.d.ts → CompanyStyle.d.ts} +11 -6
- package/Companies/LabelStyle.d.ts +2 -2
- package/Companies/NotificationServerEmail.d.ts +2 -2
- package/Companies/NotificationServerSms.d.ts +3 -3
- package/Companies/PasswordPolicy.d.ts +2 -2
- package/Companies/SessionPolicy.d.ts +2 -2
- package/Dispatch/DispatchDirection.d.ts +3 -3
- package/Dispatch/DispatchJob.d.ts +4 -4
- package/Dispatch/DispatchStep.d.ts +4 -4
- package/Dispatch/DispatchStepState.d.ts +3 -3
- package/Dispatch/DispatchTask.d.ts +5 -5
- package/Hosting/Document.d.ts +3 -3
- package/Hosting/Fields/FormFieldAttachments.d.ts +4 -11
- package/Hosting/Fields/FormFieldBase.d.ts +8 -23
- package/Hosting/Fields/FormFieldBase_fromJSON.d.ts +1 -0
- package/Hosting/Fields/FormFieldBoolean.d.ts +4 -12
- package/Hosting/Fields/FormFieldChoice.d.ts +10 -12
- package/Hosting/Fields/FormFieldDate.d.ts +2 -9
- package/Hosting/Fields/FormFieldNumeric.d.ts +2 -9
- package/Hosting/Fields/FormFieldSignature.d.ts +2 -2
- package/Hosting/Fields/FormFieldText.d.ts +2 -9
- package/Hosting/Fields/FormFieldTime.d.ts +12 -9
- package/Hosting/Fields/FormFieldTimezone.d.ts +2 -2
- package/Hosting/FormResult.d.ts +4 -4
- package/Hosting/FormTemplate.d.ts +3 -3
- package/Images/Dashcam.d.ts +3 -3
- package/Images/DashcamBase.d.ts +2 -2
- package/Images/DashcamLive.d.ts +3 -3
- package/Images/Icon.d.ts +7 -27
- package/Images/IconGlyph.d.ts +5 -12
- package/Images/IconLabel.d.ts +5 -8
- package/Images/Picture.d.ts +3 -3
- package/Maintenance/MaintenanceInterval.d.ts +2 -2
- package/Maintenance/MaintenanceJob.d.ts +3 -3
- package/Maintenance/MaintenanceSchedule.d.ts +4 -4
- package/Messaging/AssetAlert.d.ts +2 -1
- package/Messaging/AssetMessage.d.ts +2 -2
- package/Messaging/MessageBase.d.ts +3 -3
- package/Places/Place.d.ts +4 -4
- package/Providers/Config/ProviderConfig.d.ts +4 -4
- package/Providers/Config/ProviderRegistration.d.ts +2 -2
- package/Providers/Config/ProviderScript.d.ts +4 -4
- package/Providers/Config/ProviderScriptBlock.d.ts +2 -1
- package/Providers/Config/ProviderScriptParameter.d.ts +2 -2
- package/Providers/Configuration/ProviderConfiguration.d.ts +4 -4
- package/Providers/Configuration/ProviderConfigurationNode.d.ts +4 -3
- package/Providers/Configuration/ProviderConfigurationType.d.ts +4 -4
- package/Providers/Configuration/ProviderGeofenceBase.d.ts +6 -8
- package/Providers/Configuration/ProviderGeofenceBase_fromJSON.d.ts +1 -0
- package/Providers/Provider.d.ts +80 -14
- package/Providers/ProviderAdvanced.d.ts +4 -4
- package/Providers/ProviderCommand.d.ts +2 -2
- package/Providers/ProviderControl.d.ts +3 -3
- package/Providers/ProviderData.d.ts +2 -2
- package/Providers/ProviderGeneral.d.ts +18 -10
- package/Reports/ReportBreakdown.d.ts +9 -32
- package/Reports/ReportBreakdownJob.d.ts +6 -31
- package/Reports/ReportBreakdownMessage.d.ts +7 -32
- package/Reports/ReportBreakdownTask.d.ts +6 -31
- package/Reports/ReportBreakdown_fromJSON.d.ts +1 -0
- package/Reports/ReportNotifications.d.ts +3 -3
- package/Reports/ReportOptions.d.ts +3 -2
- package/Reports/ReportParameter.d.ts +2 -1
- package/Reports/ReportRecurrence.d.ts +2 -2
- package/Reports/ReportResult.d.ts +9 -9
- package/Reports/ReportSchedule.d.ts +3 -3
- package/Reports/ReportScorecard.d.ts +3 -3
- package/Reports/ReportScorecardParameter.d.ts +2 -2
- package/Reports/ReportScorecardRules.d.ts +2 -2
- package/Reports/ReportSummary.d.ts +5 -33
- package/Reports/ReportTemplate.d.ts +3 -3
- package/Reports/ReportTotal.d.ts +2 -2
- package/index.d.ts +406 -0
- package/package.json +31 -22
- package/{Storage.d.ts → storage.d.ts} +11 -1
- package/trakit-objects.min.js +8 -0
- package/API/Component.d.ts +0 -42
- package/API/Compound.d.ts +0 -19
- package/Assets/Person.d.ts +0 -25
- package/Assets/PersonGeneral.d.ts +0 -35
- package/Assets/Trailer.d.ts +0 -42
- package/Assets/TrailerGeneral.d.ts +0 -47
- package/Assets/Vehicle.d.ts +0 -73
- package/Assets/VehicleAdvanced.d.ts +0 -25
- package/Assets/VehicleGeneral.d.ts +0 -33
- package/README.md +0 -13
- package/Reports/ReportDataTotal.d.ts +0 -50
- package/objects.d.ts +0 -534
- package/objects.min.js +0 -7
package/objects.min.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
function t(t){const e=[];for(let s=0,i=t.length;s<i;s++)e.indexOf(t[s])<0&&e.push(t[s]);return e}function e(t,e){const s=[];for(let i=0,n=t.length;i<n;i++){let n=!1;for(let s=0,r=e.length;s<r&&(n=t[i]===e[s],!n);s++);n||s.push(t[i])}return s}function s(t){return t.id}function i(t){return t.toJSON()}function n(t,e){return this[e]}class r{constructor(t){t&&this.fromJSON(t)}}class a extends r{#t=-1;get v(){return[this.#t]}updateVersion(t){if(t instanceof Array)return this.updateVersion(t[0]);{const e=t+1||0,s=this.#t+1||0,i=!s||e>s;return i&&(this.#t=e-1),i}}updateVersions(t=[]){return t?.map((t=>this.updateVersion(t)))}}const o=parseInt,h=parseFloat,d=Object,l=d.keys,c=d.freeze,u=Math,m=u.PI,p=u.abs,g=u.asin,f=u.atan,y=u.atan2,N=u.cos,v=u.log,w=u.max,S=u.min,I=u.pow,b=u.round,O=u.sin,k=u.sqrt,x=u.tan,J=180/m,T=m/180,C=globalThis.location;function U(...t){const e={};for(let s=0;s<t.length;s++){const i=t[s],n=l(i);for(let t=0;t<n.length;t++){const t=n[s];t in e||(e[t]=M(i[t]))}}return e}function M(t){if(t instanceof Array)return t.map(M);if(t instanceof Date)return new Date(t);if(t instanceof Map){const e=new Map;return t.forEach(((t,s)=>e.set(s,M(t)))),e}if(t instanceof Set){const e=new Set;return t.forEach((t=>e.add(M(t)))),e}return t instanceof RegExp?new RegExp(t.source,(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")):t&&"object"==typeof t?U({},t):t}function D(t){return null==t}function E(t){return"number"==typeof t||t instanceof Number}function P(t){return"string"==typeof t||t instanceof String}function A(t){return E(t)&&!isNaN(t)&&isFinite(t)}function R(t,e){let s=I(10,e||0);return b(t*s)/s}function z(t,e){return k(p(t*t)+p(e*e))}function L(t){return o(t,10)}function _(t){return new Date(t instanceof Date?t.valueOf():E(t)?t:Date.parse(String(t)))}function B(t,e,s){const i=new Array(t.length);let n=[0,t.length-1];for(;n.length>0;){const r=n.shift(),a=n.shift();if(i[r]=i[a]=!0,a-r>1){let i=-1,o=0;const h=t[r],d=t[a];for(let s=r+1;s<a;s++){const n=e(h,t[s],d);if(!A(n))throw new RangeError("triangleHeight returned NaN");n>o&&(o=n,i=s)}i>-1&&o>=s&&(n.push(r,i),n.push(i,a))}}return i}const V=o("33",36);const j=1e10;function K(t){let e=L(t);if(e){const t=e>j;t&&(e-=j),(e<=2e9||e>=999e7)&&(e=NaN),t&&e&&(e+=j)}return e||NaN}function H(t,e,s=0,i=10){const n=t.toString(i).split(".");return s&&1===n.length&&n.push("0"),n[0].length<e&&(n[0]="0".repeat(e-n[0].length)+n[0]),n[1]&&n[1].length<s&&(n[1]+="0".repeat(s-n[1].length)),n.join(".")}function G(t,e=!0){return q(t,((t,s)=>[t,e?M(s):s]))}function q(t,e){const s={};for(let[i,n]of t.entries()){const[t,r]=e(i,n);s[t]=r}return s}function F(t){return q(t,((t,e)=>[t,e.toJSON()]))}function W(t,e){const s=l(t),i=new Map;for(let n=0;n<s.length;n++){const[r,a]=e(s[n],t[s[n]]);i.set(r,a)}return i}function Y(t,e=!1){return W(t,((t,s)=>[t,e?M(s):s]))}function $(t,e=!1){return W(t,((t,s)=>[nt(t),e?M(s):s]))}function Z(t){return A(t.valueOf())?t.toISOString():null}function Q(t){return A(t)?t:null}const X=[!1,!1,!1,!1,!1,!1,!1];function tt(t){const e=[...X];for(let s=0;s<e.length;s++){const i=t[s];e[s]="boolean"==typeof i?i:1===L(i)}return e}function et(t){let e="";for(let s=0;s<7;s++)e+=t[s]?"1":"0";return e}const st={ⱥ:"a",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ā:"a",ă:"a",ą:"a",ǎ:"a",ǟ:"a",ǡ:"a",ǻ:"a",ȁ:"a",ȃ:"a",ȧ:"a",ɐ:"a",a:"a",ḁ:"a",ẚ:"a",ạ:"a",ả:"a",ấ:"a",ầ:"a",ẩ:"a",ẫ:"a",ậ:"a",ắ:"a",ằ:"a",ẳ:"a",ẵ:"a",ặ:"a","ⓐ":"a",ꜳ:"aa",æ:"ae",ǣ:"ae",ǽ:"ae",ꜵ:"ao",ꜷ:"au",ꜹ:"av",ꜻ:"av",ꜽ:"ay",ƀ:"b",ƃ:"b",ɓ:"b",b:"b",ḃ:"b",ḅ:"b",ḇ:"b","ⓑ":"b",ç:"c",ć:"c",ĉ:"c",ċ:"c",č:"c",ƈ:"c",ꜿ:"c",ȼ:"c",c:"c",ḉ:"c",ↄ:"c","ⓒ":"c",ď:"d",đ:"d",ƌ:"d",ꝺ:"d",ɖ:"d",ɗ:"d",d:"d",ḋ:"d",ḍ:"d",ḏ:"d",ḑ:"d",ḓ:"d","ⓓ":"d",ð:"d",dž:"dz",dz:"dz",è:"e",é:"e",ê:"e",ë:"e",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",ǝ:"e",ȅ:"e",ȇ:"e",ȩ:"e",ɇ:"e",ɛ:"e",e:"e",ḕ:"e",ḗ:"e",ḙ:"e",ḛ:"e",ḝ:"e",ẹ:"e",ẻ:"e",ẽ:"e",ế:"e",ề:"e",ể:"e",ễ:"e",ệ:"e","ⓔ":"e",ƒ:"f",ꝼ:"f",f:"f",ḟ:"f","ⓕ":"f",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",ꝿ:"g",ꞡ:"g",ǥ:"g",ǧ:"g",ǵ:"g",ɠ:"g",g:"g",ᵹ:"g",ḡ:"g","ⓖ":"g",ⱨ:"h",ⱶ:"h",ĥ:"h",ħ:"h",ȟ:"h",ɥ:"h",h:"h",ḣ:"h",ḥ:"h",ḧ:"h",ḩ:"h",ḫ:"h",ẖ:"h","ⓗ":"h",ƕ:"hv",ì:"i",í:"i",î:"i",ï:"i",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",ǐ:"i",ȉ:"i",ȋ:"i",ɨ:"i",i:"i",ḭ:"i",ḯ:"i","̇":"i",ỉ:"i",ị:"i","ⓘ":"i",i:"i",ij:"ij",ĵ:"j",ǰ:"j",ɉ:"j",j:"j","ⓙ":"j",ⱪ:"k",ķ:"k",ƙ:"k",ꝁ:"k",ꝃ:"k",ꝅ:"k",ꞣ:"k",ǩ:"k",k:"k",ḱ:"k",ḳ:"k",ḵ:"k","ⓚ":"k",ĸ:"k",ⱡ:"l",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",ſ:"l",ƚ:"l",ꝇ:"l",ꝉ:"l",ꞁ:"l",ɫ:"l",l:"l",ḷ:"l",ḹ:"l",ḻ:"l",ḽ:"l","ⓛ":"l",lj:"lj",ɯ:"m",ɱ:"m",m:"m",ḿ:"m",ṁ:"m",ṃ:"m","ⓜ":"m",ñ:"n",ń:"n",ņ:"n",ň:"n",ʼn:"n",ƞ:"n",ꞑ:"n",ꞥ:"n",ǹ:"n",ɲ:"n",n:"n",ṅ:"n",ṇ:"n",ṉ:"n",ṋ:"n","ⓝ":"n",ŋ:"n",nj:"nj",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ō:"o",ŏ:"o",ő:"o",ơ:"o",ꝋ:"o",ꝍ:"o",ǒ:"o",ǫ:"o",ǭ:"o",ǿ:"o",ȍ:"o",ȏ:"o",ȫ:"o",ȭ:"o",ȯ:"o",ȱ:"o",ɔ:"o",ɵ:"o",o:"o",ṍ:"o",ṏ:"o",ṑ:"o",ṓ:"o",ọ:"o",ỏ:"o",ố:"o",ồ:"o",ổ:"o",ỗ:"o",ộ:"o",ớ:"o",ờ:"o",ở:"o",ỡ:"o",ợ:"o","ⓞ":"o","":"oe","":"oe",œ:"oe",ƣ:"oi",ꝏ:"oo",ȣ:"ou",ƥ:"p",ꝑ:"p",ꝓ:"p",ꝕ:"p",p:"p",ᵽ:"p",ṕ:"p",ṗ:"p","ⓟ":"p",ꝗ:"q",ꝙ:"q",ɋ:"q",q:"q","ⓠ":"q",ŕ:"r",ŗ:"r",ř:"r",ꝛ:"r",ꞃ:"r",ꞧ:"r",ȑ:"r",ȓ:"r",ɍ:"r",ɽ:"r",r:"r",ṙ:"r",ṛ:"r",ṝ:"r",ṟ:"r","ⓡ":"r",ß:"s",ś:"s",ŝ:"s",ş:"s",š:"s",ꞅ:"s",ꞩ:"s",ș:"s",ȿ:"s",s:"s",ṡ:"s",ṣ:"s",ṥ:"s",ṧ:"s",ṩ:"s",ẛ:"s","ⓢ":"s",ⱦ:"t",ţ:"t",ť:"t",ŧ:"t",ꞇ:"t",ƭ:"t",ț:"t",ʈ:"t",t:"t",ṫ:"t",ṭ:"t",ṯ:"t",ṱ:"t",ẗ:"t","ⓣ":"t",þ:"th",ꜩ:"tz",ù:"u",ú:"u",û:"u",ü:"u",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",ư:"u",ǔ:"u",ǖ:"u",ǘ:"u",ǚ:"u",ǜ:"u",ȕ:"u",ȗ:"u",ʉ:"u",u:"u",ṳ:"u",ṵ:"u",ṷ:"u",ṹ:"u",ṻ:"u",ụ:"u",ủ:"u",ứ:"u",ừ:"u",ử:"u",ữ:"u",ự:"u","ⓤ":"u",ꝟ:"v",ʋ:"v",ʌ:"v",v:"v",ṽ:"v",ṿ:"v","ⓥ":"v",ꝡ:"vy",ⱳ:"w",ŵ:"w",w:"w",ẁ:"w",ẃ:"w",ẅ:"w",ẇ:"w",ẉ:"w",ẘ:"w","ⓦ":"w",x:"x",ẋ:"x",ẍ:"x","ⓧ":"x",ý:"y",ÿ:"y",ŷ:"y",ƴ:"y",ȳ:"y",ɏ:"y",y:"y",ẏ:"y",ẙ:"y",ỳ:"y",ỵ:"y",ỷ:"y",ỹ:"y",ỿ:"y","ⓨ":"y",ⱬ:"z",ź:"z",ż:"z",ž:"z",ꝣ:"z",ƶ:"z",ȥ:"z",ɀ:"z",z:"z",ẑ:"z",ẓ:"z",ẕ:"z","ⓩ":"z"},it=['"',"'","^","`","«","´","»","ʺ","˝","ˮ","˶","ײ","״","᳓","“","”","‟","″","‶","〃","""];function nt(t){if(!P(t))throw new TypeError("input value is not a string");for(var e=!0,s="",i=0,n=(t=t.toLowerCase()).length;i<n;i++){var r=t[i],a=st[r],o=(a||r).charCodeAt(0),h=!a&&it.indexOf(r)>-1,d=!h&&(o>=97&&o<=122||o>=48&&o<=57);d?s+=a||r:h||e||(s+="-"),h||(e=!d)}return e?s.slice(0,-1):s}function rt(t,e){const s=[];for(let[i,n]of t.entries())e.includes(i)&&s.push(n);return s}function at(t,e){const s=[];for(let i of t.values())i.companyId===e&&s.push(i);return s}const ot=new Map,ht=new Map,dt=new Map,lt=new Map,ct=new Map,ut=new Map,mt=new Map,pt=new Map,gt=new Map,ft=new Map,yt=new Map,Nt=new Map,vt=new Map,wt=new Map,St=new Map,It=new Map,bt=new Map,Ot=new Map,kt=new Map,xt=new Map,Jt=new Map,Tt=new Map,Ct=new Map,Ut=new Map,Mt=new Map,Dt=new Map,Et=new Map,Pt=new Map,At=new Map,Rt=new Map,zt=new Map,Lt=new Map,_t=new Map,Bt="Email",Vt="Mobile",jt="Office",Kt="Fax",Ht="Address",Gt="Website";class qt{static fromJSON(t){return new qt(t.code,t.name,t.offset,t.dst)}static utc=new qt("utc","UTC",0,!1);code;name;offset;dst;constructor(t,e,s,i){this.code=t,this.name=e,this.offset=s,this.dst=i}toJSON(){return{code:this.code,name:this.name,offset:this.offset,dst:this.dst}}getKey(){return this.code}}const Ft=[new qt("dateline-standard-time","International Date Line West (UTC-12:00)",-720,!1),new qt("utc-11","Coordinated Universal Time-11 (UTC-11:00)",-660,!1),new qt("aleutian-standard-time","Aleutian Islands (UTC-10:00)",-600,!0),new qt("hawaiian-standard-time","Hawaii (UTC-10:00)",-600,!1),new qt("marquesas-standard-time","Marquesas Islands (UTC-09:30)",-570,!1),new qt("alaskan-standard-time","Alaska (UTC-09:00)",-540,!0),new qt("utc-09","Coordinated Universal Time-09 (UTC-09:00)",-540,!1),new qt("pacific-standard-time-mexico","Baja California (UTC-08:00)",-480,!0),new qt("utc-08","Coordinated Universal Time-08 (UTC-08:00)",-480,!1),new qt("pacific-standard-time","Pacific Time (US & Canada) (UTC-08:00)",-480,!0),new qt("us-mountain-standard-time","Arizona (UTC-07:00)",-420,!1),new qt("mountain-standard-time-mexico","La Paz, Mazatlan (UTC-07:00)",-420,!0),new qt("mountain-standard-time","Mountain Time (US & Canada) (UTC-07:00)",-420,!0),new qt("yukon-standard-time","Yukon (UTC-07:00)",-420,!0),new qt("central-america-standard-time","Central America (UTC-06:00)",-360,!1),new qt("central-standard-time","Central Time (US & Canada) (UTC-06:00)",-360,!0),new qt("easter-island-standard-time","Easter Island (UTC-06:00)",-360,!0),new qt("central-standard-time-mexico","Guadalajara, Mexico City, Monterrey (UTC-06:00)",-360,!0),new qt("canada-central-standard-time","Saskatchewan (UTC-06:00)",-360,!1),new qt("sa-pacific-standard-time","Bogota, Lima, Quito, Rio Branco (UTC-05:00)",-300,!1),new qt("eastern-standard-time-mexico","Chetumal (UTC-05:00)",-300,!0),new qt("eastern-standard-time","Eastern Time (US & Canada) (UTC-05:00)",-300,!0),new qt("haiti-standard-time","Haiti (UTC-05:00)",-300,!0),new qt("cuba-standard-time","Havana (UTC-05:00)",-300,!0),new qt("us-eastern-standard-time","Indiana (East) (UTC-05:00)",-300,!0),new qt("turks-and-caicos-standard-time","Turks and Caicos (UTC-05:00)",-300,!0),new qt("paraguay-standard-time","Asuncion (UTC-04:00)",-240,!0),new qt("atlantic-standard-time","Atlantic Time (Canada) (UTC-04:00)",-240,!0),new qt("venezuela-standard-time","Caracas (UTC-04:00)",-240,!0),new qt("central-brazilian-standard-time","Cuiaba (UTC-04:00)",-240,!0),new qt("sa-western-standard-time","Georgetown, La Paz, Manaus, San Juan (UTC-04:00)",-240,!1),new qt("pacific-sa-standard-time","Santiago (UTC-04:00)",-240,!0),new qt("newfoundland-standard-time","Newfoundland (UTC-03:30)",-210,!0),new qt("tocantins-standard-time","Araguaina (UTC-03:00)",-180,!0),new qt("e-south-america-standard-time","Brasilia (UTC-03:00)",-180,!0),new qt("sa-eastern-standard-time","Cayenne, Fortaleza (UTC-03:00)",-180,!1),new qt("argentina-standard-time","City of Buenos Aires (UTC-03:00)",-180,!0),new qt("montevideo-standard-time","Montevideo (UTC-03:00)",-180,!0),new qt("magallanes-standard-time","Punta Arenas (UTC-03:00)",-180,!0),new qt("saint-pierre-standard-time","Saint Pierre and Miquelon (UTC-03:00)",-180,!0),new qt("bahia-standard-time","Salvador (UTC-03:00)",-180,!0),new qt("utc-02","Coordinated Universal Time-02 (UTC-02:00)",-120,!1),new qt("greenland-standard-time","Greenland (UTC-02:00)",-120,!0),new qt("mid-atlantic-standard-time","Mid-Atlantic - Old (UTC-02:00)",-120,!0),new qt("azores-standard-time","Azores (UTC-01:00)",-60,!0),new qt("cape-verde-standard-time","Cabo Verde Is. (UTC-01:00)",-60,!1),new qt("utc","Coordinated Universal Time (UTC)",0,!1),new qt("gmt-standard-time","Dublin, Edinburgh, Lisbon, London (UTC+00:00)",0,!0),new qt("greenwich-standard-time","Monrovia, Reykjavik (UTC+00:00)",0,!1),new qt("sao-tome-standard-time","Sao Tome (UTC+00:00)",0,!0),new qt("morocco-standard-time","Casablanca (UTC+01:00)",0,!0),new qt("w-europe-standard-time","Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna (UTC+01:00)",60,!0),new qt("central-europe-standard-time","Belgrade, Bratislava, Budapest, Ljubljana, Prague (UTC+01:00)",60,!0),new qt("romance-standard-time","Brussels, Copenhagen, Madrid, Paris (UTC+01:00)",60,!0),new qt("central-european-standard-time","Sarajevo, Skopje, Warsaw, Zagreb (UTC+01:00)",60,!0),new qt("w-central-africa-standard-time","West Central Africa (UTC+01:00)",60,!1),new qt("gtb-standard-time","Athens, Bucharest (UTC+02:00)",120,!0),new qt("middle-east-standard-time","Beirut (UTC+02:00)",120,!0),new qt("egypt-standard-time","Cairo (UTC+02:00)",120,!0),new qt("e-europe-standard-time","Chisinau (UTC+02:00)",120,!0),new qt("west-bank-standard-time","Gaza, Hebron (UTC+02:00)",120,!0),new qt("south-africa-standard-time","Harare, Pretoria (UTC+02:00)",120,!1),new qt("fle-standard-time","Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius (UTC+02:00)",120,!0),new qt("israel-standard-time","Jerusalem (UTC+02:00)",120,!0),new qt("south-sudan-standard-time","Juba (UTC+02:00)",120,!0),new qt("kaliningrad-standard-time","Kaliningrad (UTC+02:00)",120,!0),new qt("sudan-standard-time","Khartoum (UTC+02:00)",120,!0),new qt("libya-standard-time","Tripoli (UTC+02:00)",120,!0),new qt("namibia-standard-time","Windhoek (UTC+02:00)",120,!0),new qt("jordan-standard-time","Amman (UTC+03:00)",180,!0),new qt("arabic-standard-time","Baghdad (UTC+03:00)",180,!0),new qt("syria-standard-time","Damascus (UTC+03:00)",180,!0),new qt("turkey-standard-time","Istanbul (UTC+03:00)",180,!0),new qt("arab-standard-time","Kuwait, Riyadh (UTC+03:00)",180,!1),new qt("belarus-standard-time","Minsk (UTC+03:00)",180,!0),new qt("russian-standard-time","Moscow, St. Petersburg (UTC+03:00)",180,!0),new qt("e-africa-standard-time","Nairobi (UTC+03:00)",180,!1),new qt("volgograd-standard-time","Volgograd (UTC+04:00)",180,!0),new qt("iran-standard-time","Tehran (UTC+03:30)",210,!0),new qt("arabian-standard-time","Abu Dhabi, Muscat (UTC+04:00)",240,!1),new qt("astrakhan-standard-time","Astrakhan, Ulyanovsk (UTC+04:00)",240,!0),new qt("azerbaijan-standard-time","Baku (UTC+04:00)",240,!0),new qt("russia-time-zone-3","Izhevsk, Samara (UTC+04:00)",240,!0),new qt("mauritius-standard-time","Port Louis (UTC+04:00)",240,!0),new qt("saratov-standard-time","Saratov (UTC+04:00)",240,!0),new qt("georgian-standard-time","Tbilisi (UTC+04:00)",240,!1),new qt("caucasus-standard-time","Yerevan (UTC+04:00)",240,!0),new qt("afghanistan-standard-time","Kabul (UTC+04:30)",270,!1),new qt("west-asia-standard-time","Ashgabat, Tashkent (UTC+05:00)",300,!1),new qt("qyzylorda-standard-time","Astana (UTC+05:00)",300,!0),new qt("ekaterinburg-standard-time","Ekaterinburg (UTC+05:00)",300,!0),new qt("pakistan-standard-time","Islamabad, Karachi (UTC+05:00)",300,!0),new qt("india-standard-time","Chennai, Kolkata, Mumbai, New Delhi (UTC+05:30)",330,!1),new qt("sri-lanka-standard-time","Sri Jayawardenepura (UTC+05:30)",330,!1),new qt("nepal-standard-time","Kathmandu (UTC+05:45)",345,!1),new qt("central-asia-standard-time","Bishkek (UTC+06:00)",360,!1),new qt("bangladesh-standard-time","Dhaka (UTC+06:00)",360,!0),new qt("omsk-standard-time","Omsk (UTC+06:00)",360,!0),new qt("myanmar-standard-time","Yangon (Rangoon) (UTC+06:30)",390,!1),new qt("se-asia-standard-time","Bangkok, Hanoi, Jakarta (UTC+07:00)",420,!1),new qt("altai-standard-time","Barnaul, Gorno-Altaysk (UTC+07:00)",420,!0),new qt("w-mongolia-standard-time","Hovd (UTC+07:00)",420,!0),new qt("north-asia-standard-time","Krasnoyarsk (UTC+07:00)",420,!0),new qt("n-central-asia-standard-time","Novosibirsk (UTC+07:00)",420,!0),new qt("tomsk-standard-time","Tomsk (UTC+07:00)",420,!0),new qt("china-standard-time","Beijing, Chongqing, Hong Kong, Urumqi (UTC+08:00)",480,!1),new qt("north-asia-east-standard-time","Irkutsk (UTC+08:00)",480,!0),new qt("singapore-standard-time","Kuala Lumpur, Singapore (UTC+08:00)",480,!1),new qt("w-australia-standard-time","Perth (UTC+08:00)",480,!0),new qt("taipei-standard-time","Taipei (UTC+08:00)",480,!1),new qt("ulaanbaatar-standard-time","Ulaanbaatar (UTC+08:00)",480,!0),new qt("aus-central-w-standard-time","Eucla (UTC+08:45)",525,!1),new qt("transbaikal-standard-time","Chita (UTC+09:00)",540,!0),new qt("tokyo-standard-time","Osaka, Sapporo, Tokyo (UTC+09:00)",540,!1),new qt("north-korea-standard-time","Pyongyang (UTC+09:00)",540,!0),new qt("korea-standard-time","Seoul (UTC+09:00)",540,!1),new qt("yakutsk-standard-time","Yakutsk (UTC+09:00)",540,!0),new qt("cen-australia-standard-time","Adelaide (UTC+09:30)",570,!0),new qt("aus-central-standard-time","Darwin (UTC+09:30)",570,!1),new qt("e-australia-standard-time","Brisbane (UTC+10:00)",600,!1),new qt("aus-eastern-standard-time","Canberra, Melbourne, Sydney (UTC+10:00)",600,!0),new qt("west-pacific-standard-time","Guam, Port Moresby (UTC+10:00)",600,!1),new qt("tasmania-standard-time","Hobart (UTC+10:00)",600,!0),new qt("vladivostok-standard-time","Vladivostok (UTC+10:00)",600,!0),new qt("lord-howe-standard-time","Lord Howe Island (UTC+10:30)",630,!0),new qt("bougainville-standard-time","Bougainville Island (UTC+11:00)",660,!0),new qt("russia-time-zone-10","Chokurdakh (UTC+11:00)",660,!0),new qt("magadan-standard-time","Magadan (UTC+11:00)",660,!0),new qt("norfolk-standard-time","Norfolk Island (UTC+11:00)",660,!0),new qt("sakhalin-standard-time","Sakhalin (UTC+11:00)",660,!0),new qt("central-pacific-standard-time","Solomon Is., New Caledonia (UTC+11:00)",660,!1),new qt("russia-time-zone-11","Anadyr, Petropavlovsk-Kamchatsky (UTC+12:00)",720,!0),new qt("new-zealand-standard-time","Auckland, Wellington (UTC+12:00)",720,!0),new qt("utc-12","Coordinated Universal Time+12 (UTC+12:00)",720,!1),new qt("fiji-standard-time","Fiji (UTC+12:00)",720,!0),new qt("kamchatka-standard-time","Petropavlovsk-Kamchatsky - Old (UTC+12:00)",720,!0),new qt("chatham-islands-standard-time","Chatham Islands (UTC+12:45)",765,!0),new qt("utc-13","Coordinated Universal Time+13 (UTC+13:00)",780,!1),new qt("tonga-standard-time","Nuku'alofa (UTC+13:00)",780,!0),new qt("samoa-standard-time","Samoa (UTC+13:00)",780,!0),new qt("line-islands-standard-time","Kiritimati Island (UTC+14:00)",840,!1)];function Wt(t){return t=nt(t),Ft.find((e=>e.code===t))}var Yt,$t,Zt,Qt,Xt,te;!function(t){t.companyGeneral="companyGeneral",t.companyDirectory="companyDirectory",t.companyLabels="companyLabels",t.companyPolicies="companyPolicies",t.companyReseller="companyReseller",t.companyCreate="companyCreate",t.assetGeneral="assetGeneral",t.assetAdvanced="assetAdvanced",t.assetMessage="assetMessage",t.assetDispatch="assetDispatch",t.placeGeneral="placeGeneral",t.providerGeneral="providerGeneral",t.providerAdvanced="providerAdvanced",t.providerControl="providerControl",t.providerConfiguration="providerConfiguration",t.providerConfigType="providerConfigType",t.providerScript="providerScript",t.providerCommand="providerCommand",t.reportResult="reportResult",t.reportTemplate="reportTemplate",t.reportSchedule="reportSchedule",t.userGeneral="userGeneral",t.userAdvanced="userAdvanced",t.userGroup="userGroup",t.machine="machine",t.session="session",t.behaviour="behaviour",t.behaviourLog="behaviourLog",t.behaviourScript="behaviourScript",t.dispatchTask="dispatchTask",t.dispatchTemplate="dispatchTemplate",t.contact="contact",t.hosCarrier="hosCarrier",t.hosEvent="hosEvent",t.hosInspection="hosInspection",t.maintenanceJob="maintenanceJob",t.maintenanceSchedule="maintenanceSchedule",t.analyticRule="analyticRule",t.analyticSummary="analyticSummary",t.icon="icon",t.picture="picture",t.document="document",t.billingProfile="billingProfile",t.billingHosting="billingHosting",t.billingDiscount="billingDiscount",t.billingLicense="billingLicense",t.billingReport="billingReport",t.formTemplate="formTemplate",t.formResult="formResult",t.dispatchJob="dispatchJob"}(Yt||(Yt={})),function(t){t.read="read",t.update="update",t.full="full"}($t||($t={})),function(t){t.grant="grant",t.revoke="revoke"}(Zt||(Zt={}));class ee{static fromJSON(t){return new ee(t.company,t.kind,t.level,t.method,t.labels)}companyId;get company(){return ot.get(this.companyId)}kind;get type(){return this.kind.toString()}set type(t){const e=Yt[t];if(!e)throw new Error("Unknown PermissionType");this.kind=e}level;method;labels;constructor(t,e,s=$t.read,i=Zt.grant,n){this.companyId=L(t),this.kind=Yt[e],this.level=$t[s]||$t.read,this.method=Zt[i]||Zt.grant,this.labels=n||[]}toJSON(){return{company:Q(this.companyId),kind:Yt[this.kind]||null,level:$t[this.level]||null,method:Zt[this.method]||null,labels:[...this.labels]}}}!function(t){t.metric="metric",t.standard="standard"}(Qt||(Qt={}));!function(t){t.popup="popup",t.sms="sms",t.email="email"}(Xt||(Xt={}));class se{level;labels;constructor(t,e){this.level=t||null,this.labels=e||null}}class ie{direction;company;kind;after;before;constructor(t,e,s,i,n,r,a){this.direction=t,this.company=e,this.kind=s,this.after=new se(i,n),this.before=new se(r,a)}}!function(t){t.vertical="vertical",t.horizontal="horizontal"}(te||(te={}));class ne extends ee{order;constructor(t,e,s=$t.read,i=Zt.grant,n,r){super(t,e,s,i,n),this.order=r}}const re=[Yt.companyGeneral,Yt.companyLabels,Yt.companyPolicies,Yt.icon,Yt.picture],ae=[Yt.assetGeneral,Yt.assetAdvanced,Yt.assetDispatch,Yt.placeGeneral,Yt.dispatchJob,Yt.dispatchTemplate,Yt.formResult,Yt.formTemplate],oe=[$t.read,$t.update,$t.full],he=["*"];function de(t,e,s){e.forEach((function(e){ae.indexOf(e.kind)<0?le(t,e.kind,e.level,s):(e.labels&&e.labels.length?e.labels:he).forEach((function(i){le(t,e.kind+" "+i,e.level,s)}))}))}function le(t,e,s,i){const n=t.get(e);(!n||n[0]===Zt.revoke||oe.indexOf(s)>oe.indexOf(n[1]))&&t.set(e,[Zt.grant,s,i])}function ce(t,e,s){e.forEach((function(e){ae.indexOf(e.kind)<0?ue(t,e.kind,e.level,s):(e.labels&&e.labels.length?e.labels:he).forEach((function(i){ue(t,e.kind+" "+i,e.level,s)}))}))}function ue(t,e,s,i){const n=t.get(e),r=oe.indexOf(s);n&&r?(n[0]===Zt.grant&&r<=oe.indexOf(n[1])||n[0]===Zt.revoke&&r<oe.indexOf(n[1]))&&t.set(e,[n[0],oe[r-1],i]):t.set(e,[Zt.revoke,s,i])}function me(t){return t.kind==this}function pe(t){return t.method===Zt.grant&&t.companyId==this}function ge(t){return t.method===Zt.revoke&&t.companyId==this}function fe(t){return!ye(t)}function ye(t){return ae.indexOf(t.kind)<0}function Ne(t,e){return t.order>e.order?-1:t.order<e.order?1:0}function ve(t,e,s,i,n){const r=[],a=[],o=new Map;return i=i??t,n||t!==i||re.forEach((function(t){o.set(t,[Zt.grant,$t.read,0])})),de(o,e.filter(pe,i),1),ce(o,e.filter(ge,i),1),de(o,s.filter(pe,i),2),ce(o,s.filter(ge,i),2),o.forEach((function(t,e){const s=e.split(" "),n=s[0],o=s[1]||"";o?a.push(new ne(i,n,t[1],t[0],"*"===o?[]:[o],t[2])):t[0]===Zt.grant&&r.push(new ne(i,n,t[1],t[0],[],0))})),r.concat(a.reduce((function(t,e){if(e.labels.length){const s=t.find((function(t){return t.kind===e.kind&&t.method===e.method&&t.level===e.level&&t.order<=e.order}));s?s.labels.length&&s.labels.push(e.labels[0]):t.push(e)}else{for(let s,i=0;s=t[i];i++)s.kind===e.kind&&s.method===e.method&&oe.indexOf(s.level)<=oe.indexOf(e.level)&&s.order<=e.order&&t.splice(i--,1);t.push(e)}return t}),[])).sort(Ne).map((function(t){return new ee(t.companyId,t.kind,t.level,t.method,t.labels)}))}function we(t,e,s,i){e||(e=[]),s||(s=[]);const n=new Map;return n.set(t,ve(t,e,s,t,!!i)),e.concat(s).forEach((function(r){const a=r.companyId;n.has(a)||n.set(a,ve(t,e,s,a,!!i))})),n}function Se(t,e,s,i,n){return ve(t,e||[],s||[],A(i)?i:t,!!n)}function Ie(t,e,s,i){return Se(t,(e||[]).filter(ye),(s||[]).filter(ye),i)}function be(t,e,s,i){return oe.indexOf(Oe(t,e,s))>=oe.indexOf($t[i]||$t.read)}function Oe(t,e,s){if(0===t)return $t.full;if(!A(t))throw new TypeError("userCompanyId must be a number");const i=(e||[]).find(me,s);return i&&i.method===Zt.grant?i.level:void 0}function ke(t,e,s,i){return Se(t,(e||[]).filter(fe),(s||[]).filter(fe),i).filter(fe)}function xe(t,e,s,i,n,r){return oe.indexOf(Je(t,e,s,i,n))>=oe.indexOf($t[r]||$t.read)}function Je(t,s,i,n,r){if(0===t)return $t.full;if(!A(t))throw new TypeError("userCompanyId must be a number");i||(i=[]),r&&r.length||(r=i);let a=null,o=null,h=null;return(s||[]).forEach((function(t){if(t.kind===n){const e=t.labels&&t.labels.length?t.labels:i.concat(r);if(t.method===Zt.grant){switch(t.level){case $t.full:h||(h=[]);case $t.update:o||(o=[]);case $t.read:a||(a=[])}e.forEach((function(e){switch(t.level){case $t.full:h.indexOf(e)<0&&h.push(e);case $t.update:o.indexOf(e)<0&&o.push(e);case $t.read:a.indexOf(e)<0&&a.push(e)}}))}else if(e.length)e.forEach((function(e){let s;switch(t.level){case $t.read:a&&(s=a.indexOf(e))>-1&&a.splice(s,1);case $t.update:o&&(s=o.indexOf(e))>-1&&o.splice(s,1);case $t.full:h&&(s=h.indexOf(e))>-1&&h.splice(s,1)}})),a&&!a.length&&(a=null),o&&!o.length&&(o=null),h&&!h.length&&(h=null);else switch(t.level){case $t.read:a&&(a=null);case $t.update:o&&(o=null);case $t.full:h&&(h=null)}}})),h&&!e(r,h).length?$t.full:o&&!e(r,o).length?$t.update:a&&function(t,e){const s=[];for(let i=0,n=t.length;i<n;i++)for(let n=0,r=e.length;n<r;n++)t[i]===e[n]&&s.push(t[i]);return s}(r,a).length||!i.length?$t.read:void 0}function Te(t,e,s,i){return be(t,e,s,i)}function Ce(e,s,i,n){if(!A(e))throw new TypeError("userCompanyId must be a number");const r=[];return i&&i.length&&(s||(s=[]),i.forEach((function(a){if(ae.indexOf(a.kind)>-1){n||(n=[]);const o=t(n.concat(a.labels||[]));for(let t=0,h=o.length;t<h;t++){const h=Je(e,s,n,a.kind,[o[t]]),d=Je(e,i,n,a.kind,[o[t]]);if(Me(h,d)){r.push(new ie(te.vertical,a.companyId,a.kind,d,[o[t]],h,[o[t]]));break}}}else{const t=s.find((function(t){return t.kind==a.kind}));Me(t?.level,a.level)&&r.push(new ie(te.vertical,a.companyId,a.kind,a.level,null,t?.level,null))}}))),r}function Ue(e,s,i,n,r,a){if(0===e)return null;r=r||[],a=a||[];const o=t((s||[]).map((t=>t.companyId)));switch(o.length){case 1:break;case 0:throw new Error("Zero permissions given.");default:throw new Error("Permissions given for more than one company.")}const h=Je(e,s,n,i,r),d=Je(e,s,n,i,a);return Me(h,d)?new ie(te.horizontal,o[0],i,d,a.length>0?a:n||[],h,r.length>0?r:n||[]):null}function Me(t,e){return oe.indexOf(e)>oe.indexOf(t)}var De;!function(t){t.notFound="notFound",t.created="created",t.active="active",t.idle="idle",t.passwordExpired="passwordExpired",t.expired="expired"}(De||(De={}));class Ee{static fromJSON(t){return new Ee(t.handle,t.company,t.ipAddress,t.userAgent,t.sockets,t.login,t.status,t.created,t.expires,t.lastCommand,t.lastActivity)}handle;companyId;get company(){return ot.get(this.companyId)}ipAddress;userAgent;sockets;login;status;created;expiry;lastCommand;lastActivity;get active(){return this.sockets>0}constructor(t,e,s,i,n,r,a,o,h,d,l){this.handle=t||"",this.companyId=L(e),this.login=r||"",this.status=De[a]||De.notFound,this.userAgent=i||"",this.ipAddress=s||"",this.created=_(o),this.expiry=_(h),this.lastActivity=_(l),this.lastCommand=d||"",this.sockets=L(n)||0}toJSON(){return{handle:this.handle,login:this.login,company:this.companyId,created:this.created.toISOString(),lastActivity:this.lastActivity.toISOString(),ipAddress:this.ipAddress,userAgent:this.userAgent,lastCommand:this.lastCommand,active:this.active,sockets:this.sockets}}getKey(){return this.handle}}class Pe extends a{get v(){return this.pieces.map((t=>t?.v[0]??-1))}}class Ae extends a{login="";companyId=NaN;get company(){return ot.get(this.companyId)}groupIds=[];get groups(){return rt(ct,this.groupIds)}set groups(t){this.groupIds=t?.map(s)??[]}permissions=[];toJSON(){return{login:this.login.toLowerCase(),v:this.v,company:this.companyId,groups:[...this.groupIds],permissions:this.permissions.map(i)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.login||(this.login=(t.login||"").toLowerCase()),this.companyId=L(t.company),this.groupIds=t.groups||[],this.permissions=(t.permissions||[]).map(ee.fromJSON)),s}getKey(){return this.login}}const Re=1e3,ze=6e4,Le=36e5,_e=864e5;class Be{static fromDays(t){return new Be(t*_e)}static fromHours(t){return new Be(t*Le)}static fromMinutes(t){return new Be(t*ze)}static fromSeconds(t){return new Be(t*Re)}static fromMilliseconds(t){return new Be(t)}__total=0;__days=0;__hours=0;__minutes=0;__seconds=0;__milli=0;constructor(t){t&&this.add(t)}get days(){return this.__days}get hours(){return this.__hours}get minutes(){return this.__minutes}get seconds(){return this.__seconds}get milliseconds(){return this.__milli}get totalDays(){return this.__total/_e}get totalHours(){return this.__total/Le}get totalMinutes(){return this.__total/ze}get totalSeconds(){return this.__total/Re}get totalMilliseconds(){return this.__total}toString(t=""){if(t){var e=t.split(/(\\.|[hHmstT]{1,2}|[df]{1,6})/gm),s=e.includes("d");return e.slice(1,e.length-1).reduce(((t,e)=>{switch(e[0]||""){case"d":t+=H(this.days,e.length);break;case"H":t+=H(this.hours+(s?0:24*this.days),e.length);break;case"h":t+=H(this.hours%12,e.length);break;case"m":t+=H(this.minutes,e.length);break;case"s":t+=H(this.seconds,e.length);break;case"f":t+=H(this.milliseconds/Re,0,e.length).substring(2);break;default:t+=e}return t}),this.__total<0?"-":"")}var i=p(this.__days),n=p(this.__hours),r=p(this.__minutes),a=p(this.__seconds),o=p(this.__milli);return(this.__total<0?"-":"")+(i?i+".":"")+(n>9?n:"0"+n)+":"+(r>9?r:"0"+r)+":"+(a>9?a:"0"+a)+(o?(o/Re).toString().slice(1):"")}toJSON=this.toString;valueOf(){return this.__total}add(t,e=!1){let s=0;if(E(t)){const i=(t<0?-1:1)*(e?-1:1);for(;s>=_e;)this.__days+=i,s-=_e;for(;s>=Le;)this.__hours+=i,s-=Le;for(;s>=ze;)this.__minutes+=i,s-=ze;for(;s>=Re;)this.__seconds+=i,s-=Re;this.__milli+=b(s)*i}else if(t=String(t).trim()){const i=t.match(/^(-?)(?:(\d+)\.)?(\d*):(\d*)(?::(\d+)(?:\.(\d+))?)?$/)||[t,t[0],("-"===t[0]?-1:1)*h(t)];"-"===i[1]&&(e=!e),(s=_e*h(i[2]))&&this.add(s,e),(s=Le*h(i[3]))&&this.add(s,e),(s=ze*h(i[4]))&&this.add(s,e),(s=Re*h(i[5]))&&this.add(s,e),(s=b(h("0."+(i[6]&&i[6]+"000".slice(i[6].length)))*Re))&&this.add(s,e)}return this.__total=this.__days*_e+this.__hours*Le+this.__minutes*ze+this.__seconds*Re+this.__milli}subtract(t,e=!1){return this.add(t,!e)}}class Ve{static fromJSON(t){return new Ve(t.name,t.enabled,t.weekdays,t.start,t.end,t.email,t.sms,t.online,t.offline)}name;enabled;weekdays;start;end;email;sms;online;offline;constructor(t,e,s,i,n,r,a,o,h){this.name=t||"",this.enabled=!!e,this.weekdays=tt(s||[]),this.start=new Be(i),this.end=new Be(n),this.email=r||"",this.sms=K(a),this.online=[...o||[]],this.offline=[...h||[]]}toJSON(){return{name:this.name||"",enabled:!!this.enabled,weekdays:et(this.weekdays),start:A(this.start.valueOf())?this.start.toString():"00:00:00",end:A(this.end.valueOf())?this.end.toString():"00:00:00",email:this.email||"",sms:this.sms||null,online:this.online.slice(),offline:this.offline.slice()}}}class je extends a{login="";companyId=NaN;get company(){return ot.get(this.companyId)}passwordExpired=!1;enabled=!1;nickname="";contactId=NaN;get contact(){return ht.get(this.contactId)}set contact(t){this.contactId=t.id}timezone=qt.utc;language="";formats=new Map;measurements=new Map;options=new Map;notify=[];toJSON(){return{login:this.login.toLowerCase(),v:this.v,company:this.companyId,nickname:this.nickname,enabled:!!this.enabled,contact:!!this.contactId,passwordExpired:!!this.passwordExpired,timezone:this.timezone?.code??qt.utc.code,language:this.language,formats:G(this.formats),measurements:G(this.measurements),options:G(this.options),notify:this.notify.map(i)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.login||(this.login=(t.login||"").toLowerCase()),this.companyId=L(t.company),this.nickname=t.nickname||"",this.enabled=!!t.enabled,this.contactId=L(t.contact),this.passwordExpired=!!t.passwordExpired,this.timezone=Wt(t.timezone||"")||qt.utc,this.language=t.language||"",this.formats=$(t.formats||{}),this.measurements=W(t.measurements||{},((t,e)=>[nt(t),Qt[e]??Qt.metric])),this.options=$(t.options||{}),this.notify=(t.notify||[]).map((t=>new Ve(t)))),s}getKey(){return this.login}}const Ke=10.763910416709722,He=3.587970138903241;const Ge=.6213711922373338,qe=3.2808398950131235,Fe=1.0936132983377078,We=.3937007874015748;function Ye(t){return t*Ge}function $e(t){return t*qe}function Ze(t){return t*We}function Qe(t){return t/Ge}function Xe(t){return t/qe}function ts(t){return t/We}const es=.14503773773375084;const ss=5/9;const is=.2641720523581484,ns=.03381402270184299,rs=.2199692482990878,as=.035195079727854045;const os=2.2046226218487757,hs=.03527396194958041,ds=1.1023113109243878,ls=.9842065276110606;const cs=is*Ge*100,us=rs*Ge*100;function ms(t){return cs/t}function ps(t){return us/t}function gs(t){return 100/(1/Ge)/t}const fs={fromTo:function t(e,s,i){const n=fs[s.toLowerCase()+"To"+i[0].toUpperCase()+i.slice(1).toLowerCase()];if(!n||n===t)throw new Error("No converter for "+s+" to "+i);return n(e)},sqmToSqft:function(t){return t*Ke},sqftToSqm:function(t){return t/Ke},sqmToSqy:function(t){return t*He},yftToSqm:function(t){return t/He},sqkmToSqmi:function(t){return.3861021585424459*t},sqmiToSqkm:function(t){return t/Ge},haToAc:function(t){return 2.471053814671653*t},acToHa:function(t){return t/Ge},kmToMi:Ye,miToKm:Qe,mToYd:function(t){return t*Fe},ydToM:function(t){return t/Fe},mToFt:$e,ftToM:Xe,cmToIn:Ze,inToCm:ts,mpgToL100km:ms,mpgUKToL100km:ps,mpkwhToKwh100kim:gs,l100kmToMpg:ms,l100kmToMpgUK:ps,kwh100kimToMpkwh:gs,kpaToPsi:function(t){return t*es},psiToKpa:function(t){return t/es},kphToMph:Ye,mphToKph:Qe,mpsToFtps:$e,ftpsToMps:Xe,cmpsToInps:Ze,inpsToCmps:ts,cToF:function(t){return 1.8*t+32},fToC:function(t){return(t-32)*ss},lToGal:function(t){return t*is},lToGalUK:function(t){return t*rs},galToL:function(t){return t/is},galUKToL:function(t){return t/rs},mlToFloz:function(t){return t*ns},mlToFlozUK:function(t){return t*as},flozToMl:function(t){return t/ns},flozUKToMl:function(t){return t/as},kgToLbs:function(t){return t*os},lbsToKg:function(t){return t/ls},gToOz:function(t){return t*hs},ozToG:function(t){return t/hs},tToTon:function(t){return t*ds},tonToT:function(t){return t/ds},tToTonUK:function(t){return t*os},tonUKToT:function(t){return t/ls}},ys=["B","KB","MB","GB","TB","PB","EB","ZB","YB","XB","SB","DB"];function Ns(t,e=3,s=",",i=s,n="."){if(!(e>0))throw new TypeError("size must be greater than zero.");const r=t<0?"-":"",a=p(t).toString().split("."),o=[],h=[];for(let t=a[0].length;t>0;t-=e)o.unshift(a[0].slice(w(0,t-e),t));if(a.length>1)for(let t=0,s=a[1].length;t<s;t+=e)h.push(a[1].slice(t,t+e));return r+o.join(s)+(h.length?(n??"")+h.join(i):"")}const vs=6378137,ws=1/298.257223563,Ss=6356752.314245179;function Is(t){return 0===R(N(t*T),9)}function bs(t,e=90){return E(t)?t>e?e:t<-e?-e:t:NaN}function Os(t,e=NaN){return t=E(t)?p(t%=360)>180?t+(t<0?360:-360):t:NaN,A(e)&&Is(e)&&(t=0),t}const ks=1e-9;function xs(t,e){const s=bs(t.lat),i=bs(e.lat),n=Os(t.lng,s),r=Os(e.lng,i);if(Is(s))return s>0?180:0;{const t=s*T,e=i*T,a=(r-n)*T,o=N(e);return(y(O(a)*o,N(t)*O(e)-O(t)*o*N(a))*J+360)%360}}function Js(t,e){const s=bs(t.lat),i=bs(e.lat),n=Os(t.lng,s),r=Os(e.lng,i),a=s*T,o=i*T,h=r*T-n*T,d=I(O((o-a)/2),2),l=I(O(h/2),2),c=d+N(a)*N(o)*l;return 2*y(k(c),k(1-c))*vs}function Ts(t,e,s){if(Js(t,s)<ks)return Js(t,e);const i=bs(t.lat),n=bs(e.lat),r=bs(s.lat),a=Os(t.lng,i),o=Os(e.lng,n),h=Os(s.lng,r),d=i*T,l=a*T,c=n*T,u=o*T,m=r*T,p=h*T,f=O(d),y=N(d),v=O(l),w=N(l),S=O(c),I=N(c),b=O(u),x=N(u),J=O(m),C=N(m),U=O(p),M=N(p),D=f*J+y*C*(w*M+v*U);return g(R((f*(C*I*M*b-C*I*U*x)+y*w*(C*S*U-J*I*b)+y*v*(J*I*x-C*S*M))/k(1-D*D),15))*vs}function Cs(t,e,s){let i=bs(t.lat),n=Os(t.lng,i);if(e>=ks){const t=e/vs,r=s*T,a=i*T,o=n*T,h=g(R(O(a)*N(t)+N(a)*O(t)*N(r),15)),d=o+y(O(r)*O(t)*N(a),N(t)-O(a)*O(h));i=h*J,n=d*J}if(!A(i)||!A(n))throw new Error("Either latitude or longitude is NaN");return{lat:i,lng:n}}function Us(t,e){const s=bs(t.lat),i=bs(e.lat),n=Os(t.lng,s),r=Os(e.lng,i),a=s*T,o=n*T,h=i*T,d=(r-n)*T,l=N(h)*N(d),c=N(h)*O(d),u=y(O(a)+O(h),k((N(a)+l)*(N(a)+l)+c*c)),m=o+y(c,N(a)+l);if(!A(u)||!A(m))throw new Error("latitude or longitude is NaN");return{lat:u*J,lng:m*J}}function Ms(t,e,s){return p(Ts(t,e,s))}function Ds(t,e){const s=[];let i=t*e<<1;for(i<0&&(i=~i);i>=32;)s.push(63+(32|31&i)),i>>=5;return s.push(i+63),String.fromCharCode.apply(s,s)}function Es(t,e=5){const s=t.length,i=[],n=I(10,e||5);let r=0,a=r,o=r;function h(){let e=0,s=0,i=0;do{e=t.charCodeAt(r++)-63,i|=(31&e)<<s,s+=5}while(e>=32);return 1&i?~(i>>1):i>>1}for(;r<s;)i.push({lat:(a+=h())/n,lng:(o+=h())/n});return i}function Ps(t){const e=[...t],s=t.length;let i=0,n=0,r=s-1;if(s>1)for(let t=0;t<s;t++){const a=e[t];for(let o=t+1;o<s;o++){const s=Js(a,e[o]);s>i&&(n=t,r=o,i=s)}}return[i,n,r]}function As(t,e,s){const i=Js(t,e)/vs,n=Js(e,s)/vs,r=Js(s,t)/vs,a=(i+n+r)/2,o=x(a/2)*x((a-i)/2)*x((a-n)/2)*x((a-r)/2);return 4*f(k(p(o)))}function Rs(t,e,s){const i=bs(t.lat),n=Os(t.lng,i),r=bs(e.lat),a=Os(e.lng,r),o=bs(s.lat),h=Os(s.lng,o),d=i*T,l=n*T,c=r*T,u=a*T,m=o*T,p=h*T,g=N(d)*N(l),f=N(d)*O(l),y=O(d),v=N(c)*N(u),w=N(c)*O(u),S=O(c),I=N(m)*N(p),b=N(m)*O(p),k=O(m);return g*w*k+v*b*y+I*f*S-g*b*S-v*f*k-I*w*y<0?-1:1}function zs(t){return!!t&&E(t.x)&&E(t.y)}function Ls(t){return E(t?.r)&&zs(t)}function _s(t){return!!t&&E(t.top)&&E(t.left)&&E(t.bottom)&&E(t.right)}function Bs(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function Vs(t,e){var s=0;return t.x===e.x&&t.y===e.y||(s=y(e.y-t.y,e.x-t.x)*J+90),(s+360)%360}function js(t,e){return z(e.x-t.x,e.y-t.y)}function Ks(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}function Hs(t,e){var s=(e-90)*T;return{x:N(s)*t,y:O(s)*t}}function Gs(t,e,s){var i=js(t,s);return i>0?Fs([t,e,s])/i*2:js(t,e)}function qs(t,e,s){return Gs(t,e,s)}function Fs(t){var e=t.slice(),s=0,i=0,n=e.length-1,r=e[i],a=e[n];for(r.x===a.x&&r.y===a.y||(n=e.push(r)-1);i<n;i++)r=e[i],a=e[i+1],s+=r.x*a.y-r.y*a.x;return p(s/2)}function Ws(t){let e=NaN,s=NaN,i=NaN,n=NaN;for(let r=0;r<t.length;r++){const a=t[r].x,o=t[r].y;a>e||(e=a),a<i||(i=a),o>s||(s=o),o<n||(n=o)}return{left:e,top:s,right:i,bottom:n}}function Ys(t,e){return!(e.y<t.top||e.x<t.left||e.x>t.right||e.y>t.bottom)}class $s{static fromJSON(t){return new $s(t?.width,t?.height)}width;height;constructor(t,e){this.width=h(t),this.height=h(e)}toString(t=","){return[this.width,this.height].join(t??"")}toJSON(){return{width:this.width,height:this.height}}equals(t,e=18){return function(t){return!!t&&E(t.width)&&E(t.height)}(t)&&R(this.width,e)==R(t.width,e)&&R(this.height,e)==R(t.height,e)}resize(t=1,e=t){return new $s(this.width*t,this.height*e)}resizeToWidth(t){return this.resize(t/this.width)}resizeToHeight(t){return this.resize(t/this.height)}}class Zs{static fromObject(t){const e=A((t=t||{}).left),s=A(t.top),i=A(t.right),n=A(t.bottom),r=A(t.width),a=A(t.height);return new Zs(e?t.left:i&&r?t.right-t.width:NaN,s?t.top:n&&a?t.bottom-t.height:NaN,i?t.right:e&&r?t.left+t.width:NaN,n?t.bottom:s&&a?t.top+t.height:NaN)}left=NaN;top=NaN;right=NaN;bottom=NaN;get width(){return this.right-this.left}get height(){return this.bottom-this.top}constructor(...t){A(t[0])&&A(t[1])&&A(t[2])&&A(t[3])?(this.left=h(t[0]),this.top=h(t[1]),this.right=h(t[2]),this.bottom=h(t[3])):this.__expander(t)}toString(t=","){return this.validate(),[this.left,this.top,this.right,this.bottom].join(t??"")}toJSON(){return this.validate(),{top:this.top,right:this.right,bottom:this.bottom,left:this.left}}isEqual(t,e=18){return this.validate(),_s(t)&&R(this.top,e)==R(t.top,e)&&R(this.left,e)==R(t.left,e)&&R(this.bottom,e)==R(t.bottom,e)&&R(this.right,e)==R(t.right,e)}isValid(){return!(this.top>this.bottom||this.right<this.left||this.width!==p(this.right-this.left)||this.height!==p(this.bottom-this.top))}isEmpty(){return this.isValid()&&this.width+this.height===0}contains(t){return Ys(this,t)}overlaps(t){return!(t.left>this.right||t.right<this.left||t.top>this.bottom||t.bottom<this.top)}copy(){return this.validate(),new Zs(this)}getCentre(){return this.validate(),new Xs(this.left+this.width/2,this.top+this.height/2)}getSize(){return this.validate(),new $s(this.width,this.height)}getTopLeft(){return this.validate(),new Xs(this.left,this.top)}getTopRight(){return this.validate(),new Xs(this.right,this.top)}getBottomLeft(){return this.validate(),new Xs(this.left,this.bottom)}getBottomRight(){return this.validate(),new Xs(this.right,this.bottom)}__expander(t){t instanceof Array?t.forEach(this.__expander,this):Ls(t)?(this.__expander({x:t.x+t.r,y:t.y+t.r}),this.__expander({x:t.x-t.r,y:t.y-t.r})):zs(t)?((t.y<this.top||!A(this.top))&&(this.top=t.y),(t.x<this.left||!A(this.left))&&(this.left=t.x),(t.x>this.right||!A(this.right))&&(this.right=t.x),(t.y>this.bottom||!A(this.bottom))&&(this.bottom=t.y)):_s(t)&&(this.__expander({x:t.left,y:t.top}),this.__expander({x:t.right,y:t.bottom}))}validate(){var t=this.top,e=this.left,s=this.bottom,i=this.right;return this.top=t<s?t:s,this.bottom=t>s?t:s,this.left=e<i?e:i,this.right=e>i?e:i,this}expand(t){return this.__expander(t),this}extend(t){return this.__expander(t),this.validate()}grow(t=0,e=0,s=""){return E(t)||(t=0),E(e)||(e=0),P(s)||(s=""),s.indexOf("top")>-1?this.top-=e:s.indexOf("bottom")>-1?this.bottom+=e:(this.top-=e/2,this.bottom+=e/2),s.indexOf("left")>-1?this.left-=t:s.indexOf("right")>-1?this.right+=t:(this.left-=t/2,this.right+=t/2),this.validate()}translateTo(t,e){return this.offsetTo(Hs(t,e))}offsetTo(t){const e=this.toOffset(t);return this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom,this}toTranslated(t,e){return this.toOffset(Hs(t,e))}toOffset(t){return this.validate(),new Zs(new Xs(this.left+t.x,this.top+t.y),new Xs(this.right+t.x,this.bottom+t.y))}toRadial(t=!1){this.validate();var e=this.getCentre();return new Qs(e.x,e.y,t?this.width>this.height?js(e,{x:this.left,y:this.top+this.height/2}):js(e,{x:this.left+this.width/2,y:this.top}):js(e,{x:this.left,y:this.top}))}}class Qs{static fromObject(t){return new Qs(t.x,t.y,t.r)}x=NaN;y=NaN;r=NaN;constructor(...t){A(t[0])&&A(t[1])&&A(t[2])?(this.x=h(t[0]),this.y=h(t[1]),this.r=h(t[2])):this.__expander(t)}toString(t=","){return[this.x,this.y,this.r].join(t??"")}toJSON(){return{x:this.x,y:this.y,r:this.r}}copy(){return new Qs(this.x,this.y,this.r)}isEquals(t,e=18){return Ls(t)&&R(this.x,e)==R(t.x,e)&&R(this.y,e)==R(t.y,e)&&R(this.r,e)==R(t.r,e)}contains(t){return js(this,t)<=this.r}overlaps(t){return js(this,t)<=this.r+t.r}getCentre(){return new Xs(this.x,this.y)}getSize(){return new $s(2*this.r,2*this.r)}__expander(t){if(t instanceof Array)t.forEach(this.__expander,this);else{const e=this.getCentre();let s;Ls(t)?(s=js(e,t)+t.r)>this.r&&(this.r=s):zs(t)&&(s=js(e,t))>this.r&&(this.r=s)}}extend(t){return this.__expander(t),this}grow(t){return this.r+=t,this}translateTo(t,e){return this.offsetTo(Hs(t,e))}offsetTo(t){const e=this.toOffset(t);return this.x=e.x,this.y=e.y,this}toTranslated(t,e){return this.toOffset(Hs(t,e))}toOffset(t){return new Qs(this.x+t.x,this.y+t.y,this.r)}toRectangle(t=!1){const e=t?this.getCentre():null,s=e?e.toOffset(Hs(this.r,-45)):new Xs(this.x-this.r,this.y-this.r),i=e?e.toOffset(Hs(this.r,135)):new Xs(this.x+this.r,this.y+this.r);return new Zs(s,i)}}class Xs{static fromJSON(t){return new Xs(t?.x,t?.y)}x;y;constructor(t,e){this.x=h(t),this.y=h(e)}toString(t=","){return[this.x,this.y].join(t??"")}toJSON(){return{x:this.x,y:this.y}}copy(){return new Xs(this.x,this.y)}isEquals(t,e=18){return zs(t)&&R(this.x,e)==R(t.x,e)&&R(this.y,e)==R(t.y,e)}distanceTo(t){return js(this,t)}angleTo(t){return Vs(this,t)}translateTo(t,e){return this.offsetTo(Hs(t,e))}offsetTo(t){const e=this.toOffset(t);return this.x=e.x,this.y=e.y,this}toTranslated(t,e){return this.toOffset(Hs(t,e))}toOffset(t){return new Xs(this.x+t.x,this.y+t.y)}toRadial(t){return new Qs(this.x,this.y,t)}}function ti(t){return!!t&&E(t.lat)&&E(t.lng)}function ei(t){return!!t&&E(t.north)&&E(t.west)&&E(t.south)&&E(t.west)}class si{static fromJSON(t){const e=new si;return ei(t)&&(e.east=t.east,e.north=t.north,e.west=t.west,e.south=t.south),e.validate()}north=NaN;east=NaN;south=NaN;west=NaN;constructor(...t){t.forEach((t=>this.__expander(t)))}toString(t=","){return[this.north,this.east,this.south,this.west].join(t??"")}toJSON(){return this.validate(),{north:this.north,east:this.east,south:this.south,west:this.west}}isEqual(t,e=1e-9){return ei(t)&&Js(this.getNorthEast(),{lat:t.north,lng:t.east})<e&&Js(this.getSouthWest(),{lat:t.south,lng:t.west})<e}isValid(){return this.north>=this.south&&this.east>=this.west&&!(p(this.north)>90||p(this.south)>90||p(this.east)>180&&p(this.east)>180)}isEmpty(){return this.isValid()&&(Js(this.getNorthEast(),this.getNorthWest())<ks||Js(this.getNorthEast(),this.getSouthEast())<ks)}contains(t){this.validate();const e=bs(t.lat),s=Os(t.lng,e)+360;return s<=Os(this.east)+360&&s>=Os(this.west)+360&&Ts(this.getNorthWest(),{lat:e,lng:s},this.getNorthEast())<=0&&Ts(this.getSouthWest(),{lat:e,lng:s},this.getSouthEast())>=0}encloses(t){this.validate();const e=bs(t.north),s=Os(t.east,e)+360,i=bs(t.south),n=Os(t.west,i)+360;return s<=Os(this.east)+360&&n>=Os(this.west)+360&&Ts(this.getNorthWest(),{lat:t.north,lng:t.west},this.getNorthEast())<=0&&Ts(this.getSouthWest(),{lat:t.south,lng:t.east},this.getSouthEast())>=0}overlaps(t){this.validate();const e=new si(t);return this.contains(e.getNorthEast())||this.contains(e.getNorthWest())||this.contains(e.getSouthWest())||this.contains(e.getSouthEast())||e.encloses(this)}__expander(t){if(t instanceof Array)t.forEach(this.__expander,this);else if(ei(t)){const e=bs(t.north),s=Os(t.east,e),i=bs(t.south),n=Os(t.west,i);if((s>this.east||!A(this.east))&&(this.east=s),(n<this.west||!A(this.west))&&(this.west=n),!A(this.north)||e>this.north&&(this.east===s||this.west===n))this.north=e;else if(A(e)){const t={lat:e,lng:s},i=Ts(this.getNorthWest(),t,this.getNorthEast());i>0&&(this.north=Cs(t,i,0).lat)}if(!A(this.south)||i<this.south&&(this.east===s||this.west===n))this.south=i;else if(A(i)){const t={lat:i,lng:n},e=Ts(this.getSouthEast(),t,this.getSouthWest());e>0&&(this.south=Cs(t,e,180).lat)}}else if(ti(t)){const e=bs(t.lat),s=Os(t.lng,e);if((s>this.east||!A(this.east))&&(this.east=s),(s<this.west||!A(this.west))&&(this.west=s),!A(this.north)||e>this.north&&(this.east===s||this.west===s))this.north=e;else if(A(e)){const t={lat:e,lng:s},i=Ts(this.getNorthWest(),t,this.getNorthEast());i>0&&(this.north=Cs(t,i,0).lat)}if(!A(this.south)||e<this.south&&(this.east===s||this.west===s))this.south=e;else if(A(e)){const t={lat:e,lng:s},i=Ts(this.getSouthEast(),t,this.getSouthWest());i>0&&(this.south=Cs(t,i,180).lat)}}}expand(t){return this.__expander(t),this}extend(t){return this.__expander(t),this.validate()}getCentre(){const t=this.getNorthEast(),e=this.getSouthWest(),s=Cs(t,Js(t,e)/2,xs(t,e));return new ii(s.lat,s.lng)}getNorthEast(){return new ii(this.north,this.east)}getNorthWest(){return new ii(this.north,this.west)}getSouthEast(){return new ii(this.south,this.east)}getSouthWest(){return new ii(this.south,this.west)}getNorthMiddle(){const t=Us(this.getNorthEast(),this.getNorthWest());return new ii(t.lat,t.lng)}getSouthMiddle(){const t=Us(this.getSouthEast(),this.getSouthWest());return new ii(t.lat,t.lng)}getEastMiddle(){const t=Us(this.getNorthEast(),this.getSouthEast());return new ii(t.lat,t.lng)}getWestMiddle(){const t=Us(this.getNorthWest(),this.getSouthWest());return new ii(t.lat,t.lng)}getDiagonalDistance(){return Js(this.getNorthEast(),this.getSouthWest())}getLatitudinalDistance(){return Js(this.getNorthEast(),this.getSouthEast())}getLongitudinalDistance(){return p(this.north)<p(this.south)?Js(this.getNorthEast(),this.getNorthWest()):Js(this.getSouthEast(),this.getSouthWest())}validate(){const t=bs(this.north),e=Os(this.east,t),s=bs(this.south),i=Os(this.west,s);return this.north=t>s?t:s,this.south=s<t?s:t,this.east=e>i?e:i,this.west=i<e?i:e,this}}class ii{static INVALID=new ii(0,0);static fromJSON(t){return new ii(t?.lat,t?.lng)}lat;lng;constructor(t,e){this.lat=t,this.lng=e}toString(t=","){return[this.lat,this.lng].join(t??"")}toJSON(){return this.isValid()?{lat:this.lat,lng:this.lng}:{lat:0,lng:0}}isEqual(t,e=1e-9){return ti(t)&&Js(this,t)<e}isValid(){return A(this.lat)&&A(this.lng)&&!this.isEqual(ii.INVALID)}distanceTo(t){return Js(this,t)}bearingTo(t){return xs(this,t)}toTranslated(t,e){const s=Cs(this,t,e);return new ii(s.lat,s.lng)}toBetween(t){const e=Us(this,t);return new ii(e.lat,e.lng)}toRadians(t=1){var e=O(this.lat*T);return new Xs((1+this.lng/180)*t,(1-.5/m*v((1+e)/(1-e)))*t)}toBounds(t){var e=z(t,t);return new si(Cs(this,e,45),Cs(this,e,-135))}}class ni{static fromJSON(t){return new ni(t.number,t.street,t.city,t.region,t.province,t.country,t.postal,t.isToll)}number;street;city;region;province;country;postal;isToll;constructor(t,e,s,i,n,r,a,o){this.number=String(t??"").trim(),this.street=String(e??"").trim(),this.city=String(s??"").trim(),this.region=String(i??"").trim(),this.province=String(n??"").trim(),this.country=String(r??"").trim(),this.postal=String(a??"").trim(),this.isToll=!!o}toString(){var t=[];return this.street&&t.push((this.number?this.number+" ":"")+this.street),this.city&&t.push(this.city),this.region&&t.push(this.region),this.province&&t.push(this.province),this.country&&t.push(this.country),this.postal&&t.push(this.postal),t.join(", ")}toJSON(){return{number:this.number,street:this.street,city:this.city,region:this.region,province:this.province,country:this.country,postal:this.postal,isToll:this.isToll}}}class ri extends ii{speed;bearing;altitude;accuracy;date=_();get dts(){return this.date.toISOString()}streetAddress=null;speedLimit;origin="";get address(){return this.streetAddress?.toString()??""}constructor(t,e,s,i,n,r,a,o,d){super(t||NaN,e||NaN),this.speed=h(s),this.bearing=h(i),this.accuracy=h(n),this.date=_(r),this.speedLimit=h(a),this.altitude=h(o),d&&(this.streetAddress=ni.fromJSON(d))}toString(t=","){return t=t??"","("+super.toString(t)+t+this.speed+t+this.bearing+t+this.accuracy+t+this.altitude+t+Z(this.date)+t+this.speedLimit+")"+this.address}toJSON(){return{lat:this.lat,lng:this.lng,dts:this.date.toISOString(),speed:Q(this.speed),speedLimit:Q(this.speedLimit),bearing:Q(this.bearing),altitude:Q(this.altitude),accuracy:Q(this.accuracy),streetAddress:this.streetAddress?.toJSON()||null}}}const ai=(C?C.protocol+C.host+C.pathname:(new Date).valueOf().toString(16)).match(/[a-z0-9]/gim).reduce((function(t,e){return t+o(e,36)}),0).toString(16).split("").reduce((function(t,e,s){return t[s]=e,t})," - -4 - - ".split(""));function oi(t,e,s){return t[s+26]=e,t}const hi=/^!?[a-z0-9\-]+:/gim,di=/(!?(?:[#$]?[a-z0-9\-]+|"[^"]+"|'[^']+'|\*))/gim,li=/(?:!?[a-z0-9\-]+:\s*)?(?:(?:(!?(?:[#$]?[a-z0-9\-]+|"[^"]*"|'[^']*'|\*))(?:,\s*)?)+)?/gim,ci=/("[^"]*"|'[^']*'|\|)/gm;function ui(t){var e=(t.match(hi)||[])[0]||"",s="!"===(e[0]||"").trim()?"!":"",i=e&&nt(t.substring(0,e.length-1))||"";if(i){i=s+i;var n=this.operators.get(i);n||this.operators.set(i,n=[]),t.substring(e.length).split(di).forEach(mi,n)}else(t=t.trim())&&t.split(di).forEach(mi,this.terms)}function mi(t){if(t){var e="!"===t[0]?"!":"";switch(e&&(t=t.substring(1)),t[0]){case"*":return this.push(e+t);case"#":case"$":t=e+t[0]+nt(t.substring(1));break;default:t=e+nt(t)}t&&this.indexOf(t)<0&&this.push(t)}}function pi(t){var e=t.indexOf("*");if(e<0)for(;(e=t.indexOf(""))>-1;)t.splice(e,1);else t.length=0}class gi{static parse(t){const e=(t??"").split(ci),s=[];let i="";for(let t=0,n=e.length;t<n;t++)"|"!==e[t]?i+=e[t]:(i&&s.push(new gi(i)),i="");return i&&s.push(new gi(i)),s}static stringify(t){const e=(t||[]).map((t=>t.toString()));return 0===e.length?null:e.some((t=>"*"===t))?"*":e.join("|")}operators=new Map;terms=[];constructor(t=""){var e,s=t?t.match(li):null;s?.length&&(e=this,s.forEach(ui,e),e.operators.forEach(pi),pi(e.terms))}get wildcard(){return!this.terms.length&&!this.operators.size}toString(){const t=[];return this.operators.forEach(((e,s)=>t.push(s+":"+(e?.join(",")||"*")))),(t.join(" ")+" "+this.terms.join(",")).trim()||"*"}toJSON=this.toString;copy(){var t=new gi;return this.operators.forEach(((e,s)=>t.operators.set(s,[...e]))),t.terms=[...this.terms],t}}class fi{static fromJSON(t){return new fi(t.name,t.simple,t.complex,t.raw,t.unit,t.provider,t.asset,t.dts,t.global)}name="";simple="";complex="";raw=null;unit="";providerId="";get provider(){return Dt.get(this.providerId)}assetId=NaN;get asset(){return mt.get(this.assetId)}dts=_();global=!1;constructor(t,e,s,i,n,r,a,o,h){this.name=t||"",this.simple=e||"",this.complex=s||"",this.raw=i||null,this.unit=n||"",this.providerId=r||"",this.assetId=L(a),this.dts=_(o),this.global=!!h}toJSON(){return{name:this.name,simple:this.simple,complex:this.complex,raw:this.raw||A(this.raw)||"string"==typeof this.raw?this.raw:null,provider:this.providerId||"",asset:Q(this.assetId),dts:Z(this.dts),global:!!this.global}}}var yi,Ni,vi,wi,Si,Ii,bi,Oi,ki,xi,Ji,Ti,Ci,Ui,Mi,Di,Ei,Pi;!function(t){t.enter="enter",t.inside="inside",t.exit="exit"}(yi||(yi={}));class Ai{static fromJSON(t){return new Ai(t.kind,t.enter,t.latest)}kind=yi.inside;enter=_();latest=_();constructor(t,e,s){this.kind=yi[t]||yi.inside,this.enter=_(e),this.latest=_(s)}toJSON(){return{kind:yi[this.kind]||yi.inside,enter:Z(this.enter),latest:Z(this.latest)}}}!function(t){t.asset="asset",t.person="person",t.trailer="trailer",t.vehicle="vehicle"}(Ni||(Ni={}));class Ri extends zi{engineHours=NaN;toJSON(){return U(super.toJSON(),{engineHours:this.engineHours||null})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.engineHours=h(t.engineHours)),s}}class zi extends a{static fromJSON(t){switch(t.kind){case Ni.vehicle:return new Ri(t);case Ni.person:case Ni.trailer:default:return new zi(t)}}id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}position=null;odometer=NaN;tags=[];attributes=new Map;providerIds=[];get providers(){return rt(Dt,this.providerIds)}set providers(t){this.providerIds=t?.map((t=>t.id))??[]}relationshipIds=[];get relationships(){return rt(mt,this.relationshipIds)}set relationships(t){this.relationshipIds=t?.map(s)??[]}places=new Map;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,position:this.position?.toJSON()||null,odometer:this.odometer||0,tags:[...this.tags],attributes:F(this.attributes),providers:[...this.providerIds],relationships:[...this.relationshipIds],places:F(this.places)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.id=L(t.id),this.companyId=L(t.company),this.position=t.position?new ri(t.position.lat,t.position.lng,t.position.speed,t.position.bearing,t.position.accuracy,t.position.dts,t.position.speedLimit||t.position.limit,t.position.altitude,t.position.streetAddress):null,this.odometer=h(t.odometer),this.tags=[...t.tags||[]],this.attributes=W(t.attributes||{},((t,e)=>[t,new fi(e)])),this.relationshipIds=(t.relationships||[]).map(L),this.places=W(t.places||{},((t,e)=>[L(t),new Ai(e)]))),s}getKey(){return this.id.toString()}}class Li{static fromJSON(t){return new Li(t.distance,t.duration,t.instructions,t.path,t.directions?.map(Li.fromJSON),t.job,t.step)}distance;duration;instructions="";path;directions;job;step;constructor(t,e,s,i,n,r,a){this.distance=h(t),this.duration=new Be(e),this.instructions=s||"",this.path=i?.map(ii.fromJSON)??[],this.directions=n??[],this.job=L(r),this.step=L(a)}toJSON(){return{distance:this.distance||0,duration:this.duration.toString()||null,instructions:this.instructions||"",path:this.path.map(i),directions:this.directions.map(i),job:this.job||null,step:this.step||null}}}class _i extends a{static fromJSON(t){return new _i(t)}id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}jobIds=[];get jobs(){return rt(bt,this.jobIds)}set jobs(t){this.jobIds=t?.map(s)??[]}directions=[];lastDispatched=_();toJSON(){return{id:this.id||null,v:this.v,companyId:this.companyId||null,jobs:[...this.jobIds],directions:[...this.directions],lastDispatched:this.lastDispatched.toISOString()}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.id=L(t.id),this.companyId=L(t.company),this.jobIds=(t.jobs||[]).map(L),this.directions=(t.directions||[]).map(Li.fromJSON),this.lastDispatched=_(t.lastDispatched)),s}getKey(){return this.id.toString()}}class Bi extends Ki{contactId=NaN;get contact(){return ht.get(this.contactId)}set contact(t){this.contactId=t.id}toJSON(){return this.suspended?super.toJSON():U(super.toJSON(),{contact:this.contactId})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.contactId=L(t.contact)),s}}class Vi extends Ki{plate="";serial="";make="";model="";year=NaN;colour="";toJSON(){return this.suspended?super.toJSON():U(super.toJSON(),{serial:this.serial||"",plate:this.plate||"",make:this.make||"",model:this.model||"",year:this.year||null,colour:this.colour||""})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.plate=t.plate||"",this.serial=t.serial||"",this.make=t.make||"",this.model=t.model||"",this.year=L(t.year)||0,this.colour=t.colour||""),s}}class ji extends Ki{vin="";plate="";make="";model="";year=NaN;colour="";toJSON(){return this.suspended?super.toJSON():U(super.toJSON(),{vin:this.vin||"",plate:this.plate||"",make:this.make||"",model:this.model||"",year:this.year||null,colour:this.colour||""})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.plate=t.plate||"",this.vin=t.vin||"",this.make=t.make||"",this.model=t.model||"",this.year=L(t.year)||0,this.colour=t.colour||""),s}}class Ki extends a{static fromJSON(t){switch(t.kind){case Ni.person:return new Bi(t);case Ni.vehicle:return new ji(t);case Ni.trailer:return new Vi(t);default:return new Ki(t)}}id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}kind=Ni.asset;name="";iconId=NaN;get icon(){return Tt.get(this.iconId)}set icon(t){this.iconId=t?.id??NaN}notes="";labels=[];pictureIds=[];get pictures(){return rt(Jt,this.pictureIds)}set pictures(t){this.pictureIds=t?.map(s)??[]}messagingAddress="";references=new Map;toJSON(){return U({id:this.id||null,v:this.v,company:this.companyId,kind:Ni[this.kind]||null,name:this.name||"",notes:this.notes||"",icon:this.iconId,labels:[...this.labels]},this.suspended?{suspended:!0,since:Z(this.since)}:{references:G(this.references),messagingAddress:this.messagingAddress,pictures:[...this.pictureIds]})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.id=L(t.id),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.suspended=!!t.suspended,this.since=_(t.since),this.references=Y(t.references||{}),this.labels=[...t.labels||[]],this.iconId=L(t.icon),this.pictureIds=(t.pictures||[]).map(L),this.messagingAddress=t.messagingAddress||""),s}getKey(){return this.id.toString()}suspended=!1;since=_()}class Hi extends Fi{get general(){return super.general}get contactId(){return this.general.contactId}set contactId(t){this.general.contactId=t}get contact(){return this.general.contact}set contact(t){this.general.contact=t}}class Gi extends Fi{get general(){return super.general}get serial(){return this.general.serial}set serial(t){this.general.serial=t}get plate(){return this.general.plate}set plate(t){this.general.plate=t}get make(){return this.general.make}set make(t){this.general.make=t}get model(){return this.general.model}set model(t){this.general.model=t}get year(){return this.general.year}set year(t){this.general.year=t}get colour(){return this.general.colour}set colour(t){this.general.colour=t}}class qi extends Fi{get general(){return super.general}get advanced(){return super.advanced}get plate(){return this.general.plate}get vin(){return this.general.vin}set vin(t){this.general.vin=t}get make(){return this.general.make}set make(t){this.general.make=t}get model(){return this.general.model}set model(t){this.general.model=t}get year(){return this.general.year}set year(t){this.general.year=t}get colour(){return this.general.colour}set colour(t){this.general.colour=t}get engineHours(){return this.advanced.engineHours}set engineHours(t){this.advanced.engineHours=t}toJSON(){return U(super.toJSON(),{plate:this.plate||"",vin:this.vin||"",make:this.make||"",model:this.model||"",year:this.year||0,colour:this.colour||"",engineHours:this.engineHours||0})}}class Fi extends Pe{static fromJSON(t){switch(t.kind){case Ni.person:return new Hi(t);case Ni.vehicle:return new qi(t);case Ni.trailer:return new Gi(t);default:return new Fi(t)}}get pieces(){return[this.#e,this.#s,this.#i]}get id(){return this.#e.id??this.#s.id??this.#i.id}get companyId(){return this.#e.companyId??this.#s.companyId??this.#i.companyId}get company(){return this.#e.company??this.#s.company??this.#i.company}get kind(){return this.#e.kind}#e=new Ki;get general(){return this.#e}get name(){return this.#e.name}set name(t){this.#e.name=t}get notes(){return this.#e.notes}set notes(t){this.#e.notes=t}get iconId(){return this.#e.iconId}set iconId(t){this.#e.iconId=t}get icon(){return this.#e.icon}set icon(t){this.#e.icon=t}get labels(){return this.#e.labels}set labels(t){this.#e.labels=t}get pictureIds(){return this.#e.pictureIds}set pictureIds(t){this.#e.pictureIds=t}get pictures(){return this.#e.pictures}set pictures(t){this.#e.pictures=t}get messagingAddress(){return this.#e.messagingAddress}set messagingAddress(t){this.#e.messagingAddress=t}get references(){return this.#e.references}set references(t){this.#e.references=t}#s=new zi;get advanced(){return this.#s}get position(){return this.#s.position}set position(t){this.#s.position=t}get odometer(){return this.#s.odometer}set odometer(t){this.#s.odometer=t}get tags(){return this.#s.tags}set tags(t){this.#s.tags=t}get attributes(){return this.#s.attributes}set attributes(t){this.#s.attributes=t}get providerIds(){return this.#s.providerIds}get providers(){return this.#s.providers}get relationshipIds(){return this.#s.relationshipIds}set relationshipIds(t){this.#s.relationshipIds=t}get relationships(){return this.#s.relationships}set relationships(t){this.#s.relationships=t}get places(){return this.#s.places}set places(t){this.#s.places=t}#i=new _i;get dispatch(){return this.#i}toJSON(){return this.#e.suspended?this.#e.toJSON():U({id:this.id||null,v:this.v,company:this.companyId},this.#e.toJSON(),this.#s.toJSON(),this.#i.toJSON())}fromJSON(t,e){const s=this.#e.fromJSON(U({v:t.v.slice(0,1)},t),e),i=this.#s.fromJSON(U({v:t.v.slice(1,2)},t),e),n=this.#i.fromJSON(U({v:t.v.slice(2,3)},t),e);return s||i||n}getKey(){return this.id.toString()}get suspended(){return this.#e.suspended}get since(){return this.#e.since}}!function(t){t.boolean="boolean",t.number="number",t.text="text",t.json="json"}(vi||(vi={}));class Wi{static fromJSON(t){return new Wi(t.kind||t.type,t.value,t.notes,t.context)}kind;value;notes;context;constructor(t,e,s,i){this.kind=vi[t]||vi.text,this.value=e||"",this.notes=s||"",this.context=i||""}toJSON(){return{kind:vi[this.kind]||vi.text,value:this.value||"",notes:this.notes||"",context:this.context||""}}}!function(t){t.log="log",t.info="info",t.warn="warn",t.err="err"}(wi||(wi={}));!function(t){t.CAD="CAD",t.USD="USD",t.EURO="EURO"}(Si||(Si={})),function(t){t.monthly="monthly",t.quarterly="quarterly",t.annually="annually"}(Ii||(Ii={}));class Yi{static fromJSON(t){return new Yi(t.limit,t.amount)}limit=NaN;amount=NaN;constructor(t,e){this.limit=L(t),this.amount=h(e)}toJSON(){return{limit:Q(this.limit),amount:Q(this.amount)}}}class $i extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}profileId=NaN;get profile(){return Nt.get(this.profileId)}name="";notes="";reference="";sku="";start=_();end=_();amount=NaN;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,profile:this.profileId,name:this.name||"",notes:this.notes||"",reference:this.reference||"",sku:this.sku||"",start:Z(this.start),end:Z(this.end),amount:Q(this.amount)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.profileId=L(t.profile),this.name=t.name||"",this.notes=t.notes||"",this.reference=t.reference||"",this.sku=t.sku||"",this.start=_(t.start),this.end=_(t.end),this.amount=h(t.amount)),s}getKey(){return this.id.toString()}}class Zi extends $i{limit=NaN;targets=null;suspended=!1;toJSON(){return U(super.toJSON(),{limit:Q(this.limit),targets:gi.stringify(this.targets),suspended:!!this.suspended})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.limit=h(t.limit),this.targets=gi.parse(t.targets),this.suspended=!!t.suspended),s}}!function(t){t.smartwitness="smartwitness",t.bewhere="bewhere",t.calamp="calamp"}(bi||(bi={}));!function(t){t.mobile="mobile",t.vehicle="vehicle",t.asset="asset",t.dispatch="dispatch",t.elogs="elogs",t.inventory="inventory",t.cargo="cargo",t.forms="forms",t.streetview="streetview"}(Oi||(Oi={}));!function(t){t.unknown="unknown",t.airlink="airlink",t.bluetree="bluetree",t.genx="genx",t.lmu="lmu",t.ttu="ttu",t.spiderAT="spiderAT",t.spiderMT="spiderMT",t.mobile="mobile",t.datatrans="datatrans",t.xirgo="xirgo",t.lbs="lbs",t.titan="titan",t.concox="concox",t.aspenta="aspenta",t.json="json",t.smartwitness="smartwitness",t.calamp="calamp",t.enfora="enfora",t.bewhere="bewhere",t.atrack="atrack",t.teltonika="teltonika"}(ki||(ki={}));class Qi{static fromJSON(t){return new Qi(t.provider,t.kind,t.name,t.notes,t.created,t.deleted,t.phoneNumber,t.firmware,t.billableDays,t.cost,t.total)}providerId="";get provider(){return Dt.get(this.providerId)}set provider(t){this.providerId=t?.id}kind;name="";notes="";created=_();deleted=_();phoneNumber=NaN;firmware="";billableDays=NaN;cost=NaN;total=NaN;constructor(t,e,s,i,n,r,a,o,d,l,c){this.providerId=t||"",this.kind=ki[e]||ki.unknown,this.name=s||"",this.notes=i||"",this.created=_(n),this.deleted=_(r),this.phoneNumber=K(a),this.firmware=o||"",this.billableDays=h(d),this.cost=h(l),this.total=h(c)}toJSON(){return{provider:this.providerId,kind:ki[this.kind]??ki.unknown,name:this.name||"",notes:this.notes||"",created:Z(this.created),deleted:Z(this.deleted),phoneNumber:Q(this.phoneNumber),firmware:this.firmware||"",billableDays:Q(this.billableDays),cost:Q(this.cost),total:Q(this.total)}}}class Xi{static fromJSON(t){return new Xi(t.asset,t.kind,t.name,t.notes,t.created,t.deleted,t.suspended,t.restored,t.revived,t.labels,t.providers,t.phoneNumbers,t.updatedDts,t.billableDays,t.cost,t.suspendedDays,t.suspendedCost,t.total)}assetId=NaN;get asset(){return mt.get(this.assetId)}set asset(t){this.assetId=t?.id||NaN}kind=Ni.asset;name="";notes="";created=_();deleted=_();suspended=_();restored=_();revived=_();labels=[];providerIds=[];get providers(){return rt(Dt,this.providerIds)}set providers(t){this.providerIds=t?.map((t=>t.id))??[]}phoneNumbers=[];updatedDts=_();billableDays=NaN;cost=NaN;suspendedDays=NaN;suspendedCost=NaN;total=NaN;constructor(t,e,s,i,n,r,a,o,d,l,c,u,m,p,g,f,y,N){this.assetId=L(t),this.kind=Ni[e]||Ni.asset,this.name=s||"",this.notes=i||"",this.created=_(n),this.deleted=_(r),this.suspended=_(a),this.restored=_(o),this.revived=_(d),this.labels=l?.map(nt)??[],this.providerIds=c||[],this.phoneNumbers=u?.map(K)??[],this.updatedDts=_(m),this.billableDays=h(p),this.cost=h(g),this.suspendedDays=h(f),this.suspendedCost=h(y),this.total=h(N)}toJSON(){return{asset:Q(this.assetId),kind:Ni[this.kind]||null,name:this.name||"",notes:this.notes||"",created:Z(this.created),deleted:Z(this.deleted),suspended:Z(this.suspended),restored:Z(this.restored),revived:Z(this.revived),labels:[...this.labels],providers:[...this.providerIds],phoneNumbers:[...this.phoneNumbers],revupdatedDtsived:Z(this.updatedDts),billableDays:this.billableDays||0,cost:this.cost||0,suspendedDays:this.suspendedDays||0,suspendedCost:this.suspendedCost||0,total:this.total||0}}}class tn{static fromJSON(t){return new tn(t.target,t.services?.map(Xi.fromJSON),t.licenses?.map(Qi.fromJSON))}targetId=NaN;get target(){return ot.get(this.targetId)}services=[];licenses=[];constructor(t,e,s){this.targetId=L(t),this.services=[...e||[]],this.licenses=[...s||[]]}toJSON(){return{target:Q(this.targetId),services:[...this.services||[]],licenses:[...this.licenses||[]]}}}!function(t){t.created="created",t.queued="queued",t.running="running",t.completed="completed",t.failed="failed"}(xi||(xi={}));class en{static fromJSON(t){return new en(t.sku,t.cost,t.count,t.total)}sku="";cost=NaN;count=NaN;total=NaN;constructor(t,e,s,i){this.sku=t||"",this.cost=h(e),this.count=L(s),this.total=h(i)}toJSON(){return{sku:this.sku||"",cost:Q(this.cost),count:Q(this.count),total:Q(this.total)}}}class sn{static fromJSON(t){return new sn(t.target,t.parent,t.name,t.notes,t.hosting?.map(en.fromJSON))}targetId=NaN;get target(){return ot.get(this.targetId)}parentId=NaN;get parent(){return ot.get(this.parentId)}name="";notes="";hosting=[];constructor(t,e,s,i,n){this.targetId=L(t),this.parentId=L(e),this.name=s||"",this.notes=i||"",this.hosting=[...n||[]]}toJSON(){return{target:Q(this.targetId),parent:Q(this.parentId),name:this.name||"",notes:this.notes||"",hosting:this.hosting?.map(i)??[]}}}class nn{static fromJSON(t){return new nn(t.fill,t.stroke)}fill="";stroke="";constructor(t,e){this.fill=t||"",this.stroke=e||""}toJSON(){return{fill:this.fill||"",stroke:this.stroke||""}}}class rn extends a{id=NaN;parentId=NaN;get parent(){return ot.get(this.parentId)}employees=new Map;toJSON(){return{id:Q(this.id),v:this.v,parent:this.parentId,directory:G(this.employees)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.parentId=L(t.parent),this.employees=Y(t.directory||{})),s}getKey(){return this.id.toString()}}class an extends a{id=NaN;parentId=NaN;get parent(){return ot.get(this.parentId)}name="";notes="";references=new Map;toJSON(){return{id:Q(this.id),v:this.v,parent:this.parentId,name:this.name,notes:this.notes,references:G(this.references)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.parentId=L(t.parent),this.name=t.name||"",this.notes=t.notes||"",this.references=Y(t.references||{})),s}getKey(){return this.id.toString()}}!function(t){t.never="never",t.days="days",t.sessions="sessions"}(Ji||(Ji={}));class on{static fromJSON(t){return new on(t.minimumLength,t.includeLetters,t.includeNumbers,t.includeUpperLower,t.includeSpecial,t.expireMode,t.expireThreshold)}minimumLength;includeLetters;includeNumbers;includeUpperLower;includeSpecial;expireMode;expireThreshold;constructor(t,e,s,i,n,r,a){this.minimumLength=L(t),this.includeLetters=!!e,this.includeNumbers=!!s,this.includeUpperLower=!!i,this.includeSpecial=!!n,this.expireMode=Ji[r]??Ji.never,this.expireThreshold=L(a)}toJSON(){return{minimumLength:Q(this.minimumLength),includeLetters:!!this.includeLetters,includeNumbers:!!this.includeNumbers,includeUpperLower:!!this.includeUpperLower,includeSpecial:!!this.includeSpecial,expireMode:this.expireMode,expireThreshold:Q(this.expireThreshold)}}}!function(t){t.allow="allow",t.deny="deny",t.replace="replace"}(Ti||(Ti={}));class hn{static fromJSON(t){return new hn(t.applications,t.ipv4Ranges,t.multiUser,t.idleAllowed,t.expireTimeout,t.maxSessions)}applications;ipv4Ranges;multiUser;idleAllowed;expireTimeout;maxSessions;constructor(t,e,s,i,n,r){this.applications=[...t||[]],this.ipv4Ranges=[...e||[]],this.multiUser=Ti[s]||Ti.allow,this.idleAllowed=!!i,this.expireTimeout=L(n)||0,this.maxSessions=L(r)||0}toJSON(){return{applications:[...this.applications],ipv4Ranges:[...this.ipv4Ranges],multiUser:Ti[this.multiUser]||Ti.allow,idleAllowed:!!this.idleAllowed,expireTimeout:Q(this.expireTimeout),maxSessions:Q(this.maxSessions)}}}class dn extends a{id=NaN;parentId=NaN;get parent(){return ot.get(this.parentId)}sessionPolicy=new hn;passwordPolicy=new on;toJSON(){return{id:Q(this.id),v:this.v,parent:this.parentId,sessionPolicy:this.sessionPolicy?.toJSON()??null,passwordPolicy:this.passwordPolicy?.toJSON()??null}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.parentId=L(t.parent),this.sessionPolicy=new hn(t.sessionPolicy),this.passwordPolicy=new on(t.passwordPolicy)),s}getKey(){return this.id.toString()}}!function(t){t.IMAP="IMAP",t.POP3="POP3"}(Ci||(Ci={})),function(t){t.SMTP="SMTP"}(Ui||(Ui={}));class ln{static fromJSON(t){return new ln(t.incomingType,t.incomingAddress,t.incomingPort,t.incomingLogin,t.incomingSecure,t.incomingMessageNumber,t.outgoingType,t.outgoingAddress,t.outgoingPort,t.outgoingLogin,t.outgoingSecure,t.outgoingReplyTo)}incomingType=Ci.IMAP;incomingAddress="";incomingPort=NaN;incomingLogin="";incomingSecure=!1;incomingMessageNumber=NaN;outgoingType=Ui.SMTP;outgoingAddress="";outgoingPort=NaN;outgoingLogin="";outgoingSecure=!1;outgoingReplyTo="";constructor(t,e,s,i,n,r,a,o,h,d,l,c){this.incomingType=Ci[t]||Ci.IMAP,this.incomingAddress=e||"",this.incomingPort=L(s),this.incomingLogin=i||"",this.incomingSecure=!!n,this.incomingMessageNumber=L(r),this.outgoingType=Ui[a]||Ui.SMTP,this.outgoingAddress=o||"",this.outgoingPort=L(h),this.outgoingLogin=d||"",this.outgoingSecure=!!l,this.outgoingReplyTo=c||""}toJSON(){return{incomingType:Ci[this.incomingType]||Ci.IMAP,incomingAddress:this.incomingAddress||"",incomingPort:Q(this.incomingPort),incomingLogin:this.incomingLogin||"",incomingSecure:!!this.incomingSecure,incomingMessageNumber:Q(this.incomingMessageNumber),outgoingType:Ui[this.outgoingType]||Ui.SMTP,outgoingAddress:this.outgoingAddress||"",outgoingPort:Q(this.outgoingPort),outgoingLogin:this.outgoingLogin||"",outgoingSecure:!!this.outgoingSecure,outgoingReplyTo:this.outgoingReplyTo||""}}}class cn{static fromJSON(t){return new cn(t.notifyLimit,Y(t.phoneNumbers||{}))}notifyLimit=NaN;phoneNumbers=new Map;constructor(t,e){this.notifyLimit=L(t),this.phoneNumbers=e??new Map}toJSON(){return{notifyLimit:Q(this.notifyLimit),phoneNumbers:G(this.phoneNumbers)}}}class un extends a{id=NaN;parentId=NaN;get parent(){return ot.get(this.parentId)}contactInfo=new Map;serviceName="";logo="";icon="";favourite="";domain="";website=new Map;graphics=new Map;languages=[];gamut=new Map;notifyEmail=new ln;notifySms=new cn;termsPreamble="";termsUpdated=_();recoverSubject="";recoverBody="";recoverIsHtml=!1;toJSON(){return{id:Q(this.id),v:this.v,parent:this.parentId,contactInfo:G(this.contactInfo),serviceName:this.serviceName||"",logo:this.logo||"",icon:this.icon||"",favourite:this.favourite||"",domain:this.domain||"",website:G(this.website),graphics:G(this.graphics),languages:[...this.languages],gamut:G(this.gamut),notifyEmail:this.notifyEmail.toJSON(),notifySms:this.notifySms.toJSON(),termsPreamble:this.termsPreamble||"",termsUpdated:this.termsUpdated.valueOf()?this.termsUpdated.toISOString():null,recoverSubject:this.recoverSubject||"",recoverBody:this.recoverBody||"",recoverIsHtml:!!this.recoverIsHtml}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.parentId=L(t.parent),this.contactInfo=W(t.contactInfo||{},((t,e)=>[t,L(e)])),this.serviceName=t.serviceName||"",this.logo=t.logo||"",this.icon=t.icon||"",this.favourite=t.favourite||"",this.domain=t.domain||t.URN||t.urn||"",this.website=Y(t.website||{}),this.graphics=Y(t.graphics||{}),this.gamut=W(t.gamut||{},((t,e)=>[t,nn.fromJSON(e)])),this.languages=[...t.languages||[]],this.notifyEmail=ln.fromJSON(t.notifyEmail),this.notifySms=cn.fromJSON(t.notifySms),this.termsPreamble=t.termsPreamble||"",this.termsUpdated=_(t.termsUpdated),this.recoverSubject=t.recoverSubject||"",this.recoverBody=t.recoverBody||"",this.recoverIsHtml=!!t.recoverIsHtml),s}getKey(){return this.id.toString()}}class mn{static fromJSON(t){return new mn(t.name,t.fill,t.stroke,t.graphic,t.notes)}name="";fill="";stroke="";graphic="";notes="";get code(){return nt(this.name)}constructor(t,e,s,i,n){this.name=t||"",this.fill=e||"",this.stroke=s||"",this.graphic=i||"",this.notes=n||""}toJSON(){return{name:this.name,notes:this.notes,fill:this.fill,stroke:this.stroke,graphic:this.graphic}}}class pn extends a{id=NaN;parentId=NaN;get parent(){return ot.get(this.parentId)}labels=new Map;tags=new Map;toJSON(){return{id:Q(this.id),v:this.v,parent:this.parentId,labels:F(this.labels),tags:F(this.tags)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.parentId=L(t.parent),this.labels=W(t.labels,gn),this.tags=W(t.tags,gn)),s}getKey(){return this.id.toString()}}function gn(t,e){return[nt(t),new mn(e)]}!function(t){t.standby="standby",t.low="low",t.medium="medium",t.high="high",t.urgent="urgent"}(Mi||(Mi={}));class fn{static fromJSON(t){return new fn(t.updated,t.latlng)}updated=_();latlng;constructor(t,e){this.updated=_(t),this.latlng=e?ii.fromJSON(e):null}toJSON(){return{updated:Z(this.updated),latlng:this.latlng?.toJSON()??null}}}!function(t){t.pending="pending",t.onRoute="onRoute",t.arrived="arrived",t.completed="completed"}(Di||(Di={}));class yn{static fromJSON(t){return new yn(t.id,t.name||"",W(t.states||{},((t,e)=>[t,fn.fromJSON(e)])),t.eta,t.duration,t.place,t.address,t.latlng,t.notes,t.signature,t.signatory)}id=NaN;name="";get status(){let t=Di.pending,e=_(0);for(let[s,i]of this.states)i.updated>e&&(t=s,e=i.updated);return t}get updated(){let t=_(0);for(let[e,s]of this.states)s.updated>t&&(t=s.updated);return t}states=new Map;eta=_();duration=new Be;get timeOnSite(){return this.duration.totalSeconds??0}set timeOnSite(t){this.duration=Be.fromSeconds(t)}placeId=NaN;get place(){return Mt.get(this.placeId)}set place(t){this.placeId=t?.id??NaN}address="";latlng;notes="";signature=!1;signatory="";constructor(t,e,s,i,n,r,a,o,h,d,l){this.id=L(t),this.address=a||"",this.duration=new Be(n),this.eta=_(i),this.latlng=o?ii.fromJSON(o):null,this.name=e||"",this.notes=h||"",this.placeId=L(r),this.signature=!!d,this.signatory=l||"",this.states=s??new Map}toJSON(){return{id:this.id||null,address:this.address||"",duration:this.duration.toString()??null,eta:this.eta.toISOString(),latlng:this.latlng?.toJSON()??null,name:this.name||"",notes:this.notes||"",place:this.placeId||null,signature:!!this.signature,signatory:this.signatory||"",states:F(this.states)}}}class Nn extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}assetId=NaN;get asset(){return mt.get(this.assetId)}set asset(t){this.assetId=t?.id||NaN}name="";references=new Map;instructions="";formIds=[];get forms(){return rt(xt,this.formIds)}set forms(t){this.formIds=t?.map(s)??[]}priority=Mi.medium;labels=[];tags=[];steps=[];created=_();driver="";toJSON(){return{id:this.id||null,company:this.companyId||null,v:this.v,driver:this.driver||"",created:Z(this.created),name:this.name||"",instructions:this.instructions||"",priority:this.priority||Mi.standby,references:G(this.references),labels:[...this.labels],tags:this.tags||[],forms:[...this.formIds],steps:(this.steps||[]).map(i)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.created=_(t.created),this.assetId=L(t.asset)||NaN,this.driver=t.driver||"",this.name=t.name||"",this.instructions=t.instructions||"",this.priority=Mi[t.priority]||Mi.standby,this.references=Y(t.references),this.labels=[...t.labels||[]],this.tags=[...t.tags||[]],this.formIds=(t.forms||[]).map(L),this.steps=(t.steps||[]).map((t=>new yn(t)))),s}getKey(){return this.id.toString()}}!function(t){t.created="created",t.queued="queued",t.onRoute="onRoute",t.arrived="arrived",t.completed="completed",t.cancelled="cancelled",t.pickedUp="pickedUp",t.droppedOff="droppedOff",t.waiting="waiting",t.damaged="damaged",t.unsuccessful="unsuccessful"}(Ei||(Ei={}));class vn extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}assetId=NaN;get asset(){return mt.get(this.assetId)}set asset(t){this.assetId=t?.id||NaN}name="";references=new Map;placeId=NaN;get place(){return Mt.get(this.placeId)}set place(t){this.placeId=t?.id||NaN}address="";latlng=ii.INVALID;status=Ei.created;created=_();eta=_();duration=new Be;arrived=_();completed=_();instructions="";signature=!1;signatory="";notes="";attachmentIds=[];get attachments(){return rt(Ot,this.attachmentIds)}set attachments(t){this.attachmentIds=t?.map(s)??[]}updatedBy="";updatedUtc=_();toJSON(){return{id:this.id||null,company:this.companyId||null,asset:this.assetId||null,v:this.v,name:this.name||"",references:G(this.references),place:this.placeId||null,address:this.address||"",latlng:this.latlng.toJSON(),status:Ei[this.status]||null,created:Z(this.created),eta:Z(this.eta),duration:this.duration.toString(),arrived:Z(this.arrived),completed:Z(this.completed),instructions:this.instructions||"",signature:!!this.signature,signatory:this.signatory||"",notes:this.notes||"",attachments:[...this.attachmentIds],updatedBy:this.updatedBy||"",updatedUtc:Z(this.updatedUtc)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.assetId=L(t.asset),this.name=t.name||"",this.references=Y(t.references),this.placeId=L(t.place),this.address=t.address||"",this.latlng=t.latlng?ii.fromJSON(t.latlng):ii.INVALID,this.status=Ei[t.status]||Ei.created,this.created=_(t.created),this.eta=_(t.eta),this.duration=new Be(t.duration),this.arrived=_(t.arrived),this.completed=_(t.completed),this.instructions=t.instructions||"",this.signature=!!t.signature,this.signatory=t.signatory||"",this.notes=t.notes||"",this.attachmentIds=(t.attachments||[]).map(L),this.updatedBy=t.updatedBy||"",this.updatedUtc=_(t.updatedUtc)),s}getKey(){return this.id.toString()}}!function(t){t.text="text",t.choice="choice",t.dropdown="dropdown",t.checkbox="checkbox",t.toggle="toggle",t.numeric="numeric",t.range="range",t.distance="distance",t.area="area",t.temperature="temperature",t.weight="weight",t.volume="volume",t.pressure="pressure",t.speed="speed",t.fuelEconomy="fuelEconomy",t.currency="currency",t.datetime="datetime",t.date="date",t.time="time",t.duration="duration",t.signature="signature",t.pictures="pictures",t.files="files",t.timezone="timezone"}(Pi||(Pi={}));class wn extends Dn{static DEFAULT_CHOICES=["true","false",""];static parseChoices(t){return(t??[]).concat([null,null,null]).slice(0,3).map(((t,e)=>t?.trim()??wn.DEFAULT_CHOICES[e]))}get supported(){return[Pi.checkbox,Pi.toggle]}choices;constructor(t,e,s,i,n,r,a,o){super(t,e,s,n,r,a,o),this.choices=wn.parseChoices(i)}toJSON(){return U(super.toJSON(),{choices:[...this.choices]})}isValid(t){return wn.parseChoices(this.choices).slice(0,this.required?2:3).includes(String(t??"").trim())}}const Sn=/(?<!\\),/;class In extends Dn{static splitValues(t){return t?.split(Sn).map((t=>t.trim().replaceAll("\\,",",")))??[]}static escapeValue(t){return(t=t?.trim())?.replaceAll(",","\\,")}get supported(){return[Pi.choice,Pi.dropdown]}choices;minimum;maximum;constructor(t,e,s,i,n,r,a,o,h,d){super(t,e,s,a,o,h,d),this.choices=i??new Map,this.minimum=L(n),this.maximum=L(r)}toJSON(){return U(super.toJSON(),{choices:G(this.choices),minimum:Q(this.minimum),maximum:Q(this.maximum)})}isValid(t){const e=In.splitValues(t),s=[...this.choices.values()];return e.length>0&&(!A(this.minimum)||this.minimum<=e.length)&&(!A(this.maximum)||this.maximum>=e.length)&&e.filter((t=>s.includes(t))).length==e.length}}class bn extends Dn{get supported(){return[Pi.date,Pi.datetime]}minimum;maximum;constructor(t,e,s,i,n,r,a,o,h){super(t,e,s,r,a,o,h),this.minimum=_(i),this.maximum=_(n)}toJSON(){return U(super.toJSON(),{minimum:Z(this.minimum),maximum:Z(this.maximum)})}isValid(t){let e=_(t),s=A(e.valueOf()),i=_(this.minimum),n=_(this.maximum);return s&&this.kind==Pi.date&&(e=new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=new Date(i.getFullYear(),i.getMonth(),i.getDate()),n=new Date(n.getFullYear(),n.getMonth(),n.getDate())),s&&(!A(i.valueOf())||i<=e)&&(!A(n.valueOf())||n>=e)}}var On;!function(t){t.small="small",t.medium="medium",t.large="large"}(On||(On={}));class kn extends Dn{get supported(){return[Pi.numeric,Pi.range,Pi.distance,Pi.area,Pi.temperature,Pi.weight,Pi.volume,Pi.pressure,Pi.speed,Pi.fuelEconomy,Pi.currency]}size;precision;step;units;minimum;maximum;constructor(t,e,s,i,n,r,a,o,d,l,c,u,m){super(t,e,s,l,c,u,m),this.size=On[i]??On.medium,this.precision=L(n),this.step=h(r),this.units=a||"",this.minimum=h(o),this.maximum=h(d)}toJSON(){return U(super.toJSON(),{size:On[this.size]??On.medium,precision:Q(this.precision),step:Q(this.step),units:this.units||"",minimum:Q(this.minimum),maximum:Q(this.maximum)})}isValid(t){let e=this.minimum,s=this.maximum,i=h(t),n=A(i);return n&&(i=R(i,this.precision),A(e)&&(e=R(e,this.precision)),A(s)&&(s=R(s,this.precision))),n&&(!A(e)||e<=i)&&(!A(s)||s>=i)}}class xn extends Dn{get supported(){return[Pi.signature]}constructor(t,e,s,i,n,r){super(t,e,Pi.signature,s,i,n,r)}isValid(t){return!!String(t??"").trim()}}class Jn extends Dn{get supported(){return[Pi.text]}rows;minimum;maximum;constructor(t,e,s,i,n,r,a,o,d){super(t,e,Pi.text,r,a,o,d),this.rows=L(s),this.minimum=h(i),this.maximum=h(n)}toJSON(){return U(super.toJSON(),{rows:Q(this.rows),minimum:Q(this.minimum),maximum:Q(this.maximum)})}isValid(t){return!!(t=String(t??"").trim())&&(!A(this.minimum)||this.minimum<=t.length)&&(!A(this.maximum)||this.maximum>=t.length)}}const Tn=Be.fromDays(0),Cn=Be.fromDays(1);class Un extends Dn{get supported(){return[Pi.time,Pi.duration]}minimum;maximum;constructor(t,e,s,i,n,r,a,o,h){super(t,e,s,r,a,o,h),this.minimum=i||A(i)?new Be(i):null,this.maximum=n||A(n)?new Be(n):null}toJSON(){return U(super.toJSON(),{minimum:A(this.minimum?.valueOf())?this.minimum.toString():null,maximum:A(this.maximum?.valueOf())?this.maximum.toString():null})}isValid(t){let e=!!t||!D(t),s=new Be(t),i=this.minimum,n=this.maximum;return e&&this.kind==Pi.time&&((!A(i?.valueOf())||i<Tn)&&(i=Tn),(!A(n?.valueOf())||n>Cn)&&(n=Cn)),e&&(!A(i?.valueOf())||i<=s)&&(!A(n?.valueOf())||n>=s)}}class Mn extends Dn{get supported(){return[Pi.timezone]}constructor(t,e,s,i,n,r){super(t,e,Pi.timezone,s,i,n,r)}isValid(t){return!!Wt(t)}}class Dn{static fromJSON(t){switch(t.kind){case Pi.text:return new Jn(t.id,t.name,t.rows,t.minimum,t.maximum,t.notes,t.required,t.value,t.editable);case Pi.choice:case Pi.dropdown:return new In(t.id,t.name,t.kind,Y(t.choices),t.minimum,t.maximum,t.notes,t.required,t.value,t.editable);case Pi.checkbox:case Pi.toggle:return new wn(t.id,t.name,t.kind,t.choices,t.notes,t.required,t.value,t.editable);case Pi.area:case Pi.numeric:case Pi.range:case Pi.distance:case Pi.temperature:case Pi.weight:case Pi.volume:case Pi.pressure:case Pi.speed:case Pi.fuelEconomy:case Pi.currency:return new kn(t.id,t.name,t.kind,t.size,t.precision,t.step,t.units,t.minimum,t.maximum,t.notes,t.required,t.value,t.editable);case Pi.datetime:case Pi.date:return new bn(t.id,t.name,t.kind,t.minimum,t.maximum,t.notes,t.required,t.value,t.editable);case Pi.duration:case Pi.time:return new Un(t.id,t.name,t.kind,t.minimum,t.maximum,t.notes,t.required,t.value,t.editable);case Pi.signature:return new xn(t.id,t.name,t.notes,t.required,t.value,t.editable);case Pi.pictures:case Pi.files:return new En(t.id,t.name,t.kind,t.minimum,t.maximum,t.notes,t.required,t.value,t.editable);case Pi.timezone:return new Mn(t.id,t.name,t.notes,t.required,t.value,t.editable);default:throw new Error("kind unsupported")}}get supported(){throw new Error("getter not implemented.")}kind;id;name;notes;required;value;editable;constructor(t,e,s,i,n,r,a){if(this.id=L(t),this.kind=Pi[s],this.name=e||"",this.notes=i||"",this.required=!!n,this.value=r??null,this.editable=!!a,!this.supported.includes(this.kind))throw new Error(`kind "${this.kind||""}" is not supported by this field type.`)}toJSON(){return{id:this.id||null,kind:this.kind,name:this.name||"",notes:this.notes||"",required:!!this.required,value:this.value??null,editable:!!this.editable}}}class En extends Dn{static splitValues(t){return t?.split(",").map((t=>t.trim()))??[]}get supported(){return[Pi.pictures,Pi.files]}minimum;maximum;constructor(t,e,s,i,n,r,a,o,h){super(t,e,s,r,a,o,h),this.minimum=L(i),this.maximum=L(n)}toJSON(){return U(super.toJSON(),{minimum:Q(this.minimum),maximum:Q(this.maximum)})}isValid(t){const e=En.splitValues(t);return e.length>0&&(!A(this.minimum)||this.minimum<=e.length)&&(!A(this.maximum)||this.maximum>=e.length)&&e.every((function(t){return A(L(t))}))}}class Pn{bytes;size;providerId;get provider(){return Dt.get(this.providerId)}companyId;get company(){return ot.get(this.companyId)}assetId;get asset(){return mt.get(this.assetId)}camera;latitude;longitude;speed;heading;altitude;constructor(t,e,s,i,n,r,a,o,d,l,c){this.bytes=L(t),this.size=e?$s.fromJSON(e):new $s(0,0),this.providerId=s||"",this.companyId=L(i),this.assetId=L(n),this.camera=L(r),this.latitude=h(a),this.longitude=h(o),this.speed=h(d),this.heading=h(l),this.altitude=h(c)}toJSON(){return{bytes:Q(this.bytes),size:this.size.toJSON(),provider:this.providerId||"",company:Q(this.companyId),asset:Q(this.assetId),camera:Q(this.camera),latitude:Q(this.latitude),longitude:Q(this.longitude),speed:Q(this.speed),heading:Q(this.heading),altitude:Q(this.altitude)}}}var An,Rn,zn;!function(t){t.unknown="unknown",t.image="image",t.video="video"}(An||(An={}));class Ln extends Pn{static fromJSON(t){return new Ln(t.bytes,t.size,t.provider,t.company,t.asset,t.camera,t.latitude,t.longitude,t.speed,t.heading,t.altitude,t.guid,t.kind,t.fps,t.start,t.end,t.eventName)}guid;kind;fps;start;end;get duration(){return new Be(this.end-this.start)}eventName;constructor(t,e,s,i,n,r,a,o,d,l,c,u,m,p,g,f,y){super(t,e,s,i,n,r,a,o,d,l,c),this.guid=u||"",this.kind=An[m]||An.unknown,this.fps=h(p),this.start=_(g),this.end=_(f),this.eventName=y||""}toJSON(){return U(super.toJSON(),{guid:this.guid||"",kind:An[this.kind]||An.unknown,fps:Q(this.fps),start:Z(this.start),end:Z(this.end),eventName:this.eventName||""})}getKey(){return this.guid.toString()}}class _n extends Pn{static fromJSON(t){return new _n(t.bytes,t.size,t.provider,t.company,t.asset,t.camera,t.latitude,t.longitude,t.speed,t.heading,t.altitude,t.dts)}kind=An.image;dts;constructor(t,e,s,i,n,r,a,o,h,d,l,c){super(t,e,s,i,n,r,a,o,h,d,l),this.dts=_(c)}toJSON(){return U(super.toJSON(),{kind:An.image,dts:Z(this.dts)})}getKey(){return(Q(this.assetId)??0)+"-"+this.providerId+"-"+this.camera}}class Bn{static fromJSON(t){return new Bn(t.anchor,t.align,t.colour)}anchor;align;colour;constructor(t,e,s){this.anchor=Xs.fromJSON(t),this.align=e||"right top",this.colour=s||"#cccccc"}toJSON(){return{align:this.align||"",anchor:this.anchor.toJSON(),colour:this.colour||""}}}!function(t){t.fills="fills",t.shadows="shadows",t.outlines="outlines",t.markers="markers",t.labels="labels",t.drawings="drawings",t.edits="edits"}(Rn||(Rn={}));class Vn{static fromJSON(t){return new Vn(t.tags,t.src,t.size,t.anchor,t.layer,t.zIndex,t.rotates)}tags;src;size;anchor;layer;zIndex;rotates;constructor(t,e,s,i,n,r,a){this.tags=[...t||[]],this.src=e||"",this.size=$s.fromJSON(s),this.anchor=Xs.fromJSON(i),this.layer=Rn[n]||Rn.markers,this.zIndex=L(r)||0,this.rotates=!!a}toJSON(){return{tags:[...this.tags],src:this.src||"",size:this.size.toJSON(),anchor:this.anchor.toJSON(),layer:Rn[this.layer]||Rn.markers,zIndex:Q(this.zIndex),rotates:!!this.rotates}}}class jn{static fromJSON(t){return new jn(t.asset,t.date,t.odometer,t.engineHours,t.lastJob)}assetId;get asset(){return mt.get(this.assetId)}date;odometer;engineHours;lastJobId;get lastJob(){return Ut.get(this.lastJobId)}constructor(t,e,s,i,n){this.assetId=L(t),this.date=_(e),this.odometer=h(s),this.engineHours=h(i),this.lastJobId=L(n)}toJSON(){return{asset:this.assetId||null,date:Z(this.date),odometer:this.odometer||0,engineHours:this.engineHours||0,lastJob:this.lastJobId||null}}}!function(t){t.pending="pending",t.pastdue="pastdue",t.completed="completed",t.cancelled="cancelled"}(zn||(zn={}));var Kn,Hn,Gn,qn,Fn,Wn,Yn,$n,Zn,Qn,Xn,tr,er,sr;!function(t){t.low="low",t.normal="normal",t.high="high"}(Kn||(Kn={})),function(t){t.created="created",t.processed="processed",t.failed="failed",t.throttled="throttled",t.bounceback="bounceback",t.acknowledged="acknowledged"}(Hn||(Hn={})),function(t){t.unknown="unknown",t.sms="sms",t.email="email",t.pnd="pnd",t.gcm="gcm",t.apn="apn",t.socket="socket"}(Gn||(Gn={}));class ir extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}status=Hn.created;kind=Gn.unknown;to="";from="";body="";processed=_();delivered=_();subject="";assetId=NaN;get asset(){return mt.get(this.assetId)}userLogin="";get user(){return lt.get(this.userLogin)}toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,status:Hn[this.status]||Hn.created,kind:Gn[this.kind]||Gn.unknown,to:this.to||"",from:this.from||"",body:this.body||"",processed:Z(this.processed),delivered:Z(this.delivered),subject:this.subject||"",asset:this.assetId,user:this.userLogin||""}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.status=Hn[t.status]||Hn.created,this.kind=Gn[t.kind]||Gn.unknown,this.to=t.to||"",this.from=t.from||"",this.body=t.body||"",this.processed=_(t.processed),this.delivered=_(t.delivered),this.subject=t.subject||"",this.assetId=L(t.asset),this.userLogin=t.user||""),s}getKey(){return this.id.toString()}}!function(t){t.inbox="inbox",t.archive="archive"}(qn||(qn={}));class nr extends ir{folder=qn.archive;incoming=!1;readBy="";toJSON(){return U(super.toJSON(),{folder:qn[this.folder]||qn.archive,incoming:!!this.incoming,readBy:this.readBy||""})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.folder=qn[t.folder]||qn.archive,this.incoming=!!t.incoming,this.readBy=t.readBy||""),s}}!function(t){t.point="point",t.radial="radial",t.polygon="polygon",t.rectangle="rectangle"}(Fn||(Fn={}));class rr{static fromJSON(t){return new rr(t.content,t.replace,t.condition,t.validate)}content;replace;condition;validate;constructor(t,e,s,i){this.content=t||"",this.replace=e||"",this.condition=s||"",this.validate=i||""}toJSON(){return{content:this.content||"",replace:this.replace||"",condition:this.condition||"",validate:this.validate||""}}}!function(t){t.boolean="boolean",t.number="number",t.text="text"}(Wn||(Wn={}));class ar{static fromJSON(t){return new ar(t.kind,t.value,t.notes,t.context,t.order,t.advanced)}kind;value;notes;context;order;advanced;constructor(t,e,s,i,n,r){this.kind=Wn[t]||Wn.text,this.value=e||"",this.notes=s||"",this.context=i||"",this.order=L(n),this.advanced=!!r}toJSON(){return{kind:Wn[this.kind]||Wn.text,value:this.value||"",notes:this.notes||"",context:this.context||"",order:L(this.order)||0,advanced:!!this.advanced}}}class or{static nodesFromJSON(t){const e=new Map;return l(t).forEach((s=>e.set(s,or.fromJSON(t[s]||{})))),e}static fromJSON(t){return new or(t.id,t.notes,t.isAdvanced,t.type,t.min,t.max,t.value,t.unit,or.nodesFromJSON(t.nodes))}isAdvanced;id;value;min;max;type;unit;notes;nodes;constructor(t,e,s,i,n,r,a,o,h){this.id=t||"",this.notes=e||"",this.isAdvanced=!!s,this.type=i||"",this.min=n,this.max=r,this.value=a,this.unit=o||"",this.nodes=h||new Map}toJSON(){return{id:this.id||"",value:this.value,min:this.min,max:this.max,type:this.type||"",unit:this.unit||"",notes:this.notes||"",isAdvanced:!!this.isAdvanced,nodes:F(this.nodes)}}}class hr extends cr{get type(){return Fn.point}}class dr extends cr{get type(){return Fn.polygon}maxVertices;constructor(t,e){super(t),this.maxVertices=L(e)}toJSON(){return U(super.toJSON(),{maxVertices:Q(this.maxVertices)})}}class lr extends cr{get type(){return Fn.rectangle}maxLength;maxWidth;constructor(t,e,s){super(t),this.maxLength=L(e),this.maxWidth=L(s)}toJSON(){return U(super.toJSON(),{maxLength:Q(this.maxLength),maxWidth:Q(this.maxWidth)})}}class cr{static fromJSON(t){switch(Fn[t.type]){case Fn.point:return new hr(t.maxGeofenceCount);case Fn.radial:return new ur(t.maxGeofenceCount,t.minRadius,t.maxRadius);case Fn.rectangle:return new lr(t.maxGeofenceCount,t.maxLength,t.maxWidth);case Fn.polygon:return new dr(t.maxGeofenceCount,t.maxVertices);default:throw new Error("Unsopported type:"+t.type)}}maxGeofenceCount;constructor(t){this.maxGeofenceCount=L(t)||0}toJSON(){return{type:Fn[this.type]||null,maxGeofenceCount:this.maxGeofenceCount||0}}}class ur extends cr{get type(){return Fn.radial}minRadius;maxRadius;constructor(t,e,s){super(t),this.minRadius=h(e),this.maxRadius=h(s)}toJSON(){return U(super.toJSON(),{minRadius:Q(this.minRadius),maxRadius:Q(this.maxRadius)})}}class mr{static fromJSON(t){return new mr(t.value,t.dts,t.unit)}value=null;dts=_();unit="";constructor(t,e,s){this.value=D(t)?null:t,this.dts=_(e),this.unit=s||""}toJSON(){return{value:D(this.value)?null:this.value,dts:Z(this.dts),unit:this.unit||""}}}class pr extends a{id="";companyId=NaN;get company(){return ot.get(this.companyId)}set company(t){this.companyId=t?.id??NaN}lastIP="";attributes=new Map;snf=new Map;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,lastIP:this.lastIP||"",attributes:q(this.attributes,((t,e)=>[t,F(e)])),snf:G(this.snf)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.id=t.id||"",this.companyId=L(t.company),this.lastIP=t.lastIP||"",this.attributes=W(t.attributes||{},((t,e)=>[t,W(e||{},((t,e)=>[t,mr.fromJSON(e)]))])),this.snf=Y(t.snf||{})),s}getKey(){return this.id}}!function(t){t.created="created",t.pending="pending",t.inProgress="inProgress",t.completed="completed",t.failed="failed",t.cancelled="cancelled"}(Yn||(Yn={}));class gr{static fromJSON(t){return new gr(t.status,t.parameters,t.created,t.processed)}status=Yn.created;parameters=[];created=_();processed=_();constructor(t,e,s,i){this.status=Yn[t]||Yn.created,this.parameters=[...e||[]],this.created=_(s),this.processed=_(i)}toJSON(){return{status:Yn[this.status]||Yn.created,parameters:[...this.parameters||[]],created:Z(this.created),processed:Z(this.processed)}}}!function(t){t.unknown="unknown",t.config="config",t.geofence="geofence",t.dispatch="dispatch",t.gps="gps",t.status="status",t.output="output",t.custom="custom"}($n||($n={}));class fr extends a{id="";companyId=NaN;get company(){return ot.get(this.companyId)}set company(t){this.companyId=t?.id??NaN}commands=new Map;toJSON(){return{id:this.id||null,v:this.v,company:Q(this.companyId),commands:F(this.commands)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.id||(this.id=t.id||""),this.companyId=L(t.company),this.commands=W(t.commands||{},((t,e)=>[$n[t],gr.fromJSON(e)]))),s}getKey(){return this.id}}class yr extends a{id="";companyId=NaN;get company(){return ot.get(this.companyId)}set company(t){this.companyId=t?.id??NaN}name="";notes="";kind=ki.unknown;assetId=NaN;get asset(){return mt.get(this.assetId)}set asset(t){this.assetId=t?.id??NaN}configurationId=NaN;get configuration(){return Pt.get(this.configurationId)??Rt.get(this.configurationId)}set configuration(t){this.configurationId=t?.id||NaN}password="";firmware="";phoneNumber=NaN;information=new Map;sim="";toJSON(){return U({id:this.id||null,v:this.v,company:Q(this.companyId),name:this.name||"",notes:this.notes||"",kind:ki[this.kind]||ki.unknown,configuration:Q(this.configurationId)},this.suspended?{suspended:!0,since:Z(this.since)}:{asset:Q(this.assetId),password:this.password||"",firmware:this.firmware||"",phoneNumber:Q(this.phoneNumber),information:G(this.information),sim:this.sim||""})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.id||(this.id=t.id||""),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.kind=ki[t.kind]||ki.unknown,this.assetId=L(t.asset),this.configurationId=L(t.configuration),this.password=t.password||"",this.firmware=t.firmware||"",this.phoneNumber=K(t.phoneNumber),this.information=Y(t.information||{}),this.sim=t.sim||"",this.suspended=!!t.suspended,this.since=_(t.since)),s}getKey(){return this.id}suspended=!1;since=_()}class Nr extends Sr{job;constructor(t,e,s,i,n,r){super(e,s,i,n,r),this.job=t}toJSON(){return U(super.toJSON(),{job:this.job.toJSON()})}}class vr extends Sr{message;constructor(t,e,s,i,n,r){super(e,s,i,n,r),this.message=t}toJSON(){return U(super.toJSON(),{message:this.message.toJSON()})}}class wr extends Sr{task;constructor(t,e,s,i,n,r){super(e,s,i,n,r),this.task=t}toJSON(){return U(super.toJSON(),{task:this.task.toJSON()})}}class Sr{static fromJSON(t){return"object"==typeof t.job?new Nr(new Nn(t.job),t.asset,t.instance,t.summaryInstances?.map(L),t.general?Ki.fromJSON(t.general):t.general,t.advanced?zi.fromJSON(t.advanced):t.advanced):"object"==typeof t.message?new vr(new nr(t.message),t.asset,t.instance,t.summaryInstances?.map(L),t.general?Ki.fromJSON(t.general):t.general,t.advanced?zi.fromJSON(t.advanced):t.advanced):"object"==typeof t.task?new wr(new vn(t.task),t.asset,t.instance,t.summaryInstances?.map(L),t.general?Ki.fromJSON(t.general):t.general,t.advanced?zi.fromJSON(t.advanced):t.advanced):new Sr(t.asset,t.instance,t.summaryInstances?.map(L),t.general?Ki.fromJSON(t.general):t.general,t.advanced?zi.fromJSON(t.advanced):t.advanced)}assetId;get asset(){return mt.get(this.assetId)}instance;summaryInstances;general;advanced;constructor(t,e,s,i,n){this.assetId=L(t),this.instance=L(e),this.summaryInstances=s?.map(L)??[],this.general=i||null,this.advanced=n||null}toJSON(){return{asset:Q(this.assetId),instance:Q(this.instance),summaryInstances:[...this.summaryInstances||[]],general:this.general?.toJSON()??null,advanced:this.advanced?.toJSON()??null}}}!function(t){t.none="none",t.inclusive="inclusive",t.exclusive="exclusive"}(Zn||(Zn={}));class Ir{static fromJSON(t){return new Ir(t.users,gi.parse(t.assets))}users;assets;constructor(t,e){this.users=[...t||[]],this.assets=e||null}toJSON(){return{users:[...this.users||[]],assets:gi.stringify(this.assets)}}}!function(t){t.startDate="startDate",t.endDate="endDate",t.timeOfDay="timeOfDay",t.tags="tags",t.duration="duration",t.prolonged="prolonged",t.distance="distance",t.rubicon="rubicon",t.collate="collate",t.attributes="attributes"}(Qn||(Qn={}));class br{static fromJSON(t){return new br(t.kind,t.value)}kind;value;constructor(t,e){this.kind=Qn[t],this.value=e||""}toJSON(){return{kind:Qn[this.kind]||"",value:this.value||""}}}class Or{static fromJSON(t){return new Or(t.condition,t.duration,t.points)}condition;duration;points;constructor(t,e,s){this.condition=t||"",this.duration=new Be(e),this.points=h(s)}toJSON(){return{condition:this.condition||"",duration:this.duration.toString(),points:Q(this.points)}}}class kr{static fromJSON(t){return new kr(t.baseScore,t.parameters?.map(Or.fromJSON))}baseScore;parameters;constructor(t,e){this.baseScore=h(t),this.parameters=e??[]}toJSON(){return{baseScore:Q(this.baseScore),parameters:this.parameters.map(i)}}}class xr{static fromJSON(t){return new xr(t.parameters?.map(br.fromJSON),gi.parse(t.targets),t.filtering,gi.parse(t.places),t.regions,t.scorecardRules?kr.fromJSON(t.scorecardRules):null)}parameters;targets;filtering;places;regions;scorecardRules;constructor(t,e,s,i,n,r){this.parameters=t??[],this.targets=e||null,this.filtering=Zn[s]||Zn.none,this.places=i||null,this.regions=n??[],this.scorecardRules=r||null}toJSON(){return{parameters:this.parameters.map(i),targets:gi.stringify(this.targets),filtering:Zn[this.filtering]||Zn.none,places:gi.stringify(this.places),regions:[...this.regions],scorecardRules:this.scorecardRules?.toJSON()??null}}}!function(t){t.once="once",t.daily="daily",t.weekly="weekly",t.monthly="monthly",t.quarterly="quarterly",t.annually="annually"}(Xn||(Xn={}));class Jr{static fromJSON(t){return new Jr(t.kind,t.weekdays,t.weekday,t.start,t.end,t.iterations,t.lastResult,t.nextStartDate,t.nextEndDate,t.lastStartDate,t.lastEndDate)}kind;weekdays;weekday;start;end;#n;get iterations(){return this.#n}#r;get lastResult(){return this.#r}#a;get nextStartDate(){return this.#a}#o;get nextEndDate(){return this.#o}#h;get lastStartDate(){return this.#h}#d;get lastEndDate(){return this.#d}constructor(t,e,s,i,n,r,a,o,h,d,l){this.kind=Xn[t]||Xn.once,this.weekdays=tt(e||X),this.weekday=L(s),this.start=_(i),this.end=_(n),this.#n=L(r),this.#r=L(a),this.#a=_(o),this.#o=_(h),this.#h=_(d),this.#d=_(l)}toJSON(){return{kind:Xn[this.kind]||Xn.once,weekdays:et(this.weekdays),weekday:Q(this.weekday),start:Z(this.start),end:Z(this.end),iterations:Q(this.iterations),lastResult:Q(this.lastResult),nextStartDate:Z(this.nextStartDate),nextEndDate:Z(this.nextEndDate),lastStartDate:Z(this.lastStartDate),lastEndDate:Z(this.lastEndDate)}}}!function(t){t.created="created",t.queued="queued",t.running="running",t.saving="saving",t.completed="completed",t.failed="failed"}(tr||(tr={}));class Tr{static fromJSON(t){return new Tr(t.asset,t.stateDetail,t.summaryCount,t.duration,t.distance)}assetId;get asset(){return mt.get(this.assetId)}stateDetail;summaryCount;duration;distance;constructor(t,e,s,i,n){this.assetId=L(t),this.stateDetail=e||"",this.summaryCount=L(s),this.duration=new Be(i),this.distance=h(n)}toJSON(){return{asset:Q(this.assetId),stateDetail:this.stateDetail||"",summaryCount:Q(this.summaryCount),duration:this.duration.toString(),distance:Q(this.distance)}}}!function(t){t.full="full",t.tags="tags",t.places="places",t.messages="messages",t.tasks="tasks",t.attributes="attributes",t.regions="regions",t.jobs="jobs",t.positions="positions"}(er||(er={}));class Cr{static fromJSON(t){return new Cr(t.asset,t.score,W(t.rulePoints||{},((t,e)=>[t,h(e)])))}assetId;get asset(){return mt.get(this.assetId)}score;rulePoints;constructor(t,e,s){this.assetId=L(t),this.score=h(e),this.rulePoints=s??new Map}toJSON(){return{asset:this.assetId||null,score:this.score||0,rulePoints:G(this.rulePoints)||{}}}}class Ur extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}kind=er.full;name="";notes="";options=new xr;templateId=NaN;get template(){return zt.get(this.templateId)}scheduleId=NaN;get schedule(){return Lt.get(this.scheduleId)}archive=!1;timezone=qt.utc;runBy="";created=_();completed=_();status=tr.created;progress=NaN;bounds=null;targeted=[];filtered=[];totals=[];scorecards=[];error="";toJSON(){return{id:Q(this.id),company:Q(this.companyId),kind:er[this.kind],name:this.name||"",notes:this.notes||"",options:this.options.toJSON(),template:Q(this.templateId),schedule:Q(this.scheduleId),archive:!!this.archive,timezone:this.timezone?.code??"",runBy:this.runBy||"",created:A(this.created.valueOf())?this.created.toISOString():null,completed:A(this.completed.valueOf())?this.completed.toISOString():null,status:tr[this.status]||tr.created,progress:this.progress||0,bounds:this.bounds?.toJSON()??null,targeted:this.targeted||null,filtered:this.filtered||null,totals:this.totals||null,scorecards:this.scorecards||null,error:this.error||""}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.kind=er[t.kind],this.name=t.name||"",this.notes=t.notes||"",this.options=xr.fromJSON(t.options),this.templateId=L(t.template),this.scheduleId=L(t.schedule),this.archive=!!t.archive,this.timezone=Wt(t.timezone)||qt.utc,this.runBy=t.runBy||"",this.created=_(t.created),this.completed=_(t.completed),this.status=tr[t.status]||tr.created,this.progress=L(t.progress),this.bounds=si.fromJSON(t.bounds),this.targeted=(t.targeted||[]).map(L),this.filtered=(t.filtered||[]).map(L),this.totals=(t.totals||[]).map(Tr.fromJSON),this.scorecards=(t.scorecards||[]).map(Cr.fromJSON),this.error=t.error||""),s}getKey(){return this.id.toString()}}!function(t){t.outsideRange="outsideRange",t.targeted="targeted",t.stateMatch="stateMatch",t.split="split",t.filterMatch="filterMatch"}(sr||(sr={}));class Mr{static fromJSON(t){return new Mr(t.asset,t.stateDetail,t.instance,t.instancesCount,t.startingUtc,t.startingReason,t.endingUtc,t.endingReason,t.distance,t.polyline,t.firstState?Fi.fromJSON(t.firstState):null,t.lastState?Fi.fromJSON(t.lastState):null)}assetId;get asset(){return mt.get(this.assetId)}stateDetail;instance;instancesCount;startingUtc;startingReason;endingUtc;endingReason;distance;get duration(){return Be.fromMilliseconds(this.endingUtc-this.startingUtc)}polyline;firstState;lastState;constructor(t,e,s,i,n,r,a,o,d,l,c,u){this.assetId=L(t),this.stateDetail=e||"",this.instance=L(s),this.instancesCount=L(i),this.startingUtc=_(n),this.startingReason=sr[r]||sr.outsideRange,this.endingUtc=_(a),this.endingReason=sr[o]||sr.outsideRange,this.distance=h(d),this.polyline=l?.map(ii.fromJSON)??[],this.firstState=c||null,this.lastState=u||null}toJSON(){return{asset:Q(this.assetId),stateDetail:this.stateDetail||"",instance:Q(this.instance),instancesCount:Q(this.instancesCount),startingUtc:Z(this.startingUtc),startingReason:sr[this.startingReason]||sr.outsideRange,endingUtc:Z(this.endingUtc),endingReason:sr[this.endingReason]||sr.outsideRange,distance:Q(this.distance),polyline:this.polyline.map(i),firstState:this.firstState?.toJSON()??null,lastState:this.lastState?.toJSON()??null}}}var Dr={version:5.02,storage:{companies:ot,contacts:ht,machines:dt,users:lt,userGroups:ct,sessions:ut,assets:mt,assetMessages:pt,behaviours:gt,behaviourScripts:ft,behaviourLogs:yt,billingProfiles:Nt,billingReports:vt,billableHostingRules:wt,billableHostingLicenses:St,dispatchTasks:It,dispatchJobs:bt,documents:Ot,formTemplates:kt,formResults:xt,pictures:Jt,icons:Tt,maintenanceSchedules:Ct,maintenanceJobs:Ut,places:Mt,providers:Dt,providerScripts:Et,providerConfigs:Pt,providerConfigurationTypes:At,providerConfigurations:Rt,reportTemplates:zt,reportSchedules:Lt,reportResults:_t},utility:{codify:nt,guid:function(){const t=(new Date).valueOf().toString(16).substring(1).split("").reduce(oi,[...ai]);for(let e=0;e<36;e++)if(" "===t[e]){let s=16*u.random()|0;t[e]=(19!==e?s:3&s|8).toString(16)}return t.join("")},isNothing:D,isntNaN:A,roundTo:R,merge:U,parseTime:function(t){return new Be(String(t)).totalSeconds},stringifyTime:function(t){return new Be(t*Re).toString()},douglasPeucker:function(t,e,s){if(!Array.isArray(t))throw new TypeError("source is not an Array.");if(!("function"==typeof(i=e)||i instanceof Function))throw new TypeError("triangleHeight is not an Function.");var i;if(!A(s)||s<0)throw new TypeError("tolerance is not an Number or less than zero.");return t.length<3?[...t]:t.filter(n,B(t,e,s))},numberGroups:Ns,fileSize:function(t,e=0,s=4,i=3,n=",",r=n,a="."){let o=0;if(t)for(s=S(s,ys.length-1);o<s&&t>1024;)t/=1024,o++;return Ns(R(t,e),i,n,r,a)+" "+ys[o]},findTimeZoneById:Wt,phoneNumber:K},SearchPattern:gi,TimeSpan:Be,Timezone:qt,convert:fs,encoding:{toPassword:function(t){return escape(t.split("").reduce((function(t,e){return t+String.fromCharCode(e.charCodeAt(0)^V)}),""))},fromPassword:function(t){return unescape(t).split("").reduce((function(t,e){return t+String.fromCharCode(e.charCodeAt(0)^V)}),"")}},geometry:{pathLength:function(t){for(var e=0,s=0,i=t.length-1,n=t[s],r=n;s<i;s++)n=t[s],e+=z((r=t[s+1]).x-n.x,r.y-n.y);return e},pathOrthogonal:Gs,pathReduce:function(t,e=0){return t.length<3?t.slice():(e>0||(e=0),t.filter(n,B(t,qs,e)))},pointAngle:Vs,pointDistance:js,pointPythagora:z,pointVector:Hs,polyArea:Fs,polyContains:function(t,e){var s=t.slice(),i=0,n=s.length,r=n-1,a=!1;if(s[i].x===s[r].x&&s[i].y===s[r].y&&(s.pop(),r=(n=s.length)-1),Ys(Ws(s),e))for(;i<n;r=i++){var o=s[i],h=s[r];o.y>e.y!=h.y>e.y&&e.x<(h.x-o.x)*(e.y-o.y)/(h.y-o.y)+o.x&&(a=!a)}return a},polyReduce:function(t,e=0){let s=[...t],i=t.length;if(i<3)return s;var r=0,a=0;e>0||(e=0);for(var o=0;o<i;o++)for(var h=s[o],d=o+1;d<i;d++){var l=js(h,s[d]);l>r&&(a=o,r=l)}return s=s.splice(a,i).concat(s),js(s[0],s[i-1])>0&&(i=s.push(s[0])),s=s.filter(n,B(s,qs,e)),i=s.length,js(s[0],s[i-1])<=0&&s.pop(),s},polyWrapper:function(t){for(var e=t.slice().sort(Ks),s=e[0],i=[s];e.length>1;){for(var n=0,r=0,a=360,o=0,h=e.length;o<h;o++){var d=e[o],l=Vs(s,d),c=js(s,d);d!==s&&(c?(l<a||l===a&&c>r)&&(l===a&&(e.splice(n,1),o--,h--),a=l,r=c,n=o):(e.splice(o--,1),h--))}if(0===n)break;i.push(s=e.splice(n,1)[0])}return i},radialCircumference:function(t){return 2*m*t},radialArea:function(t){return m*(t*t)},radialSmallest:function(t,e){let s=t[0],i=0;switch(t.length){case 1:return{x:s.x,y:s.y,r:i};case 2:return function(t,e){const s=function(t){return{x:t.left+(t.right-t.left)/2,y:t.top+(t.bottom-t.top)/2}}(t),i=t.right-t.left,n=t.bottom-t.top;return{x:s.x,y:s.y,r:js(s,e?i>n?{x:t.left,y:t.top+n/2}:{x:t.left+i/2,y:t.top}:{x:t.left,y:t.top})}}(Ws(t),!1)}e||(e=1e4);for(let h=0;h<e;h++){var n=t[0],r=0;for(let e=0;e<t.length;e++){var a=t[e],o=js(s,a);o>r&&(n=a,r=o)}s={x:s.x+1/(h+1)*(n.x-s.x),y:s.y+1/(h+1)*(n.y-s.y)},i=r}return{x:s.x,y:s.y,r:i}},radialOverlapsRectangle:function(t,e){var s=Bs(e),i=Bs(e);return s.top-=t.r,s.bottom+=t.r,i.left-=t.r,i.right+=t.r,Ys(s,t)||Ys(i,t)||js(t,{x:e.left,y:e.top})<=t.r||js(t,{x:e.right,y:e.top})<=t.r||js(t,{x:e.left,y:e.bottom})<=t.r||js(t,{x:e.right,y:e.bottom})<=t.r}},Point:Xs,Radial:Qs,Rectangle:Zs,Size:$s,geography:{earthRadius:vs,clampLat:bs,clampLng:Os,pathLength:function(t){const e=[...t],s=e.length-1;for(let t=0,i=0;t<s;t++)i+=Js(e[t],e[t+1]);return length},pathReduce:function(t,e){return t.length<3?[...t]:(e>0||(e=0),t.filter(n,B(t,Ms,e)))},pathEncode:function(t,e=5){const s=I(10,e);let i=Ds(t[0].lat,s)+Ds(t[0].lng,s);for(let e=1;e<t.length;e++){const n=t[e],r=t[e-1];i+=Ds(n.lat-r.lat,s)+Ds(n.lng-r.lng,s)}return i},pathDecode:Es,pointAngle:xs,pointDistance:Js,pointMiddle:Us,pointOrthogonal:Ts,pointTranslate:Cs,pointVincenty:function(t,e){const s=bs(t.lat),i=bs(e.lat),n=Os(t.lng,s),r=(Os(e.lng,i)-n)*T,a=f((1-ws)*x(s*T)),o=f((1-ws)*x(s*T)),h=O(a),d=N(a),l=O(o),c=N(o);let u,m,g,v,w,S,I,b,J,C,U=r,M=100;do{if(m=O(U),g=N(U),v=k(c*m*(c*m)+(d*l-h*c*g)*(d*l-h*c*g)),0===v)return 0;w=h*l+d*c*g,S=y(v,w),I=d*c*m/v,b=1-I*I,J=w-2*h*l/b,C=ws/16*b*(4+ws*(4-3*b)),A(J)||(J=0),u=U,U=r+(1-C)*ws*I*(S+C*v*(J+C*w*(2*J*J-1)))}while(p(U-u)>1e-12&&--M>0);if(!M)return 0;const D=272331606107.5547*b/40408299984661.445,E=D/1024*(256+D*(D*(74-47*D)-128));return Ss*(1+D/16384*(4096+D*(D*(320-175*D)-768)))*(S-E*v*(J+E/4*(w*(2*J*J-1)-E/6*J*(4*v*v-3)*(4*J*J-3))))},polyArea:function(t){const e=[...t];let s,i=0,n=0,r=e.length-1,a=e[n],o=e[r];if(a&&o&&Js(a,o)<=ks&&(e.pop(),r--),r<1)throw new Error("Not enough coordinates");if(r>1)for(n=1;n<r;n++)s=e[n],o=e[n+1],i+=As(a,s,o)*Rs(a,s,o);return p(40680631590769*i)},polyContains:function(t,e){throw"not implemented"},polyReduce:function(t,e=1e-9){let s=[...t],i=t.length;if(i>2){const[t,r,a]=Ps(s);e>0||(e=ks),s=s.splice(r,i).concat(s),Js(s[0],s[i-1])>e&&(i=s.push(s[0])),s=s.filter(n,B(s,Ms,e)),i=s.length,Js(s[0],s[i-1])<=e&&s.pop()}return s},polyWidest:Ps},LatLng:ii,LatLngBounds:si,Position:ri,StreetAddress:ni,ColourStyle:nn,Company:class extends Pe{get pieces(){return[this.general,null,this.directory,this.styles,this.policies,this.reseller]}get id(){return this.general.id??this.directory.id??this.policies.id??this.styles.id??this.reseller?.id}get parent(){return this.general.parent??this.directory.parent??this.policies.parent??this.styles.parent??this.reseller?.parent}set parent(t){this.parentId=t?.id??NaN}get parentId(){return this.parent?.id??NaN}set parentId(t){this.general.parentId=t,this.directory.parentId=t,this.policies.parentId=t,this.styles.parentId=t,this.reseller&&(this.reseller.parentId=t)}get company(){return ot.get(this.companyId)}get companyId(){return this.parentId}set companyId(t){this.parentId=t}general=new an;get name(){return this.general.name}set name(t){this.general.name=t}get notes(){return this.general.notes}set notes(t){this.general.notes=t}get references(){return this.general.references}set references(t){this.general.references=t}directory=new rn;get employees(){return this.directory.employees}set employees(t){this.directory.employees=t}policies=new dn;get sessionPolicy(){return this.policies.sessionPolicy}set sessionPolicy(t){this.policies.sessionPolicy=t}get passwordPolicy(){return this.policies.passwordPolicy}set passwordPolicy(t){this.policies.passwordPolicy=t}styles=new pn;get labels(){return this.styles.labels}set labels(t){this.styles.labels=t}get tags(){return this.styles.tags}set tags(t){this.styles.tags=t}reseller=null;toJSON(){return U({id:Q(this.id),v:this.v,parent:this.parentId},this.general.toJSON(),this.directory.toJSON(),this.styles.toJSON(),this.policies.toJSON(),this.reseller?.toJSON()??{})}fromJSON(t,e){const s=this.general.fromJSON(U({v:t.v.slice(0,1)},t)),i=this.directory.fromJSON(U({v:t.v.slice(2,3)},t)),n=this.styles.fromJSON(U({v:t.v.slice(3,4)},t)),r=this.policies.fromJSON(U({v:t.v.slice(4,5)},t));let a;return t?.v?.[5]>0?(a=!this.reseller,a&&(this.reseller=new un),a=this.reseller?.fromJSON(U({v:t.v.slice(5,6)},t))??a):(a=!!this.reseller,this.reseller=null),s||i||n||r||a}getKey(){return this.id.toString()}get contacts(){return at(ht,this.id)}get pictures(){return at(Jt,this.id)}},CompanyGeneral:an,CompanyDirectory:rn,CompanyPolicies:dn,CompanyStyles:pn,CompanyReseller:un,PasswordExpiryMode:Ji,PasswordPolicy:on,SessionMultiUser:Ti,SessionPolicy:hn,LabelStyle:mn,NotificationServerEmail:ln,NotificationServerSms:cn,authorizer:{computeAll:we,compute:Se,computeAllSimple:function(t,e,s){return we(t,(e||[]).filter(ye),(s||[]).filter(ye))},computeSimple:Ie,computeSimpleLevels:function(t,e,s,i){const n=new Map;return Ie(t,e,s,i).forEach((function(t){n.set(t.kind,t.level)})),n},getSimpleLevel:function(t,e,s,i,n){return Oe(t,Ie(t,e,s,i),n)},hasSimple:function(t,e,s,i,n,r){return be(t,Ie(t,e,s,i),n,r)},findSimple:be,findSimpleLevel:Oe,computeAllComplex:function(t,e,s){const i=new Map;return we(t,(e||[]).filter(fe),(s||[]).filter(fe)).forEach((function(t,e){for(let e,s=0;e=t[s];s++)fe(e)||t.splice(s--,1);t.length>0&&i.set(e,t)})),i},computeComplex:ke,getComplexLevel:function(t,e,s,i,n,r,a){return Je(t,ke(t,e,s,i),n,r,a)},findComplexLevel:Je,hasComplex:function(t,e,s,i,n,r,a,o){return xe(t,ke(t,e,s,i),n,r,a,o)},findComplex:xe,hasAnyComplex:function(t,e,s,i,n,r){return Te(t,ke(t,e,s,i),n,r)},findAnyComplex:Te,findAllEscalations:function(t,e,s,i){const n=new Map;return s.forEach((function(s,r){if(e.has(r)){const a=Ce(t,e.get(r),s,i&&i.get(r));a.length&&n.set(r,a)}else n.set(r,s.map((function(t){return new ie(te.vertical,t.companyId,t.kind,t.level,t.labels)})))})),n},findEscalations:Ce,findAllLabelEscalations:function(t,e,s,i,n,r){const a=[];return(s||[]).length>0&&s.forEach((function(s){const o=Ue(t,e,s,i,n,r);o&&a.push(o)})),a},findLabelEscalation:Ue,implied:c(re),simple:c(e(l(Yt),ae)),complex:c(ae)},Contact:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";otherNames=new Map;emails=new Map;phones=new Map;addresses=new Map;urls=new Map;dates=new Map;options=new Map;roles=[];pictureIds=[];get pictures(){return rt(Jt,this.pictureIds)}set pictures(t){this.pictureIds=t?.map(s)??[]}get email(){return this.emails.get(Bt)??""}set email(t){t?this.emails.set(Bt,t):this.emails.delete(Bt)}get mobile(){return this.phones.get(Vt)??NaN}set mobile(t){t?this.phones.set(Vt,t):this.phones.delete(Vt)}get office(){return this.phones.get(jt)??NaN}set office(t){t?this.phones.set(jt,t):this.phones.delete(jt)}get fax(){return this.phones.get(Kt)??NaN}set fax(t){t?this.phones.set(Kt,t):this.phones.delete(Kt)}get address(){return this.addresses.get(Ht)??""}set address(t){t?this.addresses.set(Ht,t):this.addresses.delete(Ht)}get url(){return this.urls.get(Gt)??""}set url(t){t?this.urls.set(Gt,t):this.urls.delete(Gt)}toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,name:this.name||"",notes:this.notes||"",otherNames:G(this.otherNames),emails:G(this.emails),phones:G(this.phones),addresses:G(this.addresses),urls:G(this.urls),dates:q(this.dates,((t,e)=>[t,e.toISOString()])),options:G(this.options),roles:[...this.roles],pictures:[...this.pictureIds]}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.emails=Y(t.emails||{},!1),this.phones=Y(t.phones||{},!1),this.addresses=Y(t.addresses||{},!1),this.urls=Y(t.urls||{},!1),this.dates=W(t.dates||{},((t,e)=>[t,_(e)])),this.options=Y(t.options||{},!1),this.otherNames=Y(t.otherNames||{},!1),this.roles=(t.roles||[]).map(nt),this.pictureIds=(t.pictures||[]).map(L)),s}getKey(){return this.id.toString()}},Machine:class extends a{key="";companyId=NaN;get company(){return ot.get(this.companyId)}enabled=!1;secret=null;nickname="";notes="";notBefore=_();notAfter=_();timezone=qt.utc;language="";formats=new Map;measurements=new Map;options=new Map;groupIds=[];get groups(){return rt(ct,this.groupIds)}set groups(t){this.groupIds=t?.map(s)??[]}permissions=[];services=[];referrers=[];ipRanges=[];insecure=!1;toJSON(){return{key:this.key,v:this.v,company:this.companyId,nickname:this.nickname,notes:this.notes,enabled:!!this.enabled,notBefore:Z(this.notBefore),notAfter:Z(this.notAfter),timezone:this.timezone?.code||qt.utc.code,language:this.language,formats:G(this.formats),measurements:G(this.measurements),options:G(this.options),groups:[...this.groupIds],permissions:this.permissions?.map(i)??[],services:[...this.services],referrers:[...this.referrers],ipRanges:[...this.ipRanges],insecure:!!this.insecure}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.key||(this.key=t.key||""),this.companyId=L(t.company),this.secret="string"==typeof t.secret?t.secret:"",this.nickname=t.nickname||"",this.notes=t.notes||"",this.enabled=!!t.enabled,this.notBefore=_(t.notBefore),this.notAfter=_(t.notAfter),this.timezone=Wt(t.timezone||"")||qt.utc,this.language=t.language||"",this.formats=$(t.formats||{}),this.measurements=W(t.measurements||{},((t,e)=>[nt(t),Qt[e]??Qt.metric])),this.options=$(t.options||{}),this.groupIds=(t.groups||[]).map(L),this.permissions=(t.permissions||[]).map(ee.fromJSON),this.services=t.services||[],this.referrers=t.referrers||[],this.ipRanges=t.ipRanges||[],this.insecure=!!t.insecure),s}getKey(){return this.key}},NotificationMethod:Xt,Permission:ee,PermissionEscalation:ie,PermissionEscalationState:se,PermissionEscalationType:te,PermissionLevel:$t,PermissionMethod:Zt,PermissionType:Yt,Session:Ee,SessionStatus:De,SystemsOfUnits:Qt,User:class extends Pe{get pieces(){return[this.#e,this.#s]}get login(){return this.general.login??this.advanced.login}get companyId(){return this.general.companyId??this.advanced.companyId}get company(){return this.general.company}#e=new je;get general(){return this.#e}get passwordExpired(){return this.general.passwordExpired}set passwordExpired(t){this.general.passwordExpired=t}get enabled(){return this.general.enabled}set enabled(t){this.general.enabled=t}get nickname(){return this.general.nickname}set nickname(t){this.general.nickname=t}get contactId(){return this.general.contactId}set contactId(t){this.general.contactId=t||NaN}get contact(){return this.general.contact}set contact(t){this.general.contactId=t?.id||NaN}get timezone(){return this.general.timezone}set timezone(t){this.general.timezone=t}get language(){return this.general.language}set language(t){this.general.language=t}get formats(){return this.general.formats}set formats(t){this.general.formats=t}get measurements(){return this.general.measurements}set measurements(t){this.general.measurements=t}get options(){return this.general.options}set options(t){this.general.options=t}get notify(){return this.general.notify}set notify(t){this.general.notify=t}#s=new Ae;get advanced(){return this.#s}get groupIds(){return this.advanced.groupIds}set groupIds(t){this.advanced.groupIds=t}get groups(){return this.advanced.groups}set groups(t){this.advanced.groups=t}get permissions(){return this.advanced.permissions}set permissions(t){this.advanced.permissions=t}toJSON(){return U({login:this.login,v:this.v,company:this.companyId},this.general.toJSON(),this.advanced.toJSON())}fromJSON(t,e){const s=this.general.fromJSON(U({v:t.v.slice(0,1)},t),e),i=this.advanced.fromJSON(U({v:t.v.slice(1,2)},t),e);return s||i}getKey(){return this.login}},UserGeneral:je,UserAdvanced:Ae,UserGroup:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";permissions=[];toJSON(){return{id:this.id,v:this.v,company:this.companyId,name:this.name||"",notes:this.notes||"",permissions:this.permissions?.map(i)??[]}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.permissions=(t.permissions||[]).map(ee.fromJSON)),s}getKey(){return this.id.toString()}},UserNotifications:Ve,Asset:Fi,AssetAdvanced:zi,AssetAttribute:fi,AssetDispatch:_i,AssetGeneral:Ki,AssetPlaceStatus:Ai,AssetPlaceStatusType:yi,AssetType:Ni,Person:Hi,PersonGeneral:Bi,Trailer:Gi,TrailerGeneral:Vi,Vehicle:qi,VehicleGeneral:ji,VehicleAdvanced:Ri,AssetAlert:class extends ir{priority=Kn.normal;toJSON(){return U(super.toJSON(),{priority:Kn[this.priority]||Kn.normal})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.priority=Kn[t.folder]||Kn.normal),s}},AssetMessage:nr,AlertPriority:Kn,MessageFolder:qn,MessageStatus:Hn,MessageType:Gn,Behaviour:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}scriptId=NaN;get script(){return ft.get(this.scriptId)}name="";notes="";priority=255;targets=null;filters=null;parameters=new Map;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId||null,script:this.scriptId||null,name:this.name||"",notes:this.notes||"",targets:gi.stringify(this.targets),filters:gi.stringify(this.filters),priority:this.priority||255,parameters:F(this.parameters)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.scriptId=L(t.script),this.name=t.name||"",this.notes=t.notes||"",this.priority=L(t.priority),this.targets=gi.parse(t.targets),this.filters=gi.parse(t.filters),this.parameters=W(t.parameters||{},((t,e)=>[t,Wi.fromJSON(e)]))),s}getKey(){return this.id.toString()}},BehaviourLog:class extends a{id=NaN;assetId=NaN;get asset(){return mt.get(this.assetId)}companyId=NaN;get company(){return ot.get(this.companyId)}behaviourId=NaN;get behaviour(){return gt.get(this.behaviourId)}scriptId=NaN;get script(){return ft.get(this.scriptId)}kind=wi.log;dts=_();message="";line=NaN;character=NaN;toJSON(){return{id:this.id||null,v:this.v,asset:this.assetId||null,company:this.companyId||null,behaviour:this.behaviourId||null,script:this.scriptId||null,kind:wi[this.kind]||wi.log,dts:Z(this.dts),message:this.message||"",line:this.line||-1,character:this.character||-1}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.assetId=L(t.asset),this.companyId=L(t.company),this.behaviourId=L(t.behaviour),this.scriptId=L(t.script),this.kind=wi[t.kind]||wi.log,this.dts=_(t.dts),this.message=t.message||"",this.line=L(t.line),this.character=L(t.character)),s}getKey(){return this.id.toString()}},BehaviourLogType:wi,BehaviourParameter:Wi,BehaviourParameterType:vi,BehaviourScript:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";global=!1;source="";filters=null;parameters=new Map;fill="";stroke="";graphic="";toJSON(){return{id:this.id||null,v:this.v,company:this.companyId||null,name:this.name||"",notes:this.notes||"",global:!!this.global,source:this.source||"",filters:gi.stringify(this.filters),parameters:F(this.parameters),fill:this.fill||"",stroke:this.stroke||"",graphic:this.graphic||""}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.global=!!t.global,this.source=t.source||"",this.filters=gi.parse(t.filters),this.parameters=W(t.parameters||{},((t,e)=>[t,Wi.fromJSON(e)])),this.fill=t.fill||"",this.stroke=t.stroke||"",this.graphic=t.graphic||""),s}getKey(){return this.id.toString()}},BillableHostingDiscount:class extends Zi{services=[];percentage=!1;toJSON(){return U(super.toJSON(),{services:[...this.services],percentage:!!this.percentage})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.services=[...t.services||[]],this.percentage=!!t.percentage),s}},BillableHostingLicense:class extends Zi{kind=bi.bewhere;toJSON(){return U(super.toJSON(),{kind:bi[this.kind]})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.kind=bi[t.kind]),s}},BillableHostingLicenseType:bi,BillableHostingRule:class extends Zi{service=Oi.asset;toJSON(){return U(super.toJSON(),{service:Oi[this.service]})}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return super.fromJSON(t,s),s&&(this.service=Oi[t.kind]),s}},BillableHostingType:Oi,BillingCurrency:Si,BillingCycle:Ii,BillingProfile:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}targetId=NaN;get target(){return ot.get(this.targetId)}billeeId=NaN;get billee(){return ot.get(this.billeeId)}name="";notes="";messages=[];cycle=Ii.monthly;cycleStart=_();cycleEnd=_();cyclePostDated=!1;currency=Si.CAD;googleServicesEnabled=!1;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,target:this.targetId,billee:this.billeeId,name:this.name||"",notes:this.notes||"",messages:this.messages?.map(i)??[],cycle:Ii[this.cycle]||Ii.monthly,currency:Si[this.currency]||Si.CAD,cycleStart:A(this.cycleStart.valueOf())?this.cycleStart.toISOString():null,cycleEnd:A(this.cycleStart.valueOf())?this.cycleEnd.toISOString():null,cyclePostDated:!!this.cyclePostDated,googleServicesEnabled:!!this.googleServicesEnabled}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.targetId=L(t.target),this.billeeId=L(t.billee),this.name=t.name||"",this.notes=t.notes||"",this.messages=(t.messages||[]).map(Yi.fromJSON),this.cycle=Ii[t.cycle]||Ii.monthly,this.cycleStart=_(t.cycleStart),this.cycleEnd=_(t.cycleEnd),this.cyclePostDated=!!t.cyclePostDated,this.currency=Si[t.cycle]||Si.CAD,this.googleServicesEnabled=!!t.googleServicesEnabled),s}getKey(){return this.id.toString()}},BillingReport:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}billeeId=NaN;get billee(){return ot.get(this.billeeId)}profileId=NaN;get profile(){return Nt.get(this.profileId)}name="";notes="";startDate=_();endDate=_();total=NaN;currency=Si.CAD;status=xi.created;error="";summary=[];breakdown=[];toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,billee:this.billeeId,profile:this.profileId,name:this.name||"",notes:this.notes||"",startDate:Z(this.startDate),endDate:Z(this.endDate),total:this.total||0,currency:Si[this.currency]||Si.CAD,status:xi[this.status]||xi.created,error:this.error||"",summary:this.summary?.map(i)??[],breakdown:this.breakdown?.map(i)??[]}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.billeeId=L(t.billee),this.profileId=L(t.profile),this.name=t.name||"",this.notes=t.notes||"",this.startDate=_(t.startDate),this.endDate=_(t.endDate),this.total=h(t.total),this.currency=Si[t.cycle]||Si.CAD,this.status=xi[t.status]||xi.created,this.error=t.error||"",this.summary=(t.summary||[]).map(sn.fromJSON),this.breakdown=(t.breakdown||[]).map(tn.fromJSON)),s}getKey(){return this.id.toString()}},BillingReportBreakdown:tn,BillingReportHostingSummary:en,BillingReportLicenseBreakdown:Qi,BillingReportServiceBreakdown:Xi,BillingReportStatus:xi,BillingReportSummary:sn,DispatchDirection:Li,DispatchJob:Nn,DispatchJobPriority:Mi,DispatchStep:yn,DispatchStepState:fn,DispatchStepStatus:Di,DispatchTask:vn,DispatchTaskStatus:Ei,Document:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";src="";bytes=NaN;mime="";expiry=_();references=new Map;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,name:this.name||"",notes:this.notes||"",src:this.src||"",mime:this.mime||"",bytes:this.bytes||0,expiry:Z(this.expiry),references:Y(this.references)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.src=t.src||"",this.mime=t.mime||"",this.bytes=L(t.bytes)||0,this.expiry=_(t.expiry),this.references=Y(t.references||{})),s}getKey(){return this.id.toString()}},FormResult:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}templateId=NaN;get template(){return kt.get(this.templateId)}set template(t){this.templateId=t?.id??NaN}assetId=NaN;get asset(){return mt.get(this.assetId)}name="";notes="";labels=[];fields=new Map;completed=_();latlng=null;driver="";getKey(){return this.id.toString()}toJSON(){return{id:this.id,company:this.companyId,v:this.v,template:this.templateId||null,asset:this.assetId||null,name:this.name||"",notes:this.notes||"",labels:[...this.labels],fields:G(this.fields),completed:Z(this.completed),latlng:this.latlng?.toJSON()??null,driver:this.driver||null}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.id=L(t.id),this.companyId=L(t.company),this.templateId=L(t.template),this.assetId=L(t.asset),this.name=t.name||"",this.notes=t.notes||"",this.labels=[...t.labels||[]],this.fields=function(t,e=!1){return W(t,((t,s)=>[L(t),e?M(s):s]))}(t.fields||{}),this.completed=_(t.completed),this.latlng=t.latlng?ii.fromJSON(t.latlng):null,this.driver=t.driver||""),s}},FormTemplate:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";labels=[];fill="";stroke="";graphic="";fields=[];getKey(){return this.id.toString()}toJSON(){return{id:Q(this.id),company:Q(this.companyId),v:this.v,name:this.name||"",notes:this.notes||"",labels:[...this.labels],fields:this.fields.map(i),fill:this.fill||"",stroke:this.stroke||"",graphic:this.graphic||""}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.companyId),this.name=t.name||"",this.notes=t.notes||"",this.labels=[...t.labels||[]],this.fields=(t.fields||[]).map(Dn.fromJSON),this.fill=t.fill||"",this.stroke=t.stroke||"",this.graphic=t.graphic||""),s}},FormFieldType:Pi,FormFieldBase:Dn,FormFieldAttachments:En,FormFieldBoolean:wn,FormFieldChoice:In,FormFieldDate:bn,FormFieldNumeric:kn,FormFieldNumericSize:On,FormFieldSignature:xn,FormFieldText:Jn,FormFieldTime:Un,FormFieldTimezone:Mn,DashcamBase:Pn,Dashcam:Ln,DashcamLive:_n,DashcamMediaType:An,Icon:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}category="";name="";notes="";global=!1;usage=[];label=new Bn;badge=new Bn;glyphs=[];toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,category:this.category||"",name:this.name||"",notes:this.notes||"",global:!!this.global,usage:[...this.usage],label:this.label.toJSON(),badge:this.badge.toJSON(),glyphs:this.glyphs.map(i)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(this.id=L(t.id),this.companyId=L(t.company),this.category=t.category||"",this.name=t.name||"",this.notes=t.notes||"",this.global=!!t.global,this.usage=(t.usage||[]).map(nt),this.label=new Bn(t.label),this.badge=new Bn(t.badge),this.glyphs=(t.glyphs||[]).map((t=>new Vn(t)))),s}getKey(){return this.id.toString()}},IconGlyph:Vn,IconLabel:Bn,IconLayer:Rn,Picture:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";src="";size=new $s(0,0);focals=[];bytes=NaN;uses=NaN;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,name:this.name||"",notes:this.notes||"",src:this.src||"",size:this.size.toJSON(),focals:this.focals.map(i),bytes:A(this.bytes)?this.bytes:null,uses:A(this.uses)?this.uses:null}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.src=t.src||"",this.size=t.size?new $s(t.size.width,t.size.height):new $s(0,0),this.focals=(t.focals||[]).map((t=>new Zs(new Xs(t.left,t.top),new Xs(t.right,t.bottom)))),this.bytes=L(t.bytes),this.uses=L(t.uses)),s}getKey(){return this.id.toString()}},MaintenanceInterval:jn,MaintenanceJob:class extends a{id=NaN;assetId=NaN;get asset(){return mt.get(this.assetId)}companyId=NaN;get company(){return ot.get(this.companyId)}scheduleId=NaN;get schedule(){return Ct.get(this.scheduleId)}set schedule(t){this.scheduleId=t?.id}name="";notes="";status=zn.pending;created=_();completed=_();odometer=NaN;engineHours=NaN;garage="";duration=new Be;cost=NaN;reference="";technician="";pictureIds=[];get pictures(){return rt(Jt,this.pictureIds)}set pictures(t){this.pictureIds=t?.map(s)??[]}toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,asset:this.assetId,schedule:this.scheduleId,name:this.name||"",notes:this.notes||"",status:this.status,created:Z(this.created),completed:Z(this.completed),odometer:this.odometer,engineHours:this.engineHours,garage:this.garage,cost:this.cost,duration:this.duration.toString(),reference:this.reference,technician:this.technician,pictures:[...this.pictureIds]}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.assetId=L(t.asset),this.scheduleId=L(t.schedule),this.name=t.name||"",this.notes=t.notes||"",this.status=zn[t.status]||zn.pending,this.created=_(t.created),this.completed=_(t.completed),this.odometer=h(t.odometer),this.engineHours=h(t.engineHours),this.garage=t.garage||"",this.cost=h(t.cost),this.duration=new Be(t.duration),this.reference=t.reference||"",this.technician=t.technician||"",this.pictureIds=(t.pictures||[]).map(L)),s}getKey(){return this.id.toString()}},MaintenanceJobStatus:zn,MaintenanceSchedule:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";targets=null;notify=[];fill="";stroke="";graphic="";predictionDays=14;recurDays=NaN;recurDistance=NaN;recurEngineHours=NaN;intervals=new Map;garage="";duration=new Be;cost=NaN;reference="";toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,name:this.name||"",notes:this.notes||"",notify:[...this.notify],targets:gi.stringify(this.targets),fill:this.fill||"",stroke:this.stroke||"",graphic:this.graphic||"",garage:this.garage||"",cost:this.cost||0,duration:this.duration.toString(),reference:this.reference||"",predictionDays:this.predictionDays||14,recurDays:this.recurDays||null,recurDistance:this.recurDistance||null,recurEngineHours:this.recurEngineHours||null,intervals:F(this.intervals)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.notify=t.notify||[],this.targets=gi.parse(t.targets),this.fill=t.fill||"",this.stroke=t.stroke||"",this.graphic=t.graphic||"",this.garage=t.garage||"",this.cost=h(t.cost),this.duration=new Be(t.duration),this.reference=t.reference||"",this.predictionDays=L(t.predictionDays)||14,this.recurDays=L(t.recurDays),this.recurDistance=h(t.recurDistance),this.recurEngineHours=h(t.recurEngineHours),this.intervals=W(t.intervals||{},((t,e)=>[L(t),jn.fromJSON(e)]))),s}getKey(){return this.id.toString()}},Place:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}kind=Fn.point;name="";address="";iconId=NaN;get icon(){return Tt.get(this.iconId)}set icon(t){this.iconId=t?.id??NaN}notes="";labels=[];colour="";pictureIds=[];get pictures(){return rt(Jt,this.pictureIds)}set pictures(t){this.pictureIds=t?.map(s)??[]}reference="";anchor=null;radius=NaN;points=null;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,icon:this.iconId,name:this.name||"",notes:this.notes||"",address:this.address||"",kind:Fn[this.kind]||Fn.point,labels:[...this.labels],colour:this.colour||"",pictures:[...this.pictureIds],reference:this.reference||"",anchor:this.anchor?.toJSON()??null,radius:this.radius||null,shape:this.points?.map(i)??null}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.iconId=L(t.icon),this.name=t.name||"",this.notes=t.notes||"",this.address=t.address||"",this.kind=Fn[t.kind]||Fn.point,this.labels=(t.labels||[]).map(nt),this.colour=t.colour||"",this.pictureIds=(t.pictures||[]).map(L),this.reference=t.reference||"",this.anchor=t.anchor?ii.fromJSON(t.anchor):null,this.radius=h(t.radius),this.points=("string"==typeof t.shape?Es(t.shape,6):t.shape?t.shape:null)?.map(ii.fromJSON)??null),s}getKey(){return this.id.toString()}},PlaceType:Fn,Provider:class extends Pe{get pieces(){return[this.#e,this.#s,this.#l]}get id(){return this.#e.id??this.#s.id??this.#l.id}get companyId(){return this.#e.companyId??this.#s.companyId??this.#l.companyId}get company(){return this.#e.company??this.#s.company??this.#l.company}set company(t){this.general.company=t,this.advanced.company=t,this.control.company=t}get kind(){return this.#e.kind}#e=new yr;get general(){return this.#e}get name(){return this.#e.name}set name(t){this.#e.name=t}get notes(){return this.#e.notes}set notes(t){this.#e.notes=t}get asset(){return this.#e.assetId}set asset(t){this.#e.assetId=t}get configuration(){return this.#e.configurationId}set configuration(t){this.#e.configurationId=t}get password(){return this.#e.password}set password(t){this.#e.password=t}get firmware(){return this.#e.firmware}set firmware(t){this.#e.firmware=t}get phoneNumber(){return this.#e.phoneNumber}set phoneNumber(t){this.#e.phoneNumber=t??NaN}get information(){return this.#e.information}set information(t){this.#e.information=t}get sim(){return this.#e.sim}set sim(t){this.#e.sim=t}#s=new pr;get advanced(){return this.#s}get lastIP(){return this.#s.lastIP}set lastIP(t){this.#s.lastIP=t}get attributes(){return this.#s.attributes}set attributes(t){this.#s.attributes=t}get snf(){return this.#s.snf}set snf(t){this.#s.snf=t}#l=new fr;get control(){return this.#l}get commands(){return this.#l.commands}set commands(t){this.#l.commands=t}toJSON(){return this.suspended?this.#e.toJSON():U({id:this.id||"",v:this.v,control:this.#l.toJSON()},this.#e.toJSON(),this.#s.toJSON())}fromJSON(t,e){const s=this.#e.fromJSON(U({v:t.v.slice(0,1)},t),e),i=this.#s.fromJSON(U({v:t.v.slice(1,2)},t),e),n=this.#l.fromJSON(U({v:t.v.slice(2,3)},t.control),e);return s||i||n}getKey(){return this.id}get suspended(){return this.#e.suspended}get since(){return this.#e.since}},ProviderAdvanced:pr,ProviderData:mr,ProviderGeneral:yr,ProviderControl:fr,ProviderCommand:gr,ProviderCommandStatus:Yn,ProviderCommandType:$n,ProviderType:ki,ProviderRegistration:class extends r{code="";companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";password="";userLogin="";get user(){return lt.get(this.userLogin)}configId=NaN;get config(){return Pt.get(this.configId)??Rt.get(this.configId)}kind=ki.unknown;since=_();completed=_();expires=_();identifier="";assetId=NaN;get asset(){return mt.get(this.assetId)}phoneNumber=NaN;toJSON(){return{code:this.code||null,company:this.companyId||null,name:this.name||"",notes:this.notes||"",password:this.password||"",user:this.userLogin||"",config:this.configId||null,kind:ki[this.kind]||ki.unknown,since:Z(this.since),completed:Z(this.completed),expires:Z(this.expires),identifier:this.identifier||"",asset:this.assetId||null,phoneNumber:this.phoneNumber||null}}fromJSON(t,e){return A(L(this.code))||(this.code=t.code),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.password=t.password||"",this.userLogin=t.userLogin||"",this.configId=L(t.config),this.kind=ki[t.kind]||ki.unknown,this.since=_(t.password),this.completed=_(t.completed),this.expires=_(t.expires),this.identifier=t.identifier||"",this.assetId=L(t.asset),this.phoneNumber=K(t.phoneNumber),!0}getKey(){return this.code}},ProviderConfig:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}scriptId=NaN;get script(){return Et.get(this.scriptId)}set script(t){this.scriptId=t?.id??NaN}name="";notes="";parameters=new Map;geofences=null;toJSON(){return{id:Q(this.id),v:this.v,company:Q(this.companyId),script:Q(this.scriptId),name:this.name||"",notes:this.notes||"",parameters:G(this.parameters),geofences:gi.stringify(this.geofences)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.scriptId=L(t.script),this.name=t.name||"",this.notes=t.notes||"",this.parameters=Y(t.parameters||{}),this.geofences=gi.parse(t.geofences)),s}getKey(){return this.id.toString()}},ProviderScript:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";fill="";stroke="";graphic="";global=!1;kind=ki.unknown;blocks=[];parameters=new Map;toJSON(){return{id:this.id||null,v:this.v,company:this.companyId,name:this.name||"",notes:this.notes||"",fill:this.fill||"",stroke:this.stroke||"",graphic:this.graphic||"",global:!!this.global,kind:ki[this.kind]||ki.unknown,blocks:this.blocks.map(i),parameters:F(this.parameters)}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.fill=t.fill||"",this.stroke=t.stroke||"",this.graphic=t.graphic||"",this.global=!!t.global,this.kind=ki[t.kind]||ki.unknown,this.blocks=t.blocks?.map(rr.fromJSON)??[],this.parameters=W(t.parameters||{},((t,e)=>[t,ar.fromJSON(e)]))),s}getKey(){return this.id.toString()}},ProviderScriptBlock:rr,ProviderScriptParameter:ar,ProviderScriptParameterType:Wn,ProviderConfiguration:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}name="";notes="";typeId=NaN;get type(){return At.get(this.typeId)}scriptParameters=new Map;geofences=[];toJSON(){return{id:this.id,company:this.companyId,v:this.v,name:this.name||"",notes:this.notes||"",type:this.typeId||null,scriptParameters:G(this.scriptParameters),geofences:this.geofences||""}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.typeId=L(t.type),this.scriptParameters=Y(t.scriptParameters),this.geofences=t.geofences||""),s}getKey(){return this.id.toString()}},ProviderConfigurationNode:or,ProviderConfigurationType:class extends a{id=NaN;name="";notes="";providerType=ki.unknown;maxGeofenceCount=NaN;minGeofenceCount=NaN;scriptOptions=new Map;geofenceTypes=[];toJSON(){return{id:this.id,v:this.v,name:this.name||"",notes:this.notes||"",providerType:ki[this.providerType]||ki.unknown,maxGeofenceCount:Q(this.maxGeofenceCount),minGeofenceCount:Q(this.minGeofenceCount),scriptOptions:F(this.scriptOptions),geofenceTypes:this.geofenceTypes.map((t=>Fn[t]||null))}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.name=t.name||"",this.notes=t.notes||"",this.providerType=ki[t.providerType]||ki.unknown,this.maxGeofenceCount=L(t.maxGeofenceCount),this.minGeofenceCount=L(t.minGeofenceCount),this.scriptOptions=or.nodesFromJSON(t.scriptOptions),this.geofenceTypes=t.geofenceTypes?.map((t=>Fn[t]))??[]),s}getKey(){return this.id.toString()}},ProviderGeofenceCircular:ur,ProviderGeofencePoint:hr,ProviderGeofencePolygon:dr,ProviderGeofenceRectangle:lr,ReportResult:Ur,ReportResultData:class extends Ur{summary=new Map;breakdown=new Map},ReportSchedule:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}templateId=NaN;get template(){return zt.get(this.templateId)}owner="";name="";notes="";enabled=!1;repetition=null;options=null;notify=null;toJSON(){return{id:this.id||null,company:this.companyId||null,template:this.templateId||null,v:this.v,name:this.name||"",notes:this.notes||"",owner:this.owner||"",enabled:!!this.enabled,repetition:this.repetition?.toJSON()??null,options:this.options?.toJSON()??null,notify:this.notify?.toJSON()??null}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.templateId=L(t.template),this.name=t.name||"",this.notes=t.notes||"",this.owner=t.owner||"",this.enabled=!!t.enabled,this.repetition=t.repetition?Jr.fromJSON(t.repetition):null,this.options=t.options?xr.fromJSON(t.options):null,this.notify=t.notify?Ir.fromJSON(t.notify):null),s}getKey(){return this.id.toString()}},ReportTemplate:class extends a{id=NaN;companyId=NaN;get company(){return ot.get(this.companyId)}kind=er.full;name="";notes="";options=null;fill="";stroke="";graphic="";toJSON(){return{id:this.id||null,company:this.companyId||null,v:this.v,name:this.name||"",notes:this.notes||"",options:this.options?.toJSON()??null,fill:this.fill||"",stroke:this.stroke||"",graphic:this.graphic||""}}fromJSON(t,e){const s=this.updateVersion(t?.v)||!(!e||!t);return s&&(A(this.id)||(this.id=L(t.id)),this.companyId=L(t.company),this.name=t.name||"",this.notes=t.notes||"",this.options=t.options?xr.fromJSON(t.options):null,this.fill=t.fill||"",this.stroke=t.stroke||"",this.graphic=t.graphic||""),s}getKey(){return this.id.toString()}}
|
|
2
|
-
/**
|
|
3
|
-
* Object definitions that work with our various APIs.
|
|
4
|
-
* {@link https://apis.trakit.ca/ts|TypeScript API documentation.}
|
|
5
|
-
* Last updated on Thu Feb 27 2025 11:59:01
|
|
6
|
-
* @copyright Trak-iT Wireless Inc. 2025
|
|
7
|
-
*/,ReportBreakdown:Sr,ReportBreakdownJob:Nr,ReportBreakdownMessage:vr,ReportBreakdownTask:wr,ReportTotal:Tr,ReportFilterMode:Zn,ReportNotifications:Ir,ReportOptions:xr,ReportParameter:br,ReportParameterType:Qn,ReportRecurrence:Jr,ReportRecurrenceType:Xn,ReportScorecard:Cr,ReportScorecardParameter:Or,ReportScorecardRules:kr,ReportStatus:tr,ReportSummary:Mr,ReportSummaryReason:sr,ReportType:er};export{Dr as default};
|