@hellotext/hellotext 2.5.6 → 2.5.8

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 (113) hide show
  1. package/README.md +5 -26
  2. package/dist/hellotext.js +1 -1
  3. package/dist/hellotext.js.LICENSE.txt +1 -1
  4. package/index.d.ts +15 -6
  5. package/lib/api/acks.cjs +17 -31
  6. package/lib/api/acks.js +17 -42
  7. package/lib/api/businesses.cjs +14 -28
  8. package/lib/api/businesses.js +13 -36
  9. package/lib/api/events.cjs +26 -40
  10. package/lib/api/events.js +28 -52
  11. package/lib/api/forms.cjs +24 -40
  12. package/lib/api/forms.js +24 -57
  13. package/lib/api/identifications.cjs +15 -29
  14. package/lib/api/identifications.js +15 -40
  15. package/lib/api/index.cjs +26 -46
  16. package/lib/api/index.js +28 -49
  17. package/lib/api/push/identities.cjs +43 -0
  18. package/lib/api/push/identities.js +35 -0
  19. package/lib/api/response.cjs +30 -52
  20. package/lib/api/response.js +31 -60
  21. package/lib/api/submissions.cjs +18 -34
  22. package/lib/api/submissions.js +18 -48
  23. package/lib/api/webchat/messages.cjs +44 -64
  24. package/lib/api/webchat/messages.js +44 -80
  25. package/lib/api/webchats.cjs +37 -56
  26. package/lib/api/webchats.js +37 -65
  27. package/lib/api/whatsapp_widgets.cjs +49 -72
  28. package/lib/api/whatsapp_widgets.js +48 -91
  29. package/lib/builders/input_builder.cjs +36 -48
  30. package/lib/builders/input_builder.js +36 -48
  31. package/lib/builders/logo_builder.cjs +10 -29
  32. package/lib/builders/logo_builder.js +20 -28
  33. package/lib/channels/application_channel.cjs +136 -178
  34. package/lib/channels/application_channel.js +137 -180
  35. package/lib/channels/webchat_channel.cjs +125 -170
  36. package/lib/channels/webchat_channel.js +125 -170
  37. package/lib/controllers/form_controller.cjs +82 -121
  38. package/lib/controllers/form_controller.js +82 -130
  39. package/lib/controllers/message_controller.cjs +211 -282
  40. package/lib/controllers/message_controller.js +209 -284
  41. package/lib/controllers/mixins/usePopover.cjs +3 -6
  42. package/lib/controllers/mixins/usePopover.js +17 -22
  43. package/lib/controllers/webchat/emoji_picker_controller.cjs +106 -150
  44. package/lib/controllers/webchat/emoji_picker_controller.js +105 -170
  45. package/lib/controllers/webchat/useBehaviour.js +5 -5
  46. package/lib/controllers/webchat/useOpeningSequence.js +6 -6
  47. package/lib/controllers/webchat/useTeaser.js +9 -9
  48. package/lib/controllers/webchat_controller.cjs +916 -1088
  49. package/lib/controllers/webchat_controller.js +926 -1152
  50. package/lib/core/configuration/forms.cjs +21 -35
  51. package/lib/core/configuration/forms.js +20 -35
  52. package/lib/core/configuration/locale.cjs +36 -71
  53. package/lib/core/configuration/locale.js +36 -70
  54. package/lib/core/configuration/push.cjs +16 -0
  55. package/lib/core/configuration/push.js +10 -0
  56. package/lib/core/configuration/webchat.cjs +142 -182
  57. package/lib/core/configuration/webchat.js +145 -189
  58. package/lib/core/configuration/whatsapp.cjs +76 -102
  59. package/lib/core/configuration/whatsapp.js +76 -105
  60. package/lib/core/configuration.cjs +62 -75
  61. package/lib/core/configuration.js +61 -75
  62. package/lib/core/event.cjs +36 -59
  63. package/lib/core/event.js +35 -61
  64. package/lib/core/sanitize_html.js +4 -4
  65. package/lib/errors/invalid_event.cjs +5 -26
  66. package/lib/errors/invalid_event.js +5 -26
  67. package/lib/errors/not_initialized_error.cjs +5 -26
  68. package/lib/errors/not_initialized_error.js +5 -26
  69. package/lib/hellotext.cjs +186 -211
  70. package/lib/hellotext.js +189 -236
  71. package/lib/index.js +1 -1
  72. package/lib/models/business.cjs +115 -152
  73. package/lib/models/business.js +118 -162
  74. package/lib/models/cookies.cjs +34 -51
  75. package/lib/models/cookies.js +34 -51
  76. package/lib/models/fingerprint.cjs +8 -23
  77. package/lib/models/fingerprint.js +25 -58
  78. package/lib/models/form.cjs +106 -142
  79. package/lib/models/form.js +105 -153
  80. package/lib/models/form_collection.cjs +63 -101
  81. package/lib/models/form_collection.js +61 -107
  82. package/lib/models/index.cjs +7 -0
  83. package/lib/models/index.js +1 -0
  84. package/lib/models/page.cjs +106 -129
  85. package/lib/models/page.js +106 -131
  86. package/lib/models/push.cjs +345 -0
  87. package/lib/models/push.js +339 -0
  88. package/lib/models/query.cjs +21 -41
  89. package/lib/models/query.js +21 -41
  90. package/lib/models/session.cjs +33 -65
  91. package/lib/models/session.js +30 -63
  92. package/lib/models/user.cjs +29 -51
  93. package/lib/models/user.js +29 -51
  94. package/lib/models/utm.cjs +15 -27
  95. package/lib/models/utm.js +17 -32
  96. package/lib/models/webchat.cjs +52 -76
  97. package/lib/models/webchat.js +52 -90
  98. package/lib/models/whatsapp_widget.cjs +41 -59
  99. package/lib/models/whatsapp_widget.js +41 -73
  100. package/lib/vanilla.cjs +4 -7
  101. package/lib/vanilla.js +2 -1
  102. package/package.json +2 -10
  103. package/src/api/index.js +5 -0
  104. package/src/api/push/identities.js +42 -0
  105. package/src/core/configuration/push.js +12 -0
  106. package/src/core/configuration.js +5 -0
  107. package/src/hellotext.js +15 -1
  108. package/src/index.bundle.js +0 -1
  109. package/src/models/business.js +1 -0
  110. package/src/models/index.js +1 -0
  111. package/src/models/push.js +397 -0
  112. package/src/vanilla.js +2 -1
  113. package/styles/index.css +0 -30
