@nhtio/lucid-resourceful 0.1.0-master-29dd5a13 → 0.1.0-master-641df8fc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/adonis-env.d.ts +17 -0
  2. package/bundled_liqe.d.ts +6 -5
  3. package/bundled_xml_js.d.ts +5 -4
  4. package/definitions.d.ts +1 -1
  5. package/encoding.d.ts +6 -6
  6. package/errors.d.ts +23 -8
  7. package/{index-Bsyx9Sty.js → index-B-5JiNqG.js} +76 -221
  8. package/index-B-5JiNqG.js.map +1 -0
  9. package/{index-B6dIMDux.cjs → index-BrGbuAtt.cjs} +76 -221
  10. package/index-BrGbuAtt.cjs.map +1 -0
  11. package/index-C9zyi90j.js.map +1 -1
  12. package/{index-CpyTnwZV.cjs → index-CQApAM0M.cjs} +298 -353
  13. package/index-CQApAM0M.cjs.map +1 -0
  14. package/index-CxRBayw6.cjs.map +1 -1
  15. package/{index-C8mGEf4P.js → index-DLVvkVxI.js} +295 -350
  16. package/index-DLVvkVxI.js.map +1 -0
  17. package/index-DsojAcQ4.js.map +1 -1
  18. package/index-DuzIXu31.cjs.map +1 -1
  19. package/index.cjs +1 -1
  20. package/index.d.ts +7 -7
  21. package/index.mjs +1 -1
  22. package/integration/middlewares/odata_error.cjs +1 -1
  23. package/integration/middlewares/odata_error.d.ts +1 -1
  24. package/integration/middlewares/odata_error.mjs +1 -1
  25. package/integration/middlewares/resourceful_encoded_request.cjs +100 -12
  26. package/integration/middlewares/resourceful_encoded_request.cjs.map +1 -1
  27. package/integration/middlewares/resourceful_encoded_request.d.ts +1 -1
  28. package/integration/middlewares/resourceful_encoded_request.mjs +98 -10
  29. package/integration/middlewares/resourceful_encoded_request.mjs.map +1 -1
  30. package/integration/middlewares/resourceful_error.cjs +1 -1
  31. package/integration/middlewares/resourceful_error.d.ts +1 -1
  32. package/integration/middlewares/resourceful_error.mjs +1 -1
  33. package/integration/provider.cjs +1 -1
  34. package/integration/provider.mjs +1 -1
  35. package/joi.d.ts +1 -1
  36. package/{manager-OLS5T3G7-CJHhMwR7.cjs → manager-OLS5T3G7-BPVI59Zw.cjs} +2 -2
  37. package/{manager-OLS5T3G7-CJHhMwR7.cjs.map → manager-OLS5T3G7-BPVI59Zw.cjs.map} +1 -1
  38. package/{manager-OLS5T3G7-C-NS6lhx.js → manager-OLS5T3G7-DzVckqOB.js} +2 -2
  39. package/{manager-OLS5T3G7-C-NS6lhx.js.map → manager-OLS5T3G7-DzVckqOB.js.map} +1 -1
  40. package/odata/context.d.ts +1 -1
  41. package/odata/macro.d.ts +1 -1
  42. package/{odata_error_middleware-BWfOpQZV.cjs → odata_error_middleware-DhLzccN7.cjs} +4 -4
  43. package/{odata_error_middleware-BWfOpQZV.cjs.map → odata_error_middleware-DhLzccN7.cjs.map} +1 -1
  44. package/{odata_error_middleware-CWYqZMez.js → odata_error_middleware-Dspi8bct.js} +4 -4
  45. package/{odata_error_middleware-CWYqZMez.js.map → odata_error_middleware-Dspi8bct.js.map} +1 -1
  46. package/package.json +1 -1
  47. package/private/data_type_schemas.d.ts +12 -12
  48. package/private/data_types.d.ts +1 -1
  49. package/private/decorator_schemas.d.ts +1 -1
  50. package/private/decorator_utils.d.ts +1 -1
  51. package/private/decorators.d.ts +14 -11
  52. package/private/encoding.d.ts +3 -3
  53. package/private/joi/index.d.ts +3 -3
  54. package/private/lucene_to_lucid_translator.d.ts +1 -1
  55. package/private/mixin.d.ts +25 -8
  56. package/private/odata_macro/controllers/resourceful_model_controller.d.ts +4 -4
  57. package/private/odata_macro/index.d.ts +1 -1
  58. package/private/odata_macro/middlewares/odata_error_middleware.d.ts +22 -10
  59. package/private/odata_macro/services/odata_context_service.d.ts +1 -1
  60. package/private/odata_macro/services/odata_metadata_service.d.ts +3 -3
  61. package/private/odata_macro/utils/odata.d.ts +2 -2
  62. package/private/odata_to_lucid_translator.d.ts +1 -1
  63. package/private/open_api_schema_service.d.ts +3 -3
  64. package/private/router_macro/controllers/resourceful_model_controller.d.ts +5 -5
  65. package/private/router_macro/index.d.ts +3 -3
  66. package/private/router_macro/middlewares/resourceful_error_middleware.d.ts +22 -10
  67. package/private/router_macro/services/resourceful_router_choices_service.d.ts +3 -3
  68. package/private/router_macro/services/resourceful_router_context_service.d.ts +1 -1
  69. package/private/router_macro/services/resourceful_router_model_options_service.d.ts +1 -1
  70. package/private/router_macro/services/resourceful_router_model_resolver_service.d.ts +3 -3
  71. package/private/router_macro/services/resourceful_router_openapi_document_service.d.ts +4 -4
  72. package/private/router_macro/services/resourceful_router_options_service.d.ts +3 -3
  73. package/private/router_macro/types.d.ts +15 -8
  74. package/private/router_macro/utils/errors.d.ts +1 -1
  75. package/private/router_macro/utils/http.d.ts +1 -1
  76. package/private/router_macro/utils/openapi_validation_schemas.d.ts +2 -2
  77. package/private/router_macro/utils/relationships.d.ts +1 -1
  78. package/private/router_macro/utils/type_guards.d.ts +1 -1
  79. package/private/schema_types.d.ts +1 -1
  80. package/private/type_guards.d.ts +5 -5
  81. package/private/types.d.ts +5 -5
  82. package/private/utils/casters.d.ts +1 -1
  83. package/private/utils/consumers.d.ts +1 -1
  84. package/private/utils/preparers.d.ts +1 -1
  85. package/private/utils.d.ts +1 -1
  86. package/{resourceful_error_middleware-CMSZGdoG.js → resourceful_error_middleware-Cb_eTzST.js} +4 -4
  87. package/{resourceful_error_middleware-CMSZGdoG.js.map → resourceful_error_middleware-Cb_eTzST.js.map} +1 -1
  88. package/{resourceful_error_middleware-lXgefPIC.cjs → resourceful_error_middleware-CnjbNoev.cjs} +4 -4
  89. package/{resourceful_error_middleware-lXgefPIC.cjs.map → resourceful_error_middleware-CnjbNoev.cjs.map} +1 -1
  90. package/router/context.d.ts +1 -1
  91. package/router/utils.cjs +1 -1
  92. package/router/utils.d.ts +1 -1
  93. package/router/utils.mjs +1 -1
  94. package/router.cjs +1 -1
  95. package/router.d.ts +2 -2
  96. package/router.mjs +1 -1
  97. package/types.d.ts +13 -13
  98. package/utils.d.ts +4 -4
  99. package/vite-env.d.ts +3 -0
  100. package/index-B6dIMDux.cjs.map +0 -1
  101. package/index-Bsyx9Sty.js.map +0 -1
  102. package/index-C8mGEf4P.js.map +0 -1
  103. package/index-CpIq4gOr.js +0 -93
  104. package/index-CpIq4gOr.js.map +0 -1
  105. package/index-CpyTnwZV.cjs.map +0 -1
  106. package/index-DqbJXpcT.cjs +0 -92
  107. package/index-DqbJXpcT.cjs.map +0 -1
  108. package/private/controller_factory.d.ts +0 -1
  109. package/private/utils/function_serializer.d.ts +0 -32
