@flonix/ig-embed 0.0.0-stage → 0.1.1

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/index.js ADDED
@@ -0,0 +1,1331 @@
1
+ 'use strict';
2
+
3
+ // src/logo-data.ts
4
+ var FLONIX_LOGO_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHsAAAB6CAYAAACfmyzaAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfpBxMQLTr3E+SmAAAAAW9yTlQBz6J3mgAAKFdJREFUeNrtfXmcVNWV/7nLW2rtZl8Eu8EtGqMScMUFUJNg0BhNRw1BNEHE/IIJGX8TzcykZeb3y8RMomZEjWJcxjFR2sQo7isoi46iEgVFFkFcIg291PK2u5z549UrupvurgK6uxrC9/N5n6KLqnr33vPuuWc/AAdwAAdwAAdwAAewL4BUegCVwqRJk5Lz/+Vfvuy7wcGDBg+IDxo8NNW4o1FnM5m8aZr5XMZdP2funL9u3rzZq/RYD2APUV9fT+f//OeTN65bd79w/e2oMQgc1/ddz9eBcFGjkIHwfdfb/Ogjj/x69uzZVZUe8wHsAa6/5pqh69asuU747sdS+MpzXO05LnqOi64bvnqeF10atXRamna8+swTT0yr9NgPYDdQX1/PP1y//joUgaNkgK0tTdiW0NHleR66fnjlsq0oAk8hqk2LF//55ErP4QDKxCOLFp2ASm7xclkd+C5K4Zcktgg8lMLHbKZF5XKti+9bsGBQpeexN6CVHkBfoK6ujk2aMnmu8P2RnHNCKQXP2yl3EUKKV/E9BJBKgRACkskkicfiU8addNJp8Hcs1O4LIBvWrr1UeV6jCMLdms20oFYCfddD3/XantPtriDw0C9wgeam7SgDf/OCBQv2WXa+3+/s+ro6I5FKHo+AVUEQAGMM4vE4uK5b8rvR7vd9H9LpNFBGR37zm984b/z48Ual57Un2O+JfdqV3z+xeuDASxUg55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DE2OjQ1OjE4KzAwOjAwsvSvzAAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNS0wNy0xOVQxNjo0NTo1OCswMDowMGGrgOkAAAAASUVORK5CYII=";
5
+
6
+ // src/branding.ts
7
+ function escapeHtml(value) {
8
+ return value.replace(
9
+ /[&<>"']/g,
10
+ (c) => c === "&" ? "&amp;" : c === "<" ? "&lt;" : c === ">" ? "&gt;" : c === '"' ? "&quot;" : "&#39;"
11
+ );
12
+ }
13
+ var WORDMARK_FONT = "Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif";
14
+ function flonixLogo(size = 20) {
15
+ return `<span class="flxig-brand" style="--flxig-logo-size:${size}px" role="img" aria-label="Flonix">
16
+ <span class="flxig-brand__chip">
17
+ <img class="flxig-brand__img" src="${FLONIX_LOGO_PNG}" alt="" draggable="false" />
18
+ </span>
19
+ <svg class="flxig-brand__wordmark" viewBox="0 0 55 22" fill="currentColor" aria-hidden="true">
20
+ <text x="0" y="19" font-size="22" font-weight="700" letter-spacing="-0.4" font-family="${WORDMARK_FONT}" textLength="55" lengthAdjust="spacingAndGlyphs">flonix</text>
21
+ </svg>
22
+ </span>`;
23
+ }
24
+ function cobrandLockup(partner) {
25
+ const name = escapeHtml(partner.name);
26
+ const light = escapeHtml(partner.logo);
27
+ const dark = partner.logoDark ? escapeHtml(partner.logoDark) : "";
28
+ const partnerImgs = dark ? `<img class="flxig-partner__img flxig-partner__img--light" src="${light}" alt="${name}" draggable="false" />
29
+ <img class="flxig-partner__img flxig-partner__img--dark" src="${dark}" alt="${name}" draggable="false" />` : `<img class="flxig-partner__img" src="${light}" alt="${name}" draggable="false" />`;
30
+ return `<span class="flxig-cobrand">
31
+ <span class="flxig-partner" data-has-dark="${dark ? "true" : "false"}">${partnerImgs}</span>
32
+ <span class="flxig-cobrand__x">\xD7</span>
33
+ ${flonixLogo(18)}
34
+ </span>`;
35
+ }
36
+ var icons = {
37
+ instagram: (size = 18) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
38
+ <rect x="2" y="2" width="20" height="20" rx="5" ry="5"/>
39
+ <path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"/>
40
+ <line x1="17.5" y1="6.5" x2="17.51" y2="6.5"/>
41
+ </svg>`,
42
+ comment: (size = 18) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
43
+ <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>
44
+ </svg>`,
45
+ dm: (size = 18) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
46
+ <line x1="22" y1="2" x2="11" y2="13"/>
47
+ <polygon points="22 2 15 22 11 13 2 9 22 2"/>
48
+ </svg>`,
49
+ check: (size = 16) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
50
+ <polyline points="20 6 9 17 4 12"/>
51
+ </svg>`,
52
+ close: (size = 18) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
53
+ <line x1="18" y1="6" x2="6" y2="18"/>
54
+ <line x1="6" y1="6" x2="18" y2="18"/>
55
+ </svg>`,
56
+ plus: (size = 16) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
57
+ <line x1="12" y1="5" x2="12" y2="19"/>
58
+ <line x1="5" y1="12" x2="19" y2="12"/>
59
+ </svg>`,
60
+ link: (size = 15) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
61
+ <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/>
62
+ <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>
63
+ </svg>`,
64
+ bolt: (size = 16) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
65
+ <path d="M13 2 4.5 13.5H11L10 22l8.5-11.5H12L13 2Z"/>
66
+ </svg>`,
67
+ spinner: (size = 18) => `<svg class="flxig-spin" width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true">
68
+ <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
69
+ </svg>`,
70
+ video: (size = 14) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
71
+ <path d="M8 5v14l11-7L8 5Z"/>
72
+ </svg>`,
73
+ layers: (size = 14) => `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
74
+ <polygon points="12 2 2 7 12 12 22 7 12 2"/>
75
+ <polyline points="2 17 12 22 22 17"/>
76
+ <polyline points="2 12 12 17 22 12"/>
77
+ </svg>`
78
+ };
79
+
80
+ // src/client.ts
81
+ function authHeaders(token) {
82
+ return {
83
+ "Content-Type": "application/json",
84
+ Authorization: `Bearer ${token}`
85
+ };
86
+ }
87
+ function createHttpTransport(baseUrl) {
88
+ const base = baseUrl.replace(/\/+$/, "");
89
+ async function call(path, init) {
90
+ let res;
91
+ try {
92
+ res = await fetch(`${base}${path}`, init);
93
+ } catch {
94
+ throw new Error("Network error \u2014 please try again.");
95
+ }
96
+ const json = await res.json().catch(() => null);
97
+ if (!res.ok) {
98
+ throw new Error((json == null ? void 0 : json.error) || `Request failed (${res.status})`);
99
+ }
100
+ return json;
101
+ }
102
+ return {
103
+ session: ({ apiKey, user }) => call("/api/embed/session", {
104
+ method: "POST",
105
+ headers: authHeaders(apiKey),
106
+ body: JSON.stringify({ user })
107
+ }),
108
+ connectStart: ({ token, returnUrl }) => call("/api/embed/connect/start", {
109
+ method: "POST",
110
+ headers: authHeaders(token),
111
+ body: JSON.stringify({ returnUrl })
112
+ }),
113
+ posts: ({ token, cursor }) => call(
114
+ `/api/embed/posts${cursor ? `?cursor=${encodeURIComponent(cursor)}` : ""}`,
115
+ { method: "GET", headers: authHeaders(token) }
116
+ ),
117
+ createAutomation: ({ token, data }) => call("/api/embed/automations", {
118
+ method: "POST",
119
+ headers: authHeaders(token),
120
+ body: JSON.stringify(data)
121
+ })
122
+ };
123
+ }
124
+
125
+ // src/dom.ts
126
+ function el(tag, attrs = {}, ...children) {
127
+ const node = document.createElement(tag);
128
+ if (attrs.class) node.className = attrs.class;
129
+ if (attrs.text != null) node.textContent = attrs.text;
130
+ if (attrs.html != null) node.innerHTML = attrs.html;
131
+ if (attrs.style) node.setAttribute("style", attrs.style);
132
+ if (attrs.dataset) {
133
+ for (const [key, value] of Object.entries(attrs.dataset)) {
134
+ node.dataset[key] = value;
135
+ }
136
+ }
137
+ if (attrs.attrs) {
138
+ for (const [key, value] of Object.entries(attrs.attrs)) {
139
+ if (value == null || value === false) continue;
140
+ node.setAttribute(key, value === true ? "" : String(value));
141
+ }
142
+ }
143
+ if (attrs.on) {
144
+ for (const [event, handler] of Object.entries(attrs.on)) {
145
+ node.addEventListener(event, handler);
146
+ }
147
+ }
148
+ append(node, children);
149
+ return node;
150
+ }
151
+ function append(parent, children) {
152
+ for (const child of children) {
153
+ if (child == null || child === false) continue;
154
+ parent.appendChild(
155
+ child instanceof Node ? child : document.createTextNode(String(child))
156
+ );
157
+ }
158
+ }
159
+ function clear(node) {
160
+ while (node.firstChild) node.removeChild(node.firstChild);
161
+ }
162
+ function fromMarkup(markup) {
163
+ var _a;
164
+ const wrapper = document.createElement("div");
165
+ wrapper.innerHTML = markup.trim();
166
+ return (_a = wrapper.firstElementChild) != null ? _a : wrapper;
167
+ }
168
+
169
+ // src/components.ts
170
+ function button(opts) {
171
+ var _a;
172
+ const classes = [
173
+ "flxig-btn",
174
+ `flxig-btn--${(_a = opts.variant) != null ? _a : "primary"}`,
175
+ opts.block ? "flxig-btn--block" : "",
176
+ opts.large ? "flxig-btn--lg" : ""
177
+ ].filter(Boolean).join(" ");
178
+ const btn = el("button", {
179
+ class: classes,
180
+ attrs: { type: "button", disabled: opts.disabled },
181
+ on: opts.onClick ? { click: opts.onClick } : void 0
182
+ });
183
+ if (opts.icon) btn.appendChild(fromMarkup(opts.icon));
184
+ append(btn, [el("span", { text: opts.label })]);
185
+ return btn;
186
+ }
187
+ function field(label, control, hint) {
188
+ return el(
189
+ "div",
190
+ { class: "flxig-field" },
191
+ el("span", { class: "flxig-label", text: label }),
192
+ control,
193
+ hint ? el("span", { class: "flxig-hint", text: hint }) : null
194
+ );
195
+ }
196
+ function textInput(opts) {
197
+ var _a, _b;
198
+ return el("input", {
199
+ class: "flxig-input",
200
+ attrs: { type: "text", value: (_a = opts.value) != null ? _a : "", placeholder: (_b = opts.placeholder) != null ? _b : "" }
201
+ });
202
+ }
203
+ function textArea(opts) {
204
+ var _a, _b, _c;
205
+ const ta = el("textarea", {
206
+ class: "flxig-textarea",
207
+ attrs: { placeholder: (_a = opts.placeholder) != null ? _a : "", rows: (_b = opts.rows) != null ? _b : 3 }
208
+ });
209
+ ta.value = (_c = opts.value) != null ? _c : "";
210
+ return ta;
211
+ }
212
+ function switchToggle(opts) {
213
+ const input = el("input", { attrs: { type: "checkbox" } });
214
+ input.checked = opts.checked;
215
+ if (opts.onChange) {
216
+ input.addEventListener("change", () => opts.onChange(input.checked));
217
+ }
218
+ const element = el(
219
+ "span",
220
+ { class: "flxig-switch" },
221
+ input,
222
+ el("span", { class: "flxig-switch__track" }),
223
+ el("span", { class: "flxig-switch__thumb" })
224
+ );
225
+ return { element, input };
226
+ }
227
+ function chipsInput(opts) {
228
+ var _a;
229
+ let values = [...opts.values];
230
+ const list = el("span", { class: "flxig-chips" });
231
+ const input = el("input", {
232
+ attrs: { type: "text", placeholder: (_a = opts.placeholder) != null ? _a : "Add keyword\u2026" }
233
+ });
234
+ const render = () => {
235
+ while (list.firstChild && list.firstChild !== input) {
236
+ list.removeChild(list.firstChild);
237
+ }
238
+ const chips = values.map(
239
+ (value, index) => el(
240
+ "span",
241
+ { class: "flxig-chip" },
242
+ el("span", { text: value }),
243
+ el("button", {
244
+ attrs: { type: "button", "aria-label": `Remove ${value}` },
245
+ html: icons.close(12),
246
+ on: {
247
+ click: () => {
248
+ values.splice(index, 1);
249
+ render();
250
+ }
251
+ }
252
+ })
253
+ )
254
+ );
255
+ list.prepend(...chips);
256
+ };
257
+ const commit = () => {
258
+ const raw = input.value.trim().replace(/,$/, "").trim();
259
+ if (raw && !values.includes(raw)) {
260
+ values.push(raw);
261
+ render();
262
+ }
263
+ input.value = "";
264
+ };
265
+ input.addEventListener("keydown", (ev) => {
266
+ if (ev.key === "Enter" || ev.key === ",") {
267
+ ev.preventDefault();
268
+ commit();
269
+ } else if (ev.key === "Backspace" && !input.value && values.length) {
270
+ values.pop();
271
+ render();
272
+ }
273
+ });
274
+ input.addEventListener("blur", commit);
275
+ list.appendChild(input);
276
+ render();
277
+ return { element: list, getValues: () => [...values] };
278
+ }
279
+ function linkButtonsEditor(opts) {
280
+ const rows = el("div", { class: "flxig-links" });
281
+ const addBtn = button({
282
+ label: "Add link",
283
+ variant: "ghost",
284
+ icon: icons.plus(15),
285
+ onClick: () => {
286
+ if (rows.querySelectorAll(".flxig-link").length >= opts.max) return;
287
+ addRow({ label: "", url: "" });
288
+ syncAdd();
289
+ }
290
+ });
291
+ addBtn.classList.add("flxig-links__add");
292
+ function syncAdd() {
293
+ addBtn.disabled = rows.querySelectorAll(".flxig-link").length >= opts.max;
294
+ }
295
+ function addRow(value) {
296
+ const label = textInput({ value: value.label, placeholder: "Button label" });
297
+ label.classList.add("flxig-link__label");
298
+ const url = el("input", {
299
+ class: "flxig-input flxig-link__url",
300
+ attrs: { type: "url", value: value.url, placeholder: "https://\u2026", inputmode: "url" }
301
+ });
302
+ const row = el(
303
+ "div",
304
+ { class: "flxig-link" },
305
+ fromMarkup(`<span class="flxig-link__ic">${icons.link(15)}</span>`),
306
+ el("div", { class: "flxig-link__inputs" }, label, url),
307
+ el("button", {
308
+ class: "flxig-iconbtn",
309
+ attrs: { type: "button", "aria-label": "Remove link" },
310
+ html: icons.close(16),
311
+ on: {
312
+ click: () => {
313
+ row.remove();
314
+ syncAdd();
315
+ }
316
+ }
317
+ })
318
+ );
319
+ rows.appendChild(row);
320
+ }
321
+ const seed = opts.values.length ? opts.values : [{ label: "", url: "" }];
322
+ seed.slice(0, opts.max).forEach(addRow);
323
+ syncAdd();
324
+ const element = el("div", { class: "flxig-links__wrap" }, rows, addBtn);
325
+ return {
326
+ element,
327
+ getValues: () => [...rows.querySelectorAll(".flxig-link")].map((row) => ({
328
+ label: row.querySelector(".flxig-link__label").value.trim(),
329
+ url: row.querySelector(".flxig-link__url").value.trim()
330
+ })).filter((b) => b.label || b.url)
331
+ };
332
+ }
333
+ function stateBlock(opts) {
334
+ var _a;
335
+ return el(
336
+ "div",
337
+ { class: "flxig-state" },
338
+ opts.icon ? fromMarkup(opts.icon) : null,
339
+ el("p", { class: "flxig-h2", text: opts.title }),
340
+ opts.detail ? el("p", { class: "flxig-muted", text: opts.detail }) : null,
341
+ (_a = opts.action) != null ? _a : null
342
+ );
343
+ }
344
+
345
+ // src/screens/connect.ts
346
+ function renderConnect(opts) {
347
+ const cta = button({
348
+ label: opts.connecting ? "Redirecting\u2026" : "Connect Instagram",
349
+ variant: "primary",
350
+ large: true,
351
+ block: true,
352
+ disabled: opts.connecting,
353
+ icon: opts.connecting ? icons.spinner() : icons.instagram(),
354
+ onClick: opts.onConnect
355
+ });
356
+ return el(
357
+ "div",
358
+ { class: "flxig-connect" },
359
+ el(
360
+ "div",
361
+ { class: "flxig-connect__copy" },
362
+ el("h1", { class: "flxig-h1", text: "Connect your Instagram with Flonix" }),
363
+ el("p", {
364
+ class: "flxig-muted",
365
+ text: "Link your Instagram account to set up comment and DM automations on your posts \u2014 directly from here."
366
+ })
367
+ ),
368
+ el("div", { class: "flxig-connect__cta" }, cta),
369
+ fromMarkup(`<div class="flxig-connect__foot">${cobrandLockup(opts.partner)}</div>`)
370
+ );
371
+ }
372
+
373
+ // src/screens/posts.ts
374
+ var TYPE_META = {
375
+ IMAGE: { label: "Image", icon: icons.instagram(12) },
376
+ VIDEO: { label: "Video", icon: icons.video() },
377
+ REELS: { label: "Reel", icon: icons.video() },
378
+ CAROUSEL: { label: "Album", icon: icons.layers() }
379
+ };
380
+ function postTile(post, onAutomate) {
381
+ var _a, _b, _c;
382
+ const meta = (_a = TYPE_META[post.mediaType]) != null ? _a : TYPE_META.IMAGE;
383
+ const media = el("div", { class: "flxig-tile__media" });
384
+ if (post.media) {
385
+ append(media, [
386
+ el("img", {
387
+ attrs: { src: post.media, alt: (_b = post.caption) != null ? _b : "Instagram post", loading: "lazy" }
388
+ })
389
+ ]);
390
+ } else {
391
+ append(media, [fromMarkup(`<div class="flxig-tile__ph">${icons.instagram(28)}</div>`)]);
392
+ }
393
+ append(media, [
394
+ fromMarkup(
395
+ `<span class="flxig-tile__type">${meta.icon}<span>${meta.label}</span></span>`
396
+ )
397
+ ]);
398
+ return el(
399
+ "div",
400
+ { class: "flxig-tile" },
401
+ media,
402
+ el(
403
+ "div",
404
+ { class: "flxig-tile__body" },
405
+ el("p", {
406
+ class: "flxig-tile__cap",
407
+ text: ((_c = post.caption) == null ? void 0 : _c.trim()) || "No caption"
408
+ }),
409
+ button({
410
+ label: "Automate",
411
+ variant: "secondary",
412
+ block: true,
413
+ icon: icons.bolt(),
414
+ onClick: () => onAutomate(post)
415
+ })
416
+ )
417
+ );
418
+ }
419
+ function renderPosts(opts) {
420
+ var _a;
421
+ const username = (_a = opts.account) == null ? void 0 : _a.username;
422
+ const grid = el("div", { class: "flxig-grid" });
423
+ const sentinel = el("div", { class: "flxig-sentinel" });
424
+ const loadMore = el("div", { class: "flxig-loadmore" });
425
+ const header = el(
426
+ "div",
427
+ { class: "flxig-header" },
428
+ el(
429
+ "div",
430
+ { class: "flxig-header__id" },
431
+ fromMarkup(`<span class="flxig-avatar">${icons.instagram(18)}</span>`),
432
+ el(
433
+ "div",
434
+ {},
435
+ el("div", { class: "flxig-h2", text: username ? `@${username}` : "Instagram" }),
436
+ el("div", { class: "flxig-muted", text: "Pick a post to automate" })
437
+ )
438
+ ),
439
+ fromMarkup(
440
+ `<span class="flxig-badge">${icons.check(13)}<span>Connected</span></span>`
441
+ )
442
+ );
443
+ const attribution = fromMarkup(
444
+ `<div class="flxig-attrib"><span>Automations by</span>${flonixLogo(15)}</div>`
445
+ );
446
+ const root = el(
447
+ "div",
448
+ {},
449
+ header,
450
+ grid,
451
+ loadMore,
452
+ sentinel,
453
+ attribution
454
+ );
455
+ let hasMore = true;
456
+ let loading = false;
457
+ let empty = false;
458
+ const observer = typeof IntersectionObserver !== "undefined" ? new IntersectionObserver(
459
+ (entries) => {
460
+ if (entries.some((e) => e.isIntersecting) && hasMore && !loading && !empty) {
461
+ opts.onLoadMore();
462
+ }
463
+ },
464
+ { rootMargin: "240px" }
465
+ ) : null;
466
+ observer == null ? void 0 : observer.observe(sentinel);
467
+ const renderLoadMore = () => {
468
+ clear(loadMore);
469
+ if (loading) {
470
+ append(loadMore, [fromMarkup(icons.spinner(20))]);
471
+ } else if (hasMore && !observer) {
472
+ append(loadMore, [
473
+ button({ label: "Load more", variant: "ghost", onClick: opts.onLoadMore })
474
+ ]);
475
+ }
476
+ };
477
+ return {
478
+ element: root,
479
+ appendPosts(posts) {
480
+ empty = false;
481
+ append(
482
+ grid,
483
+ posts.map((post) => postTile(post, opts.onAutomate))
484
+ );
485
+ },
486
+ setLoadingMore(value) {
487
+ loading = value;
488
+ renderLoadMore();
489
+ },
490
+ setHasMore(value) {
491
+ hasMore = value;
492
+ renderLoadMore();
493
+ if (!value) observer == null ? void 0 : observer.disconnect();
494
+ },
495
+ showEmpty() {
496
+ empty = true;
497
+ hasMore = false;
498
+ observer == null ? void 0 : observer.disconnect();
499
+ clear(grid);
500
+ grid.replaceWith(
501
+ stateBlock({
502
+ icon: icons.instagram(30),
503
+ title: "No posts yet",
504
+ detail: "Publish a post on Instagram, then come back to automate it."
505
+ })
506
+ );
507
+ },
508
+ destroy() {
509
+ observer == null ? void 0 : observer.disconnect();
510
+ }
511
+ };
512
+ }
513
+
514
+ // src/prefill.ts
515
+ function profileUrl(account) {
516
+ if (account == null ? void 0 : account.username) return `https://instagram.com/${account.username}`;
517
+ return "https://instagram.com/";
518
+ }
519
+ function buildPrefill(post, account, type) {
520
+ const handle = (account == null ? void 0 : account.username) ? `@${account.username}` : "us";
521
+ const common = {
522
+ postId: post.id,
523
+ type,
524
+ entryButtonLabel: "Send me the link",
525
+ deliveryMessage: "Thanks for reaching out! \u{1F64C} Here's the link you asked for \u{1F447}",
526
+ // One link button prefilled; the merchant fills in their own URL.
527
+ linkButtons: [{ label: "Shop now", url: "" }],
528
+ // Follow-gate is ON and prefilled by default, per product spec.
529
+ followGate: {
530
+ enabled: true,
531
+ followProfileUrl: profileUrl(account),
532
+ followButtonLabel: `Follow ${handle}`,
533
+ followConfirmButtonLabel: "I'm following \u2705",
534
+ followUpMessage: "Awesome \u2014 thanks for following! \u{1F499} Here's your link \u{1F447}"
535
+ }
536
+ };
537
+ if (type === "COMMENT") {
538
+ return {
539
+ ...common,
540
+ name: "Comment \u2192 DM automation",
541
+ keywords: ["link", "price", "info"],
542
+ commentReply: "Just sent you a DM! \u{1F4E9}"
543
+ };
544
+ }
545
+ return {
546
+ ...common,
547
+ name: "DM keyword automation",
548
+ keywords: ["link", "info"],
549
+ commentReply: null
550
+ };
551
+ }
552
+
553
+ // src/types.ts
554
+ var MAX_LINK_BUTTONS = 3;
555
+
556
+ // src/screens/automate-dialog.ts
557
+ var TYPE_OPTIONS = [
558
+ {
559
+ type: "COMMENT",
560
+ title: "Comment automation",
561
+ detail: "Reply + DM when someone comments a keyword",
562
+ icon: icons.comment(20)
563
+ },
564
+ {
565
+ type: "DM",
566
+ title: "DM automation",
567
+ detail: "Auto-reply when someone DMs a keyword",
568
+ icon: icons.dm(20)
569
+ }
570
+ ];
571
+ function openAutomateDialog(opts) {
572
+ var _a;
573
+ let type = "COMMENT";
574
+ let draft = buildPrefill(opts.post, opts.account, type);
575
+ let submitting = false;
576
+ const body = el("div", { class: "flxig-dialog__body" });
577
+ const overlay = el("div", { class: "flxig-overlay" });
578
+ const close = () => {
579
+ document.removeEventListener("keydown", onKey);
580
+ overlay.remove();
581
+ };
582
+ const onKey = (ev) => {
583
+ if (ev.key === "Escape" && !submitting) close();
584
+ };
585
+ document.addEventListener("keydown", onKey);
586
+ overlay.addEventListener("click", (ev) => {
587
+ if (ev.target === overlay && !submitting) close();
588
+ });
589
+ const picker = el("div", { class: "flxig-seg" });
590
+ const renderPicker = () => {
591
+ picker.replaceChildren(
592
+ ...TYPE_OPTIONS.map(
593
+ (opt) => el(
594
+ "div",
595
+ {
596
+ class: "flxig-seg__opt",
597
+ dataset: { active: String(opt.type === type) },
598
+ attrs: { role: "button", tabindex: "0" },
599
+ on: {
600
+ click: () => {
601
+ if (opt.type === type) return;
602
+ type = opt.type;
603
+ draft = buildPrefill(opts.post, opts.account, type);
604
+ renderPicker();
605
+ renderForm();
606
+ }
607
+ }
608
+ },
609
+ fromMarkup(`<span class="flxig-seg__ic">${opt.icon}</span>`),
610
+ el(
611
+ "div",
612
+ {},
613
+ el("div", { class: "flxig-seg__t", text: opt.title }),
614
+ el("div", { class: "flxig-seg__d", text: opt.detail })
615
+ )
616
+ )
617
+ )
618
+ );
619
+ };
620
+ let readForm = () => draft;
621
+ const renderForm = () => {
622
+ var _a2;
623
+ const keywords = chipsInput({
624
+ values: draft.keywords,
625
+ placeholder: "Add keyword\u2026"
626
+ });
627
+ const commentReply = textInput({ value: (_a2 = draft.commentReply) != null ? _a2 : "" });
628
+ const deliveryMessage = textArea({ value: draft.deliveryMessage, rows: 3 });
629
+ const entryButtonLabel = textInput({ value: draft.entryButtonLabel });
630
+ const links = linkButtonsEditor({
631
+ values: draft.linkButtons,
632
+ max: MAX_LINK_BUTTONS
633
+ });
634
+ const followUpMessage = textArea({ value: draft.followGate.followUpMessage, rows: 2 });
635
+ const followButtonLabel = textInput({ value: draft.followGate.followButtonLabel });
636
+ const followProfileUrl = textInput({ value: draft.followGate.followProfileUrl });
637
+ const followConfirmLabel = textInput({ value: draft.followGate.followConfirmButtonLabel });
638
+ const gateFields = el(
639
+ "div",
640
+ { class: "flxig-gate__fields", dataset: { off: String(!draft.followGate.enabled) } },
641
+ field("Follow profile URL", followProfileUrl),
642
+ field("Follow button label", followButtonLabel),
643
+ field("Confirm button label", followConfirmLabel),
644
+ field("Message after they follow", followUpMessage)
645
+ );
646
+ const gateSwitch = switchToggle({
647
+ checked: draft.followGate.enabled,
648
+ onChange: (checked) => {
649
+ gateFields.dataset.off = String(!checked);
650
+ }
651
+ });
652
+ const gate = el(
653
+ "div",
654
+ { class: "flxig-gate" },
655
+ el(
656
+ "div",
657
+ { class: "flxig-gate__top" },
658
+ el(
659
+ "div",
660
+ {},
661
+ el("div", { class: "flxig-label", text: "Follow gate" }),
662
+ el("div", {
663
+ class: "flxig-hint",
664
+ text: "Require users to follow before they get the link."
665
+ })
666
+ ),
667
+ gateSwitch.element
668
+ ),
669
+ gateFields
670
+ );
671
+ const fields = [
672
+ field(
673
+ type === "COMMENT" ? "Trigger keywords (in comments)" : "Trigger keywords (in DMs)",
674
+ keywords.element,
675
+ "Press Enter or comma to add. The automation fires on these words."
676
+ )
677
+ ];
678
+ if (type === "COMMENT") {
679
+ fields.push(field("Public comment reply", commentReply, "Posted under the comment."));
680
+ }
681
+ fields.push(
682
+ field("DM message", deliveryMessage, "The direct message delivered to the user."),
683
+ field(
684
+ "Link buttons",
685
+ links.element,
686
+ `Where they enter the link(s). Up to ${MAX_LINK_BUTTONS} \u2014 each has a label and a URL.`
687
+ ),
688
+ field("Opt-in button label", entryButtonLabel, "Button users tap in the first DM."),
689
+ gate
690
+ );
691
+ body.replaceChildren(...fields);
692
+ readForm = () => ({
693
+ postId: opts.post.id,
694
+ type,
695
+ name: draft.name,
696
+ keywords: keywords.getValues(),
697
+ commentReply: type === "COMMENT" ? commentReply.value.trim() || null : null,
698
+ entryButtonLabel: entryButtonLabel.value.trim(),
699
+ deliveryMessage: deliveryMessage.value.trim(),
700
+ linkButtons: links.getValues(),
701
+ followGate: {
702
+ enabled: gateSwitch.input.checked,
703
+ followProfileUrl: followProfileUrl.value.trim(),
704
+ followButtonLabel: followButtonLabel.value.trim(),
705
+ followConfirmButtonLabel: followConfirmLabel.value.trim(),
706
+ followUpMessage: followUpMessage.value.trim()
707
+ }
708
+ });
709
+ body.prepend(
710
+ el("div", { class: "flxig-field" }, el("span", { class: "flxig-label", text: "Automation type" }), picker)
711
+ );
712
+ };
713
+ const saveBtn = button({
714
+ label: "Create automation",
715
+ variant: "primary",
716
+ icon: icons.bolt(),
717
+ onClick: async () => {
718
+ if (submitting) return;
719
+ const data = readForm();
720
+ if (!data.keywords.length) {
721
+ opts.onToast("Add at least one keyword");
722
+ return;
723
+ }
724
+ if (!data.deliveryMessage) {
725
+ opts.onToast("Add a DM message");
726
+ return;
727
+ }
728
+ submitting = true;
729
+ saveBtn.disabled = true;
730
+ saveBtn.replaceChildren(fromMarkup(icons.spinner()), el("span", { text: "Creating\u2026" }));
731
+ try {
732
+ await opts.onSubmit(data);
733
+ close();
734
+ } catch (error) {
735
+ opts.onToast(error instanceof Error ? error.message : "Something went wrong");
736
+ submitting = false;
737
+ saveBtn.disabled = false;
738
+ saveBtn.replaceChildren(fromMarkup(icons.bolt()), el("span", { text: "Create automation" }));
739
+ }
740
+ }
741
+ });
742
+ const dialog = el(
743
+ "div",
744
+ { class: "flxig-dialog", attrs: { role: "dialog", "aria-modal": "true" } },
745
+ el(
746
+ "div",
747
+ { class: "flxig-dialog__head" },
748
+ el(
749
+ "div",
750
+ {},
751
+ el("div", { class: "flxig-h2", text: "Automate this post" }),
752
+ el("div", {
753
+ class: "flxig-muted",
754
+ text: ((_a = opts.post.caption) == null ? void 0 : _a.trim()) ? truncate(opts.post.caption.trim(), 70) : "Set up comment & DM replies"
755
+ })
756
+ ),
757
+ el("button", {
758
+ class: "flxig-iconbtn",
759
+ attrs: { type: "button", "aria-label": "Close" },
760
+ html: icons.close(),
761
+ on: { click: () => !submitting && close() }
762
+ })
763
+ ),
764
+ body,
765
+ el(
766
+ "div",
767
+ { class: "flxig-dialog__foot" },
768
+ button({ label: "Cancel", variant: "ghost", onClick: () => !submitting && close() }),
769
+ saveBtn
770
+ )
771
+ );
772
+ renderPicker();
773
+ renderForm();
774
+ append(overlay, [dialog]);
775
+ opts.mount.appendChild(overlay);
776
+ return { close };
777
+ }
778
+ function truncate(value, max) {
779
+ return value.length > max ? `${value.slice(0, max - 1)}\u2026` : value;
780
+ }
781
+
782
+ // src/theme.ts
783
+ var DEFAULT_FONT_FAMILY = '"Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
784
+ var DEFAULT_RADIUS = "12px";
785
+ var DEFAULT_TOKENS = {
786
+ light: {
787
+ background: "#ffffff",
788
+ foreground: "#0a0a0b",
789
+ card: "#ffffff",
790
+ cardForeground: "#0a0a0b",
791
+ popover: "#ffffff",
792
+ popoverForeground: "#0a0a0b",
793
+ primary: "#2563eb",
794
+ primaryForeground: "#ffffff",
795
+ secondary: "#f4f4f5",
796
+ secondaryForeground: "#18181b",
797
+ muted: "#f4f4f5",
798
+ mutedForeground: "#71717a",
799
+ accent: "#eef2ff",
800
+ accentForeground: "#1e3a8a",
801
+ destructive: "#ef4444",
802
+ destructiveForeground: "#ffffff",
803
+ border: "#e4e4e7",
804
+ input: "#e4e4e7",
805
+ ring: "#2563eb"
806
+ },
807
+ dark: {
808
+ background: "#0a0a0b",
809
+ foreground: "#fafafa",
810
+ card: "#131316",
811
+ cardForeground: "#fafafa",
812
+ popover: "#131316",
813
+ popoverForeground: "#fafafa",
814
+ primary: "#3b82f6",
815
+ primaryForeground: "#ffffff",
816
+ secondary: "#27272a",
817
+ secondaryForeground: "#fafafa",
818
+ muted: "#1b1b1f",
819
+ mutedForeground: "#a1a1aa",
820
+ accent: "#1e293b",
821
+ accentForeground: "#bfdbfe",
822
+ destructive: "#f87171",
823
+ destructiveForeground: "#0a0a0b",
824
+ border: "#27272a",
825
+ input: "#2a2a2e",
826
+ ring: "#3b82f6"
827
+ }
828
+ };
829
+ function resolveTheme(config = {}) {
830
+ var _a, _b, _c, _d, _e, _f, _g;
831
+ return {
832
+ mode: (_a = config.mode) != null ? _a : "auto",
833
+ fontFamily: (_b = config.fontFamily) != null ? _b : DEFAULT_FONT_FAMILY,
834
+ radius: (_c = config.radius) != null ? _c : DEFAULT_RADIUS,
835
+ light: { ...DEFAULT_TOKENS.light, ...(_e = (_d = config.tokens) == null ? void 0 : _d.light) != null ? _e : {} },
836
+ dark: { ...DEFAULT_TOKENS.dark, ...(_g = (_f = config.tokens) == null ? void 0 : _f.dark) != null ? _g : {} }
837
+ };
838
+ }
839
+ var camelToKebab = (key) => key.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
840
+ function tokensToVars(tokens) {
841
+ return Object.keys(tokens).map((key) => ` --flxig-${camelToKebab(key)}: ${tokens[key]};`).join("\n");
842
+ }
843
+ function buildThemeVars(theme) {
844
+ return `:host {
845
+ ${tokensToVars(theme.light)}
846
+ --flxig-radius: ${theme.radius};
847
+ --flxig-font: ${theme.fontFamily};
848
+ }
849
+ :host(.flxig-dark) {
850
+ ${tokensToVars(theme.dark)}
851
+ }`;
852
+ }
853
+ function isDarkActive(mode) {
854
+ if (mode === "dark") return true;
855
+ if (mode === "light") return false;
856
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
857
+ }
858
+
859
+ // src/styles.ts
860
+ var STYLES = `
861
+ *, *::before, *::after { box-sizing: border-box; }
862
+
863
+ .flxig-root {
864
+ font-family: var(--flxig-font);
865
+ color: var(--flxig-foreground);
866
+ background: var(--flxig-background);
867
+ border: 1px solid var(--flxig-border);
868
+ border-radius: var(--flxig-radius);
869
+ padding: clamp(20px, 4vw, 36px);
870
+ line-height: 1.5;
871
+ -webkit-font-smoothing: antialiased;
872
+ text-rendering: optimizeLegibility;
873
+ container-type: inline-size;
874
+ }
875
+
876
+ /* Borderless / full-bleed: blends into the host page and fills its container.
877
+ Only the OUTER chrome is removed \u2014 internal borders (tiles, inputs) stay. */
878
+ .flxig-root.flxig-plain {
879
+ border: none;
880
+ border-radius: 0;
881
+ padding: 0;
882
+ background: transparent;
883
+ }
884
+
885
+ /* ---- typography ---- */
886
+ .flxig-h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
887
+ .flxig-h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
888
+ .flxig-muted { color: var(--flxig-muted-foreground); font-size: 0.9rem; margin: 0; }
889
+ .flxig-label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; }
890
+ .flxig-hint { font-size: 0.75rem; color: var(--flxig-muted-foreground); margin-top: 4px; }
891
+
892
+ /* ---- buttons ---- */
893
+ .flxig-btn {
894
+ appearance: none; border: 1px solid transparent; cursor: pointer;
895
+ font-family: inherit; font-size: 0.9rem; font-weight: 600;
896
+ border-radius: calc(var(--flxig-radius) - 4px);
897
+ padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center;
898
+ gap: 8px; transition: filter .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
899
+ text-decoration: none; white-space: nowrap;
900
+ }
901
+ .flxig-btn:disabled { opacity: .55; cursor: not-allowed; }
902
+ .flxig-btn--primary { background: var(--flxig-primary); color: var(--flxig-primary-foreground); }
903
+ .flxig-btn--primary:hover:not(:disabled) { filter: brightness(1.07); }
904
+ .flxig-btn--secondary { background: var(--flxig-secondary); color: var(--flxig-secondary-foreground); border-color: var(--flxig-border); }
905
+ .flxig-btn--secondary:hover:not(:disabled) { background: var(--flxig-muted); }
906
+ .flxig-btn--ghost { background: transparent; color: var(--flxig-foreground); }
907
+ .flxig-btn--ghost:hover:not(:disabled) { background: var(--flxig-muted); }
908
+ .flxig-btn--block { width: 100%; }
909
+ .flxig-btn--lg { padding: 13px 20px; font-size: 0.98rem; }
910
+
911
+ /* ---- brand logo: delta chip (light) / bare delta (dark) + wordmark ---- */
912
+ .flxig-brand { display: inline-flex; align-items: center; gap: 7px; color: var(--flxig-foreground); }
913
+ .flxig-brand__chip { display: inline-flex; align-items: center; justify-content: center; background: var(--flxig-primary); border-radius: 6px; padding: 3px; }
914
+ .flxig-brand__img { display: block; width: var(--flxig-logo-size, 18px); height: var(--flxig-logo-size, 18px); object-fit: contain; }
915
+ .flxig-brand__wordmark { display: block; height: var(--flxig-logo-size, 18px); width: auto; }
916
+ :host(.flxig-dark) .flxig-brand__chip { background: transparent; padding: 0; }
917
+
918
+ /* ---- co-brand lockup: "<partner logo> \xD7 flonix" ---- */
919
+ .flxig-cobrand { display: inline-flex; align-items: center; gap: 9px; font-size: 0.9rem; }
920
+ .flxig-cobrand__x { color: var(--flxig-muted-foreground); font-weight: 400; }
921
+ .flxig-partner { display: inline-flex; align-items: center; }
922
+ .flxig-partner__img { display: block; height: 18px; width: auto; max-width: 120px; object-fit: contain; }
923
+ .flxig-partner[data-has-dark="true"] .flxig-partner__img--dark { display: none; }
924
+ :host(.flxig-dark) .flxig-partner[data-has-dark="true"] .flxig-partner__img--light { display: none; }
925
+ :host(.flxig-dark) .flxig-partner[data-has-dark="true"] .flxig-partner__img--dark { display: block; }
926
+
927
+ /* ---- connect screen ---- */
928
+ .flxig-connect { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: clamp(20px, 6cqw, 52px) 8px; }
929
+ .flxig-connect__copy { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
930
+ .flxig-connect__cta { width: 100%; max-width: 340px; margin-top: 4px; }
931
+ .flxig-connect__foot { margin-top: 6px; }
932
+
933
+ /* ---- posts header ---- */
934
+ .flxig-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
935
+ .flxig-header__id { display: flex; align-items: center; gap: 10px; min-width: 0; }
936
+ .flxig-avatar { width: 38px; height: 38px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--flxig-accent); color: var(--flxig-accent-foreground); flex: none; }
937
+ .flxig-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--flxig-accent); color: var(--flxig-accent-foreground); }
938
+
939
+ /* ---- posts grid ---- */
940
+ .flxig-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
941
+ @container (min-width: 520px) { .flxig-grid { grid-template-columns: repeat(3, 1fr); } }
942
+ @container (min-width: 760px) { .flxig-grid { grid-template-columns: repeat(4, 1fr); } }
943
+
944
+ .flxig-tile { border: 1px solid var(--flxig-border); border-radius: var(--flxig-radius); overflow: hidden; background: var(--flxig-card); display: flex; flex-direction: column; }
945
+ .flxig-tile__media { position: relative; aspect-ratio: 1 / 1; background: var(--flxig-muted); overflow: hidden; }
946
+ .flxig-tile__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
947
+ .flxig-tile__ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--flxig-muted-foreground); }
948
+ .flxig-tile__type { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; font-weight: 600; padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, #000 55%, transparent); color: #fff; backdrop-filter: blur(4px); }
949
+ .flxig-tile__body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
950
+ .flxig-tile__cap { font-size: 0.78rem; color: var(--flxig-muted-foreground); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.1em; }
951
+
952
+ .flxig-sentinel { height: 1px; }
953
+ .flxig-loadmore { display: flex; justify-content: center; padding: 18px 0 2px; color: var(--flxig-muted-foreground); }
954
+
955
+ /* ---- empty / error / loading ---- */
956
+ .flxig-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 48px 16px; color: var(--flxig-muted-foreground); }
957
+
958
+ /* ---- dialog ---- */
959
+ .flxig-overlay { position: fixed; inset: 0; background: color-mix(in srgb, #000 55%, transparent); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 2147483000; animation: flxig-fade .15s ease; }
960
+ .flxig-dialog { background: var(--flxig-popover); color: var(--flxig-popover-foreground); border: 1px solid var(--flxig-border); border-radius: var(--flxig-radius); width: min(560px, 100%); max-height: min(88vh, 760px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); animation: flxig-pop .18s cubic-bezier(.2,.8,.2,1); }
961
+ .flxig-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--flxig-border); }
962
+ .flxig-dialog__body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
963
+ .flxig-dialog__foot { padding: 14px 20px; border-top: 1px solid var(--flxig-border); display: flex; gap: 10px; justify-content: flex-end; }
964
+ .flxig-iconbtn { appearance: none; background: transparent; border: none; color: var(--flxig-muted-foreground); cursor: pointer; padding: 4px; border-radius: 8px; display: inline-flex; }
965
+ .flxig-iconbtn:hover { background: var(--flxig-muted); color: var(--flxig-foreground); }
966
+
967
+ /* ---- type picker (segmented) ---- */
968
+ .flxig-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
969
+ .flxig-seg__opt { border: 1px solid var(--flxig-border); border-radius: calc(var(--flxig-radius) - 2px); padding: 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: var(--flxig-card); transition: border-color .15s, background .15s; }
970
+ .flxig-seg__opt:hover { border-color: var(--flxig-ring); }
971
+ .flxig-seg__opt[data-active="true"] { border-color: var(--flxig-primary); background: var(--flxig-accent); }
972
+ .flxig-seg__ic { color: var(--flxig-primary); margin-top: 2px; }
973
+ .flxig-seg__t { font-weight: 650; font-size: 0.88rem; }
974
+ .flxig-seg__d { font-size: 0.74rem; color: var(--flxig-muted-foreground); margin-top: 2px; }
975
+
976
+ /* ---- form fields ---- */
977
+ .flxig-field { display: block; }
978
+ .flxig-input, .flxig-textarea {
979
+ width: 100%; font-family: inherit; font-size: 0.88rem; color: var(--flxig-foreground);
980
+ background: var(--flxig-background); border: 1px solid var(--flxig-input);
981
+ border-radius: calc(var(--flxig-radius) - 4px); padding: 9px 11px; transition: border-color .15s, box-shadow .15s;
982
+ }
983
+ .flxig-input:focus, .flxig-textarea:focus { outline: none; border-color: var(--flxig-ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--flxig-ring) 25%, transparent); }
984
+ .flxig-textarea { resize: vertical; min-height: 72px; }
985
+
986
+ /* ---- follow-gate card + switch ---- */
987
+ .flxig-gate { border: 1px solid var(--flxig-border); border-radius: calc(var(--flxig-radius) - 2px); padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--flxig-card); }
988
+ .flxig-gate__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
989
+ .flxig-gate__fields { display: flex; flex-direction: column; gap: 12px; }
990
+ .flxig-gate__fields[data-off="true"] { opacity: .5; pointer-events: none; }
991
+
992
+ .flxig-switch { position: relative; width: 40px; height: 23px; flex: none; }
993
+ .flxig-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
994
+ .flxig-switch__track { position: absolute; inset: 0; background: var(--flxig-input); border-radius: 999px; transition: background .15s; }
995
+ .flxig-switch__thumb { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 999px; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
996
+ .flxig-switch input:checked ~ .flxig-switch__track { background: var(--flxig-primary); }
997
+ .flxig-switch input:checked ~ .flxig-switch__thumb { transform: translateX(17px); }
998
+
999
+ /* ---- chips (keywords) ---- */
1000
+ .flxig-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--flxig-input); border-radius: calc(var(--flxig-radius) - 4px); background: var(--flxig-background); }
1001
+ .flxig-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--flxig-secondary); color: var(--flxig-secondary-foreground); font-size: 0.78rem; font-weight: 600; padding: 4px 8px; border-radius: 999px; }
1002
+ .flxig-chip button { appearance: none; border: none; background: transparent; color: inherit; cursor: pointer; opacity: .6; padding: 0; display: inline-flex; }
1003
+ .flxig-chip button:hover { opacity: 1; }
1004
+ .flxig-chips input { flex: 1; min-width: 80px; border: none; outline: none; background: transparent; color: var(--flxig-foreground); font-family: inherit; font-size: 0.82rem; padding: 4px; }
1005
+
1006
+ /* ---- link buttons editor ---- */
1007
+ .flxig-links__wrap { display: flex; flex-direction: column; gap: 10px; }
1008
+ .flxig-links { display: flex; flex-direction: column; gap: 10px; }
1009
+ .flxig-link { display: flex; align-items: center; gap: 8px; }
1010
+ .flxig-link__ic { color: var(--flxig-muted-foreground); flex: none; display: inline-flex; }
1011
+ .flxig-link__inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 8px; flex: 1; min-width: 0; }
1012
+ .flxig-links__add { align-self: flex-start; padding-left: 8px; padding-right: 12px; }
1013
+ @container (max-width: 440px) { .flxig-link__inputs { grid-template-columns: 1fr; } }
1014
+
1015
+ /* ---- toast ---- */
1016
+ .flxig-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--flxig-foreground); color: var(--flxig-background); font-size: 0.85rem; font-weight: 600; padding: 10px 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; z-index: 2147483001; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); animation: flxig-pop .2s ease; }
1017
+
1018
+ /* ---- footer attribution ---- */
1019
+ .flxig-attrib { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--flxig-border); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.72rem; color: var(--flxig-muted-foreground); }
1020
+
1021
+ /* ---- animations ---- */
1022
+ .flxig-spin { animation: flxig-rotate .8s linear infinite; }
1023
+ @keyframes flxig-rotate { to { transform: rotate(360deg); } }
1024
+ @keyframes flxig-fade { from { opacity: 0; } to { opacity: 1; } }
1025
+ @keyframes flxig-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
1026
+ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
1027
+ `;
1028
+
1029
+ // src/widget.ts
1030
+ var RETURN_FLAG = "flxig_connected";
1031
+ var DEFAULT_BASE_URL = "https://flonix.pro";
1032
+ var Widget = class {
1033
+ constructor(target, config) {
1034
+ this.mediaQuery = null;
1035
+ this.token = null;
1036
+ this.account = null;
1037
+ this.postsView = null;
1038
+ this.cursor = null;
1039
+ this.connecting = false;
1040
+ this.destroyed = false;
1041
+ // ---- lifecycle ----
1042
+ this.onSchemeChange = (ev) => this.applyMode(ev.matches);
1043
+ var _a, _b;
1044
+ this.config = config;
1045
+ this.transport = (_b = config.transport) != null ? _b : createHttpTransport((_a = config.baseUrl) != null ? _a : DEFAULT_BASE_URL);
1046
+ this.host = document.createElement("div");
1047
+ this.host.setAttribute("data-flonix-ig", "");
1048
+ target.appendChild(this.host);
1049
+ this.shadow = this.host.attachShadow({ mode: "open" });
1050
+ const theme = resolveTheme(config.theme);
1051
+ this.shadow.appendChild(
1052
+ el("style", { text: `${buildThemeVars(theme)}
1053
+ ${STYLES}` })
1054
+ );
1055
+ this.root = el("div", {
1056
+ class: config.appearance === "plain" ? "flxig-root flxig-plain" : "flxig-root"
1057
+ });
1058
+ this.content = el("div", { class: "flxig-content" });
1059
+ this.root.appendChild(this.content);
1060
+ this.shadow.appendChild(this.root);
1061
+ this.applyMode(isDarkActive(theme.mode));
1062
+ if (theme.mode === "auto" && typeof window.matchMedia === "function") {
1063
+ this.mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
1064
+ this.mediaQuery.addEventListener("change", this.onSchemeChange);
1065
+ }
1066
+ void this.init();
1067
+ }
1068
+ applyMode(dark) {
1069
+ this.host.classList.toggle("flxig-dark", dark);
1070
+ }
1071
+ refresh() {
1072
+ this.cursor = null;
1073
+ void this.init();
1074
+ }
1075
+ unmount() {
1076
+ var _a, _b;
1077
+ this.destroyed = true;
1078
+ (_a = this.postsView) == null ? void 0 : _a.destroy();
1079
+ (_b = this.mediaQuery) == null ? void 0 : _b.removeEventListener("change", this.onSchemeChange);
1080
+ this.host.remove();
1081
+ }
1082
+ fail(error) {
1083
+ var _a, _b;
1084
+ const err = error instanceof Error ? error : new Error(String(error));
1085
+ (_b = (_a = this.config).onError) == null ? void 0 : _b.call(_a, err);
1086
+ return err;
1087
+ }
1088
+ // ---- flow ----
1089
+ async init() {
1090
+ var _a, _b, _c;
1091
+ this.renderLoading();
1092
+ try {
1093
+ const session = await this.transport.session({
1094
+ apiKey: this.config.apiKey,
1095
+ user: this.config.user
1096
+ });
1097
+ if (this.destroyed) return;
1098
+ this.token = session.token;
1099
+ this.account = session.account;
1100
+ if (session.connected) {
1101
+ this.clearReturnFlag();
1102
+ (_c = (_b = this.config).onConnected) == null ? void 0 : _c.call(_b, (_a = session.account) != null ? _a : { instagramId: null, username: null });
1103
+ await this.renderPosts();
1104
+ } else {
1105
+ this.renderConnect();
1106
+ }
1107
+ } catch (error) {
1108
+ this.renderError(this.fail(error).message);
1109
+ }
1110
+ }
1111
+ async startConnect() {
1112
+ if (!this.token || this.connecting) return;
1113
+ this.connecting = true;
1114
+ this.renderConnect();
1115
+ try {
1116
+ const { authorizeUrl } = await this.transport.connectStart({
1117
+ token: this.token,
1118
+ returnUrl: this.resolveReturnUrl()
1119
+ });
1120
+ window.location.href = authorizeUrl;
1121
+ } catch (error) {
1122
+ this.connecting = false;
1123
+ this.renderConnect();
1124
+ this.toast(this.fail(error).message);
1125
+ }
1126
+ }
1127
+ async renderPosts() {
1128
+ const view = renderPosts({
1129
+ account: this.account,
1130
+ onAutomate: (post) => this.openDialog(post),
1131
+ onLoadMore: () => void this.loadMore()
1132
+ });
1133
+ this.postsView = view;
1134
+ this.swap(view.element);
1135
+ await this.loadMore(true);
1136
+ }
1137
+ async loadMore(initial = false) {
1138
+ const view = this.postsView;
1139
+ if (!view || !this.token) return;
1140
+ view.setLoadingMore(true);
1141
+ try {
1142
+ const { posts, nextCursor } = await this.transport.posts({
1143
+ token: this.token,
1144
+ cursor: this.cursor
1145
+ });
1146
+ if (this.destroyed) return;
1147
+ if (initial && posts.length === 0) {
1148
+ view.showEmpty();
1149
+ return;
1150
+ }
1151
+ view.appendPosts(posts);
1152
+ this.cursor = nextCursor;
1153
+ view.setHasMore(Boolean(nextCursor));
1154
+ } catch (error) {
1155
+ this.toast(this.fail(error).message);
1156
+ } finally {
1157
+ view.setLoadingMore(false);
1158
+ }
1159
+ }
1160
+ openDialog(post) {
1161
+ if (!this.token) return;
1162
+ openAutomateDialog({
1163
+ mount: this.shadow,
1164
+ post,
1165
+ account: this.account,
1166
+ onToast: (message) => this.toast(message),
1167
+ onSubmit: (data) => this.createAutomation(data)
1168
+ });
1169
+ }
1170
+ async createAutomation(data) {
1171
+ var _a, _b;
1172
+ if (!this.token) throw new Error("Not connected");
1173
+ const result = await this.transport.createAutomation({ token: this.token, data });
1174
+ (_b = (_a = this.config).onAutomationCreated) == null ? void 0 : _b.call(_a, result);
1175
+ this.toast("Automation created \u2713");
1176
+ }
1177
+ // ---- rendering helpers ----
1178
+ swap(node) {
1179
+ clear(this.content);
1180
+ this.content.appendChild(node);
1181
+ }
1182
+ renderConnect() {
1183
+ this.swap(
1184
+ renderConnect({
1185
+ connecting: this.connecting,
1186
+ partner: this.config.partner,
1187
+ onConnect: () => void this.startConnect()
1188
+ })
1189
+ );
1190
+ }
1191
+ renderLoading() {
1192
+ this.swap(stateBlock({ icon: icons.spinner(26), title: "Loading\u2026" }));
1193
+ }
1194
+ renderError(message) {
1195
+ this.swap(
1196
+ stateBlock({
1197
+ icon: icons.close(26),
1198
+ title: "Couldn't load",
1199
+ detail: message
1200
+ })
1201
+ );
1202
+ }
1203
+ toast(message) {
1204
+ const toast = fromMarkup(
1205
+ `<div class="flxig-toast">${icons.bolt(14)}<span></span></div>`
1206
+ );
1207
+ toast.querySelector("span").textContent = message;
1208
+ this.shadow.appendChild(toast);
1209
+ setTimeout(() => toast.remove(), 2600);
1210
+ }
1211
+ // ---- return-from-OAuth handling ----
1212
+ resolveReturnUrl() {
1213
+ if (this.config.returnUrl) return this.config.returnUrl;
1214
+ if (typeof window === "undefined") return "";
1215
+ return window.location.href;
1216
+ }
1217
+ clearReturnFlag() {
1218
+ var _a;
1219
+ if (typeof window === "undefined" || !((_a = window.history) == null ? void 0 : _a.replaceState)) return;
1220
+ const url = new URL(window.location.href);
1221
+ if (url.searchParams.has(RETURN_FLAG)) {
1222
+ url.searchParams.delete(RETURN_FLAG);
1223
+ window.history.replaceState({}, "", url.toString());
1224
+ }
1225
+ }
1226
+ };
1227
+
1228
+ // src/mock.ts
1229
+ var delay = (ms) => new Promise((r) => setTimeout(r, ms));
1230
+ var TYPES = ["IMAGE", "CAROUSEL", "REELS", "VIDEO", "IMAGE"];
1231
+ var CAPTIONS = [
1232
+ "New drop is live \u{1F525} comment LINK for the shop",
1233
+ "Behind the scenes of today's shoot",
1234
+ "Our bestseller is back in stock \u2728",
1235
+ "How to style this 3 ways \u{1F447}",
1236
+ "Limited edition \u2014 only 50 made",
1237
+ "Weekend sale starts now \u{1F6CD}\uFE0F",
1238
+ null,
1239
+ "Tag a friend who needs this \u{1F499}"
1240
+ ];
1241
+ function makePage(page, perPage) {
1242
+ return Array.from({ length: perPage }, (_, i) => {
1243
+ var _a, _b;
1244
+ const n = page * perPage + i;
1245
+ return {
1246
+ id: `mock_${n}`,
1247
+ caption: (_a = CAPTIONS[n % CAPTIONS.length]) != null ? _a : null,
1248
+ media: `https://picsum.photos/seed/flonix${n}/600/600`,
1249
+ mediaType: (_b = TYPES[n % TYPES.length]) != null ? _b : "IMAGE",
1250
+ permalink: null,
1251
+ timestamp: new Date(Date.now() - n * 864e5).toISOString()
1252
+ };
1253
+ });
1254
+ }
1255
+ function createMockTransport(options = {}) {
1256
+ var _a, _b, _c;
1257
+ const totalPages = (_a = options.totalPages) != null ? _a : 3;
1258
+ const perPage = (_b = options.perPage) != null ? _b : 8;
1259
+ const storageKey = `flxig.mock.connected.${(_c = options.namespace) != null ? _c : "default"}`;
1260
+ const isConnected = () => {
1261
+ try {
1262
+ return localStorage.getItem(storageKey) === "1";
1263
+ } catch {
1264
+ return false;
1265
+ }
1266
+ };
1267
+ return {
1268
+ async session() {
1269
+ await delay(400);
1270
+ const connected = isConnected();
1271
+ return {
1272
+ connected,
1273
+ token: "mock-session-token",
1274
+ account: connected ? { instagramId: "17890000000", username: "your_brand" } : null
1275
+ };
1276
+ },
1277
+ async connectStart({ returnUrl }) {
1278
+ await delay(500);
1279
+ try {
1280
+ localStorage.setItem(storageKey, "1");
1281
+ } catch {
1282
+ }
1283
+ const url = new URL(returnUrl, window.location.href);
1284
+ url.searchParams.set("flxig_connected", "1");
1285
+ return { authorizeUrl: url.toString() };
1286
+ },
1287
+ async posts({ cursor }) {
1288
+ await delay(500);
1289
+ const page = cursor ? Number(cursor) : 0;
1290
+ const posts = makePage(page, perPage);
1291
+ const next = page + 1;
1292
+ return { posts, nextCursor: next < totalPages ? String(next) : null };
1293
+ },
1294
+ async createAutomation() {
1295
+ await delay(700);
1296
+ return { id: `mock_automation_${Date.now()}` };
1297
+ }
1298
+ };
1299
+ }
1300
+
1301
+ // src/index.ts
1302
+ var version = "0.1.1";
1303
+ function mount(target, config) {
1304
+ var _a, _b, _c;
1305
+ const element = typeof target === "string" ? document.querySelector(target) : target;
1306
+ if (!element) {
1307
+ throw new Error(`FlonixIG.mount: target not found: ${String(target)}`);
1308
+ }
1309
+ if (!(config == null ? void 0 : config.apiKey)) {
1310
+ throw new Error("FlonixIG.mount: config.apiKey is required");
1311
+ }
1312
+ if (!((_a = config == null ? void 0 : config.user) == null ? void 0 : _a.id)) {
1313
+ throw new Error("FlonixIG.mount: config.user.id is required");
1314
+ }
1315
+ if (!((_b = config == null ? void 0 : config.partner) == null ? void 0 : _b.logo) || !((_c = config == null ? void 0 : config.partner) == null ? void 0 : _c.name)) {
1316
+ throw new Error(
1317
+ "FlonixIG.mount: config.partner.name and config.partner.logo are required"
1318
+ );
1319
+ }
1320
+ return new Widget(element, config);
1321
+ }
1322
+ var FlonixIG = { mount, version };
1323
+
1324
+ exports.DEFAULT_TOKENS = DEFAULT_TOKENS;
1325
+ exports.FlonixIG = FlonixIG;
1326
+ exports.createHttpTransport = createHttpTransport;
1327
+ exports.createMockTransport = createMockTransport;
1328
+ exports.mount = mount;
1329
+ exports.version = version;
1330
+ //# sourceMappingURL=index.js.map
1331
+ //# sourceMappingURL=index.js.map