@@ -4,11 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Forms = void 0;
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
7
  /**
13
8
  * @class Forms
14
9
  * @classdesc
@@ -16,34 +11,25 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
16
11
  * @property {Boolean} autoMount - whether to auto mount forms
17
12
  * @property {Boolean|String} successMessage - whether to show success message after form completion or not
18
13
  */
19
- let Forms = /*#__PURE__*/function () {
20
- function Forms() {
21
- _classCallCheck(this, Forms);
22
- }
23
- _createClass(Forms, null, [{
24
- key: "assign",
25
- value:
26
- /**
27
- * @param {Object} props
28
- * @param {Boolean} [props.autoMount=true] - whether to auto mount forms
29
- * @param {Boolean|String} [props.successMessage=true] - whether to show success message after form completion or not
30
- */
31
- function assign(props) {
32
- if (props) {
33
- Object.entries(props).forEach(([key, value]) => {
34
- this[key] = value;
35
- });
36
- }
37
- return this;
38
- }
39
- }, {
40
- key: "shouldShowSuccessMessage",
41
- get: function () {
42
- return this.successMessage;
14
+ class Forms {
15
+ static autoMount = true;
16
+ static successMessage = true;
17
+
18
+ /**
19
+ * @param {Object} props
20
+ * @param {Boolean} [props.autoMount=true] - whether to auto mount forms
21
+ * @param {Boolean|String} [props.successMessage=true] - whether to show success message after form completion or not
22
+ */
23
+ static assign(props) {
24
+ if (props) {
25
+ Object.entries(props).forEach(([key, value]) => {
26
+ this[key] = value;
27
+ });
43
28
  }
44
- }]);
45
- return Forms;
46
- }();
47
- exports.Forms = Forms;
48
- Forms.autoMount = true;
49
- Forms.successMessage = true;
29
+ return this;
30
+ }
31
+ static get shouldShowSuccessMessage() {
32
+ return this.successMessage;
33
+ }
34
+ }
35
+ exports.Forms = Forms;
@@ -1,8 +1,3 @@
1
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
1
  /**
7
2
  * @class Forms
8
3
  * @classdesc
@@ -10,35 +5,25 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
10
5
  * @property {Boolean} autoMount - whether to auto mount forms
11
6
  * @property {Boolean|String} successMessage - whether to show success message after form completion or not
12
7
  */
13
- var Forms = /*#__PURE__*/function () {
14
- function Forms() {
15
- _classCallCheck(this, Forms);
16
- }
17
- _createClass(Forms, null, [{
18
- key: "assign",
19
- value:
20
- /**
21
- * @param {Object} props
22
- * @param {Boolean} [props.autoMount=true] - whether to auto mount forms
23
- * @param {Boolean|String} [props.successMessage=true] - whether to show success message after form completion or not
24
- */
25
- function assign(props) {
26
- if (props) {
27
- Object.entries(props).forEach(_ref => {
28
- var [key, value] = _ref;
29
- this[key] = value;
30
- });
31
- }
32
- return this;
33
- }
34
- }, {
35
- key: "shouldShowSuccessMessage",
36
- get: function get() {
37
- return this.successMessage;
8
+ class Forms {
9
+ static autoMount = true;
10
+ static successMessage = true;
11
+
12
+ /**
13
+ * @param {Object} props
14
+ * @param {Boolean} [props.autoMount=true] - whether to auto mount forms
15
+ * @param {Boolean|String} [props.successMessage=true] - whether to show success message after form completion or not
16
+ */
17
+ static assign(props) {
18
+ if (props) {
19
+ Object.entries(props).forEach(([key, value]) => {
20
+ this[key] = value;
21
+ });
38
22
  }
39
- }]);
40
- return Forms;
41
- }();
42
- Forms.autoMount = true;
43
- Forms.successMessage = true;
23
+ return this;
24
+ }
25
+ static get shouldShowSuccessMessage() {
26
+ return this.successMessage;
27
+ }
28
+ }
44
29
  export { Forms };
@@ -4,17 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Locale = void 0;
7
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
- function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }
13
- var id = 0;
14
- function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; }
15
- var _fromHtmlLangProperty = /*#__PURE__*/_classPrivateFieldLooseKey("fromHtmlLangProperty");
16
- var _fromMetaTag = /*#__PURE__*/_classPrivateFieldLooseKey("fromMetaTag");
17
- var _fromBrowserLanguage = /*#__PURE__*/_classPrivateFieldLooseKey("fromBrowserLanguage");
18
7
  /**
19
8
  * @class Locale
20
9
  * @classdesc
@@ -22,66 +11,42 @@ var _fromBrowserLanguage = /*#__PURE__*/_classPrivateFieldLooseKey("fromBrowserL
22
11
  * Provides automatic locale detection from HTML lang attribute, meta tags,
23
12
  * and browser language with fallback to 'en'.
24
13
  */
25
- let Locale = /*#__PURE__*/function () {
26
- function Locale() {
27
- _classCallCheck(this, Locale);
14
+ class Locale {
15
+ static _identifier;
16
+
17
+ /**
18
+ * Sets the locale identifier explicitly.
19
+ * @param {string} value - The locale identifier (e.g., 'en', 'es')
20
+ */
21
+ static set identifier(value) {
22
+ this._identifier = value;
28
23
  }
29
- _createClass(Locale, null, [{
30
- key: "identifier",
31
- get:
32
- /**
33
- * Gets the effective locale identifier.
34
- * Falls back to auto-detection if not explicitly set.
35
- * @returns {string} The locale identifier
36
- */
37
- function () {
38
- if (this._identifier) return this._identifier;
39
- return _classPrivateFieldLooseBase(this, _fromHtmlLangProperty)[_fromHtmlLangProperty] || _classPrivateFieldLooseBase(this, _fromMetaTag)[_fromMetaTag] || _classPrivateFieldLooseBase(this, _fromBrowserLanguage)[_fromBrowserLanguage] || 'en';
40
- }
41
24
 
42
- /**
43
- * Returns the locale identifier as a string.
44
- * @returns {string} The locale identifier
45
- */,
46
- set:
47
- /**
48
- * Sets the locale identifier explicitly.
49
- * @param {string} value - The locale identifier (e.g., 'en', 'es')
50
- */
51
- function (value) {
52
- this._identifier = value;
53
- }
54
- }, {
55
- key: "toString",
56
- value: function toString() {
57
- return this.identifier;
58
- }
59
- }]);
60
- return Locale;
61
- }();
62
- exports.Locale = Locale;
63
- function _get_fromHtmlLangProperty() {
64
- var _document, _document$documentEle;
65
- return (_document = document) === null || _document === void 0 ? void 0 : (_document$documentEle = _document.documentElement) === null || _document$documentEle === void 0 ? void 0 : _document$documentEle.lang;
66
- }
67
- function _get_fromMetaTag() {
68
- var _document2, _document2$querySelec;
69
- return (_document2 = document) === null || _document2 === void 0 ? void 0 : (_document2$querySelec = _document2.querySelector('meta[name="locale"]')) === null || _document2$querySelec === void 0 ? void 0 : _document2$querySelec.content;
70
- }
71
- function _get_fromBrowserLanguage() {
72
- var _navigator, _navigator$language;
73
- return (_navigator = navigator) === null || _navigator === void 0 ? void 0 : (_navigator$language = _navigator.language) === null || _navigator$language === void 0 ? void 0 : _navigator$language.split('-')[0]; // Extract primary language
25
+ /**
26
+ * Gets the effective locale identifier.
27
+ * Falls back to auto-detection if not explicitly set.
28
+ * @returns {string} The locale identifier
29
+ */
30
+ static get identifier() {
31
+ if (this._identifier) return this._identifier;
32
+ return this.#fromHtmlLangProperty || this.#fromMetaTag || this.#fromBrowserLanguage || 'en';
33
+ }
34
+
35
+ /**
36
+ * Returns the locale identifier as a string.
37
+ * @returns {string} The locale identifier
38
+ */
39
+ static toString() {
40
+ return this.identifier;
41
+ }
42
+ static get #fromHtmlLangProperty() {
43
+ return document?.documentElement?.lang;
44
+ }
45
+ static get #fromMetaTag() {
46
+ return document?.querySelector('meta[name="locale"]')?.content;
47
+ }
48
+ static get #fromBrowserLanguage() {
49
+ return navigator?.language?.split('-')[0]; // Extract primary language
50
+ }
74
51
  }
