@dra2020/baseclient 1.0.117 → 1.0.118

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021-2022 Dave's Redistricting, LLC.
3
+ Copyright (c) 2021-2023 Dave's Redistricting, LLC.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -5795,7 +5795,7 @@ exports.OTServerEngine = OTServerEngine;
5795
5795
 
5796
5796
 
5797
5797
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5798
- exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.FilterMyGroups = exports.FilterCOI = exports.FilterOfficial = exports.FilterPublic = exports.FilterTrash = exports.FilterRecent = exports.FilterMyPublic = exports.FilterSharedWithMe = exports.FilterMyMaps = exports.EClockAnomaly = exports.EMaintenance = exports.ENoAccess = exports.ENoPerm = exports.ELoadFailed = exports.EBadRequest = exports.ENoUser = exports.EClockReset = exports.EClockFailure = exports.EClockSeen = exports.ENoSession = exports.ERetry = exports.EFull = exports.EFail = exports.ESuccess = void 0;
5798
+ exports.SessionFilterFunction = exports.accessMapFindUser = exports.accessFindUser = exports.ServerStateMaintenance = exports.ServerStateRunning = exports.PermAll = exports.PermEdit = exports.PermVersion = exports.PermAdmin = exports.PermOwner = exports.PermWrite = exports.PermRead = exports.PermNone = exports.FilterCount = exports.FilterMyGroups = exports.FilterCOI = exports.FilterOfficial = exports.FilterPublic = exports.FilterTrash = exports.FilterRecent = exports.FilterMyPublic = exports.FilterSharedWithMe = exports.FilterMyMaps = exports.EClockAnomaly = exports.EMaintenance = exports.ENoAccess = exports.ENoPerm = exports.ELoadFailed = exports.EBadRequest = exports.ENoUser = exports.EClockReset = exports.EClockFailure = exports.EClockSeen = exports.ENoSession = exports.ERetry = exports.EFull = exports.EFail = exports.ESuccess = void 0;
5799
5799
  // Errors
5800
5800
  exports.ESuccess = 0; // Generic success
5801
5801
  exports.EFail = 1; // Generic failure
@@ -5829,6 +5829,7 @@ exports.PermRead = 1; // Can view
5829
5829
  exports.PermWrite = 2; // Can modify
5830
5830
  exports.PermOwner = 4; // Can change deleted, published, access permissions
5831
5831
  exports.PermAdmin = 8; // Can administer site
5832
+ exports.PermVersion = 16; // Can view a specific version
5832
5833
  exports.PermEdit = (exports.PermWrite | exports.PermOwner);
5833
5834
  exports.PermAll = (exports.PermRead | exports.PermWrite | exports.PermOwner | exports.PermAdmin);
5834
5835
  // Server State
@@ -7297,18 +7298,13 @@ function polyContainsPoint(poly, x, y) {
7297
7298
  let pp = PP.polyPack(poly);
7298
7299
  if (pp == null)
7299
7300
  return false;
7300
- let bFound = false;
7301
7301
  let bInside = false;
7302
7302
  let iCurPoly = -1;
7303
7303
  let bCurInside = false;
7304
7304
  PP.polyPackEachRing(pp, (b, iPoly, iRing, iOffset, nPoints) => {
7305
- if (bFound)
7306
- return;
7307
7305
  if (iRing == 0) {
7308
- if (iCurPoly >= 0 && bCurInside) {
7306
+ if (iCurPoly >= 0 && bCurInside)
7309
7307
  bInside = true;
7310
- bFound = true;
7311
- }
7312
7308
  iCurPoly = iPoly;
7313
7309
  bCurInside = false;
7314
7310
  }
@@ -10376,17 +10372,13 @@ function polyIntersectArea(p1, p2) {
10376
10372
  let pp2 = Poly.polyNormalize(p2);
10377
10373
  let area = 0;
10378
10374
  PP.polyPackEachRing(pp1, (buffer1, iPoly1, iRing1, iOffset1, nPoints1) => {
10379
- if (iRing1 == 0) {
10380
- let c1 = unpackCoords(buffer1, iOffset1, nPoints1);
10381
- PP.polyPackEachRing(pp2, (buffer2, iPoly2, iRing2, iOffset2, nPoints2) => {
10382
- if (iRing2 == 0) {
10383
- let c2 = unpackCoords(buffer2, iOffset2, nPoints2);
10384
- let result = _intersection(c1, c2);
10385
- if (result && result.length > 0)
10386
- area += Poly.polyArea(result);
10387
- }
10388
- });
10389
- }
10375
+ let c1 = unpackCoords(buffer1, iOffset1, nPoints1);
10376
+ PP.polyPackEachRing(pp2, (buffer2, iPoly2, iRing2, iOffset2, nPoints2) => {
10377
+ let c2 = unpackCoords(buffer2, iOffset2, nPoints2);
10378
+ let result = _intersection(c1, c2);
10379
+ if (result && result.length > 0)
10380
+ area += Poly.polyArea(result) * ((!iRing1 == !iRing2) ? 1 : -1);
10381
+ });
10390
10382
  });
10391
10383
  return area;
10392
10384
  }