@digipair/skill-canvas 0.117.7 → 0.117.9

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.
Files changed (2) hide show
  1. package/dist/index.esm.js +285 -95
  2. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -1,5 +1,3 @@
1
- import { snakeCase, kebabCase, camelCase } from 'case-anything/dist/index.js';
2
-
3
1
  function _mergeNamespaces(n, m) {
4
2
  m.forEach(function(e) {
5
3
  e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
@@ -8194,7 +8192,7 @@ function _create_class$v(Constructor, protoProps, staticProps) {
8194
8192
  if (staticProps) _defineProperties$v(Constructor, staticProps);
8195
8193
  return Constructor;
8196
8194
  }
8197
- function _define_property$4(obj, key, value) {
8195
+ function _define_property$5(obj, key, value) {
8198
8196
  if (key in obj) {
8199
8197
  Object.defineProperty(obj, key, {
8200
8198
  value: value,
@@ -8269,7 +8267,7 @@ function _non_iterable_rest$5() {
8269
8267
  function _non_iterable_spread$6() {
8270
8268
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8271
8269
  }
8272
- function _object_spread$2(target) {
8270
+ function _object_spread$3(target) {
8273
8271
  for(var i = 1; i < arguments.length; i++){
8274
8272
  var source = arguments[i] != null ? arguments[i] : {};
8275
8273
  var ownKeys = Object.keys(source);
@@ -8279,12 +8277,12 @@ function _object_spread$2(target) {
8279
8277
  }));
8280
8278
  }
8281
8279
  ownKeys.forEach(function(key) {
8282
- _define_property$4(target, key, source[key]);
8280
+ _define_property$5(target, key, source[key]);
8283
8281
  });
8284
8282
  }
8285
8283
  return target;
8286
8284
  }
8287
- function ownKeys$1(object, enumerableOnly) {
8285
+ function ownKeys$2(object, enumerableOnly) {
8288
8286
  var keys = Object.keys(object);
8289
8287
  if (Object.getOwnPropertySymbols) {
8290
8288
  var symbols = Object.getOwnPropertySymbols(object);
@@ -8292,12 +8290,12 @@ function ownKeys$1(object, enumerableOnly) {
8292
8290
  }
8293
8291
  return keys;
8294
8292
  }
8295
- function _object_spread_props$1(target, source) {
8293
+ function _object_spread_props$2(target, source) {
8296
8294
  source = source != null ? source : {};
8297
8295
  if (Object.getOwnPropertyDescriptors) {
8298
8296
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
8299
8297
  } else {
8300
- ownKeys$1(Object(source)).forEach(function(key) {
8298
+ ownKeys$2(Object(source)).forEach(function(key) {
8301
8299
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
8302
8300
  });
8303
8301
  }
@@ -9168,7 +9166,7 @@ function getCachedWeekInfo(locString) {
9168
9166
  data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo;
9169
9167
  // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86
9170
9168
  if (!("minimalDays" in data)) {
9171
- data = _object_spread$2({}, fallbackWeekSettings, data);
9169
+ data = _object_spread$3({}, fallbackWeekSettings, data);
9172
9170
  }
9173
9171
  weekInfoCache.set(locString, data);
9174
9172
  }
@@ -9275,7 +9273,7 @@ function supportsFastNumbers(loc) {
9275
9273
  "floor"
9276
9274
  ]);
9277
9275
  if (!forceSimple || Object.keys(otherOpts).length > 0) {
9278
- var intlOpts = _object_spread$2({
9276
+ var intlOpts = _object_spread$3({
9279
9277
  useGrouping: false
9280
9278
  }, opts);
9281
9279
  if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;
@@ -9345,7 +9343,7 @@ function supportsFastNumbers(loc) {
9345
9343
  });
9346
9344
  this.originalZone = dt.zone;
9347
9345
  }
9348
- var intlOpts = _object_spread$2({}, this.opts);
9346
+ var intlOpts = _object_spread$3({}, this.opts);
9349
9347
  intlOpts.timeZone = intlOpts.timeZone || z;
9350
9348
  this.dtf = getCachedDTF(intl, intlOpts);
9351
9349
  }
@@ -9376,7 +9374,7 @@ function supportsFastNumbers(loc) {
9376
9374
  locale: _this.dt.locale,
9377
9375
  format: _this.opts.timeZoneName
9378
9376
  });
9379
- return _object_spread_props$1(_object_spread$2({}, part), {
9377
+ return _object_spread_props$2(_object_spread$3({}, part), {
9380
9378
  value: offsetName
9381
9379
  });
9382
9380
  } else {
@@ -9401,7 +9399,7 @@ function supportsFastNumbers(loc) {
9401
9399
  */ var PolyRelFormatter = /*#__PURE__*/ function() {
9402
9400
  function PolyRelFormatter(intl, isEnglish, opts) {
9403
9401
  _class_call_check$A(this, PolyRelFormatter);
9404
- this.opts = _object_spread$2({
9402
+ this.opts = _object_spread$3({
9405
9403
  style: "long"
9406
9404
  }, opts);
9407
9405
  if (!isEnglish && hasRelative()) {
@@ -9496,7 +9494,7 @@ var fallbackWeekSettings = {
9496
9494
  key: "redefaultToEN",
9497
9495
  value: function redefaultToEN() {
9498
9496
  var alts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
9499
- return this.clone(_object_spread_props$1(_object_spread$2({}, alts), {
9497
+ return this.clone(_object_spread_props$2(_object_spread$3({}, alts), {
9500
9498
  defaultToEN: true
9501
9499
  }));
9502
9500
  }
@@ -9505,7 +9503,7 @@ var fallbackWeekSettings = {
9505
9503
  key: "redefaultToSystem",
9506
9504
  value: function redefaultToSystem() {
9507
9505
  var alts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
9508
- return this.clone(_object_spread_props$1(_object_spread$2({}, alts), {
9506
+ return this.clone(_object_spread_props$2(_object_spread$3({}, alts), {
9509
9507
  defaultToEN: false
9510
9508
  }));
9511
9509
  }
@@ -10384,7 +10382,7 @@ function isoWeekdayToLocal(isoWeekday, startOfWeek) {
10384
10382
  } else {
10385
10383
  weekYear = year;
10386
10384
  }
10387
- return _object_spread$2({
10385
+ return _object_spread$3({
10388
10386
  weekYear: weekYear,
10389
10387
  weekNumber: weekNumber,
10390
10388
  weekday: weekday
@@ -10404,7 +10402,7 @@ function weekToGregorian(weekData) {
10404
10402
  year = weekYear;
10405
10403
  }
10406
10404
  var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), month = _uncomputeOrdinal.month, day = _uncomputeOrdinal.day;
10407
- return _object_spread$2({
10405
+ return _object_spread$3({
10408
10406
  year: year,
10409
10407
  month: month,
10410
10408
  day: day
@@ -10413,7 +10411,7 @@ function weekToGregorian(weekData) {
10413
10411
  function gregorianToOrdinal(gregData) {
10414
10412
  var year = gregData.year, month = gregData.month, day = gregData.day;
10415
10413
  var ordinal = computeOrdinal(year, month, day);
10416
- return _object_spread$2({
10414
+ return _object_spread$3({
10417
10415
  year: year,
10418
10416
  ordinal: ordinal
10419
10417
  }, timeObject(gregData));
@@ -10421,7 +10419,7 @@ function gregorianToOrdinal(gregData) {
10421
10419
  function ordinalToGregorian(ordinalData) {
10422
10420
  var year = ordinalData.year, ordinal = ordinalData.ordinal;
10423
10421
  var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), month = _uncomputeOrdinal.month, day = _uncomputeOrdinal.day;
10424
- return _object_spread$2({
10422
+ return _object_spread$3({
10425
10423
  year: year,
10426
10424
  month: month,
10427
10425
  day: day
@@ -10717,7 +10715,7 @@ function parseZoneInfo(ts, offsetFormat, locale) {
10717
10715
  if (timeZone) {
10718
10716
  intlOpts.timeZone = timeZone;
10719
10717
  }
10720
- var modified = _object_spread$2({
10718
+ var modified = _object_spread$3({
10721
10719
  timeZoneName: offsetFormat
10722
10720
  }, intlOpts);
10723
10721
  var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function(m) {
@@ -11076,7 +11074,7 @@ var macroTokenToFormatOpts = {
11076
11074
  if (this.systemLoc === null) {
11077
11075
  this.systemLoc = this.loc.redefaultToSystem();
11078
11076
  }
11079
- var df = this.systemLoc.dtFormatter(dt, _object_spread$2({}, this.opts, opts));
11077
+ var df = this.systemLoc.dtFormatter(dt, _object_spread$3({}, this.opts, opts));
11080
11078
  return df.format();
11081
11079
  }
11082
11080
  },
@@ -11084,7 +11082,7 @@ var macroTokenToFormatOpts = {
11084
11082
  key: "dtFormatter",
11085
11083
  value: function dtFormatter(dt) {
11086
11084
  var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
11087
- return this.loc.dtFormatter(dt, _object_spread$2({}, this.opts, opts));
11085
+ return this.loc.dtFormatter(dt, _object_spread$3({}, this.opts, opts));
11088
11086
  }
11089
11087
  },
11090
11088
  {
@@ -11120,7 +11118,7 @@ var macroTokenToFormatOpts = {
11120
11118
  if (this.opts.forceSimple) {
11121
11119
  return padStart(n, p);
11122
11120
  }
11123
- var opts = _object_spread$2({}, this.opts);
11121
+ var opts = _object_spread$3({}, this.opts);
11124
11122
  if (p > 0) {
11125
11123
  opts.padTo = p;
11126
11124
  }
@@ -11536,7 +11534,7 @@ function combineExtractors() {
11536
11534
  var _param = _sliced_to_array$5(param, 3), mergedVals = _param[0], mergedZone = _param[1], cursor = _param[2];
11537
11535
  var _ex = _sliced_to_array$5(ex(m, cursor), 3), val = _ex[0], zone = _ex[1], next = _ex[2];
11538
11536
  return [
11539
- _object_spread$2({}, mergedVals, val),
11537
+ _object_spread$3({}, mergedVals, val),
11540
11538
  zone || mergedZone,
11541
11539
  next
11542
11540
  ];
@@ -11847,7 +11845,7 @@ var lowOrderMatrix = {
11847
11845
  seconds: {
11848
11846
  milliseconds: 1000
11849
11847
  }
11850
- }, casualMatrix = _object_spread$2({
11848
+ }, casualMatrix = _object_spread$3({
11851
11849
  years: {
11852
11850
  quarters: 4,
11853
11851
  months: 12,
@@ -11875,7 +11873,7 @@ var lowOrderMatrix = {
11875
11873
  seconds: 30 * 24 * 60 * 60,
11876
11874
  milliseconds: 30 * 24 * 60 * 60 * 1000
11877
11875
  }
11878
- }, lowOrderMatrix), daysInYearAccurate = 146097.0 / 400, daysInMonthAccurate = 146097.0 / 4800, accurateMatrix = _object_spread$2({
11876
+ }, lowOrderMatrix), daysInYearAccurate = 146097.0 / 400, daysInMonthAccurate = 146097.0 / 4800, accurateMatrix = _object_spread$3({
11879
11877
  years: {
11880
11878
  quarters: 4,
11881
11879
  months: 12,
@@ -11922,7 +11920,7 @@ function clone$1(dur, alts) {
11922
11920
  var clear = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
11923
11921
  // deep merge for vals
11924
11922
  var conf = {
11925
- values: clear ? alts.values : _object_spread$2({}, dur.values, alts.values || {}),
11923
+ values: clear ? alts.values : _object_spread$3({}, dur.values, alts.values || {}),
11926
11924
  loc: dur.loc.clone(alts.loc),
11927
11925
  conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,
11928
11926
  matrix: alts.matrix || dur.matrix
@@ -12121,7 +12119,7 @@ function removeZeroes(vals) {
12121
12119
  value: function toFormat(fmt) {
12122
12120
  var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
12123
12121
  // reverse-compat since 1.2; we always round down now, never up, and we do it by default
12124
- var fmtOpts = _object_spread_props$1(_object_spread$2({}, opts), {
12122
+ var fmtOpts = _object_spread_props$2(_object_spread$3({}, opts), {
12125
12123
  floor: opts.round !== false && opts.floor !== false
12126
12124
  });
12127
12125
  return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2;
@@ -12154,7 +12152,7 @@ function removeZeroes(vals) {
12154
12152
  if (isUndefined$2(val) || val === 0 && !showZeros) {
12155
12153
  return null;
12156
12154
  }
12157
- return _this.loc.numberFormatter(_object_spread_props$1(_object_spread$2({
12155
+ return _this.loc.numberFormatter(_object_spread_props$2(_object_spread$3({
12158
12156
  style: "unit",
12159
12157
  unitDisplay: "long"
12160
12158
  }, opts), {
@@ -12163,7 +12161,7 @@ function removeZeroes(vals) {
12163
12161
  }).filter(function(n) {
12164
12162
  return n;
12165
12163
  });
12166
- return this.loc.listFormatter(_object_spread$2({
12164
+ return this.loc.listFormatter(_object_spread$3({
12167
12165
  type: "conjunction",
12168
12166
  style: opts.listStyle || "narrow"
12169
12167
  }, opts)).format(l);
@@ -12177,7 +12175,7 @@ function removeZeroes(vals) {
12177
12175
  */ key: "toObject",
12178
12176
  value: function toObject() {
12179
12177
  if (!this.isValid) return {};
12180
- return _object_spread$2({}, this.values);
12178
+ return _object_spread$3({}, this.values);
12181
12179
  }
12182
12180
  },
12183
12181
  {
@@ -12230,7 +12228,7 @@ function removeZeroes(vals) {
12230
12228
  if (!this.isValid) return null;
12231
12229
  var millis = this.toMillis();
12232
12230
  if (millis < 0 || millis >= 86400000) return null;
12233
- opts = _object_spread_props$1(_object_spread$2({
12231
+ opts = _object_spread_props$2(_object_spread$3({
12234
12232
  suppressMilliseconds: false,
12235
12233
  suppressSeconds: false,
12236
12234
  includePrefix: false,
@@ -12401,7 +12399,7 @@ function removeZeroes(vals) {
12401
12399
  */ key: "set",
12402
12400
  value: function set(values) {
12403
12401
  if (!this.isValid) return this;
12404
- var mixed = _object_spread$2({}, this.values, normalizeObject(values, Duration.normalizeUnit));
12402
+ var mixed = _object_spread$3({}, this.values, normalizeObject(values, Duration.normalizeUnit));
12405
12403
  return clone$1(this, {
12406
12404
  values: mixed
12407
12405
  });
@@ -14012,7 +14010,7 @@ function diff(earlier, later, units, opts) {
14012
14010
  });
14013
14011
  if (lowerOrderUnits.length === 0) {
14014
14012
  if (highWater < later) {
14015
- highWater = cursor.plus(_define_property$4({}, lowestOrder, 1));
14013
+ highWater = cursor.plus(_define_property$5({}, lowestOrder, 1));
14016
14014
  }
14017
14015
  if (highWater !== cursor) {
14018
14016
  results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);
@@ -14572,7 +14570,7 @@ function clone$2(inst, alts) {
14572
14570
  loc: inst.loc,
14573
14571
  invalid: inst.invalid
14574
14572
  };
14575
- return new DateTime(_object_spread_props$1(_object_spread$2({}, current, alts), {
14573
+ return new DateTime(_object_spread_props$2(_object_spread$3({}, current, alts), {
14576
14574
  old: current
14577
14575
  }));
14578
14576
  }
@@ -14626,7 +14624,7 @@ function objToTS(obj, offset, zone) {
14626
14624
  }
14627
14625
  // create a new DT instance by adding a duration, adjusting for DSTs
14628
14626
  function adjustTime(inst, dur) {
14629
- var oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = _object_spread_props$1(_object_spread$2({}, inst.c), {
14627
+ var oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = _object_spread_props$2(_object_spread$3({}, inst.c), {
14630
14628
  year: year,
14631
14629
  month: month,
14632
14630
  day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
@@ -14657,7 +14655,7 @@ function adjustTime(inst, dur) {
14657
14655
  function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {
14658
14656
  var setZone = opts.setZone, zone = opts.zone;
14659
14657
  if (parsed && Object.keys(parsed).length !== 0 || parsedZone) {
14660
- var interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, _object_spread_props$1(_object_spread$2({}, opts), {
14658
+ var interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, _object_spread_props$2(_object_spread$3({}, opts), {
14661
14659
  zone: interpretationZone,
14662
14660
  specificOffset: specificOffset
14663
14661
  }));
@@ -15677,11 +15675,11 @@ function lastOpts(argList) {
15677
15675
  }
15678
15676
  var mixed;
15679
15677
  if (settingWeekStuff) {
15680
- mixed = weekToGregorian(_object_spread$2({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek);
15678
+ mixed = weekToGregorian(_object_spread$3({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek);
15681
15679
  } else if (!isUndefined$2(normalized.ordinal)) {
15682
- mixed = ordinalToGregorian(_object_spread$2({}, gregorianToOrdinal(this.c), normalized));
15680
+ mixed = ordinalToGregorian(_object_spread$3({}, gregorianToOrdinal(this.c), normalized));
15683
15681
  } else {
15684
- mixed = _object_spread$2({}, this.toObject(), normalized);
15682
+ mixed = _object_spread$3({}, this.toObject(), normalized);
15685
15683
  // if we didn't set the day but we ended up on an overflow date,
15686
15684
  // use the last day of the right month
15687
15685
  if (isUndefined$2(normalized.day)) {
@@ -15800,7 +15798,7 @@ function lastOpts(argList) {
15800
15798
  * @return {DateTime}
15801
15799
  */ key: "endOf",
15802
15800
  value: function endOf(unit, opts) {
15803
- return this.isValid ? this.plus(_define_property$4({}, unit, 1)).startOf(unit, opts).minus(1) : this;
15801
+ return this.isValid ? this.plus(_define_property$5({}, unit, 1)).startOf(unit, opts).minus(1) : this;
15804
15802
  }
15805
15803
  },
15806
15804
  {
@@ -16128,7 +16126,7 @@ function lastOpts(argList) {
16128
16126
  value: function toObject() {
16129
16127
  var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
16130
16128
  if (!this.isValid) return {};
16131
- var base = _object_spread$2({}, this.c);
16129
+ var base = _object_spread$3({}, this.c);
16132
16130
  if (opts.includeConfig) {
16133
16131
  base.outputCalendar = this.outputCalendar;
16134
16132
  base.numberingSystem = this.loc.numberingSystem;
@@ -16168,7 +16166,7 @@ function lastOpts(argList) {
16168
16166
  if (!this.isValid || !otherDateTime.isValid) {
16169
16167
  return Duration.invalid("created by diffing an invalid DateTime");
16170
16168
  }
16171
- var durOpts = _object_spread$2({
16169
+ var durOpts = _object_spread$3({
16172
16170
  locale: this.locale,
16173
16171
  numberingSystem: this.numberingSystem
16174
16172
  }, opts);
@@ -16272,7 +16270,7 @@ function lastOpts(argList) {
16272
16270
  units = options.unit;
16273
16271
  unit = undefined;
16274
16272
  }
16275
- return diffRelative(base, this.plus(padding), _object_spread_props$1(_object_spread$2({}, options), {
16273
+ return diffRelative(base, this.plus(padding), _object_spread_props$2(_object_spread$3({}, options), {
16276
16274
  numeric: "always",
16277
16275
  units: units,
16278
16276
  unit: unit
@@ -16298,7 +16296,7 @@ function lastOpts(argList) {
16298
16296
  if (!this.isValid) return null;
16299
16297
  return diffRelative(options.base || DateTime.fromObject({}, {
16300
16298
  zone: this.zone
16301
- }), this, _object_spread_props$1(_object_spread$2({}, options), {
16299
+ }), this, _object_spread_props$2(_object_spread$3({}, options), {
16302
16300
  numeric: "auto",
16303
16301
  units: [
16304
16302
  "years",
@@ -22566,7 +22564,7 @@ function _create_class$r(Constructor, protoProps, staticProps) {
22566
22564
  if (staticProps) _defineProperties$r(Constructor, staticProps);
22567
22565
  return Constructor;
22568
22566
  }
22569
- function _define_property$3(obj, key, value) {
22567
+ function _define_property$4(obj, key, value) {
22570
22568
  if (key in obj) {
22571
22569
  Object.defineProperty(obj, key, {
22572
22570
  value: value,
@@ -22619,7 +22617,7 @@ function _non_iterable_rest$2() {
22619
22617
  function _non_iterable_spread$4() {
22620
22618
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
22621
22619
  }
22622
- function _object_spread$1(target) {
22620
+ function _object_spread$2(target) {
22623
22621
  for(var i = 1; i < arguments.length; i++){
22624
22622
  var source = arguments[i] != null ? arguments[i] : {};
22625
22623
  var ownKeys = Object.keys(source);
@@ -22629,12 +22627,12 @@ function _object_spread$1(target) {
22629
22627
  }));
22630
22628
  }
22631
22629
  ownKeys.forEach(function(key) {
22632
- _define_property$3(target, key, source[key]);
22630
+ _define_property$4(target, key, source[key]);
22633
22631
  });
22634
22632
  }
22635
22633
  return target;
22636
22634
  }
22637
- function ownKeys(object, enumerableOnly) {
22635
+ function ownKeys$1(object, enumerableOnly) {
22638
22636
  var keys = Object.keys(object);
22639
22637
  if (Object.getOwnPropertySymbols) {
22640
22638
  var symbols = Object.getOwnPropertySymbols(object);
@@ -22642,12 +22640,12 @@ function ownKeys(object, enumerableOnly) {
22642
22640
  }
22643
22641
  return keys;
22644
22642
  }
22645
- function _object_spread_props(target, source) {
22643
+ function _object_spread_props$1(target, source) {
22646
22644
  source = source != null ? source : {};
22647
22645
  if (Object.getOwnPropertyDescriptors) {
22648
22646
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
22649
22647
  } else {
22650
- ownKeys(Object(source)).forEach(function(key) {
22648
+ ownKeys$1(Object(source)).forEach(function(key) {
22651
22649
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
22652
22650
  });
22653
22651
  }
@@ -22840,14 +22838,14 @@ function indent(str, spaces) {
22840
22838
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
22841
22839
  // match is required
22842
22840
  if (!match) {
22843
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
22841
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
22844
22842
  v: nextMatch1
22845
22843
  };
22846
22844
  }
22847
22845
  var token = match.token, offset = match.offset;
22848
22846
  i1 += offset;
22849
22847
  if (token === ' ') {
22850
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
22848
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
22851
22849
  }
22852
22850
  tokens1 = _to_consumable_array$4(tokens1).concat([
22853
22851
  token
@@ -22866,7 +22864,7 @@ function indent(str, spaces) {
22866
22864
  if (contextKeys.some(function(el) {
22867
22865
  return el.startsWith(name);
22868
22866
  })) {
22869
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
22867
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
22870
22868
  }
22871
22869
  if (dateTimeIdentifiers.some(function(el) {
22872
22870
  return el === name;
@@ -22885,9 +22883,9 @@ function indent(str, spaces) {
22885
22883
  if (dateTimeIdentifiers.some(function(el) {
22886
22884
  return el.startsWith(name);
22887
22885
  })) {
22888
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
22886
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
22889
22887
  }
22890
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
22888
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
22891
22889
  v: nextMatch1
22892
22890
  };
22893
22891
  };
@@ -22899,7 +22897,7 @@ function indent(str, spaces) {
22899
22897
  }
22900
22898
  }
22901
22899
  var _obj;
22902
- var identifiersMap = (_obj = {}, _define_property$3(_obj, identifier, 'identifier'), _define_property$3(_obj, nameIdentifier, 'nameIdentifier'), _obj);
22900
+ var identifiersMap = (_obj = {}, _define_property$4(_obj, identifier, 'identifier'), _define_property$4(_obj, nameIdentifier, 'nameIdentifier'), _obj);
22903
22901
  var identifiers = new ExternalTokenizer(function(input, stack) {
22904
22902
  LOG_PARSE_DEBUG && console.log('%s: T <identifier | nameIdentifier>', input.pos);
22905
22903
  var nameMatch = parseName(input, stack.context);
@@ -22948,11 +22946,11 @@ var insertSemicolon = new ExternalTokenizer(function(input, stack) {
22948
22946
  }
22949
22947
  });
22950
22948
  var _obj1;
22951
- var prefixedContextStarts = (_obj1 = {}, _define_property$3(_obj1, functionInvocationStart, 'FunctionInvocation'), _define_property$3(_obj1, filterExpressionStart, 'FilterExpression'), _define_property$3(_obj1, pathExpressionStart, 'PathExpression'), _obj1);
22949
+ var prefixedContextStarts = (_obj1 = {}, _define_property$4(_obj1, functionInvocationStart, 'FunctionInvocation'), _define_property$4(_obj1, filterExpressionStart, 'FilterExpression'), _define_property$4(_obj1, pathExpressionStart, 'PathExpression'), _obj1);
22952
22950
  var _obj2;
22953
- var contextStarts = (_obj2 = {}, _define_property$3(_obj2, contextStart, 'Context'), _define_property$3(_obj2, functionDefinitionStart, 'FunctionDefinition'), _define_property$3(_obj2, forExpressionStart, 'ForExpression'), _define_property$3(_obj2, listStart, 'List'), _define_property$3(_obj2, ifExpressionStart, 'IfExpression'), _define_property$3(_obj2, quantifiedExpressionStart, 'QuantifiedExpression'), _obj2);
22951
+ var contextStarts = (_obj2 = {}, _define_property$4(_obj2, contextStart, 'Context'), _define_property$4(_obj2, functionDefinitionStart, 'FunctionDefinition'), _define_property$4(_obj2, forExpressionStart, 'ForExpression'), _define_property$4(_obj2, listStart, 'List'), _define_property$4(_obj2, ifExpressionStart, 'IfExpression'), _define_property$4(_obj2, quantifiedExpressionStart, 'QuantifiedExpression'), _obj2);
22954
22952
  var _obj3;
22955
- var contextEnds = (_obj3 = {}, _define_property$3(_obj3, Context, 'Context'), _define_property$3(_obj3, FunctionDefinition, 'FunctionDefinition'), _define_property$3(_obj3, ForExpression, 'ForExpression'), _define_property$3(_obj3, List, 'List'), _define_property$3(_obj3, IfExpression, 'IfExpression'), _define_property$3(_obj3, QuantifiedExpression, 'QuantifiedExpression'), _define_property$3(_obj3, PathExpression, 'PathExpression'), _define_property$3(_obj3, FunctionInvocation, 'FunctionInvocation'), _define_property$3(_obj3, FilterExpression, 'FilterExpression'), _define_property$3(_obj3, ArithmeticExpression, 'ArithmeticExpression'), _obj3);
22953
+ var contextEnds = (_obj3 = {}, _define_property$4(_obj3, Context, 'Context'), _define_property$4(_obj3, FunctionDefinition, 'FunctionDefinition'), _define_property$4(_obj3, ForExpression, 'ForExpression'), _define_property$4(_obj3, List, 'List'), _define_property$4(_obj3, IfExpression, 'IfExpression'), _define_property$4(_obj3, QuantifiedExpression, 'QuantifiedExpression'), _define_property$4(_obj3, PathExpression, 'PathExpression'), _define_property$4(_obj3, FunctionInvocation, 'FunctionInvocation'), _define_property$4(_obj3, FilterExpression, 'FilterExpression'), _define_property$4(_obj3, ArithmeticExpression, 'ArithmeticExpression'), _obj3);
22956
22954
  /**
22957
22955
  * A simple producer that retrievs a value from
22958
22956
  * a given context. Used to lazily take things.
@@ -23040,7 +23038,7 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
23040
23038
  */ key: "set",
23041
23039
  value: function set(key, value) {
23042
23040
  var constructor = /** @type { typeof VariableContext } */ this.constructor;
23043
- return constructor.of(_object_spread_props(_object_spread$1({}, this.value), _define_property$3({}, key, value)));
23041
+ return constructor.of(_object_spread_props$1(_object_spread$2({}, this.value), _define_property$4({}, key, value)));
23044
23042
  }
23045
23043
  },
23046
23044
  {
@@ -23104,7 +23102,7 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
23104
23102
  if ((typeof context === "undefined" ? "undefined" : _type_of$z(context)) !== 'object') {
23105
23103
  return {};
23106
23104
  }
23107
- return _object_spread$1({}, context);
23105
+ return _object_spread$2({}, context);
23108
23106
  }
23109
23107
  },
23110
23108
  {
@@ -23122,13 +23120,13 @@ var dateTimeIdentifiers = Object.keys(dateTimeLiterals);
23122
23120
  return reduce$1(this.__unwrap(other), function(merged, value, key) {
23123
23121
  if (_instanceof$f(value, ValueProducer)) {
23124
23122
  // keep value producers in tact
23125
- return _object_spread_props(_object_spread$1({}, merged), _define_property$3({}, key, value));
23123
+ return _object_spread_props$1(_object_spread$2({}, merged), _define_property$4({}, key, value));
23126
23124
  }
23127
23125
  value = _this.__unwrap(value);
23128
23126
  if (has$2(merged, key)) {
23129
23127
  value = _this.__merge(_this.__unwrap(merged[key]), value);
23130
23128
  }
23131
- return _object_spread_props(_object_spread$1({}, merged), _define_property$3({}, key, value));
23129
+ return _object_spread_props$1(_object_spread$2({}, merged), _define_property$4({}, key, value));
23132
23130
  }, this.__unwrap(context));
23133
23131
  }
23134
23132
  }
@@ -23347,7 +23345,7 @@ var Variables = /*#__PURE__*/ function() {
23347
23345
  */ key: "assign",
23348
23346
  value: function assign() {
23349
23347
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
23350
- return Variables.of(_object_spread$1({}, this, options));
23348
+ return Variables.of(_object_spread$2({}, this, options));
23351
23349
  }
23352
23350
  },
23353
23351
  {
@@ -23362,7 +23360,7 @@ var Variables = /*#__PURE__*/ function() {
23362
23360
  context: this.context,
23363
23361
  parent: this.parent
23364
23362
  };
23365
- return Variables.of(_object_spread$1({}, defaultOptions, options));
23363
+ return Variables.of(_object_spread$2({}, defaultOptions, options));
23366
23364
  }
23367
23365
  }
23368
23366
  ], [
@@ -23845,7 +23843,7 @@ function _create_class$q(Constructor, protoProps, staticProps) {
23845
23843
  if (protoProps) _defineProperties$q(Constructor.prototype, protoProps);
23846
23844
  return Constructor;
23847
23845
  }
23848
- function _define_property$2(obj, key, value) {
23846
+ function _define_property$3(obj, key, value) {
23849
23847
  if (key in obj) {
23850
23848
  Object.defineProperty(obj, key, {
23851
23849
  value: value,
@@ -25152,7 +25150,7 @@ var builtins = {
25152
25150
  if (key in context) {
25153
25151
  return FALSE;
25154
25152
  }
25155
- return Object.assign(Object.assign({}, context), _define_property$2({}, entry.key, entry.value));
25153
+ return Object.assign(Object.assign({}, context), _define_property$3({}, entry.key, entry.value));
25156
25154
  }, {});
25157
25155
  if (context === FALSE) {
25158
25156
  return null;
@@ -25205,7 +25203,7 @@ var builtins = {
25205
25203
  return null;
25206
25204
  }
25207
25205
  }
25208
- return Object.assign(Object.assign({}, context), _define_property$2({}, key, value));
25206
+ return Object.assign(Object.assign({}, context), _define_property$3({}, key, value));
25209
25207
  }
25210
25208
  function matches(a, b) {
25211
25209
  return a === b;
@@ -25932,7 +25930,7 @@ function evalNode(node, input, args) {
25932
25930
  return function(context) {
25933
25931
  return args.slice(1, -1).reduce(function(obj, arg) {
25934
25932
  var _arg = _sliced_to_array$1(arg(Object.assign(Object.assign({}, context), obj)), 2), key = _arg[0], value = _arg[1];
25935
- return Object.assign(Object.assign({}, obj), _define_property$2({}, key, value));
25933
+ return Object.assign(Object.assign({}, obj), _define_property$3({}, key, value));
25936
25934
  }, {});
25937
25935
  };
25938
25936
  case 'FunctionBody':
@@ -26429,7 +26427,7 @@ function extractValue(context, prop, _target) {
26429
26427
  'range'
26430
26428
  ].includes(getType(target))) {
26431
26429
  return target.map(function(t) {
26432
- return _define_property$2({}, prop, t);
26430
+ return _define_property$3({}, prop, t);
26433
26431
  });
26434
26432
  }
26435
26433
  return null;
@@ -42893,7 +42891,7 @@ function _class_call_check$1(instance, Constructor) {
42893
42891
  throw new TypeError("Cannot call a class as a function");
42894
42892
  }
42895
42893
  }
42896
- function _define_property$1(obj, key, value) {
42894
+ function _define_property$2(obj, key, value) {
42897
42895
  if (key in obj) {
42898
42896
  Object.defineProperty(obj, key, {
42899
42897
  value: value,
@@ -42973,7 +42971,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
42973
42971
  _class_call_check$1(this, CelParser);
42974
42972
  var _this;
42975
42973
  _this = _super.call(this, allTokens);
42976
- _define_property$1(_assert_this_initialized$1(_this), "expr", _this.RULE('expr', function() {
42974
+ _define_property$2(_assert_this_initialized$1(_this), "expr", _this.RULE('expr', function() {
42977
42975
  _this.SUBRULE(_this.conditionalOr, {
42978
42976
  LABEL: 'conditionalOr'
42979
42977
  });
@@ -42988,7 +42986,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
42988
42986
  });
42989
42987
  });
42990
42988
  }));
42991
- _define_property$1(_assert_this_initialized$1(_this), "conditionalAnd", _this.RULE('conditionalAnd', function() {
42989
+ _define_property$2(_assert_this_initialized$1(_this), "conditionalAnd", _this.RULE('conditionalAnd', function() {
42992
42990
  _this.SUBRULE(_this.relation, {
42993
42991
  LABEL: 'lhs'
42994
42992
  });
@@ -42999,7 +42997,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
42999
42997
  });
43000
42998
  });
43001
42999
  }));
43002
- _define_property$1(_assert_this_initialized$1(_this), "conditionalOr", _this.RULE('conditionalOr', function() {
43000
+ _define_property$2(_assert_this_initialized$1(_this), "conditionalOr", _this.RULE('conditionalOr', function() {
43003
43001
  _this.SUBRULE(_this.conditionalAnd, {
43004
43002
  LABEL: 'lhs'
43005
43003
  });
@@ -43010,7 +43008,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43010
43008
  });
43011
43009
  });
43012
43010
  }));
43013
- _define_property$1(_assert_this_initialized$1(_this), "relation", _this.RULE('relation', function() {
43011
+ _define_property$2(_assert_this_initialized$1(_this), "relation", _this.RULE('relation', function() {
43014
43012
  _this.SUBRULE(_this.addition, {
43015
43013
  LABEL: 'lhs'
43016
43014
  });
@@ -43021,7 +43019,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43021
43019
  });
43022
43020
  });
43023
43021
  }));
43024
- _define_property$1(_assert_this_initialized$1(_this), "addition", _this.RULE('addition', function() {
43022
+ _define_property$2(_assert_this_initialized$1(_this), "addition", _this.RULE('addition', function() {
43025
43023
  _this.SUBRULE(_this.multiplication, {
43026
43024
  LABEL: 'lhs'
43027
43025
  });
@@ -43032,7 +43030,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43032
43030
  });
43033
43031
  });
43034
43032
  }));
43035
- _define_property$1(_assert_this_initialized$1(_this), "multiplication", _this.RULE('multiplication', function() {
43033
+ _define_property$2(_assert_this_initialized$1(_this), "multiplication", _this.RULE('multiplication', function() {
43036
43034
  _this.SUBRULE(_this.unaryExpression, {
43037
43035
  LABEL: 'lhs'
43038
43036
  });
@@ -43043,13 +43041,13 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43043
43041
  });
43044
43042
  });
43045
43043
  }));
43046
- _define_property$1(_assert_this_initialized$1(_this), "unaryExpression", _this.RULE('unaryExpression', function() {
43044
+ _define_property$2(_assert_this_initialized$1(_this), "unaryExpression", _this.RULE('unaryExpression', function() {
43047
43045
  _this.MANY(function() {
43048
43046
  _this.CONSUME(UnaryOperator);
43049
43047
  });
43050
43048
  _this.SUBRULE(_this.atomicExpression);
43051
43049
  }));
43052
- _define_property$1(_assert_this_initialized$1(_this), "parenthesisExpression", _this.RULE('parenthesisExpression', function() {
43050
+ _define_property$2(_assert_this_initialized$1(_this), "parenthesisExpression", _this.RULE('parenthesisExpression', function() {
43053
43051
  _this.CONSUME(OpenParenthesis, {
43054
43052
  LABEL: 'open'
43055
43053
  });
@@ -43058,7 +43056,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43058
43056
  LABEL: 'close'
43059
43057
  });
43060
43058
  }));
43061
- _define_property$1(_assert_this_initialized$1(_this), "listExpression", _this.RULE('listExpression', function() {
43059
+ _define_property$2(_assert_this_initialized$1(_this), "listExpression", _this.RULE('listExpression', function() {
43062
43060
  _this.CONSUME(OpenBracket);
43063
43061
  _this.OPTION(function() {
43064
43062
  _this.SUBRULE(_this.expr, {
@@ -43078,7 +43076,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43078
43076
  });
43079
43077
  });
43080
43078
  }));
43081
- _define_property$1(_assert_this_initialized$1(_this), "mapExpression", _this.RULE('mapExpression', function() {
43079
+ _define_property$2(_assert_this_initialized$1(_this), "mapExpression", _this.RULE('mapExpression', function() {
43082
43080
  _this.CONSUME(OpenCurlyBracket);
43083
43081
  _this.MANY(function() {
43084
43082
  _this.SUBRULE(_this.mapKeyValues, {
@@ -43103,7 +43101,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43103
43101
  ]);
43104
43102
  });
43105
43103
  }));
43106
- _define_property$1(_assert_this_initialized$1(_this), "mapKeyValues", _this.RULE('mapKeyValues', function() {
43104
+ _define_property$2(_assert_this_initialized$1(_this), "mapKeyValues", _this.RULE('mapKeyValues', function() {
43107
43105
  _this.SUBRULE(_this.expr, {
43108
43106
  LABEL: 'key'
43109
43107
  });
@@ -43115,7 +43113,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43115
43113
  _this.CONSUME(Comma);
43116
43114
  });
43117
43115
  }));
43118
- _define_property$1(_assert_this_initialized$1(_this), "macrosExpression", _this.RULE('macrosExpression', function() {
43116
+ _define_property$2(_assert_this_initialized$1(_this), "macrosExpression", _this.RULE('macrosExpression', function() {
43119
43117
  _this.CONSUME(Identifier);
43120
43118
  _this.CONSUME(OpenParenthesis);
43121
43119
  _this.OPTION(function() {
@@ -43131,7 +43129,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43131
43129
  });
43132
43130
  _this.CONSUME(CloseParenthesis);
43133
43131
  }));
43134
- _define_property$1(_assert_this_initialized$1(_this), "identifierExpression", _this.RULE('identifierExpression', function() {
43132
+ _define_property$2(_assert_this_initialized$1(_this), "identifierExpression", _this.RULE('identifierExpression', function() {
43135
43133
  _this.CONSUME(Identifier);
43136
43134
  _this.MANY(function() {
43137
43135
  _this.OR([
@@ -43150,7 +43148,7 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43150
43148
  ]);
43151
43149
  });
43152
43150
  }));
43153
- _define_property$1(_assert_this_initialized$1(_this), "identifierDotExpression", _this.RULE('identifierDotExpression', function() {
43151
+ _define_property$2(_assert_this_initialized$1(_this), "identifierDotExpression", _this.RULE('identifierDotExpression', function() {
43154
43152
  _this.CONSUME(Dot);
43155
43153
  _this.CONSUME(Identifier);
43156
43154
  // Optional method call with arguments (for collection macros)
@@ -43170,12 +43168,12 @@ var CelParser = /*#__PURE__*/ function(CstParser) {
43170
43168
  _this.CONSUME(CloseParenthesis);
43171
43169
  });
43172
43170
  }));
43173
- _define_property$1(_assert_this_initialized$1(_this), "indexExpression", _this.RULE('indexExpression', function() {
43171
+ _define_property$2(_assert_this_initialized$1(_this), "indexExpression", _this.RULE('indexExpression', function() {
43174
43172
  _this.CONSUME(OpenBracket);
43175
43173
  _this.SUBRULE(_this.expr);
43176
43174
  _this.CONSUME(CloseBracket);
43177
43175
  }));
43178
- _define_property$1(_assert_this_initialized$1(_this), "atomicExpression", _this.RULE('atomicExpression', function() {
43176
+ _define_property$2(_assert_this_initialized$1(_this), "atomicExpression", _this.RULE('atomicExpression', function() {
43179
43177
  _this.OR([
43180
43178
  {
43181
43179
  ALT: function() {
@@ -43284,7 +43282,7 @@ function _create_class(Constructor, protoProps, staticProps) {
43284
43282
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
43285
43283
  return Constructor;
43286
43284
  }
43287
- function _define_property(obj, key, value) {
43285
+ function _define_property$1(obj, key, value) {
43288
43286
  if (key in obj) {
43289
43287
  Object.defineProperty(obj, key, {
43290
43288
  value: value,
@@ -43356,7 +43354,7 @@ function _non_iterable_rest() {
43356
43354
  function _non_iterable_spread() {
43357
43355
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
43358
43356
  }
43359
- function _object_spread(target) {
43357
+ function _object_spread$1(target) {
43360
43358
  for(var i = 1; i < arguments.length; i++){
43361
43359
  var source = arguments[i] != null ? arguments[i] : {};
43362
43360
  var ownKeys = Object.keys(source);
@@ -43366,7 +43364,7 @@ function _object_spread(target) {
43366
43364
  }));
43367
43365
  }
43368
43366
  ownKeys.forEach(function(key) {
43369
- _define_property(target, key, source[key]);
43367
+ _define_property$1(target, key, source[key]);
43370
43368
  });
43371
43369
  }
43372
43370
  return target;
@@ -43452,13 +43450,13 @@ var CelVisitor = /*#__PURE__*/ function(BaseCelVisitor) {
43452
43450
  _class_call_check(this, CelVisitor);
43453
43451
  var _this;
43454
43452
  _this = _super.call(this);
43455
- _define_property(_assert_this_initialized(_this), "context", void 0);
43453
+ _define_property$1(_assert_this_initialized(_this), "context", void 0);
43456
43454
  /**
43457
43455
  * Tracks the current mode of the visitor to handle special cases.
43458
- */ _define_property(_assert_this_initialized(_this), "mode", Mode.normal);
43459
- _define_property(_assert_this_initialized(_this), "functions", void 0);
43456
+ */ _define_property$1(_assert_this_initialized(_this), "mode", Mode.normal);
43457
+ _define_property$1(_assert_this_initialized(_this), "functions", void 0);
43460
43458
  _this.context = context || {};
43461
- _this.functions = _object_spread({}, defaultFunctions, functions || {});
43459
+ _this.functions = _object_spread$1({}, defaultFunctions, functions || {});
43462
43460
  _this.validateVisitor();
43463
43461
  return _this;
43464
43462
  }
@@ -44199,6 +44197,198 @@ function evaluate(expression, context, functions) {
44199
44197
  }
44200
44198
  return toAstVisitorInstance.visit(result.cst);
44201
44199
  }
44200
+ // Latin-1 Supplement
44201
+ // upper case ranges
44202
+ // [À-ÖØ-ß]
44203
+ // lower case ranges
44204
+ // [à-öø-ÿ]
44205
+ var magicSplit = /^[a-zà-öø-ÿа-я]+|[A-ZÀ-ÖØ-ßА-Я][a-zà-öø-ÿа-я]+|[a-zà-öø-ÿа-я]+|[0-9]+|[A-ZÀ-ÖØ-ßА-Я]+(?![a-zà-öø-ÿа-я])/g;
44206
+ var spaceSplit = /\S+/g;
44207
+ /**
44208
+ * A string.matchAll function that will return an array of "string parts" and the indexes at which it split each part
44209
+ */ function getPartsAndIndexes(string, splitRegex) {
44210
+ var result = {
44211
+ parts: [],
44212
+ prefixes: []
44213
+ };
44214
+ var matches = string.matchAll(splitRegex);
44215
+ var lastWordEndIndex = 0;
44216
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
44217
+ try {
44218
+ for(var _iterator = matches[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
44219
+ var match = _step.value;
44220
+ if (typeof match.index !== 'number') continue;
44221
+ var word = match[0];
44222
+ result.parts.push(word);
44223
+ var prefix = string.slice(lastWordEndIndex, match.index).trim();
44224
+ result.prefixes.push(prefix);
44225
+ lastWordEndIndex = match.index + word.length;
44226
+ }
44227
+ } catch (err) {
44228
+ _didIteratorError = true;
44229
+ _iteratorError = err;
44230
+ } finally{
44231
+ try {
44232
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
44233
+ _iterator.return();
44234
+ }
44235
+ } finally{
44236
+ if (_didIteratorError) {
44237
+ throw _iteratorError;
44238
+ }
44239
+ }
44240
+ }
44241
+ var tail = string.slice(lastWordEndIndex).trim();
44242
+ if (tail) {
44243
+ result.parts.push('');
44244
+ result.prefixes.push(tail);
44245
+ }
44246
+ return result;
44247
+ }
44248
+ /**
44249
+ * A function that splits a string on words and returns an array of words.
44250
+ * - It can prefix each word with a given character
44251
+ * - It can strip or keep special characters, this affects the logic for adding a prefix as well
44252
+ */ function splitAndPrefix(string, options) {
44253
+ var _ref = options || {}, _ref_keepSpecialCharacters = _ref.keepSpecialCharacters, keepSpecialCharacters = _ref_keepSpecialCharacters === void 0 ? false : _ref_keepSpecialCharacters, keep = _ref.keep, _ref_prefix = _ref.prefix, prefix = _ref_prefix === void 0 ? '' : _ref_prefix;
44254
+ var normalString = string.trim().normalize('NFC');
44255
+ var hasSpaces = normalString.includes(' ');
44256
+ var split = hasSpaces ? spaceSplit : magicSplit;
44257
+ var partsAndIndexes = getPartsAndIndexes(normalString, split);
44258
+ return partsAndIndexes.parts.map(function(_part, i) {
44259
+ var foundPrefix = partsAndIndexes.prefixes[i] || '';
44260
+ var part = _part;
44261
+ if (keepSpecialCharacters === false) {
44262
+ if (keep) {
44263
+ part = part.normalize('NFD').replace(new RegExp("[^a-zA-Z\xd8\xdf\xf80-9".concat(keep.join(''), "]"), 'g'), '');
44264
+ }
44265
+ if (!keep) {
44266
+ part = part.normalize('NFD').replace(/[^a-zA-ZØßø0-9]/g, '');
44267
+ foundPrefix = '';
44268
+ }
44269
+ }
44270
+ if (keep && foundPrefix) {
44271
+ foundPrefix = foundPrefix.replace(new RegExp("[^".concat(keep.join(''), "]"), 'g'), '');
44272
+ }
44273
+ // the first word doesn't need a prefix, so only return the found prefix
44274
+ if (i === 0) {
44275
+ // console.log(`foundPrefix → `, foundPrefix)
44276
+ return foundPrefix + part;
44277
+ }
44278
+ if (!foundPrefix && !part) return '';
44279
+ if (!hasSpaces) {
44280
+ // return the found prefix OR fall back to a given prefix
44281
+ return (foundPrefix || prefix) + part;
44282
+ }
44283
+ // space based sentence was split on spaces, so only return found prefixes
44284
+ if (!foundPrefix && prefix.match(/\s/)) {
44285
+ // in this case we have no more found prefix, it was trimmed, but we're looking to add a space
44286
+ // so let's return that space
44287
+ return ' ' + part;
44288
+ }
44289
+ return (foundPrefix || prefix) + part;
44290
+ }).filter(Boolean);
44291
+ }
44292
+ /**
44293
+ * Capitalises a single word
44294
+ * @returns the word with the first character in uppercase and the rest in lowercase
44295
+ */ function capitaliseWord(string) {
44296
+ var match = string.matchAll(magicSplit).next().value;
44297
+ var firstLetterIndex = match ? match.index : 0;
44298
+ return string.slice(0, firstLetterIndex + 1).toUpperCase() + string.slice(firstLetterIndex + 1).toLowerCase();
44299
+ }
44300
+ function _define_property(obj, key, value) {
44301
+ if (key in obj) {
44302
+ Object.defineProperty(obj, key, {
44303
+ value: value,
44304
+ enumerable: true,
44305
+ configurable: true,
44306
+ writable: true
44307
+ });
44308
+ } else {
44309
+ obj[key] = value;
44310
+ }
44311
+ return obj;
44312
+ }
44313
+ function _object_spread(target) {
44314
+ for(var i = 1; i < arguments.length; i++){
44315
+ var source = arguments[i] != null ? arguments[i] : {};
44316
+ var ownKeys = Object.keys(source);
44317
+ if (typeof Object.getOwnPropertySymbols === "function") {
44318
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
44319
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
44320
+ }));
44321
+ }
44322
+ ownKeys.forEach(function(key) {
44323
+ _define_property(target, key, source[key]);
44324
+ });
44325
+ }
44326
+ return target;
44327
+ }
44328
+ function ownKeys(object, enumerableOnly) {
44329
+ var keys = Object.keys(object);
44330
+ if (Object.getOwnPropertySymbols) {
44331
+ var symbols = Object.getOwnPropertySymbols(object);
44332
+ keys.push.apply(keys, symbols);
44333
+ }
44334
+ return keys;
44335
+ }
44336
+ function _object_spread_props(target, source) {
44337
+ source = source != null ? source : {};
44338
+ if (Object.getOwnPropertyDescriptors) {
44339
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
44340
+ } else {
44341
+ ownKeys(Object(source)).forEach(function(key) {
44342
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
44343
+ });
44344
+ }
44345
+ return target;
44346
+ }
44347
+ /**
44348
+ * # 🐪 camelCase
44349
+ * converts a string to camelCase
44350
+ * - first lowercase then all capitalised
44351
+ * - *strips away* special characters by default
44352
+ *
44353
+ * @example
44354
+ * camelCase('$catDog') === 'catDog'
44355
+ * @example
44356
+ * camelCase('$catDog', { keepSpecialCharacters: true }) === '$catDog'
44357
+ */ function camelCase(string, options) {
44358
+ return splitAndPrefix(string, options).reduce(function(result, word, index) {
44359
+ return index === 0 || !(word[0] || '').match(magicSplit) ? result + word.toLowerCase() : result + capitaliseWord(word);
44360
+ }, '');
44361
+ }
44362
+ /**
44363
+ * # 🥙 kebab-case
44364
+ * converts a string to kebab-case
44365
+ * - hyphenated lowercase
44366
+ * - *strips away* special characters by default
44367
+ *
44368
+ * @example
44369
+ * kebabCase('$catDog') === 'cat-dog'
44370
+ * @example
44371
+ * kebabCase('$catDog', { keepSpecialCharacters: true }) === '$cat-dog'
44372
+ */ function kebabCase(string, options) {
44373
+ return splitAndPrefix(string, _object_spread_props(_object_spread({}, options), {
44374
+ prefix: '-'
44375
+ })).join('').toLowerCase();
44376
+ }
44377
+ /**
44378
+ * # 🐍 snake_case
44379
+ * converts a string to snake_case
44380
+ * - underscored lowercase
44381
+ * - *strips away* special characters by default
44382
+ *
44383
+ * @example
44384
+ * snakeCase('$catDog') === 'cat_dog'
44385
+ * @example
44386
+ * snakeCase('$catDog', { keepSpecialCharacters: true }) === '$cat_dog'
44387
+ */ function snakeCase(string, options) {
44388
+ return splitAndPrefix(string, _object_spread_props(_object_spread({}, options), {
44389
+ prefix: '_'
44390
+ })).join('').toLowerCase();
44391
+ }
44202
44392
  const Handlebars = handlebars_min || HandlebarsNamespace;
44203
44393
  Handlebars.registerHelper('JSONstringify', function(value) {
44204
44394
  return JSON.stringify(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-canvas",
3
- "version": "0.117.7",
3
+ "version": "0.117.9",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",