75
- Object.defineProperty(Locale, _fromBrowserLanguage, {
76
- get: _get_fromBrowserLanguage,
77
- set: void 0
78
- });
79
- Object.defineProperty(Locale, _fromMetaTag, {
80
- get: _get_fromMetaTag,
81
- set: void 0
82
- });
83
- Object.defineProperty(Locale, _fromHtmlLangProperty, {
84
- get: _get_fromHtmlLangProperty,
85
- set: void 0
86
- });
87
- Locale._identifier = void 0;
52
+ exports.Locale = Locale;
@@ -1,14 +1,3 @@
1
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
6
- function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; }
7
- var id = 0;
8
- function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; }
9
- var _fromHtmlLangProperty = /*#__PURE__*/_classPrivateFieldLooseKey("fromHtmlLangProperty");
10
- var _fromMetaTag = /*#__PURE__*/_classPrivateFieldLooseKey("fromMetaTag");
11
- var _fromBrowserLanguage = /*#__PURE__*/_classPrivateFieldLooseKey("fromBrowserLanguage");
12
1
  /**
13
2
  * @class Locale
14
3
  * @classdesc
@@ -16,66 +5,43 @@ var _fromBrowserLanguage = /*#__PURE__*/_classPrivateFieldLooseKey("fromBrowserL
16
5
  * Provides automatic locale detection from HTML lang attribute, meta tags,
17
6
  * and browser language with fallback to 'en'.
18
7
  */
19
- var Locale = /*#__PURE__*/function () {
20
- function Locale() {
21
- _classCallCheck(this, Locale);
8
+ class Locale {
9
+ static _identifier;
10
+
11
+ /**
12
+ * Sets the locale identifier explicitly.
13
+ * @param {string} value - The locale identifier (e.g., 'en', 'es')
14
+ */
15
+ static set identifier(value) {
16
+ this._identifier = value;
22
17
  }
23
- _createClass(Locale, null, [{
24
- key: "identifier",
25
- get:
26
- /**
27
- * Gets the effective locale identifier.
28
- * Falls back to auto-detection if not explicitly set.
29
- * @returns {string} The locale identifier
30
- */
31
- function get() {
32
- if (this._identifier) return this._identifier;
33
- return _classPrivateFieldLooseBase(this, _fromHtmlLangProperty)[_fromHtmlLangProperty] || _classPrivateFieldLooseBase(this, _fromMetaTag)[_fromMetaTag] || _classPrivateFieldLooseBase(this, _fromBrowserLanguage)[_fromBrowserLanguage] || 'en';
34
- }
35
18
 
36
- /**
37
- * Returns the locale identifier as a string.
38
- * @returns {string} The locale identifier
39
- */,
40
- set:
41
- /**
42
- * Sets the locale identifier explicitly.
43
- * @param {string} value - The locale identifier (e.g., 'en', 'es')
44
- */
45
- function set(value) {
46
- this._identifier = value;
47
- }
48
- }, {
49
- key: "toString",
50
- value: function toString() {
51
- return this.identifier;
52
- }
53
- }]);
54
- return Locale;
55
- }();
56
- function _get_fromHtmlLangProperty() {
57
- var _document, _document$documentEle;
58
- return (_document = document) === null || _document === void 0 ? void 0 : (_document$documentEle = _document.documentElement) === null || _document$documentEle === void 0 ? void 0 : _document$documentEle.lang;
59
- }
60
- function _get_fromMetaTag() {
61
- var _document2, _document2$querySelec;
62
- return (_document2 = document) === null || _document2 === void 0 ? void 0 : (_document2$querySelec = _document2.querySelector('meta[name="locale"]')) === null || _document2$querySelec === void 0 ? void 0 : _document2$querySelec.content;
63
- }
64
- function _get_fromBrowserLanguage() {
65
- var _navigator, _navigator$language;
66
- return (_navigator = navigator) === null || _navigator === void 0 ? void 0 : (_navigator$language = _navigator.language) === null || _navigator$language === void 0 ? void 0 : _navigator$language.split('-')[0]; // Extract primary language
19
+ /**
20
+ * Gets the effective locale identifier.
21
+ * Falls back to auto-detection if not explicitly set.
22
+ * @returns {string} The locale identifier
23
+ */
24
+ static get identifier() {
25
+ if (this._identifier) return this._identifier;
26
+ return this.#fromHtmlLangProperty || this.#fromMetaTag || this.#fromBrowserLanguage || 'en';
27
+ }
28
+
29
+ /**
30
+ * Returns the locale identifier as a string.
31
+ * @returns {string} The locale identifier
32
+ */
33
+ static toString() {
34
+ return this.identifier;
35
+ }
36
+ static get #fromHtmlLangProperty() {
37
+ return document?.documentElement?.lang;
38
+ }
39
+ static get #fromMetaTag() {
40
+ return document?.querySelector('meta[name="locale"]')?.content;
41
+ }
42
+ static get #fromBrowserLanguage() {
43
+ return navigator?.language?.split('-')[0]; // Extract primary language
44
+ }
67
45
  }
