pushfeedback 0.0.2 → 0.0.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.
@@ -2,14 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-cb138587.js');
5
+ const index = require('./index-df770657.js');
6
6
 
7
- const feedbackButtonCss = ".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";
7
+ const feedbackButtonCss = ".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);padding:5px 10px;font-size:var(--feedback-modal-button-font-size)}.feedback-button-content--light:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";
8
8
 
9
9
  const FeedbackButton = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
- this.feedbackModal = undefined;
13
12
  this.modalTitle = 'Share your feedback';
14
13
  this.successModalTitle = 'Thanks for your feedback!';
15
14
  this.errorModalTitle = "Oops! We didn't receive your feedback. Please try again later.";
@@ -21,15 +20,11 @@ const FeedbackButton = class {
21
20
  this.email = '';
22
21
  this.emailPlaceholder = 'Email address (optional)';
23
22
  this.messagePlaceholder = 'How could this page be more helpful?';
23
+ this.buttonStyle = 'default';
24
24
  }
25
- componentDidLoad() {
26
- this.feedbackModal.showModal = false;
27
- }
28
- showModal() {
29
- this.feedbackModal.showModal = true;
30
- }
31
- render() {
32
- const propKeys = [
25
+ connectedCallback() {
26
+ this.feedbackModal = document.createElement('feedback-modal');
27
+ const props = [
33
28
  'modalTitle',
34
29
  'successModalTitle',
35
30
  'errorModalTitle',
@@ -41,13 +36,20 @@ const FeedbackButton = class {
41
36
  'email',
42
37
  'emailPlaceholder',
43
38
  'messagePlaceholder',
44
- 'showModal',
45
39
  ];
46
- let feedbackModalProps = {};
47
- propKeys.forEach((key) => {
48
- feedbackModalProps[key] = this[key];
40
+ props.forEach(prop => {
41
+ this.feedbackModal[prop] = this[prop];
49
42
  });
50
- return (index.h(index.Host, null, index.h("a", { class: "feedback-button-content", onClick: () => this.showModal() }, index.h("slot", null)), index.h("feedback-modal", Object.assign({}, feedbackModalProps, { ref: (el) => this.feedbackModal = el }))));
43
+ document.body.appendChild(this.feedbackModal);
44
+ }
45
+ disconnectedCallback() {
46
+ document.body.removeChild(this.feedbackModal);
47
+ }
48
+ showModal() {
49
+ this.feedbackModal.showModal = true;
50
+ }
51
+ render() {
52
+ return (index.h(index.Host, null, index.h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle}`, onClick: () => this.showModal() }, index.h("slot", null))));
51
53
  }
52
54
  };
53
55
  FeedbackButton.style = feedbackButtonCss;
@@ -49,7 +49,6 @@ const uniqueTime = (key, measureText) => {
49
49
  }
50
50
  };
51
51
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
52
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
53
52
  /**
54
53
  * Default style mode id
55
54
  */
@@ -93,7 +92,6 @@ function queryNonceMetaTagContent(doc) {
93
92
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
94
93
  const h = (nodeName, vnodeData, ...children) => {
95
94
  let child = null;
96
- let key = null;
97
95
  let simple = false;
98
96
  let lastSimple = false;
99
97
  const vNodeChildren = [];
@@ -121,10 +119,6 @@ const h = (nodeName, vnodeData, ...children) => {
121
119
  };
122
120
  walk(children);
123
121
  if (vnodeData) {
124
- // normalize class / classname attributes
125
- if (vnodeData.key) {
126
- key = vnodeData.key;
127
- }
128
122
  {
129
123
  const classData = vnodeData.className || vnodeData.class;
130
124
  if (classData) {
@@ -142,9 +136,6 @@ const h = (nodeName, vnodeData, ...children) => {
142
136
  if (vNodeChildren.length > 0) {
143
137
  vnode.$children$ = vNodeChildren;
144
138
  }
145
- {
146
- vnode.$key$ = key;
147
- }
148
139
  return vnode;
149
140
  };
150
141
  /**
@@ -166,9 +157,6 @@ const newVNode = (tag, text) => {
166
157
  {
167
158
  vnode.$attrs$ = null;
168
159
  }
169
- {
170
- vnode.$key$ = null;
171
- }
172
160
  return vnode;
173
161
  };
174
162
  const Host = {};
@@ -329,33 +317,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
329
317
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
330
318
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
331
319
  }
332
- else if (memberName === 'style') {
333
- // update style attribute, css properties and values
334
- {
335
- for (const prop in oldValue) {
336
- if (!newValue || newValue[prop] == null) {
337
- if (prop.includes('-')) {
338
- elm.style.removeProperty(prop);
339
- }
340
- else {
341
- elm.style[prop] = '';
342
- }
343
- }
344
- }
345
- }
346
- for (const prop in newValue) {
347
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
348
- if (prop.includes('-')) {
349
- elm.style.setProperty(prop, newValue[prop]);
350
- }
351
- else {
352
- elm.style[prop] = newValue[prop];
353
- }
354
- }
355
- }
356
- }
357
- else if (memberName === 'key')
358
- ;
359
320
  else if (memberName === 'ref') {
360
321
  // minifier will clean this up
361
322
  if (newValue) {
@@ -422,36 +383,16 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
422
383
  }
423
384
  catch (e) { }
424
385
  }
425
- /**
426
- * Need to manually update attribute if:
427
- * - memberName is not an attribute
428
- * - if we are rendering the host element in order to reflect attribute
429
- * - if it's a SVG, since properties might not work in <svg>
430
- * - if the newValue is null/undefined or 'false'.
431
- */
432
- let xlink = false;
433
- {
434
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
435
- memberName = ln;
436
- xlink = true;
437
- }
438
- }
439
386
  if (newValue == null || newValue === false) {
440
387
  if (newValue !== false || elm.getAttribute(memberName) === '') {
441
- if (xlink) {
442
- elm.removeAttributeNS(XLINK_NS, memberName);
443
- }
444
- else {
388
+ {
445
389
  elm.removeAttribute(memberName);
446
390
  }
447
391
  }
448
392
  }
449
393
  else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
450
394
  newValue = newValue === true ? '' : newValue;
451
- if (xlink) {
452
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
453
- }
454
- else {
395
+ {
455
396
  elm.setAttribute(memberName, newValue);
456
397
  }
457
398
  }
@@ -670,8 +611,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
670
611
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
671
612
  let oldStartIdx = 0;
672
613
  let newStartIdx = 0;
673
- let idxInOld = 0;
674
- let i = 0;
675
614
  let oldEndIdx = oldCh.length - 1;
676
615
  let oldStartVnode = oldCh[0];
677
616
  let oldEndVnode = oldCh[oldEndIdx];
@@ -679,7 +618,6 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
679
618
  let newStartVnode = newCh[0];
680
619
  let newEndVnode = newCh[newEndIdx];
681
620
  let node;
682
- let elmToMove;
683
621
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
684
622
  if (oldStartVnode == null) {
685
623
  // VNode might have been moved left
@@ -746,41 +684,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
746
684
  newStartVnode = newCh[++newStartIdx];
747
685
  }
748
686
  else {
749
- // Here we do some checks to match up old and new nodes based on the
750
- // `$key$` attribute, which is set by putting a `key="my-key"` attribute
751
- // in the JSX for a DOM element in the implementation of a Stencil
752
- // component.
753
- //
754
- // First we check to see if there are any nodes in the array of old
755
- // children which have the same key as the first node in the new
756
- // children.
757
- idxInOld = -1;
758
687
  {
759
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
760
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
761
- idxInOld = i;
762
- break;
763
- }
764
- }
765
- }
766
- if (idxInOld >= 0) {
767
- // We found a node in the old children which matches up with the first
768
- // node in the new children! So let's deal with that
769
- elmToMove = oldCh[idxInOld];
770
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
771
- // the tag doesn't match so we'll need a new DOM element
772
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
773
- }
774
- else {
775
- patch(elmToMove, newStartVnode);
776
- // invalidate the matching old node so that we won't try to update it
777
- // again later on
778
- oldCh[idxInOld] = undefined;
779
- node = elmToMove.$elm$;
780
- }
781
- newStartVnode = newCh[++newStartIdx];
782
- }
783
- else {
784
688
  // We either didn't find an element in the old children that matches
785
689
  // the key of the first new child OR the build is not using `key`
786
690
  // attributes at all. In either case we need to create a new element
@@ -829,10 +733,7 @@ const isSameVnode = (leftVNode, rightVNode) => {
829
733
  // compare if two vnode to see if they're "technically" the same
830
734
  // need to have the same element tag, and same key to be the same
831
735
  if (leftVNode.$tag$ === rightVNode.$tag$) {
832
- // this will be set if components in the build have `key` attrs set on them
833
- {
834
- return leftVNode.$key$ === rightVNode.$key$;
835
- }
736
+ return true;
836
737
  }
837
738
  return false;
838
739
  };
@@ -1028,7 +929,6 @@ const postUpdateComponent = (hostRef) => {
1028
929
  const tagName = hostRef.$cmpMeta$.$tagName$;
1029
930
  const elm = hostRef.$hostElement$;
1030
931
  const endPostUpdate = createTime('postUpdate', tagName);
1031
- const instance = hostRef.$lazyInstance$ ;
1032
932
  const ancestorComponent = hostRef.$ancestorComponent$;
1033
933
  if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1034
934
  hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
@@ -1036,9 +936,6 @@ const postUpdateComponent = (hostRef) => {
1036
936
  // DOM WRITE!
1037
937
  addHydratedFlag(elm);
1038
938
  }
1039
- {
1040
- safeCall(instance, 'componentDidLoad');
1041
- }
1042
939
  endPostUpdate();
1043
940
  {
1044
941
  hostRef.$onReadyResolve$(elm);
@@ -1259,6 +1156,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1259
1156
  hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1260
1157
  }
1261
1158
  endNewInstance();
1159
+ fireConnectedCallback(hostRef.$lazyInstance$);
1262
1160
  }
1263
1161
  if (Cstr.style) {
1264
1162
  // this component has styles but we haven't registered them yet
@@ -1287,6 +1185,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1287
1185
  schedule();
1288
1186
  }
1289
1187
  };
1188
+ const fireConnectedCallback = (instance) => {
1189
+ {
1190
+ safeCall(instance, 'connectedCallback');
1191
+ }
1192
+ };
1290
1193
  const connectedCallback = (elm) => {
1291
1194
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1292
1195
  const hostRef = getHostRef(elm);
@@ -1325,12 +1228,20 @@ const connectedCallback = (elm) => {
1325
1228
  initializeComponent(elm, hostRef, cmpMeta);
1326
1229
  }
1327
1230
  }
1231
+ else {
1232
+ // fire off connectedCallback() on component instance
1233
+ fireConnectedCallback(hostRef.$lazyInstance$);
1234
+ }
1328
1235
  endConnected();
1329
1236
  }
1330
1237
  };
1331
1238
  const disconnectedCallback = (elm) => {
1332
1239
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1333
- getHostRef(elm);
1240
+ const hostRef = getHostRef(elm);
1241
+ const instance = hostRef.$lazyInstance$ ;
1242
+ {
1243
+ safeCall(instance, 'disconnectedCallback');
1244
+ }
1334
1245
  }
1335
1246
  };
1336
1247
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-cb138587.js');
5
+ const index = require('./index-df770657.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"feedbackModal":[32]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
17
+ return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-cb138587.js');
5
+ const index = require('./index-df770657.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"feedbackModal":[32]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
20
+ return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "entries": [
3
- "./components/feedback-modal/feedback-modal.js",
4
- "./components/feedback-button/feedback-button.js"
3
+ "./components/feedback-button/feedback-button.js",
4
+ "./components/feedback-modal/feedback-modal.js"
5
5
  ],
6
6
  "compiler": {
7
7
  "name": "@stencil/core",
@@ -1,15 +1,17 @@
1
1
  .feedback-button-content {
2
2
  cursor: pointer;
3
+ }
4
+
5
+ .feedback-button-content--light{
3
6
  background-color: var(--feedback-button-bg-color);
4
7
  border: 1px solid var(--feedback-button-border-color);
5
8
  border-radius: var(--feedback-button-border-radius);
6
9
  color: var(--feedback-button-text-color);
7
- cursor: pointer;
8
- font-size: var(--feedback-modal-button-font-size);
9
10
  padding: 5px 10px;
11
+ font-size: var(--feedback-modal-button-font-size);
10
12
  }
11
13
 
12
- .feedback-button-content:hover {
14
+ .feedback-button-content--light:hover {
13
15
  color: var(--feedback-button-text-color-active);
14
16
  background-color: var(--feedback-button-bg-color-active);
15
17
  border: 1px solid var(--feedback-button-border-color-active);
@@ -1,7 +1,6 @@
1
1
  import { Host, h } from '@stencil/core';
2
2
  export class FeedbackButton {
3
3
  constructor() {
4
- this.feedbackModal = undefined;
5
4
  this.modalTitle = 'Share your feedback';
6
5
  this.successModalTitle = 'Thanks for your feedback!';
7
6
  this.errorModalTitle = "Oops! We didn't receive your feedback. Please try again later.";
@@ -13,15 +12,11 @@ export class FeedbackButton {
13
12
  this.email = '';
14
13
  this.emailPlaceholder = 'Email address (optional)';
15
14
  this.messagePlaceholder = 'How could this page be more helpful?';
15
+ this.buttonStyle = 'default';
16
16
  }
17
- componentDidLoad() {
18
- this.feedbackModal.showModal = false;
19
- }
20
- showModal() {
21
- this.feedbackModal.showModal = true;
22
- }
23
- render() {
24
- const propKeys = [
17
+ connectedCallback() {
18
+ this.feedbackModal = document.createElement('feedback-modal');
19
+ const props = [
25
20
  'modalTitle',
26
21
  'successModalTitle',
27
22
  'errorModalTitle',
@@ -33,13 +28,20 @@ export class FeedbackButton {
33
28
  'email',
34
29
  'emailPlaceholder',
35
30
  'messagePlaceholder',
36
- 'showModal',
37
31
  ];
38
- let feedbackModalProps = {};
39
- propKeys.forEach((key) => {
40
- feedbackModalProps[key] = this[key];
32
+ props.forEach(prop => {
33
+ this.feedbackModal[prop] = this[prop];
41
34
  });
42
- return (h(Host, null, h("a", { class: "feedback-button-content", onClick: () => this.showModal() }, h("slot", null)), h("feedback-modal", Object.assign({}, feedbackModalProps, { ref: (el) => this.feedbackModal = el }))));
35
+ document.body.appendChild(this.feedbackModal);
36
+ }
37
+ disconnectedCallback() {
38
+ document.body.removeChild(this.feedbackModal);
39
+ }
40
+ showModal() {
41
+ this.feedbackModal.showModal = true;
42
+ }
43
+ render() {
44
+ return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle}`, onClick: () => this.showModal() }, h("slot", null))));
43
45
  }
44
46
  static get is() { return "feedback-button"; }
45
47
  static get encapsulation() { return "shadow"; }
@@ -252,12 +254,25 @@ export class FeedbackButton {
252
254
  "attribute": "message-placeholder",
253
255
  "reflect": false,
254
256
  "defaultValue": "'How could this page be more helpful?'"
257
+ },
258
+ "buttonStyle": {
259
+ "type": "string",
260
+ "mutable": false,
261
+ "complexType": {
262
+ "original": "string",
263
+ "resolved": "string",
264
+ "references": {}
265
+ },
266
+ "required": false,
267
+ "optional": false,
268
+ "docs": {
269
+ "tags": [],
270
+ "text": ""
271
+ },
272
+ "attribute": "button-style",
273
+ "reflect": false,
274
+ "defaultValue": "'default'"
255
275
  }
256
276
  };
257
277
  }
