@markupai/sidebar-adapter 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,10 +1,10 @@
1
- var y = /* @__PURE__ */ (function(e) {
1
+ var ne = /* @__PURE__ */ (function(e) {
2
2
  return e.TEXT_PLAIN = "text/plain", e.TEXT_MARKDOWN = "text/markdown", e.TEXT_HTML = "text/html", e.APPLICATION_DITA_XML = "application/dita+xml", e;
3
3
  })({}), ae = [
4
- y.TEXT_PLAIN,
5
- y.TEXT_MARKDOWN,
6
- y.TEXT_HTML,
7
- y.APPLICATION_DITA_XML
4
+ "text/plain",
5
+ "text/markdown",
6
+ "text/html",
7
+ "application/dita+xml"
8
8
  ], oe = {
9
9
  integrationName: "unknown",
10
10
  integrationVersion: "unknown",
@@ -21,41 +21,42 @@ var y = /* @__PURE__ */ (function(e) {
21
21
  const r = i;
22
22
  return typeof r.value == "string" && typeof r.label == "string";
23
23
  }) : !1;
24
- }, D = class _ extends Error {
24
+ }, T = class O extends Error {
25
25
  name = "TextLookupError";
26
26
  constructor(t) {
27
- super(t), Object.setPrototypeOf(this, _.prototype);
27
+ super(t), Object.setPrototypeOf(this, O.prototype);
28
28
  }
29
29
  };
30
30
  function ce(e) {
31
- return e instanceof D;
31
+ return e instanceof T;
32
32
  }
33
- var E = { TextLookupError: (e) => new D(e) };
34
- function H(e) {
35
- const t = e.message ?? "", i = e.name, r = typeof i == "string" && i in E ? E[i] : void 0;
33
+ var P = { TextLookupError: (e) => new T(e) };
34
+ function N(e) {
35
+ const t = e.message ?? "", i = e.name, r = typeof i == "string" && i in P ? P[i] : void 0;
36
36
  return r ? r(t, e) : Object.assign(new Error(t), i ? { name: i } : {});
37
37
  }
38
- var R = () => {
39
- }, U = class {
40
- _promise;
41
- [Symbol.toStringTag] = "Promise";
42
- resolve = R;
43
- reject = R;
44
- constructor() {
45
- this._promise = new Promise((e, t) => {
46
- this.resolve = e, this.reject = t;
47
- });
48
- }
49
- then(e, t) {
50
- return this._promise.then(e, t);
51
- }
52
- catch(e) {
53
- return this._promise.catch(e);
54
- }
55
- finally(e) {
56
- return this._promise.finally(e);
57
- }
58
- }, j = { timeout: 1e4 }, L = class {
38
+ var B = class extends Promise {
39
+ static get [Symbol.species]() {
40
+ return Promise;
41
+ }
42
+ resolve;
43
+ reject;
44
+ constructor(e = () => {
45
+ }) {
46
+ let t, i;
47
+ super((r, a) => {
48
+ t = r, i = a, e(r, a);
49
+ }), this.resolve = t, this.reject = i;
50
+ }
51
+ }, U = { timeout: 1e4 };
52
+ function H(e) {
53
+ const t = JSON.stringify(e, Object.getOwnPropertyNames(e)), i = JSON.parse(t);
54
+ return i.message === void 0 || i.message === "" ? JSON.stringify({
55
+ message: e instanceof Error ? e.message : String(e),
56
+ name: e instanceof Error ? e.name : void 0
57
+ }) : t;
58
+ }
59
+ var D = class {
59
60
  promisesByID = {};
60
61
  receiversByName = {};
61
62
  currentID = 0;
@@ -63,7 +64,7 @@ var R = () => {
63
64
  postMessage;
64
65
  constructor(e, t) {
65
66
  this.postMessage = e, this.config = {
66
- ...j,
67
+ ...U,
67
68
  ...t
68
69
  };
69
70
  }
@@ -77,7 +78,7 @@ var R = () => {
77
78
  return this.callWithOptions(e, {}, ...t);
78
79
  }
79
80
  callWithOptions(e, t, ...i) {
80
- const r = this.currentID++, a = new U(), n = t.timeout ?? this.config.timeout, o = setTimeout(() => {
81
+ const r = this.currentID++, a = new B(), n = t.timeout ?? this.config.timeout, o = setTimeout(() => {
81
82
  if (r in this.promisesByID) {
82
83
  const l = /* @__PURE__ */ new Error(`IPC call timeout: "${e}" did not respond within ${String(n)}ms`);
83
84
  a.reject(l), Reflect.deleteProperty(this.promisesByID, r);
@@ -117,43 +118,37 @@ var R = () => {
117
118
  }
118
119
  async handleCall(e) {
119
120
  const { id: t, name: i, data: r } = e;
120
- if (i in this.receiversByName) {
121
- const a = this.receiversByName[i];
122
- try {
123
- if (!Array.isArray(r)) throw new Error(`IPC: Expected array of arguments but got ${typeof r}`);
124
- const n = await a(...r), o = {
125
- type: "response",
126
- id: t,
127
- name: i,
128
- data: n
129
- };
130
- this.postMessage(o);
131
- } catch (n) {
132
- let o = JSON.stringify(n, Object.getOwnPropertyNames(n));
133
- const s = JSON.parse(o);
134
- (s.message === void 0 || s.message === "") && (o = JSON.stringify({
135
- message: n instanceof Error ? n.message : String(n),
136
- name: n instanceof Error ? n.name : void 0
137
- }));
138
- const l = {
139
- type: "error",
140
- id: t,
141
- name: i,
142
- errorJSON: o
143
- };
144
- this.postMessage(l);
145
- }
146
- } else {
147
- const a = /* @__PURE__ */ new Error(`No receiver registered for: ${i}`), n = {
121
+ if (!(i in this.receiversByName)) {
122
+ const n = /* @__PURE__ */ new Error(`No receiver registered for: ${i}`), o = JSON.stringify({
123
+ message: n.message,
124
+ name: n.name
125
+ });
126
+ this.postMessage({
127
+ type: "error",
128
+ id: t,
129
+ name: i,
130
+ errorJSON: o
131
+ });
132
+ return;
133
+ }
134
+ const a = this.receiversByName[i];
135
+ try {
136
+ if (!Array.isArray(r)) throw new TypeError(`IPC: Expected array of arguments but got ${typeof r}`);
137
+ const n = await a(...r), o = {
138
+ type: "response",
139
+ id: t,
140
+ name: i,
141
+ data: n
142
+ };
143
+ this.postMessage(o);
144
+ } catch (n) {
145
+ const o = {
148
146
  type: "error",
149
147
  id: t,
150
148
  name: i,
151
- errorJSON: JSON.stringify({
152
- message: a.message,
153
- name: a.name
154
- })
149
+ errorJSON: H(n)
155
150
  };
156
- this.postMessage(n);
151
+ this.postMessage(o);
157
152
  }
158
153
  }
159
154
  handleResponse(e) {
@@ -169,7 +164,7 @@ var R = () => {
169
164
  const { promise: r, timeoutId: a } = this.promisesByID[t];
170
165
  clearTimeout(a);
171
166
  try {
172
- const n = H(JSON.parse(i));
167
+ const n = N(JSON.parse(i));
173
168
  r.reject(n);
174
169
  } catch {
175
170
  r.reject(/* @__PURE__ */ new Error("Failed to parse error from IPC"));
@@ -182,12 +177,12 @@ var R = () => {
182
177
  clearTimeout(t), e.reject(/* @__PURE__ */ new Error("IPC destroyed"));
183
178
  this.promisesByID = {}, this.receiversByName = {};
184
179
  }
185
- }, F = class {
180
+ }, j = class {
186
181
  ipc;
187
182
  sidebar;
188
183
  targetOrigin;
189
184
  constructor(e, t, i = "*") {
190
- this.sidebar = e || {}, this.targetOrigin = i, this.ipc = new L((r) => {
185
+ this.sidebar = e || {}, this.targetOrigin = i, this.ipc = new D((r) => {
191
186
  window.parent.postMessage(r, this.targetOrigin);
192
187
  }, t), window.addEventListener("message", this.handleMessage), this.registerReceivers();
193
188
  }
@@ -273,6 +268,9 @@ var R = () => {
273
268
  async openAuthUrl(e) {
274
269
  await this.ipc.call("openAuthUrl", e);
275
270
  }
271
+ async copyToClipboard(e) {
272
+ await this.ipc.call("copyToClipboard", e);
273
+ }
276
274
  async onIntegrationSettingsChange(e, t) {
277
275
  await this.ipc.call("onIntegrationSettingsChange", e, t);
278
276
  }
@@ -295,10 +293,10 @@ var R = () => {
295
293
  destroy() {
296
294
  window.removeEventListener("message", this.handleMessage), this.ipc.destroy();
297
295
  }
298
- }, ge = class {
296
+ }, de = class {
299
297
  ipcAdapter;
300
298
  constructor(e, t, i) {
301
- this.ipcAdapter = new F(e, t, i);
299
+ this.ipcAdapter = new j(e, t, i);
302
300
  }
303
301
  destroy() {
304
302
  this.ipcAdapter.destroy();
@@ -339,6 +337,9 @@ var R = () => {
339
337
  openAuthUrl(e) {
340
338
  return this.ipcAdapter.openAuthUrl(e);
341
339
  }
340
+ copyToClipboard(e) {
341
+ return this.ipcAdapter.copyToClipboard(e);
342
+ }
342
343
  onIntegrationSettingsChange(e, t) {
343
344
  return this.ipcAdapter.onIntegrationSettingsChange(e, t);
344
345
  }
@@ -351,14 +352,14 @@ var R = () => {
351
352
  getTargetOrigin() {
352
353
  return this.ipcAdapter.getTargetOrigin();
353
354
  }
354
- }, $ = class {
355
+ }, F = class {
355
356
  ipc;
356
357
  plugin;
357
358
  iframe;
358
359
  window;
359
360
  targetOrigin;
360
361
  constructor(e, t, i, r, a = "*") {
361
- this.plugin = e, this.iframe = t, this.window = i ?? window, this.targetOrigin = a, this.ipc = new L((n) => {
362
+ this.plugin = e, this.iframe = t, this.window = i ?? window, this.targetOrigin = a, this.ipc = new D((n) => {
362
363
  this.iframe.contentWindow?.postMessage(n, this.targetOrigin);
363
364
  }, r), this.window.addEventListener("message", this.handleMessage, !1), this.registerReceivers();
364
365
  }
@@ -372,8 +373,10 @@ var R = () => {
372
373
  }), this.ipc.receive("selectContent", async (e) => {
373
374
  await this.plugin.selectContent(e);
374
375
  }), this.ipc.receive("showDialog", async (e, t, i, r) => {
376
+ if (!this.plugin.showDialog) throw new Error("SidebarIPCAdapter: host does not implement showDialog");
375
377
  await this.plugin.showDialog(e, t, i, r);
376
378
  }), this.ipc.receive("closeDialog", async () => {
379
+ if (!this.plugin.closeDialog) throw new Error("SidebarIPCAdapter: host does not implement closeDialog");
377
380
  await this.plugin.closeDialog();
378
381
  }), this.ipc.receive("replaceMultipleContents", async (e) => {
379
382
  await this.plugin.replaceMultipleContents(e);
@@ -398,6 +401,12 @@ var R = () => {
398
401
  await e(t);
399
402
  });
400
403
  }
404
+ if (this.plugin.copyToClipboard) {
405
+ const e = this.plugin.copyToClipboard;
406
+ this.ipc.receive("copyToClipboard", async (t) => {
407
+ await e(t);
408
+ });
409
+ }
401
410
  if (this.plugin.onIntegrationSettingsChange) {
402
411
  const e = this.plugin.onIntegrationSettingsChange;
403
412
  this.ipc.receive("onIntegrationSettingsChange", async (t, i) => {
@@ -432,10 +441,10 @@ var R = () => {
432
441
  destroy() {
433
442
  this.window.removeEventListener("message", this.handleMessage), this.ipc.destroy();
434
443
  }
435
- }, W = class {
444
+ }, $ = class {
436
445
  ipcAdapter;
437
446
  constructor(e, t, i) {
438
- this.ipcAdapter = new $(e, t, i?.win, i?.config, i?.targetOrigin);
447
+ this.ipcAdapter = new F(e, t, i?.win, i?.config, i?.targetOrigin);
439
448
  }
440
449
  destroy() {
441
450
  this.ipcAdapter.destroy();
@@ -464,7 +473,7 @@ var R = () => {
464
473
  configure(e) {
465
474
  this.ipcAdapter.configure(e);
466
475
  }
467
- }, G = `
476
+ }, W = `
468
477
  <div class="sidebar-load-overlay-card">
469
478
  <div class="sidebar-load-overlay-title">Sidebar failed to load</div>
470
479
  <div class="sidebar-load-overlay-description">Check your connection or try again.</div>
@@ -487,14 +496,14 @@ var R = () => {
487
496
  </div>
488
497
  `, z = () => {
489
498
  const e = document.createElement("div");
490
- e.className = "sidebar-load-overlay", e.style.display = "none", e.innerHTML = G;
499
+ e.className = "sidebar-load-overlay", e.style.display = "none", e.innerHTML = W;
491
500
  const t = e.querySelector(".sidebar-load-overlay-button");
492
501
  if (!t) throw new Error("Missing retry button in load overlay template.");
493
502
  return {
494
503
  overlay: e,
495
504
  button: t
496
505
  };
497
- }, O = "markupai-sidebar-load-overlay-styles", J = `
506
+ }, E = "markupai-sidebar-load-overlay-styles", G = `
498
507
  :root {
499
508
  --background: #f5f5f4;
500
509
  --foreground: #333332;
@@ -586,55 +595,55 @@ var R = () => {
586
595
  box-shadow: 0 0 0 2px
587
596
  color-mix(in srgb, var(--accent, #ef4640) 60%, transparent);
588
597
  }
589
- `, X = (e) => {
598
+ `, J = (e) => {
590
599
  const t = e ?? document;
591
- if (t.getElementById(O)) return;
600
+ if (t.getElementById(E)) return;
592
601
  const i = t.createElement("style");
593
- i.id = O, i.textContent = J, t.head.appendChild(i);
602
+ i.id = E, i.textContent = G, t.head.appendChild(i);
594
603
  }, Y = 8e3, V = 12e3, K = (e, t, i = {}) => {
595
- X(e.ownerDocument);
596
- const { sidebarUrl: r, targetOrigin: a, timeoutMs: n = Y, retryIntervalMs: o = V, messageListenWindow: s } = i, l = s ?? (typeof globalThis.window < "u" ? globalThis.window : globalThis), p = () => r ?? t.src, N = () => {
604
+ J(e.ownerDocument);
605
+ const { sidebarUrl: r, targetOrigin: a, timeoutMs: n = Y, retryIntervalMs: o = V, messageListenWindow: s } = i, l = s ?? (typeof globalThis.window < "u" ? globalThis.window : globalThis), p = () => r ?? t.src, _ = () => {
597
606
  if (a) return a;
598
607
  try {
599
608
  return new URL(p()).origin;
600
609
  } catch {
601
610
  return "*";
602
611
  }
603
- }, { overlay: I, button: v } = z();
604
- e.appendChild(I);
605
- let u = !1, h, g;
606
- const d = (c) => {
607
- I.style.display = c ? "flex" : "none";
612
+ }, { overlay: m, button: I } = z();
613
+ e.appendChild(m);
614
+ let u = !1, h, d;
615
+ const g = (c) => {
616
+ m.style.display = c ? "flex" : "none";
608
617
  };
609
- d(!1);
618
+ g(!1);
610
619
  const f = () => {
611
620
  h && (globalThis.clearTimeout(h), h = void 0);
612
- }, A = () => {
621
+ }, v = () => {
613
622
  f(), h = globalThis.setTimeout(() => {
614
- u || d(!0);
623
+ u || g(!0);
615
624
  }, n);
616
- }, C = (c) => {
617
- const m = c?.preserveOverlay ?? !0;
618
- u = !1, m || d(!1), t.src = p(), A();
619
- }, B = () => {
620
- g || o <= 0 || (g = globalThis.setInterval(() => {
621
- u || C({ preserveOverlay: !0 });
625
+ }, A = (c) => {
626
+ const y = c?.preserveOverlay ?? !0;
627
+ u = !1, y || g(!1), t.src = p(), v();
628
+ }, k = () => {
629
+ d || o <= 0 || (d = globalThis.setInterval(() => {
630
+ u || A({ preserveOverlay: !0 });
622
631
  }, o));
623
- }, b = () => {
624
- g && (globalThis.clearInterval(g), g = void 0);
625
- }, S = (c) => {
632
+ }, C = () => {
633
+ d && (globalThis.clearInterval(d), d = void 0);
634
+ }, b = (c) => {
626
635
  if (!t.contentWindow || c.source !== t.contentWindow) return;
627
- const m = N();
628
- m !== "*" && c.origin !== m || (u = !0, f(), b(), d(!1));
636
+ const y = _();
637
+ y !== "*" && c.origin !== y || (u = !0, f(), C(), g(!1));
629
638
  }, w = () => {
630
- f(), d(!0);
631
- }, P = () => {
632
- C();
639
+ f(), g(!0);
640
+ }, S = () => {
641
+ A();
633
642
  };
634
- return v.addEventListener("click", P), t.addEventListener("error", w), l.addEventListener("message", S), A(), B(), () => {
635
- f(), b(), t.removeEventListener("error", w), l.removeEventListener("message", S), v.removeEventListener("click", P), I.remove();
643
+ return I.addEventListener("click", S), t.addEventListener("error", w), l.addEventListener("message", b), v(), k(), () => {
644
+ f(), C(), t.removeEventListener("error", w), l.removeEventListener("message", b), I.removeEventListener("click", S), m.remove();
636
645
  };
637
- }, q = "Markup AI Sidebar", Z = "clipboard-read; clipboard-write", de = "markupai.sidebarNextGen.overrideUrl", pe = "https://sidebar.markup.ai/";
646
+ }, X = "Markup AI Sidebar", q = "clipboard-read; clipboard-write", ge = "markupai.sidebarNextGen.overrideUrl", pe = "https://sidebar.markup.ai/";
638
647
  function ue(e) {
639
648
  try {
640
649
  return "localStorage" in globalThis && globalThis.localStorage.getItem("markupai.sidebarNextGen.overrideUrl")?.trim() || e;
@@ -642,12 +651,12 @@ function ue(e) {
642
651
  return e;
643
652
  }
644
653
  }
645
- var Q = "markupai.sidebarNextGen.authOverride";
654
+ var Z = "markupai.sidebarNextGen.authOverride";
646
655
  function he(e, t) {
647
656
  if (!t) return e;
648
657
  try {
649
658
  if (!("localStorage" in globalThis)) return e;
650
- const i = globalThis.localStorage.getItem(Q)?.trim();
659
+ const i = globalThis.localStorage.getItem(Z)?.trim();
651
660
  if (!i) return e;
652
661
  const r = JSON.parse(i);
653
662
  return r !== null && typeof r == "object" && "type" in r && (r.type === "mediation" || r.type === "popup") ? r : e;
@@ -662,10 +671,10 @@ function fe(e, t) {
662
671
  return t?.onInvalidUrl?.(e, i), "*";
663
672
  }
664
673
  }
665
- function me(e, t = "Expected SidebarAdapter from createSidebarHost") {
674
+ function ye(e, t = "Expected SidebarAdapter from createSidebarHost") {
666
675
  if (e.adapter === null) throw new Error(t);
667
676
  }
668
- function ee(e) {
677
+ function Q(e) {
669
678
  const { iframe: t, iframeMount: i } = e;
670
679
  if (t !== void 0 && i !== void 0) throw new Error("createSidebarHost: pass only one of `iframe` or `iframeMount`");
671
680
  if (t !== void 0) return {
@@ -673,18 +682,18 @@ function ee(e) {
673
682
  removeMountedIframe: null
674
683
  };
675
684
  if (i === void 0) throw new Error("createSidebarHost: pass either `iframe` or `iframeMount`");
676
- const { container: r, src: a, allow: n = Z } = i, o = document.createElement("iframe");
677
- return o.title = q, o.src = a, n && o.setAttribute("allow", n), r.appendChild(o), {
685
+ const { container: r, src: a, allow: n = q } = i, o = document.createElement("iframe");
686
+ return o.title = X, o.src = a, n && o.setAttribute("allow", n), r.appendChild(o), {
678
687
  iframe: o,
679
688
  removeMountedIframe: () => {
680
689
  o.remove();
681
690
  }
682
691
  };
683
692
  }
684
- function ye(e) {
685
- const { plugin: t, loadOverlayContainer: i, loadOverlayOptions: r, adapterOptions: a } = e, { iframe: n, removeMountedIframe: o } = ee(e), s = i !== void 0 ? K(i, n, r ?? {}) : null;
693
+ function me(e) {
694
+ const { plugin: t, loadOverlayContainer: i, loadOverlayOptions: r, adapterOptions: a } = e, { iframe: n, removeMountedIframe: o } = Q(e), s = i !== void 0 ? K(i, n, r ?? {}) : null;
686
695
  if (t !== void 0) {
687
- const l = new W(t, n, a);
696
+ const l = new $(t, n, a);
688
697
  return {
689
698
  iframe: n,
690
699
  adapter: l,
@@ -701,14 +710,14 @@ function ye(e) {
701
710
  }
702
711
  };
703
712
  }
704
- var M = "sidebarContainer", T = "markupai-sidebar-host-shell-styles";
705
- function x(e) {
713
+ var x = "sidebarContainer", R = "markupai-sidebar-host-shell-styles";
714
+ function L(e) {
706
715
  if (typeof CSS < "u" && typeof CSS.escape == "function") return CSS.escape(e);
707
716
  if (!/^[a-zA-Z_][\w-]*$/.test(e)) throw new Error(`sidebar host shell: containerId must match /^[a-zA-Z_][\\w-]*$/ when CSS.escape is unavailable (got ${JSON.stringify(e)})`);
708
717
  return e;
709
718
  }
710
- function k(e = M) {
711
- const t = x(e);
719
+ function M(e = x) {
720
+ const t = L(e);
712
721
  return `
713
722
  html {
714
723
  height: 100%;
@@ -733,21 +742,21 @@ body {
733
742
  }
734
743
  `.trim();
735
744
  }
736
- var Ie = k();
737
- function te(e) {
745
+ var Ie = M();
746
+ function ee(e) {
738
747
  return e instanceof Document ? e : e.ownerDocument;
739
748
  }
740
- function ie(e, t, i) {
741
- if (!t || e.getElementById(T)) return;
749
+ function te(e, t, i) {
750
+ if (!t || e.getElementById(R)) return;
742
751
  const r = e.createElement("style");
743
- r.id = T, r.textContent = k(i), e.head.appendChild(r);
752
+ r.id = R, r.textContent = M(i), e.head.appendChild(r);
744
753
  }
745
754
  function ve(e) {
746
- const { root: t = typeof document < "u" ? document : void 0, containerId: i = M, includeDefaultStyles: r = !0 } = e ?? {};
755
+ const { root: t = typeof document < "u" ? document : void 0, containerId: i = x, includeDefaultStyles: r = !0 } = e ?? {};
747
756
  if (t === void 0) throw new Error("ensureSidebarHostShell: no document — pass `root` in non-browser environments");
748
- const a = te(t);
749
- ie(a, r, i);
750
- const n = t instanceof Document ? a.getElementById(i) : t.querySelector(`#${x(i)}`);
757
+ const a = ee(t);
758
+ te(a, r, i);
759
+ const n = t instanceof Document ? a.getElementById(i) : t.querySelector(`#${L(i)}`);
751
760
  if (n instanceof HTMLElement && (t instanceof Document || t.contains(n))) return n;
752
761
  if (!(t instanceof Document)) {
753
762
  const s = a.createElement("div");
@@ -756,18 +765,18 @@ function ve(e) {
756
765
  const o = a.createElement("div");
757
766
  return o.id = i, a.body.appendChild(o), o;
758
767
  }
759
- function re() {
768
+ function ie() {
760
769
  return ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />';
761
770
  }
762
771
  function Ae(e) {
763
- const { title: t = "Markup AI Sidebar", headInnerHtml: i = "", includePluginHostHead: r = !1, bodyScriptsHtml: a, htmlLang: n = "en", htmlAttrs: o = `lang="${n}" style="height:100%"`, bodyAttrs: s = 'style="height:100%;margin:0"' } = e, l = [r ? re() : "", i].filter((p) => p.trim().length > 0).join(`
772
+ const { title: t = "Markup AI Sidebar", headInnerHtml: i = "", includePluginHostHead: r = !1, bodyScriptsHtml: a, htmlLang: n = "en", htmlAttrs: o = `lang="${n}" style="height:100%"`, bodyAttrs: s = 'style="height:100%;margin:0"' } = e, l = [r ? ie() : "", i].filter((p) => p.trim().length > 0).join(`
764
773
  `);
765
774
  return `<!DOCTYPE html>
766
775
  <html ${o}>
767
776
  <head>
768
777
  <base target="_top" />
769
778
  <meta charset="UTF-8" />
770
- <title>${ne(t)}</title>${l ? `
779
+ <title>${re(t)}</title>${l ? `
771
780
  ${l}` : ""}
772
781
  </head>
773
782
  <body ${s}>
@@ -776,41 +785,41 @@ ${l}` : ""}
776
785
  </html>
777
786
  `;
778
787
  }
779
- function ne(e) {
788
+ function re(e) {
780
789
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
781
790
  }
782
791
  export {
783
- Q as AUTH_CONFIG_OVERRIDE_STORAGE_KEY,
784
- j as DEFAULT_IPC_CONFIG,
792
+ Z as AUTH_CONFIG_OVERRIDE_STORAGE_KEY,
793
+ U as DEFAULT_IPC_CONFIG,
785
794
  oe as DEFAULT_SIDEBAR_CONFIG,
786
- U as DeferredPromise,
787
- L as IPCCore,
788
- y as MimeType,
789
- ge as PluginAdapter,
790
- F as PluginIPCAdapter,
795
+ B as DeferredPromise,
796
+ D as IPCCore,
797
+ ne as MimeType,
798
+ de as PluginAdapter,
799
+ j as PluginIPCAdapter,
791
800
  pe as SIDEBAR_DEFAULT_PRODUCTION_BASE_URL,
792
- M as SIDEBAR_HOST_CONTAINER_ID,
801
+ x as SIDEBAR_HOST_CONTAINER_ID,
793
802
  Ie as SIDEBAR_HOST_SHELL_CSS,
794
- Z as SIDEBAR_IFRAME_DEFAULT_ALLOW,
795
- q as SIDEBAR_IFRAME_DEFAULT_TITLE,
796
- de as SIDEBAR_URL_OVERRIDE_STORAGE_KEY,
797
- W as SidebarAdapter,
798
- $ as SidebarIPCAdapter,
803
+ q as SIDEBAR_IFRAME_DEFAULT_ALLOW,
804
+ X as SIDEBAR_IFRAME_DEFAULT_TITLE,
805
+ ge as SIDEBAR_URL_OVERRIDE_STORAGE_KEY,
806
+ $ as SidebarAdapter,
807
+ F as SidebarIPCAdapter,
799
808
  ae as TEXT_MIME_TYPES,
800
- D as TextLookupError,
801
- me as assertSidebarHostAdapter,
809
+ T as TextLookupError,
810
+ ye as assertSidebarHostAdapter,
802
811
  Ae as buildSidebarHostHtmlDocument,
803
- k as buildSidebarHostShellCss,
804
- re as buildSidebarPluginHostHeadInnerHtml,
805
- ye as createSidebarHost,
812
+ M as buildSidebarHostShellCss,
813
+ ie as buildSidebarPluginHostHeadInnerHtml,
814
+ me as createSidebarHost,
806
815
  ve as ensureSidebarHostShell,
807
816
  he as getAuthConfigWithOverride,
808
817
  ue as getSidebarBaseUrlWithOverride,
809
- E as ipcErrorReconstructors,
818
+ P as ipcErrorReconstructors,
810
819
  le as isIntegrationSettingField,
811
820
  se as isIntegrationSettingsSchema,
812
821
  ce as isTextLookupError,
813
- H as reconstructError,
822
+ N as reconstructError,
814
823
  K as setupSidebarLoadOverlay,
815
824
  fe as sidebarPostMessageTargetOrigin
816
825
  };