68
- Object.defineProperty(Locale, _fromBrowserLanguage, {
69
- get: _get_fromBrowserLanguage,
70
- set: void 0
71
- });
72
- Object.defineProperty(Locale, _fromMetaTag, {
73
- get: _get_fromMetaTag,
74
- set: void 0
75
- });
76
- Object.defineProperty(Locale, _fromHtmlLangProperty, {
77
- get: _get_fromHtmlLangProperty,
78
- set: void 0
79
- });
80
- Locale._identifier = void 0;
46
+
81
47
  export { Locale };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Push = void 0;
7
+ class Push {
8
+ static serviceWorkerUrl = null;
9
+ static channelId = null;
10
+ static assign(props) {
11
+ this.serviceWorkerUrl = props?.serviceWorkerUrl || null;
12
+ this.channelId = props?.channelId || null;
13
+ return this;
14
+ }
15
+ }
16
+ exports.Push = Push;
@@ -0,0 +1,10 @@
1
+ class Push {
2
+ static serviceWorkerUrl = null;
3
+ static channelId = null;
4
+ static assign(props) {
5
+ this.serviceWorkerUrl = props?.serviceWorkerUrl || null;
6
+ this.channelId = props?.channelId || null;
7
+ return this;
8
+ }
9
+ }
10
+ export { Push };