@drawbridge/components 0.0.78 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/components/styles.css +228 -0
- package/dist/advertisement.js +64 -1047
- package/dist/advertisement.mjs +50 -41
- package/dist/bridge/advertisements.js +230 -0
- package/dist/bridge/advertisements.mjs +201 -0
- package/dist/bridge/countdown.js +88 -0
- package/dist/bridge/countdown.mjs +59 -0
- package/dist/bridge/fields.js +306 -0
- package/dist/bridge/fields.mjs +271 -0
- package/dist/bridge/form-subdomain-embed.js +283 -0
- package/dist/bridge/form-subdomain-embed.mjs +254 -0
- package/dist/bridge/form-subdomain-header.js +118 -0
- package/dist/bridge/form-subdomain-header.mjs +85 -0
- package/dist/bridge/form-subdomain-issue.js +265 -0
- package/dist/bridge/form-subdomain-issue.mjs +236 -0
- package/dist/bridge/form-subdomain-prize.js +160 -0
- package/dist/bridge/form-subdomain-prize.mjs +131 -0
- package/dist/bridge/form-subdomain-shop-modal.js +557 -0
- package/dist/bridge/form-subdomain-shop-modal.mjs +523 -0
- package/dist/bridge/form-subdomain-shop.js +64 -0
- package/dist/bridge/form-subdomain-shop.mjs +35 -0
- package/dist/bridge/form-subdomain.js +1012 -0
- package/dist/bridge/form-subdomain.mjs +977 -0
- package/dist/bridge/lib/age-gate.js +55 -0
- package/dist/bridge/lib/age-gate.mjs +21 -0
- package/dist/bridge/lib/checkout-kit.js +141 -0
- package/dist/bridge/lib/checkout-kit.mjs +107 -0
- package/dist/bridge/lib/constants.js +24 -0
- package/dist/bridge/lib/constants.mjs +5 -0
- package/dist/bridge/lib/css.js +31 -0
- package/dist/bridge/lib/css.mjs +8 -0
- package/dist/bridge/lib/recaptcha.js +31 -0
- package/dist/bridge/lib/recaptcha.mjs +8 -0
- package/dist/bridge/lib/url.js +64 -0
- package/dist/bridge/lib/url.mjs +39 -0
- package/dist/{embla.js → bridge/lib/yup.js} +10 -10
- package/dist/bridge/lib/yup.mjs +8 -0
- package/dist/bridge/product-tile.js +122 -0
- package/dist/bridge/product-tile.mjs +93 -0
- package/dist/bridge/provider-analytics.js +184 -0
- package/dist/bridge/provider-analytics.mjs +150 -0
- package/dist/bridge/share-button.js +239 -0
- package/dist/bridge/share-button.mjs +227 -0
- package/dist/bridge/subdomain-content.js +195 -0
- package/dist/bridge/subdomain-content.mjs +166 -0
- package/dist/bridge/template-layout.js +733 -0
- package/dist/bridge/template-layout.mjs +704 -0
- package/dist/bridge/template-modal.js +638 -0
- package/dist/bridge/template-modal.mjs +609 -0
- package/dist/bridge/template-not-found.js +83 -0
- package/dist/bridge/template-not-found.mjs +54 -0
- package/dist/bridge/template-subdomain-gallery.js +524 -0
- package/dist/bridge/template-subdomain-gallery.mjs +495 -0
- package/dist/bridge/template-subdomain-link.js +134 -0
- package/dist/bridge/template-subdomain-link.mjs +105 -0
- package/dist/bridge/template-subdomain.js +423 -0
- package/dist/bridge/template-subdomain.mjs +394 -0
- package/dist/dashboard/accordion.js +141 -0
- package/dist/dashboard/accordion.mjs +112 -0
- package/dist/dashboard/avatar.js +76 -0
- package/dist/dashboard/avatar.mjs +47 -0
- package/dist/dashboard/card-affiliate.js +266 -0
- package/dist/dashboard/card-affiliate.mjs +237 -0
- package/dist/dashboard/card-connection.js +214 -0
- package/dist/dashboard/card-connection.mjs +181 -0
- package/dist/dashboard/card-data-item.js +76 -0
- package/dist/dashboard/card-data-item.mjs +57 -0
- package/dist/dashboard/card-integration.js +187 -0
- package/dist/dashboard/card-integration.mjs +158 -0
- package/dist/dashboard/card-metric.js +147 -0
- package/dist/dashboard/card-metric.mjs +118 -0
- package/dist/dashboard/card-note.js +151 -0
- package/dist/dashboard/card-note.mjs +122 -0
- package/dist/dashboard/card-order.js +236 -0
- package/dist/dashboard/card-order.mjs +207 -0
- package/dist/dashboard/card-overage.js +307 -0
- package/dist/dashboard/card-overage.mjs +278 -0
- package/dist/dashboard/card-payment-method.js +82 -0
- package/dist/dashboard/card-payment-method.mjs +63 -0
- package/dist/dashboard/card-plan.js +363 -0
- package/dist/dashboard/card-plan.mjs +334 -0
- package/dist/dashboard/card-product.js +86 -0
- package/dist/dashboard/card-product.mjs +57 -0
- package/dist/dashboard/card-score.js +201 -0
- package/dist/dashboard/card-score.mjs +172 -0
- package/dist/dashboard/card-section.js +82 -0
- package/dist/dashboard/card-section.mjs +63 -0
- package/dist/dashboard/card-setting.js +136 -0
- package/dist/dashboard/card-setting.mjs +107 -0
- package/dist/dashboard/card-task.js +133 -0
- package/dist/dashboard/card-task.mjs +104 -0
- package/dist/dashboard/card-template.js +197 -0
- package/dist/dashboard/card-template.mjs +168 -0
- package/dist/dashboard/card-tile.js +459 -0
- package/dist/dashboard/card-tile.mjs +425 -0
- package/dist/dashboard/card-utm.js +83 -0
- package/dist/dashboard/card-utm.mjs +54 -0
- package/dist/dashboard/carousel-tiles.js +64 -0
- package/dist/dashboard/carousel-tiles.mjs +35 -0
- package/dist/dashboard/code-formatter.js +134 -0
- package/dist/dashboard/code-formatter.mjs +105 -0
- package/dist/dashboard/drawer-subscription.js +762 -0
- package/dist/dashboard/drawer-subscription.mjs +733 -0
- package/dist/dashboard/drawer.js +143 -0
- package/dist/dashboard/drawer.mjs +114 -0
- package/dist/dashboard/dropdown.js +154 -0
- package/dist/dashboard/dropdown.mjs +125 -0
- package/dist/dashboard/form-action.js +120 -0
- package/dist/dashboard/form-action.mjs +91 -0
- package/dist/dashboard/form-address.js +98 -0
- package/dist/dashboard/form-address.mjs +69 -0
- package/dist/dashboard/form-admin-campaign.js +161 -0
- package/dist/dashboard/form-admin-campaign.mjs +132 -0
- package/dist/dashboard/form-admin-invoice-refund.js +153 -0
- package/dist/dashboard/form-admin-invoice-refund.mjs +124 -0
- package/dist/dashboard/form-admin-oauth.js +327 -0
- package/dist/dashboard/form-admin-oauth.mjs +298 -0
- package/dist/dashboard/form-admin-organization.js +231 -0
- package/dist/dashboard/form-admin-organization.mjs +202 -0
- package/dist/dashboard/form-admin-provider.js +286 -0
- package/dist/dashboard/form-admin-provider.mjs +257 -0
- package/dist/dashboard/form-admin-referrer.js +227 -0
- package/dist/dashboard/form-admin-referrer.mjs +198 -0
- package/dist/dashboard/form-admin-subscription-custom.js +285 -0
- package/dist/dashboard/form-admin-subscription-custom.mjs +256 -0
- package/dist/dashboard/form-admin-template.js +514 -0
- package/dist/dashboard/form-admin-template.mjs +481 -0
- package/dist/dashboard/form-admin-user-credit.js +141 -0
- package/dist/dashboard/form-admin-user-credit.mjs +112 -0
- package/dist/dashboard/form-admin-user-permissions.js +141 -0
- package/dist/dashboard/form-admin-user-permissions.mjs +112 -0
- package/dist/dashboard/form-admin-user-status.js +151 -0
- package/dist/dashboard/form-admin-user-status.mjs +122 -0
- package/dist/dashboard/form-admin-utm.js +400 -0
- package/dist/dashboard/form-admin-utm.mjs +371 -0
- package/dist/dashboard/form-ai.js +779 -0
- package/dist/dashboard/form-ai.mjs +742 -0
- package/dist/dashboard/form-auth.js +597 -0
- package/dist/dashboard/form-auth.mjs +561 -0
- package/dist/dashboard/form-credit.js +80 -0
- package/dist/dashboard/form-credit.mjs +51 -0
- package/dist/dashboard/form-file-upload.js +527 -0
- package/dist/dashboard/form-file-upload.mjs +498 -0
- package/dist/dashboard/form-file.js +367 -0
- package/dist/dashboard/form-file.mjs +338 -0
- package/dist/dashboard/form-filters-analytics.js +294 -0
- package/dist/dashboard/form-filters-analytics.mjs +265 -0
- package/dist/dashboard/form-filters.js +411 -0
- package/dist/dashboard/form-filters.mjs +382 -0
- package/dist/dashboard/form-note.js +143 -0
- package/dist/dashboard/form-note.mjs +114 -0
- package/dist/dashboard/form-notification.js +173 -0
- package/dist/dashboard/form-notification.mjs +140 -0
- package/dist/dashboard/form-organization-affiliate.js +301 -0
- package/dist/dashboard/form-organization-affiliate.mjs +268 -0
- package/dist/dashboard/form-organization-brand.js +333 -0
- package/dist/dashboard/form-organization-brand.mjs +299 -0
- package/dist/dashboard/form-organization-campaign-advertisement.js +460 -0
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +427 -0
- package/dist/dashboard/form-organization-campaign-agreement.js +251 -0
- package/dist/dashboard/form-organization-campaign-agreement.mjs +222 -0
- package/dist/dashboard/form-organization-campaign-draw.js +458 -0
- package/dist/dashboard/form-organization-campaign-draw.mjs +429 -0
- package/dist/dashboard/form-organization-campaign-field-email.js +401 -0
- package/dist/dashboard/form-organization-campaign-field-email.mjs +372 -0
- package/dist/dashboard/form-organization-campaign-field-name.js +185 -0
- package/dist/dashboard/form-organization-campaign-field-name.mjs +156 -0
- package/dist/dashboard/form-organization-campaign-field-number.js +228 -0
- package/dist/dashboard/form-organization-campaign-field-number.mjs +199 -0
- package/dist/dashboard/form-organization-campaign-field-phone.js +229 -0
- package/dist/dashboard/form-organization-campaign-field-phone.mjs +200 -0
- package/dist/dashboard/form-organization-campaign-field-select.js +258 -0
- package/dist/dashboard/form-organization-campaign-field-select.mjs +229 -0
- package/dist/dashboard/form-organization-campaign-field-text.js +202 -0
- package/dist/dashboard/form-organization-campaign-field-text.mjs +173 -0
- package/dist/dashboard/form-organization-campaign-field-textarea.js +236 -0
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +207 -0
- package/dist/dashboard/form-organization-campaign-integration-age.js +214 -0
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +185 -0
- package/dist/dashboard/form-organization-campaign-integration-enable.js +105 -0
- package/dist/dashboard/form-organization-campaign-integration-enable.mjs +76 -0
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +188 -0
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +159 -0
- package/dist/dashboard/form-organization-campaign-integration-gtm.js +176 -0
- package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +147 -0
- package/dist/dashboard/form-organization-campaign-lead.js +212 -0
- package/dist/dashboard/form-organization-campaign-lead.mjs +183 -0
- package/dist/dashboard/form-organization-campaign-link.js +241 -0
- package/dist/dashboard/form-organization-campaign-link.mjs +212 -0
- package/dist/dashboard/form-organization-campaign-page-affiliates.js +133 -0
- package/dist/dashboard/form-organization-campaign-page-affiliates.mjs +104 -0
- package/dist/dashboard/form-organization-campaign-page-embed.js +102 -0
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +73 -0
- package/dist/dashboard/form-organization-campaign-page-preview.js +245 -0
- package/dist/dashboard/form-organization-campaign-page-preview.mjs +216 -0
- package/dist/dashboard/form-organization-campaign-page-qr.js +417 -0
- package/dist/dashboard/form-organization-campaign-page-qr.mjs +384 -0
- package/dist/dashboard/form-organization-campaign-page-share.js +484 -0
- package/dist/dashboard/form-organization-campaign-page-share.mjs +455 -0
- package/dist/dashboard/form-organization-campaign-page-slug.js +187 -0
- package/dist/dashboard/form-organization-campaign-page-slug.mjs +158 -0
- package/dist/dashboard/form-organization-campaign-page.js +400 -0
- package/dist/dashboard/form-organization-campaign-page.mjs +366 -0
- package/dist/dashboard/form-organization-campaign-prize-edit.js +543 -0
- package/dist/dashboard/form-organization-campaign-prize-edit.mjs +514 -0
- package/dist/dashboard/form-organization-campaign-prize.js +141 -0
- package/dist/dashboard/form-organization-campaign-prize.mjs +112 -0
- package/dist/dashboard/form-organization-campaign-range.js +269 -0
- package/dist/dashboard/form-organization-campaign-range.mjs +240 -0
- package/dist/dashboard/form-organization-campaign.js +1106 -0
- package/dist/dashboard/form-organization-campaign.mjs +1067 -0
- package/dist/dashboard/form-organization-connection.js +545 -0
- package/dist/dashboard/form-organization-connection.mjs +512 -0
- package/dist/dashboard/form-organization-export.js +289 -0
- package/dist/dashboard/form-organization-export.mjs +260 -0
- package/dist/dashboard/form-organization-file-frame.js +168 -0
- package/dist/dashboard/form-organization-file-frame.mjs +139 -0
- package/dist/dashboard/form-organization-file.js +332 -0
- package/dist/dashboard/form-organization-file.mjs +303 -0
- package/dist/dashboard/form-organization-identity.js +800 -0
- package/dist/dashboard/form-organization-identity.mjs +765 -0
- package/dist/dashboard/form-organization-member.js +332 -0
- package/dist/dashboard/form-organization-member.mjs +303 -0
- package/dist/dashboard/form-organization-segment.js +441 -0
- package/dist/dashboard/form-organization-segment.mjs +412 -0
- package/dist/dashboard/form-organization-workflow.js +1145 -0
- package/dist/dashboard/form-organization-workflow.mjs +1109 -0
- package/dist/dashboard/form-organization.js +788 -0
- package/dist/dashboard/form-organization.mjs +751 -0
- package/dist/dashboard/form-otc.js +228 -0
- package/dist/dashboard/form-otc.mjs +194 -0
- package/dist/dashboard/form-payment-methods.js +183 -0
- package/dist/dashboard/form-payment-methods.mjs +154 -0
- package/dist/dashboard/form-profile.js +281 -0
- package/dist/dashboard/form-profile.mjs +248 -0
- package/dist/dashboard/form-stripe-promotion.js +142 -0
- package/dist/dashboard/form-stripe-promotion.mjs +113 -0
- package/dist/dashboard/form-stripe.js +236 -0
- package/dist/dashboard/form-stripe.mjs +207 -0
- package/dist/dashboard/form-verify-prize.js +342 -0
- package/dist/dashboard/form-verify-prize.mjs +309 -0
- package/dist/dashboard/google.js +671 -0
- package/dist/dashboard/google.mjs +637 -0
- package/dist/dashboard/guard-navigation.js +228 -0
- package/dist/dashboard/guard-navigation.mjs +195 -0
- package/dist/dashboard/guide.js +238 -0
- package/dist/dashboard/guide.mjs +209 -0
- package/dist/dashboard/iframe.js +159 -0
- package/dist/dashboard/iframe.mjs +130 -0
- package/dist/dashboard/input-address-saved.js +288 -0
- package/dist/dashboard/input-address-saved.mjs +259 -0
- package/dist/dashboard/input-array.js +272 -0
- package/dist/dashboard/input-array.mjs +236 -0
- package/dist/dashboard/input-color.js +192 -0
- package/dist/dashboard/input-color.mjs +163 -0
- package/dist/dashboard/input-combobox.js +281 -0
- package/dist/dashboard/input-combobox.mjs +258 -0
- package/dist/dashboard/input-date.js +234 -0
- package/dist/dashboard/input-date.mjs +201 -0
- package/dist/dashboard/input-editor.js +476 -0
- package/dist/dashboard/input-editor.mjs +441 -0
- package/dist/dashboard/input-fields.js +1101 -0
- package/dist/dashboard/input-fields.mjs +1060 -0
- package/dist/dashboard/input-file.js +188 -0
- package/dist/dashboard/input-file.mjs +159 -0
- package/dist/dashboard/input-font.js +506 -0
- package/dist/dashboard/input-font.mjs +477 -0
- package/dist/dashboard/input-group-ai.js +157 -0
- package/dist/dashboard/input-group-ai.mjs +128 -0
- package/dist/dashboard/input-radio.js +126 -0
- package/dist/dashboard/input-radio.mjs +97 -0
- package/dist/dashboard/input-resource.js +206 -0
- package/dist/dashboard/input-resource.mjs +177 -0
- package/dist/dashboard/input-secret.js +221 -0
- package/dist/dashboard/input-secret.mjs +192 -0
- package/dist/dashboard/input-time.js +100 -0
- package/dist/dashboard/input-time.mjs +71 -0
- package/dist/dashboard/lib/confetti.js +70 -0
- package/dist/dashboard/lib/confetti.mjs +37 -0
- package/dist/dashboard/lib/connection-controls.js +34 -0
- package/dist/dashboard/lib/connection-controls.mjs +11 -0
- package/dist/dashboard/lib/features.js +57 -0
- package/dist/dashboard/lib/features.mjs +22 -0
- package/dist/dashboard/lib/frames.js +35 -0
- package/dist/dashboard/lib/frames.mjs +11 -0
- package/dist/dashboard/lib/geo.js +138 -0
- package/dist/dashboard/lib/geo.mjs +113 -0
- package/dist/dashboard/lib/hooks.js +426 -0
- package/dist/dashboard/lib/hooks.mjs +397 -0
- package/dist/dashboard/lib/navigation.js +46 -0
- package/dist/dashboard/lib/navigation.mjs +23 -0
- package/dist/dashboard/lib/otc.js +45 -0
- package/dist/dashboard/lib/otc.mjs +22 -0
- package/dist/dashboard/lib/overage.js +30 -0
- package/dist/dashboard/lib/overage.mjs +6 -0
- package/dist/dashboard/lib/table-actions.js +108 -0
- package/dist/dashboard/lib/table-actions.mjs +75 -0
- package/dist/dashboard/lib/time-slots.js +72 -0
- package/dist/dashboard/lib/time-slots.mjs +44 -0
- package/dist/dashboard/lib/trickle.js +31 -0
- package/dist/dashboard/lib/trickle.mjs +8 -0
- package/dist/dashboard/lib/uppy.js +202 -0
- package/dist/dashboard/lib/uppy.mjs +166 -0
- package/dist/dashboard/lib/utm.js +66 -0
- package/dist/dashboard/lib/utm.mjs +42 -0
- package/dist/dashboard/link-back.js +94 -0
- package/dist/dashboard/link-back.mjs +65 -0
- package/dist/dashboard/link.js +129 -0
- package/dist/dashboard/link.mjs +95 -0
- package/dist/dashboard/list-resource.js +184 -0
- package/dist/dashboard/list-resource.mjs +155 -0
- package/dist/dashboard/list.js +96 -0
- package/dist/dashboard/list.mjs +67 -0
- package/dist/dashboard/menu.js +778 -0
- package/dist/dashboard/menu.mjs +740 -0
- package/dist/dashboard/modal.js +194 -0
- package/dist/dashboard/modal.mjs +165 -0
- package/dist/dashboard/notes.js +169 -0
- package/dist/dashboard/notes.mjs +140 -0
- package/dist/dashboard/notice.js +138 -0
- package/dist/dashboard/notice.mjs +109 -0
- package/dist/dashboard/paged.js +430 -0
- package/dist/dashboard/paged.mjs +401 -0
- package/dist/dashboard/provider-resource.js +102 -0
- package/dist/dashboard/provider-resource.mjs +73 -0
- package/dist/dashboard/provider-ui.js +255 -0
- package/dist/dashboard/provider-ui.mjs +226 -0
- package/dist/dashboard/provider.js +79 -0
- package/dist/dashboard/provider.mjs +50 -0
- package/dist/dashboard/recharts.js +630 -0
- package/dist/dashboard/recharts.mjs +596 -0
- package/dist/dashboard/steps.js +263 -0
- package/dist/dashboard/steps.mjs +229 -0
- package/dist/dashboard/swatch.js +81 -0
- package/dist/dashboard/swatch.mjs +52 -0
- package/dist/dashboard/table-cell-title.js +207 -0
- package/dist/dashboard/table-cell-title.mjs +174 -0
- package/dist/dashboard/table.js +765 -0
- package/dist/dashboard/table.mjs +723 -0
- package/dist/dashboard/template-dashboard.js +697 -0
- package/dist/dashboard/template-dashboard.mjs +662 -0
- package/dist/dashboard/template-not-found.js +124 -0
- package/dist/dashboard/template-not-found.mjs +95 -0
- package/dist/dashboard/template-socket.js +502 -0
- package/dist/dashboard/template-socket.mjs +466 -0
- package/dist/dashboard/template-suspended.js +64 -0
- package/dist/dashboard/template-suspended.mjs +41 -0
- package/dist/dashboard/template-ui.js +535 -0
- package/dist/dashboard/template-ui.mjs +506 -0
- package/dist/dashboard/wrapper-ai.js +79 -0
- package/dist/dashboard/wrapper-ai.mjs +50 -0
- package/dist/icons/arrow-down-tray.js +1 -3
- package/dist/icons/arrow-down-tray.mjs +1 -2
- package/dist/icons/arrow-left.js +1 -3
- package/dist/icons/arrow-left.mjs +1 -2
- package/dist/icons/arrow-right.js +1 -3
- package/dist/icons/arrow-right.mjs +1 -2
- package/dist/icons/arrow-up-tray.js +1 -3
- package/dist/icons/arrow-up-tray.mjs +1 -2
- package/dist/icons/bars-arrow-down.js +1 -3
- package/dist/icons/bars-arrow-down.mjs +1 -2
- package/dist/icons/bars-arrow-up.js +1 -3
- package/dist/icons/bars-arrow-up.mjs +1 -2
- package/dist/icons/bold.js +1 -3
- package/dist/icons/bold.mjs +1 -2
- package/dist/icons/bolt.js +1 -3
- package/dist/icons/bolt.mjs +1 -2
- package/dist/icons/calendar.js +1 -3
- package/dist/icons/calendar.mjs +1 -2
- package/dist/icons/cancel.js +1 -3
- package/dist/icons/cancel.mjs +1 -2
- package/dist/icons/card.js +1 -3
- package/dist/icons/card.mjs +1 -2
- package/dist/icons/chart.js +1 -3
- package/dist/icons/chart.mjs +1 -2
- package/dist/icons/check.js +1 -3
- package/dist/icons/check.mjs +24 -3
- package/dist/icons/chevron-down.js +1 -3
- package/dist/icons/chevron-down.mjs +24 -3
- package/dist/icons/chevron-left.js +1 -3
- package/dist/icons/chevron-left.mjs +1 -2
- package/dist/icons/chevron-right.js +1 -3
- package/dist/icons/chevron-right.mjs +1 -2
- package/dist/icons/chevron-up-down.js +1 -3
- package/dist/icons/chevron-up-down.mjs +1 -2
- package/dist/icons/chevron-up.js +1 -3
- package/dist/icons/chevron-up.mjs +1 -2
- package/dist/icons/clock.js +1 -3
- package/dist/icons/clock.mjs +1 -2
- package/dist/icons/code-bracket.js +1 -3
- package/dist/icons/code-bracket.mjs +1 -2
- package/dist/icons/cog.js +1 -3
- package/dist/icons/cog.mjs +1 -2
- package/dist/icons/copy.js +1 -3
- package/dist/icons/copy.mjs +1 -2
- package/dist/icons/discord.js +1 -3
- package/dist/icons/discord.mjs +13 -3
- package/dist/icons/document.js +1 -3
- package/dist/icons/document.mjs +1 -2
- package/dist/icons/download.js +1 -3
- package/dist/icons/download.mjs +1 -2
- package/dist/icons/drag.js +1 -3
- package/dist/icons/drag.mjs +1 -2
- package/dist/icons/ellipsis.js +1 -3
- package/dist/icons/ellipsis.mjs +1 -2
- package/dist/icons/email.js +1 -3
- package/dist/icons/email.mjs +1 -2
- package/dist/icons/external.js +1 -3
- package/dist/icons/external.mjs +1 -2
- package/dist/icons/facebook.js +1 -3
- package/dist/icons/facebook.mjs +13 -3
- package/dist/icons/filter.js +1 -3
- package/dist/icons/filter.mjs +1 -2
- package/dist/icons/flag.js +1 -3
- package/dist/icons/flag.mjs +1 -2
- package/dist/icons/github.js +1 -3
- package/dist/icons/github.mjs +13 -3
- package/dist/icons/google.js +1 -3
- package/dist/icons/google.mjs +1 -2
- package/dist/icons/home.js +1 -3
- package/dist/icons/home.mjs +1 -2
- package/dist/icons/image.js +1 -3
- package/dist/icons/image.mjs +1 -2
- package/dist/icons/instagram.js +1 -3
- package/dist/icons/instagram.mjs +13 -3
- package/dist/icons/italic.js +1 -3
- package/dist/icons/italic.mjs +1 -2
- package/dist/icons/link.js +1 -3
- package/dist/icons/link.mjs +1 -2
- package/dist/icons/linkedin.js +1 -3
- package/dist/icons/linkedin.mjs +13 -3
- package/dist/icons/loader.js +1 -3
- package/dist/icons/loader.mjs +40 -3
- package/dist/icons/lock.js +1 -3
- package/dist/icons/lock.mjs +1 -2
- package/dist/icons/logo-mark.js +1 -3
- package/dist/icons/logo-mark.mjs +1 -2
- package/dist/icons/logo-tagline.js +1 -3
- package/dist/icons/logo-tagline.mjs +1 -2
- package/dist/icons/map-pin.js +1 -3
- package/dist/icons/map-pin.mjs +1 -2
- package/dist/icons/menu.js +1 -3
- package/dist/icons/menu.mjs +1 -2
- package/dist/icons/minus.js +1 -3
- package/dist/icons/minus.mjs +24 -3
- package/dist/icons/muted.js +1 -3
- package/dist/icons/muted.mjs +1 -2
- package/dist/icons/pause.js +1 -3
- package/dist/icons/pause.mjs +1 -2
- package/dist/icons/pencil.js +1 -3
- package/dist/icons/pencil.mjs +1 -2
- package/dist/icons/pinterest.js +1 -3
- package/dist/icons/pinterest.mjs +13 -3
- package/dist/icons/play.js +1 -3
- package/dist/icons/play.mjs +1 -2
- package/dist/icons/plus.js +1 -3
- package/dist/icons/plus.mjs +24 -3
- package/dist/icons/powered-by.js +1 -3
- package/dist/icons/powered-by.mjs +1 -2
- package/dist/icons/qr-code.js +1 -3
- package/dist/icons/qr-code.mjs +1 -2
- package/dist/icons/queue.js +1 -3
- package/dist/icons/queue.mjs +1 -2
- package/dist/icons/refresh.js +1 -3
- package/dist/icons/refresh.mjs +1 -2
- package/dist/icons/refund.js +1 -3
- package/dist/icons/refund.mjs +1 -2
- package/dist/icons/rocket.js +1 -3
- package/dist/icons/rocket.mjs +1 -2
- package/dist/icons/search.js +1 -3
- package/dist/icons/search.mjs +1 -2
- package/dist/icons/share.js +1 -3
- package/dist/icons/share.mjs +1 -2
- package/dist/icons/shop.js +1 -3
- package/dist/icons/shop.mjs +1 -2
- package/dist/icons/snapchat.js +1 -3
- package/dist/icons/snapchat.mjs +13 -3
- package/dist/icons/social.js +39 -229
- package/dist/icons/social.mjs +29 -59
- package/dist/icons/sparkles.js +1 -3
- package/dist/icons/sparkles.mjs +1 -2
- package/dist/icons/spotify.js +1 -3
- package/dist/icons/spotify.mjs +13 -3
- package/dist/icons/star.js +1 -3
- package/dist/icons/star.mjs +1 -2
- package/dist/icons/switch.js +1 -3
- package/dist/icons/switch.mjs +1 -2
- package/dist/icons/threads.js +1 -3
- package/dist/icons/threads.mjs +13 -3
- package/dist/icons/tiktok.js +1 -3
- package/dist/icons/tiktok.mjs +13 -3
- package/dist/icons/times.js +1 -3
- package/dist/icons/times.mjs +1 -2
- package/dist/icons/trash.js +1 -3
- package/dist/icons/trash.mjs +1 -2
- package/dist/icons/twitch.js +1 -3
- package/dist/icons/twitch.mjs +13 -3
- package/dist/icons/underline.js +1 -3
- package/dist/icons/underline.mjs +1 -2
- package/dist/icons/upload.js +1 -3
- package/dist/icons/upload.mjs +1 -2
- package/dist/icons/volume.js +1 -3
- package/dist/icons/volume.mjs +1 -2
- package/dist/icons/warning.js +1 -3
- package/dist/icons/warning.mjs +24 -3
- package/dist/icons/whatsapp.js +1 -3
- package/dist/icons/whatsapp.mjs +13 -3
- package/dist/icons/x.js +1 -3
- package/dist/icons/x.mjs +13 -3
- package/dist/icons/youtube.js +1 -3
- package/dist/icons/youtube.mjs +13 -3
- package/dist/input-checkbox.js +37 -72
- package/dist/input-checkbox.mjs +24 -19
- package/dist/input-group.js +43 -153
- package/dist/input-group.mjs +125 -6
- package/dist/input-name.js +27 -294
- package/dist/input-name.mjs +9 -18
- package/dist/input-number.js +51 -106
- package/dist/input-number.mjs +32 -31
- package/dist/input-phone.js +28 -74
- package/dist/input-phone.mjs +15 -17
- package/dist/input-select.js +27 -63
- package/dist/input-select.mjs +91 -5
- package/dist/input-text.js +3 -27
- package/dist/input-text.mjs +29 -4
- package/dist/input-textarea.js +7 -28
- package/dist/input-textarea.mjs +6 -7
- package/dist/product.js +98 -726
- package/dist/product.mjs +375 -11
- package/dist/provider-font.js +10 -26
- package/dist/provider-font.mjs +4 -10
- package/dist/shared/address-lines.js +74 -0
- package/dist/shared/address-lines.mjs +55 -0
- package/dist/shared/badge.js +88 -0
- package/dist/shared/badge.mjs +59 -0
- package/dist/shared/button.js +106 -0
- package/dist/shared/button.mjs +77 -0
- package/dist/shared/card-asset.js +139 -0
- package/dist/shared/card-asset.mjs +110 -0
- package/dist/shared/card-prize.js +188 -0
- package/dist/shared/card-prize.mjs +159 -0
- package/dist/shared/carousel.js +175 -0
- package/dist/shared/carousel.mjs +146 -0
- package/dist/shared/copy-to-clipboard.js +129 -0
- package/dist/shared/copy-to-clipboard.mjs +100 -0
- package/dist/shared/divider.js +67 -0
- package/dist/shared/divider.mjs +48 -0
- package/dist/shared/empty.js +56 -0
- package/dist/shared/empty.mjs +37 -0
- package/dist/shared/error.js +112 -0
- package/dist/shared/error.mjs +83 -0
- package/dist/shared/fieldset.js +76 -0
- package/dist/shared/fieldset.mjs +57 -0
- package/dist/shared/form.js +48 -0
- package/dist/shared/form.mjs +29 -0
- package/dist/shared/indicator.js +50 -0
- package/dist/shared/indicator.mjs +31 -0
- package/dist/shared/input-checkbox-list.js +114 -0
- package/dist/shared/input-checkbox-list.mjs +85 -0
- package/dist/shared/input-range.js +111 -0
- package/dist/shared/input-range.mjs +92 -0
- package/dist/shared/input-switch.js +111 -0
- package/dist/shared/input-switch.mjs +82 -0
- package/dist/{embla-fade.js → shared/input-url.js} +18 -13
- package/dist/shared/input-url.mjs +17 -0
- package/dist/shared/lib/form.js +85 -0
- package/dist/shared/lib/form.mjs +59 -0
- package/dist/shared/lib/helpers.js +401 -0
- package/dist/shared/lib/helpers.mjs +341 -0
- package/dist/shared/lib/icon-labels.js +53 -0
- package/dist/shared/lib/icon-labels.mjs +20 -0
- package/dist/shared/lib/yup.js +83 -0
- package/dist/shared/lib/yup.mjs +50 -0
- package/dist/shared/loader.js +124 -0
- package/dist/shared/loader.mjs +90 -0
- package/dist/shared/overlay.js +73 -0
- package/dist/shared/overlay.mjs +44 -0
- package/dist/shared/progress.js +75 -0
- package/dist/shared/progress.mjs +56 -0
- package/dist/shared/provider-recaptcha.js +43 -0
- package/dist/shared/provider-recaptcha.mjs +24 -0
- package/dist/shared/sortable.js +227 -0
- package/dist/shared/sortable.mjs +198 -0
- package/dist/shared/tabs.js +140 -0
- package/dist/shared/tabs.mjs +111 -0
- package/dist/shared/tooltip.js +108 -0
- package/dist/shared/tooltip.mjs +79 -0
- package/dist/styles.js +27 -23
- package/dist/styles.mjs +89 -18
- package/dist/video.js +16 -86
- package/dist/video.mjs +8 -14
- package/dist/wrapper-gradient.js +4 -6
- package/dist/wrapper-gradient.mjs +202 -4
- package/package.json +988 -18
- package/types/bridge/advertisements.d.ts +33 -0
- package/types/bridge/countdown.d.ts +11 -0
- package/types/bridge/fields.d.ts +29 -0
- package/types/bridge/form-subdomain-embed.d.ts +26 -0
- package/types/bridge/form-subdomain-header.d.ts +14 -0
- package/types/bridge/form-subdomain-issue.d.ts +16 -0
- package/types/bridge/form-subdomain-prize.d.ts +22 -0
- package/types/bridge/form-subdomain-shop-modal.d.ts +41 -0
- package/types/bridge/form-subdomain-shop.d.ts +14 -0
- package/types/bridge/form-subdomain.d.ts +69 -0
- package/types/bridge/lib/age-gate.d.ts +11 -0
- package/types/bridge/lib/checkout-kit.d.ts +27 -0
- package/types/bridge/lib/constants.d.ts +5 -0
- package/types/bridge/lib/css.d.ts +3 -0
- package/types/bridge/lib/recaptcha.d.ts +5 -0
- package/types/bridge/lib/url.d.ts +21 -0
- package/types/bridge/lib/yup.d.ts +20 -0
- package/types/bridge/product-tile.d.ts +26 -0
- package/types/bridge/provider-analytics.d.ts +25 -0
- package/types/bridge/share-button.d.ts +18 -0
- package/types/bridge/subdomain-content.d.ts +25 -0
- package/types/bridge/template-layout.d.ts +12 -0
- package/types/bridge/template-modal.d.ts +46 -0
- package/types/bridge/template-not-found.d.ts +9 -0
- package/types/bridge/template-subdomain-gallery.d.ts +25 -0
- package/types/bridge/template-subdomain-link.d.ts +18 -0
- package/types/bridge/template-subdomain.d.ts +22 -0
- package/types/dashboard/accordion.d.ts +25 -0
- package/types/dashboard/avatar.d.ts +17 -0
- package/types/dashboard/card-affiliate.d.ts +24 -0
- package/types/dashboard/card-connection.d.ts +23 -0
- package/types/dashboard/card-data-item.d.ts +15 -0
- package/types/dashboard/card-integration.d.ts +24 -0
- package/types/dashboard/card-metric.d.ts +16 -0
- package/types/dashboard/card-note.d.ts +24 -0
- package/types/dashboard/card-order.d.ts +25 -0
- package/types/dashboard/card-overage.d.ts +26 -0
- package/types/dashboard/card-payment-method.d.ts +16 -0
- package/types/dashboard/card-plan.d.ts +28 -0
- package/types/dashboard/card-product.d.ts +14 -0
- package/types/dashboard/card-score.d.ts +38 -0
- package/types/dashboard/card-section.d.ts +13 -0
- package/types/dashboard/card-setting.d.ts +21 -0
- package/types/dashboard/card-task.d.ts +34 -0
- package/types/dashboard/card-template.d.ts +34 -0
- package/types/dashboard/card-tile.d.ts +54 -0
- package/types/dashboard/card-utm.d.ts +20 -0
- package/types/dashboard/carousel-tiles.d.ts +13 -0
- package/types/dashboard/code-formatter.d.ts +14 -0
- package/types/dashboard/drawer-subscription.d.ts +35 -0
- package/types/dashboard/drawer.d.ts +16 -0
- package/types/dashboard/dropdown.d.ts +33 -0
- package/types/dashboard/form-action.d.ts +20 -0
- package/types/dashboard/form-address.d.ts +28 -0
- package/types/dashboard/form-admin-campaign.d.ts +19 -0
- package/types/dashboard/form-admin-invoice-refund.d.ts +16 -0
- package/types/dashboard/form-admin-oauth.d.ts +20 -0
- package/types/dashboard/form-admin-organization.d.ts +17 -0
- package/types/dashboard/form-admin-provider.d.ts +33 -0
- package/types/dashboard/form-admin-referrer.d.ts +18 -0
- package/types/dashboard/form-admin-subscription-custom.d.ts +31 -0
- package/types/dashboard/form-admin-template.d.ts +16 -0
- package/types/dashboard/form-admin-user-credit.d.ts +12 -0
- package/types/dashboard/form-admin-user-permissions.d.ts +16 -0
- package/types/dashboard/form-admin-user-status.d.ts +11 -0
- package/types/dashboard/form-admin-utm.d.ts +39 -0
- package/types/dashboard/form-ai.d.ts +64 -0
- package/types/dashboard/form-auth.d.ts +64 -0
- package/types/dashboard/form-credit.d.ts +10 -0
- package/types/dashboard/form-file-upload.d.ts +16 -0
- package/types/dashboard/form-file.d.ts +33 -0
- package/types/dashboard/form-filters-analytics.d.ts +40 -0
- package/types/dashboard/form-filters.d.ts +70 -0
- package/types/dashboard/form-note.d.ts +15 -0
- package/types/dashboard/form-notification.d.ts +30 -0
- package/types/dashboard/form-organization-affiliate.d.ts +29 -0
- package/types/dashboard/form-organization-brand.d.ts +37 -0
- package/types/dashboard/form-organization-campaign-advertisement.d.ts +49 -0
- package/types/dashboard/form-organization-campaign-agreement.d.ts +25 -0
- package/types/dashboard/form-organization-campaign-draw.d.ts +30 -0
- package/types/dashboard/form-organization-campaign-field-email.d.ts +31 -0
- package/types/dashboard/form-organization-campaign-field-name.d.ts +28 -0
- package/types/dashboard/form-organization-campaign-field-number.d.ts +27 -0
- package/types/dashboard/form-organization-campaign-field-phone.d.ts +29 -0
- package/types/dashboard/form-organization-campaign-field-select.d.ts +29 -0
- package/types/dashboard/form-organization-campaign-field-text.d.ts +30 -0
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +28 -0
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +24 -0
- package/types/dashboard/form-organization-campaign-integration-enable.d.ts +24 -0
- package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +27 -0
- package/types/dashboard/form-organization-campaign-integration-gtm.d.ts +18 -0
- package/types/dashboard/form-organization-campaign-lead.d.ts +22 -0
- package/types/dashboard/form-organization-campaign-link.d.ts +28 -0
- package/types/dashboard/form-organization-campaign-page-affiliates.d.ts +16 -0
- package/types/dashboard/form-organization-campaign-page-embed.d.ts +14 -0
- package/types/dashboard/form-organization-campaign-page-preview.d.ts +23 -0
- package/types/dashboard/form-organization-campaign-page-qr.d.ts +44 -0
- package/types/dashboard/form-organization-campaign-page-share.d.ts +23 -0
- package/types/dashboard/form-organization-campaign-page-slug.d.ts +23 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +43 -0
- package/types/dashboard/form-organization-campaign-prize-edit.d.ts +39 -0
- package/types/dashboard/form-organization-campaign-prize.d.ts +11 -0
- package/types/dashboard/form-organization-campaign-range.d.ts +24 -0
- package/types/dashboard/form-organization-campaign.d.ts +49 -0
- package/types/dashboard/form-organization-connection.d.ts +47 -0
- package/types/dashboard/form-organization-export.d.ts +21 -0
- package/types/dashboard/form-organization-file-frame.d.ts +20 -0
- package/types/dashboard/form-organization-file.d.ts +33 -0
- package/types/dashboard/form-organization-identity.d.ts +87 -0
- package/types/dashboard/form-organization-member.d.ts +25 -0
- package/types/dashboard/form-organization-segment.d.ts +32 -0
- package/types/dashboard/form-organization-workflow.d.ts +78 -0
- package/types/dashboard/form-organization.d.ts +50 -0
- package/types/dashboard/form-otc.d.ts +29 -0
- package/types/dashboard/form-payment-methods.d.ts +22 -0
- package/types/dashboard/form-profile.d.ts +23 -0
- package/types/dashboard/form-stripe-promotion.d.ts +12 -0
- package/types/dashboard/form-stripe.d.ts +20 -0
- package/types/dashboard/form-verify-prize.d.ts +40 -0
- package/types/dashboard/google.d.ts +48 -0
- package/types/dashboard/guard-navigation.d.ts +11 -0
- package/types/dashboard/guide.d.ts +23 -0
- package/types/dashboard/iframe.d.ts +18 -0
- package/types/dashboard/input-address-saved.d.ts +9 -0
- package/types/dashboard/input-array.d.ts +56 -0
- package/types/dashboard/input-color.d.ts +20 -0
- package/types/dashboard/input-combobox.d.ts +30 -0
- package/types/dashboard/input-date.d.ts +32 -0
- package/types/dashboard/input-editor.d.ts +32 -0
- package/types/dashboard/input-fields.d.ts +49 -0
- package/types/dashboard/input-file.d.ts +30 -0
- package/types/dashboard/input-font.d.ts +20 -0
- package/types/dashboard/input-group-ai.d.ts +24 -0
- package/types/dashboard/input-radio.d.ts +19 -0
- package/types/dashboard/input-resource.d.ts +33 -0
- package/types/dashboard/input-secret.d.ts +32 -0
- package/types/dashboard/input-time.d.ts +25 -0
- package/types/dashboard/lib/confetti.d.ts +2 -0
- package/types/dashboard/lib/connection-controls.d.ts +12 -0
- package/types/dashboard/lib/features.d.ts +10 -0
- package/types/dashboard/lib/frames.d.ts +12 -0
- package/types/dashboard/lib/geo.d.ts +37 -0
- package/types/dashboard/lib/hooks.d.ts +65 -0
- package/types/dashboard/lib/navigation.d.ts +24 -0
- package/types/dashboard/lib/otc.d.ts +10 -0
- package/types/dashboard/lib/overage.d.ts +9 -0
- package/types/dashboard/lib/table-actions.d.ts +18 -0
- package/types/dashboard/lib/time-slots.d.ts +34 -0
- package/types/dashboard/lib/trickle.d.ts +11 -0
- package/types/dashboard/lib/uppy.d.ts +36 -0
- package/types/dashboard/lib/utm.d.ts +32 -0
- package/types/dashboard/link-back.d.ts +15 -0
- package/types/dashboard/link.d.ts +17 -0
- package/types/dashboard/list-resource.d.ts +39 -0
- package/types/dashboard/list.d.ts +26 -0
- package/types/dashboard/menu.d.ts +65 -0
- package/types/dashboard/modal.d.ts +20 -0
- package/types/dashboard/notes.d.ts +20 -0
- package/types/dashboard/notice.d.ts +20 -0
- package/types/dashboard/paged.d.ts +57 -0
- package/types/dashboard/provider-resource.d.ts +29 -0
- package/types/dashboard/provider-ui.d.ts +17 -0
- package/types/dashboard/provider.d.ts +12 -0
- package/types/dashboard/recharts.d.ts +32 -0
- package/types/dashboard/steps.d.ts +40 -0
- package/types/dashboard/swatch.d.ts +14 -0
- package/types/dashboard/table-cell-title.d.ts +24 -0
- package/types/dashboard/table.d.ts +106 -0
- package/types/dashboard/template-dashboard.d.ts +110 -0
- package/types/dashboard/template-not-found.d.ts +14 -0
- package/types/dashboard/template-socket.d.ts +17 -0
- package/types/dashboard/template-suspended.d.ts +12 -0
- package/types/dashboard/template-ui.d.ts +14 -0
- package/types/dashboard/wrapper-ai.d.ts +12 -0
- package/types/input-group.d.ts +1 -0
- package/types/input-phone.d.ts +2 -0
- package/types/input-textarea.d.ts +2 -0
- package/types/shared/address-lines.d.ts +14 -0
- package/types/shared/badge.d.ts +14 -0
- package/types/shared/button.d.ts +29 -0
- package/types/shared/card-asset.d.ts +29 -0
- package/types/shared/card-prize.d.ts +27 -0
- package/types/shared/carousel.d.ts +21 -0
- package/types/shared/copy-to-clipboard.d.ts +23 -0
- package/types/shared/divider.d.ts +11 -0
- package/types/shared/empty.d.ts +18 -0
- package/types/shared/error.d.ts +17 -0
- package/types/shared/fieldset.d.ts +17 -0
- package/types/shared/form.d.ts +13 -0
- package/types/shared/indicator.d.ts +10 -0
- package/types/shared/input-checkbox-list.d.ts +20 -0
- package/types/shared/input-range.d.ts +19 -0
- package/types/shared/input-switch.d.ts +16 -0
- package/types/shared/input-url.d.ts +14 -0
- package/types/shared/lib/form.d.ts +28 -0
- package/types/shared/lib/helpers.d.ts +145 -0
- package/types/shared/lib/icon-labels.d.ts +6 -0
- package/types/shared/lib/yup.d.ts +19 -0
- package/types/shared/loader.d.ts +14 -0
- package/types/shared/overlay.d.ts +20 -0
- package/types/shared/progress.d.ts +14 -0
- package/types/shared/provider-recaptcha.d.ts +10 -0
- package/types/shared/sortable.d.ts +14 -0
- package/types/shared/tabs.d.ts +32 -0
- package/types/shared/tooltip.d.ts +18 -0
- package/types/styles.d.ts +4 -0
- package/dist/chunk-24RIMAX7.mjs +0 -18
- package/dist/chunk-2ZYGRSSA.mjs +0 -45
- package/dist/chunk-34VHCLEM.mjs +0 -18
- package/dist/chunk-3ZVT66SF.mjs +0 -18
- package/dist/chunk-6F23WKP2.mjs +0 -104
- package/dist/chunk-7GRIGQDC.mjs +0 -98
- package/dist/chunk-DPFPNFJT.mjs +0 -387
- package/dist/chunk-DTGGUHVT.mjs +0 -18
- package/dist/chunk-FYA7EAMR.mjs +0 -29
- package/dist/chunk-G3FIQDKF.mjs +0 -18
- package/dist/chunk-GDO334JM.mjs +0 -18
- package/dist/chunk-GFDZ7ER6.mjs +0 -29
- package/dist/chunk-HH7WF5BT.mjs +0 -29
- package/dist/chunk-KJMXWB22.mjs +0 -18
- package/dist/chunk-KSCQQUFC.mjs +0 -89
- package/dist/chunk-OSTKXL5W.mjs +0 -18
- package/dist/chunk-PLX5YT4F.mjs +0 -18
- package/dist/chunk-PT7UR6AO.mjs +0 -208
- package/dist/chunk-Q3UIVGPQ.mjs +0 -29
- package/dist/chunk-S6X5EEMX.mjs +0 -18
- package/dist/chunk-T5QQBFM3.mjs +0 -29
- package/dist/chunk-TOR3Z64G.mjs +0 -18
- package/dist/chunk-WQXZE4EX.mjs +0 -18
- package/dist/chunk-WRQM5ECM.mjs +0 -18
- package/dist/chunk-WUZE3BIA.mjs +0 -122
- package/dist/chunk-Y466XTIK.mjs +0 -37
- package/dist/chunk-YEC7KSKN.mjs +0 -18
- package/dist/embla-fade.mjs +0 -6
- package/dist/embla.mjs +0 -6
- package/dist/input-group-error.js +0 -132
- package/dist/input-group-error.mjs +0 -7
- package/types/embla-fade.d.ts +0 -2
- package/types/embla.d.ts +0 -2
- package/types/input-group-error.d.ts +0 -14
|
@@ -0,0 +1,1109 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Image from "next/image";
|
|
3
|
+
import Link from "./link";
|
|
4
|
+
import { Fragment, useCallback, useState } from "react";
|
|
5
|
+
import { request } from "@drawbridge/drawbridge-utils/fetch";
|
|
6
|
+
import { useForm, useWatch, Controller } from "../shared/lib/form";
|
|
7
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
8
|
+
import yup, { resolver } from "../shared/lib/yup";
|
|
9
|
+
import Form from "../shared/form";
|
|
10
|
+
import Fieldset from "../shared/fieldset";
|
|
11
|
+
import InputGroup from "../input-group";
|
|
12
|
+
import Error from "../shared/error";
|
|
13
|
+
import InputText from "../input-text";
|
|
14
|
+
import InputUrl from "../shared/input-url";
|
|
15
|
+
import InputResource from "./input-resource";
|
|
16
|
+
import InputCombobox from "./input-combobox";
|
|
17
|
+
import { FormNotification } from "./form-notification";
|
|
18
|
+
import { InputArrayButton, InputArrayControl, InputArraySortable } from "./input-array";
|
|
19
|
+
import Badge from "../shared/badge";
|
|
20
|
+
import CardTask from "./card-task";
|
|
21
|
+
import { LoaderDynamic } from "../shared/loader";
|
|
22
|
+
import Trash from "../icons/trash";
|
|
23
|
+
import Button from "../shared/button";
|
|
24
|
+
const emailSteps = ["step.email.send", "step.email.digest"];
|
|
25
|
+
const teamSteps = ["step.email.notify", "step.email.digest"];
|
|
26
|
+
const messageSteps = [...emailSteps, "step.sms.send"];
|
|
27
|
+
const defaultScore = {
|
|
28
|
+
rules: [
|
|
29
|
+
{ description: "From: domain has series of non-vowel letters", score: 0.5 },
|
|
30
|
+
{ description: "Informational: message was not relayed via SMTP", score: 0 },
|
|
31
|
+
{ description: "Informational: message has no Received headers", score: 0 }
|
|
32
|
+
],
|
|
33
|
+
subtotal: 0,
|
|
34
|
+
threshold: 5,
|
|
35
|
+
total: 0.5
|
|
36
|
+
};
|
|
37
|
+
const stepPrefills = {
|
|
38
|
+
"step.email.send": {
|
|
39
|
+
message: "Thanks for entering. We have your entry and will be in touch.",
|
|
40
|
+
score: defaultScore,
|
|
41
|
+
subject: "Thanks for entering",
|
|
42
|
+
text: "Thanks for entering. We have your entry and will be in touch."
|
|
43
|
+
},
|
|
44
|
+
// Nothing to prefill — the step writes its own copy — but the entry has to
|
|
45
|
+
// exist: an unlisted step arrives from the deep link with no settings shape
|
|
46
|
+
// and the drawer creates the workflow without it.
|
|
47
|
+
"step.email.notify": {},
|
|
48
|
+
"step.email.digest": {
|
|
49
|
+
message: "You had {{count}} new entries.",
|
|
50
|
+
score: defaultScore,
|
|
51
|
+
subject: "Your entries",
|
|
52
|
+
text: "You had {{count}} new entries."
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const memberParams = {
|
|
56
|
+
filters: {
|
|
57
|
+
status: "accepted"
|
|
58
|
+
},
|
|
59
|
+
limit: 100,
|
|
60
|
+
skip: 0,
|
|
61
|
+
sort: {
|
|
62
|
+
createdAt: -1
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const useOrganizationMembers = (organization) => {
|
|
66
|
+
var _a;
|
|
67
|
+
const members = useQuery({
|
|
68
|
+
queryKey: ["organization-members", organization, "options"],
|
|
69
|
+
queryFn: async () => {
|
|
70
|
+
const { result } = await request({
|
|
71
|
+
endpoint: "/organization/" + organization + "/members",
|
|
72
|
+
// limit / skip / sort are required by the route's query validation.
|
|
73
|
+
params: memberParams
|
|
74
|
+
});
|
|
75
|
+
return result;
|
|
76
|
+
},
|
|
77
|
+
enabled: Boolean(organization),
|
|
78
|
+
staleTime: Infinity
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
items: ((_a = members.data) == null ? void 0 : _a.items) || [],
|
|
82
|
+
// isLoading, not isPending: a query disabled for want of an organization
|
|
83
|
+
// is pending forever but never loading, and must not hold the form.
|
|
84
|
+
loading: members.isLoading
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const memberLabel = (member) => {
|
|
88
|
+
var _a, _b, _c;
|
|
89
|
+
return [(_a = member == null ? void 0 : member.user) == null ? void 0 : _a.firstName, (_b = member == null ? void 0 : member.user) == null ? void 0 : _b.lastName].filter(Boolean).join(" ") || (member == null ? void 0 : member.email) || ((_c = member == null ? void 0 : member.user) == null ? void 0 : _c.email) || "Member";
|
|
90
|
+
};
|
|
91
|
+
const useWorkflowCatalog = (organization, current) => {
|
|
92
|
+
const catalog = useQuery({
|
|
93
|
+
queryKey: ["organization-workflow-catalog", organization],
|
|
94
|
+
queryFn: async () => {
|
|
95
|
+
const { result } = await request({
|
|
96
|
+
endpoint: "/organization/" + organization + "/workflows/catalog"
|
|
97
|
+
});
|
|
98
|
+
return result;
|
|
99
|
+
},
|
|
100
|
+
enabled: Boolean(organization),
|
|
101
|
+
staleTime: Infinity
|
|
102
|
+
});
|
|
103
|
+
const catalogList = catalog.data || [];
|
|
104
|
+
const triggerGroups = catalogList.filter((item) => item.type !== "schedule" || item.trigger === current).reduce((groups, item) => {
|
|
105
|
+
const model = item.type === "schedule" ? "schedule" : item.trigger.split(".")[0];
|
|
106
|
+
if (!groups[model]) groups[model] = [];
|
|
107
|
+
groups[model].push(item);
|
|
108
|
+
return groups;
|
|
109
|
+
}, {});
|
|
110
|
+
const triggerOptions = [
|
|
111
|
+
{ key: "Select a trigger", value: "" },
|
|
112
|
+
...Object.entries(triggerGroups).sort(([a], [b]) => a.localeCompare(b)).flatMap(([model, items]) => [
|
|
113
|
+
{ key: model.charAt(0).toUpperCase() + model.slice(1), header: true },
|
|
114
|
+
...items.sort((a, b) => a.title.localeCompare(b.title)).map((item) => ({
|
|
115
|
+
image: item.image,
|
|
116
|
+
key: item.title,
|
|
117
|
+
value: item.trigger
|
|
118
|
+
}))
|
|
119
|
+
])
|
|
120
|
+
];
|
|
121
|
+
return { catalog, catalogList, triggerOptions };
|
|
122
|
+
};
|
|
123
|
+
const WorkflowTriggerField = ({ control, formState, catalogList, triggerOptions, getValues, setValue }) => /* @__PURE__ */ jsx(
|
|
124
|
+
Controller,
|
|
125
|
+
{
|
|
126
|
+
...{
|
|
127
|
+
control,
|
|
128
|
+
name: "triggerEvent",
|
|
129
|
+
render: ({ field: { value, onChange } }) => {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
return /* @__PURE__ */ jsx(
|
|
132
|
+
InputGroup,
|
|
133
|
+
{
|
|
134
|
+
...{
|
|
135
|
+
error: (_b = (_a = formState == null ? void 0 : formState.errors) == null ? void 0 : _a.triggerEvent) == null ? void 0 : _b.message,
|
|
136
|
+
input: /* @__PURE__ */ jsx(
|
|
137
|
+
InputCombobox,
|
|
138
|
+
{
|
|
139
|
+
...{
|
|
140
|
+
onChange: (val) => {
|
|
141
|
+
onChange(val);
|
|
142
|
+
const entry = catalogList.find((item) => item.trigger === val);
|
|
143
|
+
if (entry) {
|
|
144
|
+
const currentTitle = getValues("title");
|
|
145
|
+
const catalogTitles = catalogList.map((item) => item.title);
|
|
146
|
+
if (!currentTitle || catalogTitles.includes(currentTitle)) {
|
|
147
|
+
setValue("title", entry.title);
|
|
148
|
+
}
|
|
149
|
+
;
|
|
150
|
+
}
|
|
151
|
+
;
|
|
152
|
+
},
|
|
153
|
+
options: triggerOptions,
|
|
154
|
+
value: value || ""
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
label: "Trigger"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
const WorkflowTitleField = ({ control, formState }) => /* @__PURE__ */ jsx(
|
|
167
|
+
Controller,
|
|
168
|
+
{
|
|
169
|
+
...{
|
|
170
|
+
control,
|
|
171
|
+
name: "title",
|
|
172
|
+
render: ({ field: { value, onChange } }) => {
|
|
173
|
+
var _a, _b;
|
|
174
|
+
return /* @__PURE__ */ jsx(
|
|
175
|
+
InputGroup,
|
|
176
|
+
{
|
|
177
|
+
...{
|
|
178
|
+
error: (_b = (_a = formState == null ? void 0 : formState.errors) == null ? void 0 : _a.title) == null ? void 0 : _b.message,
|
|
179
|
+
input: /* @__PURE__ */ jsx(
|
|
180
|
+
InputText,
|
|
181
|
+
{
|
|
182
|
+
...{
|
|
183
|
+
onChange,
|
|
184
|
+
placeholder: "Workflow name",
|
|
185
|
+
value: value || ""
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
label: "Title"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
const campaignFilterId = (campaign) => (campaign == null ? void 0 : campaign.id) || campaign || null;
|
|
198
|
+
const WorkflowFilterField = ({
|
|
199
|
+
collection,
|
|
200
|
+
control,
|
|
201
|
+
label,
|
|
202
|
+
message,
|
|
203
|
+
model,
|
|
204
|
+
name,
|
|
205
|
+
organization,
|
|
206
|
+
resource
|
|
207
|
+
}) => {
|
|
208
|
+
const queryClient = useQueryClient();
|
|
209
|
+
const id = useWatch({
|
|
210
|
+
control,
|
|
211
|
+
name
|
|
212
|
+
});
|
|
213
|
+
const selected = useQuery({
|
|
214
|
+
queryKey: ["workflow-filter", model, organization, id],
|
|
215
|
+
queryFn: async () => {
|
|
216
|
+
const { result } = await request({
|
|
217
|
+
endpoint: "/organization/" + organization + "/" + resource + "/" + id
|
|
218
|
+
}).catch(() => ({ result: null }));
|
|
219
|
+
return result;
|
|
220
|
+
},
|
|
221
|
+
enabled: Boolean(id),
|
|
222
|
+
staleTime: Infinity
|
|
223
|
+
});
|
|
224
|
+
return /* @__PURE__ */ jsx(
|
|
225
|
+
Controller,
|
|
226
|
+
{
|
|
227
|
+
...{
|
|
228
|
+
control,
|
|
229
|
+
name,
|
|
230
|
+
render: ({ field: { onChange } }) => /* @__PURE__ */ jsx(
|
|
231
|
+
InputGroup,
|
|
232
|
+
{
|
|
233
|
+
...{
|
|
234
|
+
input: /* @__PURE__ */ jsx(
|
|
235
|
+
InputResource,
|
|
236
|
+
{
|
|
237
|
+
...{
|
|
238
|
+
endpoint: "/organization/" + organization + "/" + collection,
|
|
239
|
+
model,
|
|
240
|
+
onChange: (doc) => {
|
|
241
|
+
if (doc == null ? void 0 : doc.id) queryClient.setQueryData(["workflow-filter", model, organization, doc.id], doc);
|
|
242
|
+
onChange((doc == null ? void 0 : doc.id) || null);
|
|
243
|
+
},
|
|
244
|
+
value: selected.data || null
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
label,
|
|
249
|
+
message
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
const stepRow = (step = {}, members = []) => {
|
|
258
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
259
|
+
return {
|
|
260
|
+
connectionId: step.connectionId || "",
|
|
261
|
+
discount: ((_a = step.settings) == null ? void 0 : _a.discount) || null,
|
|
262
|
+
// Stored as ids, picked as documents. Hydrating through the fetched list
|
|
263
|
+
// also drops ids whose member no longer exists — a removed teammate
|
|
264
|
+
// leaves their id on the step, and an id with nothing behind it would
|
|
265
|
+
// render as an unlabelled chip nobody could identify.
|
|
266
|
+
members: (((_b = step.settings) == null ? void 0 : _b.members) || []).map((id) => members.find((member) => (member == null ? void 0 : member.id) === id)).filter(Boolean),
|
|
267
|
+
message: ((_c = step.settings) == null ? void 0 : _c.message) || "",
|
|
268
|
+
// THE LAST SPAM CHECK, RE-TAGGED WITH THE COPY IT MEASURED.
|
|
269
|
+
//
|
|
270
|
+
// The api stores a score without that copy and tests the tag again on the
|
|
271
|
+
// way back in, so seeding a bare score would fail the test and clear the
|
|
272
|
+
// stored result on every save. Putting the pair back on is the other half of
|
|
273
|
+
// a round trip the api already expects — and it is what lets the step panel
|
|
274
|
+
// open showing the last result instead of spending a request on a free
|
|
275
|
+
// service to be told what is already in the fields.
|
|
276
|
+
score: ((_d = step.settings) == null ? void 0 : _d.score) ? {
|
|
277
|
+
...step.settings.score,
|
|
278
|
+
message: ((_e = step.settings) == null ? void 0 : _e.message) || "",
|
|
279
|
+
subject: ((_f = step.settings) == null ? void 0 : _f.subject) || ""
|
|
280
|
+
} : null,
|
|
281
|
+
slug: step.slug || "",
|
|
282
|
+
subject: ((_g = step.settings) == null ? void 0 : _g.subject) || "",
|
|
283
|
+
// The editor writes this only when the merchant touches it, so without a
|
|
284
|
+
// seed an untouched save dropped the plain rendering of the message.
|
|
285
|
+
text: ((_h = step.settings) == null ? void 0 : _h.text) || "",
|
|
286
|
+
type: step.type || "",
|
|
287
|
+
url: ((_i = step.settings) == null ? void 0 : _i.url) || ""
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
const FormOrganizationWorkflow = ({
|
|
291
|
+
disabled,
|
|
292
|
+
onClose,
|
|
293
|
+
onError,
|
|
294
|
+
onSuccess,
|
|
295
|
+
values
|
|
296
|
+
}) => {
|
|
297
|
+
const { catalog, catalogList, triggerOptions } = useWorkflowCatalog(values == null ? void 0 : values.organization, values == null ? void 0 : values.triggerEvent);
|
|
298
|
+
const { control, formState, getValues, handleSubmit, setValue } = useForm({
|
|
299
|
+
defaultValues: {
|
|
300
|
+
title: "",
|
|
301
|
+
triggerEvent: (values == null ? void 0 : values.triggerEvent) || ""
|
|
302
|
+
},
|
|
303
|
+
resolver: resolver(
|
|
304
|
+
yup.object({
|
|
305
|
+
title: yup.string().required().max(100).label("Title"),
|
|
306
|
+
triggerEvent: yup.string().label("Trigger").required("A trigger is required")
|
|
307
|
+
})
|
|
308
|
+
)
|
|
309
|
+
});
|
|
310
|
+
const watchedTrigger = useWatch({
|
|
311
|
+
control,
|
|
312
|
+
name: "triggerEvent"
|
|
313
|
+
});
|
|
314
|
+
const onSubmit = async ({ title, triggerEvent }) => {
|
|
315
|
+
const prefill = stepPrefills[values == null ? void 0 : values.step];
|
|
316
|
+
const prefilledSteps = prefill ? [{
|
|
317
|
+
settings: { ...prefill },
|
|
318
|
+
type: values.step
|
|
319
|
+
}] : [];
|
|
320
|
+
try {
|
|
321
|
+
const response = await request({
|
|
322
|
+
body: {
|
|
323
|
+
steps: prefilledSteps,
|
|
324
|
+
title,
|
|
325
|
+
trigger: {
|
|
326
|
+
event: triggerEvent,
|
|
327
|
+
filters: {
|
|
328
|
+
// Both blank, meaning every campaign and every segment. The
|
|
329
|
+
// create drawer asks for a trigger and a title only; narrowing
|
|
330
|
+
// is done on the workflow page afterwards.
|
|
331
|
+
campaign: null,
|
|
332
|
+
segment: null
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
endpoint: "/organization/" + (values == null ? void 0 : values.organization) + "/workflow",
|
|
337
|
+
method: "POST"
|
|
338
|
+
});
|
|
339
|
+
onSuccess(response);
|
|
340
|
+
onClose == null ? void 0 : onClose();
|
|
341
|
+
} catch (error) {
|
|
342
|
+
onError(error);
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
if (catalog.isLoading) {
|
|
346
|
+
return /* @__PURE__ */ jsx(LoaderDynamic, {});
|
|
347
|
+
}
|
|
348
|
+
return /* @__PURE__ */ jsx(
|
|
349
|
+
Form,
|
|
350
|
+
{
|
|
351
|
+
...{
|
|
352
|
+
className: "relative w-full",
|
|
353
|
+
onSubmit: handleSubmit(onSubmit)
|
|
354
|
+
},
|
|
355
|
+
children: /* @__PURE__ */ jsxs(
|
|
356
|
+
Fieldset,
|
|
357
|
+
{
|
|
358
|
+
...{
|
|
359
|
+
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
360
|
+
},
|
|
361
|
+
children: [
|
|
362
|
+
/* @__PURE__ */ jsx(
|
|
363
|
+
WorkflowTriggerField,
|
|
364
|
+
{
|
|
365
|
+
...{
|
|
366
|
+
control,
|
|
367
|
+
formState,
|
|
368
|
+
catalogList,
|
|
369
|
+
triggerOptions,
|
|
370
|
+
getValues,
|
|
371
|
+
setValue
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
),
|
|
375
|
+
watchedTrigger && /* @__PURE__ */ jsx(
|
|
376
|
+
WorkflowTitleField,
|
|
377
|
+
{
|
|
378
|
+
...{
|
|
379
|
+
control,
|
|
380
|
+
formState
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
/* @__PURE__ */ jsx(
|
|
385
|
+
Button,
|
|
386
|
+
{
|
|
387
|
+
...{
|
|
388
|
+
loading: formState == null ? void 0 : formState.isSubmitting,
|
|
389
|
+
type: "submit"
|
|
390
|
+
},
|
|
391
|
+
children: "Create workflow"
|
|
392
|
+
}
|
|
393
|
+
)
|
|
394
|
+
]
|
|
395
|
+
}
|
|
396
|
+
)
|
|
397
|
+
}
|
|
398
|
+
);
|
|
399
|
+
};
|
|
400
|
+
const FormOrganizationWorkflowEdit = ({
|
|
401
|
+
disabled,
|
|
402
|
+
onClose,
|
|
403
|
+
onError,
|
|
404
|
+
onSuccess,
|
|
405
|
+
values
|
|
406
|
+
}) => {
|
|
407
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
408
|
+
const { catalog, catalogList, triggerOptions } = useWorkflowCatalog(values == null ? void 0 : values.organization, (_a = values == null ? void 0 : values.trigger) == null ? void 0 : _a.event);
|
|
409
|
+
const { items: memberItems, loading: membersLoading } = useOrganizationMembers(values == null ? void 0 : values.organization);
|
|
410
|
+
const queryClient = useQueryClient();
|
|
411
|
+
const ownerEmail = queryClient.getQueryData(["organization", values == null ? void 0 : values.organization]).owner.email;
|
|
412
|
+
const commerceConnectionId = ((_b = catalogList.flatMap((item) => item.steps || []).find(
|
|
413
|
+
(s) => s.value === "step.commerce.customer.insert" || s.value === "step.commerce.code.issue"
|
|
414
|
+
)) == null ? void 0 : _b.connectionId) || null;
|
|
415
|
+
const commerceConnection = useQuery({
|
|
416
|
+
queryKey: ["commerce-connection", values == null ? void 0 : values.organization, commerceConnectionId],
|
|
417
|
+
queryFn: async () => {
|
|
418
|
+
const { result } = await request({
|
|
419
|
+
endpoint: "/organization/" + (values == null ? void 0 : values.organization) + "/connection/" + commerceConnectionId
|
|
420
|
+
});
|
|
421
|
+
return result;
|
|
422
|
+
},
|
|
423
|
+
enabled: Boolean((values == null ? void 0 : values.organization) && commerceConnectionId),
|
|
424
|
+
staleTime: Infinity
|
|
425
|
+
});
|
|
426
|
+
const commerceDomain = ((_d = (_c = commerceConnection.data) == null ? void 0 : _c.source) == null ? void 0 : _d.domain) || ((_f = (_e = commerceConnection.data) == null ? void 0 : _e.settings) == null ? void 0 : _f.domain) || null;
|
|
427
|
+
const defaultSteps = ((values == null ? void 0 : values.steps) || []).map((s) => stepRow(s, memberItems));
|
|
428
|
+
const [checking, setChecking] = useState({});
|
|
429
|
+
const checkingAny = Object.values(checking).some(Boolean);
|
|
430
|
+
const onChecking = useCallback(
|
|
431
|
+
(id, value) => setChecking(
|
|
432
|
+
(current) => Boolean(current[id]) === value ? current : { ...current, [id]: value }
|
|
433
|
+
),
|
|
434
|
+
[]
|
|
435
|
+
);
|
|
436
|
+
const { control, formState, getValues, handleSubmit, setValue } = useForm({
|
|
437
|
+
values: {
|
|
438
|
+
steps: defaultSteps,
|
|
439
|
+
filterCampaign: campaignFilterId((_h = (_g = values == null ? void 0 : values.trigger) == null ? void 0 : _g.filters) == null ? void 0 : _h.campaign),
|
|
440
|
+
// Stored and returned as a plain id — extend.workflow() $lookup-hydrates
|
|
441
|
+
// only the campaign — but read through the same reducer, so the field
|
|
442
|
+
// stays right if the segment is ever hydrated too.
|
|
443
|
+
filterSegment: campaignFilterId((_j = (_i = values == null ? void 0 : values.trigger) == null ? void 0 : _i.filters) == null ? void 0 : _j.segment),
|
|
444
|
+
title: (values == null ? void 0 : values.title) || "",
|
|
445
|
+
triggerEvent: ((_k = values == null ? void 0 : values.trigger) == null ? void 0 : _k.event) || ""
|
|
446
|
+
},
|
|
447
|
+
resolver: resolver(
|
|
448
|
+
yup.object({
|
|
449
|
+
title: yup.string().required().max(100).label("Title"),
|
|
450
|
+
triggerEvent: yup.string().label("Trigger").required("A trigger is required"),
|
|
451
|
+
steps: yup.array().of(
|
|
452
|
+
yup.object({
|
|
453
|
+
type: yup.string().label("Step").required("A step is required"),
|
|
454
|
+
url: yup.string().when("type", ([type], schema) => {
|
|
455
|
+
if (type === "step.webhook.send") {
|
|
456
|
+
return schema.url().required("URL is required").label("URL");
|
|
457
|
+
}
|
|
458
|
+
return schema;
|
|
459
|
+
}),
|
|
460
|
+
subject: yup.string().when("type", ([type], schema) => {
|
|
461
|
+
if (messageSteps.includes(type)) {
|
|
462
|
+
return schema.required("Subject is required").label("Subject");
|
|
463
|
+
}
|
|
464
|
+
return schema;
|
|
465
|
+
}),
|
|
466
|
+
message: yup.string().when("type", ([type], schema) => {
|
|
467
|
+
if (messageSteps.includes(type)) {
|
|
468
|
+
return schema.required("Message is required").label("Message");
|
|
469
|
+
}
|
|
470
|
+
return schema;
|
|
471
|
+
}),
|
|
472
|
+
// No minimum. The organization owner is always a recipient, so a
|
|
473
|
+
// step with no members chosen is complete — requiring one here
|
|
474
|
+
// made the step unsaveable for a solo merchant, who has no
|
|
475
|
+
// member documents to choose and cannot reach the members
|
|
476
|
+
// endpoint at all.
|
|
477
|
+
members: yup.array().label("Recipients"),
|
|
478
|
+
discount: yup.object().nullable().when("type", ([type], schema) => {
|
|
479
|
+
if (type === "step.commerce.code.issue") {
|
|
480
|
+
return schema.required("Discount is required").label("Discount");
|
|
481
|
+
}
|
|
482
|
+
return schema;
|
|
483
|
+
})
|
|
484
|
+
})
|
|
485
|
+
)
|
|
486
|
+
})
|
|
487
|
+
)
|
|
488
|
+
});
|
|
489
|
+
const watchedTrigger = useWatch({
|
|
490
|
+
control,
|
|
491
|
+
name: "triggerEvent"
|
|
492
|
+
});
|
|
493
|
+
const watchedSteps = useWatch({
|
|
494
|
+
control,
|
|
495
|
+
name: "steps"
|
|
496
|
+
});
|
|
497
|
+
const issueIndex = ((_l = values == null ? void 0 : values.issue) == null ? void 0 : _l.step) ? (watchedSteps || []).findIndex((step) => (step == null ? void 0 : step.type) === values.issue.step) : -1;
|
|
498
|
+
const selectedTriggerEntry = catalogList.find((item) => item.trigger === watchedTrigger) || null;
|
|
499
|
+
const getAvailableVariables = (index) => {
|
|
500
|
+
return watchedSteps.slice(0, index).flatMap((watchedStep) => {
|
|
501
|
+
const stepDef = ((selectedTriggerEntry == null ? void 0 : selectedTriggerEntry.steps) || []).find((s) => s.value === watchedStep.type);
|
|
502
|
+
return (stepDef == null ? void 0 : stepDef.returns) || [];
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
const getStepOptions = (index) => {
|
|
506
|
+
const usedTypes = watchedSteps.map((s, i) => i !== index ? s.type : null).filter(Boolean);
|
|
507
|
+
return [
|
|
508
|
+
{ key: "Select a step", value: "" },
|
|
509
|
+
...((selectedTriggerEntry == null ? void 0 : selectedTriggerEntry.steps) || []).filter((step) => !usedTypes.includes(step.value)).filter((step) => {
|
|
510
|
+
var _a2;
|
|
511
|
+
return !step.ownerOnly || step.value === ((_a2 = watchedSteps[index]) == null ? void 0 : _a2.type);
|
|
512
|
+
}).sort((a, b) => String(a.key).localeCompare(String(b.key))).map((step) => ({
|
|
513
|
+
...step,
|
|
514
|
+
// Option values must be unique per catalog entry, not per step
|
|
515
|
+
// type. Two connections offering the same step type collide,
|
|
516
|
+
// because the select resolves its displayed option by first value
|
|
517
|
+
// match — so a disconnected step rendered as whichever entry came
|
|
518
|
+
// first. Suffix the connectionId when active, the connection slug
|
|
519
|
+
// when not.
|
|
520
|
+
//
|
|
521
|
+
// The collision that produced this was mailchimp and sendgrid both
|
|
522
|
+
// offering `step.email.send`. Neither does now — email steps are
|
|
523
|
+
// connectionless and sendgrid is gone — but the rule is about any
|
|
524
|
+
// two entries sharing a type, so it stays.
|
|
525
|
+
value: step.connectionId ? step.value + "::" + step.connectionId : step.slug ? step.value + "::" + step.slug : step.value,
|
|
526
|
+
...step.disabled ? {
|
|
527
|
+
badge: {
|
|
528
|
+
text: "Enable connection"
|
|
529
|
+
},
|
|
530
|
+
disabled: false,
|
|
531
|
+
element: Link,
|
|
532
|
+
key: step == null ? void 0 : step.key,
|
|
533
|
+
props: {
|
|
534
|
+
href: "/organizations/" + (values == null ? void 0 : values.organization) + "/connections/" + step.slug,
|
|
535
|
+
onClick: onClose
|
|
536
|
+
}
|
|
537
|
+
} : {}
|
|
538
|
+
}))
|
|
539
|
+
];
|
|
540
|
+
};
|
|
541
|
+
const lockedStep = (index) => ((selectedTriggerEntry == null ? void 0 : selectedTriggerEntry.steps) || []).some((s) => {
|
|
542
|
+
var _a2;
|
|
543
|
+
return s.ownerOnly && s.value === ((_a2 = watchedSteps[index]) == null ? void 0 : _a2.type);
|
|
544
|
+
});
|
|
545
|
+
const getStepValue = (field, index) => {
|
|
546
|
+
if (!field.type) return "";
|
|
547
|
+
const options = getStepOptions(index);
|
|
548
|
+
const stored = field.connectionId ? field.type + "::" + field.connectionId : field.type;
|
|
549
|
+
if (options.some((o) => o.value === stored)) return stored;
|
|
550
|
+
const sameType = options.filter((o) => o.value.split("::")[0] === field.type);
|
|
551
|
+
const match = field.slug && sameType.find((o) => o.slug === field.slug) || sameType[0];
|
|
552
|
+
return match ? match.value : "";
|
|
553
|
+
};
|
|
554
|
+
const getStepConnection = (field) => {
|
|
555
|
+
const steps = (selectedTriggerEntry == null ? void 0 : selectedTriggerEntry.steps) || [];
|
|
556
|
+
const def = field.connectionId && steps.find((s) => s.connectionId === field.connectionId) || field.slug && steps.find((s) => s.slug === field.slug && s.value === field.type) || steps.find((s) => s.value === field.type);
|
|
557
|
+
if (!def) return null;
|
|
558
|
+
const connected = Boolean(def.connectionId);
|
|
559
|
+
if (!connected && !def.disabled) return null;
|
|
560
|
+
return {
|
|
561
|
+
connected,
|
|
562
|
+
image: def.image,
|
|
563
|
+
name: def.key,
|
|
564
|
+
slug: def.slug
|
|
565
|
+
};
|
|
566
|
+
};
|
|
567
|
+
const renderStepBadge = (field) => {
|
|
568
|
+
const conn = getStepConnection(field);
|
|
569
|
+
if (!conn) return null;
|
|
570
|
+
return /* @__PURE__ */ jsx(
|
|
571
|
+
Badge,
|
|
572
|
+
{
|
|
573
|
+
...{
|
|
574
|
+
size: "small",
|
|
575
|
+
type: conn.connected ? "success" : "error"
|
|
576
|
+
},
|
|
577
|
+
children: conn.connected ? "Connected" : "Not connected"
|
|
578
|
+
}
|
|
579
|
+
);
|
|
580
|
+
};
|
|
581
|
+
const onSubmit = async ({
|
|
582
|
+
steps,
|
|
583
|
+
filterCampaign,
|
|
584
|
+
filterSegment,
|
|
585
|
+
title,
|
|
586
|
+
triggerEvent
|
|
587
|
+
}) => {
|
|
588
|
+
try {
|
|
589
|
+
const body = {
|
|
590
|
+
steps: steps.map(({ connectionId, discount, members, message, score, slug, subject, text, type, url }, index) => {
|
|
591
|
+
const settings = {};
|
|
592
|
+
if (type === "step.webhook.send") settings.url = url;
|
|
593
|
+
if (messageSteps.includes(type)) {
|
|
594
|
+
settings.subject = subject;
|
|
595
|
+
settings.message = message;
|
|
596
|
+
}
|
|
597
|
+
if (emailSteps.includes(type)) {
|
|
598
|
+
if (score && score.subject === subject && score.message === message) settings.score = score;
|
|
599
|
+
else if (score) setValue("steps." + index + ".score", null);
|
|
600
|
+
if (text) settings.text = text;
|
|
601
|
+
}
|
|
602
|
+
if (teamSteps.includes(type)) settings.members = (members || []).map((member) => member == null ? void 0 : member.id).filter(Boolean);
|
|
603
|
+
if (type === "step.commerce.code.issue") settings.discount = discount;
|
|
604
|
+
const catalogSteps = (selectedTriggerEntry == null ? void 0 : selectedTriggerEntry.steps) || [];
|
|
605
|
+
const catalogStep = connectionId && catalogSteps.find((s) => s.connectionId === connectionId) || slug && catalogSteps.find((s) => s.slug === slug && s.value === type) || catalogSteps.find((s) => s.value === type);
|
|
606
|
+
const resolvedConnectionId = (catalogStep == null ? void 0 : catalogStep.connectionId) || connectionId || null;
|
|
607
|
+
const resolvedSlug = (catalogStep == null ? void 0 : catalogStep.slug) || slug || null;
|
|
608
|
+
return {
|
|
609
|
+
...resolvedConnectionId && { connectionId: resolvedConnectionId },
|
|
610
|
+
...resolvedSlug && { slug: resolvedSlug },
|
|
611
|
+
settings,
|
|
612
|
+
type
|
|
613
|
+
};
|
|
614
|
+
}),
|
|
615
|
+
title,
|
|
616
|
+
trigger: {
|
|
617
|
+
event: triggerEvent,
|
|
618
|
+
filters: {
|
|
619
|
+
campaign: filterCampaign || null,
|
|
620
|
+
segment: filterSegment || null
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
const response = await request({
|
|
625
|
+
body,
|
|
626
|
+
endpoint: "/organization/" + (values == null ? void 0 : values.organization) + "/workflow/" + values.id,
|
|
627
|
+
method: "PUT"
|
|
628
|
+
});
|
|
629
|
+
onSuccess(response);
|
|
630
|
+
} catch (error) {
|
|
631
|
+
onError(error);
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
if (catalog.isLoading || membersLoading || commerceConnection.isLoading) {
|
|
635
|
+
return /* @__PURE__ */ jsx(LoaderDynamic, {});
|
|
636
|
+
}
|
|
637
|
+
return /* @__PURE__ */ jsx(
|
|
638
|
+
Form,
|
|
639
|
+
{
|
|
640
|
+
...{
|
|
641
|
+
className: "relative w-full",
|
|
642
|
+
onSubmit: handleSubmit(onSubmit)
|
|
643
|
+
},
|
|
644
|
+
children: /* @__PURE__ */ jsxs(
|
|
645
|
+
Fieldset,
|
|
646
|
+
{
|
|
647
|
+
...{
|
|
648
|
+
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting)
|
|
649
|
+
},
|
|
650
|
+
children: [
|
|
651
|
+
/* @__PURE__ */ jsx(
|
|
652
|
+
CardTask,
|
|
653
|
+
{
|
|
654
|
+
...{
|
|
655
|
+
message: "Workflows run sequences that increase action usage.",
|
|
656
|
+
title: "Workflows count towards actions",
|
|
657
|
+
type: "warning"
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
),
|
|
661
|
+
/* @__PURE__ */ jsx(
|
|
662
|
+
WorkflowTriggerField,
|
|
663
|
+
{
|
|
664
|
+
...{
|
|
665
|
+
control,
|
|
666
|
+
formState,
|
|
667
|
+
catalogList,
|
|
668
|
+
triggerOptions,
|
|
669
|
+
getValues,
|
|
670
|
+
setValue
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
),
|
|
674
|
+
watchedTrigger && /* @__PURE__ */ jsx(
|
|
675
|
+
WorkflowTitleField,
|
|
676
|
+
{
|
|
677
|
+
...{
|
|
678
|
+
control,
|
|
679
|
+
formState
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
),
|
|
683
|
+
watchedTrigger === "lead.insert" && /* @__PURE__ */ jsx(
|
|
684
|
+
WorkflowFilterField,
|
|
685
|
+
{
|
|
686
|
+
...{
|
|
687
|
+
collection: "campaigns",
|
|
688
|
+
control,
|
|
689
|
+
label: "Campaign",
|
|
690
|
+
message: "Only trigger for leads from a specific campaign. Leaving blank will trigger for all campaigns.",
|
|
691
|
+
model: "campaign",
|
|
692
|
+
name: "filterCampaign",
|
|
693
|
+
organization: values == null ? void 0 : values.organization,
|
|
694
|
+
resource: "campaign"
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
),
|
|
698
|
+
watchedTrigger === "segment.contact.add" && /* @__PURE__ */ jsx(
|
|
699
|
+
WorkflowFilterField,
|
|
700
|
+
{
|
|
701
|
+
...{
|
|
702
|
+
collection: "segments",
|
|
703
|
+
control,
|
|
704
|
+
label: "Segment",
|
|
705
|
+
message: "Only trigger when a contact joins a specific segment. Leaving blank will trigger for all segments.",
|
|
706
|
+
model: "segment",
|
|
707
|
+
name: "filterSegment",
|
|
708
|
+
organization: values == null ? void 0 : values.organization,
|
|
709
|
+
resource: "segment"
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
),
|
|
713
|
+
/* @__PURE__ */ jsx(
|
|
714
|
+
InputGroup,
|
|
715
|
+
{
|
|
716
|
+
...{
|
|
717
|
+
error: (_n = (_m = formState == null ? void 0 : formState.errors) == null ? void 0 : _m.steps) == null ? void 0 : _n.message,
|
|
718
|
+
input: /* @__PURE__ */ jsx(
|
|
719
|
+
InputArraySortable,
|
|
720
|
+
{
|
|
721
|
+
...{
|
|
722
|
+
control,
|
|
723
|
+
empty: null,
|
|
724
|
+
name: "steps",
|
|
725
|
+
renderButton: (append) => /* @__PURE__ */ jsx(
|
|
726
|
+
InputArrayButton,
|
|
727
|
+
{
|
|
728
|
+
...{
|
|
729
|
+
disabled: !watchedTrigger,
|
|
730
|
+
onClick: () => append(stepRow()),
|
|
731
|
+
text: "Add step"
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
},
|
|
736
|
+
children: ({ field, handle, index, remove }) => {
|
|
737
|
+
const step = (watchedSteps == null ? void 0 : watchedSteps[index]) || field;
|
|
738
|
+
return /* @__PURE__ */ jsxs(
|
|
739
|
+
"div",
|
|
740
|
+
{
|
|
741
|
+
...{
|
|
742
|
+
className: "w-full bg-white border border-gray rounded p-4 space-y-3"
|
|
743
|
+
},
|
|
744
|
+
children: [
|
|
745
|
+
/* @__PURE__ */ jsxs(
|
|
746
|
+
"div",
|
|
747
|
+
{
|
|
748
|
+
...{
|
|
749
|
+
className: "flex items-center justify-between"
|
|
750
|
+
},
|
|
751
|
+
children: [
|
|
752
|
+
/* @__PURE__ */ jsxs(
|
|
753
|
+
"div",
|
|
754
|
+
{
|
|
755
|
+
...{
|
|
756
|
+
className: "flex items-center space-x-2"
|
|
757
|
+
},
|
|
758
|
+
children: [
|
|
759
|
+
handle,
|
|
760
|
+
/* @__PURE__ */ jsxs(
|
|
761
|
+
"span",
|
|
762
|
+
{
|
|
763
|
+
...{
|
|
764
|
+
className: "text-sm font-medium"
|
|
765
|
+
},
|
|
766
|
+
children: [
|
|
767
|
+
"Step ",
|
|
768
|
+
index + 1
|
|
769
|
+
]
|
|
770
|
+
}
|
|
771
|
+
)
|
|
772
|
+
]
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ jsxs(
|
|
776
|
+
"div",
|
|
777
|
+
{
|
|
778
|
+
...{
|
|
779
|
+
className: "flex items-center space-x-2"
|
|
780
|
+
},
|
|
781
|
+
children: [
|
|
782
|
+
renderStepBadge(step),
|
|
783
|
+
!lockedStep(index) && /* @__PURE__ */ jsx(
|
|
784
|
+
InputArrayControl,
|
|
785
|
+
{
|
|
786
|
+
...{
|
|
787
|
+
onClick: () => remove(index),
|
|
788
|
+
icon: Trash
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
"remove"
|
|
792
|
+
)
|
|
793
|
+
]
|
|
794
|
+
}
|
|
795
|
+
)
|
|
796
|
+
]
|
|
797
|
+
}
|
|
798
|
+
),
|
|
799
|
+
issueIndex === index && /* @__PURE__ */ jsx(
|
|
800
|
+
Error,
|
|
801
|
+
{
|
|
802
|
+
...{
|
|
803
|
+
error: values.issue.message
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
),
|
|
807
|
+
/* @__PURE__ */ jsx(
|
|
808
|
+
Controller,
|
|
809
|
+
{
|
|
810
|
+
...{
|
|
811
|
+
control,
|
|
812
|
+
name: `steps.${index}.type`,
|
|
813
|
+
render: ({ field: { onChange } }) => {
|
|
814
|
+
var _a2, _b2, _c2, _d2;
|
|
815
|
+
return /* @__PURE__ */ jsx(
|
|
816
|
+
InputGroup,
|
|
817
|
+
{
|
|
818
|
+
...{
|
|
819
|
+
error: (_d2 = (_c2 = (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.steps) == null ? void 0 : _b2[index]) == null ? void 0 : _c2.type) == null ? void 0 : _d2.message,
|
|
820
|
+
input: /* @__PURE__ */ jsx(
|
|
821
|
+
InputCombobox,
|
|
822
|
+
{
|
|
823
|
+
...{
|
|
824
|
+
onChange: (val) => {
|
|
825
|
+
const [type] = val.split("::");
|
|
826
|
+
const option = getStepOptions(index).find((o) => o.value === val);
|
|
827
|
+
onChange(type);
|
|
828
|
+
setValue(`steps.${index}.connectionId`, (option == null ? void 0 : option.connectionId) || "");
|
|
829
|
+
setValue(`steps.${index}.slug`, (option == null ? void 0 : option.slug) || "");
|
|
830
|
+
},
|
|
831
|
+
disabled: lockedStep(index),
|
|
832
|
+
options: getStepOptions(index),
|
|
833
|
+
// Resolved from the WHOLE ROW, not from this path: the
|
|
834
|
+
// option value carries a connection the type alone cannot
|
|
835
|
+
// name.
|
|
836
|
+
value: getStepValue(step, index)
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
),
|
|
840
|
+
label: "Step"
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
),
|
|
848
|
+
step.type === "step.webhook.send" && /* @__PURE__ */ jsx(
|
|
849
|
+
Controller,
|
|
850
|
+
{
|
|
851
|
+
...{
|
|
852
|
+
control,
|
|
853
|
+
name: `steps.${index}.url`,
|
|
854
|
+
render: ({ field: { value, onChange } }) => {
|
|
855
|
+
var _a2, _b2, _c2, _d2;
|
|
856
|
+
return /* @__PURE__ */ jsx(
|
|
857
|
+
InputGroup,
|
|
858
|
+
{
|
|
859
|
+
...{
|
|
860
|
+
error: (_d2 = (_c2 = (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.steps) == null ? void 0 : _b2[index]) == null ? void 0 : _c2.url) == null ? void 0 : _d2.message,
|
|
861
|
+
input: /* @__PURE__ */ jsx(
|
|
862
|
+
InputUrl,
|
|
863
|
+
{
|
|
864
|
+
...{
|
|
865
|
+
onChange,
|
|
866
|
+
value: value || ""
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
),
|
|
870
|
+
label: "Webhook URL"
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
),
|
|
878
|
+
teamSteps.includes(step.type) && lockedStep(index) && /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: "Recipients are chosen by the organization owner." }),
|
|
879
|
+
teamSteps.includes(step.type) && !lockedStep(index) && /* @__PURE__ */ jsx(
|
|
880
|
+
Controller,
|
|
881
|
+
{
|
|
882
|
+
...{
|
|
883
|
+
control,
|
|
884
|
+
name: `steps.${index}.members`,
|
|
885
|
+
render: ({ field: { value, onChange } }) => {
|
|
886
|
+
var _a2, _b2, _c2, _d2;
|
|
887
|
+
return /* @__PURE__ */ jsx(
|
|
888
|
+
InputGroup,
|
|
889
|
+
{
|
|
890
|
+
...{
|
|
891
|
+
error: (_d2 = (_c2 = (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.steps) == null ? void 0 : _b2[index]) == null ? void 0 : _c2.members) == null ? void 0 : _d2.message,
|
|
892
|
+
input: /* @__PURE__ */ jsx(
|
|
893
|
+
InputResource,
|
|
894
|
+
{
|
|
895
|
+
...{
|
|
896
|
+
empty: "No members to add",
|
|
897
|
+
endpoint: "/organization/" + (values == null ? void 0 : values.organization) + "/members",
|
|
898
|
+
// The owner is a chip like the others, only it cannot be
|
|
899
|
+
// removed: they are always a recipient and it is resolved
|
|
900
|
+
// in sync. Shaped like a member so `render` labels it the
|
|
901
|
+
// same way.
|
|
902
|
+
fixed: [{ email: ownerEmail }],
|
|
903
|
+
model: "member",
|
|
904
|
+
multiple: true,
|
|
905
|
+
onChange,
|
|
906
|
+
params: memberParams,
|
|
907
|
+
render: memberLabel,
|
|
908
|
+
// The row shows the name ( memberLabel ), so the search has
|
|
909
|
+
// to hit the name too. The members endpoint joins `user`
|
|
910
|
+
// before its search stage, so the nested keys resolve.
|
|
911
|
+
// Email stays for invitees who have not registered yet.
|
|
912
|
+
// ponytail: a full "First Last" query matches neither key;
|
|
913
|
+
// a $concat'd name on the API side if that comes up.
|
|
914
|
+
searchKeys: ["email", "user.firstName", "user.lastName"],
|
|
915
|
+
value: value || []
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
),
|
|
919
|
+
label: "Recipients"
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
),
|
|
927
|
+
emailSteps.includes(step.type) && /* @__PURE__ */ jsx(
|
|
928
|
+
FormNotification,
|
|
929
|
+
{
|
|
930
|
+
...{
|
|
931
|
+
control,
|
|
932
|
+
// As the Fieldset above: the Message editor is a
|
|
933
|
+
// contenteditable, which a disabled fieldset never reaches.
|
|
934
|
+
disabled: disabled || (formState == null ? void 0 : formState.isSubmitting),
|
|
935
|
+
formState,
|
|
936
|
+
onChecking,
|
|
937
|
+
setValue,
|
|
938
|
+
values: {
|
|
939
|
+
id: field.id,
|
|
940
|
+
name: `steps.${index}`,
|
|
941
|
+
organization: values == null ? void 0 : values.organization,
|
|
942
|
+
variables: getAvailableVariables(index)
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
),
|
|
947
|
+
step.type === "step.sms.send" && /* @__PURE__ */ jsx(
|
|
948
|
+
Controller,
|
|
949
|
+
{
|
|
950
|
+
...{
|
|
951
|
+
control,
|
|
952
|
+
name: `steps.${index}.subject`,
|
|
953
|
+
render: ({ field: { value, onChange } }) => {
|
|
954
|
+
var _a2, _b2, _c2, _d2;
|
|
955
|
+
return /* @__PURE__ */ jsx(
|
|
956
|
+
InputGroup,
|
|
957
|
+
{
|
|
958
|
+
...{
|
|
959
|
+
error: (_d2 = (_c2 = (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.steps) == null ? void 0 : _b2[index]) == null ? void 0 : _c2.subject) == null ? void 0 : _d2.message,
|
|
960
|
+
input: /* @__PURE__ */ jsx(
|
|
961
|
+
InputText,
|
|
962
|
+
{
|
|
963
|
+
...{
|
|
964
|
+
onChange,
|
|
965
|
+
value: value || ""
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
),
|
|
969
|
+
label: "Subject"
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
),
|
|
977
|
+
step.type === "step.sms.send" && /* @__PURE__ */ jsx(
|
|
978
|
+
Controller,
|
|
979
|
+
{
|
|
980
|
+
...{
|
|
981
|
+
control,
|
|
982
|
+
name: `steps.${index}.message`,
|
|
983
|
+
render: ({ field: { value, onChange } }) => {
|
|
984
|
+
var _a2, _b2, _c2, _d2;
|
|
985
|
+
return /* @__PURE__ */ jsx(
|
|
986
|
+
InputGroup,
|
|
987
|
+
{
|
|
988
|
+
...{
|
|
989
|
+
error: (_d2 = (_c2 = (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.steps) == null ? void 0 : _b2[index]) == null ? void 0 : _c2.message) == null ? void 0 : _d2.message,
|
|
990
|
+
input: /* @__PURE__ */ jsx(
|
|
991
|
+
InputText,
|
|
992
|
+
{
|
|
993
|
+
...{
|
|
994
|
+
onChange,
|
|
995
|
+
value: value || ""
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
),
|
|
999
|
+
label: "Message"
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
),
|
|
1007
|
+
step.type === "step.commerce.code.issue" && /* @__PURE__ */ jsx(
|
|
1008
|
+
Controller,
|
|
1009
|
+
{
|
|
1010
|
+
...{
|
|
1011
|
+
control,
|
|
1012
|
+
name: `steps.${index}.discount`,
|
|
1013
|
+
render: ({ field: { value, onChange } }) => {
|
|
1014
|
+
var _a2, _b2, _c2, _d2;
|
|
1015
|
+
return /* @__PURE__ */ jsx(
|
|
1016
|
+
InputGroup,
|
|
1017
|
+
{
|
|
1018
|
+
...{
|
|
1019
|
+
error: (_d2 = (_c2 = (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.steps) == null ? void 0 : _b2[index]) == null ? void 0 : _c2.discount) == null ? void 0 : _d2.message,
|
|
1020
|
+
input: /* @__PURE__ */ jsx(
|
|
1021
|
+
InputResource,
|
|
1022
|
+
{
|
|
1023
|
+
...{
|
|
1024
|
+
endpoint: "/organization/" + (values == null ? void 0 : values.organization) + "/connection/" + commerceConnectionId + "/hook/browse.promotions",
|
|
1025
|
+
model: "discount",
|
|
1026
|
+
onChange,
|
|
1027
|
+
// A DISCOUNT THE STORE CANNOT BACK IS SHOWN AND EXPLAINED, never
|
|
1028
|
+
// filtered out. The merchant can see it in Shopify admin, so a row
|
|
1029
|
+
// missing here with no reason reads as our bug rather than their
|
|
1030
|
+
// setting — and the reason names the fix.
|
|
1031
|
+
render: (item) => /* @__PURE__ */ jsxs("div", { children: [
|
|
1032
|
+
/* @__PURE__ */ jsx("span", { className: (item == null ? void 0 : item.blocked) ? "text-gray" : void 0, children: item == null ? void 0 : item.title }),
|
|
1033
|
+
((item == null ? void 0 : item.blocked) || (item == null ? void 0 : item.warning)) && /* @__PURE__ */ jsx("span", { className: "block text-sm text-gray", children: item.blocked || item.warning })
|
|
1034
|
+
] }),
|
|
1035
|
+
renderButton: ({ button, item }) => (
|
|
1036
|
+
// The list's small inline Add, unless the list says otherwise.
|
|
1037
|
+
/* @__PURE__ */ jsx(
|
|
1038
|
+
Button,
|
|
1039
|
+
{
|
|
1040
|
+
...{
|
|
1041
|
+
inline: true,
|
|
1042
|
+
size: "small",
|
|
1043
|
+
...button.props,
|
|
1044
|
+
disabled: Boolean(item == null ? void 0 : item.blocked),
|
|
1045
|
+
title: (item == null ? void 0 : item.blocked) || void 0
|
|
1046
|
+
},
|
|
1047
|
+
children: button.text
|
|
1048
|
+
}
|
|
1049
|
+
)
|
|
1050
|
+
),
|
|
1051
|
+
value: value || null
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
),
|
|
1055
|
+
label: "Discount",
|
|
1056
|
+
// "Issue" means MINT, not send — this step creates the code and saves
|
|
1057
|
+
// it to the lead, and nothing reaches them until a later email step
|
|
1058
|
+
// names the variable. Said here because the step picker says nothing:
|
|
1059
|
+
// QA read "Issue a discount code", built the one-step workflow that
|
|
1060
|
+
// describes, and reported the codes as never arriving.
|
|
1061
|
+
message: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1062
|
+
"Creates the code and saves it to the lead. To send it, add an email step after this one with ",
|
|
1063
|
+
"{{shopifyDiscountCode}}",
|
|
1064
|
+
" in the message.",
|
|
1065
|
+
commerceDomain ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1066
|
+
" ",
|
|
1067
|
+
/* @__PURE__ */ jsx("a", { href: "https://" + commerceDomain + "/admin/discounts", rel: "noopener noreferrer", target: "_blank", children: "Manage discounts" })
|
|
1068
|
+
] }) : null
|
|
1069
|
+
] })
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
)
|
|
1077
|
+
]
|
|
1078
|
+
}
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
),
|
|
1083
|
+
label: "Sequence"
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
),
|
|
1087
|
+
/* @__PURE__ */ jsx(
|
|
1088
|
+
Button,
|
|
1089
|
+
{
|
|
1090
|
+
...{
|
|
1091
|
+
disabled: checkingAny,
|
|
1092
|
+
loading: (formState == null ? void 0 : formState.isSubmitting) || checkingAny,
|
|
1093
|
+
type: "submit"
|
|
1094
|
+
},
|
|
1095
|
+
children: "Save"
|
|
1096
|
+
}
|
|
1097
|
+
)
|
|
1098
|
+
]
|
|
1099
|
+
}
|
|
1100
|
+
)
|
|
1101
|
+
}
|
|
1102
|
+
);
|
|
1103
|
+
};
|
|
1104
|
+
export {
|
|
1105
|
+
FormOrganizationWorkflow,
|
|
1106
|
+
FormOrganizationWorkflowEdit,
|
|
1107
|
+
campaignFilterId,
|
|
1108
|
+
stepRow
|
|
1109
|
+
};
|