258
- static get states() {
259
- return {
260
- "feedbackModal": {}
261
- };
262
- }
263
278
  }
@@ -1,14 +1,13 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
2
  import { d as defineCustomElement$2 } from './feedback-modal2.js';
3
3
 
4
- const feedbackButtonCss = ".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";
4
+ const feedbackButtonCss = ".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);padding:5px 10px;font-size:var(--feedback-modal-button-font-size)}.feedback-button-content--light:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";
5
5
 
6
6
  const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
7
  constructor() {
8
8
  super();
9
9
  this.__registerHost();
10
10
  this.__attachShadow();
11
- this.feedbackModal = undefined;
12
11
  this.modalTitle = 'Share your feedback';
13
12
  this.successModalTitle = 'Thanks for your feedback!';
14
13
  this.errorModalTitle = "Oops! We didn't receive your feedback. Please try again later.";
@@ -20,15 +19,11 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
20
19
  this.email = '';
21
20
  this.emailPlaceholder = 'Email address (optional)';
22
21
  this.messagePlaceholder = 'How could this page be more helpful?';
22
+ this.buttonStyle = 'default';
23
23
  }
24
- componentDidLoad() {
25
- this.feedbackModal.showModal = false;
26
- }
27
- showModal() {
28
- this.feedbackModal.showModal = true;
29
- }
30
- render() {
31
- const propKeys = [
24
+ connectedCallback() {
25
+ this.feedbackModal = document.createElement('feedback-modal');
26
+ const props = [
32
27
  'modalTitle',
33
28
  'successModalTitle',
34
29
  'errorModalTitle',
@@ -40,13 +35,20 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
40
35
  'email',
41
36
  'emailPlaceholder',
42
37
  'messagePlaceholder',
43
- 'showModal',
44
38
  ];
45
- let feedbackModalProps = {};
46
- propKeys.forEach((key) => {
47
- feedbackModalProps[key] = this[key];
39
+ props.forEach(prop => {
40
+ this.feedbackModal[prop] = this[prop];
48
41
  });
49
- return (h(Host, null, h("a", { class: "feedback-button-content", onClick: () => this.showModal() }, h("slot", null)), h("feedback-modal", Object.assign({}, feedbackModalProps, { ref: (el) => this.feedbackModal = el }))));
42
+ document.body.appendChild(this.feedbackModal);
43
+ }
44
+ disconnectedCallback() {
45
+ document.body.removeChild(this.feedbackModal);
46
+ }
47
+ showModal() {
48
+ this.feedbackModal.showModal = true;
49
+ }
50
+ render() {
51
+ return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle}`, onClick: () => this.showModal() }, h("slot", null))));
50
52
  }
51
53
  static get style() { return feedbackButtonCss; }
52
54
  }, [1, "feedback-button", {
@@ -61,7 +63,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
61
63
  "email": [1],
62
64
  "emailPlaceholder": [1, "email-placeholder"],
63
65
  "messagePlaceholder": [1, "message-placeholder"],
64
- "feedbackModal": [32]
66
+ "buttonStyle": [1, "button-style"]
65
67
  }]);
66
68
  function defineCustomElement$1() {
67
69
  if (typeof customElements === "undefined") {
@@ -1,11 +1,10 @@
1
- import { r as registerInstance, h, H as Host } from './index-a9d8de87.js';
1
+ import { r as registerInstance, h, H as Host } from './index-0ae29483.js';
2
2
 
3
- const feedbackButtonCss = ".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";
3
+ const feedbackButtonCss = ".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);padding:5px 10px;font-size:var(--feedback-modal-button-font-size)}.feedback-button-content--light:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";
4
4
 
5
5
  const FeedbackButton = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
- this.feedbackModal = undefined;
9
8
  this.modalTitle = 'Share your feedback';
10
9
  this.successModalTitle = 'Thanks for your feedback!';
11
10
  this.errorModalTitle = "Oops! We didn't receive your feedback. Please try again later.";
@@ -17,15 +16,11 @@ const FeedbackButton = class {
17
16
  this.email = '';
18
17
  this.emailPlaceholder = 'Email address (optional)';
19
18
  this.messagePlaceholder = 'How could this page be more helpful?';
19
+ this.buttonStyle = 'default';
20
20
  }
21
- componentDidLoad() {
22
- this.feedbackModal.showModal = false;
23
- }
24
- showModal() {
25
- this.feedbackModal.showModal = true;
26
- }
27
- render() {
28
- const propKeys = [
21
+ connectedCallback() {
22
+ this.feedbackModal = document.createElement('feedback-modal');
23
+ const props = [
29
24
  'modalTitle',
30
25
  'successModalTitle',
31
26
  'errorModalTitle',
@@ -37,13 +32,20 @@ const FeedbackButton = class {
37
32
  'email',
38
33
  'emailPlaceholder',
39
34
  'messagePlaceholder',
40
- 'showModal',
41
35
  ];
42
- let feedbackModalProps = {};
43
- propKeys.forEach((key) => {
44
- feedbackModalProps[key] = this[key];
36
+ props.forEach(prop => {
37
+ this.feedbackModal[prop] = this[prop];
45
38
  });
46
- return (h(Host, null, h("a", { class: "feedback-button-content", onClick: () => this.showModal() }, h("slot", null)), h("feedback-modal", Object.assign({}, feedbackModalProps, { ref: (el) => this.feedbackModal = el }))));
39
+ document.body.appendChild(this.feedbackModal);
40
+ }
41
+ disconnectedCallback() {
42
+ document.body.removeChild(this.feedbackModal);
43
+ }
44
+ showModal() {
45
+ this.feedbackModal.showModal = true;
46
+ }
47
+ render() {
48
+ return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle}`, onClick: () => this.showModal() }, h("slot", null))));
47
49
  }
