@base44-preview/cli 0.0.36-pr.356.36d8c62 → 0.0.37-pr.246.3c6cb91

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/dist/cli/index.js CHANGED
@@ -8933,10 +8933,10 @@ var require_ejs = __commonJS((exports) => {
8933
8933
  exports.localsName = _DEFAULT_LOCALS_NAME;
8934
8934
  exports.promiseImpl = new Function("return this;")().Promise;
8935
8935
  exports.resolveInclude = function(name2, filename, isDir) {
8936
- var dirname6 = path11.dirname;
8936
+ var dirname7 = path11.dirname;
8937
8937
  var extname = path11.extname;
8938
8938
  var resolve = path11.resolve;
8939
- var includePath = resolve(isDir ? filename : dirname6(filename), name2);
8939
+ var includePath = resolve(isDir ? filename : dirname7(filename), name2);
8940
8940
  var ext = extname(name2);
8941
8941
  if (!ext) {
8942
8942
  includePath += ".ejs";
@@ -12652,8 +12652,8 @@ var require_main = __commonJS((exports, module) => {
12652
12652
  const shortPaths = [];
12653
12653
  for (const filePath of optionPaths) {
12654
12654
  try {
12655
- const relative = path11.relative(process.cwd(), filePath);
12656
- shortPaths.push(relative);
12655
+ const relative3 = path11.relative(process.cwd(), filePath);
12656
+ shortPaths.push(relative3);
12657
12657
  } catch (e2) {
12658
12658
  if (debug) {
12659
12659
  _debug(`Failed to load ${filePath} ${e2.message}`);
@@ -13211,58 +13211,34 @@ var require_cross_spawn = __commonJS((exports, module) => {
13211
13211
  module.exports._enoent = enoent;
13212
13212
  });
13213
13213
 
13214
- // node_modules/lodash.kebabcase/index.js
13215
- var require_lodash = __commonJS((exports, module) => {
13216
- var INFINITY = 1 / 0;
13217
- var symbolTag = "[object Symbol]";
13218
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
13219
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
13220
- var rsAstralRange = "\\ud800-\\udfff";
13221
- var rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23";
13222
- var rsComboSymbolsRange = "\\u20d0-\\u20f0";
13223
- var rsDingbatRange = "\\u2700-\\u27bf";
13224
- var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
13225
- var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
13226
- var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
13227
- var rsPunctuationRange = "\\u2000-\\u206f";
13228
- var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
13229
- var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
13230
- var rsVarRange = "\\ufe0e\\ufe0f";
13231
- var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
13232
- var rsApos = "['’]";
13233
- var rsBreak = "[" + rsBreakRange + "]";
13234
- var rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]";
13235
- var rsDigits = "\\d+";
13236
- var rsDingbat = "[" + rsDingbatRange + "]";
13237
- var rsLower = "[" + rsLowerRange + "]";
13238
- var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
13239
- var rsFitz = "\\ud83c[\\udffb-\\udfff]";
13240
- var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
13241
- var rsNonAstral = "[^" + rsAstralRange + "]";
13242
- var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
13243
- var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
13244
- var rsUpper = "[" + rsUpperRange + "]";
13245
- var rsZWJ = "\\u200d";
13246
- var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")";
13247
- var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")";
13248
- var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
13249
- var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
13250
- var reOptMod = rsModifier + "?";
13251
- var rsOptVar = "[" + rsVarRange + "]?";
13252
- var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
13253
- var rsSeq = rsOptVar + reOptMod + rsOptJoin;
13254
- var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
13255
- var reApos = RegExp(rsApos, "g");
13256
- var reComboMark = RegExp(rsCombo, "g");
13257
- var reUnicodeWord = RegExp([
13258
- rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
13259
- rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")",
13260
- rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr,
13261
- rsUpper + "+" + rsOptUpperContr,
13262
- rsDigits,
13263
- rsEmoji
13264
- ].join("|"), "g");
13265
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
13214
+ // node_modules/lodash/_arrayReduce.js
13215
+ var require__arrayReduce = __commonJS((exports, module) => {
13216
+ function arrayReduce(array2, iteratee, accumulator, initAccum) {
13217
+ var index = -1, length = array2 == null ? 0 : array2.length;
13218
+ if (initAccum && length) {
13219
+ accumulator = array2[++index];
13220
+ }
13221
+ while (++index < length) {
13222
+ accumulator = iteratee(accumulator, array2[index], index, array2);
13223
+ }
13224
+ return accumulator;
13225
+ }
13226
+ module.exports = arrayReduce;
13227
+ });
13228
+
13229
+ // node_modules/lodash/_basePropertyOf.js
13230
+ var require__basePropertyOf = __commonJS((exports, module) => {
13231
+ function basePropertyOf(object2) {
13232
+ return function(key) {
13233
+ return object2 == null ? undefined : object2[key];
13234
+ };
13235
+ }
13236
+ module.exports = basePropertyOf;
13237
+ });
13238
+
13239
+ // node_modules/lodash/_deburrLetter.js
13240
+ var require__deburrLetter = __commonJS((exports, module) => {
13241
+ var basePropertyOf = require__basePropertyOf();
13266
13242
  var deburredLetters = {
13267
13243
  "À": "A",
13268
13244
  "Á": "A",
@@ -13453,72 +13429,256 @@ var require_lodash = __commonJS((exports, module) => {
13453
13429
  "Œ": "Oe",
13454
13430
  "œ": "oe",
13455
13431
  "ʼn": "'n",
13456
- "ſ": "ss"
13432
+ "ſ": "s"
13457
13433
  };
13434
+ var deburrLetter = basePropertyOf(deburredLetters);
13435
+ module.exports = deburrLetter;
13436
+ });
13437
+
13438
+ // node_modules/lodash/_freeGlobal.js
13439
+ var require__freeGlobal = __commonJS((exports, module) => {
13458
13440
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
13441
+ module.exports = freeGlobal;
13442
+ });
13443
+
13444
+ // node_modules/lodash/_root.js
13445
+ var require__root = __commonJS((exports, module) => {
13446
+ var freeGlobal = require__freeGlobal();
13459
13447
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
13460
13448
  var root = freeGlobal || freeSelf || Function("return this")();
13461
- function arrayReduce(array2, iteratee, accumulator, initAccum) {
13462
- var index = -1, length = array2 ? array2.length : 0;
13463
- if (initAccum && length) {
13464
- accumulator = array2[++index];
13465
- }
13449
+ module.exports = root;
13450
+ });
13451
+
13452
+ // node_modules/lodash/_Symbol.js
13453
+ var require__Symbol = __commonJS((exports, module) => {
13454
+ var root = require__root();
13455
+ var Symbol2 = root.Symbol;
13456
+ module.exports = Symbol2;
13457
+ });
13458
+
13459
+ // node_modules/lodash/_arrayMap.js
13460
+ var require__arrayMap = __commonJS((exports, module) => {
13461
+ function arrayMap(array2, iteratee) {
13462
+ var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
13466
13463
  while (++index < length) {
13467
- accumulator = iteratee(accumulator, array2[index], index, array2);
13464
+ result[index] = iteratee(array2[index], index, array2);
13468
13465
  }
13469
- return accumulator;
13466
+ return result;
13470
13467
  }
13471
- function asciiWords(string4) {
13472
- return string4.match(reAsciiWord) || [];
13468
+ module.exports = arrayMap;
13469
+ });
13470
+
13471
+ // node_modules/lodash/isArray.js
13472
+ var require_isArray = __commonJS((exports, module) => {
13473
+ var isArray = Array.isArray;
13474
+ module.exports = isArray;
13475
+ });
13476
+
13477
+ // node_modules/lodash/_getRawTag.js
13478
+ var require__getRawTag = __commonJS((exports, module) => {
13479
+ var Symbol2 = require__Symbol();
13480
+ var objectProto = Object.prototype;
13481
+ var hasOwnProperty = objectProto.hasOwnProperty;
13482
+ var nativeObjectToString = objectProto.toString;
13483
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined;
13484
+ function getRawTag(value) {
13485
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
13486
+ try {
13487
+ value[symToStringTag] = undefined;
13488
+ var unmasked = true;
13489
+ } catch (e2) {}
13490
+ var result = nativeObjectToString.call(value);
13491
+ if (unmasked) {
13492
+ if (isOwn) {
13493
+ value[symToStringTag] = tag;
13494
+ } else {
13495
+ delete value[symToStringTag];
13496
+ }
13497
+ }
13498
+ return result;
13473
13499
  }
13474
- function basePropertyOf(object2) {
13475
- return function(key) {
13476
- return object2 == null ? undefined : object2[key];
13477
- };
13500
+ module.exports = getRawTag;
13501
+ });
13502
+
13503
+ // node_modules/lodash/_objectToString.js
13504
+ var require__objectToString = __commonJS((exports, module) => {
13505
+ var objectProto = Object.prototype;
13506
+ var nativeObjectToString = objectProto.toString;
13507
+ function objectToString3(value) {
13508
+ return nativeObjectToString.call(value);
13478
13509
  }
13479
- var deburrLetter = basePropertyOf(deburredLetters);
13480
- function hasUnicodeWord(string4) {
13481
- return reHasUnicodeWord.test(string4);
13510
+ module.exports = objectToString3;
13511
+ });
13512
+
13513
+ // node_modules/lodash/_baseGetTag.js
13514
+ var require__baseGetTag = __commonJS((exports, module) => {
13515
+ var Symbol2 = require__Symbol();
13516
+ var getRawTag = require__getRawTag();
13517
+ var objectToString3 = require__objectToString();
13518
+ var nullTag = "[object Null]";
13519
+ var undefinedTag = "[object Undefined]";
13520
+ var symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined;
13521
+ function baseGetTag(value) {
13522
+ if (value == null) {
13523
+ return value === undefined ? undefinedTag : nullTag;
13524
+ }
13525
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString3(value);
13482
13526
  }
13483
- function unicodeWords(string4) {
13484
- return string4.match(reUnicodeWord) || [];
13527
+ module.exports = baseGetTag;
13528
+ });
13529
+
13530
+ // node_modules/lodash/isObjectLike.js
13531
+ var require_isObjectLike = __commonJS((exports, module) => {
13532
+ function isObjectLike(value) {
13533
+ return value != null && typeof value == "object";
13485
13534
  }
13486
- var objectProto = Object.prototype;
13487
- var objectToString3 = objectProto.toString;
13488
- var Symbol2 = root.Symbol;
13535
+ module.exports = isObjectLike;
13536
+ });
13537
+
13538
+ // node_modules/lodash/isSymbol.js
13539
+ var require_isSymbol = __commonJS((exports, module) => {
13540
+ var baseGetTag = require__baseGetTag();
13541
+ var isObjectLike = require_isObjectLike();
13542
+ var symbolTag = "[object Symbol]";
13543
+ function isSymbol(value) {
13544
+ return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
13545
+ }
13546
+ module.exports = isSymbol;
13547
+ });
13548
+
13549
+ // node_modules/lodash/_baseToString.js
13550
+ var require__baseToString = __commonJS((exports, module) => {
13551
+ var Symbol2 = require__Symbol();
13552
+ var arrayMap = require__arrayMap();
13553
+ var isArray = require_isArray();
13554
+ var isSymbol = require_isSymbol();
13555
+ var INFINITY = 1 / 0;
13489
13556
  var symbolProto = Symbol2 ? Symbol2.prototype : undefined;
13490
13557
  var symbolToString = symbolProto ? symbolProto.toString : undefined;
13491
13558
  function baseToString(value) {
13492
13559
  if (typeof value == "string") {
13493
13560
  return value;
13494
13561
  }
13562
+ if (isArray(value)) {
13563
+ return arrayMap(value, baseToString) + "";
13564
+ }
13495
13565
  if (isSymbol(value)) {
13496
13566
  return symbolToString ? symbolToString.call(value) : "";
13497
13567
  }
13498
13568
  var result = value + "";
13499
13569
  return result == "0" && 1 / value == -INFINITY ? "-0" : result;
13500
13570
  }
13501
- function createCompounder(callback) {
13502
- return function(string4) {
13503
- return arrayReduce(words(deburr(string4).replace(reApos, "")), callback, "");
13504
- };
13505
- }
13506
- function isObjectLike(value) {
13507
- return !!value && typeof value == "object";
13508
- }
13509
- function isSymbol(value) {
13510
- return typeof value == "symbol" || isObjectLike(value) && objectToString3.call(value) == symbolTag;
13511
- }
13571
+ module.exports = baseToString;
13572
+ });
13573
+
13574
+ // node_modules/lodash/toString.js
13575
+ var require_toString = __commonJS((exports, module) => {
13576
+ var baseToString = require__baseToString();
13512
13577
  function toString2(value) {
13513
13578
  return value == null ? "" : baseToString(value);
13514
13579
  }
13580
+ module.exports = toString2;
13581
+ });
13582
+
13583
+ // node_modules/lodash/deburr.js
13584
+ var require_deburr = __commonJS((exports, module) => {
13585
+ var deburrLetter = require__deburrLetter();
13586
+ var toString2 = require_toString();
13587
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
13588
+ var rsComboMarksRange = "\\u0300-\\u036f";
13589
+ var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
13590
+ var rsComboSymbolsRange = "\\u20d0-\\u20ff";
13591
+ var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
13592
+ var rsCombo = "[" + rsComboRange + "]";
13593
+ var reComboMark = RegExp(rsCombo, "g");
13515
13594
  function deburr(string4) {
13516
13595
  string4 = toString2(string4);
13517
13596
  return string4 && string4.replace(reLatin, deburrLetter).replace(reComboMark, "");
13518
13597
  }
13519
- var kebabCase = createCompounder(function(result, word, index) {
13520
- return result + (index ? "-" : "") + word.toLowerCase();
13521
- });
13598
+ module.exports = deburr;
13599
+ });
13600
+
13601
+ // node_modules/lodash/_asciiWords.js
13602
+ var require__asciiWords = __commonJS((exports, module) => {
13603
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
13604
+ function asciiWords(string4) {
13605
+ return string4.match(reAsciiWord) || [];
13606
+ }
13607
+ module.exports = asciiWords;
13608
+ });
13609
+
13610
+ // node_modules/lodash/_hasUnicodeWord.js
13611
+ var require__hasUnicodeWord = __commonJS((exports, module) => {
13612
+ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
13613
+ function hasUnicodeWord(string4) {
13614
+ return reHasUnicodeWord.test(string4);
13615
+ }
13616
+ module.exports = hasUnicodeWord;
13617
+ });
13618
+
13619
+ // node_modules/lodash/_unicodeWords.js
13620
+ var require__unicodeWords = __commonJS((exports, module) => {
13621
+ var rsAstralRange = "\\ud800-\\udfff";
13622
+ var rsComboMarksRange = "\\u0300-\\u036f";
13623
+ var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
13624
+ var rsComboSymbolsRange = "\\u20d0-\\u20ff";
13625
+ var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
13626
+ var rsDingbatRange = "\\u2700-\\u27bf";
13627
+ var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
13628
+ var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
13629
+ var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
13630
+ var rsPunctuationRange = "\\u2000-\\u206f";
13631
+ var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
13632
+ var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
13633
+ var rsVarRange = "\\ufe0e\\ufe0f";
13634
+ var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
13635
+ var rsApos = "['’]";
13636
+ var rsBreak = "[" + rsBreakRange + "]";
13637
+ var rsCombo = "[" + rsComboRange + "]";
13638
+ var rsDigits = "\\d+";
13639
+ var rsDingbat = "[" + rsDingbatRange + "]";
13640
+ var rsLower = "[" + rsLowerRange + "]";
13641
+ var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
13642
+ var rsFitz = "\\ud83c[\\udffb-\\udfff]";
13643
+ var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
13644
+ var rsNonAstral = "[^" + rsAstralRange + "]";
13645
+ var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
13646
+ var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
13647
+ var rsUpper = "[" + rsUpperRange + "]";
13648
+ var rsZWJ = "\\u200d";
13649
+ var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")";
13650
+ var rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")";
13651
+ var rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
13652
+ var rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
13653
+ var reOptMod = rsModifier + "?";
13654
+ var rsOptVar = "[" + rsVarRange + "]?";
13655
+ var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
13656
+ var rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])";
13657
+ var rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])";
13658
+ var rsSeq = rsOptVar + reOptMod + rsOptJoin;
13659
+ var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
13660
+ var reUnicodeWord = RegExp([
13661
+ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
13662
+ rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
13663
+ rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
13664
+ rsUpper + "+" + rsOptContrUpper,
13665
+ rsOrdUpper,
13666
+ rsOrdLower,
13667
+ rsDigits,
13668
+ rsEmoji
13669
+ ].join("|"), "g");
13670
+ function unicodeWords(string4) {
13671
+ return string4.match(reUnicodeWord) || [];
13672
+ }
13673
+ module.exports = unicodeWords;
13674
+ });
13675
+
13676
+ // node_modules/lodash/words.js
13677
+ var require_words = __commonJS((exports, module) => {
13678
+ var asciiWords = require__asciiWords();
13679
+ var hasUnicodeWord = require__hasUnicodeWord();
13680
+ var toString2 = require_toString();
13681
+ var unicodeWords = require__unicodeWords();
13522
13682
  function words(string4, pattern, guard) {
13523
13683
  string4 = toString2(string4);
13524
13684
  pattern = guard ? undefined : pattern;
@@ -13527,6 +13687,30 @@ var require_lodash = __commonJS((exports, module) => {
13527
13687
  }
13528
13688
  return string4.match(pattern) || [];
13529
13689
  }
13690
+ module.exports = words;
13691
+ });
13692
+
13693
+ // node_modules/lodash/_createCompounder.js
13694
+ var require__createCompounder = __commonJS((exports, module) => {
13695
+ var arrayReduce = require__arrayReduce();
13696
+ var deburr = require_deburr();
13697
+ var words = require_words();
13698
+ var rsApos = "['’]";
13699
+ var reApos = RegExp(rsApos, "g");
13700
+ function createCompounder(callback) {
13701
+ return function(string4) {
13702
+ return arrayReduce(words(deburr(string4).replace(reApos, "")), callback, "");
13703
+ };
13704
+ }
13705
+ module.exports = createCompounder;
13706
+ });
13707
+
13708
+ // node_modules/lodash/kebabCase.js
13709
+ var require_kebabCase = __commonJS((exports, module) => {
13710
+ var createCompounder = require__createCompounder();
13711
+ var kebabCase = createCompounder(function(result, word, index) {
13712
+ return result + (index ? "-" : "") + word.toLowerCase();
13713
+ });
13530
13714
  module.exports = kebabCase;
13531
13715
  });
13532
13716
 
@@ -14609,7 +14793,7 @@ var require_lib2 = __commonJS((exports) => {
14609
14793
  });
14610
14794
 
14611
14795
  // node_modules/lodash/lodash.js
14612
- var require_lodash2 = __commonJS((exports, module) => {
14796
+ var require_lodash = __commonJS((exports, module) => {
14613
14797
  (function() {
14614
14798
  var undefined2;
14615
14799
  var VERSION = "4.17.23";
@@ -117250,15 +117434,15 @@ var init_prettier = __esm(() => {
117250
117434
  exports.removeDuplicateSlashes = removeDuplicateSlashes;
117251
117435
  function partitionAbsoluteAndRelative(patterns) {
117252
117436
  const absolute = [];
117253
- const relative2 = [];
117437
+ const relative22 = [];
117254
117438
  for (const pattern of patterns) {
117255
117439
  if (isAbsolute2(pattern)) {
117256
117440
  absolute.push(pattern);
117257
117441
  } else {
117258
- relative2.push(pattern);
117442
+ relative22.push(pattern);
117259
117443
  }
117260
117444
  }
117261
- return [absolute, relative2];
117445
+ return [absolute, relative22];
117262
117446
  }
117263
117447
  exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
117264
117448
  function isAbsolute2(pattern) {
@@ -127599,7 +127783,7 @@ var require_AST = __commonJS((exports) => {
127599
127783
  var require_JSONSchema = __commonJS((exports) => {
127600
127784
  Object.defineProperty(exports, "__esModule", { value: true });
127601
127785
  exports.isCompound = exports.isPrimitive = exports.isBoolean = exports.getRootSchema = exports.Intersection = exports.Types = exports.Parent = undefined;
127602
- var lodash_1 = require_lodash2();
127786
+ var lodash_1 = require_lodash();
127603
127787
  exports.Parent = Symbol("Parent");
127604
127788
  exports.Types = Symbol("Types");
127605
127789
  exports.Intersection = Symbol("Intersection");
@@ -130406,7 +130590,7 @@ var require_utils7 = __commonJS((exports) => {
130406
130590
  };
130407
130591
  Object.defineProperty(exports, "__esModule", { value: true });
130408
130592
  exports.parseFileAsJSONSchema = exports.isSchemaLike = exports.appendToDescription = exports.maybeStripDefault = exports.pathTransform = exports.escapeBlockComment = exports.log = exports.error = exports.generateName = exports.toSafeString = exports.stripExtension = exports.justName = exports.traverse = exports.Try = undefined;
130409
- var lodash_1 = require_lodash2();
130593
+ var lodash_1 = require_lodash();
130410
130594
  var path_1 = __require("path");
130411
130595
  var JSONSchema_1 = require_JSONSchema();
130412
130596
  var js_yaml_1 = __importDefault(require_js_yaml3());
@@ -130737,7 +130921,7 @@ ${values.join(`
130737
130921
  var require_generator = __commonJS((exports) => {
130738
130922
  Object.defineProperty(exports, "__esModule", { value: true });
130739
130923
  exports.generateType = exports.generate = undefined;
130740
- var lodash_1 = require_lodash2();
130924
+ var lodash_1 = require_lodash();
130741
130925
  var index_1 = require_src3();
130742
130926
  var AST_1 = require_AST();
130743
130927
  var utils_1 = require_utils7();
@@ -131000,7 +131184,7 @@ var require_generator = __commonJS((exports) => {
131000
131184
  var require_typesOfSchema = __commonJS((exports) => {
131001
131185
  Object.defineProperty(exports, "__esModule", { value: true });
131002
131186
  exports.typesOfSchema = undefined;
131003
- var lodash_1 = require_lodash2();
131187
+ var lodash_1 = require_lodash();
131004
131188
  var JSONSchema_1 = require_JSONSchema();
131005
131189
  function typesOfSchema(schema9) {
131006
131190
  if (schema9.tsType) {
@@ -131359,7 +131543,7 @@ var require_normalizer = __commonJS((exports) => {
131359
131543
  var require_optimizer = __commonJS((exports) => {
131360
131544
  Object.defineProperty(exports, "__esModule", { value: true });
131361
131545
  exports.optimize = undefined;
131362
- var lodash_1 = require_lodash2();
131546
+ var lodash_1 = require_lodash();
131363
131547
  var generator_1 = require_generator();
131364
131548
  var AST_1 = require_AST();
131365
131549
  var utils_1 = require_utils7();
@@ -131425,7 +131609,7 @@ var require_optimizer = __commonJS((exports) => {
131425
131609
  var require_parser = __commonJS((exports) => {
131426
131610
  Object.defineProperty(exports, "__esModule", { value: true });
131427
131611
  exports.parse = undefined;
131428
- var lodash_1 = require_lodash2();
131612
+ var lodash_1 = require_lodash();
131429
131613
  var util_1 = __require("util");
131430
131614
  var applySchemaTyping_1 = require_applySchemaTyping();
131431
131615
  var AST_1 = require_AST();
@@ -132213,7 +132397,7 @@ var require_url = __commonJS((exports) => {
132213
132397
  exports.fromFileSystemPath = fromFileSystemPath;
132214
132398
  exports.toFileSystemPath = toFileSystemPath;
132215
132399
  exports.safePointerToPath = safePointerToPath;
132216
- exports.relative = relative2;
132400
+ exports.relative = relative4;
132217
132401
  var convert_path_to_posix_1 = __importDefault(require_convert_path_to_posix());
132218
132402
  var path_1 = __importStar(__require("path"));
132219
132403
  var forwardSlashPattern = /\//g;
@@ -132363,7 +132547,7 @@ var require_url = __commonJS((exports) => {
132363
132547
  return decodeURIComponent(value).replace(jsonPointerSlash, "/").replace(jsonPointerTilde, "~");
132364
132548
  });
132365
132549
  }
132366
- function relative2(from, to5) {
132550
+ function relative4(from, to5) {
132367
132551
  if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
132368
132552
  return resolve6(from, to5);
132369
132553
  }
@@ -137278,7 +137462,7 @@ var require_linker = __commonJS((exports) => {
137278
137462
  Object.defineProperty(exports, "__esModule", { value: true });
137279
137463
  exports.link = undefined;
137280
137464
  var JSONSchema_1 = require_JSONSchema();
137281
- var lodash_1 = require_lodash2();
137465
+ var lodash_1 = require_lodash();
137282
137466
  function link2(schema9, parent = null) {
137283
137467
  if (!Array.isArray(schema9) && !(0, lodash_1.isPlainObject)(schema9)) {
137284
137468
  return schema9;
@@ -137346,7 +137530,7 @@ var require_src3 = __commonJS((exports) => {
137346
137530
  Object.defineProperty(exports, "__esModule", { value: true });
137347
137531
  exports.ValidationError = exports.compile = exports.compileFromFile = exports.DEFAULT_OPTIONS = undefined;
137348
137532
  var fs_1 = __require("fs");
137349
- var lodash_1 = require_lodash2();
137533
+ var lodash_1 = require_lodash();
137350
137534
  var path_1 = __require("path");
137351
137535
  var formatter_1 = require_formatter();
137352
137536
  var generator_1 = require_generator();
@@ -138430,7 +138614,7 @@ var require_depd = __commonJS((exports, module) => {
138430
138614
  * Copyright(c) 2014-2018 Douglas Christopher Wilson
138431
138615
  * MIT Licensed
138432
138616
  */
138433
- var relative2 = __require("path").relative;
138617
+ var relative4 = __require("path").relative;
138434
138618
  module.exports = depd;
138435
138619
  var basePath = process.cwd();
138436
138620
  function containsNamespace(str, namespace) {
@@ -138626,7 +138810,7 @@ var require_depd = __commonJS((exports, module) => {
138626
138810
  return formatted;
138627
138811
  }
138628
138812
  function formatLocation(callSite) {
138629
- return relative2(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
138813
+ return relative4(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
138630
138814
  }
138631
138815
  function getStack() {
138632
138816
  var limit = Error.stackTraceLimit;
@@ -156088,7 +156272,7 @@ var require_view = __commonJS((exports, module) => {
156088
156272
  var debug = require_src4()("express:view");
156089
156273
  var path18 = __require("node:path");
156090
156274
  var fs28 = __require("node:fs");
156091
- var dirname11 = path18.dirname;
156275
+ var dirname12 = path18.dirname;
156092
156276
  var basename4 = path18.basename;
156093
156277
  var extname2 = path18.extname;
156094
156278
  var join15 = path18.join;
@@ -156127,7 +156311,7 @@ var require_view = __commonJS((exports, module) => {
156127
156311
  for (var i5 = 0;i5 < roots.length && !path19; i5++) {
156128
156312
  var root2 = roots[i5];
156129
156313
  var loc = resolve6(root2, name2);
156130
- var dir = dirname11(loc);
156314
+ var dir = dirname12(loc);
156131
156315
  var file2 = basename4(loc);
156132
156316
  path19 = this.resolve(dir, file2);
156133
156317
  }
@@ -161774,8 +161958,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
161774
161958
  }
161775
161959
  return parsed;
161776
161960
  }
161777
- function resolveUrl(relative2, base) {
161778
- return useNativeURL ? new URL2(relative2, base) : parseUrl(url3.resolve(base, relative2));
161961
+ function resolveUrl(relative4, base) {
161962
+ return useNativeURL ? new URL2(relative4, base) : parseUrl(url3.resolve(base, relative4));
161779
161963
  }
161780
161964
  function validateUrl(input) {
161781
161965
  if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
@@ -210218,6 +210402,168 @@ var require_multer = __commonJS((exports, module) => {
210218
210402
  module.exports.MulterError = MulterError;
210219
210403
  });
210220
210404
 
210405
+ // node_modules/lodash/isObject.js
210406
+ var require_isObject = __commonJS((exports, module) => {
210407
+ function isObject5(value) {
210408
+ var type = typeof value;
210409
+ return value != null && (type == "object" || type == "function");
210410
+ }
210411
+ module.exports = isObject5;
210412
+ });
210413
+
210414
+ // node_modules/lodash/now.js
210415
+ var require_now = __commonJS((exports, module) => {
210416
+ var root2 = require__root();
210417
+ var now = function() {
210418
+ return root2.Date.now();
210419
+ };
210420
+ module.exports = now;
210421
+ });
210422
+
210423
+ // node_modules/lodash/_trimmedEndIndex.js
210424
+ var require__trimmedEndIndex = __commonJS((exports, module) => {
210425
+ var reWhitespace = /\s/;
210426
+ function trimmedEndIndex(string4) {
210427
+ var index = string4.length;
210428
+ while (index-- && reWhitespace.test(string4.charAt(index))) {}
210429
+ return index;
210430
+ }
210431
+ module.exports = trimmedEndIndex;
210432
+ });
210433
+
210434
+ // node_modules/lodash/_baseTrim.js
210435
+ var require__baseTrim = __commonJS((exports, module) => {
210436
+ var trimmedEndIndex = require__trimmedEndIndex();
210437
+ var reTrimStart = /^\s+/;
210438
+ function baseTrim(string4) {
210439
+ return string4 ? string4.slice(0, trimmedEndIndex(string4) + 1).replace(reTrimStart, "") : string4;
210440
+ }
210441
+ module.exports = baseTrim;
210442
+ });
210443
+
210444
+ // node_modules/lodash/toNumber.js
210445
+ var require_toNumber = __commonJS((exports, module) => {
210446
+ var baseTrim = require__baseTrim();
210447
+ var isObject5 = require_isObject();
210448
+ var isSymbol = require_isSymbol();
210449
+ var NAN = 0 / 0;
210450
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
210451
+ var reIsBinary = /^0b[01]+$/i;
210452
+ var reIsOctal = /^0o[0-7]+$/i;
210453
+ var freeParseInt = parseInt;
210454
+ function toNumber(value) {
210455
+ if (typeof value == "number") {
210456
+ return value;
210457
+ }
210458
+ if (isSymbol(value)) {
210459
+ return NAN;
210460
+ }
210461
+ if (isObject5(value)) {
210462
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
210463
+ value = isObject5(other) ? other + "" : other;
210464
+ }
210465
+ if (typeof value != "string") {
210466
+ return value === 0 ? value : +value;
210467
+ }
210468
+ value = baseTrim(value);
210469
+ var isBinary = reIsBinary.test(value);
210470
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
210471
+ }
210472
+ module.exports = toNumber;
210473
+ });
210474
+
210475
+ // node_modules/lodash/debounce.js
210476
+ var require_debounce = __commonJS((exports, module) => {
210477
+ var isObject5 = require_isObject();
210478
+ var now = require_now();
210479
+ var toNumber = require_toNumber();
210480
+ var FUNC_ERROR_TEXT = "Expected a function";
210481
+ var nativeMax = Math.max;
210482
+ var nativeMin = Math.min;
210483
+ function debounce(func, wait, options8) {
210484
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
210485
+ if (typeof func != "function") {
210486
+ throw new TypeError(FUNC_ERROR_TEXT);
210487
+ }
210488
+ wait = toNumber(wait) || 0;
210489
+ if (isObject5(options8)) {
210490
+ leading = !!options8.leading;
210491
+ maxing = "maxWait" in options8;
210492
+ maxWait = maxing ? nativeMax(toNumber(options8.maxWait) || 0, wait) : maxWait;
210493
+ trailing = "trailing" in options8 ? !!options8.trailing : trailing;
210494
+ }
210495
+ function invokeFunc(time3) {
210496
+ var args = lastArgs, thisArg = lastThis;
210497
+ lastArgs = lastThis = undefined;
210498
+ lastInvokeTime = time3;
210499
+ result = func.apply(thisArg, args);
210500
+ return result;
210501
+ }
210502
+ function leadingEdge(time3) {
210503
+ lastInvokeTime = time3;
210504
+ timerId = setTimeout(timerExpired, wait);
210505
+ return leading ? invokeFunc(time3) : result;
210506
+ }
210507
+ function remainingWait(time3) {
210508
+ var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
210509
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
210510
+ }
210511
+ function shouldInvoke(time3) {
210512
+ var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime;
210513
+ return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
210514
+ }
210515
+ function timerExpired() {
210516
+ var time3 = now();
210517
+ if (shouldInvoke(time3)) {
210518
+ return trailingEdge(time3);
210519
+ }
210520
+ timerId = setTimeout(timerExpired, remainingWait(time3));
210521
+ }
210522
+ function trailingEdge(time3) {
210523
+ timerId = undefined;
210524
+ if (trailing && lastArgs) {
210525
+ return invokeFunc(time3);
210526
+ }
210527
+ lastArgs = lastThis = undefined;
210528
+ return result;
210529
+ }
210530
+ function cancel() {
210531
+ if (timerId !== undefined) {
210532
+ clearTimeout(timerId);
210533
+ }
210534
+ lastInvokeTime = 0;
210535
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
210536
+ }
210537
+ function flush() {
210538
+ return timerId === undefined ? result : trailingEdge(now());
210539
+ }
210540
+ function debounced() {
210541
+ var time3 = now(), isInvoking = shouldInvoke(time3);
210542
+ lastArgs = arguments;
210543
+ lastThis = this;
210544
+ lastCallTime = time3;
210545
+ if (isInvoking) {
210546
+ if (timerId === undefined) {
210547
+ return leadingEdge(lastCallTime);
210548
+ }
210549
+ if (maxing) {
210550
+ clearTimeout(timerId);
210551
+ timerId = setTimeout(timerExpired, wait);
210552
+ return invokeFunc(lastCallTime);
210553
+ }
210554
+ }
210555
+ if (timerId === undefined) {
210556
+ timerId = setTimeout(timerExpired, wait);
210557
+ }
210558
+ return result;
210559
+ }
210560
+ debounced.cancel = cancel;
210561
+ debounced.flush = flush;
210562
+ return debounced;
210563
+ }
210564
+ module.exports = debounce;
210565
+ });
210566
+
210221
210567
  // node_modules/@vercel/detect-agent/dist/index.js
210222
210568
  var require_dist5 = __commonJS((exports, module) => {
210223
210569
  var __defProp4 = Object.defineProperty;
@@ -210243,8 +210589,8 @@ var require_dist5 = __commonJS((exports, module) => {
210243
210589
  determineAgent: () => determineAgent
210244
210590
  });
210245
210591
  module.exports = __toCommonJS(src_exports);
210246
- var import_promises19 = __require("node:fs/promises");
210247
- var import_node_fs19 = __require("node:fs");
210592
+ var import_promises22 = __require("node:fs/promises");
210593
+ var import_node_fs21 = __require("node:fs");
210248
210594
  var DEVIN_LOCAL_PATH = "/opt/.devin";
210249
210595
  var CURSOR2 = "cursor";
210250
210596
  var CURSOR_CLI = "cursor-cli";
@@ -210301,7 +210647,7 @@ var require_dist5 = __commonJS((exports, module) => {
210301
210647
  return { isAgent: true, agent: { name: REPLIT } };
210302
210648
  }
210303
210649
  try {
210304
- await (0, import_promises19.access)(DEVIN_LOCAL_PATH, import_node_fs19.constants.F_OK);
210650
+ await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs21.constants.F_OK);
210305
210651
  return { isAgent: true, agent: { name: DEVIN } };
210306
210652
  } catch (error48) {}
210307
210653
  return { isAgent: false, agent: undefined };
@@ -210325,7 +210671,7 @@ var {
210325
210671
  } = import__.default;
210326
210672
 
210327
210673
  // src/cli/commands/agents/pull.ts
210328
- import { dirname as dirname7, join as join9 } from "node:path";
210674
+ import { dirname as dirname8, join as join9 } from "node:path";
210329
210675
 
210330
210676
  // node_modules/@clack/core/dist/index.mjs
210331
210677
  var import_picocolors = __toESM(require_picocolors(), 1);
@@ -225796,6 +226142,9 @@ var PROJECT_SUBDIR = "base44";
225796
226142
  var CONFIG_FILE_EXTENSION = "jsonc";
225797
226143
  var CONFIG_FILE_EXTENSION_GLOB = "{json,jsonc}";
225798
226144
  var FUNCTION_CONFIG_FILE = `function.${CONFIG_FILE_EXTENSION_GLOB}`;
226145
+ var FUNCTION_CONFIG_GLOB = `**/${FUNCTION_CONFIG_FILE}`;
226146
+ var ENTRY_FILE_GLOB = "**/entry.{js,ts}";
226147
+ var ENTRY_IGNORE_DOT_PATHS = ["**/*.*/**"];
225799
226148
  var APP_CONFIG_PATTERN = `**/.app.${CONFIG_FILE_EXTENSION_GLOB}`;
225800
226149
  var PROJECT_CONFIG_PATTERNS = [
225801
226150
  `${PROJECT_SUBDIR}/config.${CONFIG_FILE_EXTENSION_GLOB}`,
@@ -232824,7 +233173,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
232824
233173
  var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
232825
233174
 
232826
233175
  // src/core/project/config.ts
232827
- import { dirname as dirname5, join as join6 } from "node:path";
233176
+ import { dirname as dirname6, join as join6 } from "node:path";
232828
233177
 
232829
233178
  // src/core/resources/agent/schema.ts
232830
233179
  var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
@@ -233634,7 +233983,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
233634
233983
  return result.data;
233635
233984
  }
233636
233985
  // src/core/resources/function/config.ts
233637
- import { dirname as dirname4, join as join5 } from "node:path";
233986
+ import { basename as basename2, dirname as dirname4, join as join5, relative } from "node:path";
233638
233987
  async function readFunctionConfig(configPath) {
233639
233988
  const parsed = await readJsonFile(configPath);
233640
233989
  const result = FunctionConfigSchema.safeParse(parsed);
@@ -233652,7 +234001,7 @@ async function readFunction(configPath) {
233652
234001
  hints: [{ message: "Check the 'entry' field in your function config" }]
233653
234002
  });
233654
234003
  }
233655
- const filePaths = await globby("*.{js,ts,json}", {
234004
+ const filePaths = await globby("**/*.{js,ts,json}", {
233656
234005
  cwd: functionDir,
233657
234006
  absolute: true
233658
234007
  });
@@ -233663,26 +234012,61 @@ async function readAllFunctions(functionsDir) {
233663
234012
  if (!await pathExists(functionsDir)) {
233664
234013
  return [];
233665
234014
  }
233666
- const configFiles = await globby(`*/${FUNCTION_CONFIG_FILE}`, {
234015
+ const configFiles = await globby(FUNCTION_CONFIG_GLOB, {
233667
234016
  cwd: functionsDir,
233668
234017
  absolute: true
233669
234018
  });
233670
- const functions = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
234019
+ const entryFiles = await globby(ENTRY_FILE_GLOB, {
234020
+ cwd: functionsDir,
234021
+ absolute: true,
234022
+ ignore: ENTRY_IGNORE_DOT_PATHS
234023
+ });
234024
+ const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
234025
+ const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
234026
+ const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
234027
+ const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
234028
+ const functionDir = dirname4(entryFile);
234029
+ const filePaths = await globby("**/*.{js,ts,json}", {
234030
+ cwd: functionDir,
234031
+ absolute: true
234032
+ });
234033
+ const name2 = relative(functionsDir, functionDir).split(/[/\\]/).join("/");
234034
+ if (!name2) {
234035
+ throw new InvalidInputError("entry.ts found directly in the functions directory — it must be inside a named subfolder", {
234036
+ hints: [
234037
+ {
234038
+ message: `Move ${entryFile} into a subfolder (e.g. functions/myFunc/entry.ts)`
234039
+ }
234040
+ ]
234041
+ });
234042
+ }
234043
+ const entry = basename2(entryFile);
234044
+ return { name: name2, entry, entryPath: entryFile, filePaths };
234045
+ }));
234046
+ const functions = [...functionsFromConfig, ...functionsWithoutConfig];
233671
234047
  const names = new Set;
233672
234048
  for (const fn of functions) {
233673
234049
  if (names.has(fn.name)) {
233674
- throw new Error(`Duplicate function name "${fn.name}"`);
234050
+ throw new InvalidInputError(`Duplicate function name "${fn.name}"`, {
234051
+ hints: [
234052
+ {
234053
+ message: "Ensure each function has a unique name (or path for zero-config functions)."
234054
+ }
234055
+ ]
234056
+ });
233675
234057
  }
233676
234058
  names.add(fn.name);
233677
234059
  }
233678
234060
  return functions;
233679
234061
  }
233680
234062
  // src/core/resources/function/deploy.ts
233681
- import { basename as basename2 } from "node:path";
234063
+ import { dirname as dirname5, relative as relative2 } from "node:path";
233682
234064
  async function loadFunctionCode(fn) {
234065
+ const functionDir = dirname5(fn.entryPath);
233683
234066
  const loadedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
233684
234067
  const content = await readTextFile(filePath);
233685
- return { path: basename2(filePath), content };
234068
+ const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
234069
+ return { path: path11, content };
233686
234070
  }));
233687
234071
  return { ...fn, files: loadedFiles };
233688
234072
  }
@@ -233708,12 +234092,12 @@ async function findConfigInDir(dir) {
233708
234092
  }
233709
234093
  async function findProjectRoot(startPath) {
233710
234094
  let current = startPath || process.cwd();
233711
- while (current !== dirname5(current)) {
234095
+ while (current !== dirname6(current)) {
233712
234096
  const configPath = await findConfigInDir(current);
233713
234097
  if (configPath) {
233714
234098
  return { root: current, configPath };
233715
234099
  }
233716
- current = dirname5(current);
234100
+ current = dirname6(current);
233717
234101
  }
233718
234102
  return null;
233719
234103
  }
@@ -233735,7 +234119,7 @@ async function readProjectConfig(projectRoot) {
233735
234119
  throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
233736
234120
  }
233737
234121
  const project = result.data;
233738
- const configDir = dirname5(configPath);
234122
+ const configDir = dirname6(configPath);
233739
234123
  const [entities, functions, agents, connectors] = await Promise.all([
233740
234124
  entityResource.readAll(join6(configDir, project.entitiesDir)),
233741
234125
  functionResource.readAll(join6(configDir, project.functionsDir)),
@@ -233837,7 +234221,7 @@ async function readAppConfig(projectRoot) {
233837
234221
  // src/core/project/template.ts
233838
234222
  var import_ejs = __toESM(require_ejs(), 1);
233839
234223
  var import_front_matter = __toESM(require_front_matter(), 1);
233840
- import { dirname as dirname6, join as join7 } from "node:path";
234224
+ import { dirname as dirname7, join as join7 } from "node:path";
233841
234225
  async function listTemplates() {
233842
234226
  const parsed = await readJsonFile(getTemplatesIndexPath());
233843
234227
  const result = TemplatesConfigSchema.safeParse(parsed);
@@ -233859,7 +234243,7 @@ async function renderTemplate(template, destPath, data) {
233859
234243
  if (file2.endsWith(".ejs")) {
233860
234244
  const rendered = await import_ejs.default.renderFile(srcPath, data);
233861
234245
  const { attributes, body } = import_front_matter.default(rendered);
233862
- const destFile = attributes.outputFileName ? join7(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
234246
+ const destFile = attributes.outputFileName ? join7(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
233863
234247
  const destFilePath = join7(destPath, destFile);
233864
234248
  await writeFile(destFilePath, body);
233865
234249
  } else {
@@ -234212,7 +234596,8 @@ async function setSecrets(secrets) {
234212
234596
  let response;
234213
234597
  try {
234214
234598
  response = await appClient.post("secrets", {
234215
- json: secrets
234599
+ json: secrets,
234600
+ timeout: false
234216
234601
  });
234217
234602
  } catch (error48) {
234218
234603
  throw await ApiError.fromHttpError(error48, "setting secrets");
@@ -241534,7 +241919,7 @@ var {
241534
241919
  // package.json
241535
241920
  var package_default = {
241536
241921
  name: "base44",
241537
- version: "0.0.36",
241922
+ version: "0.0.37",
241538
241923
  description: "Base44 CLI - Unified interface for managing Base44 applications",
241539
241924
  type: "module",
241540
241925
  bin: {
@@ -241580,11 +241965,12 @@ var package_default = {
241580
241965
  "@types/ejs": "^3.1.5",
241581
241966
  "@types/express": "^5.0.6",
241582
241967
  "@types/json-schema": "^7.0.15",
241583
- "@types/lodash.kebabcase": "^4.1.9",
241584
- "@types/node": "^22.10.5",
241968
+ "@types/lodash": "^4.17.24",
241585
241969
  "@types/multer": "^2.0.0",
241970
+ "@types/node": "^22.10.5",
241586
241971
  "@vercel/detect-agent": "^1.1.0",
241587
241972
  chalk: "^5.6.2",
241973
+ chokidar: "^5.0.0",
241588
241974
  commander: "^12.1.0",
241589
241975
  "common-tags": "^1.8.2",
241590
241976
  cors: "^2.8.5",
@@ -241600,9 +241986,9 @@ var package_default = {
241600
241986
  json5: "^2.2.3",
241601
241987
  knip: "^5.83.1",
241602
241988
  ky: "^1.14.2",
241603
- "lodash.kebabcase": "^4.1.1",
241604
- multer: "^2.0.0",
241989
+ lodash: "^4.17.23",
241605
241990
  msw: "^2.12.10",
241991
+ multer: "^2.0.0",
241606
241992
  nanoid: "^5.1.6",
241607
241993
  open: "^11.0.0",
241608
241994
  "p-wait-for": "^6.0.0",
@@ -241742,7 +242128,7 @@ function getDashboardUrl(projectId) {
241742
242128
  // src/cli/commands/agents/pull.ts
241743
242129
  async function pullAgentsAction() {
241744
242130
  const { project: project2 } = await readProjectConfig();
241745
- const configDir = dirname7(project2.configPath);
242131
+ const configDir = dirname8(project2.configPath);
241746
242132
  const agentsDir = join9(configDir, project2.agentsDir);
241747
242133
  const remoteAgents = await runTask("Fetching agents from Base44", async () => {
241748
242134
  return await fetchAgents();
@@ -241837,10 +242223,10 @@ function getWhoamiCommand(context) {
241837
242223
  }
241838
242224
 
241839
242225
  // src/cli/commands/connectors/pull.ts
241840
- import { dirname as dirname8, join as join10 } from "node:path";
242226
+ import { dirname as dirname9, join as join10 } from "node:path";
241841
242227
  async function pullConnectorsAction() {
241842
242228
  const { project: project2 } = await readProjectConfig();
241843
- const configDir = dirname8(project2.configPath);
242229
+ const configDir = dirname9(project2.configPath);
241844
242230
  const connectorsDir = join10(configDir, project2.connectorsDir);
241845
242231
  const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
241846
242232
  return await listConnectors();
@@ -242729,7 +243115,7 @@ function getFunctionsDeployCommand(context) {
242729
243115
 
242730
243116
  // src/cli/commands/project/create.ts
242731
243117
  import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
242732
- var import_lodash = __toESM(require_lodash(), 1);
243118
+ var import_kebabCase = __toESM(require_kebabCase(), 1);
242733
243119
  var DEFAULT_TEMPLATE_ID = "backend-only";
242734
243120
  async function getTemplateById(templateId) {
242735
243121
  const templates = await listTemplates();
@@ -242773,7 +243159,7 @@ async function createInteractive(options) {
242773
243159
  });
242774
243160
  },
242775
243161
  projectPath: async ({ results }) => {
242776
- const suggestedPath = await isDirEmpty() ? "./" : `./${import_lodash.default(results.name)}`;
243162
+ const suggestedPath = await isDirEmpty() ? "./" : `./${import_kebabCase.default(results.name)}`;
242777
243163
  return Ze({
242778
243164
  message: "Where should we create your project?",
242779
243165
  placeholder: suggestedPath,
@@ -243536,6 +243922,7 @@ function getTypesCommand(context) {
243536
243922
  }
243537
243923
 
243538
243924
  // src/cli/dev/dev-server/main.ts
243925
+ import { dirname as dirname15, join as join18 } from "node:path";
243539
243926
  var import_cors = __toESM(require_lib4(), 1);
243540
243927
  var import_express4 = __toESM(require_express(), 1);
243541
243928
 
@@ -243694,9 +244081,9 @@ function createDevLogger() {
243694
244081
 
243695
244082
  // src/cli/dev/dev-server/function-manager.ts
243696
244083
  import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
243697
- import { dirname as dirname11, join as join15 } from "node:path";
244084
+ import { dirname as dirname12, join as join15 } from "node:path";
243698
244085
  import { fileURLToPath as fileURLToPath7 } from "node:url";
243699
- var __dirname5 = dirname11(fileURLToPath7(import.meta.url));
244086
+ var __dirname5 = dirname12(fileURLToPath7(import.meta.url));
243700
244087
  var WRAPPER_PATH = join15(__dirname5, "../deno-runtime/main.js");
243701
244088
  var READY_TIMEOUT = 30000;
243702
244089
 
@@ -243743,6 +244130,10 @@ class FunctionManager {
243743
244130
  try {
243744
244131
  return await promise2;
243745
244132
  } finally {
244133
+ if (!this.starting.has(name2) && this.running.has(name2)) {
244134
+ this.running.get(name2)?.process.kill();
244135
+ this.running.delete(name2);
244136
+ }
243746
244137
  this.starting.delete(name2);
243747
244138
  }
243748
244139
  }
@@ -243758,9 +244149,13 @@ class FunctionManager {
243758
244149
  this.setupProcessHandlers(name2, process21);
243759
244150
  return this.waitForReady(name2, runningFunc);
243760
244151
  }
244152
+ reload(functions) {
244153
+ this.stopAll();
244154
+ this.functions = new Map(functions.map((f7) => [f7.name, f7]));
244155
+ }
243761
244156
  stopAll() {
243762
244157
  for (const [name2, { process: process21 }] of this.running) {
243763
- this.logger.log(`[dev-server] Stopping function: ${name2}`);
244158
+ this.logger.log(`Stopping function: ${name2}`);
243764
244159
  process21.kill();
243765
244160
  }
243766
244161
  this.running.clear();
@@ -243771,7 +244166,7 @@ class FunctionManager {
243771
244166
  return getPorts({ exclude: usedPorts });
243772
244167
  }
243773
244168
  spawnFunction(func, port) {
243774
- this.logger.log(`[dev-server] Spawning function "${func.name}" on port ${port}`);
244169
+ this.logger.log(`Spawning function "${func.name}" on port ${port}`);
243775
244170
  const process21 = spawn2("deno", ["run", "--allow-all", WRAPPER_PATH], {
243776
244171
  env: {
243777
244172
  ...globalThis.process.env,
@@ -243799,11 +244194,13 @@ class FunctionManager {
243799
244194
  }
243800
244195
  });
243801
244196
  process21.on("exit", (code2) => {
243802
- this.logger.log(`[dev-server] Function "${name2}" exited with code ${code2}`);
244197
+ if (code2 !== null) {
244198
+ this.logger.log(`Function "${name2}" exited with code ${code2}`);
244199
+ }
243803
244200
  this.running.delete(name2);
243804
244201
  });
243805
244202
  process21.on("error", (error48) => {
243806
- this.logger.error(`[dev-server] Function "${name2}" error:`, error48);
244203
+ this.logger.error(`Function "${name2}" error:`, error48);
243807
244204
  this.running.delete(name2);
243808
244205
  });
243809
244206
  }
@@ -244254,6 +244651,1707 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
244254
244651
  return router;
244255
244652
  }
244256
244653
 
244654
+ // src/cli/dev/dev-server/watcher.ts
244655
+ import { EventEmitter as EventEmitter4 } from "node:events";
244656
+ import { relative as relative6 } from "node:path";
244657
+
244658
+ // node_modules/chokidar/index.js
244659
+ import { EventEmitter as EventEmitter3 } from "node:events";
244660
+ import { stat as statcb, Stats } from "node:fs";
244661
+ import { readdir as readdir3, stat as stat4 } from "node:fs/promises";
244662
+ import * as sp3 from "node:path";
244663
+
244664
+ // node_modules/readdirp/index.js
244665
+ import { lstat as lstat2, readdir as readdir2, realpath, stat as stat2 } from "node:fs/promises";
244666
+ import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
244667
+ import { Readable as Readable6 } from "node:stream";
244668
+ var EntryTypes = {
244669
+ FILE_TYPE: "files",
244670
+ DIR_TYPE: "directories",
244671
+ FILE_DIR_TYPE: "files_directories",
244672
+ EVERYTHING_TYPE: "all"
244673
+ };
244674
+ var defaultOptions = {
244675
+ root: ".",
244676
+ fileFilter: (_entryInfo) => true,
244677
+ directoryFilter: (_entryInfo) => true,
244678
+ type: EntryTypes.FILE_TYPE,
244679
+ lstat: false,
244680
+ depth: 2147483648,
244681
+ alwaysStat: false,
244682
+ highWaterMark: 4096
244683
+ };
244684
+ Object.freeze(defaultOptions);
244685
+ var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
244686
+ var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
244687
+ var ALL_TYPES = [
244688
+ EntryTypes.DIR_TYPE,
244689
+ EntryTypes.EVERYTHING_TYPE,
244690
+ EntryTypes.FILE_DIR_TYPE,
244691
+ EntryTypes.FILE_TYPE
244692
+ ];
244693
+ var DIR_TYPES = new Set([
244694
+ EntryTypes.DIR_TYPE,
244695
+ EntryTypes.EVERYTHING_TYPE,
244696
+ EntryTypes.FILE_DIR_TYPE
244697
+ ]);
244698
+ var FILE_TYPES2 = new Set([
244699
+ EntryTypes.EVERYTHING_TYPE,
244700
+ EntryTypes.FILE_DIR_TYPE,
244701
+ EntryTypes.FILE_TYPE
244702
+ ]);
244703
+ var isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
244704
+ var wantBigintFsStats = process.platform === "win32";
244705
+ var emptyFn = (_entryInfo) => true;
244706
+ var normalizeFilter = (filter2) => {
244707
+ if (filter2 === undefined)
244708
+ return emptyFn;
244709
+ if (typeof filter2 === "function")
244710
+ return filter2;
244711
+ if (typeof filter2 === "string") {
244712
+ const fl6 = filter2.trim();
244713
+ return (entry) => entry.basename === fl6;
244714
+ }
244715
+ if (Array.isArray(filter2)) {
244716
+ const trItems = filter2.map((item) => item.trim());
244717
+ return (entry) => trItems.some((f7) => entry.basename === f7);
244718
+ }
244719
+ return emptyFn;
244720
+ };
244721
+
244722
+ class ReaddirpStream extends Readable6 {
244723
+ parents;
244724
+ reading;
244725
+ parent;
244726
+ _stat;
244727
+ _maxDepth;
244728
+ _wantsDir;
244729
+ _wantsFile;
244730
+ _wantsEverything;
244731
+ _root;
244732
+ _isDirent;
244733
+ _statsProp;
244734
+ _rdOptions;
244735
+ _fileFilter;
244736
+ _directoryFilter;
244737
+ constructor(options8 = {}) {
244738
+ super({
244739
+ objectMode: true,
244740
+ autoDestroy: true,
244741
+ highWaterMark: options8.highWaterMark
244742
+ });
244743
+ const opts = { ...defaultOptions, ...options8 };
244744
+ const { root: root2, type } = opts;
244745
+ this._fileFilter = normalizeFilter(opts.fileFilter);
244746
+ this._directoryFilter = normalizeFilter(opts.directoryFilter);
244747
+ const statMethod = opts.lstat ? lstat2 : stat2;
244748
+ if (wantBigintFsStats) {
244749
+ this._stat = (path19) => statMethod(path19, { bigint: true });
244750
+ } else {
244751
+ this._stat = statMethod;
244752
+ }
244753
+ this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
244754
+ this._wantsDir = type ? DIR_TYPES.has(type) : false;
244755
+ this._wantsFile = type ? FILE_TYPES2.has(type) : false;
244756
+ this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
244757
+ this._root = presolve(root2);
244758
+ this._isDirent = !opts.alwaysStat;
244759
+ this._statsProp = this._isDirent ? "dirent" : "stats";
244760
+ this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
244761
+ this.parents = [this._exploreDir(root2, 1)];
244762
+ this.reading = false;
244763
+ this.parent = undefined;
244764
+ }
244765
+ async _read(batch) {
244766
+ if (this.reading)
244767
+ return;
244768
+ this.reading = true;
244769
+ try {
244770
+ while (!this.destroyed && batch > 0) {
244771
+ const par = this.parent;
244772
+ const fil = par && par.files;
244773
+ if (fil && fil.length > 0) {
244774
+ const { path: path19, depth } = par;
244775
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path19));
244776
+ const awaited = await Promise.all(slice);
244777
+ for (const entry of awaited) {
244778
+ if (!entry)
244779
+ continue;
244780
+ if (this.destroyed)
244781
+ return;
244782
+ const entryType = await this._getEntryType(entry);
244783
+ if (entryType === "directory" && this._directoryFilter(entry)) {
244784
+ if (depth <= this._maxDepth) {
244785
+ this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
244786
+ }
244787
+ if (this._wantsDir) {
244788
+ this.push(entry);
244789
+ batch--;
244790
+ }
244791
+ } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
244792
+ if (this._wantsFile) {
244793
+ this.push(entry);
244794
+ batch--;
244795
+ }
244796
+ }
244797
+ }
244798
+ } else {
244799
+ const parent = this.parents.pop();
244800
+ if (!parent) {
244801
+ this.push(null);
244802
+ break;
244803
+ }
244804
+ this.parent = await parent;
244805
+ if (this.destroyed)
244806
+ return;
244807
+ }
244808
+ }
244809
+ } catch (error48) {
244810
+ this.destroy(error48);
244811
+ } finally {
244812
+ this.reading = false;
244813
+ }
244814
+ }
244815
+ async _exploreDir(path19, depth) {
244816
+ let files;
244817
+ try {
244818
+ files = await readdir2(path19, this._rdOptions);
244819
+ } catch (error48) {
244820
+ this._onError(error48);
244821
+ }
244822
+ return { files, depth, path: path19 };
244823
+ }
244824
+ async _formatEntry(dirent, path19) {
244825
+ let entry;
244826
+ const basename4 = this._isDirent ? dirent.name : dirent;
244827
+ try {
244828
+ const fullPath = presolve(pjoin(path19, basename4));
244829
+ entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
244830
+ entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
244831
+ } catch (err) {
244832
+ this._onError(err);
244833
+ return;
244834
+ }
244835
+ return entry;
244836
+ }
244837
+ _onError(err) {
244838
+ if (isNormalFlowError(err) && !this.destroyed) {
244839
+ this.emit("warn", err);
244840
+ } else {
244841
+ this.destroy(err);
244842
+ }
244843
+ }
244844
+ async _getEntryType(entry) {
244845
+ if (!entry && this._statsProp in entry) {
244846
+ return "";
244847
+ }
244848
+ const stats = entry[this._statsProp];
244849
+ if (stats.isFile())
244850
+ return "file";
244851
+ if (stats.isDirectory())
244852
+ return "directory";
244853
+ if (stats && stats.isSymbolicLink()) {
244854
+ const full = entry.fullPath;
244855
+ try {
244856
+ const entryRealPath = await realpath(full);
244857
+ const entryRealPathStats = await lstat2(entryRealPath);
244858
+ if (entryRealPathStats.isFile()) {
244859
+ return "file";
244860
+ }
244861
+ if (entryRealPathStats.isDirectory()) {
244862
+ const len = entryRealPath.length;
244863
+ if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {
244864
+ const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
244865
+ recursiveError.code = RECURSIVE_ERROR_CODE;
244866
+ return this._onError(recursiveError);
244867
+ }
244868
+ return "directory";
244869
+ }
244870
+ } catch (error48) {
244871
+ this._onError(error48);
244872
+ return "";
244873
+ }
244874
+ }
244875
+ }
244876
+ _includeAsFile(entry) {
244877
+ const stats = entry && entry[this._statsProp];
244878
+ return stats && this._wantsEverything && !stats.isDirectory();
244879
+ }
244880
+ }
244881
+ function readdirp(root2, options8 = {}) {
244882
+ let type = options8.entryType || options8.type;
244883
+ if (type === "both")
244884
+ type = EntryTypes.FILE_DIR_TYPE;
244885
+ if (type)
244886
+ options8.type = type;
244887
+ if (!root2) {
244888
+ throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
244889
+ } else if (typeof root2 !== "string") {
244890
+ throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
244891
+ } else if (type && !ALL_TYPES.includes(type)) {
244892
+ throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
244893
+ }
244894
+ options8.root = root2;
244895
+ return new ReaddirpStream(options8);
244896
+ }
244897
+
244898
+ // node_modules/chokidar/handler.js
244899
+ import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
244900
+ import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat3 } from "node:fs/promises";
244901
+ import { type as osType } from "node:os";
244902
+ import * as sp2 from "node:path";
244903
+ var STR_DATA = "data";
244904
+ var STR_END = "end";
244905
+ var STR_CLOSE = "close";
244906
+ var EMPTY_FN = () => {};
244907
+ var pl6 = process.platform;
244908
+ var isWindows4 = pl6 === "win32";
244909
+ var isMacos = pl6 === "darwin";
244910
+ var isLinux = pl6 === "linux";
244911
+ var isFreeBSD = pl6 === "freebsd";
244912
+ var isIBMi = osType() === "OS400";
244913
+ var EVENTS = {
244914
+ ALL: "all",
244915
+ READY: "ready",
244916
+ ADD: "add",
244917
+ CHANGE: "change",
244918
+ ADD_DIR: "addDir",
244919
+ UNLINK: "unlink",
244920
+ UNLINK_DIR: "unlinkDir",
244921
+ RAW: "raw",
244922
+ ERROR: "error"
244923
+ };
244924
+ var EV = EVENTS;
244925
+ var THROTTLE_MODE_WATCH = "watch";
244926
+ var statMethods = { lstat: lstat3, stat: stat3 };
244927
+ var KEY_LISTENERS = "listeners";
244928
+ var KEY_ERR = "errHandlers";
244929
+ var KEY_RAW = "rawEmitters";
244930
+ var HANDLER_KEYS2 = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
244931
+ var binaryExtensions = new Set([
244932
+ "3dm",
244933
+ "3ds",
244934
+ "3g2",
244935
+ "3gp",
244936
+ "7z",
244937
+ "a",
244938
+ "aac",
244939
+ "adp",
244940
+ "afdesign",
244941
+ "afphoto",
244942
+ "afpub",
244943
+ "ai",
244944
+ "aif",
244945
+ "aiff",
244946
+ "alz",
244947
+ "ape",
244948
+ "apk",
244949
+ "appimage",
244950
+ "ar",
244951
+ "arj",
244952
+ "asf",
244953
+ "au",
244954
+ "avi",
244955
+ "bak",
244956
+ "baml",
244957
+ "bh",
244958
+ "bin",
244959
+ "bk",
244960
+ "bmp",
244961
+ "btif",
244962
+ "bz2",
244963
+ "bzip2",
244964
+ "cab",
244965
+ "caf",
244966
+ "cgm",
244967
+ "class",
244968
+ "cmx",
244969
+ "cpio",
244970
+ "cr2",
244971
+ "cur",
244972
+ "dat",
244973
+ "dcm",
244974
+ "deb",
244975
+ "dex",
244976
+ "djvu",
244977
+ "dll",
244978
+ "dmg",
244979
+ "dng",
244980
+ "doc",
244981
+ "docm",
244982
+ "docx",
244983
+ "dot",
244984
+ "dotm",
244985
+ "dra",
244986
+ "DS_Store",
244987
+ "dsk",
244988
+ "dts",
244989
+ "dtshd",
244990
+ "dvb",
244991
+ "dwg",
244992
+ "dxf",
244993
+ "ecelp4800",
244994
+ "ecelp7470",
244995
+ "ecelp9600",
244996
+ "egg",
244997
+ "eol",
244998
+ "eot",
244999
+ "epub",
245000
+ "exe",
245001
+ "f4v",
245002
+ "fbs",
245003
+ "fh",
245004
+ "fla",
245005
+ "flac",
245006
+ "flatpak",
245007
+ "fli",
245008
+ "flv",
245009
+ "fpx",
245010
+ "fst",
245011
+ "fvt",
245012
+ "g3",
245013
+ "gh",
245014
+ "gif",
245015
+ "graffle",
245016
+ "gz",
245017
+ "gzip",
245018
+ "h261",
245019
+ "h263",
245020
+ "h264",
245021
+ "icns",
245022
+ "ico",
245023
+ "ief",
245024
+ "img",
245025
+ "ipa",
245026
+ "iso",
245027
+ "jar",
245028
+ "jpeg",
245029
+ "jpg",
245030
+ "jpgv",
245031
+ "jpm",
245032
+ "jxr",
245033
+ "key",
245034
+ "ktx",
245035
+ "lha",
245036
+ "lib",
245037
+ "lvp",
245038
+ "lz",
245039
+ "lzh",
245040
+ "lzma",
245041
+ "lzo",
245042
+ "m3u",
245043
+ "m4a",
245044
+ "m4v",
245045
+ "mar",
245046
+ "mdi",
245047
+ "mht",
245048
+ "mid",
245049
+ "midi",
245050
+ "mj2",
245051
+ "mka",
245052
+ "mkv",
245053
+ "mmr",
245054
+ "mng",
245055
+ "mobi",
245056
+ "mov",
245057
+ "movie",
245058
+ "mp3",
245059
+ "mp4",
245060
+ "mp4a",
245061
+ "mpeg",
245062
+ "mpg",
245063
+ "mpga",
245064
+ "mxu",
245065
+ "nef",
245066
+ "npx",
245067
+ "numbers",
245068
+ "nupkg",
245069
+ "o",
245070
+ "odp",
245071
+ "ods",
245072
+ "odt",
245073
+ "oga",
245074
+ "ogg",
245075
+ "ogv",
245076
+ "otf",
245077
+ "ott",
245078
+ "pages",
245079
+ "pbm",
245080
+ "pcx",
245081
+ "pdb",
245082
+ "pdf",
245083
+ "pea",
245084
+ "pgm",
245085
+ "pic",
245086
+ "png",
245087
+ "pnm",
245088
+ "pot",
245089
+ "potm",
245090
+ "potx",
245091
+ "ppa",
245092
+ "ppam",
245093
+ "ppm",
245094
+ "pps",
245095
+ "ppsm",
245096
+ "ppsx",
245097
+ "ppt",
245098
+ "pptm",
245099
+ "pptx",
245100
+ "psd",
245101
+ "pya",
245102
+ "pyc",
245103
+ "pyo",
245104
+ "pyv",
245105
+ "qt",
245106
+ "rar",
245107
+ "ras",
245108
+ "raw",
245109
+ "resources",
245110
+ "rgb",
245111
+ "rip",
245112
+ "rlc",
245113
+ "rmf",
245114
+ "rmvb",
245115
+ "rpm",
245116
+ "rtf",
245117
+ "rz",
245118
+ "s3m",
245119
+ "s7z",
245120
+ "scpt",
245121
+ "sgi",
245122
+ "shar",
245123
+ "snap",
245124
+ "sil",
245125
+ "sketch",
245126
+ "slk",
245127
+ "smv",
245128
+ "snk",
245129
+ "so",
245130
+ "stl",
245131
+ "suo",
245132
+ "sub",
245133
+ "swf",
245134
+ "tar",
245135
+ "tbz",
245136
+ "tbz2",
245137
+ "tga",
245138
+ "tgz",
245139
+ "thmx",
245140
+ "tif",
245141
+ "tiff",
245142
+ "tlz",
245143
+ "ttc",
245144
+ "ttf",
245145
+ "txz",
245146
+ "udf",
245147
+ "uvh",
245148
+ "uvi",
245149
+ "uvm",
245150
+ "uvp",
245151
+ "uvs",
245152
+ "uvu",
245153
+ "viv",
245154
+ "vob",
245155
+ "war",
245156
+ "wav",
245157
+ "wax",
245158
+ "wbmp",
245159
+ "wdp",
245160
+ "weba",
245161
+ "webm",
245162
+ "webp",
245163
+ "whl",
245164
+ "wim",
245165
+ "wm",
245166
+ "wma",
245167
+ "wmv",
245168
+ "wmx",
245169
+ "woff",
245170
+ "woff2",
245171
+ "wrm",
245172
+ "wvx",
245173
+ "xbm",
245174
+ "xif",
245175
+ "xla",
245176
+ "xlam",
245177
+ "xls",
245178
+ "xlsb",
245179
+ "xlsm",
245180
+ "xlsx",
245181
+ "xlt",
245182
+ "xltm",
245183
+ "xltx",
245184
+ "xm",
245185
+ "xmind",
245186
+ "xpi",
245187
+ "xpm",
245188
+ "xwd",
245189
+ "xz",
245190
+ "z",
245191
+ "zip",
245192
+ "zipx"
245193
+ ]);
245194
+ var isBinaryPath = (filePath) => binaryExtensions.has(sp2.extname(filePath).slice(1).toLowerCase());
245195
+ var foreach = (val, fn9) => {
245196
+ if (val instanceof Set) {
245197
+ val.forEach(fn9);
245198
+ } else {
245199
+ fn9(val);
245200
+ }
245201
+ };
245202
+ var addAndConvert = (main, prop, item) => {
245203
+ let container = main[prop];
245204
+ if (!(container instanceof Set)) {
245205
+ main[prop] = container = new Set([container]);
245206
+ }
245207
+ container.add(item);
245208
+ };
245209
+ var clearItem = (cont) => (key2) => {
245210
+ const set2 = cont[key2];
245211
+ if (set2 instanceof Set) {
245212
+ set2.clear();
245213
+ } else {
245214
+ delete cont[key2];
245215
+ }
245216
+ };
245217
+ var delFromSet = (main, prop, item) => {
245218
+ const container = main[prop];
245219
+ if (container instanceof Set) {
245220
+ container.delete(item);
245221
+ } else if (container === item) {
245222
+ delete main[prop];
245223
+ }
245224
+ };
245225
+ var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
245226
+ var FsWatchInstances = new Map;
245227
+ function createFsWatchInstance(path19, options8, listener, errHandler, emitRaw) {
245228
+ const handleEvent = (rawEvent, evPath) => {
245229
+ listener(path19);
245230
+ emitRaw(rawEvent, evPath, { watchedPath: path19 });
245231
+ if (evPath && path19 !== evPath) {
245232
+ fsWatchBroadcast(sp2.resolve(path19, evPath), KEY_LISTENERS, sp2.join(path19, evPath));
245233
+ }
245234
+ };
245235
+ try {
245236
+ return fs_watch(path19, {
245237
+ persistent: options8.persistent
245238
+ }, handleEvent);
245239
+ } catch (error48) {
245240
+ errHandler(error48);
245241
+ return;
245242
+ }
245243
+ }
245244
+ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
245245
+ const cont = FsWatchInstances.get(fullPath);
245246
+ if (!cont)
245247
+ return;
245248
+ foreach(cont[listenerType], (listener) => {
245249
+ listener(val1, val2, val3);
245250
+ });
245251
+ };
245252
+ var setFsWatchListener = (path19, fullPath, options8, handlers) => {
245253
+ const { listener, errHandler, rawEmitter } = handlers;
245254
+ let cont = FsWatchInstances.get(fullPath);
245255
+ let watcher;
245256
+ if (!options8.persistent) {
245257
+ watcher = createFsWatchInstance(path19, options8, listener, errHandler, rawEmitter);
245258
+ if (!watcher)
245259
+ return;
245260
+ return watcher.close.bind(watcher);
245261
+ }
245262
+ if (cont) {
245263
+ addAndConvert(cont, KEY_LISTENERS, listener);
245264
+ addAndConvert(cont, KEY_ERR, errHandler);
245265
+ addAndConvert(cont, KEY_RAW, rawEmitter);
245266
+ } else {
245267
+ watcher = createFsWatchInstance(path19, options8, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
245268
+ if (!watcher)
245269
+ return;
245270
+ watcher.on(EV.ERROR, async (error48) => {
245271
+ const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
245272
+ if (cont)
245273
+ cont.watcherUnusable = true;
245274
+ if (isWindows4 && error48.code === "EPERM") {
245275
+ try {
245276
+ const fd = await open2(path19, "r");
245277
+ await fd.close();
245278
+ broadcastErr(error48);
245279
+ } catch (err) {}
245280
+ } else {
245281
+ broadcastErr(error48);
245282
+ }
245283
+ });
245284
+ cont = {
245285
+ listeners: listener,
245286
+ errHandlers: errHandler,
245287
+ rawEmitters: rawEmitter,
245288
+ watcher
245289
+ };
245290
+ FsWatchInstances.set(fullPath, cont);
245291
+ }
245292
+ return () => {
245293
+ delFromSet(cont, KEY_LISTENERS, listener);
245294
+ delFromSet(cont, KEY_ERR, errHandler);
245295
+ delFromSet(cont, KEY_RAW, rawEmitter);
245296
+ if (isEmptySet(cont.listeners)) {
245297
+ cont.watcher.close();
245298
+ FsWatchInstances.delete(fullPath);
245299
+ HANDLER_KEYS2.forEach(clearItem(cont));
245300
+ cont.watcher = undefined;
245301
+ Object.freeze(cont);
245302
+ }
245303
+ };
245304
+ };
245305
+ var FsWatchFileInstances = new Map;
245306
+ var setFsWatchFileListener = (path19, fullPath, options8, handlers) => {
245307
+ const { listener, rawEmitter } = handlers;
245308
+ let cont = FsWatchFileInstances.get(fullPath);
245309
+ const copts = cont && cont.options;
245310
+ if (copts && (copts.persistent < options8.persistent || copts.interval > options8.interval)) {
245311
+ unwatchFile(fullPath);
245312
+ cont = undefined;
245313
+ }
245314
+ if (cont) {
245315
+ addAndConvert(cont, KEY_LISTENERS, listener);
245316
+ addAndConvert(cont, KEY_RAW, rawEmitter);
245317
+ } else {
245318
+ cont = {
245319
+ listeners: listener,
245320
+ rawEmitters: rawEmitter,
245321
+ options: options8,
245322
+ watcher: watchFile(fullPath, options8, (curr, prev) => {
245323
+ foreach(cont.rawEmitters, (rawEmitter2) => {
245324
+ rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
245325
+ });
245326
+ const currmtime = curr.mtimeMs;
245327
+ if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
245328
+ foreach(cont.listeners, (listener2) => listener2(path19, curr));
245329
+ }
245330
+ })
245331
+ };
245332
+ FsWatchFileInstances.set(fullPath, cont);
245333
+ }
245334
+ return () => {
245335
+ delFromSet(cont, KEY_LISTENERS, listener);
245336
+ delFromSet(cont, KEY_RAW, rawEmitter);
245337
+ if (isEmptySet(cont.listeners)) {
245338
+ FsWatchFileInstances.delete(fullPath);
245339
+ unwatchFile(fullPath);
245340
+ cont.options = cont.watcher = undefined;
245341
+ Object.freeze(cont);
245342
+ }
245343
+ };
245344
+ };
245345
+
245346
+ class NodeFsHandler {
245347
+ fsw;
245348
+ _boundHandleError;
245349
+ constructor(fsW) {
245350
+ this.fsw = fsW;
245351
+ this._boundHandleError = (error48) => fsW._handleError(error48);
245352
+ }
245353
+ _watchWithNodeFs(path19, listener) {
245354
+ const opts = this.fsw.options;
245355
+ const directory = sp2.dirname(path19);
245356
+ const basename5 = sp2.basename(path19);
245357
+ const parent = this.fsw._getWatchedDir(directory);
245358
+ parent.add(basename5);
245359
+ const absolutePath = sp2.resolve(path19);
245360
+ const options8 = {
245361
+ persistent: opts.persistent
245362
+ };
245363
+ if (!listener)
245364
+ listener = EMPTY_FN;
245365
+ let closer;
245366
+ if (opts.usePolling) {
245367
+ const enableBin = opts.interval !== opts.binaryInterval;
245368
+ options8.interval = enableBin && isBinaryPath(basename5) ? opts.binaryInterval : opts.interval;
245369
+ closer = setFsWatchFileListener(path19, absolutePath, options8, {
245370
+ listener,
245371
+ rawEmitter: this.fsw._emitRaw
245372
+ });
245373
+ } else {
245374
+ closer = setFsWatchListener(path19, absolutePath, options8, {
245375
+ listener,
245376
+ errHandler: this._boundHandleError,
245377
+ rawEmitter: this.fsw._emitRaw
245378
+ });
245379
+ }
245380
+ return closer;
245381
+ }
245382
+ _handleFile(file2, stats, initialAdd) {
245383
+ if (this.fsw.closed) {
245384
+ return;
245385
+ }
245386
+ const dirname14 = sp2.dirname(file2);
245387
+ const basename5 = sp2.basename(file2);
245388
+ const parent = this.fsw._getWatchedDir(dirname14);
245389
+ let prevStats = stats;
245390
+ if (parent.has(basename5))
245391
+ return;
245392
+ const listener = async (path19, newStats) => {
245393
+ if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
245394
+ return;
245395
+ if (!newStats || newStats.mtimeMs === 0) {
245396
+ try {
245397
+ const newStats2 = await stat3(file2);
245398
+ if (this.fsw.closed)
245399
+ return;
245400
+ const at13 = newStats2.atimeMs;
245401
+ const mt12 = newStats2.mtimeMs;
245402
+ if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
245403
+ this.fsw._emit(EV.CHANGE, file2, newStats2);
245404
+ }
245405
+ if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
245406
+ this.fsw._closeFile(path19);
245407
+ prevStats = newStats2;
245408
+ const closer2 = this._watchWithNodeFs(file2, listener);
245409
+ if (closer2)
245410
+ this.fsw._addPathCloser(path19, closer2);
245411
+ } else {
245412
+ prevStats = newStats2;
245413
+ }
245414
+ } catch (error48) {
245415
+ this.fsw._remove(dirname14, basename5);
245416
+ }
245417
+ } else if (parent.has(basename5)) {
245418
+ const at13 = newStats.atimeMs;
245419
+ const mt12 = newStats.mtimeMs;
245420
+ if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
245421
+ this.fsw._emit(EV.CHANGE, file2, newStats);
245422
+ }
245423
+ prevStats = newStats;
245424
+ }
245425
+ };
245426
+ const closer = this._watchWithNodeFs(file2, listener);
245427
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file2)) {
245428
+ if (!this.fsw._throttle(EV.ADD, file2, 0))
245429
+ return;
245430
+ this.fsw._emit(EV.ADD, file2, stats);
245431
+ }
245432
+ return closer;
245433
+ }
245434
+ async _handleSymlink(entry, directory, path19, item) {
245435
+ if (this.fsw.closed) {
245436
+ return;
245437
+ }
245438
+ const full = entry.fullPath;
245439
+ const dir = this.fsw._getWatchedDir(directory);
245440
+ if (!this.fsw.options.followSymlinks) {
245441
+ this.fsw._incrReadyCount();
245442
+ let linkPath;
245443
+ try {
245444
+ linkPath = await fsrealpath(path19);
245445
+ } catch (e8) {
245446
+ this.fsw._emitReady();
245447
+ return true;
245448
+ }
245449
+ if (this.fsw.closed)
245450
+ return;
245451
+ if (dir.has(item)) {
245452
+ if (this.fsw._symlinkPaths.get(full) !== linkPath) {
245453
+ this.fsw._symlinkPaths.set(full, linkPath);
245454
+ this.fsw._emit(EV.CHANGE, path19, entry.stats);
245455
+ }
245456
+ } else {
245457
+ dir.add(item);
245458
+ this.fsw._symlinkPaths.set(full, linkPath);
245459
+ this.fsw._emit(EV.ADD, path19, entry.stats);
245460
+ }
245461
+ this.fsw._emitReady();
245462
+ return true;
245463
+ }
245464
+ if (this.fsw._symlinkPaths.has(full)) {
245465
+ return true;
245466
+ }
245467
+ this.fsw._symlinkPaths.set(full, true);
245468
+ }
245469
+ _handleRead(directory, initialAdd, wh2, target, dir, depth, throttler) {
245470
+ directory = sp2.join(directory, "");
245471
+ const throttleKey = target ? `${directory}:${target}` : directory;
245472
+ throttler = this.fsw._throttle("readdir", throttleKey, 1000);
245473
+ if (!throttler)
245474
+ return;
245475
+ const previous = this.fsw._getWatchedDir(wh2.path);
245476
+ const current = new Set;
245477
+ let stream = this.fsw._readdirp(directory, {
245478
+ fileFilter: (entry) => wh2.filterPath(entry),
245479
+ directoryFilter: (entry) => wh2.filterDir(entry)
245480
+ });
245481
+ if (!stream)
245482
+ return;
245483
+ stream.on(STR_DATA, async (entry) => {
245484
+ if (this.fsw.closed) {
245485
+ stream = undefined;
245486
+ return;
245487
+ }
245488
+ const item = entry.path;
245489
+ let path19 = sp2.join(directory, item);
245490
+ current.add(item);
245491
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path19, item)) {
245492
+ return;
245493
+ }
245494
+ if (this.fsw.closed) {
245495
+ stream = undefined;
245496
+ return;
245497
+ }
245498
+ if (item === target || !target && !previous.has(item)) {
245499
+ this.fsw._incrReadyCount();
245500
+ path19 = sp2.join(dir, sp2.relative(dir, path19));
245501
+ this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
245502
+ }
245503
+ }).on(EV.ERROR, this._boundHandleError);
245504
+ return new Promise((resolve7, reject) => {
245505
+ if (!stream)
245506
+ return reject();
245507
+ stream.once(STR_END, () => {
245508
+ if (this.fsw.closed) {
245509
+ stream = undefined;
245510
+ return;
245511
+ }
245512
+ const wasThrottled = throttler ? throttler.clear() : false;
245513
+ resolve7(undefined);
245514
+ previous.getChildren().filter((item) => {
245515
+ return item !== directory && !current.has(item);
245516
+ }).forEach((item) => {
245517
+ this.fsw._remove(directory, item);
245518
+ });
245519
+ stream = undefined;
245520
+ if (wasThrottled)
245521
+ this._handleRead(directory, false, wh2, target, dir, depth, throttler);
245522
+ });
245523
+ });
245524
+ }
245525
+ async _handleDir(dir, stats, initialAdd, depth, target, wh2, realpath2) {
245526
+ const parentDir = this.fsw._getWatchedDir(sp2.dirname(dir));
245527
+ const tracked = parentDir.has(sp2.basename(dir));
245528
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
245529
+ this.fsw._emit(EV.ADD_DIR, dir, stats);
245530
+ }
245531
+ parentDir.add(sp2.basename(dir));
245532
+ this.fsw._getWatchedDir(dir);
245533
+ let throttler;
245534
+ let closer;
245535
+ const oDepth = this.fsw.options.depth;
245536
+ if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
245537
+ if (!target) {
245538
+ await this._handleRead(dir, initialAdd, wh2, target, dir, depth, throttler);
245539
+ if (this.fsw.closed)
245540
+ return;
245541
+ }
245542
+ closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
245543
+ if (stats2 && stats2.mtimeMs === 0)
245544
+ return;
245545
+ this._handleRead(dirPath, false, wh2, target, dir, depth, throttler);
245546
+ });
245547
+ }
245548
+ return closer;
245549
+ }
245550
+ async _addToNodeFs(path19, initialAdd, priorWh, depth, target) {
245551
+ const ready = this.fsw._emitReady;
245552
+ if (this.fsw._isIgnored(path19) || this.fsw.closed) {
245553
+ ready();
245554
+ return false;
245555
+ }
245556
+ const wh2 = this.fsw._getWatchHelpers(path19);
245557
+ if (priorWh) {
245558
+ wh2.filterPath = (entry) => priorWh.filterPath(entry);
245559
+ wh2.filterDir = (entry) => priorWh.filterDir(entry);
245560
+ }
245561
+ try {
245562
+ const stats = await statMethods[wh2.statMethod](wh2.watchPath);
245563
+ if (this.fsw.closed)
245564
+ return;
245565
+ if (this.fsw._isIgnored(wh2.watchPath, stats)) {
245566
+ ready();
245567
+ return false;
245568
+ }
245569
+ const follow = this.fsw.options.followSymlinks;
245570
+ let closer;
245571
+ if (stats.isDirectory()) {
245572
+ const absPath = sp2.resolve(path19);
245573
+ const targetPath = follow ? await fsrealpath(path19) : path19;
245574
+ if (this.fsw.closed)
245575
+ return;
245576
+ closer = await this._handleDir(wh2.watchPath, stats, initialAdd, depth, target, wh2, targetPath);
245577
+ if (this.fsw.closed)
245578
+ return;
245579
+ if (absPath !== targetPath && targetPath !== undefined) {
245580
+ this.fsw._symlinkPaths.set(absPath, targetPath);
245581
+ }
245582
+ } else if (stats.isSymbolicLink()) {
245583
+ const targetPath = follow ? await fsrealpath(path19) : path19;
245584
+ if (this.fsw.closed)
245585
+ return;
245586
+ const parent = sp2.dirname(wh2.watchPath);
245587
+ this.fsw._getWatchedDir(parent).add(wh2.watchPath);
245588
+ this.fsw._emit(EV.ADD, wh2.watchPath, stats);
245589
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path19, wh2, targetPath);
245590
+ if (this.fsw.closed)
245591
+ return;
245592
+ if (targetPath !== undefined) {
245593
+ this.fsw._symlinkPaths.set(sp2.resolve(path19), targetPath);
245594
+ }
245595
+ } else {
245596
+ closer = this._handleFile(wh2.watchPath, stats, initialAdd);
245597
+ }
245598
+ ready();
245599
+ if (closer)
245600
+ this.fsw._addPathCloser(path19, closer);
245601
+ return false;
245602
+ } catch (error48) {
245603
+ if (this.fsw._handleError(error48)) {
245604
+ ready();
245605
+ return path19;
245606
+ }
245607
+ }
245608
+ }
245609
+ }
245610
+
245611
+ // node_modules/chokidar/index.js
245612
+ /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
245613
+ var SLASH = "/";
245614
+ var SLASH_SLASH = "//";
245615
+ var ONE_DOT = ".";
245616
+ var TWO_DOTS = "..";
245617
+ var STRING_TYPE = "string";
245618
+ var BACK_SLASH_RE = /\\/g;
245619
+ var DOUBLE_SLASH_RE = /\/\//g;
245620
+ var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
245621
+ var REPLACER_RE = /^\.[/\\]/;
245622
+ function arrify(item) {
245623
+ return Array.isArray(item) ? item : [item];
245624
+ }
245625
+ var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
245626
+ function createPattern(matcher) {
245627
+ if (typeof matcher === "function")
245628
+ return matcher;
245629
+ if (typeof matcher === "string")
245630
+ return (string4) => matcher === string4;
245631
+ if (matcher instanceof RegExp)
245632
+ return (string4) => matcher.test(string4);
245633
+ if (typeof matcher === "object" && matcher !== null) {
245634
+ return (string4) => {
245635
+ if (matcher.path === string4)
245636
+ return true;
245637
+ if (matcher.recursive) {
245638
+ const relative6 = sp3.relative(matcher.path, string4);
245639
+ if (!relative6) {
245640
+ return false;
245641
+ }
245642
+ return !relative6.startsWith("..") && !sp3.isAbsolute(relative6);
245643
+ }
245644
+ return false;
245645
+ };
245646
+ }
245647
+ return () => false;
245648
+ }
245649
+ function normalizePath(path19) {
245650
+ if (typeof path19 !== "string")
245651
+ throw new Error("string expected");
245652
+ path19 = sp3.normalize(path19);
245653
+ path19 = path19.replace(/\\/g, "/");
245654
+ let prepend = false;
245655
+ if (path19.startsWith("//"))
245656
+ prepend = true;
245657
+ path19 = path19.replace(DOUBLE_SLASH_RE, "/");
245658
+ if (prepend)
245659
+ path19 = "/" + path19;
245660
+ return path19;
245661
+ }
245662
+ function matchPatterns(patterns, testString, stats) {
245663
+ const path19 = normalizePath(testString);
245664
+ for (let index = 0;index < patterns.length; index++) {
245665
+ const pattern = patterns[index];
245666
+ if (pattern(path19, stats)) {
245667
+ return true;
245668
+ }
245669
+ }
245670
+ return false;
245671
+ }
245672
+ function anymatch(matchers, testString) {
245673
+ if (matchers == null) {
245674
+ throw new TypeError("anymatch: specify first argument");
245675
+ }
245676
+ const matchersArray = arrify(matchers);
245677
+ const patterns = matchersArray.map((matcher) => createPattern(matcher));
245678
+ if (testString == null) {
245679
+ return (testString2, stats) => {
245680
+ return matchPatterns(patterns, testString2, stats);
245681
+ };
245682
+ }
245683
+ return matchPatterns(patterns, testString);
245684
+ }
245685
+ var unifyPaths = (paths_) => {
245686
+ const paths = arrify(paths_).flat();
245687
+ if (!paths.every((p4) => typeof p4 === STRING_TYPE)) {
245688
+ throw new TypeError(`Non-string provided as watch path: ${paths}`);
245689
+ }
245690
+ return paths.map(normalizePathToUnix);
245691
+ };
245692
+ var toUnix = (string4) => {
245693
+ let str = string4.replace(BACK_SLASH_RE, SLASH);
245694
+ let prepend = false;
245695
+ if (str.startsWith(SLASH_SLASH)) {
245696
+ prepend = true;
245697
+ }
245698
+ str = str.replace(DOUBLE_SLASH_RE, SLASH);
245699
+ if (prepend) {
245700
+ str = SLASH + str;
245701
+ }
245702
+ return str;
245703
+ };
245704
+ var normalizePathToUnix = (path19) => toUnix(sp3.normalize(toUnix(path19)));
245705
+ var normalizeIgnored = (cwd = "") => (path19) => {
245706
+ if (typeof path19 === "string") {
245707
+ return normalizePathToUnix(sp3.isAbsolute(path19) ? path19 : sp3.join(cwd, path19));
245708
+ } else {
245709
+ return path19;
245710
+ }
245711
+ };
245712
+ var getAbsolutePath = (path19, cwd) => {
245713
+ if (sp3.isAbsolute(path19)) {
245714
+ return path19;
245715
+ }
245716
+ return sp3.join(cwd, path19);
245717
+ };
245718
+ var EMPTY_SET = Object.freeze(new Set);
245719
+
245720
+ class DirEntry {
245721
+ path;
245722
+ _removeWatcher;
245723
+ items;
245724
+ constructor(dir, removeWatcher) {
245725
+ this.path = dir;
245726
+ this._removeWatcher = removeWatcher;
245727
+ this.items = new Set;
245728
+ }
245729
+ add(item) {
245730
+ const { items } = this;
245731
+ if (!items)
245732
+ return;
245733
+ if (item !== ONE_DOT && item !== TWO_DOTS)
245734
+ items.add(item);
245735
+ }
245736
+ async remove(item) {
245737
+ const { items } = this;
245738
+ if (!items)
245739
+ return;
245740
+ items.delete(item);
245741
+ if (items.size > 0)
245742
+ return;
245743
+ const dir = this.path;
245744
+ try {
245745
+ await readdir3(dir);
245746
+ } catch (err) {
245747
+ if (this._removeWatcher) {
245748
+ this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
245749
+ }
245750
+ }
245751
+ }
245752
+ has(item) {
245753
+ const { items } = this;
245754
+ if (!items)
245755
+ return;
245756
+ return items.has(item);
245757
+ }
245758
+ getChildren() {
245759
+ const { items } = this;
245760
+ if (!items)
245761
+ return [];
245762
+ return [...items.values()];
245763
+ }
245764
+ dispose() {
245765
+ this.items.clear();
245766
+ this.path = "";
245767
+ this._removeWatcher = EMPTY_FN;
245768
+ this.items = EMPTY_SET;
245769
+ Object.freeze(this);
245770
+ }
245771
+ }
245772
+ var STAT_METHOD_F = "stat";
245773
+ var STAT_METHOD_L = "lstat";
245774
+
245775
+ class WatchHelper {
245776
+ fsw;
245777
+ path;
245778
+ watchPath;
245779
+ fullWatchPath;
245780
+ dirParts;
245781
+ followSymlinks;
245782
+ statMethod;
245783
+ constructor(path19, follow, fsw) {
245784
+ this.fsw = fsw;
245785
+ const watchPath = path19;
245786
+ this.path = path19 = path19.replace(REPLACER_RE, "");
245787
+ this.watchPath = watchPath;
245788
+ this.fullWatchPath = sp3.resolve(watchPath);
245789
+ this.dirParts = [];
245790
+ this.dirParts.forEach((parts) => {
245791
+ if (parts.length > 1)
245792
+ parts.pop();
245793
+ });
245794
+ this.followSymlinks = follow;
245795
+ this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
245796
+ }
245797
+ entryPath(entry) {
245798
+ return sp3.join(this.watchPath, sp3.relative(this.watchPath, entry.fullPath));
245799
+ }
245800
+ filterPath(entry) {
245801
+ const { stats } = entry;
245802
+ if (stats && stats.isSymbolicLink())
245803
+ return this.filterDir(entry);
245804
+ const resolvedPath = this.entryPath(entry);
245805
+ return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
245806
+ }
245807
+ filterDir(entry) {
245808
+ return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
245809
+ }
245810
+ }
245811
+
245812
+ class FSWatcher extends EventEmitter3 {
245813
+ closed;
245814
+ options;
245815
+ _closers;
245816
+ _ignoredPaths;
245817
+ _throttled;
245818
+ _streams;
245819
+ _symlinkPaths;
245820
+ _watched;
245821
+ _pendingWrites;
245822
+ _pendingUnlinks;
245823
+ _readyCount;
245824
+ _emitReady;
245825
+ _closePromise;
245826
+ _userIgnored;
245827
+ _readyEmitted;
245828
+ _emitRaw;
245829
+ _boundRemove;
245830
+ _nodeFsHandler;
245831
+ constructor(_opts = {}) {
245832
+ super();
245833
+ this.closed = false;
245834
+ this._closers = new Map;
245835
+ this._ignoredPaths = new Set;
245836
+ this._throttled = new Map;
245837
+ this._streams = new Set;
245838
+ this._symlinkPaths = new Map;
245839
+ this._watched = new Map;
245840
+ this._pendingWrites = new Map;
245841
+ this._pendingUnlinks = new Map;
245842
+ this._readyCount = 0;
245843
+ this._readyEmitted = false;
245844
+ const awf = _opts.awaitWriteFinish;
245845
+ const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };
245846
+ const opts = {
245847
+ persistent: true,
245848
+ ignoreInitial: false,
245849
+ ignorePermissionErrors: false,
245850
+ interval: 100,
245851
+ binaryInterval: 300,
245852
+ followSymlinks: true,
245853
+ usePolling: false,
245854
+ atomic: true,
245855
+ ..._opts,
245856
+ ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
245857
+ awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
245858
+ };
245859
+ if (isIBMi)
245860
+ opts.usePolling = true;
245861
+ if (opts.atomic === undefined)
245862
+ opts.atomic = !opts.usePolling;
245863
+ const envPoll = process.env.CHOKIDAR_USEPOLLING;
245864
+ if (envPoll !== undefined) {
245865
+ const envLower = envPoll.toLowerCase();
245866
+ if (envLower === "false" || envLower === "0")
245867
+ opts.usePolling = false;
245868
+ else if (envLower === "true" || envLower === "1")
245869
+ opts.usePolling = true;
245870
+ else
245871
+ opts.usePolling = !!envLower;
245872
+ }
245873
+ const envInterval = process.env.CHOKIDAR_INTERVAL;
245874
+ if (envInterval)
245875
+ opts.interval = Number.parseInt(envInterval, 10);
245876
+ let readyCalls = 0;
245877
+ this._emitReady = () => {
245878
+ readyCalls++;
245879
+ if (readyCalls >= this._readyCount) {
245880
+ this._emitReady = EMPTY_FN;
245881
+ this._readyEmitted = true;
245882
+ process.nextTick(() => this.emit(EVENTS.READY));
245883
+ }
245884
+ };
245885
+ this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
245886
+ this._boundRemove = this._remove.bind(this);
245887
+ this.options = opts;
245888
+ this._nodeFsHandler = new NodeFsHandler(this);
245889
+ Object.freeze(opts);
245890
+ }
245891
+ _addIgnoredPath(matcher) {
245892
+ if (isMatcherObject(matcher)) {
245893
+ for (const ignored of this._ignoredPaths) {
245894
+ if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) {
245895
+ return;
245896
+ }
245897
+ }
245898
+ }
245899
+ this._ignoredPaths.add(matcher);
245900
+ }
245901
+ _removeIgnoredPath(matcher) {
245902
+ this._ignoredPaths.delete(matcher);
245903
+ if (typeof matcher === "string") {
245904
+ for (const ignored of this._ignoredPaths) {
245905
+ if (isMatcherObject(ignored) && ignored.path === matcher) {
245906
+ this._ignoredPaths.delete(ignored);
245907
+ }
245908
+ }
245909
+ }
245910
+ }
245911
+ add(paths_, _origAdd, _internal) {
245912
+ const { cwd } = this.options;
245913
+ this.closed = false;
245914
+ this._closePromise = undefined;
245915
+ let paths = unifyPaths(paths_);
245916
+ if (cwd) {
245917
+ paths = paths.map((path19) => {
245918
+ const absPath = getAbsolutePath(path19, cwd);
245919
+ return absPath;
245920
+ });
245921
+ }
245922
+ paths.forEach((path19) => {
245923
+ this._removeIgnoredPath(path19);
245924
+ });
245925
+ this._userIgnored = undefined;
245926
+ if (!this._readyCount)
245927
+ this._readyCount = 0;
245928
+ this._readyCount += paths.length;
245929
+ Promise.all(paths.map(async (path19) => {
245930
+ const res = await this._nodeFsHandler._addToNodeFs(path19, !_internal, undefined, 0, _origAdd);
245931
+ if (res)
245932
+ this._emitReady();
245933
+ return res;
245934
+ })).then((results) => {
245935
+ if (this.closed)
245936
+ return;
245937
+ results.forEach((item) => {
245938
+ if (item)
245939
+ this.add(sp3.dirname(item), sp3.basename(_origAdd || item));
245940
+ });
245941
+ });
245942
+ return this;
245943
+ }
245944
+ unwatch(paths_) {
245945
+ if (this.closed)
245946
+ return this;
245947
+ const paths = unifyPaths(paths_);
245948
+ const { cwd } = this.options;
245949
+ paths.forEach((path19) => {
245950
+ if (!sp3.isAbsolute(path19) && !this._closers.has(path19)) {
245951
+ if (cwd)
245952
+ path19 = sp3.join(cwd, path19);
245953
+ path19 = sp3.resolve(path19);
245954
+ }
245955
+ this._closePath(path19);
245956
+ this._addIgnoredPath(path19);
245957
+ if (this._watched.has(path19)) {
245958
+ this._addIgnoredPath({
245959
+ path: path19,
245960
+ recursive: true
245961
+ });
245962
+ }
245963
+ this._userIgnored = undefined;
245964
+ });
245965
+ return this;
245966
+ }
245967
+ close() {
245968
+ if (this._closePromise) {
245969
+ return this._closePromise;
245970
+ }
245971
+ this.closed = true;
245972
+ this.removeAllListeners();
245973
+ const closers = [];
245974
+ this._closers.forEach((closerList) => closerList.forEach((closer) => {
245975
+ const promise2 = closer();
245976
+ if (promise2 instanceof Promise)
245977
+ closers.push(promise2);
245978
+ }));
245979
+ this._streams.forEach((stream) => stream.destroy());
245980
+ this._userIgnored = undefined;
245981
+ this._readyCount = 0;
245982
+ this._readyEmitted = false;
245983
+ this._watched.forEach((dirent) => dirent.dispose());
245984
+ this._closers.clear();
245985
+ this._watched.clear();
245986
+ this._streams.clear();
245987
+ this._symlinkPaths.clear();
245988
+ this._throttled.clear();
245989
+ this._closePromise = closers.length ? Promise.all(closers).then(() => {
245990
+ return;
245991
+ }) : Promise.resolve();
245992
+ return this._closePromise;
245993
+ }
245994
+ getWatched() {
245995
+ const watchList = {};
245996
+ this._watched.forEach((entry, dir) => {
245997
+ const key2 = this.options.cwd ? sp3.relative(this.options.cwd, dir) : dir;
245998
+ const index = key2 || ONE_DOT;
245999
+ watchList[index] = entry.getChildren().sort();
246000
+ });
246001
+ return watchList;
246002
+ }
246003
+ emitWithAll(event, args) {
246004
+ this.emit(event, ...args);
246005
+ if (event !== EVENTS.ERROR)
246006
+ this.emit(EVENTS.ALL, event, ...args);
246007
+ }
246008
+ async _emit(event, path19, stats) {
246009
+ if (this.closed)
246010
+ return;
246011
+ const opts = this.options;
246012
+ if (isWindows4)
246013
+ path19 = sp3.normalize(path19);
246014
+ if (opts.cwd)
246015
+ path19 = sp3.relative(opts.cwd, path19);
246016
+ const args = [path19];
246017
+ if (stats != null)
246018
+ args.push(stats);
246019
+ const awf = opts.awaitWriteFinish;
246020
+ let pw;
246021
+ if (awf && (pw = this._pendingWrites.get(path19))) {
246022
+ pw.lastChange = new Date;
246023
+ return this;
246024
+ }
246025
+ if (opts.atomic) {
246026
+ if (event === EVENTS.UNLINK) {
246027
+ this._pendingUnlinks.set(path19, [event, ...args]);
246028
+ setTimeout(() => {
246029
+ this._pendingUnlinks.forEach((entry, path20) => {
246030
+ this.emit(...entry);
246031
+ this.emit(EVENTS.ALL, ...entry);
246032
+ this._pendingUnlinks.delete(path20);
246033
+ });
246034
+ }, typeof opts.atomic === "number" ? opts.atomic : 100);
246035
+ return this;
246036
+ }
246037
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path19)) {
246038
+ event = EVENTS.CHANGE;
246039
+ this._pendingUnlinks.delete(path19);
246040
+ }
246041
+ }
246042
+ if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
246043
+ const awfEmit = (err, stats2) => {
246044
+ if (err) {
246045
+ event = EVENTS.ERROR;
246046
+ args[0] = err;
246047
+ this.emitWithAll(event, args);
246048
+ } else if (stats2) {
246049
+ if (args.length > 1) {
246050
+ args[1] = stats2;
246051
+ } else {
246052
+ args.push(stats2);
246053
+ }
246054
+ this.emitWithAll(event, args);
246055
+ }
246056
+ };
246057
+ this._awaitWriteFinish(path19, awf.stabilityThreshold, event, awfEmit);
246058
+ return this;
246059
+ }
246060
+ if (event === EVENTS.CHANGE) {
246061
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path19, 50);
246062
+ if (isThrottled)
246063
+ return this;
246064
+ }
246065
+ if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
246066
+ const fullPath = opts.cwd ? sp3.join(opts.cwd, path19) : path19;
246067
+ let stats2;
246068
+ try {
246069
+ stats2 = await stat4(fullPath);
246070
+ } catch (err) {}
246071
+ if (!stats2 || this.closed)
246072
+ return;
246073
+ args.push(stats2);
246074
+ }
246075
+ this.emitWithAll(event, args);
246076
+ return this;
246077
+ }
246078
+ _handleError(error48) {
246079
+ const code2 = error48 && error48.code;
246080
+ if (error48 && code2 !== "ENOENT" && code2 !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code2 !== "EPERM" && code2 !== "EACCES")) {
246081
+ this.emit(EVENTS.ERROR, error48);
246082
+ }
246083
+ return error48 || this.closed;
246084
+ }
246085
+ _throttle(actionType, path19, timeout3) {
246086
+ if (!this._throttled.has(actionType)) {
246087
+ this._throttled.set(actionType, new Map);
246088
+ }
246089
+ const action = this._throttled.get(actionType);
246090
+ if (!action)
246091
+ throw new Error("invalid throttle");
246092
+ const actionPath = action.get(path19);
246093
+ if (actionPath) {
246094
+ actionPath.count++;
246095
+ return false;
246096
+ }
246097
+ let timeoutObject;
246098
+ const clear = () => {
246099
+ const item = action.get(path19);
246100
+ const count2 = item ? item.count : 0;
246101
+ action.delete(path19);
246102
+ clearTimeout(timeoutObject);
246103
+ if (item)
246104
+ clearTimeout(item.timeoutObject);
246105
+ return count2;
246106
+ };
246107
+ timeoutObject = setTimeout(clear, timeout3);
246108
+ const thr = { timeoutObject, clear, count: 0 };
246109
+ action.set(path19, thr);
246110
+ return thr;
246111
+ }
246112
+ _incrReadyCount() {
246113
+ return this._readyCount++;
246114
+ }
246115
+ _awaitWriteFinish(path19, threshold, event, awfEmit) {
246116
+ const awf = this.options.awaitWriteFinish;
246117
+ if (typeof awf !== "object")
246118
+ return;
246119
+ const pollInterval = awf.pollInterval;
246120
+ let timeoutHandler;
246121
+ let fullPath = path19;
246122
+ if (this.options.cwd && !sp3.isAbsolute(path19)) {
246123
+ fullPath = sp3.join(this.options.cwd, path19);
246124
+ }
246125
+ const now = new Date;
246126
+ const writes = this._pendingWrites;
246127
+ function awaitWriteFinishFn(prevStat) {
246128
+ statcb(fullPath, (err, curStat) => {
246129
+ if (err || !writes.has(path19)) {
246130
+ if (err && err.code !== "ENOENT")
246131
+ awfEmit(err);
246132
+ return;
246133
+ }
246134
+ const now2 = Number(new Date);
246135
+ if (prevStat && curStat.size !== prevStat.size) {
246136
+ writes.get(path19).lastChange = now2;
246137
+ }
246138
+ const pw = writes.get(path19);
246139
+ const df3 = now2 - pw.lastChange;
246140
+ if (df3 >= threshold) {
246141
+ writes.delete(path19);
246142
+ awfEmit(undefined, curStat);
246143
+ } else {
246144
+ timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
246145
+ }
246146
+ });
246147
+ }
246148
+ if (!writes.has(path19)) {
246149
+ writes.set(path19, {
246150
+ lastChange: now,
246151
+ cancelWait: () => {
246152
+ writes.delete(path19);
246153
+ clearTimeout(timeoutHandler);
246154
+ return event;
246155
+ }
246156
+ });
246157
+ timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
246158
+ }
246159
+ }
246160
+ _isIgnored(path19, stats) {
246161
+ if (this.options.atomic && DOT_RE.test(path19))
246162
+ return true;
246163
+ if (!this._userIgnored) {
246164
+ const { cwd } = this.options;
246165
+ const ign = this.options.ignored;
246166
+ const ignored = (ign || []).map(normalizeIgnored(cwd));
246167
+ const ignoredPaths = [...this._ignoredPaths];
246168
+ const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
246169
+ this._userIgnored = anymatch(list3, undefined);
246170
+ }
246171
+ return this._userIgnored(path19, stats);
246172
+ }
246173
+ _isntIgnored(path19, stat5) {
246174
+ return !this._isIgnored(path19, stat5);
246175
+ }
246176
+ _getWatchHelpers(path19) {
246177
+ return new WatchHelper(path19, this.options.followSymlinks, this);
246178
+ }
246179
+ _getWatchedDir(directory) {
246180
+ const dir = sp3.resolve(directory);
246181
+ if (!this._watched.has(dir))
246182
+ this._watched.set(dir, new DirEntry(dir, this._boundRemove));
246183
+ return this._watched.get(dir);
246184
+ }
246185
+ _hasReadPermissions(stats) {
246186
+ if (this.options.ignorePermissionErrors)
246187
+ return true;
246188
+ return Boolean(Number(stats.mode) & 256);
246189
+ }
246190
+ _remove(directory, item, isDirectory3) {
246191
+ const path19 = sp3.join(directory, item);
246192
+ const fullPath = sp3.resolve(path19);
246193
+ isDirectory3 = isDirectory3 != null ? isDirectory3 : this._watched.has(path19) || this._watched.has(fullPath);
246194
+ if (!this._throttle("remove", path19, 100))
246195
+ return;
246196
+ if (!isDirectory3 && this._watched.size === 1) {
246197
+ this.add(directory, item, true);
246198
+ }
246199
+ const wp5 = this._getWatchedDir(path19);
246200
+ const nestedDirectoryChildren = wp5.getChildren();
246201
+ nestedDirectoryChildren.forEach((nested) => this._remove(path19, nested));
246202
+ const parent = this._getWatchedDir(directory);
246203
+ const wasTracked = parent.has(item);
246204
+ parent.remove(item);
246205
+ if (this._symlinkPaths.has(fullPath)) {
246206
+ this._symlinkPaths.delete(fullPath);
246207
+ }
246208
+ let relPath = path19;
246209
+ if (this.options.cwd)
246210
+ relPath = sp3.relative(this.options.cwd, path19);
246211
+ if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
246212
+ const event = this._pendingWrites.get(relPath).cancelWait();
246213
+ if (event === EVENTS.ADD)
246214
+ return;
246215
+ }
246216
+ this._watched.delete(path19);
246217
+ this._watched.delete(fullPath);
246218
+ const eventName = isDirectory3 ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
246219
+ if (wasTracked && !this._isIgnored(path19))
246220
+ this._emit(eventName, path19);
246221
+ this._closePath(path19);
246222
+ }
246223
+ _closePath(path19) {
246224
+ this._closeFile(path19);
246225
+ const dir = sp3.dirname(path19);
246226
+ this._getWatchedDir(dir).remove(sp3.basename(path19));
246227
+ }
246228
+ _closeFile(path19) {
246229
+ const closers = this._closers.get(path19);
246230
+ if (!closers)
246231
+ return;
246232
+ closers.forEach((closer) => closer());
246233
+ this._closers.delete(path19);
246234
+ }
246235
+ _addPathCloser(path19, closer) {
246236
+ if (!closer)
246237
+ return;
246238
+ let list3 = this._closers.get(path19);
246239
+ if (!list3) {
246240
+ list3 = [];
246241
+ this._closers.set(path19, list3);
246242
+ }
246243
+ list3.push(closer);
246244
+ }
246245
+ _readdirp(root2, opts) {
246246
+ if (this.closed)
246247
+ return;
246248
+ const options8 = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
246249
+ let stream = readdirp(root2, options8);
246250
+ this._streams.add(stream);
246251
+ stream.once(STR_CLOSE, () => {
246252
+ stream = undefined;
246253
+ });
246254
+ stream.once(STR_END, () => {
246255
+ if (stream) {
246256
+ this._streams.delete(stream);
246257
+ stream = undefined;
246258
+ }
246259
+ });
246260
+ return stream;
246261
+ }
246262
+ }
246263
+ function watch(paths, options8 = {}) {
246264
+ const watcher = new FSWatcher(options8);
246265
+ watcher.add(paths);
246266
+ return watcher;
246267
+ }
246268
+
246269
+ // src/cli/dev/dev-server/watcher.ts
246270
+ var import_debounce = __toESM(require_debounce(), 1);
246271
+ var WATCH_DEBOUNCE_MS = 300;
246272
+ var WATCH_QUEUE_DELAY_MS = 500;
246273
+
246274
+ class WatchBase44 extends EventEmitter4 {
246275
+ itemsToWatch;
246276
+ logger;
246277
+ watchers = [];
246278
+ queueWaitForCreation = [];
246279
+ queueWaitForCreationTimeout = null;
246280
+ constructor(itemsToWatch, logger) {
246281
+ super();
246282
+ this.itemsToWatch = itemsToWatch;
246283
+ this.logger = logger;
246284
+ }
246285
+ async start() {
246286
+ if (this.watchers.length > 0 || this.queueWaitForCreation.length > 0) {
246287
+ return;
246288
+ }
246289
+ for (const item of this.itemsToWatch) {
246290
+ if (await pathExists(item.path)) {
246291
+ this.watchers.push(this.watchTarget(item));
246292
+ } else {
246293
+ this.queueWaitForCreation.push(item);
246294
+ }
246295
+ }
246296
+ this.watchCreationQueue();
246297
+ }
246298
+ async close() {
246299
+ if (this.queueWaitForCreationTimeout) {
246300
+ clearTimeout(this.queueWaitForCreationTimeout);
246301
+ this.queueWaitForCreationTimeout = null;
246302
+ }
246303
+ for (const watcher of this.watchers) {
246304
+ await watcher.close();
246305
+ }
246306
+ this.watchers = [];
246307
+ this.queueWaitForCreation = [];
246308
+ }
246309
+ watchCreationQueue() {
246310
+ if (this.queueWaitForCreationTimeout) {
246311
+ clearTimeout(this.queueWaitForCreationTimeout);
246312
+ }
246313
+ this.queueWaitForCreationTimeout = setTimeout(async () => {
246314
+ const toRemove = [];
246315
+ for (const entry of this.queueWaitForCreation) {
246316
+ if (await pathExists(entry.path)) {
246317
+ this.watchers.push(this.watchTarget(entry));
246318
+ toRemove.push(entry);
246319
+ }
246320
+ }
246321
+ this.queueWaitForCreation = this.queueWaitForCreation.filter((entry) => !toRemove.includes(entry));
246322
+ if (this.queueWaitForCreation.length > 0) {
246323
+ this.watchCreationQueue();
246324
+ } else {
246325
+ this.queueWaitForCreationTimeout = null;
246326
+ }
246327
+ }, WATCH_QUEUE_DELAY_MS);
246328
+ }
246329
+ watchTarget(item) {
246330
+ const handler = import_debounce.default(async (_event, path19) => {
246331
+ this.emit("change", item.name, relative6(item.path, path19));
246332
+ }, WATCH_DEBOUNCE_MS);
246333
+ const watcher = watch(item.path, {
246334
+ ignoreInitial: true
246335
+ });
246336
+ watcher.on("all", handler);
246337
+ watcher.on("unlinkDir", async (deletedPath) => {
246338
+ if (deletedPath !== item.path) {
246339
+ return;
246340
+ }
246341
+ await watcher.close();
246342
+ this.queueWaitForCreation.push(item);
246343
+ this.watchCreationQueue();
246344
+ setTimeout(() => {
246345
+ this.watchers = this.watchers.filter((watcher2) => !watcher2.closed);
246346
+ });
246347
+ });
246348
+ watcher.on("error", (err) => {
246349
+ this.logger.error(`Watch handler failed for ${item.path}`, err instanceof Error ? err : undefined);
246350
+ });
246351
+ return watcher;
246352
+ }
246353
+ }
246354
+
244257
246355
  // src/cli/dev/dev-server/main.ts
244258
246356
  var DEFAULT_PORT = 4400;
244259
246357
  var BASE44_APP_URL = "https://base44.app";
@@ -244261,7 +246359,7 @@ async function createDevServer(options8) {
244261
246359
  const { port: userPort } = options8;
244262
246360
  const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
244263
246361
  const baseUrl = `http://localhost:${port}`;
244264
- const { functions, entities } = await options8.loadResources();
246362
+ const { functions, entities, project: project2 } = await options8.loadResources();
244265
246363
  const app = import_express4.default();
244266
246364
  const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
244267
246365
  target: BASE44_APP_URL,
@@ -244281,10 +246379,10 @@ async function createDevServer(options8) {
244281
246379
  });
244282
246380
  const devLogger = createDevLogger();
244283
246381
  const functionManager = new FunctionManager(functions, devLogger);
246382
+ const functionRoutes = createFunctionRouter(functionManager, devLogger);
246383
+ app.use("/api/apps/:appId/functions", functionRoutes);
244284
246384
  if (functionManager.getFunctionNames().length > 0) {
244285
246385
  R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
244286
- const functionRoutes = createFunctionRouter(functionManager, devLogger);
244287
- app.use("/api/apps/:appId/functions", functionRoutes);
244288
246386
  }
244289
246387
  const db2 = new Database(entities);
244290
246388
  if (db2.getCollectionNames().length > 0) {
@@ -244303,8 +246401,8 @@ async function createDevServer(options8) {
244303
246401
  devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
244304
246402
  remoteProxy(req, res, next);
244305
246403
  });
244306
- return new Promise((resolve6, reject) => {
244307
- const server = app.listen(port, "127.0.0.1", (err) => {
246404
+ const server = await new Promise((resolve8, reject) => {
246405
+ const s5 = app.listen(port, "127.0.0.1", (err) => {
244308
246406
  if (err) {
244309
246407
  if ("code" in err && err.code === "EADDRINUSE") {
244310
246408
  reject(new Error(`Port ${port} is already in use. Stop the other process and try again.`));
@@ -244312,24 +246410,48 @@ async function createDevServer(options8) {
244312
246410
  reject(err);
244313
246411
  }
244314
246412
  } else {
244315
- const io6 = createRealtimeServer(server);
244316
- emitEntityEvent = (appId, entityName, event) => {
244317
- broadcastEntityEvent(io6, appId, entityName, event);
244318
- };
244319
- const shutdown = () => {
244320
- io6.close();
244321
- functionManager.stopAll();
244322
- server.close();
244323
- };
244324
- process.on("SIGINT", shutdown);
244325
- process.on("SIGTERM", shutdown);
244326
- resolve6({
244327
- port,
244328
- server
244329
- });
246413
+ resolve8(s5);
244330
246414
  }
244331
246415
  });
244332
246416
  });
246417
+ const io6 = createRealtimeServer(server);
246418
+ emitEntityEvent = (appId, entityName, event) => {
246419
+ broadcastEntityEvent(io6, appId, entityName, event);
246420
+ };
246421
+ const base44ConfigWatcher = new WatchBase44([
246422
+ {
246423
+ name: "functions",
246424
+ path: join18(dirname15(project2.configPath), project2.functionsDir)
246425
+ }
246426
+ ], devLogger);
246427
+ base44ConfigWatcher.on("change", async (name2) => {
246428
+ try {
246429
+ if (name2 === "functions") {
246430
+ const { functions: functions2 } = await options8.loadResources();
246431
+ const previousFunctionCount = functionManager.getFunctionNames().length;
246432
+ functionManager.reload(functions2);
246433
+ const names = functionManager.getFunctionNames();
246434
+ if (names.length > 0) {
246435
+ devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
246436
+ } else if (previousFunctionCount > 0) {
246437
+ devLogger.log("All functions removed");
246438
+ }
246439
+ }
246440
+ } catch (error48) {
246441
+ const errorMessage = error48 instanceof Error ? error48.message : String(error48);
246442
+ devLogger.error(errorMessage);
246443
+ }
246444
+ });
246445
+ await base44ConfigWatcher.start();
246446
+ const shutdown = () => {
246447
+ base44ConfigWatcher.close();
246448
+ io6.close();
246449
+ functionManager.stopAll();
246450
+ server.close();
246451
+ };
246452
+ process.on("SIGINT", shutdown);
246453
+ process.on("SIGTERM", shutdown);
246454
+ return { port, server };
244333
246455
  }
244334
246456
 
244335
246457
  // src/cli/commands/dev.ts
@@ -244353,8 +246475,8 @@ function getDevCommand(context) {
244353
246475
  }
244354
246476
 
244355
246477
  // src/cli/commands/project/eject.ts
244356
- import { resolve as resolve6 } from "node:path";
244357
- var import_lodash2 = __toESM(require_lodash(), 1);
246478
+ import { resolve as resolve8 } from "node:path";
246479
+ var import_kebabCase2 = __toESM(require_kebabCase(), 1);
244358
246480
  async function eject(options8) {
244359
246481
  const projects = await listProjects();
244360
246482
  const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
@@ -244392,7 +246514,7 @@ async function eject(options8) {
244392
246514
  selectedProject = selected;
244393
246515
  }
244394
246516
  const projectId = selectedProject.id;
244395
- const suggestedPath = await isDirEmpty() ? `./` : `./${import_lodash2.default(selectedProject.name)}`;
246517
+ const suggestedPath = await isDirEmpty() ? `./` : `./${import_kebabCase2.default(selectedProject.name)}`;
244396
246518
  const selectedPath = options8.path ?? await Ze({
244397
246519
  message: "Where should we create your project?",
244398
246520
  placeholder: suggestedPath,
@@ -244402,7 +246524,7 @@ async function eject(options8) {
244402
246524
  Ne("Operation cancelled.");
244403
246525
  throw new CLIExitError(0);
244404
246526
  }
244405
- const resolvedPath = resolve6(selectedPath);
246527
+ const resolvedPath = resolve8(selectedPath);
244406
246528
  await runTask("Downloading your project's code...", async (updateMessage) => {
244407
246529
  await createProjectFilesForExistingProject({
244408
246530
  projectId,
@@ -244478,7 +246600,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
244478
246600
  import { release, type } from "node:os";
244479
246601
 
244480
246602
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
244481
- import { dirname as dirname12, posix, sep } from "path";
246603
+ import { dirname as dirname16, posix, sep } from "path";
244482
246604
  function createModulerModifier() {
244483
246605
  const getModuleFromFileName = createGetModuleFromFilename();
244484
246606
  return async (frames) => {
@@ -244487,12 +246609,12 @@ function createModulerModifier() {
244487
246609
  return frames;
244488
246610
  };
244489
246611
  }
244490
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname12(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
244491
- const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
246612
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname16(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246613
+ const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
244492
246614
  return (filename) => {
244493
246615
  if (!filename)
244494
246616
  return;
244495
- const normalizedFilename = isWindows4 ? normalizeWindowsPath2(filename) : filename;
246617
+ const normalizedFilename = isWindows5 ? normalizeWindowsPath2(filename) : filename;
244496
246618
  let { dir, base: file2, ext } = posix.parse(normalizedFilename);
244497
246619
  if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
244498
246620
  file2 = file2.slice(0, -1 * ext.length);
@@ -246765,14 +248887,14 @@ async function addSourceContext(frames) {
246765
248887
  return frames;
246766
248888
  }
246767
248889
  function getContextLinesFromFile(path19, ranges, output) {
246768
- return new Promise((resolve7) => {
248890
+ return new Promise((resolve9) => {
246769
248891
  const stream = createReadStream2(path19);
246770
248892
  const lineReaded = createInterface2({
246771
248893
  input: stream
246772
248894
  });
246773
248895
  function destroyStreamAndResolve() {
246774
248896
  stream.destroy();
246775
- resolve7();
248897
+ resolve9();
246776
248898
  }
246777
248899
  let lineNumber = 0;
246778
248900
  let currentRangeIndex = 0;
@@ -247884,15 +250006,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
247884
250006
  return true;
247885
250007
  if (this.featureFlagsPoller === undefined)
247886
250008
  return false;
247887
- return new Promise((resolve7) => {
250009
+ return new Promise((resolve9) => {
247888
250010
  const timeout3 = setTimeout(() => {
247889
250011
  cleanup();
247890
- resolve7(false);
250012
+ resolve9(false);
247891
250013
  }, timeoutMs);
247892
250014
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
247893
250015
  clearTimeout(timeout3);
247894
250016
  cleanup();
247895
- resolve7(count2 > 0);
250017
+ resolve9(count2 > 0);
247896
250018
  });
247897
250019
  });
247898
250020
  }
@@ -248705,4 +250827,4 @@ export {
248705
250827
  CLIExitError
248706
250828
  };
248707
250829
 
248708
- //# debugId=3A2721A692CF8F1564756E2164756E21
250830
+ //# debugId=C5F38CF0EABECFE464756E2164756E21