@@ -1,36 +1,7 @@
1
1
  "use strict";
2
- const index$1 = require("./index-CxRBayw6.cjs");
2
+ const index = require("./index-CxRBayw6.cjs");
3
+ const node_crypto = require("node:crypto");
3
4
  const errors = require("./errors-jr8bQS6M.cjs");
4
- const index = require("./index-DqbJXpcT.cjs");
5
- const require$$0 = require("crypto");
6
- var bytesExports = index.requireBytes();
7
- const bytes = /* @__PURE__ */ errors.getDefaultExportFromCjs(bytesExports);
8
- var RGX = /^(-?(?:\d+)?\.?\d+) *(m(?:illiseconds?|s(?:ecs?)?))?(s(?:ec(?:onds?|s)?)?)?(m(?:in(?:utes?|s)?)?)?(h(?:ours?|rs?)?)?(d(?:ays?)?)?(w(?:eeks?|ks?)?)?(y(?:ears?|rs?)?)?$/, SEC = 1e3, MIN = SEC * 60, HOUR = MIN * 60, DAY = HOUR * 24, YEAR = DAY * 365.25;
9
- function parse(val) {
10
- var num, arr = val.toLowerCase().match(RGX);
11
- if (arr != null && (num = parseFloat(arr[1]))) {
12
- if (arr[3] != null) return num * SEC;
13
- if (arr[4] != null) return num * MIN;
14
- if (arr[5] != null) return num * HOUR;
15
- if (arr[6] != null) return num * DAY;
16
- if (arr[7] != null) return num * DAY * 7;
17
- if (arr[8] != null) return num * YEAR;
18
- return num;
19
- }
20
- }
21
- function fmt(val, pfx, str, long) {
22
- var num = (val | 0) === val ? val : ~~(val + 0.5);
23
- return pfx + num + (long ? " " + str + (num != 1 ? "s" : "") : str[0]);
24
- }
25
- function format(num, long) {
26
- var pfx = num < 0 ? "-" : "", abs = num < 0 ? -num : num;
27
- if (abs < SEC) return num + (long ? " ms" : "ms");
28
- if (abs < MIN) return fmt(abs / SEC, pfx, "second", long);
29
- if (abs < HOUR) return fmt(abs / MIN, pfx, "minute", long);
30
- if (abs < DAY) return fmt(abs / HOUR, pfx, "hour", long);
31
- if (abs < YEAR) return fmt(abs / DAY, pfx, "day", long);
32
- return fmt(abs / YEAR, pfx, "year", long);
33
- }
34
5
  var slugify$1 = { exports: {} };
35
6
  var slugify = slugify$1.exports;
36
7
  var hasRequiredSlugify;
