buzzcasting-utils 1.5.5 → 1.6.0

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.
@@ -33,6 +33,8 @@ export { Attr_2 as Attr }
33
33
 
34
34
  export declare function attrs(attributes: NamedNodeMap): any;
35
35
 
36
+ export declare const awaitElement: (selector: string) => Promise<unknown>;
37
+
36
38
  export declare function brandLogo(channel: string, size: string): string;
37
39
 
38
40
  /**
@@ -161,6 +163,7 @@ export declare enum EVENTS {
161
163
  HIDE_LABELS = "hideLabels",
162
164
  IMAGE_GET = "getImage",
163
165
  IMAGE_SET = "setImage",
166
+ IMAGE_STORED = "imageStored",
164
167
  LAUPPUT_UPDATE = "layoutUpdate",
165
168
  PREV_SLIDE = "prevSlide",
166
169
  RELOAD_PRESENTATION = "reloadPresentation",
@@ -173,6 +176,9 @@ export declare enum EVENTS {
173
176
  PRESENTATION_READY = "presentationReady",
174
177
  PRESENTATION_LOAD = "loadPresentation",
175
178
  PRESENTATION_STORE = "storePresentation",
179
+ SCREENSHOT_TAKE = "takeScreenshot",
180
+ SCREENSHOT_STORE = "storeScreenshot",
181
+ SECTION_UPDATE = "sectionUpdate",
176
182
  SHOW_BUILDER_DIALOG = "showBuilderDialog",
177
183
  SHOW_BUILDER_MODAL = "showBuilderModal",
178
184
  SHOW_MODAL = "showModal",
@@ -181,8 +187,10 @@ export declare enum EVENTS {
181
187
  SLIDE_GOTO = "slideGoto",
182
188
  SLIDE_LOAD = "loadSlide",
183
189
  SLIDE_READY = "slideReady",
190
+ SLIDE_SAVED = "slideSaved",
184
191
  SLIDE_SET = "setSlide",
185
192
  SLIDE_STORE = "storeSlide",
193
+ SLIDE_STORED = "slideStored",
186
194
  SLIDE_TRANSITIONER = "slideTransitioner",
187
195
  START_TRANSITIONER = "startTransitioner",
188
196
  STORAGE_INIT = "storageInit",
@@ -191,6 +199,7 @@ export declare enum EVENTS {
191
199
  SWITCH_PRESENTATION = "switchPresentation",
192
200
  REMOVE_CLOUD = "removeCloud",
193
201
  UPDATE = "update",
202
+ UPLOAD_COMPLETED = "uploadCompleted",
194
203
  VERSION = "version",
195
204
  WIDGETS_CLEAR = "widgetsClear",
196
205
  WIDGET_LOAD = "widgetLoad",
@@ -212,6 +221,8 @@ export declare const getQueryParam: (param: string) => any;
212
221
 
213
222
  export declare function hashSum(o: any): string | any[];
214
223
 
224
+ export declare const hasHWA: () => boolean;
225
+
215
226
  export declare const html2json: (html: string) => {
216
227
  node: string;
217
228
  child: never[];
@@ -1,4 +1,4 @@
1
- var m = /* @__PURE__ */ ((e) => (e.CLOUD = "cloud", e.DASHBOARD = "dashboard", e.DASHBOARDS = "dashboards", e.IMAGES = "images", e.MESSAGES = "messages", e.PREFERENCE = "preference", e.PREFERENCES = "preferences", e.PRESENTATION = "presentation", e.PRESENTATIONS = "presentations", e.SERIES = "series", e.SLIDE = "slide", e.SLIDES = "slides", e.TOPICS = "topics", e.WIDGET = "widget", e.WIDGETS = "widgets", e))(m || {}), h = /* @__PURE__ */ ((e) => (e.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", e.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", e.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", e.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", e.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", e.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", e.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", e.NONE = "color:transparent;background-color:transparent;", e.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", e.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", e.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", e.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", e.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", e.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", e.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", e))(h || {}), I = /* @__PURE__ */ ((e) => (e.ADD_SLIDE = "addSlide", e.APP_READY = "appReady", e.API_UPDATE = "apiUpdate", e.WS_API_REQUEST = "wsApiRequest", e.WS_API_RESPONSE = "wsApiResponse", e.WS_API_UPDATE = "wsApiRUpdate", e.APPROVE_MESSAGE = "approveMessage", e.CHANNEL = "channel", e.CLEAN_MESSAGES = "cleanMessages", e.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", e.CLOSE_BUILDER_MODAL = "closeBuilderModal", e.CLOSE_MODAL = "closeModal", e.CSS_SET = "setCss", e.CSS_STORE = "storeCss", e.DASHBOARD_LOAD = "loadDashboard", e.DASHBOARD_STORE = "storeDashboard", e.ERROR = "error", e.HIDE_MESSAGE = "hideMessage", e.HIDE_LABELS = "hideLabels", e.IMAGE_GET = "getImage", e.IMAGE_SET = "setImage", e.LAUPPUT_UPDATE = "layoutUpdate", e.PREV_SLIDE = "prevSlide", e.RELOAD_PRESENTATION = "reloadPresentation", e.STAR_MESSAGE = "starMessage", e.GOTO_SLIDE = "gotoSlide", e.NEXT_SLIDE = "nextSlide", e.PREFERENCE_LOAD = "loadPreference", e.PREFERENCE_STORE = "storePreference", e.PAUSE_PRESENTATION = "pausePresentation", e.PRESENTATION_READY = "presentationReady", e.PRESENTATION_LOAD = "loadPresentation", e.PRESENTATION_STORE = "storePresentation", e.SHOW_BUILDER_DIALOG = "showBuilderDialog", e.SHOW_BUILDER_MODAL = "showBuilderModal", e.SHOW_MODAL = "showModal", e.SLIDE_DID_LOAD = "slideDidLoad", e.SLIDE_GET = "getSlide", e.SLIDE_GOTO = "slideGoto", e.SLIDE_LOAD = "loadSlide", e.SLIDE_READY = "slideReady", e.SLIDE_SET = "setSlide", e.SLIDE_STORE = "storeSlide", e.SLIDE_TRANSITIONER = "slideTransitioner", e.START_TRANSITIONER = "startTransitioner", e.STORAGE_INIT = "storageInit", e.SUBSCRIBE = "subscribe", e.SUSPEND_ACCOUNT = "suspendAccount", e.SWITCH_PRESENTATION = "switchPresentation", e.REMOVE_CLOUD = "removeCloud", e.UPDATE = "update", e.VERSION = "version", e.WIDGETS_CLEAR = "widgetsClear", e.WIDGET_LOAD = "widgetLoad", e.WIDGET_STORE = "widgetStore", e.WIDGET_UPDATE = "widgetUpdate", e))(I || {}), x = /* @__PURE__ */ ((e) => (e.APPROVED = "approved", e.BEFORE = "before", e.DELAYED = "delayed", e.NONE = "none", e.REALTIME = "realtime", e))(x || {}), E = /* @__PURE__ */ ((e) => (e.KEYVAL = "keyval", e.LOCAL = "local", e.SESSION = "session", e.DEXIE = "dexie", e.WINDOW = "window", e))(E || {});
1
+ var h = /* @__PURE__ */ ((e) => (e.CLOUD = "cloud", e.DASHBOARD = "dashboard", e.DASHBOARDS = "dashboards", e.IMAGES = "images", e.MESSAGES = "messages", e.PREFERENCE = "preference", e.PREFERENCES = "preferences", e.PRESENTATION = "presentation", e.PRESENTATIONS = "presentations", e.SERIES = "series", e.SLIDE = "slide", e.SLIDES = "slides", e.TOPICS = "topics", e.WIDGET = "widget", e.WIDGETS = "widgets", e))(h || {}), m = /* @__PURE__ */ ((e) => (e.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", e.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", e.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", e.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", e.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", e.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", e.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", e.NONE = "color:transparent;background-color:transparent;", e.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", e.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", e.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", e.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", e.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", e.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", e.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", e))(m || {}), v = /* @__PURE__ */ ((e) => (e.ADD_SLIDE = "addSlide", e.APP_READY = "appReady", e.API_UPDATE = "apiUpdate", e.WS_API_REQUEST = "wsApiRequest", e.WS_API_RESPONSE = "wsApiResponse", e.WS_API_UPDATE = "wsApiRUpdate", e.APPROVE_MESSAGE = "approveMessage", e.CHANNEL = "channel", e.CLEAN_MESSAGES = "cleanMessages", e.CLOSE_BUILDER_DIALOG = "closeBuilderDialog", e.CLOSE_BUILDER_MODAL = "closeBuilderModal", e.CLOSE_MODAL = "closeModal", e.CSS_SET = "setCss", e.CSS_STORE = "storeCss", e.DASHBOARD_LOAD = "loadDashboard", e.DASHBOARD_STORE = "storeDashboard", e.ERROR = "error", e.HIDE_MESSAGE = "hideMessage", e.HIDE_LABELS = "hideLabels", e.IMAGE_GET = "getImage", e.IMAGE_SET = "setImage", e.IMAGE_STORED = "imageStored", e.LAUPPUT_UPDATE = "layoutUpdate", e.PREV_SLIDE = "prevSlide", e.RELOAD_PRESENTATION = "reloadPresentation", e.STAR_MESSAGE = "starMessage", e.GOTO_SLIDE = "gotoSlide", e.NEXT_SLIDE = "nextSlide", e.PREFERENCE_LOAD = "loadPreference", e.PREFERENCE_STORE = "storePreference", e.PAUSE_PRESENTATION = "pausePresentation", e.PRESENTATION_READY = "presentationReady", e.PRESENTATION_LOAD = "loadPresentation", e.PRESENTATION_STORE = "storePresentation", e.SCREENSHOT_TAKE = "takeScreenshot", e.SCREENSHOT_STORE = "storeScreenshot", e.SECTION_UPDATE = "sectionUpdate", e.SHOW_BUILDER_DIALOG = "showBuilderDialog", e.SHOW_BUILDER_MODAL = "showBuilderModal", e.SHOW_MODAL = "showModal", e.SLIDE_DID_LOAD = "slideDidLoad", e.SLIDE_GET = "getSlide", e.SLIDE_GOTO = "slideGoto", e.SLIDE_LOAD = "loadSlide", e.SLIDE_READY = "slideReady", e.SLIDE_SAVED = "slideSaved", e.SLIDE_SET = "setSlide", e.SLIDE_STORE = "storeSlide", e.SLIDE_STORED = "slideStored", e.SLIDE_TRANSITIONER = "slideTransitioner", e.START_TRANSITIONER = "startTransitioner", e.STORAGE_INIT = "storageInit", e.SUBSCRIBE = "subscribe", e.SUSPEND_ACCOUNT = "suspendAccount", e.SWITCH_PRESENTATION = "switchPresentation", e.REMOVE_CLOUD = "removeCloud", e.UPDATE = "update", e.UPLOAD_COMPLETED = "uploadCompleted", e.VERSION = "version", e.WIDGETS_CLEAR = "widgetsClear", e.WIDGET_LOAD = "widgetLoad", e.WIDGET_STORE = "widgetStore", e.WIDGET_UPDATE = "widgetUpdate", e))(v || {}), x = /* @__PURE__ */ ((e) => (e.APPROVED = "approved", e.BEFORE = "before", e.DELAYED = "delayed", e.NONE = "none", e.REALTIME = "realtime", e))(x || {}), I = /* @__PURE__ */ ((e) => (e.KEYVAL = "keyval", e.LOCAL = "local", e.SESSION = "session", e.DEXIE = "dexie", e.WINDOW = "window", e))(I || {});
2
2
  function J(e) {
3
3
  const t = e.toUpperCase().split(/[\s_-]+/);
4
4
  return t.length > 0 ? (t.forEach((r, n) => {
@@ -39,11 +39,19 @@ function V(e) {
39
39
  const t = {};
40
40
  for (let r = 0; r < e.length; r++) {
41
41
  const n = e[r];
42
- n.name !== "class" && (t[n.name] = v(n.value));
42
+ n.name !== "class" && (t[n.name] = E(n.value));
43
43
  }
44
44
  return t;
45
45
  }
46
- function ee(e, t) {
46
+ const ee = (e) => new Promise((t) => {
47
+ if (document.querySelector(e))
48
+ return t(document.querySelector(e));
49
+ const r = new MutationObserver((n) => {
50
+ document.querySelector(e) && (r.disconnect(), t(document.querySelector(e)));
51
+ });
52
+ r.observe(document.body, { childList: !0, subtree: !0 });
53
+ });
54
+ function te(e, t) {
47
55
  switch (e) {
48
56
  case "ax":
49
57
  return '<div class="axa-switch-small bg-center bg-cover w-6 h-6"></div>';
@@ -87,55 +95,55 @@ function ee(e, t) {
87
95
  return "";
88
96
  }
89
97
  }
90
- function te(e) {
98
+ function re(e) {
91
99
  return e.replace(/^\w|[A-Z]|\b\w/g, (t, r) => r === 0 ? t.toLowerCase() : t.toUpperCase()).replace(/\s+/g, "");
92
100
  }
93
- function v(e) {
101
+ function E(e) {
94
102
  return e.toLowerCase().split("-").reduce((t, r) => t + (r.charAt(0).toUpperCase() + r.slice(1)));
95
103
  }
96
- const re = (e) => e.charAt(0).toUpperCase() + e.slice(1);
97
- function ne(e) {
104
+ const ne = (e) => e.charAt(0).toUpperCase() + e.slice(1);
105
+ function oe(e) {
98
106
  const t = document.createRange();
99
107
  t.selectNodeContents(e), t.deleteContents();
100
108
  }
101
- const oe = () => Math.floor(Math.random() * 16777215).toString(16), ae = () => {
109
+ const ae = () => Math.floor(Math.random() * 16777215).toString(16), ie = () => {
102
110
  var e = Math.round, t = Math.random, r = 255;
103
111
  return "rgba(" + e(t() * r) + "," + e(t() * r) + "," + e(t() * r) + "," + t().toFixed(1) + ")";
104
- }, ie = () => {
112
+ }, se = () => {
105
113
  var e = Math.round, t = Math.random, r = 255;
106
114
  return "rgba(" + e(t() * r) + "," + e(t() * r) + "," + e(t() * r) + ", 0)";
107
- }, se = () => {
115
+ }, le = () => {
108
116
  var e = Math.round, t = Math.random, r = 255;
109
117
  return "rgba(" + e(t() * r) + "," + e(t() * r) + "," + e(t() * r) + ")";
110
- }, le = (e, t) => {
118
+ }, ce = (e, t) => {
111
119
  e = e.substring(e.indexOf("(") + 1, e.indexOf(")"));
112
120
  let r = e.split(",");
113
121
  return r = r.map((n) => parseFloat(n.trim()).toString()), e = "background-color: rgba(" + parseInt(r[0]) + "," + parseInt(r[1]) + "," + parseInt(r[2]) + "," + t + ");", e;
114
122
  };
115
- function k(e) {
123
+ function P(e) {
116
124
  e.reduce(
117
125
  (t, r) => Object.keys(r).reduce(
118
126
  (n, o) => ({
119
127
  ...n,
120
- [o]: o in t && typeof t[o] == "object" && t[o] !== null && typeof r[o] == "object" && r[o] !== null ? k([t[o], r[o]]) : r[o]
128
+ [o]: o in t && typeof t[o] == "object" && t[o] !== null && typeof r[o] == "object" && r[o] !== null ? P([t[o], r[o]]) : r[o]
121
129
  }),
122
130
  t
123
131
  ),
124
132
  {}
125
133
  );
126
134
  }
127
- const ce = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
128
- function de(e, t = "font-bold") {
135
+ const de = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
136
+ function ue(e, t = "font-bold") {
129
137
  return `${(e == null ? void 0 : e.title.length) > 0 ? `<div class="${t}">${e.title}</div>` : ""}${e != null && e.content ? e.content.replace(/\n\n/g, `
130
138
  `).replace(/\n/g, "<br/>") : ""}`;
131
139
  }
132
- const ue = () => [b(2), b(1), b(1), b(1), b(3)].join("-"), b = (e) => {
140
+ const fe = () => [b(2), b(1), b(1), b(1), b(3)].join("-"), b = (e) => {
133
141
  let t = "";
134
142
  for (let r = 0; r < e; r++)
135
143
  t += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
136
144
  return t;
137
145
  };
138
- function P(e, t) {
146
+ function k(e, t) {
139
147
  for (; e.length < t; )
140
148
  e = `0${e}`;
141
149
  return e;
@@ -148,7 +156,7 @@ function f(e, t) {
148
156
  n = t.charCodeAt(r), e = (e << 5) - e + n, e |= 0;
149
157
  return e < 0 ? e * -2 : e;
150
158
  }
151
- function $(e, t, r) {
159
+ function S(e, t, r) {
152
160
  return Object.keys(t).sort().reduce(n, e);
153
161
  function n(o, a) {
154
162
  return L(o, t[a], a, r);
@@ -164,7 +172,7 @@ function L(e, t, r, n) {
164
172
  if (n.includes(t))
165
173
  return f(o, `[Circular]${r}`);
166
174
  n.push(t);
167
- const a = $(o, t, n);
175
+ const a = S(o, t, n);
168
176
  if (!("valueOf" in t) || typeof t.valueOf != "function")
169
177
  return a;
170
178
  try {
@@ -178,12 +186,12 @@ function L(e, t, r, n) {
178
186
  function M(e) {
179
187
  return Object.prototype.toString.call(e);
180
188
  }
181
- function fe(e) {
182
- return P(L(0, e, "", []).toString(16), 8);
189
+ function pe(e) {
190
+ return k(L(0, e, "", []).toString(16), 8);
183
191
  }
184
- const pe = (e) => {
192
+ const ge = (e) => {
185
193
  let t = "";
186
- return D(e, {
194
+ return A(e, {
187
195
  start: function(r, n, o) {
188
196
  t += "<" + r;
189
197
  for (let a = 0; a < n.length; a++)
@@ -200,7 +208,7 @@ const pe = (e) => {
200
208
  t += `<!-- ${r} -->`;
201
209
  }
202
210
  }), t;
203
- }, ge = (e, t) => {
211
+ }, be = (e, t) => {
204
212
  const r = g("html,head,body,title"), n = { link: "head", base: "head" };
205
213
  t ? t = t.ownerDocument || t.getOwnerDocument && t.getOwnerDocument() || t : typeof t < "u" ? t = new Document() : typeof document < "u" && document.implementation && document.implementation.createDocument && (t = document.implementation.createDocument("", "", null));
206
214
  const o = [];
@@ -210,7 +218,7 @@ const pe = (e) => {
210
218
  }(), t.getElementsByTagName)
211
219
  for (let i in r) r[i] = t.getElementsByTagName(i)[0];
212
220
  let l = r.body;
213
- return D(e, {
221
+ return A(e, {
214
222
  start: function(i, u, c) {
215
223
  if (r[i]) {
216
224
  l = r[i], c || o.push(l);
@@ -234,15 +242,15 @@ const pe = (e) => {
234
242
  let t = {}, r = e.split(",");
235
243
  for (let n = 0; n < r.length; n++) t[r[n]] = !0;
236
244
  return t;
237
- }, R = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, _ = /^<\/([-A-Za-z0-9_]+)[^>]*>/, y = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g, S = g(
245
+ }, R = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, _ = /^<\/([-A-Za-z0-9_]+)[^>]*>/, $ = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g, y = g(
238
246
  "area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"
239
247
  ), C = g(
240
248
  "a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"
241
249
  ), U = g(
242
250
  "abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"
243
- ), B = g("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), G = g(
251
+ ), G = g("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), B = g(
244
252
  "checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
245
- ), T = g("script,style"), D = (e, t) => {
253
+ ), T = g("script,style"), A = (e, t) => {
246
254
  let r, n, o, a = [], l = e;
247
255
  const i = (c, s) => {
248
256
  let d;
@@ -282,17 +290,17 @@ const pe = (e) => {
282
290
  if (s = s.toLowerCase(), C[s])
283
291
  for (; a.at(-1) && U[a.at(-1)]; )
284
292
  i("", a.at(-1));
285
- if (B[s] && a.at(-1) == s && i("", s), p = S[s] || !!p, p || a.push(s), t.start) {
286
- const w = [];
287
- d.replace(y, function(j, A) {
288
- let O = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : G[A] ? A : "";
289
- w.push({
290
- name: A,
291
- value: O,
292
- escaped: O.replace(/(^|[^\\])"/g, '$1\\"')
293
+ if (G[s] && a.at(-1) == s && i("", s), p = y[s] || !!p, p || a.push(s), t.start) {
294
+ const O = [];
295
+ d.replace($, function(Q, D) {
296
+ let w = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : B[D] ? D : "";
297
+ O.push({
298
+ name: D,
299
+ value: w,
300
+ escaped: w.replace(/(^|[^\\])"/g, '$1\\"')
293
301
  //"
294
302
  });
295
- }), t.start && t.start(s, w, p);
303
+ }), t.start && t.start(s, O, p);
296
304
  }
297
305
  }
298
306
  };
@@ -302,13 +310,13 @@ function H(e) {
302
310
  function W(e) {
303
311
  return e.replace(/<\?xml.*\?>\n/, "").replace(/<!doctype.*\>\n/, "").replace(/<!DOCTYPE.*\>\n/, "");
304
312
  }
305
- const be = (e) => {
313
+ const me = (e) => {
306
314
  e = W(e);
307
315
  const t = [], r = {
308
316
  node: "root",
309
317
  child: []
310
318
  };
311
- return D(e, {
319
+ return A(e, {
312
320
  start: function(n, o, a) {
313
321
  let l = {
314
322
  node: "element",
@@ -392,7 +400,13 @@ const be = (e) => {
392
400
  return `<!-- ${e.text} -->`;
393
401
  if (e.node === "root")
394
402
  return r;
395
- }, he = (e, t = 0, r = !0, n = "en") => {
403
+ }, he = () => {
404
+ const e = (t = !1) => {
405
+ const n = document.createElement("canvas").getContext("2d", { willReadFrequently: t });
406
+ return n !== null ? (n.moveTo(0, 0), n.lineTo(120, 121), n.stroke(), n.getImageData(0, 0, 200, 200).data.join()) : null;
407
+ };
408
+ return e(!0) !== e(!1);
409
+ }, xe = (e, t = 0, r = !0, n = "en") => {
396
410
  if (e = typeof e == "string" || e instanceof String ? parseFloat(e.replace(/[^0-9.]/g, "")) : e, r === !1)
397
411
  return e.toLocaleString(n);
398
412
  if (e < 1e3)
@@ -409,7 +423,7 @@ const be = (e) => {
409
423
  for (a = o.length - 1; a > 0 && !(e >= o[a].v); a--)
410
424
  ;
411
425
  return (e / o[a].v).toFixed(t).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + o[a].s;
412
- }, me = (e = 0, t) => {
426
+ }, De = (e = 0, t) => {
413
427
  switch (!0) {
414
428
  case e > 3:
415
429
  console.debug(...t);
@@ -424,12 +438,12 @@ const be = (e) => {
424
438
  console.error(...t);
425
439
  break;
426
440
  }
427
- }, xe = (e) => e.replace(/\<\!--\s*?[^\s?\[][\s\S]*?--\>/g, "").replace(/\>\s*\</g, "><").replace(/\t/g, ""), Ae = (e) => e.replace(/\>\</g, `>
428
- <`), De = (e) => e.replace(/\/\*.*\*\/|\/\*[\s\S]*?\*\/|\n|\t|\v|\s{2,}/g, "").replace(/\s*\{\s*/g, "{").replace(/\s*\}\s*/g, "}").replace(/\s*\:\s*/g, ":").replace(/\s*\;\s*/g, ";").replace(/\s*\,\s*/g, ",").replace(/\s*\~\s*/g, "~").replace(/\s*\>\s*/g, ">").replace(/\s*\+\s*/g, "+").replace(/\s*\!\s*/g, "!"), we = (e) => e.replace(/\,/g, ", ").replace(/\{/g, ` {
441
+ }, Ae = (e) => e.replace(/\<\!--\s*?[^\s?\[][\s\S]*?--\>/g, "").replace(/\>\s*\</g, "><").replace(/\t/g, ""), Oe = (e) => e.replace(/\>\</g, `>
442
+ <`), we = (e) => e.replace(/\/\*.*\*\/|\/\*[\s\S]*?\*\/|\n|\t|\v|\s{2,}/g, "").replace(/\s*\{\s*/g, "{").replace(/\s*\}\s*/g, "}").replace(/\s*\:\s*/g, ":").replace(/\s*\;\s*/g, ";").replace(/\s*\,\s*/g, ",").replace(/\s*\~\s*/g, "~").replace(/\s*\>\s*/g, ">").replace(/\s*\+\s*/g, "+").replace(/\s*\!\s*/g, "!"), Re = (e) => e.replace(/\,/g, ", ").replace(/\{/g, ` {
429
443
  `).replace(/\}/g, `}
430
444
  `).replace(/\;/g, `;
431
445
  `);
432
- function Oe(e, t) {
446
+ function _e(e, t) {
433
447
  const r = [
434
448
  { value: 1, symbol: "" },
435
449
  { value: 1e3, symbol: "K" },
@@ -444,18 +458,18 @@ function Oe(e, t) {
444
458
  ;
445
459
  return (e / r[o].value).toFixed(t).replace(n, "$1") + r[o].symbol;
446
460
  }
447
- function Re(e) {
461
+ function Le(e) {
448
462
  const t = RegExp(`[?&]${e}=([^&]*)`).exec(window.location.search);
449
463
  return t && decodeURIComponent(t[1].replace(/\+/g, " ")) || null;
450
464
  }
451
- const _e = (e) => new Proxy(new URLSearchParams(window.location.search), {
465
+ const ve = (e) => new Proxy(new URLSearchParams(window.location.search), {
452
466
  // @ts-ignore
453
467
  get: (r, n) => r.get(n)
454
468
  })[e];
455
- function Le(e) {
469
+ function Ie(e) {
456
470
  return e[Math.floor(Math.random() * e.length)];
457
471
  }
458
- function Ie(e) {
472
+ function Ee(e) {
459
473
  switch (e.language) {
460
474
  case "ar":
461
475
  return {
@@ -466,7 +480,7 @@ function Ie(e) {
466
480
  return {};
467
481
  }
468
482
  }
469
- function Ee(e) {
483
+ function Pe(e) {
470
484
  const t = window.BuzzCasting.getOptions().suspended ?? !1;
471
485
  return e.forEach((r) => {
472
486
  var n;
@@ -507,13 +521,13 @@ function Ee(e) {
507
521
  }
508
522
  }), e;
509
523
  }
510
- function ve(e, t, r, n) {
524
+ function ke(e, t, r, n) {
511
525
  e.stopPropagation(), t.showModal({
512
526
  showComponent: "card-modal",
513
527
  props: { data: r, options: n }
514
528
  });
515
529
  }
516
- function ke(e) {
530
+ function Se(e) {
517
531
  const t = [...e];
518
532
  for (let r = t.length - 1; r > 0; r--) {
519
533
  const n = Math.floor(Math.random() * (r + 1));
@@ -521,7 +535,7 @@ function ke(e) {
521
535
  }
522
536
  return t;
523
537
  }
524
- function Pe() {
538
+ function Me() {
525
539
  let e = "";
526
540
  const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
527
541
  for (let r = 0; r < 7; r++) e += t.charAt(Math.floor(Math.random() * t.length));
@@ -529,23 +543,23 @@ function Pe() {
529
543
  }
530
544
  const $e = (e) => {
531
545
  switch (e == null ? void 0 : e.type) {
532
- case m.MESSAGES:
533
- return h.MESSAGES;
534
- case m.SERIES:
535
- return h.SERIES;
536
- case m.CLOUD:
537
- return h.CLOUD;
546
+ case h.MESSAGES:
547
+ return m.MESSAGES;
548
+ case h.SERIES:
549
+ return m.SERIES;
550
+ case h.CLOUD:
551
+ return m.CLOUD;
538
552
  default:
539
- return h.NO_UPDATES;
553
+ return m.NO_UPDATES;
540
554
  }
541
- }, Y = (e = 6) => Math.random().toString(36).substring(2, e + 2), K = (e, t = []) => !t.find(function(n) {
555
+ }, K = (e = 6) => Math.random().toString(36).substring(2, e + 2), Y = (e, t = []) => !t.find(function(n) {
542
556
  return n === e;
543
- }), Me = (e, t = []) => {
557
+ }), ye = (e, t = []) => {
544
558
  let n = 0, o = "";
545
559
  for (; o == "" && n < 100; )
546
- o = Y(e), K(o, t) || (o = "", n++);
560
+ o = K(e), Y(o, t) || (o = "", n++);
547
561
  return o;
548
- }, ye = (e) => {
562
+ }, Ce = (e) => {
549
563
  switch (!0) {
550
564
  case e < 0:
551
565
  return "text-down text-xs";
@@ -554,12 +568,12 @@ const $e = (e) => {
554
568
  default:
555
569
  return "text-white text-xs";
556
570
  }
557
- }, Se = (e, t, r) => Promise.race([e, Z(t, r)]), Z = (e, t) => new Promise((r, n) => setTimeout(() => t === void 0 ? r("ok") : n(t), e));
558
- function Ce(e) {
571
+ }, Ue = (e, t, r) => Promise.race([e, Z(t, r)]), Z = (e, t) => new Promise((r, n) => setTimeout(() => t === void 0 ? r("ok") : n(t), e));
572
+ function Ge(e) {
559
573
  let t = `${e.type}.${e.topics}`;
560
574
  return e.order && (t += `.${e.order}`), e.period && (t += `.${e.period}`), t;
561
575
  }
562
- function Ue(e) {
576
+ function Be(e) {
563
577
  var t;
564
578
  if (e.widget === void 0) {
565
579
  const r = (t = e.topics) == null ? void 0 : t.split("-");
@@ -567,7 +581,7 @@ function Ue(e) {
567
581
  }
568
582
  return e;
569
583
  }
570
- function Be(e, t) {
584
+ function Te(e, t) {
571
585
  var i;
572
586
  let r, n, o, a, l;
573
587
  switch (e.moderation) {
@@ -585,60 +599,62 @@ function Be(e, t) {
585
599
  }
586
600
  return t;
587
601
  }
588
- var X = /* @__PURE__ */ ((e) => (e.MultiPolygon = "MultiPolygon", e.Polygon = "Polygon", e))(X || {}), Q = /* @__PURE__ */ ((e) => (e.MultiPolygon = "MultiPolygon", e.Polygon = "Polygon", e))(Q || {});
602
+ var X = /* @__PURE__ */ ((e) => (e.MultiPolygon = "MultiPolygon", e.Polygon = "Polygon", e))(X || {}), j = /* @__PURE__ */ ((e) => (e.MultiPolygon = "MultiPolygon", e.Polygon = "Polygon", e))(j || {});
589
603
  export {
590
- m as API,
591
- h as CSS,
592
- I as EVENTS,
593
- D as HTMLParser,
594
- ge as HTMLtoDOM,
595
- pe as HTMLtoXML,
604
+ h as API,
605
+ m as CSS,
606
+ v as EVENTS,
607
+ A as HTMLParser,
608
+ be as HTMLtoDOM,
609
+ ge as HTMLtoXML,
596
610
  x as MODERATION,
597
- le as RGBAchangeA,
598
- E as STORAGE,
599
- Q as ShapeType,
611
+ ce as RGBAchangeA,
612
+ I as STORAGE,
613
+ j as ShapeType,
600
614
  X as Type,
601
615
  J as anonymize,
602
616
  z as attachedMedia,
603
617
  q as attrs,
604
- ee as brandLogo,
605
- v as camelCase,
618
+ ee as awaitElement,
619
+ te as brandLogo,
620
+ E as camelCase,
606
621
  V as camelCasedProps,
607
- te as camelize,
608
- re as capitalizeFirstLetter,
609
- ne as clearContents,
610
- k as deepMerge,
611
- ce as escape,
622
+ re as camelize,
623
+ ne as capitalizeFirstLetter,
624
+ oe as clearContents,
625
+ P as deepMerge,
626
+ de as escape,
612
627
  N as filterAttributes,
613
- de as formatContent,
614
- ue as getGuid,
615
- Ce as getKey,
616
- Re as getParameterByName,
617
- _e as getQueryParam,
618
- fe as hashSum,
619
- be as html2json,
620
- he as intToString,
628
+ ue as formatContent,
629
+ fe as getGuid,
630
+ Ge as getKey,
631
+ Le as getParameterByName,
632
+ ve as getQueryParam,
633
+ he as hasHWA,
634
+ pe as hashSum,
635
+ me as html2json,
636
+ xe as intToString,
621
637
  F as json2html,
622
- me as log,
623
- we as maxifyCss,
624
- Ae as maxifyHtml,
625
- De as minifyCss,
626
- xe as minifyHtml,
627
- Be as moderation,
628
- Oe as numberFormatter,
629
- oe as randomColor,
630
- se as randomRGB,
631
- ie as randomRGBA,
632
- ae as randomRGBAfull,
633
- Le as randomValue,
634
- Ie as rtl,
635
- Ee as sanitize,
636
- ve as showModal,
637
- ke as shuffleMessages,
638
- Pe as stringGen,
638
+ De as log,
639
+ Re as maxifyCss,
640
+ Oe as maxifyHtml,
641
+ we as minifyCss,
642
+ Ae as minifyHtml,
643
+ Te as moderation,
644
+ _e as numberFormatter,
645
+ ae as randomColor,
646
+ le as randomRGB,
647
+ se as randomRGBA,
648
+ ie as randomRGBAfull,
649
+ Ie as randomValue,
650
+ Ee as rtl,
651
+ Pe as sanitize,
652
+ ke as showModal,
653
+ Se as shuffleMessages,
654
+ Me as stringGen,
639
655
  $e as typeCss,
640
- Me as uniq,
641
- ye as upDownColor,
642
- Ue as widgetParams,
643
- Se as wrapPromise
656
+ ye as uniq,
657
+ Ce as upDownColor,
658
+ Be as widgetParams,
659
+ Ue as wrapPromise
644
660
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "buzzcasting-utils",
3
3
  "type": "module",
4
- "version": "1.5.5",
4
+ "version": "1.6.0",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "Mark Tamis, TouchFlows SAS",
@@ -39,7 +39,7 @@
39
39
  "camelcase": "^8.0.0",
40
40
  "changelogen": "^0.6.1",
41
41
  "eslint": "^9.25.1",
42
- "lint-staged": "^15.5.1",
42
+ "lint-staged": "^16.0.0",
43
43
  "typescript": "^5.8.3",
44
44
  "vite": "^6.3.4",
45
45
  "vite-plugin-dts": "^4.5.3",