@diabolic/pointy 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -87,6 +87,7 @@ pointy.show();
87
87
  | `offsetY` | `number` | `16` | Vertical offset from target |
88
88
  | `initialPosition` | `string` | `'center'` | Starting position preset |
89
89
  | `tracking` | `boolean` | `true` | Enable real-time target tracking |
90
+ | `zIndex` | `number` | `9999` | CSS z-index for the container |
90
91
 
91
92
  **Initial Position Presets:** `'center'`, `'top-left'`, `'top-center'`, `'top-right'`, `'middle-left'`, `'middle-right'`, `'bottom-left'`, `'bottom-center'`, `'bottom-right'`, `'first-step'`
92
93
 
@@ -137,10 +138,10 @@ pointy.reset(); // Reset to initial position
137
138
  ### Content
138
139
 
139
140
  ```javascript
140
- pointy.setMessages('New message'); // Replace all messages
141
+ pointy.setMessage('Single message'); // Replace all with single message
141
142
  pointy.setMessages(['Message 1', 'Message 2']); // Set multiple messages
142
143
 
143
- pointy.setMessage('Updated text'); // Update current message only
144
+ pointy.setCurrentMessage('Updated text'); // Update message at current index only
144
145
 
145
146
  pointy.nextMessage();
146
147
  pointy.prevMessage();
@@ -190,6 +191,7 @@ pointy.setFloatingAnimation(true);
190
191
  pointy.setOffset(30, 20);
191
192
  pointy.setInitialPosition('top-left');
192
193
  pointy.setInitialPositionOffset(50);
194
+ pointy.setZIndex(10000);
193
195
 
194
196
  // Tracking
195
197
  pointy.setTracking(true);
@@ -300,7 +302,7 @@ pointy.on('all', (data) => {
300
302
  | Event | Data |
301
303
  |-------|------|
302
304
  | `messagesSet` | `{ messages, total, animated, cyclePaused }` |
303
- | `messageUpdate` | `{ index, message, oldMessage, total, animated }` |
305
+ | `currentMessageUpdate` | `{ index, message, oldMessage, total, animated }` |
304
306
  | `messageChange` | `{ fromIndex, toIndex, message, total, isAuto? }` |
305
307
 
306
308
  #### Message Cycle
@@ -353,6 +355,62 @@ All setter methods emit `*Change` events with `{ from, to }` data.
353
355
  }
354
356
  ```
355
357
 
358
+ ### Custom Class Names
359
+
360
+ Customize class prefix or override specific class names:
361
+
362
+ ```javascript
363
+ // Change prefix (default: 'pointy')
364
+ const pointy = new Pointy({
365
+ classPrefix: 'my-tour', // → .my-tour-container, .my-tour-bubble, etc.
366
+ steps: [...]
367
+ });
368
+
369
+ // Override specific suffixes
370
+ const pointy = new Pointy({
371
+ classSuffixes: {
372
+ container: 'wrapper', // → .pointy-wrapper instead of .pointy-container
373
+ bubble: 'tooltip' // → .pointy-tooltip instead of .pointy-bubble
374
+ },
375
+ steps: [...]
376
+ });
377
+
378
+ // Full class name override
379
+ const pointy = new Pointy({
380
+ classNames: {
381
+ container: 'custom-container',
382
+ pointer: 'custom-pointer',
383
+ bubble: 'custom-bubble',
384
+ bubbleText: 'custom-text',
385
+ hidden: 'is-hidden',
386
+ visible: 'is-visible',
387
+ moving: 'is-moving'
388
+ },
389
+ steps: [...]
390
+ });
391
+ ```
392
+
393
+ **Default Class Names:**
394
+
395
+ | Key | Default | Description |
396
+ |-----|---------|-------------|
397
+ | `container` | `pointy-container` | Main wrapper element |
398
+ | `pointer` | `pointy-pointer` | Pointer/cursor element |
399
+ | `bubble` | `pointy-bubble` | Message bubble |
400
+ | `bubbleText` | `pointy-bubble-text` | Text inside bubble |
401
+ | `hidden` | `pointy-hidden` | Hidden state |
402
+ | `visible` | `pointy-visible` | Visible state |
403
+ | `moving` | `pointy-moving` | During animation |
404
+
405
+ ### CSS Variable Prefix
406
+
407
+ ```javascript
408
+ const pointy = new Pointy({
409
+ cssVarPrefix: 'tour', // → --tour-duration, --tour-easing, etc.
410
+ steps: [...]
411
+ });
412
+ ```
413
+
356
414
  ### Custom Pointer SVG
357
415
 
358
416
  ```javascript
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Pointy - A lightweight tooltip library with animated pointer
3
- * @version 1.0.3
3
+ * @version 1.1.0
4
4
  * @license MIT
5
5
  */
6
6
  /**
@@ -25,6 +25,7 @@
25
25
  * - steps {Array<{target, content, direction?, duration?}>} - Tour steps
26
26
  * - target {string|HTMLElement} - Initial target element
27
27
  * - content {string|string[]} - Initial content/messages (single-step use)
28
+ * - zIndex {number} - CSS z-index for the container (default: 9999)
28
29
  * - offsetX {number} - Horizontal offset from target (default: 20)
29
30
  * - offsetY {number} - Vertical offset from target (default: 16)
30
31
  * - trackingFps {number} - Position update FPS, 0 = unlimited (default: 60)
@@ -79,8 +80,8 @@
79
80
  * - introAnimationEnd: Initial fade-in animation completed
80
81
  *
81
82
  * Content:
82
- * - messagesSet: Messages array replaced via setMessages()
83
- * - messageUpdate: Single message updated via setMessage()
83
+ * - messagesSet: Messages array replaced via setMessages() or setMessage()
84
+ * - currentMessageUpdate: Current message updated via setCurrentMessage()
84
85
  * - messageChange: Message changed (navigation or auto-cycle)
85
86
  *
86
87
  * Message Cycle:
@@ -132,7 +133,7 @@
132
133
  * Core: show(), hide(), destroy()
133
134
  * Navigation: next(), prev(), goToStep(index), reset(), restart()
134
135
  * Custom Target: pointTo(target, content?, direction?)
135
- * Content: setMessages(content), setMessage(msg), nextMessage(), prevMessage(), goToMessage(index)
136
+ * Content: setMessages(content), setMessage(msg), setCurrentMessage(msg), nextMessage(), prevMessage(), goToMessage(index)
136
137
  * Message Cycle: startMessageCycle(interval?), stopMessageCycle(), pauseMessageCycle(), resumeMessageCycle()
137
138
  * Autoplay: startAutoplay(), stopAutoplay(), pauseAutoplay(), resumeAutoplay()
138
139
  * Animation: animateToInitialPosition()
@@ -141,8 +142,8 @@
141
142
  *
142
143
  * Setters (all emit change events):
143
144
  * setEasing(), setAnimationDuration(), setIntroFadeDuration(), setBubbleFadeDuration(),
144
- * setMessageInterval(), setMessageTransitionDuration(), setOffset(), setResetOnComplete(),
145
- * setFloatingAnimation(), setInitialPosition(), setInitialPositionOffset(),
145
+ * setMessageInterval(), setMessageTransitionDuration(), setOffset(), setZIndex(),
146
+ * setResetOnComplete(), setFloatingAnimation(), setInitialPosition(), setInitialPositionOffset(),
146
147
  * setAutoplay(), setAutoplayWaitForMessages()
147
148
  *
148
149
  * Static Helpers:
@@ -248,7 +249,6 @@ class Pointy {
248
249
 
249
250
  .${cn.container} {
250
251
  position: absolute;
251
- z-index: 9999;
252
252
  font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
253
253
  --${vp}-duration: 1000ms;
254
254
  --${vp}-easing: cubic-bezier(0, 0.55, 0.45, 1);
@@ -440,6 +440,7 @@ class Pointy {
440
440
  Pointy.injectStyles(this.classNames, this.cssVarPrefix);
441
441
 
442
442
  this.steps = options.steps || [];
443
+ this.zIndex = options.zIndex !== undefined ? options.zIndex : 9999; // CSS z-index
443
444
  this.offsetX = options.offsetX !== undefined ? options.offsetX : 20;
444
445
  this.offsetY = options.offsetY !== undefined ? options.offsetY : 16;
445
446
  this.tracking = options.tracking !== undefined ? options.tracking : true; // Enable/disable position tracking
@@ -492,6 +493,7 @@ class Pointy {
492
493
  // Create DOM elements - pointer is the anchor, bubble positioned relative to it
493
494
  this.container = document.createElement('div');
494
495
  this.container.className = `${this.classNames.container} ${this.classNames.hidden}`;
496
+ this.container.style.zIndex = this.zIndex;
495
497
  this.container.style.setProperty(`--${this.cssVarPrefix}-duration`, `${this.animationDuration}ms`);
496
498
  this.container.style.setProperty(`--${this.cssVarPrefix}-easing`, this._resolveEasing(this.easing));
497
499
  this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`, `${this.bubbleFadeDuration}ms`);
@@ -1311,11 +1313,11 @@ class Pointy {
1311
1313
  }
1312
1314
 
1313
1315
  /**
1314
- * Set/update the current message (at current index)
1316
+ * Update the message at current index only (does not replace all messages)
1315
1317
  * @param {string} message - New message content
1316
1318
  * @param {boolean} animate - Whether to animate the change (default: true)
1317
1319
  */
