1(function() { 2 try { 3 var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}; 4 e.SENTRY_RELEASE = { id: "b96dc26" }; 5 var n = new e.Error().stack; 6 n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "59bc9e4e-b941-4da0-9dc5-a1c68aefaaa2", e._sentryDebugIdIdentifier = "sentry-dbid-59bc9e4e-b941-4da0-9dc5-a1c68aefaaa2"); 7 } catch (e) {} 8})(); 9import { n as __esmMin } from "./rolldown-runtime-sLwMD6dS.js"; 10import { As as Input, Eo as sequences_path, Et as DropdownMenuTrigger, Mi as init_routes, Os as Checkbox, Xt as init_label, Yt as Label, bt as DropdownMenuItem, ft as DropdownMenu, js as init_input, ks as init_checkbox, kt as init_dropdown_menu, mt as DropdownMenuContent, wt as DropdownMenuSubmit } from "./controllers-jdPQjaCB.js"; 11import { l as unsafeCast } from "./type-guards-DVyG5ljW.js"; 12import { a as cn, i as require_compiler_runtime, l as getCsrfToken, t as require_jsx_runtime, u as init_utils } from "./jsx-runtime-CHSMGLHp.js"; 13import { t as require_react } from "./react-CrLPhuc5.js"; 14import { n as init_icon, t as Icon } from "./icon-BNzYbsdJ.js"; 15import { r as init_button, t as Button } from "./button-DOiPZHfy.js"; 16import { i as init_tag, n as Tag } from "./tag-j7SWTISf.js"; 17import { n as init_sentry_error_boundary, r as withSentryErrorBoundary } from "./sentry-error-boundary-riAWv_XB.js"; 18import { $t as init_campaigns_issues, It as SearchInput, Lt as init_search_input, Qt as CampaignsIssues, cn as PageHeaderActions, en as CampaignsMetrics, fn as PageHeaderHeading, hn as init_page_header, mn as PageHeaderTitle, nn as init_campaigns_metrics, sn as PageHeader, tn as CampaignsMetricsErrorFallback } from "./turbo-mount-DM0tFk1M.js"; 19import { r as init_separator, t as Separator } from "./separator-D5aQTBY-.js"; 20import { c as EmptyStateImage, d as init_empty_state, i as EmptyStateContent, l as EmptyStateTitle, n as EmptyStateActions, t as EmptyState } from "./empty-state-Crv2GUlN.js"; 21import { a as init_dist$1, l as router, s as usePage, t as Head_default } from "./dist-ZlUHm0R7.js"; 22import { r as init_AppLayout, t as AppLayout } from "./AppLayout-KSwds5qH.js"; 23import { i as markOnboardingStepSeen, n as init_SequencesSubmenu, r as init_onboardingSteps, t as SequencesSubmenu } from "./SequencesSubmenu-CPPYbJ2m.js"; 24//#region app/frontend/pages/Sequences/CampaignInsights.tsx 25function formatRate(rate) { 26 if (rate > .01 || rate === 0) return `${Math.round(rate * 100)}%`; 27 return `${(rate * 100).toFixed(1)}%`; 28} 29function Spinner() { 30 const $ = (0, import_compiler_runtime$9.c)(1); 31 let t0; 32 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 33 t0 = /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("i", { 34 className: "far fa-spinner-third fa-spin", 35 "aria-hidden": "true" 36 }); 37 $[0] = t0; 38 } else t0 = $[0]; 39 return t0; 40} 41function Stat(t0) { 42 const $ = (0, import_compiler_runtime$9.c)(6); 43 const { className, href, title, icon, children } = t0; 44 let t1; 45 if ($[0] !== children || $[1] !== className || $[2] !== href || $[3] !== icon || $[4] !== title) { 46 t1 = /* @__PURE__ */ (0, import_jsx_runtime$9.jsxs)("a", { 47 className, 48 href, 49 "data-controller": "tooltip", 50 "data-turbo-frame": "_top", 51 title, 52 children: [ 53 icon, 54 " ", 55 children 56 ] 57 }); 58 $[0] = children; 59 $[1] = className; 60 $[2] = href; 61 $[3] = icon; 62 $[4] = title; 63 $[5] = t1; 64 } else t1 = $[5]; 65 return t1; 66} 67function CampaignInsights(t0) { 68 const $ = (0, import_compiler_runtime$9.c)(7); 69 const { showsInsights, resolved, insights, labels } = t0; 70 if (!showsInsights) { 71 let t1; 72 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 73 t1 = /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("span", { 74 className: "light-grey", 75 children: "-" 76 }); 77 $[0] = t1; 78 } else t1 = $[0]; 79 return t1; 80 } 81 let t1; 82 if ($[1] !== insights || $[2] !== labels || $[3] !== resolved) { 83 t1 = renderStrip(resolved, insights, labels); 84 $[1] = insights; 85 $[2] = labels; 86 $[3] = resolved; 87 $[4] = t1; 88 } else t1 = $[4]; 89 let t2; 90 if ($[5] !== t1) { 91 t2 = /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("div", { 92 className: "campaign-insight", 93 children: t1 94 }); 95 $[5] = t1; 96 $[6] = t2; 97 } else t2 = $[6]; 98 return t2; 99}
100function renderStrip(resolved, insights, labels) { 101 if (!insights) { 102 if (resolved) return /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("span", { 103 className: "light-grey", 104 children: "-" 105 }); 106 return /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("span", { 107 className: "campaigns-table__statistics", 108 children: /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Spinner, {}) 109 }); 110 } 111 if (insights.state === "preparing") return /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("span", { 112 className: "grey pending_rate", 113 children: /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Spinner, {}) 114 }); 115 if (insights.state === "creating") return /* @__PURE__ */ (0, import_jsx_runtime$9.jsxs)("span", { 116 className: "grey pending_rate", 117 children: [ 118 /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Spinner, {}), 119 " ", 120 insights.label 121 ] 122 }); 123 return /* @__PURE__ */ (0, import_jsx_runtime$9.jsxs)("span", { 124 className: "campaigns-table__statistics", 125 children: [ 126 /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Stat, { 127 className: "grey pending_rate", 128 href: insights.pendingPath, 129 title: labels.insightsPending, 130 icon: /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("i", { 131 className: "fad fa-hourglass-empty", 132 "aria-hidden": "true" 133 }), 134 children: insights.pendingCount 135 }), 136 /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Stat, { 137 className: "blue contact_rate", 138 href: insights.sentPath, 139 title: labels.insightsSent, 140 icon: /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("i", { 141 className: "fad fa-envelope", 142 "aria-hidden": "true" 143 }), 144 children: insights.sentCount 145 }),
146 insights.tracked && /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Stat, { 147 className: "green open_rate", 148 href: insights.openedPath, 149 title: labels.insightsOpened, 150 icon: /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("i", { 151 className: "fad fa-eye", 152 "aria-hidden": "true" 153 }), 154 children: formatRate(insights.openRate) 155 }), 156 insights.trackedLinks && /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Stat, { 157 className: "cyan click_rate", 158 href: insights.clickedPath, 159 title: labels.insightsClicked, 160 icon: /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("i", { 161 className: "far fa-hand-pointer", 162 "aria-hidden": "true" 163 }), 164 children: formatRate(insights.clickRate) 165 }), 166 /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Stat, { 167 className: "purple reply_rate", 168 href: insights.repliedPath, 169 title: labels.insightsReplied, 170 icon: /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("i", { 171 className: "fad fa-reply", 172 "aria-hidden": "true" 173 }), 174 children: formatRate(insights.replyRate) 175 }), 176 /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)(Stat, { 177 className: "green success_rate", 178 href: insights.successfulPath, 179 title: labels.insightsSuccessful, 180 icon: /* @__PURE__ */ (0, import_jsx_runtime$9.jsx)("i", { 181 className: "far fa-thumbs-up", 182 "aria-hidden": "true" 183 }), 184 children: formatRate(insights.successfulRate) 185 }) 186 ] 187 }); 188} 189var import_compiler_runtime$9, import_jsx_runtime$9; 190function init_CampaignInsights() { 191 return (init_CampaignInsights = __esmMin((() => { 192 import_compiler_runtime$9 = require_compiler_runtime(); 193 import_jsx_runtime$9 = require_jsx_runtime(); 194 })))(); 195} 196//#endregion 197//#region app/frontend/pages/Sequences/CampaignRow.tsx 198function escapeHtml(value) { 199 return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"); 200} 201function TurboFrameIsland(t0) { 202 const $ = (0, import_compiler_runtime$8.c)(4); 203 const { id, innerHtml } = t0; 204 let t1; 205 if ($[0] !== id) { 206 t1 = escapeHtml(id); 207 $[0] = id; 208 $[1] = t1; 209 } else t1 = $[1]; 210 const t2 = `<turbo-frame id="${t1}">${innerHtml}</turbo-frame>`; 211 let t3; 212 if ($[2] !== t2) { 213 t3 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("div", { 214 "data-turbo": "true", 215 dangerouslySetInnerHTML: { __html: t2 } 216 }); 217 $[2] = t2; 218 $[3] = t3; 219 } else t3 = $[3]; 220 return t3; 221} 222function OwnerAvatar(t0) { 223 const $ = (0, import_compiler_runtime$8.c)(7); 224 const { owner } = t0; 225 const reveal = _temp$3; 226 let t1; 227 if ($[0] !== owner.avatarUrl || $[1] !== owner.fullName || $[2] !== owner.initials) {
228 t1 = owner.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("img", { 229 ref: reveal, 230 src: owner.avatarUrl, 231 alt: owner.fullName, 232 onLoad: _temp2 233 }) : owner.initials; 234 $[0] = owner.avatarUrl; 235 $[1] = owner.fullName; 236 $[2] = owner.initials; 237 $[3] = t1; 238 } else t1 = $[3]; 239 let t2; 240 if ($[4] !== owner.fullName || $[5] !== t1) { 241 t2 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("span", { 242 className: "profile-pic pic-sm", 243 title: owner.fullName, 244 children: t1 245 }); 246 $[4] = owner.fullName; 247 $[5] = t1; 248 $[6] = t2; 249 } else t2 = $[6]; 250 return t2; 251} 252function _temp2(event) { 253 event.currentTarget.style.opacity = "1"; 254} 255function _temp$3(img) { 256 if (img?.complete) img.style.opacity = "1"; 257} 258function StatusBadge(t0) { 259 const $ = (0, import_compiler_runtime$8.c)(15); 260 const { campaign } = t0; 261 const { badge } = campaign; 262 const t1 = badge.variant ?? "default"; 263 let t2; 264 if ($[0] !== t1) { 265 t2 = unsafeCast(t1); 266 $[0] = t1; 267 $[1] = t2; 268 } else t2 = $[1]; 269 let t3; 270 if ($[2] !== badge.tooltipIcon) {
271 t3 = badge.tooltipIcon && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 272 icon: "question-circle", 273 variant: "regular", 274 className: "h-tag__tooltip-icon", 275 "aria-hidden": "true" 276 }); 277 $[2] = badge.tooltipIcon; 278 $[3] = t3; 279 } else t3 = $[3]; 280 let t4; 281 if ($[4] !== badge.label || $[5] !== t3) { 282 t4 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)(import_jsx_runtime$8.Fragment, { children: [badge.label, t3] }); 283 $[4] = badge.label; 284 $[5] = t3; 285 $[6] = t4; 286 } else t4 = $[6]; 287 const t5 = badge.tooltip ? "tooltip" : void 0; 288 const t6 = badge.tooltip ? "body" : void 0; 289 let t7; 290 if ($[7] !== badge.icon || $[8] !== badge.iconLoading || $[9] !== badge.tooltip || $[10] !== t2 || $[11] !== t4 || $[12] !== t5 || $[13] !== t6) { 291 t7 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Tag, { 292 size: "none", 293 variant: t2, 294 icon: badge.icon, 295 iconLoading: badge.iconLoading, 296 label: t4, 297 title: badge.tooltip, 298 "data-controller": t5, 299 "data-bs-container": t6 300 }); 301 $[7] = badge.icon; 302 $[8] = badge.iconLoading; 303 $[9] = badge.tooltip; 304 $[10] = t2; 305 $[11] = t4; 306 $[12] = t5; 307 $[13] = t6; 308 $[14] = t7; 309 } else t7 = $[14]; 310 return t7; 311} 312function RowActions(t0) { 313 const $ = (0, import_compiler_runtime$8.c)(36); 314 const { campaign, labels } = t0; 315 const { actions } = campaign; 316 let t1; 317 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 318 t1 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 319 icon: "ellipsis-vertical", 320 variant: "regular", 321 "aria-hidden": "true" 322 }); 323 $[0] = t1; 324 } else t1 = $[0]; 325 let t2; 326 if ($[1] !== labels.moreActions) { 327 t2 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(DropdownMenuTrigger, { 328 asChild: true, 329 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Button, { 330 type: "button", 331 variant: "ghost", 332 size: "xs", 333 iconOnly: true, 334 "aria-label": labels.moreActions, 335 children: t1 336 }) 337 }); 338 $[1] = labels.moreActions; 339 $[2] = t2; 340 } else t2 = $[2]; 341 let t3; 342 if ($[3] !== actions.pausePath || $[4] !== actions.resume || $[5] !== labels.resume) { 343 t3 = actions.resume && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(DropdownMenuItem, { 344 closeOnClick: true, 345 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("a", { 346 className: "dropdown-menu__action", 347 href: actions.pausePath, 348 "data-turbo-method": "delete", 349 children: [/* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 350 icon: "play", 351 variant: "regular", 352 "aria-hidden": "true" 353 }), labels.resume] 354 }) 355 }); 356 $[3] = actions.pausePath; 357 $[4] = actions.resume; 358 $[5] = labels.resume; 359 $[6] = t3; 360 } else t3 = $[6]; 361 let t4; 362 if ($[7] !== actions.pause || $[8] !== actions.pausePath || $[9] !== labels.pause) { 363 t4 = actions.pause && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(DropdownMenuItem, { 364 closeOnClick: true, 365 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("a", { 366 className: "dropdown-menu__action", 367 href: actions.pausePath, 368 "data-turbo-method": "post", 369 children: [/* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 370 icon: "pause", 371 variant: "regular", 372 "aria-hidden": "true" 373 }), labels.pause] 374 }) 375 }); 376 $[7] = actions.pause; 377 $[8] = actions.pausePath; 378 $[9] = labels.pause; 379 $[10] = t4; 380 } else t4 = $[10]; 381 let t5; 382 if ($[11] === Symbol.for("react.memo_cache_sentinel")) { 383 t5 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 384 icon: "copy", 385 variant: "regular", 386 "aria-hidden": "true" 387 }); 388 $[11] = t5; 389 } else t5 = $[11]; 390 let t6; 391 if ($[12] !== actions.duplicatePath || $[13] !== labels.duplicate) { 392 t6 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(DropdownMenuItem, { 393 closeOnClick: true, 394 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("a", { 395 className: "dropdown-menu__action", 396 href: actions.duplicatePath, 397 "data-turbo-method": "post", 398 children: [t5, labels.duplicate] 399 }) 400 }); 401 $[12] = actions.duplicatePath; 402 $[13] = labels.duplicate; 403 $[14] = t6; 404 } else t6 = $[14]; 405 let t7; 406 if ($[15] !== actions.archive || $[16] !== campaign.archive || $[17] !== labels.archive) {
407 t7 = actions.archive && campaign.archive && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(DropdownMenuItem, { 408 closeOnClick: true, 409 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("button", { 410 type: "button", 411 className: "dropdown-menu__action", 412 "data-bs-toggle": "modal", 413 "data-bs-target": `#${campaign.archive.id}`, 414 children: [/* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 415 icon: "archive", 416 variant: "regular", 417 "aria-hidden": "true" 418 }), labels.archive] 419 }) 420 }); 421 $[15] = actions.archive; 422 $[16] = campaign.archive; 423 $[17] = labels.archive; 424 $[18] = t7; 425 } else t7 = $[18]; 426 let t8; 427 if ($[19] !== actions.deleteConfirmation || $[20] !== labels.delete) { 428 t8 = actions.deleteConfirmation && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(DropdownMenuItem, { 429 closeOnClick: true, 430 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("a", { 431 className: "dropdown-menu__action dropdown-menu__action--danger", 432 href: actions.deleteConfirmation.path, 433 "data-controller": "confirm-deletion", 434 "data-action": "click->confirm-deletion#trigger", 435 "data-confirm-deletion-title-value": actions.deleteConfirmation.title, 436 "data-confirm-deletion-content-value": actions.deleteConfirmation.contentHtml, 437 "data-confirm-deletion-button-label-value": actions.deleteConfirmation.buttonLabel, 438 children: [/* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 439 icon: "trash-alt", 440 variant: "regular", 441 "aria-hidden": "true" 442 }), labels.delete] 443 }) 444 }); 445 $[19] = actions.deleteConfirmation; 446 $[20] = labels.delete; 447 $[21] = t8; 448 } else t8 = $[21]; 449 let t9; 450 if ($[22] !== actions.rename || $[23] !== campaign.rename || $[24] !== labels.rename) { 451 t9 = actions.rename && campaign.rename && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(DropdownMenuItem, { 452 closeOnClick: true, 453 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("button", { 454 type: "button", 455 className: "dropdown-menu__action", 456 "data-bs-toggle": "modal", 457 "data-bs-target": `#${campaign.rename.id}`, 458 children: [/* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 459 icon: "pencil", 460 variant: "regular", 461 "aria-hidden": "true" 462 }), labels.rename] 463 }) 464 }); 465 $[22] = actions.rename; 466 $[23] = campaign.rename; 467 $[24] = labels.rename; 468 $[25] = t9; 469 } else t9 = $[25]; 470 let t10; 471 if ($[26] !== t3 || $[27] !== t4 || $[28] !== t6 || $[29] !== t7 || $[30] !== t8 || $[31] !== t9) { 472 t10 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)(DropdownMenuContent, { 473 align: "end", 474 "data-turbo": "true", 475 children: [ 476 t3, 477 t4, 478 t6, 479 t7, 480 t8, 481 t9 482 ] 483 }); 484 $[26] = t3; 485 $[27] = t4; 486 $[28] = t6; 487 $[29] = t7; 488 $[30] = t8; 489 $[31] = t9; 490 $[32] = t10; 491 } else t10 = $[32]; 492 let t11; 493 if ($[33] !== t10 || $[34] !== t2) { 494 t11 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("td", { 495 className: "campaigns-table__actions-col text-end", 496 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("div", { 497 className: "h-table__actions", 498 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)(DropdownMenu, { children: [t2, t10] }) 499 }) 500 }); 501 $[33] = t10; 502 $[34] = t2; 503 $[35] = t11; 504 } else t11 = $[35]; 505 return t11; 506} 507function CampaignRow(t0) { 508 const $ = (0, import_compiler_runtime$8.c)(56); 509 const { campaign, insights, insightsResolved, sharedWorkspace, labels } = t0; 510 const t1 = campaign.recoversAt ?? void 0; 511 let t2; 512 if ($[0] !== campaign.abTesting) { 513 t2 = campaign.abTesting && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Tag, { 514 size: "none", 515 variant: "info", 516 label: campaign.abTesting.label, 517 title: campaign.abTesting.tooltip, 518 "data-controller": "tooltip", 519 "data-bs-container": "body" 520 }); 521 $[0] = campaign.abTesting; 522 $[1] = t2; 523 } else t2 = $[1]; 524 let t3; 525 if ($[2] !== campaign.name || $[3] !== t2) { 526 t3 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("strong", { 527 className: "campaigns-table__name", 528 children: [t2, campaign.name] 529 }); 530 $[2] = campaign.name; 531 $[3] = t2; 532 $[4] = t3; 533 } else t3 = $[4]; 534 let t4; 535 if ($[5] !== campaign.href || $[6] !== t3) { 536 t4 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("a", { 537 href: campaign.href, 538 className: "campaigns-table__name-link", 539 children: t3 540 }); 541 $[5] = campaign.href; 542 $[6] = t3; 543 $[7] = t4; 544 } else t4 = $[7]; 545 let t5; 546 if ($[8] !== campaign.senders) {
547 t5 = campaign.senders && /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)(import_jsx_runtime$8.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("span", { 548 "data-bs-toggle": "tooltip", 549 "data-bs-html": "true", 550 title: campaign.senders.tooltipHtml, 551 "data-bs-custom-class": "email-accounts-tooltip", 552 children: [" · ", campaign.senders.label] 553 }), campaign.senders.overRateLimit && campaign.senders.capacityUrl && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("button", { 554 type: "button", 555 className: "campaigns-table__sender-limit-info", 556 "data-controller": "stop-propagation lazy-popover", 557 "data-lazy-popover-url-value": campaign.senders.capacityUrl, 558 "data-lazy-popover-sanitize-value": "false", 559 "data-action": "mouseenter->lazy-popover#onEnter mouseleave->lazy-popover#onLeave focusin->lazy-popover#onEnter focusout->lazy-popover#onLeave", 560 "data-bs-html": "true", 561 "data-bs-placement": "bottom", 562 "data-bs-custom-class": "sender-capacity-popover", 563 "aria-label": campaign.senders.capacityLabel, 564 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(Icon, { 565 icon: "info-circle", 566 variant: "regular", 567 size: "sm", 568 "aria-hidden": "true" 569 }) 570 })] }); 571 $[8] = campaign.senders; 572 $[9] = t5; 573 } else t5 = $[9]; 574 let t6; 575 if ($[10] !== campaign.recipientsLabel || $[11] !== t5) { 576 t6 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("div", { 577 className: "campaigns-table__details", 578 children: [campaign.recipientsLabel, t5] 579 }); 580 $[10] = campaign.recipientsLabel; 581 $[11] = t5; 582 $[12] = t6; 583 } else t6 = $[12]; 584 let t7; 585 if ($[13] !== t4 || $[14] !== t6) { 586 t7 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("td", { 587 className: "campaigns-table__name-col", 588 children: [t4, t6] 589 }); 590 $[13] = t4; 591 $[14] = t6; 592 $[15] = t7; 593 } else t7 = $[15]; 594 let t8; 595 if ($[16] !== campaign.owner || $[17] !== sharedWorkspace) { 596 t8 = sharedWorkspace && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("td", { children: campaign.owner && /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(OwnerAvatar, { owner: campaign.owner }) }); 597 $[16] = campaign.owner; 598 $[17] = sharedWorkspace; 599 $[18] = t8; 600 } else t8 = $[18]; 601 let t9; 602 if ($[19] !== campaign) { 603 t9 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(StatusBadge, { campaign }) }); 604 $[19] = campaign; 605 $[20] = t9; 606 } else t9 = $[20]; 607 let t10; 608 if ($[21] !== campaign.currentState.frameId || $[22] !== campaign.currentState.html) { 609 t10 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("td", { 610 className: "hidden-xs", 611 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(TurboFrameIsland, { 612 id: campaign.currentState.frameId, 613 innerHtml: campaign.currentState.html 614 }) 615 }); 616 $[21] = campaign.currentState.frameId; 617 $[22] = campaign.currentState.html; 618 $[23] = t10; 619 } else t10 = $[23]; 620 let t11; 621 if ($[24] !== campaign.createdAt) { 622 t11 = campaign.createdAt ? /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("span", { 623 "data-bs-toggle": "tooltip", 624 "data-bs-placement": "top", 625 title: campaign.createdAt.full, 626 children: campaign.createdAt.relative 627 }) : "-"; 628 $[24] = campaign.createdAt; 629 $[25] = t11; 630 } else t11 = $[25]; 631 let t12; 632 if ($[26] !== t11) { 633 t12 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("td", { 634 className: "hidden-xs", 635 children: t11 636 }); 637 $[26] = t11; 638 $[27] = t12; 639 } else t12 = $[27]; 640 let t13; 641 if ($[28] !== campaign.progression.preparing || $[29] !== campaign.progression.steps || $[30] !== campaign.progression.tooltipHtml) { 642 t13 = campaign.progression.preparing ? "-" : /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("div", { 643 className: "campaign-progression-indicator", 644 "data-bs-toggle": "tooltip", 645 title: campaign.progression.tooltipHtml ?? void 0, 646 "data-bs-html": "true", 647 "data-bs-custom-class": "campaign-progression-tooltip", 648 children: campaign.progression.steps.map(_temp3) 649 }); 650 $[28] = campaign.progression.preparing; 651 $[29] = campaign.progression.steps; 652 $[30] = campaign.progression.tooltipHtml; 653 $[31] = t13; 654 } else t13 = $[31]; 655 let t14; 656 if ($[32] !== t13) { 657 t14 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("td", { 658 className: "hidden-xs", 659 children: t13 660 }); 661 $[32] = t13; 662 $[33] = t14; 663 } else t14 = $[33]; 664 let t15; 665 if ($[34] !== campaign.showsInsights || $[35] !== insights || $[36] !== insightsResolved || $[37] !== labels) { 666 t15 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("td", { 667 className: "email-statistics-column hidden-xs hidden-sm", 668 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(CampaignInsights, { 669 showsInsights: campaign.showsInsights, 670 resolved: insightsResolved, 671 insights, 672 labels 673 }) 674 }); 675 $[34] = campaign.showsInsights; 676 $[35] = insights; 677 $[36] = insightsResolved; 678 $[37] = labels; 679 $[38] = t15; 680 } else t15 = $[38]; 681 let t16; 682 if ($[39] !== campaign || $[40] !== labels) { 683 t16 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)(RowActions, { 684 campaign, 685 labels 686 }); 687 $[39] = campaign; 688 $[40] = labels; 689 $[41] = t16; 690 } else t16 = $[41]; 691 let t17; 692 if ($[42] !== campaign.href || $[43] !== campaign.id || $[44] !== campaign.pauseReason || $[45] !== campaign.status || $[46] !== t1 || $[47] !== t10 || $[48] !== t12 || $[49] !== t14 || $[50] !== t15 || $[51] !== t16 || $[52] !== t7 || $[53] !== t8 || $[54] !== t9) { 693 t17 = /* @__PURE__ */ (0, import_jsx_runtime$8.jsxs)("tr", { 694 className: "h-table__row-link", 695 "data-campaign-id": campaign.id, 696 "data-campaign-status": campaign.status, 697 "data-campaign-pause-reason": campaign.pauseReason,
698 "data-campaign-recovers-at": t1, 699 "data-action": "click->table-link#openPage", 700 "data-href": campaign.href, 701 children: [ 702 t7, 703 t8, 704 t9, 705 t10, 706 t12, 707 t14, 708 t15, 709 t16 710 ] 711 }); 712 $[42] = campaign.href; 713 $[43] = campaign.id; 714 $[44] = campaign.pauseReason; 715 $[45] = campaign.status; 716 $[46] = t1; 717 $[47] = t10; 718 $[48] = t12; 719 $[49] = t14; 720 $[50] = t15; 721 $[51] = t16; 722 $[52] = t7; 723 $[53] = t8; 724 $[54] = t9; 725 $[55] = t17; 726 } else t17 = $[55]; 727 return t17; 728} 729function _temp3(step, index) { 730 return /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("div", { 731 className: "campaign-progression-indicator__step", 732 children: /* @__PURE__ */ (0, import_jsx_runtime$8.jsx)("div", { 733 className: "campaign-progression-indicator__track", 734 style: { width: `${step.pct}%` } 735 }) 736 }, index); 737} 738var import_compiler_runtime$8, import_jsx_runtime$8; 739function init_CampaignRow() { 740 return (init_CampaignRow = __esmMin((() => { 741 import_compiler_runtime$8 = require_compiler_runtime(); 742 init_button(); 743 init_dropdown_menu(); 744 init_icon(); 745 init_tag(); 746 init_CampaignInsights(); 747 import_jsx_runtime$8 = require_jsx_runtime(); 748 })))(); 749} 750//#endregion 751//#region app/frontend/pages/Sequences/useCampaignStatusPoll.ts 752function recovered(campaign) { 753 return campaign.recoversAt != null && Date.parse(campaign.recoversAt) <= Date.now(); 754} 755function snapshotOf(campaigns) { 756 return campaigns.map((campaign) => ({ 757 id: campaign.id, 758 status: campaign.status, 759 pauseReason: campaign.pauseReason, 760 recoversAt: campaign.recoversAt 761 })); 762} 763function useCampaignStatusPoll(campaigns, insightsResolved) { 764 const snapshotKey = JSON.stringify(snapshotOf(campaigns)); 765 (0, import_react$5.useEffect)(() => { 766 const localRows = JSON.parse(snapshotKey); 767 if (localRows.length === 0) return; 768 let cancelled = false; 769 let pollTimeoutId = 0; 770 let reloadWatchdogId = 0; 771 let cancelReload = null; 772 const ids = localRows.map((row) => row.id).join(","); 773 function schedulePoll() { 774 if (!cancelled) pollTimeoutId = window.setTimeout(poll, POLL_MS); 775 } 776 async function poll() { 777 let changed = false; 778 try { 779 const response = await fetch(sequences_path({ 780 format: "json", 781 ids 782 })); 783 if (!response.ok || cancelled) { 784 schedulePoll(); 785 return; 786 } 787 const remote = await response.json(); 788 if (cancelled) return; 789 const localById = new Map(localRows.map((row_0) => [row_0.id, row_0])); 790 changed = remote.some((row_1) => { 791 const local = localById.get(row_1.id); 792 if (!local) return false; 793 return local.status !== row_1.status || local.pauseReason !== row_1.pause_reason || recovered(local); 794 }); 795 } catch { 796 schedulePoll(); 797 return; 798 } 799 if (!changed) { 800 schedulePoll(); 801 return; 802 } 803 let settled = false; 804 const settleReload = () => { 805 if (settled) return; 806 settled = true; 807 window.clearTimeout(reloadWatchdogId); 808 cancelReload = null; 809 schedulePoll(); 810 }; 811 const recoverReload = () => { 812 const cancel = cancelReload; 813 settleReload(); 814 cancel?.(); 815 }; 816 reloadWatchdogId = window.setTimeout(recoverReload, RELOAD_WATCHDOG_MS); 817 router.reload({ 818 only: insightsResolved ? ["campaigns", "insights"] : ["campaigns"], 819 onCancelToken: (token) => { 820 cancelReload = () => token.cancel(); 821 }, 822 onFinish: settleReload 823 }); 824 } 825 schedulePoll(); 826 return () => { 827 cancelled = true; 828 window.clearTimeout(pollTimeoutId); 829 window.clearTimeout(reloadWatchdogId); 830 const cancel_0 = cancelReload; 831 cancelReload = null; 832 cancel_0?.(); 833 }; 834 }, [snapshotKey, insightsResolved]); 835} 836var import_react$5, POLL_MS, RELOAD_WATCHDOG_MS; 837function init_useCampaignStatusPoll() { 838 return (init_useCampaignStatusPoll = __esmMin((() => { 839 import_react$5 = require_react(); 840 init_dist$1(); 841 init_routes(); 842 POLL_MS = 5e3; 843 RELOAD_WATCHDOG_MS = POLL_MS * 6; 844 })))(); 845} 846//#endregion 847//#region app/frontend/pages/Sequences/CampaignsTable.tsx 848function SortHeader(t0) { 849 const $ = (0, import_compiler_runtime$7.c)(17); 850 const { column, label, sort, className } = t0; 851 let t1; 852 if ($[0] !== column || $[1] !== sort.urls) { 853 let t2; 854 if ($[3] !== column) { 855 t2 = (entry) => entry.name === column; 856 $[3] = column; 857 $[4] = t2; 858 } else t2 = $[4]; 859 t1 = sort.urls.find(t2); 860 $[0] = column; 861 $[1] = sort.urls; 862 $[2] = t1; 863 } else t1 = $[2]; 864 const url = t1; 865 const active = sort.column === column; 866 const href = !url ? "#" : active && sort.direction !== "desc" ? url.desc : url.asc; 867 const icon = !active ? "sort" : sort.direction === "desc" ? "sort-down" : "sort-up"; 868 const t2 = active && "active-sort"; 869 let t3; 870 if ($[5] !== className || $[6] !== t2) { 871 t3 = cn(t2, className); 872 $[5] = className; 873 $[6] = t2; 874 $[7] = t3; 875 } else t3 = $[7]; 876 let t4; 877 if ($[8] !== icon) { 878 t4 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(Icon, { 879 icon, 880 variant: "solid", 881 "aria-hidden": "true" 882 }); 883 $[8] = icon; 884 $[9] = t4; 885 } else t4 = $[9]; 886 let t5; 887 if ($[10] !== href || $[11] !== label || $[12] !== t4) { 888 t5 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsxs)("a", { 889 className: "h-table__sorting", 890 href, 891 children: [label, t4] 892 }); 893 $[10] = href; 894 $[11] = label; 895 $[12] = t4; 896 $[13] = t5; 897 } else t5 = $[13]; 898 let t6; 899 if ($[14] !== t3 || $[15] !== t5) { 900 t6 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("th", { 901 className: t3, 902 children: t5 903 }); 904 $[14] = t3; 905 $[15] = t5; 906 $[16] = t6; 907 } else t6 = $[16]; 908 return t6; 909}
910function TablePagination(t0) { 911 const $ = (0, import_compiler_runtime$7.c)(15); 912 const { pagination, labels } = t0; 913 if (pagination.total <= pagination.pageSize) return null; 914 let t1; 915 if ($[0] !== pagination.outOfLabel) { 916 t1 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsxs)("span", { children: [" ", pagination.outOfLabel] }); 917 $[0] = pagination.outOfLabel; 918 $[1] = t1; 919 } else t1 = $[1]; 920 let t2; 921 if ($[2] !== pagination.rangeLabel || $[3] !== t1) { 922 t2 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsxs)("div", { 923 className: "elements-count", 924 children: [pagination.rangeLabel, t1] 925 }); 926 $[2] = pagination.rangeLabel; 927 $[3] = t1; 928 $[4] = t2; 929 } else t2 = $[4]; 930 let t3; 931 if ($[5] !== labels.previous || $[6] !== pagination.previousUrl) { 932 t3 = pagination.previousUrl ? /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(Button, { 933 asChild: true, 934 size: "sm", 935 className: "pagination-button", 936 children: /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("a", { 937 href: pagination.previousUrl, 938 children: labels.previous 939 }) 940 }) : /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(Button, { 941 size: "sm", 942 className: "pagination-button", 943 disabled: true, 944 children: labels.previous 945 }); 946 $[5] = labels.previous; 947 $[6] = pagination.previousUrl; 948 $[7] = t3; 949 } else t3 = $[7]; 950 let t4; 951 if ($[8] !== labels.next || $[9] !== pagination.nextUrl) {
952 t4 = pagination.nextUrl ? /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(Button, { 953 asChild: true, 954 size: "sm", 955 className: "pagination-button", 956 children: /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("a", { 957 href: pagination.nextUrl, 958 children: labels.next 959 }) 960 }) : /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(Button, { 961 size: "sm", 962 className: "pagination-button", 963 disabled: true, 964 children: labels.next 965 }); 966 $[8] = labels.next; 967 $[9] = pagination.nextUrl; 968 $[10] = t4; 969 } else t4 = $[10]; 970 let t5; 971 if ($[11] !== t2 || $[12] !== t3 || $[13] !== t4) { 972 t5 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsxs)("div", { 973 className: "box-pagination", 974 children: [ 975 t2, 976 t3, 977 t4 978 ] 979 }); 980 $[11] = t2; 981 $[12] = t3; 982 $[13] = t4; 983 $[14] = t5; 984 } else t5 = $[14]; 985 return t5; 986} 987function CampaignsTable(t0) { 988 const $ = (0, import_compiler_runtime$7.c)(54); 989 const { campaigns, insights, sharedWorkspace, sort, pagination, labels } = t0; 990 const insightsResolved = insights !== void 0; 991 useCampaignStatusPoll(campaigns, insightsResolved); 992 let t1; 993 if ($[0] !== insights) { 994 t1 = new Map((insights ?? []).map(_temp$2)); 995 $[0] = insights; 996 $[1] = t1; 997 } else t1 = $[1]; 998 const insightsById = t1; 999 let t2; 1000 if ($[2] !== labels.name || $[3] !== sort) { 1001 t2 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(SortHeader, { 1002 column: "name", 1003 label: labels.name, 1004 sort 1005 }); 1006 $[2] = labels.name; 1007 $[3] = sort; 1008 $[4] = t2; 1009 } else t2 = $[4]; 1010 let t3; 1011 if ($[5] !== sharedWorkspace) { 1012 t3 = sharedWorkspace && /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("th", {}); 1013 $[5] = sharedWorkspace; 1014 $[6] = t3; 1015 } else t3 = $[6]; 1016 let t4; 1017 if ($[7] !== labels.status || $[8] !== sort) { 1018 t4 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(SortHeader, { 1019 column: "status", 1020 label: labels.status, 1021 sort 1022 }); 1023 $[7] = labels.status; 1024 $[8] = sort; 1025 $[9] = t4; 1026 } else t4 = $[9]; 1027 let t5; 1028 if ($[10] === Symbol.for("react.memo_cache_sentinel")) { 1029 t5 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(Icon, { 1030 icon: "question-circle", 1031 variant: "regular", 1032 className: "question-circle", 1033 "aria-hidden": "true" 1034 }); 1035 $[10] = t5; 1036 } else t5 = $[10]; 1037 let t6; 1038 if ($[11] !== labels.currentState || $[12] !== labels.currentStateTooltip) { 1039 t6 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("th", { 1040 className: "hidden-xs", 1041 children: /* @__PURE__ */ (0, import_jsx_runtime$7.jsxs)("span", { 1042 "data-controller": "tooltip", 1043 title: labels.currentStateTooltip, 1044 children: [labels.currentState, t5] 1045 }) 1046 }); 1047 $[11] = labels.currentState; 1048 $[12] = labels.currentStateTooltip; 1049 $[13] = t6; 1050 } else t6 = $[13]; 1051 let t7; 1052 if ($[14] !== labels.created || $[15] !== sort) { 1053 t7 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(SortHeader, { 1054 column: "created_at", 1055 label: labels.created, 1056 sort, 1057 className: "hidden-xs" 1058 }); 1059 $[14] = labels.created; 1060 $[15] = sort; 1061 $[16] = t7; 1062 } else t7 = $[16]; 1063 let t8; 1064 if ($[17] !== labels.progression) { 1065 t8 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("th", { 1066 className: "hidden-xs", 1067 children: labels.progression 1068 }); 1069 $[17] = labels.progression; 1070 $[18] = t8; 1071 } else t8 = $[18]; 1072 let t9; 1073 if ($[19] !== labels.performance) { 1074 t9 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("th", { 1075 className: "hidden-xs hidden-sm", 1076 children: labels.performance 1077 }); 1078 $[19] = labels.performance; 1079 $[20] = t9; 1080 } else t9 = $[20]; 1081 let t10; 1082 if ($[21] !== labels.actions) { 1083 t10 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("th", { 1084 className: "campaigns-table__actions-col", 1085 children: /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("span", { 1086 className: "visually-hidden", 1087 children: labels.actions 1088 }) 1089 }); 1090 $[21] = labels.actions; 1091 $[22] = t10; 1092 } else t10 = $[22]; 1093 let t11; 1094 if ($[23] !== t10 || $[24] !== t2 || $[25] !== t3 || $[26] !== t4 || $[27] !== t6 || $[28] !== t7 || $[29] !== t8 || $[30] !== t9) { 1095 t11 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("thead", { 1096 className: "h-table__heading", 1097 children: /* @__PURE__ */ (0, import_jsx_runtime$7.jsxs)("tr", { children: [ 1098 t2, 1099 t3, 1100 t4, 1101 t6, 1102 t7, 1103 t8, 1104 t9, 1105 t10 1106 ] }) 1107 }); 1108 $[23] = t10; 1109 $[24] = t2; 1110 $[25] = t3; 1111 $[26] = t4; 1112 $[27] = t6; 1113 $[28] = t7; 1114 $[29] = t8; 1115 $[30] = t9; 1116 $[31] = t11; 1117 } else t11 = $[31]; 1118 let t12; 1119 if ($[32] !== campaigns || $[33] !== insightsById || $[34] !== insightsResolved || $[35] !== labels || $[36] !== sharedWorkspace) { 1120 let t13; 1121 if ($[38] !== insightsById || $[39] !== insightsResolved || $[40] !== labels || $[41] !== sharedWorkspace) { 1122 t13 = (campaign) => /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(CampaignRow, { 1123 campaign, 1124 insights: insightsById.get(campaign.id), 1125 insightsResolved, 1126 sharedWorkspace, 1127 labels 1128 }, campaign.id); 1129 $[38] = insightsById; 1130 $[39] = insightsResolved; 1131 $[40] = labels; 1132 $[41] = sharedWorkspace; 1133 $[42] = t13; 1134 } else t13 = $[42]; 1135 t12 = campaigns.map(t13); 1136 $[32] = campaigns; 1137 $[33] = insightsById; 1138 $[34] = insightsResolved; 1139 $[35] = labels; 1140 $[36] = sharedWorkspace; 1141 $[37] = t12; 1142 } else t12 = $[37]; 1143 let t13; 1144 if ($[43] !== t12) { 1145 t13 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("tbody", { children: t12 }); 1146 $[43] = t12; 1147 $[44] = t13; 1148 } else t13 = $[44]; 1149 let t14; 1150 if ($[45] !== t11 || $[46] !== t13) { 1151 t14 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsxs)("table", { 1152 "data-controller": "table-link", 1153 children: [t11, t13] 1154 }); 1155 $[45] = t11; 1156 $[46] = t13; 1157 $[47] = t14; 1158 } else t14 = $[47]; 1159 let t15; 1160 if ($[48] !== labels || $[49] !== pagination) { 1161 t15 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)("div", { 1162 className: "h-table__footer", 1163 children: /* @__PURE__ */ (0, import_jsx_runtime$7.jsx)(TablePagination, { 1164 pagination, 1165 labels 1166 }) 1167 }); 1168 $[48] = labels; 1169 $[49] = pagination; 1170 $[50] = t15; 1171 } else t15 = $[50]; 1172 let t16; 1173 if ($[51] !== t14 || $[52] !== t15) { 1174 t16 = /* @__PURE__ */ (0, import_jsx_runtime$7.jsxs)("div", { 1175 className: "h-table h-table--full campaigns-table mt-4", 1176 children: [t14, t15] 1177 }); 1178 $[51] = t14; 1179 $[52] = t15; 1180 $[53] = t16; 1181 } else t16 = $[53]; 1182 return t16; 1183} 1184function _temp$2(entry) { 1185 return [entry.id, entry]; 1186} 1187var import_compiler_runtime$7, import_jsx_runtime$7; 1188function init_CampaignsTable() { 1189 return (init_CampaignsTable = __esmMin((() => { 1190 import_compiler_runtime$7 = require_compiler_runtime(); 1191 init_button(); 1192 init_icon(); 1193 init_utils(); 1194 init_CampaignRow(); 1195 init_useCampaignStatusPoll(); 1196 import_jsx_runtime$7 = require_jsx_runtime(); 1197 })))(); 1198} 1199//#endregion 1200//#region app/frontend/images/empty_states/campaigns.svg 1201var campaigns_default; 1202function init_campaigns() { 1203 return (init_campaigns = __esmMin((() => {
1204 campaigns_default = "/assets/campaigns-ClElyETR.svg"; 1205 })))(); 1206} 1207//#endregion 1208//#region app/frontend/pages/Sequences/EmptyState.tsx 1209function SequencesEmptyState(t0) { 1210 const $ = (0, import_compiler_runtime$6.c)(17); 1211 const { emptyState, sequencesPath, labels } = t0; 1212 if (emptyState.kind === "none") return null; 1213 let t1; 1214 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 1215 t1 = /* @__PURE__ */ (0, import_jsx_runtime$6.jsx)(EmptyStateImage, { children: /* @__PURE__ */ (0, import_jsx_runtime$6.jsx)("img", { 1216 src: campaigns_default, 1217 alt: "" 1218 }) }); 1219 $[0] = t1; 1220 } else t1 = $[0]; 1221 let t2; 1222 if ($[1] !== emptyState.title) { 1223 t2 = /* @__PURE__ */ (0, import_jsx_runtime$6.jsx)(EmptyStateTitle, { children: emptyState.title }); 1224 $[1] = emptyState.title; 1225 $[2] = t2; 1226 } else t2 = $[2]; 1227 let t3; 1228 if ($[3] !== emptyState.subtitle) { 1229 t3 = /* @__PURE__ */ (0, import_jsx_runtime$6.jsx)("p", { children: emptyState.subtitle }); 1230 $[3] = emptyState.subtitle; 1231 $[4] = t3; 1232 } else t3 = $[4]; 1233 let t4; 1234 if ($[5] !== emptyState.clearHref || $[6] !== emptyState.kind || $[7] !== emptyState.tutorialHref || $[8] !== emptyState.tutorialLabel || $[9] !== labels.clearFilters || $[10] !== labels.new || $[11] !== sequencesPath) { 1235 t4 = /* @__PURE__ */ (0, import_jsx_runtime$6.jsx)(EmptyStateActions, { children: emptyState.kind === "filtered" ? /* @__P
1235URE__ */ (0, import_jsx_runtime$6.jsx)(Button, { 1236 asChild: true, 1237 size: "sm", 1238 children: /* @__PURE__ */ (0, import_jsx_runtime$6.jsx)("a", { 1239 href: emptyState.clearHref, 1240 children: labels.clearFilters 1241 }) 1242 }) : /* @__PURE__ */ (0, import_jsx_runtime$6.jsxs)(import_jsx_runtime$6.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime$6.jsxs)("form", { 1243 action: sequencesPath, 1244 method: "post", 1245 children: [/* @__PURE__ */ (0, import_jsx_runtime$6.jsx)("input", { 1246 type: "hidden", 1247 name: "authenticity_token", 1248 value: getCsrfToken() 1249 }), /* @__PURE__ */ (0, import_jsx_runtime$6.jsxs)(Button, { 1250 type: "submit", 1251 variant: "primary", 1252 size: "sm", 1253 children: [/* @__PURE__ */ (0, import_jsx_runtime$6.jsx)(Icon, { 1254 icon: "plus", 1255 "aria-hidden": "true" 1256 }), labels.new] 1257 })] 1258 }), /* @__PURE__ */ (0, import_jsx_runtime$6.jsx)(Button, { 1259 asChild: true, 1260 size: "sm", 1261 children: /* @__PURE__ */ (0, import_jsx_runtime$6.jsxs)("a", { 1262 href: emptyState.tutorialHref, 1263 target: "_blank", 1264 rel: "noreferrer", 1265 children: [/* @__PURE__ */ (0, import_jsx_runtime$6.jsx)(Icon, { 1266 icon: "question-circle", 1267 variant: "regular" 1268 }), emptyState.tutorialLabel] 1269 }) 1270 })] }) }); 1271 $[5] = emptyState.clearHref; 1272 $[6] = emptyState.kind; 1273 $[7] = emptyState.tutorialHref; 1274 $[8] = emptyState.tutorialLabel; 1275 $[9] = labels.clearFilters; 1276 $[10] = labels.new; 1277 $[11] = sequencesPath; 1278 $[12] = t4; 1279 } else t4 = $[12]; 1280 let t5; 1281 if ($[13] !== t2 || $[14] !== t3 || $[15] !== t4) { 1282 t5 = /* @__PURE__ */ (0, import_jsx_runtime$6.jsxs)(EmptyState, { children: [t1, /* @__PURE__ */ (0, import_jsx_runtime$6.jsxs)(EmptyStateContent, { children: [ 1283 t2, 1284 t3, 1285 t4 1286 ] })] }); 1287 $[13] = t2; 1288 $[14] = t3; 1289 $[15] = t4; 1290 $[16] = t5; 1291 } else t5 = $[16]; 1292 return t5; 1293} 1294var import_compiler_runtime$6, import_jsx_runtime$6; 1295function init_EmptyState() { 1296 return (init_EmptyState = __esmMin((() => { 1297 import_compiler_runtime$6 = require_compiler_runtime(); 1298 init_utils(); 1299 init_button(); 1300 init_empty_state(); 1301 init_icon(); 1302 init_campaigns(); 1303 import_jsx_runtime$6 = require_jsx_runtime(); 1304 })))(); 1305} 1306//#endregion 1307//#region app/frontend/pages/Sequences/CheckboxFilterDropdown.tsx 1308function CheckboxFilterDropdown(t0) { 1309 const $ = (0, import_compiler_runtime$5.c)(69); 1310 const { name, label, options, selectedValues, applyLabel, selectAllLabel, clearLabel, optionsLabel, removeFilterLabel, onApply } = t0; 1311 const [selection, setSelection] = (0, import_react$4.useState)(selectedValues); 1312 let t1; 1313 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 1314 t1 = function toggle(value) { 1315 setSelection((current) => current.includes(value) ? current.filter((item) => item !== value) : [...current, value]); 1316 }; 1317 $[0] = t1; 1318 } else t1 = $[0]; 1319 const toggle = t1; 1320 let t2; 1321 if ($[1] !== options || $[2] !== selectedValues) { 1322 let t3; 1323 if ($[4] !== selectedValues) { 1324 t3 = (option) => selectedValues.includes(option.value); 1325 $[4] = selectedValues; 1326 $[5] = t3; 1327 } else t3 = $[5]; 1328 t2 = options.filter(t3); 1329 $[1] = options; 1330 $[2] = selectedValues; 1331 $[3] = t2; 1332 } else t2 = $[3]; 1333 const selectedOptions = t2; 1334 const countLabel = `${options.length} ${optionsLabel}`; 1335 let t3; 1336 if ($[6] !== selectedValues) { 1337 t3 = new Set(selectedValues); 1338 $[6] = selectedValues; 1339 $[7] = t3; 1340 } else t3 = $[7]; 1341 const appliedSet = t3; 1342 let t4; 1343 if ($[8] !== appliedSet || $[9] !== selectedValues.length || $[10] !== selection) { 1344 t4 = selection.length === selectedValues.length && selection.every((value_0) => appliedSet.has(value_0)); 1345 $[8] = appliedSet; 1346 $[9] = selectedValues.length; 1347 $[10] = selection; 1348 $[11] = t4; 1349 } else t4 = $[11]; 1350 const applyDisabled = t4; 1351 let t5; 1352 if ($[12] === Symbol.for("react.memo_cache_sentinel")) { 1353 t5 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(Icon, { 1354 icon: "angle-down", 1355 "aria-hidden": "true" 1356 }); 1357 $[12] = t5; 1358 } else t5 = $[12]; 1359 let t6; 1360 if ($[13] !== label) { 1361 t6 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(DropdownMenuTrigger, { 1362 asChild: true, 1363 children: /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)(Button, { 1364 size: "sm", 1365 className: "h-filter__button", 1366 children: [label, t5] 1367 }) 1368 }); 1369 $[13] = label; 1370 $[14] = t6; 1371 } else t6 = $[14]; 1372 let t7; 1373 if ($[15] !== countLabel) { 1374 t7 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)("div", { 1375 className: "dropdown-search-metas__count", 1376 children: /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)("span", { children: countLabel }) 1377 }); 1378 $[15] = countLabel; 1379 $[16] = t7; 1380 } else t7 = $[16]; 1381 let t8; 1382 if ($[17] !== options) { 1383 t8 = () => setSelection(options.map(_temp$1)); 1384 $[17] = options; 1385 $[18] = t8; 1386 } else t8 = $[18]; 1387 let t9; 1388 if ($[19] !== selectAllLabel || $[20] !== t8) { 1389 t9 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(Button, { 1390 variant: "link", 1391 size: "sm", 1392 onClick: t8, 1393 children: selectAllLabel 1394 }); 1395 $[19] = selectAllLabel; 1396 $[20] = t8; 1397 $[21] = t9; 1398 } else t9 = $[21]; 1399 let t10; 1400 if ($[22] === Symbol.for("react.memo_cache_sentinel")) { 1401 t10 = () => setSelection([]); 1402 $[22] = t10; 1403 } else t10 = $[22]; 1404 let t11; 1405 if ($[23] !== clearLabel) { 1406 t11 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(Button, { 1407 variant: "link", 1408 size: "sm", 1409 onClick: t10, 1410 children: clearLabel 1411 }); 1412 $[23] = clearLabel; 1413 $[24] = t11; 1414 } else t11 = $[24]; 1415 let t12; 1416 if ($[25] !== t11 || $[26] !== t9) { 1417 t12 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)("div", { 1418 className: "dropdown-search-metas__actions ml-auto", 1419 children: [t9, t11] 1420 }); 1421 $[25] = t11; 1422 $[26] = t9; 1423 $[27] = t12; 1424 } else t12 = $[27]; 1425 let t13; 1426 if ($[28] !== t12 || $[29] !== t7) { 1427 t13 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)("div", { 1428 className: "dropdown-search-metas", 1429 children: [t7, t12] 1430 }); 1431 $[28] = t12; 1432 $[29] = t7; 1433 $[30] = t13; 1434 } else t13 = $[30]; 1435 const t14 = options.length >= 10 ? "dropdown-menu__list--scrollable" : void 0; 1436 let t15; 1437 if ($[31] !== name || $[32] !== options || $[33] !== selection) { 1438 let t16; 1439 if ($[35] !== name || $[36] !== selection) { 1440 t16 = (option_1) => /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)("li", { 1441 className: "dropdown-item", 1442 children: [/* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(Checkbox, { 1443 id: `filter-${name}-${option_1.value}`, 1444 checked: selection.includes(option_1.value), 1445 onChange: () => toggle(option_1.value) 1446 }
1446), /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)("label", { 1447 htmlFor: `filter-${name}-${option_1.value}`, 1448 children: option_1.label 1449 })] 1450 }, option_1.value); 1451 $[35] = name; 1452 $[36] = selection; 1453 $[37] = t16; 1454 } else t16 = $[37]; 1455 t15 = options.map(t16); 1456 $[31] = name; 1457 $[32] = options; 1458 $[33] = selection; 1459 $[34] = t15; 1460 } else t15 = $[34]; 1461 let t16; 1462 if ($[38] !== t14 || $[39] !== t15) { 1463 t16 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)("ul", { 1464 className: t14, 1465 children: t15 1466 }); 1467 $[38] = t14; 1468 $[39] = t15; 1469 $[40] = t16; 1470 } else t16 = $[40]; 1471 let t17; 1472 if ($[41] !== onApply || $[42] !== selection) { 1473 t17 = () => onApply(selection); 1474 $[41] = onApply; 1475 $[42] = selection; 1476 $[43] = t17; 1477 } else t17 = $[43]; 1478 let t18; 1479 if ($[44] !== applyDisabled || $[45] !== applyLabel || $[46] !== t17) { 1480 t18 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(DropdownMenuSubmit, { 1481 disabled: applyDisabled, 1482 onClick: t17, 1483 children: applyLabel 1484 }); 1485 $[44] = applyDisabled; 1486 $[45] = applyLabel; 1487 $[46] = t17; 1488 $[47] = t18; 1489 } else t18 = $[47]; 1490 let t19; 1491 if ($[48] !== t13 || $[49] !== t16 || $[50] !== t18) { 1492 t19 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(DropdownMenuContent, { 1493 asChild: true, 1494 tabNavigable: true, 1495 children: /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)("div", { children: [ 1496 t13, 1497 t16, 1498 t18 1499 ] }) 1500 }); 1501 $[48] = t13; 1502 $[49] = t16; 1503 $[50] = t18; 1504 $[51] = t19; 1505 } else t19 = $[51]; 1506 let t20; 1507 if ($[52] !== t19 || $[53] !== t6) { 1508 t20 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)(DropdownMenu, { children: [t6, t19] }); 1509 $[52] = t19; 1510 $[53] = t6; 1511 $[54] = t20; 1512 } else t20 = $[54]; 1513 let t21; 1514 if ($[55] !== onApply || $[56] !== optionsLabel || $[57] !== removeFilterLabel || $[58] !== selectedOptions.length) { 1515 t21 = selectedOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)("div", { 1516 className: "h-filter__value", 1517 children: [
1518 /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)("span", { children: selectedOptions.length }), 1519 " ", 1520 optionsLabel, 1521 /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)("button", { 1522 type: "button", 1523 className: "btn-empty h-filter__remove", 1524 "aria-label": removeFilterLabel, 1525 onClick: () => onApply([]), 1526 children: /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(Icon, { icon: "times" }) 1527 }) 1528 ] 1529 }); 1530 $[55] = onApply; 1531 $[56] = optionsLabel; 1532 $[57] = removeFilterLabel; 1533 $[58] = selectedOptions.length; 1534 $[59] = t21; 1535 } else t21 = $[59]; 1536 let t22; 1537 if ($[60] !== onApply || $[61] !== removeFilterLabel || $[62] !== selectedOptions[0] || $[63] !== selectedOptions.length) { 1538 t22 = selectedOptions.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)("div", { 1539 className: "h-filter__value", 1540 children: [/* @__PURE__ */ (0, import_jsx_runtime$5.jsx)("span", { children: selectedOptions[0].label }), /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)("button", { 1541 type: "button", 1542 className: "btn-empty h-filter__remove", 1543 "aria-label": `${removeFilterLabel} ${selectedOptions[0].label}`, 1544 onClick: () => onApply([]), 1545 children: /* @__PURE__ */ (0, import_jsx_runtime$5.jsx)(Icon, { icon: "times" }) 1546 })] 1547 }); 1548 $[60] = onApply; 1549 $[61] = removeFilterLabel; 1550 $[62] = selectedOptions[0]; 1551 $[63] = selectedOptions.length; 1552 $[64] = t22; 1553 } else t22 = $[64]; 1554 let t23; 1555 if ($[65] !== t20 || $[66] !== t21 || $[67] !== t22) { 1556 t23 = /* @__PURE__ */ (0, import_jsx_runtime$5.jsxs)("div", { 1557 className: "h-filter", 1558 children: [ 1559 t20, 1560 t21, 1561 t22 1562 ] 1563 }); 1564 $[65] = t20; 1565 $[66] = t21; 1566 $[67] = t22; 1567 $[68] = t23; 1568 } else t23 = $[68]; 1569 return t23; 1570} 1571function _temp$1(option_0) { 1572 return option_0.value; 1573} 1574var import_compiler_runtime$5, import_react$4, import_jsx_runtime$5; 1575function init_CheckboxFilterDropdown() { 1576 return (init_CheckboxFilterDropdown = __esmMin((() => { 1577 import_compiler_runtime$5 = require_compiler_runtime(); 1578 import_react$4 = require_react(); 1579 init_button(); 1580 init_checkbox(); 1581 init_dropdown_menu(); 1582 init_icon(); 1583 import_jsx_runtime$5 = require_jsx_runtime(); 1584 })))(); 1585} 1586//#endregion 1587//#region app/frontend/pages/Sequences/FiltersBar.tsx 1588function visit(sequencesPath, params) { 1589 const query = Object.fromEntries(Object.entries(params).filter(([, value]) => value != null && value !== "")); 1590 router.get(sequencesPath, query, { 1591 preserveScroll: false, 1592 preserveState: false 1593 }); 1594} 1595function FiltersBar(t0) { 1596 const $ = (0, import_compiler_runtime$4.c)(47); 1597 const { headingHtml, query, filters, filterOptions, sort, hasCampaigns, sharedWorkspace, sequencesPath, labels } = t0; 1598 const [searchValue, setSearchValue] = (0, import_react$3.useState)(query ?? ""); 1599 let t1; 1600 if ($[0] !== filters.emailAccountIds || $[1] !== filters.status || $[2] !== filters.userIds || $[3] !== query || $[4] !== sort.column || $[5] !== sort.direction) { 1601 t1 = function currentParams(t2) { 1602 const overrides = t2 === void 0 ? {} : t2; 1603 return { 1604 sort: sort.column, 1605 direction: sort.direction, 1606 filter: filters.status.length ? filters.status.join("|") : void 0, 1607 email_account_ids: filters.emailAccountIds.length ? filters.emailAccountIds.join("|") : void 0, 1608 user_ids: filters.userIds.length ? filters.userIds.join("|") : void 0, 1609 query: query ?? void 0, 1610 ...overrides 1611 }; 1612 }; 1613 $[0] = filters.emailAccountIds; 1614 $[1] = filters.status; 1615 $[2] = filters.userIds; 1616 $[3] = query; 1617 $[4] = sort.column; 1618 $[5] = sort.direction; 1619 $[6] = t1; 1620 } else t1 = $[6]; 1621 const currentParams = t1; 1622 let t2; 1623 if ($[7] !== headingHtml) { 1624 t2 = /* @__PURE__ */ (0, import_jsx_runtime$4.jsx)("h2", { 1625 className: "main-heading__count", 1626 dangerouslySetInnerHTML: { __html: headingHtml } 1627 }); 1628 $[7] = headingHtml; 1629 $[8] = t2; 1630 } else t2 = $[8]; 1631 let t3; 1632 if ($[9] === Symbol.for("react.memo_cache_sentinel")) { 1633 t3 = /* @__PURE__ */ (0, import_jsx_runtime$4.jsx)("hr", { className: "main-heading__separator" }); 1634 $[9] = t3; 1635 } else t3 = $[9]; 1636 const t4 = labels.searchPlaceholder; 1637 const t5 = labels.searchPlaceholder; 1638 const t6 = labels.clearSearch; 1639 const t7 = Boolean(query); 1640 let t8;
1641 if ($[10] !== currentParams || $[11] !== searchValue || $[12] !== sequencesPath) { 1642 t8 = () => visit(sequencesPath, currentParams({ query: searchValue || void 0 })); 1643 $[10] = currentParams; 1644 $[11] = searchValue; 1645 $[12] = sequencesPath; 1646 $[13] = t8; 1647 } else t8 = $[13]; 1648 let t9; 1649 if ($[14] !== currentParams || $[15] !== sequencesPath) { 1650 t9 = () => visit(sequencesPath, currentParams({ query: void 0 })); 1651 $[14] = currentParams; 1652 $[15] = sequencesPath; 1653 $[16] = t9; 1654 } else t9 = $[16]; 1655 let t10; 1656 if ($[17] !== labels.clearSearch || $[18] !== labels.searchPlaceholder || $[19] !== searchValue || $[20] !== t7 || $[21] !== t8 || $[22] !== t9) { 1657 t10 = /* @__PURE__ */ (0, import_jsx_runtime$4.jsx)(SearchInput, { 1658 id: "query", 1659 name: "query", 1660 value: searchValue, 1661 onChange: setSearchValue, 1662 placeholder: t4, 1663 ariaLabel: t5, 1664 clearAriaLabel: t6, 1665 showReset: t7, 1666 onSubmit: t8, 1667 onClear: t9 1668 }); 1669 $[17] = labels.clearSearch; 1670 $[18] = labels.searchPlaceholder; 1671 $[19] = searchValue; 1672 $[20] = t7; 1673 $[21] = t8; 1674 $[22] = t9; 1675 $[23] = t10; 1676 } else t10 = $[23]; 1677 let t11; 1678 if ($[24] !== currentParams || $[25] !== filterOptions || $[26] !== filters.emailAccountIds || $[27] !== filters.status || $[28] !== filters.userIds || $[29] !== hasCampaigns || $[30] !== labels.applyFilters || $[31] !== labels.clear || $[32] !== labels.emailAccounts || $[33] !== labels.options || $[34] !== labels.removeFilter || $[35] !== labels.selectAll || $[36] !== labels.statusFilter || $[37] !== labels.teamMembers || $[38] !== sequencesPath || $[39] !== sharedWorkspace) {
1679 t11 = hasCampaigns && /* @__PURE__ */ (0, import_jsx_runtime$4.jsxs)(import_jsx_runtime$4.Fragment, { children: [ 1680 /* @__PURE__ */ (0, import_jsx_runtime$4.jsx)(CheckboxFilterDropdown, { 1681 name: "filter", 1682 label: labels.statusFilter, 1683 options: filterOptions.status, 1684 selectedValues: filters.status, 1685 applyLabel: labels.applyFilters, 1686 selectAllLabel: labels.selectAll, 1687 clearLabel: labels.clear, 1688 optionsLabel: labels.options, 1689 removeFilterLabel: labels.removeFilter, 1690 onApply: (values) => visit(sequencesPath, currentParams({ filter: values.join("|") || void 0 })) 1691 }, `filter-${filters.status.join("|")}`), 1692 /* @__PURE__ */ (0, import_jsx_runtime$4.jsx)(CheckboxFilterDropdown, { 1693 name: "email_account_ids", 1694 label: labels.emailAccounts, 1695 options: filterOptions.emailAccounts, 1696 selectedValues: filters.emailAccountIds, 1697 applyLabel: labels.applyFilters, 1698 selectAllLabel: labels.selectAll, 1699 clearLabel: labels.clear, 1700 optionsLabel: labels.options, 1701 removeFilterLabel: labels.removeFilter, 1702 onApply: (values_0) => visit(sequencesPath, currentParams({ email_account_ids: values_0.join("|") || void 0 })) 1703 }, `email_account_ids-${filters.emailAccountIds.join("|")}`), 1704 sharedWorkspace && /* @__PURE__ */ (0, import_jsx_runtime$4.jsx)(CheckboxFilterDropdown, { 1705 name: "user_ids", 1706 label: labels.teamMembers, 1707 options: filterOptions.teamMembers, 1708 selectedValues: filters.userIds, 1709 applyLabel: labels.applyFilters, 1710 selectAllLabel: labels.selectAll, 1711 clearLabel: labels.clear, 1712 optionsLabel: labels.options, 1713 removeFilterLabel: labels.removeFilter, 1714 onApply: (values_1) => visit(sequencesPath, currentParams({ user_ids: values_1.join("|") || void 0 })) 1715 }, `user_ids-${filters.userIds.join("|")}`) 1716 ] }); 1717 $[24] = currentParams; 1718 $[25] = filterOptions; 1719 $[26] = filters.emailAccountIds; 1720 $[27] = filters.status; 1721 $[28] = filters.userIds; 1722 $[29] = hasCampaigns; 1723 $[30] = labels.applyFilters; 1724 $[31] = labels.clear; 1725 $[32] = labels.emailAccounts; 1726 $[33] = labels.options; 1727 $[34] = labels.removeFilter; 1728 $[35] = labels.selectAll; 1729 $[36] = labels.statusFilter; 1730 $[37] = labels.teamMembers; 1731 $[38] = sequencesPath; 1732 $[39] = sharedWorkspace; 1733 $[40] = t11; 1734 } else t11 = $[40]; 1735 let t12; 1736 if ($[41] !== t10 || $[42] !== t11) { 1737 t12 = /* @__PURE__ */ (0, import_jsx_runtime$4.jsxs)("div", { 1738 className: "main-heading__filtering", 1739 children: [t10, t11] 1740 }); 1741 $[41] = t10; 1742 $[42] = t11; 1743 $[43] = t12; 1744 } else t12 = $[43]; 1745 let t13; 1746 if ($[44] !== t12 || $[45] !== t2) { 1747 t13 = /* @__PURE__ */ (0, import_jsx_runtime$4.jsxs)("div", { 1748 className: "main-heading", 1749 children: [ 1750 t2, 1751 t3, 1752 t12 1753 ] 1754 }); 1755 $[44] = t12; 1756 $[45] = t2; 1757 $[46] = t13; 1758 } else t13 = $[46]; 1759 return t13; 1760} 1761var import_compiler_runtime$4, import_react$3, import_jsx_runtime$4; 1762function init_FiltersBar() { 1763 return (init_FiltersBar = __esmMin((() => { 1764 import_compiler_runtime$4 = require_compiler_runtime(); 1765 import_react$3 = require_react(); 1766 init_dist$1(); 1767 init_search_input(); 1768 init_CheckboxFilterDropdown(); 1769 import_jsx_runtime$4 = require_jsx_runtime(); 1770 })))(); 1771} 1772//#endregion 1773//#region app/frontend/pages/Sequences/IndexModals.tsx 1774function RenameModal(t0) { 1775 const $ = (0, import_compiler_runtime$3.c)(35); 1776 const { campaign, labels } = t0; 1777 const rename = campaign.rename; 1778 if (!rename) return null; 1779 let t1; 1780 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 1781 t1 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("input", { 1782 type: "hidden", 1783 name: "_method", 1784 value: "put" 1785 }); 1786 $[0] = t1; 1787 } else t1 = $[0]; 1788 let t2; 1789 if ($[1] === Symbol.for("react.memo_cache_sentinel")) { 1790 t2 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("input", { 1791 type: "hidden", 1792 name: "authenticity_token", 1793 value: getCsrfToken() 1794 }); 1795 $[1] = t2; 1796 } else t2 = $[1]; 1797 let t3; 1798 if ($[2] !== labels.renameTitle) { 1799 t3 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("h2", { 1800 className: "modal-title", 1801 children: labels.renameTitle 1802 }); 1803 $[2] = labels.renameTitle; 1804 $[3] = t3; 1805 } else t3 = $[3]; 1806 let t4; 1807 if ($[4] === Symbol.for("react.memo_cache_sentinel")) { 1808 t4 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("span", { 1809 "aria-hidden": "true", 1810 children: "×" 1811 }); 1812 $[4] = t4; 1813 } else t4 = $[4]; 1814 let t5; 1815 if ($[5] !== labels.close) { 1816 t5 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("button", { 1817 type: "button",
1818 className: "modal-close", 1819 "data-bs-dismiss": "modal", 1820 "aria-label": labels.close, 1821 children: t4 1822 }); 1823 $[5] = labels.close; 1824 $[6] = t5; 1825 } else t5 = $[6]; 1826 let t6; 1827 if ($[7] !== t3 || $[8] !== t5) { 1828 t6 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 1829 className: "modal-header", 1830 children: [t3, t5] 1831 }); 1832 $[7] = t3; 1833 $[8] = t5; 1834 $[9] = t6; 1835 } else t6 = $[9]; 1836 let t7; 1837 if ($[10] !== labels.renameLabel || $[11] !== rename.fieldId) { 1838 t7 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Label, { 1839 htmlFor: rename.fieldId, 1840 children: labels.renameLabel 1841 }); 1842 $[10] = labels.renameLabel; 1843 $[11] = rename.fieldId; 1844 $[12] = t7; 1845 } else t7 = $[12]; 1846 let t8; 1847 if ($[13] !== rename.fieldId || $[14] !== rename.name) { 1848 t8 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Input, { 1849 id: rename.fieldId, 1850 name: "campaign[name]", 1851 className: "h-input--block", 1852 defaultValue: rename.name, 1853 required: true 1854 }); 1855 $[13] = rename.fieldId; 1856 $[14] = rename.name; 1857 $[15] = t8; 1858 } else t8 = $[15]; 1859 let t9; 1860 if ($[16] !== t7 || $[17] !== t8) { 1861 t9 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 1862 className: "modal-body", 1863 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 1864 className: "form-group", 1865 children: [t7, t8] 1866 }) 1867 }); 1868 $[16] = t7; 1869 $[17] = t8; 1870 $[18] = t9; 1871 } else t9 = $[18]; 1872 let t10; 1873 if ($[19] !== labels.cancel) { 1874 t10 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Button, { 1875 type: "button", 1876 "data-bs-dismiss": "modal", 1877 children: labels.cancel 1878 }); 1879 $[19] = labels.cancel; 1880 $[20] = t10; 1881 } else t10 = $[20]; 1882 let t11; 1883 if ($[21] !== labels.update || $[22] !== labels.updating) { 1884 t11 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Button, { 1885 type: "submit", 1886 variant: "primary", 1887 "data-loading": labels.updating, 1888 children: labels.update 1889 }); 1890 $[21] = labels.update; 1891 $[22] = labels.updating; 1892 $[23] = t11; 1893 } else t11 = $[23]; 1894 let t12; 1895 if ($[24] !== t10 || $[25] !== t11) { 1896 t12 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 1897 className: "modal-footer", 1898 children: [t10, t11] 1899 }); 1900 $[24] = t10; 1901 $[25] = t11; 1902 $[26] = t12; 1903 } else t12 = $[26]; 1904 let t13; 1905 if ($[27] !== rename.path || $[28] !== t12 || $[29] !== t6 || $[30] !== t9) { 1906 t13 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 1907 className: "modal-dialog", 1908 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 1909 className: "modal-content", 1910 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("form", { 1911 action: rename.path, 1912 method: "post", 1913 children: [ 1914 t1, 1915 t2, 1916 t6, 1917 t9, 1918 t12 1919 ] 1920 }) 1921 }) 1922 }); 1923 $[27] = rename.path; 1924 $[28] = t12; 1925 $[29] = t6; 1926 $[30] = t9; 1927 $[31] = t13; 1928 } else t13 = $[31]; 1929 let t14; 1930 if ($[32] !== rename.id || $[33] !== t13) { 1931 t14 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 1932 className: "modal fade", 1933 id: rename.id, 1934 children: t13 1935 }); 1936 $[32] = rename.id; 1937 $[33] = t13; 1938 $[34] = t14; 1939 } else t14 = $[34]; 1940 return t14; 1941} 1942function ArchiveModal(t0) { 1943 const $ = (0, import_compiler_runtime$3.c)(27); 1944 const { campaign, labels } = t0; 1945 const archive = campaign.archive; 1946 if (!archive) return null; 1947 let t1; 1948 if ($[0] !== archive.title) { 1949 t1 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("h2", { 1950 className: "modal-title", 1951 children: archive.title 1952 }); 1953 $[0] = archive.title; 1954 $[1] = t1; 1955 } else t1 = $[1]; 1956 let t2; 1957 if ($[2] === Symbol.for("react.memo_cache_sentinel")) { 1958 t2 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("button", { 1959 type: "button", 1960 className: "modal-close", 1961 "data-bs-dismiss": "modal", 1962 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("span", { children: "×" }) 1963 }); 1964 $[2] = t2; 1965 } else t2 = $[2]; 1966 let t3; 1967 if ($[3] !== t1) { 1968 t3 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 1969 className: "modal-header", 1970 children: [t1, t2] 1971 }); 1972 $[3] = t1; 1973 $[4] = t3; 1974 } else t3 = $[4]; 1975 let t4; 1976 if ($[5] !== archive.pendingNoticeHtml) { 1977 t4 = archive.pendingNoticeHtml && /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("span", { dangerouslySetInnerHTML: { __html: archive.pendingNoticeHtml } }); 1978 $[5] = archive.pendingNoticeHtml; 1979 $[6] = t4; 1980 } else t4 = $[6]; 1981 let t5; 1982 if ($[7] !== archive.noGoingBackHtml) { 1983 t5 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("span", { dangerouslySetInnerHTML: { __html: archive.noGoingBackHtml } }); 1984 $[7] = archive.noGoingBackHtml; 1985 $[8] = t5; 1986 } else t5 = $[8]; 1987 let t6; 1988 if ($[9] !== t4 || $[10] !== t5) { 1989 t6 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", {
1990 className: "modal-body", 1991 children: [t4, t5] 1992 }); 1993 $[9] = t4; 1994 $[10] = t5; 1995 $[11] = t6; 1996 } else t6 = $[11]; 1997 let t7; 1998 if ($[12] !== labels.cancel) { 1999 t7 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Button, { 2000 type: "button", 2001 "data-bs-dismiss": "modal", 2002 children: labels.cancel 2003 }); 2004 $[12] = labels.cancel; 2005 $[13] = t7; 2006 } else t7 = $[13]; 2007 let t8; 2008 if ($[14] !== archive.archivePath || $[15] !== labels.archive) { 2009 t8 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Button, { 2010 variant: "primary", 2011 asChild: true, 2012 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("a", { 2013 href: archive.archivePath, 2014 "data-turbo-method": "post", 2015 children: labels.archive 2016 }) 2017 }); 2018 $[14] = archive.archivePath; 2019 $[15] = labels.archive; 2020 $[16] = t8; 2021 } else t8 = $[16]; 2022 let t9; 2023 if ($[17] !== t7 || $[18] !== t8) { 2024 t9 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 2025 className: "modal-footer", 2026 children: [t7, t8] 2027 }); 2028 $[17] = t7; 2029 $[18] = t8; 2030 $[19] = t9; 2031 } else t9 = $[19]; 2032 let t10; 2033 if ($[20] !== t3 || $[21] !== t6 || $[22] !== t9) { 2034 t10 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 2035 className: "modal-dialog", 2036 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 2037 className: "modal-content", 2038 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("form", { children: [ 2039 t3, 2040 t6, 2041 t9 2042 ] }) 2043 }) 2044 }); 2045 $[20] = t3; 2046 $[21] = t6; 2047 $[22] = t9; 2048 $[23] = t10; 2049 } else t10 = $[23]; 2050 let t11; 2051 if ($[24] !== archive.id || $[25] !== t10) { 2052 t11 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 2053 className: "modal fade", 2054 id: archive.id, 2055 children: t10 2056 }); 2057 $[24] = archive.id; 2058 $[25] = t10; 2059 $[26] = t11; 2060 } else t11 = $[26]; 2061 return t11; 2062} 2063function ProvisioningWarmupModal(t0) { 2064 const $ = (0, import_compiler_runtime$3.c)(34); 2065 const { modal } = t0; 2066 let t1; 2067 if ($[0] !== modal.newLabel) { 2068 t1 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Tag, { 2069 label: modal.newLabel, 2070 variant: "info" 2071 }); 2072 $[0] = modal.newLabel; 2073 $[1] = t1; 2074 } else t1 = $[1]; 2075 let t2; 2076 if ($[2] !== modal.provisioningTitle) { 2077 t2 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("h2", { 2078 className: "text-md-medium mb-2 mt-4", 2079 children: modal.provisioningTitle 2080 }); 2081 $[2] = modal.provisioningTitle; 2082 $[3] = t2; 2083 } else t2 = $[3]; 2084 let t3; 2085 if ($[4] !== modal.provisioningHtml) { 2086 t3 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("p", { 2087 className: "text-sm text-body-secondary", 2088 dangerouslySetInnerHTML: { __html: modal.provisioningHtml } 2089 }); 2090 $[4] = modal.provisioningHtml; 2091 $[5] = t3; 2092 } else t3 = $[5]; 2093 let t4; 2094 if ($[6] === Symbol.for("react.memo_cache_sentinel")) { 2095 t4 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Separator, { 2096 variant: "light", 2097 className: "my-8" 2098 }); 2099 $[6] = t4; 2100 } else t4 = $[6]; 2101 let t5; 2102 if ($[7] !== modal.warmupTitle) { 2103 t5 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("h2", { 2104 className: "text-md-medium mb-2", 2105 children: modal.warmupTitle 2106 }); 2107 $[7] = modal.warmupTitle; 2108 $[8] = t5; 2109 } else t5 = $[8]; 2110 let t6; 2111 if ($[9] !== modal.warmupHtml) { 2112 t6 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("p", { 2113 className: "text-sm text-body-secondary", 2114 dangerouslySetInnerHTML: { __html: modal.warmupHtml } 2115 }); 2116 $[9] = modal.warmupHtml; 2117 $[10] = t6; 2118 } else t6 = $[10]; 2119 let t7; 2120 if ($[11] !== modal.gotIt) { 2121 t7 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Button, { 2122 type: "button", 2123 variant: "primary", 2124 "data-action": "components--alert#close", 2125 children: modal.gotIt 2126 }); 2127 $[11] = modal.gotIt; 2128 $[12] = t7; 2129 } else t7 = $[12]; 2130 let t8; 2131 if ($[13] !== modal.learnMore || $[14] !== modal.learnMoreHref) { 2132 t8 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(Button, { 2133 asChild: true, 2134 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("a", { 2135 href: modal.learnMoreHref, 2136 target: "_blank", 2137 rel: "noopener noreferrer", 2138 children: modal.learnMore 2139 }) 2140 }); 2141 $[13] = modal.learnMore; 2142 $[14] = modal.learnMoreHref; 2143 $[15] = t8; 2144 } else t8 = $[15]; 2145 let t9; 2146 if ($[16] !== t7 || $[17] !== t8) { 2147 t9 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 2148 className: "d-flex gap-2 mt-10", 2149 children: [t7, t8] 2150 }); 2151 $[16] = t7; 2152 $[17] = t8; 2153 $[18] = t9; 2154 } else t9 = $[18]; 2155 let t10; 2156 if ($[19] !== t1 || $[20] !== t2 || $[21] !== t3 || $[22] !== t5 || $[23] !== t6 || $[24] !== t9) { 2157 t10 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 2158 className: "col-12 col-md-5", 2159 children: [ 2160 t1, 2161 t2, 2162 t3, 2163 t4, 2164 t5, 2165 t6, 2166 t9 2167 ] 2168 }); 2169 $[19] = t1; 2170 $[20] = t2; 2171 $[21] = t3; 2172 $[22] = t5; 2173 $[23] = t6; 2174 $[24] = t9; 2175 $[25] = t10; 2176 } else t10 = $[25]; 2177 let t11; 2178 if ($[26] !== modal.imageUrl) { 2179 t11 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 2180 className: "col-12 col-md-7", 2181 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("img", { 2182 src: modal.imageUrl, 2183 className: "img-fluid", 2184 alt: "" 2185 }) 2186 }); 2187 $[26] = modal.imageUrl; 2188 $[27] = t11; 2189 } else t11 = $[27]; 2190 let t12; 2191 if ($[28] !== t10 || $[29] !== t11) { 2192 t12 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", {
2193 className: "modal-dialog modal-lg modal-dialog-centered", 2194 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 2195 className: "modal-content", 2196 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 2197 className: "modal-body row align-items-center", 2198 children: [t10, t11] 2199 }) 2200 }) 2201 }); 2202 $[28] = t10; 2203 $[29] = t11; 2204 $[30] = t12; 2205 } else t12 = $[30]; 2206 let t13; 2207 if ($[31] !== modal.step || $[32] !== t12) { 2208 t13 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 2209 id: "provisioning-warmup-announcement-modal", 2210 className: "modal fade", 2211 tabIndex: -1, 2212 role: "dialog", 2213 "aria-modal": "true", 2214 "data-controller": "announcement-modal components--alert", 2215 "data-components--alert-id-value": modal.step, 2216 "data-components--alert-dismiss-definitely-value": "true", 2217 children: t12 2218 }); 2219 $[31] = modal.step; 2220 $[32] = t12; 2221 $[33] = t13; 2222 } else t13 = $[33]; 2223 return t13; 2224} 2225function IndexModals(t0) { 2226 const $ = (0, import_compiler_runtime$3.c)(11); 2227 const { campaigns, provisioningWarmup, labels } = t0; 2228 let t1; 2229 if ($[0] !== campaigns || $[1] !== labels) { 2230 let t2; 2231 if ($[3] !== labels) { 2232 t2 = (campaign) => /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(RenameModal, { 2233 campaign, 2234 labels 2235 }), /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(ArchiveModal, { 2236 campaign, 2237 labels 2238 })] }, campaign.id); 2239 $[3] = labels; 2240 $[4] = t2; 2241 } else t2 = $[4]; 2242 t1 = campaigns.map(t2); 2243 $[0] = campaigns; 2244 $[1] = labels; 2245 $[2] = t1; 2246 } else t1 = $[2]; 2247 let t2; 2248 if ($[5] !== provisioningWarmup) {
2249 t2 = provisioningWarmup && /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)(ProvisioningWarmupModal, { modal: provisioningWarmup }); 2250 $[5] = provisioningWarmup; 2251 $[6] = t2; 2252 } else t2 = $[6]; 2253 let t3; 2254 if ($[7] === Symbol.for("react.memo_cache_sentinel")) { 2255 t3 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("div", { 2256 className: "modal fade", 2257 id: "edit-smtp-imap-modal", 2258 role: "dialog", 2259 tabIndex: -1, 2260 children: /* @__PURE__ */ (0, import_jsx_runtime$3.jsx)("turbo-frame", { id: "edit_smtp_imap_connection" }) 2261 }); 2262 $[7] = t3; 2263 } else t3 = $[7]; 2264 let t4; 2265 if ($[8] !== t1 || $[9] !== t2) { 2266 t4 = /* @__PURE__ */ (0, import_jsx_runtime$3.jsxs)("div", { 2267 "data-turbo": "true", 2268 children: [ 2269 t1, 2270 t2, 2271 t3 2272 ] 2273 }); 2274 $[8] = t1; 2275 $[9] = t2; 2276 $[10] = t4; 2277 } else t4 = $[10]; 2278 return t4; 2279} 2280var import_compiler_runtime$3, import_jsx_runtime$3; 2281function init_IndexModals() { 2282 return (init_IndexModals = __esmMin((() => { 2283 import_compiler_runtime$3 = require_compiler_runtime(); 2284 init_utils(); 2285 init_button(); 2286 init_input(); 2287 init_label(); 2288 init_separator(); 2289 init_tag(); 2290 import_jsx_runtime$3 = require_jsx_runtime(); 2291 })))(); 2292} 2293//#endregion 2294//#region app/frontend/pages/Sequences/OnboardingBox.tsx 2295function OnboardingBox(t0) { 2296 const $ = (0, import_compiler_runtime$2.c)(18); 2297 const { onboarding } = t0; 2298 const [dismissed, setDismissed] = (0, import_react$2.useState)(false); 2299 let t1; 2300 if ($[0] !== onboarding.notificationId) { 2301 t1 = function handleClose() { 2302 markOnboardingStepSeen(onboarding.notificationId); 2303 setDismissed(true); 2304 }; 2305 $[0] = onboarding.notificationId; 2306 $[1] = t1; 2307 } else t1 = $[1]; 2308 const handleClose = t1; 2309 if (dismissed) return null; 2310 let t2; 2311 if ($[2] !== handleClose) { 2312 t2 = (event) => { 2313 event.preventDefault(); 2314 handleClose(); 2315 }; 2316 $[2] = handleClose; 2317 $[3] = t2; 2318 } else t2 = $[3]; 2319 let t3; 2320 if ($[4] !== onboarding.closeLabel || $[5] !== t2) { 2321 t3 = /* @__PURE__ */ (0, import_jsx_runtime$2.jsx)("div", { 2322 className: "float-end light-grey", 2323 children: /* @__PURE__ */ (0, import_jsx_runtime$2.jsx)("a", { 2324 href: "#", 2325 onClick: t2, 2326 children: onboarding.closeLabel 2327 }) 2328 }); 2329 $[4] = onboarding.closeLabel; 2330 $[5] = t2; 2331 $[6] = t3; 2332 } else t3 = $[6]; 2333 let t4; 2334 if ($[7] === Symbol.for("react.memo_cache_sentinel")) { 2335 t4 = /* @__PURE__ */ (0, import_jsx_runtime$2.jsx)(Icon, { 2336 icon: "book", 2337 variant: "regular", 2338 "aria-hidden": "true" 2339 }); 2340 $[7] = t4; 2341 } else t4 = $[7]; 2342 let t5; 2343 if ($[8] !== onboarding.title) { 2344 t5 = /* @__PURE__ */ (0, import_jsx_runtime$2.jsxs)("h2", { children: [ 2345 t4, 2346 "\xA0", 2347 onboarding.title 2348 ] }); 2349 $[8] = onboarding.title; 2350 $[9] = t5; 2351 } else t5 = $[9]; 2352 let t6; 2353 if ($[10] !== onboarding.items) { 2354 t6 = onboarding.items.map(_temp); 2355 $[10] = onboarding.items; 2356 $[11] = t6; 2357 } else t6 = $[11]; 2358 let t7; 2359 if ($[12] !== t6) { 2360 t7 = /* @__PURE__ */ (0, import_jsx_runtime$2.jsx)("ul", { 2361 className: "gap-top-md", 2362 children: t6 2363 }); 2364 $[12] = t6; 2365 $[13] = t7; 2366 } else t7 = $[13]; 2367 let t8; 2368 if ($[14] !== t3 || $[15] !== t5 || $[16] !== t7) { 2369 t8 = /* @__PURE__ */ (0, import_jsx_runtime$2.jsxs)("div", { 2370 className: "onboarding-box onboarding-box-horizontal onboarding-box--blue mt-10 mb-0", 2371 children: [ 2372 t3, 2373 t5, 2374 t7 2375 ] 2376 }); 2377 $[14] = t3; 2378 $[15] = t5; 2379 $[16] = t7; 2380 $[17] = t8; 2381 } else t8 = $[17]; 2382 return t8; 2383} 2384function _temp(item) { 2385 return /* @__PURE__ */ (0, import_jsx_runtime$2.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime$2.jsx)("a", { 2386 className: "blue-link", 2387 href: item.href, 2388 target: "_blank", 2389 rel: "noreferrer", 2390 children: item.label 2391 }) }, item.href); 2392} 2393var import_compiler_runtime$2, import_react$2, import_jsx_runtime$2; 2394function init_OnboardingBox() { 2395 return (init_OnboardingBox = __esmMin((() => { 2396 import_compiler_runtime$2 = require_compiler_runtime(); 2397 import_react$2 = require_react(); 2398 init_icon(); 2399 init_onboardingSteps(); 2400 import_jsx_runtime$2 = require_jsx_runtime(); 2401 })))(); 2402} 2403//#endregion 2404//#region app/frontend/pages/Sequences/TurboStreamSource.tsx 2405function TurboStreamSource(t0) { 2406 const $ = (0, import_compiler_runtime$1.c)(4); 2407 const { signedStreamName } = t0; 2408 const anchorRef = (0, import_react$1.useRef)(null); 2409 let t1; 2410 let t2; 2411 if ($[0] !== signedStreamName) { 2412 t1 = () => { 2413 const anchor = anchorRef.current; 2414 if (!anchor) return; 2415 const element = document.createElement("turbo-cable-stream-source"); 2416 element.setAttribute("channel", "Turbo::StreamsChannel"); 2417 element.setAttribute("signed-stream-name", signedStreamName); 2418 anchor.appendChild(element); 2419 return () => element.remove(); 2420 }; 2421 t2 = [signedStreamName]; 2422 $[0] = signedStreamName; 2423 $[1] = t1; 2424 $[2] = t2; 2425 } else { 2426 t1 = $[1]; 2427 t2 = $[2]; 2428 } 2429 (0, import_react$1.useEffect)(t1, t2); 2430 let t3; 2431 if ($[3] === Symbol.for("react.memo_cache_sentinel")) { 2432 t3 = /* @__PURE__ */ (0, import_jsx_runtime$1.jsx)("span", { 2433 ref: anchorRef, 2434 style: { display: "contents" } 2435 }); 2436 $[3] = t3; 2437 } else t3 = $[3]; 2438 return t3; 2439} 2440var import_compiler_runtime$1, import_react$1, import_jsx_runtime$1; 2441function init_TurboStreamSource() { 2442 return (init_TurboStreamSource = __esmMin((() => { 2443 import_compiler_runtime$1 = require_compiler_runtime(); 2444 import_react$1 = require_react(); 2445 import_jsx_runtime$1 = require_jsx_runtime(); 2446 })))(); 2447} 2448//#endregion 2449//#region app/frontend/pages/Sequences/Index.tsx 2450function Index() { 2451 const $ = (0, import_compiler_runtime.c)(83); 2452 const { title, hasCampaigns, sharedWorkspace, headingHtml, submenu, query, filters, filterOptions, sort, campaigns, insights, pagination, emptyState, onboarding, provisioningWarmup, streams, satisfaction, metricsEndpoint, metricsRefreshInterval, issuesEndpoint, issuesRefreshInterval, paths, labels } = usePage().props; 2453 const contentRef = (0, import_react.useRef)(null); 2454 let t0; 2455 if ($[0] === Symbol.for("react.memo_cache_sentinel")) { 2456 t0 = () => { 2457 const tooltips = contentRef.current?.querySelectorAll("[data-bs-toggle=\"tooltip\"]"); 2458 if (tooltips?.length) App.tooltip(tooltips); 2459 }; 2460 $[0] = t0; 2461 } else t0 = $[0]; 2462 let t1; 2463 if ($[1] !== campaigns || $[2] !== insights) { 2464 t1 = [campaigns, insights]; 2465 $[1] = campaigns; 2466 $[2] = insights; 2467 $[3] = t1; 2468 } else t1 = $[3]; 2469 (0, import_react.useEffect)(t0, t1); 2470 let t2; 2471 if ($[4] !== title) { 2472 t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Head_default, { title }); 2473 $[4] = title; 2474 $[5] = t2; 2475 } else t2 = $[5]; 2476 let t3; 2477 if ($[6] !== submenu) { 2478 t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 2479 className: "dashboard-main__submenu", 2480 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SequencesSubmenu, { ...submenu }) 2481 }); 2482 $[6] = submenu; 2483 $[7] = t3; 2484 } else t3 = $[7]; 2485 let t4; 2486 if ($[8] !== title) { 2487 t4 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageHeaderTitle, { children: t
2487itle }); 2488 $[8] = title; 2489 $[9] = t4; 2490 } else t4 = $[9]; 2491 let t5; 2492 if ($[10] !== labels.sharedWorkspace || $[11] !== paths.teams || $[12] !== sharedWorkspace) { 2493 t5 = sharedWorkspace && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 2494 className: "ml-4", 2495 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { 2496 className: "h-avatar h-avatar--sm shared-icon", 2497 href: paths.teams, 2498 "data-turbo-frame": "_top", 2499 "data-bs-toggle": "tooltip", 2500 "data-bs-container": "body", 2501 "data-bs-placement": "top", 2502 title: labels.sharedWorkspace, 2503 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { 2504 icon: "users", 2505 variant: "regular", 2506 "aria-hidden": "true" 2507 }) 2508 }) 2509 }); 2510 $[10] = labels.sharedWorkspace; 2511 $[11] = paths.teams; 2512 $[12] = sharedWorkspace; 2513 $[13] = t5; 2514 } else t5 = $[13]; 2515 let t6; 2516 if ($[14] !== t4 || $[15] !== t5) { 2517 t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PageHeaderHeading, { children: [t4, t5] }); 2518 $[14] = t4; 2519 $[15] = t5; 2520 $[16] = t6; 2521 } else t6 = $[16]; 2522 let t7; 2523 if ($[17] === Symbol.for("react.memo_cache_sentinel")) { 2524 t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { 2525 type: "hidden", 2526 name: "authenticity_token", 2527 value: getCsrfToken() 2528 }); 2529 $[17] = t7; 2530 } else t7 = $[17]; 2531 let t8; 2532 if ($[18] === Symbol.for("react.memo_cache_sentinel")) { 2533 t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { 2534 icon: "plus", 2535 variant: "regular", 2536 "aria-hidden": "true" 2537 }); 2538 $[18] = t8; 2539 } else t8 = $[18]; 2540 let t9; 2541 if ($[19] !== labels.new) { 2542 t9 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, { 2543 type: "submit", 2544 variant: "primary", 2545 size: "sm", 2546 children: [t8, labels.new] 2547 }); 2548 $[19] = labels.new; 2549 $[20] = t9; 2550 } else t9 = $[20]; 2551 let t10; 2552 if ($[21] !== paths.sequences || $[22] !== t9) { 2553 t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { 2554 action: paths.sequences, 2555 method: "post", 2556 id: "sending", 2557 className: "ml-auto", 2558 children: [t7, t9] 2559 }) }); 2560 $[21] = paths.sequences; 2561 $[22] = t9; 2562 $[23] = t10; 2563 } else t10 = $[23]; 2564 let t11; 2565 if ($[24] !== t10 || $[25] !== t6) { 2566 t11 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PageHeader, { children: [t6, t10] }); 2567 $[24] = t10; 2568 $[25] = t6; 2569 $[26] = t11; 2570 } else t11 = $[26]; 2571 let t12; 2572 if ($[27] !== hasCampaigns || $[28] !== issuesEndpoint || $[29] !== issuesRefreshInterval || $[30] !== metricsEndpoint || $[31] !== metricsRefreshInterval) {
2573 t12 = hasCampaigns && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 2574 className: "d-flex gap-4 mb-8", 2575 children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 2576 className: "campaigns-overview-widgets", 2577 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CampaignsMetricsWidget, { 2578 endpoint: metricsEndpoint, 2579 refreshInterval: metricsRefreshInterval 2580 }) 2581 }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 2582 className: "campaigns-issues-widget", 2583 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CampaignsIssuesWidget, { 2584 endpoint: issuesEndpoint, 2585 refreshInterval: issuesRefreshInterval 2586 }) 2587 })] 2588 }); 2589 $[27] = hasCampaigns; 2590 $[28] = issuesEndpoint; 2591 $[29] = issuesRefreshInterval; 2592 $[30] = metricsEndpoint; 2593 $[31] = metricsRefreshInterval; 2594 $[32] = t12; 2595 } else t12 = $[32]; 2596 const t13 = satisfaction.satismeterKey ?? ""; 2597 const t14 = satisfaction.environment; 2598 let t15; 2599 if ($[33] !== satisfaction.user) { 2600 t15 = JSON.stringify(satisfaction.user); 2601 $[33] = satisfaction.user; 2602 $[34] = t15; 2603 } else t15 = $[34]; 2604 let t16; 2605 if ($[35] !== streams.campaigns) { 2606 t16 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TurboStreamSource, { signedStreamName: streams.campaigns }); 2607 $[35] = streams.campaigns; 2608 $[36] = t16; 2609 } else t16 = $[36]; 2610 let t17; 2611 if ($[37] !== filterOptions || $[38] !== filters || $[39] !== hasCampaigns || $[40] !== headingHtml || $[41] !== labels || $[42] !== paths.sequences || $[43] !== query || $[44] !== sharedWorkspace || $[45] !== sort) { 2612 t17 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FiltersBar, { 2613 headingHtml, 2614 query, 2615 filters, 2616 filterOptions, 2617 sort, 2618 hasCampaigns, 2619 sharedWorkspace, 2620 sequencesPath: paths.sequences, 2621 labels 2622 }); 2623 $[37] = filterOptions; 2624 $[38] = filters; 2625 $[39] = hasCampaigns; 2626 $[40] = headingHtml; 2627 $[41] = labels; 2628 $[42] = paths.sequences; 2629 $[43] = query; 2630 $[44] = sharedWorkspace; 2631 $[45] = sort; 2632 $[46] = t17; 2633 } else t17 = $[46]; 2634 let t18; 2635 if ($[47] !== campaigns || $[48] !== emptyState || $[49] !== insights || $[50] !== labels || $[51] !== pagination || $[52] !== paths.sequences || $[53] !== sharedWorkspace || $[54] !== sort) { 2636 t18 = campaigns.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CampaignsTable, { 2637 campaigns, 2638 insights, 2639 sharedWorkspace, 2640 sort, 2641 pagination, 2642 labels 2643 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SequencesEmptyState, { 2644 emptyState, 2645 sequencesPath: paths.sequences, 2646 labels 2647 }); 2648 $[47] = campaigns; 2649 $[48] = emptyState; 2650 $[49] = insights; 2651 $[50] = labels; 2652 $[51] = pagination; 2653 $[52] = paths.sequences; 2654 $[53] = sharedWorkspace; 2655 $[54] = sort; 2656 $[55] = t18; 2657 } else t18 = $[55]; 2658 let t19; 2659 if ($[56] !== onboarding) { 2660 t19 = onboarding && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OnboardingBox, { onboarding }); 2661 $[56] = onboarding; 2662 $[57] = t19; 2663 } else t19 = $[57]; 2664 let t20; 2665 if ($[58] !== satisfaction.environment || $[59] !== t13 || $[60] !== t15 || $[61] !== t16 || $[62] !== t17 || $[63] !== t18 || $[64] !== t19) { 2666 t20 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 2667 ref: contentRef, 2668 "data-turbo": "true", 2669 "data-controller": "satisfaction", 2670 "data-satisfaction-satismeter-key-value": t13, 2671 "data-satisfaction-environment-value": t14, 2672 "data-satisfaction-user-value": t15, 2673 children: [ 2674 t16, 2675 t17, 2676 t18, 2677 t19 2678 ] 2679 }); 2680 $[58] = satisfaction.environment; 2681 $[59] = t13; 2682 $[60] = t15; 2683 $[61] = t16; 2684 $[62] = t17; 2685 $[63] = t18; 2686 $[64] = t19; 2687 $[65] = t20; 2688 } else t20 = $[65]; 2689 let t21; 2690 if ($[66] !== t11 || $[67] !== t12 || $[68] !== t20) { 2691 t21 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 2692 className: "master-details", 2693 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 2694 className: "master-details__master", 2695 children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 2696 className: "board-box campaigns-index__board", 2697 children: [ 2698 t11, 2699 t12, 2700 t20 2701 ] 2702 }) 2703 }) 2704 }); 2705 $[66] = t11; 2706 $[67] = t12; 2707 $[68] = t20; 2708 $[69] = t21; 2709 } else t21 = $[69]; 2710 let t22; 2711 if ($[70] !== campaigns || $[71] !== labels || $[72] !== provisioningWarmup) { 2712 t22 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IndexModals, { 2713 campaigns, 2714 provisioningWarmup, 2715 labels 2716 }); 2717 $[70] = campaigns; 2718 $[71] = labels; 2719 $[72] = provisioningWarmup; 2720 $[73] = t22; 2721 } else t22 = $[73]; 2722 let t23; 2723 if ($[74] !== t21 || $[75] !== t22) { 2724 t23 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 2725 className: "dashboard-main__content", 2726 children: [t21, t22] 2727 }); 2728 $[74] = t21; 2729 $[75] = t22; 2730 $[76] = t23; 2731 } else t23 = $[76]; 2732 let t24; 2733 if ($[77] !== t23 || $[78] !== t3) { 2734 t24 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("main", { 2735 className: "dashboard-main", 2736 children: [t3, t23] 2737 }); 2738 $[77] = t23; 2739 $[78] = t3; 2740 $[79] = t24; 2741 } else t24 = $[79]; 2742 let t25; 2743 if ($[80] !== t2 || $[81] !== t24) { 2744 t25 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [t2, t24] });
2745 $[80] = t2; 2746 $[81] = t24; 2747 $[82] = t25; 2748 } else t25 = $[82]; 2749 return t25; 2750} 2751var import_compiler_runtime, import_react, import_jsx_runtime, CampaignsMetricsWidget, CampaignsIssuesWidget; 2752function init_Index() { 2753 return (init_Index = __esmMin((() => { 2754 import_compiler_runtime = require_compiler_runtime(); 2755 import_react = require_react(); 2756 init_dist$1(); 2757 init_AppLayout(); 2758 init_utils(); 2759 init_campaigns_metrics(); 2760 init_campaigns_issues(); 2761 init_sentry_error_boundary(); 2762 init_button(); 2763 init_icon(); 2764 init_page_header(); 2765 init_SequencesSubmenu(); 2766 init_CampaignsTable(); 2767 init_EmptyState(); 2768 init_FiltersBar(); 2769 init_IndexModals(); 2770 init_OnboardingBox(); 2771 init_TurboStreamSource(); 2772 import_jsx_runtime = require_jsx_runtime(); 2773 CampaignsMetricsWidget = withSentryErrorBoundary(CampaignsMetrics, "CampaignsMetrics", CampaignsMetricsErrorFallback); 2774 CampaignsIssuesWidget = withSentryErrorBoundary(CampaignsIssues, "CampaignsIssues"); 2775 Index.layout = (page) => (0, import_react.createElement)(AppLayout, { navCollapsed: true }, page); 2776 })))(); 2777} 2778//#endregion 2779init_Index(); 2780export { Index as default };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.