@@ -46,15 +17,15 @@ function requireSlugify() {
46
17
  })("slugify", slugify, function() {
47
18
  var charMap = JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`);
48
19
  var locales = JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');
49
- function replace(string2, options) {
50
- if (typeof string2 !== "string") {
20
+ function replace(string, options) {
21
+ if (typeof string !== "string") {
51
22
  throw new Error("slugify: string argument expected");
52
23
  }
53
24
  options = typeof options === "string" ? { replacement: options } : options || {};
54
25
  var locale = locales[options.locale] || {};
55
26
  var replacement = options.replacement === void 0 ? "-" : options.replacement;
56
27
  var trim = options.trim === void 0 ? true : options.trim;
57
- var slug2 = string2.normalize().split("").reduce(function(result, ch) {
28
+ var slug2 = string.normalize().split("").reduce(function(result, ch) {
58
29
  var appendChar = locale[ch];
59
30
  if (appendChar === void 0) appendChar = charMap[ch];
60
31
  if (appendChar === void 0) appendChar = ch;
@@ -83,135 +54,6 @@ function requireSlugify() {
83
54
  }
84
55
  var slugifyExports = requireSlugify();
85
56
  const slugifyPkg = /* @__PURE__ */ errors.getDefaultExportFromCjs(slugifyExports);
86
- var truncatise$1 = { exports: {} };
87
- var truncatise = truncatise$1.exports;
88
- var hasRequiredTruncatise;
89
- function requireTruncatise() {
90
- if (hasRequiredTruncatise) return truncatise$1.exports;
91
- hasRequiredTruncatise = 1;
92
- (function(module2) {
93
- (function(exportTo) {
94
- var selfClosingTags = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"];
95
- var truncatise3 = function(text, options) {
96
- var options = options || {}, text = (text || "").trim(), truncatedText = "", currentState = 0, isEndOfWord = false, currentTag = "", tagStack = [], nextChar = "";
97
- var charCounter = 0, wordCounter = 0, paragraphCounter = 0;
98
- var NOT_TAG = 0, TAG_START = 1, TAG_ATTRIBUTES = 2;
99
- options.TruncateBy = options.TruncateBy === void 0 || typeof options.TruncateBy !== "string" || !options.TruncateBy.match(/(word(s)?|character(s)?|paragraph(s)?)/) ? "words" : options.TruncateBy.toLowerCase();
100
- options.TruncateLength = options.TruncateLength === void 0 || typeof options.TruncateLength !== "number" ? 50 : options.TruncateLength;
101
- options.StripHTML = options.StripHTML === void 0 || typeof options.StripHTML !== "boolean" ? false : options.StripHTML;
102
- options.Strict = options.Strict === void 0 || typeof options.Strict !== "boolean" ? true : options.Strict;
103
- options.Suffix = options.Suffix === void 0 || typeof options.Suffix !== "string" ? "..." : options.Suffix;
104
- if (text === "" || text.length <= options.TruncateLength && options.StripHTML === false) {
105
- return text;
106
- }
107
- if (options.StripHTML) {
108
- text = String(text).replace(/<br( \/)?>/gi, " ");
109
- }
110
- if (options.StripHTML && !options.TruncateBy.match(/(paragraph(s)?)/)) {
111
- text = String(text).replace(/<!--(.*?)-->/gm, "").replace(/<\/?[^>]+>/gi, "");
112
- }
113
- text = String(text).replace(/<\/p>(\r?\n)+<p>/gm, "</p><p>");
114
- if (options.StripHTML && String(text).match(/\r?\n\r?\n/)) {
115
- text = String(text).replace(/((.+)(\r?\n\r?\n|$))/gi, "<p>$2</p>");
116
- }
117
- for (var pointer = 0; pointer < text.length; pointer++) {
118
- var currentChar = text[pointer];
119
- switch (currentChar) {
120
- case "<":
121
- if (currentState === NOT_TAG) {
122
- currentState = TAG_START;
123
- currentTag = "";
124
- }
125
- if (!options.StripHTML) {
126
- truncatedText += currentChar;
127
- }
128
- break;
129
- case ">":
130
- if (currentState === TAG_START || currentState === TAG_ATTRIBUTES) {
131
- currentState = NOT_TAG;
132
- currentTag = currentTag.toLowerCase();
133
- if (currentTag === "/p") {
134
- paragraphCounter++;
135
- if (options.StripHTML) {
136
- truncatedText += " ";
137
- }
138
- }
139
- if (selfClosingTags.indexOf(currentTag) === -1 && selfClosingTags.indexOf(currentTag + "/") === -1) {
140
- if (currentTag.indexOf("/") >= 0) {
141
- tagStack.pop();
142
- } else {
143
- tagStack.push(currentTag);
144
- }
145
- }
146
- }
147
- if (!options.StripHTML) {
148
- truncatedText += currentChar;
149
- }
150
- break;
151
- case " ":
152
- if (currentState === TAG_START) {
153
- currentState = TAG_ATTRIBUTES;
154
- }
155
- if (currentState === NOT_TAG) {
156
- wordCounter++;
157
- charCounter++;
158
- }
159
- if (currentState === NOT_TAG || !options.StripHTML) {
160
- truncatedText += currentChar;
161
- }
162
- break;
163
- default:
164
- if (currentState === NOT_TAG) {
165
- charCounter++;
166
- }
167
- if (currentState === TAG_START) {
168
- currentTag += currentChar;
169
- }
170
- if (currentState === NOT_TAG || !options.StripHTML) {
171
- truncatedText += currentChar;
172
- }
173
- break;
174
- }
175
- nextChar = text[pointer + 1] || "";
176
- isEndOfWord = options.Strict ? true : !currentChar.match(/[a-zA-ZÇ-Ü']/i) || !nextChar.match(/[a-zA-ZÇ-Ü']/i);
177
- if (options.TruncateBy.match(/word(s)?/i) && options.TruncateLength <= wordCounter) {
178
- truncatedText = truncatedText.replace(/\s+$/, "");
179
- break;
180
- }
181
- if (options.TruncateBy.match(/character(s)?/i) && options.TruncateLength <= charCounter && isEndOfWord) {
182
- break;
183
- }
184
- if (options.TruncateBy.match(/paragraph(s)?/i) && options.TruncateLength === paragraphCounter) {
185
- break;
186
- }
187
- }
188
- if (!options.StripHTML && tagStack.length > 0) {
189
- while (tagStack.length > 0) {
190
- var tag = tagStack.pop();
191
- if (tag !== "!--") {
192
- truncatedText += "</" + tag + ">";
193
- }
194
- }
195
- }
196
- if (pointer < text.length - 1) {
197
- if (truncatedText.match(/<\/p>$/gi)) {
198
- truncatedText = truncatedText.replace(/(<\/p>)$/gi, options.Suffix + "$1");
199
- } else {
200
- truncatedText = truncatedText + options.Suffix;
201
- }
202
- }
203
- return truncatedText.trim();
204
- };
205
- if (module2.exports) {
206
- return module2.exports = truncatise3;
207
- }
208
- exportTo.truncatise = truncatise3;
209
- })(truncatise);
210
- })(truncatise$1);
211
- return truncatise$1.exports;
212
- }
213
- var truncatiseExports = requireTruncatise();
214
- const truncatise2 = /* @__PURE__ */ errors.getDefaultExportFromCjs(truncatiseExports);
215
57
  function commonjsRequire(path) {
216
58
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
217
59
  }
@@ -570,29 +412,29 @@ var pluralizeExports = requirePluralize();
570
412
  const pluralizePkg = /* @__PURE__ */ errors.getDefaultExportFromCjs(pluralizeExports);
571
413
  const magicSplit = /^[a-zà-öø-ÿа-я]+|[A-ZÀ-ÖØ-ßА-Я][a-zà-öø-ÿа-я]+|[a-zà-öø-ÿа-я]+|[0-9]+|[A-ZÀ-ÖØ-ßА-Я]+(?![a-zà-öø-ÿа-я])/g;
572
414
  const spaceSplit = /\S+/g;
573
- function getPartsAndIndexes(string2, splitRegex) {
415
+ function getPartsAndIndexes(string, splitRegex) {
574
416
  const result = { parts: [], prefixes: [] };
575
- const matches = string2.matchAll(splitRegex);
417
+ const matches = string.matchAll(splitRegex);
576
418
  let lastWordEndIndex = 0;
577
419
  for (const match of matches) {
578
420
  if (typeof match.index !== "number")
579
421
  continue;
580
422
  const word = match[0];
581
423
  result.parts.push(word);
582
- const prefix = string2.slice(lastWordEndIndex, match.index).trim();
424
+ const prefix = string.slice(lastWordEndIndex, match.index).trim();
583
425
  result.prefixes.push(prefix);
584
426
  lastWordEndIndex = match.index + word.length;
585
427
  }
586
- const tail = string2.slice(lastWordEndIndex).trim();
428
+ const tail = string.slice(lastWordEndIndex).trim();
587
429
  if (tail) {
588
430
  result.parts.push("");
589
431
  result.prefixes.push(tail);
590
432
  }
591
433
  return result;
592
434
  }
593
- function splitAndPrefix(string2, options) {
435
+ function splitAndPrefix(string, options) {
594
436
  const { keepSpecialCharacters = false, keep, prefix = "" } = options || {};
595
- const normalString = string2.trim().normalize("NFC");
437
+ const normalString = string.trim().normalize("NFC");
596
438
  const hasSpaces = normalString.includes(" ");
597
439
  const split = hasSpaces ? spaceSplit : magicSplit;
598
440
  const partsAndIndexes = getPartsAndIndexes(normalString, split);
@@ -625,74 +467,127 @@ function splitAndPrefix(string2, options) {
625
467
  return (foundPrefix || prefix) + part;
626
468
  }).filter(Boolean);
627
469
  }
628
- function capitaliseWord(string2) {
629
- const match = string2.matchAll(magicSplit).next().value;
470
+ function capitaliseWord(string) {
471
+ const match = string.matchAll(magicSplit).next().value;
630
472
  const firstLetterIndex = match ? match.index : 0;
631
- return string2.slice(0, firstLetterIndex + 1).toUpperCase() + string2.slice(firstLetterIndex + 1).toLowerCase();
473
+ return string.slice(0, firstLetterIndex + 1).toUpperCase() + string.slice(firstLetterIndex + 1).toLowerCase();
632
474
  }
633
- function camelCase(string2, options) {
634
- return splitAndPrefix(string2, options).reduce((result, word, index2) => {
475
+ function camelCase$1(string, options) {
476
+ return splitAndPrefix(string, options).reduce((result, word, index2) => {
635
477
  return index2 === 0 || !(word[0] || "").match(magicSplit) ? result + word.toLowerCase() : result + capitaliseWord(word);
636
478
  }, "");
637
479
  }
638
- function pascalCase(string2, options) {
639
- return splitAndPrefix(string2, options).reduce((result, word) => {
480
+ function pascalCase$1(string, options) {
481
+ return splitAndPrefix(string, options).reduce((result, word) => {
640
482
  return result + capitaliseWord(word);
641
483
  }, "");
642
484
  }
643
- function kebabCase(string2, options) {
644
- return splitAndPrefix(string2, { ...options, prefix: "-" }).join("").toLowerCase();
485
+ function kebabCase(string, options) {
486
+ return splitAndPrefix(string, { ...options, prefix: "-" }).join("").toLowerCase();
645
487
  }
646
- function snakeCase(string2, options) {
647
- return splitAndPrefix(string2, { ...options, prefix: "_" }).join("").toLowerCase();
488
+ function snakeCase$1(string, options) {
489
+ return splitAndPrefix(string, { ...options, prefix: "_" }).join("").toLowerCase();
648
490
  }
649
- function trainCase(string2, options) {
650
- return splitAndPrefix(string2, { ...options, prefix: "-" }).map((word) => capitaliseWord(word)).join("");
491
+ function trainCase(string, options) {
492
+ return splitAndPrefix(string, { ...options, prefix: "-" }).map((word) => capitaliseWord(word)).join("");
651
493
  }
652
- function dotNotation(string2, options) {
653
- return splitAndPrefix(string2, { ...options, prefix: "." }).join("");
494
+ function dotNotation(string, options) {
495
+ return splitAndPrefix(string, { ...options, prefix: "." }).join("");
654
496
  }
655
- function capitalCase(string2, options = { keepSpecialCharacters: true }) {
656
- return splitAndPrefix(string2, { ...options, prefix: " " }).reduce((result, word) => {
497
+ function capitalCase$1(string, options = { keepSpecialCharacters: true }) {
498
+ return splitAndPrefix(string, { ...options, prefix: " " }).reduce((result, word) => {
657
499
  return result + capitaliseWord(word);
658
500
  }, "");
659
501
  }
502
+ var __create = Object.create;
503
+ var __defProp = Object.defineProperty;
504
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
505
+ var __getOwnPropNames = Object.getOwnPropertyNames;
506
+ var __getProtoOf = Object.getPrototypeOf;
507
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
508
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
509
+ var __copyProps = (to, from, except, desc) => {
510
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n2 = keys.length, key; i < n2; i++) {
511
+ key = keys[i];
512
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
513
+ get: ((k) => from[k]).bind(null, key),
514
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
515
+ });
516
+ }
517
+ return to;
518
+ };
519
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(__defProp(target, "default", {
520
+ value: mod,
521
+ enumerable: true
522
+ }), mod));
523
+ var import_bytes = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports$1, module2) => {
524
+ module2.exports = bytes$1;
525
+ module2.exports.format = format$1;
526
+ module2.exports.parse = parse$1;
527
+ var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
528
+ var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
529
+ var map = {
530
+ b: 1,
531
+ kb: 1024,
532
+ mb: 1 << 20,
533
+ gb: 1 << 30,
534
+ tb: Math.pow(1024, 4),
535
+ pb: Math.pow(1024, 5)
536
+ };
537
+ var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
538
+ function bytes$1(value, options) {
539
+ if (typeof value === "string") return parse$1(value);
540
+ if (typeof value === "number") return format$1(value, options);
541
+ return null;
542
+ }
543
+ function format$1(value, options) {
544
+ if (!Number.isFinite(value)) return null;
545
+ var mag = Math.abs(value);
546
+ var thousandsSeparator = options && options.thousandsSeparator || "";
547
+ var unitSeparator = options && options.unitSeparator || "";
548
+ var decimalPlaces = options && options.decimalPlaces !== void 0 ? options.decimalPlaces : 2;
549
+ var fixedDecimals = Boolean(options && options.fixedDecimals);
550
+ var unit = options && options.unit || "";
551
+ if (!unit || !map[unit.toLowerCase()]) if (mag >= map.pb) unit = "PB";
552
+ else if (mag >= map.tb) unit = "TB";
553
+ else if (mag >= map.gb) unit = "GB";
554
+ else if (mag >= map.mb) unit = "MB";
555
+ else if (mag >= map.kb) unit = "KB";
556
+ else unit = "B";
557
+ var str = (value / map[unit.toLowerCase()]).toFixed(decimalPlaces);
558
+ if (!fixedDecimals) str = str.replace(formatDecimalsRegExp, "$1");
559
+ if (thousandsSeparator) str = str.split(".").map(function(s, i) {
560
+ return i === 0 ? s.replace(formatThousandsRegExp, thousandsSeparator) : s;
561
+ }).join(".");
562
+ return str + unitSeparator + unit;
563
+ }
564
+ function parse$1(val) {
565
+ if (typeof val === "number" && !isNaN(val)) return val;
566
+ if (typeof val !== "string") return null;
567
+ var results = parseRegExp.exec(val);
568
+ var floatValue;
569
+ var unit = "b";
570
+ if (!results) {
571
+ floatValue = parseInt(val, 10);
572
+ unit = "b";
573
+ } else {
574
+ floatValue = parseFloat(results[1]);
575
+ unit = results[4].toLowerCase();
576
+ }
577
+ if (isNaN(floatValue)) return null;
578
+ return Math.floor(map[unit] * floatValue);
579
+ }
580
+ })))());
660
581
  var bytes_default = {
661
- /**
662
- * Formats bytes to a human-readable string value. When input cannot be formatted, the `null` value is returned. The accepted options are as follows.
663
- *
664
- - `decimalPlaces`: Maximum number of decimal places to include in output. `default=2`.
665
- - `fixedDecimals`: Whether to always display the maximum number of decimal places. `default=false`.
666
- - `thousandsSeparator`: Specify the separator for thousands. `default=''`.
667
- - `unit`: The unit in which the result will be returned. It could be `B/KB/MB/GB/TB`. The default behavior is to auto-detect based on the input.
668
- - `unitSeparator`: The separator between the value and the `unit`. `default=''`.
669
- */
670
582
  format(valueInBytes, options) {
671
- return bytes.format(valueInBytes, options);
583
+ return import_bytes.default.format(valueInBytes, options);
672
584
  },
673
- /**
674
- * Parse a human-readable string expression to bytes. If the unit value is a number, it will be
675
- * returned as it is. Otherwise, the string expression will be converted to a number representing
676
- * bytes.
677
- *
678
- * The `null` value is returned when the input cannot be parsed.
679
- *
680
- * Supported units and abbreviations are as follows and are case-insensitive:
681
- - `b` for bytes
682
- - `kb` for kilobytes
683
- - `mb` for megabytes
684
- - `gb` for gigabytes
685
- - `tb` for terabytes
686
- - `pb` for petabytes
687
- */
688
585
  parse(unit) {
689
- if (typeof unit === "number") {
690
- return unit;
691
- }
692
- return bytes.parse(unit);
586
+ if (typeof unit === "number") return unit;
587
+ return import_bytes.default.parse(unit);
693
588
  }
694
589
  };
695
- var uuidGenerator = require$$0.randomUUID;
590
+ let uuidGenerator = node_crypto.randomUUID;
696
591
  function uuid(options) {
697
592
  return uuidGenerator(options);
698
593
  }
@@ -700,38 +595,52 @@ uuid.use = function uuidUse(generator) {
700
595
  uuidGenerator = generator;
701
596
  };
702
597
  uuid.restore = function uuidRestore() {
703
- uuidGenerator = require$$0.randomUUID;
598
+ uuidGenerator = node_crypto.randomUUID;
704
599
  };
600
+ var RGX = /^(-?(?:\d+)?\.?\d+) *(m(?:illiseconds?|s(?:ecs?)?))?(s(?:ec(?:onds?|s)?)?)?(m(?:in(?:utes?|s)?)?)?(h(?:ours?|rs?)?)?(d(?:ays?)?)?(w(?:eeks?|ks?)?)?(y(?:ears?|rs?)?)?$/, SEC = 1e3, MIN = SEC * 60, HOUR = MIN * 60, DAY = HOUR * 24, YEAR = DAY * 365.25;
601
+ function parse(val) {
602
+ var num, arr = val.toLowerCase().match(RGX);
603
+ if (arr != null && (num = parseFloat(arr[1]))) {
604
+ if (arr[3] != null) return num * SEC;
605
+ if (arr[4] != null) return num * MIN;
606
+ if (arr[5] != null) return num * HOUR;
607
+ if (arr[6] != null) return num * DAY;
608
+ if (arr[7] != null) return num * DAY * 7;
609
+ if (arr[8] != null) return num * YEAR;
610
+ return num;
611
+ }
612
+ }
613
+ function fmt(val, pfx, str, long) {
614
+ var num = (val | 0) === val ? val : ~~(val + 0.5);
615
+ return pfx + num + (long ? " " + str + (num != 1 ? "s" : "") : str[0]);
616
+ }
617
+ function format(num, long) {
618
+ var pfx = num < 0 ? "-" : "", abs = num < 0 ? -num : num;
619
+ if (abs < SEC) return num + (long ? " ms" : "ms");
620
+ if (abs < MIN) return fmt(abs / SEC, pfx, "second", long);
621
+ if (abs < HOUR) return fmt(abs / MIN, pfx, "minute", long);
622
+ if (abs < DAY) return fmt(abs / HOUR, pfx, "hour", long);
623
+ if (abs < YEAR) return fmt(abs / DAY, pfx, "day", long);
624
+ return fmt(abs / YEAR, pfx, "year", long);
625
+ }
705
626
  var seconds_default = {
706
- /**
707
- * Formats seconds to pretty string output
708
- */
709
627
  format(seconds, long) {
710
628
  return format(seconds * 1e3, long);
711
629
  },
712
- /**
713
- * Parse the time expression to seconds. If the unit value is a number, then
714
- * it will be returned as it is. Otherwise the string expression will be
715
- * converted to a number representing seconds.
716
- */
717
630
  parse(duration) {
718
- if (typeof duration === "number") {
719
- return duration;
720
- }
631
+ if (typeof duration === "number") return duration;
721
632
  const milliseconds = parse(duration);
722
- if (milliseconds === void 0) {
723
- throw new Error(`Invalid duration expression "${duration}"`);
724
- }
633
+ if (milliseconds === void 0) throw new Error(`Invalid duration expression "${duration}"`);
725
634
  return Math.floor(milliseconds / 1e3);
726
635
  }
727
636
  };
728
- var slug = slugifyPkg;
729
- var defaultGenerator = (size) => {
637
+ const slug = slugifyPkg;
638
+ const defaultGenerator = (size) => {
730
639
  const bits = (size + 1) * 6;
731
- const buffer = require$$0.randomBytes(Math.ceil(bits / 8));
732
- return index$1.Buffer.from(buffer).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "").slice(0, size);
640
+ const buffer = node_crypto.randomBytes(Math.ceil(bits / 8));
641
+ return index.Buffer.from(buffer).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "").slice(0, size);
733
642
  };
734
- var randomGenerator = defaultGenerator;
643
+ let randomGenerator = defaultGenerator;
735
644
  function random(size) {
736
645
  return randomGenerator(size);
737
646
  }
@@ -741,13 +650,102 @@ random.use = function randomUse(generator) {
741
650
  random.restore = function randomRestore() {
742
651
  randomGenerator = defaultGenerator;
743
652
  };
744
- function excerpt(sentence2, charactersLimit, options) {
745
- return truncatise2(sentence2, {
653
+ var require_truncatise = /* @__PURE__ */ __commonJSMin(((exports$1, module2) => {
654
+ (function(exportTo) {
655
+ var selfClosingTags = [
656
+ "area",
657
+ "base",
658
+ "br",
659
+ "col",
660
+ "embed",
661
+ "hr",
662
+ "img",
663
+ "input",
664
+ "keygen",
665
+ "link",
666
+ "menuitem",
667
+ "meta",
668
+ "param",
669
+ "source",
670
+ "track",
671
+ "wbr"
672
+ ];
673
+ var truncatise$2 = function(text, options) {
674
+ var options = options || {}, text = (text || "").trim(), truncatedText = "", currentState = 0, isEndOfWord = false, currentTag = "", tagStack = [], nextChar = "";
675
+ var charCounter = 0, wordCounter = 0, paragraphCounter = 0;
676
+ var NOT_TAG = 0, TAG_START = 1, TAG_ATTRIBUTES = 2;
677
+ options.TruncateBy = options.TruncateBy === void 0 || typeof options.TruncateBy !== "string" || !options.TruncateBy.match(/(word(s)?|character(s)?|paragraph(s)?)/) ? "words" : options.TruncateBy.toLowerCase();
678
+ options.TruncateLength = options.TruncateLength === void 0 || typeof options.TruncateLength !== "number" ? 50 : options.TruncateLength;
679
+ options.StripHTML = options.StripHTML === void 0 || typeof options.StripHTML !== "boolean" ? false : options.StripHTML;
680
+ options.Strict = options.Strict === void 0 || typeof options.Strict !== "boolean" ? true : options.Strict;
681
+ options.Suffix = options.Suffix === void 0 || typeof options.Suffix !== "string" ? "..." : options.Suffix;
682
+ if (text === "" || text.length <= options.TruncateLength && options.StripHTML === false) return text;
683
+ if (options.StripHTML) text = String(text).replace(/<br( \/)?>/gi, " ");
684
+ if (options.StripHTML && !options.TruncateBy.match(/(paragraph(s)?)/)) text = String(text).replace(/<!--(.*?)-->/gm, "").replace(/<\/?[^>]+>/gi, "");
685
+ text = String(text).replace(/<\/p>(\r?\n)+<p>/gm, "</p><p>");
686
+ if (options.StripHTML && String(text).match(/\r?\n\r?\n/)) text = String(text).replace(/((.+)(\r?\n\r?\n|$))/gi, "<p>$2</p>");
687
+ for (var pointer = 0; pointer < text.length; pointer++) {
688
+ var currentChar = text[pointer];
689
+ switch (currentChar) {
690
+ case "<":
691
+ if (currentState === NOT_TAG) {
692
+ currentState = TAG_START;
693
+ currentTag = "";
694
+ }
695
+ if (!options.StripHTML) truncatedText += currentChar;
696
+ break;
697
+ case ">":
698
+ if (currentState === TAG_START || currentState === TAG_ATTRIBUTES) {
699
+ currentState = NOT_TAG;
700
+ currentTag = currentTag.toLowerCase();
701
+ if (currentTag === "/p") {
702
+ paragraphCounter++;
703
+ if (options.StripHTML) truncatedText += " ";
704
+ }
705
+ if (selfClosingTags.indexOf(currentTag) === -1 && selfClosingTags.indexOf(currentTag + "/") === -1) if (currentTag.indexOf("/") >= 0) tagStack.pop();
706
+ else tagStack.push(currentTag);
707
+ }
708
+ if (!options.StripHTML) truncatedText += currentChar;
709
+ break;
710
+ case " ":
711
+ if (currentState === TAG_START) currentState = TAG_ATTRIBUTES;
712
+ if (currentState === NOT_TAG) {
713
+ wordCounter++;
714
+ charCounter++;
715
+ }
716
+ if (currentState === NOT_TAG || !options.StripHTML) truncatedText += currentChar;
717
+ break;
718
+ default:
719
+ if (currentState === NOT_TAG) charCounter++;
720
+ if (currentState === TAG_START) currentTag += currentChar;
721
+ if (currentState === NOT_TAG || !options.StripHTML) truncatedText += currentChar;
722
+ break;
723
+ }
724
+ nextChar = text[pointer + 1] || "";
725
+ isEndOfWord = options.Strict ? true : !currentChar.match(/[a-zA-ZÇ-Ü']/i) || !nextChar.match(/[a-zA-ZÇ-Ü']/i);
726
+ if (options.TruncateBy.match(/word(s)?/i) && options.TruncateLength <= wordCounter) {
727
+ truncatedText = truncatedText.replace(/\s+$/, "");
728
+ break;
729
+ }
730
+ if (options.TruncateBy.match(/character(s)?/i) && options.TruncateLength <= charCounter && isEndOfWord) break;
731
+ if (options.TruncateBy.match(/paragraph(s)?/i) && options.TruncateLength === paragraphCounter) break;
732
+ }
733
+ if (!options.StripHTML && tagStack.length > 0) while (tagStack.length > 0) {
734
+ var tag = tagStack.pop();
735
+ if (tag !== "!--") truncatedText += "</" + tag + ">";
736
+ }
737
+ if (pointer < text.length - 1) if (truncatedText.match(/<\/p>$/gi)) truncatedText = truncatedText.replace(/(<\/p>)$/gi, options.Suffix + "$1");
738
+ else truncatedText = truncatedText + options.Suffix;
739
+ return truncatedText.trim();
740
+ };
741
+ if (typeof module2 !== "undefined" && module2.exports) return module2.exports = truncatise$2;
742
+ exportTo.truncatise = truncatise$2;
743
+ })(exports$1);
744
+ }));
745
+ var import_truncatise$1 = /* @__PURE__ */ __toESM(require_truncatise());
746
+ function excerpt(sentence$1, charactersLimit, options) {
747
+ return (0, import_truncatise$1.default)(sentence$1, {
746
748
  TruncateLength: charactersLimit,
747
- /**
748
- * Do not complete words when "completeWords" is not explicitly set
749
- * to true
750
- */
751
749
  Strict: options && options.completeWords === true ? false : true,
752
750
  StripHTML: true,
753
751
  TruncateBy: "characters",
@@ -755,12 +753,8 @@ function excerpt(sentence2, charactersLimit, options) {
755
753
  });
756
754
  }
757
755
  function applyPadding(value, options) {
758
- if (options.paddingLeft) {
759
- value = `${options.paddingChar.repeat(options.paddingLeft)}${value}`;
760
- }
761
- if (options.paddingRight) {
762
- value = `${value}${options.paddingChar.repeat(options.paddingRight)}`;
763
- }
756
+ if (options.paddingLeft) value = `${options.paddingChar.repeat(options.paddingLeft)}${value}`;
757
+ if (options.paddingRight) value = `${value}${options.paddingChar.repeat(options.paddingRight)}`;
764
758
  return value;
765
759
  }
766
760
  function justify(columns, options) {
@@ -771,15 +765,11 @@ function justify(columns, options) {
771
765
  };
772
766
  return columns.map((column) => {
773
767
  const columnWidth = options.getLength?.(column) ?? column.length;
774
- if (columnWidth >= normalizedOptions.width) {
775
- return column;
776
- }
777
- if (normalizedOptions.align === "left") {
778
- return applyPadding(column, {
779
- paddingChar: normalizedOptions.indent,
780
- paddingRight: normalizedOptions.width - columnWidth
781
- });
782
- }
768
+ if (columnWidth >= normalizedOptions.width) return column;
769
+ if (normalizedOptions.align === "left") return applyPadding(column, {
770
+ paddingChar: normalizedOptions.indent,
771
+ paddingRight: normalizedOptions.width - columnWidth
772
+ });
783
773
  return applyPadding(column, {
784
774
  paddingChar: normalizedOptions.indent,
785
775
  paddingLeft: normalizedOptions.width - columnWidth
@@ -788,15 +778,10 @@ function justify(columns, options) {
788
778
  }
789
779
  function ordinal(value) {
790
780
  const transformedValue = Math.abs(typeof value === "string" ? Number.parseInt(value) : value);
791
- if (!Number.isFinite(transformedValue) || Number.isNaN(transformedValue)) {
792
- throw new Error("Cannot ordinalize invalid or infinite numbers");
793
- }
781
+ if (!Number.isFinite(transformedValue) || Number.isNaN(transformedValue)) throw new Error("Cannot ordinalize invalid or infinite numbers");
794
782
  const percent = transformedValue % 100;
795
- if (percent >= 10 && percent <= 20) {
796
- return `${value}th`;
797
- }
798
- const decimal = transformedValue % 10;
799
- switch (decimal) {
783
+ if (percent >= 10 && percent <= 20) return `${value}th`;
784
+ switch (transformedValue % 10) {
800
785
  case 1:
801
786
  return `${value}st`;
802
787
  case 2:
@@ -807,13 +792,10 @@ function ordinal(value) {
807
792
  return `${value}th`;
808
793
  }
809
794
  }
810
- function truncate(sentence2, charactersLimit, options) {
811
- return truncatise2(sentence2, {
795
+ var import_truncatise = /* @__PURE__ */ __toESM(require_truncatise());
796
+ function truncate(sentence$1, charactersLimit, options) {
797
+ return (0, import_truncatise.default)(sentence$1, {
812
798
  TruncateLength: charactersLimit,
813
- /**
814
- * Do not complete words when "completeWords" is not explicitly set
815
- * to true
816
- */
817
799
  Strict: options && options.completeWords === true ? false : true,
818
800
  StripHTML: false,
819
801
  TruncateBy: "characters",
@@ -821,16 +803,13 @@ function truncate(sentence2, charactersLimit, options) {
821
803
  });
822
804
  }
823
805
  function sentence(values, options) {
824
- if (values.length === 0) {
825
- return "";
826
- }
827
- if (values.length === 1) {
828
- return values[0];
829
- }
830
- if (values.length === 2) {
831
- return `${values[0]}${options?.pairSeparator || " and "}${values[1]}`;
832
- }
833
- const normalized = Object.assign({ separator: ", ", lastSeparator: ", and " }, options);
806
+ if (values.length === 0) return "";
807
+ if (values.length === 1) return values[0];
808
+ if (values.length === 2) return `${values[0]}${options?.pairSeparator || " and "}${values[1]}`;
809
+ const normalized = Object.assign({
810
+ separator: ", ",
811
+ lastSeparator: ", and "
812
+ }, options);
834
813
  return `${values.slice(0, -1).join(normalized.separator)}${normalized.lastSeparator}${values[values.length - 1]}`;
835
814
  }
836
815
  function wordWrap(value, options) {
@@ -840,35 +819,19 @@ function wordWrap(value, options) {
840
819
  let regexString = ".{1," + width + "}";
841
820
  regexString += "([\\s​]+|$)|[^\\s​]+?([\\s​]+|$)";
842
821
  const re = new RegExp(regexString, "g");
843
- const lines = value.match(re) || [];
844
- const result = lines.map(function(line) {
845
- if (line.slice(-1) === "\n") {
846
- line = line.slice(0, line.length - 1);
847
- }
822
+ return (value.match(re) || []).map(function(line) {
823
+ if (line.slice(-1) === "\n") line = line.slice(0, line.length - 1);
848
824
  return options.escape ? options.escape(line) : line;
849
825
  }).join(newLine);
850
- return result;
851
826
  }
852
827
  var milliseconds_default = {
853
- /**
854
- * Formats milliseconds to pretty string output
855
- */
856
828
  format(milliseconds, long) {
857
829
  return format(milliseconds, long);
858
830
  },
859
- /**
860
- * Parse the time expression to milliseconds. If the unit value is a number,
861
- * then it will be returned as it is. Otherwise the string expression will
862
- * be converted to a number representing seconds.
863
- */
864
831
  parse(duration) {
865
- if (typeof duration === "number") {
866
- return duration;
867
- }
832
+ if (typeof duration === "number") return duration;
868
833
  const milliseconds = parse(duration);
869
- if (milliseconds === void 0) {
870
- throw new Error(`Invalid duration expression "${duration}"`);
871
- }
834
+ if (milliseconds === void 0) throw new Error(`Invalid duration expression "${duration}"`);
872
835
  return milliseconds;
873
836
  }
874
837
  };
@@ -878,9 +841,7 @@ function htmlEscape(value) {
878
841
  function parseProp(data, key) {
879
842
  const tokens = key.split(".");
880
843
  while (tokens.length) {
881
- if (data === null || typeof data !== "object") {
882
- return;
883
- }
844
+ if (data === null || typeof data !== "object") return;
884
845
  const token = tokens.shift();
885
846
  data = Object.hasOwn(data, token) ? data[token] : void 0;
886
847
  }
@@ -888,17 +849,12 @@ function parseProp(data, key) {
888
849
  }
889
850
  function interpolate(input, data) {
890
851
  return input.replace(/(\\)?{{(.*?)}}/g, (_, escapeChar, key) => {
891
- if (escapeChar) {
892
- return `{{${key}}}`;
893
- }
852
+ if (escapeChar) return `{{${key}}}`;
894
853
  return parseProp(data, key.trim());
895
854
  });
896
855
  }
897
856
  function toUnixSlash(path) {
898
- const isExtendedLengthPath = path.startsWith("\\\\?\\");
899
- if (isExtendedLengthPath) {
900
- return path;
901
- }
857
+ if (path.startsWith("\\\\?\\")) return path;
902
858
  return path.replace(/\\/g, "/");
903
859
  }
904
860
  function pluralize(word, count, inclusive) {
@@ -908,17 +864,17 @@ pluralize.addPluralRule = pluralizePkg.addPluralRule;
908
864
  pluralize.addSingularRule = pluralizePkg.addSingularRule;
909
865
  pluralize.addIrregularRule = pluralizePkg.addIrregularRule;
910
866
  pluralize.addUncountableRule = pluralizePkg.addUncountableRule;
911
- var plural = pluralizePkg.plural;
912
- var singular = pluralizePkg.singular;
913
- var isPlural = pluralizePkg.isPlural;
914
- var isSingular = pluralizePkg.isSingular;
915
- var NO_CASE_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
916
- var NO_CASE_STRIP_REGEXP = /[^A-Z0-9]+/gi;
917
- var SMALL_WORDS = /\b(?:an?d?|a[st]|because|but|by|en|for|i[fn]|neither|nor|o[fnr]|only|over|per|so|some|tha[tn]|the|to|up|upon|vs?\.?|versus|via|when|with|without|yet)\b/i;
918
- var TOKENS = /[^\s:–—-]+|./g;
919
- var WHITESPACE = /\s/;
920
- var IS_MANUAL_CASE = /.(?=[A-Z]|\..)/;
921
- var ALPHANUMERIC_PATTERN = /[A-Za-z0-9\u00C0-\u00FF]/;
867
+ const plural = pluralizePkg.plural;
868
+ const singular = pluralizePkg.singular;
869
+ const isPlural = pluralizePkg.isPlural;
870
+ const isSingular = pluralizePkg.isSingular;
871
+ const NO_CASE_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
872
+ const NO_CASE_STRIP_REGEXP = /[^A-Z0-9]+/gi;
873
+ const SMALL_WORDS = /\b(?:an?d?|a[st]|because|but|by|en|for|i[fn]|neither|nor|o[fnr]|only|over|per|so|some|tha[tn]|the|to|up|upon|vs?\.?|versus|via|when|with|without|yet)\b/i;
874
+ const TOKENS = /[^\s:–—-]+|./g;
875
+ const WHITESPACE = /\s/;
876
+ const IS_MANUAL_CASE = /.(?=[A-Z]|\..)/;
877
+ const ALPHANUMERIC_PATTERN = /[A-Za-z0-9\u00C0-\u00FF]/;
922
878
  function titleCase(input) {
923
879
  let output = "";
924
880
  let result;
@@ -932,38 +888,32 @@ function titleCase(input) {
932
888
  }
933
889
  return output;
934
890
  }
935
- function camelCase2(value) {
936
- return camelCase(value);
891
+ function camelCase(value) {
892
+ return camelCase$1(value);
937
893
  }
938
- function snakeCase2(value) {
939
- return snakeCase(value);
894
+ function snakeCase(value) {
895
+ return snakeCase$1(value);
940
896
  }
941
897
  function dashCase(value, options) {
942
- if (options && options.capitalize) {
943
- return trainCase(value);
944
- }
898
+ if (options && options.capitalize) return trainCase(value);
945
899
  return kebabCase(value);
946
900
  }
947
- function pascalCase2(value) {
948
- return pascalCase(value);
901
+ function pascalCase(value) {
902
+ return pascalCase$1(value);
949
903
  }
950
- function capitalCase2(value) {
951
- return capitalCase(value);
904
+ function capitalCase(value) {
905
+ return capitalCase$1(value);
952
906
  }
953
907
  function sentenceCase(value) {
954
908
  return noCase(value, (input, index2) => {
955
909
  const result = input.toLowerCase();
956
- if (index2 === 0) {
957
- return input.charAt(0).toUpperCase() + input.substring(1);
958
- }
910
+ if (index2 === 0) return input.charAt(0).toUpperCase() + input.substring(1);
959
911
  return result;
960
912
  });
961
913
  }
962
914
  function dotCase(value, options) {
963
915
  const transformedValue = dotNotation(value);
964
- if (options && options.lowerCase) {
965
- return transformedValue.toLowerCase();
966
- }
916
+ if (options && options.lowerCase) return transformedValue.toLowerCase();
967
917
  return transformedValue;
968
918
  }
969
919
  function noCase(value, transform) {
@@ -971,18 +921,14 @@ function noCase(value, transform) {
971
921
  result = result.replace(NO_CASE_STRIP_REGEXP, "\0");
972
922
  let start = 0;
973
923
  let end = result.length;
974
- while (result.charAt(start) === "\0") {
975
- start++;
976
- }
977
- while (result.charAt(end - 1) === "\0") {
978
- end--;
979
- }
924
+ while (result.charAt(start) === "\0") start++;
925
+ while (result.charAt(end - 1) === "\0") end--;
980
926
  return result.slice(start, end).split("\0").map(transform || ((input) => input.toLowerCase())).join(" ");
981
927
  }
982
928
  function condenseWhitespace(value) {
983
929
  return value.trim().replace(/\s{2,}/g, " ");
984
930
  }
985
- var string = {
931
+ var string_default = {
986
932
  excerpt,
987
933
  truncate,
988
934
  slug,
@@ -992,14 +938,14 @@ var string = {
992
938
  singular,
993
939
  isPlural,
994
940
  isSingular,
995
- camelCase: camelCase2,
996
- capitalCase: capitalCase2,
941
+ camelCase,
942
+ capitalCase,
997
943
  dashCase,
998
944
  dotCase,
999
945
  noCase,
1000
- pascalCase: pascalCase2,
946
+ pascalCase,
1001
947
  sentenceCase,
1002
- snakeCase: snakeCase2,
948
+ snakeCase,
1003
949
  titleCase,
1004
950
  random,
1005
951
  sentence,
@@ -1014,7 +960,6 @@ var string = {
1014
960
  uuid,
1015
961
  toUnixSlash
1016
962
  };
1017
- var index_default = string;
1018
963
  var o = Object.defineProperty;
1019
964
  var a = (t, s, r) => s in t ? o(t, s, { enumerable: true, configurable: true, writable: true, value: r }) : t[s] = r;
1020
965
  var n = (t, s, r) => a(t, s + "", r);
@@ -1082,6 +1027,6 @@ class l {
1082
1027
  }
1083
1028
  }
1084
1029
  exports.commonjsRequire = commonjsRequire;
1085
- exports.index_default = index_default;
1086
1030
  exports.l = l;
1087
- //# sourceMappingURL=index-CpyTnwZV.cjs.map
1031
+ exports.string_default = string_default;
1032
+ //# sourceMappingURL=index-CQApAM0M.cjs.map