48
50
  };
49
51
  FeedbackButton.style = feedbackButtonCss;
@@ -27,7 +27,6 @@ const uniqueTime = (key, measureText) => {
27
27
  }
28
28
  };
29
29
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
30
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
31
30
  /**
32
31
  * Default style mode id
33
32
  */
@@ -71,7 +70,6 @@ function queryNonceMetaTagContent(doc) {
71
70
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
72
71
  const h = (nodeName, vnodeData, ...children) => {
73
72
  let child = null;
74
- let key = null;
75
73
  let simple = false;
76
74
  let lastSimple = false;
77
75
  const vNodeChildren = [];
@@ -99,10 +97,6 @@ const h = (nodeName, vnodeData, ...children) => {
99
97
  };
100
98
  walk(children);
101
99
  if (vnodeData) {
102
- // normalize class / classname attributes
103
- if (vnodeData.key) {
104
- key = vnodeData.key;
105
- }
106
100
  {
107
101
  const classData = vnodeData.className || vnodeData.class;
108
102
  if (classData) {
@@ -120,9 +114,6 @@ const h = (nodeName, vnodeData, ...children) => {
120
114
  if (vNodeChildren.length > 0) {
121
115
  vnode.$children$ = vNodeChildren;
122
116
  }
123
- {
124
- vnode.$key$ = key;
125
- }
126
117
  return vnode;
127
118
  };
128
119
  /**
@@ -144,9 +135,6 @@ const newVNode = (tag, text) => {
144
135
  {
145
136
  vnode.$attrs$ = null;
146
137
  }
147
- {
148
- vnode.$key$ = null;
149
- }
150
138
  return vnode;
151
139
  };
152
140
  const Host = {};
@@ -307,33 +295,6 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
307
295
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
308
296
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
309
297
  }
310
- else if (memberName === 'style') {
311
- // update style attribute, css properties and values
312
- {
313
- for (const prop in oldValue) {
314
- if (!newValue || newValue[prop] == null) {
315
- if (prop.includes('-')) {
316
- elm.style.removeProperty(prop);
317
- }
318
- else {
319
- elm.style[prop] = '';
320
- }
321
- }
322
- }
323
- }
324
- for (const prop in newValue) {
325
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
326
- if (prop.includes('-')) {
327
- elm.style.setProperty(prop, newValue[prop]);
328
- }
329
- else {
330
- elm.style[prop] = newValue[prop];
331
- }
332
- }
333
- }
334
- }
335
- else if (memberName === 'key')
336
- ;
337
298
  else if (memberName === 'ref') {
338
299
  // minifier will clean this up
339
300
  if (newValue) {
@@ -400,36 +361,16 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
400
361
  }
401
362
  catch (e) { }
402
363
  }
403
- /**
404
- * Need to manually update attribute if:
405
- * - memberName is not an attribute
406
- * - if we are rendering the host element in order to reflect attribute
407
- * - if it's a SVG, since properties might not work in <svg>
408
- * - if the newValue is null/undefined or 'false'.
409
- */
410
- let xlink = false;
411
- {
412
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
413
- memberName = ln;
414
- xlink = true;
415
- }
416
- }
417
364
  if (newValue == null || newValue === false) {
418
365
  if (newValue !== false || elm.getAttribute(memberName) === '') {
419
- if (xlink) {
420
- elm.removeAttributeNS(XLINK_NS, memberName);
421
- }
422
- else {
366
+ {
423
367
  elm.removeAttribute(memberName);
424
368
  }
425
369
  }
426
370
  }
427
371
  else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
428
372
  newValue = newValue === true ? '' : newValue;
429
- if (xlink) {
430
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
431
- }
432
- else {
373
+ {
433
374
  elm.setAttribute(memberName, newValue);
434
375
  }
435
376
  }
@@ -648,8 +589,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
648
589
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
649
590
  let oldStartIdx = 0;
650
591
  let newStartIdx = 0;
651
- let idxInOld = 0;
652
- let i = 0;
653
592
  let oldEndIdx = oldCh.length - 1;
654
593
  let oldStartVnode = oldCh[0];
655
594
  let oldEndVnode = oldCh[oldEndIdx];
@@ -657,7 +596,6 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
657
596
  let newStartVnode = newCh[0];
658
597
  let newEndVnode = newCh[newEndIdx];
659
598
  let node;
660
- let elmToMove;
661
599
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
662
600
  if (oldStartVnode == null) {
663
601
  // VNode might have been moved left
@@ -724,41 +662,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
724
662
  newStartVnode = newCh[++newStartIdx];
725
663
  }
726
664
  else {
727
- // Here we do some checks to match up old and new nodes based on the
728
- // `$key$` attribute, which is set by putting a `key="my-key"` attribute
729
- // in the JSX for a DOM element in the implementation of a Stencil
730
- // component.
731
- //
732
- // First we check to see if there are any nodes in the array of old
733
- // children which have the same key as the first node in the new
734
- // children.
735
- idxInOld = -1;
736
665
  {
737
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
738
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
739
- idxInOld = i;
740
- break;
741
- }
742
- }
743
- }
744
- if (idxInOld >= 0) {
745
- // We found a node in the old children which matches up with the first
746
- // node in the new children! So let's deal with that
747
- elmToMove = oldCh[idxInOld];
748
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
749
- // the tag doesn't match so we'll need a new DOM element
750
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
751
- }
752
- else {
753
- patch(elmToMove, newStartVnode);
754
- // invalidate the matching old node so that we won't try to update it
755
- // again later on
756
- oldCh[idxInOld] = undefined;
757
- node = elmToMove.$elm$;
758
- }
759
- newStartVnode = newCh[++newStartIdx];
760
- }
761
- else {
762
666
  // We either didn't find an element in the old children that matches
763
667
  // the key of the first new child OR the build is not using `key`
764
668
  // attributes at all. In either case we need to create a new element
@@ -807,10 +711,7 @@ const isSameVnode = (leftVNode, rightVNode) => {
807
711
  // compare if two vnode to see if they're "technically" the same
808
712
  // need to have the same element tag, and same key to be the same
809
713
  if (leftVNode.$tag$ === rightVNode.$tag$) {
810
- // this will be set if components in the build have `key` attrs set on them
811
- {
812
- return leftVNode.$key$ === rightVNode.$key$;
813
- }
714
+ return true;
814
715
  }
815
716
  return false;
816
717
  };
@@ -1006,7 +907,6 @@ const postUpdateComponent = (hostRef) => {
1006
907
  const tagName = hostRef.$cmpMeta$.$tagName$;
1007
908
  const elm = hostRef.$hostElement$;
1008
909
  const endPostUpdate = createTime('postUpdate', tagName);
1009
- const instance = hostRef.$lazyInstance$ ;
1010
910
  const ancestorComponent = hostRef.$ancestorComponent$;
1011
911
  if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1012
912
  hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
@@ -1014,9 +914,6 @@ const postUpdateComponent = (hostRef) => {
1014
914
  // DOM WRITE!
1015
915
  addHydratedFlag(elm);
1016
916
  }
1017
- {
1018
- safeCall(instance, 'componentDidLoad');
1019
- }
1020
917
  endPostUpdate();
1021
918
  {
1022
919
  hostRef.$onReadyResolve$(elm);
@@ -1237,6 +1134,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1237
1134
  hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1238
1135
  }
1239
1136
  endNewInstance();
1137
+ fireConnectedCallback(hostRef.$lazyInstance$);
1240
1138
  }
1241
1139
  if (Cstr.style) {
1242
1140
  // this component has styles but we haven't registered them yet
@@ -1265,6 +1163,11 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1265
1163
  schedule();
1266
1164
  }
1267
1165
  };
1166
+ const fireConnectedCallback = (instance) => {
1167
+ {
1168
+ safeCall(instance, 'connectedCallback');
1169
+ }
1170
+ };
1268
1171
  const connectedCallback = (elm) => {
1269
1172
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1270
1173
  const hostRef = getHostRef(elm);
@@ -1303,12 +1206,20 @@ const connectedCallback = (elm) => {
1303
1206
  initializeComponent(elm, hostRef, cmpMeta);
1304
1207
  }
1305
1208
  }
1209
+ else {
1210
+ // fire off connectedCallback() on component instance
1211
+ fireConnectedCallback(hostRef.$lazyInstance$);
1212
+ }
1306
1213
  endConnected();
1307
1214
  }
1308
1215
  };
1309
1216
  const disconnectedCallback = (elm) => {
1310
1217
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1311
- getHostRef(elm);
1218
+ const hostRef = getHostRef(elm);
1219
+ const instance = hostRef.$lazyInstance$ ;
1220
+ {
1221
+ safeCall(instance, 'disconnectedCallback');
1222
+ }
1312
1223
  }
1313
1224
  };
1314
1225
  const bootstrapLazy = (lazyBundles, options = {}) => {
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-a9d8de87.js';
2
- export { s as setNonce } from './index-a9d8de87.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-0ae29483.js';
2
+ export { s as setNonce } from './index-0ae29483.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"feedbackModal":[32]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
14
+ return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-a9d8de87.js';
2
- export { s as setNonce } from './index-a9d8de87.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-0ae29483.js';
2
+ export { s as setNonce } from './index-0ae29483.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"feedbackModal":[32]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
17
+ return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
18
18
  });
