@eventop/sdk 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js ADDED
@@ -0,0 +1,1041 @@
1
+ function _mergeNamespaces(n, m) {
2
+ m.forEach(function (e) {
3
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
4
+ if (k !== 'default' && !(k in n)) {
5
+ var d = Object.getOwnPropertyDescriptor(e, k);
6
+ Object.defineProperty(n, k, d.get ? d : {
7
+ enumerable: true,
8
+ get: function () { return e[k]; }
9
+ });
10
+ }
11
+ });
12
+ });
13
+ return Object.freeze(n);
14
+ }
15
+
16
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
17
+
18
+ var core$1 = {exports: {}};
19
+
20
+ /**
21
+ * ╔══════════════════════════════════════════════════════════════╗
22
+ * ║ @eventop/sdk v1.1.0 ║
23
+ * ║ AI-powered guided tours — themeable, provider-agnostic ║
24
+ * ║ ║
25
+ * ║ Provider: always proxy through your own server. ║
26
+ * ║ Never expose API keys in client-side code. ║
27
+ * ╚══════════════════════════════════════════════════════════════╝
28
+ */
29
+ (function (module) {
30
+ (function (global, factory) {
31
+ if (module.exports) {
32
+ module.exports = factory();
33
+ } else {
34
+ global.Eventop = factory();
35
+ }
36
+ })(typeof globalThis !== 'undefined' ? globalThis : commonjsGlobal, function () {
37
+
38
+ const SHEPHERD_CSS = 'https://cdn.jsdelivr.net/npm/shepherd.js@11.2.0/dist/css/shepherd.css';
39
+ const SHEPHERD_JS = 'https://cdn.jsdelivr.net/npm/shepherd.js@11.2.0/dist/js/shepherd.min.js';
40
+
41
+ // ─── Internal state ──────────────────────────────────────────────────────────
42
+ let _provider = null;
43
+ let _config = null;
44
+ let _tour = null;
45
+ let _isOpen = false;
46
+ let _messages = [];
47
+ let _mediaQuery = null;
48
+
49
+ // Pause/resume state
50
+ let _pausedSteps = null;
51
+ let _pausedIndex = 0;
52
+
53
+ // Active cleanup callbacks — cleared when tour ends or is paused
54
+ let _cleanups = [];
55
+
56
+ // ═══════════════════════════════════════════════════════════════════════════
57
+ // THEME ENGINE
58
+ // ═══════════════════════════════════════════════════════════════════════════
59
+
60
+ const DARK_TOKENS = {
61
+ accent: '#e94560',
62
+ accentSecondary: '#a855f7',
63
+ bg: '#0f0f1a',
64
+ surface: '#1a1a2e',
65
+ border: '#2a2a4a',
66
+ text: '#e0e0f0',
67
+ textDim: '#6060a0',
68
+ radius: '16px',
69
+ fontFamily: "system-ui, -apple-system, 'Segoe UI', sans-serif"
70
+ };
71
+ const LIGHT_TOKENS = {
72
+ accent: '#e94560',
73
+ accentSecondary: '#7c3aed',
74
+ bg: '#ffffff',
75
+ surface: '#f8f8fc',
76
+ border: '#e4e4f0',
77
+ text: '#1a1a2e',
78
+ textDim: '#888899',
79
+ radius: '16px',
80
+ fontFamily: "system-ui, -apple-system, 'Segoe UI', sans-serif"
81
+ };
82
+ const PRESETS = {
83
+ default: {},
84
+ minimal: {
85
+ accent: '#000000',
86
+ accentSecondary: '#333333',
87
+ radius: '8px'
88
+ },
89
+ soft: {
90
+ accent: '#6366f1',
91
+ accentSecondary: '#8b5cf6',
92
+ radius: '20px'
93
+ }
94
+ };
95
+ function resolveTheme(themeConfig = {}) {
96
+ var _window$matchMedia, _window;
97
+ const {
98
+ mode = 'auto',
99
+ preset = 'default',
100
+ tokens = {}
101
+ } = themeConfig;
102
+ const isDark = mode === 'auto' ? ((_window$matchMedia = (_window = window).matchMedia) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.call(_window, '(prefers-color-scheme: dark)').matches) ?? true : mode === 'dark';
103
+ const base = isDark ? {
104
+ ...DARK_TOKENS
105
+ } : {
106
+ ...LIGHT_TOKENS
107
+ };
108
+ return {
109
+ ...base,
110
+ ...(PRESETS[preset] || {}),
111
+ ...tokens,
112
+ _isDark: isDark
113
+ };
114
+ }
115
+ function buildCSSVars(t) {
116
+ return `
117
+ --sai-accent: ${t.accent};
118
+ --sai-accent2: ${t.accentSecondary};
119
+ --sai-bg: ${t.bg};
120
+ --sai-surface: ${t.surface};
121
+ --sai-border: ${t.border};
122
+ --sai-text: ${t.text};
123
+ --sai-text-dim: ${t.textDim};
124
+ --sai-radius: ${t.radius};
125
+ --sai-font: ${t.fontFamily};
126
+ `;
127
+ }
128
+ function applyTheme(t) {
129
+ const panel = document.getElementById('sai-panel');
130
+ const trigger = document.getElementById('sai-trigger');
131
+ if (panel) {
132
+ panel.style.cssText += buildCSSVars(t);
133
+ }
134
+ if (trigger) {
135
+ trigger.style.cssText += buildCSSVars(t);
136
+ }
137
+ }
138
+
139
+ // ═══════════════════════════════════════════════════════════════════════════
140
+ // POSITIONING
141
+ // ═══════════════════════════════════════════════════════════════════════════
142
+
143
+ function resolvePosition(posConfig = {}) {
144
+ const {
145
+ corner = 'bottom-right',
146
+ offsetX = 28,
147
+ offsetY = 28
148
+ } = posConfig;
149
+ const isLeft = corner.includes('left');
150
+ const isTop = corner.includes('top');
151
+ return {
152
+ trigger: {
153
+ [isLeft ? 'left' : 'right']: `${offsetX}px`,
154
+ [isTop ? 'top' : 'bottom']: `${offsetY}px`
155
+ },
156
+ panel: {
157
+ [isLeft ? 'left' : 'right']: `${offsetX}px`,
158
+ [isTop ? 'top' : 'bottom']: `${offsetY + 56 + 12}px`,
159
+ transformOrigin: isTop ? 'top center' : 'bottom center'
160
+ }
161
+ };
162
+ }
163
+ function positionToCSS(obj) {
164
+ return Object.entries(obj).map(([k, v]) => `${k}:${v}`).join(';');
165
+ }
166
+
167
+ // ═══════════════════════════════════════════════════════════════════════════
168
+ // PROVIDER
169
+ // Only custom() is supported — route AI calls through your own server.
170
+ //
171
+ // Your endpoint receives: POST { systemPrompt, messages }
172
+ // Your endpoint must return: { message: string, steps: Step[] }
173
+ //
174
+ // @example
175
+ // Eventop.init({
176
+ // provider: Eventop.providers.custom(async ({ systemPrompt, messages }) => {
177
+ // const res = await fetch('/api/guide', {
178
+ // method: 'POST',
179
+ // headers: { 'Content-Type': 'application/json' },
180
+ // body: JSON.stringify({ systemPrompt, messages }),
181
+ // });
182
+ // return res.json();
183
+ // }),
184
+ // config: { ... },
185
+ // });
186
+ // ═══════════════════════════════════════════════════════════════════════════
187
+
188
+ const providers = {
189
+ custom(fn) {
190
+ if (typeof fn !== 'function') throw new Error('[Eventop] providers.custom() requires a function');
191
+ return fn;
192
+ }
193
+ };
194
+
195
+ // ═══════════════════════════════════════════════════════════════════════════
196
+ // SYSTEM PROMPT
197
+ // ═══════════════════════════════════════════════════════════════════════════
198
+
199
+ function buildSystemPrompt() {
200
+ const screens = [...new Set((_config.features || []).filter(f => {
201
+ var _f$screen;
202
+ return (_f$screen = f.screen) === null || _f$screen === void 0 ? void 0 : _f$screen.id;
203
+ }).map(f => f.screen.id))];
204
+ const featureSummary = (_config.features || []).map(f => {
205
+ var _f$screen2, _f$flow;
206
+ const entry = {
207
+ id: f.id,
208
+ name: f.name,
209
+ description: f.description,
210
+ screen: ((_f$screen2 = f.screen) === null || _f$screen2 === void 0 ? void 0 : _f$screen2.id) || 'default'
211
+ };
212
+ if ((_f$flow = f.flow) !== null && _f$flow !== void 0 && _f$flow.length) {
213
+ entry.note = `This feature has ${f.flow.length} sequential sub-steps. Include ONE step per flow entry.`;
214
+ }
215
+ return entry;
216
+ });
217
+ return `
218
+ You are an in-app assistant called "${_config.assistantName || 'AI Guide'}" for "${_config.appName}".
219
+ Your ONLY job: guide users step-by-step through tasks using the feature map below.
220
+
221
+ ${screens.length > 1 ? `SCREENS: This app has multiple screens: ${screens.join(', ')}. Features are screen-specific. The SDK handles navigation — just pick the right features.` : ''}
222
+
223
+ FEATURE MAP (only reference IDs from this list):
224
+ ${JSON.stringify(featureSummary, null, 2)}
225
+
226
+ RESPOND ONLY with this exact JSON — no markdown, no extra text:
227
+ {
228
+ "message": "Friendly 1-2 sentence intro about what you are helping with.",
229
+ "steps": [
230
+ {
231
+ "id": "feature-id-from-map",
232
+ "title": "3-5 word title",
233
+ "text": "Exact instruction. Max 2 sentences.",
234
+ "selector": "#selector-from-feature-map",
235
+ "position": "bottom"
236
+ }
237
+ ]
238
+ }
239
+
240
+ RULES:
241
+ 1. The step "id" MUST match a feature id from the feature map.
242
+ 2. Only use selectors and IDs from the feature map. Never invent them.
243
+ 3. No matching feature → steps: [], explain kindly in message.
244
+ 4. position values: top | bottom | left | right | auto only.
245
+ 5. Order steps logically. For multi-step flows, order as the user encounters them.
246
+ 6. For forms: ALWAYS include a step for the form section or first input BEFORE the
247
+ continue/submit button. The button step must always be LAST in its section.
248
+ 7. If a feature has a flow, include one step per flow entry using the same feature id —
249
+ the SDK expands them automatically.
250
+ 8. Never skip features in a required sequence. Include every step end-to-end.
251
+ `.trim();
252
+ }
253
+ async function callAI(userMessage) {
254
+ const systemPrompt = buildSystemPrompt();
255
+ const messagesWithNew = [..._messages, {
256
+ role: 'user',
257
+ content: userMessage
258
+ }];
259
+ const result = await _provider({
260
+ systemPrompt,
261
+ messages: messagesWithNew
262
+ });
263
+ _messages.push({
264
+ role: 'user',
265
+ content: userMessage
266
+ });
267
+ _messages.push({
268
+ role: 'assistant',
269
+ content: result.message
270
+ });
271
+ return result;
272
+ }
273
+
274
+ // ═══════════════════════════════════════════════════════════════════════════
275
+ // SCREEN NAVIGATION
276
+ // ═══════════════════════════════════════════════════════════════════════════
277
+
278
+ async function ensureOnCorrectScreen(feature) {
279
+ if (!feature.screen) return;
280
+ if (typeof feature.screen.check === 'function' && feature.screen.check()) return;
281
+ addMsg('ai', 'Taking you to the right screen first…');
282
+ if (typeof feature.screen.navigate === 'function') {
283
+ feature.screen.navigate();
284
+ }
285
+ const waitSelector = feature.screen.waitFor || feature.selector;
286
+ if (waitSelector) await waitForElement(waitSelector, 10000);
287
+ }
288
+
289
+ // ═══════════════════════════════════════════════════════════════════════════
290
+ // FLOW EXPANSION
291
+ // A feature with flow[] gets expanded into multiple Shepherd steps.
292
+ // Developer supplies selectors; AI supplies copy for the parent step.
293
+ // ═══════════════════════════════════════════════════════════════════════════
294
+
295
+ function expandFlowSteps(aiStep, feature) {
296
+ var _feature$flow;
297
+ if (!((_feature$flow = feature.flow) !== null && _feature$flow !== void 0 && _feature$flow.length)) return [aiStep];
298
+ return feature.flow.map((entry, i) => ({
299
+ id: `${aiStep.id}-flow-${i}`,
300
+ title: i === 0 ? aiStep.title : `${aiStep.title} (${i + 1}/${feature.flow.length})`,
301
+ text: i === 0 ? aiStep.text : `Step ${i + 1} of ${feature.flow.length}: continue with the action highlighted below.`,
302
+ position: aiStep.position || 'bottom',
303
+ selector: entry.selector || null,
304
+ waitFor: entry.waitFor || null,
305
+ advanceOn: entry.advanceOn || null,
306
+ _parentId: aiStep.id
307
+ }));
308
+ }
309
+
310
+ // ═══════════════════════════════════════════════════════════════════════════
311
+ // SHEPHERD RUNNER
312
+ // ═══════════════════════════════════════════════════════════════════════════
313
+
314
+ function loadCSS(href) {
315
+ if (document.querySelector(`link[href="${href}"]`)) return;
316
+ const l = document.createElement('link');
317
+ l.rel = 'stylesheet';
318
+ l.href = href;
319
+ document.head.appendChild(l);
320
+ }
321
+ function loadScript(src) {
322
+ return new Promise((res, rej) => {
323
+ if (document.querySelector(`script[src="${src}"]`)) return res();
324
+ const s = document.createElement('script');
325
+ s.src = src;
326
+ s.onload = res;
327
+ s.onerror = rej;
328
+ document.head.appendChild(s);
329
+ });
330
+ }
331
+ async function ensureShepherd() {
332
+ if (typeof Shepherd !== 'undefined') return;
333
+ loadCSS(SHEPHERD_CSS);
334
+ await loadScript(SHEPHERD_JS);
335
+ }
336
+ function waitForElement(selector, timeout = 8000) {
337
+ return new Promise(resolve => {
338
+ if (document.querySelector(selector)) return resolve();
339
+ const timer = setTimeout(() => {
340
+ observer.disconnect();
341
+ console.warn(`[Eventop] waitFor("${selector}") timed out — continuing`);
342
+ resolve();
343
+ }, timeout);
344
+ const observer = new MutationObserver(() => {
345
+ if (document.querySelector(selector)) {
346
+ clearTimeout(timer);
347
+ observer.disconnect();
348
+ resolve();
349
+ }
350
+ });
351
+ observer.observe(document.body, {
352
+ childList: true,
353
+ subtree: true
354
+ });
355
+ _cleanups.push(() => {
356
+ clearTimeout(timer);
357
+ observer.disconnect();
358
+ });
359
+ });
360
+ }
361
+ function mergeWithFeature(step) {
362
+ var _config2;
363
+ if (!((_config2 = _config) !== null && _config2 !== void 0 && _config2.features)) return step;
364
+ const feature = _config.features.find(f => f.id === step.id);
365
+ if (!feature) return step;
366
+ return {
367
+ waitFor: feature.waitFor || null,
368
+ advanceOn: feature.advanceOn || null,
369
+ validate: feature.validate || null,
370
+ screen: feature.screen || null,
371
+ flow: feature.flow || null,
372
+ ...step,
373
+ selector: feature.selector || step.selector // feature map always wins
374
+ };
375
+ }
376
+ function wireAdvanceOn(shepherdStep, advanceOn, tour) {
377
+ if (!(advanceOn !== null && advanceOn !== void 0 && advanceOn.selector) || !(advanceOn !== null && advanceOn !== void 0 && advanceOn.event)) return;
378
+ function handler(e) {
379
+ if (e.target.matches(advanceOn.selector) || e.target.closest(advanceOn.selector)) {
380
+ setTimeout(() => {
381
+ if (tour && !tour.isActive()) return;
382
+ tour.next();
383
+ }, advanceOn.delay || 300);
384
+ }
385
+ }
386
+ document.addEventListener(advanceOn.event, handler, true);
387
+ _cleanups.push(() => document.removeEventListener(advanceOn.event, handler, true));
388
+ shepherdStep.on('show', () => {
389
+ var _shepherdStep$getElem;
390
+ const nextBtn = (_shepherdStep$getElem = shepherdStep.getElement()) === null || _shepherdStep$getElem === void 0 ? void 0 : _shepherdStep$getElem.querySelector('.shepherd-footer .shepherd-button:not(.shepherd-button-secondary)');
391
+ if (nextBtn && !shepherdStep._isLast) {
392
+ nextBtn.style.opacity = '0.4';
393
+ nextBtn.title = 'Complete the action above to continue';
394
+ }
395
+ });
396
+ }
397
+ function addProgressIndicator(shepherdStep, index, total) {
398
+ shepherdStep.on('show', () => {
399
+ var _shepherdStep$getElem2;
400
+ const header = (_shepherdStep$getElem2 = shepherdStep.getElement()) === null || _shepherdStep$getElem2 === void 0 ? void 0 : _shepherdStep$getElem2.querySelector('.shepherd-header');
401
+ if (!header || header.querySelector('.sai-progress')) return;
402
+ const pct = Math.round((index + 1) / total * 100);
403
+ const wrapper = document.createElement('div');
404
+ wrapper.className = 'sai-progress';
405
+ wrapper.innerHTML = `
406
+ <div class="sai-progress-bar">
407
+ <div class="sai-progress-fill" style="width:${pct}%"></div>
408
+ </div>
409
+ <span class="sai-progress-label">${index + 1} / ${total}</span>
410
+ `;
411
+ header.appendChild(wrapper);
412
+ });
413
+ }
414
+ function showResumeButton(fromIndex) {
415
+ var _document$getElementB, _document$getElementB2;
416
+ const msgs = document.getElementById('sai-messages');
417
+ if (!msgs) return;
418
+ (_document$getElementB = document.getElementById('sai-resume-prompt')) === null || _document$getElementB === void 0 || _document$getElementB.remove();
419
+ const div = document.createElement('div');
420
+ div.id = 'sai-resume-prompt';
421
+ div.className = 'sai-msg sai-ai';
422
+ div.innerHTML = `
423
+ Tour paused. Ready when you are.
424
+ <br/>
425
+ <button class="sai-chip" id="sai-resume-btn" style="display:inline-block;margin-top:8px;">
426
+ ▶ Resume from step ${fromIndex + 1}
427
+ </button>
428
+ `;
429
+ msgs.appendChild(div);
430
+ msgs.scrollTop = msgs.scrollHeight;
431
+ (_document$getElementB2 = document.getElementById('sai-resume-btn')) === null || _document$getElementB2 === void 0 || _document$getElementB2.addEventListener('click', () => {
432
+ div.remove();
433
+ if (!_pausedSteps) return;
434
+ const steps = _pausedSteps;
435
+ const idx = _pausedIndex;
436
+ _pausedSteps = null;
437
+ _pausedIndex = 0;
438
+ if (_isOpen) togglePanel();
439
+ runTour(steps.slice(idx));
440
+ });
441
+ if (!_isOpen) togglePanel();
442
+ }
443
+ async function runTour(steps, options = {}) {
444
+ var _config3;
445
+ await ensureShepherd();
446
+ if (_tour) {
447
+ _tour.cancel();
448
+ }
449
+ _cleanups.forEach(fn => fn());
450
+ _cleanups = [];
451
+ _tour = null;
452
+ if (!(steps !== null && steps !== void 0 && steps.length)) return;
453
+ const {
454
+ showProgress = true,
455
+ waitTimeout = 8000
456
+ } = options;
457
+
458
+ // Merge AI steps with feature map
459
+ const mergedSteps = steps.map(mergeWithFeature);
460
+
461
+ // Navigate to the correct screen for the first step if needed
462
+ const firstFeature = (_config3 = _config) === null || _config3 === void 0 || (_config3 = _config3.features) === null || _config3 === void 0 ? void 0 : _config3.find(f => {
463
+ var _mergedSteps$;
464
+ return f.id === ((_mergedSteps$ = mergedSteps[0]) === null || _mergedSteps$ === void 0 ? void 0 : _mergedSteps$.id);
465
+ });
466
+ if (firstFeature) await ensureOnCorrectScreen(firstFeature);
467
+
468
+ // Expand flow[] features into individual Shepherd steps
469
+ const expandedSteps = mergedSteps.flatMap(step => {
470
+ var _config4;
471
+ const feature = (_config4 = _config) === null || _config4 === void 0 || (_config4 = _config4.features) === null || _config4 === void 0 ? void 0 : _config4.find(f => f.id === step.id);
472
+ return feature ? expandFlowSteps(step, feature) : [step];
473
+ });
474
+ const ShepherdClass = typeof Shepherd !== 'undefined' ? Shepherd : window.Shepherd;
475
+ _tour = new ShepherdClass.Tour({
476
+ useModalOverlay: true,
477
+ defaultStepOptions: {
478
+ scrollTo: {
479
+ behavior: 'smooth',
480
+ block: 'center'
481
+ },
482
+ cancelIcon: {
483
+ enabled: true
484
+ },
485
+ classes: 'sai-shepherd-step'
486
+ }
487
+ });
488
+ expandedSteps.forEach((step, i) => {
489
+ var _step$advanceOn, _step$advanceOn2;
490
+ const isLast = i === expandedSteps.length - 1;
491
+ const hasAuto = !!((_step$advanceOn = step.advanceOn) !== null && _step$advanceOn !== void 0 && _step$advanceOn.selector && (_step$advanceOn2 = step.advanceOn) !== null && _step$advanceOn2 !== void 0 && _step$advanceOn2.event);
492
+ const buttons = [];
493
+ if (i > 0) {
494
+ buttons.push({
495
+ text: '← Back',
496
+ action: _tour.back,
497
+ secondary: true
498
+ });
499
+ }
500
+ buttons.push({
501
+ text: isLast ? 'Done ✓' : 'Next →',
502
+ action: isLast ? _tour.complete : _tour.next
503
+ });
504
+ buttons.push({
505
+ text: '⏸ Pause',
506
+ secondary: true,
507
+ action: function () {
508
+ _tour.cancel();
509
+ }
510
+ });
511
+ const shepherdStep = _tour.addStep({
512
+ id: step.id || `sai-step-${i}`,
513
+ title: step.title,
514
+ text: step.text,
515
+ attachTo: step.selector ? {
516
+ element: step.selector,
517
+ on: step.position || 'bottom'
518
+ } : undefined,
519
+ beforeShowPromise: step.waitFor ? () => waitForElement(step.waitFor, waitTimeout) : undefined,
520
+ buttons
521
+ });
522
+ shepherdStep._isLast = isLast;
523
+ if (hasAuto) wireAdvanceOn(shepherdStep, step.advanceOn, _tour);
524
+ if (showProgress && expandedSteps.length > 1) {
525
+ addProgressIndicator(shepherdStep, i, expandedSteps.length);
526
+ }
527
+ });
528
+ _tour.on('complete', () => {
529
+ _cleanups.forEach(fn => fn());
530
+ _cleanups = [];
531
+ _pausedSteps = null;
532
+ _pausedIndex = 0;
533
+ _tour = null;
534
+ });
535
+
536
+ // Cancel → pause instead of hard destroy
537
+ _tour.on('cancel', () => {
538
+ const currentStepEl = _tour.getCurrentStep();
539
+ const currentIdx = currentStepEl ? expandedSteps.findIndex(s => s.id === currentStepEl.id) : 0;
540
+ _cleanups.forEach(fn => fn());
541
+ _cleanups = [];
542
+ _pausedSteps = expandedSteps;
543
+ _pausedIndex = Math.max(0, currentIdx);
544
+ _tour = null;
545
+ showResumeButton(_pausedIndex);
546
+ });
547
+ _tour.start();
548
+ }
549
+ function stepComplete() {
550
+ var _tour2;
551
+ if ((_tour2 = _tour) !== null && _tour2 !== void 0 && _tour2.isActive()) _tour.next();
552
+ }
553
+ function stepFail(message) {
554
+ var _tour3, _el$querySelector;
555
+ if (!((_tour3 = _tour) !== null && _tour3 !== void 0 && _tour3.isActive())) return;
556
+ const current = _tour.getCurrentStep();
557
+ if (!current) return;
558
+ const el = current.getElement();
559
+ el === null || el === void 0 || (_el$querySelector = el.querySelector('.sai-step-error')) === null || _el$querySelector === void 0 || _el$querySelector.remove();
560
+ if (message) {
561
+ var _el$querySelector2;
562
+ const err = document.createElement('div');
563
+ err.className = 'sai-step-error';
564
+ err.textContent = '⚠ ' + message;
565
+ el === null || el === void 0 || (_el$querySelector2 = el.querySelector('.shepherd-text')) === null || _el$querySelector2 === void 0 || _el$querySelector2.appendChild(err);
566
+ }
567
+ }
568
+
569
+ // ═══════════════════════════════════════════════════════════════════════════
570
+ // STYLES
571
+ // ═══════════════════════════════════════════════════════════════════════════
572
+
573
+ function injectStyles(theme, pos) {
574
+ if (document.getElementById('sai-styles')) return;
575
+ const triggerCSS = positionToCSS(pos.trigger);
576
+ const panelCSS = positionToCSS(pos.panel);
577
+ const isDark = theme._isDark;
578
+ const stepBg = isDark ? 'var(--sai-bg)' : '#ffffff';
579
+ const stepSurf = isDark ? 'var(--sai-surface)' : '#f8f8fc';
580
+ const stepText = isDark ? 'var(--sai-text)' : '#1a1a2e';
581
+ const stepBorder = isDark ? 'var(--sai-border)' : '#e4e4f0';
582
+ const style = document.createElement('style');
583
+ style.id = 'sai-styles';
584
+ style.textContent = `
585
+ #sai-trigger, #sai-panel { ${buildCSSVars(theme)} }
586
+
587
+ /* ── Trigger ── */
588
+ #sai-trigger {
589
+ position: fixed; ${triggerCSS};
590
+ width: 54px; height: 54px; border-radius: 50%;
591
+ background: var(--sai-surface); border: 2px solid var(--sai-accent);
592
+ color: var(--sai-text); font-size: 20px; cursor: pointer; z-index: 99998;
593
+ display: flex; align-items: center; justify-content: center;
594
+ box-shadow: 0 4px 20px color-mix(in srgb, var(--sai-accent) 40%, transparent);
595
+ transition: transform .2s ease, box-shadow .2s ease;
596
+ font-family: var(--sai-font); padding: 0;
597
+ }
598
+ #sai-trigger:hover {
599
+ transform: scale(1.08);
600
+ box-shadow: 0 6px 28px color-mix(in srgb, var(--sai-accent) 55%, transparent);
601
+ }
602
+ #sai-trigger .sai-pulse {
603
+ position: absolute; width: 100%; height: 100%; border-radius: 50%;
604
+ background: color-mix(in srgb, var(--sai-accent) 30%, transparent);
605
+ animation: sai-pulse 2.2s ease-out infinite; pointer-events: none;
606
+ }
607
+ #sai-trigger.sai-paused .sai-pulse { animation: none; }
608
+ #sai-trigger.sai-paused::after {
609
+ content: '⏸'; position: absolute; bottom: -2px; right: -2px;
610
+ font-size: 12px; background: var(--sai-accent); border-radius: 50%;
611
+ width: 18px; height: 18px; display: flex; align-items: center;
612
+ justify-content: center; color: #fff; line-height: 1;
613
+ }
614
+ @keyframes sai-pulse {
615
+ 0% { transform: scale(1); opacity: .8; }
616
+ 100% { transform: scale(1.75); opacity: 0; }
617
+ }
618
+
619
+ /* ── Panel ── */
620
+ #sai-panel {
621
+ position: fixed; ${panelCSS};
622
+ width: 340px; background: var(--sai-bg);
623
+ border: 1px solid var(--sai-border); border-radius: var(--sai-radius);
624
+ display: flex; flex-direction: column; z-index: 99999; overflow: hidden;
625
+ box-shadow: 0 16px 48px rgba(0,0,0,.18); font-family: var(--sai-font);
626
+ transform: translateY(12px) scale(.97); opacity: 0; pointer-events: none;
627
+ transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s ease;
628
+ max-height: 520px;
629
+ }
630
+ #sai-panel.sai-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }
631
+
632
+ /* ── Header ── */
633
+ #sai-header {
634
+ display: flex; align-items: center; gap: 10px; padding: 13px 15px;
635
+ background: var(--sai-surface); border-bottom: 1px solid var(--sai-border);
636
+ }
637
+ #sai-avatar {
638
+ width: 30px; height: 30px; border-radius: 50%;
639
+ background: linear-gradient(135deg, var(--sai-accent), var(--sai-accent2));
640
+ display: flex; align-items: center; justify-content: center;
641
+ font-size: 14px; flex-shrink: 0; color: #fff;
642
+ }
643
+ #sai-header-info { flex: 1; min-width: 0; }
644
+ #sai-header-info h4 {
645
+ margin: 0; font-size: 13px; font-weight: 600; color: var(--sai-text);
646
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
647
+ }
648
+ #sai-header-info p {
649
+ margin: 0; font-size: 11px; color: var(--sai-text-dim);
650
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
651
+ }
652
+ #sai-close {
653
+ background: none; border: none; color: var(--sai-text-dim); cursor: pointer;
654
+ font-size: 18px; line-height: 1; padding: 0; flex-shrink: 0; transition: color .15s;
655
+ }
656
+ #sai-close:hover { color: var(--sai-text); }
657
+
658
+ /* ── Messages ── */
659
+ #sai-messages {
660
+ flex: 1; overflow-y: auto; padding: 12px;
661
+ display: flex; flex-direction: column; gap: 9px;
662
+ min-height: 160px; max-height: 280px;
663
+ scrollbar-width: thin; scrollbar-color: var(--sai-border) transparent;
664
+ }
665
+ #sai-messages::-webkit-scrollbar { width: 4px; }
666
+ #sai-messages::-webkit-scrollbar-thumb { background: var(--sai-border); border-radius: 2px; }
667
+ .sai-msg {
668
+ max-width: 86%; padding: 8px 11px; border-radius: 11px;
669
+ font-size: 13px; line-height: 1.55; animation: sai-in .18s ease both;
670
+ }
671
+ @keyframes sai-in {
672
+ from { opacity: 0; transform: translateY(5px); }
673
+ to { opacity: 1; transform: translateY(0); }
674
+ }
675
+ .sai-msg.sai-ai {
676
+ background: var(--sai-surface); color: var(--sai-text);
677
+ border-bottom-left-radius: 3px; align-self: flex-start;
678
+ border: 1px solid var(--sai-border);
679
+ }
680
+ .sai-msg.sai-user {
681
+ background: var(--sai-accent); color: #fff;
682
+ border-bottom-right-radius: 3px; align-self: flex-end;
683
+ }
684
+ .sai-msg.sai-error {
685
+ background: color-mix(in srgb, #ef4444 10%, var(--sai-bg));
686
+ color: #ef4444;
687
+ border: 1px solid color-mix(in srgb, #ef4444 25%, var(--sai-bg));
688
+ align-self: flex-start;
689
+ }
690
+
691
+ /* ── Typing indicator ── */
692
+ .sai-typing {
693
+ display: flex; gap: 4px; padding: 9px 12px; align-self: flex-start;
694
+ background: var(--sai-surface); border: 1px solid var(--sai-border);
695
+ border-radius: 11px; border-bottom-left-radius: 3px;
696
+ }
697
+ .sai-typing span {
698
+ width: 5px; height: 5px; border-radius: 50%;
699
+ background: var(--sai-text-dim); animation: sai-bounce 1.2s infinite;
700
+ }
701
+ .sai-typing span:nth-child(2) { animation-delay: .15s; }
702
+ .sai-typing span:nth-child(3) { animation-delay: .3s; }
703
+ @keyframes sai-bounce {
704
+ 0%,80%,100% { transform: translateY(0); }
705
+ 40% { transform: translateY(-5px); }
706
+ }
707
+
708
+ /* ── Suggestions ── */
709
+ #sai-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
710
+ .sai-chip {
711
+ font-size: 11px; padding: 5px 10px; border-radius: 20px;
712
+ background: transparent; border: 1px solid var(--sai-border);
713
+ color: var(--sai-text-dim); cursor: pointer; font-family: inherit; transition: all .15s;
714
+ }
715
+ .sai-chip:hover {
716
+ border-color: var(--sai-accent); color: var(--sai-accent);
717
+ background: color-mix(in srgb, var(--sai-accent) 6%, transparent);
718
+ }
719
+
720
+ /* ── Input row ── */
721
+ #sai-inputrow {
722
+ display: flex; align-items: center; gap: 7px; padding: 9px 11px;
723
+ border-top: 1px solid var(--sai-border); background: var(--sai-bg);
724
+ }
725
+ #sai-input {
726
+ flex: 1; background: var(--sai-surface); border: 1px solid var(--sai-border);
727
+ border-radius: 8px; padding: 7px 11px; color: var(--sai-text);
728
+ font-size: 13px; outline: none; transition: border-color .15s; font-family: inherit;
729
+ }
730
+ #sai-input::placeholder { color: var(--sai-text-dim); }
731
+ #sai-input:focus { border-color: var(--sai-accent); }
732
+ #sai-send {
733
+ width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px;
734
+ background: var(--sai-accent); border: none; color: #fff; font-size: 14px;
735
+ cursor: pointer; display: flex; align-items: center; justify-content: center;
736
+ transition: filter .15s, transform .1s; line-height: 1;
737
+ }
738
+ #sai-send:hover { filter: brightness(1.1); }
739
+ #sai-send:active { transform: scale(.93); }
740
+ #sai-send:disabled { background: var(--sai-border); cursor: not-allowed; }
741
+
742
+ /* ── Shepherd step overrides ── */
743
+ .sai-shepherd-step {
744
+ background: ${stepBg} !important;
745
+ border: 1px solid ${stepBorder} !important;
746
+ border-radius: 12px !important;
747
+ box-shadow: 0 8px 36px rgba(0,0,0,.18) !important;
748
+ max-width: 290px !important;
749
+ font-family: var(--sai-font, system-ui) !important;
750
+ }
751
+ .sai-shepherd-step.shepherd-has-title .shepherd-content .shepherd-header {
752
+ background: ${stepSurf} !important; padding: 11px 15px 8px !important;
753
+ border-bottom: 1px solid ${stepBorder} !important;
754
+ }
755
+ .sai-shepherd-step .shepherd-title {
756
+ color: var(--sai-accent, #e94560) !important;
757
+ font-size: 13px !important; font-weight: 700 !important;
758
+ }
759
+ .sai-shepherd-step .shepherd-text {
760
+ color: ${stepText} !important; font-size: 13px !important;
761
+ line-height: 1.6 !important; padding: 10px 15px !important;
762
+ }
763
+ .sai-shepherd-step .shepherd-footer {
764
+ border-top: 1px solid ${stepBorder} !important; padding: 8px 11px !important;
765
+ background: ${stepBg} !important; display: flex; gap: 5px; flex-wrap: wrap;
766
+ }
767
+ .sai-shepherd-step .shepherd-button {
768
+ background: var(--sai-accent, #e94560) !important; color: #fff !important;
769
+ border: none !important; border-radius: 6px !important; padding: 6px 13px !important;
770
+ font-size: 12px !important; font-weight: 600 !important; cursor: pointer !important;
771
+ transition: filter .15s !important; font-family: var(--sai-font, system-ui) !important;
772
+ }
773
+ .sai-shepherd-step .shepherd-button:hover { filter: brightness(1.1) !important; }
774
+ .sai-shepherd-step .shepherd-button-secondary {
775
+ background: transparent !important; color: var(--sai-text-dim, #888) !important;
776
+ border: 1px solid ${stepBorder} !important;
777
+ }
778
+ .sai-shepherd-step .shepherd-button-secondary:hover {
779
+ background: ${stepSurf} !important; color: ${stepText} !important;
780
+ }
781
+ .sai-shepherd-step .shepherd-cancel-icon { color: var(--sai-text-dim, #888) !important; }
782
+ .sai-shepherd-step .shepherd-cancel-icon:hover { color: ${stepText} !important; }
783
+ .sai-shepherd-step[data-popper-placement] > .shepherd-arrow::before {
784
+ background: ${stepBorder} !important;
785
+ }
786
+
787
+ /* ── Progress bar ── */
788
+ .sai-progress { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
789
+ .sai-progress-bar {
790
+ width: 60px; height: 3px; border-radius: 2px; background: ${stepBorder}; overflow: hidden;
791
+ }
792
+ .sai-progress-fill {
793
+ height: 100%; border-radius: 2px;
794
+ background: var(--sai-accent, #e94560); transition: width .3s ease;
795
+ }
796
+ .sai-progress-label {
797
+ font-size: 10px; color: var(--sai-text-dim, #888);
798
+ white-space: nowrap; font-family: var(--sai-font, system-ui);
799
+ }
800
+
801
+ /* ── Step error ── */
802
+ .sai-step-error {
803
+ margin-top: 8px; padding: 6px 10px;
804
+ background: color-mix(in srgb, #ef4444 12%, ${stepBg});
805
+ border: 1px solid color-mix(in srgb, #ef4444 25%, ${stepBorder});
806
+ border-radius: 6px; color: #ef4444; font-size: 12px; line-height: 1.5;
807
+ animation: sai-in .18s ease;
808
+ }
809
+ `;
810
+ document.head.appendChild(style);
811
+ }
812
+
813
+ // ═══════════════════════════════════════════════════════════════════════════
814
+ // CHAT UI
815
+ // ═══════════════════════════════════════════════════════════════════════════
816
+
817
+ function buildChat(theme, positionCSS) {
818
+ var _config$suggestions, _config$theme, _config$theme2;
819
+ if (document.getElementById('sai-trigger')) return;
820
+ injectStyles(theme, positionCSS);
821
+ const trigger = document.createElement('button');
822
+ trigger.id = 'sai-trigger';
823
+ trigger.title = 'Need help?';
824
+ trigger.setAttribute('aria-label', 'Open help assistant');
825
+ trigger.innerHTML = '<span class="sai-pulse" aria-hidden="true"></span>✦';
826
+ document.body.appendChild(trigger);
827
+ const panel = document.createElement('div');
828
+ panel.id = 'sai-panel';
829
+ panel.setAttribute('role', 'dialog');
830
+ panel.setAttribute('aria-label', `${_config.assistantName || 'AI Guide'} chat`);
831
+ panel.innerHTML = `
832
+ <div id="sai-header">
833
+ <div id="sai-avatar" aria-hidden="true">✦</div>
834
+ <div id="sai-header-info">
835
+ <h4>${escHTML(_config.assistantName || 'AI Guide')}</h4>
836
+ <p>Ask me anything about ${escHTML(_config.appName)}</p>
837
+ </div>
838
+ <button id="sai-close" aria-label="Close help assistant">×</button>
839
+ </div>
840
+ <div id="sai-messages" role="log" aria-live="polite"></div>
841
+ <div id="sai-suggestions" aria-label="Suggested questions"></div>
842
+ <div id="sai-inputrow">
843
+ <input id="sai-input" type="text" placeholder="What do you need help with?"
844
+ autocomplete="off" aria-label="Ask a question"/>
845
+ <button id="sai-send" aria-label="Send message">➤</button>
846
+ </div>
847
+ `;
848
+ document.body.appendChild(panel);
849
+ if ((_config$suggestions = _config.suggestions) !== null && _config$suggestions !== void 0 && _config$suggestions.length) {
850
+ const container = panel.querySelector('#sai-suggestions');
851
+ _config.suggestions.forEach(s => {
852
+ const btn = document.createElement('button');
853
+ btn.className = 'sai-chip';
854
+ btn.textContent = s;
855
+ btn.addEventListener('click', () => handleSend(s));
856
+ container.appendChild(btn);
857
+ });
858
+ }
859
+ trigger.addEventListener('click', togglePanel);
860
+ panel.querySelector('#sai-close').addEventListener('click', togglePanel);
861
+ panel.querySelector('#sai-send').addEventListener('click', () => {
862
+ const v = panel.querySelector('#sai-input').value.trim();
863
+ if (v) handleSend(v);
864
+ });
865
+ panel.querySelector('#sai-input').addEventListener('keydown', e => {
866
+ if (e.key === 'Enter' && !e.shiftKey) {
867
+ e.preventDefault();
868
+ const v = e.target.value.trim();
869
+ if (v) handleSend(v);
870
+ }
871
+ });
872
+ addMsg('ai', `Hey! 👋 I can guide you through ${_config.appName}. What would you like to do?`);
873
+
874
+ // Auto theme switching
875
+ if (((_config$theme = _config.theme) === null || _config$theme === void 0 ? void 0 : _config$theme.mode) === 'auto' || !((_config$theme2 = _config.theme) !== null && _config$theme2 !== void 0 && _config$theme2.mode)) {
876
+ _mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
877
+ _mediaQuery.addEventListener('change', () => {
878
+ var _document$getElementB3;
879
+ const newTheme = resolveTheme(_config.theme);
880
+ applyTheme(newTheme);
881
+ (_document$getElementB3 = document.getElementById('sai-styles')) === null || _document$getElementB3 === void 0 || _document$getElementB3.remove();
882
+ injectStyles(newTheme, positionCSS);
883
+ });
884
+ }
885
+ }
886
+ function escHTML(str) {
887
+ return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
888
+ }
889
+ function togglePanel() {
890
+ var _document$getElementB4, _document$getElementB5, _document$getElementB6;
891
+ _isOpen = !_isOpen;
892
+ (_document$getElementB4 = document.getElementById('sai-panel')) === null || _document$getElementB4 === void 0 || _document$getElementB4.classList.toggle('sai-open', _isOpen);
893
+ (_document$getElementB5 = document.getElementById('sai-trigger')) === null || _document$getElementB5 === void 0 || _document$getElementB5.classList.toggle('sai-paused', !!_pausedSteps);
894
+ if (_isOpen) (_document$getElementB6 = document.getElementById('sai-input')) === null || _document$getElementB6 === void 0 || _document$getElementB6.focus();
895
+ }
896
+ function addMsg(type, text) {
897
+ const msgs = document.getElementById('sai-messages');
898
+ if (!msgs) return;
899
+ const div = document.createElement('div');
900
+ div.className = `sai-msg sai-${type}`;
901
+ div.textContent = text;
902
+ msgs.appendChild(div);
903
+ msgs.scrollTop = msgs.scrollHeight;
904
+ }
905
+ function showTyping() {
906
+ const msgs = document.getElementById('sai-messages');
907
+ const el = document.createElement('div');
908
+ el.className = 'sai-typing';
909
+ el.id = 'sai-typing';
910
+ el.innerHTML = '<span></span><span></span><span></span>';
911
+ msgs.appendChild(el);
912
+ msgs.scrollTop = msgs.scrollHeight;
913
+ }
914
+ function hideTyping() {
915
+ var _document$getElementB7;
916
+ (_document$getElementB7 = document.getElementById('sai-typing')) === null || _document$getElementB7 === void 0 || _document$getElementB7.remove();
917
+ }
918
+ function setDisabled(d) {
919
+ ['sai-input', 'sai-send'].forEach(id => {
920
+ const el = document.getElementById(id);
921
+ if (el) el.disabled = d;
922
+ });
923
+ }
924
+ async function handleSend(text) {
925
+ var _document$getElementB8, _document$getElementB9;
926
+ const input = document.getElementById('sai-input');
927
+ if (input) input.value = '';
928
+ document.getElementById('sai-suggestions').style.display = 'none';
929
+
930
+ // New message clears any existing pause state
931
+ _pausedSteps = null;
932
+ _pausedIndex = 0;
933
+ (_document$getElementB8 = document.getElementById('sai-resume-prompt')) === null || _document$getElementB8 === void 0 || _document$getElementB8.remove();
934
+ (_document$getElementB9 = document.getElementById('sai-trigger')) === null || _document$getElementB9 === void 0 || _document$getElementB9.classList.remove('sai-paused');
935
+ addMsg('user', text);
936
+ setDisabled(true);
937
+ showTyping();
938
+ try {
939
+ var _result$steps;
940
+ const result = await callAI(text);
941
+ hideTyping();
942
+ addMsg('ai', result.message);
943
+ if ((_result$steps = result.steps) !== null && _result$steps !== void 0 && _result$steps.length) {
944
+ setTimeout(() => {
945
+ togglePanel();
946
+ runTour(result.steps);
947
+ }, 600);
948
+ }
949
+ } catch (err) {
950
+ hideTyping();
951
+ addMsg('error', err.message || 'Something went wrong. Please try again.');
952
+ console.error('[Eventop]', err);
953
+ } finally {
954
+ var _document$getElementB0;
955
+ setDisabled(false);
956
+ (_document$getElementB0 = document.getElementById('sai-input')) === null || _document$getElementB0 === void 0 || _document$getElementB0.focus();
957
+ }
958
+ }
959
+
960
+ // ═══════════════════════════════════════════════════════════════════════════
961
+ // PUBLIC API
962
+ // ═══════════════════════════════════════════════════════════════════════════
963
+
964
+ const Eventop = {
965
+ providers,
966
+ init(opts = {}) {
967
+ var _opts$config, _opts$config2;
968
+ if (!opts.provider) throw new Error('[Eventop] provider is required');
969
+ if (!((_opts$config = opts.config) !== null && _opts$config !== void 0 && _opts$config.appName)) throw new Error('[Eventop] config.appName is required');
970
+ if (!((_opts$config2 = opts.config) !== null && _opts$config2 !== void 0 && _opts$config2.features)) throw new Error('[Eventop] config.features is required');
971
+ _provider = opts.provider;
972
+ _config = opts.config;
973
+ const theme = resolveTheme(_config.theme);
974
+ const posCSS = resolvePosition(_config.position);
975
+ if (document.readyState === 'loading') {
976
+ document.addEventListener('DOMContentLoaded', () => buildChat(theme, posCSS));
977
+ } else {
978
+ buildChat(theme, posCSS);
979
+ }
980
+ ensureShepherd();
981
+ },
982
+ open() {
983
+ if (!_isOpen) togglePanel();
984
+ },
985
+ close() {
986
+ if (_isOpen) togglePanel();
987
+ },
988
+ runTour,
989
+ cancelTour() {
990
+ var _document$getElementB1, _document$getElementB10;
991
+ _pausedSteps = null;
992
+ _pausedIndex = 0;
993
+ if (_tour) {
994
+ _tour.cancel();
995
+ }
996
+ _cleanups.forEach(fn => fn());
997
+ _cleanups = [];
998
+ _tour = null;
999
+ (_document$getElementB1 = document.getElementById('sai-trigger')) === null || _document$getElementB1 === void 0 || _document$getElementB1.classList.remove('sai-paused');
1000
+ (_document$getElementB10 = document.getElementById('sai-resume-prompt')) === null || _document$getElementB10 === void 0 || _document$getElementB10.remove();
1001
+ },
1002
+ resumeTour() {
1003
+ var _document$getElementB11, _document$getElementB12;
1004
+ if (!_pausedSteps) return;
1005
+ const steps = _pausedSteps;
1006
+ const idx = _pausedIndex;
1007
+ _pausedSteps = null;
1008
+ _pausedIndex = 0;
1009
+ (_document$getElementB11 = document.getElementById('sai-resume-prompt')) === null || _document$getElementB11 === void 0 || _document$getElementB11.remove();
1010
+ (_document$getElementB12 = document.getElementById('sai-trigger')) === null || _document$getElementB12 === void 0 || _document$getElementB12.classList.remove('sai-paused');
1011
+ if (_isOpen) togglePanel();
1012
+ runTour(steps.slice(idx));
1013
+ },
1014
+ isPaused() {
1015
+ return !!_pausedSteps;
1016
+ },
1017
+ isActive() {
1018
+ var _tour4;
1019
+ return !!((_tour4 = _tour) !== null && _tour4 !== void 0 && _tour4.isActive());
1020
+ },
1021
+ stepComplete,
1022
+ stepFail,
1023
+ /** @internal — used by the React package to sync the live feature registry */
1024
+ _updateConfig(partial) {
1025
+ if (!_config) return;
1026
+ _config = {
1027
+ ..._config,
1028
+ ...partial
1029
+ };
1030
+ }
1031
+ };
1032
+ return Eventop;
1033
+ });
1034
+ })(core$1);
1035
+ var coreExports = core$1.exports;
1036
+
1037
+ var core = /*#__PURE__*/_mergeNamespaces({
1038
+ __proto__: null
1039
+ }, [coreExports]);
1040
+
1041
+ export { core as c };