1318
- setMessage(message, animate = true) {
1320
+ setCurrentMessage(message, animate = true) {
1319
1321
  const oldMessage = this.currentMessages[this.currentMessageIndex];
1320
1322
  this.currentMessages[this.currentMessageIndex] = message;
1321
1323
 
@@ -1326,7 +1328,7 @@ class Pointy {
1326
1328
  this.updatePosition();
1327
1329
  }
1328
1330
 
1329
- this._emit('messageUpdate', {
1331
+ this._emit('currentMessageUpdate', {
1330
1332
  index: this.currentMessageIndex,
1331
1333
  message: message,
1332
1334
  oldMessage: oldMessage,
@@ -1335,6 +1337,15 @@ class Pointy {
1335
1337
  });
1336
1338
  }
1337
1339
 
1340
+ /**
1341
+ * Set a single message (replaces all messages with one)
1342
+ * @param {string} message - Message content
1343
+ * @param {boolean} animate - Whether to animate the change (default: true)
1344
+ */
1345
+ setMessage(message, animate = true) {
1346
+ this.setMessages(message, animate);
1347
+ }
1348
+
1338
1349
  /**
1339
1350
  * Set messages programmatically (replaces current messages)
1340
1351
  * @param {string|string[]} content - Single message or array of messages
@@ -1397,6 +1408,19 @@ class Pointy {
1397
1408
  this._emit('targetChange', { from: oldTarget, to: this.targetElement });
1398
1409
  }
1399
1410
 
1411
+ /**
1412
+ * Set the z-index of the container
1413
+ * @param {number} zIndex - CSS z-index value
1414
+ */
1415
+ setZIndex(zIndex) {
1416
+ const oldValue = this.zIndex;
1417
+ if (oldValue === zIndex) return;
1418
+
1419
+ this.zIndex = zIndex;
1420
+ this.container.style.zIndex = zIndex;
1421
+ this._emit('zIndexChange', { from: oldValue, to: zIndex });
1422
+ }
1423
+
1400
1424
  setOffset(offsetX, offsetY) {
1401
1425
  const oldOffsetX = this.offsetX;
1402
1426
  const oldOffsetY = this.offsetY;
package/dist/pointy.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Pointy - A lightweight tooltip library with animated pointer
3
- * @version 1.0.3
3
+ * @version 1.1.0
4
4
  * @license MIT
5
5
  */
6
6
  (function (global, factory) {
@@ -31,6 +31,7 @@
31
31
  * - steps {Array<{target, content, direction?, duration?}>} - Tour steps
32
32
  * - target {string|HTMLElement} - Initial target element
33
33
  * - content {string|string[]} - Initial content/messages (single-step use)
34
+ * - zIndex {number} - CSS z-index for the container (default: 9999)
34
35
  * - offsetX {number} - Horizontal offset from target (default: 20)
35
36
  * - offsetY {number} - Vertical offset from target (default: 16)
36
37
  * - trackingFps {number} - Position update FPS, 0 = unlimited (default: 60)
@@ -85,8 +86,8 @@
85
86
  * - introAnimationEnd: Initial fade-in animation completed
86
87
  *
87
88
  * Content:
88
- * - messagesSet: Messages array replaced via setMessages()
89
- * - messageUpdate: Single message updated via setMessage()
89
+ * - messagesSet: Messages array replaced via setMessages() or setMessage()
90
+ * - currentMessageUpdate: Current message updated via setCurrentMessage()
90
91
  * - messageChange: Message changed (navigation or auto-cycle)
91
92
  *
92
93
  * Message Cycle:
@@ -138,7 +139,7 @@
138
139
  * Core: show(), hide(), destroy()
139
140
  * Navigation: next(), prev(), goToStep(index), reset(), restart()
140
141
  * Custom Target: pointTo(target, content?, direction?)
141
- * Content: setMessages(content), setMessage(msg), nextMessage(), prevMessage(), goToMessage(index)
142
+ * Content: setMessages(content), setMessage(msg), setCurrentMessage(msg), nextMessage(), prevMessage(), goToMessage(index)
142
143
  * Message Cycle: startMessageCycle(interval?), stopMessageCycle(), pauseMessageCycle(), resumeMessageCycle()
143
144
  * Autoplay: startAutoplay(), stopAutoplay(), pauseAutoplay(), resumeAutoplay()
144
145
  * Animation: animateToInitialPosition()
@@ -147,8 +148,8 @@
147
148
  *
148
149
  * Setters (all emit change events):
149
150
  * setEasing(), setAnimationDuration(), setIntroFadeDuration(), setBubbleFadeDuration(),
150
- * setMessageInterval(), setMessageTransitionDuration(), setOffset(), setResetOnComplete(),
151
- * setFloatingAnimation(), setInitialPosition(), setInitialPositionOffset(),
151
+ * setMessageInterval(), setMessageTransitionDuration(), setOffset(), setZIndex(),
152
+ * setResetOnComplete(), setFloatingAnimation(), setInitialPosition(), setInitialPositionOffset(),
152
153
  * setAutoplay(), setAutoplayWaitForMessages()
153
154
  *
154
155
  * Static Helpers:
@@ -254,7 +255,6 @@
254
255
 
255
256
  .${cn.container} {
256
257
  position: absolute;
257
- z-index: 9999;
258
258
  font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
259
259
  --${vp}-duration: 1000ms;
260
260
  --${vp}-easing: cubic-bezier(0, 0.55, 0.45, 1);
@@ -446,6 +446,7 @@
446
446
  Pointy.injectStyles(this.classNames, this.cssVarPrefix);
447
447
 
448
448
  this.steps = options.steps || [];
449
+ this.zIndex = options.zIndex !== undefined ? options.zIndex : 9999; // CSS z-index
449
450
  this.offsetX = options.offsetX !== undefined ? options.offsetX : 20;
450
451
  this.offsetY = options.offsetY !== undefined ? options.offsetY : 16;
451
452
  this.tracking = options.tracking !== undefined ? options.tracking : true; // Enable/disable position tracking
@@ -498,6 +499,7 @@
498
499
  // Create DOM elements - pointer is the anchor, bubble positioned relative to it
499
500
  this.container = document.createElement('div');
500
501
  this.container.className = `${this.classNames.container} ${this.classNames.hidden}`;
502
+ this.container.style.zIndex = this.zIndex;
501
503
  this.container.style.setProperty(`--${this.cssVarPrefix}-duration`, `${this.animationDuration}ms`);
502
504
  this.container.style.setProperty(`--${this.cssVarPrefix}-easing`, this._resolveEasing(this.easing));
503
505
  this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`, `${this.bubbleFadeDuration}ms`);
@@ -1317,11 +1319,11 @@
1317
1319
  }
1318
1320
 
1319
1321
  /**
1320
- * Set/update the current message (at current index)
1322
+ * Update the message at current index only (does not replace all messages)
1321
1323
  * @param {string} message - New message content
1322
1324
  * @param {boolean} animate - Whether to animate the change (default: true)
1323
1325
  */
1324
- setMessage(message, animate = true) {
1326
+ setCurrentMessage(message, animate = true) {
1325
1327
  const oldMessage = this.currentMessages[this.currentMessageIndex];
1326
1328
  this.currentMessages[this.currentMessageIndex] = message;
1327
1329
 
@@ -1332,7 +1334,7 @@
1332
1334
  this.updatePosition();
1333
1335
  }
1334
1336
 
1335
- this._emit('messageUpdate', {
1337
+ this._emit('currentMessageUpdate', {
1336
1338
  index: this.currentMessageIndex,
1337
1339
  message: message,
1338
1340
  oldMessage: oldMessage,
@@ -1341,6 +1343,15 @@
1341
1343
  });
1342
1344
  }
1343
1345
 
1346
+ /**
1347
+ * Set a single message (replaces all messages with one)
1348
+ * @param {string} message - Message content
1349
+ * @param {boolean} animate - Whether to animate the change (default: true)
1350
+ */
1351
+ setMessage(message, animate = true) {
1352
+ this.setMessages(message, animate);
1353
+ }
1354
+
1344
1355
  /**
1345
1356
  * Set messages programmatically (replaces current messages)
1346
1357
  * @param {string|string[]} content - Single message or array of messages
@@ -1403,6 +1414,19 @@
1403
1414
  this._emit('targetChange', { from: oldTarget, to: this.targetElement });
1404
1415
  }
1405
1416
 
1417
+ /**
1418
+ * Set the z-index of the container
1419
+ * @param {number} zIndex - CSS z-index value
1420
+ */
1421
+ setZIndex(zIndex) {
1422
+ const oldValue = this.zIndex;
1423
+ if (oldValue === zIndex) return;
1424
+
1425
+ this.zIndex = zIndex;
1426
+ this.container.style.zIndex = zIndex;
1427
+ this._emit('zIndexChange', { from: oldValue, to: zIndex });
1428
+ }
1429
+
1406
1430
  setOffset(offsetX, offsetY) {
1407
1431
  const oldOffsetX = this.offsetX;
1408
1432
  const oldOffsetY = this.offsetY;
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Pointy=e()}(this,function(){"use strict";class t{static EASINGS={default:"cubic-bezier(0, 0.55, 0.45, 1)",standard:"cubic-bezier(0.4, 0, 0.2, 1)",decelerate:"cubic-bezier(0, 0, 0.2, 1)",accelerate:"cubic-bezier(0.4, 0, 1, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",elastic:"cubic-bezier(0.68, -0.6, 0.32, 1.6)",smooth:"cubic-bezier(0.45, 0, 0.55, 1)",snap:"cubic-bezier(0.5, 0, 0.1, 1)","expo-out":"cubic-bezier(0.19, 1, 0.22, 1)","circ-out":"cubic-bezier(0.075, 0.82, 0.165, 1)","back-out":"cubic-bezier(0.175, 0.885, 0.32, 1.275)"};static POINTER_SVG='\n <svg xmlns="http://www.w3.org/2000/svg" width="33" height="33" fill="none" viewBox="0 0 33 33">\n <g filter="url(#pointy-shadow)">\n <path fill="#0a1551" d="m18.65 24.262 6.316-14.905c.467-1.103-.645-2.215-1.748-1.747L8.313 13.925c-1.088.461-1.083 2.004.008 2.459l5.049 2.104c.325.135.583.393.718.718l2.104 5.049c.454 1.09 1.997 1.095 2.458.007"/>\n </g>\n <defs>\n <filter id="pointy-shadow" width="32.576" height="32.575" x="0" y="0" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>\n <feOffset/>\n <feGaussianBlur stdDeviation="3.75"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend in2="BackgroundImageFix" result="effect1_dropShadow"/>\n <feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>\n </filter>\n </defs>\n </svg>\n ';static DEFAULT_CLASS_PREFIX="pointy";static DEFAULT_CLASS_SUFFIXES={container:"container",pointer:"pointer",bubble:"bubble",bubbleText:"bubble-text",hidden:"hidden",visible:"visible",moving:"moving"};static generateClassNames(e=t.DEFAULT_CLASS_PREFIX,s={}){const i={...t.DEFAULT_CLASS_SUFFIXES,...s};return{container:`${e}-${i.container}`,pointer:`${e}-${i.pointer}`,bubble:`${e}-${i.bubble}`,bubbleText:`${e}-${i.bubbleText}`,hidden:`${e}-${i.hidden}`,visible:`${e}-${i.visible}`,moving:`${e}-${i.moving}`}}static DEFAULT_CSS_VAR_PREFIX="pointy";static generateStyles(t,e="pointy"){const s=t,i=e;return`\n @keyframes ${s.container}-float {\n 0%, 100% {\n transform: translateY(0px);\n }\n 50% {\n transform: translateY(-8px);\n }\n }\n\n .${s.container} {\n position: absolute;\n z-index: 9999;\n font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --${i}-duration: 1000ms;\n --${i}-easing: cubic-bezier(0, 0.55, 0.45, 1);\n --${i}-bubble-fade: 500ms;\n transition: left var(--${i}-duration) var(--${i}-easing), top var(--${i}-duration) var(--${i}-easing), opacity 0.3s ease;\n animation: ${s.container}-float 3s ease-in-out infinite;\n }\n\n .${s.container}.${s.moving} {\n animation-play-state: paused;\n }\n\n .${s.container}.${s.hidden} {\n opacity: 0;\n pointer-events: none;\n }\n\n .${s.container}.${s.visible} {\n opacity: 1;\n }\n\n .${s.pointer} {\n width: 33px;\n height: 33px;\n transition: transform var(--${i}-duration) var(--${i}-easing);\n }\n\n .${s.bubble} {\n position: absolute;\n right: 26px;\n top: 0;\n background: #0a1551;\n color: white;\n padding: 4px 12px;\n border-radius: 14px;\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);\n white-space: nowrap;\n overflow: hidden;\n transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform var(--${i}-duration) var(--${i}-easing), opacity var(--${i}-bubble-fade) ease;\n }\n\n .${s.bubbleText} {\n display: inline-block;\n }\n `}static injectedStyleKeys=new Set;static injectStyles(e,s="pointy"){const i=JSON.stringify(e)+s;if(t.injectedStyleKeys.has(i))return;if(!t.fontInjected){const e=document.createElement("link");e.href="https://cdn.jotfor.ms/fonts/?family=Circular",e.rel="stylesheet",document.head.appendChild(e),t.fontInjected=!0}const n=document.createElement("style");n.id=`pointy-styles-${i.length}`,n.textContent=t.generateStyles(e,s),document.head.appendChild(n),t.injectedStyleKeys.add(i)}static fontInjected=!1;static getTargetElement(t){return"string"==typeof t?document.querySelector(t):t}static animateText(e,s,i=500,n=null,a=null){const o=.4*i,r=.6*i;let h=null,l=null;if(n){const e=document.createElement("div");e.style.cssText="visibility: hidden; position: absolute; padding: 4px 12px;",t.renderContent(e,s),n.appendChild(e),h=e.offsetWidth,l=e.offsetHeight,n.removeChild(e);const i=n.offsetWidth,a=n.offsetHeight;n.style.width=i+"px",n.style.height=a+"px"}e.style.transition=`clip-path ${o}ms ease-in`,e.style.clipPath="inset(0 0 0 100%)",setTimeout(()=>{t.renderContent(e,s),n&&null!==h&&(n.style.width=h+"px",n.style.height=l+"px"),e.style.transition="none",e.style.clipPath="inset(0 100% 0 0)",e.offsetHeight,e.style.transition=`clip-path ${r}ms ease-out`,e.style.clipPath="inset(0 0 0 0)",n&&setTimeout(()=>{n.style.width="",n.style.height=""},r+100),a&&a()},o)}static renderContent(t,e){if(e&&"object"==typeof e&&e.$$typeof)if("undefined"!=typeof ReactDOM&&ReactDOM.createRoot){const s=ReactDOM.createRoot(t);s.render(e),t._reactRoot=s}else"undefined"!=typeof ReactDOM&&ReactDOM.render?ReactDOM.render(e,t):(console.warn("Pointy: React element passed but ReactDOM not found"),t.innerHTML=String(e));else t.innerHTML=e}constructor(e={}){if(this.classPrefix=e.classPrefix||t.DEFAULT_CLASS_PREFIX,this.classNames=t.generateClassNames(this.classPrefix,e.classSuffixes),e.classNames&&(this.classNames={...this.classNames,...e.classNames}),this.cssVarPrefix=e.cssVarPrefix||this.classPrefix,this.pointerSvg=e.pointerSvg||t.POINTER_SVG,t.injectStyles(this.classNames,this.cssVarPrefix),this.steps=e.steps||[],this.offsetX=void 0!==e.offsetX?e.offsetX:20,this.offsetY=void 0!==e.offsetY?e.offsetY:16,this.tracking=void 0===e.tracking||e.tracking,this.trackingFps=void 0!==e.trackingFps?e.trackingFps:60,this.animationDuration=void 0!==e.animationDuration?e.animationDuration:1e3,this.introFadeDuration=void 0!==e.introFadeDuration?e.introFadeDuration:1e3,this.bubbleFadeDuration=void 0!==e.bubbleFadeDuration?e.bubbleFadeDuration:500,this.messageTransitionDuration=void 0!==e.messageTransitionDuration?e.messageTransitionDuration:500,this.easing=void 0!==e.easing?e.easing:"default",this.resetOnComplete=void 0===e.resetOnComplete||e.resetOnComplete,this.floatingAnimation=void 0===e.floatingAnimation||e.floatingAnimation,this.initialPosition=e.initialPosition||"center",this.initialPositionOffset=void 0!==e.initialPositionOffset?e.initialPositionOffset:32,this.resetPositionOnHide=void 0!==e.resetPositionOnHide&&e.resetPositionOnHide,this.autoplay=e.autoplay||null,this.autoplayEnabled=void 0!==e.autoplayEnabled&&e.autoplayEnabled,this.autoplayWaitForMessages=void 0===e.autoplayWaitForMessages||e.autoplayWaitForMessages,this.hideOnComplete=void 0===e.hideOnComplete||e.hideOnComplete,this.hideOnCompleteDelay=void 0!==e.hideOnCompleteDelay?e.hideOnCompleteDelay:null,this._autoplayTimeoutId=null,this._autoplayPaused=!1,this._messagesCompletedForStep=!1,this._hideOnCompleteTimeoutId=null,this.onStepChange=e.onStepChange,this.onComplete=e.onComplete,this._eventListeners={},this.targetElement=e.target?t.getTargetElement(e.target):null,this.currentStepIndex=0,this.currentMessageIndex=0,this.currentMessages=[],this.messageInterval=e.messageInterval||null,this._messageIntervalId=null,this.isVisible=!1,this.isPointingUp=!0,this.lastTargetY=null,this._targetYHistory=[],this._lastDirectionChangeTime=0,this.manualDirection=null,this.moveTimeout=null,this._hasShownBefore=!1,this.steps.length>0&&(this.targetElement=t.getTargetElement(this.steps[0].target)),this.container=document.createElement("div"),this.container.className=`${this.classNames.container} ${this.classNames.hidden}`,this.container.style.setProperty(`--${this.cssVarPrefix}-duration`,`${this.animationDuration}ms`),this.container.style.setProperty(`--${this.cssVarPrefix}-easing`,this._resolveEasing(this.easing)),this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`,`${this.bubbleFadeDuration}ms`),this.floatingAnimation||(this.container.style.animationPlayState="paused"),this.pointer=document.createElement("div"),this.pointer.className=this.classNames.pointer,t.renderContent(this.pointer,this.pointerSvg),this.bubble=document.createElement("div"),this.bubble.className=this.classNames.bubble,this.bubble.style.transform="translateY(28px)",this.bubbleText=document.createElement("span"),this.bubbleText.className=this.classNames.bubbleText,this.steps.length>0){const e=this.steps[0].content;this.currentMessages=Array.isArray(e)?e:[e],t.renderContent(this.bubbleText,this.currentMessages[0])}else{const s=e.content||"";this.currentMessages=Array.isArray(s)?s:[s],t.renderContent(this.bubbleText,this.currentMessages[0])}this.currentMessageIndex=0,this.bubble.appendChild(this.bubbleText),this.container.appendChild(this.pointer),this.container.appendChild(this.bubble),this.updatePosition=this.updatePosition.bind(this),this._trackPosition=this._trackPosition.bind(this),this._lastTrackTime=0,window.addEventListener("resize",this.updatePosition),window.addEventListener("scroll",this.updatePosition)}_trackPosition(){if(this.isVisible&&this.targetElement){if(this.trackingFps>0){const t=performance.now(),e=1e3/this.trackingFps;t-this._lastTrackTime>=e&&(this._lastTrackTime=t,this.updatePosition(),this._emit("track",{target:this.targetElement,timestamp:t}))}else this.updatePosition(),this._emit("track",{target:this.targetElement,timestamp:performance.now()});this._rafId=requestAnimationFrame(this._trackPosition)}else this._rafId=null}_startTracking(){this.tracking&&(this._rafId||this._trackPosition())}_stopTracking(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null)}updatePosition(){if(!this.targetElement)return;const t=this.targetElement.getBoundingClientRect(),e=window.scrollX,s=window.scrollY;if(null!==this.manualDirection)this.isPointingUp="up"===this.manualDirection;else{const e=t.top+s,i=Date.now();this._targetYHistory.push({y:e,time:i});const n=200;if(this._targetYHistory=this._targetYHistory.filter(t=>i-t.time<n),this._targetYHistory.length>=2){const t=this._targetYHistory[0],e=this._targetYHistory[this._targetYHistory.length-1],s=e.y-t.y;e.time,t.time;const n=30,a=300;if(Math.abs(s)>n&&i-this._lastDirectionChangeTime>a){const t=s<0;t!==this.isPointingUp&&(this.isPointingUp=t,this._lastDirectionChangeTime=i)}}this.lastTargetY=e}let i,n;if(this.isPointingUp)this.pointer.style.transform="rotate(0deg)",i=t.left+e-25+this.offsetX,n=t.bottom+s-8-this.offsetY,this.bubble.style.transform="translateY(28px)";else{this.pointer.style.transform="rotate(90deg)",i=t.left+e-25+this.offsetX,n=t.top+s-25+this.offsetY;const a=this.bubble.offsetHeight||28;this.bubble.style.transform=`translateY(-${a}px)`}this.container.style.left=`${i}px`,this.container.style.top=`${n}px`}show(){if(this._emit("beforeShow",{target:this.targetElement}),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),document.body.contains(this.container)||document.body.appendChild(this.container),!this._hasShownBefore){this._hasShownBefore=!0;const t="first-step"===this.initialPosition,e=this._getInitialPosition(),s=e.x,i=e.y;if(this.container.style.transition=`opacity ${this.introFadeDuration}ms ease`,this.pointer.style.transition="none",this.bubble.style.transition="none",this.bubble.style.opacity="0",this.container.style.left=`${s}px`,this.container.style.top=`${i}px`,t&&void 0!==e.isPointingUp)if(this.isPointingUp=e.isPointingUp,this.isPointingUp)this.pointer.style.transform="rotate(0deg)",this.bubble.style.transform="translateY(28px)";else{this.pointer.style.transform="rotate(90deg)";const t=this.bubble.offsetHeight||28;this.bubble.style.transform=`translateY(-${t}px)`}else this.pointer.style.transform="rotate(0deg)",this.bubble.style.transform="translateY(28px)";return this.container.style.display="flex",this.container.offsetHeight,this.container.classList.remove(this.classNames.hidden),this.container.classList.add(this.classNames.visible),this.isVisible=!0,this._emit("introAnimationStart",{duration:this.introFadeDuration,initialPosition:{x:s,y:i}}),void setTimeout(()=>{if(this._emit("introAnimationEnd",{initialPosition:{x:s,y:i}}),t){this.container.style.transition="none",this.pointer.style.transition="none",this._startTracking();const t=this.currentMessages.length>0&&this.currentMessages.some(t=>""!==t&&null!=t);this.bubble.style.transition=`opacity ${this.bubbleFadeDuration}ms ease`,t?this.bubble.style.opacity="1":(this.bubble.style.opacity="0",this.bubble.style.pointerEvents="none"),setTimeout(()=>{this.container.style.transition="",this.pointer.style.transition="",this.bubble.style.transition=""},this.bubbleFadeDuration),this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._scheduleAutoplay(),this._emit("show",{target:this.targetElement,isIntro:!0,isFirstStep:!0})}else this.container.style.transition="",this.pointer.style.transition="",this.bubble.style.transition="none",this.updatePosition(),this._startTracking(),setTimeout(()=>{const t=this.currentMessages.length>0&&this.currentMessages.some(t=>""!==t&&null!=t);this.bubble.style.transition="",t?this.bubble.style.opacity="1":(this.bubble.style.opacity="0",this.bubble.style.pointerEvents="none"),this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._scheduleAutoplay()},this.animationDuration),this._emit("show",{target:this.targetElement,isIntro:!0,isFirstStep:!1})},this.introFadeDuration)}this.container.style.display="flex",this.container.offsetHeight,this.container.classList.remove(this.classNames.hidden),this.container.classList.add(this.classNames.visible),this.isVisible=!0,this.updatePosition(),this._startTracking(),this._messageCyclePausedByHide&&this.messageInterval&&this.currentMessages.length>1?(this._startMessageCycle(),this._messageCyclePausedByHide=!1):this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._wasAutoplayActiveBeforeHide&&(this._scheduleAutoplay(),this._wasAutoplayActiveBeforeHide=!1),this._emit("show",{target:this.targetElement,isIntro:!1})}hide(){this._emit("beforeHide",{target:this.targetElement}),this.container.classList.remove(this.classNames.visible),this.container.classList.add(this.classNames.hidden),this.isVisible=!1,this.resetPositionOnHide&&(this._hasShownBefore=!1),this._stopTracking(),this._messageIntervalId&&(this._stopMessageCycle(),this._messageCyclePausedByHide=!0),this._wasAutoplayActiveBeforeHide=this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused,this._stopAutoplay(),this._emit("hide",{target:this.targetElement})}restart(){this._emit("beforeRestart",{}),this._hasShownBefore=!1,this.isVisible?(this.container.classList.remove(this.classNames.visible),this.container.classList.add(this.classNames.hidden),this._stopTracking(),this._stopMessageCycle(),this.isVisible=!1,setTimeout(()=>{this.goToStep(0),this.show(),this._emit("restart",{})},50)):(this.goToStep(0),this.show(),this._emit("restart",{}))}destroy(){this._emit("destroy",{}),document.body.contains(this.container)&&document.body.removeChild(this.container),window.removeEventListener("resize",this.updatePosition),window.removeEventListener("scroll",this.updatePosition),this._stopTracking(),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),this._eventListeners={}}reset(e=!0){this._emit("beforeReset",{currentStep:this.currentStepIndex}),this._stopMessageCycle(),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout);const{x:s,y:i}=this._getInitialPosition();if(this.container.style.left=`${s}px`,this.container.style.top=`${i}px`,this.bubble.style.opacity="0",e&&this.steps.length>0){this.currentStepIndex=0;const e=this.steps[0];this.targetElement=t.getTargetElement(e.target),this.currentMessages=Array.isArray(e.content)?e.content:[e.content],this.currentMessageIndex=0,t.renderContent(this.bubbleText,this.currentMessages[0])}this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._hasShownBefore=!1,this._emit("reset",{stepIndex:this.currentStepIndex})},this.animationDuration)}setResetOnComplete(t){const e=this.resetOnComplete;e!==t&&(this.resetOnComplete=t,this._emit("resetOnCompleteChange",{from:e,to:t}))}setFloatingAnimation(t){const e=this.floatingAnimation;e!==t&&(this.floatingAnimation=t,this.container.style.animationPlayState=t?"":"paused",this._emit("floatingAnimationChange",{from:e,to:t}))}isFloatingAnimationEnabled(){return this.floatingAnimation}setTracking(t){const e=this.tracking;e!==t&&(this.tracking=t,t&&this.isVisible?this._startTracking():t||this._stopTracking(),this._emit("trackingChange",{from:e,to:t}))}setTrackingFps(t){const e=this.trackingFps;e!==t&&(this.trackingFps=t,this._emit("trackingFpsChange",{from:e,to:t}))}isTrackingEnabled(){return this.tracking}updateContent(e,s=!0){if(""===e||null==e||Array.isArray(e)&&0===e.length||Array.isArray(e)&&e.every(t=>""===t||null==t))return this.bubble.style.opacity="0",void(this.bubble.style.pointerEvents="none");if("0"===this.bubble.style.opacity&&this.isVisible){const t=this.bubble.style.transition,e=this.pointer.style.transition;this.bubble.style.transition="none",this.pointer.style.transition="none",this.bubble.style.opacity="1",this.bubble.style.pointerEvents="",this.bubble.offsetHeight,this.updatePosition(),this.bubble.offsetHeight,requestAnimationFrame(()=>{this.bubble.style.transition=t,this.pointer.style.transition=e})}"string"==typeof e&&this.bubbleText.innerHTML===e||(s?t.animateText(this.bubbleText,e,this.messageTransitionDuration,this.bubble,()=>{this.updatePosition()}):(t.renderContent(this.bubbleText,e),this.updatePosition()))}_applyMessages(t,e=!1){const s=null!==this._messageIntervalId;this._stopMessageCycle(),this.currentMessages=Array.isArray(t)?t:[t],this.currentMessageIndex=0,this.updateContent(this.currentMessages[0]),e&&this.messageInterval&&this.currentMessages.length>1?this._startMessageCycle():s&&this.currentMessages.length>1&&(this._messageCyclePaused=!0),this._emit("messagesSet",{messages:this.currentMessages,total:this.currentMessages.length,cyclePaused:!0===this._messageCyclePaused})}_startMessageCycle(){this._messagesCompletedForStep=!1,this._messageIntervalId=setInterval(()=>{this.currentMessageIndex===this.currentMessages.length-1&&this.autoplay&&this.autoplayWaitForMessages?(this._stopMessageCycle(),this._messagesCompletedForStep=!0,this._emit("messageCycleComplete",{stepIndex:this.currentStepIndex,totalMessages:this.currentMessages.length}),this._scheduleAutoplayAfterMessages()):this.nextMessage(!0)},this.messageInterval),this._emit("messageCycleStart",{interval:this.messageInterval,totalMessages:this.currentMessages.length})}_stopMessageCycle(){this._messageIntervalId&&(clearInterval(this._messageIntervalId),this._messageIntervalId=null,this._emit("messageCycleStop",{currentIndex:this.currentMessageIndex}))}pauseMessageCycle(){this._messageIntervalId&&(clearInterval(this._messageIntervalId),this._messageIntervalId=null,this._messageCyclePaused=!0,this._emit("messageCyclePause",{currentIndex:this.currentMessageIndex}))}resumeMessageCycle(){return!!(this._messageCyclePaused&&this.messageInterval&&this.currentMessages.length>1)&&(this._messageCyclePaused=!1,this._startMessageCycle(),this._emit("messageCycleResume",{currentIndex:this.currentMessageIndex}),!0)}startMessageCycle(t){return!this._messageIntervalId&&(!(this.currentMessages.length<=1)&&(void 0!==t&&(this.messageInterval=t),!!this.messageInterval&&(this._messageCyclePaused=!1,this._startMessageCycle(),!0)))}stopMessageCycle(){return!!this._messageIntervalId&&(this._stopMessageCycle(),this._messageCyclePaused=!1,!0)}isMessageCycleActive(){return null!==this._messageIntervalId}isMessageCyclePaused(){return!0===this._messageCyclePaused}nextMessage(t=!1){if(this.currentMessages.length<=1)return!1;const e=this.currentMessageIndex;return this.currentMessageIndex=(this.currentMessageIndex+1)%this.currentMessages.length,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:e,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length,isAuto:t}),!0}prevMessage(){if(this.currentMessages.length<=1)return!1;const t=this.currentMessageIndex;return this.currentMessageIndex=(this.currentMessageIndex-1+this.currentMessages.length)%this.currentMessages.length,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:t,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length}),!0}goToMessage(t){if(t<0||t>=this.currentMessages.length)return;const e=this.currentMessageIndex;this.currentMessageIndex=t,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:e,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length})}getCurrentMessage(){return this.currentMessageIndex}getTotalMessages(){return this.currentMessages.length}setMessage(t,e=!0){const s=this.currentMessages[this.currentMessageIndex];this.currentMessages[this.currentMessageIndex]=t,this.updateContent(t,e),e||this.updatePosition(),this._emit("messageUpdate",{index:this.currentMessageIndex,message:t,oldMessage:s,total:this.currentMessages.length,animated:e})}setMessages(e,s=!0){const i=null!==this._messageIntervalId;s?this._applyMessages(e,!1):(this._stopMessageCycle(),this.currentMessages=Array.isArray(e)?e:[e],this.currentMessageIndex=0,t.renderContent(this.bubbleText,this.currentMessages[0]),this.updatePosition(),i&&this.currentMessages.length>1&&(this._messageCyclePaused=!0)),this._emit("messagesSet",{messages:this.currentMessages,total:this.currentMessages.length,animated:s,cyclePaused:!0===this._messageCyclePaused})}setMessageInterval(t){const e=this.messageInterval;e!==t&&(this.messageInterval=t,this._stopMessageCycle(),t&&this.currentMessages.length>1&&this._startMessageCycle(),this._emit("messageIntervalChange",{from:e,to:t}))}updateTarget(e){const s=this.targetElement;this.targetElement=t.getTargetElement(e),this.updatePosition(),this._emit("targetChange",{from:s,to:this.targetElement})}setOffset(t,e){const s=this.offsetX,i=this.offsetY;s===t&&i===e||(this.offsetX=t,this.offsetY=e,this.updatePosition(),this._emit("offsetChange",{from:{x:s,y:i},to:{x:t,y:e}}))}setAnimationDuration(t){const e=this.animationDuration;e!==t&&(this.animationDuration=t,this.container.style.setProperty(`--${this.cssVarPrefix}-duration`,`${t}ms`),this._emit("animationDurationChange",{from:e,to:t}))}setIntroFadeDuration(t){const e=this.introFadeDuration;e!==t&&(this.introFadeDuration=t,this._emit("introFadeDurationChange",{from:e,to:t}))}setBubbleFadeDuration(t){const e=this.bubbleFadeDuration;e!==t&&(this.bubbleFadeDuration=t,this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`,`${t}ms`),this._emit("bubbleFadeDurationChange",{from:e,to:t}))}_getInitialPosition(){const e=this.initialPositionOffset,s=window.innerWidth,i=window.innerHeight;if("first-step"===this.initialPosition&&this.steps.length>0){const e=this.steps[0],s=t.getTargetElement(e.target);if(s){const t=s.getBoundingClientRect(),i=window.scrollX,n=window.scrollY,a="down"!==e.direction;let o,r;return a?(o=t.left+i-25+this.offsetX,r=t.bottom+n-8-this.offsetY):(o=t.left+i-25+this.offsetX,r=t.top+n-25+this.offsetY),{x:o,y:r,isPointingUp:a}}}if(this.initialPosition&&"string"!=typeof this.initialPosition){const t=this.initialPosition.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}if("string"==typeof this.initialPosition&&(this.initialPosition.startsWith("#")||this.initialPosition.startsWith("."))){const t=document.querySelector(this.initialPosition);if(t){const e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}}const n={center:{x:s/2,y:i/2},"top-left":{x:e,y:e},"top-center":{x:s/2,y:e},"top-right":{x:s-e,y:e},"middle-left":{x:e,y:i/2},"middle-right":{x:s-e,y:i/2},"bottom-left":{x:e,y:i-e},"bottom-center":{x:s/2,y:i-e},"bottom-right":{x:s-e,y:i-e}};return n[this.initialPosition]||n.center}setInitialPosition(t){const e=["center","top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right","first-step"];if("string"==typeof t&&!t.startsWith("#")&&!t.startsWith(".")&&!e.includes(t))return void console.warn(`Invalid initial position: ${t}. Valid presets: ${e.join(", ")}. Or use a CSS selector or DOM element.`);const s=this.initialPosition;s!==t&&(this.initialPosition=t,this._emit("initialPositionChange",{from:s,to:t}))}animateToInitialPosition(){if(!this.isVisible)return;const{x:t,y:e}=this._getInitialPosition();this._stopTracking(),this.container.style.cssText=`\n position: fixed;\n left: ${t}px;\n top: ${e}px;\n opacity: 0;\n transition: none;\n `,this.bubble.style.opacity="0",this.bubble.style.transition="none",this.container.offsetHeight,this.container.style.transition=`opacity ${this.introFadeDuration}ms ease`,this.container.style.opacity="1",setTimeout(()=>{this.container.style.transition="",this.container.style.cssText="",this.container.style.left=`${t}px`,this.container.style.top=`${e}px`,this.container.offsetHeight,this.updatePosition(),this._startTracking(),setTimeout(()=>{this.bubble.style.transition="",this.bubble.style.opacity="1"},this.animationDuration)},this.introFadeDuration)}setInitialPositionOffset(t){const e=this.initialPositionOffset;e!==t&&(this.initialPositionOffset=t,this._emit("initialPositionOffsetChange",{from:e,to:t}))}_resolveEasing(e){return t.EASINGS[e]?t.EASINGS[e]:e}setEasing(t){const e=this.easing;e!==t&&(this.easing=t,this.container.style.setProperty(`--${this.cssVarPrefix}-easing`,this._resolveEasing(t)),this._emit("easingChange",{from:e,to:t}))}setMessageTransitionDuration(t){const e=this.messageTransitionDuration;e!==t&&(this.messageTransitionDuration=t,this._emit("messageTransitionDurationChange",{from:e,to:t}))}setPointerSvg(e){const s=this.pointerSvg;s!==e&&(this.pointerSvg=e,t.renderContent(this.pointer,e),this._emit("pointerSvgChange",{from:s,to:e}))}getPointerSvg(){return this.pointerSvg}getClassNames(){return{...this.classNames}}getClassPrefix(){return this.classPrefix}getCssVarPrefix(){return this.cssVarPrefix}static getEasingPresets(){return Object.keys(t.EASINGS)}static getInitialPositions(){return["center","top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right","first-step"]}goToStep(e){if(0===this.steps.length||e<0||e>=this.steps.length)return;this._stopAutoplay(),this._messagesCompletedForStep=!1;const s=this.currentStepIndex,i=this.targetElement;this.currentStepIndex=e;const n=this.steps[this.currentStepIndex];this._emit("beforeStepChange",{fromIndex:s,toIndex:e,step:n,fromTarget:i}),this.manualDirection=n.direction||null,this._targetYHistory=[],this.lastTargetY=null,this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout),this._emit("animationStart",{fromTarget:i,toTarget:t.getTargetElement(n.target),type:"step",stepIndex:e}),this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._emit("moveComplete",{index:e,step:n,target:this.targetElement}),this._emit("animationEnd",{fromTarget:i,toTarget:this.targetElement,type:"step",stepIndex:e}),this._scheduleAutoplay()},this.animationDuration),this._emit("move",{index:e,step:n}),this._applyMessages(n.content,!0),this.targetElement=t.getTargetElement(n.target),this.updatePosition(),this._emit("stepChange",{fromIndex:s,toIndex:e,step:n,target:this.targetElement}),this.onStepChange&&this.onStepChange(this.currentStepIndex,n)}_scheduleAutoplay(){if(!this.autoplay||!this.autoplayEnabled||this._autoplayPaused||!this.isVisible)return;const t=this.steps[this.currentStepIndex],e=this.currentMessages.length>1&&this.messageInterval;if(this.autoplayWaitForMessages&&e)return;const s=void 0!==t.duration?t.duration:this.autoplay;s&&s>0&&(this._autoplayTimeoutId=setTimeout(()=>{!this._autoplayPaused&&this.isVisible&&this.autoplayEnabled&&(this._emit("autoplayNext",{fromIndex:this.currentStepIndex,duration:s}),this.next())},s))}_scheduleAutoplayAfterMessages(){if(!this.autoplay||!this.autoplayEnabled||this._autoplayPaused||!this.isVisible)return;this._autoplayTimeoutId=setTimeout(()=>{!this._autoplayPaused&&this.isVisible&&this._messagesCompletedForStep&&(this._emit("autoplayNext",{fromIndex:this.currentStepIndex,afterMessages:!0}),this.next())},300)}_stopAutoplay(){this._autoplayTimeoutId&&(clearTimeout(this._autoplayTimeoutId),this._autoplayTimeoutId=null)}startAutoplay(){this.autoplay&&(this.autoplayEnabled=!0,this._autoplayPaused=!1,this._emit("autoplayStart",{}),this._scheduleAutoplay())}stopAutoplay(){this._stopAutoplay(),this.autoplayEnabled=!1,this._autoplayPaused=!1,this._emit("autoplayStop",{})}pauseAutoplay(){this._stopAutoplay(),this._autoplayPaused=!0,this._emit("autoplayPause",{})}resumeAutoplay(){this._autoplayPaused&&(this._autoplayPaused=!1,this._emit("autoplayResume",{}),this._scheduleAutoplay())}isAutoplayActive(){return this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused}isAutoplayPaused(){return this._autoplayPaused}setAutoplayInterval(t){const e=this.autoplay;e!==t&&(this.autoplay=t,this._emit("autoplayChange",{from:e,to:t}),this.autoplayEnabled&&t&&this.isVisible?(this._stopAutoplay(),this._scheduleAutoplay()):t||(this._stopAutoplay(),this.autoplayEnabled=!1))}setAutoplay(t){this.setAutoplayInterval(t),t&&this.isVisible&&(this.autoplayEnabled=!0,this._autoplayPaused=!1,this.restart())}setAutoplayWaitForMessages(t){const e=this.autoplayWaitForMessages;e!==t&&(this.autoplayWaitForMessages=t,this._emit("autoplayWaitForMessagesChange",{from:e,to:t}))}setHideOnComplete(t){const e=this.hideOnComplete;e!==t&&(this.hideOnComplete=t,this._emit("hideOnCompleteChange",{from:e,to:t}))}setHideOnCompleteDelay(t){const e=this.hideOnCompleteDelay;e!==t&&(this.hideOnCompleteDelay=t,this._emit("hideOnCompleteDelayChange",{from:e,to:t}))}next(){if(0!==this.steps.length)if(this.currentStepIndex<this.steps.length-1)this._emit("next",{fromIndex:this.currentStepIndex,toIndex:this.currentStepIndex+1}),this.goToStep(this.currentStepIndex+1);else{const t=this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused;if(this._emit("complete",{totalSteps:this.steps.length,source:t?"autoplay":"manual"}),t&&(this._stopAutoplay(),this.autoplayEnabled=!1,this._emit("autoplayComplete",{totalSteps:this.steps.length})),this.resetOnComplete){if(this.reset(),this.hideOnComplete){const e=null!==this.hideOnCompleteDelay?this.hideOnCompleteDelay:this.animationDuration,s=t?"autoplay":"manual";this._hideOnCompleteTimeoutId=setTimeout(()=>{this.hide(),this._emit("autoHide",{delay:e,source:s})},this.animationDuration+e)}}else if(this.hideOnComplete){const e=null!==this.hideOnCompleteDelay?this.hideOnCompleteDelay:this.animationDuration,s=t?"autoplay":"manual";this._hideOnCompleteTimeoutId=setTimeout(()=>{this.hide(),this._emit("autoHide",{delay:e,source:s})},e)}this.onComplete&&this.onComplete()}}prev(){0!==this.steps.length&&this.currentStepIndex>0&&(this._emit("prev",{fromIndex:this.currentStepIndex,toIndex:this.currentStepIndex-1}),this.goToStep(this.currentStepIndex-1))}getCurrentStep(){return this.currentStepIndex}getTotalSteps(){return this.steps.length}pointTo(e,s,i){const n=this.targetElement,a=i||"auto";this._emit("beforePointTo",{target:t.getTargetElement(e),content:s,direction:a,fromTarget:n}),this.manualDirection=i||null,this._targetYHistory=[],this.lastTargetY=null,this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout);const o=t.getTargetElement(e);this._emit("animationStart",{fromTarget:n,toTarget:o,type:"pointTo",content:s}),this.targetElement=o,void 0!==s&&this._applyMessages(s,!1),this.updatePosition();const r=this.isPointingUp?"up":"down";this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._emit("pointToComplete",{target:this.targetElement,content:s,direction:r}),this._emit("animationEnd",{fromTarget:n,toTarget:this.targetElement,type:"pointTo",content:s})},this.animationDuration),this._emit("pointTo",{target:this.targetElement,content:s,direction:r}),this.isVisible||this.show()}on(t,e){return this._eventListeners[t]||(this._eventListeners[t]=[]),this._eventListeners[t].push(e),this}off(t,e){return this._eventListeners[t]?(e?this._eventListeners[t]=this._eventListeners[t].filter(t=>t!==e):delete this._eventListeners[t],this):this}_emit(e,s){const i={...s,type:e,pointy:this};this._eventListeners[e]&&this._eventListeners[e].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in ${e} event handler:`,t)}});const n=t.getEventGroup(e);n&&this._eventListeners[n]&&this._eventListeners[n].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in ${n} group handler for ${e}:`,t)}}),["*","all"].forEach(t=>{this._eventListeners[t]&&this._eventListeners[t].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in wildcard handler for ${e}:`,t)}})})}static getEventGroup(e){for(const[s,i]of Object.entries(t.EVENT_GROUPS))if(i.includes(e))return s;return e.endsWith("Change")?"config":null}static getEventsInGroup(e){return t.EVENT_GROUPS[e]||[]}}return t.EVENT_GROUPS={lifecycle:["beforeShow","show","beforeHide","hide","destroy","beforeRestart","restart","beforeReset","reset"],navigation:["beforeStepChange","stepChange","next","prev","complete"],animation:["animationStart","animationEnd","move","moveComplete","introAnimationStart","introAnimationEnd"],content:["contentSet","messagesSet","messageChange"],messageCycle:["messageCycleStart","messageCycleStop","messageCyclePause","messageCycleResume","messageCycleComplete"],pointing:["beforePointTo","pointTo","pointToComplete"],tracking:["track","targetChange","trackingChange","trackingFpsChange"],autoplay:["autoplayStart","autoplayStop","autoplayPause","autoplayResume","autoplayNext","autoplayComplete","autoHide","autoplayChange","autoplayWaitForMessagesChange"]},t});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Pointy=e()}(this,function(){"use strict";class t{static EASINGS={default:"cubic-bezier(0, 0.55, 0.45, 1)",standard:"cubic-bezier(0.4, 0, 0.2, 1)",decelerate:"cubic-bezier(0, 0, 0.2, 1)",accelerate:"cubic-bezier(0.4, 0, 1, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",elastic:"cubic-bezier(0.68, -0.6, 0.32, 1.6)",smooth:"cubic-bezier(0.45, 0, 0.55, 1)",snap:"cubic-bezier(0.5, 0, 0.1, 1)","expo-out":"cubic-bezier(0.19, 1, 0.22, 1)","circ-out":"cubic-bezier(0.075, 0.82, 0.165, 1)","back-out":"cubic-bezier(0.175, 0.885, 0.32, 1.275)"};static POINTER_SVG='\n <svg xmlns="http://www.w3.org/2000/svg" width="33" height="33" fill="none" viewBox="0 0 33 33">\n <g filter="url(#pointy-shadow)">\n <path fill="#0a1551" d="m18.65 24.262 6.316-14.905c.467-1.103-.645-2.215-1.748-1.747L8.313 13.925c-1.088.461-1.083 2.004.008 2.459l5.049 2.104c.325.135.583.393.718.718l2.104 5.049c.454 1.09 1.997 1.095 2.458.007"/>\n </g>\n <defs>\n <filter id="pointy-shadow" width="32.576" height="32.575" x="0" y="0" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse">\n <feFlood flood-opacity="0" result="BackgroundImageFix"/>\n <feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/>\n <feOffset/>\n <feGaussianBlur stdDeviation="3.75"/>\n <feComposite in2="hardAlpha" operator="out"/>\n <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>\n <feBlend in2="BackgroundImageFix" result="effect1_dropShadow"/>\n <feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>\n </filter>\n </defs>\n </svg>\n ';static DEFAULT_CLASS_PREFIX="pointy";static DEFAULT_CLASS_SUFFIXES={container:"container",pointer:"pointer",bubble:"bubble",bubbleText:"bubble-text",hidden:"hidden",visible:"visible",moving:"moving"};static generateClassNames(e=t.DEFAULT_CLASS_PREFIX,s={}){const i={...t.DEFAULT_CLASS_SUFFIXES,...s};return{container:`${e}-${i.container}`,pointer:`${e}-${i.pointer}`,bubble:`${e}-${i.bubble}`,bubbleText:`${e}-${i.bubbleText}`,hidden:`${e}-${i.hidden}`,visible:`${e}-${i.visible}`,moving:`${e}-${i.moving}`}}static DEFAULT_CSS_VAR_PREFIX="pointy";static generateStyles(t,e="pointy"){const s=t,i=e;return`\n @keyframes ${s.container}-float {\n 0%, 100% {\n transform: translateY(0px);\n }\n 50% {\n transform: translateY(-8px);\n }\n }\n\n .${s.container} {\n position: absolute;\n font-family: 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n --${i}-duration: 1000ms;\n --${i}-easing: cubic-bezier(0, 0.55, 0.45, 1);\n --${i}-bubble-fade: 500ms;\n transition: left var(--${i}-duration) var(--${i}-easing), top var(--${i}-duration) var(--${i}-easing), opacity 0.3s ease;\n animation: ${s.container}-float 3s ease-in-out infinite;\n }\n\n .${s.container}.${s.moving} {\n animation-play-state: paused;\n }\n\n .${s.container}.${s.hidden} {\n opacity: 0;\n pointer-events: none;\n }\n\n .${s.container}.${s.visible} {\n opacity: 1;\n }\n\n .${s.pointer} {\n width: 33px;\n height: 33px;\n transition: transform var(--${i}-duration) var(--${i}-easing);\n }\n\n .${s.bubble} {\n position: absolute;\n right: 26px;\n top: 0;\n background: #0a1551;\n color: white;\n padding: 4px 12px;\n border-radius: 14px;\n font-size: 14px;\n line-height: 20px;\n font-weight: 400;\n box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);\n white-space: nowrap;\n overflow: hidden;\n transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform var(--${i}-duration) var(--${i}-easing), opacity var(--${i}-bubble-fade) ease;\n }\n\n .${s.bubbleText} {\n display: inline-block;\n }\n `}static injectedStyleKeys=new Set;static injectStyles(e,s="pointy"){const i=JSON.stringify(e)+s;if(t.injectedStyleKeys.has(i))return;if(!t.fontInjected){const e=document.createElement("link");e.href="https://cdn.jotfor.ms/fonts/?family=Circular",e.rel="stylesheet",document.head.appendChild(e),t.fontInjected=!0}const n=document.createElement("style");n.id=`pointy-styles-${i.length}`,n.textContent=t.generateStyles(e,s),document.head.appendChild(n),t.injectedStyleKeys.add(i)}static fontInjected=!1;static getTargetElement(t){return"string"==typeof t?document.querySelector(t):t}static animateText(e,s,i=500,n=null,a=null){const o=.4*i,r=.6*i;let h=null,l=null;if(n){const e=document.createElement("div");e.style.cssText="visibility: hidden; position: absolute; padding: 4px 12px;",t.renderContent(e,s),n.appendChild(e),h=e.offsetWidth,l=e.offsetHeight,n.removeChild(e);const i=n.offsetWidth,a=n.offsetHeight;n.style.width=i+"px",n.style.height=a+"px"}e.style.transition=`clip-path ${o}ms ease-in`,e.style.clipPath="inset(0 0 0 100%)",setTimeout(()=>{t.renderContent(e,s),n&&null!==h&&(n.style.width=h+"px",n.style.height=l+"px"),e.style.transition="none",e.style.clipPath="inset(0 100% 0 0)",e.offsetHeight,e.style.transition=`clip-path ${r}ms ease-out`,e.style.clipPath="inset(0 0 0 0)",n&&setTimeout(()=>{n.style.width="",n.style.height=""},r+100),a&&a()},o)}static renderContent(t,e){if(e&&"object"==typeof e&&e.$$typeof)if("undefined"!=typeof ReactDOM&&ReactDOM.createRoot){const s=ReactDOM.createRoot(t);s.render(e),t._reactRoot=s}else"undefined"!=typeof ReactDOM&&ReactDOM.render?ReactDOM.render(e,t):(console.warn("Pointy: React element passed but ReactDOM not found"),t.innerHTML=String(e));else t.innerHTML=e}constructor(e={}){if(this.classPrefix=e.classPrefix||t.DEFAULT_CLASS_PREFIX,this.classNames=t.generateClassNames(this.classPrefix,e.classSuffixes),e.classNames&&(this.classNames={...this.classNames,...e.classNames}),this.cssVarPrefix=e.cssVarPrefix||this.classPrefix,this.pointerSvg=e.pointerSvg||t.POINTER_SVG,t.injectStyles(this.classNames,this.cssVarPrefix),this.steps=e.steps||[],this.zIndex=void 0!==e.zIndex?e.zIndex:9999,this.offsetX=void 0!==e.offsetX?e.offsetX:20,this.offsetY=void 0!==e.offsetY?e.offsetY:16,this.tracking=void 0===e.tracking||e.tracking,this.trackingFps=void 0!==e.trackingFps?e.trackingFps:60,this.animationDuration=void 0!==e.animationDuration?e.animationDuration:1e3,this.introFadeDuration=void 0!==e.introFadeDuration?e.introFadeDuration:1e3,this.bubbleFadeDuration=void 0!==e.bubbleFadeDuration?e.bubbleFadeDuration:500,this.messageTransitionDuration=void 0!==e.messageTransitionDuration?e.messageTransitionDuration:500,this.easing=void 0!==e.easing?e.easing:"default",this.resetOnComplete=void 0===e.resetOnComplete||e.resetOnComplete,this.floatingAnimation=void 0===e.floatingAnimation||e.floatingAnimation,this.initialPosition=e.initialPosition||"center",this.initialPositionOffset=void 0!==e.initialPositionOffset?e.initialPositionOffset:32,this.resetPositionOnHide=void 0!==e.resetPositionOnHide&&e.resetPositionOnHide,this.autoplay=e.autoplay||null,this.autoplayEnabled=void 0!==e.autoplayEnabled&&e.autoplayEnabled,this.autoplayWaitForMessages=void 0===e.autoplayWaitForMessages||e.autoplayWaitForMessages,this.hideOnComplete=void 0===e.hideOnComplete||e.hideOnComplete,this.hideOnCompleteDelay=void 0!==e.hideOnCompleteDelay?e.hideOnCompleteDelay:null,this._autoplayTimeoutId=null,this._autoplayPaused=!1,this._messagesCompletedForStep=!1,this._hideOnCompleteTimeoutId=null,this.onStepChange=e.onStepChange,this.onComplete=e.onComplete,this._eventListeners={},this.targetElement=e.target?t.getTargetElement(e.target):null,this.currentStepIndex=0,this.currentMessageIndex=0,this.currentMessages=[],this.messageInterval=e.messageInterval||null,this._messageIntervalId=null,this.isVisible=!1,this.isPointingUp=!0,this.lastTargetY=null,this._targetYHistory=[],this._lastDirectionChangeTime=0,this.manualDirection=null,this.moveTimeout=null,this._hasShownBefore=!1,this.steps.length>0&&(this.targetElement=t.getTargetElement(this.steps[0].target)),this.container=document.createElement("div"),this.container.className=`${this.classNames.container} ${this.classNames.hidden}`,this.container.style.zIndex=this.zIndex,this.container.style.setProperty(`--${this.cssVarPrefix}-duration`,`${this.animationDuration}ms`),this.container.style.setProperty(`--${this.cssVarPrefix}-easing`,this._resolveEasing(this.easing)),this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`,`${this.bubbleFadeDuration}ms`),this.floatingAnimation||(this.container.style.animationPlayState="paused"),this.pointer=document.createElement("div"),this.pointer.className=this.classNames.pointer,t.renderContent(this.pointer,this.pointerSvg),this.bubble=document.createElement("div"),this.bubble.className=this.classNames.bubble,this.bubble.style.transform="translateY(28px)",this.bubbleText=document.createElement("span"),this.bubbleText.className=this.classNames.bubbleText,this.steps.length>0){const e=this.steps[0].content;this.currentMessages=Array.isArray(e)?e:[e],t.renderContent(this.bubbleText,this.currentMessages[0])}else{const s=e.content||"";this.currentMessages=Array.isArray(s)?s:[s],t.renderContent(this.bubbleText,this.currentMessages[0])}this.currentMessageIndex=0,this.bubble.appendChild(this.bubbleText),this.container.appendChild(this.pointer),this.container.appendChild(this.bubble),this.updatePosition=this.updatePosition.bind(this),this._trackPosition=this._trackPosition.bind(this),this._lastTrackTime=0,window.addEventListener("resize",this.updatePosition),window.addEventListener("scroll",this.updatePosition)}_trackPosition(){if(this.isVisible&&this.targetElement){if(this.trackingFps>0){const t=performance.now(),e=1e3/this.trackingFps;t-this._lastTrackTime>=e&&(this._lastTrackTime=t,this.updatePosition(),this._emit("track",{target:this.targetElement,timestamp:t}))}else this.updatePosition(),this._emit("track",{target:this.targetElement,timestamp:performance.now()});this._rafId=requestAnimationFrame(this._trackPosition)}else this._rafId=null}_startTracking(){this.tracking&&(this._rafId||this._trackPosition())}_stopTracking(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null)}updatePosition(){if(!this.targetElement)return;const t=this.targetElement.getBoundingClientRect(),e=window.scrollX,s=window.scrollY;if(null!==this.manualDirection)this.isPointingUp="up"===this.manualDirection;else{const e=t.top+s,i=Date.now();this._targetYHistory.push({y:e,time:i});const n=200;if(this._targetYHistory=this._targetYHistory.filter(t=>i-t.time<n),this._targetYHistory.length>=2){const t=this._targetYHistory[0],e=this._targetYHistory[this._targetYHistory.length-1],s=e.y-t.y;e.time,t.time;const n=30,a=300;if(Math.abs(s)>n&&i-this._lastDirectionChangeTime>a){const t=s<0;t!==this.isPointingUp&&(this.isPointingUp=t,this._lastDirectionChangeTime=i)}}this.lastTargetY=e}let i,n;if(this.isPointingUp)this.pointer.style.transform="rotate(0deg)",i=t.left+e-25+this.offsetX,n=t.bottom+s-8-this.offsetY,this.bubble.style.transform="translateY(28px)";else{this.pointer.style.transform="rotate(90deg)",i=t.left+e-25+this.offsetX,n=t.top+s-25+this.offsetY;const a=this.bubble.offsetHeight||28;this.bubble.style.transform=`translateY(-${a}px)`}this.container.style.left=`${i}px`,this.container.style.top=`${n}px`}show(){if(this._emit("beforeShow",{target:this.targetElement}),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),document.body.contains(this.container)||document.body.appendChild(this.container),!this._hasShownBefore){this._hasShownBefore=!0;const t="first-step"===this.initialPosition,e=this._getInitialPosition(),s=e.x,i=e.y;if(this.container.style.transition=`opacity ${this.introFadeDuration}ms ease`,this.pointer.style.transition="none",this.bubble.style.transition="none",this.bubble.style.opacity="0",this.container.style.left=`${s}px`,this.container.style.top=`${i}px`,t&&void 0!==e.isPointingUp)if(this.isPointingUp=e.isPointingUp,this.isPointingUp)this.pointer.style.transform="rotate(0deg)",this.bubble.style.transform="translateY(28px)";else{this.pointer.style.transform="rotate(90deg)";const t=this.bubble.offsetHeight||28;this.bubble.style.transform=`translateY(-${t}px)`}else this.pointer.style.transform="rotate(0deg)",this.bubble.style.transform="translateY(28px)";return this.container.style.display="flex",this.container.offsetHeight,this.container.classList.remove(this.classNames.hidden),this.container.classList.add(this.classNames.visible),this.isVisible=!0,this._emit("introAnimationStart",{duration:this.introFadeDuration,initialPosition:{x:s,y:i}}),void setTimeout(()=>{if(this._emit("introAnimationEnd",{initialPosition:{x:s,y:i}}),t){this.container.style.transition="none",this.pointer.style.transition="none",this._startTracking();const t=this.currentMessages.length>0&&this.currentMessages.some(t=>""!==t&&null!=t);this.bubble.style.transition=`opacity ${this.bubbleFadeDuration}ms ease`,t?this.bubble.style.opacity="1":(this.bubble.style.opacity="0",this.bubble.style.pointerEvents="none"),setTimeout(()=>{this.container.style.transition="",this.pointer.style.transition="",this.bubble.style.transition=""},this.bubbleFadeDuration),this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._scheduleAutoplay(),this._emit("show",{target:this.targetElement,isIntro:!0,isFirstStep:!0})}else this.container.style.transition="",this.pointer.style.transition="",this.bubble.style.transition="none",this.updatePosition(),this._startTracking(),setTimeout(()=>{const t=this.currentMessages.length>0&&this.currentMessages.some(t=>""!==t&&null!=t);this.bubble.style.transition="",t?this.bubble.style.opacity="1":(this.bubble.style.opacity="0",this.bubble.style.pointerEvents="none"),this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._scheduleAutoplay()},this.animationDuration),this._emit("show",{target:this.targetElement,isIntro:!0,isFirstStep:!1})},this.introFadeDuration)}this.container.style.display="flex",this.container.offsetHeight,this.container.classList.remove(this.classNames.hidden),this.container.classList.add(this.classNames.visible),this.isVisible=!0,this.updatePosition(),this._startTracking(),this._messageCyclePausedByHide&&this.messageInterval&&this.currentMessages.length>1?(this._startMessageCycle(),this._messageCyclePausedByHide=!1):this.messageInterval&&this.currentMessages.length>1&&!this._messageIntervalId&&this._startMessageCycle(),this._wasAutoplayActiveBeforeHide&&(this._scheduleAutoplay(),this._wasAutoplayActiveBeforeHide=!1),this._emit("show",{target:this.targetElement,isIntro:!1})}hide(){this._emit("beforeHide",{target:this.targetElement}),this.container.classList.remove(this.classNames.visible),this.container.classList.add(this.classNames.hidden),this.isVisible=!1,this.resetPositionOnHide&&(this._hasShownBefore=!1),this._stopTracking(),this._messageIntervalId&&(this._stopMessageCycle(),this._messageCyclePausedByHide=!0),this._wasAutoplayActiveBeforeHide=this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused,this._stopAutoplay(),this._emit("hide",{target:this.targetElement})}restart(){this._emit("beforeRestart",{}),this._hasShownBefore=!1,this.isVisible?(this.container.classList.remove(this.classNames.visible),this.container.classList.add(this.classNames.hidden),this._stopTracking(),this._stopMessageCycle(),this.isVisible=!1,setTimeout(()=>{this.goToStep(0),this.show(),this._emit("restart",{})},50)):(this.goToStep(0),this.show(),this._emit("restart",{}))}destroy(){this._emit("destroy",{}),document.body.contains(this.container)&&document.body.removeChild(this.container),window.removeEventListener("resize",this.updatePosition),window.removeEventListener("scroll",this.updatePosition),this._stopTracking(),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),this._eventListeners={}}reset(e=!0){this._emit("beforeReset",{currentStep:this.currentStepIndex}),this._stopMessageCycle(),this._hideOnCompleteTimeoutId&&(clearTimeout(this._hideOnCompleteTimeoutId),this._hideOnCompleteTimeoutId=null),this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout);const{x:s,y:i}=this._getInitialPosition();if(this.container.style.left=`${s}px`,this.container.style.top=`${i}px`,this.bubble.style.opacity="0",e&&this.steps.length>0){this.currentStepIndex=0;const e=this.steps[0];this.targetElement=t.getTargetElement(e.target),this.currentMessages=Array.isArray(e.content)?e.content:[e.content],this.currentMessageIndex=0,t.renderContent(this.bubbleText,this.currentMessages[0])}this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._hasShownBefore=!1,this._emit("reset",{stepIndex:this.currentStepIndex})},this.animationDuration)}setResetOnComplete(t){const e=this.resetOnComplete;e!==t&&(this.resetOnComplete=t,this._emit("resetOnCompleteChange",{from:e,to:t}))}setFloatingAnimation(t){const e=this.floatingAnimation;e!==t&&(this.floatingAnimation=t,this.container.style.animationPlayState=t?"":"paused",this._emit("floatingAnimationChange",{from:e,to:t}))}isFloatingAnimationEnabled(){return this.floatingAnimation}setTracking(t){const e=this.tracking;e!==t&&(this.tracking=t,t&&this.isVisible?this._startTracking():t||this._stopTracking(),this._emit("trackingChange",{from:e,to:t}))}setTrackingFps(t){const e=this.trackingFps;e!==t&&(this.trackingFps=t,this._emit("trackingFpsChange",{from:e,to:t}))}isTrackingEnabled(){return this.tracking}updateContent(e,s=!0){if(""===e||null==e||Array.isArray(e)&&0===e.length||Array.isArray(e)&&e.every(t=>""===t||null==t))return this.bubble.style.opacity="0",void(this.bubble.style.pointerEvents="none");if("0"===this.bubble.style.opacity&&this.isVisible){const t=this.bubble.style.transition,e=this.pointer.style.transition;this.bubble.style.transition="none",this.pointer.style.transition="none",this.bubble.style.opacity="1",this.bubble.style.pointerEvents="",this.bubble.offsetHeight,this.updatePosition(),this.bubble.offsetHeight,requestAnimationFrame(()=>{this.bubble.style.transition=t,this.pointer.style.transition=e})}"string"==typeof e&&this.bubbleText.innerHTML===e||(s?t.animateText(this.bubbleText,e,this.messageTransitionDuration,this.bubble,()=>{this.updatePosition()}):(t.renderContent(this.bubbleText,e),this.updatePosition()))}_applyMessages(t,e=!1){const s=null!==this._messageIntervalId;this._stopMessageCycle(),this.currentMessages=Array.isArray(t)?t:[t],this.currentMessageIndex=0,this.updateContent(this.currentMessages[0]),e&&this.messageInterval&&this.currentMessages.length>1?this._startMessageCycle():s&&this.currentMessages.length>1&&(this._messageCyclePaused=!0),this._emit("messagesSet",{messages:this.currentMessages,total:this.currentMessages.length,cyclePaused:!0===this._messageCyclePaused})}_startMessageCycle(){this._messagesCompletedForStep=!1,this._messageIntervalId=setInterval(()=>{this.currentMessageIndex===this.currentMessages.length-1&&this.autoplay&&this.autoplayWaitForMessages?(this._stopMessageCycle(),this._messagesCompletedForStep=!0,this._emit("messageCycleComplete",{stepIndex:this.currentStepIndex,totalMessages:this.currentMessages.length}),this._scheduleAutoplayAfterMessages()):this.nextMessage(!0)},this.messageInterval),this._emit("messageCycleStart",{interval:this.messageInterval,totalMessages:this.currentMessages.length})}_stopMessageCycle(){this._messageIntervalId&&(clearInterval(this._messageIntervalId),this._messageIntervalId=null,this._emit("messageCycleStop",{currentIndex:this.currentMessageIndex}))}pauseMessageCycle(){this._messageIntervalId&&(clearInterval(this._messageIntervalId),this._messageIntervalId=null,this._messageCyclePaused=!0,this._emit("messageCyclePause",{currentIndex:this.currentMessageIndex}))}resumeMessageCycle(){return!!(this._messageCyclePaused&&this.messageInterval&&this.currentMessages.length>1)&&(this._messageCyclePaused=!1,this._startMessageCycle(),this._emit("messageCycleResume",{currentIndex:this.currentMessageIndex}),!0)}startMessageCycle(t){return!this._messageIntervalId&&(!(this.currentMessages.length<=1)&&(void 0!==t&&(this.messageInterval=t),!!this.messageInterval&&(this._messageCyclePaused=!1,this._startMessageCycle(),!0)))}stopMessageCycle(){return!!this._messageIntervalId&&(this._stopMessageCycle(),this._messageCyclePaused=!1,!0)}isMessageCycleActive(){return null!==this._messageIntervalId}isMessageCyclePaused(){return!0===this._messageCyclePaused}nextMessage(t=!1){if(this.currentMessages.length<=1)return!1;const e=this.currentMessageIndex;return this.currentMessageIndex=(this.currentMessageIndex+1)%this.currentMessages.length,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:e,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length,isAuto:t}),!0}prevMessage(){if(this.currentMessages.length<=1)return!1;const t=this.currentMessageIndex;return this.currentMessageIndex=(this.currentMessageIndex-1+this.currentMessages.length)%this.currentMessages.length,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:t,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length}),!0}goToMessage(t){if(t<0||t>=this.currentMessages.length)return;const e=this.currentMessageIndex;this.currentMessageIndex=t,this.updateContent(this.currentMessages[this.currentMessageIndex]),this._emit("messageChange",{fromIndex:e,toIndex:this.currentMessageIndex,message:this.currentMessages[this.currentMessageIndex],total:this.currentMessages.length})}getCurrentMessage(){return this.currentMessageIndex}getTotalMessages(){return this.currentMessages.length}setCurrentMessage(t,e=!0){const s=this.currentMessages[this.currentMessageIndex];this.currentMessages[this.currentMessageIndex]=t,this.updateContent(t,e),e||this.updatePosition(),this._emit("currentMessageUpdate",{index:this.currentMessageIndex,message:t,oldMessage:s,total:this.currentMessages.length,animated:e})}setMessage(t,e=!0){this.setMessages(t,e)}setMessages(e,s=!0){const i=null!==this._messageIntervalId;s?this._applyMessages(e,!1):(this._stopMessageCycle(),this.currentMessages=Array.isArray(e)?e:[e],this.currentMessageIndex=0,t.renderContent(this.bubbleText,this.currentMessages[0]),this.updatePosition(),i&&this.currentMessages.length>1&&(this._messageCyclePaused=!0)),this._emit("messagesSet",{messages:this.currentMessages,total:this.currentMessages.length,animated:s,cyclePaused:!0===this._messageCyclePaused})}setMessageInterval(t){const e=this.messageInterval;e!==t&&(this.messageInterval=t,this._stopMessageCycle(),t&&this.currentMessages.length>1&&this._startMessageCycle(),this._emit("messageIntervalChange",{from:e,to:t}))}updateTarget(e){const s=this.targetElement;this.targetElement=t.getTargetElement(e),this.updatePosition(),this._emit("targetChange",{from:s,to:this.targetElement})}setZIndex(t){const e=this.zIndex;e!==t&&(this.zIndex=t,this.container.style.zIndex=t,this._emit("zIndexChange",{from:e,to:t}))}setOffset(t,e){const s=this.offsetX,i=this.offsetY;s===t&&i===e||(this.offsetX=t,this.offsetY=e,this.updatePosition(),this._emit("offsetChange",{from:{x:s,y:i},to:{x:t,y:e}}))}setAnimationDuration(t){const e=this.animationDuration;e!==t&&(this.animationDuration=t,this.container.style.setProperty(`--${this.cssVarPrefix}-duration`,`${t}ms`),this._emit("animationDurationChange",{from:e,to:t}))}setIntroFadeDuration(t){const e=this.introFadeDuration;e!==t&&(this.introFadeDuration=t,this._emit("introFadeDurationChange",{from:e,to:t}))}setBubbleFadeDuration(t){const e=this.bubbleFadeDuration;e!==t&&(this.bubbleFadeDuration=t,this.container.style.setProperty(`--${this.cssVarPrefix}-bubble-fade`,`${t}ms`),this._emit("bubbleFadeDurationChange",{from:e,to:t}))}_getInitialPosition(){const e=this.initialPositionOffset,s=window.innerWidth,i=window.innerHeight;if("first-step"===this.initialPosition&&this.steps.length>0){const e=this.steps[0],s=t.getTargetElement(e.target);if(s){const t=s.getBoundingClientRect(),i=window.scrollX,n=window.scrollY,a="down"!==e.direction;let o,r;return a?(o=t.left+i-25+this.offsetX,r=t.bottom+n-8-this.offsetY):(o=t.left+i-25+this.offsetX,r=t.top+n-25+this.offsetY),{x:o,y:r,isPointingUp:a}}}if(this.initialPosition&&"string"!=typeof this.initialPosition){const t=this.initialPosition.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}if("string"==typeof this.initialPosition&&(this.initialPosition.startsWith("#")||this.initialPosition.startsWith("."))){const t=document.querySelector(this.initialPosition);if(t){const e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+e.height/2}}}const n={center:{x:s/2,y:i/2},"top-left":{x:e,y:e},"top-center":{x:s/2,y:e},"top-right":{x:s-e,y:e},"middle-left":{x:e,y:i/2},"middle-right":{x:s-e,y:i/2},"bottom-left":{x:e,y:i-e},"bottom-center":{x:s/2,y:i-e},"bottom-right":{x:s-e,y:i-e}};return n[this.initialPosition]||n.center}setInitialPosition(t){const e=["center","top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right","first-step"];if("string"==typeof t&&!t.startsWith("#")&&!t.startsWith(".")&&!e.includes(t))return void console.warn(`Invalid initial position: ${t}. Valid presets: ${e.join(", ")}. Or use a CSS selector or DOM element.`);const s=this.initialPosition;s!==t&&(this.initialPosition=t,this._emit("initialPositionChange",{from:s,to:t}))}animateToInitialPosition(){if(!this.isVisible)return;const{x:t,y:e}=this._getInitialPosition();this._stopTracking(),this.container.style.cssText=`\n position: fixed;\n left: ${t}px;\n top: ${e}px;\n opacity: 0;\n transition: none;\n `,this.bubble.style.opacity="0",this.bubble.style.transition="none",this.container.offsetHeight,this.container.style.transition=`opacity ${this.introFadeDuration}ms ease`,this.container.style.opacity="1",setTimeout(()=>{this.container.style.transition="",this.container.style.cssText="",this.container.style.left=`${t}px`,this.container.style.top=`${e}px`,this.container.offsetHeight,this.updatePosition(),this._startTracking(),setTimeout(()=>{this.bubble.style.transition="",this.bubble.style.opacity="1"},this.animationDuration)},this.introFadeDuration)}setInitialPositionOffset(t){const e=this.initialPositionOffset;e!==t&&(this.initialPositionOffset=t,this._emit("initialPositionOffsetChange",{from:e,to:t}))}_resolveEasing(e){return t.EASINGS[e]?t.EASINGS[e]:e}setEasing(t){const e=this.easing;e!==t&&(this.easing=t,this.container.style.setProperty(`--${this.cssVarPrefix}-easing`,this._resolveEasing(t)),this._emit("easingChange",{from:e,to:t}))}setMessageTransitionDuration(t){const e=this.messageTransitionDuration;e!==t&&(this.messageTransitionDuration=t,this._emit("messageTransitionDurationChange",{from:e,to:t}))}setPointerSvg(e){const s=this.pointerSvg;s!==e&&(this.pointerSvg=e,t.renderContent(this.pointer,e),this._emit("pointerSvgChange",{from:s,to:e}))}getPointerSvg(){return this.pointerSvg}getClassNames(){return{...this.classNames}}getClassPrefix(){return this.classPrefix}getCssVarPrefix(){return this.cssVarPrefix}static getEasingPresets(){return Object.keys(t.EASINGS)}static getInitialPositions(){return["center","top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right","first-step"]}goToStep(e){if(0===this.steps.length||e<0||e>=this.steps.length)return;this._stopAutoplay(),this._messagesCompletedForStep=!1;const s=this.currentStepIndex,i=this.targetElement;this.currentStepIndex=e;const n=this.steps[this.currentStepIndex];this._emit("beforeStepChange",{fromIndex:s,toIndex:e,step:n,fromTarget:i}),this.manualDirection=n.direction||null,this._targetYHistory=[],this.lastTargetY=null,this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout),this._emit("animationStart",{fromTarget:i,toTarget:t.getTargetElement(n.target),type:"step",stepIndex:e}),this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._emit("moveComplete",{index:e,step:n,target:this.targetElement}),this._emit("animationEnd",{fromTarget:i,toTarget:this.targetElement,type:"step",stepIndex:e}),this._scheduleAutoplay()},this.animationDuration),this._emit("move",{index:e,step:n}),this._applyMessages(n.content,!0),this.targetElement=t.getTargetElement(n.target),this.updatePosition(),this._emit("stepChange",{fromIndex:s,toIndex:e,step:n,target:this.targetElement}),this.onStepChange&&this.onStepChange(this.currentStepIndex,n)}_scheduleAutoplay(){if(!this.autoplay||!this.autoplayEnabled||this._autoplayPaused||!this.isVisible)return;const t=this.steps[this.currentStepIndex],e=this.currentMessages.length>1&&this.messageInterval;if(this.autoplayWaitForMessages&&e)return;const s=void 0!==t.duration?t.duration:this.autoplay;s&&s>0&&(this._autoplayTimeoutId=setTimeout(()=>{!this._autoplayPaused&&this.isVisible&&this.autoplayEnabled&&(this._emit("autoplayNext",{fromIndex:this.currentStepIndex,duration:s}),this.next())},s))}_scheduleAutoplayAfterMessages(){if(!this.autoplay||!this.autoplayEnabled||this._autoplayPaused||!this.isVisible)return;this._autoplayTimeoutId=setTimeout(()=>{!this._autoplayPaused&&this.isVisible&&this._messagesCompletedForStep&&(this._emit("autoplayNext",{fromIndex:this.currentStepIndex,afterMessages:!0}),this.next())},300)}_stopAutoplay(){this._autoplayTimeoutId&&(clearTimeout(this._autoplayTimeoutId),this._autoplayTimeoutId=null)}startAutoplay(){this.autoplay&&(this.autoplayEnabled=!0,this._autoplayPaused=!1,this._emit("autoplayStart",{}),this._scheduleAutoplay())}stopAutoplay(){this._stopAutoplay(),this.autoplayEnabled=!1,this._autoplayPaused=!1,this._emit("autoplayStop",{})}pauseAutoplay(){this._stopAutoplay(),this._autoplayPaused=!0,this._emit("autoplayPause",{})}resumeAutoplay(){this._autoplayPaused&&(this._autoplayPaused=!1,this._emit("autoplayResume",{}),this._scheduleAutoplay())}isAutoplayActive(){return this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused}isAutoplayPaused(){return this._autoplayPaused}setAutoplayInterval(t){const e=this.autoplay;e!==t&&(this.autoplay=t,this._emit("autoplayChange",{from:e,to:t}),this.autoplayEnabled&&t&&this.isVisible?(this._stopAutoplay(),this._scheduleAutoplay()):t||(this._stopAutoplay(),this.autoplayEnabled=!1))}setAutoplay(t){this.setAutoplayInterval(t),t&&this.isVisible&&(this.autoplayEnabled=!0,this._autoplayPaused=!1,this.restart())}setAutoplayWaitForMessages(t){const e=this.autoplayWaitForMessages;e!==t&&(this.autoplayWaitForMessages=t,this._emit("autoplayWaitForMessagesChange",{from:e,to:t}))}setHideOnComplete(t){const e=this.hideOnComplete;e!==t&&(this.hideOnComplete=t,this._emit("hideOnCompleteChange",{from:e,to:t}))}setHideOnCompleteDelay(t){const e=this.hideOnCompleteDelay;e!==t&&(this.hideOnCompleteDelay=t,this._emit("hideOnCompleteDelayChange",{from:e,to:t}))}next(){if(0!==this.steps.length)if(this.currentStepIndex<this.steps.length-1)this._emit("next",{fromIndex:this.currentStepIndex,toIndex:this.currentStepIndex+1}),this.goToStep(this.currentStepIndex+1);else{const t=this.autoplay&&this.autoplayEnabled&&!this._autoplayPaused;if(this._emit("complete",{totalSteps:this.steps.length,source:t?"autoplay":"manual"}),t&&(this._stopAutoplay(),this.autoplayEnabled=!1,this._emit("autoplayComplete",{totalSteps:this.steps.length})),this.resetOnComplete){if(this.reset(),this.hideOnComplete){const e=null!==this.hideOnCompleteDelay?this.hideOnCompleteDelay:this.animationDuration,s=t?"autoplay":"manual";this._hideOnCompleteTimeoutId=setTimeout(()=>{this.hide(),this._emit("autoHide",{delay:e,source:s})},this.animationDuration+e)}}else if(this.hideOnComplete){const e=null!==this.hideOnCompleteDelay?this.hideOnCompleteDelay:this.animationDuration,s=t?"autoplay":"manual";this._hideOnCompleteTimeoutId=setTimeout(()=>{this.hide(),this._emit("autoHide",{delay:e,source:s})},e)}this.onComplete&&this.onComplete()}}prev(){0!==this.steps.length&&this.currentStepIndex>0&&(this._emit("prev",{fromIndex:this.currentStepIndex,toIndex:this.currentStepIndex-1}),this.goToStep(this.currentStepIndex-1))}getCurrentStep(){return this.currentStepIndex}getTotalSteps(){return this.steps.length}pointTo(e,s,i){const n=this.targetElement,a=i||"auto";this._emit("beforePointTo",{target:t.getTargetElement(e),content:s,direction:a,fromTarget:n}),this.manualDirection=i||null,this._targetYHistory=[],this.lastTargetY=null,this.container.classList.add(this.classNames.moving),this.moveTimeout&&clearTimeout(this.moveTimeout);const o=t.getTargetElement(e);this._emit("animationStart",{fromTarget:n,toTarget:o,type:"pointTo",content:s}),this.targetElement=o,void 0!==s&&this._applyMessages(s,!1),this.updatePosition();const r=this.isPointingUp?"up":"down";this.moveTimeout=setTimeout(()=>{this.container.classList.remove(this.classNames.moving),this._emit("pointToComplete",{target:this.targetElement,content:s,direction:r}),this._emit("animationEnd",{fromTarget:n,toTarget:this.targetElement,type:"pointTo",content:s})},this.animationDuration),this._emit("pointTo",{target:this.targetElement,content:s,direction:r}),this.isVisible||this.show()}on(t,e){return this._eventListeners[t]||(this._eventListeners[t]=[]),this._eventListeners[t].push(e),this}off(t,e){return this._eventListeners[t]?(e?this._eventListeners[t]=this._eventListeners[t].filter(t=>t!==e):delete this._eventListeners[t],this):this}_emit(e,s){const i={...s,type:e,pointy:this};this._eventListeners[e]&&this._eventListeners[e].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in ${e} event handler:`,t)}});const n=t.getEventGroup(e);n&&this._eventListeners[n]&&this._eventListeners[n].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in ${n} group handler for ${e}:`,t)}}),["*","all"].forEach(t=>{this._eventListeners[t]&&this._eventListeners[t].forEach(t=>{try{t(i)}catch(t){console.error(`Pointy: Error in wildcard handler for ${e}:`,t)}})})}static getEventGroup(e){for(const[s,i]of Object.entries(t.EVENT_GROUPS))if(i.includes(e))return s;return e.endsWith("Change")?"config":null}static getEventsInGroup(e){return t.EVENT_GROUPS[e]||[]}}return t.EVENT_GROUPS={lifecycle:["beforeShow","show","beforeHide","hide","destroy","beforeRestart","restart","beforeReset","reset"],navigation:["beforeStepChange","stepChange","next","prev","complete"],animation:["animationStart","animationEnd","move","moveComplete","introAnimationStart","introAnimationEnd"],content:["contentSet","messagesSet","messageChange"],messageCycle:["messageCycleStart","messageCycleStop","messageCyclePause","messageCycleResume","messageCycleComplete"],pointing:["beforePointTo","pointTo","pointToComplete"],tracking:["track","targetChange","trackingChange","trackingFpsChange"],autoplay:["autoplayStart","autoplayStop","autoplayPause","autoplayResume","autoplayNext","autoplayComplete","autoHide","autoplayChange","autoplayWaitForMessagesChange"]},t});
2
2
  //# sourceMappingURL=pointy.min.js.map