@@ -0,0 +1,2 @@
1
+ let e,t,n=!1,l=!1;const o={},s=e=>"object"==(e=typeof e)||"function"===e;function c(e){var t,n,l;return null!==(l=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==l?l:void 0}const i=(e,t,...n)=>{let l=null,o=!1,c=!1;const i=[],u=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!s(l))&&(l+=""),o&&c?i[i.length-1].t+=l:i.push(o?r(null,l):l),c=o)};if(u(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const a=r(e,null);return a.l=t,i.length>0&&(a.o=i),a},r=(e,t)=>({i:0,u:e,t,h:null,o:null,l:null}),u={},a=new WeakMap,f=e=>"sc-"+e.p,d=(e,t,n,l,o,c)=>{if(n!==l){let i=F(e,t),r=t.toLowerCase();if("class"===t){const t=e.classList,o=p(n),s=p(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("ref"===t)l&&l(e);else if(i||"o"!==t[0]||"n"!==t[1]){const r=s(l);if((i||r&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?i=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!i||4&c||o)&&!r&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):F(D,r)?r.slice(2):r[2]+t.slice(3),n&&I.rel(e,t,n,!1),l&&I.ael(e,t,l,!1)}},h=/\s/,p=e=>e?e.split(h):[],$=(e,t,n,l)=>{const s=11===t.h.nodeType&&t.h.host?t.h.host:t.h,c=e&&e.l||o,i=t.l||o;for(l in c)l in i||d(s,l,c[l],void 0,n,t.i);for(l in i)d(s,l,c[l],i[l],n,t.i)},m=(t,l,o)=>{const s=l.o[o];let c,i,r=0;if(null!==s.t)c=s.h=G.createTextNode(s.t);else{if(n||(n="svg"===s.u),c=s.h=G.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s.u),n&&"foreignObject"===s.u&&(n=!1),$(null,s,n),null!=e&&c["s-si"]!==e&&c.classList.add(c["s-si"]=e),s.o)for(r=0;r<s.o.length;++r)i=m(t,s,r),i&&c.appendChild(i);"svg"===s.u?n=!1:"foreignObject"===c.tagName&&(n=!0)}return c},y=(e,n,l,o,s,c)=>{let i,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);s<=c;++s)o[s]&&(i=m(null,l,s),i&&(o[s].h=i,r.insertBefore(i,n)))},w=(e,t,n,l,o)=>{for(;t<=n;++t)(l=e[t])&&(o=l.h,g(l),o.remove())},b=(e,t)=>e.u===t.u,v=(e,t)=>{const l=t.h=e.h,o=e.o,s=t.o,c=t.u,i=t.t;null===i?(n="svg"===c||"foreignObject"!==c&&n,"slot"===c||$(e,t,n),null!==o&&null!==s?((e,t,n,l)=>{let o,s=0,c=0,i=t.length-1,r=t[0],u=t[i],a=l.length-1,f=l[0],d=l[a];for(;s<=i&&c<=a;)null==r?r=t[++s]:null==u?u=t[--i]:null==f?f=l[++c]:null==d?d=l[--a]:b(r,f)?(v(r,f),r=t[++s],f=l[++c]):b(u,d)?(v(u,d),u=t[--i],d=l[--a]):b(r,d)?(v(r,d),e.insertBefore(r.h,u.h.nextSibling),r=t[++s],d=l[--a]):b(u,f)?(v(u,f),e.insertBefore(u.h,r.h),u=t[--i],f=l[++c]):(o=m(t&&t[c],n,c),f=l[++c],o&&r.h.parentNode.insertBefore(o,r.h));s>i?y(e,null==l[a+1]?null:l[a+1].h,n,l,c,a):c>a&&w(t,s,i)})(l,o,t,s):null!==s?(null!==e.t&&(l.textContent=""),y(l,null,t,s,0,s.length-1)):null!==o&&w(o,0,o.length-1),n&&"svg"===c&&(n=!1)):e.t!==i&&(l.data=i)},g=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(g)},S=(e,t)=>{t&&!e.$&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.$=t)))},j=(e,t)=>{if(e.i|=16,!(4&e.i))return S(e,e.m),ne((()=>k(e,t)));e.i|=512},k=(e,t)=>{const n=e.v;let l;return t&&(l=P(n,"componentWillLoad")),E(l,(()=>O(e,n,t)))},O=async(e,t,n)=>{const l=e.g,o=l["s-rc"];n&&(e=>{const t=e.S,n=e.g,l=t.i,o=((e,t)=>{var n;let l=f(t);const o=B.get(l);if(e=11===e.nodeType?e:G,o)if("string"==typeof o){let t,s=a.get(e=e.head||e);if(s||a.set(e,s=new Set),!s.has(l)){{t=G.createElement("style"),t.innerHTML=o;const l=null!==(n=I.j)&&void 0!==n?n:c(G);null!=l&&t.setAttribute("nonce",l),e.insertBefore(t,e.querySelector("link"))}s&&s.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);C(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>M(e);0===t.length?n():(Promise.all(t).then(n),e.i|=4,t.length=0)}},C=(n,l)=>{try{l=l.render(),n.i&=-17,n.i|=2,((n,l)=>{const o=n.g,s=n.S,c=n.k||r(null,null),a=(e=>e&&e.u===u)(l)?l:i(null,null,l);t=o.tagName,s.O&&(a.l=a.l||{},s.O.map((([e,t])=>a.l[t]=o[e]))),a.u=null,a.i|=4,n.k=a,a.h=c.h=o.shadowRoot||o,e=o["s-sc"],v(c,a)})(n,l)}catch(e){V(e,n.g)}return null},M=e=>{const t=e.g,n=e.m;64&e.i||(e.i|=64,L(t),e.C(t),n||x()),e.$&&(e.$(),e.$=void 0),512&e.i&&te((()=>j(e,!1))),e.i&=-517},x=()=>{L(G.documentElement),te((()=>(e=>{const t=I.ce("appload",{detail:{namespace:"pushfeedback"}});return e.dispatchEvent(t),t})(D)))},P=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){V(e)}},E=(e,t)=>e&&e.then?e.then(t):t(),L=e=>e.classList.add("hydrated"),N=(e,t,n)=>{if(t.M){const l=Object.entries(t.M),o=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(o,e,{get(){return((e,t)=>R(this).P.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=R(e),c=o.P.get(t),i=o.i,r=o.v;n=((e,t)=>null==e||s(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.M[t][0]),8&i&&void 0!==c||n===c||Number.isNaN(c)&&Number.isNaN(n)||(o.P.set(t,n),r&&2==(18&i)&&j(o,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){I.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.O.push([e,o]),o}))}}return e},T=e=>{P(e,"connectedCallback")},W=(e,t={})=>{var n;const l=[],o=t.exclude||[],s=D.customElements,i=G.head,r=i.querySelector("meta[charset]"),u=G.createElement("style"),a=[];let d,h=!0;Object.assign(I,t),I.L=new URL(t.resourcesUrl||"./",G.baseURI).href,e.map((e=>{e[1].map((t=>{const n={i:t[0],p:t[1],M:t[2],N:t[3]};n.M=t[2],n.O=[];const c=n.p,i=class extends HTMLElement{constructor(e){super(e),q(e=this,n),1&n.i&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),h?a.push(this):I.jmp((()=>(e=>{if(0==(1&I.i)){const t=R(e),n=t.S,l=()=>{};if(1&t.i)T(t.v);else{t.i|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){S(t,t.m=n);break}}n.M&&Object.entries(n.M).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.i)){{if(t.i|=32,(o=z(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(N(o,n,2),o.isProxied=!0);const e=()=>{};t.i|=8;try{new o(t)}catch(e){V(e)}t.i&=-9,e(),T(t.v)}if(o.style){let e=o.style;const t=f(n);if(!B.has(t)){const l=()=>{};((e,t,n)=>{let l=B.get(e);K&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,B.set(e,l)})(t,e,!!(1&n.i)),l()}}}const s=t.m,c=()=>j(t,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){I.jmp((()=>(()=>{0==(1&I.i)&&P(R(this).v,"disconnectedCallback")})()))}componentOnReady(){return R(this).T}};n.W=e[0],o.includes(c)||s.get(c)||(l.push(c),s.define(c,N(i,n,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(n=I.j)&&void 0!==n?n:c(G);null!=e&&u.setAttribute("nonce",e),i.insertBefore(u,r?r.nextSibling:i.firstChild)}h=!1,a.length?a.map((e=>e.connectedCallback())):I.jmp((()=>d=setTimeout(x,30)))},A=e=>I.j=e,H=new WeakMap,R=e=>H.get(e),U=(e,t)=>H.set(t.v=e,t),q=(e,t)=>{const n={i:0,g:e,S:t,P:new Map};return n.T=new Promise((e=>n.C=e)),e["s-p"]=[],e["s-rc"]=[],H.set(e,n)},F=(e,t)=>t in e,V=(e,t)=>(0,console.error)(e,t),_=new Map,z=e=>{const t=e.p.replace(/-/g,"_"),n=e.W,l=_.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(_.set(n,e),e[t])),V)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},B=new Map,D="undefined"!=typeof window?window:{},G=D.document||{head:{}},I={i:0,L:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},J=e=>Promise.resolve(e),K=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),Q=[],X=[],Y=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&I.i?te(ee):I.raf(ee))},Z=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){V(e)}e.length=0},ee=()=>{Z(Q),Z(X),(l=Q.length>0)&&I.raf(ee)},te=e=>J().then(e),ne=Y(X,!0);export{u as H,W as b,i as h,J as p,U as r,A as s}
@@ -0,0 +1 @@
1
+ import{r as e,h as t,H as o}from"./p-60079923.js";const n=class{constructor(t){e(this,t),this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.buttonStyle="default"}connectedCallback(){this.feedbackModal=document.createElement("feedback-modal"),["modalTitle","successModalTitle","errorModalTitle","modalPosition","sendButtonText","project","screenshotButtonTooltipText","screenshotTopbarText","email","emailPlaceholder","messagePlaceholder"].forEach((e=>{this.feedbackModal[e]=this[e]})),document.body.appendChild(this.feedbackModal)}disconnectedCallback(){document.body.removeChild(this.feedbackModal)}showModal(){this.feedbackModal.showModal=!0}render(){return t(o,null,t("a",{class:`feedback-button-content feedback-button-content--${this.buttonStyle}`,onClick:()=>this.showModal()},t("slot",null)))}};n.style=".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);padding:5px 10px;font-size:var(--feedback-modal-button-font-size)}.feedback-button-content--light:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";var r,i,a=(r=function(e){!function(){var t=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var o,n;return(o="application/font-woff",n="image/jpeg",{woff:o,woff2:o,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[t(e).toLowerCase()]||""},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var o=window.atob(e.toDataURL().split(",")[1]),n=o.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=o.charCodeAt(i);t(new Blob([r],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var o=document.implementation.createHTMLDocument(),n=o.createElement("base");o.head.appendChild(n);var r=o.createElement("a");return o.body.appendChild(r),n.href=t,r.href=e,r.href},getAndEncode:function(e){return s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()),new Promise((function(t){var o,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var e=r.result.split(/,/)[1];t(e)},r.readAsDataURL(n.response)}else o?t(o):i("cannot fetch resource: "+e+", status: "+n.status)},n.ontimeout=function(){o?t(o):i("timeout of 30000ms occured while fetching resource: "+e)},n.responseType="blob",n.timeout=3e4,n.open("GET",e,!0),n.send(),s.impl.options.imagePlaceholder){var r=s.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(o=r[1])}function i(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(o){setTimeout((function(){o(t)}),e)}))}},asArray:function(e){for(var t=[],o=e.length,n=0;n<o;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,o){var n=new Image;n.onload=function(){t(n)},n.onerror=o,n.src=e}))},width:function(e){var t=o(e,"border-left-width"),n=o(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=o(e,"border-top-width"),n=o(e,"border-bottom-width");return e.scrollHeight+t+n}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function o(e,t){var o=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(o.replace("px",""))}}(),o=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,t,i){return o(e)?Promise.resolve(e).then(n).then((function(o){var n=Promise.resolve(e);return o.forEach((function(e){n=n.then((function(o){return r(o,e,t,i)}))})),n})):Promise.resolve(e)},shouldProcess:o,impl:{readUrls:n,inline:r}};function o(t){return-1!==t.search(e)}function n(o){for(var n,r=[];null!==(n=e.exec(o));)r.push(n[1]);return r.filter((function(e){return!t.isDataUrl(e)}))}function r(e,o,n,r){return Promise.resolve(o).then((function(e){return n?t.resolveUrl(e,n):e})).then(r||t.getAndEncode).then((function(e){return t.dataAsUrl(e,t.mimeType(o))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+t.escape(e)+")(['\"]?\\))","g")}(o),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(e){var o=[];return e.forEach((function(e){try{t.asArray(e.cssRules||[]).forEach(o.push.bind(o))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),o})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return o.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){return o.inlineAll(e.cssText,(e.parentStyleSheet||{}).href)},src:function(){return e.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?o.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(r).then((function(){return r instanceof HTMLImageElement?e(r).inline():Promise.all(t.asArray(r.childNodes).map((function(e){return n(e)})))})):Promise.resolve(r)},impl:{newImage:e}};function e(e){return{inline:function(o){return t.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(o||t.getAndEncode).then((function(o){return t.dataAsUrl(o,t.mimeType(e.src))})).then((function(t){return new Promise((function(o,n){e.onload=o,e.onerror=n,e.src=t}))}))}}}}(),i=void 0,a=!1,s={toSvg:c,toPng:function(e,t){return d(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return d(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,o){return d(e,o||{}).then(t.canvasToBlob)},toPixelData:function(e,o){return d(e,o||{}).then((function(o){return o.getContext("2d").getImageData(0,0,t.width(e),t.height(e)).data}))},impl:{fontFaces:n,images:r,util:t,inliner:o,options:{}}};function c(e,o){return function(e){s.impl.options.imagePlaceholder=void 0===e.imagePlaceholder?i:e.imagePlaceholder,s.impl.options.cacheBust=void 0===e.cacheBust?a:e.cacheBust}(o=o||{}),Promise.resolve(e).then((function(e){return l(e,o.filter,!0)})).then(u).then(f).then((function(e){return o.bgcolor&&(e.style.backgroundColor=o.bgcolor),o.width&&(e.style.width=o.width+"px"),o.height&&(e.style.height=o.height+"px"),o.style&&Object.keys(o.style).forEach((function(t){e.style[t]=o.style[t]})),e})).then((function(n){return function(e,o,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(t.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,o.width||t.width(e),o.height||t.height(e))}))}function d(e,o){return c(e,o).then(t.makeImage).then(t.delay(100)).then((function(n){var r=function(e){var n=document.createElement("canvas");if(n.width=o.width||t.width(e),n.height=o.height||t.height(e),o.bgcolor){var r=n.getContext("2d");r.fillStyle=o.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(e);return r.getContext("2d").drawImage(n,0,0),r}))}function l(e,o,n){return n||!o||o(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,o,n){var r=e.childNodes;return 0===r.length?Promise.resolve(o):function(e,t,o){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,o)})).then((function(t){t&&e.appendChild(t)}))})),n}(o,t.asArray(r),n).then((function(){return o}))}(e,n,o)})).then((function(o){return function(e,o){return o instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(e),r=o.style,n.cssText?r.cssText=n.cssText:function(e,o){t.asArray(e).forEach((function(t){o.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(""!==i&&"none"!==i){var a=t.uid();o.className=o.className+" "+a;var s=document.createElement("style");s.appendChild(function(e,o,n){var r="."+e+":"+o,i=n.cssText?a(n):s(n);return document.createTextNode(r+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return t.asArray(e).map(o).join("; ")+";";function o(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}(a,n,r)),o.appendChild(s)}}(n)}))})).then((function(){e instanceof HTMLTextAreaElement&&(o.innerHTML=e.value),e instanceof HTMLInputElement&&o.setAttribute("value",e.value)})).then((function(){o instanceof SVGElement&&(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=o.getAttribute(e);t&&o.style.setProperty(e,t)})))})).then((function(){return o})):o}(e,o)})):Promise.resolve()}function u(e){return n.resolveAll().then((function(t){var o=document.createElement("style");return e.appendChild(o),o.appendChild(document.createTextNode(t)),e}))}function f(e){return r.inlineAll(e).then((function(){return e}))}e.exports=s}()},r(i={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),i.exports);const s=class{constructor(t){e(this,t),this.handleSubmit=async e=>{e.preventDefault(),this.showScreenshotMode=!1,this.showModal=!1,this.sending=!0;let t="";this.encodedScreenshot&&await this.encodedScreenshot.then((e=>{t=e})).catch((e=>{console.log(e)}));try{200===(await fetch("https://app.pushfeedback.com/api/feedback/",{method:"POST",body:JSON.stringify({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:t}),headers:{"Content-Type":"application/json"}})).status?(this.formSuccess=!0,this.formError=!1):(this.formSuccess=!1,this.formError=!0)}catch(e){this.formSuccess=!1,this.formError=!0}finally{this.sending=!1,this.showModal=!0}},this.close=()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.formSuccess=!1,this.formError=!1,this.formMessage="",this.formEmail=""},this.openScreenShot=()=>{this.hasSelectedElement=!1,this.showModal=!1,this.showScreenshotMode=!0,this.encodedScreenshot=null,document.getElementsByTagName("html")[0].style.overflow="auto"},this.closeScreenShot=()=>{this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.overlay.style.display="none",document.getElementsByTagName("html")[0].style.overflow="inherit"},this.handleMouseOverScreenShot=e=>{if(e.preventDefault(),this.hasSelectedElement)return;this.overlay.style.display="none",this.screenshotModal.style.display="none";const t=document.elementFromPoint(e.clientX,e.clientY).getBoundingClientRect();this.screenshotModal.style.display="",this.elementSelected.style.position="absolute",this.elementSelected.style.left=`${t.left}px`,this.elementSelected.style.top=`${t.top}px`,this.elementSelected.style.width=`${t.width}px`,this.elementSelected.style.height=`${t.height}px`,this.elementSelected.classList.add("feedback-modal-element-hover"),this.topSide.style.position="absolute",this.topSide.style.left=`${t.left}px`,this.topSide.style.top="0px",this.topSide.style.width=`${t.width+8}px`,this.topSide.style.height=`${t.top}px`,this.topSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.leftSide.style.position="absolute",this.leftSide.style.left="0px",this.leftSide.style.top="0px",this.leftSide.style.width=`${t.left}px`,this.leftSide.style.height="100vh",this.leftSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.bottomSide.style.position="absolute",this.bottomSide.style.left=`${t.left}px`,this.bottomSide.style.top=`${t.bottom+8}px`,this.bottomSide.style.width=`${t.width+8}px`,this.bottomSide.style.height="100vh",this.bottomSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.rightSide.style.position="absolute",this.rightSide.style.left=`${t.right+8}px`,this.rightSide.style.top="0px",this.rightSide.style.width="100%",this.rightSide.style.height="100vh",this.rightSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.screenshotModal.style.backgroundColor="transparent"},this.handleMouseClickedSelectedElement=e=>{e.preventDefault(),this.elementSelected&&this.elementSelected.classList.add("feedback-modal-element-selected");let t=this.elementSelected.getBoundingClientRect().top;this.elementSelected.style.top=`${t+window.pageYOffset}px`;const o=this.elementSelected.cloneNode(!0);document.body.appendChild(o),this.elementSelected.style.top=`${t}px`,this.encodedScreenshot=a.toPng(document.body,{cacheBust:!0}).then((function(e){return document.body.removeChild(o),e})).catch((function(e){return console.error("oops, something went wrong!",e),""})),document.getElementsByTagName("html")[0].style.overflow="hidden",this.hasSelectedElement=!0,this.overlay.style.display="block",this.showModal=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formError=!1,this.encodedScreenshot=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1}componentWillLoad(){this.formEmail=this.email}handleMessageInput(e){this.formMessage=e.target.value}handleEmailInput(e){this.formEmail=e.target.value}render(){return t("div",{class:"feedback-modal-wrapper"},this.showScreenshotMode&&t("div",{class:"feedback-modal-screenshot",ref:e=>this.screenshotModal=e,onMouseMove:this.handleMouseOverScreenShot},t("div",{class:"feedback-modal-screenshot-element-selected",ref:e=>this.elementSelected=e,onClick:this.handleMouseClickedSelectedElement}),t("div",{class:"top-side",ref:e=>this.topSide=e}),t("div",{class:"left-side",ref:e=>this.leftSide=e}),t("div",{class:"bottom-side",ref:e=>this.bottomSide=e}),t("div",{class:"right-side",ref:e=>this.rightSide=e}),t("div",{class:"feedback-modal-screenshot-header",onClick:this.closeScreenShot},t("span",null,this.screenshotTopbarText),t("span",{class:"feedback-modal-screenshot-close"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-screenshot-overlay",ref:e=>this.overlay=e})),this.showModal&&t("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition}`,ref:e=>this.modalContent=e},t("div",{class:"feedback-modal-header"},this.formSuccess||this.formError?this.formSuccess?t("span",{class:"text-center"},this.successModalTitle):this.formError?t("span",{class:"text-center"},this.errorModalTitle):t("span",null):t("span",null,this.modalTitle),t("button",{class:"feedback-modal-close",onClick:this.close},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#ccc","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-body"},this.formSuccess||this.formError?t("span",null):t("form",{onSubmit:this.handleSubmit},t("div",{class:"feedback-modal-text"},t("textarea",{placeholder:this.messagePlaceholder,value:this.formMessage,onInput:e=>this.handleMessageInput(e),required:!0})),!this.email&&t("div",{class:"feedback-modal-email"},t("input",{type:"email",placeholder:this.emailPlaceholder,onInput:e=>this.handleEmailInput(e),value:this.formEmail})),t("div",{class:"feedback-modal-buttons"},t("button",{type:"button",class:"button"+(this.encodedScreenshot?" active":""),title:this.screenshotButtonTooltipText,onClick:this.openScreenShot,disabled:this.sending},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-camera"},t("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t("circle",{cx:"12",cy:"13",r:"4"}))),t("button",{class:"button",type:"submit",disabled:this.sending},this.sendButtonText)))),t("div",{class:"feedback-modal-footer"},t("div",{class:"feedback-logo"},t("svg",{class:"w-8 h-8",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},t("defs",null,t("radialGradient",{cx:"21.152%",cy:"86.063%",fx:"21.152%",fy:"86.063%",r:"79.941%",id:"footer-logo"},t("stop",{"stop-color":"#4FD1C5",offset:"0%"}),t("stop",{"stop-color":"#81E6D9",offset:"25.871%"}),t("stop",{"stop-color":"#338CF5",offset:"100%"}))),t("rect",{width:"32",height:"32",rx:"16",fill:"url(#footer-logo)","fill-rule":"nonzero"}))," ",t("a",{href:"https://pushfeedback.com"},"PushFeedback")))))}};s.style=".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300}.feedback-modal-content.feedback-modal-content--center{left:50%;top:50%;transform:translate(-50%, -50%)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;justify-content:space-between}.button{background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";export{n as feedback_button,s as feedback_modal}
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-6aedd58b.js";export{s as setNonce}from"./p-6aedd58b.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-327ea768",[[1,"feedback-button",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],feedbackModal:[32]}],[1,"feedback-modal",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],showModal:[1540,"show-modal"],showScreenshotMode:[1540,"show-screenshot-mode"],hasSelectedElement:[1540,"has-selected-element"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formError:[32],encodedScreenshot:[32]}]]]],e)));
1
+ import{p as e,b as t}from"./p-60079923.js";export{s as setNonce}from"./p-60079923.js";(()=>{const t=import.meta.url,o={};return""!==t&&(o.resourcesUrl=new URL(".",t).href),e(o)})().then((e=>t([["p-eac9210f",[[1,"feedback-button",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],buttonStyle:[1,"button-style"]}],[1,"feedback-modal",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],showModal:[1540,"show-modal"],showScreenshotMode:[1540,"show-screenshot-mode"],hasSelectedElement:[1540,"has-selected-element"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formError:[32],encodedScreenshot:[32]}]]]],e)));
@@ -1,6 +1,5 @@
1
- import { FeedbackModal } from '../feedback-modal/feedback-modal';
2
1
  export declare class FeedbackButton {
3
- feedbackModal: FeedbackModal;
2
+ feedbackModal: any;
4
3
  modalTitle: string;
5
4
  successModalTitle: string;
6
5
  errorModalTitle: string;
@@ -12,7 +11,9 @@ export declare class FeedbackButton {
12
11
  email: string;
13
12
  emailPlaceholder: string;
14
13
  messagePlaceholder: string;
15
- componentDidLoad(): void;
14
+ buttonStyle: string;
15
+ connectedCallback(): void;
16
+ disconnectedCallback(): void;
16
17
  showModal(): void;
17
18
  render(): any;
18
19
  }
@@ -7,6 +7,7 @@
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  export namespace Components {
9
9
  interface FeedbackButton {
10
+ "buttonStyle": string;
10
11
  "email": string;
11
12
  "emailPlaceholder": string;
12
13
  "errorModalTitle": string;
@@ -56,6 +57,7 @@ declare global {
56
57
  }
57
58
  declare namespace LocalJSX {
58
59
  interface FeedbackButton {
60
+ "buttonStyle"?: string;
59
61
  "email"?: string;
60
62
  "emailPlaceholder"?: string;
61
63
  "errorModalTitle"?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushfeedback",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Feedback widget for websites.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as e,h as t,H as o}from"./p-6aedd58b.js";const n=class{constructor(t){e(this,t),this.feedbackModal=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?"}componentDidLoad(){this.feedbackModal.showModal=!1}showModal(){this.feedbackModal.showModal=!0}render(){let e={};return["modalTitle","successModalTitle","errorModalTitle","modalPosition","sendButtonText","project","screenshotButtonTooltipText","screenshotTopbarText","email","emailPlaceholder","messagePlaceholder","showModal"].forEach((t=>{e[t]=this[t]})),t(o,null,t("a",{class:"feedback-button-content",onClick:()=>this.showModal()},t("slot",null)),t("feedback-modal",Object.assign({},e,{ref:e=>this.feedbackModal=e})))}};n.style=".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";var r,i,a=(r=function(e){!function(){var t=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var o,n;return(o="application/font-woff",n="image/jpeg",{woff:o,woff2:o,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[t(e).toLowerCase()]||""},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var o=window.atob(e.toDataURL().split(",")[1]),n=o.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=o.charCodeAt(i);t(new Blob([r],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var o=document.implementation.createHTMLDocument(),n=o.createElement("base");o.head.appendChild(n);var r=o.createElement("a");return o.body.appendChild(r),n.href=t,r.href=e,r.href},getAndEncode:function(e){return s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()),new Promise((function(t){var o,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var e=r.result.split(/,/)[1];t(e)},r.readAsDataURL(n.response)}else o?t(o):i("cannot fetch resource: "+e+", status: "+n.status)},n.ontimeout=function(){o?t(o):i("timeout of 30000ms occured while fetching resource: "+e)},n.responseType="blob",n.timeout=3e4,n.open("GET",e,!0),n.send(),s.impl.options.imagePlaceholder){var r=s.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(o=r[1])}function i(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(o){setTimeout((function(){o(t)}),e)}))}},asArray:function(e){for(var t=[],o=e.length,n=0;n<o;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,o){var n=new Image;n.onload=function(){t(n)},n.onerror=o,n.src=e}))},width:function(e){var t=o(e,"border-left-width"),n=o(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=o(e,"border-top-width"),n=o(e,"border-bottom-width");return e.scrollHeight+t+n}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function o(e,t){var o=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(o.replace("px",""))}}(),o=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,t,i){return o(e)?Promise.resolve(e).then(n).then((function(o){var n=Promise.resolve(e);return o.forEach((function(e){n=n.then((function(o){return r(o,e,t,i)}))})),n})):Promise.resolve(e)},shouldProcess:o,impl:{readUrls:n,inline:r}};function o(t){return-1!==t.search(e)}function n(o){for(var n,r=[];null!==(n=e.exec(o));)r.push(n[1]);return r.filter((function(e){return!t.isDataUrl(e)}))}function r(e,o,n,r){return Promise.resolve(o).then((function(e){return n?t.resolveUrl(e,n):e})).then(r||t.getAndEncode).then((function(e){return t.dataAsUrl(e,t.mimeType(o))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+t.escape(e)+")(['\"]?\\))","g")}(o),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(e){var o=[];return e.forEach((function(e){try{t.asArray(e.cssRules||[]).forEach(o.push.bind(o))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),o})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return o.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){return o.inlineAll(e.cssText,(e.parentStyleSheet||{}).href)},src:function(){return e.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?o.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(r).then((function(){return r instanceof HTMLImageElement?e(r).inline():Promise.all(t.asArray(r.childNodes).map((function(e){return n(e)})))})):Promise.resolve(r)},impl:{newImage:e}};function e(e){return{inline:function(o){return t.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(o||t.getAndEncode).then((function(o){return t.dataAsUrl(o,t.mimeType(e.src))})).then((function(t){return new Promise((function(o,n){e.onload=o,e.onerror=n,e.src=t}))}))}}}}(),i=void 0,a=!1,s={toSvg:c,toPng:function(e,t){return d(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return d(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,o){return d(e,o||{}).then(t.canvasToBlob)},toPixelData:function(e,o){return d(e,o||{}).then((function(o){return o.getContext("2d").getImageData(0,0,t.width(e),t.height(e)).data}))},impl:{fontFaces:n,images:r,util:t,inliner:o,options:{}}};function c(e,o){return function(e){s.impl.options.imagePlaceholder=void 0===e.imagePlaceholder?i:e.imagePlaceholder,s.impl.options.cacheBust=void 0===e.cacheBust?a:e.cacheBust}(o=o||{}),Promise.resolve(e).then((function(e){return l(e,o.filter,!0)})).then(u).then(f).then((function(e){return o.bgcolor&&(e.style.backgroundColor=o.bgcolor),o.width&&(e.style.width=o.width+"px"),o.height&&(e.style.height=o.height+"px"),o.style&&Object.keys(o.style).forEach((function(t){e.style[t]=o.style[t]})),e})).then((function(n){return function(e,o,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(t.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,o.width||t.width(e),o.height||t.height(e))}))}function d(e,o){return c(e,o).then(t.makeImage).then(t.delay(100)).then((function(n){var r=function(e){var n=document.createElement("canvas");if(n.width=o.width||t.width(e),n.height=o.height||t.height(e),o.bgcolor){var r=n.getContext("2d");r.fillStyle=o.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(e);return r.getContext("2d").drawImage(n,0,0),r}))}function l(e,o,n){return n||!o||o(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,o,n){var r=e.childNodes;return 0===r.length?Promise.resolve(o):function(e,t,o){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,o)})).then((function(t){t&&e.appendChild(t)}))})),n}(o,t.asArray(r),n).then((function(){return o}))}(e,n,o)})).then((function(o){return function(e,o){return o instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(e),r=o.style,n.cssText?r.cssText=n.cssText:function(e,o){t.asArray(e).forEach((function(t){o.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(""!==i&&"none"!==i){var a=t.uid();o.className=o.className+" "+a;var s=document.createElement("style");s.appendChild(function(e,o,n){var r="."+e+":"+o,i=n.cssText?a(n):s(n);return document.createTextNode(r+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return t.asArray(e).map(o).join("; ")+";";function o(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}(a,n,r)),o.appendChild(s)}}(n)}))})).then((function(){e instanceof HTMLTextAreaElement&&(o.innerHTML=e.value),e instanceof HTMLInputElement&&o.setAttribute("value",e.value)})).then((function(){o instanceof SVGElement&&(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=o.getAttribute(e);t&&o.style.setProperty(e,t)})))})).then((function(){return o})):o}(e,o)})):Promise.resolve()}function u(e){return n.resolveAll().then((function(t){var o=document.createElement("style");return e.appendChild(o),o.appendChild(document.createTextNode(t)),e}))}function f(e){return r.inlineAll(e).then((function(){return e}))}e.exports=s}()},r(i={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),i.exports);const s=class{constructor(t){e(this,t),this.handleSubmit=async e=>{e.preventDefault(),this.showScreenshotMode=!1,this.showModal=!1,this.sending=!0;let t="";this.encodedScreenshot&&await this.encodedScreenshot.then((e=>{t=e})).catch((e=>{console.log(e)}));try{200===(await fetch("https://app.pushfeedback.com/api/feedback/",{method:"POST",body:JSON.stringify({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:t}),headers:{"Content-Type":"application/json"}})).status?(this.formSuccess=!0,this.formError=!1):(this.formSuccess=!1,this.formError=!0)}catch(e){this.formSuccess=!1,this.formError=!0}finally{this.sending=!1,this.showModal=!0}},this.close=()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.formSuccess=!1,this.formError=!1,this.formMessage="",this.formEmail=""},this.openScreenShot=()=>{this.hasSelectedElement=!1,this.showModal=!1,this.showScreenshotMode=!0,this.encodedScreenshot=null,document.getElementsByTagName("html")[0].style.overflow="auto"},this.closeScreenShot=()=>{this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.overlay.style.display="none",document.getElementsByTagName("html")[0].style.overflow="inherit"},this.handleMouseOverScreenShot=e=>{if(e.preventDefault(),this.hasSelectedElement)return;this.overlay.style.display="none",this.screenshotModal.style.display="none";const t=document.elementFromPoint(e.clientX,e.clientY).getBoundingClientRect();this.screenshotModal.style.display="",this.elementSelected.style.position="absolute",this.elementSelected.style.left=`${t.left}px`,this.elementSelected.style.top=`${t.top}px`,this.elementSelected.style.width=`${t.width}px`,this.elementSelected.style.height=`${t.height}px`,this.elementSelected.classList.add("feedback-modal-element-hover"),this.topSide.style.position="absolute",this.topSide.style.left=`${t.left}px`,this.topSide.style.top="0px",this.topSide.style.width=`${t.width+8}px`,this.topSide.style.height=`${t.top}px`,this.topSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.leftSide.style.position="absolute",this.leftSide.style.left="0px",this.leftSide.style.top="0px",this.leftSide.style.width=`${t.left}px`,this.leftSide.style.height="100vh",this.leftSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.bottomSide.style.position="absolute",this.bottomSide.style.left=`${t.left}px`,this.bottomSide.style.top=`${t.bottom+8}px`,this.bottomSide.style.width=`${t.width+8}px`,this.bottomSide.style.height="100vh",this.bottomSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.rightSide.style.position="absolute",this.rightSide.style.left=`${t.right+8}px`,this.rightSide.style.top="0px",this.rightSide.style.width="100%",this.rightSide.style.height="100vh",this.rightSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.screenshotModal.style.backgroundColor="transparent"},this.handleMouseClickedSelectedElement=e=>{e.preventDefault(),this.elementSelected&&this.elementSelected.classList.add("feedback-modal-element-selected");let t=this.elementSelected.getBoundingClientRect().top;this.elementSelected.style.top=`${t+window.pageYOffset}px`;const o=this.elementSelected.cloneNode(!0);document.body.appendChild(o),this.elementSelected.style.top=`${t}px`,this.encodedScreenshot=a.toPng(document.body,{cacheBust:!0}).then((function(e){return document.body.removeChild(o),e})).catch((function(e){return console.error("oops, something went wrong!",e),""})),document.getElementsByTagName("html")[0].style.overflow="hidden",this.hasSelectedElement=!0,this.overlay.style.display="block",this.showModal=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formError=!1,this.encodedScreenshot=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1}componentWillLoad(){this.formEmail=this.email}handleMessageInput(e){this.formMessage=e.target.value}handleEmailInput(e){this.formEmail=e.target.value}render(){return t("div",{class:"feedback-modal-wrapper"},this.showScreenshotMode&&t("div",{class:"feedback-modal-screenshot",ref:e=>this.screenshotModal=e,onMouseMove:this.handleMouseOverScreenShot},t("div",{class:"feedback-modal-screenshot-element-selected",ref:e=>this.elementSelected=e,onClick:this.handleMouseClickedSelectedElement}),t("div",{class:"top-side",ref:e=>this.topSide=e}),t("div",{class:"left-side",ref:e=>this.leftSide=e}),t("div",{class:"bottom-side",ref:e=>this.bottomSide=e}),t("div",{class:"right-side",ref:e=>this.rightSide=e}),t("div",{class:"feedback-modal-screenshot-header",onClick:this.closeScreenShot},t("span",null,this.screenshotTopbarText),t("span",{class:"feedback-modal-screenshot-close"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-screenshot-overlay",ref:e=>this.overlay=e})),this.showModal&&t("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition}`,ref:e=>this.modalContent=e},t("div",{class:"feedback-modal-header"},this.formSuccess||this.formError?this.formSuccess?t("span",{class:"text-center"},this.successModalTitle):this.formError?t("span",{class:"text-center"},this.errorModalTitle):t("span",null):t("span",null,this.modalTitle),t("button",{class:"feedback-modal-close",onClick:this.close},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#ccc","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-body"},this.formSuccess||this.formError?t("span",null):t("form",{onSubmit:this.handleSubmit},t("div",{class:"feedback-modal-text"},t("textarea",{placeholder:this.messagePlaceholder,value:this.formMessage,onInput:e=>this.handleMessageInput(e),required:!0})),!this.email&&t("div",{class:"feedback-modal-email"},t("input",{type:"email",placeholder:this.emailPlaceholder,onInput:e=>this.handleEmailInput(e),value:this.formEmail})),t("div",{class:"feedback-modal-buttons"},t("button",{type:"button",class:"button"+(this.encodedScreenshot?" active":""),title:this.screenshotButtonTooltipText,onClick:this.openScreenShot,disabled:this.sending},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-camera"},t("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t("circle",{cx:"12",cy:"13",r:"4"}))),t("button",{class:"button",type:"submit",disabled:this.sending},this.sendButtonText)))),t("div",{class:"feedback-modal-footer"},t("div",{class:"feedback-logo"},t("svg",{class:"w-8 h-8",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},t("defs",null,t("radialGradient",{cx:"21.152%",cy:"86.063%",fx:"21.152%",fy:"86.063%",r:"79.941%",id:"footer-logo"},t("stop",{"stop-color":"#4FD1C5",offset:"0%"}),t("stop",{"stop-color":"#81E6D9",offset:"25.871%"}),t("stop",{"stop-color":"#338CF5",offset:"100%"}))),t("rect",{width:"32",height:"32",rx:"16",fill:"url(#footer-logo)","fill-rule":"nonzero"}))," ",t("a",{href:"https://pushfeedback.com"},"PushFeedback")))))}};s.style=".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300}.feedback-modal-content.feedback-modal-content--center{left:50%;top:50%;transform:translate(-50%, -50%)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;justify-content:space-between}.button{background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";export{n as feedback_button,s as feedback_modal}
@@ -1,2 +0,0 @@
1
- let e,n,t=!1,l=!1;const s="http://www.w3.org/1999/xlink",o={},i=e=>"object"==(e=typeof e)||"function"===e;function r(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const c=(e,n,...t)=>{let l=null,s=null,o=!1,r=!1;const c=[],f=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!i(l))&&(l+=""),o&&r?c[c.length-1].t+=l:c.push(o?u(null,l):l),r=o)};if(f(t),n){n.key&&(s=n.key);{const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}}const a=u(e,null);return a.l=n,c.length>0&&(a.o=c),a.i=s,a},u=(e,n)=>({u:0,h:e,t:n,p:null,o:null,l:null,i:null}),f={},a=new WeakMap,d=e=>"sc-"+e.$,h=(e,n,t,l,o,r)=>{if(t!==l){let c=D(e,n),u=n.toLowerCase();if("class"===n){const n=e.classList,s=$(t),o=$(l);n.remove(...s.filter((e=>e&&!o.includes(e)))),n.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===n){for(const n in t)l&&null!=l[n]||(n.includes("-")?e.style.removeProperty(n):e.style[n]="");for(const n in l)t&&l[n]===t[n]||(n.includes("-")?e.style.setProperty(n,l[n]):e.style[n]=l[n])}else if("key"===n);else if("ref"===n)l&&l(e);else if(c||"o"!==n[0]||"n"!==n[1]){const f=i(l);if((c||f&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[n]=l;else{const s=null==l?"":l;"list"===n?c=!1:null!=t&&e[n]==s||(e[n]=s)}}catch(e){}let a=!1;u!==(u=u.replace(/^xlink\:?/,""))&&(n=u,a=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(n)||(a?e.removeAttributeNS(s,n):e.removeAttribute(n)):(!c||4&r||o)&&!f&&(l=!0===l?"":l,a?e.setAttributeNS(s,n,l):e.setAttribute(n,l))}else n="-"===n[2]?n.slice(3):D(B,u)?u.slice(2):u[2]+n.slice(3),t&&I.rel(e,n,t,!1),l&&I.ael(e,n,l,!1)}},p=/\s/,$=e=>e?e.split(p):[],y=(e,n,t,l)=>{const s=11===n.p.nodeType&&n.p.host?n.p.host:n.p,i=e&&e.l||o,r=n.l||o;for(l in i)l in r||h(s,l,i[l],void 0,t,n.u);for(l in r)h(s,l,i[l],r[l],t,n.u)},m=(n,l,s)=>{const o=l.o[s];let i,r,c=0;if(null!==o.t)i=o.p=G.createTextNode(o.t);else{if(t||(t="svg"===o.h),i=o.p=G.createElementNS(t?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.h),t&&"foreignObject"===o.h&&(t=!1),y(null,o,t),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),o.o)for(c=0;c<o.o.length;++c)r=m(n,o,c),r&&i.appendChild(r);"svg"===o.h?t=!1:"foreignObject"===i.tagName&&(t=!0)}return i},w=(e,t,l,s,o,i)=>{let r,c=e;for(c.shadowRoot&&c.tagName===n&&(c=c.shadowRoot);o<=i;++o)s[o]&&(r=m(null,l,o),r&&(s[o].p=r,c.insertBefore(r,t)))},b=(e,n,t,l,s)=>{for(;n<=t;++n)(l=e[n])&&(s=l.p,S(l),s.remove())},v=(e,n)=>e.h===n.h&&e.i===n.i,g=(e,n)=>{const l=n.p=e.p,s=e.o,o=n.o,i=n.h,r=n.t;null===r?(t="svg"===i||"foreignObject"!==i&&t,"slot"===i||y(e,n,t),null!==s&&null!==o?((e,n,t,l)=>{let s,o,i=0,r=0,c=0,u=0,f=n.length-1,a=n[0],d=n[f],h=l.length-1,p=l[0],$=l[h];for(;i<=f&&r<=h;)if(null==a)a=n[++i];else if(null==d)d=n[--f];else if(null==p)p=l[++r];else if(null==$)$=l[--h];else if(v(a,p))g(a,p),a=n[++i],p=l[++r];else if(v(d,$))g(d,$),d=n[--f],$=l[--h];else if(v(a,$))g(a,$),e.insertBefore(a.p,d.p.nextSibling),a=n[++i],$=l[--h];else if(v(d,p))g(d,p),e.insertBefore(d.p,a.p),d=n[--f],p=l[++r];else{for(c=-1,u=i;u<=f;++u)if(n[u]&&null!==n[u].i&&n[u].i===p.i){c=u;break}c>=0?(o=n[c],o.h!==p.h?s=m(n&&n[r],t,c):(g(o,p),n[c]=void 0,s=o.p),p=l[++r]):(s=m(n&&n[r],t,r),p=l[++r]),s&&a.p.parentNode.insertBefore(s,a.p)}i>f?w(e,null==l[h+1]?null:l[h+1].p,t,l,r,h):r>h&&b(n,i,f)})(l,s,n,o):null!==o?(null!==e.t&&(l.textContent=""),w(l,null,n,o,0,o.length-1)):null!==s&&b(s,0,s.length-1),t&&"svg"===i&&(t=!1)):e.t!==r&&(l.data=r)},S=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(S)},j=(e,n)=>{n&&!e.m&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.m=n)))},k=(e,n)=>{if(e.u|=16,!(4&e.u))return j(e,e.v),te((()=>O(e,n)));e.u|=512},O=(e,n)=>{const t=e.g;let l;return n&&(l=P(t,"componentWillLoad")),E(l,(()=>M(e,t,n)))},M=async(e,n,t)=>{const l=e.S,s=l["s-rc"];t&&(e=>{const n=e.j,t=e.S,l=n.u,s=((e,n)=>{var t;let l=d(n);const s=z.get(l);if(e=11===e.nodeType?e:G,s)if("string"==typeof s){let n,o=a.get(e=e.head||e);if(o||a.set(e,o=new Set),!o.has(l)){{n=G.createElement("style"),n.innerHTML=s;const l=null!==(t=I.k)&&void 0!==t?t:r(G);null!=l&&n.setAttribute("nonce",l),e.insertBefore(n,e.querySelector("link"))}o&&o.add(l)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=s,t.classList.add(s+"-h"))})(e);x(e,n),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const n=l["s-p"],t=()=>C(e);0===n.length?t():(Promise.all(n).then(t),e.u|=4,n.length=0)}},x=(t,l)=>{try{l=l.render(),t.u&=-17,t.u|=2,((t,l)=>{const s=t.S,o=t.j,i=t.O||u(null,null),r=(e=>e&&e.h===f)(l)?l:c(null,null,l);n=s.tagName,o.M&&(r.l=r.l||{},o.M.map((([e,n])=>r.l[n]=s[e]))),r.h=null,r.u|=4,t.O=r,r.p=i.p=s.shadowRoot||s,e=s["s-sc"],g(i,r)})(t,l)}catch(e){F(e,t.S)}return null},C=e=>{const n=e.S,t=e.g,l=e.v;64&e.u||(e.u|=64,N(n),P(t,"componentDidLoad"),e.C(n),l||L()),e.m&&(e.m(),e.m=void 0),512&e.u&&ne((()=>k(e,!1))),e.u&=-517},L=()=>{N(G.documentElement),ne((()=>(e=>{const n=I.ce("appload",{detail:{namespace:"pushfeedback"}});return e.dispatchEvent(n),n})(B)))},P=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){F(e)}},E=(e,n)=>e&&e.then?e.then(n):n(),N=e=>e.classList.add("hydrated"),T=(e,n,t)=>{if(n.L){const l=Object.entries(n.L),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&t&&32&l)&&Object.defineProperty(s,e,{get(){return((e,n)=>R(this).P.get(n))(0,e)},set(t){((e,n,t,l)=>{const s=R(e),o=s.P.get(n),r=s.u,c=s.g;t=((e,n)=>null==e||i(e)?e:4&n?"false"!==e&&(""===e||!!e):1&n?e+"":e)(t,l.L[n][0]),8&r&&void 0!==o||t===o||Number.isNaN(o)&&Number.isNaN(t)||(s.P.set(n,t),c&&2==(18&r)&&k(s,!1))})(this,e,t,n)},configurable:!0,enumerable:!0})})),1&t){const t=new Map;s.attributeChangedCallback=function(e,n,l){I.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,n])=>15&n[0])).map((([e,l])=>{const s=l[1]||e;return t.set(s,e),512&l[0]&&n.M.push([e,s]),s}))}}return e},W=(e,n={})=>{var t;const l=[],s=n.exclude||[],o=B.customElements,i=G.head,c=i.querySelector("meta[charset]"),u=G.createElement("style"),f=[];let a,h=!0;Object.assign(I,n),I.N=new URL(n.resourcesUrl||"./",G.baseURI).href,e.map((e=>{e[1].map((n=>{const t={u:n[0],$:n[1],L:n[2],T:n[3]};t.L=n[2],t.M=[];const i=t.$,r=class extends HTMLElement{constructor(e){super(e),q(e=this,t),1&t.u&&e.attachShadow({mode:"open"})}connectedCallback(){a&&(clearTimeout(a),a=null),h?f.push(this):I.jmp((()=>(e=>{if(0==(1&I.u)){const n=R(e),t=n.j,l=()=>{};if(!(1&n.u)){n.u|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){j(n,n.v=t);break}}t.L&&Object.entries(t.L).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t,l,s)=>{if(0==(32&n.u)){{if(n.u|=32,(s=_(t)).then){const e=()=>{};s=await s,e()}s.isProxied||(T(s,t,2),s.isProxied=!0);const e=()=>{};n.u|=8;try{new s(n)}catch(e){F(e)}n.u&=-9,e()}if(s.style){let e=s.style;const n=d(t);if(!z.has(n)){const l=()=>{};((e,n,t)=>{let l=z.get(e);K&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,z.set(e,l)})(n,e,!!(1&t.u)),l()}}}const o=n.v,i=()=>k(n,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,n,t)}l()}})(this)))}disconnectedCallback(){I.jmp((()=>{}))}componentOnReady(){return R(this).W}};t.A=e[0],s.includes(i)||o.get(i)||(l.push(i),o.define(i,T(r,t,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(t=I.k)&&void 0!==t?t:r(G);null!=e&&u.setAttribute("nonce",e),i.insertBefore(u,c?c.nextSibling:i.firstChild)}h=!1,f.length?f.map((e=>e.connectedCallback())):I.jmp((()=>a=setTimeout(L,30)))},A=e=>I.k=e,H=new WeakMap,R=e=>H.get(e),U=(e,n)=>H.set(n.g=e,n),q=(e,n)=>{const t={u:0,S:e,j:n,P:new Map};return t.W=new Promise((e=>t.C=e)),e["s-p"]=[],e["s-rc"]=[],H.set(e,t)},D=(e,n)=>n in e,F=(e,n)=>(0,console.error)(e,n),V=new Map,_=e=>{const n=e.$.replace(/-/g,"_"),t=e.A,l=V.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(V.set(t,e),e[n])),F)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},z=new Map,B="undefined"!=typeof window?window:{},G=B.document||{head:{}},I={u:0,N:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},J=e=>Promise.resolve(e),K=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),Q=[],X=[],Y=(e,n)=>t=>{e.push(t),l||(l=!0,n&&4&I.u?ne(ee):I.raf(ee))},Z=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){F(e)}e.length=0},ee=()=>{Z(Q),Z(X),(l=Q.length>0)&&I.raf(ee)},ne=e=>J().then(e),te=Y(X,!0);export{f as H,W as b,c as h,J as p,U as r,A as s}