Plugin Directory

Changeset 3450956


Ignore:
Timestamp:
01/31/2026 11:20:10 AM (2 months ago)
Author:
debuggersstudio
Message:

Update to version 4.0.7 from GitHub

Location:
ecomm-reels
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ecomm-reels/tags/4.0.7/CHANGELOG.md

    r3449375 r3450956  
    11# Changelog
     2
     3## [4.0.7](https://github.com/dstudio-asia/reels-wp/compare/v4.0.6...v4.0.7) (2026-01-31)
     4
     5
     6### Features
     7
     8* **links:** add product tagging and unified link management ([2111b1d](https://github.com/dstudio-asia/reels-wp/commit/2111b1dd3a437232d26b4c91b3111416d6eb2e0b))
     9* **ui:** add product card component and link handling ([2af533d](https://github.com/dstudio-asia/reels-wp/commit/2af533d558415317ed97fdf63146afa95670000c))
     10
     11
     12### Bug Fixes
     13
     14* **player:** use ManageLinks and clamp reel title ([e951a06](https://github.com/dstudio-asia/reels-wp/commit/e951a0679e969f5e7cda3396bac55e85fd28bbb1))
     15* **ui:** improve range input styling and refactor input component ([cb8861c](https://github.com/dstudio-asia/reels-wp/commit/cb8861c5ce373a2fd30e3f8c15d26dc453966558))
     16* **ui:** scope button styles and add dialog close action ([e376136](https://github.com/dstudio-asia/reels-wp/commit/e376136f287921261c9db2151f62b4ae7b6ec6e9))
    217
    318## [4.0.6](https://github.com/dstudio-asia/reels-wp/compare/v4.0.5...v4.0.6) (2026-01-29)
  • ecomm-reels/tags/4.0.7/admin/class-reel-admin.php

    r3444846 r3450956  
    135135                true
    136136            );
    137             // wp_enqueue_style(
    138             //     'ecommreels-ecomm-reels-build-styles',
    139             //     ECOMMREELS_ASSETS . 'build/index.css',
    140             //     [],
    141             //     WP_REELS_VER
    142             // );
    143         }
     137        }
     138        $localized_data = [
     139            'url' => esc_url_raw(rest_url()),
     140            'nonce' => wp_create_nonce('wp_rest'),
     141            'apiBase' => rest_url('wp-reels/v1/'),
     142            'createStoryNonce' => wp_create_nonce('ecommreels_action'),
     143            'currentStoryUrl' => home_url('/wp-admin/admin.php?page=my-reels&story='),
     144            'isProActive' => $is_pro_active,
     145            'isLicenseActive' => $is_pro_license_active,
     146            'license_page' => home_url() . '/wp-admin/admin.php?page=ecomm-reels-license'
     147        ];
     148
     149        if (class_exists('WooCommerce')) {
     150            $localized_data['store_api_nonce'] = wp_create_nonce('wc_store_api');
     151            $localized_data['nonce']        = wp_create_nonce('wp_rest');
     152        }
     153
    144154        wp_localize_script(
    145155            'ecommreels-ecomm-reels-build-script',
    146156            'ecommreelsInfo',
    147             [
    148                 'url' => esc_url_raw(rest_url()),
    149                 'nonce' => wp_create_nonce('wp_rest'),
    150                 'apiBase' => rest_url('wp-reels/v1/'),
    151                 'createStoryNonce' => wp_create_nonce('ecommreels_action'),
    152                 'currentStoryUrl' => home_url('/wp-admin/admin.php?page=my-reels&story='),
    153                 'isProActive' => $is_pro_active,
    154                 'isLicenseActive' => $is_pro_license_active,
    155                 'license_page' => home_url() . '/wp-admin/admin.php?page=ecomm-reels-license'
    156             ]
    157         );
    158 
    159         wp_localize_script(
    160             'ecommreels-ecomm-reels-build-script',
    161             'reelswp_media_api',
    162             [
    163                 'ajax_url' => admin_url('admin-ajax.php'),
    164                 'nonce'    => wp_create_nonce('reelswp_nonce'),
    165                 'action'   => 'reelswp_upload_cropped_image',
    166             ]
     157            $localized_data
    167158        );
    168159    }
  • ecomm-reels/tags/4.0.7/build/index.js

    r3449375 r3450956  
    1 (function(y,la,Pn,ca){"use strict";var da=document.createElement("style");da.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}.ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:var(--color-primary, #111);color:var(--color-primary-foreground, #fff);cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}.ecr-button:disabled{opacity:.6;cursor:not-allowed}.ecr-button--primary{background:var(--color-primary, #1f2937);color:var(--color-primary-foreground, #fff)}.ecr-button--primary:hover{background:color-mix(in srgb,var(--color-primary, #1f2937) 90%,#000)}.ecr-button--secondary{background:var(--color-secondary, #e5e7eb);color:var(--color-secondary-foreground, #111827)}.ecr-button--secondary:hover{background:color-mix(in srgb,var(--color-secondary, #e5e7eb) 90%,#000)}.ecr-button--outline{background:transparent;border-color:var(--color-border, #d1d5db);color:var(--color-foreground, #111827)}.ecr-button--outline:hover{background:var(--color-accent, #f3f4f6)}.ecr-button--ghost{background:transparent;color:var(--color-foreground, #111827)}.ecr-button--ghost:hover{background:var(--color-accent, #f3f4f6)}.ecr-button--link{background:none;border-color:transparent;padding:0;color:var(--color-primary, #2563eb);text-decoration:none}.ecr-button--link:hover{text-decoration:underline}.ecr-button--danger{background:#dc2626;color:#fff}.ecr-button--danger:hover{background:#b91c1c}.ecr-button--sm{height:32px;padding:0 12px;font-size:13px}.ecr-button--md{height:36px;padding:0 16px}.ecr-button--lg{height:40px;padding:0 20px;font-size:15px}.ecr-button--icon,.ecr-button--icon-sm,.ecr-button--icon-lg{padding:0;width:36px;height:36px}.ecr-button--icon-sm{width:32px;height:32px}.ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:20;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:50;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:50;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed;inset:0;display:grid;place-items:center;width:100%;height:100vh}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:50;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size, 150px),1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:40;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:50;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:999;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:grid;cursor:pointer;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:70}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:50}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:60}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px;margin-bottom:8px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:50;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px}@media(min-width:1024px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:10;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-thumb__link-list,.ecommreels-short-code .ecr-thumb__link-list,.reelswp-group-short-code .ecr-thumb__link-list,.reelswp-reel-short-code .ecr-thumb__link-list{margin-top:4px;display:flex;flex-direction:column;gap:4px}#ecommreels-admin-app .ecr-thumb__link-list a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-list a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:57.6px;text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff}:is(#ecommreels-admin-app .ecr-thumb__link-list a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-list a.ecr-thumb__link):hover{text-decoration:underline}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:20;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:50;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:50;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;border:1px solid #fff;font-size:14px}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1024px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;background:#fff;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:280px;border:2px solid #e5e7eb}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:50}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:50;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{cursor:pointer;overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:10;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size, 150px),1fr))}
    2 /*$vite$:1*/`,document.head.appendChild(da);function ua(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const h=ua(y),br=ua(ca);function vd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var On={exports:{}},Ut={};/**
     1(function(y,ga,Rn,xa){"use strict";var ba=document.createElement("style");ba.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:color-mix(in srgb,#1f2937) 90%,#000}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:color-mix(in srgb,#e5e7eb 90%,#000)}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:20;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:50;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:50;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed;inset:0;display:grid;place-items:center;width:100%;height:100vh}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:50;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size, 150px),1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:40;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:50;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:999;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:grid;cursor:pointer;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:70}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:50}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:60}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:50;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px}@media(min-width:1024px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:10;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:12px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-thumb__link-list,.ecommreels-short-code .ecr-thumb__link-list,.reelswp-group-short-code .ecr-thumb__link-list,.reelswp-reel-short-code .ecr-thumb__link-list{margin-top:4px;display:flex;flex-direction:column;gap:4px}#ecommreels-admin-app .ecr-thumb__link-list a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-list a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:57.6px;text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff}:is(#ecommreels-admin-app .ecr-thumb__link-list a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-list a.ecr-thumb__link):hover{text-decoration:underline}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;cursor:grab;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:20;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:50;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:50;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;border:1px solid #fff;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1024px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;background:#fff;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:280px;border:2px solid #e5e7eb}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:50}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:50;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{cursor:pointer;overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:10;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size, 150px),1fr))}
     2/*$vite$:1*/`,document.head.appendChild(ba);function va(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const g=va(y),vr=va(xa);function jd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ln={exports:{}},$t={};/**
    33 * @license React
    44 * react-jsx-runtime.production.min.js
     
    88 * This source code is licensed under the MIT license found in the
    99 * LICENSE file in the root directory of this source tree.
    10  */var pa;function bd(){if(pa)return Ut;pa=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var u,p={},m=null,g=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(u in c)n.call(c,u)&&!i.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Ut.Fragment=r,Ut.jsx=s,Ut.jsxs=s,Ut}var ma;function _d(){return ma||(ma=1,On.exports=bd()),On.exports}var a=_d();/**
     10 */var _a;function Sd(){if(_a)return $t;_a=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(l,c,d){var u,p={},m=null,h=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(h=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:h,props:p,_owner:o.current}}return $t.Fragment=r,$t.jsx=i,$t.jsxs=i,$t}var ya;function Cd(){return ya||(ya=1,Ln.exports=Sd()),Ln.exports}var a=Cd();/**
    1111 * @remix-run/router v1.23.2
    1212 *
     
    1717 *
    1818 * @license MIT
    19  */function Ht(){return Ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ht.apply(this,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const fa="popstate";function yd(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Vt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Rn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:_r(i))}function n(o,i){ha(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Sd(t,r,n,e)}function xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ha(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wd(){return Math.random().toString(36).substr(2,8)}function ga(e,t){return{usr:e.state,key:e.key,idx:t}}function Rn(e,t,r,n){return r===void 0&&(r=null),Ht({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Vt(t):t,{state:r,key:t&&t.key||n||wd()})}function _r(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Vt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Sd(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=Qe.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Ht({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=Qe.Pop;let x=u(),_=x==null?null:x-d;d=x,c&&c({action:l,location:f.location,delta:_})}function m(x,_){l=Qe.Push;let b=Rn(f.location,x,_);r&&r(b,x),d=u()+1;let w=ga(b,d),S=f.createHref(b);try{s.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(S)}i&&c&&c({action:l,location:f.location,delta:1})}function g(x,_){l=Qe.Replace;let b=Rn(f.location,x,_);r&&r(b,x),d=u();let w=ga(b,d),S=f.createHref(b);s.replaceState(w,"",S),i&&c&&c({action:l,location:f.location,delta:0})}function v(x){let _=o.location.origin!=="null"?o.location.origin:o.location.href,b=typeof x=="string"?x:_r(x);return b=b.replace(/ $/,"%20"),xe(_,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,_)}let f={get action(){return l},get location(){return e(o,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(fa,p),c=x,()=>{o.removeEventListener(fa,p),c=null}},createHref(x){return t(o,x)},createURL:v,encodeLocation(x){let _=v(x);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:g,go(x){return s.go(x)}};return f}var xa;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xa||(xa={}));function va(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const jd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cd=e=>jd.test(e);function kd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Vt(e):e,i;if(r)if(Cd(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),ha(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=ba(r.substring(1),"/"):i=ba(r,t)}else i=t;return{pathname:i,search:Ed(n),hash:Td(o)}}function ba(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Ln(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Nd(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _a(e,t){let r=Nd(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ya(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Vt(e):(o=Ht({},e),xe(!o.pathname||!o.pathname.includes("?"),Ln("?","pathname","search",o)),xe(!o.pathname||!o.pathname.includes("#"),Ln("#","pathname","hash",o)),xe(!o.search||!o.search.includes("#"),Ln("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=kd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const wa=e=>e.join("/").replace(/\/\/+/g,"/"),Ed=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Td=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Sa=["post","put","patch","delete"];new Set(Sa);const Ad=["get",...Sa];new Set(Ad);/**
     19 */function Bt(){return Bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bt.apply(this,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const wa="popstate";function kd(e){e===void 0&&(e={});function t(o,s){let{pathname:i="/",search:l="",hash:c=""}=Ut(o.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),In("",{pathname:i,search:l,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(o,s){let i=o.document.querySelector("base"),l="";if(i&&i.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof s=="string"?s:_r(s))}function n(o,s){ja(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return Ed(t,r,n,e)}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ja(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Nd(){return Math.random().toString(36).substr(2,8)}function Sa(e,t){return{usr:e.state,key:e.key,idx:t}}function In(e,t,r,n){return r===void 0&&(r=null),Bt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ut(t):t,{state:r,key:t&&t.key||n||Nd()})}function _r(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ut(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ed(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,l=Qe.Pop,c=null,d=u();d==null&&(d=0,i.replaceState(Bt({},i.state,{idx:d}),""));function u(){return(i.state||{idx:null}).idx}function p(){l=Qe.Pop;let x=u(),_=x==null?null:x-d;d=x,c&&c({action:l,location:f.location,delta:_})}function m(x,_){l=Qe.Push;let v=In(f.location,x,_);r&&r(v,x),d=u()+1;let w=Sa(v,d),j=f.createHref(v);try{i.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}s&&c&&c({action:l,location:f.location,delta:1})}function h(x,_){l=Qe.Replace;let v=In(f.location,x,_);r&&r(v,x),d=u();let w=Sa(v,d),j=f.createHref(v);i.replaceState(w,"",j),s&&c&&c({action:l,location:f.location,delta:0})}function b(x){let _=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof x=="string"?x:_r(x);return v=v.replace(/ $/,"%20"),be(_,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,_)}let f={get action(){return l},get location(){return e(o,i)},listen(x){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(wa,p),c=x,()=>{o.removeEventListener(wa,p),c=null}},createHref(x){return t(o,x)},createURL:b,encodeLocation(x){let _=b(x);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:h,go(x){return i.go(x)}};return f}var Ca;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ca||(Ca={}));function ka(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Td=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ad=e=>Td.test(e);function Pd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Ut(e):e,s;if(r)if(Ad(r))s=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),ja(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+r))}r.startsWith("/")?s=Na(r.substring(1),"/"):s=Na(r,t)}else s=t;return{pathname:s,search:Rd(n),hash:Ld(o)}}function Na(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function zn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Od(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ea(e,t){let r=Od(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ta(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Ut(e):(o=Bt({},e),be(!o.pathname||!o.pathname.includes("?"),zn("?","pathname","search",o)),be(!o.pathname||!o.pathname.includes("#"),zn("#","pathname","hash",o)),be(!o.search||!o.search.includes("#"),zn("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,l;if(i==null)l=r;else{let p=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Pd(o,l),d=i&&i!=="/"&&i.endsWith("/"),u=(s||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Aa=e=>e.join("/").replace(/\/\/+/g,"/"),Rd=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ld=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Pa=["post","put","patch","delete"];new Set(Pa);const Id=["get",...Pa];new Set(Id);/**
    2020 * React Router v6.30.3
    2121 *
     
    2626 *
    2727 * @license MIT
    28  */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const ja=h.createContext(null),xt=h.createContext(null),In=h.createContext(null),wr=h.createContext({outlet:null,matches:[],isDataRoute:!1});function Pd(e,t){let{relative:r}=t===void 0?{}:t;Sr()||xe(!1);let{basename:n,navigator:o}=h.useContext(xt),{hash:i,pathname:s,search:l}=ka(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:wa([n,s])),o.createHref({pathname:c,search:l,hash:i})}function Sr(){return h.useContext(In)!=null}function Wt(){return Sr()||xe(!1),h.useContext(In).location}function Ca(e){h.useContext(xt).static||h.useLayoutEffect(e)}function je(){let{isDataRoute:e}=h.useContext(wr);return e?Md():Od()}function Od(){Sr()||xe(!1);let e=h.useContext(ja),{basename:t,future:r,navigator:n}=h.useContext(xt),{matches:o}=h.useContext(wr),{pathname:i}=Wt(),s=JSON.stringify(_a(o,r.v7_relativeSplatPath)),l=h.useRef(!1);return Ca(()=>{l.current=!0}),h.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=ya(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:wa([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function ka(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=h.useContext(xt),{matches:o}=h.useContext(wr),{pathname:i}=Wt(),s=JSON.stringify(_a(o,n.v7_relativeSplatPath));return h.useMemo(()=>ya(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Na=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Na||{}),Ea=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Ea||{});function Rd(e){let t=h.useContext(ja);return t||xe(!1),t}function Ld(e){let t=h.useContext(wr);return t||xe(!1),t}function Id(e){let t=Ld(),r=t.matches[t.matches.length-1];return r.route.id||xe(!1),r.route.id}function Md(){let{router:e}=Rd(Na.UseNavigateStable),t=Id(Ea.UseNavigateStable),r=h.useRef(!1);return Ca(()=>{r.current=!0}),h.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function zd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Dd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Qe.Pop,navigator:i,static:s=!1,future:l}=e;Sr()&&xe(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Vt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:v="default"}=n,f=h.useMemo(()=>{let x=va(u,c);return x==null?null:{location:{pathname:x,search:p,hash:m,state:g,key:v},navigationType:o}},[c,u,p,m,g,v,o]);return f==null?null:h.createElement(xt.Provider,{value:d},h.createElement(In.Provider,{children:r,value:f}))}new Promise(()=>{});/**
     28 */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const Oa=g.createContext(null),ft=g.createContext(null),Mn=g.createContext(null),wr=g.createContext({outlet:null,matches:[],isDataRoute:!1});function zd(e,t){let{relative:r}=t===void 0?{}:t;jr()||be(!1);let{basename:n,navigator:o}=g.useContext(ft),{hash:s,pathname:i,search:l}=La(e,{relative:r}),c=i;return n!=="/"&&(c=i==="/"?n:Aa([n,i])),o.createHref({pathname:c,search:l,hash:s})}function jr(){return g.useContext(Mn)!=null}function Ht(){return jr()||be(!1),g.useContext(Mn).location}function Ra(e){g.useContext(ft).static||g.useLayoutEffect(e)}function Se(){let{isDataRoute:e}=g.useContext(wr);return e?Bd():Md()}function Md(){jr()||be(!1);let e=g.useContext(Oa),{basename:t,future:r,navigator:n}=g.useContext(ft),{matches:o}=g.useContext(wr),{pathname:s}=Ht(),i=JSON.stringify(Ea(o,r.v7_relativeSplatPath)),l=g.useRef(!1);return Ra(()=>{l.current=!0}),g.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ta(d,JSON.parse(i),s,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Aa([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,i,s,e])}function La(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=g.useContext(ft),{matches:o}=g.useContext(wr),{pathname:s}=Ht(),i=JSON.stringify(Ea(o,n.v7_relativeSplatPath));return g.useMemo(()=>Ta(e,JSON.parse(i),s,r==="path"),[e,i,s,r])}var Ia=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Ia||{}),za=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(za||{});function Dd(e){let t=g.useContext(Oa);return t||be(!1),t}function Fd(e){let t=g.useContext(wr);return t||be(!1),t}function $d(e){let t=Fd(),r=t.matches[t.matches.length-1];return r.route.id||be(!1),r.route.id}function Bd(){let{router:e}=Dd(Ia.UseNavigateStable),t=$d(za.UseNavigateStable),r=g.useRef(!1);return Ra(()=>{r.current=!0}),g.useCallback(function(o,s){s===void 0&&(s={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},s)))},[e,t])}function Ud(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Hd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Qe.Pop,navigator:s,static:i=!1,future:l}=e;jr()&&be(!1);let c=t.replace(/^\/*/,"/"),d=g.useMemo(()=>({basename:c,navigator:s,static:i,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,s,i]);typeof n=="string"&&(n=Ut(n));let{pathname:u="/",search:p="",hash:m="",state:h=null,key:b="default"}=n,f=g.useMemo(()=>{let x=ka(u,c);return x==null?null:{location:{pathname:x,search:p,hash:m,state:h,key:b},navigationType:o}},[c,u,p,m,h,b,o]);return f==null?null:g.createElement(ft.Provider,{value:d},g.createElement(Mn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
    2929 * React Router DOM v6.30.3
    3030 *
     
    3535 *
    3636 * @license MIT
    37  */function Mn(){return Mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mn.apply(this,arguments)}function Fd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function $d(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Bd(e,t){return e.button===0&&(!t||t==="_self")&&!$d(e)}function zn(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Ud(e,t){let r=zn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Hd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Vd="6";try{window.__reactRouterVersion=Vd}catch{}const Ta=h["startTransition"];function Wd(e){let{basename:t,children:r,future:n,window:o}=e,i=h.useRef();i.current==null&&(i.current=yd({window:o,v5Compat:!0}));let s=i.current,[l,c]=h.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=h.useCallback(p=>{d&&Ta?Ta(()=>c(p)):c(p)},[c,d]);return h.useLayoutEffect(()=>s.listen(u),[s,u]),h.useEffect(()=>zd(n),[n]),h.createElement(Dd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Gd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=h.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=Fd(t,Hd),{basename:g}=h.useContext(xt),v,f=!1;if(typeof d=="string"&&qd.test(d)&&(v=d,Gd))try{let w=new URL(window.location.href),S=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=va(S.pathname,g);S.origin===w.origin&&C!=null?d=C+S.search+S.hash:f=!0}catch{}let x=Pd(d,{relative:o}),_=Kd(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function b(w){n&&n(w),w.defaultPrevented||_(w)}return h.createElement("a",Mn({},m,{href:v||x,onClick:f||i?n:b,ref:r,target:c}))});var Aa;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Aa||(Aa={}));var Pa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Pa||(Pa={}));function Kd(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=je(),d=Wt(),u=ka(e,{relative:s});return h.useCallback(p=>{if(Bd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(d)===_r(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Gt(e){let t=h.useRef(zn(e)),r=h.useRef(!1),n=Wt(),o=h.useMemo(()=>Ud(n.search,r.current?null:t.current),[n.search]),i=je(),s=h.useCallback((l,c)=>{const d=zn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let Yd={data:""},Xd=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Yd},Jd=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Zd=/\/\*[^]*?\*\/|  +/g,Oa=/\n+/g,Be=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Be(s,i):i+"{"+Be(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Be(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Be.p?Be.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Le={},Ra=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ra(e[r]);return t}return e},Qd=(e,t,r,n,o)=>{let i=Ra(e),s=Le[i]||(Le[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!Le[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=Jd.exec(d.replace(Zd,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Oa," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Oa," ").trim();return m[0]})(e);Le[s]=Be(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Le.g?Le.g:null;return r&&(Le.g=Le[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Le[s],t,n,l),s},eu=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Be(l,""):l===!1?"":l}return n+o+(s??"")},"");function jr(e){let t=this||{},r=e.call?e(t.p):e;return Qd(r.unshift?r.raw?eu(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,Xd(t.target),t.g,t.o,t.k)}let La,Dn,Fn;jr.bind({g:1});let Ie=jr.bind({k:1});function tu(e,t,r,n){Be.p=t,La=e,Dn=r,Fn=n}function Ue(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Dn&&Dn()},l),r.o=/ *go\d+/.test(c),l.className=jr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Fn&&d[0]&&Fn(l),La(d,l)}return o}}var ru=e=>typeof e=="function",Cr=(e,t)=>ru(e)?e(t):e,nu=(()=>{let e=0;return()=>(++e).toString()})(),Ia=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),ou=20,$n="default",Ma=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ma(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},kr=[],za={toasts:[],pausedAt:void 0,settings:{toastLimit:ou}},Ce={},Da=(e,t=$n)=>{Ce[t]=Ma(Ce[t]||za,e),kr.forEach(([r,n])=>{r===t&&n(Ce[t])})},Fa=e=>Object.keys(Ce).forEach(t=>Da(e,t)),au=e=>Object.keys(Ce).find(t=>Ce[t].toasts.some(r=>r.id===e)),Nr=(e=$n)=>t=>{Da(t,e)},iu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},su=(e={},t=$n)=>{let[r,n]=y.useState(Ce[t]||za),o=y.useRef(Ce[t]);y.useEffect(()=>(o.current!==Ce[t]&&n(Ce[t]),kr.push([t,n]),()=>{let s=kr.findIndex(([l])=>l===t);s>-1&&kr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||iu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},lu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||nu()}),qt=e=>(t,r)=>{let n=lu(t,e,r);return Nr(n.toasterId||au(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>qt("blank")(e,t);ne.error=qt("error"),ne.success=qt("success"),ne.loading=qt("loading"),ne.custom=qt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Nr(t)(r):Fa(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Nr(t)(r):Fa(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?Cr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?Cr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var cu=1e3,du=(e,t="default")=>{let{toasts:r,pausedAt:n}=su(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=cu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let v=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(v<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),v)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Nr(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:v=8,defaultPosition:f}=m||{},x=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),_=x.findIndex(w=>w.id===p.id),b=x.filter((w,S)=>S<_&&w.visible).length;return x.filter(w=>w.visible).slice(...g?[b+1]:[0,b]).reduce((w,S)=>w+(S.height||0)+v,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},uu=Ie`
     37 */function Dn(){return Dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dn.apply(this,arguments)}function Vd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Wd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qd(e,t){return e.button===0&&(!t||t==="_self")&&!Wd(e)}function Fn(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Gd(e,t){let r=Fn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}const Kd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yd="6";try{window.__reactRouterVersion=Yd}catch{}const Ma=g["startTransition"];function Xd(e){let{basename:t,children:r,future:n,window:o}=e,s=g.useRef();s.current==null&&(s.current=kd({window:o,v5Compat:!0}));let i=s.current,[l,c]=g.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},u=g.useCallback(p=>{d&&Ma?Ma(()=>c(p)):c(p)},[c,d]);return g.useLayoutEffect(()=>i.listen(u),[i,u]),g.useEffect(()=>Ud(n),[n]),g.createElement(Hd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}const Jd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=g.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:s,replace:i,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=Vd(t,Kd),{basename:h}=g.useContext(ft),b,f=!1;if(typeof d=="string"&&Zd.test(d)&&(b=d,Jd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=ka(j.pathname,h);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let x=zd(d,{relative:o}),_=Qd(d,{replace:i,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function v(w){n&&n(w),w.defaultPrevented||_(w)}return g.createElement("a",Dn({},m,{href:b||x,onClick:f||s?n:v,ref:r,target:c}))});var Da;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Da||(Da={}));var Fa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fa||(Fa={}));function Qd(e,t){let{target:r,replace:n,state:o,preventScrollReset:s,relative:i,viewTransition:l}=t===void 0?{}:t,c=Se(),d=Ht(),u=La(e,{relative:i});return g.useCallback(p=>{if(qd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(d)===_r(u);c(e,{replace:m,state:o,preventScrollReset:s,relative:i,viewTransition:l})}},[d,c,u,n,o,r,e,s,i,l])}function Vt(e){let t=g.useRef(Fn(e)),r=g.useRef(!1),n=Ht(),o=g.useMemo(()=>Gd(n.search,r.current?null:t.current),[n.search]),s=Se(),i=g.useCallback((l,c)=>{const d=Fn(typeof l=="function"?l(o):l);r.current=!0,s("?"+d,c)},[s,o]);return[o,i]}let eu={data:""},tu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||eu},ru=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,nu=/\/\*[^]*?\*\/|  +/g,$a=/\n+/g,Be=(e,t)=>{let r="",n="",o="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+i+";":n+=s[1]=="f"?Be(i,s):s+"{"+Be(i,s[1]=="k"?"":t)+"}":typeof i=="object"?n+=Be(i,t?t.replace(/([^,])+/g,l=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):s):i!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Be.p?Be.p(s,i):s+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Le={},Ba=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ba(e[r]);return t}return e},ou=(e,t,r,n,o)=>{let s=Ba(e),i=Le[s]||(Le[s]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(s));if(!Le[i]){let c=s!==e?e:(d=>{let u,p,m=[{}];for(;u=ru.exec(d.replace(nu,""));)u[4]?m.shift():u[3]?(p=u[3].replace($a," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace($a," ").trim();return m[0]})(e);Le[i]=Be(o?{["@keyframes "+i]:c}:c,r?"":"."+i)}let l=r&&Le.g?Le.g:null;return r&&(Le.g=Le[i]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Le[i],t,n,l),i},au=(e,t,r)=>e.reduce((n,o,s)=>{let i=t[s];if(i&&i.call){let l=i(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;i=c?"."+c:l&&typeof l=="object"?l.props?"":Be(l,""):l===!1?"":l}return n+o+(i??"")},"");function Sr(e){let t=this||{},r=e.call?e(t.p):e;return ou(r.unshift?r.raw?au(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,tu(t.target),t.g,t.o,t.k)}let Ua,$n,Bn;Sr.bind({g:1});let Ie=Sr.bind({k:1});function su(e,t,r,n){Be.p=t,Ua=e,$n=r,Bn=n}function Ue(e,t){let r=this||{};return function(){let n=arguments;function o(s,i){let l=Object.assign({},s),c=l.className||o.className;r.p=Object.assign({theme:$n&&$n()},l),r.o=/ *go\d+/.test(c),l.className=Sr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Bn&&d[0]&&Bn(l),Ua(d,l)}return o}}var iu=e=>typeof e=="function",Cr=(e,t)=>iu(e)?e(t):e,lu=(()=>{let e=0;return()=>(++e).toString()})(),Ha=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),cu=20,Un="default",Va=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return Va(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+s}))}}},kr=[],Wa={toasts:[],pausedAt:void 0,settings:{toastLimit:cu}},Ce={},qa=(e,t=Un)=>{Ce[t]=Va(Ce[t]||Wa,e),kr.forEach(([r,n])=>{r===t&&n(Ce[t])})},Ga=e=>Object.keys(Ce).forEach(t=>qa(e,t)),du=e=>Object.keys(Ce).find(t=>Ce[t].toasts.some(r=>r.id===e)),Nr=(e=Un)=>t=>{qa(t,e)},uu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},pu=(e={},t=Un)=>{let[r,n]=y.useState(Ce[t]||Wa),o=y.useRef(Ce[t]);y.useEffect(()=>(o.current!==Ce[t]&&n(Ce[t]),kr.push([t,n]),()=>{let i=kr.findIndex(([l])=>l===t);i>-1&&kr.splice(i,1)}),[t]);let s=r.toasts.map(i=>{var l,c,d;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((l=e[i.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:i.duration||((c=e[i.type])==null?void 0:c.duration)||e?.duration||uu[i.type],style:{...e.style,...(d=e[i.type])==null?void 0:d.style,...i.style}}});return{...r,toasts:s}},mu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||lu()}),Wt=e=>(t,r)=>{let n=mu(t,e,r);return Nr(n.toasterId||du(n.id))({type:2,toast:n}),n.id},oe=(e,t)=>Wt("blank")(e,t);oe.error=Wt("error"),oe.success=Wt("success"),oe.loading=Wt("loading"),oe.custom=Wt("custom"),oe.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Nr(t)(r):Ga(r)},oe.dismissAll=e=>oe.dismiss(void 0,e),oe.remove=(e,t)=>{let r={type:4,toastId:e};t?Nr(t)(r):Ga(r)},oe.removeAll=e=>oe.remove(void 0,e),oe.promise=(e,t,r)=>{let n=oe.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Cr(t.success,o):void 0;return s?oe.success(s,{id:n,...r,...r?.success}):oe.dismiss(n),o}).catch(o=>{let s=t.error?Cr(t.error,o):void 0;s?oe.error(s,{id:n,...r,...r?.error}):oe.dismiss(n)}),e};var fu=1e3,hu=(e,t="default")=>{let{toasts:r,pausedAt:n}=pu(e,t),o=y.useRef(new Map).current,s=y.useCallback((p,m=fu)=>{if(o.has(p))return;let h=setTimeout(()=>{o.delete(p),i({type:4,toastId:p})},m);o.set(p,h)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(h=>{if(h.duration===1/0)return;let b=(h.duration||0)+h.pauseDuration-(p-h.createdAt);if(b<0){h.visible&&oe.dismiss(h.id);return}return setTimeout(()=>oe.dismiss(h.id,t),b)});return()=>{m.forEach(h=>h&&clearTimeout(h))}},[r,n,t]);let i=y.useCallback(Nr(t),[t]),l=y.useCallback(()=>{i({type:5,time:Date.now()})},[i]),c=y.useCallback((p,m)=>{i({type:1,toast:{id:p,height:m}})},[i]),d=y.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),u=y.useCallback((p,m)=>{let{reverseOrder:h=!1,gutter:b=8,defaultPosition:f}=m||{},x=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),_=x.findIndex(w=>w.id===p.id),v=x.filter((w,j)=>j<_&&w.visible).length;return x.filter(w=>w.visible).slice(...h?[v+1]:[0,v]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)s(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},gu=Ie`
    3838from {
    3939  transform: scale(0) rotate(45deg);
     
    4343 transform: scale(1) rotate(45deg);
    4444  opacity: 1;
    45 }`,pu=Ie`
     45}`,xu=Ie`
    4646from {
    4747  transform: scale(0);
     
    5151  transform: scale(1);
    5252  opacity: 1;
    53 }`,mu=Ie`
     53}`,bu=Ie`
    5454from {
    5555  transform: scale(0) rotate(90deg);
     
    5959  transform: scale(1) rotate(90deg);
    6060    opacity: 1;
    61 }`,fu=Ue("div")`
     61}`,vu=Ue("div")`
    6262  width: 20px;
    6363  opacity: 0;
     
    6868  transform: rotate(45deg);
    6969
    70   animation: ${uu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
     70  animation: ${gu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    7171    forwards;
    7272  animation-delay: 100ms;
     
    7575  &:before {
    7676    content: '';
    77     animation: ${pu} 0.15s ease-out forwards;
     77    animation: ${xu} 0.15s ease-out forwards;
    7878    animation-delay: 150ms;
    7979    position: absolute;
     
    8888
    8989  &:before {
    90     animation: ${mu} 0.15s ease-out forwards;
     90    animation: ${bu} 0.15s ease-out forwards;
    9191    animation-delay: 180ms;
    9292    transform: rotate(90deg);
    9393  }
    94 `,hu=Ie`
     94`,_u=Ie`
    9595  from {
    9696    transform: rotate(0deg);
     
    9999    transform: rotate(360deg);
    100100  }
    101 `,gu=Ue("div")`
     101`,yu=Ue("div")`
    102102  width: 12px;
    103103  height: 12px;
     
    107107  border-color: ${e=>e.secondary||"#e0e0e0"};
    108108  border-right-color: ${e=>e.primary||"#616161"};
    109   animation: ${hu} 1s linear infinite;
    110 `,xu=Ie`
     109  animation: ${_u} 1s linear infinite;
     110`,wu=Ie`
    111111from {
    112112  transform: scale(0) rotate(45deg);
     
    116116  transform: scale(1) rotate(45deg);
    117117    opacity: 1;
    118 }`,vu=Ie`
     118}`,ju=Ie`
    1191190% {
    120120    height: 0;
     
    130130  opacity: 1;
    131131  height: 10px;
    132 }`,bu=Ue("div")`
     132}`,Su=Ue("div")`
    133133  width: 20px;
    134134  opacity: 0;
     
    139139  transform: rotate(45deg);
    140140
    141   animation: ${xu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
     141  animation: ${wu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    142142    forwards;
    143143  animation-delay: 100ms;
     
    145145    content: '';
    146146    box-sizing: border-box;
    147     animation: ${vu} 0.2s ease-out forwards;
     147    animation: ${ju} 0.2s ease-out forwards;
    148148    opacity: 0;
    149149    animation-delay: 200ms;
     
    157157    width: 6px;
    158158  }
    159 `,_u=Ue("div")`
     159`,Cu=Ue("div")`
    160160  position: absolute;
    161 `,yu=Ue("div")`
     161`,ku=Ue("div")`
    162162  position: relative;
    163163  display: flex;
     
    166166  min-width: 20px;
    167167  min-height: 20px;
    168 `,wu=Ie`
     168`,Nu=Ie`
    169169from {
    170170  transform: scale(0.6);
     
    174174  transform: scale(1);
    175175  opacity: 1;
    176 }`,Su=Ue("div")`
     176}`,Eu=Ue("div")`
    177177  position: relative;
    178178  transform: scale(0.6);
    179179  opacity: 0.4;
    180180  min-width: 20px;
    181   animation: ${wu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
     181  animation: ${Nu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    182182    forwards;
    183 `,ju=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?h.createElement(Su,null,t):t:r==="blank"?null:h.createElement(yu,null,h.createElement(gu,{...n}),r!=="loading"&&h.createElement(_u,null,r==="error"?h.createElement(fu,{...n}):h.createElement(bu,{...n})))},Cu=e=>`
     183`,Tu=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?g.createElement(Eu,null,t):t:r==="blank"?null:g.createElement(ku,null,g.createElement(yu,{...n}),r!=="loading"&&g.createElement(Cu,null,r==="error"?g.createElement(vu,{...n}):g.createElement(Su,{...n})))},Au=e=>`
    1841840% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
    185185100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
    186 `,ku=e=>`
     186`,Pu=e=>`
    1871870% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
    188188100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
    189 `,Nu="0%{opacity:0;} 100%{opacity:1;}",Eu="0%{opacity:1;} 100%{opacity:0;}",Tu=Ue("div")`
     189`,Ou="0%{opacity:0;} 100%{opacity:1;}",Ru="0%{opacity:1;} 100%{opacity:0;}",Lu=Ue("div")`
    190190  display: flex;
    191191  align-items: center;
     
    199199  padding: 8px 10px;
    200200  border-radius: 8px;
    201 `,Au=Ue("div")`
     201`,Iu=Ue("div")`
    202202  display: flex;
    203203  justify-content: center;
     
    206206  flex: 1 1 auto;
    207207  white-space: pre-line;
    208 `,Pu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Ia()?[Nu,Eu]:[Cu(r),ku(r)];return{animation:t?`${Ie(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Ou=h.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Pu(e.position||t||"top-center",e.visible):{opacity:0},i=h.createElement(ju,{toast:e}),s=h.createElement(Au,{...e.ariaProps},Cr(e.message,e));return h.createElement(Tu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):h.createElement(h.Fragment,null,i,s))});tu(h.createElement);var Ru=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=h.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return h.createElement("div",{ref:i,className:t,style:r},o)},Lu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ia()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Iu=jr`
     208`,zu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Ha()?[Ou,Ru]:[Au(r),Pu(r)];return{animation:t?`${Ie(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Mu=g.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?zu(e.position||t||"top-center",e.visible):{opacity:0},s=g.createElement(Tu,{toast:e}),i=g.createElement(Iu,{...e.ariaProps},Cr(e.message,e));return g.createElement(Lu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:i}):g.createElement(g.Fragment,null,s,i))});su(g.createElement);var Du=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=g.useCallback(i=>{if(i){let l=()=>{let c=i.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return g.createElement("div",{ref:s,className:t,style:r},o)},Fu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ha()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},$u=Sr`
    209209  z-index: 9999;
    210210  > * {
    211211    pointer-events: auto;
    212212  }
    213 `,Er=16,Mu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=du(r,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Er,left:Er,right:Er,bottom:Er,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Lu(p,m);return h.createElement(Ru,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Iu:"",style:g},u.type==="custom"?Cr(u.message,u):o?o(u):h.createElement(Ou,{toast:u,position:p}))}))},q=ne;const $a={carousel:"carousel",grid:"grid"},zu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,shape:"rectangle",size:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:$a.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Du=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Ba=[{label:"Horizontal",value:"horizontal"}],Fu=[{label:"Vertical",value:"vertical"}],$u=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],Bu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Ua={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ha=y.createContext&&y.createContext(Ua),Uu=["attr","size","title"];function Hu(e,t){if(e==null)return{};var r=Vu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Vu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tr.apply(this,arguments)}function Va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){Wu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wu(e,t,r){return t=Gu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gu(e){var t=qu(e,"string");return typeof t=="symbol"?t:t+""}function qu(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wa(e){return e&&e.map((t,r)=>y.createElement(t.tag,Ar({key:r},t.attr),Wa(t.child)))}function V(e){return t=>y.createElement(Ku,Tr({attr:Ar({},e.attr)},t),Wa(e.child))}function Ku(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Hu(e,Uu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Ar(Ar({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return Ha!==void 0?y.createElement(Ha.Consumer,null,r=>t(r)):t(Ua)}function Yu(e){return V({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function bt(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function _t(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Kt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function Yt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function Xu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function Ju(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function tt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function Zu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function Ga(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function Qu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function Xt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function qa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=qa(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():qa(e[o],null)}}}}function Y(...e){return h.useCallback(Bn(...e),e)}function rt(e){const t=tp(e),r=h.forwardRef((n,o)=>{const{children:i,...s}=n,l=h.Children.toArray(i),c=l.find(np);if(c){const d=c.props.children,u=l.map(p=>p===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var ep=rt("Slot");function tp(e){const t=h.forwardRef((r,n)=>{const{children:o,...i}=r;if(h.isValidElement(o)){const s=ap(o),l=op(i,o.props);return o.type!==h.Fragment&&(l.ref=n?Bn(n,s):s),h.cloneElement(o,l)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rp=Symbol("radix.slottable");function np(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rp}function op(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function ap(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ka(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Ka(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ip(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ka(e))&&(n&&(n+=" "),n+=t);return n}function D(...e){return ip(e)}const sp="ecr-button",lp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},cp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function oe({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?ep:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:D(sp,lp[t],cp[r],e),...o})}function dp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(oe,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(oe,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:l=>o(l.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(oe,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(Xt,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(Ga,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(oe,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(_t,{})," ","Create Group"]}):null]})]})}function up(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function pp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function nt(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function mp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function fp({isFullScreen:e}){return a.jsx("div",{className:D("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const Ya=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:D("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),yt=({className:e,children:t,...r})=>a.jsx("button",{className:D("ecr-player__nav",e),...r,children:t});function Un(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Hn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Vn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Wn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const hp="Left",gp="Right",xp="Up",vp="Down",wt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Gn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Xa="mousemove",Ja="mouseup",bp="touchend",_p="touchmove",yp="touchstart";function Sp(e,t,r,n){return e>t?r>0?gp:hp:n>0?vp:xp}function Za(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function jp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(Xa,n),document.addEventListener(Ja,s));const{clientX:v,clientY:f}=p?u.touches[0]:u,x=Za([v,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Gn),{initial:x.slice(),xy:x,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:v,clientY:f}=g?u.touches[0]:u,[x,_]=Za([v,f],m.rotationAngle),b=x-p.xy[0],w=_-p.xy[1],S=Math.abs(b),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(S*S+C*C)/(N||1),E=[b/(N||1),w/(N||1)],T=Sp(S,C,b,w),R=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||wt.delta;if(S<R&&C<R&&!p.swiping)return p;const I={absX:S,absY:C,deltaX:b,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};I.first&&m.onSwipeStart&&m.onSwipeStart(I),m.onSwiping&&m.onSwiping(I);let A=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(A=!0),A&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:I,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const v=m[`onSwiped${g.dir}`];v&&v(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Gn),{eventData:g})})},i=()=>{document.removeEventListener(Xa,n),document.removeEventListener(Ja,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},wt.touchEventOptions),p.touchEventOptions),v=[[yp,r,g],[_p,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[bp,o,g]];v.forEach(([f,x,_])=>u.addEventListener(f,x,_)),m=()=>v.forEach(([f,x])=>u.removeEventListener(f,x))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Cp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function kp(e){const{trackMouse:t}=e,r=h.useRef(Object.assign({},Gn)),n=h.useRef(Object.assign({},wt)),o=h.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},wt),e);let i;for(i in wt)n.current[i]===void 0&&(n.current[i]=wt[i]);const[s,l]=h.useMemo(()=>jp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Cp(r.current,n.current,o.current,l),s}const Np=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},Qa=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=x=>{const _=p.current[x];_&&(i?_.play():_.pause(),s(b=>!b))},g=x=>{const _=p.current[x];_&&(_.muted=!d,u(b=>!b))},v=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=kp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{v&&c()},onSwipedDown:()=>{if(v){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((x,_)=>a.jsx("div",{className:"ecr-player__slide",children:x?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Np,{videoRefs:p,file:x,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},x.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(Un,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Hn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)}):a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)})]})]})},_))})},Ep=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(yt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Kt,{size:24})}):null,r.index<u-1?a.jsx(yt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Yt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(Ya,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(Xt,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(Qa,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Tp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Ap(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Pp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Op(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ei(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Rp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Lp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Ip(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Mp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}function ti(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function zp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Dp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function Fp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function $p(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}const Bp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Up=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Bp(r?.[e.id]??e.view_count)}),a.jsx(Ju,{size:14})]})]})},qn=y.memo(Up);function Hp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:D("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(qn,{story:e,styles:t}),a.jsxs("div",{className:D("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(oe,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx($p,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(oe,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(oe,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(ti,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:D("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(oe,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Rp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Lp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel-card__title",children:e.title})]})}function Vp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{style:{"--thumbnail-size":`${t?.size}px`},className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Hp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const Jt=({cb:e})=>{const t=je(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(up,{size:24})})};function Wp(e){return V({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const Zt=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Wp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Or=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(Qu,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:D("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:D("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),St=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),jt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Gp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const Ir=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Gp,{}),"ReelsWP"]});function ri(e,t){return function(){return e.apply(t,arguments)}}const{toString:qp}=Object.prototype,{getPrototypeOf:Kn}=Object,{iterator:Mr,toStringTag:ni}=Symbol,zr=(e=>t=>{const r=qp.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ve=e=>(e=e.toLowerCase(),t=>zr(t)===e),Dr=e=>t=>typeof t===e,{isArray:Ct}=Array,kt=Dr("undefined");function Qt(e){return e!==null&&!kt(e)&&e.constructor!==null&&!kt(e.constructor)&&ce(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const oi=ve("ArrayBuffer");function Kp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&oi(e.buffer),t}const Yp=Dr("string"),ce=Dr("function"),ai=Dr("number"),er=e=>e!==null&&typeof e=="object",Xp=e=>e===!0||e===!1,Fr=e=>{if(zr(e)!=="object")return!1;const t=Kn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ni in e)&&!(Mr in e)},Jp=e=>{if(!er(e)||Qt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Zp=ve("Date"),Qp=ve("File"),em=ve("Blob"),tm=ve("FileList"),rm=e=>er(e)&&ce(e.pipe),nm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ce(e.append)&&((t=zr(e))==="formdata"||t==="object"&&ce(e.toString)&&e.toString()==="[object FormData]"))},om=ve("URLSearchParams"),[am,im,sm,lm]=["ReadableStream","Request","Response","Headers"].map(ve),cm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function tr(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Qt(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function ii(e,t){if(Qt(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,si=e=>!kt(e)&&e!==ot;function Yn(){const{caseless:e,skipUndefined:t}=si(this)&&this||{},r={},n=(o,i)=>{const s=e&&ii(r,i)||i;Fr(r[s])&&Fr(o)?r[s]=Yn(r[s],o):Fr(o)?r[s]=Yn({},o):Ct(o)?r[s]=o.slice():(!t||!kt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&tr(arguments[o],n);return r}const dm=(e,t,r,{allOwnKeys:n}={})=>(tr(t,(o,i)=>{r&&ce(o)?e[i]=ri(o,r):e[i]=o},{allOwnKeys:n}),e),um=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},mm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Kn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},fm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},hm=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!ai(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},gm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Kn(Uint8Array)),xm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},vm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},bm=ve("HTMLFormElement"),_m=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),li=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ym=ve("RegExp"),ci=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};tr(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},wm=e=>{ci(e,(t,r)=>{if(ce(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ce(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},jm=()=>{},Cm=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function km(e){return!!(e&&ce(e.append)&&e[ni]==="FormData"&&e[Mr])}const Nm=e=>{const t=new Array(10),r=(n,o)=>{if(er(n)){if(t.indexOf(n)>=0)return;if(Qt(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return tr(n,(s,l)=>{const c=r(s,o+1);!kt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},Em=ve("AsyncFunction"),Tm=e=>e&&(er(e)||ce(e))&&ce(e.then)&&ce(e.catch),di=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:i})=>{o===ot&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ce(ot.postMessage)),Am=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||di,j={isArray:Ct,isArrayBuffer:oi,isBuffer:Qt,isFormData:nm,isArrayBufferView:Kp,isString:Yp,isNumber:ai,isBoolean:Xp,isObject:er,isPlainObject:Fr,isEmptyObject:Jp,isReadableStream:am,isRequest:im,isResponse:sm,isHeaders:lm,isUndefined:kt,isDate:Zp,isFile:Qp,isBlob:em,isRegExp:ym,isFunction:ce,isStream:rm,isURLSearchParams:om,isTypedArray:gm,isFileList:tm,forEach:tr,merge:Yn,extend:dm,trim:cm,stripBOM:um,inherits:pm,toFlatObject:mm,kindOf:zr,kindOfTest:ve,endsWith:fm,toArray:hm,forEachEntry:xm,matchAll:vm,isHTMLForm:bm,hasOwnProperty:li,hasOwnProp:li,reduceDescriptors:ci,freezeMethods:wm,toObjectSet:Sm,toCamelCase:_m,noop:jm,toFiniteNumber:Cm,findKey:ii,global:ot,isContextDefined:si,isSpecCompliantForm:km,toJSONObject:Nm,isAsyncFn:Em,isThenable:Tm,setImmediate:di,asap:Am,isIterable:e=>e!=null&&ce(e[Mr])};function B(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}j.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.status}}});const ui=B.prototype,pi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{pi[e]={value:e}}),Object.defineProperties(B,pi),Object.defineProperty(ui,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,i)=>{const s=Object.create(ui);j.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return B.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Pm=null;function Xn(e){return j.isPlainObject(e)||j.isArray(e)}function mi(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function fi(e,t,r){return e?e.concat(t).map(function(o,i){return o=mi(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Om(e){return j.isArray(e)&&!e.some(Xn)}const Rm=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(e,t,r){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=j.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,x){return!j.isUndefined(x[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(o))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(j.isDate(v))return v.toISOString();if(j.isBoolean(v))return v.toString();if(!c&&j.isBlob(v))throw new B("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(v)||j.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function u(v,f,x){let _=v;if(v&&!x&&typeof v=="object"){if(j.endsWith(f,"{}"))f=n?f:f.slice(0,-2),v=JSON.stringify(v);else if(j.isArray(v)&&Om(v)||(j.isFileList(v)||j.endsWith(f,"[]"))&&(_=j.toArray(v)))return f=mi(f),_.forEach(function(w,S){!(j.isUndefined(w)||w===null)&&t.append(s===!0?fi([f],S,i):s===null?f:f+"[]",d(w))}),!1}return Xn(v)?!0:(t.append(fi(x,f,i),d(v)),!1)}const p=[],m=Object.assign(Rm,{defaultVisitor:u,convertValue:d,isVisitable:Xn});function g(v,f){if(!j.isUndefined(v)){if(p.indexOf(v)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(v),j.forEach(v,function(_,b){(!(j.isUndefined(_)||_===null)&&o.call(t,_,j.isString(b)?b.trim():b,f,m))===!0&&g(_,f?f.concat(b):[b])}),p.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return g(e),t}function hi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Jn(e,t){this._pairs=[],e&&$r(e,this,t)}const gi=Jn.prototype;gi.append=function(t,r){this._pairs.push([t,r])},gi.toString=function(t){const r=t?function(n){return t.call(this,n,hi)}:hi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Lm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function xi(e,t,r){if(!t)return e;const n=r&&r.encode||Lm;j.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=j.isURLSearchParams(t)?t.toString():new Jn(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class vi{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(n){n!==null&&t(n)})}}const bi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Im={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Jn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Zn=typeof window<"u"&&typeof document<"u",Qn=typeof navigator=="object"&&navigator||void 0,Mm=Zn&&(!Qn||["ReactNative","NativeScript","NS"].indexOf(Qn.product)<0),zm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dm=Zn&&window.location.href||"http://localhost",se={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zn,hasStandardBrowserEnv:Mm,hasStandardBrowserWebWorkerEnv:zm,navigator:Qn,origin:Dm},Symbol.toStringTag,{value:"Module"})),...Im};function Fm(e,t){return $r(e,new se.classes.URLSearchParams,{visitor:function(r,n,o,i){return se.isNode&&j.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function $m(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Bm(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function _i(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&j.isArray(o)?o.length:s,c?(j.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!j.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&j.isArray(o[s])&&(o[s]=Bm(o[s])),!l)}if(j.isFormData(e)&&j.isFunction(e.entries)){const r={};return j.forEachEntry(e,(n,o)=>{t($m(n),o,r,0)}),r}return null}function Um(e,t,r){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const rr={transitional:bi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=j.isObject(t);if(i&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return o?JSON.stringify(_i(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Fm(t,this.formSerializer).toString();if((l=j.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $r(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Um(t)):t}],transformResponse:[function(t){const r=this.transitional||rr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?B.from(l,B.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:se.classes.FormData,Blob:se.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],e=>{rr.headers[e]={}});const Hm=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vm=e=>{const t={};let r,n,o;return e&&e.split(`
    214 `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Hm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},yi=Symbol("internals");function nr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:j.isArray(e)?e.map(Br):String(e)}function Wm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Gm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eo(e,t,r,n,o){if(j.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!j.isString(t)){if(j.isString(n))return t.indexOf(n)!==-1;if(j.isRegExp(n))return n.test(t)}}function qm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Km(e,t){const r=j.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let de=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=nr(c);if(!u)throw new Error("header name must be a non-empty string");const p=j.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const s=(l,c)=>j.forEach(l,(d,u)=>i(d,u,c));if(j.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(j.isString(t)&&(t=t.trim())&&!Gm(t))s(Vm(t),r);else if(j.isObject(t)&&j.isIterable(t)){let l={},c,d;for(const u of t){if(!j.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?j.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=nr(t),t){const n=j.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Wm(o);if(j.isFunction(r))return r.call(this,o,n);if(j.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=nr(t),t){const n=j.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||eo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=nr(s),s){const l=j.findKey(n,s);l&&(!r||eo(n,n[l],l,r))&&(delete n[l],o=!0)}}return j.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||eo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return j.forEach(this,(o,i)=>{const s=j.findKey(n,i);if(s){r[s]=Br(o),delete r[i];return}const l=t?qm(i):String(i).trim();l!==i&&delete r[i],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return j.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&j.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
    215 `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[yi]=this[yi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=nr(s);n[l]||(Km(o,s),n[l]=!0)}return j.isArray(t)?t.forEach(i):i(t),this}};de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),j.reduceDescriptors(de.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),j.freezeMethods(de);function to(e,t){const r=this||rr,n=t||r,o=de.from(n.headers);let i=n.data;return j.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function wi(e){return!!(e&&e.__CANCEL__)}function Nt(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}j.inherits(Nt,B,{__CANCEL__:!0});function Si(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ym(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xm(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function Jm(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=Xm(50,250);return Jm(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},ji=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ci=e=>(...t)=>j.asap(()=>e(...t)),Zm=se.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,se.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(se.origin),se.navigator&&/(msie|trident)/i.test(se.navigator.userAgent)):()=>!0,Qm=se.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];j.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),j.isString(n)&&l.push(`path=${n}`),j.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),j.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ef(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ki(e,t,r){let n=!ef(t);return e&&(n||r==!1)?tf(e,t):t}const Ni=e=>e instanceof de?{...e}:e;function at(e,t){t=t||{};const r={};function n(d,u,p,m){return j.isPlainObject(d)&&j.isPlainObject(u)?j.merge.call({caseless:m},d,u):j.isPlainObject(u)?j.merge({},u):j.isArray(u)?u.slice():u}function o(d,u,p,m){if(j.isUndefined(u)){if(!j.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!j.isUndefined(u))return n(void 0,u)}function s(d,u){if(j.isUndefined(u)){if(!j.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Ni(d),Ni(u),p,!0)};return j.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);j.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Ei=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=de.from(s),t.url=xi(ki(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),j.isFormData(r)){if(se.hasStandardBrowserEnv||se.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(j.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(se.hasStandardBrowserEnv&&(n&&j.isFunction(n)&&(n=n(t)),n||n!==!1&&Zm(t.url))){const c=o&&i&&Qm.read(i);c&&s.set(o,c)}return t},rf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ei(e);let i=o.data;const s=de.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,v;function f(){g&&g(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function _(){if(!x)return;const w=de.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};Si(function(k){r(k),f()},function(k){n(k),f()},C),x=null}"onloadend"in x?x.onloadend=_:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(_)},x.onabort=function(){x&&(n(new B("Request aborted",B.ECONNABORTED,e,x)),x=null)},x.onerror=function(S){const C=S&&S.message?S.message:"Network Error",N=new B(C,B.ERR_NETWORK,e,x);N.event=S||null,n(N),x=null},x.ontimeout=function(){let S=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||bi;o.timeoutErrorMessage&&(S=o.timeoutErrorMessage),n(new B(S,C.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,x)),x=null},i===void 0&&s.setContentType(null),"setRequestHeader"in x&&j.forEach(s.toJSON(),function(S,C){x.setRequestHeader(C,S)}),j.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),l&&l!=="json"&&(x.responseType=o.responseType),d&&([m,v]=Ur(d,!0),x.addEventListener("progress",m)),c&&x.upload&&([p,g]=Ur(c),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{x&&(n(!w||w.type?new Nt(null,e,x):w),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const b=Ym(o.url);if(b&&se.protocols.indexOf(b)===-1){n(new B("Unsupported protocol "+b+":",B.ERR_BAD_REQUEST,e));return}x.send(i||null)})},nf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof B?u:new Nt(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new B(`timeout ${t} of ms exceeded`,B.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>j.asap(l),c}},of=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},af=async function*(e,t){for await(const r of sf(e))yield*of(r,t)},sf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Ti=(e,t,r,n)=>{const o=af(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Ai=64*1024,{isFunction:Hr}=j,lf=(({Request:e,Response:t})=>({Request:e,Response:t}))(j.global),{ReadableStream:Pi,TextEncoder:Oi}=j.global,Ri=(e,...t)=>{try{return!!e(...t)}catch{return!1}},cf=e=>{e=j.merge.call({skipUndefined:!0},lf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",i=Hr(r),s=Hr(n);if(!o)return!1;const l=o&&Hr(Pi),c=o&&(typeof Oi=="function"?(v=>f=>v.encode(f))(new Oi):async v=>new Uint8Array(await new r(v).arrayBuffer())),d=i&&l&&Ri(()=>{let v=!1;const f=new r(se.origin,{body:new Pi,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!f}),u=s&&l&&Ri(()=>j.isReadableStream(new n("").body)),p={stream:u&&(v=>v.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!p[v]&&(p[v]=(f,x)=>{let _=f&&f[v];if(_)return _.call(f);throw new B(`Response type '${v}' is not supported`,B.ERR_NOT_SUPPORT,x)})});const m=async v=>{if(v==null)return 0;if(j.isBlob(v))return v.size;if(j.isSpecCompliantForm(v))return(await new r(se.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(j.isArrayBufferView(v)||j.isArrayBuffer(v))return v.byteLength;if(j.isURLSearchParams(v)&&(v=v+""),j.isString(v))return(await c(v)).byteLength},g=async(v,f)=>{const x=j.toFiniteNumber(v.getContentLength());return x??m(f)};return async v=>{let{url:f,method:x,data:_,signal:b,cancelToken:w,timeout:S,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:R}=Ei(v),I=t||fetch;k=k?(k+"").toLowerCase():"text";let A=nf([b,w&&w.toAbortSignal()],S),L=null;const M=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let $;try{if(N&&d&&x!=="get"&&x!=="head"&&($=await g(E,_))!==0){let Z=new r(f,{method:"POST",body:_,duplex:"half"}),pe;if(j.isFormData(_)&&(pe=Z.headers.get("content-type"))&&E.setContentType(pe),Z.body){const[Fe,he]=ji($,Ur(Ci(N)));_=Ti(Z.body,Ai,Fe,he)}}j.isString(T)||(T=T?"include":"omit");const O=i&&"credentials"in r.prototype,U={...R,signal:A,method:x.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:O?T:void 0};L=i&&new r(f,U);let P=await(i?I(L,R):I(f,U));const G=u&&(k==="stream"||k==="response");if(u&&(C||G&&M)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=P[$e]});const pe=j.toFiniteNumber(P.headers.get("content-length")),[Fe,he]=C&&ji(pe,Ur(Ci(C),!0))||[];P=new n(Ti(P.body,Ai,Fe,()=>{he&&he(),M&&M()}),Z)}k=k||"text";let X=await p[j.findKey(p,k)||"text"](P,v);return!G&&M&&M(),await new Promise((Z,pe)=>{Si(Z,pe,{data:X,headers:de.from(P.headers),status:P.status,statusText:P.statusText,config:v,request:L})})}catch(O){throw M&&M(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,v,L),{cause:O.cause||O}):B.from(O,O&&O.code,v,L)}}},df=new Map,Li=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=df;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:cf(t)),u=d;return d};Li();const ro={http:Pm,xhr:rf,fetch:{get:Li}};j.forEach(ro,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ii=e=>`- ${e}`,uf=e=>j.isFunction(e)||e===null||e===!1;function pf(e,t){e=j.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!uf(n)&&(o=ro[(l=String(n)).toLowerCase()],o===void 0))throw new B(`Unknown adapter '${l}'`);if(o&&(j.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
    216 `+s.map(Ii).join(`
    217 `):" "+Ii(s[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Mi={getAdapter:pf,adapters:ro};function no(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function zi(e){return no(e),e.headers=de.from(e.headers),e.data=to.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Mi.getAdapter(e.adapter||rr.adapter,e)(e).then(function(n){return no(e),n.data=to.call(e,e.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return wi(n)||(no(e),n&&n.response&&(n.response.data=to.call(e,e.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}const Di="1.13.1",Vr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Fi={};Vr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Di+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new B(o(s," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Fi[s]&&(Fi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function mf(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new B("option "+i+" must be "+c,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+i,B.ERR_BAD_OPTION)}}const Wr={assertOptions:mf,validators:Vr},ke=Wr.validators;let it=class{constructor(t){this.defaults=t||{},this.interceptors={request:new vi,response:new vi}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
    218 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(j.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&j.merge(i.common,i[r.method]);i&&j.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),r.headers=de.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const v=[zi.bind(this),void 0];for(v.unshift(...l),v.push(...d),m=v.length,u=Promise.resolve(r);p<m;)u=u.then(v[p++],v[p++]);return u}m=l.length;let g=r;for(;p<m;){const v=l[p++],f=l[p++];try{g=v(g)}catch(x){f.call(this,x);break}}try{u=zi.call(this,g)}catch(v){return Promise.reject(v)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=at(this.defaults,t);const r=ki(t.baseURL,t.url,t.allowAbsoluteUrls);return xi(r,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){it.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),j.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(at(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}it.prototype[t]=r(),it.prototype[t+"Form"]=r(!0)});let ff=class xd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Nt(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new xd(function(o){t=o}),cancel:t}}};function hf(e){return function(r){return e.apply(null,r)}}function gf(e){return j.isObject(e)&&e.isAxiosError===!0}const oo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(oo).forEach(([e,t])=>{oo[t]=e});function $i(e){const t=new it(e),r=ri(it.prototype.request,t);return j.extend(r,it.prototype,t,{allOwnKeys:!0}),j.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return $i(at(e,o))},r}const te=$i(rr);te.Axios=it,te.CanceledError=Nt,te.CancelToken=ff,te.isCancel=wi,te.VERSION=Di,te.toFormData=$r,te.AxiosError=B,te.Cancel=te.CanceledError,te.all=function(t){return Promise.all(t)},te.spread=hf,te.isAxiosError=gf,te.mergeConfig=at,te.AxiosHeaders=de,te.formToJSON=e=>_i(j.isHTMLForm(e)?new FormData(e):e),te.getAdapter=Mi.getAdapter,te.HttpStatusCode=oo,te.default=te;const{Axios:i_,AxiosError:s_,CanceledError:l_,isCancel:c_,CancelToken:d_,VERSION:u_,all:p_,Cancel:m_,isAxiosError:f_,spread:h_,toFormData:g_,AxiosHeaders:x_,HttpStatusCode:v_,formToJSON:b_,getAdapter:__,mergeConfig:y_}=te,Bi=ecommreelsInfo,ue=te.create({baseURL:`${Bi.apiBase}`,headers:{"X-WP-Nonce":Bi.nonce,"Content-Type":"application/json"}}),xf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:et,story_ids:s},c=await ue.post("stories/manage-group-stories",l);return q.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?q.error(l.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l)=>{try{n(!0),await ue.delete(`story/${s}`),l(c=>c.filter(d=>d.id!==s)),q.success("Reel deleted successfully!")}catch(c){c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!")}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function Ui(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Hi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=Ui(p,500),v=y.useRef(!0),f=y.useCallback(async b=>{b===1&&v.current?u(!0):c(!0);try{const w={page:b,per_page:20};e&&(w.group_id=e),g&&(w.search=g);const S=await ue.get("stories",{params:w}),C=S.data,N=parseInt(S.headers["x-wp-totalpages"]);r(k=>b===1?C:[...k,...C]),o(b+1),s(b<N)}catch(w){w instanceof Error?q.error(w.message):q.error("Something went wrong. Try again later!")}finally{v.current&&(v.current=!1),c(!1),u(!1)}},[e,g]);y.useEffect(()=>{o(1),r([]),f(1)},[g,f]);const x=y.useRef(null),_=y.useCallback(b=>{l||(x.current&&x.current.disconnect(),x.current=new IntersectionObserver(w=>{w[0].isIntersecting&&i&&f(n)}),b&&x.current.observe(b))},[l,i,n,f]);return y.useEffect(()=>()=>{x.current&&x.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:_}};function vf(){const e=je(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Hi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=xf(),[g,v]=y.useState(null),[f,x]=y.useState(null),[_,b]=y.useState([]),w=async()=>{const k=await p(_);k&&e(`?view=${K.mg}&gid=${k}`)},S=()=>{b(t.map(k=>k.id))},C=k=>{b(E=>E.includes(k)?E.filter(T=>T!==k):[...E,k])},N=y.useCallback(async()=>{g&&(await m(g,r),v(null))},[m,g,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[g&&a.jsx(Or,{onReject:()=>v(null),onAccept:N,isLoading:u,message:"Are you sure, You want to remove this reel?"}),a.jsx(St,{left:[a.jsx(jt,{name:"All Reels",Icon:Yu},"page"),a.jsx(Jt,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:_t},"add-reel-all-reel")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(dp,{selectedReelIds:_,handleSelectAll:S,clearSelection:()=>b([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:w}),t.length?a.jsx(Vp,{reels:t,styles:c,selectedReelIds:_,onSelectReel:C,onDeleteReel:v,onPreviewReel:x,lastStoryElementRef:o}):!n&&!l?a.jsx(mp,{}):null,n&&a.jsx(fp,{isFullScreen:!t.length})]}),!!f&&a.jsx(Ep,{previewReel:f,setPreviewReel:x})]})}const bf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,links:s};typeof l=="string"&&l.trim().length>0&&(c.thumbnail=l),n&&(c.story_id=n);const d=await ue.post("files",c);return q.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},ao=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(oe,{onClick:t,className:D("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(Zu,{className:"ecr-admin-save-button__icon"})," ",r]}),Vi=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),_f=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=je(),[s]=Gt(),l=s.get("sid"),c=s.get("from")||K.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=bf(),m=async()=>{if(u)return;const g=await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});g&&i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0,...l?{}:{state:{storyId:g}}})};return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(jt,{name:l?"Update Reel":"Add Reel",Icon:_t},"page"),a.jsx(Jt,{},"back")],center:[a.jsx(Vi,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(ao,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function yf(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let io;const wf=new Uint8Array(16);function Sf(){if(!io){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");io=crypto.getRandomValues.bind(crypto)}return io(wf)}const Wi={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function jf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Sf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,yf(n)}function Gi(e,t,r){return Wi.randomUUID&&!e?Wi.randomUUID():jf(e)}const qi="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ki=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:Gi()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:D("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:qi,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/**
    219  * @license lucide-react v0.552.0 - ISC
    220  *
    221  * This source code is licensed under the ISC license.
    222  * See the LICENSE file in the root directory of this source tree.
    223  */const Cf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Yi=e=>{const t=kf(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xi=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Nf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
    224  * @license lucide-react v0.552.0 - ISC
    225  *
    226  * This source code is licensed under the ISC license.
    227  * See the LICENSE file in the root directory of this source tree.
    228  */var Ef={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
    229  * @license lucide-react v0.552.0 - ISC
    230  *
    231  * This source code is licensed under the ISC license.
    232  * See the LICENSE file in the root directory of this source tree.
    233  */const Tf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>y.createElement("svg",{ref:c,...Ef,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Xi("lucide",o),...!i&&!Nf(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>y.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
    234  * @license lucide-react v0.552.0 - ISC
    235  *
    236  * This source code is licensed under the ISC license.
    237  * See the LICENSE file in the root directory of this source tree.
    238  */const be=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(Tf,{ref:i,iconNode:t,className:Xi(`lucide-${Cf(Yi(e))}`,`lucide-${e}`,n),...o}));return r.displayName=Yi(e),r};/**
    239  * @license lucide-react v0.552.0 - ISC
    240  *
    241  * This source code is licensed under the ISC license.
    242  * See the LICENSE file in the root directory of this source tree.
    243  */const Af=be("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
    244  * @license lucide-react v0.552.0 - ISC
    245  *
    246  * This source code is licensed under the ISC license.
    247  * See the LICENSE file in the root directory of this source tree.
    248  */const so=be("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
    249  * @license lucide-react v0.552.0 - ISC
    250  *
    251  * This source code is licensed under the ISC license.
    252  * See the LICENSE file in the root directory of this source tree.
    253  */const Pf=be("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
    254  * @license lucide-react v0.552.0 - ISC
    255  *
    256  * This source code is licensed under the ISC license.
    257  * See the LICENSE file in the root directory of this source tree.
    258  */const Of=be("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
    259  * @license lucide-react v0.552.0 - ISC
    260  *
    261  * This source code is licensed under the ISC license.
    262  * See the LICENSE file in the root directory of this source tree.
    263  */const Rf=be("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
    264  * @license lucide-react v0.552.0 - ISC
    265  *
    266  * This source code is licensed under the ISC license.
    267  * See the LICENSE file in the root directory of this source tree.
    268  */const Lf=be("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
    269  * @license lucide-react v0.552.0 - ISC
    270  *
    271  * This source code is licensed under the ISC license.
    272  * See the LICENSE file in the root directory of this source tree.
    273  */const If=be("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
    274  * @license lucide-react v0.552.0 - ISC
    275  *
    276  * This source code is licensed under the ISC license.
    277  * See the LICENSE file in the root directory of this source tree.
    278  */const Mf=be("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
    279  * @license lucide-react v0.552.0 - ISC
    280  *
    281  * This source code is licensed under the ISC license.
    282  * See the LICENSE file in the root directory of this source tree.
    283  */const zf=be("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
    284  * @license lucide-react v0.552.0 - ISC
    285  *
    286  * This source code is licensed under the ISC license.
    287  * See the LICENSE file in the root directory of this source tree.
    288  */const Df=be("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
    289  * @license lucide-react v0.552.0 - ISC
    290  *
    291  * This source code is licensed under the ISC license.
    292  * See the LICENSE file in the root directory of this source tree.
    293  */const Ff=be("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var $f=Symbol.for("react.lazy"),Gr=h[" use ".trim().toString()];function Bf(e){return typeof e=="object"&&e!==null&&"then"in e}function Ji(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$f&&"_payload"in e&&Bf(e._payload)}function Uf(e){const t=Hf(e),r=h.forwardRef((n,o)=>{let{children:i,...s}=n;Ji(i)&&typeof Gr=="function"&&(i=Gr(i._payload));const l=h.Children.toArray(i),c=l.find(Wf);if(c){const d=c.props.children,u=l.map(p=>p===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Hf(e){const t=h.forwardRef((r,n)=>{let{children:o,...i}=r;if(Ji(o)&&typeof Gr=="function"&&(o=Gr(o._payload)),h.isValidElement(o)){const s=qf(o),l=Gf(i,o.props);return o.type!==h.Fragment&&(l.ref=n?Bn(n,s):s),h.cloneElement(o,l)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vf=Symbol("radix.slottable");function Wf(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vf}function Gf(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function qf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Kf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yf=Kf.reduce((e,t)=>{const r=Uf(`Primitive.${t}`),n=h.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xf="Separator",Zi="horizontal",Jf=["horizontal","vertical"],Qi=h.forwardRef((e,t)=>{const{decorative:r,orientation:n=Zi,...o}=e,i=Zf(n)?n:Zi,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Yf.div,{"data-orientation":i,...l,...o,ref:t})});Qi.displayName=Xf;function Zf(e){return Jf.includes(e)}var Qf=Qi;function lo({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(Qf,{"data-slot":"separator",decorative:r,orientation:t,className:D("ecr-separator",e),...n})}const Et=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(lo,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(lo,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(oe,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eh(e,t){const r=h.createContext(t),n=i=>{const{children:s,...l}=i,c=h.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=h.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(i,s){const l=h.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...v}=p,f=m?.[e]?.[c]||l,x=h.useMemo(()=>v,Object.values(v));return a.jsx(f.Provider,{value:x,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,v=h.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>h.createContext(s));return function(l){const c=l?.[e]||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,th(o,...t)]}function th(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var rh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=rh.reduce((e,t)=>{const r=rt(`Primitive.${t}`),n=h.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nh(e,t){e&&br.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...r)=>t.current?.(...r),[])}function oh(e,t=globalThis?.document){const r=Ve(e);h.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ah="DismissableLayer",co="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",es,ts=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=h.useContext(ts),[u,p]=h.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=h.useState({}),v=Y(t,k=>p(k)),f=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(x),b=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=_,C=dh(k=>{const E=k.target,T=[...d.branches].some(R=>R.contains(E));!S||T||(o?.(k),s?.(k),k.defaultPrevented||l?.())},m),N=uh(k=>{const E=k.target;[...d.branches].some(R=>R.contains(E))||(i?.(k),s?.(k),k.defaultPrevented||l?.())},m);return oh(k=>{b===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),h.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(es=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),rs(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=es)}},[u,m,r,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),rs())},[u,d]),h.useEffect(()=>{const k=()=>g({});return document.addEventListener(co,k),()=>document.removeEventListener(co,k)},[]),a.jsx(W.div,{...c,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,N.onFocusCapture),onBlurCapture:H(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=ah;var lh="DismissableLayerBranch",ch=h.forwardRef((e,t)=>{const r=h.useContext(ts),n=h.useRef(null),o=Y(t,n);return h.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ch.displayName=lh;function dh(e,t=globalThis?.document){const r=Ve(e),n=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ns(ih,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function uh(e,t=globalThis?.document){const r=Ve(e),n=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!n.current&&ns(sh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function rs(){const e=new CustomEvent(co);document.dispatchEvent(e)}function ns(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?nh(o,i):o.dispatchEvent(i)}var uo=0;function po(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??os()),document.body.insertAdjacentElement("beforeend",e[1]??os()),uo++,()=>{uo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),uo--}},[])}function os(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mo="focusScope.autoFocusOnMount",fo="focusScope.autoFocusOnUnmount",as={bubbles:!1,cancelable:!0},ph="FocusScope",Kr=h.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=h.useState(null),d=Ve(o),u=Ve(i),p=h.useRef(null),m=Y(t,f=>c(f)),g=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const S=w.target;l.contains(S)?p.current=S:We(p.current,{select:!0})},x=function(w){if(g.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||We(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",x);const b=new MutationObserver(_);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",x),b.disconnect()}}},[n,l,g.paused]),h.useEffect(()=>{if(l){ls.add(g);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(mo,as);l.addEventListener(mo,d),l.dispatchEvent(_),_.defaultPrevented||(mh(vh(is(l)),{select:!0}),document.activeElement===f&&We(l))}return()=>{l.removeEventListener(mo,d),setTimeout(()=>{const _=new CustomEvent(fo,as);l.addEventListener(fo,u),l.dispatchEvent(_),_.defaultPrevented||We(f??document.body,{select:!0}),l.removeEventListener(fo,u),ls.remove(g)},0)}}},[l,d,u,g]);const v=h.useCallback(f=>{if(!r&&!n||g.paused)return;const x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(x&&_){const b=f.currentTarget,[w,S]=fh(b);w&&S?!f.shiftKey&&_===S?(f.preventDefault(),r&&We(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&We(S,{select:!0})):_===b&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:v})});Kr.displayName=ph;function mh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function fh(e){const t=is(e),r=ss(t,e),n=ss(t.reverse(),e);return[r,n]}function is(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ss(e,t){for(const r of e)if(!hh(r,{upTo:t}))return r}function hh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gh(e){return e instanceof HTMLInputElement&&"select"in e}function We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gh(e)&&t&&e.select()}}var ls=xh();function xh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=cs(e,t),e.unshift(t)},remove(t){e=cs(e,t),e[0]?.resume()}}}function cs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function vh(e){return e.filter(t=>t.tagName!=="A")}var ie=globalThis?.document?h.useLayoutEffect:()=>{},bh=h[" useId ".trim().toString()]||(()=>{}),_h=0;function Ne(e){const[t,r]=h.useState(bh());return ie(()=>{r(n=>n??String(_h++))},[e]),e||(t?`radix-${t}`:"")}const yh=["top","right","bottom","left"],Ge=Math.min,me=Math.max,Yr=Math.round,Xr=Math.floor,Ee=e=>({x:e,y:e}),wh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function ho(e,t,r){return me(e,Ge(t,r))}function Me(e,t){return typeof e=="function"?e(t):e}function ze(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function go(e){return e==="x"?"y":"x"}function xo(e){return e==="y"?"height":"width"}const jh=new Set(["top","bottom"]);function Te(e){return jh.has(ze(e))?"y":"x"}function vo(e){return go(Te(e))}function Ch(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=vo(e),i=xo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function kh(e){const t=Jr(e);return[bo(e),t,bo(t)]}function bo(e){return e.replace(/start|end/g,t=>Sh[t])}const ds=["left","right"],us=["right","left"],Nh=["top","bottom"],Eh=["bottom","top"];function Th(e,t,r){switch(e){case"top":case"bottom":return r?t?us:ds:t?ds:us;case"left":case"right":return t?Nh:Eh;default:return[]}}function Ah(e,t,r,n){const o=Tt(e);let i=Th(ze(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(bo)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>wh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function ps(e){return typeof e!="number"?Ph(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ms(e,t,r){let{reference:n,floating:o}=e;const i=Te(t),s=vo(t),l=xo(s),c=ze(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Oh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=ms(d,n,c),m=n,g={},v=0;for(let f=0;f<l.length;f++){const{name:x,fn:_}=l[f],{x:b,y:w,data:S,reset:C}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=b??u,p=w??p,g={...g,[x]:{...g[x],...S}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=ms(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function or(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Me(t,e),v=ps(g),x=l[m?p==="floating"?"reference":"floating":p],_=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(x)))==null||r?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),b=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:w,strategy:c}):b);return{top:(_.top-C.top+v.top)/S.y,bottom:(C.bottom-_.bottom+v.bottom)/S.y,left:(_.left-C.left+v.left)/S.x,right:(C.right-_.right+v.right)/S.x}}const Rh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Me(e,t)||{};if(d==null)return{};const p=ps(u),m={x:r,y:n},g=vo(o),v=xo(g),f=await s.getDimensions(d),x=g==="y",_=x?"top":"left",b=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[g]-m[g]-i.floating[v],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(N)))&&(k=l.floating[w]||i.floating[v]);const E=S/2-C/2,T=k/2-f[v]/2-1,R=Ge(p[_],T),I=Ge(p[b],T),A=R,L=k-f[v]-I,M=k/2-f[v]/2+E,$=ho(A,M,L),O=!c.arrow&&Tt(o)!=null&&M!==$&&i.reference[v]/2-(M<A?R:I)-f[v]/2<0,U=O?M<A?M-A:M-L:0;return{[g]:m[g]+U,data:{[g]:$,centerOffset:M-$-U,...O&&{alignmentOffset:U}},reset:O}}}),Lh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:f=!0,...x}=Me(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const _=ze(o),b=Te(l),w=ze(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Jr(l)]:kh(l)),N=v!=="none";!m&&N&&C.push(...Ah(l,f,v,S));const k=[l,...C],E=await or(t,x),T=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const M=Ch(o,s,S);T.push(E[M[0]],E[M[1]])}if(R=[...R,{placement:o,overflows:T}],!T.every(M=>M<=0)){var I,A;const M=(((I=i.flip)==null?void 0:I.index)||0)+1,$=k[M];if($&&(!(p==="alignment"?b!==Te($):!1)||R.every(P=>Te(P.placement)===b?P.overflows[0]>0:!0)))return{data:{index:M,overflows:R},reset:{placement:$}};let O=(A=R.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!O)switch(g){case"bestFit":{var L;const U=(L=R.filter(P=>{if(N){const G=Te(P.placement);return G===b||G==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(G=>G>0).reduce((G,X)=>G+X,0)]).sort((P,G)=>P[1]-G[1])[0])==null?void 0:L[0];U&&(O=U);break}case"initialPlacement":O=l;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function fs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hs(e){return yh.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Me(e,t);switch(n){case"referenceHidden":{const i=await or(t,{...o,elementContext:"reference"}),s=fs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:hs(s)}}}case"escaped":{const i=await or(t,{...o,altBoundary:!0}),s=fs(i,r.floating);return{data:{escapedOffsets:s,escaped:hs(s)}}}default:return{}}}}},gs=new Set(["left","top"]);async function Mh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ze(r),l=Tt(r),c=Te(r)==="y",d=gs.has(s)?-1:1,u=i&&c?-1:1,p=Me(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const zh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Mh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Dh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:_,y:b}=x;return{x:_,y:b}}},...c}=Me(e,t),d={x:r,y:n},u=await or(t,c),p=Te(ze(o)),m=go(p);let g=d[m],v=d[p];if(i){const x=m==="y"?"top":"left",_=m==="y"?"bottom":"right",b=g+u[x],w=g-u[_];g=ho(b,g,w)}if(s){const x=p==="y"?"top":"left",_=p==="y"?"bottom":"right",b=v+u[x],w=v-u[_];v=ho(b,v,w)}const f=l.fn({...t,[m]:g,[p]:v});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Fh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Me(e,t),u={x:r,y:n},p=Te(o),m=go(p);let g=u[m],v=u[p];const f=Me(l,t),x=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",S=i.reference[m]-i.floating[w]+x.mainAxis,C=i.reference[m]+i.reference[w]-x.mainAxis;g<S?g=S:g>C&&(g=C)}if(d){var _,b;const w=m==="y"?"width":"height",S=gs.has(ze(o)),C=i.reference[p]-i.floating[w]+(S&&((_=s.offset)==null?void 0:_[p])||0)+(S?0:x.crossAxis),N=i.reference[p]+i.reference[w]+(S?0:((b=s.offset)==null?void 0:b[p])||0)-(S?x.crossAxis:0);v<C?v=C:v>N&&(v=N)}return{[m]:g,[p]:v}}}},$h=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Me(e,t),u=await or(t,d),p=ze(o),m=Tt(o),g=Te(o)==="y",{width:v,height:f}=i.floating;let x,_;p==="top"||p==="bottom"?(x=p,_=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,x=m==="end"?"top":"bottom");const b=f-u.top-u.bottom,w=v-u.left-u.right,S=Ge(f-u[x],b),C=Ge(v-u[_],w),N=!t.middlewareData.shift;let k=S,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=b),N&&!m){const R=me(u.left,0),I=me(u.right,0),A=me(u.top,0),L=me(u.bottom,0);g?E=v-2*(R!==0||I!==0?R+I:me(u.left,u.right)):k=f-2*(A!==0||L!==0?A+L:me(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const T=await s.getDimensions(l.floating);return v!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function At(e){return xs(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(xs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xs(e){return Qr()?e instanceof Node||e instanceof fe(e).Node:!1}function _e(e){return Qr()?e instanceof Element||e instanceof fe(e).Element:!1}function Pe(e){return Qr()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function vs(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}const Bh=new Set(["inline","contents"]);function ar(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Bh.has(o)}const Uh=new Set(["table","td","th"]);function Hh(e){return Uh.has(At(e))}const Vh=[":popover-open",":modal"];function en(e){return Vh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wh=["transform","translate","scale","rotate","perspective"],Gh=["transform","translate","scale","rotate","perspective","filter"],qh=["paint","layout","strict","content"];function _o(e){const t=yo(),r=_e(e)?ye(e):e;return Wh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Gh.some(n=>(r.willChange||"").includes(n))||qh.some(n=>(r.contain||"").includes(n))}function Kh(e){let t=qe(e);for(;Pe(t)&&!Pt(t);){if(_o(t))return t;if(en(t))return null;t=qe(t)}return null}function yo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yh=new Set(["html","body","#document"]);function Pt(e){return Yh.has(At(e))}function ye(e){return fe(e).getComputedStyle(e)}function tn(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vs(e)&&e.host||Ae(e);return vs(t)?t.host:t}function bs(e){const t=qe(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&ar(t)?t:bs(t)}function ir(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=bs(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=fe(o);if(i){const l=wo(s);return t.concat(s,s.visualViewport||[],ar(o)?o:[],l&&r?ir(l):[])}return t.concat(o,ir(o,[],r))}function wo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _s(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Pe(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function So(e){return _e(e)?e:e.contextElement}function Ot(e){const t=So(e);if(!Pe(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=_s(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xh=Ee(0);function ys(e){const t=fe(e);return!yo()||!t.visualViewport?Xh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==fe(e)?!1:t}function st(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=So(e);let s=Ee(1);t&&(n?_e(n)&&(s=Ot(n)):s=Ot(e));const l=Jh(i,r,n)?ys(i):Ee(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=fe(i),g=n&&_e(n)?fe(n):n;let v=m,f=wo(v);for(;f&&n&&g!==v;){const x=Ot(f),_=f.getBoundingClientRect(),b=ye(f),w=_.left+(f.clientLeft+parseFloat(b.paddingLeft))*x.x,S=_.top+(f.clientTop+parseFloat(b.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,p*=x.y,c+=w,d+=S,v=fe(f),f=wo(v)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:st(Ae(e)).left+r}function ws(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Zh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Ae(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Ee(1);const u=Ee(0),p=Pe(n);if((p||!p&&!i)&&((At(n)!=="body"||ar(s))&&(c=tn(n)),Pe(n))){const g=st(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?ws(s,c):Ee(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Qh(e){return Array.from(e.getClientRects())}function eg(e){const t=Ae(e),r=tn(e),n=e.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return ye(n).direction==="rtl"&&(s+=me(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ss=25;function tg(e,t){const r=fe(e),n=Ae(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=yo();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(n.clientWidth-p.clientWidth-g);v<=Ss&&(i-=v)}else d<=Ss&&(i+=d);return{width:i,height:s,x:l,y:c}}const rg=new Set(["absolute","fixed"]);function ng(e,t){const r=st(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Pe(e)?Ot(e):Ee(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function js(e,t,r){let n;if(t==="viewport")n=tg(e,r);else if(t==="document")n=eg(Ae(e));else if(_e(t))n=ng(t,r);else{const o=ys(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function Cs(e,t){const r=qe(e);return r===t||!_e(r)||Pt(r)?!1:ye(r).position==="fixed"||Cs(r,t)}function og(e,t){const r=t.get(e);if(r)return r;let n=ir(e,[],!1).filter(l=>_e(l)&&At(l)!=="body"),o=null;const i=ye(e).position==="fixed";let s=i?qe(e):e;for(;_e(s)&&!Pt(s);){const l=ye(s),c=_o(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&rg.has(o.position)||ar(s)&&!c&&Cs(e,s))?n=n.filter(u=>u!==s):o=l,s=qe(s)}return t.set(e,n),n}function ag(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:og(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=js(t,u,o);return d.top=me(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=me(p.left,d.left),d},js(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ig(e){const{width:t,height:r}=_s(e);return{width:t,height:r}}function sg(e,t,r){const n=Pe(t),o=Ae(t),i=r==="fixed",s=st(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ee(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((At(t)!=="body"||ar(o))&&(l=tn(t)),n){const g=st(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?ws(o,l):Ee(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function jo(e){return ye(e).position==="static"}function ks(e,t){if(!Pe(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Ns(e,t){const r=fe(e);if(en(e))return r;if(!Pe(e)){let o=qe(e);for(;o&&!Pt(o);){if(_e(o)&&!jo(o))return o;o=qe(o)}return r}let n=ks(e,t);for(;n&&Hh(n)&&jo(n);)n=ks(n,t);return n&&Pt(n)&&jo(n)&&!_o(n)?r:n||Kh(e)||r}const lg=async function(e){const t=this.getOffsetParent||Ns,r=this.getDimensions,n=await r(e.floating);return{reference:sg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cg(e){return ye(e).direction==="rtl"}const dg={convertOffsetParentRelativeRectToViewportRelativeRect:Zh,getDocumentElement:Ae,getClippingRect:ag,getOffsetParent:Ns,getElementRects:lg,getClientRects:Qh,getDimensions:ig,getScale:Ot,isElement:_e,isRTL:cg};function Es(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ug(e,t){let r=null,n;const o=Ae(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const v=Xr(p),f=Xr(o.clientWidth-(u+m)),x=Xr(o.clientHeight-(p+g)),_=Xr(u),w={rootMargin:-v+"px "+-f+"px "+-x+"px "+-_+"px",threshold:me(0,Ge(1,c))||1};let S=!0;function C(N){const k=N[0].intersectionRatio;if(k!==c){if(!S)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!Es(d,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function pg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=So(e),u=o||i?[...d?ir(d):[],...ir(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),i&&_.addEventListener("resize",r)});const p=d&&l?ug(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(_=>{let[b]=_;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let v,f=c?st(e):null;c&&x();function x(){const _=st(e);f&&!Es(f,_)&&r(),f=_,v=requestAnimationFrame(x)}return r(),()=>{var _;u.forEach(b=>{o&&b.removeEventListener("scroll",r),i&&b.removeEventListener("resize",r)}),p?.(),(_=g)==null||_.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const mg=zh,fg=Dh,hg=Lh,gg=$h,xg=Ih,Ts=Rh,vg=Fh,bg=(e,t,r)=>{const n=new Map,o={platform:dg,...r},i={...o.platform,_c:n};return Oh(e,t,{...o,platform:i})};var _g=typeof document<"u",yg=function(){},nn=_g?y.useLayoutEffect:yg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function As(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ps(e,t){const r=As(e);return Math.round(t*r)/r}function Co(e){const t=h.useRef(e);return nn(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=h.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=h.useState(n);on(m,n)||g(n);const[v,f]=h.useState(null),[x,_]=h.useState(null),b=h.useCallback(P=>{P!==N.current&&(N.current=P,f(P))},[]),w=h.useCallback(P=>{P!==k.current&&(k.current=P,_(P))},[]),S=i||v,C=s||x,N=h.useRef(null),k=h.useRef(null),E=h.useRef(u),T=c!=null,R=Co(c),I=Co(o),A=Co(d),L=h.useCallback(()=>{if(!N.current||!k.current)return;const P={placement:t,strategy:r,middleware:m};I.current&&(P.platform=I.current),bg(N.current,k.current,P).then(G=>{const X={...G,isPositioned:A.current!==!1};M.current&&!on(E.current,X)&&(E.current=X,br.flushSync(()=>{p(X)}))})},[m,t,r,I,A]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[d]);const M=h.useRef(!1);nn(()=>(M.current=!0,()=>{M.current=!1}),[]),nn(()=>{if(S&&(N.current=S),C&&(k.current=C),S&&C){if(R.current)return R.current(S,C,L);L()}},[S,C,L,R,T]);const $=h.useMemo(()=>({reference:N,floating:k,setReference:b,setFloating:w}),[b,w]),O=h.useMemo(()=>({reference:S,floating:C}),[S,C]),U=h.useMemo(()=>{const P={position:r,left:0,top:0};if(!O.floating)return P;const G=Ps(O.floating,u.x),X=Ps(O.floating,u.y);return l?{...P,transform:"translate("+G+"px, "+X+"px)",...As(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:G,top:X}},[r,l,O.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:L,refs:$,elements:O,floatingStyles:U}),[u,L,$,O,U])}const Sg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ts({element:n.current,padding:o}).fn(r):{}:n?Ts({element:n,padding:o}).fn(r):{}}}},jg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),kg=(e,t)=>({...vg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...gg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...Sg(e),options:[e,t]});var Pg="Arrow",Os=h.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Os.displayName=Pg;var Og=Os;function Rg(e){const[t,r]=h.useState(void 0);return ie(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var ko="Popper",[Rs,an]=He(ko),[Lg,Ls]=Rs(ko),Is=e=>{const{__scopePopper:t,children:r}=e,[n,o]=h.useState(null);return a.jsx(Lg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Is.displayName=ko;var Ms="PopperAnchor",zs=h.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ls(Ms,r),s=h.useRef(null),l=Y(t,s),c=h.useRef(null);return h.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});zs.displayName=Ms;var No="PopperContent",[Ig,Mg]=Rs(No),Ds=h.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...f}=e,x=Ls(No,r),[_,b]=h.useState(null),w=Y(t,F=>b(F)),[S,C]=h.useState(null),N=Rg(S),k=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(d)?d:[d],A=I.length>0,L={padding:R,boundary:I.filter(Dg),altBoundary:A},{refs:M,floatingStyles:$,placement:O,isPositioned:U,middlewareData:P}=wg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>pg(...F,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[jg({mainAxis:o+E,alignmentAxis:s}),c&&Cg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?kg():void 0,...L}),c&&Ng({...L}),Eg({...L,apply:({elements:F,rects:ee,availableWidth:le,availableHeight:J})=>{const{width:Q,height:re}=ee.reference,ge=F.floating.style;ge.setProperty("--radix-popper-available-width",`${le}px`),ge.setProperty("--radix-popper-available-height",`${J}px`),ge.setProperty("--radix-popper-anchor-width",`${Q}px`),ge.setProperty("--radix-popper-anchor-height",`${re}px`)}}),S&&Ag({element:S,padding:l}),Fg({arrowWidth:k,arrowHeight:E}),m&&Tg({strategy:"referenceHidden",...L})]}),[G,X]=Bs(O),Z=Ve(v);ie(()=>{U&&Z?.()},[U,Z]);const pe=P.arrow?.x,Fe=P.arrow?.y,he=P.arrow?.centerOffset!==0,[$e,ht]=h.useState();return ie(()=>{_&&ht(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Ig,{scope:r,placedSide:G,onArrowChange:C,arrowX:pe,arrowY:Fe,shouldHideArrow:he,children:a.jsx(W.div,{"data-side":G,"data-align":X,...f,ref:w,style:{...f.style,animation:U?void 0:"none"}})})})});Ds.displayName=No;var Fs="PopperArrow",zg={top:"bottom",right:"left",bottom:"top",left:"right"},$s=h.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Mg(Fs,n),s=zg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Og,{...o,ref:r,style:{...o.style,display:"block"}})})});$s.displayName=Fs;function Dg(e){return e!==null}var Fg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Bs(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let v="",f="";return d==="bottom"?(v=s?p:`${m}px`,f=`${-c}px`):d==="top"?(v=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(v=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(v=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:v,y:f}}}});function Bs(e){const[t,r="center"]=e.split("-");return[t,r]}var Us=Is,Eo=zs,Hs=Ds,Vs=$s,$g="Portal",sn=h.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=h.useState(!1);ie(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ca.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=$g;function Bg(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=Ug(t),o=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),i=Y(n.ref,Hg(o));return typeof r=="function"||n.isPresent?h.cloneElement(o,{ref:i}):null};Ke.displayName="Presence";function Ug(e){const[t,r]=h.useState(),n=h.useRef(null),o=h.useRef(e),i=h.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Bg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),ie(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ie(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function Hg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vg=h[" useInsertionEffect ".trim().toString()]||ie;function lt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Wg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=h.useCallback(u=>{if(l){const p=Gg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Wg({defaultProp:e,onChange:t}){const[r,n]=h.useState(e),o=h.useRef(r),i=h.useRef(t);return Vg(()=>{i.current=t},[t]),h.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Gg(e){return typeof e=="function"}var qg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,cn=new WeakMap,dn={},To=0,Ws=function(e){return e&&(e.host||Ws(e.parentNode))},Kg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ws(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Yg=function(e,t,r,n){var o=Kg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),v=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,x=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,x),s.push(m),f===1&&v&&cn.set(m,!0),x===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),To++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),To--,To||(Rt=new WeakMap,Rt=new WeakMap,cn=new WeakMap,dn={})}},Ao=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=qg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Yg(n,o,r,"aria-hidden")):function(){return null}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Oe.apply(this,arguments)};function Gs(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Xg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Jg="with-scroll-bars-hidden",Zg="--removed-body-scroll-bar-size";function Po(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var ex=typeof window<"u"?h.useLayoutEffect:h.useEffect,qs=new WeakMap;function tx(e,t){var r=Qg(null,function(n){return e.forEach(function(o){return Po(o,n)})});return ex(function(){var n=qs.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||Po(l,null)}),i.forEach(function(l){o.has(l)||Po(l,s)})}qs.set(r,e)},[e]),r}function rx(e){return e}function nx(e,t){t===void 0&&(t=rx);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ox(e){e===void 0&&(e={});var t=nx(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Ks=function(e){var t=e.sideCar,r=Gs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,Oe({},r))};Ks.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),Ks}var Ys=ox(),Oo=function(){},mn=h.forwardRef(function(e,t){var r=h.useRef(null),n=h.useState({onScrollCapture:Oo,onWheelCapture:Oo,onTouchMoveCapture:Oo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,v=e.noIsolation,f=e.inert,x=e.allowPinchZoom,_=e.as,b=_===void 0?"div":_,w=e.gapMode,S=Gs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=tx([r,t]),k=Oe(Oe({},S),o);return h.createElement(h.Fragment,null,u&&h.createElement(C,{sideCar:Ys,removeScrollBar:d,shards:p,noRelative:g,noIsolation:v,inert:f,setCallbacks:i,allowPinchZoom:!!x,lockRef:r,gapMode:w}),s?h.cloneElement(h.Children.only(l),Oe(Oe({},k),{ref:N})):h.createElement(b,Oe({},k,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ix=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ix();return t&&e.setAttribute("nonce",t),e}function lx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=sx())&&(lx(t,r),cx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ux=function(){var e=dx();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Xs=function(){var e=ux(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},px={left:0,top:0,right:0,gap:0},Ro=function(e){return parseInt(e||"",10)||0},mx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ro(r),Ro(n),Ro(o)]},fx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return px;var t=mx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},hx=Xs(),Lt="data-scroll-locked",gx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
    294   .`.concat(Jg,` {
     213`,Er=16,Bu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:i,containerClassName:l})=>{let{toasts:c,handlers:d}=hu(r,s);return g.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Er,left:Er,right:Er,bottom:Er,pointerEvents:"none",...i},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),h=Fu(p,m);return g.createElement(Du,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?$u:"",style:h},u.type==="custom"?Cr(u.message,u):o?o(u):g.createElement(Mu,{toast:u,position:p}))}))},G=oe;const Ka={carousel:"carousel",grid:"grid"},Uu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,shape:"rectangle",size:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ka.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Hu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Ya=[{label:"Horizontal",value:"horizontal"}],Vu=[{label:"Vertical",value:"vertical"}],Wu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],qu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Xa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ja=y.createContext&&y.createContext(Xa),Gu=["attr","size","title"];function Ku(e,t){if(e==null)return{};var r=Yu(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tr.apply(this,arguments)}function Za(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Za(Object(r),!0).forEach(function(n){Xu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Za(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xu(e,t,r){return t=Ju(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ju(e){var t=Zu(e,"string");return typeof t=="symbol"?t:t+""}function Zu(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qa(e){return e&&e.map((t,r)=>y.createElement(t.tag,Ar({key:r},t.attr),Qa(t.child)))}function H(e){return t=>y.createElement(Qu,Tr({attr:Ar({},e.attr)},t),Qa(e.child))}function Qu(e){var t=r=>{var{attr:n,size:o,title:s}=e,i=Ku(e,Gu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:c,style:Ar(Ar({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&y.createElement("title",null,s),e.children)};return Ja!==void 0?y.createElement(Ja.Consumer,null,r=>t(r)):t(Xa)}function ep(e){return H({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function qt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function gt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Gt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function Kt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function tp(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function rp(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function tt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function np(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function es(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function op(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function Yt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function ts(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Hn(...e){return t=>{let r=!1;const n=e.map(o=>{const s=ts(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():ts(e[o],null)}}}}function Y(...e){return g.useCallback(Hn(...e),e)}function rt(e){const t=sp(e),r=g.forwardRef((n,o)=>{const{children:s,...i}=n,l=g.Children.toArray(s),c=l.find(lp);if(c){const d=c.props.children,u=l.map(p=>p===c?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var ap=rt("Slot");function sp(e){const t=g.forwardRef((r,n)=>{const{children:o,...s}=r;if(g.isValidElement(o)){const i=dp(o),l=cp(s,o.props);return o.type!==g.Fragment&&(l.ref=n?Hn(n,i):i),g.cloneElement(o,l)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ip=Symbol("radix.slottable");function lp(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ip}function cp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function dp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function rs(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=rs(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function up(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=rs(e))&&(n&&(n+=" "),n+=t);return n}function D(...e){return up(e)}const pp="ecr-button",mp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},fp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function re({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const s=n?ap:"button";return a.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:D(pp,mp[t],fp[r],e),...o})}function hp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:s,handleCreateGroup:i}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(re,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(re,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:l=>o(l.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(re,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(es,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(re,{disabled:s,onClick:i,className:"ecr-admin-reels-header__create",children:[s?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Group"]}):null]})]})}function gp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function xp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function nt(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function bp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function vp({isFullScreen:e}){return a.jsx("div",{className:D("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const ns=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,s)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:D("ecr-player__progress-fill",s===r?.index?"ecr-player__progress-fill--active":s<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},s))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:D("ecr-player__nav",e),...r,children:t});function Vn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Wn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Gn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const _p="Left",yp="Right",jp="Up",Sp="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Kn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},os="mousemove",as="mouseup",Cp="touchend",kp="touchmove",Np="touchstart";function Ep(e,t,r,n){return e>t?r>0?yp:_p:n>0?Sp:jp}function ss(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Tp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,h)=>{h.trackMouse&&!p&&(document.addEventListener(os,n),document.addEventListener(as,i));const{clientX:b,clientY:f}=p?u.touches[0]:u,x=ss([b,f],h.rotationAngle);return h.onTouchStartOrOnMouseDown&&h.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Kn),{initial:x.slice(),xy:x,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const h="touches"in u;if(h&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=h?u.touches[0]:u,[x,_]=ss([b,f],m.rotationAngle),v=x-p.xy[0],w=_-p.xy[1],j=Math.abs(v),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[v/(N||1),w/(N||1)],T=Ep(j,C,v,w),O=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||bt.delta;if(j<O&&C<O&&!p.swiping)return p;const L={absX:j,absY:C,deltaX:v,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};L.first&&m.onSwipeStart&&m.onSwipeStart(L),m.onSwiping&&m.onSwiping(L);let A=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(A=!0),A&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:L,swiping:!0})})},o=u=>{e((p,m)=>{let h;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){h=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(h);const b=m[`onSwiped${h.dir}`];b&&b(h)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Kn),{eventData:h})})},s=()=>{document.removeEventListener(os,n),document.removeEventListener(as,i)},i=u=>{s(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const h=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Np,r,h],[kp,n,Object.assign(Object.assign({},h),p.preventScrollOnSwipe?{passive:!1}:{})],[Cp,o,h]];b.forEach(([f,x,_])=>u.addEventListener(f,x,_)),m=()=>b.forEach(([f,x])=>u.removeEventListener(f,x))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const h={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),h.cleanUpTouch=void 0),m.trackTouch&&u&&(h.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),h)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Ap(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Pp(e){const{trackMouse:t}=e,r=g.useRef(Object.assign({},Kn)),n=g.useRef(Object.assign({},bt)),o=g.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let s;for(s in bt)n.current[s]===void 0&&(n.current[s]=bt[s]);const[i,l]=g.useMemo(()=>Tp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Ap(r.current,n.current,o.current,l),i}const Op=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:s,handleNextFile:i,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>s(o),onEnded:i,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,h=p.videoHeight;d(h>m),l(p.duration)}})})},is=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:s,setIsPaused:i,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=x=>{const _=p.current[x];_&&(s?_.play():_.pause(),i(v=>!v))},h=x=>{const _=p.current[x];_&&(_.muted=!d,u(v=>!v))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Pp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((x,_)=>a.jsx("div",{className:"ecr-player__slide",children:x?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Op,{videoRefs:p,file:x,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:s},x.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[s?a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(_)}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(_)})]})]})},_))})},Rp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,s]=y.useState(!1),[i,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(h=>({index:h.index-1,story_uuid:m[h.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(h=>({index:h.index+1,story_uuid:m[h.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(xt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ns,{playingStory:e,duration:i,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(is,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:s,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Ip(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function zp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Mp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ls(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Dp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Fp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function $p(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Bp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}function cs(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Hp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function Vp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function Wp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}const qp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Gp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(i=>({...i,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),s=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:s}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:qp(r?.[e.id]??e.view_count)}),a.jsx(rp,{size:14})]})]})},Yn=y.memo(Gp);function Kp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:i}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:D("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Yn,{story:e,styles:t}),a.jsxs("div",{className:D("ecr-admin-reel-card__actions",i?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(re,{onClick:()=>s(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(re,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(re,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(cs,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:D("ecr-admin-reel-card__corner",i?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(re,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Dp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Fp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel-card__title",children:e.title})]})}function Yp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:s,lastStoryElementRef:i}){return a.jsx("div",{style:{"--thumbnail-size":`${t?.size}px`},className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?i:null,children:a.jsx(Kp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:r.length>0})},l.id))})}const Xt=({cb:e})=>{const t=Se(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(gp,{size:24})})};function Xp(e){return H({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const Jt=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:s=>{if(!t)return;const i=r.href;i&&(s.preventDefault(),t(i))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Xp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Or=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(op,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:s})=>a.jsxs(ht,{style:{color:r},to:e,className:D("ecr-admin-link-button",o),onClick:i=>{s&&(i.preventDefault(),s(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:D("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),vt=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),_t=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Jp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const Ir=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Jp,{}),"ReelsWP"]});function ds(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zp}=Object.prototype,{getPrototypeOf:Xn}=Object,{iterator:zr,toStringTag:us}=Symbol,Mr=(e=>t=>{const r=Zp.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ve=e=>(e=e.toLowerCase(),t=>Mr(t)===e),Dr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Dr("undefined");function Zt(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&ce(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ps=ve("ArrayBuffer");function Qp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ps(e.buffer),t}const em=Dr("string"),ce=Dr("function"),ms=Dr("number"),Qt=e=>e!==null&&typeof e=="object",tm=e=>e===!0||e===!1,Fr=e=>{if(Mr(e)!=="object")return!1;const t=Xn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(us in e)&&!(zr in e)},rm=e=>{if(!Qt(e)||Zt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},nm=ve("Date"),om=ve("File"),am=ve("Blob"),sm=ve("FileList"),im=e=>Qt(e)&&ce(e.pipe),lm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ce(e.append)&&((t=Mr(e))==="formdata"||t==="object"&&ce(e.toString)&&e.toString()==="[object FormData]"))},cm=ve("URLSearchParams"),[dm,um,pm,mm]=["ReadableStream","Request","Response","Headers"].map(ve),fm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function er(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Zt(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let l;for(n=0;n<i;n++)l=s[n],t.call(null,e[l],l,e)}}function fs(e,t){if(Zt(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hs=e=>!wt(e)&&e!==ot;function Jn(){const{caseless:e,skipUndefined:t}=hs(this)&&this||{},r={},n=(o,s)=>{const i=e&&fs(r,s)||s;Fr(r[i])&&Fr(o)?r[i]=Jn(r[i],o):Fr(o)?r[i]=Jn({},o):yt(o)?r[i]=o.slice():(!t||!wt(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&er(arguments[o],n);return r}const hm=(e,t,r,{allOwnKeys:n}={})=>(er(t,(o,s)=>{r&&ce(o)?e[s]=ds(o,r):e[s]=o},{allOwnKeys:n}),e),gm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},bm=(e,t,r,n)=>{let o,s,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=r!==!1&&Xn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},vm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},_m=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!ms(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ym=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xn(Uint8Array)),wm=(e,t)=>{const n=(e&&e[zr]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},jm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Sm=ve("HTMLFormElement"),Cm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),gs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),km=ve("RegExp"),xs=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};er(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},Nm=e=>{xs(e,(t,r)=>{if(ce(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ce(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Em=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Tm=()=>{},Am=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Pm(e){return!!(e&&ce(e.append)&&e[us]==="FormData"&&e[zr])}const Om=e=>{const t=new Array(10),r=(n,o)=>{if(Qt(n)){if(t.indexOf(n)>=0)return;if(Zt(n))return n;if(!("toJSON"in n)){t[o]=n;const s=yt(n)?[]:{};return er(n,(i,l)=>{const c=r(i,o+1);!wt(c)&&(s[l]=c)}),t[o]=void 0,s}}return n};return r(e,0)},Rm=ve("AsyncFunction"),Lm=e=>e&&(Qt(e)||ce(e))&&ce(e.then)&&ce(e.catch),bs=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:s})=>{o===ot&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ce(ot.postMessage)),Im=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||bs,S={isArray:yt,isArrayBuffer:ps,isBuffer:Zt,isFormData:lm,isArrayBufferView:Qp,isString:em,isNumber:ms,isBoolean:tm,isObject:Qt,isPlainObject:Fr,isEmptyObject:rm,isReadableStream:dm,isRequest:um,isResponse:pm,isHeaders:mm,isUndefined:wt,isDate:nm,isFile:om,isBlob:am,isRegExp:km,isFunction:ce,isStream:im,isURLSearchParams:cm,isTypedArray:ym,isFileList:sm,forEach:er,merge:Jn,extend:hm,trim:fm,stripBOM:gm,inherits:xm,toFlatObject:bm,kindOf:Mr,kindOfTest:ve,endsWith:vm,toArray:_m,forEachEntry:wm,matchAll:jm,isHTMLForm:Sm,hasOwnProperty:gs,hasOwnProp:gs,reduceDescriptors:xs,freezeMethods:Nm,toObjectSet:Em,toCamelCase:Cm,noop:Tm,toFiniteNumber:Am,findKey:fs,global:ot,isContextDefined:hs,isSpecCompliantForm:Pm,toJSONObject:Om,isAsyncFn:Rm,isThenable:Lm,setImmediate:bs,asap:Im,isIterable:e=>e!=null&&ce(e[zr])};function B(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const vs=B.prototype,_s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{_s[e]={value:e}}),Object.defineProperties(B,_s),Object.defineProperty(vs,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,s)=>{const i=Object.create(vs);S.toFlatObject(e,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return B.call(i,l,c,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const zm=null;function Zn(e){return S.isPlainObject(e)||S.isArray(e)}function ys(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function ws(e,t,r){return e?e.concat(t).map(function(o,s){return o=ys(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Mm(e){return S.isArray(e)&&!e.some(Zn)}const Dm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,x){return!S.isUndefined(x[f])});const n=r.metaTokens,o=r.visitor||u,s=r.dots,i=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new B("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,x){let _=b;if(b&&!x&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Mm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(_=S.toArray(b)))return f=ys(f),_.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(i===!0?ws([f],j,s):i===null?f:f+"[]",d(w))}),!1}return Zn(b)?!0:(t.append(ws(x,f,s),d(b)),!1)}const p=[],m=Object.assign(Dm,{defaultVisitor:u,convertValue:d,isVisitable:Zn});function h(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(_,v){(!(S.isUndefined(_)||_===null)&&o.call(t,_,S.isString(v)?v.trim():v,f,m))===!0&&h(_,f?f.concat(v):[v])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return h(e),t}function js(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Qn(e,t){this._pairs=[],e&&$r(e,this,t)}const Ss=Qn.prototype;Ss.append=function(t,r){this._pairs.push([t,r])},Ss.toString=function(t){const r=t?function(n){return t.call(this,n,js)}:js;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Fm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Cs(e,t,r){if(!t)return e;const n=r&&r.encode||Fm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(o?s=o(t,r):s=S.isURLSearchParams(t)?t.toString():new Qn(t,r).toString(n),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ks{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ns={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$m={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Qn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},eo=typeof window<"u"&&typeof document<"u",to=typeof navigator=="object"&&navigator||void 0,Bm=eo&&(!to||["ReactNative","NativeScript","NS"].indexOf(to.product)<0),Um=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hm=eo&&window.location.href||"http://localhost",ie={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:eo,hasStandardBrowserEnv:Bm,hasStandardBrowserWebWorkerEnv:Um,navigator:to,origin:Hm},Symbol.toStringTag,{value:"Module"})),...$m};function Vm(e,t){return $r(e,new ie.classes.URLSearchParams,{visitor:function(r,n,o,s){return ie.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Wm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qm(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Es(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),c=s>=r.length;return i=!i&&S.isArray(o)?o.length:i,c?(S.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!l):((!o[i]||!S.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&S.isArray(o[i])&&(o[i]=qm(o[i])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Wm(n),o,r,0)}),r}return null}function Gm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const tr={transitional:Ns,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=S.isObject(t);if(s&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Es(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Vm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $r(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Gm(t)):t}],transformResponse:[function(t){const r=this.transitional||tr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?B.from(l,B.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{tr.headers[e]={}});const Km=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ym=e=>{const t={};let r,n,o;return e&&e.split(`
     214`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Km[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Ts=Symbol("internals");function rr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:S.isArray(e)?e.map(Br):String(e)}function Xm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Jm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ro(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function Zm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Qm(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}let de=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(l,c,d){const u=rr(c);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const i=(l,c)=>S.forEach(l,(d,u)=>s(d,u,c));if(S.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(S.isString(t)&&(t=t.trim())&&!Jm(t))i(Ym(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},c,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?S.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(l,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=rr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Xm(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=rr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ro(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(i){if(i=rr(i),i){const l=S.findKey(n,i);l&&(!r||ro(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||ro(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,s)=>{const i=S.findKey(n,s);if(i){r[i]=Br(o),delete r[s];return}const l=t?Zm(s):String(s).trim();l!==s&&delete r[s],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
     215`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Ts]=this[Ts]={accessors:{}}).accessors,o=this.prototype;function s(i){const l=rr(i);n[l]||(Qm(o,i),n[l]=!0)}return S.isArray(t)?t.forEach(s):s(t),this}};de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(de.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(de);function no(e,t){const r=this||tr,n=t||r,o=de.from(n.headers);let s=n.data;return S.forEach(e,function(l){s=l.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function As(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,B,{__CANCEL__:!0});function Ps(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ef(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[s];i||(i=d),r[o]=c,n[o]=d;let p=s,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-i<t)return;const h=u&&d-u;return h?Math.round(m*1e3/h):void 0}}function rf(e,t){let r=0,n=1e3/t,o,s;const i=(d,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?i(d,u):(o=d,s||(s=setTimeout(()=>{s=null,i(o)},n-p)))},()=>o&&i(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=tf(50,250);return rf(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,c=i-n,d=o(c),u=i<=l;n=i;const p={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-i)/d:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Os=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Rs=e=>(...t)=>S.asap(()=>e(...t)),nf=ie.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ie.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ie.origin),ie.navigator&&/(msie|trident)/i.test(ie.navigator.userAgent)):()=>!0,of=ie.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),s===!0&&l.push("secure"),S.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function af(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ls(e,t,r){let n=!af(t);return e&&(n||r==!1)?sf(e,t):t}const Is=e=>e instanceof de?{...e}:e;function at(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function s(d,u){if(!S.isUndefined(u))return n(void 0,u)}function i(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(d,u,p)=>o(Is(d),Is(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const zs=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:l}=t;if(t.headers=i=de.from(i),t.url=Cs(Ls(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&i.set(u,p)})}}if(ie.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&nf(t.url))){const c=o&&s&&of.read(s);c&&i.set(o,c)}return t},lf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=zs(e);let s=o.data;const i=de.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,h,b;function f(){h&&h(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function _(){if(!x)return;const w=de.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};Ps(function(k){r(k),f()},function(k){n(k),f()},C),x=null}"onloadend"in x?x.onloadend=_:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(_)},x.onabort=function(){x&&(n(new B("Request aborted",B.ECONNABORTED,e,x)),x=null)},x.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new B(C,B.ERR_NETWORK,e,x);N.event=j||null,n(N),x=null},x.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ns;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new B(j,C.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,x)),x=null},s===void 0&&i.setContentType(null),"setRequestHeader"in x&&S.forEach(i.toJSON(),function(j,C){x.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),l&&l!=="json"&&(x.responseType=o.responseType),d&&([m,b]=Ur(d,!0),x.addEventListener("progress",m)),c&&x.upload&&([p,h]=Ur(c),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(u=w=>{x&&(n(!w||w.type?new jt(null,e,x):w),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=ef(o.url);if(v&&ie.protocols.indexOf(v)===-1){n(new B("Unsupported protocol "+v+":",B.ERR_BAD_REQUEST,e));return}x.send(s||null)})},cf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const s=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof B?u:new jt(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new B(`timeout ${t} of ms exceeded`,B.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},df=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},uf=async function*(e,t){for await(const r of pf(e))yield*df(r,t)},pf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Ms=(e,t,r,n)=>{const o=uf(e,t);let s=0,i,l=c=>{i||(i=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=s+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Ds=64*1024,{isFunction:Hr}=S,mf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Fs,TextEncoder:$s}=S.global,Bs=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ff=e=>{e=S.merge.call({skipUndefined:!0},mf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",s=Hr(r),i=Hr(n);if(!o)return!1;const l=o&&Hr(Fs),c=o&&(typeof $s=="function"?(b=>f=>b.encode(f))(new $s):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=s&&l&&Bs(()=>{let b=!1;const f=new r(ie.origin,{body:new Fs,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=i&&l&&Bs(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,x)=>{let _=f&&f[b];if(_)return _.call(f);throw new B(`Response type '${b}' is not supported`,B.ERR_NOT_SUPPORT,x)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ie.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},h=async(b,f)=>{const x=S.toFiniteNumber(b.getContentLength());return x??m(f)};return async b=>{let{url:f,method:x,data:_,signal:v,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:O}=zs(b),L=t||fetch;k=k?(k+"").toLowerCase():"text";let A=cf([v,w&&w.toAbortSignal()],j),I=null;const z=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let $;try{if(N&&d&&x!=="get"&&x!=="head"&&($=await h(E,_))!==0){let Z=new r(f,{method:"POST",body:_,duplex:"half"}),pe;if(S.isFormData(_)&&(pe=Z.headers.get("content-type"))&&E.setContentType(pe),Z.body){const[Fe,ge]=Os($,Ur(Rs(N)));_=Ms(Z.body,Ds,Fe,ge)}}S.isString(T)||(T=T?"include":"omit");const R=s&&"credentials"in r.prototype,U={...O,signal:A,method:x.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:R?T:void 0};I=s&&new r(f,U);let P=await(s?L(I,O):L(f,U));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&z)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=P[$e]});const pe=S.toFiniteNumber(P.headers.get("content-length")),[Fe,ge]=C&&Os(pe,Ur(Rs(C),!0))||[];P=new n(Ms(P.body,Ds,Fe,()=>{ge&&ge(),z&&z()}),Z)}k=k||"text";let X=await p[S.findKey(p,k)||"text"](P,b);return!q&&z&&z(),await new Promise((Z,pe)=>{Ps(Z,pe,{data:X,headers:de.from(P.headers),status:P.status,statusText:P.statusText,config:b,request:I})})}catch(R){throw z&&z(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,b,I),{cause:R.cause||R}):B.from(R,R&&R.code,b,I)}}},hf=new Map,Us=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i=s.length,l=i,c,d,u=hf;for(;l--;)c=s[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:ff(t)),u=d;return d};Us();const oo={http:zm,xhr:lf,fetch:{get:Us}};S.forEach(oo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Hs=e=>`- ${e}`,gf=e=>S.isFunction(e)||e===null||e===!1;function xf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i<r;i++){n=e[i];let l;if(o=n,!gf(n)&&(o=oo[(l=String(n)).toLowerCase()],o===void 0))throw new B(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;s[l||"#"+i]=o}if(!o){const i=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?i.length>1?`since :
     216`+i.map(Hs).join(`
     217`):" "+Hs(i[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Vs={getAdapter:xf,adapters:oo};function ao(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function Ws(e){return ao(e),e.headers=de.from(e.headers),e.data=no.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Vs.getAdapter(e.adapter||tr.adapter,e)(e).then(function(n){return ao(e),n.data=no.call(e,e.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return As(n)||(ao(e),n&&n.response&&(n.response.data=no.call(e,e.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}const qs="1.13.1",Vr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Gs={};Vr.transitional=function(t,r,n){function o(s,i){return"[Axios v"+qs+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,l)=>{if(t===!1)throw new B(o(i," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Gs[i]&&(Gs[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function bf(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const l=e[s],c=l===void 0||i(l,s,e);if(c!==!0)throw new B("option "+s+" must be "+c,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+s,B.ERR_BAD_OPTION)}}const Wr={assertOptions:bf,validators:Vr},ke=Wr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ks,response:new ks}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
     218`+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&S.merge(s.common,s[r.method]);s&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),r.headers=de.concat(i,s);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Ws.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let h=r;for(;p<m;){const b=l[p++],f=l[p++];try{h=b(h)}catch(x){f.call(this,x);break}}try{u=Ws.call(this,h)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=at(this.defaults,t);const r=Ls(t.baseURL,t.url,t.allowAbsoluteUrls);return Cs(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,l){return this.request(at(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let vf=class wd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{n.subscribe(l),s=l}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,l){n.reason||(n.reason=new jt(s,i,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new wd(function(o){t=o}),cancel:t}}};function _f(e){return function(r){return e.apply(null,r)}}function yf(e){return S.isObject(e)&&e.isAxiosError===!0}const so={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(so).forEach(([e,t])=>{so[t]=e});function Ks(e){const t=new st(e),r=ds(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ks(at(e,o))},r}const ee=Ks(tr);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=vf,ee.isCancel=As,ee.VERSION=qs,ee.toFormData=$r,ee.AxiosError=B,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=_f,ee.isAxiosError=yf,ee.mergeConfig=at,ee.AxiosHeaders=de,ee.formToJSON=e=>Es(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Vs.getAdapter,ee.HttpStatusCode=so,ee.default=ee;const{Axios:x_,AxiosError:b_,CanceledError:v_,isCancel:__,CancelToken:y_,VERSION:w_,all:j_,Cancel:S_,isAxiosError:C_,spread:k_,toFormData:N_,AxiosHeaders:E_,HttpStatusCode:T_,formToJSON:A_,getAdapter:P_,mergeConfig:O_}=ee,Ys=ecommreelsInfo,ue=ee.create({baseURL:`${Ys.apiBase}`,headers:{"X-WP-Nonce":Ys.nonce,"Content-Type":"application/json"}}),wf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async i=>{try{t(!0);const l={styles:et,story_ids:i},c=await ue.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),s=y.useCallback(async(i,l)=>{try{n(!0),await ue.delete(`story/${i}`),l(c=>c.filter(d=>d.id!==i)),G.success("Reel deleted successfully!")}catch(c){c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!")}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:s}};function io(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Xs=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[s,i]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),h=io(p,500),b=y.useRef(!0),f=y.useCallback(async v=>{v===1&&b.current?u(!0):c(!0);try{const w={page:v,per_page:20};e&&(w.group_id=e),h&&(w.search=h);const j=await ue.get("stories",{params:w}),C=j.data,N=parseInt(j.headers["x-wp-totalpages"]);r(k=>v===1?C:[...k,...C]),o(v+1),i(v<N)}catch(w){w instanceof Error?G.error(w.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,h]);y.useEffect(()=>{o(1),r([]),f(1)},[h,f]);const x=y.useRef(null),_=y.useCallback(v=>{l||(x.current&&x.current.disconnect(),x.current=new IntersectionObserver(w=>{w[0].isIntersecting&&s&&f(n)}),v&&x.current.observe(v))},[l,s,n,f]);return y.useEffect(()=>()=>{x.current&&x.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:_}};function jf(){const e=Se(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:s,setSearchTerm:i,isLoading:l}=Xs(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=wf(),[h,b]=y.useState(null),[f,x]=y.useState(null),[_,v]=y.useState([]),w=async()=>{const k=await p(_);k&&e(`?view=${K.mg}&gid=${k}`)},j=()=>{v(t.map(k=>k.id))},C=k=>{v(E=>E.includes(k)?E.filter(T=>T!==k):[...E,k])},N=y.useCallback(async()=>{h&&(await m(h,r),b(null))},[m,h,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[h&&a.jsx(Or,{onReject:()=>b(null),onAccept:N,isLoading:u,message:"Are you sure, You want to remove this reel?"}),a.jsx(vt,{left:[a.jsx(_t,{name:"All Reels",Icon:ep},"page"),a.jsx(Xt,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(hp,{selectedReelIds:_,handleSelectAll:j,clearSelection:()=>v([]),searchTerm:s,setSearchTerm:i,isCreating:d,handleCreateGroup:w}),t.length?a.jsx(Yp,{reels:t,styles:c,selectedReelIds:_,onSelectReel:C,onDeleteReel:b,onPreviewReel:x,lastStoryElementRef:o}):!n&&!l?a.jsx(bp,{}):null,n&&a.jsx(vp,{isFullScreen:!t.length})]}),!!f&&a.jsx(Rp,{previewReel:f,setPreviewReel:x})]})}const Sf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:s,links:i,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:s,links:i};typeof l=="string"&&l.trim().length>0&&(c.thumbnail=l),n&&(c.story_id=n);const d=await ue.post("files",c);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},lo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(re,{onClick:t,className:D("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(np,{className:"ecr-admin-save-button__icon"})," ",r]}),Js=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:s=>{e&&e(!0),r(s.target.value)}})}),Cf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const s=Se(),[i]=Vt(),l=i.get("sid"),c=i.get("from")||K.ag,d=i.get("gid"),{isSaving:u,saveStory:p}=Sf(),m=async()=>{if(u)return;const h=await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});h&&s(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0,...l?{}:{state:{storyId:h}}})};return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:l?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(Xt,{},"back")],center:[a.jsx(Js,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(lo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function kf(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let co;const Nf=new Uint8Array(16);function Ef(){if(!co){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");co=crypto.getRandomValues.bind(crypto)}return co(Nf)}const Zs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Tf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Ef();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,kf(n)}function uo(e,t,r){return Zs.randomUUID&&!e?Zs.randomUUID():Tf(e)}const Qs="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ei=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:s})=>{const[i,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:uo()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:D("ecr-admin-upload",i?"ecr-admin-upload--active":"ecr-admin-upload--idle",s),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Qs,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:i?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/**
     219 * @license lucide-react v0.552.0 - ISC
     220 *
     221 * This source code is licensed under the ISC license.
     222 * See the LICENSE file in the root directory of this source tree.
     223 */const Af=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ti=e=>{const t=Pf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ri=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Of=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
     224 * @license lucide-react v0.552.0 - ISC
     225 *
     226 * This source code is licensed under the ISC license.
     227 * See the LICENSE file in the root directory of this source tree.
     228 */var Rf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
     229 * @license lucide-react v0.552.0 - ISC
     230 *
     231 * This source code is licensed under the ISC license.
     232 * See the LICENSE file in the root directory of this source tree.
     233 */const Lf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...l},c)=>y.createElement("svg",{ref:c,...Rf,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ri("lucide",o),...!s&&!Of(l)&&{"aria-hidden":"true"},...l},[...i.map(([d,u])=>y.createElement(d,u)),...Array.isArray(s)?s:[s]]));/**
     234 * @license lucide-react v0.552.0 - ISC
     235 *
     236 * This source code is licensed under the ISC license.
     237 * See the LICENSE file in the root directory of this source tree.
     238 */const me=(e,t)=>{const r=y.forwardRef(({className:n,...o},s)=>y.createElement(Lf,{ref:s,iconNode:t,className:ri(`lucide-${Af(ti(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ti(e),r};/**
     239 * @license lucide-react v0.552.0 - ISC
     240 *
     241 * This source code is licensed under the ISC license.
     242 * See the LICENSE file in the root directory of this source tree.
     243 */const If=me("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
     244 * @license lucide-react v0.552.0 - ISC
     245 *
     246 * This source code is licensed under the ISC license.
     247 * See the LICENSE file in the root directory of this source tree.
     248 */const po=me("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
     249 * @license lucide-react v0.552.0 - ISC
     250 *
     251 * This source code is licensed under the ISC license.
     252 * See the LICENSE file in the root directory of this source tree.
     253 */const zf=me("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
     254 * @license lucide-react v0.552.0 - ISC
     255 *
     256 * This source code is licensed under the ISC license.
     257 * See the LICENSE file in the root directory of this source tree.
     258 */const Mf=me("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
     259 * @license lucide-react v0.552.0 - ISC
     260 *
     261 * This source code is licensed under the ISC license.
     262 * See the LICENSE file in the root directory of this source tree.
     263 */const Df=me("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
     264 * @license lucide-react v0.552.0 - ISC
     265 *
     266 * This source code is licensed under the ISC license.
     267 * See the LICENSE file in the root directory of this source tree.
     268 */const Ff=me("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
     269 * @license lucide-react v0.552.0 - ISC
     270 *
     271 * This source code is licensed under the ISC license.
     272 * See the LICENSE file in the root directory of this source tree.
     273 */const $f=me("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
     274 * @license lucide-react v0.552.0 - ISC
     275 *
     276 * This source code is licensed under the ISC license.
     277 * See the LICENSE file in the root directory of this source tree.
     278 */const Bf=me("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
     279 * @license lucide-react v0.552.0 - ISC
     280 *
     281 * This source code is licensed under the ISC license.
     282 * See the LICENSE file in the root directory of this source tree.
     283 */const Uf=me("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
     284 * @license lucide-react v0.552.0 - ISC
     285 *
     286 * This source code is licensed under the ISC license.
     287 * See the LICENSE file in the root directory of this source tree.
     288 */const Hf=me("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
     289 * @license lucide-react v0.552.0 - ISC
     290 *
     291 * This source code is licensed under the ISC license.
     292 * See the LICENSE file in the root directory of this source tree.
     293 */const Vf=me("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
     294 * @license lucide-react v0.552.0 - ISC
     295 *
     296 * This source code is licensed under the ISC license.
     297 * See the LICENSE file in the root directory of this source tree.
     298 */const Wf=me("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
     299 * @license lucide-react v0.552.0 - ISC
     300 *
     301 * This source code is licensed under the ISC license.
     302 * See the LICENSE file in the root directory of this source tree.
     303 */const qf=me("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Gf(e,t){const r=g.createContext(t),n=s=>{const{children:i,...l}=s,c=g.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:i})};n.displayName=e+"Provider";function o(s){const i=g.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(s,i){const l=g.createContext(i),c=r.length;r=[...r,i];const d=p=>{const{scope:m,children:h,...b}=p,f=m?.[e]?.[c]||l,x=g.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:x,children:h})};d.displayName=s+"Provider";function u(p,m){const h=m?.[e]?.[c]||l,b=g.useContext(h);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,u]}const o=()=>{const s=r.map(i=>g.createContext(i));return function(l){const c=l?.[e]||s;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,Kf(o,...t)]}function Kf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(s)[`__scope${d}`];return{...l,...p}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Yf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=Yf.reduce((e,t)=>{const r=rt(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...l}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Xf(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>t.current?.(...r),[])}function Jf(e,t=globalThis?.document){const r=Ve(e);g.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Zf="DismissableLayer",mo="dismissableLayer.update",Qf="dismissableLayer.pointerDownOutside",eh="dismissableLayer.focusOutside",ni,oi=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,d=g.useContext(oi),[u,p]=g.useState(null),m=u?.ownerDocument??globalThis?.document,[,h]=g.useState({}),b=Y(t,k=>p(k)),f=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(x),v=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=v>=_,C=nh(k=>{const E=k.target,T=[...d.branches].some(O=>O.contains(E));!j||T||(o?.(k),i?.(k),k.defaultPrevented||l?.())},m),N=oh(k=>{const E=k.target;[...d.branches].some(O=>O.contains(E))||(s?.(k),i?.(k),k.defaultPrevented||l?.())},m);return Jf(k=>{v===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ni=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ai(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ni)}},[u,m,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ai())},[u,d]),g.useEffect(()=>{const k=()=>h({});return document.addEventListener(mo,k),()=>document.removeEventListener(mo,k)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=Zf;var th="DismissableLayerBranch",rh=g.forwardRef((e,t)=>{const r=g.useContext(oi),n=g.useRef(null),o=Y(t,n);return g.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});rh.displayName=th;function nh(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let c=function(){si(Qf,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function oh(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1);return g.useEffect(()=>{const o=s=>{s.target&&!n.current&&si(eh,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ai(){const e=new CustomEvent(mo);document.dispatchEvent(e)}function si(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Xf(o,s):o.dispatchEvent(s)}var fo=0;function ho(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ii()),document.body.insertAdjacentElement("beforeend",e[1]??ii()),fo++,()=>{fo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fo--}},[])}function ii(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var go="focusScope.autoFocusOnMount",xo="focusScope.autoFocusOnUnmount",li={bubbles:!1,cancelable:!0},ah="FocusScope",Gr=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,c]=g.useState(null),d=Ve(o),u=Ve(s),p=g.useRef(null),m=Y(t,f=>c(f)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let f=function(w){if(h.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:We(p.current,{select:!0})},x=function(w){if(h.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||We(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",x);const v=new MutationObserver(_);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",x),v.disconnect()}}},[n,l,h.paused]),g.useEffect(()=>{if(l){ui.add(h);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(go,li);l.addEventListener(go,d),l.dispatchEvent(_),_.defaultPrevented||(sh(uh(ci(l)),{select:!0}),document.activeElement===f&&We(l))}return()=>{l.removeEventListener(go,d),setTimeout(()=>{const _=new CustomEvent(xo,li);l.addEventListener(xo,u),l.dispatchEvent(_),_.defaultPrevented||We(f??document.body,{select:!0}),l.removeEventListener(xo,u),ui.remove(h)},0)}}},[l,d,u,h]);const b=g.useCallback(f=>{if(!r&&!n||h.paused)return;const x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(x&&_){const v=f.currentTarget,[w,j]=ih(v);w&&j?!f.shiftKey&&_===j?(f.preventDefault(),r&&We(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&We(j,{select:!0})):_===v&&f.preventDefault()}},[r,n,h.paused]);return a.jsx(W.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});Gr.displayName=ah;function sh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function ih(e){const t=ci(e),r=di(t,e),n=di(t.reverse(),e);return[r,n]}function ci(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function di(e,t){for(const r of e)if(!lh(r,{upTo:t}))return r}function lh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ch(e){return e instanceof HTMLInputElement&&"select"in e}function We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ch(e)&&t&&e.select()}}var ui=dh();function dh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=pi(e,t),e.unshift(t)},remove(t){e=pi(e,t),e[0]?.resume()}}}function pi(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function uh(e){return e.filter(t=>t.tagName!=="A")}var se=globalThis?.document?g.useLayoutEffect:()=>{},ph=g[" useId ".trim().toString()]||(()=>{}),mh=0;function Ne(e){const[t,r]=g.useState(ph());return se(()=>{r(n=>n??String(mh++))},[e]),e||(t?`radix-${t}`:"")}const fh=["top","right","bottom","left"],qe=Math.min,fe=Math.max,Kr=Math.round,Yr=Math.floor,Ee=e=>({x:e,y:e}),hh={left:"right",right:"left",bottom:"top",top:"bottom"},gh={start:"end",end:"start"};function bo(e,t,r){return fe(e,qe(t,r))}function ze(e,t){return typeof e=="function"?e(t):e}function Me(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function vo(e){return e==="x"?"y":"x"}function _o(e){return e==="y"?"height":"width"}const xh=new Set(["top","bottom"]);function Te(e){return xh.has(Me(e))?"y":"x"}function yo(e){return vo(Te(e))}function bh(e,t,r){r===void 0&&(r=!1);const n=St(e),o=yo(e),s=_o(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xr(i)),[i,Xr(i)]}function vh(e){const t=Xr(e);return[wo(e),t,wo(t)]}function wo(e){return e.replace(/start|end/g,t=>gh[t])}const mi=["left","right"],fi=["right","left"],_h=["top","bottom"],yh=["bottom","top"];function wh(e,t,r){switch(e){case"top":case"bottom":return r?t?fi:mi:t?mi:fi;case"left":case"right":return t?_h:yh;default:return[]}}function jh(e,t,r,n){const o=St(e);let s=wh(Me(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(wo)))),s}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>hh[t])}function Sh(e){return{top:0,right:0,bottom:0,left:0,...e}}function hi(e){return typeof e!="number"?Sh(e):{top:e,right:e,bottom:e,left:e}}function Jr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function gi(e,t,r){let{reference:n,floating:o}=e;const s=Te(t),i=yo(t),l=_o(i),c=Me(t),d=s==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let h;switch(c){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:p};break;case"left":h={x:n.x-o.width,y:p};break;default:h={x:n.x,y:n.y}}switch(St(t)){case"start":h[i]-=m*(r&&d?-1:1);break;case"end":h[i]+=m*(r&&d?-1:1);break}return h}const Ch=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=gi(d,n,c),m=n,h={},b=0;for(let f=0;f<l.length;f++){const{name:x,fn:_}=l[f],{x:v,y:w,data:j,reset:C}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:h,rects:d,platform:i,elements:{reference:e,floating:t}});u=v??u,p=w??p,h={...h,[x]:{...h[x],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=gi(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:h}};async function nr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:h=0}=ze(t,e),b=hi(h),x=l[m?p==="floating"?"reference":"floating":p],_=Jr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=p==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(_.top-C.top+b.top)/j.y,bottom:(C.bottom-_.bottom+b.bottom)/j.y,left:(_.left-C.left+b.left)/j.x,right:(C.right-_.right+b.right)/j.x}}const kh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=ze(e,t)||{};if(d==null)return{};const p=hi(u),m={x:r,y:n},h=yo(o),b=_o(h),f=await i.getDimensions(d),x=h==="y",_=x?"top":"left",v=x?"bottom":"right",w=x?"clientHeight":"clientWidth",j=s.reference[b]+s.reference[h]-m[h]-s.floating[b],C=m[h]-s.reference[h],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(N)))&&(k=l.floating[w]||s.floating[b]);const E=j/2-C/2,T=k/2-f[b]/2-1,O=qe(p[_],T),L=qe(p[v],T),A=O,I=k-f[b]-L,z=k/2-f[b]/2+E,$=bo(A,z,I),R=!c.arrow&&St(o)!=null&&z!==$&&s.reference[b]/2-(z<A?O:L)-f[b]/2<0,U=R?z<A?z-A:z-I:0;return{[h]:m[h]+U,data:{[h]:$,centerOffset:z-$-U,...R&&{alignmentOffset:U}},reset:R}}}),Nh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...x}=ze(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const _=Me(o),v=Te(l),w=Me(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Xr(l)]:vh(l)),N=b!=="none";!m&&N&&C.push(...jh(l,f,b,j));const k=[l,...C],E=await nr(t,x),T=[];let O=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const z=bh(o,i,j);T.push(E[z[0]],E[z[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(z=>z<=0)){var L,A;const z=(((L=s.flip)==null?void 0:L.index)||0)+1,$=k[z];if($&&(!(p==="alignment"?v!==Te($):!1)||O.every(P=>Te(P.placement)===v?P.overflows[0]>0:!0)))return{data:{index:z,overflows:O},reset:{placement:$}};let R=(A=O.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!R)switch(h){case"bestFit":{var I;const U=(I=O.filter(P=>{if(N){const q=Te(P.placement);return q===v||q==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((P,q)=>P[1]-q[1])[0])==null?void 0:I[0];U&&(R=U);break}case"initialPlacement":R=l;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function xi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bi(e){return fh.some(t=>e[t]>=0)}const Eh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=ze(e,t);switch(n){case"referenceHidden":{const s=await nr(t,{...o,elementContext:"reference"}),i=xi(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bi(i)}}}case"escaped":{const s=await nr(t,{...o,altBoundary:!0}),i=xi(s,r.floating);return{data:{escapedOffsets:i,escaped:bi(i)}}}default:return{}}}}},vi=new Set(["left","top"]);async function Th(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Me(r),l=St(r),c=Te(r)==="y",d=vi.has(i)?-1:1,u=s&&c?-1:1,p=ze(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(h=l==="end"?b*-1:b),c?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Ah=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:l}=t,c=await Th(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Ph=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:x=>{let{x:_,y:v}=x;return{x:_,y:v}}},...c}=ze(e,t),d={x:r,y:n},u=await nr(t,c),p=Te(Me(o)),m=vo(p);let h=d[m],b=d[p];if(s){const x=m==="y"?"top":"left",_=m==="y"?"bottom":"right",v=h+u[x],w=h-u[_];h=bo(v,h,w)}if(i){const x=p==="y"?"top":"left",_=p==="y"?"bottom":"right",v=b+u[x],w=b-u[_];b=bo(v,b,w)}const f=l.fn({...t,[m]:h,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:s,[p]:i}}}}}},Oh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=ze(e,t),u={x:r,y:n},p=Te(o),m=vo(p);let h=u[m],b=u[p];const f=ze(l,t),x=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=s.reference[m]-s.floating[w]+x.mainAxis,C=s.reference[m]+s.reference[w]-x.mainAxis;h<j?h=j:h>C&&(h=C)}if(d){var _,v;const w=m==="y"?"width":"height",j=vi.has(Me(o)),C=s.reference[p]-s.floating[w]+(j&&((_=i.offset)==null?void 0:_[p])||0)+(j?0:x.crossAxis),N=s.reference[p]+s.reference[w]+(j?0:((v=i.offset)==null?void 0:v[p])||0)-(j?x.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:h,[p]:b}}}},Rh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=ze(e,t),u=await nr(t,d),p=Me(o),m=St(o),h=Te(o)==="y",{width:b,height:f}=s.floating;let x,_;p==="top"||p==="bottom"?(x=p,_=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,x=m==="end"?"top":"bottom");const v=f-u.top-u.bottom,w=b-u.left-u.right,j=qe(f-u[x],v),C=qe(b-u[_],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=v),N&&!m){const O=fe(u.left,0),L=fe(u.right,0),A=fe(u.top,0),I=fe(u.bottom,0);h?E=b-2*(O!==0||L!==0?O+L:fe(u.left,u.right)):k=f-2*(A!==0||I!==0?A+I:fe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const T=await i.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Zr(){return typeof window<"u"}function Ct(e){return _i(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(_i(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _i(e){return Zr()?e instanceof Node||e instanceof he(e).Node:!1}function _e(e){return Zr()?e instanceof Element||e instanceof he(e).Element:!1}function Pe(e){return Zr()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function yi(e){return!Zr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}const Lh=new Set(["inline","contents"]);function or(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Lh.has(o)}const Ih=new Set(["table","td","th"]);function zh(e){return Ih.has(Ct(e))}const Mh=[":popover-open",":modal"];function Qr(e){return Mh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Dh=["transform","translate","scale","rotate","perspective"],Fh=["transform","translate","scale","rotate","perspective","filter"],$h=["paint","layout","strict","content"];function jo(e){const t=So(),r=_e(e)?ye(e):e;return Dh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Fh.some(n=>(r.willChange||"").includes(n))||$h.some(n=>(r.contain||"").includes(n))}function Bh(e){let t=Ge(e);for(;Pe(t)&&!kt(t);){if(jo(t))return t;if(Qr(t))return null;t=Ge(t)}return null}function So(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Uh=new Set(["html","body","#document"]);function kt(e){return Uh.has(Ct(e))}function ye(e){return he(e).getComputedStyle(e)}function en(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yi(e)&&e.host||Ae(e);return yi(t)?t.host:t}function wi(e){const t=Ge(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&or(t)?t:wi(t)}function ar(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=wi(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=he(o);if(s){const l=Co(i);return t.concat(i,i.visualViewport||[],or(o)?o:[],l&&r?ar(l):[])}return t.concat(o,ar(o,[],r))}function Co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ji(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Pe(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=Kr(r)!==s||Kr(n)!==i;return l&&(r=s,n=i),{width:r,height:n,$:l}}function ko(e){return _e(e)?e:e.contextElement}function Nt(e){const t=ko(e);if(!Pe(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=ji(t);let i=(s?Kr(r.width):r.width)/n,l=(s?Kr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Hh=Ee(0);function Si(e){const t=he(e);return!So()||!t.visualViewport?Hh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==he(e)?!1:t}function it(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=ko(e);let i=Ee(1);t&&(n?_e(n)&&(i=Nt(n)):i=Nt(e));const l=Vh(s,r,n)?Si(s):Ee(0);let c=(o.left+l.x)/i.x,d=(o.top+l.y)/i.y,u=o.width/i.x,p=o.height/i.y;if(s){const m=he(s),h=n&&_e(n)?he(n):n;let b=m,f=Co(b);for(;f&&n&&h!==b;){const x=Nt(f),_=f.getBoundingClientRect(),v=ye(f),w=_.left+(f.clientLeft+parseFloat(v.paddingLeft))*x.x,j=_.top+(f.clientTop+parseFloat(v.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,p*=x.y,c+=w,d+=j,b=he(f),f=Co(b)}}return Jr({width:u,height:p,x:c,y:d})}function tn(e,t){const r=en(e).scrollLeft;return t?t.left+r:it(Ae(e)).left+r}function Ci(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-tn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Wh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Ae(n),l=t?Qr(t.floating):!1;if(n===i||l&&s)return r;let c={scrollLeft:0,scrollTop:0},d=Ee(1);const u=Ee(0),p=Pe(n);if((p||!p&&!s)&&((Ct(n)!=="body"||or(i))&&(c=en(n)),Pe(n))){const h=it(n);d=Nt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const m=i&&!p&&!s?Ci(i,c):Ee(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function qh(e){return Array.from(e.getClientRects())}function Gh(e){const t=Ae(e),r=en(e),n=e.ownerDocument.body,o=fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+tn(e);const l=-r.scrollTop;return ye(n).direction==="rtl"&&(i+=fe(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:l}}const ki=25;function Kh(e,t){const r=he(e),n=Ae(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,l=0,c=0;if(o){s=o.width,i=o.height;const u=So();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=tn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-h);b<=ki&&(s-=b)}else d<=ki&&(s+=d);return{width:s,height:i,x:l,y:c}}const Yh=new Set(["absolute","fixed"]);function Xh(e,t){const r=it(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Pe(e)?Nt(e):Ee(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=o*s.x,d=n*s.y;return{width:i,height:l,x:c,y:d}}function Ni(e,t,r){let n;if(t==="viewport")n=Kh(e,r);else if(t==="document")n=Gh(Ae(e));else if(_e(t))n=Xh(t,r);else{const o=Si(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function Ei(e,t){const r=Ge(e);return r===t||!_e(r)||kt(r)?!1:ye(r).position==="fixed"||Ei(r,t)}function Jh(e,t){const r=t.get(e);if(r)return r;let n=ar(e,[],!1).filter(l=>_e(l)&&Ct(l)!=="body"),o=null;const s=ye(e).position==="fixed";let i=s?Ge(e):e;for(;_e(i)&&!kt(i);){const l=ye(i),c=jo(i);!c&&l.position==="fixed"&&(o=null),(s?!c&&!o:!c&&l.position==="static"&&!!o&&Yh.has(o.position)||or(i)&&!c&&Ei(e,i))?n=n.filter(u=>u!==i):o=l,i=Ge(i)}return t.set(e,n),n}function Zh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Qr(t)?[]:Jh(t,this._c):[].concat(r),n],l=i[0],c=i.reduce((d,u)=>{const p=Ni(t,u,o);return d.top=fe(p.top,d.top),d.right=qe(p.right,d.right),d.bottom=qe(p.bottom,d.bottom),d.left=fe(p.left,d.left),d},Ni(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Qh(e){const{width:t,height:r}=ji(e);return{width:t,height:r}}function eg(e,t,r){const n=Pe(t),o=Ae(t),s=r==="fixed",i=it(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=Ee(0);function d(){c.x=tn(o)}if(n||!n&&!s)if((Ct(t)!=="body"||or(o))&&(l=en(t)),n){const h=it(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&d();s&&!n&&o&&d();const u=o&&!n&&!s?Ci(o,l):Ee(0),p=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:i.width,height:i.height}}function No(e){return ye(e).position==="static"}function Ti(e,t){if(!Pe(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Ai(e,t){const r=he(e);if(Qr(e))return r;if(!Pe(e)){let o=Ge(e);for(;o&&!kt(o);){if(_e(o)&&!No(o))return o;o=Ge(o)}return r}let n=Ti(e,t);for(;n&&zh(n)&&No(n);)n=Ti(n,t);return n&&kt(n)&&No(n)&&!jo(n)?r:n||Bh(e)||r}const tg=async function(e){const t=this.getOffsetParent||Ai,r=this.getDimensions,n=await r(e.floating);return{reference:eg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rg(e){return ye(e).direction==="rtl"}const ng={convertOffsetParentRelativeRectToViewportRelativeRect:Wh,getDocumentElement:Ae,getClippingRect:Zh,getOffsetParent:Ai,getElementRects:tg,getClientRects:qh,getDimensions:Qh,getScale:Nt,isElement:_e,isRTL:rg};function Pi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function og(e,t){let r=null,n;const o=Ae(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:h}=d;if(l||t(),!m||!h)return;const b=Yr(p),f=Yr(o.clientWidth-(u+m)),x=Yr(o.clientHeight-(p+h)),_=Yr(u),w={rootMargin:-b+"px "+-f+"px "+-x+"px "+-_+"px",threshold:fe(0,qe(1,c))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==c){if(!j)return i();k?i(!1,k):n=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Pi(d,e.getBoundingClientRect())&&i(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return i(!0),s}function ag(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=ko(e),u=o||s?[...d?ar(d):[],...ar(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),s&&_.addEventListener("resize",r)});const p=d&&l?og(d,r):null;let m=-1,h=null;i&&(h=new ResizeObserver(_=>{let[v]=_;v&&v.target===d&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),r()}),d&&!c&&h.observe(d),h.observe(t));let b,f=c?it(e):null;c&&x();function x(){const _=it(e);f&&!Pi(f,_)&&r(),f=_,b=requestAnimationFrame(x)}return r(),()=>{var _;u.forEach(v=>{o&&v.removeEventListener("scroll",r),s&&v.removeEventListener("resize",r)}),p?.(),(_=h)==null||_.disconnect(),h=null,c&&cancelAnimationFrame(b)}}const sg=Ah,ig=Ph,lg=Nh,cg=Rh,dg=Eh,Oi=kh,ug=Oh,pg=(e,t,r)=>{const n=new Map,o={platform:ng,...r},s={...o.platform,_c:n};return Ch(e,t,{...o,platform:s})};var mg=typeof document<"u",fg=function(){},rn=mg?y.useLayoutEffect:fg;function nn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!nn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!nn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ri(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Li(e,t){const r=Ri(e);return Math.round(t*r)/r}function Eo(e){const t=g.useRef(e);return rn(()=>{t.current=e}),t}function hg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=g.useState(n);nn(m,n)||h(n);const[b,f]=g.useState(null),[x,_]=g.useState(null),v=g.useCallback(P=>{P!==N.current&&(N.current=P,f(P))},[]),w=g.useCallback(P=>{P!==k.current&&(k.current=P,_(P))},[]),j=s||b,C=i||x,N=g.useRef(null),k=g.useRef(null),E=g.useRef(u),T=c!=null,O=Eo(c),L=Eo(o),A=Eo(d),I=g.useCallback(()=>{if(!N.current||!k.current)return;const P={placement:t,strategy:r,middleware:m};L.current&&(P.platform=L.current),pg(N.current,k.current,P).then(q=>{const X={...q,isPositioned:A.current!==!1};z.current&&!nn(E.current,X)&&(E.current=X,vr.flushSync(()=>{p(X)}))})},[m,t,r,L,A]);rn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[d]);const z=g.useRef(!1);rn(()=>(z.current=!0,()=>{z.current=!1}),[]),rn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(O.current)return O.current(j,C,I);I()}},[j,C,I,O,T]);const $=g.useMemo(()=>({reference:N,floating:k,setReference:v,setFloating:w}),[v,w]),R=g.useMemo(()=>({reference:j,floating:C}),[j,C]),U=g.useMemo(()=>{const P={position:r,left:0,top:0};if(!R.floating)return P;const q=Li(R.floating,u.x),X=Li(R.floating,u.y);return l?{...P,transform:"translate("+q+"px, "+X+"px)",...Ri(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:X}},[r,l,R.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:I,refs:$,elements:R,floatingStyles:U}),[u,I,$,R,U])}const gg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Oi({element:n.current,padding:o}).fn(r):{}:n?Oi({element:n,padding:o}).fn(r):{}}}},xg=(e,t)=>({...sg(e),options:[e,t]}),bg=(e,t)=>({...ig(e),options:[e,t]}),vg=(e,t)=>({...ug(e),options:[e,t]}),_g=(e,t)=>({...lg(e),options:[e,t]}),yg=(e,t)=>({...cg(e),options:[e,t]}),wg=(e,t)=>({...dg(e),options:[e,t]}),jg=(e,t)=>({...gg(e),options:[e,t]});var Sg="Arrow",Ii=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return a.jsx(W.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ii.displayName=Sg;var Cg=Ii;function kg(e){const[t,r]=g.useState(void 0);return se(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,l=d.blockSize}else i=e.offsetWidth,l=e.offsetHeight;r({width:i,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var To="Popper",[zi,on]=He(To),[Ng,Mi]=zi(To),Di=e=>{const{__scopePopper:t,children:r}=e,[n,o]=g.useState(null);return a.jsx(Ng,{scope:t,anchor:n,onAnchorChange:o,children:r})};Di.displayName=To;var Fi="PopperAnchor",$i=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Mi(Fi,r),i=g.useRef(null),l=Y(t,i),c=g.useRef(null);return g.useEffect(()=>{const d=c.current;c.current=n?.current||i.current,d!==c.current&&s.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});$i.displayName=Fi;var Ao="PopperContent",[Eg,Tg]=zi(Ao),Bi=g.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:b,...f}=e,x=Mi(Ao,r),[_,v]=g.useState(null),w=Y(t,F=>v(F)),[j,C]=g.useState(null),N=kg(j),k=N?.width??0,E=N?.height??0,T=n+(s!=="center"?"-"+s:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(d)?d:[d],A=L.length>0,I={padding:O,boundary:L.filter(Pg),altBoundary:A},{refs:z,floatingStyles:$,placement:R,isPositioned:U,middlewareData:P}=hg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>ag(...F,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[xg({mainAxis:o+E,alignmentAxis:i}),c&&bg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?vg():void 0,...I}),c&&_g({...I}),yg({...I,apply:({elements:F,rects:te,availableWidth:le,availableHeight:J})=>{const{width:Q,height:ne}=te.reference,xe=F.floating.style;xe.setProperty("--radix-popper-available-width",`${le}px`),xe.setProperty("--radix-popper-available-height",`${J}px`),xe.setProperty("--radix-popper-anchor-width",`${Q}px`),xe.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),j&&jg({element:j,padding:l}),Og({arrowWidth:k,arrowHeight:E}),m&&wg({strategy:"referenceHidden",...I})]}),[q,X]=Vi(R),Z=Ve(b);se(()=>{U&&Z?.()},[U,Z]);const pe=P.arrow?.x,Fe=P.arrow?.y,ge=P.arrow?.centerOffset!==0,[$e,pt]=g.useState();return se(()=>{_&&pt(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Eg,{scope:r,placedSide:q,onArrowChange:C,arrowX:pe,arrowY:Fe,shouldHideArrow:ge,children:a.jsx(W.div,{"data-side":q,"data-align":X,...f,ref:w,style:{...f.style,animation:U?void 0:"none"}})})})});Bi.displayName=Ao;var Ui="PopperArrow",Ag={top:"bottom",right:"left",bottom:"top",left:"right"},Hi=g.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Tg(Ui,n),i=Ag[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(Cg,{...o,ref:r,style:{...o.style,display:"block"}})})});Hi.displayName=Ui;function Pg(e){return e!==null}var Og=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,u]=Vi(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,h=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=i?p:`${m}px`,f=`${-c}px`):d==="top"?(b=i?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=i?p:`${h}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=i?p:`${h}px`),{data:{x:b,y:f}}}});function Vi(e){const[t,r="center"]=e.split("-");return[t,r]}var Wi=Di,Po=$i,qi=Bi,Gi=Hi,Rg="Portal",an=g.forwardRef((e,t)=>{const{container:r,...n}=e,[o,s]=g.useState(!1);se(()=>s(!0),[]);const i=r||o&&globalThis?.document?.body;return i?xa.createPortal(a.jsx(W.div,{...n,ref:t}),i):null});an.displayName=Rg;function Lg(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=Ig(t),o=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),s=Y(n.ref,zg(o));return typeof r=="function"||n.isPresent?g.cloneElement(o,{ref:s}):null};Ke.displayName="Presence";function Ig(e){const[t,r]=g.useState(),n=g.useRef(null),o=g.useRef(e),s=g.useRef("none"),i=e?"mounted":"unmounted",[l,c]=Lg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const d=sn(n.current);s.current=l==="mounted"?d:"none"},[l]),se(()=>{const d=n.current,u=o.current;if(u!==e){const m=s.current,h=sn(d);e?c("MOUNT"):h==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),se(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=h=>{const f=sn(n.current).includes(CSS.escape(h.animationName));if(h.target===t&&f&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=h=>{h.target===t&&(s.current=sn(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:g.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function sn(e){return e?.animationName||"none"}function zg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Mg=g[" useInsertionEffect ".trim().toString()]||se;function lt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Dg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=g.useCallback(u=>{if(l){const p=Fg(u)?u(e):u;p!==e&&i.current?.(p)}else s(u)},[l,e,s,i]);return[c,d]}function Dg({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),o=g.useRef(r),s=g.useRef(t);return Mg(()=>{s.current=t},[t]),g.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}function Fg(e){return typeof e=="function"}var $g=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Et=new WeakMap,ln=new WeakMap,cn={},Oo=0,Ki=function(e){return e&&(e.host||Ki(e.parentNode))},Bg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ki(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Ug=function(e,t,r,n){var o=Bg(t,Array.isArray(e)?e:[e]);cn[r]||(cn[r]=new WeakMap);var s=cn[r],i=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var h=m.getAttribute(n),b=h!==null&&h!=="false",f=(Et.get(m)||0)+1,x=(s.get(m)||0)+1;Et.set(m,f),s.set(m,x),i.push(m),f===1&&b&&ln.set(m,!0),x===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),Oo++,function(){i.forEach(function(p){var m=Et.get(p)-1,h=s.get(p)-1;Et.set(p,m),s.set(p,h),m||(ln.has(p)||p.removeAttribute(n),ln.delete(p)),h||p.removeAttribute(r)}),Oo--,Oo||(Et=new WeakMap,Et=new WeakMap,ln=new WeakMap,cn={})}},Ro=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=$g(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Ug(n,o,r,"aria-hidden")):function(){return null}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Oe.apply(this,arguments)};function Yi(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Hg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var dn="right-scroll-bar-position",un="width-before-scroll-bar",Vg="with-scroll-bars-hidden",Wg="--removed-body-scroll-bar-size";function Lo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Gg=typeof window<"u"?g.useLayoutEffect:g.useEffect,Xi=new WeakMap;function Kg(e,t){var r=qg(null,function(n){return e.forEach(function(o){return Lo(o,n)})});return Gg(function(){var n=Xi.get(r);if(n){var o=new Set(n),s=new Set(e),i=r.current;o.forEach(function(l){s.has(l)||Lo(l,null)}),s.forEach(function(l){o.has(l)||Lo(l,i)})}Xi.set(r,e)},[e]),r}function Yg(e){return e}function Xg(e,t){t===void 0&&(t=Yg);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(l){return s(l)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(s),i=r}var c=function(){var u=i;i=[],u.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){i.push(u),d()},filter:function(u){return i=i.filter(u),r}}}};return o}function Jg(e){e===void 0&&(e={});var t=Xg(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Ji=function(e){var t=e.sideCar,r=Yi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return g.createElement(n,Oe({},r))};Ji.isSideCarExport=!0;function Zg(e,t){return e.useMedium(t),Ji}var Zi=Jg(),Io=function(){},pn=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:Io,onWheelCapture:Io,onTouchMoveCapture:Io}),o=n[0],s=n[1],i=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,b=e.noIsolation,f=e.inert,x=e.allowPinchZoom,_=e.as,v=_===void 0?"div":_,w=e.gapMode,j=Yi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Kg([r,t]),k=Oe(Oe({},j),o);return g.createElement(g.Fragment,null,u&&g.createElement(C,{sideCar:Zi,removeScrollBar:d,shards:p,noRelative:h,noIsolation:b,inert:f,setCallbacks:s,allowPinchZoom:!!x,lockRef:r,gapMode:w}),i?g.cloneElement(g.Children.only(l),Oe(Oe({},k),{ref:N})):g.createElement(v,Oe({},k,{className:c,ref:N}),l))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pn.classNames={fullWidth:un,zeroRight:dn};var Qg=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ex(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qg();return t&&e.setAttribute("nonce",t),e}function tx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ex())&&(tx(t,r),rx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ox=function(){var e=nx();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Qi=function(){var e=ox(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},ax={left:0,top:0,right:0,gap:0},zo=function(e){return parseInt(e||"",10)||0},sx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[zo(r),zo(n),zo(o)]},ix=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ax;var t=sx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},lx=Qi(),Tt="data-scroll-locked",cx=function(e,t,r,n){var o=e.left,s=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
     304  .`.concat(Vg,` {
    295305   overflow: hidden `).concat(n,`;
    296306   padding-right: `).concat(l,"px ").concat(n,`;
    297307  }
    298   body[`).concat(Lt,`] {
     308  body[`).concat(Tt,`] {
    299309    overflow: hidden `).concat(n,`;
    300310    overscroll-behavior: contain;
    301311    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
    302312    padding-left: `.concat(o,`px;
    303     padding-top: `).concat(i,`px;
    304     padding-right: `).concat(s,`px;
     313    padding-top: `).concat(s,`px;
     314    padding-right: `).concat(i,`px;
    305315    margin-left:0;
    306316    margin-top:0;
     
    309319  }
    310320 
     321  .`).concat(dn,` {
     322    right: `).concat(l,"px ").concat(n,`;
     323  }
     324 
    311325  .`).concat(un,` {
    312     right: `).concat(l,"px ").concat(n,`;
    313   }
    314  
    315   .`).concat(pn,` {
    316326    margin-right: `).concat(l,"px ").concat(n,`;
    317327  }
    318328 
     329  .`).concat(dn," .").concat(dn,` {
     330    right: 0 `).concat(n,`;
     331  }
     332 
    319333  .`).concat(un," .").concat(un,` {
    320     right: 0 `).concat(n,`;
    321   }
    322  
    323   .`).concat(pn," .").concat(pn,` {
    324334    margin-right: 0 `).concat(n,`;
    325335  }
    326336 
    327   body[`).concat(Lt,`] {
    328     `).concat(Zg,": ").concat(l,`px;
    329   }
    330 `)},Js=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0},xx=function(){h.useEffect(function(){return document.body.setAttribute(Lt,(Js()+1).toString()),function(){var e=Js()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},vx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;xx();var i=h.useMemo(function(){return fx(o)},[o]);return h.createElement(hx,{styles:gx(i,!t,o,r?"":"!important")})},Lo=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Lo=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Lo=!1}var It=Lo?{passive:!1}:!1,bx=function(e){return e.tagName==="TEXTAREA"},Zs=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!bx(e)&&r[t]==="visible")},_x=function(e){return Zs(e,"overflowY")},yx=function(e){return Zs(e,"overflowX")},Qs=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=el(e,n);if(o){var i=tl(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Sx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},el=function(e,t){return e==="v"?_x(t):yx(t)},tl=function(e,t){return e==="v"?wx(t):Sx(t)},jx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Cx=function(e,t,r,n,o){var i=jx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=tl(e,l),v=g[0],f=g[1],x=g[2],_=f-x-i*v;(v||_)&&el(e,l)&&(p+=_,m+=v);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rl=function(e){return[e.deltaX,e.deltaY]},nl=function(e){return e&&"current"in e?e.current:e},kx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nx=function(e){return`
     337  body[`).concat(Tt,`] {
     338    `).concat(Wg,": ").concat(l,`px;
     339  }
     340`)},el=function(){var e=parseInt(document.body.getAttribute(Tt)||"0",10);return isFinite(e)?e:0},dx=function(){g.useEffect(function(){return document.body.setAttribute(Tt,(el()+1).toString()),function(){var e=el()-1;e<=0?document.body.removeAttribute(Tt):document.body.setAttribute(Tt,e.toString())}},[])},ux=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;dx();var s=g.useMemo(function(){return ix(o)},[o]);return g.createElement(lx,{styles:cx(s,!t,o,r?"":"!important")})},Mo=!1;if(typeof window<"u")try{var mn=Object.defineProperty({},"passive",{get:function(){return Mo=!0,!0}});window.addEventListener("test",mn,mn),window.removeEventListener("test",mn,mn)}catch{Mo=!1}var At=Mo?{passive:!1}:!1,px=function(e){return e.tagName==="TEXTAREA"},tl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!px(e)&&r[t]==="visible")},mx=function(e){return tl(e,"overflowY")},fx=function(e){return tl(e,"overflowX")},rl=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=nl(e,n);if(o){var s=ol(e,n),i=s[1],l=s[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},hx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},gx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},nl=function(e,t){return e==="v"?mx(t):fx(t)},ol=function(e,t){return e==="v"?hx(t):gx(t)},xx=function(e,t){return e==="h"&&t==="rtl"?-1:1},bx=function(e,t,r,n,o){var s=xx(e,window.getComputedStyle(t).direction),i=s*n,l=r.target,c=t.contains(l),d=!1,u=i>0,p=0,m=0;do{if(!l)break;var h=ol(e,l),b=h[0],f=h[1],x=h[2],_=f-x-s*b;(b||_)&&nl(e,l)&&(p+=_,m+=b);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},fn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},al=function(e){return[e.deltaX,e.deltaY]},sl=function(e){return e&&"current"in e?e.current:e},vx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_x=function(e){return`
    331341  .block-interactivity-`.concat(e,` {pointer-events: none;}
    332342  .allow-interactivity-`).concat(e,` {pointer-events: all;}
    333 `)},Ex=0,Mt=[];function Tx(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),o=h.useState(Ex++)[0],i=h.useState(Xs)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Xg([e.lockRef.current],(e.shards||[]).map(nl),!0).filter(Boolean);return f.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(f,x){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var _=hn(f),b=r.current,w="deltaX"in f?f.deltaX:b[0]-_[0],S="deltaY"in f?f.deltaY:b[1]-_[1],C,N=f.target,k=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=Qs(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=Qs(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||S)&&(n.current=C),!C)return!0;var T=n.current||C;return Cx(T,x,f,T==="h"?w:S)},[]),c=h.useCallback(function(f){var x=f;if(!(!Mt.length||Mt[Mt.length-1]!==i)){var _="deltaY"in x?rl(x):hn(x),b=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&kx(C.delta,_)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(s.current.shards||[]).map(nl).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?l(x,w[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),d=h.useCallback(function(f,x,_,b){var w={name:f,delta:x,target:_,should:b,shadowParent:Ax(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=h.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=h.useCallback(function(f){d(f.type,rl(f),f.target,l(f,e.lockRef.current))},[]),m=h.useCallback(function(f){d(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);h.useEffect(function(){return Mt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){Mt=Mt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(i,{styles:Nx(o)}):null,g?h.createElement(vx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ax(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Px=ax(Ys,Tx);var gn=h.forwardRef(function(e,t){return h.createElement(mn,Oe({},e,{ref:t,sideCar:Px}))});gn.classNames=mn.classNames;var xn="Popover",[ol]=He(xn,[an]),sr=an(),[Ox,Ye]=ol(xn),al=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=sr(t),c=h.useRef(null),[d,u]=h.useState(!1),[p,m]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(Us,{...l,children:a.jsx(Ox,{scope:t,contentId:Ne(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:s,children:r})})};al.displayName=xn;var il="PopoverAnchor",Rx=h.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(il,r),i=sr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return h.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Eo,{...i,...n,ref:t})});Rx.displayName=il;var sl="PopoverTrigger",ll=h.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(sl,r),i=sr(r),s=Y(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ml(o.open),...n,ref:s,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Eo,{asChild:!0,...i,children:l})});ll.displayName=sl;var Io="PopoverPortal",[Lx,Ix]=ol(Io,{forceMount:void 0}),cl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Ye(Io,t);return a.jsx(Lx,{scope:t,forceMount:r,children:a.jsx(Ke,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};cl.displayName=Io;var zt="PopoverContent",dl=h.forwardRef((e,t)=>{const r=Ix(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Ye(zt,e.__scopePopover);return a.jsx(Ke,{present:n||i.open,children:i.modal?a.jsx(zx,{...o,ref:t}):a.jsx(Dx,{...o,ref:t})})});dl.displayName=zt;var Mx=rt("PopoverContent.RemoveScroll"),zx=h.forwardRef((e,t)=>{const r=Ye(zt,e.__scopePopover),n=h.useRef(null),o=Y(t,n),i=h.useRef(!1);return h.useEffect(()=>{const s=n.current;if(s)return Ao(s)},[]),a.jsx(gn,{as:Mx,allowPinchZoom:!0,children:a.jsx(ul,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Dx=h.forwardRef((e,t)=>{const r=Ye(zt,e.__scopePopover),n=h.useRef(!1),o=h.useRef(!1);return a.jsx(ul,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ul=h.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Ye(zt,r),g=sr(r);return po(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Hs,{"data-state":ml(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),pl="PopoverClose",Fx=h.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(pl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});Fx.displayName=pl;var $x="PopoverArrow",Bx=h.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=sr(r);return a.jsx(Vs,{...o,...n,ref:t})});Bx.displayName=$x;function ml(e){return e?"open":"closed"}var Ux=al,Hx=ll,Vx=cl,Wx=dl;function ct({...e}){return a.jsx(Ux,{"data-slot":"popover",...e})}function dt({...e}){return a.jsx(Hx,{"data-slot":"popover-trigger",...e})}function ut({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Vx,{container:o,children:a.jsx(Wx,{"data-slot":"popover-content",align:t,sideOffset:r,className:D("ecr-popover",e),...n})})}var vn="Dialog",[fl]=He(vn),[Gx,we]=fl(vn),hl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=h.useRef(null),c=h.useRef(null),[d,u]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:vn});return a.jsx(Gx,{scope:t,triggerRef:l,contentRef:c,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:d,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};hl.displayName=vn;var gl="DialogTrigger",xl=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(gl,r),i=Y(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Do(o.open),...n,ref:i,onClick:H(e.onClick,o.onOpenToggle)})});xl.displayName=gl;var Mo="DialogPortal",[qx,vl]=fl(Mo,{forceMount:void 0}),bl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=we(Mo,t);return a.jsx(qx,{scope:t,forceMount:r,children:h.Children.map(n,s=>a.jsx(Ke,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};bl.displayName=Mo;var bn="DialogOverlay",_l=h.forwardRef((e,t)=>{const r=vl(bn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=we(bn,e.__scopeDialog);return i.modal?a.jsx(Ke,{present:n||i.open,children:a.jsx(Yx,{...o,ref:t})}):null});_l.displayName=bn;var Kx=rt("DialogOverlay.RemoveScroll"),Yx=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(bn,r);return a.jsx(gn,{as:Kx,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Do(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),pt="DialogContent",yl=h.forwardRef((e,t)=>{const r=vl(pt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=we(pt,e.__scopeDialog);return a.jsx(Ke,{present:n||i.open,children:i.modal?a.jsx(Xx,{...o,ref:t}):a.jsx(Jx,{...o,ref:t})})});yl.displayName=pt;var Xx=h.forwardRef((e,t)=>{const r=we(pt,e.__scopeDialog),n=h.useRef(null),o=Y(t,r.contentRef,n);return h.useEffect(()=>{const i=n.current;if(i)return Ao(i)},[]),a.jsx(wl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})}),Jx=h.forwardRef((e,t)=>{const r=we(pt,e.__scopeDialog),n=h.useRef(!1),o=h.useRef(!1);return a.jsx(wl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),wl=h.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=we(pt,r),c=h.useRef(null),d=Y(t,c);return po(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Do(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(Qx,{titleId:l.titleId}),a.jsx(t0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),zo="DialogTitle",Sl=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(zo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Sl.displayName=zo;var jl="DialogDescription",Zx=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(jl,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});Zx.displayName=jl;var Cl="DialogClose",kl=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Cl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});kl.displayName=Cl;function Do(e){return e?"open":"closed"}var Nl="DialogTitleWarning",[L_,El]=eh(Nl,{contentName:pt,titleName:zo,docsSlug:"dialog"}),Qx=({titleId:e})=>{const t=El(Nl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
     343`)},yx=0,Pt=[];function wx(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),o=g.useState(yx++)[0],s=g.useState(Qi)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Hg([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return f.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=g.useCallback(function(f,x){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!i.current.allowPinchZoom;var _=fn(f),v=r.current,w="deltaX"in f?f.deltaX:v[0]-_[0],j="deltaY"in f?f.deltaY:v[1]-_[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=rl(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=rl(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return bx(T,x,f,T==="h"?w:j)},[]),c=g.useCallback(function(f){var x=f;if(!(!Pt.length||Pt[Pt.length-1]!==s)){var _="deltaY"in x?al(x):fn(x),v=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&vx(C.delta,_)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var w=(i.current.shards||[]).map(sl).filter(Boolean).filter(function(C){return C.contains(x.target)}),j=w.length>0?l(x,w[0]):!i.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),d=g.useCallback(function(f,x,_,v){var w={name:f,delta:x,target:_,should:v,shadowParent:jx(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=g.useCallback(function(f){r.current=fn(f),n.current=void 0},[]),p=g.useCallback(function(f){d(f.type,al(f),f.target,l(f,e.lockRef.current))},[]),m=g.useCallback(function(f){d(f.type,fn(f),f.target,l(f,e.lockRef.current))},[]);g.useEffect(function(){return Pt.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,At),document.addEventListener("touchmove",c,At),document.addEventListener("touchstart",u,At),function(){Pt=Pt.filter(function(f){return f!==s}),document.removeEventListener("wheel",c,At),document.removeEventListener("touchmove",c,At),document.removeEventListener("touchstart",u,At)}},[]);var h=e.removeScrollBar,b=e.inert;return g.createElement(g.Fragment,null,b?g.createElement(s,{styles:_x(o)}):null,h?g.createElement(ux,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Sx=Zg(Zi,wx);var hn=g.forwardRef(function(e,t){return g.createElement(pn,Oe({},e,{ref:t,sideCar:Sx}))});hn.classNames=pn.classNames;var gn="Popover",[il]=He(gn,[on]),sr=on(),[Cx,Ye]=il(gn),ll=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,l=sr(t),c=g.useRef(null),[d,u]=g.useState(!1),[p,m]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:gn});return a.jsx(Wi,{...l,children:a.jsx(Cx,{scope:t,contentId:Ne(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:i,children:r})})};ll.displayName=gn;var cl="PopoverAnchor",kx=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(cl,r),s=sr(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return g.useEffect(()=>(i(),()=>l()),[i,l]),a.jsx(Po,{...s,...n,ref:t})});kx.displayName=cl;var dl="PopoverTrigger",ul=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(dl,r),s=sr(r),i=Y(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gl(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Po,{asChild:!0,...s,children:l})});ul.displayName=dl;var Do="PopoverPortal",[Nx,Ex]=il(Do,{forceMount:void 0}),pl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=Ye(Do,t);return a.jsx(Nx,{scope:t,forceMount:r,children:a.jsx(Ke,{present:r||s.open,children:a.jsx(an,{asChild:!0,container:o,children:n})})})};pl.displayName=Do;var Ot="PopoverContent",ml=g.forwardRef((e,t)=>{const r=Ex(Ot,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=Ye(Ot,e.__scopePopover);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(Ax,{...o,ref:t}):a.jsx(Px,{...o,ref:t})})});ml.displayName=Ot;var Tx=rt("PopoverContent.RemoveScroll"),Ax=g.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=g.useRef(null),o=Y(t,n),s=g.useRef(!1);return g.useEffect(()=>{const i=n.current;if(i)return Ro(i)},[]),a.jsx(hn,{as:Tx,allowPinchZoom:!0,children:a.jsx(fl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Px=g.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=g.useRef(!1),o=g.useRef(!1);return a.jsx(fl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),fl=g.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Ye(Ot,r),h=sr(r);return ho(),a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(qi,{"data-state":gl(m.open),role:"dialog",id:m.contentId,...h,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),hl="PopoverClose",Ox=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(hl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ox.displayName=hl;var Rx="PopoverArrow",Lx=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=sr(r);return a.jsx(Gi,{...o,...n,ref:t})});Lx.displayName=Rx;function gl(e){return e?"open":"closed"}var Ix=ll,zx=ul,Mx=pl,Dx=ml;function Rt({...e}){return a.jsx(Ix,{"data-slot":"popover",...e})}function Lt({...e}){return a.jsx(zx,{"data-slot":"popover-trigger",...e})}function It({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Mx,{container:o,children:a.jsx(Dx,{"data-slot":"popover-content",align:t,sideOffset:r,className:D("ecr-popover",e),...n})})}var Fx=Symbol.for("react.lazy"),xn=g[" use ".trim().toString()];function $x(e){return typeof e=="object"&&e!==null&&"then"in e}function xl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Fx&&"_payload"in e&&$x(e._payload)}function Bx(e){const t=Ux(e),r=g.forwardRef((n,o)=>{let{children:s,...i}=n;xl(s)&&typeof xn=="function"&&(s=xn(s._payload));const l=g.Children.toArray(s),c=l.find(Vx);if(c){const d=c.props.children,u=l.map(p=>p===c?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Ux(e){const t=g.forwardRef((r,n)=>{let{children:o,...s}=r;if(xl(o)&&typeof xn=="function"&&(o=xn(o._payload)),g.isValidElement(o)){const i=qx(o),l=Wx(s,o.props);return o.type!==g.Fragment&&(l.ref=n?Hn(n,i):i),g.cloneElement(o,l)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hx=Symbol("radix.slottable");function Vx(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hx}function Wx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function qx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Gx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kx=Gx.reduce((e,t)=>{const r=Bx(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...l}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Yx="Separator",bl="horizontal",Xx=["horizontal","vertical"],vl=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=bl,...o}=e,s=Jx(n)?n:bl,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(Kx.div,{"data-orientation":s,...l,...o,ref:t})});vl.displayName=Yx;function Jx(e){return Xx.includes(e)}var Zx=vl;function bn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(Zx,{"data-slot":"separator",decorative:r,orientation:t,className:D("ecr-separator",e),...n})}const ir=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(bn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(bn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(re,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};var vn="Dialog",[_l]=He(vn),[Qx,we]=_l(vn),yl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,l=g.useRef(null),c=g.useRef(null),[d,u]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:vn});return a.jsx(Qx,{scope:t,triggerRef:l,contentRef:c,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:d,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(p=>!p),[u]),modal:i,children:r})};yl.displayName=vn;var wl="DialogTrigger",jl=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(wl,r),s=Y(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bo(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)})});jl.displayName=wl;var Fo="DialogPortal",[e0,Sl]=_l(Fo,{forceMount:void 0}),Cl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=we(Fo,t);return a.jsx(e0,{scope:t,forceMount:r,children:g.Children.map(n,i=>a.jsx(Ke,{present:r||s.open,children:a.jsx(an,{asChild:!0,container:o,children:i})}))})};Cl.displayName=Fo;var _n="DialogOverlay",kl=g.forwardRef((e,t)=>{const r=Sl(_n,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(_n,e.__scopeDialog);return s.modal?a.jsx(Ke,{present:n||s.open,children:a.jsx(r0,{...o,ref:t})}):null});kl.displayName=_n;var t0=rt("DialogOverlay.RemoveScroll"),r0=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(_n,r);return a.jsx(hn,{as:t0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Bo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ct="DialogContent",Nl=g.forwardRef((e,t)=>{const r=Sl(ct,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(ct,e.__scopeDialog);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(n0,{...o,ref:t}):a.jsx(o0,{...o,ref:t})})});Nl.displayName=ct;var n0=g.forwardRef((e,t)=>{const r=we(ct,e.__scopeDialog),n=g.useRef(null),o=Y(t,r.contentRef,n);return g.useEffect(()=>{const s=n.current;if(s)return Ro(s)},[]),a.jsx(El,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault())})}),o0=g.forwardRef((e,t)=>{const r=we(ct,e.__scopeDialog),n=g.useRef(!1),o=g.useRef(!1);return a.jsx(El,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),El=g.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,l=we(ct,r),c=g.useRef(null),d=Y(t,c);return ho(),a.jsxs(a.Fragment,{children:[a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Bo(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(s0,{titleId:l.titleId}),a.jsx(l0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),$o="DialogTitle",Tl=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we($o,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Tl.displayName=$o;var Al="DialogDescription",a0=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Al,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});a0.displayName=Al;var Pl="DialogClose",Ol=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Pl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ol.displayName=Pl;function Bo(e){return e?"open":"closed"}var Rl="DialogTitleWarning",[G_,Ll]=Gf(Rl,{contentName:ct,titleName:$o,docsSlug:"dialog"}),s0=({titleId:e})=>{const t=Ll(Rl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
    334344
    335345If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
    336346
    337 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},e0="DialogDescriptionWarning",t0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${El(e0).contentName}}.`;return h.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},r0=hl,n0=xl,o0=bl,a0=_l,i0=yl,s0=Sl,l0=kl;function Tl({...e}){return a.jsx(r0,{"data-slot":"dialog",...e})}function Al({...e}){return a.jsx(n0,{"data-slot":"dialog-trigger",...e})}function c0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(o0,{"data-slot":"dialog-portal",container:t,...e})}function d0({className:e,...t}){return a.jsx(a0,{"data-slot":"dialog-overlay",className:D("ecr-dialog__overlay",e),...t})}function Pl({className:e,children:t,...r}){return a.jsxs(c0,{children:[a.jsx(d0,{}),a.jsxs(i0,{"data-slot":"dialog-content",className:D("ecr-dialog__content",e),...r,children:[t,a.jsx(l0,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(Ff,{className:"ecr-dialog__close-icon"})})]})]})}function Ol({className:e,...t}){return a.jsx("div",{className:D("ecr-dialog__header",e),...t})}function Rl({className:e,...t}){return a.jsx(s0,{"data-slot":"dialog-title",className:D("ecr-dialog__title",e),...t})}const u0=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:D("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),p0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,m0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const v=[];t||v.push("text"),n&&p0.test(n)||v.push("url"),i||v.push("campaign"),m(v),!(v.length>0)&&e({btn_type:"custom",btn_uuid:Gi(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(_n,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(_n,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(_n,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:v=>c(v.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(_n,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(u0,{name:"add",handleClick:g})})]})};function _n({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:D("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const f0=({setLinks:e})=>{const t=r=>{e(n=>[...n,r])};return a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[a.jsxs(Tl,{children:[a.jsxs(Al,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Lf,{size:20})," Add Custom Link"]}),a.jsxs(Pl,{className:"ecr-admin-link-dialog",children:[a.jsx(Ol,{children:a.jsx(Rl,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(m0,{handleLinks:t})})]})]}),a.jsxs(ct,{children:[a.jsxs(dt,{className:"ecr-admin-link-tabs__lock",children:[a.jsx(zf,{size:20})," Tag Product ",a.jsx(bt,{size:20})]}),a.jsx(ut,{className:"ecr-admin-link-tabs__popover",children:a.jsx(Et,{name:"Tag Product",text:a.jsx(a.Fragment,{children:"Link one or multiple products to your videos, enhancing sales directly from your Reels!"})})})]})]})})},h0=({links:e,onLinksChange:t})=>{const r=n=>{t(o=>o.filter(i=>i.btn_uuid!==n))};return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:"Link"}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(n=>a.jsxs("div",{className:`ecr-admin-links__item ${n.customClass??""}`,children:[a.jsx("span",{children:n.buttonText}),a.jsx(oe,{onClick:()=>r(n.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Df,{size:16})})]},n.btn_uuid)),a.jsxs(ct,{children:[a.jsxs(dt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(bt,{size:20})]}),a.jsx(ut,{className:"ecr-admin-links__popover",children:a.jsx(Et,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(f0,{setLinks:t})]})};function Ll(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const g0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:D("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},x0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(v=>!v))},g=()=>{p.current&&(p.current.muted=!l,c(v=>!v))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:D("ecr-admin-customization__panel"),children:[a.jsx(Ll,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(g0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Vn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Un,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Hn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Wn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},v0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(x0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(ct,{children:[a.jsxs(dt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:qi,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(bt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(ut,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(Et,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},b0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx(Ll,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(Ki,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),_0=()=>{const e=je(),[t]=Gt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(x=>{i(_=>({..._,title:typeof x=="function"?x(_.title):x}))},[]),p=y.useCallback(x=>{i(_=>({..._,files:typeof x=="function"?x(_.files):x}))},[]),m=y.useCallback(x=>{i(_=>({..._,links:typeof x=="function"?x(_.links):x}))},[]),g=y.useCallback(x=>{i(_=>({..._,thumbnail:typeof x=="function"?x(_.thumbnail):x}))},[]),v=()=>{c&&(p(x=>x.filter(_=>_.file_uuid!==c)),d(null))},f=y.useCallback(async x=>{try{l(!0);const _=await ue.get(`story/${x}`);i({title:_.data.title,files:_.data.files,links:_.data.links,thumbnail:_.data.thumbnail})}catch(_){_ instanceof Error?q.error(_.message):q.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(_f,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Or,{onReject:()=>d(null),onAccept:v,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(v0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(Ki,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(b0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(lo,{className:"ecr-admin-create__separator"}),a.jsx(h0,{links:o.links,onLinksChange:m})]})]})]})},Il=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(Dp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Fo,Ml;function y0(){return Ml||(Ml=1,Fo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Fo}var $o,zl;function w0(){if(zl)return $o;zl=1;var e=y0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=t[s.format]||t.default;window.clipboardData.setData(x,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var v=document.execCommand("copy");if(!v)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(x){l&&console.error("unable to copy using clipboardData: ",x),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return $o=o,$o}var S0=w0();const Dl=vd(S0);function Fl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:D("ecr-table",e),...t})})}function $l({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:D("ecr-table__header",e),...t})}function Bl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:D("ecr-table__body",e),...t})}function yn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:D("ecr-table__row",e),...t})}function Ul({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:D("ecr-table__head",e),...t})}function Re({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:D("ecr-table__cell",e),...t})}function Hl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:D("ecr-table__caption",e),...t})}const j0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],C0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Dl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Fl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Hl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(nt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx($l,{children:a.jsx(yn,{children:j0.map((s,l)=>a.jsx(Ul,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Bl,{children:e.map((s,l)=>a.jsxs(yn,{className:D("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Re,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(Xu,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:D("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(oe,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${K.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(ei,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(oe,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${K.mg}&gid=${s.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(oe,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(zp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Vl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),k0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[v]=y.useState(20),[f,x]=y.useState(0),[_,b]=y.useState(1),w=Ui(u,500),S=y.useCallback(async E=>{const T=new AbortController,R=E===1;try{R?i(!0):l(!0),n("");const I=await ue.get("groups",{params:{page:E,per_page:v,...w&&{q:w}},signal:T.signal}),A=Number(I.headers?.["x-wp-total"]??0),L=Number(I.headers?.["x-wp-totalpages"]??1),M=Math.max(1,L||1);t($=>{if(R)return I.data;const O=new Set($.map(P=>P.id)),U=I.data.filter(P=>!O.has(P.id));return[...$,...U]}),x(A),b(M),E>M&&g(M)}catch(I){if(T.signal.aborted)return;I instanceof Error?n(I.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(R?i(!1):l(!1))}},[v,w]),C=y.useCallback(()=>{g(E=>o||s||E>=_?E:E+1)},[o,s,_]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await S(1)},[m,S]),k=y.useCallback(async E=>{try{d(!0),await ue.delete(`group/${E}`),await N(),q.success("Group deleted successfully!")}catch(T){T instanceof Error?q.error(T.message):q.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{S(m)},[m,S,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:v,total:f,totalPages:_,hasMore:m<=_,loadMore:C,refreshGroups:N,deleteGroup:k}},N0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=k0(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const v=new IntersectionObserver(f=>{const[x]=f;x.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return v.observe(m.current),()=>v.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(jt,{name:"All Widgets",Icon:Fp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}`,text:"Add Reel",Icon:_t},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:v=>p(v.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(oe,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(Xt,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(Ga,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${K.mg}`,text:"Create Widget",Icon:_t,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Vl,{}):n?a.jsx(Il,{}):a.jsxs(a.Fragment,{children:[a.jsx(C0,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(If,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},E0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(v=>({...v,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){q.error("Please enter valid numbers.");return}try{l(!0),d(!1),await ue.post("settings",{rate_limit:m,time_limit:g}),q.success("Settings updated successfully."),t(!1)}catch(v){v instanceof Error?q.error(v.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const v=await ue.get("settings",{signal:m.signal});n({rateLimit:v.data.rate_limit,timeLimit:v.data.time_limit}),t(!1)}catch(v){if(m.signal.aborted)return;v instanceof Error?q.error(v.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},T0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=E0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(St,{left:[a.jsx(jt,{name:"Settings",Icon:pp},"Settings"),a.jsx(Jt,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(ao,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},A0=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],P0=({tableData:e})=>a.jsxs(Fl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Hl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx($l,{children:a.jsx(yn,{children:A0.map((t,r)=>a.jsx(Ul,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Bl,{children:e.map((t,r)=>a.jsxs(yn,{className:D("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),O0=()=>{const[e]=Gt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await ue.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?q.error(g.message):q.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(jt,{name:"Statistics",Icon:ei},"Statistics"),a.jsx(Jt,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Vl,{}):d?a.jsx(Il,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(P0,{tableData:i})})]})]})};function R0(e){return V({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function L0(e){return V({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const I0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:D("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(R0,{size:24})}),M0=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})});function z0({className:e,type:t,...r}){return a.jsx("input",{type:t,"data-slot":"input",className:D("ecr-input",e),...r})}const lr=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=v=>{const f=Math.min(r,Math.max(t,Number(v)));o(f)},g=v=>{const f=Number(v);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:v=>{const f=Number(v.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(z0,{type:"number",min:t,max:r,value:d,onChange:v=>g(v.target.value),className:"ecr-input"}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(null,arguments)}function De(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,Xe=100,cr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*Xe:0,v:i/Dt*Xe,a:o}},Wl=e=>{var{h:t,s:r,l:n,a:o}=Gl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Gl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/Xe;return{h:t,s:i>0&&i<200?r*n/Xe/(i<=Xe?i:200-i)*Xe:0,l:i/2,a:o}},ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},D0=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+ql({r:t,g:r,b:n})+(i||"")},dr=e=>cr(F0(e)),F0=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},wn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/Xe,l=n/Xe,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),z({},g,{a:o})},$0=e=>{var{r:t,g:r,b:n,a:o}=wn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},B0=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},U0=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Bo=e=>ql(wn(e)),H0=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},V0=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},Ft=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&Uo(e)?(s=dr(e),c=e):typeof e!="string"&&(s=e),s&&(n=H0(s),i=Gl(s),o=wn(s),d=D0(o),c=Bo(s),r=U0(i),t=B0(o),l=V0(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},Uo=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function Kl(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var ur=e=>"touches"in e,Yl=e=>{!ur(e)&&e.preventDefault&&e.preventDefault()},Xl=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},Jl=(e,t)=>{var r=e.getBoundingClientRect(),n=ur(t)?t.touches[0]:t;return{left:Xl((n.pageX-(r.left+window.pageXOffset))/r.width),top:Xl((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},W0=["prefixCls","className","onMove","onDown"],Ho=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=De(e,W0),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=Kl(o),m=Kl(i),g=b=>c.current&&!ur(b)?!1:(c.current=ur(b),!0),v=y.useCallback(b=>{if(Yl(b),!!l.current){var w=ur(b)?b.touches.length>0:b.buttons>0;if(!w){u(!1);return}p?.(Jl(l.current,b),b)}},[p]),f=y.useCallback(()=>u(!1),[]),x=y.useCallback(b=>{b?(window.addEventListener(c.current?"touchmove":"mousemove",v),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",v),window.removeEventListener("touchend",f))},[v,f]);y.useEffect(()=>(x(d),()=>{x(!1)}),[d,v,f,x]);var _=y.useCallback(b=>{var w=document.activeElement;w?.blur(),Yl(b.nativeEvent),g(b.nativeEvent)&&l.current&&(m?.(Jl(l.current,b.nativeEvent),b.nativeEvent),u(!0))},[m]);return a.jsx("div",z({},s,{className:[r,n||""].filter(Boolean).join(" "),style:z({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:_,onTouchStart:_}))});Ho.displayName="Interactive";var G0=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},q0=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],Zl=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=De(e,q0),m=z({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(_,b)=>{u&&d&&u({h:d.h,s:_.left*100,v:(1-_.top)*100,a:d.a})},v=y.useCallback(_=>{if(!(!d||!u)){var b=1,w=d.s,S=d.v,C=!1;switch(_.key){case"ArrowLeft":w=Math.max(0,d.s-b),C=!0,_.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+b),C=!0,_.preventDefault();break;case"ArrowUp":S=Math.min(100,d.v+b),C=!0,_.preventDefault();break;case"ArrowDown":S=Math.max(0,d.v-b),C=!0,_.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:S,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var _={top:100-d.v+"%",left:d.s+"%",color:Wl(d)};return i&&typeof i=="function"?i(z({prefixCls:n},_)):a.jsx(G0,z({prefixCls:n},_))},[d,i,n]),x=y.useCallback(_=>{_.target.focus()},[]);return a.jsx(Ho,z({className:[n,s||""].filter(Boolean).join(" ")},p,{style:z({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:v,onClick:x,children:f}))});Zl.displayName="Saturation";var K0=["className","prefixCls","left","top","style","fillProps"],Y0=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=De(e,K0),c=z({},i,{position:"absolute",left:n,top:o}),d=z({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",z({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",z({className:r+"-fill"},s,{style:d}))}))},X0=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],J0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Sn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:v,pointer:f}=e,x=De(e,X0),_=T=>{v&&v(z({},o,{a:m==="horizontal"?T.left:T.top}),T)},b=Wl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+b+" 100%)",S={};m==="horizontal"?S.left=o.a*100+"%":S.top=o.a*100+"%";var C=z({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+J0+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var R=.01,I=o.a,A=I;switch(T.key){case"ArrowLeft":m==="horizontal"&&(A=Math.max(0,I-R),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(A=Math.min(1,I+R),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(A=Math.max(0,I-R),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(A=Math.min(1,I+R),T.preventDefault());break;default:return}if(A!==I){var L={left:m==="horizontal"?A:o.a,top:m==="vertical"?A:o.a,width:0,height:0,x:0,y:0};v&&v(z({},o,{a:A}),L)}},[o,m,v]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(z({prefixCls:r},c,S)):a.jsx(Y0,z({},c,{prefixCls:r},S));return a.jsxs("div",z({},x,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",z({},s,{style:z({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(Ho,z({},l,{style:z({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:_,onDown:_,onClick:k,onKeyDown:N,children:E}))]}))});Sn.displayName="Alpha";var Z0=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Q0=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),ev=e=>Number(String(e).replace(/%/g,"")),$t=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=De(e,Z0),[v,f]=y.useState(i),x=y.useRef(!1);y.useEffect(()=>{e.value!==v&&(x.current||f(e.value))},[e.value]);function _(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");Q0(T)&&u&&u(k,T);var R=ev(T);isNaN(R)||u&&u(k,R),f(T)}function b(k){x.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var S=z({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=z({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=z({value:v,onChange:_,onBlur:b,autoComplete:"off",onFocus:()=>x.current=!0},g,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:S,children:[m?m(N,t):a.jsx("input",z({ref:t},N)),o&&a.jsx("span",{style:z({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});$t.displayName="EditableInput";var tv=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],Ql=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=De(e,tv),g=n?wn(n):{};function v(b){var w=Number(b.target.value);w&&w>255&&(b.target.value="255"),w&&w<0&&(b.target.value="0")}var f=b=>{var w=Number(b.target.value);w&&w>100&&(b.target.value="100"),w&&w<0&&(b.target.value="0")},x=(b,w,S)=>{typeof b=="number"&&(w==="a"&&(b<0&&(b=0),b>100&&(b=100),p&&p(Ft(cr(z({},g,{a:b/100}))))),b>255&&(b=255,S.target.value="255"),b<0&&(b=0,S.target.value="0"),w==="r"&&p&&p(Ft(cr(z({},g,{r:b})))),w==="g"&&p&&p(Ft(cr(z({},g,{g:b})))),w==="b"&&p&&p(Ft(cr(z({},g,{b})))))},_=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",z({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:z({fontSize:11,display:"flex"},u),children:[a.jsx($t,z({label:"R",value:g.r||0,onBlur:v,placement:o,onChange:(b,w)=>x(w,"r",b)},i,{style:z({},i.style)})),a.jsx($t,z({label:"G",value:g.g||0,onBlur:v,placement:o,onChange:(b,w)=>x(w,"g",b)},s,{style:z({marginLeft:5},i.style)})),a.jsx($t,z({label:"B",value:g.b||0,onBlur:v,placement:o,onChange:(b,w)=>x(w,"b",b)},l,{style:z({marginLeft:5},l.style)})),c&&a.jsx($t,z({label:"A",value:parseInt(String(_*100),10),onBlur:f,placement:o,onChange:(b,w)=>x(w,"a",b)},c,{style:z({marginLeft:5},c.style)}))]}))});Ql.displayName="EditableInputRGBA";var rv=["prefixCls","className","hue","onChange","direction"],ec=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=De(e,rv);return a.jsx(Sn,z({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});ec.displayName="Hue";var nv=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],tc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=De(e,nv),g=z({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),v=(f,x)=>{c&&c(dr(f),Ft(dr(f)),x)};return a.jsxs("div",z({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:z({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,x)=>{var _="",b="";typeof f=="string"&&(_=f,b=f),typeof f=="object"&&f.color&&(_=f.title||f.color,b=f.color);var w=o&&o.toLocaleLowerCase()===b.toLocaleLowerCase(),S=p&&p({title:_,color:b,checked:!!w,style:z({},g,{background:b}),onClick:N=>v(b,N)});if(S)return a.jsx(y.Fragment,{children:S},x);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:b,checked:w}):null;return a.jsx("div",z({tabIndex:0,title:_,onClick:N=>v(b,N)},l,{children:C,style:z({},g,{background:b})}),x)}),d&&y.isValidElement(d)&&d]}))});tc.displayName="Swatch";var ov=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],av=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],rc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),nc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=av,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=De(e,ov),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&Uo(l)&&g(dr(l)),typeof l=="object"&&g(l)},[l]);var v=N=>{g(N),o&&o(Ft(N))},f=(N,k)=>{typeof N=="string"&&Uo(N)&&/(3|6)/.test(String(N.length))&&v(dr(N))},x=N=>v(z({},m,{a:N.a})),_=N=>v(z({},m,N,{a:m.a})),b=z({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:$0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},S={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",z({},p,{className:r+" "+(n||""),ref:t,style:b,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(Zl,{hsva:m,style:{width:"auto",height:150},onChange:_}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ec,{width:"auto",height:10,hue:m.h,pointer:rc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>v(z({},m,N))}),!d&&a.jsx(Sn,{width:"auto",height:10,hsva:m,pointer:rc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:x})]}),!d&&a.jsx(Sn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx($t,{label:"Hex",value:Bo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(Ql,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>v(N.hsva)})]}),s&&s.length>0&&a.jsx(tc,{style:S,colors:s,color:Bo(m),onChange:N=>v(N),rectProps:{style:C}})]}))});nc.displayName="Sketch";const oc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(ct,{children:[a.jsx(dt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(ut,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(nc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),iv=[{value:"left",title:"Align Left",Icon:Tp},{value:"center",title:"Align Center",Icon:Ap},{value:"right",title:"Align Right",Icon:Pp},{value:"hidden",title:"Hidden",Icon:Op}],sv=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:iv.map(({value:r,title:n,Icon:o})=>a.jsx(oe,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),lv=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(sv,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(oc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(lr,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},cv=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Dl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},dv=({gid:e})=>{const[t,r]=cv(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Of,{color:"#ffffff",size:12})}),a.jsx("span",{className:D("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},ac=y.createContext({requestLeave:e=>e()}),uv=({value:e,children:t})=>a.jsx(ac.Provider,{value:e,children:t}),ic=()=>y.useContext(ac),jn=({link:e,style:t})=>a.jsx("div",{className:"ecr-thumb__link-list",style:t,children:a.jsx("a",{href:e.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,children:e.buttonText},e.btn_uuid)}),sc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=je(),{requestLeave:s}=ic(),l=n===e.story_uuid,c=`?view=${K.cr}&from=${K.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={width:`${t?.size}px`,border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:D("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(qn,{story:e,styles:t}),d==="overlay"&&t.shape==="rectangle"&&p&&a.jsx(jn,{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"95%",borderRadius:"6px"},link:p}),a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(oe,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(vt,{to:c,className:D("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:m=>{m.preventDefault(),s(()=>i(c))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(oe,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(tt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(ti,{size:18})})]})]}),d==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel__title",children:e.title}):null]})},lc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const x=f.scrollLeft,_=f.scrollWidth,b=f.clientWidth;c(x>0),u(x+b<_-1)};y.useEffect(()=>{const f=r.current,x=n.current;f&&x&&(s(x.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const v=f=>{const x=r.current;x&&(x.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let x=!1,_,b;const w=R=>{x=!0,_=R.pageX-f.offsetLeft,b=f.scrollLeft,f.style.cursor="grabbing"},S=()=>{x=!1,f.style.cursor="default"},C=()=>{x=!1,f.style.cursor="default"},N=R=>{if(!x)return;R.preventDefault();const A=(R.pageX-f.offsetLeft-_)*1.5;f.scrollLeft=b-A,g()},k=R=>{x=!0,_=R.touches[0].pageX-f.offsetLeft,b=f.scrollLeft},E=()=>{x=!1},T=R=>{if(!x)return;const A=(R.touches[0].pageX-f.offsetLeft-_)*1.5;f.scrollLeft=b-A,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",S),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",S),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:v,scrollStep:p}},cc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=lc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"},gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:D("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(sc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(nt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Kt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Yt,{size:20})})]})},pv=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const i={columnGap:`${t?.gap}px`};return a.jsx("div",{style:i,className:D("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(s=>a.jsx(sc,{reel:s,styles:t,gid:r,togglingId:n,onRemove:o},s.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(nt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})},dc=({title:e})=>a.jsx("p",{className:"ecr-reel_title",children:e}),mv=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",v=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(yt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Kt,{size:24})}),a.jsx(yt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Yt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(Xt,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const x=f.currentTarget,_=x.videoWidth,b=x.videoHeight;d(()=>b>_)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(Un,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Hn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"&&v?a.jsx(jn,{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"},link:v}):null,g==="title"?a.jsx(dc,{title:e.title}):null]})})},fv={carousel:cc,grid:pv},hv=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=fv[s]||cc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(dv,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(mv,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(nt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},uc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),gv=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=je(),{requestLeave:d}=ic(),u=`?view=${K.cr}&from=${K.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Rr,{to:u,text:"Add Reel",Icon:_t,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(uc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(tt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(uc,{})]})})]})]})};function pc(e){const t=e+"CollectionProvider",[r,n]=He(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:x,children:_}=f,b=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:w,collectionRef:b,children:_})};s.displayName=t;const l=e+"CollectionSlot",c=rt(l),d=y.forwardRef((f,x)=>{const{scope:_,children:b}=f,w=i(l,_),S=Y(x,w.collectionRef);return a.jsx(c,{ref:S,children:b})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(u),g=y.forwardRef((f,x)=>{const{scope:_,children:b,...w}=f,S=y.useRef(null),C=Y(x,S),N=i(u,_);return y.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>void N.itemMap.delete(S))),a.jsx(m,{[p]:"",ref:C,children:b})});g.displayName=u;function v(f){const x=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},v,n]}var xv=h.createContext(void 0);function Vo(e){const t=h.useContext(xv);return e||t||"ltr"}var Wo="rovingFocusGroup.onEntryFocus",vv={bubbles:!1,cancelable:!0},pr="RovingFocusGroup",[Go,mc,bv]=pc(pr),[_v,fc]=He(pr,[bv]),[yv,wv]=_v(pr),hc=h.forwardRef((e,t)=>a.jsx(Go.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Go.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Sv,{...e,ref:t})})}));hc.displayName=pr;var Sv=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=h.useRef(null),g=Y(t,m),v=Vo(i),[f,x]=lt({prop:s,defaultProp:l??null,onChange:c,caller:pr}),[_,b]=h.useState(!1),w=Ve(d),S=mc(r),C=h.useRef(!1),[N,k]=h.useState(0);return h.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(Wo,w),()=>E.removeEventListener(Wo,w)},[w]),a.jsx(yv,{scope:r,orientation:n,dir:v,loop:o,currentTabStopId:f,onItemFocus:h.useCallback(E=>x(E),[x]),onItemShiftTab:h.useCallback(()=>b(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:H(e.onMouseDown,()=>{C.current=!0}),onFocus:H(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!_){const R=new CustomEvent(Wo,vv);if(E.currentTarget.dispatchEvent(R),!R.defaultPrevented){const I=S().filter(O=>O.focusable),A=I.find(O=>O.active),L=I.find(O=>O.id===f),$=[A,L,...I].filter(Boolean).map(O=>O.ref.current);vc($,u)}}C.current=!1}),onBlur:H(e.onBlur,()=>b(!1))})})}),gc="RovingFocusGroupItem",xc=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ne(),d=i||c,u=wv(gc,r),p=u.currentTabStopId===d,m=mc(r),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:f}=u;return h.useEffect(()=>{if(n)return g(),()=>v()},[n,g,v]),a.jsx(Go.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:H(e.onMouseDown,x=>{n?u.onItemFocus(d):x.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=kv(x,u.orientation,u.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=m().filter(S=>S.focusable).map(S=>S.ref.current);if(_==="last")w.reverse();else if(_==="prev"||_==="next"){_==="prev"&&w.reverse();const S=w.indexOf(x.currentTarget);w=u.loop?Nv(w,S+1):w.slice(S+1)}setTimeout(()=>vc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});xc.displayName=gc;var jv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kv(e,t,r){const n=Cv(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return jv[n]}function vc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Nv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Ev=hc,Tv=xc,Cn="Tabs",[Av]=He(Cn,[fc]),bc=fc(),[Pv,qo]=Av(Cn),_c=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Vo(l),[p,m]=lt({prop:n,onChange:o,defaultProp:i??"",caller:Cn});return a.jsx(Pv,{scope:r,baseId:Ne(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});_c.displayName=Cn;var yc="TabsList",wc=h.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=qo(yc,r),s=bc(r);return a.jsx(Ev,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});wc.displayName=yc;var Sc="TabsTrigger",jc=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=qo(Sc,r),l=bc(r),c=Nc(s.baseId,n),d=Ec(s.baseId,n),u=n===s.value;return a.jsx(Tv,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:H(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:H(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:H(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});jc.displayName=Sc;var Cc="TabsContent",kc=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=qo(Cc,r),c=Nc(l.baseId,n),d=Ec(l.baseId,n),u=n===l.value,p=h.useRef(u);return h.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ke,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});kc.displayName=Cc;function Nc(e,t){return`${e}-trigger-${t}`}function Ec(e,t){return`${e}-content-${t}`}var Ov=_c,Rv=wc,Lv=jc,Iv=kc;function Mv({className:e,...t}){return a.jsx(Ov,{"data-slot":"tabs",className:D("ecr-tabs",e),...t})}function zv({className:e,...t}){return a.jsx(Rv,{"data-slot":"tabs-list",className:D("ecr-tabs__list",e),...t})}function Tc({className:e,...t}){return a.jsx(Lv,{"data-slot":"tabs-trigger",className:D("ecr-tabs__trigger",e),...t})}function Ac({className:e,...t}){return a.jsx(Iv,{"data-slot":"tabs-content",className:D("ecr-tabs__content",e),...t})}function Pc(e,[t,r]){return Math.min(r,Math.max(t,e))}function Dv(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Fv="VisuallyHidden",$v=h.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Oc,...e.style}}));$v.displayName=Fv;var Bv=[" ","Enter","ArrowUp","ArrowDown"],Uv=[" ","Enter"],mt="Select",[kn,Nn,Hv]=pc(mt),[Bt]=He(mt,[Hv,an]),En=an(),[Vv,Je]=Bt(mt),[Wv,Gv]=Bt(mt),Rc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:v}=e,f=En(t),[x,_]=h.useState(null),[b,w]=h.useState(null),[S,C]=h.useState(!1),N=Vo(d),[k,E]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:mt}),[T,R]=lt({prop:s,defaultProp:l,onChange:c,caller:mt}),I=h.useRef(null),A=x?v||!!x.closest("form"):!0,[L,M]=h.useState(new Set),$=Array.from(L).map(O=>O.props.value).join(";");return a.jsx(Us,{...f,children:a.jsxs(Vv,{required:g,scope:t,trigger:x,onTriggerChange:_,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Ne(),value:T,onValueChange:R,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:I,disabled:m,children:[a.jsx(kn.Provider,{scope:t,children:a.jsx(Wv,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(O=>{M(U=>new Set(U).add(O))},[]),onNativeOptionRemove:h.useCallback(O=>{M(U=>{const P=new Set(U);return P.delete(O),P})},[]),children:r})}),A?a.jsxs(td,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:O=>R(O.target.value),disabled:m,form:v,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(L)]},$):null]})})};Rc.displayName=mt;var Lc="SelectTrigger",Ic=h.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=En(r),s=Je(Lc,r),l=s.disabled||n,c=Y(t,s.onTriggerChange),d=Nn(r),u=h.useRef("touch"),[p,m,g]=nd(f=>{const x=d().filter(w=>!w.disabled),_=x.find(w=>w.value===s.value),b=od(x,f,_);b!==void 0&&s.onValueChange(b.value)}),v=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Eo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":rd(s.value)?"":void 0,...o,ref:c,onClick:H(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&v(f)}),onPointerDown:H(o.onPointerDown,f=>{u.current=f.pointerType;const x=f.target;x.hasPointerCapture(f.pointerId)&&x.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(v(f),f.preventDefault())}),onKeyDown:H(o.onKeyDown,f=>{const x=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(x&&f.key===" ")&&Bv.includes(f.key)&&(v(),f.preventDefault())})})})});Ic.displayName=Lc;var Mc="SelectValue",zc=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=Je(Mc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=Y(t,c.onValueNodeChange);return ie(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:rd(c.value)?a.jsx(a.Fragment,{children:s}):i})});zc.displayName=Mc;var qv="SelectIcon",Dc=h.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Dc.displayName=qv;var Kv="SelectPortal",Fc=e=>a.jsx(sn,{asChild:!0,...e});Fc.displayName=Kv;var ft="SelectContent",$c=h.forwardRef((e,t)=>{const r=Je(ft,e.__scopeSelect),[n,o]=h.useState();if(ie(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?br.createPortal(a.jsx(Bc,{scope:e.__scopeSelect,children:a.jsx(kn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Uc,{...e,ref:t})});$c.displayName=ft;var Se=10,[Bc,Ze]=Bt(ft),Yv="SelectContentImpl",Xv=rt("SelectContent.RemoveScroll"),Uc=h.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:f,avoidCollisions:x,..._}=e,b=Je(ft,r),[w,S]=h.useState(null),[C,N]=h.useState(null),k=Y(t,F=>S(F)),[E,T]=h.useState(null),[R,I]=h.useState(null),A=Nn(r),[L,M]=h.useState(!1),$=h.useRef(!1);h.useEffect(()=>{if(w)return Ao(w)},[w]),po();const O=h.useCallback(F=>{const[ee,...le]=A().map(re=>re.ref.current),[J]=le.slice(-1),Q=document.activeElement;for(const re of F)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===ee&&C&&(C.scrollTop=0),re===J&&C&&(C.scrollTop=C.scrollHeight),re?.focus(),document.activeElement!==Q))return},[A,C]),U=h.useCallback(()=>O([E,w]),[O,E,w]);h.useEffect(()=>{L&&U()},[L,U]);const{onOpenChange:P,triggerPointerDownPosRef:G}=b;h.useEffect(()=>{if(w){let F={x:0,y:0};const ee=J=>{F={x:Math.abs(Math.round(J.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(J.pageY)-(G.current?.y??0))}},le=J=>{F.x<=10&&F.y<=10?J.preventDefault():w.contains(J.target)||P(!1),document.removeEventListener("pointermove",ee),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",le,{capture:!0})}}},[w,P,G]),h.useEffect(()=>{const F=()=>P(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[P]);const[X,Z]=nd(F=>{const ee=A().filter(Q=>!Q.disabled),le=ee.find(Q=>Q.ref.current===document.activeElement),J=od(ee,F,le);J&&setTimeout(()=>J.ref.current.focus())}),pe=h.useCallback((F,ee,le)=>{const J=!$.current&&!le;(b.value!==void 0&&b.value===ee||J)&&(T(F),J&&($.current=!0))},[b.value]),Fe=h.useCallback(()=>w?.focus(),[w]),he=h.useCallback((F,ee,le)=>{const J=!$.current&&!le;(b.value!==void 0&&b.value===ee||J)&&I(F)},[b.value]),$e=n==="popper"?Ko:Hc,ht=$e===Ko?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:f,avoidCollisions:x}:{};return a.jsx(Bc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:pe,selectedItem:E,onItemLeave:Fe,itemTextRefCallback:he,focusSelectedItem:U,selectedItemText:R,position:n,isPositioned:L,searchRef:X,children:a.jsx(gn,{as:Xv,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:b.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:H(o,F=>{b.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:a.jsx($e,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:F=>F.preventDefault(),..._,...ht,onPlaced:()=>M(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:H(_.onKeyDown,F=>{const ee=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!ee&&F.key.length===1&&Z(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let J=A().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(F.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const Q=F.target,re=J.indexOf(Q);J=J.slice(re+1)}setTimeout(()=>O(J)),F.preventDefault()}})})})})})})});Uc.displayName=Yv;var Jv="SelectItemAlignedPosition",Hc=h.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Je(ft,r),s=Ze(ft,r),[l,c]=h.useState(null),[d,u]=h.useState(null),p=Y(t,k=>u(k)),m=Nn(r),g=h.useRef(!1),v=h.useRef(!0),{viewport:f,selectedItem:x,selectedItemText:_,focusSelectedItem:b}=s,w=h.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&x&&_){const k=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),R=_.getBoundingClientRect();if(i.dir!=="rtl"){const Q=R.left-E.left,re=T.left-Q,ge=k.left-re,gt=k.width+ge,aa=Math.max(gt,E.width),ia=window.innerWidth-Se,sa=Pc(re,[Se,Math.max(Se,ia-aa)]);l.style.minWidth=gt+"px",l.style.left=sa+"px"}else{const Q=E.right-R.right,re=window.innerWidth-T.right-Q,ge=window.innerWidth-k.right-re,gt=k.width+ge,aa=Math.max(gt,E.width),ia=window.innerWidth-Se,sa=Pc(re,[Se,Math.max(Se,ia-aa)]);l.style.minWidth=gt+"px",l.style.right=sa+"px"}const I=m(),A=window.innerHeight-Se*2,L=f.scrollHeight,M=window.getComputedStyle(d),$=parseInt(M.borderTopWidth,10),O=parseInt(M.paddingTop,10),U=parseInt(M.borderBottomWidth,10),P=parseInt(M.paddingBottom,10),G=$+O+L+P+U,X=Math.min(x.offsetHeight*5,G),Z=window.getComputedStyle(f),pe=parseInt(Z.paddingTop,10),Fe=parseInt(Z.paddingBottom,10),he=k.top+k.height/2-Se,$e=A-he,ht=x.offsetHeight/2,F=x.offsetTop+ht,ee=$+O+F,le=G-ee;if(ee<=he){const Q=I.length>0&&x===I[I.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-f.offsetTop-f.offsetHeight,ge=Math.max($e,ht+(Q?Fe:0)+re+U),gt=ee+ge;l.style.height=gt+"px"}else{const Q=I.length>0&&x===I[0].ref.current;l.style.top="0px";const ge=Math.max(he,$+f.offsetTop+(Q?pe:0)+ht)+le;l.style.height=ge+"px",f.scrollTop=ee-he+f.offsetTop}l.style.margin=`${Se}px 0`,l.style.minHeight=X+"px",l.style.maxHeight=A+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,x,_,i.dir,n]);ie(()=>w(),[w]);const[S,C]=h.useState();ie(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=h.useCallback(k=>{k&&v.current===!0&&(w(),b?.(),v.current=!1)},[w,b]);return a.jsx(Qv,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Hc.displayName=Jv;var Zv="SelectPopperPosition",Ko=h.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Se,...i}=e,s=En(r);return a.jsx(Hs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ko.displayName=Zv;var[Qv,Yo]=Bt(ft,{}),Xo="SelectViewport",Vc=h.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Ze(Xo,r),s=Yo(Xo,r),l=Y(t,i.onViewportChange),c=h.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(kn.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:H(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const v=window.innerHeight-Se*2,f=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),_=Math.max(f,x);if(_<v){const b=_+g,w=Math.min(v,b),S=b-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Vc.displayName=Xo;var Wc="SelectGroup",[eb,tb]=Bt(Wc),rb=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ne();return a.jsx(eb,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});rb.displayName=Wc;var Gc="SelectLabel",nb=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=tb(Gc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});nb.displayName=Gc;var Tn="SelectItem",[ob,qc]=Bt(Tn),Kc=h.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=Je(Tn,r),c=Ze(Tn,r),d=l.value===n,[u,p]=h.useState(i??""),[m,g]=h.useState(!1),v=Y(t,b=>c.itemRefCallback?.(b,n,o)),f=Ne(),x=h.useRef("touch"),_=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(ob,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:h.useCallback(b=>{p(w=>w||(b?.textContent??"").trim())},[]),children:a.jsx(kn.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:v,onFocus:H(s.onFocus,()=>g(!0)),onBlur:H(s.onBlur,()=>g(!1)),onClick:H(s.onClick,()=>{x.current!=="mouse"&&_()}),onPointerUp:H(s.onPointerUp,()=>{x.current==="mouse"&&_()}),onPointerDown:H(s.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:H(s.onPointerMove,b=>{x.current=b.pointerType,o?c.onItemLeave?.():x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(s.onKeyDown,b=>{c.searchRef?.current!==""&&b.key===" "||(Uv.includes(b.key)&&_(),b.key===" "&&b.preventDefault())})})})})});Kc.displayName=Tn;var mr="SelectItemText",Yc=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Je(mr,r),l=Ze(mr,r),c=qc(mr,r),d=Gv(mr,r),[u,p]=h.useState(null),m=Y(t,_=>p(_),c.onItemTextChange,_=>l.itemTextRefCallback?.(_,c.value,c.disabled)),g=u?.textContent,v=h.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:x}=d;return ie(()=>(f(v),()=>x(v)),[f,x,v]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?br.createPortal(i.children,s.valueNode):null]})});Yc.displayName=mr;var Xc="SelectItemIndicator",Jc=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return qc(Xc,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});Jc.displayName=Xc;var Jo="SelectScrollUpButton",Zc=h.forwardRef((e,t)=>{const r=Ze(Jo,e.__scopeSelect),n=Yo(Jo,e.__scopeSelect),[o,i]=h.useState(!1),s=Y(t,n.onScrollButtonChange);return ie(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ed,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Zc.displayName=Jo;var Zo="SelectScrollDownButton",Qc=h.forwardRef((e,t)=>{const r=Ze(Zo,e.__scopeSelect),n=Yo(Zo,e.__scopeSelect),[o,i]=h.useState(!1),s=Y(t,n.onScrollButtonChange);return ie(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ed,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Qc.displayName=Zo;var ed=h.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Ze("SelectScrollButton",r),s=h.useRef(null),l=Nn(r),c=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),ie(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:H(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:H(o.onPointerLeave,()=>{c()})})}),ab="SelectSeparator",ib=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});ib.displayName=ab;var Qo="SelectArrow",sb=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=En(r),i=Je(Qo,r),s=Ze(Qo,r);return i.open&&s.position==="popper"?a.jsx(Vs,{...o,...n,ref:t}):null});sb.displayName=Qo;var lb="SelectBubbleInput",td=h.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=h.useRef(null),i=Y(n,o),s=Dv(t);return h.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Oc,...r.style},ref:i,defaultValue:t})});td.displayName=lb;function rd(e){return e===""||e===void 0}function nd(e){const t=Ve(e),r=h.useRef(""),n=h.useRef(0),o=h.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=h.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function od(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=cb(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function cb(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var db=Rc,ub=Ic,pb=zc,mb=Dc,fb=Fc,hb=$c,gb=Vc,xb=Kc,vb=Yc,bb=Jc,_b=Zc,yb=Qc;function fr({...e}){return a.jsx(db,{"data-slot":"select",...e})}function hr({...e}){return a.jsx(pb,{"data-slot":"select-value",...e})}function gr({className:e,size:t="default",children:r,...n}){return a.jsxs(ub,{"data-slot":"select-trigger","data-size":t,className:D("ecr-select__trigger",e),...n,children:[r,a.jsx(mb,{asChild:!0,children:a.jsx(so,{className:"ecr-select__icon"})})]})}function xr({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(fb,{container:i,children:a.jsxs(hb,{"data-slot":"select-content",className:D("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(wb,{}),a.jsx(gb,{className:D("ecr-select__viewport"),children:t}),a.jsx(Sb,{})]})})}function vr({className:e,children:t,...r}){return a.jsxs(xb,{"data-slot":"select-item",className:D("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(bb,{children:a.jsx(Af,{className:"ecr-select__check-icon"})})}),a.jsx(vb,{children:t})]})}function wb({className:e,...t}){return a.jsx(_b,{"data-slot":"select-scroll-up-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(Pf,{className:"ecr-select__icon"})})}function Sb({className:e,...t}){return a.jsx(yb,{"data-slot":"select-scroll-down-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(so,{className:"ecr-select__icon"})})}const jb=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Bu.map(r=>a.jsx(vr,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Cb={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function kb(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(fr,{defaultValue:Ba[0].value,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Ba.map(e=>a.jsx(vr,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Fu.map(e=>a.jsx("div",{children:a.jsxs(ct,{modal:!0,children:[a.jsxs(dt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(bt,{size:18})]}),a.jsx(ut,{className:"ecr-admin-control__popover",children:a.jsx(Et,{name:e.label,text:Cb[e.value]})})]})},e.value))]})]})]})}const Nb=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(kb,{}),a.jsx(jb,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var An="Collapsible",[Eb]=He(An),[Tb,ea]=Eb(An),ad=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:An});return a.jsx(Tb,{scope:r,disabled:i,contentId:Ne(),open:c,onOpenToggle:h.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":ra(c),"data-disabled":i?"":void 0,...l,ref:t})})});ad.displayName=An;var id="CollapsibleTrigger",sd=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ea(id,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ra(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:H(e.onClick,o.onOpenToggle)})});sd.displayName=id;var ta="CollapsibleContent",ld=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ea(ta,e.__scopeCollapsible);return a.jsx(Ke,{present:r||o.open,children:({present:i})=>a.jsx(Ab,{...n,ref:t,present:i})})});ld.displayName=ta;var Ab=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ea(ta,r),[l,c]=h.useState(n),d=h.useRef(null),u=Y(t,d),p=h.useRef(0),m=p.current,g=h.useRef(0),v=g.current,f=s.open||l,x=h.useRef(f),_=h.useRef(void 0);return h.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),ie(()=>{const b=d.current;if(b){_.current=_.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();p.current=w.height,g.current=w.width,x.current||(b.style.transitionDuration=_.current.transitionDuration,b.style.animationName=_.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":ra(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:f&&o})});function ra(e){return e?"open":"closed"}var Pb=ad,Ob=sd,Rb=ld;function cd({className:e,...t}){return a.jsx(Pb,{"data-slot":"collapsible",className:D("ecr-collapsible",e),...t})}function dd({className:e,children:t,...r}){return a.jsxs(Ob,{"data-slot":"collapsible-trigger",className:D("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(so,{className:"ecr-collapsible__trigger-icon"})]})}function ud({className:e,...t}){return a.jsx(Rb,{"data-slot":"collapsible-content",className:D("ecr-collapsible__content",e),...t})}const na=({label:e,text:t})=>a.jsxs(ct,{children:[a.jsx(dt,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(bt,{size:20})]}),a.jsx(L0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(ut,{className:"ecr-admin-popover",children:a.jsx(Et,{name:e,text:t})})]}),Lb=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:$u.map(r=>a.jsx(vr,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Ib=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Du.map(r=>a.jsx(vr,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Mb=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],zb=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:Mb.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(Ip,{color:"#2563eb",size:16}):a.jsx(Mp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},Db=Object.values($a),Fb={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},$b=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Db.map(r=>a.jsx(vr,{value:r,className:"ecr-admin-control__option",children:r},r)),zu.map(r=>a.jsx("div",{children:a.jsxs(ct,{modal:!0,children:[a.jsxs(dt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(bt,{size:18})]}),a.jsx(ut,{className:"ecr-admin-control__popover",children:a.jsx(Et,{name:r,text:Fb[r]})})]})},r))]})]})]}),Bb=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsxs(cd,{open:o,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(dd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>s("layout"),children:[a.jsx(Rf,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(ud,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(zb,{selectedShape:e?.shape,handleShape:l=>t(c=>({...c,shape:l}))}),a.jsx($b,{selectedLayout:e?.template??"carousel",handleLayout:l=>t(c=>({...c,template:l}))}),a.jsx(Lb,{linkLayout:e?.appearance??"overlay",handleLinkLayout:l=>t(c=>({...c,appearance:l}))}),a.jsx(lr,{label:"Size",min:150,max:400,value:e?.size??150,onChange:l=>t(c=>({...c,size:l})),name:"size",id:"size"}),a.jsx(lr,{label:"Gap",min:0,max:80,value:e?.gap??0,onChange:l=>t(c=>({...c,gap:l})),name:"column_gap",id:"column-gap"}),a.jsx(na,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(na,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(na,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),a.jsxs(cd,{open:i,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(dd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>s("style"),children:[a.jsx(Mf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(ud,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(lr,{label:"Border Width",min:0,max:12,value:e?.border?.border_width??0,onChange:l=>t(c=>({...c,border:{...c.border,border_width:l}})),name:"border_width",id:"border-width"}),a.jsx(oc,{selectedColor:e?.border?.border_color,handleColor:l=>t(c=>({...c,border:{...c.border,border_color:l}})),text:"Border Color"}),e?.shape==="rectangle"&&a.jsx(lr,{label:"Border Radius",min:0,max:99,value:e?.border?.border_radius??0,onChange:l=>t(c=>({...c,border:{...c.border,border_radius:l}})),name:"border_radius",id:"border-radius"}),a.jsx(Ib,{hoverEffect:e?.hoverEffect||"none",handleHoverEffect:l=>t(c=>({...c,hoverEffect:l}))})]})]})]})},Ub=({styles:e,setStyles:t,isExpanded:r,setIsEdited:n,tabs:o,currentTab:i,setCurrentTab:s})=>{const l=d=>{t(u=>{const p=d(u);return n(!0),p})},c=d=>{(d===o.thumbnail||d===o.preview)&&s(d)};return a.jsxs("div",{className:D("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(Mv,{value:i,onValueChange:c,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(zv,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Tc,{value:o.thumbnail,children:"Thumbnail"}),a.jsx(Tc,{value:o.preview,children:"Preview"})]}),a.jsx(Ac,{value:o.thumbnail,children:a.jsx(Bb,{styles:e,updateStyles:l})}),a.jsx(Ac,{value:o.preview,children:a.jsx(Nb,{styles:e,updateStyles:l})})]})})]})},Hb=e=>{const t=je(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(et),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const b=(await ue.get(`stories/${e}`)).data;n(b.group_name),i(b.stories),l(b.styles??et)}catch(_){_ instanceof Error?q.error(_.message):q.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const v=async x=>{const _=o.map(S=>S.id),b={group_name:r,styles:s,story_ids:_};e&&(b.group_id=e);const w=await ue.post("stories/manage-group-stories",b);if(!e){const S=w.data.group_id;t(`?view=${K.mg}&gid=${S}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const x=await v();return g(!1),q.success("Changes saved successfully!"),x}catch(x){return x instanceof Error?q.error(x.message):q.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},Vb=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},pd={thumbnail:"thumbnail",preview:"preview"},Wb=()=>{const e=je(),{state:t}=Wt(),[r]=Gt(),n=r.get("gid"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:v}=Hb(n),{allReels:f,setAllReels:x,searchTerm:_,setSearchTerm:b,isSearching:w,lastStoryElementRef:S}=Hi(n),[C,N]=y.useState(""),[k,E]=y.useState(!0),[T,R]=y.useState(pd.thumbnail),{showLeaveModal:I,requestLeave:A,confirmLeave:L,cancelLeave:M,allowNextNavigation:$}=Vb(m),O=async(P,G)=>{try{N(P.story_uuid);const X=G==="add"?[P,...s]:s.filter(Z=>Z.story_uuid!==P.story_uuid);l(X),x(G==="add"?Z=>Z.filter(pe=>pe.story_uuid!==P.story_uuid):Z=>[...Z,P]),g(!0)}catch(X){X instanceof Error?q.error(X.message):q.error("Something went wrong. Please try again later!")}finally{N("")}};y.useEffect(()=>{if(!u&&t){const P=f.findIndex(G=>G.id==t.storyId);if(P!==-1){const G=f[P];x(X=>X.filter(Z=>Z.id!=G.id)),l(X=>[G,...X]),g(!0)}}},[t,f,u,x,l,g]);const U=async()=>{const P=await v();P?.isNewGroup&&$(()=>{e(`?view=${K.mg}&gid=${P.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(uv,{value:{requestLeave:A},children:[a.jsx(St,{left:[a.jsx(jt,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(Jt,{cb:()=>A(()=>e(`?view=${K.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Vi,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Tl,{children:[a.jsx(Al,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(M0,{})}),a.jsxs(Pl,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Ol,{children:a.jsx(Rl,{children:"Customize title appearance"})}),a.jsx(lv,{styles:c,setStyles:d,setIsEdited:g})]})]})]},"title")],right:[a.jsx(I0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(ao,{onSave:U,isSaving:p,disabled:!m},"save")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Manage Widget"}],onNavigate:P=>A(()=>e(P))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(gv,{allReels:f,gid:n,handleSelectReel:O,searchTerm:_,setSearchTerm:b,isSearching:w,togglingId:C,lastStoryElementRef:S}),a.jsx(hv,{gid:n,reels:s,styles:c,handleRemoveReel:O,togglingId:C,currentTab:T}),a.jsx(Ub,{isExpanded:k,setIsEdited:g,styles:c,setStyles:d,tabs:pd,setCurrentTab:R,currentTab:T})]}),I&&a.jsx(Or,{onReject:M,onAccept:L,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function Gb(){const[e]=Gt(),t=e.get("view")||K.ag;let r;switch(t){case K.settings:r=a.jsx(T0,{});break;case K.ar:r=a.jsx(vf,{});break;case K.stat:r=a.jsx(O0,{});break;case K.cr:r=a.jsx(_0,{});break;case K.mg:r=a.jsx(Wb,{});break;default:r=a.jsx(N0,{})}return a.jsxs("div",{children:[r,a.jsx(Mu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const md=async(e,t,r,n={})=>{try{if(await ue.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},qb=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),Kb=()=>{const e=y.useContext(oa),{stories:t,styles:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=y.useState(null),[d,u]=y.useState(!0),[p,m]=y.useState(0),[g,v]=y.useState(!1),f=y.useRef(!0),x=t.length-1,[_,b]=y.useState({index:0,story_uuid:t[0]?.story_uuid}),w=A=>!!A?.files?.[0]?.mime_type?.startsWith("video"),S=y.useCallback((A,L=1)=>{if(t.length===0)return null;let M=A;for(let $=0;$<t.length;$+=1){const O=t[M];if(w(O))return{story:O,index:M};M=(M+L+t.length)%t.length}return null},[t]),C=y.useCallback(()=>{const A=o,L=t.findIndex(O=>String(O.story_uuid)===A),M=L>=0?t[L]:null,$=w(M)?{story:M,index:L}:S(Math.max(L,0),1);$?.story?(c($.story),L!==$.index&&$.story.story_uuid!==o&&i($.story.story_uuid)):c(null),u(!1)},[o,t,i,S]);y.useEffect(()=>{C()},[o,t,C]),y.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const N=(A=1)=>{u(!0);const L=t.findIndex(P=>String(P.story_uuid)===String(o)),M=A>0?1:-1,$=A>0?x>L?L+1:0:L>0?L-1:x,O=S($,M);if(!O?.story){u(!1);return}const U=O.story;if(U.story_uuid===o){u(!1),i(null);return}b({index:0,story_uuid:U.story_uuid}),n&&md(n,U.id,s,{isActive:()=>f.current}),i(U.story_uuid),u(!1)},k=()=>{const A=l?.files??[];_?.index>0?b(L=>({index:L.index-1,story_uuid:A[L.index-1].story_uuid})):N(-1)},E=()=>{const A=l?.files??[];_?.index+1<A.length?b(L=>({index:L.index+1,story_uuid:A[L.index+1].story_uuid})):(N(),A[0]?.story_uuid&&b({index:0,story_uuid:A[0].story_uuid}))},T=A=>{A.target===A.currentTarget&&i(null)},R=r?.playerAppearance??"overlay",I=l?.links&&l.links.length>0?l.links[0]:null;return a.jsx("div",{onClick:T,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:l&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(yt,{onClick:k,className:"ecr-player__nav--left",children:a.jsx(Kt,{size:24})}),a.jsx(yt,{onClick:E,className:"ecr-player__nav--right",children:a.jsx(Yt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[l&&a.jsx(Ya,{playingStory:l,duration:p,currentFileIndex:_,isPaused:g},`${l.story_uuid}-${_.index}`),a.jsx("div",{onClick:()=>i(null),className:"ecr-player__close",children:a.jsx(Xt,{className:"ecr-player__close-icon"})}),d?a.jsx(qb,{}):l?.files.length>0&&a.jsx(Qa,{currentFileIndex:_,files:l?.files,setDuration:m,setIsPlaying:i,isPaused:g,setIsPaused:v,handlePrevFile:k,handleNextFile:E,storyId:l.id,storyTitle:l?.title}),R==="overlay"&&I?a.jsx(jn,{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"},link:I}):null,R==="title"?a.jsx(dc,{title:l.title}):null]})]})})},fd=({story:e,styles:t,handlePlaying:r,template:n,storyViews:o,setStoryViews:i})=>{const s=e.links&&e.links.length>0?e.links[0]:null,l=t.appearance??"overlay";return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,style:{width:n==="carousel"?`${t?.size}px`:"auto"},children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(qn,{story:e,styles:t,storyViews:o,setStoryViews:i}),l==="overlay"&&t.shape==="rectangle"&&s&&a.jsx(jn,{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"95%",borderRadius:"6px"},link:s})]}),l==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-reel__title",children:e.title}):null]})},Yb=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=lc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,style:{gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(fd,{story:m,styles:t,handlePlaying:r,template:"carousel",storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Kt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Yt,{size:20,style:{width:"20px",height:"20px"}})})]})},hd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`,gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(fd,{story:i,styles:t,handlePlaying:r,template:"grid",storyViews:n,setStoryViews:o},i.story_uuid):null)})}),Xb={carousel:Yb,grid:hd},Jb=()=>{const e=y.useContext(oa),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=Xb[d]||hd,p=({sid:m,story_uuid:g})=>{i(g),o&&md(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Zb=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(et),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(et),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const v=await ue.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(v.data.group_name),o(v.data.stories),s(v.data.styles||et)}catch(v){if(g.signal.aborted)return;u(v)}finally{c(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},oa=y.createContext(void 0),gd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=Zb(e);return a.jsxs(oa.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(Kb,{}),a.jsx(Jb,{})]})};la(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Pn.createRoot(e).render(a.jsx(Wd,{children:a.jsx(Gb,{})}))}),la(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Pn.createRoot(n).render(a.jsx(gd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Pn.createRoot(n).render(a.jsx(gd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
     347For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},i0="DialogDescriptionWarning",l0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ll(i0).contentName}}.`;return g.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},c0=yl,d0=jl,u0=Cl,p0=kl,m0=Nl,f0=Tl,Il=Ol;function Uo({...e}){return a.jsx(c0,{"data-slot":"dialog",...e})}function Ho({...e}){return a.jsx(d0,{"data-slot":"dialog-trigger",...e})}function h0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(u0,{"data-slot":"dialog-portal",container:t,...e})}function g0({className:e,...t}){return a.jsx(p0,{"data-slot":"dialog-overlay",className:D("ecr-dialog__overlay",e),...t})}function Vo({className:e,children:t,...r}){return a.jsxs(h0,{children:[a.jsx(g0,{}),a.jsxs(m0,{"data-slot":"dialog-content",className:D("ecr-dialog__content",e),...r,children:[t,a.jsx(Il,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(qf,{className:"ecr-dialog__close-icon"})})]})]})}function Wo({className:e,...t}){return a.jsx("div",{className:D("ecr-dialog__header",e),...t})}function qo({className:e,...t}){return a.jsx(f0,{"data-slot":"dialog-title",className:D("ecr-dialog__title",e),...t})}function x0({...e}){return a.jsx(Il,{"data-slot":"dialog-close",...e})}const b0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,s]=y.useState([]),[i,l]=y.useState(1),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,h]=y.useState(!1),[b,f]=y.useState(""),x=io(b,500),_=y.useRef(!0),v=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),h(!1),p(!1);return}const O=++v.current;w.current&&w.current.abort();const L=new AbortController;w.current=L,T===1&&_.current?h(!0):p(!0);try{const A={page:T,per_page:50};x&&(A.search=x);const I=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:A,signal:L.signal}),z=I.data,$=parseInt(I.headers["x-wp-totalpages"]||"1",10);O===v.current&&(s(R=>T===1?z:[...R,...z]),l(T+1),d(T<$))}catch(A){if(L.signal.aborted)return;A instanceof Error?C(A.message):C("An unknown error occurred")}finally{_.current&&(_.current=!1),O===v.current&&!L.signal.aborted&&(p(!1),h(!1))}},[x,n,r]);y.useEffect(()=>{t&&(l(1),s([]),C(null),_.current=!0,N(1))},[x,N,t]);const k=y.useRef(null),E=y.useCallback(T=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(O=>{O[0].isIntersecting&&c&&N(i)}),T&&k.current.observe(T))},[u,c,i,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:s,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},yn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",zl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:D("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),v0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:s,searchTerm:i,setSearchTerm:l,error:c})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),h=f=>{m(!1),u(x=>x.includes(f.id)?x.filter(_=>_!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const x=new Set(d),_=[];for(const v of r)x.has(v.id)&&_.push({btn_type:"product",btn_uuid:uo(),buttonText:v.name,buttonUrl:v.permalink,rating:v.average_rating,price:v.price_html,thumbnail:v.images?.[0]?.thumbnail||v.images?.[0]?.src||yn,product_id:v.id});e(_),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:i,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Ml,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,x)=>{const _=d.includes(f.id);return a.jsx("div",{ref:r.length===x+1?s:null,className:"ecr-admin-product-link__item",style:d.length>0&&!_?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(re,{type:"button",onClick:()=>h(f),className:D("ecr-admin-product-link__button",_?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[_?a.jsx(Uf,{size:20,color:"#2563eb"}):a.jsx(Hf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||yn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Ml,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(zl,{name:"add",handleClick:b})})]})]})},Ml=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),_0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,y0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[s,i]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),h=()=>{const b=[];t||b.push("text"),n&&_0.test(n)||b.push("url"),s||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:uo(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:s,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(wn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(wn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(wn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:s,setValue:i}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(wn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(zl,{name:"add",handleClick:h})})]})};function wn({error:e,type:t,name:r,label:n,placeholder:o,value:s,setValue:i}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:s,onChange:l=>i(l.target.value),className:D("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const w0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,s]=y.useState(null),[i,l]=y.useState(!1),c=b0({enabled:i}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(h=>h.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(bn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Uo,{open:o==="custom",onOpenChange:h=>s(h?"custom":null),children:[a.jsxs(Ho,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Ff,{size:20})," Add Custom Link"]}),a.jsxs(Vo,{className:"ecr-admin-link-dialog",children:[a.jsx(Wo,{children:a.jsx(qo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(y0,{handleLinks:h=>{e(b=>[...b,h]),s(null)}})})]})]}),u&&a.jsxs(Uo,{open:o==="product",onOpenChange:h=>s(h?"product":null),children:[a.jsxs(Ho,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Vf,{size:20})," Tag Products"]}),a.jsxs(Vo,{className:"ecr-admin-link-dialog",children:[a.jsx(Wo,{children:a.jsx(qo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(v0,{handleLinks:h=>{e(h),s(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},j0=({links:e,onLinksChange:t})=>{const r=o=>{t(s=>s.filter(i=>i.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(re,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Wf,{size:16})})]},o.btn_uuid)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(qt,{size:20})]}),a.jsx(It,{className:"ecr-admin-links__popover",children:a.jsx(ir,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(w0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function Dl(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const S0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[s,i]=y.useState(!1);return a.jsx("video",{ref:n,className:D("ecr-admin-reelvideo",s?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;i(()=>u>d)}})},C0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:s,dragEnd:i})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},h=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>s(e),onDragEnd:i,className:D("ecr-admin-customization__panel"),children:[a.jsx(Dl,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(S0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Vn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Wn,{size:16,className:"ecr-admin-customization__control",onClick:h}):a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:h})]})]})},k0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),s=c=>{n.current=c},i=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(C0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:s,dragEnter:i,dragEnd:l},d)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:Qs,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(qt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(It,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ir,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},N0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx(Dl,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(ei,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),E0=()=>{const e=Se(),[t]=Vt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,s]=y.useState({files:[],title:"",links:[],thumbnail:null}),[i,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(x=>{s(_=>({..._,title:typeof x=="function"?x(_.title):x}))},[]),p=y.useCallback(x=>{s(_=>({..._,files:typeof x=="function"?x(_.files):x}))},[]),m=y.useCallback(x=>{s(_=>({..._,links:typeof x=="function"?x(_.links):x}))},[]),h=y.useCallback(x=>{s(_=>({..._,thumbnail:typeof x=="function"?x(_.thumbnail):x}))},[]),b=()=>{c&&(p(x=>x.filter(_=>_.file_uuid!==c)),d(null))},f=y.useCallback(async x=>{try{l(!0);const _=await ue.get(`story/${x}`);s({title:_.data.title,files:_.data.files,links:_.data.links,thumbnail:_.data.thumbnail})}catch(_){_ instanceof Error?G.error(_.message):G.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),i?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(Cf,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Or,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(k0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(ei,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(N0,{thumbnail:o.thumbnail,onThumbnailChange:h}),a.jsx(bn,{className:"ecr-admin-create__separator"}),a.jsx(j0,{links:o.links,onLinksChange:m})]})]})]})},Fl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(Hp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Go,$l;function T0(){return $l||($l=1,Go=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Go}var Ko,Bl;function A0(){if(Bl)return Ko;Bl=1;var e=T0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(s){var i=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,i)}function o(s,i){var l,c,d,u,p,m,h=!1;i||(i={}),l=i.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=s,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),i.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=t[i.format]||t.default;window.clipboardData.setData(x,s)}else f.clipboardData.clearData(),f.clipboardData.setData(i.format,s);i.onCopy&&(f.preventDefault(),i.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");h=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(i.format||"text",s),i.onCopy&&i.onCopy(window.clipboardData),h=!0}catch(x){l&&console.error("unable to copy using clipboardData: ",x),l&&console.error("falling back to prompt"),c=n("message"in i?i.message:r),window.prompt(c,s)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return h}return Ko=o,Ko}var P0=A0();const Ul=jd(P0);function Hl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:D("ecr-table",e),...t})})}function Vl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:D("ecr-table__header",e),...t})}function Wl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:D("ecr-table__body",e),...t})}function jn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:D("ecr-table__row",e),...t})}function ql({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:D("ecr-table__head",e),...t})}function Re({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:D("ecr-table__cell",e),...t})}function Gl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:D("ecr-table__caption",e),...t})}const O0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],R0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),s=(i,l)=>{Ul(i),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Hl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Gl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(nt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(Vl,{children:a.jsx(jn,{children:O0.map((i,l)=>a.jsx(ql,{className:"ecr-admin-groups__head",style:{width:i?.width||"auto",textAlign:i?.align},children:i.label},l))})}),a.jsx(Wl,{children:e.map((i,l)=>a.jsxs(jn,{className:D("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Re,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:i.group_name})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${i.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>s(`[reelswp-group id='${i.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(tp,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:D("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(re,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.stat}&group=${i.id}&name=${i.group_name}`,children:a.jsx(ls,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.mg}&gid=${i.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Delete Group",onClick:()=>t(i.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(Up,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},i.id??l))})]}):null]})},Kl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),L0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,s]=y.useState(!1),[i,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,h]=y.useState(1),[b]=y.useState(20),[f,x]=y.useState(0),[_,v]=y.useState(1),w=io(u,500),j=y.useCallback(async E=>{const T=new AbortController,O=E===1;try{O?s(!0):l(!0),n("");const L=await ue.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),A=Number(L.headers?.["x-wp-total"]??0),I=Number(L.headers?.["x-wp-totalpages"]??1),z=Math.max(1,I||1);t($=>{if(O)return L.data;const R=new Set($.map(P=>P.id)),U=L.data.filter(P=>!R.has(P.id));return[...$,...U]}),x(A),v(z),E>z&&h(z)}catch(L){if(T.signal.aborted)return;L instanceof Error?n(L.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(O?s(!1):l(!1))}},[b,w]),C=y.useCallback(()=>{h(E=>o||i||E>=_?E:E+1)},[o,i,_]),N=y.useCallback(async()=>{if(m!==1){h(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{d(!0),await ue.delete(`group/${E}`),await N(),G.success("Group deleted successfully!")}catch(T){T instanceof Error?G.error(T.message):G.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:i,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:_,hasMore:m<=_,loadMore:C,refreshGroups:N,deleteGroup:k}},I0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:s,isDeleting:i,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=L0(),m=y.useRef(null),h=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[x]=f;x.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:"All Widgets",Icon:Vp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}`,text:"Add Reel",Icon:gt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:h,onReject:()=>t(null),isLoading:i}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(re,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(es,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${K.mg}`,text:"Create Widget",Icon:gt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Kl,{}):n?a.jsx(Fl,{}):a.jsxs(a.Fragment,{children:[a.jsx(R0,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:s?a.jsx($f,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},z0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,s]=y.useState(!1),[i,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,h)=>{t(!0),n(b=>({...b,[m]:h}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),h=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(h)){G.error("Please enter valid numbers.");return}try{l(!0),d(!1),await ue.post("settings",{rate_limit:m,time_limit:h}),G.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{s(!0),d(!1);const b=await ue.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||s(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:i,isError:c,handleOnChange:u,handleSave:p}},M0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:s,handleSave:i}=z0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(vt,{left:[a.jsx(_t,{name:"Settings",Icon:xp},"Settings"),a.jsx(Xt,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(lo,{onSave:i,isSaving:n,disabled:!t},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>s("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>s("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},D0=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],F0=({tableData:e})=>a.jsxs(Hl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Gl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(Vl,{children:a.jsx(jn,{children:D0.map((t,r)=>a.jsx(ql,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Wl,{children:e.map((t,r)=>a.jsxs(jn,{className:D("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),$0=()=>{const[e]=Vt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[s,i]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const h=await ue.get(`/group/${t}/stats`);o(h.data.stories),i(h.data.buttons)}catch(h){h instanceof Error?G.error(h.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,h)=>m+=h.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:"Statistics",Icon:ls},"Statistics"),a.jsx(Xt,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Kl,{}):d?a.jsx(Fl,{}):s.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(F0,{tableData:s})})]})]})};function B0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function U0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const H0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:D("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(B0,{size:24})}),V0=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Yl=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:D("ecr-input",e),...r}));Yl.displayName="Input";const lr=({label:e,min:t,max:r,value:n,onChange:o,name:s,id:i,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},h=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:i,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:i,name:s,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Yl,{type:"number",min:t,max:r,value:d,onChange:b=>h(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(null,arguments)}function De(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var zt=255,Xe=100,cr=e=>{var{r:t,g:r,b:n,a:o}=e,s=Math.max(t,r,n),i=s-Math.min(t,r,n),l=i?s===t?(r-n)/i:s===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(l<0?l+6:l),s:s?i/s*Xe:0,v:s/zt*Xe,a:o}},Xl=e=>{var{h:t,s:r,l:n,a:o}=Jl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Jl=e=>{var{h:t,s:r,v:n,a:o}=e,s=(200-r)*n/Xe;return{h:t,s:s>0&&s<200?r*n/Xe/(s<=Xe?s:200-s)*Xe:0,l:s/2,a:o}},Zl=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(s=>new Array(7-s.length).join("0")+s)(o.toString(16))},W0=e=>{var{r:t,g:r,b:n,a:o}=e,s=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Zl({r:t,g:r,b:n})+(s||"")},dr=e=>cr(q0(e)),q0=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,s=0,i]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:s,a:(i??255)/zt}},Sn=e=>{var{h:t,s:r,v:n,a:o}=e,s=t/60,i=r/Xe,l=n/Xe,c=Math.floor(s)%6,d=s-Math.floor(s),u=zt*l*(1-i),p=zt*l*(1-i*d),m=zt*l*(1-i*(1-d));l*=zt;var h={};switch(c){case 0:h.r=l,h.g=m,h.b=u;break;case 1:h.r=p,h.g=l,h.b=u;break;case 2:h.r=u,h.g=l,h.b=m;break;case 3:h.r=u,h.g=p,h.b=l;break;case 4:h.r=m,h.g=u,h.b=l;break;case 5:h.r=l,h.g=u,h.b=p;break}return h.r=Math.round(h.r),h.g=Math.round(h.g),h.b=Math.round(h.b),M({},h,{a:o})},G0=e=>{var{r:t,g:r,b:n,a:o}=Sn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},K0=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},Y0=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Yo=e=>Zl(Sn(e)),X0=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},J0=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},s=o(t/255),i=o(r/255),l=o(n/255),c={};return c.x=s*.4124+i*.3576+l*.1805,c.y=s*.2126+i*.7152+l*.0722,c.bri=s*.0193+i*.1192+l*.9505,c},Mt=e=>{var t,r,n,o,s,i,l,c,d;return typeof e=="string"&&Xo(e)?(i=dr(e),c=e):typeof e!="string"&&(i=e),i&&(n=X0(i),s=Jl(i),o=Sn(i),d=W0(o),c=Yo(i),r=Y0(s),t=K0(o),l=J0(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:s,hsva:i,hex:c,hexa:d,xy:l}},Xo=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function Ql(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var ur=e=>"touches"in e,ec=e=>{!ur(e)&&e.preventDefault&&e.preventDefault()},tc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},rc=(e,t)=>{var r=e.getBoundingClientRect(),n=ur(t)?t.touches[0]:t;return{left:tc((n.pageX-(r.left+window.pageXOffset))/r.width),top:tc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},Z0=["prefixCls","className","onMove","onDown"],Jo=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:s}=e,i=De(e,Z0),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=Ql(o),m=Ql(s),h=v=>c.current&&!ur(v)?!1:(c.current=ur(v),!0),b=y.useCallback(v=>{if(ec(v),!!l.current){var w=ur(v)?v.touches.length>0:v.buttons>0;if(!w){u(!1);return}p?.(rc(l.current,v),v)}},[p]),f=y.useCallback(()=>u(!1),[]),x=y.useCallback(v=>{v?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(x(d),()=>{x(!1)}),[d,b,f,x]);var _=y.useCallback(v=>{var w=document.activeElement;w?.blur(),ec(v.nativeEvent),h(v.nativeEvent)&&l.current&&(m?.(rc(l.current,v.nativeEvent),v.nativeEvent),u(!0))},[m]);return a.jsx("div",M({},i,{className:[r,n||""].filter(Boolean).join(" "),style:M({},i.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:_,onTouchStart:_}))});Jo.displayName="Interactive";var Q0=e=>{var{className:t,color:r,left:n,top:o,prefixCls:s}=e,i={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:s+"-pointer "+(t||""),style:i,children:a.jsx("div",{className:s+"-fill",style:l})}),[o,n,r,t,s])},eb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],nc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:s,className:i,hue:l=0,style:c,hsva:d,onChange:u}=e,p=De(e,eb),m=M({width:200,height:200,borderRadius:o},c,{position:"relative"}),h=(_,v)=>{u&&d&&u({h:d.h,s:_.left*100,v:(1-_.top)*100,a:d.a})},b=y.useCallback(_=>{if(!(!d||!u)){var v=1,w=d.s,j=d.v,C=!1;switch(_.key){case"ArrowLeft":w=Math.max(0,d.s-v),C=!0,_.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+v),C=!0,_.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+v),C=!0,_.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-v),C=!0,_.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var _={top:100-d.v+"%",left:d.s+"%",color:Xl(d)};return s&&typeof s=="function"?s(M({prefixCls:n},_)):a.jsx(Q0,M({prefixCls:n},_))},[d,s,n]),x=y.useCallback(_=>{_.target.focus()},[]);return a.jsx(Jo,M({className:[n,i||""].filter(Boolean).join(" ")},p,{style:M({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:h,onDown:h,onKeyDown:b,onClick:x,children:f}))});nc.displayName="Saturation";var tb=["className","prefixCls","left","top","style","fillProps"],rb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:s,fillProps:i}=e,l=De(e,tb),c=M({},s,{position:"absolute",left:n,top:o}),d=M({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},i?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",M({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",M({className:r+"-fill"},i,{style:d}))}))},nb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],ob="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Cn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:s,bgProps:i={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:h,onChange:b,pointer:f}=e,x=De(e,nb),_=T=>{b&&b(M({},o,{a:m==="horizontal"?T.left:T.top}),T)},v=Xl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+v+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=M({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+ob+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},h,{position:"relative"}),N=y.useCallback(T=>{var O=.01,L=o.a,A=L;switch(T.key){case"ArrowLeft":m==="horizontal"&&(A=Math.max(0,L-O),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(A=Math.min(1,L+O),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(A=Math.max(0,L-O),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(A=Math.min(1,L+O),T.preventDefault());break;default:return}if(A!==L){var I={left:m==="horizontal"?A:o.a,top:m==="vertical"?A:o.a,width:0,height:0,x:0,y:0};b&&b(M({},o,{a:A}),I)}},[o,m,b]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(M({prefixCls:r},c,j)):a.jsx(rb,M({},c,{prefixCls:r},j));return a.jsxs("div",M({},x,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",M({},i,{style:M({inset:0,position:"absolute",background:s||w,borderRadius:d},i.style)})),a.jsx(Jo,M({},l,{style:M({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:_,onDown:_,onClick:k,onKeyDown:N,children:E}))]}))});Cn.displayName="Alpha";var ab=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],sb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),ib=e=>Number(String(e).replace(/%/g,"")),Dt=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:s,className:i,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,h=De(e,ab),[b,f]=y.useState(s),x=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(x.current||f(e.value))},[e.value]);function _(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");sb(T)&&u&&u(k,T);var O=ib(T);isNaN(O)||u&&u(k,O),f(T)}function v(k){x.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=M({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=M({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=M({value:b,onChange:_,onBlur:v,autoComplete:"off",onFocus:()=>x.current=!0},h,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,i||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",M({ref:t},N)),o&&a.jsx("span",{style:M({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});Dt.displayName="EditableInput";var lb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],oc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:s={},gProps:i={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=De(e,lb),h=n?Sn(n):{};function b(v){var w=Number(v.target.value);w&&w>255&&(v.target.value="255"),w&&w<0&&(v.target.value="0")}var f=v=>{var w=Number(v.target.value);w&&w>100&&(v.target.value="100"),w&&w<0&&(v.target.value="0")},x=(v,w,j)=>{typeof v=="number"&&(w==="a"&&(v<0&&(v=0),v>100&&(v=100),p&&p(Mt(cr(M({},h,{a:v/100}))))),v>255&&(v=255,j.target.value="255"),v<0&&(v=0,j.target.value="0"),w==="r"&&p&&p(Mt(cr(M({},h,{r:v})))),w==="g"&&p&&p(Mt(cr(M({},h,{g:v})))),w==="b"&&p&&p(Mt(cr(M({},h,{b:v})))))},_=h.a?Math.round(h.a*100)/100:0;return a.jsxs("div",M({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:M({fontSize:11,display:"flex"},u),children:[a.jsx(Dt,M({label:"R",value:h.r||0,onBlur:b,placement:o,onChange:(v,w)=>x(w,"r",v)},s,{style:M({},s.style)})),a.jsx(Dt,M({label:"G",value:h.g||0,onBlur:b,placement:o,onChange:(v,w)=>x(w,"g",v)},i,{style:M({marginLeft:5},s.style)})),a.jsx(Dt,M({label:"B",value:h.b||0,onBlur:b,placement:o,onChange:(v,w)=>x(w,"b",v)},l,{style:M({marginLeft:5},l.style)})),c&&a.jsx(Dt,M({label:"A",value:parseInt(String(_*100),10),onBlur:f,placement:o,onChange:(v,w)=>x(w,"a",v)},c,{style:M({marginLeft:5},c.style)}))]}))});oc.displayName="EditableInputRGBA";var cb=["prefixCls","className","hue","onChange","direction"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:s,direction:i="horizontal"}=e,l=De(e,cb);return a.jsx(Cn,M({ref:t,className:r+" "+(n||"")},l,{direction:i,background:"linear-gradient(to "+(i==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{s&&s({h:i==="horizontal"?360*d.left:360*d.top})}}))});ac.displayName="Hue";var db=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:s=[],style:i,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=De(e,db),h=M({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,x)=>{c&&c(dr(f),Mt(dr(f)),x)};return a.jsxs("div",M({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:M({display:"flex",flexWrap:"wrap",position:"relative"},i),children:[u&&y.isValidElement(u)&&u,s&&Array.isArray(s)&&s.map((f,x)=>{var _="",v="";typeof f=="string"&&(_=f,v=f),typeof f=="object"&&f.color&&(_=f.title||f.color,v=f.color);var w=o&&o.toLocaleLowerCase()===v.toLocaleLowerCase(),j=p&&p({title:_,color:v,checked:!!w,style:M({},h,{background:v}),onClick:N=>b(v,N)});if(j)return a.jsx(y.Fragment,{children:j},x);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:v,checked:w}):null;return a.jsx("div",M({tabIndex:0,title:_,onClick:N=>b(v,N)},l,{children:C,style:M({},h,{background:v})}),x)}),d&&y.isValidElement(d)&&d]}))});sc.displayName="Swatch";var ub=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],pb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],ic=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),lc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:s=218,presetColors:i=pb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=De(e,ub),[m,h]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&Xo(l)&&h(dr(l)),typeof l=="object"&&h(l)},[l]);var b=N=>{h(N),o&&o(Mt(N))},f=(N,k)=>{typeof N=="string"&&Xo(N)&&/(3|6)/.test(String(N.length))&&b(dr(N))},x=N=>b(M({},m,{a:N.a})),_=N=>b(M({},m,N,{a:m.a})),v=M({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:s},u),w={borderRadius:2,background:G0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",M({},p,{className:r+" "+(n||""),ref:t,style:v,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(nc,{hsva:m,style:{width:"auto",height:150},onChange:_}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ac,{width:"auto",height:10,hue:m.h,pointer:ic,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(M({},m,N))}),!d&&a.jsx(Cn,{width:"auto",height:10,hsva:m,pointer:ic,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:x})]}),!d&&a.jsx(Cn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Dt,{label:"Hex",value:Yo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(oc,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),i&&i.length>0&&a.jsx(sc,{style:j,colors:i,color:Yo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});lc.displayName="Sketch";const cc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Rt,{children:[a.jsx(Lt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(It,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(lc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),mb=[{value:"left",title:"Align Left",Icon:Lp},{value:"center",title:"Align Center",Icon:Ip},{value:"right",title:"Align Right",Icon:zp},{value:"hidden",title:"Hidden",Icon:Mp}],fb=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:mb.map(({value:r,title:n,Icon:o})=>a.jsx(re,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),hb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(s=>{const i=o(s);return r(!0),i})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(fb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,alignment:o}}))}),a.jsx(cc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(lr,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},gb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(s=>{Ul(s),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},xb=({gid:e})=>{const[t,r]=gb(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Mf,{color:"#ffffff",size:12})}),a.jsx("span",{className:D("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},dc=y.createContext({requestLeave:e=>e()}),bb=({value:e,children:t})=>a.jsx(dc.Provider,{value:e,children:t}),uc=()=>y.useContext(dc);function vb(e){return H({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const _b=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(yb,{link:e,usedFor:t})}),yb=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||yn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||yn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx(vb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),wb=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},kn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(_b,{link:e,usedFor:t},e.btn_uuid):a.jsx(wb,{link:e,usedFor:t},e.btn_uuid)}),pc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const s=Se(),{requestLeave:i}=uc(),l=n===e.story_uuid,c=`?view=${K.cr}&from=${K.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={width:`${t?.size}px`,border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:D("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Yn,{story:e,styles:t}),d==="overlay"&&t.shape==="rectangle"&&p&&a.jsx(kn,{link:p,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}),a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(re,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(ht,{to:c,className:D("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:m=>{m.preventDefault(),i(()=>s(c))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(re,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(tt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(cs,{size:18})})]})]}),d==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel__title",children:e.title}):null]})},mc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[s,i]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),h=()=>{const f=r.current;if(!f)return;const x=f.scrollLeft,_=f.scrollWidth,v=f.clientWidth;c(x>0),u(x+v<_-1)};y.useEffect(()=>{const f=r.current,x=n.current;f&&x&&(i(x.scrollWidth>f.clientWidth),m(f.clientWidth-100),h())},[e,t]);const b=f=>{const x=r.current;x&&(x.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(h,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let x=!1,_,v;const w=O=>{x=!0,_=O.pageX-f.offsetLeft,v=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{x=!1,f.style.cursor="default"},C=()=>{x=!1,f.style.cursor="default"},N=O=>{if(!x)return;O.preventDefault();const A=(O.pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-A,h()},k=O=>{x=!0,_=O.touches[0].pageX-f.offsetLeft,v=f.scrollLeft},E=()=>{x=!1},T=O=>{if(!x)return;const A=(O.touches[0].pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-A,h()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:s,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},fc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=mc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:s,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:i,style:{...!e.length&&{margin:"auto"},gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:D("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(pc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(nt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Gt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Kt,{size:20})})]})},jb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const s={columnGap:`${t?.gap}px`};return a.jsx("div",{style:s,className:D("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(pc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(nt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})},hc=({title:e})=>a.jsx("p",{className:"ecr-reel_title",children:e}),Sb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,s]=y.useState(!1),[i,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=i)},[i]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&s(f=>!f)},m=()=>{u.current&&l(f=>!f)},h=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(xt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Gt,{size:24})}),a.jsx(xt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Kt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:i,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const x=f.currentTarget,_=x.videoWidth,v=x.videoHeight;d(()=>v>_)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:p}),i?a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),h==="overlay"&&b?a.jsx(kn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,h==="title"?a.jsx(hc,{title:e.title}):null]})})},Cb={carousel:fc,grid:jb},kb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:s})=>{const i=r.template??"carousel",l=Cb[i]||fc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(xb,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:s==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Sb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(nt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Nb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:s,togglingId:i,lastStoryElementRef:l})=>{const c=Se(),{requestLeave:d}=uc(),u=`?view=${K.cr}&from=${K.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Rr,{to:u,text:"Add Reel",Icon:gt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:s&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,h)=>a.jsx("div",{ref:p.length===h+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:i==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),i==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(tt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),s&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=He(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=f=>{const{scope:x,children:_}=f,v=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:w,collectionRef:v,children:_})};i.displayName=t;const l=e+"CollectionSlot",c=rt(l),d=y.forwardRef((f,x)=>{const{scope:_,children:v}=f,w=s(l,_),j=Y(x,w.collectionRef);return a.jsx(c,{ref:j,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(u),h=y.forwardRef((f,x)=>{const{scope:_,children:v,...w}=f,j=y.useRef(null),C=Y(x,j),N=s(u,_);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:v})});h.displayName=u;function b(f){const x=s(e+"CollectionConsumer",f);return y.useCallback(()=>{const v=x.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},b,n]}var Eb=g.createContext(void 0);function Zo(e){const t=g.useContext(Eb);return e||t||"ltr"}var Qo="rovingFocusGroup.onEntryFocus",Tb={bubbles:!1,cancelable:!0},pr="RovingFocusGroup",[ea,bc,Ab]=xc(pr),[Pb,vc]=He(pr,[Ab]),[Ob,Rb]=Pb(pr),_c=g.forwardRef((e,t)=>a.jsx(ea.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(ea.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Lb,{...e,ref:t})})}));_c.displayName=pr;var Lb=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=g.useRef(null),h=Y(t,m),b=Zo(s),[f,x]=lt({prop:i,defaultProp:l??null,onChange:c,caller:pr}),[_,v]=g.useState(!1),w=Ve(d),j=bc(r),C=g.useRef(!1),[N,k]=g.useState(0);return g.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(Qo,w),()=>E.removeEventListener(Qo,w)},[w]),a.jsx(Ob,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:g.useCallback(E=>x(E),[x]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:g.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!_){const O=new CustomEvent(Qo,Tb);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const L=j().filter(R=>R.focusable),A=L.find(R=>R.active),I=L.find(R=>R.id===f),$=[A,I,...L].filter(Boolean).map(R=>R.ref.current);jc($,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>v(!1))})})}),yc="RovingFocusGroupItem",wc=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...l}=e,c=Ne(),d=s||c,u=Rb(yc,r),p=u.currentTabStopId===d,m=bc(r),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:f}=u;return g.useEffect(()=>{if(n)return h(),()=>b()},[n,h,b]),a.jsx(ea.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,x=>{n?u.onItemFocus(d):x.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=Mb(x,u.orientation,u.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")w.reverse();else if(_==="prev"||_==="next"){_==="prev"&&w.reverse();const j=w.indexOf(x.currentTarget);w=u.loop?Db(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:f!=null}):i})})});wc.displayName=yc;var Ib={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Mb(e,t,r){const n=zb(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Ib[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Db(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Fb=_c,$b=wc,Nn="Tabs",[Bb]=He(Nn,[vc]),Sc=vc(),[Ub,ta]=Bb(Nn),Cc=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Zo(l),[p,m]=lt({prop:n,onChange:o,defaultProp:s??"",caller:Nn});return a.jsx(Ub,{scope:r,baseId:Ne(),value:p,onValueChange:m,orientation:i,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":i,...d,ref:t})})});Cc.displayName=Nn;var kc="TabsList",Nc=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=ta(kc,r),i=Sc(r);return a.jsx(Fb,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Nc.displayName=kc;var Ec="TabsTrigger",Tc=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,i=ta(Ec,r),l=Sc(r),c=Oc(i.baseId,n),d=Rc(i.baseId,n),u=n===i.value;return a.jsx($b,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=i.activationMode!=="manual";!u&&!o&&p&&i.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...i}=e,l=ta(Ac,r),c=Oc(l.baseId,n),d=Rc(l.baseId,n),u=n===l.value,p=g.useRef(u);return g.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ke,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&s})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var Hb=Cc,Vb=Nc,Wb=Tc,qb=Pc;function Gb({className:e,...t}){return a.jsx(Hb,{"data-slot":"tabs",className:D("ecr-tabs",e),...t})}function Kb({className:e,...t}){return a.jsx(Vb,{"data-slot":"tabs-list",className:D("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(Wb,{"data-slot":"tabs-trigger",className:D("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(qb,{"data-slot":"tabs-content",className:D("ecr-tabs__content",e),...t})}function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function Yb(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Xb="VisuallyHidden",Jb=g.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));Jb.displayName=Xb;var Zb=[" ","Enter","ArrowUp","ArrowDown"],Qb=[" ","Enter"],dt="Select",[En,Tn,ev]=xc(dt),[Ft]=He(dt,[ev,on]),An=on(),[tv,Je]=Ft(dt),[rv,nv]=Ft(dt),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:h,form:b}=e,f=An(t),[x,_]=g.useState(null),[v,w]=g.useState(null),[j,C]=g.useState(!1),N=Zo(d),[k,E]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:dt}),[T,O]=lt({prop:i,defaultProp:l,onChange:c,caller:dt}),L=g.useRef(null),A=x?b||!!x.closest("form"):!0,[I,z]=g.useState(new Set),$=Array.from(I).map(R=>R.props.value).join(";");return a.jsx(Wi,{...f,children:a.jsxs(tv,{required:h,scope:t,trigger:x,onTriggerChange:_,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ne(),value:T,onValueChange:O,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:L,disabled:m,children:[a.jsx(En.Provider,{scope:t,children:a.jsx(rv,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(R=>{z(U=>new Set(U).add(R))},[]),onNativeOptionRemove:g.useCallback(R=>{z(U=>{const P=new Set(U);return P.delete(R),P})},[]),children:r})}),A?a.jsxs(sd,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:R=>O(R.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(I)]},$):null]})})};Dc.displayName=dt;var Fc="SelectTrigger",$c=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=An(r),i=Je(Fc,r),l=i.disabled||n,c=Y(t,i.onTriggerChange),d=Tn(r),u=g.useRef("touch"),[p,m,h]=ld(f=>{const x=d().filter(w=>!w.disabled),_=x.find(w=>w.value===i.value),v=cd(x,f,_);v!==void 0&&i.onValueChange(v.value)}),b=f=>{l||(i.onOpenChange(!0),h()),f&&(i.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Po,{asChild:!0,...s,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":id(i.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const x=f.target;x.hasPointerCapture(f.pointerId)&&x.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const x=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(x&&f.key===" ")&&Zb.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:i="",...l}=e,c=Je(Bc,r),{onValueNodeHasChildrenChange:d}=c,u=s!==void 0,p=Y(t,c.onValueNodeChange);return se(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:id(c.value)?a.jsx(a.Fragment,{children:i}):s})});Uc.displayName=Bc;var ov="SelectIcon",Hc=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=ov;var av="SelectPortal",Vc=e=>a.jsx(an,{asChild:!0,...e});Vc.displayName=av;var ut="SelectContent",Wc=g.forwardRef((e,t)=>{const r=Je(ut,e.__scopeSelect),[n,o]=g.useState();if(se(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?vr.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(En.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=ut;var je=10,[qc,Ze]=Ft(ut),sv="SelectContentImpl",iv=rt("SelectContent.RemoveScroll"),Gc=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:b,hideWhenDetached:f,avoidCollisions:x,..._}=e,v=Je(ut,r),[w,j]=g.useState(null),[C,N]=g.useState(null),k=Y(t,F=>j(F)),[E,T]=g.useState(null),[O,L]=g.useState(null),A=Tn(r),[I,z]=g.useState(!1),$=g.useRef(!1);g.useEffect(()=>{if(w)return Ro(w)},[w]),ho();const R=g.useCallback(F=>{const[te,...le]=A().map(ne=>ne.ref.current),[J]=le.slice(-1),Q=document.activeElement;for(const ne of F)if(ne===Q||(ne?.scrollIntoView({block:"nearest"}),ne===te&&C&&(C.scrollTop=0),ne===J&&C&&(C.scrollTop=C.scrollHeight),ne?.focus(),document.activeElement!==Q))return},[A,C]),U=g.useCallback(()=>R([E,w]),[R,E,w]);g.useEffect(()=>{I&&U()},[I,U]);const{onOpenChange:P,triggerPointerDownPosRef:q}=v;g.useEffect(()=>{if(w){let F={x:0,y:0};const te=J=>{F={x:Math.abs(Math.round(J.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(J.pageY)-(q.current?.y??0))}},le=J=>{F.x<=10&&F.y<=10?J.preventDefault():w.contains(J.target)||P(!1),document.removeEventListener("pointermove",te),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",le,{capture:!0})}}},[w,P,q]),g.useEffect(()=>{const F=()=>P(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[P]);const[X,Z]=ld(F=>{const te=A().filter(Q=>!Q.disabled),le=te.find(Q=>Q.ref.current===document.activeElement),J=cd(te,F,le);J&&setTimeout(()=>J.ref.current.focus())}),pe=g.useCallback((F,te,le)=>{const J=!$.current&&!le;(v.value!==void 0&&v.value===te||J)&&(T(F),J&&($.current=!0))},[v.value]),Fe=g.useCallback(()=>w?.focus(),[w]),ge=g.useCallback((F,te,le)=>{const J=!$.current&&!le;(v.value!==void 0&&v.value===te||J)&&L(F)},[v.value]),$e=n==="popper"?ra:Kc,pt=$e===ra?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:b,hideWhenDetached:f,avoidCollisions:x}:{};return a.jsx(qc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:pe,selectedItem:E,onItemLeave:Fe,itemTextRefCallback:ge,focusSelectedItem:U,selectedItemText:O,position:n,isPositioned:I,searchRef:X,children:a.jsx(hn,{as:iv,allowPinchZoom:!0,children:a.jsx(Gr,{asChild:!0,trapped:v.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:V(o,F=>{v.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:a.jsx($e,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:F=>F.preventDefault(),..._,...pt,onPlaced:()=>z(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:V(_.onKeyDown,F=>{const te=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!te&&F.key.length===1&&Z(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let J=A().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(F.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const Q=F.target,ne=J.indexOf(Q);J=J.slice(ne+1)}setTimeout(()=>R(J)),F.preventDefault()}})})})})})})});Gc.displayName=sv;var lv="SelectItemAlignedPosition",Kc=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=Je(ut,r),i=Ze(ut,r),[l,c]=g.useState(null),[d,u]=g.useState(null),p=Y(t,k=>u(k)),m=Tn(r),h=g.useRef(!1),b=g.useRef(!0),{viewport:f,selectedItem:x,selectedItemText:_,focusSelectedItem:v}=i,w=g.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&d&&f&&x&&_){const k=s.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),O=_.getBoundingClientRect();if(s.dir!=="rtl"){const Q=O.left-E.left,ne=T.left-Q,xe=k.left-ne,mt=k.width+xe,ma=Math.max(mt,E.width),fa=window.innerWidth-je,ha=zc(ne,[je,Math.max(je,fa-ma)]);l.style.minWidth=mt+"px",l.style.left=ha+"px"}else{const Q=E.right-O.right,ne=window.innerWidth-T.right-Q,xe=window.innerWidth-k.right-ne,mt=k.width+xe,ma=Math.max(mt,E.width),fa=window.innerWidth-je,ha=zc(ne,[je,Math.max(je,fa-ma)]);l.style.minWidth=mt+"px",l.style.right=ha+"px"}const L=m(),A=window.innerHeight-je*2,I=f.scrollHeight,z=window.getComputedStyle(d),$=parseInt(z.borderTopWidth,10),R=parseInt(z.paddingTop,10),U=parseInt(z.borderBottomWidth,10),P=parseInt(z.paddingBottom,10),q=$+R+I+P+U,X=Math.min(x.offsetHeight*5,q),Z=window.getComputedStyle(f),pe=parseInt(Z.paddingTop,10),Fe=parseInt(Z.paddingBottom,10),ge=k.top+k.height/2-je,$e=A-ge,pt=x.offsetHeight/2,F=x.offsetTop+pt,te=$+R+F,le=q-te;if(te<=ge){const Q=L.length>0&&x===L[L.length-1].ref.current;l.style.bottom="0px";const ne=d.clientHeight-f.offsetTop-f.offsetHeight,xe=Math.max($e,pt+(Q?Fe:0)+ne+U),mt=te+xe;l.style.height=mt+"px"}else{const Q=L.length>0&&x===L[0].ref.current;l.style.top="0px";const xe=Math.max(ge,$+f.offsetTop+(Q?pe:0)+pt)+le;l.style.height=xe+"px",f.scrollTop=te-ge+f.offsetTop}l.style.margin=`${je}px 0`,l.style.minHeight=X+"px",l.style.maxHeight=A+"px",n?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,l,d,f,x,_,s.dir,n]);se(()=>w(),[w]);const[j,C]=g.useState();se(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=g.useCallback(k=>{k&&b.current===!0&&(w(),v?.(),b.current=!1)},[w,v]);return a.jsx(dv,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=lv;var cv="SelectPopperPosition",ra=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=je,...s}=e,i=An(r);return a.jsx(qi,{...i,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ra.displayName=cv;var[dv,na]=Ft(ut,{}),oa="SelectViewport",Yc=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=Ze(oa,r),i=na(oa,r),l=Y(t,s.onViewportChange),c=g.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(En.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=i;if(m?.current&&p){const h=Math.abs(c.current-u.scrollTop);if(h>0){const b=window.innerHeight-je*2,f=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),_=Math.max(f,x);if(_<b){const v=_+h,w=Math.min(b,v),j=v-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Yc.displayName=oa;var Xc="SelectGroup",[uv,pv]=Ft(Xc),mv=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ne();return a.jsx(uv,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});mv.displayName=Xc;var Jc="SelectLabel",fv=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=pv(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});fv.displayName=Jc;var Pn="SelectItem",[hv,Zc]=Ft(Pn),Qc=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...i}=e,l=Je(Pn,r),c=Ze(Pn,r),d=l.value===n,[u,p]=g.useState(s??""),[m,h]=g.useState(!1),b=Y(t,v=>c.itemRefCallback?.(v,n,o)),f=Ne(),x=g.useRef("touch"),_=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(hv,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:g.useCallback(v=>{p(w=>w||(v?.textContent??"").trim())},[]),children:a.jsx(En.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:b,onFocus:V(i.onFocus,()=>h(!0)),onBlur:V(i.onBlur,()=>h(!1)),onClick:V(i.onClick,()=>{x.current!=="mouse"&&_()}),onPointerUp:V(i.onPointerUp,()=>{x.current==="mouse"&&_()}),onPointerDown:V(i.onPointerDown,v=>{x.current=v.pointerType}),onPointerMove:V(i.onPointerMove,v=>{x.current=v.pointerType,o?c.onItemLeave?.():x.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(i.onPointerLeave,v=>{v.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(i.onKeyDown,v=>{c.searchRef?.current!==""&&v.key===" "||(Qb.includes(v.key)&&_(),v.key===" "&&v.preventDefault())})})})})});Qc.displayName=Pn;var mr="SelectItemText",ed=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,i=Je(mr,r),l=Ze(mr,r),c=Zc(mr,r),d=nv(mr,r),[u,p]=g.useState(null),m=Y(t,_=>p(_),c.onItemTextChange,_=>l.itemTextRefCallback?.(_,c.value,c.disabled)),h=u?.textContent,b=g.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:f,onNativeOptionRemove:x}=d;return se(()=>(f(b),()=>x(b)),[f,x,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...s,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?vr.createPortal(s.children,i.valueNode):null]})});ed.displayName=mr;var td="SelectItemIndicator",rd=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var aa="SelectScrollUpButton",nd=g.forwardRef((e,t)=>{const r=Ze(aa,e.__scopeSelect),n=na(aa,e.__scopeSelect),[o,s]=g.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;s(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});nd.displayName=aa;var sa="SelectScrollDownButton",od=g.forwardRef((e,t)=>{const r=Ze(sa,e.__scopeSelect),n=na(sa,e.__scopeSelect),[o,s]=g.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;s(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});od.displayName=sa;var ad=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=Ze("SelectScrollButton",r),i=g.useRef(null),l=Tn(r),c=g.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),se(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),gv="SelectSeparator",xv=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});xv.displayName=gv;var ia="SelectArrow",bv=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=An(r),s=Je(ia,r),i=Ze(ia,r);return s.open&&i.position==="popper"?a.jsx(Gi,{...o,...n,ref:t}):null});bv.displayName=ia;var vv="SelectBubbleInput",sd=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=g.useRef(null),s=Y(n,o),i=Yb(t);return g.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[i,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:s,defaultValue:t})});sd.displayName=vv;function id(e){return e===""||e===void 0}function ld(e){const t=Ve(e),r=g.useRef(""),n=g.useRef(0),o=g.useCallback(i=>{const l=r.current+i;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),s=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=_v(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==r));const c=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function _v(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var yv=Dc,wv=$c,jv=Uc,Sv=Hc,Cv=Vc,kv=Wc,Nv=Yc,Ev=Qc,Tv=ed,Av=rd,Pv=nd,Ov=od;function fr({...e}){return a.jsx(yv,{"data-slot":"select",...e})}function hr({...e}){return a.jsx(jv,{"data-slot":"select-value",...e})}function gr({className:e,size:t="default",children:r,...n}){return a.jsxs(wv,{"data-slot":"select-trigger","data-size":t,className:D("ecr-select__trigger",e),...n,children:[r,a.jsx(Sv,{asChild:!0,children:a.jsx(po,{className:"ecr-select__icon"})})]})}function xr({className:e,children:t,position:r="popper",align:n="center",...o}){const s=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Cv,{container:s,children:a.jsxs(kv,{"data-slot":"select-content",className:D("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(Rv,{}),a.jsx(Nv,{className:D("ecr-select__viewport"),children:t}),a.jsx(Lv,{})]})})}function br({className:e,children:t,...r}){return a.jsxs(Ev,{"data-slot":"select-item",className:D("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(Av,{children:a.jsx(If,{className:"ecr-select__check-icon"})})}),a.jsx(Tv,{children:t})]})}function Rv({className:e,...t}){return a.jsx(Pv,{"data-slot":"select-scroll-up-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(zf,{className:"ecr-select__icon"})})}function Lv({className:e,...t}){return a.jsx(Ov,{"data-slot":"select-scroll-down-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(po,{className:"ecr-select__icon"})})}const Iv=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:qu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),zv={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function Mv(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(fr,{defaultValue:Ya[0].value,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Ya.map(e=>a.jsx(br,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Vu.map(e=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(qt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(ir,{name:e.label,text:zv[e.value]})})]})},e.value))]})]})]})}const Dv=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Mv,{}),a.jsx(Iv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var On="Collapsible",[Fv]=He(On),[$v,la]=Fv(On),dd=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:s,onOpenChange:i,...l}=e,[c,d]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:On});return a.jsx($v,{scope:r,disabled:s,contentId:Ne(),open:c,onOpenToggle:g.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":da(c),"data-disabled":s?"":void 0,...l,ref:t})})});dd.displayName=On;var ud="CollapsibleTrigger",pd=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=la(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":da(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ca="CollapsibleContent",md=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=la(ca,e.__scopeCollapsible);return a.jsx(Ke,{present:r||o.open,children:({present:s})=>a.jsx(Bv,{...n,ref:t,present:s})})});md.displayName=ca;var Bv=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...s}=e,i=la(ca,r),[l,c]=g.useState(n),d=g.useRef(null),u=Y(t,d),p=g.useRef(0),m=p.current,h=g.useRef(0),b=h.current,f=i.open||l,x=g.useRef(f),_=g.useRef(void 0);return g.useEffect(()=>{const v=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(v)},[]),se(()=>{const v=d.current;if(v){_.current=_.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();p.current=w.height,h.current=w.width,x.current||(v.style.transitionDuration=_.current.transitionDuration,v.style.animationName=_.current.animationName),c(n)}},[i.open,n]),a.jsx(W.div,{"data-state":da(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!f,...s,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function da(e){return e?"open":"closed"}var Uv=dd,Hv=pd,Vv=md;function fd({className:e,...t}){return a.jsx(Uv,{"data-slot":"collapsible",className:D("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(Hv,{"data-slot":"collapsible-trigger",className:D("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(po,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(Vv,{"data-slot":"collapsible-content",className:D("ecr-collapsible__content",e),...t})}const ua=({label:e,text:t})=>a.jsxs(Rt,{children:[a.jsx(Lt,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(qt,{size:20})]}),a.jsx(U0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(It,{className:"ecr-admin-popover",children:a.jsx(ir,{name:e,text:t})})]}),Wv=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Wu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),qv=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Hu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Gv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],Kv=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:Gv.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx($p,{color:"#2563eb",size:16}):a.jsx(Bp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},Yv=Object.values(Ka),Xv={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},Jv=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Yv.map(r=>a.jsx(br,{value:r,className:"ecr-admin-control__option",children:r},r)),Uu.map(r=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(qt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(ir,{name:r,text:Xv[r]})})]})},r))]})]})]}),Zv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",s=r==="style",i=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsxs(fd,{open:o,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>i("layout"),children:[a.jsx(Df,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Kv,{selectedShape:e?.shape,handleShape:l=>t(c=>({...c,shape:l}))}),a.jsx(Jv,{selectedLayout:e?.template??"carousel",handleLayout:l=>t(c=>({...c,template:l}))}),a.jsx(Wv,{linkLayout:e?.appearance??"overlay",handleLinkLayout:l=>t(c=>({...c,appearance:l}))}),a.jsx(lr,{label:"Size",min:150,max:400,value:e?.size??150,onChange:l=>t(c=>({...c,size:l})),name:"size",id:"size"}),a.jsx(lr,{label:"Gap",min:0,max:80,value:e?.gap??0,onChange:l=>t(c=>({...c,gap:l})),name:"column_gap",id:"column-gap"}),a.jsx(ua,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(ua,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(ua,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),a.jsxs(fd,{open:s,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>i("style"),children:[a.jsx(Bf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(lr,{label:"Border Width",min:0,max:12,value:e?.border?.border_width??0,onChange:l=>t(c=>({...c,border:{...c.border,border_width:l}})),name:"border_width",id:"border-width"}),a.jsx(cc,{selectedColor:e?.border?.border_color,handleColor:l=>t(c=>({...c,border:{...c.border,border_color:l}})),text:"Border Color"}),e?.shape==="rectangle"&&a.jsx(lr,{label:"Border Radius",min:0,max:99,value:e?.border?.border_radius??0,onChange:l=>t(c=>({...c,border:{...c.border,border_radius:l}})),name:"border_radius",id:"border-radius"}),a.jsx(qv,{hoverEffect:e?.hoverEffect||"none",handleHoverEffect:l=>t(c=>({...c,hoverEffect:l}))})]})]})]})},Qv=({styles:e,setStyles:t,isExpanded:r,setIsEdited:n,tabs:o,currentTab:s,setCurrentTab:i})=>{const l=d=>{t(u=>{const p=d(u);return n(!0),p})},c=d=>{(d===o.thumbnail||d===o.preview)&&i(d)};return a.jsxs("div",{className:D("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(Gb,{value:s,onValueChange:c,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(Kb,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:o.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:o.preview,children:"Preview"})]}),a.jsx(Ic,{value:o.thumbnail,children:a.jsx(Zv,{styles:e,updateStyles:l})}),a.jsx(Ic,{value:o.preview,children:a.jsx(Dv,{styles:e,updateStyles:l})})]})})]})},e_=e=>{const t=Se(),[r,n]=y.useState(""),[o,s]=y.useState([]),[i,l]=y.useState(et),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,h]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const v=(await ue.get(`stories/${e}`)).data;n(v.group_name),s(v.stories),l(v.styles??et)}catch(_){_ instanceof Error?G.error(_.message):G.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async x=>{const _=o.map(j=>j.id),v={group_name:r,styles:i,story_ids:_};e&&(v.group_id=e);const w=await ue.post("stories/manage-group-stories",v);if(!e){const j=w.data.group_id;t(`?view=${K.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:s,styles:i,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:h,handleSave:async()=>{try{p(!0);const x=await b();return h(!1),G.success("Changes saved successfully!"),x}catch(x){return x instanceof Error?G.error(x.message):G.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},t_=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),s=y.useRef(!1),i=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){i.current=m;return}if(s.current){s.current=!1,i.current=m;return}m!==i.current&&(o.current=m,window.location.hash=i.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,s.current=!0,p();return}if(o.current){const p=o.current;o.current=null,s.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{s.current=!0,p()}}},xd={thumbnail:"thumbnail",preview:"preview"},r_=()=>{const e=Se(),{state:t}=Ht(),[r]=Vt(),n=r.get("gid"),{groupTitle:o,setGroupTitle:s,thisGroupReels:i,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:h,handleSave:b}=e_(n),{allReels:f,setAllReels:x,searchTerm:_,setSearchTerm:v,isSearching:w,lastStoryElementRef:j}=Xs(n),[C,N]=y.useState(""),[k,E]=y.useState(!0),[T,O]=y.useState(xd.thumbnail),{showLeaveModal:L,requestLeave:A,confirmLeave:I,cancelLeave:z,allowNextNavigation:$}=t_(m),R=async(P,q)=>{try{N(P.story_uuid);const X=q==="add"?[P,...i]:i.filter(Z=>Z.story_uuid!==P.story_uuid);l(X),x(q==="add"?Z=>Z.filter(pe=>pe.story_uuid!==P.story_uuid):Z=>[...Z,P]),h(!0)}catch(X){X instanceof Error?G.error(X.message):G.error("Something went wrong. Please try again later!")}finally{N("")}};y.useEffect(()=>{if(!u&&t){const P=f.findIndex(q=>q.id==t.storyId);if(P!==-1){const q=f[P];x(X=>X.filter(Z=>Z.id!=q.id)),l(X=>[q,...X]),h(!0)}}},[t,f,u,x,l,h]);const U=async()=>{const P=await b();P?.isNewGroup&&$(()=>{e(`?view=${K.mg}&gid=${P.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(bb,{value:{requestLeave:A},children:[a.jsx(vt,{left:[a.jsx(_t,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(Xt,{cb:()=>A(()=>e(`?view=${K.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Js,{placeholder:"Enter group title",title:o,setTitle:s,setIsEdited:h,style:{paddingInline:"32px"}}),o&&a.jsxs(Uo,{children:[a.jsx(Ho,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(V0,{})}),a.jsxs(Vo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Wo,{children:a.jsx(qo,{children:"Customize title appearance"})}),a.jsx(hb,{styles:c,setStyles:d,setIsEdited:h}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(x0,{asChild:!0,children:a.jsx(re,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(H0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(lo,{onSave:U,isSaving:p,disabled:!m},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Manage Widget"}],onNavigate:P=>A(()=>e(P))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Nb,{allReels:f,gid:n,handleSelectReel:R,searchTerm:_,setSearchTerm:v,isSearching:w,togglingId:C,lastStoryElementRef:j}),a.jsx(kb,{gid:n,reels:i,styles:c,handleRemoveReel:R,togglingId:C,currentTab:T}),a.jsx(Qv,{isExpanded:k,setIsEdited:h,styles:c,setStyles:d,tabs:xd,setCurrentTab:O,currentTab:T})]}),L&&a.jsx(Or,{onReject:z,onAccept:I,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function n_(){const[e]=Vt(),t=e.get("view")||K.ag;let r;switch(t){case K.settings:r=a.jsx(M0,{});break;case K.ar:r=a.jsx(jf,{});break;case K.stat:r=a.jsx($0,{});break;case K.cr:r=a.jsx(E0,{});break;case K.mg:r=a.jsx(r_,{});break;default:r=a.jsx(I0,{})}return a.jsxs("div",{children:[r,a.jsx(Bu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const bd=async(e,t,r,n={})=>{try{if(await ue.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},o_=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),a_=()=>{const e=y.useContext(pa),{stories:t,styles:r,groupId:n,isPlaying:o,setIsPlaying:s,setStoryViews:i}=e,[l,c]=y.useState(null),[d,u]=y.useState(!0),[p,m]=y.useState(0),[h,b]=y.useState(!1),f=y.useRef(!0),x=t.length-1,[_,v]=y.useState({index:0,story_uuid:t[0]?.story_uuid}),w=A=>!!A?.files?.[0]?.mime_type?.startsWith("video"),j=y.useCallback((A,I=1)=>{if(t.length===0)return null;let z=A;for(let $=0;$<t.length;$+=1){const R=t[z];if(w(R))return{story:R,index:z};z=(z+I+t.length)%t.length}return null},[t]),C=y.useCallback(()=>{const A=o,I=t.findIndex(R=>String(R.story_uuid)===A),z=I>=0?t[I]:null,$=w(z)?{story:z,index:I}:j(Math.max(I,0),1);$?.story?(c($.story),I!==$.index&&$.story.story_uuid!==o&&s($.story.story_uuid)):c(null),u(!1)},[o,t,s,j]);y.useEffect(()=>{C()},[o,t,C]),y.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const N=(A=1)=>{u(!0);const I=t.findIndex(P=>String(P.story_uuid)===String(o)),z=A>0?1:-1,$=A>0?x>I?I+1:0:I>0?I-1:x,R=j($,z);if(!R?.story){u(!1);return}const U=R.story;if(U.story_uuid===o){u(!1),s(null);return}v({index:0,story_uuid:U.story_uuid}),n&&bd(n,U.id,i,{isActive:()=>f.current}),s(U.story_uuid),u(!1)},k=()=>{const A=l?.files??[];_?.index>0?v(I=>({index:I.index-1,story_uuid:A[I.index-1].story_uuid})):N(-1)},E=()=>{const A=l?.files??[];_?.index+1<A.length?v(I=>({index:I.index+1,story_uuid:A[I.index+1].story_uuid})):(N(),A[0]?.story_uuid&&v({index:0,story_uuid:A[0].story_uuid}))},T=A=>{A.target===A.currentTarget&&s(null)},O=r?.playerAppearance??"overlay",L=l?.links&&l.links.length>0?l.links[0]:null;return a.jsx("div",{onClick:T,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:l&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(xt,{onClick:k,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}),a.jsx(xt,{onClick:E,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[l&&a.jsx(ns,{playingStory:l,duration:p,currentFileIndex:_,isPaused:h},`${l.story_uuid}-${_.index}`),a.jsx("div",{onClick:()=>s(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),d?a.jsx(o_,{}):l?.files.length>0&&a.jsx(is,{currentFileIndex:_,files:l?.files,setDuration:m,setIsPlaying:s,isPaused:h,setIsPaused:b,handlePrevFile:k,handleNextFile:E,storyId:l.id,storyTitle:l?.title}),O==="overlay"&&L?a.jsx(kn,{link:L,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,O==="title"?a.jsx(hc,{title:l.title}):null]})]})})},vd=({story:e,styles:t,handlePlaying:r,template:n,storyViews:o,setStoryViews:s})=>{const i=e.links&&e.links.length>0?e.links[0]:null,l=t.appearance??"overlay";return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,style:{width:n==="carousel"?`${t?.size}px`:"auto"},children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Yn,{story:e,styles:t,storyViews:o,setStoryViews:s}),l==="overlay"&&t.shape==="rectangle"&&i&&a.jsx(kn,{link:i,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}})]}),l==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-reel__title",children:e.title}):null]})},s_=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=mc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:s,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:i,style:{gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(vd,{story:m,styles:t,handlePlaying:r,template:"carousel",storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Gt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Kt,{size:20,style:{width:"20px",height:"20px"}})})]})},_d=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`,gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:"ecr-front-grid__list",children:e?.map(s=>s?.files[0]?.mime_type.startsWith("video")?a.jsx(vd,{story:s,styles:t,handlePlaying:r,template:"grid",storyViews:n,setStoryViews:o},s.story_uuid):null)})}),i_={carousel:s_,grid:_d},l_=()=>{const e=y.useContext(pa),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:s,storyViews:i,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=i_[d]||_d,p=({sid:m,story_uuid:h})=>{s(h),o&&bd(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:i,setStoryViews:l})]})},c_=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[s,i]=y.useState(et),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),i(et),c(!1),u(null);return}const h=new AbortController;c(!0),u(null);try{const b=await ue.get(`stories/${m}`,{signal:h.signal});if(h.signal.aborted)return;r(b.data.group_name),o(b.data.stories),i(b.data.styles||et)}catch(b){if(h.signal.aborted)return;u(b)}finally{c(!1)}return()=>{h.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:s,isLoading:l,error:d}},pa=y.createContext(void 0),yd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:s,stories:i,styles:l}=c_(e);return a.jsxs(pa.Provider,{value:{groupTitle:s,groupId:e,stories:i,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(a_,{}),a.jsx(l_,{})]})};ga(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Rn.createRoot(e).render(a.jsx(Xd,{children:a.jsx(n_,{})}))}),ga(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Rn.createRoot(n).render(a.jsx(yd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Rn.createRoot(n).render(a.jsx(yd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
  • ecomm-reels/tags/4.0.7/ecomm-reels.php

    r3449375 r3450956  
    33 * Plugin Name:       ReelsWp - Shoppable Videos & Vertical Reels Carousels
    44 * Description:       Create Insta style reels and stories with ReelsWP and add them anywhere on your WordPress site. Add fast, mobile friendly video grid and carousel layouts to your homepage, blog or news articles, and product pages.
    5  * Version:           4.0.6
     5 * Version:           4.0.7
    66 * Requires at least: 5.8
    77 * Requires PHP:      7.4
     
    2020define('ECOMMREELS_ASSETS', plugins_url('/', __FILE__));
    2121define('ECOMMREELS_FILE_PREFIX', 'class-');
    22 define('WP_REELS_VER', '4.0.6');
     22define('WP_REELS_VER', '4.0.7');
    2323
    2424// 1) Composer autoloader (optional, guarded)
  • ecomm-reels/tags/4.0.7/includes/domain/repositories/StoriesRepo.php

    r3444846 r3450956  
    198198
    199199        if (!empty($story['links']) && is_array($story['links'])) {
    200             $first_custom_link = null;
    201             foreach ($story['links'] as $link) {
    202                 if (isset($link['btn_type']) && $link['btn_type'] === 'custom') {
    203                     $first_custom_link = $link;
    204                     break;
    205                 }
    206             }
    207             $story['links'] = $first_custom_link ? [$first_custom_link] : [];
    208         }
    209 
     200            $first_link = reset($story['links']);
     201            $story['links'] = $first_link ? [$first_link] : [];
     202        }
    210203        return $story;
    211204    }
     
    268261    }
    269262}
    270 
  • ecomm-reels/tags/4.0.7/readme.txt

    r3449375 r3450956  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 4.0.6
     7Stable tag: 4.0.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    100100== Changelog ==
    101101
     102= 4.0.7 - 2026-01-31 =
     103- New: Added Product linking functionality to the reels.
     104
    102105= 4.0.6 - 2026-01-29 =
    103106- New: Added an "Only Title" option in the Preview Appearance control.
  • ecomm-reels/trunk/CHANGELOG.md

    r3449375 r3450956  
    11# Changelog
     2
     3## [4.0.7](https://github.com/dstudio-asia/reels-wp/compare/v4.0.6...v4.0.7) (2026-01-31)
     4
     5
     6### Features
     7
     8* **links:** add product tagging and unified link management ([2111b1d](https://github.com/dstudio-asia/reels-wp/commit/2111b1dd3a437232d26b4c91b3111416d6eb2e0b))
     9* **ui:** add product card component and link handling ([2af533d](https://github.com/dstudio-asia/reels-wp/commit/2af533d558415317ed97fdf63146afa95670000c))
     10
     11
     12### Bug Fixes
     13
     14* **player:** use ManageLinks and clamp reel title ([e951a06](https://github.com/dstudio-asia/reels-wp/commit/e951a0679e969f5e7cda3396bac55e85fd28bbb1))
     15* **ui:** improve range input styling and refactor input component ([cb8861c](https://github.com/dstudio-asia/reels-wp/commit/cb8861c5ce373a2fd30e3f8c15d26dc453966558))
     16* **ui:** scope button styles and add dialog close action ([e376136](https://github.com/dstudio-asia/reels-wp/commit/e376136f287921261c9db2151f62b4ae7b6ec6e9))
    217
    318## [4.0.6](https://github.com/dstudio-asia/reels-wp/compare/v4.0.5...v4.0.6) (2026-01-29)
  • ecomm-reels/trunk/admin/class-reel-admin.php

    r3444846 r3450956  
    135135                true
    136136            );
    137             // wp_enqueue_style(
    138             //     'ecommreels-ecomm-reels-build-styles',
    139             //     ECOMMREELS_ASSETS . 'build/index.css',
    140             //     [],
    141             //     WP_REELS_VER
    142             // );
    143         }
     137        }
     138        $localized_data = [
     139            'url' => esc_url_raw(rest_url()),
     140            'nonce' => wp_create_nonce('wp_rest'),
     141            'apiBase' => rest_url('wp-reels/v1/'),
     142            'createStoryNonce' => wp_create_nonce('ecommreels_action'),
     143            'currentStoryUrl' => home_url('/wp-admin/admin.php?page=my-reels&story='),
     144            'isProActive' => $is_pro_active,
     145            'isLicenseActive' => $is_pro_license_active,
     146            'license_page' => home_url() . '/wp-admin/admin.php?page=ecomm-reels-license'
     147        ];
     148
     149        if (class_exists('WooCommerce')) {
     150            $localized_data['store_api_nonce'] = wp_create_nonce('wc_store_api');
     151            $localized_data['nonce']        = wp_create_nonce('wp_rest');
     152        }
     153
    144154        wp_localize_script(
    145155            'ecommreels-ecomm-reels-build-script',
    146156            'ecommreelsInfo',
    147             [
    148                 'url' => esc_url_raw(rest_url()),
    149                 'nonce' => wp_create_nonce('wp_rest'),
    150                 'apiBase' => rest_url('wp-reels/v1/'),
    151                 'createStoryNonce' => wp_create_nonce('ecommreels_action'),
    152                 'currentStoryUrl' => home_url('/wp-admin/admin.php?page=my-reels&story='),
    153                 'isProActive' => $is_pro_active,
    154                 'isLicenseActive' => $is_pro_license_active,
    155                 'license_page' => home_url() . '/wp-admin/admin.php?page=ecomm-reels-license'
    156             ]
    157         );
    158 
    159         wp_localize_script(
    160             'ecommreels-ecomm-reels-build-script',
    161             'reelswp_media_api',
    162             [
    163                 'ajax_url' => admin_url('admin-ajax.php'),
    164                 'nonce'    => wp_create_nonce('reelswp_nonce'),
    165                 'action'   => 'reelswp_upload_cropped_image',
    166             ]
     157            $localized_data
    167158        );
    168159    }
  • ecomm-reels/trunk/build/index.js

    r3449375 r3450956  
    1 (function(y,la,Pn,ca){"use strict";var da=document.createElement("style");da.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}.ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:var(--color-primary, #111);color:var(--color-primary-foreground, #fff);cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}.ecr-button:disabled{opacity:.6;cursor:not-allowed}.ecr-button--primary{background:var(--color-primary, #1f2937);color:var(--color-primary-foreground, #fff)}.ecr-button--primary:hover{background:color-mix(in srgb,var(--color-primary, #1f2937) 90%,#000)}.ecr-button--secondary{background:var(--color-secondary, #e5e7eb);color:var(--color-secondary-foreground, #111827)}.ecr-button--secondary:hover{background:color-mix(in srgb,var(--color-secondary, #e5e7eb) 90%,#000)}.ecr-button--outline{background:transparent;border-color:var(--color-border, #d1d5db);color:var(--color-foreground, #111827)}.ecr-button--outline:hover{background:var(--color-accent, #f3f4f6)}.ecr-button--ghost{background:transparent;color:var(--color-foreground, #111827)}.ecr-button--ghost:hover{background:var(--color-accent, #f3f4f6)}.ecr-button--link{background:none;border-color:transparent;padding:0;color:var(--color-primary, #2563eb);text-decoration:none}.ecr-button--link:hover{text-decoration:underline}.ecr-button--danger{background:#dc2626;color:#fff}.ecr-button--danger:hover{background:#b91c1c}.ecr-button--sm{height:32px;padding:0 12px;font-size:13px}.ecr-button--md{height:36px;padding:0 16px}.ecr-button--lg{height:40px;padding:0 20px;font-size:15px}.ecr-button--icon,.ecr-button--icon-sm,.ecr-button--icon-lg{padding:0;width:36px;height:36px}.ecr-button--icon-sm{width:32px;height:32px}.ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:20;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:50;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:50;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed;inset:0;display:grid;place-items:center;width:100%;height:100vh}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:50;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size, 150px),1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:40;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:50;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:999;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:grid;cursor:pointer;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:70}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:50}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:60}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px;margin-bottom:8px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:50;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px}@media(min-width:1024px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:10;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-thumb__link-list,.ecommreels-short-code .ecr-thumb__link-list,.reelswp-group-short-code .ecr-thumb__link-list,.reelswp-reel-short-code .ecr-thumb__link-list{margin-top:4px;display:flex;flex-direction:column;gap:4px}#ecommreels-admin-app .ecr-thumb__link-list a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-list a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:57.6px;text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff}:is(#ecommreels-admin-app .ecr-thumb__link-list a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-list a.ecr-thumb__link):hover{text-decoration:underline}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:20;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:50;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:50;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;border:1px solid #fff;font-size:14px}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1024px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;background:#fff;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:280px;border:2px solid #e5e7eb}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:50}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:50;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{cursor:pointer;overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:10;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size, 150px),1fr))}
    2 /*$vite$:1*/`,document.head.appendChild(da);function ua(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const h=ua(y),br=ua(ca);function vd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var On={exports:{}},Ut={};/**
     1(function(y,ga,Rn,xa){"use strict";var ba=document.createElement("style");ba.textContent=`:root{--color-primary: #2563eb;--color-primary-foreground: #ffffff;--color-secondary: #e5e7eb;--color-secondary-foreground: #111827;--color-foreground: #111827;--color-muted: #f3f4f6;--color-muted-foreground: #6b7280;--color-accent: #f3f4f6;--color-border: #e5e7eb;--color-ring: #60a5fa}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{box-sizing:border-box;color:var(--color-foreground, #111);font-family:Inter,Segoe UI,system-ui,-apple-system,sans-serif}#ecommreels-admin-app *,#ecommreels-admin-app *:before,#ecommreels-admin-app *:after,.ecommreels-short-code *,.ecommreels-short-code *:before,.ecommreels-short-code *:after,.reelswp-group-short-code *,.reelswp-group-short-code *:before,.reelswp-group-short-code *:after,.reelswp-reel-short-code *,.reelswp-reel-short-code *:before,.reelswp-reel-short-code *:after{box-sizing:inherit}#ecommreels-admin-app input,#ecommreels-admin-app select,#ecommreels-admin-app textarea,.ecommreels-short-code input,.ecommreels-short-code select,.ecommreels-short-code textarea,.reelswp-group-short-code input,.reelswp-group-short-code select,.reelswp-group-short-code textarea,.reelswp-reel-short-code input,.reelswp-reel-short-code select,.reelswp-reel-short-code textarea{font:inherit;color:inherit}#ecommreels-admin-app button,.ecommreels-short-code button,.reelswp-group-short-code button,.reelswp-reel-short-code button{border:none}#ecommreels-admin-app input[type=checkbox],#ecommreels-admin-app input[type=radio],.ecommreels-short-code input[type=checkbox],.ecommreels-short-code input[type=radio],.reelswp-group-short-code input[type=checkbox],.reelswp-group-short-code input[type=radio],.reelswp-reel-short-code input[type=checkbox],.reelswp-reel-short-code input[type=radio]{margin:0}#ecommreels-admin-app input[type=number]::-webkit-inner-spin-button,#ecommreels-admin-app input[type=number]::-webkit-outer-spin-button,.ecommreels-short-code input[type=number]::-webkit-inner-spin-button,.ecommreels-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-group-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-group-short-code input[type=number]::-webkit-outer-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-inner-spin-button,.reelswp-reel-short-code input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}#ecommreels-admin-app input[type=number],.ecommreels-short-code input[type=number],.reelswp-group-short-code input[type=number],.reelswp-reel-short-code input[type=number]{-moz-appearance:textfield}#ecommreels-admin-app input,.ecommreels-short-code input,.reelswp-group-short-code input,.reelswp-reel-short-code input{min-height:auto}#ecommreels-admin-app img,.ecommreels-short-code img,.reelswp-group-short-code img,.reelswp-reel-short-code img{max-width:100%;display:block}#ecommreels-admin-app h1,#ecommreels-admin-app h2,#ecommreels-admin-app h3,#ecommreels-admin-app h4,#ecommreels-admin-app h5,#ecommreels-admin-app h6,.ecommreels-short-code h1,.ecommreels-short-code h2,.ecommreels-short-code h3,.ecommreels-short-code h4,.ecommreels-short-code h5,.ecommreels-short-code h6,.reelswp-group-short-code h1,.reelswp-group-short-code h2,.reelswp-group-short-code h3,.reelswp-group-short-code h4,.reelswp-group-short-code h5,.reelswp-group-short-code h6,.reelswp-reel-short-code h1,.reelswp-reel-short-code h2,.reelswp-reel-short-code h3,.reelswp-reel-short-code h4,.reelswp-reel-short-code h5,.reelswp-reel-short-code h6{margin:0;font-weight:600}#ecommreels-admin-app p,.ecommreels-short-code p,.reelswp-group-short-code p,.reelswp-reel-short-code p{margin:0}#ecommreels-admin-app .ecr-admin-panel{position:relative;margin:24px;min-height:50vh;border-radius:6px;border:1px solid #d1d5db;background:#fff;padding:16px}#ecommreels-admin-app .ecr-admin-panel--reels{padding:16px}#ecommreels-admin-app .ecr-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:6px;font-size:14px;font-weight:600;line-height:1;padding:8px 16px;background:#111;color:#fff;cursor:pointer;transition:background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,transform .2s ease}#ecommreels-admin-app .ecr-button:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-button--primary{background:#2563eb;color:#fff}#ecommreels-admin-app .ecr-button--primary:hover{background:color-mix(in srgb,#1f2937) 90%,#000}#ecommreels-admin-app .ecr-button--secondary{background:#e5e7eb;color:#111827}#ecommreels-admin-app .ecr-button--secondary:hover{background:color-mix(in srgb,#e5e7eb 90%,#000)}#ecommreels-admin-app .ecr-button--outline{background:transparent;border-color:#2563eb;color:#2563eb}#ecommreels-admin-app .ecr-button--outline:hover{background:#2563eb1a}#ecommreels-admin-app .ecr-button--ghost{background:transparent;color:#111827}#ecommreels-admin-app .ecr-button--ghost:hover{background:#f3f4f6}#ecommreels-admin-app .ecr-button--link{background:none;border-color:transparent;padding:0;color:#2563eb;text-decoration:none}#ecommreels-admin-app .ecr-button--link:hover{text-decoration:underline}#ecommreels-admin-app .ecr-button--danger{background:#dc2626;color:#fff}#ecommreels-admin-app .ecr-button--danger:hover{background:#b91c1c}#ecommreels-admin-app .ecr-button--sm{height:32px;padding:0 12px;font-size:13px}#ecommreels-admin-app .ecr-button--md{height:36px;padding:0 16px}#ecommreels-admin-app .ecr-button--lg{height:40px;padding:0 20px;font-size:15px}#ecommreels-admin-app .ecr-button--icon,#ecommreels-admin-app .ecr-button--icon-sm,#ecommreels-admin-app .ecr-button--icon-lg{padding:0;width:36px;height:36px}#ecommreels-admin-app .ecr-button--icon-sm{width:32px;height:32px}#ecommreels-admin-app .ecr-button--icon-lg{width:40px;height:40px}#ecommreels-admin-app .ecr-admin-reels-header{margin-bottom:16px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__left{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-admin-reels-header__right{display:flex;flex-wrap:wrap;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__title{margin:0;padding:6px 0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-reels-header__actions{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-reels-header__action{padding:0;font-weight:600;background:none;border:none;box-shadow:none}#ecommreels-admin-app .ecr-admin-reels-header__action--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reels-header__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reels-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-reels-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-reels-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-reels-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-reels-header__create{border:1px solid #3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-reels-header__create:hover{background:#ffffffe6}#ecommreels-admin-app .ecr-admin-reels-header__spinner{animation:ecr-reels-spin 1s linear infinite}@keyframes ecr-reels-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-reels-empty{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reels-empty__text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:14px}#ecommreels-admin-app .ecr-admin-reels-loading{display:flex;align-items:center;justify-content:center;padding:16px 0}#ecommreels-admin-app .ecr-admin-reels-loading--fullscreen{position:absolute;inset:0}#ecommreels-admin-app .ecr-admin-reels-loading__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-reels-loading-spin 1s linear infinite}@keyframes ecr-reels-loading-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-player__progress,.ecommreels-short-code .ecr-player__progress,.reelswp-group-short-code .ecr-player__progress,.reelswp-reel-short-code .ecr-player__progress{position:absolute;top:4px;left:50%;z-index:20;display:flex;width:90%;transform:translate(-50%);gap:4px;overflow:hidden;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-track,.ecommreels-short-code .ecr-player__progress-track,.reelswp-group-short-code .ecr-player__progress-track,.reelswp-reel-short-code .ecr-player__progress-track{width:100%;height:3px;background:#ffffff80;border-radius:999px}#ecommreels-admin-app .ecr-player__progress-fill,.ecommreels-short-code .ecr-player__progress-fill,.reelswp-group-short-code .ecr-player__progress-fill,.reelswp-reel-short-code .ecr-player__progress-fill{height:3px;background:#fff;border-radius:999px;width:0}#ecommreels-admin-app .ecr-player__progress-fill--active,.ecommreels-short-code .ecr-player__progress-fill--active,.reelswp-group-short-code .ecr-player__progress-fill--active,.reelswp-reel-short-code .ecr-player__progress-fill--active{animation:ecr-progress var(--reels-wp-animation-time) linear forwards}#ecommreels-admin-app .ecr-player__progress-fill--complete,.ecommreels-short-code .ecr-player__progress-fill--complete,.reelswp-group-short-code .ecr-player__progress-fill--complete,.reelswp-reel-short-code .ecr-player__progress-fill--complete{width:100%}#ecommreels-admin-app .ecr-player__progress-fill--empty,.ecommreels-short-code .ecr-player__progress-fill--empty,.reelswp-group-short-code .ecr-player__progress-fill--empty,.reelswp-reel-short-code .ecr-player__progress-fill--empty{width:0}@keyframes ecr-progress{0%{width:0}to{width:100%}}#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{position:absolute;top:50%;z-index:50;display:none;width:40px;height:40px;padding:0;transform:translateY(-50%);border:none;border-radius:999px;background:#ffffffd9;color:#374151;cursor:pointer;align-items:center;justify-content:center}@media(min-width:1024px){#ecommreels-admin-app .ecr-player__nav,.ecommreels-short-code .ecr-player__nav,.reelswp-group-short-code .ecr-player__nav,.reelswp-reel-short-code .ecr-player__nav{display:grid}}#ecommreels-admin-app .ecr-player__nav--left,.ecommreels-short-code .ecr-player__nav--left,.reelswp-group-short-code .ecr-player__nav--left,.reelswp-reel-short-code .ecr-player__nav--left{left:0;transform:translate(-120%,-50%)}#ecommreels-admin-app .ecr-player__nav--right,.ecommreels-short-code .ecr-player__nav--right,.reelswp-group-short-code .ecr-player__nav--right,.reelswp-reel-short-code .ecr-player__nav--right{right:0;transform:translate(120%,-50%)}#ecommreels-admin-app .ecr-player__nav:hover,.ecommreels-short-code .ecr-player__nav:hover,.reelswp-group-short-code .ecr-player__nav:hover,.reelswp-reel-short-code .ecr-player__nav:hover{background:#fff}#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{position:relative;display:flex;width:100%;height:100%;align-items:center;justify-content:center;overflow:hidden;border-radius:16px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__media-frame,.ecommreels-short-code .ecr-player__media-frame,.reelswp-group-short-code .ecr-player__media-frame,.reelswp-reel-short-code .ecr-player__media-frame{border-radius:0}}#ecommreels-admin-app .ecr-player__media,.ecommreels-short-code .ecr-player__media,.reelswp-group-short-code .ecr-player__media,.reelswp-reel-short-code .ecr-player__media{width:100%;height:auto}#ecommreels-admin-app .ecr-player__media--portrait,.ecommreels-short-code .ecr-player__media--portrait,.reelswp-group-short-code .ecr-player__media--portrait,.reelswp-reel-short-code .ecr-player__media--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-player__media--auto,.ecommreels-short-code .ecr-player__media--auto,.reelswp-group-short-code .ecr-player__media--auto,.reelswp-reel-short-code .ecr-player__media--auto{height:auto}#ecommreels-admin-app .ecr-player__slider,.ecommreels-short-code .ecr-player__slider,.reelswp-group-short-code .ecr-player__slider,.reelswp-reel-short-code .ecr-player__slider{position:absolute;top:0;display:flex;background:#000;transition:left .2s ease}#ecommreels-admin-app .ecr-player__slide,.ecommreels-short-code .ecr-player__slide,.reelswp-group-short-code .ecr-player__slide,.reelswp-reel-short-code .ecr-player__slide{position:relative;display:flex;align-items:center;justify-content:center;height:90vh;max-width:100vw;aspect-ratio:9 / 16}#ecommreels-admin-app .ecr-player__controls,.ecommreels-short-code .ecr-player__controls,.reelswp-group-short-code .ecr-player__controls,.reelswp-reel-short-code .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:50;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon,.ecommreels-short-code .ecr-player__control-icon,.reelswp-group-short-code .ecr-player__control-icon,.reelswp-reel-short-code .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecommreels-story-modal,.ecommreels-short-code .ecommreels-story-modal,.reelswp-group-short-code .ecommreels-story-modal,.reelswp-reel-short-code .ecommreels-story-modal{max-width:100%!important}#ecommreels-admin-app #player *,.ecommreels-short-code #player *,.reelswp-group-short-code #player *,.reelswp-reel-short-code #player *{scrollbar-width:none;-ms-overflow-style:none}#ecommreels-admin-app #player *::-webkit-scrollbar,.ecommreels-short-code #player *::-webkit-scrollbar,.reelswp-group-short-code #player *::-webkit-scrollbar,.reelswp-reel-short-code #player *::-webkit-scrollbar{display:none}#ecommreels-admin-app .ecr-player,.ecommreels-short-code .ecr-player,.reelswp-group-short-code .ecr-player,.reelswp-reel-short-code .ecr-player{position:fixed;inset:0;display:grid;place-items:center;width:100%;height:100vh}#ecommreels-admin-app .ecr-player__stage,.ecommreels-short-code .ecr-player__stage,.reelswp-group-short-code .ecr-player__stage,.reelswp-reel-short-code .ecr-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:90vh;max-width:100vw;overflow:hidden;border-radius:24px}@media screen and (max-width:767.98px){#ecommreels-admin-app .ecr-player__frame,.ecommreels-short-code .ecr-player__frame,.reelswp-group-short-code .ecr-player__frame,.reelswp-reel-short-code .ecr-player__frame{height:100vh;border-radius:0}}#ecommreels-admin-app .ecr-player__close,.ecommreels-short-code .ecr-player__close,.reelswp-group-short-code .ecr-player__close,.reelswp-reel-short-code .ecr-player__close{position:absolute;top:8px;right:8px;z-index:50;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1}#ecommreels-admin-app .ecr-player__close-icon,.ecommreels-short-code .ecr-player__close-icon,.reelswp-group-short-code .ecr-player__close-icon,.reelswp-reel-short-code .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-admin-reels-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size, 150px),1fr))}#ecommreels-admin-app .ecr-thumb__media,.ecommreels-short-code .ecr-thumb__media,.reelswp-group-short-code .ecr-thumb__media,.reelswp-reel-short-code .ecr-thumb__media{position:relative;width:100%;height:100%}#ecommreels-admin-app .ecr-thumb__video,.ecommreels-short-code .ecr-thumb__video,.reelswp-group-short-code .ecr-thumb__video,.reelswp-reel-short-code .ecr-thumb__video{pointer-events:none;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-thumb__placeholder,.ecommreels-short-code .ecr-thumb__placeholder,.reelswp-group-short-code .ecr-thumb__placeholder,.reelswp-reel-short-code .ecr-thumb__placeholder{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#e5e7eb;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-thumb__views,.ecommreels-short-code .ecr-thumb__views,.reelswp-group-short-code .ecr-thumb__views,.reelswp-reel-short-code .ecr-thumb__views{position:absolute;top:8px;z-index:40;display:inline-flex;align-items:center;gap:4px;background:#6b7280;color:#fff;padding:2.4px 5.6px;font-size:11px;border-radius:4px}#ecommreels-admin-app .ecr-admin-reel-card{display:block}#ecommreels-admin-app .ecr-admin-reel-card__frame{position:relative;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease,box-shadow .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame--selected{border-color:#3b82f6;box-shadow:0 0 0 2px #2b7fff}#ecommreels-admin-app .ecr-admin-reel-card__actions{position:absolute;top:100%;z-index:50;display:flex;width:100%;height:50%;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__actions--hover{top:50%}#ecommreels-admin-app .ecr-admin-reel-card__action{background:#fff;color:#111827}#ecommreels-admin-app .ecr-admin-reel-card__action:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__action--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reel-card__icon--primary{color:#2563eb}#ecommreels-admin-app .ecr-admin-reel-card__icon--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reel-card__corner{position:absolute;display:flex;top:-2px;right:-2px;z-index:999;width:42px;height:42px;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-reel-card__corner--hidden{transform:translate(100%,-100%)}#ecommreels-admin-app .ecr-admin-reel-card__frame:hover .ecr-admin-reel-card__corner--hidden{transform:translate(0)}#ecommreels-admin-app .ecr-admin-reel-card__corner--selected{background:#3b82f6}#ecommreels-admin-app .ecr-admin-reel-card__corner--idle{background:#fff}#ecommreels-admin-app .ecr-admin-reel-card__select{margin-left:auto;width:24px;height:24px;border-radius:4px;background:transparent;padding:4px}#ecommreels-admin-app .ecr-admin-reel-card__check{color:#6b7280}#ecommreels-admin-app .ecr-admin-reel-card__check--active{color:#fff}#ecommreels-admin-app .ecr-admin-reel-card__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-back-button{background:none;border:none;padding:0;color:#6b7280;cursor:pointer;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-back-button:hover{color:#2563eb}#ecommreels-admin-app .ecr-admin-breadcrumb{margin-top:12px;padding:0 24px;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-breadcrumb__list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-breadcrumb__item{display:inline-flex;align-items:center}#ecommreels-admin-app .ecr-admin-breadcrumb__link{color:#2563eb;text-decoration:none;transition:color .15s ease}#ecommreels-admin-app .ecr-admin-breadcrumb__current{font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-breadcrumb__separator{margin:0 4px;font-size:18px;color:#9ca3af}#ecommreels-admin-app .ecr-admin-modal{position:fixed;inset:0;z-index:2147483647;display:grid;place-items:center;background:#000c}#ecommreels-admin-app .ecr-admin-modal__panel{border-radius:8px;background:#fff;padding:24px;min-width:320px;max-width:500px}#ecommreels-admin-app .ecr-admin-modal__content{margin-bottom:16px}#ecommreels-admin-app .ecr-admin-modal__icon{margin-bottom:8px;display:flex;justify-content:center}#ecommreels-admin-app .ecr-admin-modal__message{margin:0;font-size:16px;font-weight:600;color:#111827;text-align:center}#ecommreels-admin-app .ecr-admin-modal__actions{display:flex;width:100%;align-items:center;justify-content:center;gap:8px}#ecommreels-admin-app .ecr-admin-modal__button{border-radius:6px;border:1px solid transparent;padding:6px 24px;font-size:14px;font-weight:600;cursor:pointer}#ecommreels-admin-app .ecr-admin-modal__button:disabled{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-modal__button--cancel{border-color:#3b82f6;background:#fff;color:#3b82f6}#ecommreels-admin-app .ecr-admin-modal__button--danger{display:inline-flex;align-items:center;gap:6px;border-color:#ef4444;background:#ef4444;color:#fff}#ecommreels-admin-app .ecr-admin-modal__spinner{animation:ecr-modal-spin 1s linear infinite}@keyframes ecr-modal-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-link-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:6px;background:#3b82f6;padding:8px 16px;font-size:14px;font-weight:600;text-decoration:none;transition:background-color .15s ease;margin-inline-start:auto}#ecommreels-admin-app .ecr-admin-link-button:hover{background:#1d4ed8}#ecommreels-admin-app .ecr-admin-loader{position:fixed;inset:0;z-index:50;display:grid;place-items:center;background:#fffc;color:#3b82f6}#ecommreels-admin-app .ecr-admin-loader__icon{animation:ecr-admin-spin 1s linear infinite}@keyframes ecr-admin-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-navbar{display:flex;align-items:center;justify-content:space-between;background:#fff;padding:16px 24px}#ecommreels-admin-app .ecr-admin-navbar__section{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-page-name{margin:0;display:inline-flex;align-items:center;gap:4px;font-size:20px;font-weight:600;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-widget-name{display:inline-flex;align-items:center;justify-content:center;gap:4px;width:320px;border-radius:6px;background:#e5e7eb;padding:8px;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create{margin:16px 24px 0;display:flex;gap:24px}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create{flex-direction:column}}#ecommreels-admin-app .ecr-admin-create__panel{position:relative;overflow-x:hidden;border-radius:16px;background:#fff;padding:16px 20px 20px}#ecommreels-admin-app .ecr-admin-create__panel--main{flex:1;min-width:0}#ecommreels-admin-app .ecr-admin-create__panel--side{width:300px;flex-shrink:0}@media(max-width:1024px){#ecommreels-admin-app .ecr-admin-create__panel--side{width:100%}}#ecommreels-admin-app .ecr-admin-create__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-create__separator{margin:12px 0}#ecommreels-admin-app .ecr-admin-save-button{background:#3b82f6;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-save-button:hover{background:#2563eb}#ecommreels-admin-app .ecr-admin-save-button:disabled{background:#6b7280}#ecommreels-admin-app .ecr-admin-save-button__icon{font-size:16px}#ecommreels-admin-app .ecr-admin-save-button__icon--spin{animation:ecr-save-spin 1s linear infinite}@keyframes ecr-save-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-title-input{width:320px;border-radius:6px;border:1px solid transparent;background:#e5e7eb;padding:8px;text-align:center;font-size:14px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-upload{display:grid;width:260px;aspect-ratio:9 / 16;place-items:center;border-radius:12px;border:2px dashed #d1d5db;background:#eff6ff;padding:20px}#ecommreels-admin-app .ecr-admin-upload--active{border-color:#3b82f6;background:#eff6ff}#ecommreels-admin-app .ecr-admin-upload--idle{border-color:#d1d5db}#ecommreels-admin-app .ecr-admin-upload__label{display:grid;cursor:pointer;place-items:center;text-align:center}#ecommreels-admin-app .ecr-admin-upload__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-upload__label:hover .ecr-admin-upload__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-upload__text{margin:8px 0 0;color:#6b7280;font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-stack{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-upload__text-item{font-size:13px}#ecommreels-admin-app .ecr-admin-upload__text-strong{font-weight:600}#ecommreels-admin-app .ecr-popover{border-radius:10px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding-block:16px;width:288px;box-shadow:0 10px 30px #00000026;z-index:70}#ecommreels-admin-app .ecr-popover[data-state=open]{animation:ecr-popover-in .15s ease-out}@keyframes ecr-popover-in{0%{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.ecr-separator{background:var(--color-border, #e5e7eb);flex-shrink:0}.ecr-separator[data-orientation=horizontal]{height:1px;width:100%}.ecr-separator[data-orientation=vertical]{width:1px;height:100%}.ecr-admin-upgrade__title{margin:0;display:inline-flex;align-items:center;gap:6px;font-weight:600;padding-inline:16px}.ecr-admin-upgrade__name{text-transform:capitalize}.ecr-admin-upgrade__tag{display:inline-block;padding:0 4px;border-radius:2px;background:#2563eb;color:#fff;font-size:10px;letter-spacing:.32px}.ecr-admin-upgrade__text{margin:0;font-size:13px;color:#374151;line-height:1.4;padding-inline:16px}.ecr-admin-upgrade__actions{display:flex;justify-content:flex-end;padding-inline:16px}.ecr-admin-upgrade__button{background:#3b82f6;color:#fff}.ecr-admin-upgrade__button:hover{background:#2563eb}.ecr-admin-upgrade__link{font-size:13px;text-decoration:none}.ecr-admin-separator{margin:12px 0}#ecommreels-admin-app .ecr-dialog__overlay{position:fixed;inset:0;background:#0f172abf;z-index:50}#ecommreels-admin-app .ecr-dialog__overlay[data-state=open]{animation:ecr-dialog-overlay-in .15s ease-out}#ecommreels-admin-app .ecr-dialog__content{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(500px,92vw);max-height:85vh;overflow:auto;border-radius:12px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-foreground, #111827);padding:20px;box-shadow:0 25px 60px #0f172a40;z-index:60}#ecommreels-admin-app .ecr-dialog__content[data-state=open]{animation:ecr-dialog-content-in .2s ease-out}#ecommreels-admin-app .ecr-dialog__close{position:absolute;right:12px;top:12px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;border:1px solid var(--color-border, #e5e7eb);background:#fff;color:var(--color-muted-foreground, #6b7280);cursor:pointer}#ecommreels-admin-app .ecr-dialog__close:hover{color:var(--color-foreground, #111827)}#ecommreels-admin-app .ecr-dialog__close-icon{width:16px;height:16px}#ecommreels-admin-app .ecr-dialog__header{display:flex;flex-direction:column;gap:6px;padding-right:36px;margin-bottom:16px}#ecommreels-admin-app .ecr-dialog__title{font-size:16px;font-weight:600;text-transform:none}#ecommreels-admin-app .ecr-dialog__description{font-size:13px;color:var(--color-muted-foreground, #6b7280)}@keyframes ecr-dialog-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes ecr-dialog-content-in{0%{opacity:0;transform:translate(-50%,-48%) scale(.98)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}#ecommreels-admin-app .ecr-admin-link-tabs{width:100%;max-height:550px}#ecommreels-admin-app .ecr-admin-link-tabs__list{width:100%;display:grid;grid-template-columns:1fr;gap:8px;border-radius:10px;padding:3px}#ecommreels-admin-app .ecr-admin-link-tabs__trigger,#ecommreels-admin-app .ecr-admin-link-tabs__lock{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;border:1px solid #3b82f6;border-radius:8px;padding:8px;font-size:13px;font-weight:600;background:#fff;color:#6b7280;text-transform:none}#ecommreels-admin-app .ecr-admin-link-tabs__lock{border-color:#969eab}#ecommreels-admin-app .ecr-admin-link-tabs__trigger{color:#3b82f6}#ecommreels-admin-app .ecr-admin-link-tabs__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-link-tabs__content{display:flex;flex-direction:column;gap:20px}#ecommreels-admin-app .ecr-admin-link-dialog{max-width:560px}#ecommreels-admin-app .ecr-admin-product-link__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-product-link__list{height:100%;max-height:300px;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-product-link__list-inner{display:flex;flex-direction:column;gap:8px;width:100%}#ecommreels-admin-app .ecr-admin-product-link__empty{padding:24px 0;text-align:center;font-size:14px;color:#6b7280}#ecommreels-admin-app .ecr-admin-product-link__item{width:100%}#ecommreels-admin-app .ecr-admin-product-link__button{height:auto;width:100%;justify-content:flex-start;border:1px solid #e5e7eb;background:#f7f7f7;color:#111827;padding:8px;font-weight:400;text-align:left;font-size:13px;display:flex;align-items:center;gap:8px;border-radius:6px}#ecommreels-admin-app .ecr-admin-product-link__button--selected{border-color:#2563eb;background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__button--unselected:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-product-link__thumb{pointer-events:none;width:40px;height:40px;flex:0 0 auto}#ecommreels-admin-app .ecr-admin-product-link__error{margin:0 0 8px;text-align:left;font-size:14px;color:#ef4444}#ecommreels-admin-app .ecr-admin-product-link__actions{display:flex;justify-content:end}#ecommreels-admin-app .ecr-admin-product-link__actions .ecr-button{text-transform:capitalize;padding:12px 32px}#ecommreels-admin-app .ecr-admin-product-link__loader{display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-product-link__spinner{width:24px;height:24px;border-radius:999px;border-bottom:2px solid #3b82f6;animation:ecr-admin-product-link-spin 1s linear infinite}@keyframes ecr-admin-product-link-spin{to{transform:rotate(360deg)}}.scrollbarThin{--sb-track: transparent;--sb-thumb: rgba(0, 0, 0, .35);--sb-thumb-hover: rgba(0, 0, 0, .5);--sb-thumb-radius: 6px;--sb-size: 8px;scrollbar-width:thin;scrollbar-color:var(--sb-thumb) var(--sb-track);-ms-overflow-style:auto}.scrollbarThin::-webkit-scrollbar{width:var(--sb-size);height:var(--sb-size)}.scrollbarThin::-webkit-scrollbar-track{background:var(--sb-track)}.scrollbarThin::-webkit-scrollbar-thumb{background-color:var(--sb-thumb);border-radius:var(--sb-thumb-radius);border:2px solid transparent;background-clip:padding-box}.scrollbarThin::-webkit-scrollbar-thumb:hover{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-thumb:active{background-color:var(--sb-thumb-hover)}.scrollbarThin::-webkit-scrollbar-corner{background:var(--sb-track)}.scrollbarThin:focus-within::-webkit-scrollbar-thumb{box-shadow:0 0 0 1px #0000000f inset}#ecommreels-admin-app .ecr-admin-link__label{display:block;text-align:left;font-size:14px;font-weight:600;text-transform:capitalize;margin-bottom:4px}#ecommreels-admin-app .ecr-admin-link__input{width:100%;border-radius:6px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-link__input--normal{border-color:#6b7280}#ecommreels-admin-app .ecr-admin-link__input--error{border-color:#ef4444}#ecommreels-admin-app .ecr-admin-link__input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-link__error{margin:4px 0 0;text-align:left;font-size:12px;color:#ef4444}#ecommreels-admin-app .ecr-admin-link__toggle{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-link__checkbox{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-link__toggle-label{cursor:pointer;font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-link__actions{margin-top:12px;display:flex;gap:8px}#ecommreels-admin-app .ecr-admin-link__actions .ecr-button{text-transform:capitalize;width:100%}#ecommreels-admin-app .ecr-admin-links{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-admin-links__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-links__wrapper{display:flex;flex-direction:column;gap:4px;max-height:380px;overflow-y:auto}#ecommreels-admin-app .ecr-admin-links__item{display:flex;align-items:center;justify-content:space-between;border-radius:6px;background:#eff6ff;padding:2px 8px 2px 16px}#ecommreels-admin-app .ecr-admin-links__remove{color:#ef4444}#ecommreels-admin-app .ecr-admin-links__add-more_btn{margin-top:8px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6;padding:8px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__upgrade{margin-top:12px;display:flex;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:4px;border-radius:6px;background:#3b82f6b3;padding:6px;font-size:13px;color:#fff;text-transform:capitalize}#ecommreels-admin-app .ecr-admin-links__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reelvideo{width:100%;border-radius:12px;display:block}#ecommreels-admin-app .ecr-admin-reelvideo--portrait{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reelvideo--landscape{width:100%}#ecommreels-admin-app .ecr-admin-customization__panel{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;cursor:grab;align-items:center;justify-content:center;overflow:hidden;border-radius:12px;background:#000;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-customization__panel:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-customization__remove{position:absolute;top:8px;left:8px;z-index:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__controls{position:absolute;top:8px;right:8px;z-index:50;display:flex;gap:8px;font-size:18px;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-customization__control{cursor:pointer}#ecommreels-admin-app .ecr-admin-customization{display:flex;width:fit-content;flex-wrap:wrap;gap:16px}#ecommreels-admin-app .ecr-admin-customization__add{position:relative;display:flex;width:260px;aspect-ratio:9 / 16;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:2px dashed #d1d5db;background:#e5e7eb;padding:20px;cursor:pointer}#ecommreels-admin-app .ecr-admin-customization__icon{width:40%;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-customization__add:hover .ecr-admin-customization__icon{transform:scale(1.02)}#ecommreels-admin-app .ecr-admin-customization__label{font-size:13px;color:#4b5563}#ecommreels-admin-app .ecr-admin-customization__lock{position:absolute;top:8px;right:8px;color:#6b7280}#ecommreels-admin-app .ecr-admin-customization__popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-thumbnail{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumbnail__title{margin:0 0 8px;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-thumbnail__preview{position:relative;margin:0 auto;width:100%;aspect-ratio:9 / 16;overflow:hidden;border-radius:12px}#ecommreels-admin-app .ecr-admin-thumbnail__image{width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-thumbnail__remove{position:absolute;top:8px;right:8px;z-index:30;cursor:pointer;color:#fff;mix-blend-mode:difference}#ecommreels-admin-app .ecr-admin-thumbnail__uploader{margin:0 auto;width:100%}#ecommreels-admin-app .ecr-admin-card{margin:24px auto 0;max-width:1024px;border:1px solid #6b7280;border-radius:6px;background:#fff;padding:24px;box-shadow:0 0 8px #aaa}#ecommreels-admin-app .ecr-admin-card--settings{width:fit-content}#ecommreels-admin-app .ecr-admin-card__header{display:flex;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-card__title{margin:0;font-size:20px;font-weight:700}#ecommreels-admin-app .ecr-admin-groups{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-groups__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-groups__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-groups__create-button{border:1px solid #2563eb;background:#fff;color:#2563eb}#ecommreels-admin-app .ecr-admin-groups__create-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-groups__load-more{display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-groups__load-more__icon{width:48px;height:48px;color:#3b82f6;animation:ecr-load-more-spin 1s linear infinite}@keyframes ecr-load-more-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-admin-groups_action_wrapper{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-groups-header__search{position:relative;width:100%}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-groups-header__search{width:280px}}#ecommreels-admin-app .ecr-admin-groups-search-input{width:100%;padding:8px 16px;border-radius:6px;border:1px solid #e5e7eb;background:#fff;font-size:14px;line-height:1.4}#ecommreels-admin-app .ecr-admin-groups-search-input:focus{outline:none;box-shadow:none;border-color:#cbd5f5}#ecommreels-admin-app .ecr-admin-groups-header__icon-wrapper{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:fit-content;height:20px;display:flex;align-items:center}#ecommreels-admin-app .ecr-admin-groups-header__search-icon{color:#d1d5db;flex-shrink:0}#ecommreels-admin-app .ecr-admin-groups-header__clear-icon{color:#f50808;flex-shrink:0}#ecommreels-admin-app .ecr-admin-error{margin-top:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:6px;border:1px solid #fecaca;background:#fef2f2;padding:24px;color:#dc2626}#ecommreels-admin-app .ecr-admin-error__icon{width:28px;height:28px}#ecommreels-admin-app .ecr-admin-error__text{margin:0;text-align:center;font-weight:600}.ecr-table__container{width:100%;overflow-x:auto}.ecr-table{width:100%;border-collapse:collapse;font-size:13px}.ecr-table__header tr{border-bottom:1px solid var(--color-border, #e5e7eb)}.ecr-table__row{border-bottom:1px solid var(--color-border, #e5e7eb);transition:background-color .2s ease}.ecr-table__row:hover,.ecr-table__row[data-state=selected]{background:var(--color-muted, #f3f4f6)}.ecr-table__head,.ecr-table__cell{padding:8px;text-align:left;vertical-align:middle;white-space:nowrap}.ecr-table__head{font-weight:600;color:var(--color-foreground, #111827)}.ecr-table__footer{border-top:1px solid var(--color-border, #e5e7eb);font-weight:600;background:var(--color-muted, #f3f4f6)}.ecr-table__caption{margin-top:16px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-admin-groups__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-groups__row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-groups__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__cell--strong{font-weight:600}#ecommreels-admin-app .ecr-admin-groups__name{display:flex;align-items:center;gap:8px;font-weight:600;color:#1f2937}#ecommreels-admin-app .ecr-admin-groups__shortcode{display:flex;align-items:center;gap:16px}#ecommreels-admin-app .ecr-admin-groups__shortcode-text{font-family:Courier New,monospace;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-groups__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-groups__copy-button{border:none;border-radius:4px;background:#1f2937;color:#fff;padding:4px 6px;cursor:pointer;transition:transform .15s ease}#ecommreels-admin-app .ecr-admin-groups__copy-button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-groups__copy-icon{display:block;width:12px;height:12px}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip{position:absolute;top:-8px;right:8px;transform:translate(33%,-100%) scale(0);transform-origin:bottom right;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip:after{content:"";position:absolute;bottom:-4px;left:50%;width:12px;height:12px;transform:translate(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-groups__copy-tooltip--visible{transform:translate(33%,-100%) scale(1)}#ecommreels-admin-app .ecr-admin-groups__actions{display:flex;align-items:center;justify-content:center;gap:6px}#ecommreels-admin-app .ecr-admin-groups__action-button{color:inherit}#ecommreels-admin-app .ecr-admin-groups__icon{width:18px;height:18px}#ecommreels-admin-app .ecr-admin-groups__icon--neutral{color:#475569}#ecommreels-admin-app .ecr-admin-groups__icon--danger{color:#f43f5e}#ecommreels-admin-app .ecr-admin-groups__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-groups__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-groups__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-groups__skeleton-table{width:100%;border-collapse:collapse}#ecommreels-admin-app .ecr-admin-groups__skeleton-head{background:#1f2937}#ecommreels-admin-app .ecr-admin-groups__skeleton-row{background:#fff}#ecommreels-admin-app .ecr-admin-groups__skeleton-row--alt{background:#f9fafb}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell{border:1px solid #e5e7eb;padding:8px}#ecommreels-admin-app .ecr-admin-groups__skeleton-cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-groups__skeleton-block,#ecommreels-admin-app .ecr-admin-groups__skeleton-line{border-radius:4px;background:#d1d5db;animation:ecr-groups-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-groups__skeleton-block{height:24px}#ecommreels-admin-app .ecr-admin-groups__skeleton-line{height:16px;margin:4px 0}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--tiny,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--tiny{width:32px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--small,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--small{width:96px;margin-inline:auto}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--medium,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--medium{width:160px}#ecommreels-admin-app .ecr-admin-groups__skeleton-block--large,#ecommreels-admin-app .ecr-admin-groups__skeleton-line--large{width:220px}@keyframes ecr-groups-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-form{margin-top:24px;display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-form__row{display:grid;grid-template-columns:1fr;align-items:center;gap:24px}@media(min-width:640px){#ecommreels-admin-app .ecr-admin-form__row{grid-template-columns:repeat(2,minmax(0,1fr))}}#ecommreels-admin-app .ecr-admin-form__label{font-size:14px;font-weight:600}#ecommreels-admin-app .ecr-admin-form__input{width:128px;border-radius:6px;border:1px solid #d1d5db;padding:8px;font-size:14px}#ecommreels-admin-app .ecr-admin-stats{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-stats__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}#ecommreels-admin-app .ecr-admin-stats__title{margin:0;font-size:20px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary{font-size:15px;font-weight:700;color:#111827}#ecommreels-admin-app .ecr-admin-stats__summary-skeleton{width:64px;height:24px;border-radius:6px;background:#d1d5db;animation:ecr-stats-pulse 1.6s ease-in-out infinite}#ecommreels-admin-app .ecr-admin-stats__body{margin-top:16px}@keyframes ecr-stats-pulse{0%,to{opacity:1}50%{opacity:.5}}#ecommreels-admin-app .ecr-admin-stats__table{margin-top:8px}#ecommreels-admin-app .ecr-admin-stats__head{background:#1f2937;color:#fff;border:1px solid #374151;padding:8px;font-size:13px;font-weight:600}#ecommreels-admin-app .ecr-admin-stats__row{background:#fff}#ecommreels-admin-app .ecr-admin-stats__row--alt{background:#f3f4f6}#ecommreels-admin-app .ecr-admin-stats__cell{border:1px solid #e5e7eb;padding:8px;font-size:13px;color:#111827}#ecommreels-admin-app .ecr-admin-stats__cell--center{text-align:center}#ecommreels-admin-app .ecr-admin-stats__cell--link{word-break:break-word}#ecommreels-admin-app .ecr-admin-stats__link{color:#2563eb;text-decoration:underline}#ecommreels-admin-app .ecr-admin-stats__caption{margin-top:16px}#ecommreels-admin-app .ecr-admin-stats__empty{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;color:#374151}#ecommreels-admin-app .ecr-admin-stats__empty-icon{width:20px;height:20px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-group-edit{margin-top:24px;padding:0 24px;display:flex;flex-direction:column;gap:16px}@media(min-width:1024px){#ecommreels-admin-app .ecr-admin-group-edit{flex-direction:row}}#ecommreels-admin-app .ecr-admin-group-title__wrapper{position:relative}#ecommreels-admin-app .ecr-admin-group-title-customization__trigger{position:absolute;top:50%;translate:0 -50%;right:0;background-color:transparent;color:gray;padding:0 8px}#ecommreels-admin-app .ecr-admin-group-title-customization-dialog{max-width:350px}#ecommreels-admin-app .ecr-admin-side-toggle{background:none;border:none;padding:0;color:#6b7280;cursor:pointer}#ecommreels-admin-app .ecr-admin-side-toggle--active{color:#2563eb}.ecr-input{width:100%;min-width:0;border:1px solid transparent;border-radius:6px;background:#f3f4f6;color:inherit;padding:6.4px 12px;font-size:14px;line-height:1.4;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease}.ecr-input:focus{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent);background:#fff}.ecr-input::placeholder{color:var(--color-muted-foreground, #9ca3af)}.ecr-input:disabled{opacity:.6;cursor:not-allowed}#ecommreels-admin-app .ecr-admin-range{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-range__label{font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-range__row{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-range__slider{width:112px;cursor:pointer;accent-color:#2563eb}#ecommreels-admin-app .ecr-admin-range__value{display:inline-flex;align-items:center;gap:6px}#ecommreels-admin-app .ecr-admin-range__value .ecr-input{width:80px;padding:6px 8px}#ecommreels-admin-app .ecr-admin-range__unit{font-size:12px;color:#6b7280}#ecommreels-admin-app .ecr-admin-group-title_alignment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;justify-content:space-between}#ecommreels-admin-app .ecr-admin-group-title_alignment-label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-group-title_alignment-options{display:flex;align-items:center;gap:0;background-color:#dfdfdf;border-radius:8px;overflow:hidden}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button{border-radius:0;color:#3d3d3d}#ecommreels-admin-app .ecr-admin-group-title_alignment-options button:not(:last-child){border-right:1px solid gray}#ecommreels-admin-app .ecr-admin-group-title-customization__content{display:flex;flex-direction:column;gap:16px;margin-top:40px}#ecommreels-admin-app .ecr-admin-color-selector-popover{width:auto;padding:0}#ecommreels-admin-app .ecr-admin-shortcode{display:flex;align-items:center;gap:8px}#ecommreels-admin-app .ecr-admin-shortcode__badge{border-radius:4px;background:#e5e7eb;padding:4px 8px;font-family:Courier New,monospace;font-size:14px;color:#111827;font-weight:900}#ecommreels-admin-app .ecr-admin-shortcode__copy{position:relative;isolation:isolate}#ecommreels-admin-app .ecr-admin-shortcode__button{cursor:pointer;border:none;border-radius:4px;background:#1f2937;padding:4px 6px;color:#fff}#ecommreels-admin-app .ecr-admin-shortcode__button:active{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip{position:absolute;top:50%;right:150%;transform:translateY(-50%) scale(0);transform-origin:center;border-radius:4px;background:#6b7280;padding:4px 8px;font-size:12px;font-weight:600;letter-spacing:.32px;color:#fff;transition:transform .2s ease}#ecommreels-admin-app .ecr-admin-shortcode__tooltip:after{content:"";position:absolute;top:50%;right:-4px;width:12px;height:12px;transform:translateY(-50%) rotate(45deg);background:#6b7280;z-index:-1}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--visible{transform:translateY(-50%) scale(1)}#ecommreels-admin-app .ecr-admin-shortcode__tooltip--hidden{transform:translateY(-50%) scale(0)}#ecommreels-admin-app .ecr-admin-reelitem{display:inline-flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reelitem__frame{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:aspect-ratio .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__actions{position:absolute;top:100%;left:0;z-index:10;display:flex;height:50%;width:100%;cursor:pointer;align-items:center;justify-content:center;gap:12px;background:#bfdbfee6;transition:top .2s ease}#ecommreels-admin-app .ecr-admin-reelitem__frame:hover .ecr-admin-reelitem__actions{top:50%}#ecommreels-admin-app .ecr-admin-reelitem__button{background:#fff;color:#111827;padding:4px;border-radius:6px}#ecommreels-admin-app .ecr-admin-reelitem__button:hover{background:#fff}#ecommreels-admin-app .ecr-admin-reelitem__button--danger{color:#ef4444}#ecommreels-admin-app .ecr-admin-reelitem__icon{width:16px;height:16px}#ecommreels-admin-app .ecr-admin-reelitem__spinner{animation:ecr-reelitem-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reelitem__link{display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-reelitem__link--disabled{pointer-events:none}#ecommreels-admin-app .ecr-admin-reelitem__link--active{pointer-events:auto}#ecommreels-admin-app .zoom-in,#ecommreels-admin-app .zoom-out{transition:transform .2s ease}#ecommreels-admin-app .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-admin-reel__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes ecr-reelitem-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-product-card-one,.ecommreels-short-code .ecr-product-card-one,.reelswp-group-short-code .ecr-product-card-one,.reelswp-reel-short-code .ecr-product-card-one{display:flex;flex-direction:column;align-items:stretch;gap:12px;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:8px;padding:8px;overflow:hidden;border:1px solid #fff;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one-content-wrapper,.ecommreels-short-code .ecr-product-card-one-content-wrapper,.reelswp-group-short-code .ecr-product-card-one-content-wrapper,.reelswp-reel-short-code .ecr-product-card-one-content-wrapper{display:flex;align-items:center;gap:8px;flex-shrink:0}#ecommreels-admin-app .ecr-product-card-one__thumb,.ecommreels-short-code .ecr-product-card-one__thumb,.reelswp-group-short-code .ecr-product-card-one__thumb,.reelswp-reel-short-code .ecr-product-card-one__thumb{pointer-events:none;width:40px;height:40px;flex-shrink:0;border-radius:4px}#ecommreels-admin-app .ecr-product-card-one__content,.ecommreels-short-code .ecr-product-card-one__content,.reelswp-group-short-code .ecr-product-card-one__content,.reelswp-reel-short-code .ecr-product-card-one__content{flex-grow:1;display:flex;flex-direction:column;align-items:flex-start;gap:4px;overflow:hidden}#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title{max-width:100%;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:500;line-height:1.2;color:#fff;text-decoration:none}:is(#ecommreels-admin-app .ecr-product-card-one p.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one p.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one p.ecr-product-card-one__title,#ecommreels-admin-app .ecr-product-card-one a.ecr-product-card-one__title,.ecommreels-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-group-short-code .ecr-product-card-one a.ecr-product-card-one__title,.reelswp-reel-short-code .ecr-product-card-one a.ecr-product-card-one__title):hover{text-decoration:underline}#ecommreels-admin-app .ecr-product-card-one__meta,.ecommreels-short-code .ecr-product-card-one__meta,.reelswp-group-short-code .ecr-product-card-one__meta,.reelswp-reel-short-code .ecr-product-card-one__meta{display:flex;align-items:center;gap:32px}#ecommreels-admin-app .ecr-product-card-one__rating,.ecommreels-short-code .ecr-product-card-one__rating,.reelswp-group-short-code .ecr-product-card-one__rating,.reelswp-reel-short-code .ecr-product-card-one__rating{margin-left:4px;display:flex;align-items:center;gap:4px;font-size:12px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__star,.ecommreels-short-code .ecr-product-card-one__star,.reelswp-group-short-code .ecr-product-card-one__star,.reelswp-reel-short-code .ecr-product-card-one__star{width:16px;height:16px;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price,.ecommreels-short-code .ecr-product-card-one__price,.reelswp-group-short-code .ecr-product-card-one__price,.reelswp-reel-short-code .ecr-product-card-one__price{display:flex;align-items:center;gap:.25ch;color:#fff}#ecommreels-admin-app .ecr-product-card-one__price *,.ecommreels-short-code .ecr-product-card-one__price *,.reelswp-group-short-code .ecr-product-card-one__price *,.reelswp-reel-short-code .ecr-product-card-one__price *{line-height:1;background-color:transparent;color:#fff;font-size:12px}#ecommreels-admin-app .ecr-product-card-one__price span.woocommerce-Price-amount,.ecommreels-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-group-short-code .ecr-product-card-one__price span.woocommerce-Price-amount,.reelswp-reel-short-code .ecr-product-card-one__price span.woocommerce-Price-amount{line-height:normal}#ecommreels-admin-app .ecr-thumb__link-list,.ecommreels-short-code .ecr-thumb__link-list,.reelswp-group-short-code .ecr-thumb__link-list,.reelswp-reel-short-code .ecr-thumb__link-list{margin-top:4px;display:flex;flex-direction:column;gap:4px}#ecommreels-admin-app .ecr-thumb__link-list a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-list a.ecr-thumb__link{display:grid;place-items:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:8px;background:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);min-height:57.6px;text-align:center;font-size:16px;font-weight:600;color:#fff;text-decoration:none;border:1px solid #fff}:is(#ecommreels-admin-app .ecr-thumb__link-list a.ecr-thumb__link,.ecommreels-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-group-short-code .ecr-thumb__link-list a.ecr-thumb__link,.reelswp-reel-short-code .ecr-thumb__link-list a.ecr-thumb__link):hover{text-decoration:underline}#ecommreels-admin-app .ecr-admin-reelitem-links,.ecommreels-short-code .ecr-admin-reelitem-links,.reelswp-group-short-code .ecr-admin-reelitem-links,.reelswp-reel-short-code .ecr-admin-reelitem-links{display:flex;align-items:center;gap:8px;overflow:hidden;margin-top:8px;cursor:grab;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-reelitem-links[data-dragging=true] *,.ecommreels-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-group-short-code .ecr-admin-reelitem-links[data-dragging=true] *,.reelswp-reel-short-code .ecr-admin-reelitem-links[data-dragging=true] *{pointer-events:none}#ecommreels-admin-app .ecr-admin-editor-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-admin-editor-carousel__viewport:active{cursor:grabbing}#ecommreels-admin-app .ecr-admin-editor-carousel__track{display:flex;width:max-content;flex-wrap:nowrap;padding:16px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__track--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-carousel__empty{display:flex;width:100%;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-carousel__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-editor-carousel__nav{position:absolute;top:50%;z-index:20;transform:translateY(-50%);border:none;background:#fff;padding:6px 8px;color:#374151;cursor:pointer;width:32px;height:40px;transition:background-color .2s ease;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-admin-editor-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--left{left:0;border-radius:0 999px 999px 0}#ecommreels-admin-app .ecr-admin-editor-carousel__nav--right{right:0;border-radius:999px 0 0 999px}#ecommreels-admin-app .ecr-admin-editor-grid{display:flex;flex-wrap:wrap;row-gap:16px}#ecommreels-admin-app .ecr-admin-editor-grid--padded{padding:16px}#ecommreels-admin-app .ecr-admin-editor-grid__empty{display:flex;width:100%;justify-content:center;padding-top:160px}#ecommreels-admin-app .ecr-admin-editor-grid__empty-text{margin:0;display:flex;width:320px;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:15px;color:#374151}#ecommreels-admin-app .ecr-admin-editor-grid__empty-icon{width:40px;height:40px;color:#f59e0b}#ecommreels-admin-app .ecr-admin-existing{width:100%;flex:1;overflow:hidden;border-radius:8px;border:1px solid #e5e7eb;background:#fff}#ecommreels-admin-app .ecr-admin-existing__header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-existing__title-wrapper{display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-existing__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-existing__body{max-height:800px;overflow-y:auto;padding:8px 16px 16px}#ecommreels-admin-app .ecr-preview-player{background-color:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px;width:100%;min-height:320px;border-radius:4px}#ecommreels-admin-app .ecr-preview-player__stage{position:relative;width:fit-content;height:fit-content}#ecommreels-admin-app .ecr-preview-player .ecr-player__frame{position:relative;aspect-ratio:9 / 16;height:min(70vh,560px);max-width:90vw;overflow:hidden;border-radius:24px}#ecommreels-admin-app .ecr-preview-player__media{width:100%;height:100%}#ecommreels-admin-app .ecr-preview-player__media-item{width:100%;object-fit:cover;display:block}#ecommreels-admin-app .ecr-preview-player__nav--disabled{opacity:.4;cursor:not-allowed}#ecommreels-admin-app .ecr-player__close{position:absolute;top:8px;right:8px;z-index:50;color:#fff;cursor:pointer;mix-blend-mode:difference;line-height:1;background:transparent;border:none}#ecommreels-admin-app .ecr-player__close-icon{font-size:22px;font-weight:800}#ecommreels-admin-app .ecr-player__controls{position:absolute;top:8px;right:40px;z-index:50;display:inline-flex;align-items:center;gap:4px;color:#fff;font-size:22px;mix-blend-mode:difference}#ecommreels-admin-app .ecr-player__control-icon{cursor:pointer}#ecommreels-admin-app .ecr-preview-player__empty{display:grid;place-items:center;color:#fff;font-size:14px;height:100%;width:100%}#ecommreels-admin-app .ecr-reel_title,.ecommreels-short-code .ecr-reel_title,.reelswp-group-short-code .ecr-reel_title,.reelswp-reel-short-code .ecr-reel_title{position:absolute;left:50%;transform:translate(-50%);bottom:8px;text-transform:capitalize;background-color:#0003;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);padding:4px 8px;color:#fff;width:95%;border-radius:8px;border:1px solid #fff;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist{display:flex;flex-direction:column;min-height:100%;width:100%;flex-shrink:0;overflow-y:auto;border-radius:8px;border:1px solid #e5e7eb;background:#fff;box-shadow:0 1px 2px #0000000d}@media(min-width:1024px){#ecommreels-admin-app .ecr-admin-reellist{width:280px}}#ecommreels-admin-app .ecr-admin-reellist__header{border-bottom:1px solid #e5e7eb;padding:16px 16px 8px;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-reellist__title{margin:0;font-size:16px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-reellist__body{margin-top:8px;display:flex;flex-direction:column;gap:12px;padding:0 16px 16px}#ecommreels-admin-app .ecr-admin-reellist__add-button{width:100%;flex-shrink:0;margin-inline-start:0;border:1px solid #2563eb;background:#fff}#ecommreels-admin-app .ecr-admin-reellist__add-button:hover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-reellist__search-input{width:100%;border-radius:4px;border:1px solid #e5e7eb;padding:8px 12px;font-size:13px}#ecommreels-admin-app .ecr-admin-reellist__search-input:focus{outline:none;border-color:#93c5fd;box-shadow:0 0 0 2px #3b82f626}#ecommreels-admin-app .ecr-admin-reellist__grid{margin-top:16px;max-height:60vh;width:100%;overflow-y:auto}#ecommreels-admin-app .ecr-admin-reellist__items{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}#ecommreels-admin-app .ecr-admin-reellist__empty{grid-column:1 / -1;padding:24px 0;text-align:center;font-size:13px;color:#6b7280}#ecommreels-admin-app .ecr-admin-reellist__item{width:100%}#ecommreels-admin-app .ecr-admin-reellist__card{position:relative;width:100%;overflow:hidden;border-radius:6px;border:2px solid #e5e7eb;transition:border-color .2s ease;padding:0}#ecommreels-admin-app .ecr-admin-reellist__card:hover{border-color:#3b82f6}#ecommreels-admin-app .ecr-admin-reellist__media{aspect-ratio:9 / 16;width:100%}#ecommreels-admin-app .ecr-admin-reellist__thumb{pointer-events:none;display:block;width:100%;height:100%;object-fit:cover}#ecommreels-admin-app .ecr-admin-reellist__label{position:absolute;bottom:0;left:0;width:100%;padding:4px;background:linear-gradient(0deg,#fff 20%,#fff0);font-size:13px;font-weight:600;color:#111827;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-admin-reellist__overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#ffffffbf}#ecommreels-admin-app .ecr-admin-reellist__overlay-icon{width:24px;height:24px;color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}#ecommreels-admin-app .ecr-admin-reellist__loader{grid-column:1 / -1;display:flex;justify-content:center;padding:24px 0}#ecommreels-admin-app .ecr-admin-reellist__spinner{width:24px;height:24px;border-radius:999px;border:2px solid #cbd5e1;border-top-color:#3b82f6;animation:ecr-reellist-spin 1s linear infinite}@keyframes ecr-reellist-spin{to{transform:rotate(360deg)}}#ecommreels-admin-app .ecr-tabs{display:flex;flex-direction:column;gap:8px}#ecommreels-admin-app .ecr-tabs__list{display:inline-flex;align-items:center;background:var(--color-muted, #f3f4f6);border-radius:10px;padding:3px;width:fit-content}#ecommreels-admin-app .ecr-tabs__trigger{border:1px solid transparent;border-radius:8px;padding:8px;font-size:13px;font-weight:600;color:var(--color-muted-foreground, #6b7280);background:transparent;transition:background-color .2s ease,color .2s ease,border-color .2s ease}#ecommreels-admin-app .ecr-tabs__trigger[data-state=active]{background:#fff;color:var(--color-foreground, #111827);border-color:var(--color-border, #e5e7eb);box-shadow:0 1px 2px #0000000f}#ecommreels-admin-app .ecr-tabs__content{outline:none}#ecommreels-admin-app .ecr-admin-sidepanel{position:relative;display:flex;flex-direction:column;min-height:100%;max-height:100%;flex-shrink:0;overflow:hidden;border-radius:8px;background:#fff;transition:width .2s ease}#ecommreels-admin-app .ecr-admin-sidepanel--expanded{width:280px;border:2px solid #e5e7eb}#ecommreels-admin-app .ecr-admin-sidepanel--collapsed{width:0;border:0;pointer-events:none}#ecommreels-admin-app .ecr-admin-sidepanel__header{position:relative;display:flex;flex-direction:column;border-bottom:1px solid #e5e7eb;padding:16px 16px 8px}#ecommreels-admin-app .ecr-admin-sidepanel__title{margin:0;font-size:15px;font-weight:600;color:#111827}#ecommreels-admin-app .ecr-admin-sidepanel__body{height:100%;overflow-x:hidden;padding:8px 16px 16px}#ecommreels-admin-app .ecr-admin-sidepanel__tabs,#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{width:100%}#ecommreels-admin-app .ecr-admin-sidepanel__tabs-list{display:grid;grid-template-columns:1fr 1fr}#ecommreels-admin-app .ecr-admin-sidepanel__lock-trigger{display:flex;cursor:pointer;align-items:center;justify-content:center;gap:4px;font-size:13px;color:#6b7280;text-transform:capitalize;padding:8px}#ecommreels-admin-app .ecr-admin-sidepanel__popover{background:#eff6ff}#ecommreels-admin-app .ecr-select__trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--color-border, #d1d5db);border-radius:6px;padding:7.2px 12px;font-size:13px;background:#fff;color:var(--color-foreground, #111827);min-width:fit-content}#ecommreels-admin-app .ecr-select__trigger[data-size=sm]{height:32px}#ecommreels-admin-app .ecr-select__trigger[data-size=default]{height:36px}#ecommreels-admin-app .ecr-select__trigger:focus-visible{outline:none;border-color:var(--color-ring, #60a5fa);box-shadow:0 0 0 3px color-mix(in srgb,#60a5fa 35%,transparent)}#ecommreels-admin-app .ecr-select__icon{width:16px;height:16px;opacity:.6}#ecommreels-admin-app .ecr-select__content{background:#fff;color:var(--color-foreground, #111827);border:1px solid var(--color-border, #d1d5db);border-radius:8px;box-shadow:0 10px 30px #00000026;overflow:hidden;min-width:140px;z-index:50}#ecommreels-admin-app .ecr-select__content[data-side=bottom]{animation:ecr-fade-down .15s ease-out}#ecommreels-admin-app .ecr-select__content[data-side=top]{animation:ecr-fade-up .15s ease-out}#ecommreels-admin-app .ecr-select__viewport{padding:5.6px}#ecommreels-admin-app .ecr-select__item{display:flex;align-items:center;gap:8px;border-radius:6px;padding:8px;font-size:13px;cursor:pointer;text-transform:capitalize}#ecommreels-admin-app .ecr-select__item[data-highlighted]{background:var(--color-accent, #f3f4f6)}#ecommreels-admin-app .ecr-select__item[data-disabled]{opacity:.5;cursor:not-allowed}#ecommreels-admin-app .ecr-select__label{padding:5.6px 8px;font-size:12px;color:var(--color-muted-foreground, #6b7280)}#ecommreels-admin-app .ecr-select__separator{height:1px;margin:4px 0;background:var(--color-border, #e5e7eb)}#ecommreels-admin-app .ecr-select__check{position:absolute;right:8px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-select__check-icon{width:14px;height:14px}#ecommreels-admin-app .ecr-select__scroll-button{display:flex;align-items:center;justify-content:center;padding:4px 0;cursor:default}@keyframes ecr-fade-down{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes ecr-fade-up{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}#ecommreels-admin-app .ecr-collapsible__trigger{align-items:center;display:inline-flex;gap:8px;justify-content:space-between;width:100%}#ecommreels-admin-app .ecr-collapsible__trigger-label{align-items:center;display:inline-flex;gap:4px}#ecommreels-admin-app .ecr-collapsible__trigger-icon{height:16px;width:16px;transition:transform .2s ease}#ecommreels-admin-app .ecr-collapsible__trigger[data-state=open] .ecr-collapsible__trigger-icon{transform:rotate(180deg)}#ecommreels-admin-app .ecr-admin-switch{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;font-weight:500;color:#6b7280}#ecommreels-admin-app .ecr-admin-switch__label{display:inline-flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-switch__icon{color:#6b7280}#ecommreels-admin-app .ecr-admin-popover{background:#eff6ff}#ecommreels-admin-app .ecr-admin-control{display:flex;flex-direction:column;align-items:flex-start;gap:4px}#ecommreels-admin-app .ecr-admin-control--row,#ecommreels-admin-app .ecr-admin-control--inline{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}#ecommreels-admin-app .ecr-admin-control__label{margin:0;font-size:13px;font-weight:600;white-space:nowrap;color:#374151}#ecommreels-admin-app .ecr-admin-control__row{display:flex;align-items:center;gap:12px}#ecommreels-admin-app .ecr-admin-control__row--color{position:relative}#ecommreels-admin-app .ecr-admin-control__choice{display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__choice-label{cursor:pointer;display:flex;align-items:center;gap:4px}#ecommreels-admin-app .ecr-admin-control__trigger,#ecommreels-admin-app .ecr-admin-control__option{text-transform:capitalize}.ecr-admin-control__lock-trigger{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;font-size:13px;color:#6b7280;cursor:pointer;border:none}.ecr-admin-control__lock-trigger:hover{background:#f3f4f6}.ecr-admin-control__popover{background:#eff6ff}.ecr-admin-control__swatch{width:24px;height:24px;cursor:pointer;border-radius:4px;border:2px solid #6b7280}#ecommreels-admin-app .ecr-admin-control__picker{position:absolute;top:100%;left:0;z-index:50;box-shadow:0 8px 16px #0000001f;outline:none}#ecommreels-admin-app .ecr-admin-control__hex{width:80px;border-radius:4px;border:1px solid #6b7280;padding:6px 8px}#ecommreels-admin-app .ecr-admin-thumb-controls{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section{border:1px solid var(--color-border, #e5e7eb);border-radius:10px;padding:12px;background:#fff;display:flex;flex-direction:column}#ecommreels-admin-app .ecr-admin-thumb-controls__section-trigger{align-items:center;background:transparent;border:none;color:var(--color-foreground, #111827);cursor:pointer;display:flex;font-size:13px;font-weight:600;justify-content:space-between;padding:0;text-align:left}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content{display:flex;flex-direction:column;gap:16px}#ecommreels-admin-app .ecr-admin-thumb-controls__section-content[data-state=open]{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}#ecommreels-admin-app,.ecommreels-short-code,.reelswp-group-short-code,.reelswp-reel-short-code{--reels-wp-animation-time: 3s;--reels-wp-marquee-time: 20s}#ecommreels-admin-app .ecr-player__loader,.ecommreels-short-code .ecr-player__loader,.reelswp-group-short-code .ecr-player__loader,.reelswp-reel-short-code .ecr-player__loader{height:90vh;max-width:100vw;aspect-ratio:9 / 16;border-radius:16px;border:1px solid #e5e7eb;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-loader,.ecommreels-short-code .ecr-loader,.reelswp-group-short-code .ecr-loader,.reelswp-reel-short-code .ecr-loader{width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px}#ecommreels-admin-app .ecr-loader__ball,.ecommreels-short-code .ecr-loader__ball,.reelswp-group-short-code .ecr-loader__ball,.reelswp-reel-short-code .ecr-loader__ball{width:20px;height:20px;border-radius:50%;background:#919191;animation:ecr-bounce 1s alternate infinite}#ecommreels-admin-app .ecr-loader__ball:nth-child(2),.ecommreels-short-code .ecr-loader__ball:nth-child(2),.reelswp-group-short-code .ecr-loader__ball:nth-child(2),.reelswp-reel-short-code .ecr-loader__ball:nth-child(2){animation-delay:.25s}#ecommreels-admin-app .ecr-loader__ball:nth-child(3),.ecommreels-short-code .ecr-loader__ball:nth-child(3),.reelswp-group-short-code .ecr-loader__ball:nth-child(3),.reelswp-reel-short-code .ecr-loader__ball:nth-child(3){animation-delay:.5s}@keyframes ecr-bounce{0%{transform:scale(2)}to{transform:scale(1)}}#ecommreels-admin-app .ecr-thumb,.ecommreels-short-code .ecr-thumb,.reelswp-group-short-code .ecr-thumb,.reelswp-reel-short-code .ecr-thumb{display:block}#ecommreels-admin-app .ecr-thumb__frame,.ecommreels-short-code .ecr-thumb__frame,.reelswp-group-short-code .ecr-thumb__frame,.reelswp-reel-short-code .ecr-thumb__frame{cursor:pointer;overflow:hidden;width:100%;position:relative}#ecommreels-admin-app .zoom-in,.ecommreels-short-code .zoom-in,.reelswp-group-short-code .zoom-in,.reelswp-reel-short-code .zoom-in,#ecommreels-admin-app .zoom-out,.ecommreels-short-code .zoom-out,.reelswp-group-short-code .zoom-out,.reelswp-reel-short-code .zoom-out{transition:transform .2s ease-in-out}#ecommreels-admin-app .zoom-in:hover,.ecommreels-short-code .zoom-in:hover,.reelswp-group-short-code .zoom-in:hover,.reelswp-reel-short-code .zoom-in:hover{transform:scale(1.05)}#ecommreels-admin-app .zoom-out:hover,.ecommreels-short-code .zoom-out:hover,.reelswp-group-short-code .zoom-out:hover,.reelswp-reel-short-code .zoom-out:hover{transform:scale(.95)}#ecommreels-admin-app .ecr-reel__title,.ecommreels-short-code .ecr-reel__title,.reelswp-group-short-code .ecr-reel__title,.reelswp-reel-short-code .ecr-reel__title{margin:6px 0 0;text-align:center;font-size:13px;font-weight:500;text-transform:capitalize;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#ecommreels-admin-app .ecr-front-carousel,.ecommreels-short-code .ecr-front-carousel,.reelswp-group-short-code .ecr-front-carousel,.reelswp-reel-short-code .ecr-front-carousel{position:relative;max-width:100%}#ecommreels-admin-app .ecr-front-carousel__viewport,.ecommreels-short-code .ecr-front-carousel__viewport,.reelswp-group-short-code .ecr-front-carousel__viewport,.reelswp-reel-short-code .ecr-front-carousel__viewport{cursor:grab;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-carousel__track,.ecommreels-short-code .ecr-front-carousel__track,.reelswp-group-short-code .ecr-front-carousel__track,.reelswp-reel-short-code .ecr-front-carousel__track{display:flex;flex-wrap:nowrap;width:max-content}#ecommreels-admin-app .ecr-front-carousel__track--zoom,.ecommreels-short-code .ecr-front-carousel__track--zoom,.reelswp-group-short-code .ecr-front-carousel__track--zoom,.reelswp-reel-short-code .ecr-front-carousel__track--zoom{padding:16px}#ecommreels-admin-app .ecr-front-carousel__nav,.ecommreels-short-code .ecr-front-carousel__nav,.reelswp-group-short-code .ecr-front-carousel__nav,.reelswp-reel-short-code .ecr-front-carousel__nav{position:absolute;top:50%;z-index:10;transform:translateY(-50%);border:none;background:#fff;color:#1f2937;cursor:pointer;width:32px;height:40px;padding:0;display:flex;align-items:center;justify-content:center}#ecommreels-admin-app .ecr-front-carousel__nav--left,.ecommreels-short-code .ecr-front-carousel__nav--left,.reelswp-group-short-code .ecr-front-carousel__nav--left,.reelswp-reel-short-code .ecr-front-carousel__nav--left{left:0;border-top-right-radius:999px;border-bottom-right-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav--right,.ecommreels-short-code .ecr-front-carousel__nav--right,.reelswp-group-short-code .ecr-front-carousel__nav--right,.reelswp-reel-short-code .ecr-front-carousel__nav--right{right:0;border-top-left-radius:999px;border-bottom-left-radius:999px}#ecommreels-admin-app .ecr-front-carousel__nav:hover,.ecommreels-short-code .ecr-front-carousel__nav:hover,.reelswp-group-short-code .ecr-front-carousel__nav:hover,.reelswp-reel-short-code .ecr-front-carousel__nav:hover{background:#dbeafe}#ecommreels-admin-app .ecr-front-grid,.ecommreels-short-code .ecr-front-grid,.reelswp-group-short-code .ecr-front-grid,.reelswp-reel-short-code .ecr-front-grid{cursor:default;overflow:hidden;-webkit-user-select:none;user-select:none}#ecommreels-admin-app .ecr-front-grid__list,.ecommreels-short-code .ecr-front-grid__list,.reelswp-group-short-code .ecr-front-grid__list,.reelswp-reel-short-code .ecr-front-grid__list{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--thumbnail-size, 150px),1fr))}
     2/*$vite$:1*/`,document.head.appendChild(ba);function va(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const g=va(y),vr=va(xa);function jd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ln={exports:{}},$t={};/**
    33 * @license React
    44 * react-jsx-runtime.production.min.js
     
    88 * This source code is licensed under the MIT license found in the
    99 * LICENSE file in the root directory of this source tree.
    10  */var pa;function bd(){if(pa)return Ut;pa=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,d){var u,p={},m=null,g=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(g=c.ref);for(u in c)n.call(c,u)&&!i.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:g,props:p,_owner:o.current}}return Ut.Fragment=r,Ut.jsx=s,Ut.jsxs=s,Ut}var ma;function _d(){return ma||(ma=1,On.exports=bd()),On.exports}var a=_d();/**
     10 */var _a;function Sd(){if(_a)return $t;_a=1;var e=y,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(l,c,d){var u,p={},m=null,h=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(h=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(p[u]=c[u]);if(l&&l.defaultProps)for(u in c=l.defaultProps,c)p[u]===void 0&&(p[u]=c[u]);return{$$typeof:t,type:l,key:m,ref:h,props:p,_owner:o.current}}return $t.Fragment=r,$t.jsx=i,$t.jsxs=i,$t}var ya;function Cd(){return ya||(ya=1,Ln.exports=Sd()),Ln.exports}var a=Cd();/**
    1111 * @remix-run/router v1.23.2
    1212 *
     
    1717 *
    1818 * @license MIT
    19  */function Ht(){return Ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ht.apply(this,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const fa="popstate";function yd(e){e===void 0&&(e={});function t(o,i){let{pathname:s="/",search:l="",hash:c=""}=Vt(o.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Rn("",{pathname:s,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(o,i){let s=o.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof i=="string"?i:_r(i))}function n(o,i){ha(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(i)+")")}return Sd(t,r,n,e)}function xe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ha(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wd(){return Math.random().toString(36).substr(2,8)}function ga(e,t){return{usr:e.state,key:e.key,idx:t}}function Rn(e,t,r,n){return r===void 0&&(r=null),Ht({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Vt(t):t,{state:r,key:t&&t.key||n||wd()})}function _r(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Vt(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Sd(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:i=!1}=n,s=o.history,l=Qe.Pop,c=null,d=u();d==null&&(d=0,s.replaceState(Ht({},s.state,{idx:d}),""));function u(){return(s.state||{idx:null}).idx}function p(){l=Qe.Pop;let x=u(),_=x==null?null:x-d;d=x,c&&c({action:l,location:f.location,delta:_})}function m(x,_){l=Qe.Push;let b=Rn(f.location,x,_);r&&r(b,x),d=u()+1;let w=ga(b,d),S=f.createHref(b);try{s.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(S)}i&&c&&c({action:l,location:f.location,delta:1})}function g(x,_){l=Qe.Replace;let b=Rn(f.location,x,_);r&&r(b,x),d=u();let w=ga(b,d),S=f.createHref(b);s.replaceState(w,"",S),i&&c&&c({action:l,location:f.location,delta:0})}function v(x){let _=o.location.origin!=="null"?o.location.origin:o.location.href,b=typeof x=="string"?x:_r(x);return b=b.replace(/ $/,"%20"),xe(_,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,_)}let f={get action(){return l},get location(){return e(o,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(fa,p),c=x,()=>{o.removeEventListener(fa,p),c=null}},createHref(x){return t(o,x)},createURL:v,encodeLocation(x){let _=v(x);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:g,go(x){return s.go(x)}};return f}var xa;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xa||(xa={}));function va(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const jd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cd=e=>jd.test(e);function kd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Vt(e):e,i;if(r)if(Cd(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),ha(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=ba(r.substring(1),"/"):i=ba(r,t)}else i=t;return{pathname:i,search:Ed(n),hash:Td(o)}}function ba(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Ln(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Nd(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _a(e,t){let r=Nd(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function ya(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Vt(e):(o=Ht({},e),xe(!o.pathname||!o.pathname.includes("?"),Ln("?","pathname","search",o)),xe(!o.pathname||!o.pathname.includes("#"),Ln("#","pathname","hash",o)),xe(!o.search||!o.search.includes("#"),Ln("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let m=s.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=kd(o,l),d=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const wa=e=>e.join("/").replace(/\/\/+/g,"/"),Ed=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Td=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Sa=["post","put","patch","delete"];new Set(Sa);const Ad=["get",...Sa];new Set(Ad);/**
     19 */function Bt(){return Bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bt.apply(this,arguments)}var Qe;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qe||(Qe={}));const wa="popstate";function kd(e){e===void 0&&(e={});function t(o,s){let{pathname:i="/",search:l="",hash:c=""}=Ut(o.location.hash.substr(1));return!i.startsWith("/")&&!i.startsWith(".")&&(i="/"+i),In("",{pathname:i,search:l,hash:c},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(o,s){let i=o.document.querySelector("base"),l="";if(i&&i.getAttribute("href")){let c=o.location.href,d=c.indexOf("#");l=d===-1?c:c.slice(0,d)}return l+"#"+(typeof s=="string"?s:_r(s))}function n(o,s){ja(o.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(s)+")")}return Ed(t,r,n,e)}function be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ja(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Nd(){return Math.random().toString(36).substr(2,8)}function Sa(e,t){return{usr:e.state,key:e.key,idx:t}}function In(e,t,r,n){return r===void 0&&(r=null),Bt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ut(t):t,{state:r,key:t&&t.key||n||Nd()})}function _r(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ut(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function Ed(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,l=Qe.Pop,c=null,d=u();d==null&&(d=0,i.replaceState(Bt({},i.state,{idx:d}),""));function u(){return(i.state||{idx:null}).idx}function p(){l=Qe.Pop;let x=u(),_=x==null?null:x-d;d=x,c&&c({action:l,location:f.location,delta:_})}function m(x,_){l=Qe.Push;let v=In(f.location,x,_);r&&r(v,x),d=u()+1;let w=Sa(v,d),j=f.createHref(v);try{i.pushState(w,"",j)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(j)}s&&c&&c({action:l,location:f.location,delta:1})}function h(x,_){l=Qe.Replace;let v=In(f.location,x,_);r&&r(v,x),d=u();let w=Sa(v,d),j=f.createHref(v);i.replaceState(w,"",j),s&&c&&c({action:l,location:f.location,delta:0})}function b(x){let _=o.location.origin!=="null"?o.location.origin:o.location.href,v=typeof x=="string"?x:_r(x);return v=v.replace(/ $/,"%20"),be(_,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,_)}let f={get action(){return l},get location(){return e(o,i)},listen(x){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(wa,p),c=x,()=>{o.removeEventListener(wa,p),c=null}},createHref(x){return t(o,x)},createURL:b,encodeLocation(x){let _=b(x);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:m,replace:h,go(x){return i.go(x)}};return f}var Ca;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ca||(Ca={}));function ka(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const Td=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ad=e=>Td.test(e);function Pd(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Ut(e):e,s;if(r)if(Ad(r))s=r;else{if(r.includes("//")){let i=r;r=r.replace(/\/\/+/g,"/"),ja(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+r))}r.startsWith("/")?s=Na(r.substring(1),"/"):s=Na(r,t)}else s=t;return{pathname:s,search:Rd(n),hash:Ld(o)}}function Na(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function zn(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Od(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ea(e,t){let r=Od(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Ta(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Ut(e):(o=Bt({},e),be(!o.pathname||!o.pathname.includes("?"),zn("?","pathname","search",o)),be(!o.pathname||!o.pathname.includes("#"),zn("#","pathname","hash",o)),be(!o.search||!o.search.includes("#"),zn("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,l;if(i==null)l=r;else{let p=t.length-1;if(!n&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),p-=1;o.pathname=m.join("/")}l=p>=0?t[p]:"/"}let c=Pd(o,l),d=i&&i!=="/"&&i.endsWith("/"),u=(s||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Aa=e=>e.join("/").replace(/\/\/+/g,"/"),Rd=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ld=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Pa=["post","put","patch","delete"];new Set(Pa);const Id=["get",...Pa];new Set(Id);/**
    2020 * React Router v6.30.3
    2121 *
     
    2626 *
    2727 * @license MIT
    28  */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const ja=h.createContext(null),xt=h.createContext(null),In=h.createContext(null),wr=h.createContext({outlet:null,matches:[],isDataRoute:!1});function Pd(e,t){let{relative:r}=t===void 0?{}:t;Sr()||xe(!1);let{basename:n,navigator:o}=h.useContext(xt),{hash:i,pathname:s,search:l}=ka(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:wa([n,s])),o.createHref({pathname:c,search:l,hash:i})}function Sr(){return h.useContext(In)!=null}function Wt(){return Sr()||xe(!1),h.useContext(In).location}function Ca(e){h.useContext(xt).static||h.useLayoutEffect(e)}function je(){let{isDataRoute:e}=h.useContext(wr);return e?Md():Od()}function Od(){Sr()||xe(!1);let e=h.useContext(ja),{basename:t,future:r,navigator:n}=h.useContext(xt),{matches:o}=h.useContext(wr),{pathname:i}=Wt(),s=JSON.stringify(_a(o,r.v7_relativeSplatPath)),l=h.useRef(!1);return Ca(()=>{l.current=!0}),h.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=ya(d,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:wa([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,s,i,e])}function ka(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=h.useContext(xt),{matches:o}=h.useContext(wr),{pathname:i}=Wt(),s=JSON.stringify(_a(o,n.v7_relativeSplatPath));return h.useMemo(()=>ya(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}var Na=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Na||{}),Ea=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Ea||{});function Rd(e){let t=h.useContext(ja);return t||xe(!1),t}function Ld(e){let t=h.useContext(wr);return t||xe(!1),t}function Id(e){let t=Ld(),r=t.matches[t.matches.length-1];return r.route.id||xe(!1),r.route.id}function Md(){let{router:e}=Rd(Na.UseNavigateStable),t=Id(Ea.UseNavigateStable),r=h.useRef(!1);return Ca(()=>{r.current=!0}),h.useCallback(function(o,i){i===void 0&&(i={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},i)))},[e,t])}function zd(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Dd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Qe.Pop,navigator:i,static:s=!1,future:l}=e;Sr()&&xe(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:i,static:s,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=Vt(n));let{pathname:u="/",search:p="",hash:m="",state:g=null,key:v="default"}=n,f=h.useMemo(()=>{let x=va(u,c);return x==null?null:{location:{pathname:x,search:p,hash:m,state:g,key:v},navigationType:o}},[c,u,p,m,g,v,o]);return f==null?null:h.createElement(xt.Provider,{value:d},h.createElement(In.Provider,{children:r,value:f}))}new Promise(()=>{});/**
     28 */function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yr.apply(this,arguments)}const Oa=g.createContext(null),ft=g.createContext(null),Mn=g.createContext(null),wr=g.createContext({outlet:null,matches:[],isDataRoute:!1});function zd(e,t){let{relative:r}=t===void 0?{}:t;jr()||be(!1);let{basename:n,navigator:o}=g.useContext(ft),{hash:s,pathname:i,search:l}=La(e,{relative:r}),c=i;return n!=="/"&&(c=i==="/"?n:Aa([n,i])),o.createHref({pathname:c,search:l,hash:s})}function jr(){return g.useContext(Mn)!=null}function Ht(){return jr()||be(!1),g.useContext(Mn).location}function Ra(e){g.useContext(ft).static||g.useLayoutEffect(e)}function Se(){let{isDataRoute:e}=g.useContext(wr);return e?Bd():Md()}function Md(){jr()||be(!1);let e=g.useContext(Oa),{basename:t,future:r,navigator:n}=g.useContext(ft),{matches:o}=g.useContext(wr),{pathname:s}=Ht(),i=JSON.stringify(Ea(o,r.v7_relativeSplatPath)),l=g.useRef(!1);return Ra(()=>{l.current=!0}),g.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let p=Ta(d,JSON.parse(i),s,u.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Aa([t,p.pathname])),(u.replace?n.replace:n.push)(p,u.state,u)},[t,n,i,s,e])}function La(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=g.useContext(ft),{matches:o}=g.useContext(wr),{pathname:s}=Ht(),i=JSON.stringify(Ea(o,n.v7_relativeSplatPath));return g.useMemo(()=>Ta(e,JSON.parse(i),s,r==="path"),[e,i,s,r])}var Ia=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Ia||{}),za=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(za||{});function Dd(e){let t=g.useContext(Oa);return t||be(!1),t}function Fd(e){let t=g.useContext(wr);return t||be(!1),t}function $d(e){let t=Fd(),r=t.matches[t.matches.length-1];return r.route.id||be(!1),r.route.id}function Bd(){let{router:e}=Dd(Ia.UseNavigateStable),t=$d(za.UseNavigateStable),r=g.useRef(!1);return Ra(()=>{r.current=!0}),g.useCallback(function(o,s){s===void 0&&(s={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,yr({fromRouteId:t},s)))},[e,t])}function Ud(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function Hd(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Qe.Pop,navigator:s,static:i=!1,future:l}=e;jr()&&be(!1);let c=t.replace(/^\/*/,"/"),d=g.useMemo(()=>({basename:c,navigator:s,static:i,future:yr({v7_relativeSplatPath:!1},l)}),[c,l,s,i]);typeof n=="string"&&(n=Ut(n));let{pathname:u="/",search:p="",hash:m="",state:h=null,key:b="default"}=n,f=g.useMemo(()=>{let x=ka(u,c);return x==null?null:{location:{pathname:x,search:p,hash:m,state:h,key:b},navigationType:o}},[c,u,p,m,h,b,o]);return f==null?null:g.createElement(ft.Provider,{value:d},g.createElement(Mn.Provider,{children:r,value:f}))}new Promise(()=>{});/**
    2929 * React Router DOM v6.30.3
    3030 *
     
    3535 *
    3636 * @license MIT
    37  */function Mn(){return Mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mn.apply(this,arguments)}function Fd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,i;for(i=0;i<n.length;i++)o=n[i],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function $d(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Bd(e,t){return e.button===0&&(!t||t==="_self")&&!$d(e)}function zn(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Ud(e,t){let r=zn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(i=>{r.append(o,i)})}),r}const Hd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Vd="6";try{window.__reactRouterVersion=Vd}catch{}const Ta=h["startTransition"];function Wd(e){let{basename:t,children:r,future:n,window:o}=e,i=h.useRef();i.current==null&&(i.current=yd({window:o,v5Compat:!0}));let s=i.current,[l,c]=h.useState({action:s.action,location:s.location}),{v7_startTransition:d}=n||{},u=h.useCallback(p=>{d&&Ta?Ta(()=>c(p)):c(p)},[c,d]);return h.useLayoutEffect(()=>s.listen(u),[s,u]),h.useEffect(()=>zd(n),[n]),h.createElement(Dd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const Gd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=h.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=Fd(t,Hd),{basename:g}=h.useContext(xt),v,f=!1;if(typeof d=="string"&&qd.test(d)&&(v=d,Gd))try{let w=new URL(window.location.href),S=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=va(S.pathname,g);S.origin===w.origin&&C!=null?d=C+S.search+S.hash:f=!0}catch{}let x=Pd(d,{relative:o}),_=Kd(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function b(w){n&&n(w),w.defaultPrevented||_(w)}return h.createElement("a",Mn({},m,{href:v||x,onClick:f||i?n:b,ref:r,target:c}))});var Aa;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Aa||(Aa={}));var Pa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Pa||(Pa={}));function Kd(e,t){let{target:r,replace:n,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=je(),d=Wt(),u=ka(e,{relative:s});return h.useCallback(p=>{if(Bd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(d)===_r(u);c(e,{replace:m,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[d,c,u,n,o,r,e,i,s,l])}function Gt(e){let t=h.useRef(zn(e)),r=h.useRef(!1),n=Wt(),o=h.useMemo(()=>Ud(n.search,r.current?null:t.current),[n.search]),i=je(),s=h.useCallback((l,c)=>{const d=zn(typeof l=="function"?l(o):l);r.current=!0,i("?"+d,c)},[i,o]);return[o,s]}let Yd={data:""},Xd=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Yd},Jd=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Zd=/\/\*[^]*?\*\/|  +/g,Oa=/\n+/g,Be=(e,t)=>{let r="",n="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+s+";":n+=i[1]=="f"?Be(s,i):i+"{"+Be(s,i[1]=="k"?"":t)+"}":typeof s=="object"?n+=Be(s,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Be.p?Be.p(i,s):i+":"+s+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Le={},Ra=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ra(e[r]);return t}return e},Qd=(e,t,r,n,o)=>{let i=Ra(e),s=Le[i]||(Le[i]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(i));if(!Le[s]){let c=i!==e?e:(d=>{let u,p,m=[{}];for(;u=Jd.exec(d.replace(Zd,""));)u[4]?m.shift():u[3]?(p=u[3].replace(Oa," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace(Oa," ").trim();return m[0]})(e);Le[s]=Be(o?{["@keyframes "+s]:c}:c,r?"":"."+s)}let l=r&&Le.g?Le.g:null;return r&&(Le.g=Le[s]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Le[s],t,n,l),s},eu=(e,t,r)=>e.reduce((n,o,i)=>{let s=t[i];if(s&&s.call){let l=s(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;s=c?"."+c:l&&typeof l=="object"?l.props?"":Be(l,""):l===!1?"":l}return n+o+(s??"")},"");function jr(e){let t=this||{},r=e.call?e(t.p):e;return Qd(r.unshift?r.raw?eu(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,Xd(t.target),t.g,t.o,t.k)}let La,Dn,Fn;jr.bind({g:1});let Ie=jr.bind({k:1});function tu(e,t,r,n){Be.p=t,La=e,Dn=r,Fn=n}function Ue(e,t){let r=this||{};return function(){let n=arguments;function o(i,s){let l=Object.assign({},i),c=l.className||o.className;r.p=Object.assign({theme:Dn&&Dn()},l),r.o=/ *go\d+/.test(c),l.className=jr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Fn&&d[0]&&Fn(l),La(d,l)}return o}}var ru=e=>typeof e=="function",Cr=(e,t)=>ru(e)?e(t):e,nu=(()=>{let e=0;return()=>(++e).toString()})(),Ia=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),ou=20,$n="default",Ma=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ma(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(s=>s.id===o||o===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},kr=[],za={toasts:[],pausedAt:void 0,settings:{toastLimit:ou}},Ce={},Da=(e,t=$n)=>{Ce[t]=Ma(Ce[t]||za,e),kr.forEach(([r,n])=>{r===t&&n(Ce[t])})},Fa=e=>Object.keys(Ce).forEach(t=>Da(e,t)),au=e=>Object.keys(Ce).find(t=>Ce[t].toasts.some(r=>r.id===e)),Nr=(e=$n)=>t=>{Da(t,e)},iu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},su=(e={},t=$n)=>{let[r,n]=y.useState(Ce[t]||za),o=y.useRef(Ce[t]);y.useEffect(()=>(o.current!==Ce[t]&&n(Ce[t]),kr.push([t,n]),()=>{let s=kr.findIndex(([l])=>l===t);s>-1&&kr.splice(s,1)}),[t]);let i=r.toasts.map(s=>{var l,c,d;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((l=e[s.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:s.duration||((c=e[s.type])==null?void 0:c.duration)||e?.duration||iu[s.type],style:{...e.style,...(d=e[s.type])==null?void 0:d.style,...s.style}}});return{...r,toasts:i}},lu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||nu()}),qt=e=>(t,r)=>{let n=lu(t,e,r);return Nr(n.toasterId||au(n.id))({type:2,toast:n}),n.id},ne=(e,t)=>qt("blank")(e,t);ne.error=qt("error"),ne.success=qt("success"),ne.loading=qt("loading"),ne.custom=qt("custom"),ne.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Nr(t)(r):Fa(r)},ne.dismissAll=e=>ne.dismiss(void 0,e),ne.remove=(e,t)=>{let r={type:4,toastId:e};t?Nr(t)(r):Fa(r)},ne.removeAll=e=>ne.remove(void 0,e),ne.promise=(e,t,r)=>{let n=ne.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let i=t.success?Cr(t.success,o):void 0;return i?ne.success(i,{id:n,...r,...r?.success}):ne.dismiss(n),o}).catch(o=>{let i=t.error?Cr(t.error,o):void 0;i?ne.error(i,{id:n,...r,...r?.error}):ne.dismiss(n)}),e};var cu=1e3,du=(e,t="default")=>{let{toasts:r,pausedAt:n}=su(e,t),o=y.useRef(new Map).current,i=y.useCallback((p,m=cu)=>{if(o.has(p))return;let g=setTimeout(()=>{o.delete(p),s({type:4,toastId:p})},m);o.set(p,g)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(g=>{if(g.duration===1/0)return;let v=(g.duration||0)+g.pauseDuration-(p-g.createdAt);if(v<0){g.visible&&ne.dismiss(g.id);return}return setTimeout(()=>ne.dismiss(g.id,t),v)});return()=>{m.forEach(g=>g&&clearTimeout(g))}},[r,n,t]);let s=y.useCallback(Nr(t),[t]),l=y.useCallback(()=>{s({type:5,time:Date.now()})},[s]),c=y.useCallback((p,m)=>{s({type:1,toast:{id:p,height:m}})},[s]),d=y.useCallback(()=>{n&&s({type:6,time:Date.now()})},[n,s]),u=y.useCallback((p,m)=>{let{reverseOrder:g=!1,gutter:v=8,defaultPosition:f}=m||{},x=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),_=x.findIndex(w=>w.id===p.id),b=x.filter((w,S)=>S<_&&w.visible).length;return x.filter(w=>w.visible).slice(...g?[b+1]:[0,b]).reduce((w,S)=>w+(S.height||0)+v,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)i(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},uu=Ie`
     37 */function Dn(){return Dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dn.apply(this,arguments)}function Vd(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,s;for(s=0;s<n.length;s++)o=n[s],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function Wd(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qd(e,t){return e.button===0&&(!t||t==="_self")&&!Wd(e)}function Fn(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function Gd(e,t){let r=Fn(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}const Kd=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yd="6";try{window.__reactRouterVersion=Yd}catch{}const Ma=g["startTransition"];function Xd(e){let{basename:t,children:r,future:n,window:o}=e,s=g.useRef();s.current==null&&(s.current=kd({window:o,v5Compat:!0}));let i=s.current,[l,c]=g.useState({action:i.action,location:i.location}),{v7_startTransition:d}=n||{},u=g.useCallback(p=>{d&&Ma?Ma(()=>c(p)):c(p)},[c,d]);return g.useLayoutEffect(()=>i.listen(u),[i,u]),g.useEffect(()=>Ud(n),[n]),g.createElement(Hd,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:i,future:n})}const Jd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=g.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:s,replace:i,state:l,target:c,to:d,preventScrollReset:u,viewTransition:p}=t,m=Vd(t,Kd),{basename:h}=g.useContext(ft),b,f=!1;if(typeof d=="string"&&Zd.test(d)&&(b=d,Jd))try{let w=new URL(window.location.href),j=d.startsWith("//")?new URL(w.protocol+d):new URL(d),C=ka(j.pathname,h);j.origin===w.origin&&C!=null?d=C+j.search+j.hash:f=!0}catch{}let x=zd(d,{relative:o}),_=Qd(d,{replace:i,state:l,target:c,preventScrollReset:u,relative:o,viewTransition:p});function v(w){n&&n(w),w.defaultPrevented||_(w)}return g.createElement("a",Dn({},m,{href:b||x,onClick:f||s?n:v,ref:r,target:c}))});var Da;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Da||(Da={}));var Fa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fa||(Fa={}));function Qd(e,t){let{target:r,replace:n,state:o,preventScrollReset:s,relative:i,viewTransition:l}=t===void 0?{}:t,c=Se(),d=Ht(),u=La(e,{relative:i});return g.useCallback(p=>{if(qd(p,r)){p.preventDefault();let m=n!==void 0?n:_r(d)===_r(u);c(e,{replace:m,state:o,preventScrollReset:s,relative:i,viewTransition:l})}},[d,c,u,n,o,r,e,s,i,l])}function Vt(e){let t=g.useRef(Fn(e)),r=g.useRef(!1),n=Ht(),o=g.useMemo(()=>Gd(n.search,r.current?null:t.current),[n.search]),s=Se(),i=g.useCallback((l,c)=>{const d=Fn(typeof l=="function"?l(o):l);r.current=!0,s("?"+d,c)},[s,o]);return[o,i]}let eu={data:""},tu=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||eu},ru=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,nu=/\/\*[^]*?\*\/|  +/g,$a=/\n+/g,Be=(e,t)=>{let r="",n="",o="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?r=s+" "+i+";":n+=s[1]=="f"?Be(i,s):s+"{"+Be(i,s[1]=="k"?"":t)+"}":typeof i=="object"?n+=Be(i,t?t.replace(/([^,])+/g,l=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):s):i!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=Be.p?Be.p(s,i):s+":"+i+";")}return r+(t&&o?t+"{"+o+"}":o)+n},Le={},Ba=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+Ba(e[r]);return t}return e},ou=(e,t,r,n,o)=>{let s=Ba(e),i=Le[s]||(Le[s]=(c=>{let d=0,u=11;for(;d<c.length;)u=101*u+c.charCodeAt(d++)>>>0;return"go"+u})(s));if(!Le[i]){let c=s!==e?e:(d=>{let u,p,m=[{}];for(;u=ru.exec(d.replace(nu,""));)u[4]?m.shift():u[3]?(p=u[3].replace($a," ").trim(),m.unshift(m[0][p]=m[0][p]||{})):m[0][u[1]]=u[2].replace($a," ").trim();return m[0]})(e);Le[i]=Be(o?{["@keyframes "+i]:c}:c,r?"":"."+i)}let l=r&&Le.g?Le.g:null;return r&&(Le.g=Le[i]),((c,d,u,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=u?c+d.data:d.data+c)})(Le[i],t,n,l),i},au=(e,t,r)=>e.reduce((n,o,s)=>{let i=t[s];if(i&&i.call){let l=i(r),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;i=c?"."+c:l&&typeof l=="object"?l.props?"":Be(l,""):l===!1?"":l}return n+o+(i??"")},"");function Sr(e){let t=this||{},r=e.call?e(t.p):e;return ou(r.unshift?r.raw?au(r,[].slice.call(arguments,1),t.p):r.reduce((n,o)=>Object.assign(n,o&&o.call?o(t.p):o),{}):r,tu(t.target),t.g,t.o,t.k)}let Ua,$n,Bn;Sr.bind({g:1});let Ie=Sr.bind({k:1});function su(e,t,r,n){Be.p=t,Ua=e,$n=r,Bn=n}function Ue(e,t){let r=this||{};return function(){let n=arguments;function o(s,i){let l=Object.assign({},s),c=l.className||o.className;r.p=Object.assign({theme:$n&&$n()},l),r.o=/ *go\d+/.test(c),l.className=Sr.apply(r,n)+(c?" "+c:"");let d=e;return e[0]&&(d=l.as||e,delete l.as),Bn&&d[0]&&Bn(l),Ua(d,l)}return o}}var iu=e=>typeof e=="function",Cr=(e,t)=>iu(e)?e(t):e,lu=(()=>{let e=0;return()=>(++e).toString()})(),Ha=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),cu=20,Un="default",Va=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return Va(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(i=>i.id===o||o===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+s}))}}},kr=[],Wa={toasts:[],pausedAt:void 0,settings:{toastLimit:cu}},Ce={},qa=(e,t=Un)=>{Ce[t]=Va(Ce[t]||Wa,e),kr.forEach(([r,n])=>{r===t&&n(Ce[t])})},Ga=e=>Object.keys(Ce).forEach(t=>qa(e,t)),du=e=>Object.keys(Ce).find(t=>Ce[t].toasts.some(r=>r.id===e)),Nr=(e=Un)=>t=>{qa(t,e)},uu={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},pu=(e={},t=Un)=>{let[r,n]=y.useState(Ce[t]||Wa),o=y.useRef(Ce[t]);y.useEffect(()=>(o.current!==Ce[t]&&n(Ce[t]),kr.push([t,n]),()=>{let i=kr.findIndex(([l])=>l===t);i>-1&&kr.splice(i,1)}),[t]);let s=r.toasts.map(i=>{var l,c,d;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((l=e[i.type])==null?void 0:l.removeDelay)||e?.removeDelay,duration:i.duration||((c=e[i.type])==null?void 0:c.duration)||e?.duration||uu[i.type],style:{...e.style,...(d=e[i.type])==null?void 0:d.style,...i.style}}});return{...r,toasts:s}},mu=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:r?.id||lu()}),Wt=e=>(t,r)=>{let n=mu(t,e,r);return Nr(n.toasterId||du(n.id))({type:2,toast:n}),n.id},oe=(e,t)=>Wt("blank")(e,t);oe.error=Wt("error"),oe.success=Wt("success"),oe.loading=Wt("loading"),oe.custom=Wt("custom"),oe.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Nr(t)(r):Ga(r)},oe.dismissAll=e=>oe.dismiss(void 0,e),oe.remove=(e,t)=>{let r={type:4,toastId:e};t?Nr(t)(r):Ga(r)},oe.removeAll=e=>oe.remove(void 0,e),oe.promise=(e,t,r)=>{let n=oe.loading(t.loading,{...r,...r?.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Cr(t.success,o):void 0;return s?oe.success(s,{id:n,...r,...r?.success}):oe.dismiss(n),o}).catch(o=>{let s=t.error?Cr(t.error,o):void 0;s?oe.error(s,{id:n,...r,...r?.error}):oe.dismiss(n)}),e};var fu=1e3,hu=(e,t="default")=>{let{toasts:r,pausedAt:n}=pu(e,t),o=y.useRef(new Map).current,s=y.useCallback((p,m=fu)=>{if(o.has(p))return;let h=setTimeout(()=>{o.delete(p),i({type:4,toastId:p})},m);o.set(p,h)},[]);y.useEffect(()=>{if(n)return;let p=Date.now(),m=r.map(h=>{if(h.duration===1/0)return;let b=(h.duration||0)+h.pauseDuration-(p-h.createdAt);if(b<0){h.visible&&oe.dismiss(h.id);return}return setTimeout(()=>oe.dismiss(h.id,t),b)});return()=>{m.forEach(h=>h&&clearTimeout(h))}},[r,n,t]);let i=y.useCallback(Nr(t),[t]),l=y.useCallback(()=>{i({type:5,time:Date.now()})},[i]),c=y.useCallback((p,m)=>{i({type:1,toast:{id:p,height:m}})},[i]),d=y.useCallback(()=>{n&&i({type:6,time:Date.now()})},[n,i]),u=y.useCallback((p,m)=>{let{reverseOrder:h=!1,gutter:b=8,defaultPosition:f}=m||{},x=r.filter(w=>(w.position||f)===(p.position||f)&&w.height),_=x.findIndex(w=>w.id===p.id),v=x.filter((w,j)=>j<_&&w.visible).length;return x.filter(w=>w.visible).slice(...h?[v+1]:[0,v]).reduce((w,j)=>w+(j.height||0)+b,0)},[r]);return y.useEffect(()=>{r.forEach(p=>{if(p.dismissed)s(p.id,p.removeDelay);else{let m=o.get(p.id);m&&(clearTimeout(m),o.delete(p.id))}})},[r,s]),{toasts:r,handlers:{updateHeight:c,startPause:l,endPause:d,calculateOffset:u}}},gu=Ie`
    3838from {
    3939  transform: scale(0) rotate(45deg);
     
    4343 transform: scale(1) rotate(45deg);
    4444  opacity: 1;
    45 }`,pu=Ie`
     45}`,xu=Ie`
    4646from {
    4747  transform: scale(0);
     
    5151  transform: scale(1);
    5252  opacity: 1;
    53 }`,mu=Ie`
     53}`,bu=Ie`
    5454from {
    5555  transform: scale(0) rotate(90deg);
     
    5959  transform: scale(1) rotate(90deg);
    6060    opacity: 1;
    61 }`,fu=Ue("div")`
     61}`,vu=Ue("div")`
    6262  width: 20px;
    6363  opacity: 0;
     
    6868  transform: rotate(45deg);
    6969
    70   animation: ${uu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
     70  animation: ${gu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    7171    forwards;
    7272  animation-delay: 100ms;
     
    7575  &:before {
    7676    content: '';
    77     animation: ${pu} 0.15s ease-out forwards;
     77    animation: ${xu} 0.15s ease-out forwards;
    7878    animation-delay: 150ms;
    7979    position: absolute;
     
    8888
    8989  &:before {
    90     animation: ${mu} 0.15s ease-out forwards;
     90    animation: ${bu} 0.15s ease-out forwards;
    9191    animation-delay: 180ms;
    9292    transform: rotate(90deg);
    9393  }
    94 `,hu=Ie`
     94`,_u=Ie`
    9595  from {
    9696    transform: rotate(0deg);
     
    9999    transform: rotate(360deg);
    100100  }
    101 `,gu=Ue("div")`
     101`,yu=Ue("div")`
    102102  width: 12px;
    103103  height: 12px;
     
    107107  border-color: ${e=>e.secondary||"#e0e0e0"};
    108108  border-right-color: ${e=>e.primary||"#616161"};
    109   animation: ${hu} 1s linear infinite;
    110 `,xu=Ie`
     109  animation: ${_u} 1s linear infinite;
     110`,wu=Ie`
    111111from {
    112112  transform: scale(0) rotate(45deg);
     
    116116  transform: scale(1) rotate(45deg);
    117117    opacity: 1;
    118 }`,vu=Ie`
     118}`,ju=Ie`
    1191190% {
    120120    height: 0;
     
    130130  opacity: 1;
    131131  height: 10px;
    132 }`,bu=Ue("div")`
     132}`,Su=Ue("div")`
    133133  width: 20px;
    134134  opacity: 0;
     
    139139  transform: rotate(45deg);
    140140
    141   animation: ${xu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
     141  animation: ${wu} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    142142    forwards;
    143143  animation-delay: 100ms;
     
    145145    content: '';
    146146    box-sizing: border-box;
    147     animation: ${vu} 0.2s ease-out forwards;
     147    animation: ${ju} 0.2s ease-out forwards;
    148148    opacity: 0;
    149149    animation-delay: 200ms;
     
    157157    width: 6px;
    158158  }
    159 `,_u=Ue("div")`
     159`,Cu=Ue("div")`
    160160  position: absolute;
    161 `,yu=Ue("div")`
     161`,ku=Ue("div")`
    162162  position: relative;
    163163  display: flex;
     
    166166  min-width: 20px;
    167167  min-height: 20px;
    168 `,wu=Ie`
     168`,Nu=Ie`
    169169from {
    170170  transform: scale(0.6);
     
    174174  transform: scale(1);
    175175  opacity: 1;
    176 }`,Su=Ue("div")`
     176}`,Eu=Ue("div")`
    177177  position: relative;
    178178  transform: scale(0.6);
    179179  opacity: 0.4;
    180180  min-width: 20px;
    181   animation: ${wu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
     181  animation: ${Nu} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    182182    forwards;
    183 `,ju=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?h.createElement(Su,null,t):t:r==="blank"?null:h.createElement(yu,null,h.createElement(gu,{...n}),r!=="loading"&&h.createElement(_u,null,r==="error"?h.createElement(fu,{...n}):h.createElement(bu,{...n})))},Cu=e=>`
     183`,Tu=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?g.createElement(Eu,null,t):t:r==="blank"?null:g.createElement(ku,null,g.createElement(yu,{...n}),r!=="loading"&&g.createElement(Cu,null,r==="error"?g.createElement(vu,{...n}):g.createElement(Su,{...n})))},Au=e=>`
    1841840% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
    185185100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
    186 `,ku=e=>`
     186`,Pu=e=>`
    1871870% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
    188188100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
    189 `,Nu="0%{opacity:0;} 100%{opacity:1;}",Eu="0%{opacity:1;} 100%{opacity:0;}",Tu=Ue("div")`
     189`,Ou="0%{opacity:0;} 100%{opacity:1;}",Ru="0%{opacity:1;} 100%{opacity:0;}",Lu=Ue("div")`
    190190  display: flex;
    191191  align-items: center;
     
    199199  padding: 8px 10px;
    200200  border-radius: 8px;
    201 `,Au=Ue("div")`
     201`,Iu=Ue("div")`
    202202  display: flex;
    203203  justify-content: center;
     
    206206  flex: 1 1 auto;
    207207  white-space: pre-line;
    208 `,Pu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Ia()?[Nu,Eu]:[Cu(r),ku(r)];return{animation:t?`${Ie(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Ou=h.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?Pu(e.position||t||"top-center",e.visible):{opacity:0},i=h.createElement(ju,{toast:e}),s=h.createElement(Au,{...e.ariaProps},Cr(e.message,e));return h.createElement(Tu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:i,message:s}):h.createElement(h.Fragment,null,i,s))});tu(h.createElement);var Ru=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let i=h.useCallback(s=>{if(s){let l=()=>{let c=s.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return h.createElement("div",{ref:i,className:t,style:r},o)},Lu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ia()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},Iu=jr`
     208`,zu=(e,t)=>{let r=e.includes("top")?1:-1,[n,o]=Ha()?[Ou,Ru]:[Au(r),Pu(r)];return{animation:t?`${Ie(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ie(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Mu=g.memo(({toast:e,position:t,style:r,children:n})=>{let o=e.height?zu(e.position||t||"top-center",e.visible):{opacity:0},s=g.createElement(Tu,{toast:e}),i=g.createElement(Iu,{...e.ariaProps},Cr(e.message,e));return g.createElement(Lu,{className:e.className,style:{...o,...r,...e.style}},typeof n=="function"?n({icon:s,message:i}):g.createElement(g.Fragment,null,s,i))});su(g.createElement);var Du=({id:e,className:t,style:r,onHeightUpdate:n,children:o})=>{let s=g.useCallback(i=>{if(i){let l=()=>{let c=i.getBoundingClientRect().height;n(e,c)};l(),new MutationObserver(l).observe(i,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return g.createElement("div",{ref:s,className:t,style:r},o)},Fu=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ha()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}},$u=Sr`
    209209  z-index: 9999;
    210210  > * {
    211211    pointer-events: auto;
    212212  }
    213 `,Er=16,Mu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:i,containerStyle:s,containerClassName:l})=>{let{toasts:c,handlers:d}=du(r,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Er,left:Er,right:Er,bottom:Er,pointerEvents:"none",...s},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),g=Lu(p,m);return h.createElement(Ru,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?Iu:"",style:g},u.type==="custom"?Cr(u.message,u):o?o(u):h.createElement(Ou,{toast:u,position:p}))}))},q=ne;const $a={carousel:"carousel",grid:"grid"},zu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,shape:"rectangle",size:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:$a.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Du=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Ba=[{label:"Horizontal",value:"horizontal"}],Fu=[{label:"Vertical",value:"vertical"}],$u=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],Bu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Ua={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ha=y.createContext&&y.createContext(Ua),Uu=["attr","size","title"];function Hu(e,t){if(e==null)return{};var r=Vu(e,t),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Vu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tr.apply(this,arguments)}function Va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(n){Wu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wu(e,t,r){return t=Gu(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gu(e){var t=qu(e,"string");return typeof t=="symbol"?t:t+""}function qu(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wa(e){return e&&e.map((t,r)=>y.createElement(t.tag,Ar({key:r},t.attr),Wa(t.child)))}function V(e){return t=>y.createElement(Ku,Tr({attr:Ar({},e.attr)},t),Wa(e.child))}function Ku(e){var t=r=>{var{attr:n,size:o,title:i}=e,s=Hu(e,Uu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:c,style:Ar(Ar({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&y.createElement("title",null,i),e.children)};return Ha!==void 0?y.createElement(Ha.Consumer,null,r=>t(r)):t(Ua)}function Yu(e){return V({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function bt(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function _t(e){return V({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Kt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function Yt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function Xu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function Ju(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function tt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function Zu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function Ga(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function Qu(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function Xt(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function qa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bn(...e){return t=>{let r=!1;const n=e.map(o=>{const i=qa(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():qa(e[o],null)}}}}function Y(...e){return h.useCallback(Bn(...e),e)}function rt(e){const t=tp(e),r=h.forwardRef((n,o)=>{const{children:i,...s}=n,l=h.Children.toArray(i),c=l.find(np);if(c){const d=c.props.children,u=l.map(p=>p===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var ep=rt("Slot");function tp(e){const t=h.forwardRef((r,n)=>{const{children:o,...i}=r;if(h.isValidElement(o)){const s=ap(o),l=op(i,o.props);return o.type!==h.Fragment&&(l.ref=n?Bn(n,s):s),h.cloneElement(o,l)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rp=Symbol("radix.slottable");function np(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rp}function op(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function ap(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ka(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Ka(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ip(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Ka(e))&&(n&&(n+=" "),n+=t);return n}function D(...e){return ip(e)}const sp="ecr-button",lp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},cp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function oe({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const i=n?ep:"button";return a.jsx(i,{"data-slot":"button","data-variant":t,"data-size":r,className:D(sp,lp[t],cp[r],e),...o})}function dp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:i,handleCreateGroup:s}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(oe,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(oe,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:l=>o(l.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(oe,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(Xt,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(Ga,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(oe,{disabled:i,onClick:s,className:"ecr-admin-reels-header__create",children:[i?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(_t,{})," ","Create Group"]}):null]})]})}function up(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function pp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function nt(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function mp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function fp({isFullScreen:e}){return a.jsx("div",{className:D("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const Ya=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,i)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:D("ecr-player__progress-fill",i===r?.index?"ecr-player__progress-fill--active":i<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},i))}),yt=({className:e,children:t,...r})=>a.jsx("button",{className:D("ecr-player__nav",e),...r,children:t});function Un(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Hn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function Vn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Wn(e){return V({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const hp="Left",gp="Right",xp="Up",vp="Down",wt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Gn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Xa="mousemove",Ja="mouseup",bp="touchend",_p="touchmove",yp="touchstart";function Sp(e,t,r,n){return e>t?r>0?gp:hp:n>0?vp:xp}function Za(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function jp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,g)=>{g.trackMouse&&!p&&(document.addEventListener(Xa,n),document.addEventListener(Ja,s));const{clientX:v,clientY:f}=p?u.touches[0]:u,x=Za([v,f],g.rotationAngle);return g.onTouchStartOrOnMouseDown&&g.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Gn),{initial:x.slice(),xy:x,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const g="touches"in u;if(g&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:v,clientY:f}=g?u.touches[0]:u,[x,_]=Za([v,f],m.rotationAngle),b=x-p.xy[0],w=_-p.xy[1],S=Math.abs(b),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(S*S+C*C)/(N||1),E=[b/(N||1),w/(N||1)],T=Sp(S,C,b,w),R=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||wt.delta;if(S<R&&C<R&&!p.swiping)return p;const I={absX:S,absY:C,deltaX:b,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};I.first&&m.onSwipeStart&&m.onSwipeStart(I),m.onSwiping&&m.onSwiping(I);let A=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(A=!0),A&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:I,swiping:!0})})},o=u=>{e((p,m)=>{let g;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){g=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(g);const v=m[`onSwiped${g.dir}`];v&&v(g)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Gn),{eventData:g})})},i=()=>{document.removeEventListener(Xa,n),document.removeEventListener(Ja,s)},s=u=>{i(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const g=Object.assign(Object.assign({},wt.touchEventOptions),p.touchEventOptions),v=[[yp,r,g],[_p,n,Object.assign(Object.assign({},g),p.preventScrollOnSwipe?{passive:!1}:{})],[bp,o,g]];v.forEach(([f,x,_])=>u.addEventListener(f,x,_)),m=()=>v.forEach(([f,x])=>u.removeEventListener(f,x))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const g={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),g.cleanUpTouch=void 0),m.trackTouch&&u&&(g.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),g)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Cp(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function kp(e){const{trackMouse:t}=e,r=h.useRef(Object.assign({},Gn)),n=h.useRef(Object.assign({},wt)),o=h.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},wt),e);let i;for(i in wt)n.current[i]===void 0&&(n.current[i]=wt[i]);const[s,l]=h.useMemo(()=>jp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Cp(r.current,n.current,o.current,l),s}const Np=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:i,handleNextFile:s,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>i(o),onEnded:s,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,g=p.videoHeight;d(g>m),l(p.duration)}})})},Qa=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:i,setIsPaused:s,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=x=>{const _=p.current[x];_&&(i?_.play():_.pause(),s(b=>!b))},g=x=>{const _=p.current[x];_&&(_.muted=!d,u(b=>!b))},v=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=kp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{v&&c()},onSwipedDown:()=>{if(v){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((x,_)=>a.jsx("div",{className:"ecr-player__slide",children:x?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Np,{videoRefs:p,file:x,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:i},x.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[i?a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(Un,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Hn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)}):a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:()=>g(_)})]})]})},_))})},Ep=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,i]=y.useState(!1),[s,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(g=>({index:g.index-1,story_uuid:m[g.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(g=>({index:g.index+1,story_uuid:m[g.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(yt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Kt,{size:24})}):null,r.index<u-1?a.jsx(yt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Yt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(Ya,{playingStory:e,duration:s,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(Xt,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(Qa,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:i,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Tp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Ap(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function Pp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Op(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ei(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Rp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Lp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function Ip(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Mp(e){return V({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}function ti(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function zp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Dp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function Fp(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function $p(e){return V({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}const Bp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Up=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(s=>({...s,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),i=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:i}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:Bp(r?.[e.id]??e.view_count)}),a.jsx(Ju,{size:14})]})]})},qn=y.memo(Up);function Hp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:s}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:D("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(qn,{story:e,styles:t}),a.jsxs("div",{className:D("ecr-admin-reel-card__actions",s?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(oe,{onClick:()=>i(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx($p,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(oe,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(vt,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(oe,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(ti,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:D("ecr-admin-reel-card__corner",s?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(oe,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Rp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Lp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel-card__title",children:e.title})]})}function Vp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:i,lastStoryElementRef:s}){return a.jsx("div",{style:{"--thumbnail-size":`${t?.size}px`},className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?s:null,children:a.jsx(Hp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:i,isAnyReelSelected:r.length>0})},l.id))})}const Jt=({cb:e})=>{const t=je(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(up,{size:24})})};function Wp(e){return V({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const Zt=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(vt,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:i=>{if(!t)return;const s=r.href;s&&(i.preventDefault(),t(s))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Wp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Or=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:i=>{i.currentTarget.contains(i.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(Qu,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:i})=>a.jsxs(vt,{style:{color:r},to:e,className:D("ecr-admin-link-button",o),onClick:s=>{i&&(s.preventDefault(),i(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:D("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),St=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),jt=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Gp(e){return V({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const Ir=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Gp,{}),"ReelsWP"]});function ri(e,t){return function(){return e.apply(t,arguments)}}const{toString:qp}=Object.prototype,{getPrototypeOf:Kn}=Object,{iterator:Mr,toStringTag:ni}=Symbol,zr=(e=>t=>{const r=qp.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ve=e=>(e=e.toLowerCase(),t=>zr(t)===e),Dr=e=>t=>typeof t===e,{isArray:Ct}=Array,kt=Dr("undefined");function Qt(e){return e!==null&&!kt(e)&&e.constructor!==null&&!kt(e.constructor)&&ce(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const oi=ve("ArrayBuffer");function Kp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&oi(e.buffer),t}const Yp=Dr("string"),ce=Dr("function"),ai=Dr("number"),er=e=>e!==null&&typeof e=="object",Xp=e=>e===!0||e===!1,Fr=e=>{if(zr(e)!=="object")return!1;const t=Kn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ni in e)&&!(Mr in e)},Jp=e=>{if(!er(e)||Qt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Zp=ve("Date"),Qp=ve("File"),em=ve("Blob"),tm=ve("FileList"),rm=e=>er(e)&&ce(e.pipe),nm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ce(e.append)&&((t=zr(e))==="formdata"||t==="object"&&ce(e.toString)&&e.toString()==="[object FormData]"))},om=ve("URLSearchParams"),[am,im,sm,lm]=["ReadableStream","Request","Response","Headers"].map(ve),cm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function tr(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),Ct(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Qt(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(n=0;n<s;n++)l=i[n],t.call(null,e[l],l,e)}}function ii(e,t){if(Qt(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,si=e=>!kt(e)&&e!==ot;function Yn(){const{caseless:e,skipUndefined:t}=si(this)&&this||{},r={},n=(o,i)=>{const s=e&&ii(r,i)||i;Fr(r[s])&&Fr(o)?r[s]=Yn(r[s],o):Fr(o)?r[s]=Yn({},o):Ct(o)?r[s]=o.slice():(!t||!kt(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&tr(arguments[o],n);return r}const dm=(e,t,r,{allOwnKeys:n}={})=>(tr(t,(o,i)=>{r&&ce(o)?e[i]=ri(o,r):e[i]=o},{allOwnKeys:n}),e),um=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),pm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},mm=(e,t,r,n)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=r!==!1&&Kn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},fm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},hm=e=>{if(!e)return null;if(Ct(e))return e;let t=e.length;if(!ai(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},gm=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Kn(Uint8Array)),xm=(e,t)=>{const n=(e&&e[Mr]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},vm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},bm=ve("HTMLFormElement"),_m=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),li=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ym=ve("RegExp"),ci=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};tr(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},wm=e=>{ci(e,(t,r)=>{if(ce(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ce(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Sm=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return Ct(e)?n(e):n(String(e).split(t)),r},jm=()=>{},Cm=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function km(e){return!!(e&&ce(e.append)&&e[ni]==="FormData"&&e[Mr])}const Nm=e=>{const t=new Array(10),r=(n,o)=>{if(er(n)){if(t.indexOf(n)>=0)return;if(Qt(n))return n;if(!("toJSON"in n)){t[o]=n;const i=Ct(n)?[]:{};return tr(n,(s,l)=>{const c=r(s,o+1);!kt(c)&&(i[l]=c)}),t[o]=void 0,i}}return n};return r(e,0)},Em=ve("AsyncFunction"),Tm=e=>e&&(er(e)||ce(e))&&ce(e.then)&&ce(e.catch),di=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:i})=>{o===ot&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ce(ot.postMessage)),Am=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||di,j={isArray:Ct,isArrayBuffer:oi,isBuffer:Qt,isFormData:nm,isArrayBufferView:Kp,isString:Yp,isNumber:ai,isBoolean:Xp,isObject:er,isPlainObject:Fr,isEmptyObject:Jp,isReadableStream:am,isRequest:im,isResponse:sm,isHeaders:lm,isUndefined:kt,isDate:Zp,isFile:Qp,isBlob:em,isRegExp:ym,isFunction:ce,isStream:rm,isURLSearchParams:om,isTypedArray:gm,isFileList:tm,forEach:tr,merge:Yn,extend:dm,trim:cm,stripBOM:um,inherits:pm,toFlatObject:mm,kindOf:zr,kindOfTest:ve,endsWith:fm,toArray:hm,forEachEntry:xm,matchAll:vm,isHTMLForm:bm,hasOwnProperty:li,hasOwnProp:li,reduceDescriptors:ci,freezeMethods:wm,toObjectSet:Sm,toCamelCase:_m,noop:jm,toFiniteNumber:Cm,findKey:ii,global:ot,isContextDefined:si,isSpecCompliantForm:km,toJSONObject:Nm,isAsyncFn:Em,isThenable:Tm,setImmediate:di,asap:Am,isIterable:e=>e!=null&&ce(e[Mr])};function B(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}j.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:j.toJSONObject(this.config),code:this.code,status:this.status}}});const ui=B.prototype,pi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{pi[e]={value:e}}),Object.defineProperties(B,pi),Object.defineProperty(ui,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,i)=>{const s=Object.create(ui);j.toFlatObject(e,s,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return B.call(s,l,c,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Pm=null;function Xn(e){return j.isPlainObject(e)||j.isArray(e)}function mi(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function fi(e,t,r){return e?e.concat(t).map(function(o,i){return o=mi(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Om(e){return j.isArray(e)&&!e.some(Xn)}const Rm=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(e,t,r){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=j.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,x){return!j.isUndefined(x[f])});const n=r.metaTokens,o=r.visitor||u,i=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(o))throw new TypeError("visitor must be a function");function d(v){if(v===null)return"";if(j.isDate(v))return v.toISOString();if(j.isBoolean(v))return v.toString();if(!c&&j.isBlob(v))throw new B("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(v)||j.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function u(v,f,x){let _=v;if(v&&!x&&typeof v=="object"){if(j.endsWith(f,"{}"))f=n?f:f.slice(0,-2),v=JSON.stringify(v);else if(j.isArray(v)&&Om(v)||(j.isFileList(v)||j.endsWith(f,"[]"))&&(_=j.toArray(v)))return f=mi(f),_.forEach(function(w,S){!(j.isUndefined(w)||w===null)&&t.append(s===!0?fi([f],S,i):s===null?f:f+"[]",d(w))}),!1}return Xn(v)?!0:(t.append(fi(x,f,i),d(v)),!1)}const p=[],m=Object.assign(Rm,{defaultVisitor:u,convertValue:d,isVisitable:Xn});function g(v,f){if(!j.isUndefined(v)){if(p.indexOf(v)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(v),j.forEach(v,function(_,b){(!(j.isUndefined(_)||_===null)&&o.call(t,_,j.isString(b)?b.trim():b,f,m))===!0&&g(_,f?f.concat(b):[b])}),p.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return g(e),t}function hi(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Jn(e,t){this._pairs=[],e&&$r(e,this,t)}const gi=Jn.prototype;gi.append=function(t,r){this._pairs.push([t,r])},gi.toString=function(t){const r=t?function(n){return t.call(this,n,hi)}:hi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Lm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function xi(e,t,r){if(!t)return e;const n=r&&r.encode||Lm;j.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=j.isURLSearchParams(t)?t.toString():new Jn(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class vi{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){j.forEach(this.handlers,function(n){n!==null&&t(n)})}}const bi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Im={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Jn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Zn=typeof window<"u"&&typeof document<"u",Qn=typeof navigator=="object"&&navigator||void 0,Mm=Zn&&(!Qn||["ReactNative","NativeScript","NS"].indexOf(Qn.product)<0),zm=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dm=Zn&&window.location.href||"http://localhost",se={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Zn,hasStandardBrowserEnv:Mm,hasStandardBrowserWebWorkerEnv:zm,navigator:Qn,origin:Dm},Symbol.toStringTag,{value:"Module"})),...Im};function Fm(e,t){return $r(e,new se.classes.URLSearchParams,{visitor:function(r,n,o,i){return se.isNode&&j.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function $m(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Bm(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function _i(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const l=Number.isFinite(+s),c=i>=r.length;return s=!s&&j.isArray(o)?o.length:s,c?(j.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!l):((!o[s]||!j.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&j.isArray(o[s])&&(o[s]=Bm(o[s])),!l)}if(j.isFormData(e)&&j.isFunction(e.entries)){const r={};return j.forEachEntry(e,(n,o)=>{t($m(n),o,r,0)}),r}return null}function Um(e,t,r){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const rr={transitional:bi,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=j.isObject(t);if(i&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return o?JSON.stringify(_i(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Fm(t,this.formSerializer).toString();if((l=j.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $r(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),Um(t)):t}],transformResponse:[function(t){const r=this.transitional||rr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?B.from(l,B.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:se.classes.FormData,Blob:se.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};j.forEach(["delete","get","head","post","put","patch"],e=>{rr.headers[e]={}});const Hm=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Vm=e=>{const t={};let r,n,o;return e&&e.split(`
    214 `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Hm[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},yi=Symbol("internals");function nr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:j.isArray(e)?e.map(Br):String(e)}function Wm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Gm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eo(e,t,r,n,o){if(j.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!j.isString(t)){if(j.isString(n))return t.indexOf(n)!==-1;if(j.isRegExp(n))return n.test(t)}}function qm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Km(e,t){const r=j.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let de=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(l,c,d){const u=nr(c);if(!u)throw new Error("header name must be a non-empty string");const p=j.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const s=(l,c)=>j.forEach(l,(d,u)=>i(d,u,c));if(j.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(j.isString(t)&&(t=t.trim())&&!Gm(t))s(Vm(t),r);else if(j.isObject(t)&&j.isIterable(t)){let l={},c,d;for(const u of t){if(!j.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?j.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}s(l,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=nr(t),t){const n=j.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Wm(o);if(j.isFunction(r))return r.call(this,o,n);if(j.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=nr(t),t){const n=j.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||eo(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=nr(s),s){const l=j.findKey(n,s);l&&(!r||eo(n,n[l],l,r))&&(delete n[l],o=!0)}}return j.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||eo(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return j.forEach(this,(o,i)=>{const s=j.findKey(n,i);if(s){r[s]=Br(o),delete r[i];return}const l=t?qm(i):String(i).trim();l!==i&&delete r[i],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return j.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&j.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
    215 `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[yi]=this[yi]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=nr(s);n[l]||(Km(o,s),n[l]=!0)}return j.isArray(t)?t.forEach(i):i(t),this}};de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),j.reduceDescriptors(de.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),j.freezeMethods(de);function to(e,t){const r=this||rr,n=t||r,o=de.from(n.headers);let i=n.data;return j.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function wi(e){return!!(e&&e.__CANCEL__)}function Nt(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}j.inherits(Nt,B,{__CANCEL__:!0});function Si(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ym(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xm(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[i];s||(s=d),r[o]=c,n[o]=d;let p=i,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-s<t)return;const g=u&&d-u;return g?Math.round(m*1e3/g):void 0}}function Jm(e,t){let r=0,n=1e3/t,o,i;const s=(d,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?s(d,u):(o=d,i||(i=setTimeout(()=>{i=null,s(o)},n-p)))},()=>o&&s(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=Xm(50,250);return Jm(i=>{const s=i.loaded,l=i.lengthComputable?i.total:void 0,c=s-n,d=o(c),u=s<=l;n=s;const p={loaded:s,total:l,progress:l?s/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-s)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},ji=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ci=e=>(...t)=>j.asap(()=>e(...t)),Zm=se.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,se.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(se.origin),se.navigator&&/(msie|trident)/i.test(se.navigator.userAgent)):()=>!0,Qm=se.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];j.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),j.isString(n)&&l.push(`path=${n}`),j.isString(o)&&l.push(`domain=${o}`),i===!0&&l.push("secure"),j.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ef(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ki(e,t,r){let n=!ef(t);return e&&(n||r==!1)?tf(e,t):t}const Ni=e=>e instanceof de?{...e}:e;function at(e,t){t=t||{};const r={};function n(d,u,p,m){return j.isPlainObject(d)&&j.isPlainObject(u)?j.merge.call({caseless:m},d,u):j.isPlainObject(u)?j.merge({},u):j.isArray(u)?u.slice():u}function o(d,u,p,m){if(j.isUndefined(u)){if(!j.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function i(d,u){if(!j.isUndefined(u))return n(void 0,u)}function s(d,u){if(j.isUndefined(u)){if(!j.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u,p)=>o(Ni(d),Ni(u),p,!0)};return j.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);j.isUndefined(m)&&p!==l||(r[u]=m)}),r}const Ei=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=de.from(s),t.url=xi(ki(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),j.isFormData(r)){if(se.hasStandardBrowserEnv||se.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(j.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&s.set(u,p)})}}if(se.hasStandardBrowserEnv&&(n&&j.isFunction(n)&&(n=n(t)),n||n!==!1&&Zm(t.url))){const c=o&&i&&Qm.read(i);c&&s.set(o,c)}return t},rf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ei(e);let i=o.data;const s=de.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,g,v;function f(){g&&g(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function _(){if(!x)return;const w=de.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};Si(function(k){r(k),f()},function(k){n(k),f()},C),x=null}"onloadend"in x?x.onloadend=_:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(_)},x.onabort=function(){x&&(n(new B("Request aborted",B.ECONNABORTED,e,x)),x=null)},x.onerror=function(S){const C=S&&S.message?S.message:"Network Error",N=new B(C,B.ERR_NETWORK,e,x);N.event=S||null,n(N),x=null},x.ontimeout=function(){let S=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||bi;o.timeoutErrorMessage&&(S=o.timeoutErrorMessage),n(new B(S,C.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,x)),x=null},i===void 0&&s.setContentType(null),"setRequestHeader"in x&&j.forEach(s.toJSON(),function(S,C){x.setRequestHeader(C,S)}),j.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),l&&l!=="json"&&(x.responseType=o.responseType),d&&([m,v]=Ur(d,!0),x.addEventListener("progress",m)),c&&x.upload&&([p,g]=Ur(c),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",g)),(o.cancelToken||o.signal)&&(u=w=>{x&&(n(!w||w.type?new Nt(null,e,x):w),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const b=Ym(o.url);if(b&&se.protocols.indexOf(b)===-1){n(new B("Unsupported protocol "+b+":",B.ERR_BAD_REQUEST,e));return}x.send(i||null)})},nf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof B?u:new Nt(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,i(new B(`timeout ${t} of ms exceeded`,B.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:c}=n;return c.unsubscribe=()=>j.asap(l),c}},of=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},af=async function*(e,t){for await(const r of sf(e))yield*of(r,t)},sf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Ti=(e,t,r,n)=>{const o=af(e,t);let i=0,s,l=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=i+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Ai=64*1024,{isFunction:Hr}=j,lf=(({Request:e,Response:t})=>({Request:e,Response:t}))(j.global),{ReadableStream:Pi,TextEncoder:Oi}=j.global,Ri=(e,...t)=>{try{return!!e(...t)}catch{return!1}},cf=e=>{e=j.merge.call({skipUndefined:!0},lf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",i=Hr(r),s=Hr(n);if(!o)return!1;const l=o&&Hr(Pi),c=o&&(typeof Oi=="function"?(v=>f=>v.encode(f))(new Oi):async v=>new Uint8Array(await new r(v).arrayBuffer())),d=i&&l&&Ri(()=>{let v=!1;const f=new r(se.origin,{body:new Pi,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!f}),u=s&&l&&Ri(()=>j.isReadableStream(new n("").body)),p={stream:u&&(v=>v.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!p[v]&&(p[v]=(f,x)=>{let _=f&&f[v];if(_)return _.call(f);throw new B(`Response type '${v}' is not supported`,B.ERR_NOT_SUPPORT,x)})});const m=async v=>{if(v==null)return 0;if(j.isBlob(v))return v.size;if(j.isSpecCompliantForm(v))return(await new r(se.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(j.isArrayBufferView(v)||j.isArrayBuffer(v))return v.byteLength;if(j.isURLSearchParams(v)&&(v=v+""),j.isString(v))return(await c(v)).byteLength},g=async(v,f)=>{const x=j.toFiniteNumber(v.getContentLength());return x??m(f)};return async v=>{let{url:f,method:x,data:_,signal:b,cancelToken:w,timeout:S,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:R}=Ei(v),I=t||fetch;k=k?(k+"").toLowerCase():"text";let A=nf([b,w&&w.toAbortSignal()],S),L=null;const M=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let $;try{if(N&&d&&x!=="get"&&x!=="head"&&($=await g(E,_))!==0){let Z=new r(f,{method:"POST",body:_,duplex:"half"}),pe;if(j.isFormData(_)&&(pe=Z.headers.get("content-type"))&&E.setContentType(pe),Z.body){const[Fe,he]=ji($,Ur(Ci(N)));_=Ti(Z.body,Ai,Fe,he)}}j.isString(T)||(T=T?"include":"omit");const O=i&&"credentials"in r.prototype,U={...R,signal:A,method:x.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:O?T:void 0};L=i&&new r(f,U);let P=await(i?I(L,R):I(f,U));const G=u&&(k==="stream"||k==="response");if(u&&(C||G&&M)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=P[$e]});const pe=j.toFiniteNumber(P.headers.get("content-length")),[Fe,he]=C&&ji(pe,Ur(Ci(C),!0))||[];P=new n(Ti(P.body,Ai,Fe,()=>{he&&he(),M&&M()}),Z)}k=k||"text";let X=await p[j.findKey(p,k)||"text"](P,v);return!G&&M&&M(),await new Promise((Z,pe)=>{Si(Z,pe,{data:X,headers:de.from(P.headers),status:P.status,statusText:P.statusText,config:v,request:L})})}catch(O){throw M&&M(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,v,L),{cause:O.cause||O}):B.from(O,O&&O.code,v,L)}}},df=new Map,Li=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,l=s,c,d,u=df;for(;l--;)c=i[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:cf(t)),u=d;return d};Li();const ro={http:Pm,xhr:rf,fetch:{get:Li}};j.forEach(ro,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ii=e=>`- ${e}`,uf=e=>j.isFunction(e)||e===null||e===!1;function pf(e,t){e=j.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let l;if(o=n,!uf(n)&&(o=ro[(l=String(n)).toLowerCase()],o===void 0))throw new B(`Unknown adapter '${l}'`);if(o&&(j.isFunction(o)||(o=o.get(t))))break;i[l||"#"+s]=o}if(!o){const s=Object.entries(i).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?s.length>1?`since :
    216 `+s.map(Ii).join(`
    217 `):" "+Ii(s[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Mi={getAdapter:pf,adapters:ro};function no(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Nt(null,e)}function zi(e){return no(e),e.headers=de.from(e.headers),e.data=to.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Mi.getAdapter(e.adapter||rr.adapter,e)(e).then(function(n){return no(e),n.data=to.call(e,e.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return wi(n)||(no(e),n&&n.response&&(n.response.data=to.call(e,e.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}const Di="1.13.1",Vr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Fi={};Vr.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Di+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,l)=>{if(t===!1)throw new B(o(s," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Fi[s]&&(Fi[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function mf(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new B("option "+i+" must be "+c,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+i,B.ERR_BAD_OPTION)}}const Wr={assertOptions:mf,validators:Vr},ke=Wr.validators;let it=class{constructor(t){this.defaults=t||{},this.interceptors={request:new vi,response:new vi}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
    218 `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(j.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&j.merge(i.common,i[r.method]);i&&j.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),r.headers=de.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const v=[zi.bind(this),void 0];for(v.unshift(...l),v.push(...d),m=v.length,u=Promise.resolve(r);p<m;)u=u.then(v[p++],v[p++]);return u}m=l.length;let g=r;for(;p<m;){const v=l[p++],f=l[p++];try{g=v(g)}catch(x){f.call(this,x);break}}try{u=zi.call(this,g)}catch(v){return Promise.reject(v)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=at(this.defaults,t);const r=ki(t.baseURL,t.url,t.allowAbsoluteUrls);return xi(r,t.params,t.paramsSerializer)}};j.forEach(["delete","get","head","options"],function(t){it.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),j.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,l){return this.request(at(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}it.prototype[t]=r(),it.prototype[t+"Form"]=r(!0)});let ff=class xd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{n.subscribe(l),i=l}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,l){n.reason||(n.reason=new Nt(i,s,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new xd(function(o){t=o}),cancel:t}}};function hf(e){return function(r){return e.apply(null,r)}}function gf(e){return j.isObject(e)&&e.isAxiosError===!0}const oo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(oo).forEach(([e,t])=>{oo[t]=e});function $i(e){const t=new it(e),r=ri(it.prototype.request,t);return j.extend(r,it.prototype,t,{allOwnKeys:!0}),j.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return $i(at(e,o))},r}const te=$i(rr);te.Axios=it,te.CanceledError=Nt,te.CancelToken=ff,te.isCancel=wi,te.VERSION=Di,te.toFormData=$r,te.AxiosError=B,te.Cancel=te.CanceledError,te.all=function(t){return Promise.all(t)},te.spread=hf,te.isAxiosError=gf,te.mergeConfig=at,te.AxiosHeaders=de,te.formToJSON=e=>_i(j.isHTMLForm(e)?new FormData(e):e),te.getAdapter=Mi.getAdapter,te.HttpStatusCode=oo,te.default=te;const{Axios:i_,AxiosError:s_,CanceledError:l_,isCancel:c_,CancelToken:d_,VERSION:u_,all:p_,Cancel:m_,isAxiosError:f_,spread:h_,toFormData:g_,AxiosHeaders:x_,HttpStatusCode:v_,formToJSON:b_,getAdapter:__,mergeConfig:y_}=te,Bi=ecommreelsInfo,ue=te.create({baseURL:`${Bi.apiBase}`,headers:{"X-WP-Nonce":Bi.nonce,"Content-Type":"application/json"}}),xf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async s=>{try{t(!0);const l={styles:et,story_ids:s},c=await ue.post("stories/manage-group-stories",l);return q.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?q.error(l.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),i=y.useCallback(async(s,l)=>{try{n(!0),await ue.delete(`story/${s}`),l(c=>c.filter(d=>d.id!==s)),q.success("Reel deleted successfully!")}catch(c){c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!")}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:i}};function Ui(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Hi=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[i,s]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),g=Ui(p,500),v=y.useRef(!0),f=y.useCallback(async b=>{b===1&&v.current?u(!0):c(!0);try{const w={page:b,per_page:20};e&&(w.group_id=e),g&&(w.search=g);const S=await ue.get("stories",{params:w}),C=S.data,N=parseInt(S.headers["x-wp-totalpages"]);r(k=>b===1?C:[...k,...C]),o(b+1),s(b<N)}catch(w){w instanceof Error?q.error(w.message):q.error("Something went wrong. Try again later!")}finally{v.current&&(v.current=!1),c(!1),u(!1)}},[e,g]);y.useEffect(()=>{o(1),r([]),f(1)},[g,f]);const x=y.useRef(null),_=y.useCallback(b=>{l||(x.current&&x.current.disconnect(),x.current=new IntersectionObserver(w=>{w[0].isIntersecting&&i&&f(n)}),b&&x.current.observe(b))},[l,i,n,f]);return y.useEffect(()=>()=>{x.current&&x.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:_}};function vf(){const e=je(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:i,setSearchTerm:s,isLoading:l}=Hi(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=xf(),[g,v]=y.useState(null),[f,x]=y.useState(null),[_,b]=y.useState([]),w=async()=>{const k=await p(_);k&&e(`?view=${K.mg}&gid=${k}`)},S=()=>{b(t.map(k=>k.id))},C=k=>{b(E=>E.includes(k)?E.filter(T=>T!==k):[...E,k])},N=y.useCallback(async()=>{g&&(await m(g,r),v(null))},[m,g,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[g&&a.jsx(Or,{onReject:()=>v(null),onAccept:N,isLoading:u,message:"Are you sure, You want to remove this reel?"}),a.jsx(St,{left:[a.jsx(jt,{name:"All Reels",Icon:Yu},"page"),a.jsx(Jt,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:_t},"add-reel-all-reel")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(dp,{selectedReelIds:_,handleSelectAll:S,clearSelection:()=>b([]),searchTerm:i,setSearchTerm:s,isCreating:d,handleCreateGroup:w}),t.length?a.jsx(Vp,{reels:t,styles:c,selectedReelIds:_,onSelectReel:C,onDeleteReel:v,onPreviewReel:x,lastStoryElementRef:o}):!n&&!l?a.jsx(mp,{}):null,n&&a.jsx(fp,{isFullScreen:!t.length})]}),!!f&&a.jsx(Ep,{previewReel:f,setPreviewReel:x})]})}const bf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:i,links:s,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:i,links:s};typeof l=="string"&&l.trim().length>0&&(c.thumbnail=l),n&&(c.story_id=n);const d=await ue.post("files",c);return q.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?q.error(c.message):q.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},ao=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(oe,{onClick:t,className:D("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(Zu,{className:"ecr-admin-save-button__icon"})," ",r]}),Vi=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:i=>{e&&e(!0),r(i.target.value)}})}),_f=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const i=je(),[s]=Gt(),l=s.get("sid"),c=s.get("from")||K.ag,d=s.get("gid"),{isSaving:u,saveStory:p}=bf(),m=async()=>{if(u)return;const g=await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});g&&i(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0,...l?{}:{state:{storyId:g}}})};return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(jt,{name:l?"Update Reel":"Add Reel",Icon:_t},"page"),a.jsx(Jt,{},"back")],center:[a.jsx(Vi,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(ao,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function yf(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let io;const wf=new Uint8Array(16);function Sf(){if(!io){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");io=crypto.getRandomValues.bind(crypto)}return io(wf)}const Wi={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function jf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Sf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,yf(n)}function Gi(e,t,r){return Wi.randomUUID&&!e?Wi.randomUUID():jf(e)}const qi="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ki=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:i})=>{const[s,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:Gi()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:D("ecr-admin-upload",s?"ecr-admin-upload--active":"ecr-admin-upload--idle",i),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:qi,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:s?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/**
    219  * @license lucide-react v0.552.0 - ISC
    220  *
    221  * This source code is licensed under the ISC license.
    222  * See the LICENSE file in the root directory of this source tree.
    223  */const Cf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Yi=e=>{const t=kf(e);return t.charAt(0).toUpperCase()+t.slice(1)},Xi=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Nf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
    224  * @license lucide-react v0.552.0 - ISC
    225  *
    226  * This source code is licensed under the ISC license.
    227  * See the LICENSE file in the root directory of this source tree.
    228  */var Ef={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
    229  * @license lucide-react v0.552.0 - ISC
    230  *
    231  * This source code is licensed under the ISC license.
    232  * See the LICENSE file in the root directory of this source tree.
    233  */const Tf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...l},c)=>y.createElement("svg",{ref:c,...Ef,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Xi("lucide",o),...!i&&!Nf(l)&&{"aria-hidden":"true"},...l},[...s.map(([d,u])=>y.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
    234  * @license lucide-react v0.552.0 - ISC
    235  *
    236  * This source code is licensed under the ISC license.
    237  * See the LICENSE file in the root directory of this source tree.
    238  */const be=(e,t)=>{const r=y.forwardRef(({className:n,...o},i)=>y.createElement(Tf,{ref:i,iconNode:t,className:Xi(`lucide-${Cf(Yi(e))}`,`lucide-${e}`,n),...o}));return r.displayName=Yi(e),r};/**
    239  * @license lucide-react v0.552.0 - ISC
    240  *
    241  * This source code is licensed under the ISC license.
    242  * See the LICENSE file in the root directory of this source tree.
    243  */const Af=be("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
    244  * @license lucide-react v0.552.0 - ISC
    245  *
    246  * This source code is licensed under the ISC license.
    247  * See the LICENSE file in the root directory of this source tree.
    248  */const so=be("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
    249  * @license lucide-react v0.552.0 - ISC
    250  *
    251  * This source code is licensed under the ISC license.
    252  * See the LICENSE file in the root directory of this source tree.
    253  */const Pf=be("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
    254  * @license lucide-react v0.552.0 - ISC
    255  *
    256  * This source code is licensed under the ISC license.
    257  * See the LICENSE file in the root directory of this source tree.
    258  */const Of=be("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
    259  * @license lucide-react v0.552.0 - ISC
    260  *
    261  * This source code is licensed under the ISC license.
    262  * See the LICENSE file in the root directory of this source tree.
    263  */const Rf=be("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
    264  * @license lucide-react v0.552.0 - ISC
    265  *
    266  * This source code is licensed under the ISC license.
    267  * See the LICENSE file in the root directory of this source tree.
    268  */const Lf=be("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
    269  * @license lucide-react v0.552.0 - ISC
    270  *
    271  * This source code is licensed under the ISC license.
    272  * See the LICENSE file in the root directory of this source tree.
    273  */const If=be("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
    274  * @license lucide-react v0.552.0 - ISC
    275  *
    276  * This source code is licensed under the ISC license.
    277  * See the LICENSE file in the root directory of this source tree.
    278  */const Mf=be("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
    279  * @license lucide-react v0.552.0 - ISC
    280  *
    281  * This source code is licensed under the ISC license.
    282  * See the LICENSE file in the root directory of this source tree.
    283  */const zf=be("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
    284  * @license lucide-react v0.552.0 - ISC
    285  *
    286  * This source code is licensed under the ISC license.
    287  * See the LICENSE file in the root directory of this source tree.
    288  */const Df=be("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
    289  * @license lucide-react v0.552.0 - ISC
    290  *
    291  * This source code is licensed under the ISC license.
    292  * See the LICENSE file in the root directory of this source tree.
    293  */const Ff=be("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var $f=Symbol.for("react.lazy"),Gr=h[" use ".trim().toString()];function Bf(e){return typeof e=="object"&&e!==null&&"then"in e}function Ji(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$f&&"_payload"in e&&Bf(e._payload)}function Uf(e){const t=Hf(e),r=h.forwardRef((n,o)=>{let{children:i,...s}=n;Ji(i)&&typeof Gr=="function"&&(i=Gr(i._payload));const l=h.Children.toArray(i),c=l.find(Wf);if(c){const d=c.props.children,u=l.map(p=>p===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...s,ref:o,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return a.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}function Hf(e){const t=h.forwardRef((r,n)=>{let{children:o,...i}=r;if(Ji(o)&&typeof Gr=="function"&&(o=Gr(o._payload)),h.isValidElement(o)){const s=qf(o),l=Gf(i,o.props);return o.type!==h.Fragment&&(l.ref=n?Bn(n,s):s),h.cloneElement(o,l)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vf=Symbol("radix.slottable");function Wf(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vf}function Gf(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function qf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Kf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yf=Kf.reduce((e,t)=>{const r=Uf(`Primitive.${t}`),n=h.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xf="Separator",Zi="horizontal",Jf=["horizontal","vertical"],Qi=h.forwardRef((e,t)=>{const{decorative:r,orientation:n=Zi,...o}=e,i=Zf(n)?n:Zi,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(Yf.div,{"data-orientation":i,...l,...o,ref:t})});Qi.displayName=Xf;function Zf(e){return Jf.includes(e)}var Qf=Qi;function lo({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(Qf,{"data-slot":"separator",decorative:r,orientation:t,className:D("ecr-separator",e),...n})}const Et=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(lo,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(lo,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(oe,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};function H(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function eh(e,t){const r=h.createContext(t),n=i=>{const{children:s,...l}=i,c=h.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(i){const s=h.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(i,s){const l=h.createContext(s),c=r.length;r=[...r,s];const d=p=>{const{scope:m,children:g,...v}=p,f=m?.[e]?.[c]||l,x=h.useMemo(()=>v,Object.values(v));return a.jsx(f.Provider,{value:x,children:g})};d.displayName=i+"Provider";function u(p,m){const g=m?.[e]?.[c]||l,v=h.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>h.createContext(s));return function(l){const c=l?.[e]||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,th(o,...t)]}function th(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var rh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=rh.reduce((e,t)=>{const r=rt(`Primitive.${t}`),n=h.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function nh(e,t){e&&br.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...r)=>t.current?.(...r),[])}function oh(e,t=globalThis?.document){const r=Ve(e);h.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ah="DismissableLayer",co="dismissableLayer.update",ih="dismissableLayer.pointerDownOutside",sh="dismissableLayer.focusOutside",es,ts=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,d=h.useContext(ts),[u,p]=h.useState(null),m=u?.ownerDocument??globalThis?.document,[,g]=h.useState({}),v=Y(t,k=>p(k)),f=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(x),b=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=_,C=dh(k=>{const E=k.target,T=[...d.branches].some(R=>R.contains(E));!S||T||(o?.(k),s?.(k),k.defaultPrevented||l?.())},m),N=uh(k=>{const E=k.target;[...d.branches].some(R=>R.contains(E))||(i?.(k),s?.(k),k.defaultPrevented||l?.())},m);return oh(k=>{b===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),h.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(es=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),rs(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=es)}},[u,m,r,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),rs())},[u,d]),h.useEffect(()=>{const k=()=>g({});return document.addEventListener(co,k),()=>document.removeEventListener(co,k)},[]),a.jsx(W.div,{...c,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,N.onFocusCapture),onBlurCapture:H(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=ah;var lh="DismissableLayerBranch",ch=h.forwardRef((e,t)=>{const r=h.useContext(ts),n=h.useRef(null),o=Y(t,n);return h.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});ch.displayName=lh;function dh(e,t=globalThis?.document){const r=Ve(e),n=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){ns(ih,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function uh(e,t=globalThis?.document){const r=Ve(e),n=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!n.current&&ns(sh,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function rs(){const e=new CustomEvent(co);document.dispatchEvent(e)}function ns(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?nh(o,i):o.dispatchEvent(i)}var uo=0;function po(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??os()),document.body.insertAdjacentElement("beforeend",e[1]??os()),uo++,()=>{uo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),uo--}},[])}function os(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mo="focusScope.autoFocusOnMount",fo="focusScope.autoFocusOnUnmount",as={bubbles:!1,cancelable:!0},ph="FocusScope",Kr=h.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=h.useState(null),d=Ve(o),u=Ve(i),p=h.useRef(null),m=Y(t,f=>c(f)),g=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(n){let f=function(w){if(g.paused||!l)return;const S=w.target;l.contains(S)?p.current=S:We(p.current,{select:!0})},x=function(w){if(g.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||We(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",x);const b=new MutationObserver(_);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",x),b.disconnect()}}},[n,l,g.paused]),h.useEffect(()=>{if(l){ls.add(g);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(mo,as);l.addEventListener(mo,d),l.dispatchEvent(_),_.defaultPrevented||(mh(vh(is(l)),{select:!0}),document.activeElement===f&&We(l))}return()=>{l.removeEventListener(mo,d),setTimeout(()=>{const _=new CustomEvent(fo,as);l.addEventListener(fo,u),l.dispatchEvent(_),_.defaultPrevented||We(f??document.body,{select:!0}),l.removeEventListener(fo,u),ls.remove(g)},0)}}},[l,d,u,g]);const v=h.useCallback(f=>{if(!r&&!n||g.paused)return;const x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(x&&_){const b=f.currentTarget,[w,S]=fh(b);w&&S?!f.shiftKey&&_===S?(f.preventDefault(),r&&We(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&We(S,{select:!0})):_===b&&f.preventDefault()}},[r,n,g.paused]);return a.jsx(W.div,{tabIndex:-1,...s,ref:m,onKeyDown:v})});Kr.displayName=ph;function mh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function fh(e){const t=is(e),r=ss(t,e),n=ss(t.reverse(),e);return[r,n]}function is(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ss(e,t){for(const r of e)if(!hh(r,{upTo:t}))return r}function hh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gh(e){return e instanceof HTMLInputElement&&"select"in e}function We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gh(e)&&t&&e.select()}}var ls=xh();function xh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=cs(e,t),e.unshift(t)},remove(t){e=cs(e,t),e[0]?.resume()}}}function cs(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function vh(e){return e.filter(t=>t.tagName!=="A")}var ie=globalThis?.document?h.useLayoutEffect:()=>{},bh=h[" useId ".trim().toString()]||(()=>{}),_h=0;function Ne(e){const[t,r]=h.useState(bh());return ie(()=>{r(n=>n??String(_h++))},[e]),e||(t?`radix-${t}`:"")}const yh=["top","right","bottom","left"],Ge=Math.min,me=Math.max,Yr=Math.round,Xr=Math.floor,Ee=e=>({x:e,y:e}),wh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function ho(e,t,r){return me(e,Ge(t,r))}function Me(e,t){return typeof e=="function"?e(t):e}function ze(e){return e.split("-")[0]}function Tt(e){return e.split("-")[1]}function go(e){return e==="x"?"y":"x"}function xo(e){return e==="y"?"height":"width"}const jh=new Set(["top","bottom"]);function Te(e){return jh.has(ze(e))?"y":"x"}function vo(e){return go(Te(e))}function Ch(e,t,r){r===void 0&&(r=!1);const n=Tt(e),o=vo(e),i=xo(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function kh(e){const t=Jr(e);return[bo(e),t,bo(t)]}function bo(e){return e.replace(/start|end/g,t=>Sh[t])}const ds=["left","right"],us=["right","left"],Nh=["top","bottom"],Eh=["bottom","top"];function Th(e,t,r){switch(e){case"top":case"bottom":return r?t?us:ds:t?ds:us;case"left":case"right":return t?Nh:Eh;default:return[]}}function Ah(e,t,r,n){const o=Tt(e);let i=Th(ze(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(bo)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>wh[t])}function Ph(e){return{top:0,right:0,bottom:0,left:0,...e}}function ps(e){return typeof e!="number"?Ph(e):{top:e,right:e,bottom:e,left:e}}function Zr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ms(e,t,r){let{reference:n,floating:o}=e;const i=Te(t),s=vo(t),l=xo(s),c=ze(t),d=i==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let g;switch(c){case"top":g={x:u,y:n.y-o.height};break;case"bottom":g={x:u,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Tt(t)){case"start":g[s]-=m*(r&&d?-1:1);break;case"end":g[s]+=m*(r&&d?-1:1);break}return g}const Oh=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=ms(d,n,c),m=n,g={},v=0;for(let f=0;f<l.length;f++){const{name:x,fn:_}=l[f],{x:b,y:w,data:S,reset:C}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:g,rects:d,platform:s,elements:{reference:e,floating:t}});u=b??u,p=w??p,g={...g,[x]:{...g[x],...S}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=ms(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:g}};async function or(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Me(t,e),v=ps(g),x=l[m?p==="floating"?"reference":"floating":p],_=Zr(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(x)))==null||r?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),b=p==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Zr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:w,strategy:c}):b);return{top:(_.top-C.top+v.top)/S.y,bottom:(C.bottom-_.bottom+v.bottom)/S.y,left:(_.left-C.left+v.left)/S.x,right:(C.right-_.right+v.right)/S.x}}const Rh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Me(e,t)||{};if(d==null)return{};const p=ps(u),m={x:r,y:n},g=vo(o),v=xo(g),f=await s.getDimensions(d),x=g==="y",_=x?"top":"left",b=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[g]-m[g]-i.floating[v],C=m[g]-i.reference[g],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(N)))&&(k=l.floating[w]||i.floating[v]);const E=S/2-C/2,T=k/2-f[v]/2-1,R=Ge(p[_],T),I=Ge(p[b],T),A=R,L=k-f[v]-I,M=k/2-f[v]/2+E,$=ho(A,M,L),O=!c.arrow&&Tt(o)!=null&&M!==$&&i.reference[v]/2-(M<A?R:I)-f[v]/2<0,U=O?M<A?M-A:M-L:0;return{[g]:m[g]+U,data:{[g]:$,centerOffset:M-$-U,...O&&{alignmentOffset:U}},reset:O}}}),Lh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:f=!0,...x}=Me(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const _=ze(o),b=Te(l),w=ze(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Jr(l)]:kh(l)),N=v!=="none";!m&&N&&C.push(...Ah(l,f,v,S));const k=[l,...C],E=await or(t,x),T=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const M=Ch(o,s,S);T.push(E[M[0]],E[M[1]])}if(R=[...R,{placement:o,overflows:T}],!T.every(M=>M<=0)){var I,A;const M=(((I=i.flip)==null?void 0:I.index)||0)+1,$=k[M];if($&&(!(p==="alignment"?b!==Te($):!1)||R.every(P=>Te(P.placement)===b?P.overflows[0]>0:!0)))return{data:{index:M,overflows:R},reset:{placement:$}};let O=(A=R.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!O)switch(g){case"bestFit":{var L;const U=(L=R.filter(P=>{if(N){const G=Te(P.placement);return G===b||G==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(G=>G>0).reduce((G,X)=>G+X,0)]).sort((P,G)=>P[1]-G[1])[0])==null?void 0:L[0];U&&(O=U);break}case"initialPlacement":O=l;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function fs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hs(e){return yh.some(t=>e[t]>=0)}const Ih=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Me(e,t);switch(n){case"referenceHidden":{const i=await or(t,{...o,elementContext:"reference"}),s=fs(i,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:hs(s)}}}case"escaped":{const i=await or(t,{...o,altBoundary:!0}),s=fs(i,r.floating);return{data:{escapedOffsets:s,escaped:hs(s)}}}default:return{}}}}},gs=new Set(["left","top"]);async function Mh(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ze(r),l=Tt(r),c=Te(r)==="y",d=gs.has(s)?-1:1,u=i&&c?-1:1,p=Me(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),c?{x:g*u,y:m*d}:{x:m*d,y:g*u}}const zh=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await Mh(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},Dh=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:_,y:b}=x;return{x:_,y:b}}},...c}=Me(e,t),d={x:r,y:n},u=await or(t,c),p=Te(ze(o)),m=go(p);let g=d[m],v=d[p];if(i){const x=m==="y"?"top":"left",_=m==="y"?"bottom":"right",b=g+u[x],w=g-u[_];g=ho(b,g,w)}if(s){const x=p==="y"?"top":"left",_=p==="y"?"bottom":"right",b=v+u[x],w=v-u[_];v=ho(b,v,w)}const f=l.fn({...t,[m]:g,[p]:v});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:i,[p]:s}}}}}},Fh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Me(e,t),u={x:r,y:n},p=Te(o),m=go(p);let g=u[m],v=u[p];const f=Me(l,t),x=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",S=i.reference[m]-i.floating[w]+x.mainAxis,C=i.reference[m]+i.reference[w]-x.mainAxis;g<S?g=S:g>C&&(g=C)}if(d){var _,b;const w=m==="y"?"width":"height",S=gs.has(ze(o)),C=i.reference[p]-i.floating[w]+(S&&((_=s.offset)==null?void 0:_[p])||0)+(S?0:x.crossAxis),N=i.reference[p]+i.reference[w]+(S?0:((b=s.offset)==null?void 0:b[p])||0)-(S?x.crossAxis:0);v<C?v=C:v>N&&(v=N)}return{[m]:g,[p]:v}}}},$h=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...d}=Me(e,t),u=await or(t,d),p=ze(o),m=Tt(o),g=Te(o)==="y",{width:v,height:f}=i.floating;let x,_;p==="top"||p==="bottom"?(x=p,_=m===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,x=m==="end"?"top":"bottom");const b=f-u.top-u.bottom,w=v-u.left-u.right,S=Ge(f-u[x],b),C=Ge(v-u[_],w),N=!t.middlewareData.shift;let k=S,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=b),N&&!m){const R=me(u.left,0),I=me(u.right,0),A=me(u.top,0),L=me(u.bottom,0);g?E=v-2*(R!==0||I!==0?R+I:me(u.left,u.right)):k=f-2*(A!==0||L!==0?A+L:me(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const T=await s.getDimensions(l.floating);return v!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Qr(){return typeof window<"u"}function At(e){return xs(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(xs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xs(e){return Qr()?e instanceof Node||e instanceof fe(e).Node:!1}function _e(e){return Qr()?e instanceof Element||e instanceof fe(e).Element:!1}function Pe(e){return Qr()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function vs(e){return!Qr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}const Bh=new Set(["inline","contents"]);function ar(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Bh.has(o)}const Uh=new Set(["table","td","th"]);function Hh(e){return Uh.has(At(e))}const Vh=[":popover-open",":modal"];function en(e){return Vh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wh=["transform","translate","scale","rotate","perspective"],Gh=["transform","translate","scale","rotate","perspective","filter"],qh=["paint","layout","strict","content"];function _o(e){const t=yo(),r=_e(e)?ye(e):e;return Wh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Gh.some(n=>(r.willChange||"").includes(n))||qh.some(n=>(r.contain||"").includes(n))}function Kh(e){let t=qe(e);for(;Pe(t)&&!Pt(t);){if(_o(t))return t;if(en(t))return null;t=qe(t)}return null}function yo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yh=new Set(["html","body","#document"]);function Pt(e){return Yh.has(At(e))}function ye(e){return fe(e).getComputedStyle(e)}function tn(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(At(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vs(e)&&e.host||Ae(e);return vs(t)?t.host:t}function bs(e){const t=qe(e);return Pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&ar(t)?t:bs(t)}function ir(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=bs(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=fe(o);if(i){const l=wo(s);return t.concat(s,s.visualViewport||[],ar(o)?o:[],l&&r?ir(l):[])}return t.concat(o,ir(o,[],r))}function wo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _s(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Pe(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=Yr(r)!==i||Yr(n)!==s;return l&&(r=i,n=s),{width:r,height:n,$:l}}function So(e){return _e(e)?e:e.contextElement}function Ot(e){const t=So(e);if(!Pe(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=_s(t);let s=(i?Yr(r.width):r.width)/n,l=(i?Yr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Xh=Ee(0);function ys(e){const t=fe(e);return!yo()||!t.visualViewport?Xh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==fe(e)?!1:t}function st(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=So(e);let s=Ee(1);t&&(n?_e(n)&&(s=Ot(n)):s=Ot(e));const l=Jh(i,r,n)?ys(i):Ee(0);let c=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,u=o.width/s.x,p=o.height/s.y;if(i){const m=fe(i),g=n&&_e(n)?fe(n):n;let v=m,f=wo(v);for(;f&&n&&g!==v;){const x=Ot(f),_=f.getBoundingClientRect(),b=ye(f),w=_.left+(f.clientLeft+parseFloat(b.paddingLeft))*x.x,S=_.top+(f.clientTop+parseFloat(b.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,p*=x.y,c+=w,d+=S,v=fe(f),f=wo(v)}}return Zr({width:u,height:p,x:c,y:d})}function rn(e,t){const r=tn(e).scrollLeft;return t?t.left+r:st(Ae(e)).left+r}function ws(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-rn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Zh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=Ae(n),l=t?en(t.floating):!1;if(n===s||l&&i)return r;let c={scrollLeft:0,scrollTop:0},d=Ee(1);const u=Ee(0),p=Pe(n);if((p||!p&&!i)&&((At(n)!=="body"||ar(s))&&(c=tn(n)),Pe(n))){const g=st(n);d=Ot(n),u.x=g.x+n.clientLeft,u.y=g.y+n.clientTop}const m=s&&!p&&!i?ws(s,c):Ee(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Qh(e){return Array.from(e.getClientRects())}function eg(e){const t=Ae(e),r=tn(e),n=e.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=me(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+rn(e);const l=-r.scrollTop;return ye(n).direction==="rtl"&&(s+=me(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ss=25;function tg(e,t){const r=fe(e),n=Ae(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=yo();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=rn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(n.clientWidth-p.clientWidth-g);v<=Ss&&(i-=v)}else d<=Ss&&(i+=d);return{width:i,height:s,x:l,y:c}}const rg=new Set(["absolute","fixed"]);function ng(e,t){const r=st(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=Pe(e)?Ot(e):Ee(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,d=n*i.y;return{width:s,height:l,x:c,y:d}}function js(e,t,r){let n;if(t==="viewport")n=tg(e,r);else if(t==="document")n=eg(Ae(e));else if(_e(t))n=ng(t,r);else{const o=ys(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zr(n)}function Cs(e,t){const r=qe(e);return r===t||!_e(r)||Pt(r)?!1:ye(r).position==="fixed"||Cs(r,t)}function og(e,t){const r=t.get(e);if(r)return r;let n=ir(e,[],!1).filter(l=>_e(l)&&At(l)!=="body"),o=null;const i=ye(e).position==="fixed";let s=i?qe(e):e;for(;_e(s)&&!Pt(s);){const l=ye(s),c=_o(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&rg.has(o.position)||ar(s)&&!c&&Cs(e,s))?n=n.filter(u=>u!==s):o=l,s=qe(s)}return t.set(e,n),n}function ag(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?en(t)?[]:og(t,this._c):[].concat(r),n],l=s[0],c=s.reduce((d,u)=>{const p=js(t,u,o);return d.top=me(p.top,d.top),d.right=Ge(p.right,d.right),d.bottom=Ge(p.bottom,d.bottom),d.left=me(p.left,d.left),d},js(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ig(e){const{width:t,height:r}=_s(e);return{width:t,height:r}}function sg(e,t,r){const n=Pe(t),o=Ae(t),i=r==="fixed",s=st(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ee(0);function d(){c.x=rn(o)}if(n||!n&&!i)if((At(t)!=="body"||ar(o))&&(l=tn(t)),n){const g=st(t,!0,i,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?ws(o,l):Ee(0),p=s.left+l.scrollLeft-c.x-u.x,m=s.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function jo(e){return ye(e).position==="static"}function ks(e,t){if(!Pe(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Ns(e,t){const r=fe(e);if(en(e))return r;if(!Pe(e)){let o=qe(e);for(;o&&!Pt(o);){if(_e(o)&&!jo(o))return o;o=qe(o)}return r}let n=ks(e,t);for(;n&&Hh(n)&&jo(n);)n=ks(n,t);return n&&Pt(n)&&jo(n)&&!_o(n)?r:n||Kh(e)||r}const lg=async function(e){const t=this.getOffsetParent||Ns,r=this.getDimensions,n=await r(e.floating);return{reference:sg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function cg(e){return ye(e).direction==="rtl"}const dg={convertOffsetParentRelativeRectToViewportRelativeRect:Zh,getDocumentElement:Ae,getClippingRect:ag,getOffsetParent:Ns,getElementRects:lg,getClientRects:Qh,getDimensions:ig,getScale:Ot,isElement:_e,isRTL:cg};function Es(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ug(e,t){let r=null,n;const o=Ae(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:g}=d;if(l||t(),!m||!g)return;const v=Xr(p),f=Xr(o.clientWidth-(u+m)),x=Xr(o.clientHeight-(p+g)),_=Xr(u),w={rootMargin:-v+"px "+-f+"px "+-x+"px "+-_+"px",threshold:me(0,Ge(1,c))||1};let S=!0;function C(N){const k=N[0].intersectionRatio;if(k!==c){if(!S)return s();k?s(!1,k):n=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!Es(d,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return s(!0),i}function pg(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=So(e),u=o||i?[...d?ir(d):[],...ir(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),i&&_.addEventListener("resize",r)});const p=d&&l?ug(d,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(_=>{let[b]=_;b&&b.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),r()}),d&&!c&&g.observe(d),g.observe(t));let v,f=c?st(e):null;c&&x();function x(){const _=st(e);f&&!Es(f,_)&&r(),f=_,v=requestAnimationFrame(x)}return r(),()=>{var _;u.forEach(b=>{o&&b.removeEventListener("scroll",r),i&&b.removeEventListener("resize",r)}),p?.(),(_=g)==null||_.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const mg=zh,fg=Dh,hg=Lh,gg=$h,xg=Ih,Ts=Rh,vg=Fh,bg=(e,t,r)=>{const n=new Map,o={platform:dg,...r},i={...o.platform,_c:n};return Oh(e,t,{...o,platform:i})};var _g=typeof document<"u",yg=function(){},nn=_g?y.useLayoutEffect:yg;function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!on(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!on(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function As(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ps(e,t){const r=As(e);return Math.round(t*r)/r}function Co(e){const t=h.useRef(e);return nn(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=h.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=h.useState(n);on(m,n)||g(n);const[v,f]=h.useState(null),[x,_]=h.useState(null),b=h.useCallback(P=>{P!==N.current&&(N.current=P,f(P))},[]),w=h.useCallback(P=>{P!==k.current&&(k.current=P,_(P))},[]),S=i||v,C=s||x,N=h.useRef(null),k=h.useRef(null),E=h.useRef(u),T=c!=null,R=Co(c),I=Co(o),A=Co(d),L=h.useCallback(()=>{if(!N.current||!k.current)return;const P={placement:t,strategy:r,middleware:m};I.current&&(P.platform=I.current),bg(N.current,k.current,P).then(G=>{const X={...G,isPositioned:A.current!==!1};M.current&&!on(E.current,X)&&(E.current=X,br.flushSync(()=>{p(X)}))})},[m,t,r,I,A]);nn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[d]);const M=h.useRef(!1);nn(()=>(M.current=!0,()=>{M.current=!1}),[]),nn(()=>{if(S&&(N.current=S),C&&(k.current=C),S&&C){if(R.current)return R.current(S,C,L);L()}},[S,C,L,R,T]);const $=h.useMemo(()=>({reference:N,floating:k,setReference:b,setFloating:w}),[b,w]),O=h.useMemo(()=>({reference:S,floating:C}),[S,C]),U=h.useMemo(()=>{const P={position:r,left:0,top:0};if(!O.floating)return P;const G=Ps(O.floating,u.x),X=Ps(O.floating,u.y);return l?{...P,transform:"translate("+G+"px, "+X+"px)",...As(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:G,top:X}},[r,l,O.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:L,refs:$,elements:O,floatingStyles:U}),[u,L,$,O,U])}const Sg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ts({element:n.current,padding:o}).fn(r):{}:n?Ts({element:n,padding:o}).fn(r):{}}}},jg=(e,t)=>({...mg(e),options:[e,t]}),Cg=(e,t)=>({...fg(e),options:[e,t]}),kg=(e,t)=>({...vg(e),options:[e,t]}),Ng=(e,t)=>({...hg(e),options:[e,t]}),Eg=(e,t)=>({...gg(e),options:[e,t]}),Tg=(e,t)=>({...xg(e),options:[e,t]}),Ag=(e,t)=>({...Sg(e),options:[e,t]});var Pg="Arrow",Os=h.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return a.jsx(W.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Os.displayName=Pg;var Og=Os;function Rg(e){const[t,r]=h.useState(void 0);return ie(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var ko="Popper",[Rs,an]=He(ko),[Lg,Ls]=Rs(ko),Is=e=>{const{__scopePopper:t,children:r}=e,[n,o]=h.useState(null);return a.jsx(Lg,{scope:t,anchor:n,onAnchorChange:o,children:r})};Is.displayName=ko;var Ms="PopperAnchor",zs=h.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ls(Ms,r),s=h.useRef(null),l=Y(t,s),c=h.useRef(null);return h.useEffect(()=>{const d=c.current;c.current=n?.current||s.current,d!==c.current&&i.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});zs.displayName=Ms;var No="PopperContent",[Ig,Mg]=Rs(No),Ds=h.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...f}=e,x=Ls(No,r),[_,b]=h.useState(null),w=Y(t,F=>b(F)),[S,C]=h.useState(null),N=Rg(S),k=N?.width??0,E=N?.height??0,T=n+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(d)?d:[d],A=I.length>0,L={padding:R,boundary:I.filter(Dg),altBoundary:A},{refs:M,floatingStyles:$,placement:O,isPositioned:U,middlewareData:P}=wg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>pg(...F,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[jg({mainAxis:o+E,alignmentAxis:s}),c&&Cg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?kg():void 0,...L}),c&&Ng({...L}),Eg({...L,apply:({elements:F,rects:ee,availableWidth:le,availableHeight:J})=>{const{width:Q,height:re}=ee.reference,ge=F.floating.style;ge.setProperty("--radix-popper-available-width",`${le}px`),ge.setProperty("--radix-popper-available-height",`${J}px`),ge.setProperty("--radix-popper-anchor-width",`${Q}px`),ge.setProperty("--radix-popper-anchor-height",`${re}px`)}}),S&&Ag({element:S,padding:l}),Fg({arrowWidth:k,arrowHeight:E}),m&&Tg({strategy:"referenceHidden",...L})]}),[G,X]=Bs(O),Z=Ve(v);ie(()=>{U&&Z?.()},[U,Z]);const pe=P.arrow?.x,Fe=P.arrow?.y,he=P.arrow?.centerOffset!==0,[$e,ht]=h.useState();return ie(()=>{_&&ht(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Ig,{scope:r,placedSide:G,onArrowChange:C,arrowX:pe,arrowY:Fe,shouldHideArrow:he,children:a.jsx(W.div,{"data-side":G,"data-align":X,...f,ref:w,style:{...f.style,animation:U?void 0:"none"}})})})});Ds.displayName=No;var Fs="PopperArrow",zg={top:"bottom",right:"left",bottom:"top",left:"right"},$s=h.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Mg(Fs,n),s=zg[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(Og,{...o,ref:r,style:{...o.style,display:"block"}})})});$s.displayName=Fs;function Dg(e){return e!==null}var Fg=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,u]=Bs(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,g=(o.arrow?.y??0)+c/2;let v="",f="";return d==="bottom"?(v=s?p:`${m}px`,f=`${-c}px`):d==="top"?(v=s?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(v=`${-c}px`,f=s?p:`${g}px`):d==="left"&&(v=`${n.floating.width+c}px`,f=s?p:`${g}px`),{data:{x:v,y:f}}}});function Bs(e){const[t,r="center"]=e.split("-");return[t,r]}var Us=Is,Eo=zs,Hs=Ds,Vs=$s,$g="Portal",sn=h.forwardRef((e,t)=>{const{container:r,...n}=e,[o,i]=h.useState(!1);ie(()=>i(!0),[]);const s=r||o&&globalThis?.document?.body;return s?ca.createPortal(a.jsx(W.div,{...n,ref:t}),s):null});sn.displayName=$g;function Bg(e,t){return h.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=Ug(t),o=typeof r=="function"?r({present:n.isPresent}):h.Children.only(r),i=Y(n.ref,Hg(o));return typeof r=="function"||n.isPresent?h.cloneElement(o,{ref:i}):null};Ke.displayName="Presence";function Ug(e){const[t,r]=h.useState(),n=h.useRef(null),o=h.useRef(e),i=h.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Bg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=ln(n.current);i.current=l==="mounted"?d:"none"},[l]),ie(()=>{const d=n.current,u=o.current;if(u!==e){const m=i.current,g=ln(d);e?c("MOUNT"):g==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),ie(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=g=>{const f=ln(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&f&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=g=>{g.target===t&&(i.current=ln(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function ln(e){return e?.animationName||"none"}function Hg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Vg=h[" useInsertionEffect ".trim().toString()]||ie;function lt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Wg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=h.useCallback(u=>{if(l){const p=Gg(u)?u(e):u;p!==e&&s.current?.(p)}else i(u)},[l,e,i,s]);return[c,d]}function Wg({defaultProp:e,onChange:t}){const[r,n]=h.useState(e),o=h.useRef(r),i=h.useRef(t);return Vg(()=>{i.current=t},[t]),h.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}function Gg(e){return typeof e=="function"}var qg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rt=new WeakMap,cn=new WeakMap,dn={},To=0,Ws=function(e){return e&&(e.host||Ws(e.parentNode))},Kg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ws(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Yg=function(e,t,r,n){var o=Kg(t,Array.isArray(e)?e:[e]);dn[r]||(dn[r]=new WeakMap);var i=dn[r],s=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var g=m.getAttribute(n),v=g!==null&&g!=="false",f=(Rt.get(m)||0)+1,x=(i.get(m)||0)+1;Rt.set(m,f),i.set(m,x),s.push(m),f===1&&v&&cn.set(m,!0),x===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),To++,function(){s.forEach(function(p){var m=Rt.get(p)-1,g=i.get(p)-1;Rt.set(p,m),i.set(p,g),m||(cn.has(p)||p.removeAttribute(n),cn.delete(p)),g||p.removeAttribute(r)}),To--,To||(Rt=new WeakMap,Rt=new WeakMap,cn=new WeakMap,dn={})}},Ao=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=qg(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Yg(n,o,r,"aria-hidden")):function(){return null}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Oe.apply(this,arguments)};function Gs(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Xg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var un="right-scroll-bar-position",pn="width-before-scroll-bar",Jg="with-scroll-bars-hidden",Zg="--removed-body-scroll-bar-size";function Po(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var ex=typeof window<"u"?h.useLayoutEffect:h.useEffect,qs=new WeakMap;function tx(e,t){var r=Qg(null,function(n){return e.forEach(function(o){return Po(o,n)})});return ex(function(){var n=qs.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(l){i.has(l)||Po(l,null)}),i.forEach(function(l){o.has(l)||Po(l,s)})}qs.set(r,e)},[e]),r}function rx(e){return e}function nx(e,t){t===void 0&&(t=rx);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(i),s=r}var c=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function ox(e){e===void 0&&(e={});var t=nx(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Ks=function(e){var t=e.sideCar,r=Gs(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return h.createElement(n,Oe({},r))};Ks.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),Ks}var Ys=ox(),Oo=function(){},mn=h.forwardRef(function(e,t){var r=h.useRef(null),n=h.useState({onScrollCapture:Oo,onWheelCapture:Oo,onTouchMoveCapture:Oo}),o=n[0],i=n[1],s=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,g=e.noRelative,v=e.noIsolation,f=e.inert,x=e.allowPinchZoom,_=e.as,b=_===void 0?"div":_,w=e.gapMode,S=Gs(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=tx([r,t]),k=Oe(Oe({},S),o);return h.createElement(h.Fragment,null,u&&h.createElement(C,{sideCar:Ys,removeScrollBar:d,shards:p,noRelative:g,noIsolation:v,inert:f,setCallbacks:i,allowPinchZoom:!!x,lockRef:r,gapMode:w}),s?h.cloneElement(h.Children.only(l),Oe(Oe({},k),{ref:N})):h.createElement(b,Oe({},k,{className:c,ref:N}),l))});mn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},mn.classNames={fullWidth:pn,zeroRight:un};var ix=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sx(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ix();return t&&e.setAttribute("nonce",t),e}function lx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=sx())&&(lx(t,r),cx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ux=function(){var e=dx();return function(t,r){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Xs=function(){var e=ux(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},px={left:0,top:0,right:0,gap:0},Ro=function(e){return parseInt(e||"",10)||0},mx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ro(r),Ro(n),Ro(o)]},fx=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return px;var t=mx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},hx=Xs(),Lt="data-scroll-locked",gx=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
    294   .`.concat(Jg,` {
     213`,Er=16,Bu=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:o,toasterId:s,containerStyle:i,containerClassName:l})=>{let{toasts:c,handlers:d}=hu(r,s);return g.createElement("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:Er,left:Er,right:Er,bottom:Er,pointerEvents:"none",...i},className:l,onMouseEnter:d.startPause,onMouseLeave:d.endPause},c.map(u=>{let p=u.position||t,m=d.calculateOffset(u,{reverseOrder:e,gutter:n,defaultPosition:t}),h=Fu(p,m);return g.createElement(Du,{id:u.id,key:u.id,onHeightUpdate:d.updateHeight,className:u.visible?$u:"",style:h},u.type==="custom"?Cr(u.message,u):o?o(u):g.createElement(Mu,{toast:u,position:p}))}))},G=oe;const Ka={carousel:"carousel",grid:"grid"},Uu=["marquee","stacked"],et={topBottomSpacing:0,gap:16,shape:"rectangle",size:150,hoverEffect:"none",border:{border_width:2,border_color:"#9ca3af",border_radius:6},shadow:{shadow_size:16},template:Ka.carousel,appearance:"overlay",widgetTitle:{alignment:"hidden",fontSize:24,color:"#000000"},playerAppearance:"overlay"},K={settings:"settings",stat:"statistics",cr:"create-reel",mg:"manage-group",ag:"all-groups",ar:"all-reels"},Hu=[{label:"None",value:"none"},{label:"zoom in",value:"zoom-in"},{label:"zoom out",value:"zoom-out"}],Ya=[{label:"Horizontal",value:"horizontal"}],Vu=[{label:"Vertical",value:"vertical"}],Wu=[{label:"Overlay",value:"overlay"},{label:"Only Title",value:"title"}],qu=[{label:"Overlay",value:"overlay"},{label:"Only Tile",value:"title"}];var Xa={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ja=y.createContext&&y.createContext(Xa),Gu=["attr","size","title"];function Ku(e,t){if(e==null)return{};var r=Yu(e,t),n,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yu(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tr.apply(this,arguments)}function Za(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Za(Object(r),!0).forEach(function(n){Xu(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Za(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xu(e,t,r){return t=Ju(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ju(e){var t=Zu(e,"string");return typeof t=="symbol"?t:t+""}function Zu(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qa(e){return e&&e.map((t,r)=>y.createElement(t.tag,Ar({key:r},t.attr),Qa(t.child)))}function H(e){return t=>y.createElement(Qu,Tr({attr:Ar({},e.attr)},t),Qa(e.child))}function Qu(e){var t=r=>{var{attr:n,size:o,title:s}=e,i=Ku(e,Gu),l=o||r.size||"1em",c;return r.className&&(c=r.className),e.className&&(c=(c?c+" ":"")+e.className),y.createElement("svg",Tr({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:c,style:Ar(Ar({color:e.color||r.color},r.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&y.createElement("title",null,s),e.children)};return Ja!==void 0?y.createElement(Ja.Consumer,null,r=>t(r)):t(Xa)}function ep(e){return H({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M164.44,105.34l-48-32A8,8,0,0,0,104,80v64a8,8,0,0,0,12.44,6.66l48-32a8,8,0,0,0,0-13.32ZM120,129.05V95l25.58,17ZM216,40H40A16,16,0,0,0,24,56V168a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,128H40V56H216V168Zm16,40a8,8,0,0,1-8,8H32a8,8,0,0,1,0-16H224A8,8,0,0,1,232,208Z"},child:[]}]})(e)}function qt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M17 10h-1v-2c0-2.205-1.794-4-4-4s-4 1.795-4 4v2h-1c-1.103 0-2 .896-2 2v7c0 1.104.897 2 2 2h10c1.103 0 2-.896 2-2v-7c0-1.104-.897-2-2-2zm-5 8.299c-.719 0-1.3-.58-1.3-1.299s.581-1.301 1.3-1.301 1.3.582 1.3 1.301-.581 1.299-1.3 1.299zm2-7.299h-4v-3c0-1.104.897-2 2-2s2 .896 2 2v3z"},child:[]}]})(e)}function gt(e){return H({attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 10h-4v-4c0-1.104-.896-2-2-2s-2 .896-2 2l.071 4h-4.071c-1.104 0-2 .896-2 2s.896 2 2 2l4.071-.071-.071 4.071c0 1.104.896 2 2 2s2-.896 2-2v-4.071l4 .071c1.104 0 2-.896 2-2s-.896-2-2-2z"},child:[]}]})(e)}function Gt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m15 18-6-6 6-6"},child:[]}]})(e)}function Kt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m9 18 6-6-6-6"},child:[]}]})(e)}function tp(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"},child:[]}]})(e)}function rp(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"},child:[]},{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]}]})(e)}function tt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 12a9 9 0 1 1-6.219-8.56"},child:[]}]})(e)}function np(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"},child:[]},{tag:"path",attr:{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"},child:[]},{tag:"path",attr:{d:"M7 3v4a1 1 0 0 0 1 1h7"},child:[]}]})(e)}function es(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"path",attr:{d:"m21 21-4.3-4.3"},child:[]}]})(e)}function op(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},child:[]},{tag:"path",attr:{d:"M12 9v4"},child:[]},{tag:"path",attr:{d:"M12 17h.01"},child:[]}]})(e)}function Yt(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 6 6 18"},child:[]},{tag:"path",attr:{d:"m6 6 12 12"},child:[]}]})(e)}function ts(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Hn(...e){return t=>{let r=!1;const n=e.map(o=>{const s=ts(o,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let o=0;o<n.length;o++){const s=n[o];typeof s=="function"?s():ts(e[o],null)}}}}function Y(...e){return g.useCallback(Hn(...e),e)}function rt(e){const t=sp(e),r=g.forwardRef((n,o)=>{const{children:s,...i}=n,l=g.Children.toArray(s),c=l.find(lp);if(c){const d=c.props.children,u=l.map(p=>p===c?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}var ap=rt("Slot");function sp(e){const t=g.forwardRef((r,n)=>{const{children:o,...s}=r;if(g.isValidElement(o)){const i=dp(o),l=cp(s,o.props);return o.type!==g.Fragment&&(l.ref=n?Hn(n,i):i),g.cloneElement(o,l)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ip=Symbol("radix.slottable");function lp(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ip}function cp(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function dp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function rs(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=rs(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function up(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=rs(e))&&(n&&(n+=" "),n+=t);return n}function D(...e){return up(e)}const pp="ecr-button",mp={default:"ecr-button--primary",destructive:"ecr-button--danger",outline:"ecr-button--outline",secondary:"ecr-button--secondary",ghost:"ecr-button--ghost",link:"ecr-button--link"},fp={default:"ecr-button--md",sm:"ecr-button--sm",lg:"ecr-button--lg",icon:"ecr-button--icon","icon-sm":"ecr-button--icon-sm","icon-lg":"ecr-button--icon-lg"};function re({className:e,variant:t="default",size:r="default",asChild:n=!1,...o}){const s=n?ap:"button";return a.jsx(s,{"data-slot":"button","data-variant":t,"data-size":r,className:D(pp,mp[t],fp[r],e),...o})}function hp({selectedReelIds:e,handleSelectAll:t,clearSelection:r,searchTerm:n,setSearchTerm:o,isCreating:s,handleCreateGroup:i}){return a.jsxs("div",{className:"ecr-admin-reels-header",children:[a.jsxs("div",{className:"ecr-admin-reels-header__left",children:[a.jsx("h2",{className:"ecr-admin-reels-header__title",children:"Reels"}),e.length?a.jsxs("div",{className:"ecr-admin-reels-header__actions",children:[a.jsx(re,{onClick:t,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--primary",children:"Select all"}),a.jsx(re,{onClick:r,variant:"link",className:"ecr-admin-reels-header__action ecr-admin-reels-header__action--danger",children:"Clear"})]}):null]}),a.jsxs("div",{className:"ecr-admin-reels-header__right",children:[a.jsxs("div",{className:"ecr-admin-reels-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:l=>o(l.target.value),className:"ecr-admin-search-input"}),a.jsxs("div",{className:"ecr-admin-reels-header__icon-wrapper",children:[n&&a.jsx(re,{onClick:()=>o(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-reels-header__clear-icon"})}),a.jsx(es,{size:16,className:"ecr-admin-reels-header__search-icon"})]})," "]}),e.length?a.jsxs(re,{disabled:s,onClick:i,className:"ecr-admin-reels-header__create",children:[s?a.jsx(tt,{className:"ecr-admin-reels-header__spinner"}):a.jsx(gt,{})," ","Create Group"]}):null]})]})}function gp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m112 160-64 64 64 64"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M64 224h294c58.76 0 106 49.33 106 108v20"},child:[]}]})(e)}function xp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M262.29 192.31a64 64 0 1 0 57.4 57.4 64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22 155.3 155.3 0 0 1-21.46-12.57 16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22 155.3 155.3 0 0 1 21.46 12.57 16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z"},child:[]}]})(e)}function nt(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M85.57 446.25h340.86a32 32 0 0 0 28.17-47.17L284.18 82.58c-12.09-22.44-44.27-22.44-56.36 0L57.4 399.08a32 32 0 0 0 28.17 47.17z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"m250.26 195.39 5.74 122 5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 5.95z"},child:[]},{tag:"path",attr:{d:"M256 397.25a20 20 0 1 1 20-20 20 20 0 0 1-20 20z"},child:[]}]})(e)}function bp(){return a.jsx("div",{className:"ecr-admin-reels-empty",children:a.jsxs("p",{className:"ecr-admin-reels-empty__text",children:[a.jsx(nt,{color:"#FFA500",size:40}),a.jsx("span",{children:"You did not have any reel yet."})]})})}function vp({isFullScreen:e}){return a.jsx("div",{className:D("ecr-admin-reels-loading",e&&"ecr-admin-reels-loading--fullscreen"),children:a.jsx(tt,{className:"ecr-admin-reels-loading__icon"})})}const ns=({playingStory:e,duration:t,currentFileIndex:r,isPaused:n})=>a.jsx("div",{className:"ecr-player__progress",children:e?.files?.map((o,s)=>a.jsx("div",{className:"ecr-player__progress-track",children:a.jsx("div",{style:{"--reels-wp-animation-time":`${t}s`,animationPlayState:n?"paused":"running"},className:D("ecr-player__progress-fill",s===r?.index?"ecr-player__progress-fill--active":s<r?.index?"ecr-player__progress-fill--complete":"ecr-player__progress-fill--empty")})},s))}),xt=({className:e,children:t,...r})=>a.jsx("button",{className:D("ecr-player__nav",e),...r,children:t});function Vn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M4.5 3H6v10H4.5V3zm7 0v10H10V3h1.5z"},child:[]}]})(e)}function Wn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 5h2.79l3.86-3.83.85.35v13l-.85.33L4.29 11H1.5l-.5-.5v-5l.5-.5zm3.35 5.17L8 13.31V2.73L4.85 5.85 4.5 6H2v4h2.5l.35.17zm9.381-4.108l.707.707L13.207 8.5l1.731 1.732-.707.707L12.5 9.207l-1.732 1.732-.707-.707L11.793 8.5 10.06 6.77l.707-.707 1.733 1.73 1.731-1.731z"},child:[]}]})(e)}function qn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M3.78 2L3 2.41v12l.78.42 9-6V8l-9-6zM4 13.48V3.35l7.6 5.07L4 13.48z"},child:[]}]})(e)}function Gn(e){return H({attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 4.83h2.79L8.15 1l.85.35v13l-.85.33-3.86-3.85H1.5l-.5-.5v-5l.5-.5zM4.85 10L8 13.14V2.56L4.85 5.68l-.35.15H2v4h2.5l.35.17zM15 7.83a6.97 6.97 0 0 1-1.578 4.428l-.712-.71A5.975 5.975 0 0 0 14 7.83c0-1.4-.48-2.689-1.284-3.71l.712-.71A6.971 6.971 0 0 1 15 7.83zm-2 0a4.978 4.978 0 0 1-1.002 3.004l-.716-.716A3.982 3.982 0 0 0 12 7.83a3.98 3.98 0 0 0-.713-2.28l.716-.716c.626.835.997 1.872.997 2.996zm-2 0c0 .574-.16 1.11-.44 1.566l-.739-.738a1.993 1.993 0 0 0 .005-1.647l.739-.739c.276.454.435.988.435 1.558z"},child:[]}]})(e)}const _p="Left",yp="Right",jp="Up",Sp="Down",bt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Kn={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},os="mousemove",as="mouseup",Cp="touchend",kp="touchmove",Np="touchstart";function Ep(e,t,r,n){return e>t?r>0?yp:_p:n>0?Sp:jp}function ss(e,t){if(t===0)return e;const r=Math.PI/180*t,n=e[0]*Math.cos(r)+e[1]*Math.sin(r),o=e[1]*Math.cos(r)-e[0]*Math.sin(r);return[n,o]}function Tp(e,t){const r=u=>{const p="touches"in u;p&&u.touches.length>1||e((m,h)=>{h.trackMouse&&!p&&(document.addEventListener(os,n),document.addEventListener(as,i));const{clientX:b,clientY:f}=p?u.touches[0]:u,x=ss([b,f],h.rotationAngle);return h.onTouchStartOrOnMouseDown&&h.onTouchStartOrOnMouseDown({event:u}),Object.assign(Object.assign(Object.assign({},m),Kn),{initial:x.slice(),xy:x,start:u.timeStamp||0})})},n=u=>{e((p,m)=>{const h="touches"in u;if(h&&u.touches.length>1)return p;if(u.timeStamp-p.start>m.swipeDuration)return p.swiping?Object.assign(Object.assign({},p),{swiping:!1}):p;const{clientX:b,clientY:f}=h?u.touches[0]:u,[x,_]=ss([b,f],m.rotationAngle),v=x-p.xy[0],w=_-p.xy[1],j=Math.abs(v),C=Math.abs(w),N=(u.timeStamp||0)-p.start,k=Math.sqrt(j*j+C*C)/(N||1),E=[v/(N||1),w/(N||1)],T=Ep(j,C,v,w),O=typeof m.delta=="number"?m.delta:m.delta[T.toLowerCase()]||bt.delta;if(j<O&&C<O&&!p.swiping)return p;const L={absX:j,absY:C,deltaX:v,deltaY:w,dir:T,event:u,first:p.first,initial:p.initial,velocity:k,vxvy:E};L.first&&m.onSwipeStart&&m.onSwipeStart(L),m.onSwiping&&m.onSwiping(L);let A=!1;return(m.onSwiping||m.onSwiped||m[`onSwiped${T}`])&&(A=!0),A&&m.preventScrollOnSwipe&&m.trackTouch&&u.cancelable&&u.preventDefault(),Object.assign(Object.assign({},p),{first:!1,eventData:L,swiping:!0})})},o=u=>{e((p,m)=>{let h;if(p.swiping&&p.eventData){if(u.timeStamp-p.start<m.swipeDuration){h=Object.assign(Object.assign({},p.eventData),{event:u}),m.onSwiped&&m.onSwiped(h);const b=m[`onSwiped${h.dir}`];b&&b(h)}}else m.onTap&&m.onTap({event:u});return m.onTouchEndOrOnMouseUp&&m.onTouchEndOrOnMouseUp({event:u}),Object.assign(Object.assign(Object.assign({},p),Kn),{eventData:h})})},s=()=>{document.removeEventListener(os,n),document.removeEventListener(as,i)},i=u=>{s(),o(u)},l=(u,p)=>{let m=()=>{};if(u&&u.addEventListener){const h=Object.assign(Object.assign({},bt.touchEventOptions),p.touchEventOptions),b=[[Np,r,h],[kp,n,Object.assign(Object.assign({},h),p.preventScrollOnSwipe?{passive:!1}:{})],[Cp,o,h]];b.forEach(([f,x,_])=>u.addEventListener(f,x,_)),m=()=>b.forEach(([f,x])=>u.removeEventListener(f,x))}return m},d={ref:u=>{u!==null&&e((p,m)=>{if(p.el===u)return p;const h={};return p.el&&p.el!==u&&p.cleanUpTouch&&(p.cleanUpTouch(),h.cleanUpTouch=void 0),m.trackTouch&&u&&(h.cleanUpTouch=l(u,m)),Object.assign(Object.assign(Object.assign({},p),{el:u}),h)})}};return t.trackMouse&&(d.onMouseDown=r),[d,l]}function Ap(e,t,r,n){return!t.trackTouch||!e.el?(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0})):e.cleanUpTouch?t.preventScrollOnSwipe!==r.preventScrollOnSwipe||t.touchEventOptions.passive!==r.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:n(e.el,t)})}function Pp(e){const{trackMouse:t}=e,r=g.useRef(Object.assign({},Kn)),n=g.useRef(Object.assign({},bt)),o=g.useRef(Object.assign({},n.current));o.current=Object.assign({},n.current),n.current=Object.assign(Object.assign({},bt),e);let s;for(s in bt)n.current[s]===void 0&&(n.current[s]=bt[s]);const[i,l]=g.useMemo(()=>Tp(c=>r.current=c(r.current,n.current),{trackMouse:t}),[t]);return r.current=Ap(r.current,n.current,o.current,l),i}const Op=({videoRefs:e,file:t,isMuted:r,isPaused:n,i:o,togglePlayPause:s,handleNextFile:i,setDuration:l})=>{const[c,d]=y.useState(!1);return a.jsx("div",{className:"ecr-player__media-frame",children:a.jsx("video",{preload:"none",playsInline:!0,muted:r,autoPlay:!n,controls:!1,loop:!1,disablePictureInPicture:!0,controlsList:"nodownload noplaybackrate noremoteplayback",ref:u=>{u&&(e.current[o]=u,u.setAttribute("webkit-playsinline","true"),u.setAttribute("x-webkit-airplay","allow"),u.setAttribute("airplay","allow"))},className:c?"ecr-player__media ecr-player__media--portrait":"ecr-player__media",src:t?.url,onClick:()=>s(o),onEnded:i,onLoadedMetadata:u=>{const p=u.currentTarget,m=p.videoWidth,h=p.videoHeight;d(h>m),l(p.duration)}})})},is=({currentFileIndex:e,files:t,setDuration:r,setIsPlaying:n,setPreviewReel:o,isPaused:s,setIsPaused:i,handlePrevFile:l,handleNextFile:c})=>{const[d,u]=y.useState(!1),p=y.useRef([]);y.useEffect(()=>{p.current=[]},[t]);const m=x=>{const _=p.current[x];_&&(s?_.play():_.pause(),i(v=>!v))},h=x=>{const _=p.current[x];_&&(_.muted=!d,u(v=>!v))},b=typeof window<"u"&&window.matchMedia("(max-width: 767px)").matches,f=Pp({trackMouse:!0,onSwipedRight:l,onSwipedLeft:c,onSwipedUp:()=>{b&&c()},onSwipedDown:()=>{if(b){l();return}n&&n(null),o&&o(null)}});return a.jsx("div",{style:{left:`${-100*e?.index}%`},className:"ecr-player__slider",...f,children:Array.isArray(t)&&t.map((x,_)=>a.jsx("div",{className:"ecr-player__slide",children:x?.mime_type?.startsWith("image")?null:a.jsxs("div",{className:"ecr-player__media-frame",children:[a.jsx(Op,{videoRefs:p,file:x,isMuted:d,i:_,togglePlayPause:m,handleNextFile:c,setDuration:r,isPaused:s},x.file_uuid),a.jsxs("div",{className:"ecr-player__controls",children:[s?a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}):a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:()=>m(_)}),d?a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(_)}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:()=>h(_)})]})]})},_))})},Rp=({previewReel:e,setPreviewReel:t})=>{const[r,n]=y.useState({index:0,story_uuid:e?.story_uuid}),[o,s]=y.useState(!1),[i,l]=y.useState(3);y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const c=()=>{const m=e?.files??[];r?.index>0?n(h=>({index:h.index-1,story_uuid:m[h.index-1].story_uuid})):t(null)},d=()=>{const m=e?.files??[];r?.index+1<m.length?n(h=>({index:h.index+1,story_uuid:m[h.index+1].story_uuid})):t(null)},u=e.files.length,p=m=>{m.target===m.currentTarget&&t(null)};return a.jsx("div",{onClick:p,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:e&&a.jsxs("div",{className:"ecr-player__stage",children:[u>1?a.jsxs(a.Fragment,{children:[r.index>0?a.jsx(xt,{onClick:c,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}):null,r.index<u-1?a.jsx(xt,{onClick:d,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}):null]}):null,a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[e&&a.jsx(ns,{playingStory:e,duration:i,currentFileIndex:r,isPaused:o},`${e.story_uuid}-${r.index}`),a.jsx("div",{onClick:()=>t(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),e?.files.length>0&&a.jsx(is,{currentFileIndex:r,files:e?.files,setDuration:l,setPreviewReel:t,isPaused:o,setIsPaused:s,handlePrevFile:c,handleNextFile:d,storyId:e.id,storyTitle:e?.title})]})]})})};function Lp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z"},child:[]}]})(e)}function Ip(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z"},child:[]}]})(e)}function zp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z"},child:[]}]})(e)}function Pr(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.045 7.401c.378-.378.586-.88.586-1.414s-.208-1.036-.586-1.414l-1.586-1.586c-.378-.378-.88-.586-1.414-.586s-1.036.208-1.413.585L4 13.585V18h4.413L19.045 7.401zm-3-3 1.587 1.585-1.59 1.584-1.586-1.585 1.589-1.584zM6 16v-1.585l7.04-7.018 1.586 1.586L7.587 16H6zm-2 4h16v2H4z"},child:[]}]})(e)}function Mp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 19c.946 0 1.81-.103 2.598-.281l-1.757-1.757c-.273.021-.55.038-.841.038-5.351 0-7.424-3.846-7.926-5a8.642 8.642 0 0 1 1.508-2.297L4.184 8.305c-1.538 1.667-2.121 3.346-2.132 3.379a.994.994 0 0 0 0 .633C2.073 12.383 4.367 19 12 19zm0-14c-1.837 0-3.346.396-4.604.981L3.707 2.293 2.293 3.707l18 18 1.414-1.414-3.319-3.319c2.614-1.951 3.547-4.615 3.561-4.657a.994.994 0 0 0 0-.633C21.927 11.617 19.633 5 12 5zm4.972 10.558-2.28-2.28c.19-.39.308-.819.308-1.278 0-1.641-1.359-3-3-3-.459 0-.888.118-1.277.309L8.915 7.501A9.26 9.26 0 0 1 12 7c5.351 0 7.424 3.846 7.926 5-.302.692-1.166 2.342-2.954 3.558z"},child:[]}]})(e)}function ls(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 12a2 2 0 0 0-.703.133l-2.398-1.963c.059-.214.101-.436.101-.67C17 8.114 15.886 7 14.5 7S12 8.114 12 9.5c0 .396.1.765.262 1.097l-2.909 3.438A2.06 2.06 0 0 0 9 14c-.179 0-.348.03-.512.074l-2.563-2.563C5.97 11.348 6 11.179 6 11c0-1.108-.892-2-2-2s-2 .892-2 2 .892 2 2 2c.179 0 .348-.03.512-.074l2.563 2.563A1.906 1.906 0 0 0 7 16c0 1.108.892 2 2 2s2-.892 2-2c0-.237-.048-.46-.123-.671l2.913-3.442c.227.066.462.113.71.113a2.48 2.48 0 0 0 1.133-.281l2.399 1.963A2.077 2.077 0 0 0 18 14c0 1.108.892 2 2 2s2-.892 2-2-.892-2-2-2z"},child:[]}]})(e)}function Dp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM7 12.414l-3.707-3.707 1.414-1.414 2.293 2.293 4.793-4.793 1.414 1.414-6.207 6.207z"},child:[]}]})(e)}function Fp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 0h-12c-1.1 0-2 0.9-2 2v12c0 1.1 0.9 2 2 2h12c1.1 0 2-0.9 2-2v-12c0-1.1-0.9-2-2-2zM14 14h-12v-12h12v12z"},child:[]}]})(e)}function $p(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 10c-1.105 0-2-0.895-2-2s0.895-2 2-2c1.105 0 2 0.895 2 2s-0.895 2-2 2z"},child:[]}]})(e)}function Bp(e){return H({attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14c-3.314 0-6-2.686-6-6s2.686-6 6-6c3.314 0 6 2.686 6 6s-2.686 6-6 6z"},child:[]}]})(e)}function cs(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Up(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function Hp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]}]})(e)}function Vp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM12 5.5v9l6-4.5z"},child:[]}]})(e)}function Wp(e){return H({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5 2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5z"},child:[]}]})(e)}const qp=e=>{if(e<1e3)return e;if(e<1e6){const r=e/1e3;return r%1===0?`${r}k`:`${r.toFixed(1)}k`}if(e<1e9){const r=e/1e6;return r%1===0?`${r}m`:`${r.toFixed(1)}m`}const t=e/1e9;return t%1===0?`${t}b`:`${t.toFixed(1)}b`},Gp=({story:e,styles:t,storyViews:r,setStoryViews:n})=>{y.useEffect(()=>{n&&n(i=>({...i,[e.id]:e.view_count}))},[e]);const o=e?.files[0]?.mime_type.startsWith("video"),s=e.thumbnail||void 0;return a.jsxs("div",{className:"ecr-thumb__media",children:[o?a.jsx("video",{className:"ecr-thumb__video",src:e?.files[0]?.url,poster:s}):a.jsx("div",{className:"ecr-thumb__placeholder",children:"No Video"}),(r?.[e.id]??e.view_count)>0&&a.jsxs("div",{style:{left:t?.shape==="circle"?"50%":"100%",transform:`translateX(${t?.shape==="circle"?"-50%":"-125%"})`,transition:"all 0.3s ease-in-out"},className:"ecr-thumb__views",children:[a.jsx("span",{children:qp(r?.[e.id]??e.view_count)}),a.jsx(rp,{size:14})]})]})},Yn=y.memo(Gp);function Kp({reel:e,styles:t,isSelected:r,onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:i}){return a.jsxs("div",{className:`ecr-admin-reel-card ${t?.hoverEffect??""}`,children:[a.jsxs("div",{style:{aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},className:D("ecr-admin-reel-card__frame",r?"ecr-admin-reel-card__frame--selected":""),children:[a.jsx(Yn,{story:e,styles:t}),a.jsxs("div",{className:D("ecr-admin-reel-card__actions",i?"":"ecr-admin-reel-card__actions--hover"),children:[e.files[0]?.mime_type.startsWith("image")?null:a.jsx(re,{onClick:()=>s(e),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--primary",size:"icon-sm",title:"Preview Reel",children:a.jsx(Wp,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--primary"})}),a.jsx(re,{title:"Edit Reel",size:"icon-sm",asChild:!0,className:"ecr-admin-reel-card__action",children:a.jsx(ht,{to:`?view=${K.cr}&from=${K.ar}&sid=${e.id}`,children:a.jsx(Pr,{className:"ecr-admin-reel-card__icon"})})}),a.jsx(re,{onClick:()=>o(e.id),className:"ecr-admin-reel-card__action ecr-admin-reel-card__action--danger",size:"icon-sm",title:"Remove Reel",children:a.jsx(cs,{size:18,className:"ecr-admin-reel-card__icon ecr-admin-reel-card__icon--danger"})})]}),a.jsx("div",{style:{clipPath:"polygon(0% 0, 100% 100%, 100% 0)"},className:D("ecr-admin-reel-card__corner",i?"":"ecr-admin-reel-card__corner--hidden",r?"ecr-admin-reel-card__corner--selected":"ecr-admin-reel-card__corner--idle"),children:a.jsx(re,{onClick:()=>n(e.id),size:"icon-sm",className:"ecr-admin-reel-card__select",children:r?a.jsx(Dp,{size:18,className:"ecr-admin-reel-card__check ecr-admin-reel-card__check--active"}):a.jsx(Fp,{size:18,className:"ecr-admin-reel-card__check"})})})]}),e.title&&a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel-card__title",children:e.title})]})}function Yp({reels:e,styles:t,selectedReelIds:r,onSelectReel:n,onDeleteReel:o,onPreviewReel:s,lastStoryElementRef:i}){return a.jsx("div",{style:{"--thumbnail-size":`${t?.size}px`},className:"ecr-admin-reels-grid",children:e?.map((l,c)=>a.jsx("div",{ref:e.length===c+1?i:null,children:a.jsx(Kp,{reel:l,styles:t,isSelected:r.includes(l.id),onSelect:n,onDelete:o,onPreview:s,isAnyReelSelected:r.length>0})},l.id))})}const Xt=({cb:e})=>{const t=Se(),r=()=>{e?e():t(-1)};return a.jsx("button",{title:"Back",onClick:r,className:"ecr-admin-back-button",children:a.jsx(gp,{size:24})})};function Xp(e){return H({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"},child:[]}]})(e)}const Jt=({breads:e=[],onNavigate:t})=>a.jsx("nav",{className:"ecr-admin-breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ul",{className:"ecr-admin-breadcrumb__list",children:e.map((r,n)=>{const o=!r.href;return a.jsxs("li",{className:"ecr-admin-breadcrumb__item",children:[r.href&&!o?a.jsx(ht,{to:r.href,className:"ecr-admin-breadcrumb__link",onClick:s=>{if(!t)return;const i=r.href;i&&(s.preventDefault(),t(i))},children:r.label}):a.jsx("span",{className:"ecr-admin-breadcrumb__current",children:r.label}),n<e.length-1&&a.jsx(Xp,{className:"ecr-admin-breadcrumb__separator"})]},n)})})}),Or=({onReject:e,onAccept:t,isLoading:r,message:n="Are you sure, You want to delete this story?"})=>{const o=y.useRef(null);return y.useEffect(()=>{o.current&&o.current.focus()},[]),a.jsx("div",{className:"ecr-admin-modal",children:a.jsxs("div",{ref:o,tabIndex:-1,className:"ecr-admin-modal__panel",onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||e(null)},children:[a.jsxs("div",{className:"ecr-admin-modal__content",children:[a.jsx("div",{className:"ecr-admin-modal__icon",children:a.jsx(op,{size:40,color:"#ffa500"})}),a.jsx("p",{className:"ecr-admin-modal__message",children:n})]}),a.jsxs("div",{className:"ecr-admin-modal__actions",children:[a.jsx("button",{disabled:r,onClick:()=>e(null),className:"ecr-admin-modal__button ecr-admin-modal__button--cancel",children:"No"}),a.jsxs("button",{disabled:r,onClick:t,className:"ecr-admin-modal__button ecr-admin-modal__button--danger",children:[r&&a.jsx(tt,{className:"ecr-admin-modal__spinner"}),"Yes"]})]})]})})},Rr=({to:e,Icon:t,textColor:r="#fff",text:n,className:o,onNavigate:s})=>a.jsxs(ht,{style:{color:r},to:e,className:D("ecr-admin-link-button",o),onClick:i=>{s&&(i.preventDefault(),s(e))},children:[t&&a.jsx(t,{}),n]}),Lr=({className:e})=>a.jsx("div",{className:D("ecr-admin-loader",e),children:a.jsx(tt,{className:"ecr-admin-loader__icon",size:64})}),vt=({left:e=[],center:t=[],right:r=[]})=>a.jsxs("div",{className:"ecr-admin-navbar",children:[a.jsx("div",{className:"ecr-admin-navbar__section",children:e.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:t.map((n,o)=>a.jsx(y.Fragment,{children:n},o))}),a.jsx("div",{className:"ecr-admin-navbar__section",children:r.map((n,o)=>a.jsx(y.Fragment,{children:n},o))})]}),_t=({name:e,Icon:t})=>a.jsxs("h1",{className:"ecr-admin-page-name",children:[a.jsx(t,{}),e]});function Jp(e){return H({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M55 18v476h18v-37h46v37h274v-37h46v37h18V18h-18v37h-46V18h-18v60H137V18h-18v37H73V18H55zm18 55h46v46H73V73zm320 0h46v46h-46V73zm-256 41h238v156H137V114zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 201h46v46H73v-46zm320 0h46v46h-46v-46zM73 265h46v46H73v-46zm320 0h46v46h-46v-46zm-256 41h238v156H137V306zm-64 23h46v46H73v-46zm320 0h46v46h-46v-46zM73 393h46v46H73v-46zm320 0h46v46h-46v-46z"},child:[]}]})(e)}const Ir=()=>a.jsxs("div",{className:"ecr-admin-widget-name",children:[a.jsx(Jp,{}),"ReelsWP"]});function ds(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zp}=Object.prototype,{getPrototypeOf:Xn}=Object,{iterator:zr,toStringTag:us}=Symbol,Mr=(e=>t=>{const r=Zp.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ve=e=>(e=e.toLowerCase(),t=>Mr(t)===e),Dr=e=>t=>typeof t===e,{isArray:yt}=Array,wt=Dr("undefined");function Zt(e){return e!==null&&!wt(e)&&e.constructor!==null&&!wt(e.constructor)&&ce(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ps=ve("ArrayBuffer");function Qp(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ps(e.buffer),t}const em=Dr("string"),ce=Dr("function"),ms=Dr("number"),Qt=e=>e!==null&&typeof e=="object",tm=e=>e===!0||e===!1,Fr=e=>{if(Mr(e)!=="object")return!1;const t=Xn(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(us in e)&&!(zr in e)},rm=e=>{if(!Qt(e)||Zt(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},nm=ve("Date"),om=ve("File"),am=ve("Blob"),sm=ve("FileList"),im=e=>Qt(e)&&ce(e.pipe),lm=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ce(e.append)&&((t=Mr(e))==="formdata"||t==="object"&&ce(e.toString)&&e.toString()==="[object FormData]"))},cm=ve("URLSearchParams"),[dm,um,pm,mm]=["ReadableStream","Request","Response","Headers"].map(ve),fm=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function er(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),yt(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(Zt(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let l;for(n=0;n<i;n++)l=s[n],t.call(null,e[l],l,e)}}function fs(e,t){if(Zt(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const ot=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hs=e=>!wt(e)&&e!==ot;function Jn(){const{caseless:e,skipUndefined:t}=hs(this)&&this||{},r={},n=(o,s)=>{const i=e&&fs(r,s)||s;Fr(r[i])&&Fr(o)?r[i]=Jn(r[i],o):Fr(o)?r[i]=Jn({},o):yt(o)?r[i]=o.slice():(!t||!wt(o))&&(r[i]=o)};for(let o=0,s=arguments.length;o<s;o++)arguments[o]&&er(arguments[o],n);return r}const hm=(e,t,r,{allOwnKeys:n}={})=>(er(t,(o,s)=>{r&&ce(o)?e[s]=ds(o,r):e[s]=o},{allOwnKeys:n}),e),gm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xm=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},bm=(e,t,r,n)=>{let o,s,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!n||n(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=r!==!1&&Xn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},vm=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},_m=e=>{if(!e)return null;if(yt(e))return e;let t=e.length;if(!ms(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ym=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Xn(Uint8Array)),wm=(e,t)=>{const n=(e&&e[zr]).call(e);let o;for(;(o=n.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},jm=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Sm=ve("HTMLFormElement"),Cm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),gs=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),km=ve("RegExp"),xs=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};er(r,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(n[s]=i||o)}),Object.defineProperties(e,n)},Nm=e=>{xs(e,(t,r)=>{if(ce(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(ce(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Em=(e,t)=>{const r={},n=o=>{o.forEach(s=>{r[s]=!0})};return yt(e)?n(e):n(String(e).split(t)),r},Tm=()=>{},Am=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Pm(e){return!!(e&&ce(e.append)&&e[us]==="FormData"&&e[zr])}const Om=e=>{const t=new Array(10),r=(n,o)=>{if(Qt(n)){if(t.indexOf(n)>=0)return;if(Zt(n))return n;if(!("toJSON"in n)){t[o]=n;const s=yt(n)?[]:{};return er(n,(i,l)=>{const c=r(i,o+1);!wt(c)&&(s[l]=c)}),t[o]=void 0,s}}return n};return r(e,0)},Rm=ve("AsyncFunction"),Lm=e=>e&&(Qt(e)||ce(e))&&ce(e.then)&&ce(e.catch),bs=((e,t)=>e?setImmediate:t?((r,n)=>(ot.addEventListener("message",({source:o,data:s})=>{o===ot&&s===r&&n.length&&n.shift()()},!1),o=>{n.push(o),ot.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",ce(ot.postMessage)),Im=typeof queueMicrotask<"u"?queueMicrotask.bind(ot):typeof process<"u"&&process.nextTick||bs,S={isArray:yt,isArrayBuffer:ps,isBuffer:Zt,isFormData:lm,isArrayBufferView:Qp,isString:em,isNumber:ms,isBoolean:tm,isObject:Qt,isPlainObject:Fr,isEmptyObject:rm,isReadableStream:dm,isRequest:um,isResponse:pm,isHeaders:mm,isUndefined:wt,isDate:nm,isFile:om,isBlob:am,isRegExp:km,isFunction:ce,isStream:im,isURLSearchParams:cm,isTypedArray:ym,isFileList:sm,forEach:er,merge:Jn,extend:hm,trim:fm,stripBOM:gm,inherits:xm,toFlatObject:bm,kindOf:Mr,kindOfTest:ve,endsWith:vm,toArray:_m,forEachEntry:wm,matchAll:jm,isHTMLForm:Sm,hasOwnProperty:gs,hasOwnProp:gs,reduceDescriptors:xs,freezeMethods:Nm,toObjectSet:Em,toCamelCase:Cm,noop:Tm,toFiniteNumber:Am,findKey:fs,global:ot,isContextDefined:hs,isSpecCompliantForm:Pm,toJSONObject:Om,isAsyncFn:Rm,isThenable:Lm,setImmediate:bs,asap:Im,isIterable:e=>e!=null&&ce(e[zr])};function B(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}S.inherits(B,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:S.toJSONObject(this.config),code:this.code,status:this.status}}});const vs=B.prototype,_s={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{_s[e]={value:e}}),Object.defineProperties(B,_s),Object.defineProperty(vs,"isAxiosError",{value:!0}),B.from=(e,t,r,n,o,s)=>{const i=Object.create(vs);S.toFlatObject(e,i,function(u){return u!==Error.prototype},d=>d!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return B.call(i,l,c,r,n,o),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const zm=null;function Zn(e){return S.isPlainObject(e)||S.isArray(e)}function ys(e){return S.endsWith(e,"[]")?e.slice(0,-2):e}function ws(e,t,r){return e?e.concat(t).map(function(o,s){return o=ys(o),!r&&s?"["+o+"]":o}).join(r?".":""):t}function Mm(e){return S.isArray(e)&&!e.some(Zn)}const Dm=S.toFlatObject(S,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(e,t,r){if(!S.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=S.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,x){return!S.isUndefined(x[f])});const n=r.metaTokens,o=r.visitor||u,s=r.dots,i=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&S.isSpecCompliantForm(t);if(!S.isFunction(o))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(S.isDate(b))return b.toISOString();if(S.isBoolean(b))return b.toString();if(!c&&S.isBlob(b))throw new B("Blob is not supported. Use a Buffer instead.");return S.isArrayBuffer(b)||S.isTypedArray(b)?c&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,f,x){let _=b;if(b&&!x&&typeof b=="object"){if(S.endsWith(f,"{}"))f=n?f:f.slice(0,-2),b=JSON.stringify(b);else if(S.isArray(b)&&Mm(b)||(S.isFileList(b)||S.endsWith(f,"[]"))&&(_=S.toArray(b)))return f=ys(f),_.forEach(function(w,j){!(S.isUndefined(w)||w===null)&&t.append(i===!0?ws([f],j,s):i===null?f:f+"[]",d(w))}),!1}return Zn(b)?!0:(t.append(ws(x,f,s),d(b)),!1)}const p=[],m=Object.assign(Dm,{defaultVisitor:u,convertValue:d,isVisitable:Zn});function h(b,f){if(!S.isUndefined(b)){if(p.indexOf(b)!==-1)throw Error("Circular reference detected in "+f.join("."));p.push(b),S.forEach(b,function(_,v){(!(S.isUndefined(_)||_===null)&&o.call(t,_,S.isString(v)?v.trim():v,f,m))===!0&&h(_,f?f.concat(v):[v])}),p.pop()}}if(!S.isObject(e))throw new TypeError("data must be an object");return h(e),t}function js(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Qn(e,t){this._pairs=[],e&&$r(e,this,t)}const Ss=Qn.prototype;Ss.append=function(t,r){this._pairs.push([t,r])},Ss.toString=function(t){const r=t?function(n){return t.call(this,n,js)}:js;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Fm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Cs(e,t,r){if(!t)return e;const n=r&&r.encode||Fm;S.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(o?s=o(t,r):s=S.isURLSearchParams(t)?t.toString():new Qn(t,r).toString(n),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ks{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){S.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ns={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$m={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Qn,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},eo=typeof window<"u"&&typeof document<"u",to=typeof navigator=="object"&&navigator||void 0,Bm=eo&&(!to||["ReactNative","NativeScript","NS"].indexOf(to.product)<0),Um=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hm=eo&&window.location.href||"http://localhost",ie={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:eo,hasStandardBrowserEnv:Bm,hasStandardBrowserWebWorkerEnv:Um,navigator:to,origin:Hm},Symbol.toStringTag,{value:"Module"})),...$m};function Vm(e,t){return $r(e,new ie.classes.URLSearchParams,{visitor:function(r,n,o,s){return ie.isNode&&S.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function Wm(e){return S.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function qm(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}function Es(e){function t(r,n,o,s){let i=r[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),c=s>=r.length;return i=!i&&S.isArray(o)?o.length:i,c?(S.hasOwnProp(o,i)?o[i]=[o[i],n]:o[i]=n,!l):((!o[i]||!S.isObject(o[i]))&&(o[i]=[]),t(r,n,o[i],s)&&S.isArray(o[i])&&(o[i]=qm(o[i])),!l)}if(S.isFormData(e)&&S.isFunction(e.entries)){const r={};return S.forEachEntry(e,(n,o)=>{t(Wm(n),o,r,0)}),r}return null}function Gm(e,t,r){if(S.isString(e))try{return(t||JSON.parse)(e),S.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const tr={transitional:Ns,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,s=S.isObject(t);if(s&&S.isHTMLForm(t)&&(t=new FormData(t)),S.isFormData(t))return o?JSON.stringify(Es(t)):t;if(S.isArrayBuffer(t)||S.isBuffer(t)||S.isStream(t)||S.isFile(t)||S.isBlob(t)||S.isReadableStream(t))return t;if(S.isArrayBufferView(t))return t.buffer;if(S.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Vm(t,this.formSerializer).toString();if((l=S.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $r(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||o?(r.setContentType("application/json",!1),Gm(t)):t}],transformResponse:[function(t){const r=this.transitional||tr.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(S.isResponse(t)||S.isReadableStream(t))return t;if(t&&S.isString(t)&&(n&&!this.responseType||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(i)throw l.name==="SyntaxError"?B.from(l,B.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ie.classes.FormData,Blob:ie.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};S.forEach(["delete","get","head","post","put","patch"],e=>{tr.headers[e]={}});const Km=S.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ym=e=>{const t={};let r,n,o;return e&&e.split(`
     214`).forEach(function(i){o=i.indexOf(":"),r=i.substring(0,o).trim().toLowerCase(),n=i.substring(o+1).trim(),!(!r||t[r]&&Km[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Ts=Symbol("internals");function rr(e){return e&&String(e).trim().toLowerCase()}function Br(e){return e===!1||e==null?e:S.isArray(e)?e.map(Br):String(e)}function Xm(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Jm=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ro(e,t,r,n,o){if(S.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!S.isString(t)){if(S.isString(n))return t.indexOf(n)!==-1;if(S.isRegExp(n))return n.test(t)}}function Zm(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Qm(e,t){const r=S.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,s,i){return this[n].call(this,t,o,s,i)},configurable:!0})})}let de=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function s(l,c,d){const u=rr(c);if(!u)throw new Error("header name must be a non-empty string");const p=S.findKey(o,u);(!p||o[p]===void 0||d===!0||d===void 0&&o[p]!==!1)&&(o[p||c]=Br(l))}const i=(l,c)=>S.forEach(l,(d,u)=>s(d,u,c));if(S.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(S.isString(t)&&(t=t.trim())&&!Jm(t))i(Ym(t),r);else if(S.isObject(t)&&S.isIterable(t)){let l={},c,d;for(const u of t){if(!S.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[d=u[0]]=(c=l[d])?S.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(l,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=rr(t),t){const n=S.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return Xm(o);if(S.isFunction(r))return r.call(this,o,n);if(S.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=rr(t),t){const n=S.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ro(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function s(i){if(i=rr(i),i){const l=S.findKey(n,i);l&&(!r||ro(n,n[l],l,r))&&(delete n[l],o=!0)}}return S.isArray(t)?t.forEach(s):s(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const s=r[n];(!t||ro(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const r=this,n={};return S.forEach(this,(o,s)=>{const i=S.findKey(n,s);if(i){r[i]=Br(o),delete r[s];return}const l=t?Zm(s):String(s).trim();l!==s&&delete r[s],r[l]=Br(o),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return S.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&S.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
     215`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Ts]=this[Ts]={accessors:{}}).accessors,o=this.prototype;function s(i){const l=rr(i);n[l]||(Qm(o,i),n[l]=!0)}return S.isArray(t)?t.forEach(s):s(t),this}};de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),S.reduceDescriptors(de.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),S.freezeMethods(de);function no(e,t){const r=this||tr,n=t||r,o=de.from(n.headers);let s=n.data;return S.forEach(e,function(l){s=l.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function As(e){return!!(e&&e.__CANCEL__)}function jt(e,t,r){B.call(this,e??"canceled",B.ERR_CANCELED,t,r),this.name="CanceledError"}S.inherits(jt,B,{__CANCEL__:!0});function Ps(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new B("Request failed with status code "+r.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ef(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function tf(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),u=n[s];i||(i=d),r[o]=c,n[o]=d;let p=s,m=0;for(;p!==o;)m+=r[p++],p=p%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),d-i<t)return;const h=u&&d-u;return h?Math.round(m*1e3/h):void 0}}function rf(e,t){let r=0,n=1e3/t,o,s;const i=(d,u=Date.now())=>{r=u,o=null,s&&(clearTimeout(s),s=null),e(...d)};return[(...d)=>{const u=Date.now(),p=u-r;p>=n?i(d,u):(o=d,s||(s=setTimeout(()=>{s=null,i(o)},n-p)))},()=>o&&i(o)]}const Ur=(e,t,r=3)=>{let n=0;const o=tf(50,250);return rf(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,c=i-n,d=o(c),u=i<=l;n=i;const p={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&u?(l-i)/d:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(p)},r)},Os=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Rs=e=>(...t)=>S.asap(()=>e(...t)),nf=ie.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ie.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ie.origin),ie.navigator&&/(msie|trident)/i.test(ie.navigator.userAgent)):()=>!0,of=ie.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];S.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),S.isString(n)&&l.push(`path=${n}`),S.isString(o)&&l.push(`domain=${o}`),s===!0&&l.push("secure"),S.isString(i)&&l.push(`SameSite=${i}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function af(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function sf(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ls(e,t,r){let n=!af(t);return e&&(n||r==!1)?sf(e,t):t}const Is=e=>e instanceof de?{...e}:e;function at(e,t){t=t||{};const r={};function n(d,u,p,m){return S.isPlainObject(d)&&S.isPlainObject(u)?S.merge.call({caseless:m},d,u):S.isPlainObject(u)?S.merge({},u):S.isArray(u)?u.slice():u}function o(d,u,p,m){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d,p,m)}else return n(d,u,p,m)}function s(d,u){if(!S.isUndefined(u))return n(void 0,u)}function i(d,u){if(S.isUndefined(u)){if(!S.isUndefined(d))return n(void 0,d)}else return n(void 0,u)}function l(d,u,p){if(p in t)return n(d,u);if(p in e)return n(void 0,d)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(d,u,p)=>o(Is(d),Is(u),p,!0)};return S.forEach(Object.keys({...e,...t}),function(u){const p=c[u]||o,m=p(e[u],t[u],u);S.isUndefined(m)&&p!==l||(r[u]=m)}),r}const zs=e=>{const t=at({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:l}=t;if(t.headers=i=de.from(i),t.url=Cs(Ls(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),S.isFormData(r)){if(ie.hasStandardBrowserEnv||ie.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(S.isFunction(r.getHeaders)){const c=r.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([u,p])=>{d.includes(u.toLowerCase())&&i.set(u,p)})}}if(ie.hasStandardBrowserEnv&&(n&&S.isFunction(n)&&(n=n(t)),n||n!==!1&&nf(t.url))){const c=o&&s&&of.read(s);c&&i.set(o,c)}return t},lf=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=zs(e);let s=o.data;const i=de.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=o,u,p,m,h,b;function f(){h&&h(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function _(){if(!x)return;const w=de.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:w,config:e,request:x};Ps(function(k){r(k),f()},function(k){n(k),f()},C),x=null}"onloadend"in x?x.onloadend=_:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(_)},x.onabort=function(){x&&(n(new B("Request aborted",B.ECONNABORTED,e,x)),x=null)},x.onerror=function(j){const C=j&&j.message?j.message:"Network Error",N=new B(C,B.ERR_NETWORK,e,x);N.event=j||null,n(N),x=null},x.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||Ns;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),n(new B(j,C.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,e,x)),x=null},s===void 0&&i.setContentType(null),"setRequestHeader"in x&&S.forEach(i.toJSON(),function(j,C){x.setRequestHeader(C,j)}),S.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),l&&l!=="json"&&(x.responseType=o.responseType),d&&([m,b]=Ur(d,!0),x.addEventListener("progress",m)),c&&x.upload&&([p,h]=Ur(c),x.upload.addEventListener("progress",p),x.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(u=w=>{x&&(n(!w||w.type?new jt(null,e,x):w),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=ef(o.url);if(v&&ie.protocols.indexOf(v)===-1){n(new B("Unsupported protocol "+v+":",B.ERR_BAD_REQUEST,e));return}x.send(s||null)})},cf=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const s=function(d){if(!o){o=!0,l();const u=d instanceof Error?d:this.reason;n.abort(u instanceof B?u:new jt(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new B(`timeout ${t} of ms exceeded`,B.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(s):d.removeEventListener("abort",s)}),e=null)};e.forEach(d=>d.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>S.asap(l),c}},df=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},uf=async function*(e,t){for await(const r of pf(e))yield*df(r,t)},pf=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Ms=(e,t,r,n)=>{const o=uf(e,t);let s=0,i,l=c=>{i||(i=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:d,value:u}=await o.next();if(d){l(),c.close();return}let p=u.byteLength;if(r){let m=s+=p;r(m)}c.enqueue(new Uint8Array(u))}catch(d){throw l(d),d}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Ds=64*1024,{isFunction:Hr}=S,mf=(({Request:e,Response:t})=>({Request:e,Response:t}))(S.global),{ReadableStream:Fs,TextEncoder:$s}=S.global,Bs=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ff=e=>{e=S.merge.call({skipUndefined:!0},mf,e);const{fetch:t,Request:r,Response:n}=e,o=t?Hr(t):typeof fetch=="function",s=Hr(r),i=Hr(n);if(!o)return!1;const l=o&&Hr(Fs),c=o&&(typeof $s=="function"?(b=>f=>b.encode(f))(new $s):async b=>new Uint8Array(await new r(b).arrayBuffer())),d=s&&l&&Bs(()=>{let b=!1;const f=new r(ie.origin,{body:new Fs,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!f}),u=i&&l&&Bs(()=>S.isReadableStream(new n("").body)),p={stream:u&&(b=>b.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!p[b]&&(p[b]=(f,x)=>{let _=f&&f[b];if(_)return _.call(f);throw new B(`Response type '${b}' is not supported`,B.ERR_NOT_SUPPORT,x)})});const m=async b=>{if(b==null)return 0;if(S.isBlob(b))return b.size;if(S.isSpecCompliantForm(b))return(await new r(ie.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(S.isArrayBufferView(b)||S.isArrayBuffer(b))return b.byteLength;if(S.isURLSearchParams(b)&&(b=b+""),S.isString(b))return(await c(b)).byteLength},h=async(b,f)=>{const x=S.toFiniteNumber(b.getContentLength());return x??m(f)};return async b=>{let{url:f,method:x,data:_,signal:v,cancelToken:w,timeout:j,onDownloadProgress:C,onUploadProgress:N,responseType:k,headers:E,withCredentials:T="same-origin",fetchOptions:O}=zs(b),L=t||fetch;k=k?(k+"").toLowerCase():"text";let A=cf([v,w&&w.toAbortSignal()],j),I=null;const z=A&&A.unsubscribe&&(()=>{A.unsubscribe()});let $;try{if(N&&d&&x!=="get"&&x!=="head"&&($=await h(E,_))!==0){let Z=new r(f,{method:"POST",body:_,duplex:"half"}),pe;if(S.isFormData(_)&&(pe=Z.headers.get("content-type"))&&E.setContentType(pe),Z.body){const[Fe,ge]=Os($,Ur(Rs(N)));_=Ms(Z.body,Ds,Fe,ge)}}S.isString(T)||(T=T?"include":"omit");const R=s&&"credentials"in r.prototype,U={...O,signal:A,method:x.toUpperCase(),headers:E.normalize().toJSON(),body:_,duplex:"half",credentials:R?T:void 0};I=s&&new r(f,U);let P=await(s?L(I,O):L(f,U));const q=u&&(k==="stream"||k==="response");if(u&&(C||q&&z)){const Z={};["status","statusText","headers"].forEach($e=>{Z[$e]=P[$e]});const pe=S.toFiniteNumber(P.headers.get("content-length")),[Fe,ge]=C&&Os(pe,Ur(Rs(C),!0))||[];P=new n(Ms(P.body,Ds,Fe,()=>{ge&&ge(),z&&z()}),Z)}k=k||"text";let X=await p[S.findKey(p,k)||"text"](P,b);return!q&&z&&z(),await new Promise((Z,pe)=>{Ps(Z,pe,{data:X,headers:de.from(P.headers),status:P.status,statusText:P.statusText,config:b,request:I})})}catch(R){throw z&&z(),R&&R.name==="TypeError"&&/Load failed|fetch/i.test(R.message)?Object.assign(new B("Network Error",B.ERR_NETWORK,b,I),{cause:R.cause||R}):B.from(R,R&&R.code,b,I)}}},hf=new Map,Us=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i=s.length,l=i,c,d,u=hf;for(;l--;)c=s[l],d=u.get(c),d===void 0&&u.set(c,d=l?new Map:ff(t)),u=d;return d};Us();const oo={http:zm,xhr:lf,fetch:{get:Us}};S.forEach(oo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Hs=e=>`- ${e}`,gf=e=>S.isFunction(e)||e===null||e===!1;function xf(e,t){e=S.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i<r;i++){n=e[i];let l;if(o=n,!gf(n)&&(o=oo[(l=String(n)).toLowerCase()],o===void 0))throw new B(`Unknown adapter '${l}'`);if(o&&(S.isFunction(o)||(o=o.get(t))))break;s[l||"#"+i]=o}if(!o){const i=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=r?i.length>1?`since :
     216`+i.map(Hs).join(`
     217`):" "+Hs(i[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o}const Vs={getAdapter:xf,adapters:oo};function ao(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jt(null,e)}function Ws(e){return ao(e),e.headers=de.from(e.headers),e.data=no.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Vs.getAdapter(e.adapter||tr.adapter,e)(e).then(function(n){return ao(e),n.data=no.call(e,e.transformResponse,n),n.headers=de.from(n.headers),n},function(n){return As(n)||(ao(e),n&&n.response&&(n.response.data=no.call(e,e.transformResponse,n.response),n.response.headers=de.from(n.response.headers))),Promise.reject(n)})}const qs="1.13.1",Vr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Gs={};Vr.transitional=function(t,r,n){function o(s,i){return"[Axios v"+qs+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,l)=>{if(t===!1)throw new B(o(i," has been removed"+(r?" in "+r:"")),B.ERR_DEPRECATED);return r&&!Gs[i]&&(Gs[i]=!0,console.warn(o(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,i,l):!0}},Vr.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function bf(e,t,r){if(typeof e!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const l=e[s],c=l===void 0||i(l,s,e);if(c!==!0)throw new B("option "+s+" must be "+c,B.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new B("Unknown option "+s,B.ERR_BAD_OPTION)}}const Wr={assertOptions:bf,validators:Vr},ke=Wr.validators;let st=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ks,response:new ks}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
     218`+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=at(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:s}=r;n!==void 0&&Wr.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),o!=null&&(S.isFunction(o)?r.paramsSerializer={serialize:o}:Wr.assertOptions(o,{encode:ke.function,serialize:ke.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Wr.assertOptions(r,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=s&&S.merge(s.common,s[r.method]);s&&S.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),r.headers=de.concat(i,s);const l=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(r)===!1||(c=c&&f.synchronous,l.unshift(f.fulfilled,f.rejected))});const d=[];this.interceptors.response.forEach(function(f){d.push(f.fulfilled,f.rejected)});let u,p=0,m;if(!c){const b=[Ws.bind(this),void 0];for(b.unshift(...l),b.push(...d),m=b.length,u=Promise.resolve(r);p<m;)u=u.then(b[p++],b[p++]);return u}m=l.length;let h=r;for(;p<m;){const b=l[p++],f=l[p++];try{h=b(h)}catch(x){f.call(this,x);break}}try{u=Ws.call(this,h)}catch(b){return Promise.reject(b)}for(p=0,m=d.length;p<m;)u=u.then(d[p++],d[p++]);return u}getUri(t){t=at(this.defaults,t);const r=Ls(t.baseURL,t.url,t.allowAbsoluteUrls);return Cs(r,t.params,t.paramsSerializer)}};S.forEach(["delete","get","head","options"],function(t){st.prototype[t]=function(r,n){return this.request(at(n||{},{method:t,url:r,data:(n||{}).data}))}}),S.forEach(["post","put","patch"],function(t){function r(n){return function(s,i,l){return this.request(at(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}st.prototype[t]=r(),st.prototype[t+"Form"]=r(!0)});let vf=class wd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(o=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](o);n._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{n.subscribe(l),s=l}).then(o);return i.cancel=function(){n.unsubscribe(s)},i},t(function(s,i,l){n.reason||(n.reason=new jt(s,i,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new wd(function(o){t=o}),cancel:t}}};function _f(e){return function(r){return e.apply(null,r)}}function yf(e){return S.isObject(e)&&e.isAxiosError===!0}const so={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(so).forEach(([e,t])=>{so[t]=e});function Ks(e){const t=new st(e),r=ds(st.prototype.request,t);return S.extend(r,st.prototype,t,{allOwnKeys:!0}),S.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return Ks(at(e,o))},r}const ee=Ks(tr);ee.Axios=st,ee.CanceledError=jt,ee.CancelToken=vf,ee.isCancel=As,ee.VERSION=qs,ee.toFormData=$r,ee.AxiosError=B,ee.Cancel=ee.CanceledError,ee.all=function(t){return Promise.all(t)},ee.spread=_f,ee.isAxiosError=yf,ee.mergeConfig=at,ee.AxiosHeaders=de,ee.formToJSON=e=>Es(S.isHTMLForm(e)?new FormData(e):e),ee.getAdapter=Vs.getAdapter,ee.HttpStatusCode=so,ee.default=ee;const{Axios:x_,AxiosError:b_,CanceledError:v_,isCancel:__,CancelToken:y_,VERSION:w_,all:j_,Cancel:S_,isAxiosError:C_,spread:k_,toFormData:N_,AxiosHeaders:E_,HttpStatusCode:T_,formToJSON:A_,getAdapter:P_,mergeConfig:O_}=ee,Ys=ecommreelsInfo,ue=ee.create({baseURL:`${Ys.apiBase}`,headers:{"X-WP-Nonce":Ys.nonce,"Content-Type":"application/json"}}),wf=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState(!1),o=y.useCallback(async i=>{try{t(!0);const l={styles:et,story_ids:i},c=await ue.post("stories/manage-group-stories",l);return G.success("Group created successfully!"),c.data.group_id}catch(l){return l instanceof Error?G.error(l.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]),s=y.useCallback(async(i,l)=>{try{n(!0),await ue.delete(`story/${i}`),l(c=>c.filter(d=>d.id!==i)),G.success("Reel deleted successfully!")}catch(c){c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!")}finally{n(!1)}},[]);return{styles:et,isCreating:e,isDeleting:r,createGroup:o,deleteReel:s}};function io(e,t){const[r,n]=y.useState(e);return y.useEffect(()=>{const o=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(o)}},[e,t]),r}const Xs=e=>{const[t,r]=y.useState([]),[n,o]=y.useState(1),[s,i]=y.useState(!0),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(""),h=io(p,500),b=y.useRef(!0),f=y.useCallback(async v=>{v===1&&b.current?u(!0):c(!0);try{const w={page:v,per_page:20};e&&(w.group_id=e),h&&(w.search=h);const j=await ue.get("stories",{params:w}),C=j.data,N=parseInt(j.headers["x-wp-totalpages"]);r(k=>v===1?C:[...k,...C]),o(v+1),i(v<N)}catch(w){w instanceof Error?G.error(w.message):G.error("Something went wrong. Try again later!")}finally{b.current&&(b.current=!1),c(!1),u(!1)}},[e,h]);y.useEffect(()=>{o(1),r([]),f(1)},[h,f]);const x=y.useRef(null),_=y.useCallback(v=>{l||(x.current&&x.current.disconnect(),x.current=new IntersectionObserver(w=>{w[0].isIntersecting&&s&&f(n)}),v&&x.current.observe(v))},[l,s,n,f]);return y.useEffect(()=>()=>{x.current&&x.current.disconnect()},[]),{allReels:t,setAllReels:r,searchTerm:p,setSearchTerm:m,isSearching:l,isLoading:d,lastStoryElementRef:_}};function jf(){const e=Se(),{allReels:t,setAllReels:r,isSearching:n,lastStoryElementRef:o,searchTerm:s,setSearchTerm:i,isLoading:l}=Xs(null),{styles:c,isCreating:d,isDeleting:u,createGroup:p,deleteReel:m}=wf(),[h,b]=y.useState(null),[f,x]=y.useState(null),[_,v]=y.useState([]),w=async()=>{const k=await p(_);k&&e(`?view=${K.mg}&gid=${k}`)},j=()=>{v(t.map(k=>k.id))},C=k=>{v(E=>E.includes(k)?E.filter(T=>T!==k):[...E,k])},N=y.useCallback(async()=>{h&&(await m(h,r),b(null))},[m,h,r]);return l&&!t.length?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[h&&a.jsx(Or,{onReject:()=>b(null),onAccept:N,isLoading:u,message:"Are you sure, You want to remove this reel?"}),a.jsx(vt,{left:[a.jsx(_t,{name:"All Reels",Icon:ep},"page"),a.jsx(Xt,{cb:()=>e(`?view=${K.ag}`)},"back")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}&from=${K.ar}`,text:"Add Reel",Icon:gt},"add-reel-all-reel")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"All Reels"}]}),a.jsxs("div",{className:"ecr-admin-panel ecr-admin-panel--reels",children:[a.jsx(hp,{selectedReelIds:_,handleSelectAll:j,clearSelection:()=>v([]),searchTerm:s,setSearchTerm:i,isCreating:d,handleCreateGroup:w}),t.length?a.jsx(Yp,{reels:t,styles:c,selectedReelIds:_,onSelectReel:C,onDeleteReel:b,onPreviewReel:x,lastStoryElementRef:o}):!n&&!l?a.jsx(bp,{}):null,n&&a.jsx(vp,{isFullScreen:!t.length})]}),!!f&&a.jsx(Rp,{previewReel:f,setPreviewReel:x})]})}const Sf=()=>{const[e,t]=y.useState(!1),r=y.useCallback(async({storyId:n,storyTitle:o,uploadedFiles:s,links:i,thumbnail:l})=>{try{t(!0);const c={story_title:o,files:s,links:i};typeof l=="string"&&l.trim().length>0&&(c.thumbnail=l),n&&(c.story_id=n);const d=await ue.post("files",c);return G.success(`Story ${n?"updated":"created"} successfully!`),d.data.story_id}catch(c){return c instanceof Error?G.error(c.message):G.error("Something went wrong. Try again later!"),null}finally{t(!1)}},[]);return{isSaving:e,saveStory:r}},lo=({isSaving:e,onSave:t,text:r="Save",className:n,...o})=>a.jsxs(re,{onClick:t,className:D("ecr-admin-save-button",n),...o,children:[e?a.jsx(tt,{className:"ecr-admin-save-button__icon ecr-admin-save-button__icon--spin"}):a.jsx(np,{className:"ecr-admin-save-button__icon"})," ",r]}),Js=({setIsEdited:e,title:t,setTitle:r,placeholder:n,style:o})=>a.jsx("div",{children:a.jsx("input",{style:o,className:"ecr-admin-title-input",type:"text",value:t,placeholder:n,onChange:s=>{e&&e(!0),r(s.target.value)}})}),Cf=({uploadedFiles:e,links:t,storyTitle:r,setStoryTitle:n,thumbnail:o})=>{const s=Se(),[i]=Vt(),l=i.get("sid"),c=i.get("from")||K.ag,d=i.get("gid"),{isSaving:u,saveStory:p}=Sf(),m=async()=>{if(u)return;const h=await p({storyId:l,storyTitle:r,uploadedFiles:e,links:t,thumbnail:o});h&&s(`?view=${c}${d?`&gid=${d}`:""}`,{replace:!0,...l?{}:{state:{storyId:h}}})};return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:l?"Update Reel":"Add Reel",Icon:gt},"page"),a.jsx(Xt,{},"back")],center:[a.jsx(Js,{placeholder:"Enter reel title",title:r,setTitle:n},"title")],right:[a.jsx(lo,{onSave:m,isSaving:u,disabled:!e.length},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:"?view=my-reels"},{label:l?"Update Reel":"Add Reel"}]})]})},ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function kf(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}let co;const Nf=new Uint8Array(16);function Ef(){if(!co){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");co=crypto.getRandomValues.bind(crypto)}return co(Nf)}const Zs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Tf(e,t,r){e=e||{};const n=e.random??e.rng?.()??Ef();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,kf(n)}function uo(e,t,r){return Zs.randomUUID&&!e?Zs.randomUUID():Tf(e)}const Qs="data:image/svg+xml,%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Transformed%20by:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23919191'%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20stroke='%23919191'%3e%3cg%20id='SVGRepo_bgCarrier'%20stroke-width='0'/%3e%3cg%20id='SVGRepo_tracerCarrier'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cg%20id='SVGRepo_iconCarrier'%3e%3cg%20data-name='Layer%202'%3e%3cg%20data-name='file-add'%3e%3crect%20width='24'%20height='24'%20opacity='0'/%3e%3cpath%20d='M19.74%207.33l-4.44-5a1%201%200%200%200-.74-.33h-8A2.53%202.53%200%200%200%204%204.5v15A2.53%202.53%200%200%200%206.56%2022h10.88A2.53%202.53%200%200%200%2020%2019.5V8a1%201%200%200%200-.26-.67zM14%2015h-1v1a1%201%200%200%201-2%200v-1h-1a1%201%200%200%201%200-2h1v-1a1%201%200%200%201%202%200v1h1a1%201%200%200%201%200%202zm.71-7a.79.79%200%200%201-.71-.85V4l3.74%204z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ei=({setUploadedFiles:e,setThumbnail:t,usedFor:r="video",mode:n="files",multiple:o=!1,className:s})=>{const[i,l]=y.useState(!1),c=()=>{const d=window.wp.media({title:"Select image or video files",button:{text:"Use this file"},multiple:o,library:{type:[r]}});d.on("select",()=>{const u=d.state().get("selection").toJSON();if(n==="thumbnail"){const m=u[0];m&&t&&t(m.url);return}if(!e)return;const p=u.map(m=>({url:m.url,mime_type:m.mime,file_uuid:uo()}));e(m=>[...m,...p])}),d.open()};return a.jsx("div",{className:D("ecr-admin-upload",i?"ecr-admin-upload--active":"ecr-admin-upload--idle",s),onDragOver:d=>{d.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:d=>{d.preventDefault(),l(!1),c()},children:a.jsxs("label",{className:"ecr-admin-upload__label",htmlFor:"file",onClick:c,children:[a.jsx("img",{className:"ecr-admin-upload__icon",src:Qs,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-upload__text",children:i?a.jsx("span",{className:"ecr-admin-upload__text-strong",children:"Drop files here..."}):a.jsxs("span",{className:"ecr-admin-upload__text-stack",children:[a.jsxs("span",{className:"ecr-admin-upload__text-item",children:["Upload ",r]}),n==="files"?a.jsx("span",{className:"ecr-admin-upload__text-item",children:"Click or Drag and drop files here"}):null]})})]})})};/**
     219 * @license lucide-react v0.552.0 - ISC
     220 *
     221 * This source code is licensed under the ISC license.
     222 * See the LICENSE file in the root directory of this source tree.
     223 */const Af=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),ti=e=>{const t=Pf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ri=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Of=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
     224 * @license lucide-react v0.552.0 - ISC
     225 *
     226 * This source code is licensed under the ISC license.
     227 * See the LICENSE file in the root directory of this source tree.
     228 */var Rf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
     229 * @license lucide-react v0.552.0 - ISC
     230 *
     231 * This source code is licensed under the ISC license.
     232 * See the LICENSE file in the root directory of this source tree.
     233 */const Lf=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...l},c)=>y.createElement("svg",{ref:c,...Rf,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ri("lucide",o),...!s&&!Of(l)&&{"aria-hidden":"true"},...l},[...i.map(([d,u])=>y.createElement(d,u)),...Array.isArray(s)?s:[s]]));/**
     234 * @license lucide-react v0.552.0 - ISC
     235 *
     236 * This source code is licensed under the ISC license.
     237 * See the LICENSE file in the root directory of this source tree.
     238 */const me=(e,t)=>{const r=y.forwardRef(({className:n,...o},s)=>y.createElement(Lf,{ref:s,iconNode:t,className:ri(`lucide-${Af(ti(e))}`,`lucide-${e}`,n),...o}));return r.displayName=ti(e),r};/**
     239 * @license lucide-react v0.552.0 - ISC
     240 *
     241 * This source code is licensed under the ISC license.
     242 * See the LICENSE file in the root directory of this source tree.
     243 */const If=me("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
     244 * @license lucide-react v0.552.0 - ISC
     245 *
     246 * This source code is licensed under the ISC license.
     247 * See the LICENSE file in the root directory of this source tree.
     248 */const po=me("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
     249 * @license lucide-react v0.552.0 - ISC
     250 *
     251 * This source code is licensed under the ISC license.
     252 * See the LICENSE file in the root directory of this source tree.
     253 */const zf=me("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
     254 * @license lucide-react v0.552.0 - ISC
     255 *
     256 * This source code is licensed under the ISC license.
     257 * See the LICENSE file in the root directory of this source tree.
     258 */const Mf=me("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
     259 * @license lucide-react v0.552.0 - ISC
     260 *
     261 * This source code is licensed under the ISC license.
     262 * See the LICENSE file in the root directory of this source tree.
     263 */const Df=me("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
     264 * @license lucide-react v0.552.0 - ISC
     265 *
     266 * This source code is licensed under the ISC license.
     267 * See the LICENSE file in the root directory of this source tree.
     268 */const Ff=me("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
     269 * @license lucide-react v0.552.0 - ISC
     270 *
     271 * This source code is licensed under the ISC license.
     272 * See the LICENSE file in the root directory of this source tree.
     273 */const $f=me("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
     274 * @license lucide-react v0.552.0 - ISC
     275 *
     276 * This source code is licensed under the ISC license.
     277 * See the LICENSE file in the root directory of this source tree.
     278 */const Bf=me("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);/**
     279 * @license lucide-react v0.552.0 - ISC
     280 *
     281 * This source code is licensed under the ISC license.
     282 * See the LICENSE file in the root directory of this source tree.
     283 */const Uf=me("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
     284 * @license lucide-react v0.552.0 - ISC
     285 *
     286 * This source code is licensed under the ISC license.
     287 * See the LICENSE file in the root directory of this source tree.
     288 */const Hf=me("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
     289 * @license lucide-react v0.552.0 - ISC
     290 *
     291 * This source code is licensed under the ISC license.
     292 * See the LICENSE file in the root directory of this source tree.
     293 */const Vf=me("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
     294 * @license lucide-react v0.552.0 - ISC
     295 *
     296 * This source code is licensed under the ISC license.
     297 * See the LICENSE file in the root directory of this source tree.
     298 */const Wf=me("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
     299 * @license lucide-react v0.552.0 - ISC
     300 *
     301 * This source code is licensed under the ISC license.
     302 * See the LICENSE file in the root directory of this source tree.
     303 */const qf=me("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function Gf(e,t){const r=g.createContext(t),n=s=>{const{children:i,...l}=s,c=g.useMemo(()=>l,Object.values(l));return a.jsx(r.Provider,{value:c,children:i})};n.displayName=e+"Provider";function o(s){const i=g.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,o]}function He(e,t=[]){let r=[];function n(s,i){const l=g.createContext(i),c=r.length;r=[...r,i];const d=p=>{const{scope:m,children:h,...b}=p,f=m?.[e]?.[c]||l,x=g.useMemo(()=>b,Object.values(b));return a.jsx(f.Provider,{value:x,children:h})};d.displayName=s+"Provider";function u(p,m){const h=m?.[e]?.[c]||l,b=g.useContext(h);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,u]}const o=()=>{const s=r.map(i=>g.createContext(i));return function(l){const c=l?.[e]||s;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,Kf(o,...t)]}function Kf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=n.reduce((l,{useScope:c,scopeName:d})=>{const p=c(s)[`__scope${d}`];return{...l,...p}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Yf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],W=Yf.reduce((e,t)=>{const r=rt(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...l}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Xf(e,t){e&&vr.flushSync(()=>e.dispatchEvent(t))}function Ve(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>t.current?.(...r),[])}function Jf(e,t=globalThis?.document){const r=Ve(e);g.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Zf="DismissableLayer",mo="dismissableLayer.update",Qf="dismissableLayer.pointerDownOutside",eh="dismissableLayer.focusOutside",ni,oi=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qr=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...c}=e,d=g.useContext(oi),[u,p]=g.useState(null),m=u?.ownerDocument??globalThis?.document,[,h]=g.useState({}),b=Y(t,k=>p(k)),f=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=f.indexOf(x),v=u?f.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,j=v>=_,C=nh(k=>{const E=k.target,T=[...d.branches].some(O=>O.contains(E));!j||T||(o?.(k),i?.(k),k.defaultPrevented||l?.())},m),N=oh(k=>{const E=k.target;[...d.branches].some(O=>O.contains(E))||(s?.(k),i?.(k),k.defaultPrevented||l?.())},m);return Jf(k=>{v===d.layers.size-1&&(n?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},m),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ni=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ai(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ni)}},[u,m,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ai())},[u,d]),g.useEffect(()=>{const k=()=>h({});return document.addEventListener(mo,k),()=>document.removeEventListener(mo,k)},[]),a.jsx(W.div,{...c,ref:b,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:V(e.onFocusCapture,N.onFocusCapture),onBlurCapture:V(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:V(e.onPointerDownCapture,C.onPointerDownCapture)})});qr.displayName=Zf;var th="DismissableLayerBranch",rh=g.forwardRef((e,t)=>{const r=g.useContext(oi),n=g.useRef(null),o=Y(t,n);return g.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(W.div,{...e,ref:o})});rh.displayName=th;function nh(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let c=function(){si(Qf,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function oh(e,t=globalThis?.document){const r=Ve(e),n=g.useRef(!1);return g.useEffect(()=>{const o=s=>{s.target&&!n.current&&si(eh,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ai(){const e=new CustomEvent(mo);document.dispatchEvent(e)}function si(e,t,r,{discrete:n}){const o=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Xf(o,s):o.dispatchEvent(s)}var fo=0;function ho(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ii()),document.body.insertAdjacentElement("beforeend",e[1]??ii()),fo++,()=>{fo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fo--}},[])}function ii(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var go="focusScope.autoFocusOnMount",xo="focusScope.autoFocusOnUnmount",li={bubbles:!1,cancelable:!0},ah="FocusScope",Gr=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,c]=g.useState(null),d=Ve(o),u=Ve(s),p=g.useRef(null),m=Y(t,f=>c(f)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let f=function(w){if(h.paused||!l)return;const j=w.target;l.contains(j)?p.current=j:We(p.current,{select:!0})},x=function(w){if(h.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||We(p.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&We(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",x);const v=new MutationObserver(_);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",x),v.disconnect()}}},[n,l,h.paused]),g.useEffect(()=>{if(l){ui.add(h);const f=document.activeElement;if(!l.contains(f)){const _=new CustomEvent(go,li);l.addEventListener(go,d),l.dispatchEvent(_),_.defaultPrevented||(sh(uh(ci(l)),{select:!0}),document.activeElement===f&&We(l))}return()=>{l.removeEventListener(go,d),setTimeout(()=>{const _=new CustomEvent(xo,li);l.addEventListener(xo,u),l.dispatchEvent(_),_.defaultPrevented||We(f??document.body,{select:!0}),l.removeEventListener(xo,u),ui.remove(h)},0)}}},[l,d,u,h]);const b=g.useCallback(f=>{if(!r&&!n||h.paused)return;const x=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,_=document.activeElement;if(x&&_){const v=f.currentTarget,[w,j]=ih(v);w&&j?!f.shiftKey&&_===j?(f.preventDefault(),r&&We(w,{select:!0})):f.shiftKey&&_===w&&(f.preventDefault(),r&&We(j,{select:!0})):_===v&&f.preventDefault()}},[r,n,h.paused]);return a.jsx(W.div,{tabIndex:-1,...i,ref:m,onKeyDown:b})});Gr.displayName=ah;function sh(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(We(n,{select:t}),document.activeElement!==r)return}function ih(e){const t=ci(e),r=di(t,e),n=di(t.reverse(),e);return[r,n]}function ci(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function di(e,t){for(const r of e)if(!lh(r,{upTo:t}))return r}function lh(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ch(e){return e instanceof HTMLInputElement&&"select"in e}function We(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&ch(e)&&t&&e.select()}}var ui=dh();function dh(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=pi(e,t),e.unshift(t)},remove(t){e=pi(e,t),e[0]?.resume()}}}function pi(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function uh(e){return e.filter(t=>t.tagName!=="A")}var se=globalThis?.document?g.useLayoutEffect:()=>{},ph=g[" useId ".trim().toString()]||(()=>{}),mh=0;function Ne(e){const[t,r]=g.useState(ph());return se(()=>{r(n=>n??String(mh++))},[e]),e||(t?`radix-${t}`:"")}const fh=["top","right","bottom","left"],qe=Math.min,fe=Math.max,Kr=Math.round,Yr=Math.floor,Ee=e=>({x:e,y:e}),hh={left:"right",right:"left",bottom:"top",top:"bottom"},gh={start:"end",end:"start"};function bo(e,t,r){return fe(e,qe(t,r))}function ze(e,t){return typeof e=="function"?e(t):e}function Me(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function vo(e){return e==="x"?"y":"x"}function _o(e){return e==="y"?"height":"width"}const xh=new Set(["top","bottom"]);function Te(e){return xh.has(Me(e))?"y":"x"}function yo(e){return vo(Te(e))}function bh(e,t,r){r===void 0&&(r=!1);const n=St(e),o=yo(e),s=_o(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xr(i)),[i,Xr(i)]}function vh(e){const t=Xr(e);return[wo(e),t,wo(t)]}function wo(e){return e.replace(/start|end/g,t=>gh[t])}const mi=["left","right"],fi=["right","left"],_h=["top","bottom"],yh=["bottom","top"];function wh(e,t,r){switch(e){case"top":case"bottom":return r?t?fi:mi:t?mi:fi;case"left":case"right":return t?_h:yh;default:return[]}}function jh(e,t,r,n){const o=St(e);let s=wh(Me(e),r==="start",n);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(wo)))),s}function Xr(e){return e.replace(/left|right|bottom|top/g,t=>hh[t])}function Sh(e){return{top:0,right:0,bottom:0,left:0,...e}}function hi(e){return typeof e!="number"?Sh(e):{top:e,right:e,bottom:e,left:e}}function Jr(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function gi(e,t,r){let{reference:n,floating:o}=e;const s=Te(t),i=yo(t),l=_o(i),c=Me(t),d=s==="y",u=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,m=n[l]/2-o[l]/2;let h;switch(c){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:p};break;case"left":h={x:n.x-o.width,y:p};break;default:h={x:n.x,y:n.y}}switch(St(t)){case"start":h[i]-=m*(r&&d?-1:1);break;case"end":h[i]+=m*(r&&d?-1:1);break}return h}const Ch=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:i}=r,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:p}=gi(d,n,c),m=n,h={},b=0;for(let f=0;f<l.length;f++){const{name:x,fn:_}=l[f],{x:v,y:w,data:j,reset:C}=await _({x:u,y:p,initialPlacement:n,placement:m,strategy:o,middlewareData:h,rects:d,platform:i,elements:{reference:e,floating:t}});u=v??u,p=w??p,h={...h,[x]:{...h[x],...j}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(d=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:p}=gi(d,m,c)),f=-1)}return{x:u,y:p,placement:m,strategy:o,middlewareData:h}};async function nr(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:h=0}=ze(t,e),b=hi(h),x=l[m?p==="floating"?"reference":"floating":p],_=Jr(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(x)))==null||r?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=p==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(_.top-C.top+b.top)/j.y,bottom:(C.bottom-_.bottom+b.bottom)/j.y,left:(_.left-C.left+b.left)/j.x,right:(C.right-_.right+b.right)/j.x}}const kh=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=ze(e,t)||{};if(d==null)return{};const p=hi(u),m={x:r,y:n},h=yo(o),b=_o(h),f=await i.getDimensions(d),x=h==="y",_=x?"top":"left",v=x?"bottom":"right",w=x?"clientHeight":"clientWidth",j=s.reference[b]+s.reference[h]-m[h]-s.floating[b],C=m[h]-s.reference[h],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let k=N?N[w]:0;(!k||!await(i.isElement==null?void 0:i.isElement(N)))&&(k=l.floating[w]||s.floating[b]);const E=j/2-C/2,T=k/2-f[b]/2-1,O=qe(p[_],T),L=qe(p[v],T),A=O,I=k-f[b]-L,z=k/2-f[b]/2+E,$=bo(A,z,I),R=!c.arrow&&St(o)!=null&&z!==$&&s.reference[b]/2-(z<A?O:L)-f[b]/2<0,U=R?z<A?z-A:z-I:0;return{[h]:m[h]+U,data:{[h]:$,centerOffset:z-$-U,...R&&{alignmentOffset:U}},reset:R}}}),Nh=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:f=!0,...x}=ze(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const _=Me(o),v=Te(l),w=Me(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(d.floating)),C=m||(w||!f?[Xr(l)]:vh(l)),N=b!=="none";!m&&N&&C.push(...jh(l,f,b,j));const k=[l,...C],E=await nr(t,x),T=[];let O=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&T.push(E[_]),p){const z=bh(o,i,j);T.push(E[z[0]],E[z[1]])}if(O=[...O,{placement:o,overflows:T}],!T.every(z=>z<=0)){var L,A;const z=(((L=s.flip)==null?void 0:L.index)||0)+1,$=k[z];if($&&(!(p==="alignment"?v!==Te($):!1)||O.every(P=>Te(P.placement)===v?P.overflows[0]>0:!0)))return{data:{index:z,overflows:O},reset:{placement:$}};let R=(A=O.filter(U=>U.overflows[0]<=0).sort((U,P)=>U.overflows[1]-P.overflows[1])[0])==null?void 0:A.placement;if(!R)switch(h){case"bestFit":{var I;const U=(I=O.filter(P=>{if(N){const q=Te(P.placement);return q===v||q==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((P,q)=>P[1]-q[1])[0])==null?void 0:I[0];U&&(R=U);break}case"initialPlacement":R=l;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function xi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bi(e){return fh.some(t=>e[t]>=0)}const Eh=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=ze(e,t);switch(n){case"referenceHidden":{const s=await nr(t,{...o,elementContext:"reference"}),i=xi(s,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:bi(i)}}}case"escaped":{const s=await nr(t,{...o,altBoundary:!0}),i=xi(s,r.floating);return{data:{escapedOffsets:i,escaped:bi(i)}}}default:return{}}}}},vi=new Set(["left","top"]);async function Th(e,t){const{placement:r,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Me(r),l=St(r),c=Te(r)==="y",d=vi.has(i)?-1:1,u=s&&c?-1:1,p=ze(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof b=="number"&&(h=l==="end"?b*-1:b),c?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Ah=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:s,placement:i,middlewareData:l}=t,c=await Th(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},Ph=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:x=>{let{x:_,y:v}=x;return{x:_,y:v}}},...c}=ze(e,t),d={x:r,y:n},u=await nr(t,c),p=Te(Me(o)),m=vo(p);let h=d[m],b=d[p];if(s){const x=m==="y"?"top":"left",_=m==="y"?"bottom":"right",v=h+u[x],w=h-u[_];h=bo(v,h,w)}if(i){const x=p==="y"?"top":"left",_=p==="y"?"bottom":"right",v=b+u[x],w=b-u[_];b=bo(v,b,w)}const f=l.fn({...t,[m]:h,[p]:b});return{...f,data:{x:f.x-r,y:f.y-n,enabled:{[m]:s,[p]:i}}}}}},Oh=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=ze(e,t),u={x:r,y:n},p=Te(o),m=vo(p);let h=u[m],b=u[p];const f=ze(l,t),x=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const w=m==="y"?"height":"width",j=s.reference[m]-s.floating[w]+x.mainAxis,C=s.reference[m]+s.reference[w]-x.mainAxis;h<j?h=j:h>C&&(h=C)}if(d){var _,v;const w=m==="y"?"width":"height",j=vi.has(Me(o)),C=s.reference[p]-s.floating[w]+(j&&((_=i.offset)==null?void 0:_[p])||0)+(j?0:x.crossAxis),N=s.reference[p]+s.reference[w]+(j?0:((v=i.offset)==null?void 0:v[p])||0)-(j?x.crossAxis:0);b<C?b=C:b>N&&(b=N)}return{[m]:h,[p]:b}}}},Rh=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=ze(e,t),u=await nr(t,d),p=Me(o),m=St(o),h=Te(o)==="y",{width:b,height:f}=s.floating;let x,_;p==="top"||p==="bottom"?(x=p,_=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,x=m==="end"?"top":"bottom");const v=f-u.top-u.bottom,w=b-u.left-u.right,j=qe(f-u[x],v),C=qe(b-u[_],w),N=!t.middlewareData.shift;let k=j,E=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(E=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(k=v),N&&!m){const O=fe(u.left,0),L=fe(u.right,0),A=fe(u.top,0),I=fe(u.bottom,0);h?E=b-2*(O!==0||L!==0?O+L:fe(u.left,u.right)):k=f-2*(A!==0||I!==0?A+I:fe(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const T=await i.getDimensions(l.floating);return b!==T.width||f!==T.height?{reset:{rects:!0}}:{}}}};function Zr(){return typeof window<"u"}function Ct(e){return _i(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(_i(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function _i(e){return Zr()?e instanceof Node||e instanceof he(e).Node:!1}function _e(e){return Zr()?e instanceof Element||e instanceof he(e).Element:!1}function Pe(e){return Zr()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function yi(e){return!Zr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}const Lh=new Set(["inline","contents"]);function or(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Lh.has(o)}const Ih=new Set(["table","td","th"]);function zh(e){return Ih.has(Ct(e))}const Mh=[":popover-open",":modal"];function Qr(e){return Mh.some(t=>{try{return e.matches(t)}catch{return!1}})}const Dh=["transform","translate","scale","rotate","perspective"],Fh=["transform","translate","scale","rotate","perspective","filter"],$h=["paint","layout","strict","content"];function jo(e){const t=So(),r=_e(e)?ye(e):e;return Dh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Fh.some(n=>(r.willChange||"").includes(n))||$h.some(n=>(r.contain||"").includes(n))}function Bh(e){let t=Ge(e);for(;Pe(t)&&!kt(t);){if(jo(t))return t;if(Qr(t))return null;t=Ge(t)}return null}function So(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Uh=new Set(["html","body","#document"]);function kt(e){return Uh.has(Ct(e))}function ye(e){return he(e).getComputedStyle(e)}function en(e){return _e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yi(e)&&e.host||Ae(e);return yi(t)?t.host:t}function wi(e){const t=Ge(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&or(t)?t:wi(t)}function ar(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=wi(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),i=he(o);if(s){const l=Co(i);return t.concat(i,i.visualViewport||[],or(o)?o:[],l&&r?ar(l):[])}return t.concat(o,ar(o,[],r))}function Co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ji(e){const t=ye(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Pe(e),s=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=Kr(r)!==s||Kr(n)!==i;return l&&(r=s,n=i),{width:r,height:n,$:l}}function ko(e){return _e(e)?e:e.contextElement}function Nt(e){const t=ko(e);if(!Pe(t))return Ee(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:s}=ji(t);let i=(s?Kr(r.width):r.width)/n,l=(s?Kr(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Hh=Ee(0);function Si(e){const t=he(e);return!So()||!t.visualViewport?Hh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==he(e)?!1:t}function it(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),s=ko(e);let i=Ee(1);t&&(n?_e(n)&&(i=Nt(n)):i=Nt(e));const l=Vh(s,r,n)?Si(s):Ee(0);let c=(o.left+l.x)/i.x,d=(o.top+l.y)/i.y,u=o.width/i.x,p=o.height/i.y;if(s){const m=he(s),h=n&&_e(n)?he(n):n;let b=m,f=Co(b);for(;f&&n&&h!==b;){const x=Nt(f),_=f.getBoundingClientRect(),v=ye(f),w=_.left+(f.clientLeft+parseFloat(v.paddingLeft))*x.x,j=_.top+(f.clientTop+parseFloat(v.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,p*=x.y,c+=w,d+=j,b=he(f),f=Co(b)}}return Jr({width:u,height:p,x:c,y:d})}function tn(e,t){const r=en(e).scrollLeft;return t?t.left+r:it(Ae(e)).left+r}function Ci(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-tn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function Wh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const s=o==="fixed",i=Ae(n),l=t?Qr(t.floating):!1;if(n===i||l&&s)return r;let c={scrollLeft:0,scrollTop:0},d=Ee(1);const u=Ee(0),p=Pe(n);if((p||!p&&!s)&&((Ct(n)!=="body"||or(i))&&(c=en(n)),Pe(n))){const h=it(n);d=Nt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const m=i&&!p&&!s?Ci(i,c):Ee(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:r.y*d.y-c.scrollTop*d.y+u.y+m.y}}function qh(e){return Array.from(e.getClientRects())}function Gh(e){const t=Ae(e),r=en(e),n=e.ownerDocument.body,o=fe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+tn(e);const l=-r.scrollTop;return ye(n).direction==="rtl"&&(i+=fe(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:l}}const ki=25;function Kh(e,t){const r=he(e),n=Ae(e),o=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,l=0,c=0;if(o){s=o.width,i=o.height;const u=So();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const d=tn(n);if(d<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-h);b<=ki&&(s-=b)}else d<=ki&&(s+=d);return{width:s,height:i,x:l,y:c}}const Yh=new Set(["absolute","fixed"]);function Xh(e,t){const r=it(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,s=Pe(e)?Nt(e):Ee(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=o*s.x,d=n*s.y;return{width:i,height:l,x:c,y:d}}function Ni(e,t,r){let n;if(t==="viewport")n=Kh(e,r);else if(t==="document")n=Gh(Ae(e));else if(_e(t))n=Xh(t,r);else{const o=Si(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jr(n)}function Ei(e,t){const r=Ge(e);return r===t||!_e(r)||kt(r)?!1:ye(r).position==="fixed"||Ei(r,t)}function Jh(e,t){const r=t.get(e);if(r)return r;let n=ar(e,[],!1).filter(l=>_e(l)&&Ct(l)!=="body"),o=null;const s=ye(e).position==="fixed";let i=s?Ge(e):e;for(;_e(i)&&!kt(i);){const l=ye(i),c=jo(i);!c&&l.position==="fixed"&&(o=null),(s?!c&&!o:!c&&l.position==="static"&&!!o&&Yh.has(o.position)||or(i)&&!c&&Ei(e,i))?n=n.filter(u=>u!==i):o=l,i=Ge(i)}return t.set(e,n),n}function Zh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?Qr(t)?[]:Jh(t,this._c):[].concat(r),n],l=i[0],c=i.reduce((d,u)=>{const p=Ni(t,u,o);return d.top=fe(p.top,d.top),d.right=qe(p.right,d.right),d.bottom=qe(p.bottom,d.bottom),d.left=fe(p.left,d.left),d},Ni(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Qh(e){const{width:t,height:r}=ji(e);return{width:t,height:r}}function eg(e,t,r){const n=Pe(t),o=Ae(t),s=r==="fixed",i=it(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=Ee(0);function d(){c.x=tn(o)}if(n||!n&&!s)if((Ct(t)!=="body"||or(o))&&(l=en(t)),n){const h=it(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&d();s&&!n&&o&&d();const u=o&&!n&&!s?Ci(o,l):Ee(0),p=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:p,y:m,width:i.width,height:i.height}}function No(e){return ye(e).position==="static"}function Ti(e,t){if(!Pe(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ae(e)===r&&(r=r.ownerDocument.body),r}function Ai(e,t){const r=he(e);if(Qr(e))return r;if(!Pe(e)){let o=Ge(e);for(;o&&!kt(o);){if(_e(o)&&!No(o))return o;o=Ge(o)}return r}let n=Ti(e,t);for(;n&&zh(n)&&No(n);)n=Ti(n,t);return n&&kt(n)&&No(n)&&!jo(n)?r:n||Bh(e)||r}const tg=async function(e){const t=this.getOffsetParent||Ai,r=this.getDimensions,n=await r(e.floating);return{reference:eg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rg(e){return ye(e).direction==="rtl"}const ng={convertOffsetParentRelativeRectToViewportRelativeRect:Wh,getDocumentElement:Ae,getClippingRect:Zh,getOffsetParent:Ai,getElementRects:tg,getClientRects:qh,getDimensions:Qh,getScale:Nt,isElement:_e,isRTL:rg};function Pi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function og(e,t){let r=null,n;const o=Ae(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:u,top:p,width:m,height:h}=d;if(l||t(),!m||!h)return;const b=Yr(p),f=Yr(o.clientWidth-(u+m)),x=Yr(o.clientHeight-(p+h)),_=Yr(u),w={rootMargin:-b+"px "+-f+"px "+-x+"px "+-_+"px",threshold:fe(0,qe(1,c))||1};let j=!0;function C(N){const k=N[0].intersectionRatio;if(k!==c){if(!j)return i();k?i(!1,k):n=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Pi(d,e.getBoundingClientRect())&&i(),j=!1}try{r=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(e)}return i(!0),s}function ag(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=ko(e),u=o||s?[...d?ar(d):[],...ar(t)]:[];u.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),s&&_.addEventListener("resize",r)});const p=d&&l?og(d,r):null;let m=-1,h=null;i&&(h=new ResizeObserver(_=>{let[v]=_;v&&v.target===d&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),r()}),d&&!c&&h.observe(d),h.observe(t));let b,f=c?it(e):null;c&&x();function x(){const _=it(e);f&&!Pi(f,_)&&r(),f=_,b=requestAnimationFrame(x)}return r(),()=>{var _;u.forEach(v=>{o&&v.removeEventListener("scroll",r),s&&v.removeEventListener("resize",r)}),p?.(),(_=h)==null||_.disconnect(),h=null,c&&cancelAnimationFrame(b)}}const sg=Ah,ig=Ph,lg=Nh,cg=Rh,dg=Eh,Oi=kh,ug=Oh,pg=(e,t,r)=>{const n=new Map,o={platform:ng,...r},s={...o.platform,_c:n};return Ch(e,t,{...o,platform:s})};var mg=typeof document<"u",fg=function(){},rn=mg?y.useLayoutEffect:fg;function nn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!nn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const s=o[n];if(!(s==="_owner"&&e.$$typeof)&&!nn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ri(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Li(e,t){const r=Ri(e);return Math.round(t*r)/r}function Eo(e){const t=g.useRef(e);return rn(()=>{t.current=e}),t}function hg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,p]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=g.useState(n);nn(m,n)||h(n);const[b,f]=g.useState(null),[x,_]=g.useState(null),v=g.useCallback(P=>{P!==N.current&&(N.current=P,f(P))},[]),w=g.useCallback(P=>{P!==k.current&&(k.current=P,_(P))},[]),j=s||b,C=i||x,N=g.useRef(null),k=g.useRef(null),E=g.useRef(u),T=c!=null,O=Eo(c),L=Eo(o),A=Eo(d),I=g.useCallback(()=>{if(!N.current||!k.current)return;const P={placement:t,strategy:r,middleware:m};L.current&&(P.platform=L.current),pg(N.current,k.current,P).then(q=>{const X={...q,isPositioned:A.current!==!1};z.current&&!nn(E.current,X)&&(E.current=X,vr.flushSync(()=>{p(X)}))})},[m,t,r,L,A]);rn(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[d]);const z=g.useRef(!1);rn(()=>(z.current=!0,()=>{z.current=!1}),[]),rn(()=>{if(j&&(N.current=j),C&&(k.current=C),j&&C){if(O.current)return O.current(j,C,I);I()}},[j,C,I,O,T]);const $=g.useMemo(()=>({reference:N,floating:k,setReference:v,setFloating:w}),[v,w]),R=g.useMemo(()=>({reference:j,floating:C}),[j,C]),U=g.useMemo(()=>{const P={position:r,left:0,top:0};if(!R.floating)return P;const q=Li(R.floating,u.x),X=Li(R.floating,u.y);return l?{...P,transform:"translate("+q+"px, "+X+"px)",...Ri(R.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:q,top:X}},[r,l,R.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:I,refs:$,elements:R,floatingStyles:U}),[u,I,$,R,U])}const gg=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Oi({element:n.current,padding:o}).fn(r):{}:n?Oi({element:n,padding:o}).fn(r):{}}}},xg=(e,t)=>({...sg(e),options:[e,t]}),bg=(e,t)=>({...ig(e),options:[e,t]}),vg=(e,t)=>({...ug(e),options:[e,t]}),_g=(e,t)=>({...lg(e),options:[e,t]}),yg=(e,t)=>({...cg(e),options:[e,t]}),wg=(e,t)=>({...dg(e),options:[e,t]}),jg=(e,t)=>({...gg(e),options:[e,t]});var Sg="Arrow",Ii=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...s}=e;return a.jsx(W.svg,{...s,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ii.displayName=Sg;var Cg=Ii;function kg(e){const[t,r]=g.useState(void 0);return se(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,l=d.blockSize}else i=e.offsetWidth,l=e.offsetHeight;r({width:i,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var To="Popper",[zi,on]=He(To),[Ng,Mi]=zi(To),Di=e=>{const{__scopePopper:t,children:r}=e,[n,o]=g.useState(null);return a.jsx(Ng,{scope:t,anchor:n,onAnchorChange:o,children:r})};Di.displayName=To;var Fi="PopperAnchor",$i=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,s=Mi(Fi,r),i=g.useRef(null),l=Y(t,i),c=g.useRef(null);return g.useEffect(()=>{const d=c.current;c.current=n?.current||i.current,d!==c.current&&s.onAnchorChange(c.current)}),n?null:a.jsx(W.div,{...o,ref:l})});$i.displayName=Fi;var Ao="PopperContent",[Eg,Tg]=zi(Ao),Bi=g.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:b,...f}=e,x=Mi(Ao,r),[_,v]=g.useState(null),w=Y(t,F=>v(F)),[j,C]=g.useState(null),N=kg(j),k=N?.width??0,E=N?.height??0,T=n+(s!=="center"?"-"+s:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(d)?d:[d],A=L.length>0,I={padding:O,boundary:L.filter(Pg),altBoundary:A},{refs:z,floatingStyles:$,placement:R,isPositioned:U,middlewareData:P}=hg({strategy:"fixed",placement:T,whileElementsMounted:(...F)=>ag(...F,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[xg({mainAxis:o+E,alignmentAxis:i}),c&&bg({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?vg():void 0,...I}),c&&_g({...I}),yg({...I,apply:({elements:F,rects:te,availableWidth:le,availableHeight:J})=>{const{width:Q,height:ne}=te.reference,xe=F.floating.style;xe.setProperty("--radix-popper-available-width",`${le}px`),xe.setProperty("--radix-popper-available-height",`${J}px`),xe.setProperty("--radix-popper-anchor-width",`${Q}px`),xe.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),j&&jg({element:j,padding:l}),Og({arrowWidth:k,arrowHeight:E}),m&&wg({strategy:"referenceHidden",...I})]}),[q,X]=Vi(R),Z=Ve(b);se(()=>{U&&Z?.()},[U,Z]);const pe=P.arrow?.x,Fe=P.arrow?.y,ge=P.arrow?.centerOffset!==0,[$e,pt]=g.useState();return se(()=>{_&&pt(window.getComputedStyle(_).zIndex)},[_]),a.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:U?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(Eg,{scope:r,placedSide:q,onArrowChange:C,arrowX:pe,arrowY:Fe,shouldHideArrow:ge,children:a.jsx(W.div,{"data-side":q,"data-align":X,...f,ref:w,style:{...f.style,animation:U?void 0:"none"}})})})});Bi.displayName=Ao;var Ui="PopperArrow",Ag={top:"bottom",right:"left",bottom:"top",left:"right"},Hi=g.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,s=Tg(Ui,n),i=Ag[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(Cg,{...o,ref:r,style:{...o.style,display:"block"}})})});Hi.displayName=Ui;function Pg(e){return e!==null}var Og=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,l=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,u]=Vi(r),p={start:"0%",center:"50%",end:"100%"}[u],m=(o.arrow?.x??0)+l/2,h=(o.arrow?.y??0)+c/2;let b="",f="";return d==="bottom"?(b=i?p:`${m}px`,f=`${-c}px`):d==="top"?(b=i?p:`${m}px`,f=`${n.floating.height+c}px`):d==="right"?(b=`${-c}px`,f=i?p:`${h}px`):d==="left"&&(b=`${n.floating.width+c}px`,f=i?p:`${h}px`),{data:{x:b,y:f}}}});function Vi(e){const[t,r="center"]=e.split("-");return[t,r]}var Wi=Di,Po=$i,qi=Bi,Gi=Hi,Rg="Portal",an=g.forwardRef((e,t)=>{const{container:r,...n}=e,[o,s]=g.useState(!1);se(()=>s(!0),[]);const i=r||o&&globalThis?.document?.body;return i?xa.createPortal(a.jsx(W.div,{...n,ref:t}),i):null});an.displayName=Rg;function Lg(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Ke=e=>{const{present:t,children:r}=e,n=Ig(t),o=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),s=Y(n.ref,zg(o));return typeof r=="function"||n.isPresent?g.cloneElement(o,{ref:s}):null};Ke.displayName="Presence";function Ig(e){const[t,r]=g.useState(),n=g.useRef(null),o=g.useRef(e),s=g.useRef("none"),i=e?"mounted":"unmounted",[l,c]=Lg(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const d=sn(n.current);s.current=l==="mounted"?d:"none"},[l]),se(()=>{const d=n.current,u=o.current;if(u!==e){const m=s.current,h=sn(d);e?c("MOUNT"):h==="none"||d?.display==="none"?c("UNMOUNT"):c(u&&m!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),se(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,p=h=>{const f=sn(n.current).includes(CSS.escape(h.animationName));if(h.target===t&&f&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},m=h=>{h.target===t&&(s.current=sn(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:g.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function sn(e){return e?.animationName||"none"}function zg(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Mg=g[" useInsertionEffect ".trim().toString()]||se;function lt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,s,i]=Dg({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:o;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const p=u.current;p!==l&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,n])}const d=g.useCallback(u=>{if(l){const p=Fg(u)?u(e):u;p!==e&&i.current?.(p)}else s(u)},[l,e,s,i]);return[c,d]}function Dg({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),o=g.useRef(r),s=g.useRef(t);return Mg(()=>{s.current=t},[t]),g.useEffect(()=>{o.current!==r&&(s.current?.(r),o.current=r)},[r,o]),[r,n,s]}function Fg(e){return typeof e=="function"}var $g=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Et=new WeakMap,ln=new WeakMap,cn={},Oo=0,Ki=function(e){return e&&(e.host||Ki(e.parentNode))},Bg=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ki(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Ug=function(e,t,r,n){var o=Bg(t,Array.isArray(e)?e:[e]);cn[r]||(cn[r]=new WeakMap);var s=cn[r],i=[],l=new Set,c=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var u=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))u(m);else try{var h=m.getAttribute(n),b=h!==null&&h!=="false",f=(Et.get(m)||0)+1,x=(s.get(m)||0)+1;Et.set(m,f),s.set(m,x),i.push(m),f===1&&b&&ln.set(m,!0),x===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return u(t),l.clear(),Oo++,function(){i.forEach(function(p){var m=Et.get(p)-1,h=s.get(p)-1;Et.set(p,m),s.set(p,h),m||(ln.has(p)||p.removeAttribute(n),ln.delete(p)),h||p.removeAttribute(r)}),Oo--,Oo||(Et=new WeakMap,Et=new WeakMap,ln=new WeakMap,cn={})}},Ro=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=$g(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Ug(n,o,r,"aria-hidden")):function(){return null}},Oe=function(){return Oe=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Oe.apply(this,arguments)};function Yi(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Hg(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var dn="right-scroll-bar-position",un="width-before-scroll-bar",Vg="with-scroll-bars-hidden",Wg="--removed-body-scroll-bar-size";function Lo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qg(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Gg=typeof window<"u"?g.useLayoutEffect:g.useEffect,Xi=new WeakMap;function Kg(e,t){var r=qg(null,function(n){return e.forEach(function(o){return Lo(o,n)})});return Gg(function(){var n=Xi.get(r);if(n){var o=new Set(n),s=new Set(e),i=r.current;o.forEach(function(l){s.has(l)||Lo(l,null)}),s.forEach(function(l){o.has(l)||Lo(l,i)})}Xi.set(r,e)},[e]),r}function Yg(e){return e}function Xg(e,t){t===void 0&&(t=Yg);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var i=t(s,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(n=!0;r.length;){var i=r;r=[],i.forEach(s)}r={push:function(l){return s(l)},filter:function(){return r}}},assignMedium:function(s){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(s),i=r}var c=function(){var u=i;i=[],u.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),r={push:function(u){i.push(u),d()},filter:function(u){return i=i.filter(u),r}}}};return o}function Jg(e){e===void 0&&(e={});var t=Xg(null);return t.options=Oe({async:!0,ssr:!1},e),t}var Ji=function(e){var t=e.sideCar,r=Yi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return g.createElement(n,Oe({},r))};Ji.isSideCarExport=!0;function Zg(e,t){return e.useMedium(t),Ji}var Zi=Jg(),Io=function(){},pn=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:Io,onWheelCapture:Io,onTouchMoveCapture:Io}),o=n[0],s=n[1],i=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,b=e.noIsolation,f=e.inert,x=e.allowPinchZoom,_=e.as,v=_===void 0?"div":_,w=e.gapMode,j=Yi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=Kg([r,t]),k=Oe(Oe({},j),o);return g.createElement(g.Fragment,null,u&&g.createElement(C,{sideCar:Zi,removeScrollBar:d,shards:p,noRelative:h,noIsolation:b,inert:f,setCallbacks:s,allowPinchZoom:!!x,lockRef:r,gapMode:w}),i?g.cloneElement(g.Children.only(l),Oe(Oe({},k),{ref:N})):g.createElement(v,Oe({},k,{className:c,ref:N}),l))});pn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},pn.classNames={fullWidth:un,zeroRight:dn};var Qg=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ex(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qg();return t&&e.setAttribute("nonce",t),e}function tx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function rx(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nx=function(){var e=0,t=null;return{add:function(r){e==0&&(t=ex())&&(tx(t,r),rx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ox=function(){var e=nx();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Qi=function(){var e=ox(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},ax={left:0,top:0,right:0,gap:0},zo=function(e){return parseInt(e||"",10)||0},sx=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[zo(r),zo(n),zo(o)]},ix=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ax;var t=sx(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},lx=Qi(),Tt="data-scroll-locked",cx=function(e,t,r,n){var o=e.left,s=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
     304  .`.concat(Vg,` {
    295305   overflow: hidden `).concat(n,`;
    296306   padding-right: `).concat(l,"px ").concat(n,`;
    297307  }
    298   body[`).concat(Lt,`] {
     308  body[`).concat(Tt,`] {
    299309    overflow: hidden `).concat(n,`;
    300310    overscroll-behavior: contain;
    301311    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
    302312    padding-left: `.concat(o,`px;
    303     padding-top: `).concat(i,`px;
    304     padding-right: `).concat(s,`px;
     313    padding-top: `).concat(s,`px;
     314    padding-right: `).concat(i,`px;
    305315    margin-left:0;
    306316    margin-top:0;
     
    309319  }
    310320 
     321  .`).concat(dn,` {
     322    right: `).concat(l,"px ").concat(n,`;
     323  }
     324 
    311325  .`).concat(un,` {
    312     right: `).concat(l,"px ").concat(n,`;
    313   }
    314  
    315   .`).concat(pn,` {
    316326    margin-right: `).concat(l,"px ").concat(n,`;
    317327  }
    318328 
     329  .`).concat(dn," .").concat(dn,` {
     330    right: 0 `).concat(n,`;
     331  }
     332 
    319333  .`).concat(un," .").concat(un,` {
    320     right: 0 `).concat(n,`;
    321   }
    322  
    323   .`).concat(pn," .").concat(pn,` {
    324334    margin-right: 0 `).concat(n,`;
    325335  }
    326336 
    327   body[`).concat(Lt,`] {
    328     `).concat(Zg,": ").concat(l,`px;
    329   }
    330 `)},Js=function(){var e=parseInt(document.body.getAttribute(Lt)||"0",10);return isFinite(e)?e:0},xx=function(){h.useEffect(function(){return document.body.setAttribute(Lt,(Js()+1).toString()),function(){var e=Js()-1;e<=0?document.body.removeAttribute(Lt):document.body.setAttribute(Lt,e.toString())}},[])},vx=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;xx();var i=h.useMemo(function(){return fx(o)},[o]);return h.createElement(hx,{styles:gx(i,!t,o,r?"":"!important")})},Lo=!1;if(typeof window<"u")try{var fn=Object.defineProperty({},"passive",{get:function(){return Lo=!0,!0}});window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{Lo=!1}var It=Lo?{passive:!1}:!1,bx=function(e){return e.tagName==="TEXTAREA"},Zs=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!bx(e)&&r[t]==="visible")},_x=function(e){return Zs(e,"overflowY")},yx=function(e){return Zs(e,"overflowX")},Qs=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=el(e,n);if(o){var i=tl(e,n),s=i[1],l=i[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},wx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Sx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},el=function(e,t){return e==="v"?_x(t):yx(t)},tl=function(e,t){return e==="v"?wx(t):Sx(t)},jx=function(e,t){return e==="h"&&t==="rtl"?-1:1},Cx=function(e,t,r,n,o){var i=jx(e,window.getComputedStyle(t).direction),s=i*n,l=r.target,c=t.contains(l),d=!1,u=s>0,p=0,m=0;do{if(!l)break;var g=tl(e,l),v=g[0],f=g[1],x=g[2],_=f-x-i*v;(v||_)&&el(e,l)&&(p+=_,m+=v);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rl=function(e){return[e.deltaX,e.deltaY]},nl=function(e){return e&&"current"in e?e.current:e},kx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nx=function(e){return`
     337  body[`).concat(Tt,`] {
     338    `).concat(Wg,": ").concat(l,`px;
     339  }
     340`)},el=function(){var e=parseInt(document.body.getAttribute(Tt)||"0",10);return isFinite(e)?e:0},dx=function(){g.useEffect(function(){return document.body.setAttribute(Tt,(el()+1).toString()),function(){var e=el()-1;e<=0?document.body.removeAttribute(Tt):document.body.setAttribute(Tt,e.toString())}},[])},ux=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;dx();var s=g.useMemo(function(){return ix(o)},[o]);return g.createElement(lx,{styles:cx(s,!t,o,r?"":"!important")})},Mo=!1;if(typeof window<"u")try{var mn=Object.defineProperty({},"passive",{get:function(){return Mo=!0,!0}});window.addEventListener("test",mn,mn),window.removeEventListener("test",mn,mn)}catch{Mo=!1}var At=Mo?{passive:!1}:!1,px=function(e){return e.tagName==="TEXTAREA"},tl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!px(e)&&r[t]==="visible")},mx=function(e){return tl(e,"overflowY")},fx=function(e){return tl(e,"overflowX")},rl=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=nl(e,n);if(o){var s=ol(e,n),i=s[1],l=s[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},hx=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},gx=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},nl=function(e,t){return e==="v"?mx(t):fx(t)},ol=function(e,t){return e==="v"?hx(t):gx(t)},xx=function(e,t){return e==="h"&&t==="rtl"?-1:1},bx=function(e,t,r,n,o){var s=xx(e,window.getComputedStyle(t).direction),i=s*n,l=r.target,c=t.contains(l),d=!1,u=i>0,p=0,m=0;do{if(!l)break;var h=ol(e,l),b=h[0],f=h[1],x=h[2],_=f-x-s*b;(b||_)&&nl(e,l)&&(p+=_,m+=b);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&Math.abs(p)<1||!u&&Math.abs(m)<1)&&(d=!0),d},fn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},al=function(e){return[e.deltaX,e.deltaY]},sl=function(e){return e&&"current"in e?e.current:e},vx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_x=function(e){return`
    331341  .block-interactivity-`.concat(e,` {pointer-events: none;}
    332342  .allow-interactivity-`).concat(e,` {pointer-events: all;}
    333 `)},Ex=0,Mt=[];function Tx(e){var t=h.useRef([]),r=h.useRef([0,0]),n=h.useRef(),o=h.useState(Ex++)[0],i=h.useState(Xs)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Xg([e.lockRef.current],(e.shards||[]).map(nl),!0).filter(Boolean);return f.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(f,x){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var _=hn(f),b=r.current,w="deltaX"in f?f.deltaX:b[0]-_[0],S="deltaY"in f?f.deltaY:b[1]-_[1],C,N=f.target,k=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=Qs(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=Qs(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||S)&&(n.current=C),!C)return!0;var T=n.current||C;return Cx(T,x,f,T==="h"?w:S)},[]),c=h.useCallback(function(f){var x=f;if(!(!Mt.length||Mt[Mt.length-1]!==i)){var _="deltaY"in x?rl(x):hn(x),b=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&kx(C.delta,_)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(s.current.shards||[]).map(nl).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?l(x,w[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),d=h.useCallback(function(f,x,_,b){var w={name:f,delta:x,target:_,should:b,shadowParent:Ax(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=h.useCallback(function(f){r.current=hn(f),n.current=void 0},[]),p=h.useCallback(function(f){d(f.type,rl(f),f.target,l(f,e.lockRef.current))},[]),m=h.useCallback(function(f){d(f.type,hn(f),f.target,l(f,e.lockRef.current))},[]);h.useEffect(function(){return Mt.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,It),document.addEventListener("touchmove",c,It),document.addEventListener("touchstart",u,It),function(){Mt=Mt.filter(function(f){return f!==i}),document.removeEventListener("wheel",c,It),document.removeEventListener("touchmove",c,It),document.removeEventListener("touchstart",u,It)}},[]);var g=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(i,{styles:Nx(o)}):null,g?h.createElement(vx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ax(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Px=ax(Ys,Tx);var gn=h.forwardRef(function(e,t){return h.createElement(mn,Oe({},e,{ref:t,sideCar:Px}))});gn.classNames=mn.classNames;var xn="Popover",[ol]=He(xn,[an]),sr=an(),[Ox,Ye]=ol(xn),al=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=sr(t),c=h.useRef(null),[d,u]=h.useState(!1),[p,m]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:xn});return a.jsx(Us,{...l,children:a.jsx(Ox,{scope:t,contentId:Ne(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:h.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:d,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:s,children:r})})};al.displayName=xn;var il="PopoverAnchor",Rx=h.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(il,r),i=sr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return h.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(Eo,{...i,...n,ref:t})});Rx.displayName=il;var sl="PopoverTrigger",ll=h.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(sl,r),i=sr(r),s=Y(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ml(o.open),...n,ref:s,onClick:H(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Eo,{asChild:!0,...i,children:l})});ll.displayName=sl;var Io="PopoverPortal",[Lx,Ix]=ol(Io,{forceMount:void 0}),cl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Ye(Io,t);return a.jsx(Lx,{scope:t,forceMount:r,children:a.jsx(Ke,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:n})})})};cl.displayName=Io;var zt="PopoverContent",dl=h.forwardRef((e,t)=>{const r=Ix(zt,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Ye(zt,e.__scopePopover);return a.jsx(Ke,{present:n||i.open,children:i.modal?a.jsx(zx,{...o,ref:t}):a.jsx(Dx,{...o,ref:t})})});dl.displayName=zt;var Mx=rt("PopoverContent.RemoveScroll"),zx=h.forwardRef((e,t)=>{const r=Ye(zt,e.__scopePopover),n=h.useRef(null),o=Y(t,n),i=h.useRef(!1);return h.useEffect(()=>{const s=n.current;if(s)return Ao(s)},[]),a.jsx(gn,{as:Mx,allowPinchZoom:!0,children:a.jsx(ul,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:H(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Dx=h.forwardRef((e,t)=>{const r=Ye(zt,e.__scopePopover),n=h.useRef(!1),o=h.useRef(!1);return a.jsx(ul,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ul=h.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Ye(zt,r),g=sr(r);return po(),a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(Hs,{"data-state":ml(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),pl="PopoverClose",Fx=h.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(pl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});Fx.displayName=pl;var $x="PopoverArrow",Bx=h.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=sr(r);return a.jsx(Vs,{...o,...n,ref:t})});Bx.displayName=$x;function ml(e){return e?"open":"closed"}var Ux=al,Hx=ll,Vx=cl,Wx=dl;function ct({...e}){return a.jsx(Ux,{"data-slot":"popover",...e})}function dt({...e}){return a.jsx(Hx,{"data-slot":"popover-trigger",...e})}function ut({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Vx,{container:o,children:a.jsx(Wx,{"data-slot":"popover-content",align:t,sideOffset:r,className:D("ecr-popover",e),...n})})}var vn="Dialog",[fl]=He(vn),[Gx,we]=fl(vn),hl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=h.useRef(null),c=h.useRef(null),[d,u]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:vn});return a.jsx(Gx,{scope:t,triggerRef:l,contentRef:c,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:d,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(p=>!p),[u]),modal:s,children:r})};hl.displayName=vn;var gl="DialogTrigger",xl=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(gl,r),i=Y(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Do(o.open),...n,ref:i,onClick:H(e.onClick,o.onOpenToggle)})});xl.displayName=gl;var Mo="DialogPortal",[qx,vl]=fl(Mo,{forceMount:void 0}),bl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,i=we(Mo,t);return a.jsx(qx,{scope:t,forceMount:r,children:h.Children.map(n,s=>a.jsx(Ke,{present:r||i.open,children:a.jsx(sn,{asChild:!0,container:o,children:s})}))})};bl.displayName=Mo;var bn="DialogOverlay",_l=h.forwardRef((e,t)=>{const r=vl(bn,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=we(bn,e.__scopeDialog);return i.modal?a.jsx(Ke,{present:n||i.open,children:a.jsx(Yx,{...o,ref:t})}):null});_l.displayName=bn;var Kx=rt("DialogOverlay.RemoveScroll"),Yx=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(bn,r);return a.jsx(gn,{as:Kx,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Do(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),pt="DialogContent",yl=h.forwardRef((e,t)=>{const r=vl(pt,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=we(pt,e.__scopeDialog);return a.jsx(Ke,{present:n||i.open,children:i.modal?a.jsx(Xx,{...o,ref:t}):a.jsx(Jx,{...o,ref:t})})});yl.displayName=pt;var Xx=h.forwardRef((e,t)=>{const r=we(pt,e.__scopeDialog),n=h.useRef(null),o=Y(t,r.contentRef,n);return h.useEffect(()=>{const i=n.current;if(i)return Ao(i)},[]),a.jsx(wl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:H(e.onFocusOutside,i=>i.preventDefault())})}),Jx=h.forwardRef((e,t)=>{const r=we(pt,e.__scopeDialog),n=h.useRef(!1),o=h.useRef(!1);return a.jsx(wl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),wl=h.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=we(pt,r),c=h.useRef(null),d=Y(t,c);return po(),a.jsxs(a.Fragment,{children:[a.jsx(Kr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Do(l.open),...s,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(Qx,{titleId:l.titleId}),a.jsx(t0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),zo="DialogTitle",Sl=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(zo,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Sl.displayName=zo;var jl="DialogDescription",Zx=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(jl,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});Zx.displayName=jl;var Cl="DialogClose",kl=h.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Cl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:H(e.onClick,()=>o.onOpenChange(!1))})});kl.displayName=Cl;function Do(e){return e?"open":"closed"}var Nl="DialogTitleWarning",[L_,El]=eh(Nl,{contentName:pt,titleName:zo,docsSlug:"dialog"}),Qx=({titleId:e})=>{const t=El(Nl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
     343`)},yx=0,Pt=[];function wx(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),o=g.useState(yx++)[0],s=g.useState(Qi)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var f=Hg([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return f.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),f.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=g.useCallback(function(f,x){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!i.current.allowPinchZoom;var _=fn(f),v=r.current,w="deltaX"in f?f.deltaX:v[0]-_[0],j="deltaY"in f?f.deltaY:v[1]-_[1],C,N=f.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in f&&k==="h"&&N.type==="range")return!1;var E=rl(k,N);if(!E)return!0;if(E?C=k:(C=k==="v"?"h":"v",E=rl(k,N)),!E)return!1;if(!n.current&&"changedTouches"in f&&(w||j)&&(n.current=C),!C)return!0;var T=n.current||C;return bx(T,x,f,T==="h"?w:j)},[]),c=g.useCallback(function(f){var x=f;if(!(!Pt.length||Pt[Pt.length-1]!==s)){var _="deltaY"in x?al(x):fn(x),v=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&vx(C.delta,_)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var w=(i.current.shards||[]).map(sl).filter(Boolean).filter(function(C){return C.contains(x.target)}),j=w.length>0?l(x,w[0]):!i.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),d=g.useCallback(function(f,x,_,v){var w={name:f,delta:x,target:_,should:v,shadowParent:jx(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),u=g.useCallback(function(f){r.current=fn(f),n.current=void 0},[]),p=g.useCallback(function(f){d(f.type,al(f),f.target,l(f,e.lockRef.current))},[]),m=g.useCallback(function(f){d(f.type,fn(f),f.target,l(f,e.lockRef.current))},[]);g.useEffect(function(){return Pt.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,At),document.addEventListener("touchmove",c,At),document.addEventListener("touchstart",u,At),function(){Pt=Pt.filter(function(f){return f!==s}),document.removeEventListener("wheel",c,At),document.removeEventListener("touchmove",c,At),document.removeEventListener("touchstart",u,At)}},[]);var h=e.removeScrollBar,b=e.inert;return g.createElement(g.Fragment,null,b?g.createElement(s,{styles:_x(o)}):null,h?g.createElement(ux,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Sx=Zg(Zi,wx);var hn=g.forwardRef(function(e,t){return g.createElement(pn,Oe({},e,{ref:t,sideCar:Sx}))});hn.classNames=pn.classNames;var gn="Popover",[il]=He(gn,[on]),sr=on(),[Cx,Ye]=il(gn),ll=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,l=sr(t),c=g.useRef(null),[d,u]=g.useState(!1),[p,m]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:gn});return a.jsx(Wi,{...l,children:a.jsx(Cx,{scope:t,contentId:Ne(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:g.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:i,children:r})})};ll.displayName=gn;var cl="PopoverAnchor",kx=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(cl,r),s=sr(r),{onCustomAnchorAdd:i,onCustomAnchorRemove:l}=o;return g.useEffect(()=>(i(),()=>l()),[i,l]),a.jsx(Po,{...s,...n,ref:t})});kx.displayName=cl;var dl="PopoverTrigger",ul=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(dl,r),s=sr(r),i=Y(t,o.triggerRef),l=a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gl(o.open),...n,ref:i,onClick:V(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(Po,{asChild:!0,...s,children:l})});ul.displayName=dl;var Do="PopoverPortal",[Nx,Ex]=il(Do,{forceMount:void 0}),pl=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,s=Ye(Do,t);return a.jsx(Nx,{scope:t,forceMount:r,children:a.jsx(Ke,{present:r||s.open,children:a.jsx(an,{asChild:!0,container:o,children:n})})})};pl.displayName=Do;var Ot="PopoverContent",ml=g.forwardRef((e,t)=>{const r=Ex(Ot,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,s=Ye(Ot,e.__scopePopover);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(Ax,{...o,ref:t}):a.jsx(Px,{...o,ref:t})})});ml.displayName=Ot;var Tx=rt("PopoverContent.RemoveScroll"),Ax=g.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=g.useRef(null),o=Y(t,n),s=g.useRef(!1);return g.useEffect(()=>{const i=n.current;if(i)return Ro(i)},[]),a.jsx(hn,{as:Tx,allowPinchZoom:!0,children:a.jsx(fl,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,i=>{i.preventDefault(),s.current||r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;s.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:V(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Px=g.forwardRef((e,t)=>{const r=Ye(Ot,e.__scopePopover),n=g.useRef(!1),o=g.useRef(!1);return a.jsx(fl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),fl=g.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:u,...p}=e,m=Ye(Ot,r),h=sr(r);return ho(),a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:a.jsx(qi,{"data-state":gl(m.open),role:"dialog",id:m.contentId,...h,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),hl="PopoverClose",Ox=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ye(hl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ox.displayName=hl;var Rx="PopoverArrow",Lx=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=sr(r);return a.jsx(Gi,{...o,...n,ref:t})});Lx.displayName=Rx;function gl(e){return e?"open":"closed"}var Ix=ll,zx=ul,Mx=pl,Dx=ml;function Rt({...e}){return a.jsx(Ix,{"data-slot":"popover",...e})}function Lt({...e}){return a.jsx(zx,{"data-slot":"popover-trigger",...e})}function It({className:e,align:t="center",sideOffset:r=4,...n}){const o=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Mx,{container:o,children:a.jsx(Dx,{"data-slot":"popover-content",align:t,sideOffset:r,className:D("ecr-popover",e),...n})})}var Fx=Symbol.for("react.lazy"),xn=g[" use ".trim().toString()];function $x(e){return typeof e=="object"&&e!==null&&"then"in e}function xl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Fx&&"_payload"in e&&$x(e._payload)}function Bx(e){const t=Ux(e),r=g.forwardRef((n,o)=>{let{children:s,...i}=n;xl(s)&&typeof xn=="function"&&(s=xn(s._payload));const l=g.Children.toArray(s),c=l.find(Vx);if(c){const d=c.props.children,u=l.map(p=>p===c?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:p);return a.jsx(t,{...i,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return a.jsx(t,{...i,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function Ux(e){const t=g.forwardRef((r,n)=>{let{children:o,...s}=r;if(xl(o)&&typeof xn=="function"&&(o=xn(o._payload)),g.isValidElement(o)){const i=qx(o),l=Wx(s,o.props);return o.type!==g.Fragment&&(l.ref=n?Hn(n,i):i),g.cloneElement(o,l)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hx=Symbol("radix.slottable");function Vx(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hx}function Wx(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...l)=>{const c=s(...l);return o(...l),c}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function qx(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Gx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kx=Gx.reduce((e,t)=>{const r=Bx(`Primitive.${t}`),n=g.forwardRef((o,s)=>{const{asChild:i,...l}=o,c=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Yx="Separator",bl="horizontal",Xx=["horizontal","vertical"],vl=g.forwardRef((e,t)=>{const{decorative:r,orientation:n=bl,...o}=e,s=Jx(n)?n:bl,l=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return a.jsx(Kx.div,{"data-orientation":s,...l,...o,ref:t})});vl.displayName=Yx;function Jx(e){return Xx.includes(e)}var Zx=vl;function bn({className:e,orientation:t="horizontal",decorative:r=!0,...n}){return a.jsx(Zx,{"data-slot":"separator",decorative:r,orientation:t,className:D("ecr-separator",e),...n})}const ir=({name:e,text:t})=>{const r=ecommreelsInfo.isProActive,n=ecommreelsInfo.isLicenseActive,o=ecommreelsInfo.license_page;return a.jsxs("div",{className:"ecr-admin-upgrade__modal",children:[a.jsxs("h4",{className:"ecr-admin-upgrade__title",children:[a.jsx("span",{className:"ecr-admin-upgrade__name",children:e}),a.jsx("span",{className:"ecr-admin-upgrade__tag",children:"PRO"})]}),a.jsx(bn,{className:"ecr-admin-separator"}),a.jsx("p",{className:"ecr-admin-upgrade__text",children:t}),a.jsx(bn,{className:"ecr-admin-separator"}),a.jsx("div",{className:"ecr-admin-upgrade__actions",children:a.jsx(re,{asChild:!0,className:"ecr-admin-upgrade__button",size:"sm",children:a.jsx("a",{href:r&&!n?o:"https://reelswp.com/pricing/",style:{color:"#fff"},target:"_blank",rel:"noreferrer",className:"ecr-admin-upgrade__link",children:r&&!n?"Active":"Upgrade to Pro"})})})]})};var vn="Dialog",[_l]=He(vn),[Qx,we]=_l(vn),yl=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,l=g.useRef(null),c=g.useRef(null),[d,u]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:vn});return a.jsx(Qx,{scope:t,triggerRef:l,contentRef:c,contentId:Ne(),titleId:Ne(),descriptionId:Ne(),open:d,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(p=>!p),[u]),modal:i,children:r})};yl.displayName=vn;var wl="DialogTrigger",jl=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(wl,r),s=Y(t,o.triggerRef);return a.jsx(W.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bo(o.open),...n,ref:s,onClick:V(e.onClick,o.onOpenToggle)})});jl.displayName=wl;var Fo="DialogPortal",[e0,Sl]=_l(Fo,{forceMount:void 0}),Cl=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,s=we(Fo,t);return a.jsx(e0,{scope:t,forceMount:r,children:g.Children.map(n,i=>a.jsx(Ke,{present:r||s.open,children:a.jsx(an,{asChild:!0,container:o,children:i})}))})};Cl.displayName=Fo;var _n="DialogOverlay",kl=g.forwardRef((e,t)=>{const r=Sl(_n,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(_n,e.__scopeDialog);return s.modal?a.jsx(Ke,{present:n||s.open,children:a.jsx(r0,{...o,ref:t})}):null});kl.displayName=_n;var t0=rt("DialogOverlay.RemoveScroll"),r0=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(_n,r);return a.jsx(hn,{as:t0,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(W.div,{"data-state":Bo(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ct="DialogContent",Nl=g.forwardRef((e,t)=>{const r=Sl(ct,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,s=we(ct,e.__scopeDialog);return a.jsx(Ke,{present:n||s.open,children:s.modal?a.jsx(n0,{...o,ref:t}):a.jsx(o0,{...o,ref:t})})});Nl.displayName=ct;var n0=g.forwardRef((e,t)=>{const r=we(ct,e.__scopeDialog),n=g.useRef(null),o=Y(t,r.contentRef,n);return g.useEffect(()=>{const s=n.current;if(s)return Ro(s)},[]),a.jsx(El,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(e.onCloseAutoFocus,s=>{s.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:V(e.onFocusOutside,s=>s.preventDefault())})}),o0=g.forwardRef((e,t)=>{const r=we(ct,e.__scopeDialog),n=g.useRef(!1),o=g.useRef(!1);return a.jsx(El,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(n.current||r.triggerRef.current?.focus(),s.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;r.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),El=g.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,l=we(ct,r),c=g.useRef(null),d=Y(t,c);return ho(),a.jsxs(a.Fragment,{children:[a.jsx(Gr,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:s,children:a.jsx(qr,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Bo(l.open),...i,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(s0,{titleId:l.titleId}),a.jsx(l0,{contentRef:c,descriptionId:l.descriptionId})]})]})}),$o="DialogTitle",Tl=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we($o,r);return a.jsx(W.h2,{id:o.titleId,...n,ref:t})});Tl.displayName=$o;var Al="DialogDescription",a0=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Al,r);return a.jsx(W.p,{id:o.descriptionId,...n,ref:t})});a0.displayName=Al;var Pl="DialogClose",Ol=g.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=we(Pl,r);return a.jsx(W.button,{type:"button",...n,ref:t,onClick:V(e.onClick,()=>o.onOpenChange(!1))})});Ol.displayName=Pl;function Bo(e){return e?"open":"closed"}var Rl="DialogTitleWarning",[G_,Ll]=Gf(Rl,{contentName:ct,titleName:$o,docsSlug:"dialog"}),s0=({titleId:e})=>{const t=Ll(Rl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
    334344
    335345If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
    336346
    337 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},e0="DialogDescriptionWarning",t0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${El(e0).contentName}}.`;return h.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},r0=hl,n0=xl,o0=bl,a0=_l,i0=yl,s0=Sl,l0=kl;function Tl({...e}){return a.jsx(r0,{"data-slot":"dialog",...e})}function Al({...e}){return a.jsx(n0,{"data-slot":"dialog-trigger",...e})}function c0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(o0,{"data-slot":"dialog-portal",container:t,...e})}function d0({className:e,...t}){return a.jsx(a0,{"data-slot":"dialog-overlay",className:D("ecr-dialog__overlay",e),...t})}function Pl({className:e,children:t,...r}){return a.jsxs(c0,{children:[a.jsx(d0,{}),a.jsxs(i0,{"data-slot":"dialog-content",className:D("ecr-dialog__content",e),...r,children:[t,a.jsx(l0,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(Ff,{className:"ecr-dialog__close-icon"})})]})]})}function Ol({className:e,...t}){return a.jsx("div",{className:D("ecr-dialog__header",e),...t})}function Rl({className:e,...t}){return a.jsx(s0,{"data-slot":"dialog-title",className:D("ecr-dialog__title",e),...t})}const u0=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:D("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),p0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,m0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[i,s]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),g=()=>{const v=[];t||v.push("text"),n&&p0.test(n)||v.push("url"),i||v.push("campaign"),m(v),!(v.length>0)&&e({btn_type:"custom",btn_uuid:Gi(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:i,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(_n,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(_n,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(_n,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:i,setValue:s}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:v=>c(v.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(_n,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(u0,{name:"add",handleClick:g})})]})};function _n({error:e,type:t,name:r,label:n,placeholder:o,value:i,setValue:s}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:i,onChange:l=>s(l.target.value),className:D("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const f0=({setLinks:e})=>{const t=r=>{e(n=>[...n,r])};return a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[a.jsxs(Tl,{children:[a.jsxs(Al,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Lf,{size:20})," Add Custom Link"]}),a.jsxs(Pl,{className:"ecr-admin-link-dialog",children:[a.jsx(Ol,{children:a.jsx(Rl,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(m0,{handleLinks:t})})]})]}),a.jsxs(ct,{children:[a.jsxs(dt,{className:"ecr-admin-link-tabs__lock",children:[a.jsx(zf,{size:20})," Tag Product ",a.jsx(bt,{size:20})]}),a.jsx(ut,{className:"ecr-admin-link-tabs__popover",children:a.jsx(Et,{name:"Tag Product",text:a.jsx(a.Fragment,{children:"Link one or multiple products to your videos, enhancing sales directly from your Reels!"})})})]})]})})},h0=({links:e,onLinksChange:t})=>{const r=n=>{t(o=>o.filter(i=>i.btn_uuid!==n))};return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:"Link"}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(n=>a.jsxs("div",{className:`ecr-admin-links__item ${n.customClass??""}`,children:[a.jsx("span",{children:n.buttonText}),a.jsx(oe,{onClick:()=>r(n.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Df,{size:16})})]},n.btn_uuid)),a.jsxs(ct,{children:[a.jsxs(dt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(bt,{size:20})]}),a.jsx(ut,{className:"ecr-admin-links__popover",children:a.jsx(Et,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(f0,{setLinks:t})]})};function Ll(e){return V({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const g0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[i,s]=y.useState(!1);return a.jsx("video",{ref:n,className:D("ecr-admin-reelvideo",i?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;s(()=>u>d)}})},x0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:i,dragEnd:s})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(v=>!v))},g=()=>{p.current&&(p.current.muted=!l,c(v=>!v))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>i(e),onDragEnd:s,className:D("ecr-admin-customization__panel"),children:[a.jsx(Ll,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(g0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(Vn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Un,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Hn,{size:16,className:"ecr-admin-customization__control",onClick:g}):a.jsx(Wn,{size:16,className:"ecr-admin-customization__control",onClick:g})]})]})},v0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),i=c=>{n.current=c},s=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(x0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:i,dragEnter:s,dragEnd:l},d)),a.jsxs(ct,{children:[a.jsxs(dt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:qi,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(bt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(ut,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(Et,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},b0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx(Ll,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(Ki,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),_0=()=>{const e=je(),[t]=Gt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,i]=y.useState({files:[],title:"",links:[],thumbnail:null}),[s,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(x=>{i(_=>({..._,title:typeof x=="function"?x(_.title):x}))},[]),p=y.useCallback(x=>{i(_=>({..._,files:typeof x=="function"?x(_.files):x}))},[]),m=y.useCallback(x=>{i(_=>({..._,links:typeof x=="function"?x(_.links):x}))},[]),g=y.useCallback(x=>{i(_=>({..._,thumbnail:typeof x=="function"?x(_.thumbnail):x}))},[]),v=()=>{c&&(p(x=>x.filter(_=>_.file_uuid!==c)),d(null))},f=y.useCallback(async x=>{try{l(!0);const _=await ue.get(`story/${x}`);i({title:_.data.title,files:_.data.files,links:_.data.links,thumbnail:_.data.thumbnail})}catch(_){_ instanceof Error?q.error(_.message):q.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(_f,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Or,{onReject:()=>d(null),onAccept:v,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(v0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(Ki,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(b0,{thumbnail:o.thumbnail,onThumbnailChange:g}),a.jsx(lo,{className:"ecr-admin-create__separator"}),a.jsx(h0,{links:o.links,onLinksChange:m})]})]})]})},Il=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(Dp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Fo,Ml;function y0(){return Ml||(Ml=1,Fo=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Fo}var $o,zl;function w0(){if(zl)return $o;zl=1;var e=y0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(i){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return i.replace(/#{\s*key\s*}/g,s)}function o(i,s){var l,c,d,u,p,m,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=i,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),s.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=t[s.format]||t.default;window.clipboardData.setData(x,i)}else f.clipboardData.clearData(),f.clipboardData.setData(s.format,i);s.onCopy&&(f.preventDefault(),s.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var v=document.execCommand("copy");if(!v)throw new Error("copy command was unsuccessful");g=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",i),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(x){l&&console.error("unable to copy using clipboardData: ",x),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,i)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return g}return $o=o,$o}var S0=w0();const Dl=vd(S0);function Fl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:D("ecr-table",e),...t})})}function $l({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:D("ecr-table__header",e),...t})}function Bl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:D("ecr-table__body",e),...t})}function yn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:D("ecr-table__row",e),...t})}function Ul({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:D("ecr-table__head",e),...t})}function Re({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:D("ecr-table__cell",e),...t})}function Hl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:D("ecr-table__caption",e),...t})}const j0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],C0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),i=(s,l)=>{Dl(s),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Fl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Hl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(nt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx($l,{children:a.jsx(yn,{children:j0.map((s,l)=>a.jsx(Ul,{className:"ecr-admin-groups__head",style:{width:s?.width||"auto",textAlign:s?.align},children:s.label},l))})}),a.jsx(Bl,{children:e.map((s,l)=>a.jsxs(yn,{className:D("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Re,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:s.group_name})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${s.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>i(`[reelswp-group id='${s.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(Xu,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:D("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(oe,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${K.stat}&group=${s.id}&name=${s.group_name}`,children:a.jsx(ei,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(oe,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(vt,{to:`?view=${K.mg}&gid=${s.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(oe,{title:"Delete Group",onClick:()=>t(s.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(zp,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},s.id??l))})]}):null]})},Vl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),k0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,g]=y.useState(1),[v]=y.useState(20),[f,x]=y.useState(0),[_,b]=y.useState(1),w=Ui(u,500),S=y.useCallback(async E=>{const T=new AbortController,R=E===1;try{R?i(!0):l(!0),n("");const I=await ue.get("groups",{params:{page:E,per_page:v,...w&&{q:w}},signal:T.signal}),A=Number(I.headers?.["x-wp-total"]??0),L=Number(I.headers?.["x-wp-totalpages"]??1),M=Math.max(1,L||1);t($=>{if(R)return I.data;const O=new Set($.map(P=>P.id)),U=I.data.filter(P=>!O.has(P.id));return[...$,...U]}),x(A),b(M),E>M&&g(M)}catch(I){if(T.signal.aborted)return;I instanceof Error?n(I.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(R?i(!1):l(!1))}},[v,w]),C=y.useCallback(()=>{g(E=>o||s||E>=_?E:E+1)},[o,s,_]),N=y.useCallback(async()=>{if(m!==1){g(1);return}await S(1)},[m,S]),k=y.useCallback(async E=>{try{d(!0),await ue.delete(`group/${E}`),await N(),q.success("Group deleted successfully!")}catch(T){T instanceof Error?q.error(T.message):q.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{S(m)},[m,S,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:s,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:v,total:f,totalPages:_,hasMore:m<=_,loadMore:C,refreshGroups:N,deleteGroup:k}},N0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:i,isDeleting:s,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=k0(),m=y.useRef(null),g=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const v=new IntersectionObserver(f=>{const[x]=f;x.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return v.observe(m.current),()=>v.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(jt,{name:"All Widgets",Icon:Fp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}`,text:"Add Reel",Icon:_t},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:g,onReject:()=>t(null),isLoading:s}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:v=>p(v.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(oe,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(Xt,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(Ga,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${K.mg}`,text:"Create Widget",Icon:_t,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Vl,{}):n?a.jsx(Il,{}):a.jsxs(a.Fragment,{children:[a.jsx(C0,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:i?a.jsx(If,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},E0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,i]=y.useState(!1),[s,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,g)=>{t(!0),n(v=>({...v,[m]:g}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),g=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(g)){q.error("Please enter valid numbers.");return}try{l(!0),d(!1),await ue.post("settings",{rate_limit:m,time_limit:g}),q.success("Settings updated successfully."),t(!1)}catch(v){v instanceof Error?q.error(v.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{i(!0),d(!1);const v=await ue.get("settings",{signal:m.signal});n({rateLimit:v.data.rate_limit,timeLimit:v.data.time_limit}),t(!1)}catch(v){if(m.signal.aborted)return;v instanceof Error?q.error(v.message):q.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||i(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:s,isError:c,handleOnChange:u,handleSave:p}},T0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:i,handleSave:s}=E0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(St,{left:[a.jsx(jt,{name:"Settings",Icon:pp},"Settings"),a.jsx(Jt,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(ao,{onSave:s,isSaving:n,disabled:!t},"save")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>i("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>i("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},A0=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],P0=({tableData:e})=>a.jsxs(Fl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Hl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx($l,{children:a.jsx(yn,{children:A0.map((t,r)=>a.jsx(Ul,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Bl,{children:e.map((t,r)=>a.jsxs(yn,{className:D("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),O0=()=>{const[e]=Gt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[i,s]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const g=await ue.get(`/group/${t}/stats`);o(g.data.stories),s(g.data.buttons)}catch(g){g instanceof Error?q.error(g.message):q.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,g)=>m+=g.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(St,{left:[a.jsx(jt,{name:"Statistics",Icon:ei},"Statistics"),a.jsx(Jt,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Vl,{}):d?a.jsx(Il,{}):i.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(P0,{tableData:i})})]})]})};function R0(e){return V({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function L0(e){return V({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const I0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:D("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(R0,{size:24})}),M0=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})});function z0({className:e,type:t,...r}){return a.jsx("input",{type:t,"data-slot":"input",className:D("ecr-input",e),...r})}const lr=({label:e,min:t,max:r,value:n,onChange:o,name:i,id:s,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=v=>{const f=Math.min(r,Math.max(t,Number(v)));o(f)},g=v=>{const f=Number(v);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:s,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:s,name:i,min:t,max:r,value:n,onChange:v=>{const f=Number(v.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(z0,{type:"number",min:t,max:r,value:d,onChange:v=>g(v.target.value),className:"ecr-input"}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function z(){return z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(null,arguments)}function De(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Dt=255,Xe=100,cr=e=>{var{r:t,g:r,b:n,a:o}=e,i=Math.max(t,r,n),s=i-Math.min(t,r,n),l=s?i===t?(r-n)/s:i===r?2+(n-t)/s:4+(t-r)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*Xe:0,v:i/Dt*Xe,a:o}},Wl=e=>{var{h:t,s:r,l:n,a:o}=Gl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Gl=e=>{var{h:t,s:r,v:n,a:o}=e,i=(200-r)*n/Xe;return{h:t,s:i>0&&i<200?r*n/Xe/(i<=Xe?i:200-i)*Xe:0,l:i/2,a:o}},ql=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(i=>new Array(7-i.length).join("0")+i)(o.toString(16))},D0=e=>{var{r:t,g:r,b:n,a:o}=e,i=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+ql({r:t,g:r,b:n})+(i||"")},dr=e=>cr(F0(e)),F0=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,i=0,s]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:i,a:(s??255)/Dt}},wn=e=>{var{h:t,s:r,v:n,a:o}=e,i=t/60,s=r/Xe,l=n/Xe,c=Math.floor(i)%6,d=i-Math.floor(i),u=Dt*l*(1-s),p=Dt*l*(1-s*d),m=Dt*l*(1-s*(1-d));l*=Dt;var g={};switch(c){case 0:g.r=l,g.g=m,g.b=u;break;case 1:g.r=p,g.g=l,g.b=u;break;case 2:g.r=u,g.g=l,g.b=m;break;case 3:g.r=u,g.g=p,g.b=l;break;case 4:g.r=m,g.g=u,g.b=l;break;case 5:g.r=l,g.g=u,g.b=p;break}return g.r=Math.round(g.r),g.g=Math.round(g.g),g.b=Math.round(g.b),z({},g,{a:o})},$0=e=>{var{r:t,g:r,b:n,a:o}=wn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},B0=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},U0=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Bo=e=>ql(wn(e)),H0=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},V0=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},i=o(t/255),s=o(r/255),l=o(n/255),c={};return c.x=i*.4124+s*.3576+l*.1805,c.y=i*.2126+s*.7152+l*.0722,c.bri=i*.0193+s*.1192+l*.9505,c},Ft=e=>{var t,r,n,o,i,s,l,c,d;return typeof e=="string"&&Uo(e)?(s=dr(e),c=e):typeof e!="string"&&(s=e),s&&(n=H0(s),i=Gl(s),o=wn(s),d=D0(o),c=Bo(s),r=U0(i),t=B0(o),l=V0(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:i,hsva:s,hex:c,hexa:d,xy:l}},Uo=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function Kl(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var ur=e=>"touches"in e,Yl=e=>{!ur(e)&&e.preventDefault&&e.preventDefault()},Xl=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},Jl=(e,t)=>{var r=e.getBoundingClientRect(),n=ur(t)?t.touches[0]:t;return{left:Xl((n.pageX-(r.left+window.pageXOffset))/r.width),top:Xl((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},W0=["prefixCls","className","onMove","onDown"],Ho=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:i}=e,s=De(e,W0),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=Kl(o),m=Kl(i),g=b=>c.current&&!ur(b)?!1:(c.current=ur(b),!0),v=y.useCallback(b=>{if(Yl(b),!!l.current){var w=ur(b)?b.touches.length>0:b.buttons>0;if(!w){u(!1);return}p?.(Jl(l.current,b),b)}},[p]),f=y.useCallback(()=>u(!1),[]),x=y.useCallback(b=>{b?(window.addEventListener(c.current?"touchmove":"mousemove",v),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",v),window.removeEventListener("touchend",f))},[v,f]);y.useEffect(()=>(x(d),()=>{x(!1)}),[d,v,f,x]);var _=y.useCallback(b=>{var w=document.activeElement;w?.blur(),Yl(b.nativeEvent),g(b.nativeEvent)&&l.current&&(m?.(Jl(l.current,b.nativeEvent),b.nativeEvent),u(!0))},[m]);return a.jsx("div",z({},s,{className:[r,n||""].filter(Boolean).join(" "),style:z({},s.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:_,onTouchStart:_}))});Ho.displayName="Interactive";var G0=e=>{var{className:t,color:r,left:n,top:o,prefixCls:i}=e,s={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:i+"-pointer "+(t||""),style:s,children:a.jsx("div",{className:i+"-fill",style:l})}),[o,n,r,t,i])},q0=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],Zl=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:i,className:s,hue:l=0,style:c,hsva:d,onChange:u}=e,p=De(e,q0),m=z({width:200,height:200,borderRadius:o},c,{position:"relative"}),g=(_,b)=>{u&&d&&u({h:d.h,s:_.left*100,v:(1-_.top)*100,a:d.a})},v=y.useCallback(_=>{if(!(!d||!u)){var b=1,w=d.s,S=d.v,C=!1;switch(_.key){case"ArrowLeft":w=Math.max(0,d.s-b),C=!0,_.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+b),C=!0,_.preventDefault();break;case"ArrowUp":S=Math.min(100,d.v+b),C=!0,_.preventDefault();break;case"ArrowDown":S=Math.max(0,d.v-b),C=!0,_.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:S,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var _={top:100-d.v+"%",left:d.s+"%",color:Wl(d)};return i&&typeof i=="function"?i(z({prefixCls:n},_)):a.jsx(G0,z({prefixCls:n},_))},[d,i,n]),x=y.useCallback(_=>{_.target.focus()},[]);return a.jsx(Ho,z({className:[n,s||""].filter(Boolean).join(" ")},p,{style:z({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:g,onDown:g,onKeyDown:v,onClick:x,children:f}))});Zl.displayName="Saturation";var K0=["className","prefixCls","left","top","style","fillProps"],Y0=e=>{var{className:t,prefixCls:r,left:n,top:o,style:i,fillProps:s}=e,l=De(e,K0),c=z({},i,{position:"absolute",left:n,top:o}),d=z({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},s?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",z({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",z({className:r+"-fill"},s,{style:d}))}))},X0=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],J0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Sn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:i,bgProps:s={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:g,onChange:v,pointer:f}=e,x=De(e,X0),_=T=>{v&&v(z({},o,{a:m==="horizontal"?T.left:T.top}),T)},b=Wl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+b+" 100%)",S={};m==="horizontal"?S.left=o.a*100+"%":S.top=o.a*100+"%";var C=z({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+J0+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},g,{position:"relative"}),N=y.useCallback(T=>{var R=.01,I=o.a,A=I;switch(T.key){case"ArrowLeft":m==="horizontal"&&(A=Math.max(0,I-R),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(A=Math.min(1,I+R),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(A=Math.max(0,I-R),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(A=Math.min(1,I+R),T.preventDefault());break;default:return}if(A!==I){var L={left:m==="horizontal"?A:o.a,top:m==="vertical"?A:o.a,width:0,height:0,x:0,y:0};v&&v(z({},o,{a:A}),L)}},[o,m,v]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(z({prefixCls:r},c,S)):a.jsx(Y0,z({},c,{prefixCls:r},S));return a.jsxs("div",z({},x,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",z({},s,{style:z({inset:0,position:"absolute",background:i||w,borderRadius:d},s.style)})),a.jsx(Ho,z({},l,{style:z({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:_,onDown:_,onClick:k,onKeyDown:N,children:E}))]}))});Sn.displayName="Alpha";var Z0=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],Q0=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),ev=e=>Number(String(e).replace(/%/g,"")),$t=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:i,className:s,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,g=De(e,Z0),[v,f]=y.useState(i),x=y.useRef(!1);y.useEffect(()=>{e.value!==v&&(x.current||f(e.value))},[e.value]);function _(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");Q0(T)&&u&&u(k,T);var R=ev(T);isNaN(R)||u&&u(k,R),f(T)}function b(k){x.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var S=z({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=z({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=z({value:v,onChange:_,onBlur:b,autoComplete:"off",onFocus:()=>x.current=!0},g,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,s||""].filter(Boolean).join(" "),style:S,children:[m?m(N,t):a.jsx("input",z({ref:t},N)),o&&a.jsx("span",{style:z({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});$t.displayName="EditableInput";var tv=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],Ql=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:i={},gProps:s={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=De(e,tv),g=n?wn(n):{};function v(b){var w=Number(b.target.value);w&&w>255&&(b.target.value="255"),w&&w<0&&(b.target.value="0")}var f=b=>{var w=Number(b.target.value);w&&w>100&&(b.target.value="100"),w&&w<0&&(b.target.value="0")},x=(b,w,S)=>{typeof b=="number"&&(w==="a"&&(b<0&&(b=0),b>100&&(b=100),p&&p(Ft(cr(z({},g,{a:b/100}))))),b>255&&(b=255,S.target.value="255"),b<0&&(b=0,S.target.value="0"),w==="r"&&p&&p(Ft(cr(z({},g,{r:b})))),w==="g"&&p&&p(Ft(cr(z({},g,{g:b})))),w==="b"&&p&&p(Ft(cr(z({},g,{b})))))},_=g.a?Math.round(g.a*100)/100:0;return a.jsxs("div",z({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:z({fontSize:11,display:"flex"},u),children:[a.jsx($t,z({label:"R",value:g.r||0,onBlur:v,placement:o,onChange:(b,w)=>x(w,"r",b)},i,{style:z({},i.style)})),a.jsx($t,z({label:"G",value:g.g||0,onBlur:v,placement:o,onChange:(b,w)=>x(w,"g",b)},s,{style:z({marginLeft:5},i.style)})),a.jsx($t,z({label:"B",value:g.b||0,onBlur:v,placement:o,onChange:(b,w)=>x(w,"b",b)},l,{style:z({marginLeft:5},l.style)})),c&&a.jsx($t,z({label:"A",value:parseInt(String(_*100),10),onBlur:f,placement:o,onChange:(b,w)=>x(w,"a",b)},c,{style:z({marginLeft:5},c.style)}))]}))});Ql.displayName="EditableInputRGBA";var rv=["prefixCls","className","hue","onChange","direction"],ec=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:i,direction:s="horizontal"}=e,l=De(e,rv);return a.jsx(Sn,z({ref:t,className:r+" "+(n||"")},l,{direction:s,background:"linear-gradient(to "+(s==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{i&&i({h:s==="horizontal"?360*d.left:360*d.top})}}))});ec.displayName="Hue";var nv=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],tc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:i=[],style:s,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=De(e,nv),g=z({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),v=(f,x)=>{c&&c(dr(f),Ft(dr(f)),x)};return a.jsxs("div",z({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:z({display:"flex",flexWrap:"wrap",position:"relative"},s),children:[u&&y.isValidElement(u)&&u,i&&Array.isArray(i)&&i.map((f,x)=>{var _="",b="";typeof f=="string"&&(_=f,b=f),typeof f=="object"&&f.color&&(_=f.title||f.color,b=f.color);var w=o&&o.toLocaleLowerCase()===b.toLocaleLowerCase(),S=p&&p({title:_,color:b,checked:!!w,style:z({},g,{background:b}),onClick:N=>v(b,N)});if(S)return a.jsx(y.Fragment,{children:S},x);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:b,checked:w}):null;return a.jsx("div",z({tabIndex:0,title:_,onClick:N=>v(b,N)},l,{children:C,style:z({},g,{background:b})}),x)}),d&&y.isValidElement(d)&&d]}))});tc.displayName="Swatch";var ov=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],av=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],rc=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),nc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:i=218,presetColors:s=av,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=De(e,ov),[m,g]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&Uo(l)&&g(dr(l)),typeof l=="object"&&g(l)},[l]);var v=N=>{g(N),o&&o(Ft(N))},f=(N,k)=>{typeof N=="string"&&Uo(N)&&/(3|6)/.test(String(N.length))&&v(dr(N))},x=N=>v(z({},m,{a:N.a})),_=N=>v(z({},m,N,{a:m.a})),b=z({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:i},u),w={borderRadius:2,background:$0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},S={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",z({},p,{className:r+" "+(n||""),ref:t,style:b,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(Zl,{hsva:m,style:{width:"auto",height:150},onChange:_}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ec,{width:"auto",height:10,hue:m.h,pointer:rc,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>v(z({},m,N))}),!d&&a.jsx(Sn,{width:"auto",height:10,hsva:m,pointer:rc,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:x})]}),!d&&a.jsx(Sn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx($t,{label:"Hex",value:Bo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(Ql,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>v(N.hsva)})]}),s&&s.length>0&&a.jsx(tc,{style:S,colors:s,color:Bo(m),onChange:N=>v(N),rectProps:{style:C}})]}))});nc.displayName="Sketch";const oc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(ct,{children:[a.jsx(dt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(ut,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(nc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),iv=[{value:"left",title:"Align Left",Icon:Tp},{value:"center",title:"Align Center",Icon:Ap},{value:"right",title:"Align Right",Icon:Pp},{value:"hidden",title:"Hidden",Icon:Op}],sv=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:iv.map(({value:r,title:n,Icon:o})=>a.jsx(oe,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),lv=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(i=>{const s=o(i);return r(!0),s})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(sv,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,alignment:o}}))}),a.jsx(oc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(lr,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(i=>({...i,widgetTitle:{...i.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},cv=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(i=>{Dl(i),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},dv=({gid:e})=>{const[t,r]=cv(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Of,{color:"#ffffff",size:12})}),a.jsx("span",{className:D("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},ac=y.createContext({requestLeave:e=>e()}),uv=({value:e,children:t})=>a.jsx(ac.Provider,{value:e,children:t}),ic=()=>y.useContext(ac),jn=({link:e,style:t})=>a.jsx("div",{className:"ecr-thumb__link-list",style:t,children:a.jsx("a",{href:e.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,children:e.buttonText},e.btn_uuid)}),sc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const i=je(),{requestLeave:s}=ic(),l=n===e.story_uuid,c=`?view=${K.cr}&from=${K.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={width:`${t?.size}px`,border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:D("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(qn,{story:e,styles:t}),d==="overlay"&&t.shape==="rectangle"&&p&&a.jsx(jn,{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"95%",borderRadius:"6px"},link:p}),a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(oe,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(vt,{to:c,className:D("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:m=>{m.preventDefault(),s(()=>i(c))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(oe,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(tt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(ti,{size:18})})]})]}),d==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel__title",children:e.title}):null]})},lc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[i,s]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),g=()=>{const f=r.current;if(!f)return;const x=f.scrollLeft,_=f.scrollWidth,b=f.clientWidth;c(x>0),u(x+b<_-1)};y.useEffect(()=>{const f=r.current,x=n.current;f&&x&&(s(x.scrollWidth>f.clientWidth),m(f.clientWidth-100),g())},[e,t]);const v=f=>{const x=r.current;x&&(x.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(g,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let x=!1,_,b;const w=R=>{x=!0,_=R.pageX-f.offsetLeft,b=f.scrollLeft,f.style.cursor="grabbing"},S=()=>{x=!1,f.style.cursor="default"},C=()=>{x=!1,f.style.cursor="default"},N=R=>{if(!x)return;R.preventDefault();const A=(R.pageX-f.offsetLeft-_)*1.5;f.scrollLeft=b-A,g()},k=R=>{x=!0,_=R.touches[0].pageX-f.offsetLeft,b=f.scrollLeft},E=()=>{x=!1},T=R=>{if(!x)return;const A=(R.touches[0].pageX-f.offsetLeft-_)*1.5;f.scrollLeft=b-A,g()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",S),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",S),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:i,canScrollLeft:l,canScrollRight:d,scrollBy:v,scrollStep:p}},cc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=lc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:i,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:s,style:{...!e.length&&{margin:"auto"},gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:D("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(sc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(nt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Kt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Yt,{size:20})})]})},pv=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const i={columnGap:`${t?.gap}px`};return a.jsx("div",{style:i,className:D("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(s=>a.jsx(sc,{reel:s,styles:t,gid:r,togglingId:n,onRemove:o},s.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(nt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})},dc=({title:e})=>a.jsx("p",{className:"ecr-reel_title",children:e}),mv=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,i]=y.useState(!1),[s,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=s)},[s]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&i(f=>!f)},m=()=>{u.current&&l(f=>!f)},g=t?.playerAppearance??"overlay",v=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(yt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Kt,{size:24})}),a.jsx(yt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Yt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(Xt,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:s,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const x=f.currentTarget,_=x.videoWidth,b=x.videoHeight;d(()=>b>_)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(Un,{size:20,className:"ecr-player__control-icon",onClick:p}),s?a.jsx(Hn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),g==="overlay"&&v?a.jsx(jn,{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"},link:v}):null,g==="title"?a.jsx(dc,{title:e.title}):null]})})},fv={carousel:cc,grid:pv},hv=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:i})=>{const s=r.template??"carousel",l=fv[s]||cc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(dv,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:i==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(mv,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(nt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},uc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),gv=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:i,togglingId:s,lastStoryElementRef:l})=>{const c=je(),{requestLeave:d}=ic(),u=`?view=${K.cr}&from=${K.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Rr,{to:u,text:"Add Reel",Icon:_t,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:i&&t.length===0?a.jsx(uc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,g)=>a.jsx("div",{ref:p.length===g+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:s==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),s==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(tt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),i&&t.length>0&&a.jsx(uc,{})]})})]})]})};function pc(e){const t=e+"CollectionProvider",[r,n]=He(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:x,children:_}=f,b=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:w,collectionRef:b,children:_})};s.displayName=t;const l=e+"CollectionSlot",c=rt(l),d=y.forwardRef((f,x)=>{const{scope:_,children:b}=f,w=i(l,_),S=Y(x,w.collectionRef);return a.jsx(c,{ref:S,children:b})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(u),g=y.forwardRef((f,x)=>{const{scope:_,children:b,...w}=f,S=y.useRef(null),C=Y(x,S),N=i(u,_);return y.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>void N.itemMap.delete(S))),a.jsx(m,{[p]:"",ref:C,children:b})});g.displayName=u;function v(f){const x=i(e+"CollectionConsumer",f);return y.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:d,ItemSlot:g},v,n]}var xv=h.createContext(void 0);function Vo(e){const t=h.useContext(xv);return e||t||"ltr"}var Wo="rovingFocusGroup.onEntryFocus",vv={bubbles:!1,cancelable:!0},pr="RovingFocusGroup",[Go,mc,bv]=pc(pr),[_v,fc]=He(pr,[bv]),[yv,wv]=_v(pr),hc=h.forwardRef((e,t)=>a.jsx(Go.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Go.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Sv,{...e,ref:t})})}));hc.displayName=pr;var Sv=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=h.useRef(null),g=Y(t,m),v=Vo(i),[f,x]=lt({prop:s,defaultProp:l??null,onChange:c,caller:pr}),[_,b]=h.useState(!1),w=Ve(d),S=mc(r),C=h.useRef(!1),[N,k]=h.useState(0);return h.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(Wo,w),()=>E.removeEventListener(Wo,w)},[w]),a.jsx(yv,{scope:r,orientation:n,dir:v,loop:o,currentTabStopId:f,onItemFocus:h.useCallback(E=>x(E),[x]),onItemShiftTab:h.useCallback(()=>b(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:H(e.onMouseDown,()=>{C.current=!0}),onFocus:H(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!_){const R=new CustomEvent(Wo,vv);if(E.currentTarget.dispatchEvent(R),!R.defaultPrevented){const I=S().filter(O=>O.focusable),A=I.find(O=>O.active),L=I.find(O=>O.id===f),$=[A,L,...I].filter(Boolean).map(O=>O.ref.current);vc($,u)}}C.current=!1}),onBlur:H(e.onBlur,()=>b(!1))})})}),gc="RovingFocusGroupItem",xc=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...l}=e,c=Ne(),d=i||c,u=wv(gc,r),p=u.currentTabStopId===d,m=mc(r),{onFocusableItemAdd:g,onFocusableItemRemove:v,currentTabStopId:f}=u;return h.useEffect(()=>{if(n)return g(),()=>v()},[n,g,v]),a.jsx(Go.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:H(e.onMouseDown,x=>{n?u.onItemFocus(d):x.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=kv(x,u.orientation,u.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=m().filter(S=>S.focusable).map(S=>S.ref.current);if(_==="last")w.reverse();else if(_==="prev"||_==="next"){_==="prev"&&w.reverse();const S=w.indexOf(x.currentTarget);w=u.loop?Nv(w,S+1):w.slice(S+1)}setTimeout(()=>vc(w))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:f!=null}):s})})});xc.displayName=gc;var jv={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cv(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kv(e,t,r){const n=Cv(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return jv[n]}function vc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Nv(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Ev=hc,Tv=xc,Cn="Tabs",[Av]=He(Cn,[fc]),bc=fc(),[Pv,qo]=Av(Cn),_c=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Vo(l),[p,m]=lt({prop:n,onChange:o,defaultProp:i??"",caller:Cn});return a.jsx(Pv,{scope:r,baseId:Ne(),value:p,onValueChange:m,orientation:s,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":s,...d,ref:t})})});_c.displayName=Cn;var yc="TabsList",wc=h.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=qo(yc,r),s=bc(r);return a.jsx(Ev,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});wc.displayName=yc;var Sc="TabsTrigger",jc=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,s=qo(Sc,r),l=bc(r),c=Nc(s.baseId,n),d=Ec(s.baseId,n),u=n===s.value;return a.jsx(Tv,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...i,ref:t,onMouseDown:H(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:H(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:H(e.onFocus,()=>{const p=s.activationMode!=="manual";!u&&!o&&p&&s.onValueChange(n)})})})});jc.displayName=Sc;var Cc="TabsContent",kc=h.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:i,...s}=e,l=qo(Cc,r),c=Nc(l.baseId,n),d=Ec(l.baseId,n),u=n===l.value,p=h.useRef(u);return h.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ke,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&i})})});kc.displayName=Cc;function Nc(e,t){return`${e}-trigger-${t}`}function Ec(e,t){return`${e}-content-${t}`}var Ov=_c,Rv=wc,Lv=jc,Iv=kc;function Mv({className:e,...t}){return a.jsx(Ov,{"data-slot":"tabs",className:D("ecr-tabs",e),...t})}function zv({className:e,...t}){return a.jsx(Rv,{"data-slot":"tabs-list",className:D("ecr-tabs__list",e),...t})}function Tc({className:e,...t}){return a.jsx(Lv,{"data-slot":"tabs-trigger",className:D("ecr-tabs__trigger",e),...t})}function Ac({className:e,...t}){return a.jsx(Iv,{"data-slot":"tabs-content",className:D("ecr-tabs__content",e),...t})}function Pc(e,[t,r]){return Math.min(r,Math.max(t,e))}function Dv(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Fv="VisuallyHidden",$v=h.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Oc,...e.style}}));$v.displayName=Fv;var Bv=[" ","Enter","ArrowUp","ArrowDown"],Uv=[" ","Enter"],mt="Select",[kn,Nn,Hv]=pc(mt),[Bt]=He(mt,[Hv,an]),En=an(),[Vv,Je]=Bt(mt),[Wv,Gv]=Bt(mt),Rc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:g,form:v}=e,f=En(t),[x,_]=h.useState(null),[b,w]=h.useState(null),[S,C]=h.useState(!1),N=Vo(d),[k,E]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:mt}),[T,R]=lt({prop:s,defaultProp:l,onChange:c,caller:mt}),I=h.useRef(null),A=x?v||!!x.closest("form"):!0,[L,M]=h.useState(new Set),$=Array.from(L).map(O=>O.props.value).join(";");return a.jsx(Us,{...f,children:a.jsxs(Vv,{required:g,scope:t,trigger:x,onTriggerChange:_,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Ne(),value:T,onValueChange:R,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:I,disabled:m,children:[a.jsx(kn.Provider,{scope:t,children:a.jsx(Wv,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(O=>{M(U=>new Set(U).add(O))},[]),onNativeOptionRemove:h.useCallback(O=>{M(U=>{const P=new Set(U);return P.delete(O),P})},[]),children:r})}),A?a.jsxs(td,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:O=>R(O.target.value),disabled:m,form:v,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(L)]},$):null]})})};Rc.displayName=mt;var Lc="SelectTrigger",Ic=h.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=En(r),s=Je(Lc,r),l=s.disabled||n,c=Y(t,s.onTriggerChange),d=Nn(r),u=h.useRef("touch"),[p,m,g]=nd(f=>{const x=d().filter(w=>!w.disabled),_=x.find(w=>w.value===s.value),b=od(x,f,_);b!==void 0&&s.onValueChange(b.value)}),v=f=>{l||(s.onOpenChange(!0),g()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Eo,{asChild:!0,...i,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":rd(s.value)?"":void 0,...o,ref:c,onClick:H(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&v(f)}),onPointerDown:H(o.onPointerDown,f=>{u.current=f.pointerType;const x=f.target;x.hasPointerCapture(f.pointerId)&&x.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(v(f),f.preventDefault())}),onKeyDown:H(o.onKeyDown,f=>{const x=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(x&&f.key===" ")&&Bv.includes(f.key)&&(v(),f.preventDefault())})})})});Ic.displayName=Lc;var Mc="SelectValue",zc=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...l}=e,c=Je(Mc,r),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,p=Y(t,c.onValueNodeChange);return ie(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:rd(c.value)?a.jsx(a.Fragment,{children:s}):i})});zc.displayName=Mc;var qv="SelectIcon",Dc=h.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Dc.displayName=qv;var Kv="SelectPortal",Fc=e=>a.jsx(sn,{asChild:!0,...e});Fc.displayName=Kv;var ft="SelectContent",$c=h.forwardRef((e,t)=>{const r=Je(ft,e.__scopeSelect),[n,o]=h.useState();if(ie(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?br.createPortal(a.jsx(Bc,{scope:e.__scopeSelect,children:a.jsx(kn.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(Uc,{...e,ref:t})});$c.displayName=ft;var Se=10,[Bc,Ze]=Bt(ft),Yv="SelectContentImpl",Xv=rt("SelectContent.RemoveScroll"),Uc=h.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:f,avoidCollisions:x,..._}=e,b=Je(ft,r),[w,S]=h.useState(null),[C,N]=h.useState(null),k=Y(t,F=>S(F)),[E,T]=h.useState(null),[R,I]=h.useState(null),A=Nn(r),[L,M]=h.useState(!1),$=h.useRef(!1);h.useEffect(()=>{if(w)return Ao(w)},[w]),po();const O=h.useCallback(F=>{const[ee,...le]=A().map(re=>re.ref.current),[J]=le.slice(-1),Q=document.activeElement;for(const re of F)if(re===Q||(re?.scrollIntoView({block:"nearest"}),re===ee&&C&&(C.scrollTop=0),re===J&&C&&(C.scrollTop=C.scrollHeight),re?.focus(),document.activeElement!==Q))return},[A,C]),U=h.useCallback(()=>O([E,w]),[O,E,w]);h.useEffect(()=>{L&&U()},[L,U]);const{onOpenChange:P,triggerPointerDownPosRef:G}=b;h.useEffect(()=>{if(w){let F={x:0,y:0};const ee=J=>{F={x:Math.abs(Math.round(J.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(J.pageY)-(G.current?.y??0))}},le=J=>{F.x<=10&&F.y<=10?J.preventDefault():w.contains(J.target)||P(!1),document.removeEventListener("pointermove",ee),G.current=null};return G.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",le,{capture:!0})}}},[w,P,G]),h.useEffect(()=>{const F=()=>P(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[P]);const[X,Z]=nd(F=>{const ee=A().filter(Q=>!Q.disabled),le=ee.find(Q=>Q.ref.current===document.activeElement),J=od(ee,F,le);J&&setTimeout(()=>J.ref.current.focus())}),pe=h.useCallback((F,ee,le)=>{const J=!$.current&&!le;(b.value!==void 0&&b.value===ee||J)&&(T(F),J&&($.current=!0))},[b.value]),Fe=h.useCallback(()=>w?.focus(),[w]),he=h.useCallback((F,ee,le)=>{const J=!$.current&&!le;(b.value!==void 0&&b.value===ee||J)&&I(F)},[b.value]),$e=n==="popper"?Ko:Hc,ht=$e===Ko?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:v,hideWhenDetached:f,avoidCollisions:x}:{};return a.jsx(Bc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:pe,selectedItem:E,onItemLeave:Fe,itemTextRefCallback:he,focusSelectedItem:U,selectedItemText:R,position:n,isPositioned:L,searchRef:X,children:a.jsx(gn,{as:Xv,allowPinchZoom:!0,children:a.jsx(Kr,{asChild:!0,trapped:b.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:H(o,F=>{b.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:a.jsx($e,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:F=>F.preventDefault(),..._,...ht,onPlaced:()=>M(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:H(_.onKeyDown,F=>{const ee=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!ee&&F.key.length===1&&Z(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let J=A().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(F.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const Q=F.target,re=J.indexOf(Q);J=J.slice(re+1)}setTimeout(()=>O(J)),F.preventDefault()}})})})})})})});Uc.displayName=Yv;var Jv="SelectItemAlignedPosition",Hc=h.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Je(ft,r),s=Ze(ft,r),[l,c]=h.useState(null),[d,u]=h.useState(null),p=Y(t,k=>u(k)),m=Nn(r),g=h.useRef(!1),v=h.useRef(!0),{viewport:f,selectedItem:x,selectedItemText:_,focusSelectedItem:b}=s,w=h.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&f&&x&&_){const k=i.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),R=_.getBoundingClientRect();if(i.dir!=="rtl"){const Q=R.left-E.left,re=T.left-Q,ge=k.left-re,gt=k.width+ge,aa=Math.max(gt,E.width),ia=window.innerWidth-Se,sa=Pc(re,[Se,Math.max(Se,ia-aa)]);l.style.minWidth=gt+"px",l.style.left=sa+"px"}else{const Q=E.right-R.right,re=window.innerWidth-T.right-Q,ge=window.innerWidth-k.right-re,gt=k.width+ge,aa=Math.max(gt,E.width),ia=window.innerWidth-Se,sa=Pc(re,[Se,Math.max(Se,ia-aa)]);l.style.minWidth=gt+"px",l.style.right=sa+"px"}const I=m(),A=window.innerHeight-Se*2,L=f.scrollHeight,M=window.getComputedStyle(d),$=parseInt(M.borderTopWidth,10),O=parseInt(M.paddingTop,10),U=parseInt(M.borderBottomWidth,10),P=parseInt(M.paddingBottom,10),G=$+O+L+P+U,X=Math.min(x.offsetHeight*5,G),Z=window.getComputedStyle(f),pe=parseInt(Z.paddingTop,10),Fe=parseInt(Z.paddingBottom,10),he=k.top+k.height/2-Se,$e=A-he,ht=x.offsetHeight/2,F=x.offsetTop+ht,ee=$+O+F,le=G-ee;if(ee<=he){const Q=I.length>0&&x===I[I.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-f.offsetTop-f.offsetHeight,ge=Math.max($e,ht+(Q?Fe:0)+re+U),gt=ee+ge;l.style.height=gt+"px"}else{const Q=I.length>0&&x===I[0].ref.current;l.style.top="0px";const ge=Math.max(he,$+f.offsetTop+(Q?pe:0)+ht)+le;l.style.height=ge+"px",f.scrollTop=ee-he+f.offsetTop}l.style.margin=`${Se}px 0`,l.style.minHeight=X+"px",l.style.maxHeight=A+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,i.trigger,i.valueNode,l,d,f,x,_,i.dir,n]);ie(()=>w(),[w]);const[S,C]=h.useState();ie(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=h.useCallback(k=>{k&&v.current===!0&&(w(),b?.(),v.current=!1)},[w,b]);return a.jsx(Qv,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:g,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Hc.displayName=Jv;var Zv="SelectPopperPosition",Ko=h.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=Se,...i}=e,s=En(r);return a.jsx(Hs,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Ko.displayName=Zv;var[Qv,Yo]=Bt(ft,{}),Xo="SelectViewport",Vc=h.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Ze(Xo,r),s=Yo(Xo,r),l=Y(t,i.onViewportChange),c=h.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(kn.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:H(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(c.current-u.scrollTop);if(g>0){const v=window.innerHeight-Se*2,f=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),_=Math.max(f,x);if(_<v){const b=_+g,w=Math.min(v,b),S=b-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Vc.displayName=Xo;var Wc="SelectGroup",[eb,tb]=Bt(Wc),rb=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ne();return a.jsx(eb,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});rb.displayName=Wc;var Gc="SelectLabel",nb=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=tb(Gc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});nb.displayName=Gc;var Tn="SelectItem",[ob,qc]=Bt(Tn),Kc=h.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,l=Je(Tn,r),c=Ze(Tn,r),d=l.value===n,[u,p]=h.useState(i??""),[m,g]=h.useState(!1),v=Y(t,b=>c.itemRefCallback?.(b,n,o)),f=Ne(),x=h.useRef("touch"),_=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(ob,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:h.useCallback(b=>{p(w=>w||(b?.textContent??"").trim())},[]),children:a.jsx(kn.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:v,onFocus:H(s.onFocus,()=>g(!0)),onBlur:H(s.onBlur,()=>g(!1)),onClick:H(s.onClick,()=>{x.current!=="mouse"&&_()}),onPointerUp:H(s.onPointerUp,()=>{x.current==="mouse"&&_()}),onPointerDown:H(s.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:H(s.onPointerMove,b=>{x.current=b.pointerType,o?c.onItemLeave?.():x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(s.onKeyDown,b=>{c.searchRef?.current!==""&&b.key===" "||(Uv.includes(b.key)&&_(),b.key===" "&&b.preventDefault())})})})})});Kc.displayName=Tn;var mr="SelectItemText",Yc=h.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Je(mr,r),l=Ze(mr,r),c=qc(mr,r),d=Gv(mr,r),[u,p]=h.useState(null),m=Y(t,_=>p(_),c.onItemTextChange,_=>l.itemTextRefCallback?.(_,c.value,c.disabled)),g=u?.textContent,v=h.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:f,onNativeOptionRemove:x}=d;return ie(()=>(f(v),()=>x(v)),[f,x,v]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...i,ref:m}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?br.createPortal(i.children,s.valueNode):null]})});Yc.displayName=mr;var Xc="SelectItemIndicator",Jc=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return qc(Xc,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});Jc.displayName=Xc;var Jo="SelectScrollUpButton",Zc=h.forwardRef((e,t)=>{const r=Ze(Jo,e.__scopeSelect),n=Yo(Jo,e.__scopeSelect),[o,i]=h.useState(!1),s=Y(t,n.onScrollButtonChange);return ie(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ed,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Zc.displayName=Jo;var Zo="SelectScrollDownButton",Qc=h.forwardRef((e,t)=>{const r=Ze(Zo,e.__scopeSelect),n=Yo(Zo,e.__scopeSelect),[o,i]=h.useState(!1),s=Y(t,n.onScrollButtonChange);return ie(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ed,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Qc.displayName=Zo;var ed=h.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Ze("SelectScrollButton",r),s=h.useRef(null),l=Nn(r),c=h.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),ie(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:H(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:H(o.onPointerLeave,()=>{c()})})}),ab="SelectSeparator",ib=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});ib.displayName=ab;var Qo="SelectArrow",sb=h.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=En(r),i=Je(Qo,r),s=Ze(Qo,r);return i.open&&s.position==="popper"?a.jsx(Vs,{...o,...n,ref:t}):null});sb.displayName=Qo;var lb="SelectBubbleInput",td=h.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=h.useRef(null),i=Y(n,o),s=Dv(t);return h.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(W.select,{...r,style:{...Oc,...r.style},ref:i,defaultValue:t})});td.displayName=lb;function rd(e){return e===""||e===void 0}function nd(e){const t=Ve(e),r=h.useRef(""),n=h.useRef(0),o=h.useCallback(s=>{const l=r.current+s;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=h.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function od(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=cb(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const c=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function cb(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var db=Rc,ub=Ic,pb=zc,mb=Dc,fb=Fc,hb=$c,gb=Vc,xb=Kc,vb=Yc,bb=Jc,_b=Zc,yb=Qc;function fr({...e}){return a.jsx(db,{"data-slot":"select",...e})}function hr({...e}){return a.jsx(pb,{"data-slot":"select-value",...e})}function gr({className:e,size:t="default",children:r,...n}){return a.jsxs(ub,{"data-slot":"select-trigger","data-size":t,className:D("ecr-select__trigger",e),...n,children:[r,a.jsx(mb,{asChild:!0,children:a.jsx(so,{className:"ecr-select__icon"})})]})}function xr({className:e,children:t,position:r="popper",align:n="center",...o}){const i=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(fb,{container:i,children:a.jsxs(hb,{"data-slot":"select-content",className:D("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(wb,{}),a.jsx(gb,{className:D("ecr-select__viewport"),children:t}),a.jsx(Sb,{})]})})}function vr({className:e,children:t,...r}){return a.jsxs(xb,{"data-slot":"select-item",className:D("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(bb,{children:a.jsx(Af,{className:"ecr-select__check-icon"})})}),a.jsx(vb,{children:t})]})}function wb({className:e,...t}){return a.jsx(_b,{"data-slot":"select-scroll-up-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(Pf,{className:"ecr-select__icon"})})}function Sb({className:e,...t}){return a.jsx(yb,{"data-slot":"select-scroll-down-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(so,{className:"ecr-select__icon"})})}const jb=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Bu.map(r=>a.jsx(vr,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Cb={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function kb(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(fr,{defaultValue:Ba[0].value,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Ba.map(e=>a.jsx(vr,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Fu.map(e=>a.jsx("div",{children:a.jsxs(ct,{modal:!0,children:[a.jsxs(dt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(bt,{size:18})]}),a.jsx(ut,{className:"ecr-admin-control__popover",children:a.jsx(Et,{name:e.label,text:Cb[e.value]})})]})},e.value))]})]})]})}const Nb=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(kb,{}),a.jsx(jb,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var An="Collapsible",[Eb]=He(An),[Tb,ea]=Eb(An),ad=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:i,onOpenChange:s,...l}=e,[c,d]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:An});return a.jsx(Tb,{scope:r,disabled:i,contentId:Ne(),open:c,onOpenToggle:h.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":ra(c),"data-disabled":i?"":void 0,...l,ref:t})})});ad.displayName=An;var id="CollapsibleTrigger",sd=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=ea(id,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ra(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:H(e.onClick,o.onOpenToggle)})});sd.displayName=id;var ta="CollapsibleContent",ld=h.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ea(ta,e.__scopeCollapsible);return a.jsx(Ke,{present:r||o.open,children:({present:i})=>a.jsx(Ab,{...n,ref:t,present:i})})});ld.displayName=ta;var Ab=h.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...i}=e,s=ea(ta,r),[l,c]=h.useState(n),d=h.useRef(null),u=Y(t,d),p=h.useRef(0),m=p.current,g=h.useRef(0),v=g.current,f=s.open||l,x=h.useRef(f),_=h.useRef(void 0);return h.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),ie(()=>{const b=d.current;if(b){_.current=_.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();p.current=w.height,g.current=w.width,x.current||(b.style.transitionDuration=_.current.transitionDuration,b.style.animationName=_.current.animationName),c(n)}},[s.open,n]),a.jsx(W.div,{"data-state":ra(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!f,...i,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:f&&o})});function ra(e){return e?"open":"closed"}var Pb=ad,Ob=sd,Rb=ld;function cd({className:e,...t}){return a.jsx(Pb,{"data-slot":"collapsible",className:D("ecr-collapsible",e),...t})}function dd({className:e,children:t,...r}){return a.jsxs(Ob,{"data-slot":"collapsible-trigger",className:D("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(so,{className:"ecr-collapsible__trigger-icon"})]})}function ud({className:e,...t}){return a.jsx(Rb,{"data-slot":"collapsible-content",className:D("ecr-collapsible__content",e),...t})}const na=({label:e,text:t})=>a.jsxs(ct,{children:[a.jsx(dt,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(bt,{size:20})]}),a.jsx(L0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(ut,{className:"ecr-admin-popover",children:a.jsx(Et,{name:e,text:t})})]}),Lb=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:$u.map(r=>a.jsx(vr,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Ib=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Du.map(r=>a.jsx(vr,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Mb=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],zb=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:Mb.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx(Ip,{color:"#2563eb",size:16}):a.jsx(Mp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},Db=Object.values($a),Fb={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},$b=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Db.map(r=>a.jsx(vr,{value:r,className:"ecr-admin-control__option",children:r},r)),zu.map(r=>a.jsx("div",{children:a.jsxs(ct,{modal:!0,children:[a.jsxs(dt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(bt,{size:18})]}),a.jsx(ut,{className:"ecr-admin-control__popover",children:a.jsx(Et,{name:r,text:Fb[r]})})]})},r))]})]})]}),Bb=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",i=r==="style",s=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsxs(cd,{open:o,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(dd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>s("layout"),children:[a.jsx(Rf,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(ud,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(zb,{selectedShape:e?.shape,handleShape:l=>t(c=>({...c,shape:l}))}),a.jsx($b,{selectedLayout:e?.template??"carousel",handleLayout:l=>t(c=>({...c,template:l}))}),a.jsx(Lb,{linkLayout:e?.appearance??"overlay",handleLinkLayout:l=>t(c=>({...c,appearance:l}))}),a.jsx(lr,{label:"Size",min:150,max:400,value:e?.size??150,onChange:l=>t(c=>({...c,size:l})),name:"size",id:"size"}),a.jsx(lr,{label:"Gap",min:0,max:80,value:e?.gap??0,onChange:l=>t(c=>({...c,gap:l})),name:"column_gap",id:"column-gap"}),a.jsx(na,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(na,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(na,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),a.jsxs(cd,{open:i,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(dd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>s("style"),children:[a.jsx(Mf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(ud,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(lr,{label:"Border Width",min:0,max:12,value:e?.border?.border_width??0,onChange:l=>t(c=>({...c,border:{...c.border,border_width:l}})),name:"border_width",id:"border-width"}),a.jsx(oc,{selectedColor:e?.border?.border_color,handleColor:l=>t(c=>({...c,border:{...c.border,border_color:l}})),text:"Border Color"}),e?.shape==="rectangle"&&a.jsx(lr,{label:"Border Radius",min:0,max:99,value:e?.border?.border_radius??0,onChange:l=>t(c=>({...c,border:{...c.border,border_radius:l}})),name:"border_radius",id:"border-radius"}),a.jsx(Ib,{hoverEffect:e?.hoverEffect||"none",handleHoverEffect:l=>t(c=>({...c,hoverEffect:l}))})]})]})]})},Ub=({styles:e,setStyles:t,isExpanded:r,setIsEdited:n,tabs:o,currentTab:i,setCurrentTab:s})=>{const l=d=>{t(u=>{const p=d(u);return n(!0),p})},c=d=>{(d===o.thumbnail||d===o.preview)&&s(d)};return a.jsxs("div",{className:D("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(Mv,{value:i,onValueChange:c,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(zv,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Tc,{value:o.thumbnail,children:"Thumbnail"}),a.jsx(Tc,{value:o.preview,children:"Preview"})]}),a.jsx(Ac,{value:o.thumbnail,children:a.jsx(Bb,{styles:e,updateStyles:l})}),a.jsx(Ac,{value:o.preview,children:a.jsx(Nb,{styles:e,updateStyles:l})})]})})]})},Hb=e=>{const t=je(),[r,n]=y.useState(""),[o,i]=y.useState([]),[s,l]=y.useState(et),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,g]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const b=(await ue.get(`stories/${e}`)).data;n(b.group_name),i(b.stories),l(b.styles??et)}catch(_){_ instanceof Error?q.error(_.message):q.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const v=async x=>{const _=o.map(S=>S.id),b={group_name:r,styles:s,story_ids:_};e&&(b.group_id=e);const w=await ue.post("stories/manage-group-stories",b);if(!e){const S=w.data.group_id;t(`?view=${K.mg}&gid=${S}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:i,styles:s,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:g,handleSave:async()=>{try{p(!0);const x=await v();return g(!1),q.success("Changes saved successfully!"),x}catch(x){return x instanceof Error?q.error(x.message):q.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},Vb=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),i=y.useRef(!1),s=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){s.current=m;return}if(i.current){i.current=!1,s.current=m;return}m!==s.current&&(o.current=m,window.location.hash=s.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,i.current=!0,p();return}if(o.current){const p=o.current;o.current=null,i.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{i.current=!0,p()}}},pd={thumbnail:"thumbnail",preview:"preview"},Wb=()=>{const e=je(),{state:t}=Wt(),[r]=Gt(),n=r.get("gid"),{groupTitle:o,setGroupTitle:i,thisGroupReels:s,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:g,handleSave:v}=Hb(n),{allReels:f,setAllReels:x,searchTerm:_,setSearchTerm:b,isSearching:w,lastStoryElementRef:S}=Hi(n),[C,N]=y.useState(""),[k,E]=y.useState(!0),[T,R]=y.useState(pd.thumbnail),{showLeaveModal:I,requestLeave:A,confirmLeave:L,cancelLeave:M,allowNextNavigation:$}=Vb(m),O=async(P,G)=>{try{N(P.story_uuid);const X=G==="add"?[P,...s]:s.filter(Z=>Z.story_uuid!==P.story_uuid);l(X),x(G==="add"?Z=>Z.filter(pe=>pe.story_uuid!==P.story_uuid):Z=>[...Z,P]),g(!0)}catch(X){X instanceof Error?q.error(X.message):q.error("Something went wrong. Please try again later!")}finally{N("")}};y.useEffect(()=>{if(!u&&t){const P=f.findIndex(G=>G.id==t.storyId);if(P!==-1){const G=f[P];x(X=>X.filter(Z=>Z.id!=G.id)),l(X=>[G,...X]),g(!0)}}},[t,f,u,x,l,g]);const U=async()=>{const P=await v();P?.isNewGroup&&$(()=>{e(`?view=${K.mg}&gid=${P.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(uv,{value:{requestLeave:A},children:[a.jsx(St,{left:[a.jsx(jt,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(Jt,{cb:()=>A(()=>e(`?view=${K.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Vi,{placeholder:"Enter group title",title:o,setTitle:i,setIsEdited:g,style:{paddingInline:"32px"}}),o&&a.jsxs(Tl,{children:[a.jsx(Al,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(M0,{})}),a.jsxs(Pl,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Ol,{children:a.jsx(Rl,{children:"Customize title appearance"})}),a.jsx(lv,{styles:c,setStyles:d,setIsEdited:g})]})]})]},"title")],right:[a.jsx(I0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(ao,{onSave:U,isSaving:p,disabled:!m},"save")]}),a.jsx(Zt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Manage Widget"}],onNavigate:P=>A(()=>e(P))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(gv,{allReels:f,gid:n,handleSelectReel:O,searchTerm:_,setSearchTerm:b,isSearching:w,togglingId:C,lastStoryElementRef:S}),a.jsx(hv,{gid:n,reels:s,styles:c,handleRemoveReel:O,togglingId:C,currentTab:T}),a.jsx(Ub,{isExpanded:k,setIsEdited:g,styles:c,setStyles:d,tabs:pd,setCurrentTab:R,currentTab:T})]}),I&&a.jsx(Or,{onReject:M,onAccept:L,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function Gb(){const[e]=Gt(),t=e.get("view")||K.ag;let r;switch(t){case K.settings:r=a.jsx(T0,{});break;case K.ar:r=a.jsx(vf,{});break;case K.stat:r=a.jsx(O0,{});break;case K.cr:r=a.jsx(_0,{});break;case K.mg:r=a.jsx(Wb,{});break;default:r=a.jsx(N0,{})}return a.jsxs("div",{children:[r,a.jsx(Mu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const md=async(e,t,r,n={})=>{try{if(await ue.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},qb=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),Kb=()=>{const e=y.useContext(oa),{stories:t,styles:r,groupId:n,isPlaying:o,setIsPlaying:i,setStoryViews:s}=e,[l,c]=y.useState(null),[d,u]=y.useState(!0),[p,m]=y.useState(0),[g,v]=y.useState(!1),f=y.useRef(!0),x=t.length-1,[_,b]=y.useState({index:0,story_uuid:t[0]?.story_uuid}),w=A=>!!A?.files?.[0]?.mime_type?.startsWith("video"),S=y.useCallback((A,L=1)=>{if(t.length===0)return null;let M=A;for(let $=0;$<t.length;$+=1){const O=t[M];if(w(O))return{story:O,index:M};M=(M+L+t.length)%t.length}return null},[t]),C=y.useCallback(()=>{const A=o,L=t.findIndex(O=>String(O.story_uuid)===A),M=L>=0?t[L]:null,$=w(M)?{story:M,index:L}:S(Math.max(L,0),1);$?.story?(c($.story),L!==$.index&&$.story.story_uuid!==o&&i($.story.story_uuid)):c(null),u(!1)},[o,t,i,S]);y.useEffect(()=>{C()},[o,t,C]),y.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const N=(A=1)=>{u(!0);const L=t.findIndex(P=>String(P.story_uuid)===String(o)),M=A>0?1:-1,$=A>0?x>L?L+1:0:L>0?L-1:x,O=S($,M);if(!O?.story){u(!1);return}const U=O.story;if(U.story_uuid===o){u(!1),i(null);return}b({index:0,story_uuid:U.story_uuid}),n&&md(n,U.id,s,{isActive:()=>f.current}),i(U.story_uuid),u(!1)},k=()=>{const A=l?.files??[];_?.index>0?b(L=>({index:L.index-1,story_uuid:A[L.index-1].story_uuid})):N(-1)},E=()=>{const A=l?.files??[];_?.index+1<A.length?b(L=>({index:L.index+1,story_uuid:A[L.index+1].story_uuid})):(N(),A[0]?.story_uuid&&b({index:0,story_uuid:A[0].story_uuid}))},T=A=>{A.target===A.currentTarget&&i(null)},R=r?.playerAppearance??"overlay",I=l?.links&&l.links.length>0?l.links[0]:null;return a.jsx("div",{onClick:T,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:l&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(yt,{onClick:k,className:"ecr-player__nav--left",children:a.jsx(Kt,{size:24})}),a.jsx(yt,{onClick:E,className:"ecr-player__nav--right",children:a.jsx(Yt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[l&&a.jsx(Ya,{playingStory:l,duration:p,currentFileIndex:_,isPaused:g},`${l.story_uuid}-${_.index}`),a.jsx("div",{onClick:()=>i(null),className:"ecr-player__close",children:a.jsx(Xt,{className:"ecr-player__close-icon"})}),d?a.jsx(qb,{}):l?.files.length>0&&a.jsx(Qa,{currentFileIndex:_,files:l?.files,setDuration:m,setIsPlaying:i,isPaused:g,setIsPaused:v,handlePrevFile:k,handleNextFile:E,storyId:l.id,storyTitle:l?.title}),R==="overlay"&&I?a.jsx(jn,{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"},link:I}):null,R==="title"?a.jsx(dc,{title:l.title}):null]})]})})},fd=({story:e,styles:t,handlePlaying:r,template:n,storyViews:o,setStoryViews:i})=>{const s=e.links&&e.links.length>0?e.links[0]:null,l=t.appearance??"overlay";return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,style:{width:n==="carousel"?`${t?.size}px`:"auto"},children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(qn,{story:e,styles:t,storyViews:o,setStoryViews:i}),l==="overlay"&&t.shape==="rectangle"&&s&&a.jsx(jn,{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"95%",borderRadius:"6px"},link:s})]}),l==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-reel__title",children:e.title}):null]})},Yb=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:i,thumbsWrapperRef:s,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=lc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:i,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:s,style:{gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(fd,{story:m,styles:t,handlePlaying:r,template:"carousel",storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Kt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Yt,{size:20,style:{width:"20px",height:"20px"}})})]})},hd=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`,gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:"ecr-front-grid__list",children:e?.map(i=>i?.files[0]?.mime_type.startsWith("video")?a.jsx(fd,{story:i,styles:t,handlePlaying:r,template:"grid",storyViews:n,setStoryViews:o},i.story_uuid):null)})}),Xb={carousel:Yb,grid:hd},Jb=()=>{const e=y.useContext(oa),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:i,storyViews:s,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=Xb[d]||hd,p=({sid:m,story_uuid:g})=>{i(g),o&&md(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:s,setStoryViews:l})]})},Zb=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[i,s]=y.useState(et),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),s(et),c(!1),u(null);return}const g=new AbortController;c(!0),u(null);try{const v=await ue.get(`stories/${m}`,{signal:g.signal});if(g.signal.aborted)return;r(v.data.group_name),o(v.data.stories),s(v.data.styles||et)}catch(v){if(g.signal.aborted)return;u(v)}finally{c(!1)}return()=>{g.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:i,isLoading:l,error:d}},oa=y.createContext(void 0),gd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:i,stories:s,styles:l}=Zb(e);return a.jsxs(oa.Provider,{value:{groupTitle:i,groupId:e,stories:s,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(Kb,{}),a.jsx(Jb,{})]})};la(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Pn.createRoot(e).render(a.jsx(Wd,{children:a.jsx(Gb,{})}))}),la(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Pn.createRoot(n).render(a.jsx(gd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Pn.createRoot(n).render(a.jsx(gd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
     347For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},i0="DialogDescriptionWarning",l0=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ll(i0).contentName}}.`;return g.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},c0=yl,d0=jl,u0=Cl,p0=kl,m0=Nl,f0=Tl,Il=Ol;function Uo({...e}){return a.jsx(c0,{"data-slot":"dialog",...e})}function Ho({...e}){return a.jsx(d0,{"data-slot":"dialog-trigger",...e})}function h0({...e}){const t=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(u0,{"data-slot":"dialog-portal",container:t,...e})}function g0({className:e,...t}){return a.jsx(p0,{"data-slot":"dialog-overlay",className:D("ecr-dialog__overlay",e),...t})}function Vo({className:e,children:t,...r}){return a.jsxs(h0,{children:[a.jsx(g0,{}),a.jsxs(m0,{"data-slot":"dialog-content",className:D("ecr-dialog__content",e),...r,children:[t,a.jsx(Il,{className:"ecr-dialog__close","aria-label":"Close dialog",children:a.jsx(qf,{className:"ecr-dialog__close-icon"})})]})]})}function Wo({className:e,...t}){return a.jsx("div",{className:D("ecr-dialog__header",e),...t})}function qo({className:e,...t}){return a.jsx(f0,{"data-slot":"dialog-title",className:D("ecr-dialog__title",e),...t})}function x0({...e}){return a.jsx(Il,{"data-slot":"dialog-close",...e})}const b0=(e={})=>{const{enabled:t=!0}=e,r=typeof ecommreelsInfo<"u"?ecommreelsInfo?.url:"",n=typeof ecommreelsInfo<"u"?ecommreelsInfo?.nonce:"",[o,s]=y.useState([]),[i,l]=y.useState(1),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,h]=y.useState(!1),[b,f]=y.useState(""),x=io(b,500),_=y.useRef(!0),v=y.useRef(0),w=y.useRef(null),[j,C]=y.useState(null),N=y.useCallback(async T=>{if(!r||!n){C("Missing API configuration."),h(!1),p(!1);return}const O=++v.current;w.current&&w.current.abort();const L=new AbortController;w.current=L,T===1&&_.current?h(!0):p(!0);try{const A={page:T,per_page:50};x&&(A.search=x);const I=await ee.get(`${r}wc/v3/products`,{headers:{"X-WP-Nonce":n},withCredentials:!0,params:A,signal:L.signal}),z=I.data,$=parseInt(I.headers["x-wp-totalpages"]||"1",10);O===v.current&&(s(R=>T===1?z:[...R,...z]),l(T+1),d(T<$))}catch(A){if(L.signal.aborted)return;A instanceof Error?C(A.message):C("An unknown error occurred")}finally{_.current&&(_.current=!1),O===v.current&&!L.signal.aborted&&(p(!1),h(!1))}},[x,n,r]);y.useEffect(()=>{t&&(l(1),s([]),C(null),_.current=!0,N(1))},[x,N,t]);const k=y.useRef(null),E=y.useCallback(T=>{u||(k.current&&k.current.disconnect(),k.current=new IntersectionObserver(O=>{O[0].isIntersecting&&c&&N(i)}),T&&k.current.observe(T))},[u,c,i,N]);return y.useEffect(()=>()=>{k.current&&k.current.disconnect(),w.current&&w.current.abort()},[]),{products:o,setProducts:s,searchTerm:b,setSearchTerm:f,isSearching:u,isLoading:m,error:j,lastProductElementRef:E}},yn="data:image/webp;base64,UklGRrYCAABXRUJQVlA4IKoCAAAQDgCdASpkAEMAAAAAJaQDTXX09L/D3HZzPbW8/T59Tq2V1f9x4QZUkPFMe8XfzV/1/cA/U3/e+qB5s3stfrGmnzI3LSXH12rz2O2VKFiQhcbIwmUHTRPSh2VO/qyrsEp8zYYljZlwfgijGvud/SarxFjfxEew4IAAAP7/ti48OT/Oya3x+X1pd0VKczR2pok8Ci8XRszNhGh0y5UiQtxf1xZl/3jvki/LfqRs3vrkqKO+RR3ax2yhGPzf/uMJqz6MmyKZ75prVit6Eu2kyiVhUvihA/zLTt4PvMG3YOlFXZJRTk9Zz1SB9/gGf8x4hu9/9Fz/JZ63KGECMtEG58t43wKZFRr2piHRIZQT76htB+3yWUaqjW/9r5PNawz37RxBI1wHwj1o4cbmVBENdq85+fOSQapp04WZhajKbzXhRwSwcxZI01XL2O35Gs53AKgwVjlqhKBXmU5RK0/N1qmQ8h7bn4+Dgm4fguH/nDOEx63rpdXh50ZJgbckzvlWp65XCscQ+Z90pb/bzQAYUI5YPYyk20I93Q8IjMbbafY+FumPz2rofTi71XKY3kDqTc0uBkqjYSUfFMUKxgw1NrzD+Wbnnu2IM+Qd4VS0LEDgJPgKfQ7ibiPABUBtu3G+7MUdxJwAkJmmQoJaL1guZuZ05cbqVsGknyIqlaio4CV14KH5qn4pmkuDfSxtqzn9mhCN+TzF0t4TaR8ogb3/yo30guRPtF+g5KYFVA2UDcRWPUEzW14M0OZ3fHminXd6FGdr5AvpJFRrKwXRhN3HGAgFUI0Kz+1aaiktbCubMvxjbQen+JdPvxDhRzgIgdUC5WTRnTMOZEM6XsqjihAbcx04mA92SCnBZNJtBpRioadBJLj6D4Dd/wEDbmI9KaZM56h8czAAAAAAAAAA",zl=({name:e,handleClick:t})=>a.jsx("button",{onClick:t,className:D("ecr-button ecr-button--sm",e==="add"?"ecr-button--primary":"ecr-button--danger"),children:e}),v0=({handleLinks:e,taggedProducts:t,products:r,isSearching:n,isLoading:o,lastProductElementRef:s,searchTerm:i,setSearchTerm:l,error:c})=>{const[d,u]=y.useState(t.map(f=>f.product_id)),[p,m]=y.useState(!1),h=f=>{m(!1),u(x=>x.includes(f.id)?x.filter(_=>_!==f.id):[f.id])},b=f=>{if(f.preventDefault(),d.length===0){m(!0);return}const x=new Set(d),_=[];for(const v of r)x.has(v.id)&&_.push({btn_type:"product",btn_uuid:uo(),buttonText:v.name,buttonUrl:v.permalink,rating:v.average_rating,price:v.price_html,thumbnail:v.images?.[0]?.thumbnail||v.images?.[0]?.src||yn,product_id:v.id});e(_),u([])};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"ecr-admin-product-link__search",children:a.jsx("input",{type:"text",placeholder:"Search products...",value:i,onChange:f=>l(f.target.value),className:"ecr-admin-product-link__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-product-link__list",children:o&&r.length===0?a.jsx(Ml,{}):a.jsxs("div",{className:"ecr-admin-product-link__list-inner",children:[r.length===0?a.jsx("p",{className:"ecr-admin-product-link__empty",children:c||"No products are available to add."}):r.map((f,x)=>{const _=d.includes(f.id);return a.jsx("div",{ref:r.length===x+1?s:null,className:"ecr-admin-product-link__item",style:d.length>0&&!_?{opacity:.5,pointerEvents:"none"}:{},children:a.jsxs(re,{type:"button",onClick:()=>h(f),className:D("ecr-admin-product-link__button",_?"ecr-admin-product-link__button--selected":"ecr-admin-product-link__button--unselected"),children:[_?a.jsx(Uf,{size:20,color:"#2563eb"}):a.jsx(Hf,{size:20,color:"#8c95a9"}),a.jsx("img",{className:"ecr-admin-product-link__thumb",src:f.images?.[0]?.thumbnail||f.images?.[0]?.src||yn,alt:"Product thumbnail"}),a.jsx("span",{children:f.name||`Product #${f.id}`})]})},f.id)}),n&&r.length>0&&a.jsx(Ml,{})]})}),a.jsxs("div",{className:"ecr-admin-product-link__footer",children:[p&&a.jsx("p",{className:"ecr-admin-product-link__error",children:"You did not select any product!"}),a.jsx("div",{className:"ecr-admin-product-link__actions",children:a.jsx(zl,{name:"add",handleClick:b})})]})]})},Ml=()=>a.jsx("div",{className:"ecr-admin-product-link__loader",children:a.jsx("div",{className:"ecr-admin-product-link__spinner"})}),_0=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i,y0=({handleLinks:e})=>{const[t,r]=y.useState(""),[n,o]=y.useState(""),[s,i]=y.useState(""),[l,c]=y.useState(!0),[d,u]=y.useState(""),[p,m]=y.useState([]),h=()=>{const b=[];t||b.push("text"),n&&_0.test(n)||b.push("url"),s||b.push("campaign"),m(b),!(b.length>0)&&e({btn_type:"custom",btn_uuid:uo(),buttonText:t,buttonUrl:n,openInNewTab:l,campaignName:s,customClass:d,clickCount:0})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx(wn,{error:p.includes("text"),type:"text",name:"buttonText",label:"Button Text",placeholder:"e.g Buy Now",value:t,setValue:r}),p.includes("text")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Button text is required!"})]}),a.jsxs("div",{children:[a.jsx(wn,{error:p.includes("url"),type:"url",name:"url",label:"Url",placeholder:"e.g https://example.com",value:n,setValue:o}),p.includes("url")&&a.jsx("p",{className:"ecr-admin-link__error",children:"A valid url is required!"})]}),a.jsxs("div",{children:[a.jsx(wn,{error:p.includes("campaign"),type:"text",name:"campaignName",label:"Campaign Name",placeholder:"e.g Summer sale",value:s,setValue:i}),p.includes("campaign")&&a.jsx("p",{className:"ecr-admin-link__error",children:"Campaign name is required!"})]}),a.jsxs("div",{className:"ecr-admin-link__toggle",children:[a.jsx("input",{checked:l,onChange:b=>c(b.target.checked),className:"ecr-admin-link__checkbox",type:"checkbox",name:"",id:"newTab"}),a.jsx("label",{className:"ecr-admin-link__toggle-label",htmlFor:"newTab",children:"Open in new tab"})]}),a.jsx("div",{children:a.jsx(wn,{error:p.includes("customClass"),type:"text",name:"customClass",label:"Custom class",placeholder:"custom-class",value:d,setValue:u})}),a.jsx("div",{className:"ecr-admin-link__actions",children:a.jsx(zl,{name:"add",handleClick:h})})]})};function wn({error:e,type:t,name:r,label:n,placeholder:o,value:s,setValue:i}){return a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"ecr-admin-link__label",htmlFor:r,children:n}),a.jsx("input",{id:r,name:r,type:t,placeholder:o,value:s,onChange:l=>i(l.target.value),className:D("ecr-admin-link__input",e?"ecr-admin-link__input--error":"ecr-admin-link__input--normal")})]})}const w0=({setLinks:e,linkCount:t,linkType:r,links:n})=>{const[o,s]=y.useState(null),[i,l]=y.useState(!1),c=b0({enabled:i}),d=t===0||r==="Link",u=t===0||r==="Product",p=n.filter(h=>h.btn_type==="product"),m=()=>l(!0);return a.jsxs(a.Fragment,{children:[t?a.jsx(bn,{}):null,a.jsx("div",{className:"ecr-admin-link-tabs",children:a.jsxs("div",{className:"ecr-admin-link-tabs__list",children:[d&&a.jsxs(Uo,{open:o==="custom",onOpenChange:h=>s(h?"custom":null),children:[a.jsxs(Ho,{className:"ecr-admin-link-tabs__trigger",children:[a.jsx(Ff,{size:20})," Add Custom Link"]}),a.jsxs(Vo,{className:"ecr-admin-link-dialog",children:[a.jsx(Wo,{children:a.jsx(qo,{children:"Add Custom Link"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(y0,{handleLinks:h=>{e(b=>[...b,h]),s(null)}})})]})]}),u&&a.jsxs(Uo,{open:o==="product",onOpenChange:h=>s(h?"product":null),children:[a.jsxs(Ho,{className:"ecr-admin-link-tabs__trigger",onMouseEnter:m,children:[a.jsx(Vf,{size:20})," Tag Products"]}),a.jsxs(Vo,{className:"ecr-admin-link-dialog",children:[a.jsx(Wo,{children:a.jsx(qo,{children:"Select Products"})}),a.jsx("div",{className:"ecr-admin-link-tabs__content",children:a.jsx(v0,{handleLinks:h=>{e(h),s(null)},taggedProducts:p,products:c.products,isSearching:c.isSearching,isLoading:c.isLoading,lastProductElementRef:c.lastProductElementRef,searchTerm:c.searchTerm,setSearchTerm:c.setSearchTerm,error:c.error})})]})]})]})})]})},j0=({links:e,onLinksChange:t})=>{const r=o=>{t(s=>s.filter(i=>i.btn_uuid!==o))},n=e[0]?.btn_type==="product"?"Product":"Link";return a.jsxs("div",{className:"ecr-admin-links",children:[a.jsx("p",{className:"ecr-admin-links__title",children:`${n}${e.length>1?"s":""}`}),e.length>0?a.jsxs(a.Fragment,{children:[e.map(o=>a.jsxs("div",{className:`ecr-admin-links__item ${o.btn_type==="custom"?o.customClass??"":""}`,children:[a.jsx("span",{children:o.buttonText}),a.jsx(re,{onClick:()=>r(o.btn_uuid),size:"icon-sm",variant:"link",className:"ecr-admin-links__remove",children:a.jsx(Wf,{size:16})})]},o.btn_uuid)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-links__upgrade",children:["+ Add Another ",a.jsx(qt,{size:20})]}),a.jsx(It,{className:"ecr-admin-links__popover",children:a.jsx(ir,{name:"Multiple Links",text:a.jsx(a.Fragment,{children:"Unlock the ability to add multiple custom links, seamlessly redirecting users to your pages from the videos!"})})})]})]}):a.jsx(w0,{setLinks:t,linkCount:e.length,linkType:n,links:e})]})};function Dl(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const S0=({togglePlayPause:e,isMuted:t,file:r,videoRef:n,onEnded:o})=>{const[s,i]=y.useState(!1);return a.jsx("video",{ref:n,className:D("ecr-admin-reelvideo",s?"ecr-admin-reelvideo--portrait":"ecr-admin-reelvideo--landscape"),src:r?.url,muted:t,onClick:e,autoPlay:!0,draggable:!1,onEnded:o,onLoadedMetadata:l=>{const c=l.currentTarget,d=c.videoWidth,u=c.videoHeight;i(()=>u>d)}})},C0=({index:e,setIsAttemptingDelete:t,file:r,file_uuid:n,dragStart:o,dragEnter:s,dragEnd:i})=>{const[l,c]=y.useState(!0),[d,u]=y.useState(!1),p=y.useRef(null),m=()=>{p.current&&(d?p.current.play():p.current.pause(),u(b=>!b))},h=()=>{p.current&&(p.current.muted=!l,c(b=>!b))};return a.jsxs("div",{draggable:!0,onDragStart:()=>o(e),onDragEnter:()=>s(e),onDragEnd:i,className:D("ecr-admin-customization__panel"),children:[a.jsx(Dl,{className:"ecr-admin-customization__remove",size:20,onClick:()=>t(n)}),a.jsx(S0,{togglePlayPause:m,isMuted:l,file:r,videoRef:p,onEnded:()=>u(!0)}),a.jsxs("div",{className:"ecr-admin-customization__controls",children:[d?a.jsx(qn,{size:16,className:"ecr-admin-customization__control",onClick:m}):a.jsx(Vn,{size:16,className:"ecr-admin-customization__control",onClick:m}),l?a.jsx(Wn,{size:16,className:"ecr-admin-customization__control",onClick:h}):a.jsx(Gn,{size:16,className:"ecr-admin-customization__control",onClick:h})]})]})},k0=({uploadedFiles:e,setIsAttemptingDelete:t,setUploadedFiles:r})=>{const n=y.useRef(null),o=y.useRef(null),s=c=>{n.current=c},i=c=>{o.current=c},l=()=>{if(n.current===null||o.current===null)return;const c=[...e],d=c[n.current];c.splice(n.current,1),c.splice(o.current,0,d),n.current=null,o.current=null,r(c)};return a.jsxs("div",{className:"ecr-admin-customization",children:[e.map((c,d)=>a.jsx(C0,{setIsAttemptingDelete:t,file:c,file_uuid:c.file_uuid,index:d,dragStart:s,dragEnter:i,dragEnd:l},d)),a.jsxs(Rt,{children:[a.jsxs(Lt,{className:"ecr-admin-customization__add",children:[a.jsx("img",{className:"ecr-admin-customization__icon",src:Qs,alt:"Upload"}),a.jsx("span",{className:"ecr-admin-customization__label",children:"Upload another video"}),a.jsx(qt,{size:20,className:"ecr-admin-customization__lock"})]}),a.jsx(It,{side:"right",className:"ecr-admin-customization__popover",children:a.jsx(ir,{name:"Multiple Videos",text:a.jsxs(a.Fragment,{children:["Unlock the power of ",a.jsx("strong",{children:"Multiple Video"})," uploads, boosting engagement and variety in every Reels!"]})})})]})]})},N0=({thumbnail:e,onThumbnailChange:t})=>a.jsxs("div",{className:"ecr-admin-thumbnail",children:[a.jsx("p",{className:"ecr-admin-thumbnail__title",children:"Thumbnail"}),e?a.jsxs("div",{className:"ecr-admin-thumbnail__preview",children:[a.jsx("img",{src:e,alt:"Thumbnail",className:"ecr-admin-thumbnail__image"}),a.jsx(Dl,{className:"ecr-admin-thumbnail__remove",size:20,onClick:()=>t(null)})]}):a.jsx(ei,{mode:"thumbnail",usedFor:"image",setThumbnail:t,className:"ecr-admin-thumbnail__uploader"})]}),E0=()=>{const e=Se(),[t]=Vt(),r=y.useMemo(()=>t.get("sid"),[t]),n=y.useRef(null),[o,s]=y.useState({files:[],title:"",links:[],thumbnail:null}),[i,l]=y.useState(!1),[c,d]=y.useState(null),u=y.useCallback(x=>{s(_=>({..._,title:typeof x=="function"?x(_.title):x}))},[]),p=y.useCallback(x=>{s(_=>({..._,files:typeof x=="function"?x(_.files):x}))},[]),m=y.useCallback(x=>{s(_=>({..._,links:typeof x=="function"?x(_.links):x}))},[]),h=y.useCallback(x=>{s(_=>({..._,thumbnail:typeof x=="function"?x(_.thumbnail):x}))},[]),b=()=>{c&&(p(x=>x.filter(_=>_.file_uuid!==c)),d(null))},f=y.useCallback(async x=>{try{l(!0);const _=await ue.get(`story/${x}`);s({title:_.data.title,files:_.data.files,links:_.data.links,thumbnail:_.data.thumbnail})}catch(_){_ instanceof Error?G.error(_.message):G.error("Something went wrong. Try again later!"),n.current=setTimeout(()=>e(-1),1e3)}finally{l(!1)}},[e]);return y.useEffect(()=>{r&&f(r)},[r,f]),y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),i?a.jsx(Lr,{}):a.jsxs(a.Fragment,{children:[a.jsx(Cf,{uploadedFiles:o.files,links:o.links,thumbnail:o.thumbnail,storyTitle:o.title,setStoryTitle:u}),a.jsxs("div",{className:"ecr-admin-create",children:[a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--main",children:[a.jsx("p",{className:"ecr-admin-create__title",children:"Select video"}),c&&a.jsx(Or,{onReject:()=>d(null),onAccept:b,isLoading:!1,message:"Are you sure, You want to remove this file?"}),o.files.length>0?a.jsx(k0,{uploadedFiles:o.files,setUploadedFiles:p,setIsAttemptingDelete:d}):a.jsx(ei,{setUploadedFiles:p})]}),a.jsxs("div",{className:"ecr-admin-create__panel ecr-admin-create__panel--side",children:[a.jsx(N0,{thumbnail:o.thumbnail,onThumbnailChange:h}),a.jsx(bn,{className:"ecr-admin-create__separator"}),a.jsx(j0,{links:o.links,onLinksChange:m})]})]})]})},Fl=({message:e="Something went wrong. Please try again."})=>a.jsxs("div",{className:"ecr-admin-error",children:[a.jsx(Hp,{className:"ecr-admin-error__icon"}),a.jsx("p",{className:"ecr-admin-error__text",children:e})]});var Go,$l;function T0(){return $l||($l=1,Go=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(o){e.addRange(o)}),t&&t.focus()}}),Go}var Ko,Bl;function A0(){if(Bl)return Ko;Bl=1;var e=T0(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(s){var i=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,i)}function o(s,i){var l,c,d,u,p,m,h=!1;i||(i={}),l=i.debug||!1;try{d=e(),u=document.createRange(),p=document.getSelection(),m=document.createElement("span"),m.textContent=s,m.ariaHidden="true",m.style.all="unset",m.style.position="fixed",m.style.top=0,m.style.clip="rect(0, 0, 0, 0)",m.style.whiteSpace="pre",m.style.webkitUserSelect="text",m.style.MozUserSelect="text",m.style.msUserSelect="text",m.style.userSelect="text",m.addEventListener("copy",function(f){if(f.stopPropagation(),i.format)if(f.preventDefault(),typeof f.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=t[i.format]||t.default;window.clipboardData.setData(x,s)}else f.clipboardData.clearData(),f.clipboardData.setData(i.format,s);i.onCopy&&(f.preventDefault(),i.onCopy(f.clipboardData))}),document.body.appendChild(m),u.selectNodeContents(m),p.addRange(u);var b=document.execCommand("copy");if(!b)throw new Error("copy command was unsuccessful");h=!0}catch(f){l&&console.error("unable to copy using execCommand: ",f),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(i.format||"text",s),i.onCopy&&i.onCopy(window.clipboardData),h=!0}catch(x){l&&console.error("unable to copy using clipboardData: ",x),l&&console.error("falling back to prompt"),c=n("message"in i?i.message:r),window.prompt(c,s)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(u):p.removeAllRanges()),m&&document.body.removeChild(m),d()}return h}return Ko=o,Ko}var P0=A0();const Ul=jd(P0);function Hl({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"ecr-table__container",children:a.jsx("table",{"data-slot":"table",className:D("ecr-table",e),...t})})}function Vl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:D("ecr-table__header",e),...t})}function Wl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:D("ecr-table__body",e),...t})}function jn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:D("ecr-table__row",e),...t})}function ql({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:D("ecr-table__head",e),...t})}function Re({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:D("ecr-table__cell",e),...t})}function Gl({className:e,...t}){return a.jsx("caption",{"data-slot":"table-caption",className:D("ecr-table__caption",e),...t})}const O0=[{label:"No.",width:80,align:"center"},{label:"Group Name",width:250,align:"start"},{label:"Short Code",align:"start"},{label:"Action",width:150,align:"center"}],R0=({tableData:e,setIsAttemptingDelete:t})=>{const[r,n]=y.useState(null),o=y.useRef(null),s=(i,l)=>{Ul(i),n(l),o.current=setTimeout(()=>{n(null)},700)};return y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),a.jsxs(Hl,{className:"ecr-admin-groups__table",children:[!e.length&&a.jsx(Gl,{className:"ecr-admin-groups__caption",children:a.jsxs("div",{className:"ecr-admin-groups__empty",children:[a.jsx(nt,{className:"ecr-admin-groups__empty-icon"}),"You did not create any reel group yet!"]})}),e.length?a.jsxs(a.Fragment,{children:[a.jsx(Vl,{children:a.jsx(jn,{children:O0.map((i,l)=>a.jsx(ql,{className:"ecr-admin-groups__head",style:{width:i?.width||"auto",textAlign:i?.align},children:i.label},l))})}),a.jsx(Wl,{children:e.map((i,l)=>a.jsxs(jn,{className:D("ecr-admin-groups__row",l%2===0&&"ecr-admin-groups__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-groups__cell ecr-admin-groups__cell--center ecr-admin-groups__cell--strong",children:l+1}),a.jsx(Re,{children:a.jsx("div",{className:"ecr-admin-groups__name",children:i.group_name})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__shortcode",children:[a.jsx("span",{className:"ecr-admin-groups__shortcode-text",children:`[reelswp-group id='${i.id}']`}),a.jsxs("div",{className:"ecr-admin-groups__copy",children:[a.jsx("button",{onClick:()=>s(`[reelswp-group id='${i.id}']`,l),className:"ecr-admin-groups__copy-button",title:"Copy",children:a.jsx(tp,{className:"ecr-admin-groups__copy-icon"})}),a.jsx("span",{className:D("ecr-admin-groups__copy-tooltip",r===l&&"ecr-admin-groups__copy-tooltip--visible"),children:"Copied!"})]})]})}),a.jsx(Re,{children:a.jsxs("div",{className:"ecr-admin-groups__actions",children:[a.jsx(re,{title:"Statistics",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.stat}&group=${i.id}&name=${i.group_name}`,children:a.jsx(ls,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Update Stories",variant:"link",size:"icon-sm",asChild:!0,className:"ecr-admin-groups__action-button",children:a.jsx(ht,{to:`?view=${K.mg}&gid=${i.id}`,children:a.jsx(Pr,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--neutral"})})}),a.jsx(re,{title:"Delete Group",onClick:()=>t(i.id),variant:"link",size:"icon-sm",className:"ecr-admin-groups__action-button",children:a.jsx(Up,{className:"ecr-admin-groups__icon ecr-admin-groups__icon--danger"})})]})})]},i.id??l))})]}):null]})},Kl=()=>a.jsxs("table",{className:"ecr-admin-groups__skeleton-table",children:[a.jsx("thead",{className:"ecr-admin-groups__skeleton-head",children:a.jsxs("tr",{children:[a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--tiny"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--medium"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--large"})}),a.jsx("th",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-block ecr-admin-groups__skeleton-block--small"})})]})}),a.jsx("tbody",{children:Array.from({length:5}).map((e,t)=>a.jsxs("tr",{className:t%2===0?"ecr-admin-groups__skeleton-row ecr-admin-groups__skeleton-row--alt":"ecr-admin-groups__skeleton-row",children:[a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--tiny"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--medium"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--large"})}),a.jsx("td",{className:"ecr-admin-groups__skeleton-cell ecr-admin-groups__skeleton-cell--center",children:a.jsx("div",{className:"ecr-admin-groups__skeleton-line ecr-admin-groups__skeleton-line--small"})})]},t))})]}),L0=()=>{const[e,t]=y.useState([]),[r,n]=y.useState(""),[o,s]=y.useState(!1),[i,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(""),[m,h]=y.useState(1),[b]=y.useState(20),[f,x]=y.useState(0),[_,v]=y.useState(1),w=io(u,500),j=y.useCallback(async E=>{const T=new AbortController,O=E===1;try{O?s(!0):l(!0),n("");const L=await ue.get("groups",{params:{page:E,per_page:b,...w&&{q:w}},signal:T.signal}),A=Number(L.headers?.["x-wp-total"]??0),I=Number(L.headers?.["x-wp-totalpages"]??1),z=Math.max(1,I||1);t($=>{if(O)return L.data;const R=new Set($.map(P=>P.id)),U=L.data.filter(P=>!R.has(P.id));return[...$,...U]}),x(A),v(z),E>z&&h(z)}catch(L){if(T.signal.aborted)return;L instanceof Error?n(L.message):n("Something went wrong. Try again later!")}finally{T.signal.aborted||(O?s(!1):l(!1))}},[b,w]),C=y.useCallback(()=>{h(E=>o||i||E>=_?E:E+1)},[o,i,_]),N=y.useCallback(async()=>{if(m!==1){h(1);return}await j(1)},[m,j]),k=y.useCallback(async E=>{try{d(!0),await ue.delete(`group/${E}`),await N(),G.success("Group deleted successfully!")}catch(T){T instanceof Error?G.error(T.message):G.error("Failed to delete group.")}finally{d(!1)}},[N]);return y.useEffect(()=>{j(m)},[m,j,w]),{groups:e,groupError:r,isLoading:o,isLoadingMore:i,isDeleting:c,searchTerm:u,setSearchTerm:p,perPage:b,total:f,totalPages:_,hasMore:m<=_,loadMore:C,refreshGroups:N,deleteGroup:k}},I0=()=>{const[e,t]=y.useState(null),{groups:r,groupError:n,isLoading:o,isLoadingMore:s,isDeleting:i,deleteGroup:l,hasMore:c,loadMore:d,searchTerm:u,setSearchTerm:p}=L0(),m=y.useRef(null),h=async()=>{e&&(await l(e),t(null))};return y.useEffect(()=>{if(!m.current||!c)return;const b=new IntersectionObserver(f=>{const[x]=f;x.isIntersecting&&d()},{root:null,rootMargin:"200px",threshold:0});return b.observe(m.current),()=>b.disconnect()},[c,d]),a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:"All Widgets",Icon:Vp},"page")],center:[a.jsx(Ir,{},"reel-wp")],right:[a.jsx(Rr,{to:`?view=${K.cr}`,text:"Add Reel",Icon:gt},"add-reel-reel-group")]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-groups",children:[e&&a.jsx(Or,{onAccept:h,onReject:()=>t(null),isLoading:i}),a.jsxs("div",{className:"ecr-admin-groups__header",children:[a.jsx("h2",{className:"ecr-admin-groups__title",children:"Reel Widgets"}),a.jsxs("div",{className:"ecr-admin-groups_action_wrapper",children:[a.jsxs("div",{className:"ecr-admin-groups-header__search",children:[a.jsx("input",{type:"text",placeholder:"Search widgets...",value:u,onChange:b=>p(b.target.value),className:"ecr-admin-groups-search-input"}),a.jsxs("div",{className:"ecr-admin-groups-header__icon-wrapper",children:[u&&a.jsx(re,{onClick:()=>p(""),variant:"link",size:"icon-sm",children:a.jsx(Yt,{size:16,className:"ecr-admin-groups-header__clear-icon"})}),a.jsx(es,{size:16,className:"ecr-admin-groups-header__search-icon"})]})]}),a.jsx(Rr,{to:`?view=${K.mg}`,text:"Create Widget",Icon:gt,className:"ecr-admin-groups__create-button",textColor:"#2563eb"})]})]}),o?a.jsx(Kl,{}):n?a.jsx(Fl,{}):a.jsxs(a.Fragment,{children:[a.jsx(R0,{tableData:r,setIsAttemptingDelete:t}),c&&a.jsx("div",{ref:m,className:"ecr-admin-groups__load-more","aria-live":"polite",children:s?a.jsx($f,{className:"ecr-admin-groups__load-more__icon"}):null})]})]})]})},z0=()=>{const[e,t]=y.useState(!1),[r,n]=y.useState({rateLimit:2,timeLimit:1}),[o,s]=y.useState(!1),[i,l]=y.useState(!1),[c,d]=y.useState(!1),u=y.useCallback((m,h)=>{t(!0),n(b=>({...b,[m]:h}))},[]),p=y.useCallback(async()=>{const m=Number(r.rateLimit),h=Number(r.timeLimit);if(!Number.isFinite(m)||!Number.isFinite(h)){G.error("Please enter valid numbers.");return}try{l(!0),d(!1),await ue.post("settings",{rate_limit:m,time_limit:h}),G.success("Settings updated successfully."),t(!1)}catch(b){b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{l(!1)}},[r.rateLimit,r.timeLimit]);return y.useEffect(()=>{const m=new AbortController;return(async()=>{try{s(!0),d(!1);const b=await ue.get("settings",{signal:m.signal});n({rateLimit:b.data.rate_limit,timeLimit:b.data.time_limit}),t(!1)}catch(b){if(m.signal.aborted)return;b instanceof Error?G.error(b.message):G.error("Something went wrong. Try again later!"),d(!0)}finally{m.signal.aborted||s(!1)}})(),()=>m.abort()},[]),{limit:r,isEdited:e,isLoading:o,isSaving:i,isError:c,handleOnChange:u,handleSave:p}},M0=()=>{const{limit:e,isEdited:t,isLoading:r,isSaving:n,isError:o,handleOnChange:s,handleSave:i}=z0();return a.jsxs(a.Fragment,{children:[r&&a.jsx(Lr,{}),a.jsx(vt,{left:[a.jsx(_t,{name:"Settings",Icon:xp},"Settings"),a.jsx(Xt,{},"back-settings")],center:[a.jsx(Ir,{},"Settings-widget-name")],right:[a.jsx(lo,{onSave:i,isSaving:n,disabled:!t},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Settings"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-card--settings",children:[a.jsx("div",{className:"ecr-admin-card__header",children:a.jsx("h2",{className:"ecr-admin-card__title",children:"ReelsWP Settings"})}),o&&a.jsx("div",{className:"ecr-admin-form__row",children:a.jsx("span",{children:"Unable to load settings. Please try again."})}),a.jsxs("form",{action:"",className:"ecr-admin-form",children:[a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_rate_limit",className:"ecr-admin-form__label",children:"Rate Limit:"}),a.jsx("input",{type:"number",id:"ecommreels_rate_limit",name:"ecommreels_rate_limit",value:e.rateLimit,onChange:l=>s("rateLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]}),a.jsxs("div",{className:"ecr-admin-form__row",children:[a.jsx("label",{htmlFor:"ecommreels_time_limit",className:"ecr-admin-form__label",children:"Time Limit (minutes):"}),a.jsx("input",{type:"number",id:"ecommreels_time_limit",name:"ecommreels_time_limit",value:e.timeLimit,onChange:l=>s("timeLimit",l.target.value),className:"ecr-admin-form__input",min:"1"})]})]})]})]})},D0=[{label:"No.",width:80,align:"center"},{label:"Story Title",width:150,align:"left"},{label:"Campaign Name",width:150,align:"left"},{label:"Button Text",width:150,align:"left"},{label:"URL",align:"left"},{label:"Click",width:80,align:"center"}],F0=({tableData:e})=>a.jsxs(Hl,{className:"ecr-admin-stats__table",children:[!e.length&&a.jsx(Gl,{className:"ecr-admin-stats__caption",children:a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),"You did not create any reel group yet!"]})}),a.jsx(Vl,{children:a.jsx(jn,{children:D0.map((t,r)=>a.jsx(ql,{className:"ecr-admin-stats__head",style:{...t.width&&{width:`${t.width}px`},textAlign:t.align},children:t.label},r))})}),!!e.length&&a.jsx(Wl,{children:e.map((t,r)=>a.jsxs(jn,{className:D("ecr-admin-stats__row",r%2===0&&"ecr-admin-stats__row--alt"),children:[a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:r+1}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.storyTitle}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.campaignName}),a.jsx(Re,{className:"ecr-admin-stats__cell",children:t.buttonText}),a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--link",children:a.jsx("a",{href:t.buttonUrl,target:"_blank",rel:"noopener noreferrer",className:"ecr-admin-stats__link",children:t.buttonUrl})}),a.jsx(Re,{className:"ecr-admin-stats__cell ecr-admin-stats__cell--center",children:t.clickCount})]},t.id))})]}),$0=()=>{const[e]=Vt(),t=e.get("group"),r=e.get("name"),[n,o]=y.useState([]),[s,i]=y.useState([]),[l,c]=y.useState(!1),[d,u]=y.useState(!1);y.useEffect(()=>{t&&(async()=>{try{c(!0);const h=await ue.get(`/group/${t}/stats`);o(h.data.stories),i(h.data.buttons)}catch(h){h instanceof Error?G.error(h.message):G.error("Something went wrong. Try again later!"),u(!0)}finally{c(!1)}})()},[t]);const p=n.length>0?n.reduce((m,h)=>m+=h.view_count??0,0):0;return a.jsxs(a.Fragment,{children:[a.jsx(vt,{left:[a.jsx(_t,{name:"Statistics",Icon:ls},"Statistics"),a.jsx(Xt,{},"Statistics-back")],center:[a.jsx(Ir,{},"Statistics-widget-name")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Statistics"}]}),a.jsxs("div",{className:"ecr-admin-card ecr-admin-stats",children:[a.jsxs("div",{className:"ecr-admin-stats__header",children:[a.jsxs("h2",{className:"ecr-admin-stats__title",children:["Group: ",r]}),l?a.jsx("div",{className:"ecr-admin-stats__summary-skeleton"}):a.jsxs("div",{className:"ecr-admin-stats__summary",children:[a.jsx("span",{children:"Total View:"})," ",a.jsx("span",{children:p})]})]}),a.jsx("div",{className:"ecr-admin-stats__body",children:l?a.jsx(Kl,{}):d?a.jsx(Fl,{}):s.length===0?a.jsxs("div",{className:"ecr-admin-stats__empty",children:[a.jsx(nt,{className:"ecr-admin-stats__empty-icon"}),a.jsx("span",{children:"No Stats available for this group"})]}):a.jsx(F0,{tableData:s})})]})]})};function B0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 3a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2zm-5-1v12H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm1 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2z"},child:[]}]})(e)}function U0(e){return H({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 4a4 4 0 0 1 0 8H8a5 5 0 0 0 2-4 5 5 0 0 0-2-4zm-6 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8M0 8a5 5 0 0 0 5 5h6a5 5 0 0 0 0-10H5a5 5 0 0 0-5 5"},child:[]}]})(e)}const H0=({isExpanded:e,setIsExpanded:t})=>a.jsx("button",{onClick:()=>t(r=>!r),className:D("ecr-admin-side-toggle",e?"ecr-admin-side-toggle--active":""),title:"Side Panel",children:a.jsx(B0,{size:24})}),V0=({...e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none","fill-rule":"evenodd",children:[a.jsx("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),a.jsx("path",{fill:"currentColor",d:"M16 15c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 1 1 0-2h9.17A3 3 0 0 1 16 15m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2M8 9a3 3 0 0 1 2.762 1.828l.067.172H20a1 1 0 0 1 .117 1.993L20 13h-9.17a3.001 3.001 0 0 1-5.592.172L5.17 13H4a1 1 0 0 1-.117-1.993L4 11h1.17A3 3 0 0 1 8 9m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2m8-8c1.306 0 2.418.835 2.83 2H20a1 1 0 1 1 0 2h-1.17a3.001 3.001 0 0 1-5.66 0H4a1 1 0 0 1 0-2h9.17A3 3 0 0 1 16 3m0 2a1 1 0 1 0 0 2a1 1 0 0 0 0-2"})]})}),Yl=y.forwardRef(({className:e,type:t,...r},n)=>a.jsx(W.input,{ref:n,type:t,"data-slot":"input",className:D("ecr-input",e),...r}));Yl.displayName="Input";const lr=({label:e,min:t,max:r,value:n,onChange:o,name:s,id:i,wrapperStyles:l,hideSlider:c})=>{const[d,u]=y.useState(n),p=y.useRef(null);y.useEffect(()=>{u(n)},[n]);const m=b=>{const f=Math.min(r,Math.max(t,Number(b)));o(f)},h=b=>{const f=Number(b);u(f),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(f>r?r:f<t?t:f)},1e3)};return a.jsxs("div",{style:l,className:"ecr-admin-range",children:[a.jsxs("label",{htmlFor:i,className:"ecr-admin-range__label",children:[e,":"]}),a.jsxs("div",{className:"ecr-admin-range__row",children:[!c&&a.jsx("input",{type:"range",id:i,name:s,min:t,max:r,value:n,onChange:b=>{const f=Number(b.target.value);u(f),m(f)},className:"ecr-admin-range__slider"}),a.jsxs("div",{className:"ecr-admin-range__value",children:[a.jsx(Yl,{type:"number",min:t,max:r,value:d,onChange:b=>h(b.target.value)}),a.jsx("span",{className:"ecr-admin-range__unit",children:"px"})]})]})]})};function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},M.apply(null,arguments)}function De(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var zt=255,Xe=100,cr=e=>{var{r:t,g:r,b:n,a:o}=e,s=Math.max(t,r,n),i=s-Math.min(t,r,n),l=i?s===t?(r-n)/i:s===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(l<0?l+6:l),s:s?i/s*Xe:0,v:s/zt*Xe,a:o}},Xl=e=>{var{h:t,s:r,l:n,a:o}=Jl(e);return"hsla("+t+", "+r+"%, "+n+"%, "+o+")"},Jl=e=>{var{h:t,s:r,v:n,a:o}=e,s=(200-r)*n/Xe;return{h:t,s:s>0&&s<200?r*n/Xe/(s<=Xe?s:200-s)*Xe:0,l:s/2,a:o}},Zl=e=>{var{r:t,g:r,b:n}=e,o=t<<16|r<<8|n;return"#"+(s=>new Array(7-s.length).join("0")+s)(o.toString(16))},W0=e=>{var{r:t,g:r,b:n,a:o}=e,s=typeof o=="number"&&(o*255|256).toString(16).slice(1);return""+Zl({r:t,g:r,b:n})+(s||"")},dr=e=>cr(q0(e)),q0=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[n,o,s=0,i]=e.match(r).map(l=>parseInt(l,16));return{r:n,g:o,b:s,a:(i??255)/zt}},Sn=e=>{var{h:t,s:r,v:n,a:o}=e,s=t/60,i=r/Xe,l=n/Xe,c=Math.floor(s)%6,d=s-Math.floor(s),u=zt*l*(1-i),p=zt*l*(1-i*d),m=zt*l*(1-i*(1-d));l*=zt;var h={};switch(c){case 0:h.r=l,h.g=m,h.b=u;break;case 1:h.r=p,h.g=l,h.b=u;break;case 2:h.r=u,h.g=l,h.b=m;break;case 3:h.r=u,h.g=p,h.b=l;break;case 4:h.r=m,h.g=u,h.b=l;break;case 5:h.r=l,h.g=u,h.b=p;break}return h.r=Math.round(h.r),h.g=Math.round(h.g),h.b=Math.round(h.b),M({},h,{a:o})},G0=e=>{var{r:t,g:r,b:n,a:o}=Sn(e);return"rgba("+t+", "+r+", "+n+", "+o+")"},K0=e=>{var{r:t,g:r,b:n}=e;return{r:t,g:r,b:n}},Y0=e=>{var{h:t,s:r,l:n}=e;return{h:t,s:r,l:n}},Yo=e=>Zl(Sn(e)),X0=e=>{var{h:t,s:r,v:n}=e;return{h:t,s:r,v:n}},J0=e=>{var{r:t,g:r,b:n}=e,o=function(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)},s=o(t/255),i=o(r/255),l=o(n/255),c={};return c.x=s*.4124+i*.3576+l*.1805,c.y=s*.2126+i*.7152+l*.0722,c.bri=s*.0193+i*.1192+l*.9505,c},Mt=e=>{var t,r,n,o,s,i,l,c,d;return typeof e=="string"&&Xo(e)?(i=dr(e),c=e):typeof e!="string"&&(i=e),i&&(n=X0(i),s=Jl(i),o=Sn(i),d=W0(o),c=Yo(i),r=Y0(s),t=K0(o),l=J0(t)),{rgb:t,hsl:r,hsv:n,rgba:o,hsla:s,hsva:i,hex:c,hexa:d,xy:l}},Xo=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function Ql(e){var t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useCallback((r,n)=>t.current&&t.current(r,n),[])}var ur=e=>"touches"in e,ec=e=>{!ur(e)&&e.preventDefault&&e.preventDefault()},tc=function(t,r,n){return r===void 0&&(r=0),n===void 0&&(n=1),t>n?n:t<r?r:t},rc=(e,t)=>{var r=e.getBoundingClientRect(),n=ur(t)?t.touches[0]:t;return{left:tc((n.pageX-(r.left+window.pageXOffset))/r.width),top:tc((n.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:n.pageX-(r.left+window.pageXOffset),y:n.pageY-(r.top+window.pageYOffset)}},Z0=["prefixCls","className","onMove","onDown"],Jo=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:n,onMove:o,onDown:s}=e,i=De(e,Z0),l=y.useRef(null),c=y.useRef(!1),[d,u]=y.useState(!1),p=Ql(o),m=Ql(s),h=v=>c.current&&!ur(v)?!1:(c.current=ur(v),!0),b=y.useCallback(v=>{if(ec(v),!!l.current){var w=ur(v)?v.touches.length>0:v.buttons>0;if(!w){u(!1);return}p?.(rc(l.current,v),v)}},[p]),f=y.useCallback(()=>u(!1),[]),x=y.useCallback(v=>{v?(window.addEventListener(c.current?"touchmove":"mousemove",b),window.addEventListener(c.current?"touchend":"mouseup",f)):(window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",f),window.removeEventListener("touchmove",b),window.removeEventListener("touchend",f))},[b,f]);y.useEffect(()=>(x(d),()=>{x(!1)}),[d,b,f,x]);var _=y.useCallback(v=>{var w=document.activeElement;w?.blur(),ec(v.nativeEvent),h(v.nativeEvent)&&l.current&&(m?.(rc(l.current,v.nativeEvent),v.nativeEvent),u(!0))},[m]);return a.jsx("div",M({},i,{className:[r,n||""].filter(Boolean).join(" "),style:M({},i.style,{touchAction:"none"}),ref:l,tabIndex:0,onMouseDown:_,onTouchStart:_}))});Jo.displayName="Interactive";var Q0=e=>{var{className:t,color:r,left:n,top:o,prefixCls:s}=e,i={position:"absolute",top:o,left:n},l={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:r};return y.useMemo(()=>a.jsx("div",{className:s+"-pointer "+(t||""),style:i,children:a.jsx("div",{className:s+"-fill",style:l})}),[o,n,r,t,s])},eb=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],nc=y.forwardRef((e,t)=>{var r,{prefixCls:n="w-color-saturation",radius:o=0,pointer:s,className:i,hue:l=0,style:c,hsva:d,onChange:u}=e,p=De(e,eb),m=M({width:200,height:200,borderRadius:o},c,{position:"relative"}),h=(_,v)=>{u&&d&&u({h:d.h,s:_.left*100,v:(1-_.top)*100,a:d.a})},b=y.useCallback(_=>{if(!(!d||!u)){var v=1,w=d.s,j=d.v,C=!1;switch(_.key){case"ArrowLeft":w=Math.max(0,d.s-v),C=!0,_.preventDefault();break;case"ArrowRight":w=Math.min(100,d.s+v),C=!0,_.preventDefault();break;case"ArrowUp":j=Math.min(100,d.v+v),C=!0,_.preventDefault();break;case"ArrowDown":j=Math.max(0,d.v-v),C=!0,_.preventDefault();break;default:return}C&&u({h:d.h,s:w,v:j,a:d.a})}},[d,u]),f=y.useMemo(()=>{if(!d)return null;var _={top:100-d.v+"%",left:d.s+"%",color:Xl(d)};return s&&typeof s=="function"?s(M({prefixCls:n},_)):a.jsx(Q0,M({prefixCls:n},_))},[d,s,n]),x=y.useCallback(_=>{_.target.focus()},[]);return a.jsx(Jo,M({className:[n,i||""].filter(Boolean).join(" ")},p,{style:M({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+((r=d?.h)!=null?r:l)+", 100%, 50%))"},m,{outline:"none"}),ref:t,onMove:h,onDown:h,onKeyDown:b,onClick:x,children:f}))});nc.displayName="Saturation";var tb=["className","prefixCls","left","top","style","fillProps"],rb=e=>{var{className:t,prefixCls:r,left:n,top:o,style:s,fillProps:i}=e,l=De(e,tb),c=M({},s,{position:"absolute",left:n,top:o}),d=M({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},i?.style,{transform:n?"translate(-9px, -1px)":"translate(-1px, -9px)"});return a.jsx("div",M({className:r+"-pointer "+(t||""),style:c},l,{children:a.jsx("div",M({className:r+"-fill"},i,{style:d}))}))},nb=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],ob="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",Cn=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-alpha",className:n,hsva:o,background:s,bgProps:i={},innerProps:l={},pointerProps:c={},radius:d=0,width:u,height:p=16,direction:m="horizontal",style:h,onChange:b,pointer:f}=e,x=De(e,nb),_=T=>{b&&b(M({},o,{a:m==="horizontal"?T.left:T.top}),T)},v=Xl(Object.assign({},o,{a:1})),w="linear-gradient(to "+(m==="horizontal"?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+v+" 100%)",j={};m==="horizontal"?j.left=o.a*100+"%":j.top=o.a*100+"%";var C=M({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:d,background:"url("+ob+") left center",backgroundColor:"var(--alpha-background-color)"},{width:u,height:p},h,{position:"relative"}),N=y.useCallback(T=>{var O=.01,L=o.a,A=L;switch(T.key){case"ArrowLeft":m==="horizontal"&&(A=Math.max(0,L-O),T.preventDefault());break;case"ArrowRight":m==="horizontal"&&(A=Math.min(1,L+O),T.preventDefault());break;case"ArrowUp":m==="vertical"&&(A=Math.max(0,L-O),T.preventDefault());break;case"ArrowDown":m==="vertical"&&(A=Math.min(1,L+O),T.preventDefault());break;default:return}if(A!==L){var I={left:m==="horizontal"?A:o.a,top:m==="vertical"?A:o.a,width:0,height:0,x:0,y:0};b&&b(M({},o,{a:A}),I)}},[o,m,b]),k=y.useCallback(T=>{T.target.focus()},[]),E=f&&typeof f=="function"?f(M({prefixCls:r},c,j)):a.jsx(rb,M({},c,{prefixCls:r},j));return a.jsxs("div",M({},x,{className:[r,r+"-"+m,n||""].filter(Boolean).join(" "),style:C,ref:t,children:[a.jsx("div",M({},i,{style:M({inset:0,position:"absolute",background:s||w,borderRadius:d},i.style)})),a.jsx(Jo,M({},l,{style:M({},l.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:_,onDown:_,onClick:k,onKeyDown:N,children:E}))]}))});Cn.displayName="Alpha";var ab=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],sb=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),ib=e=>Number(String(e).replace(/%/g,"")),Dt=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input",placement:n="bottom",label:o,value:s,className:i,style:l,labelStyle:c,inputStyle:d,onChange:u,onBlur:p,renderInput:m}=e,h=De(e,ab),[b,f]=y.useState(s),x=y.useRef(!1);y.useEffect(()=>{e.value!==b&&(x.current||f(e.value))},[e.value]);function _(k,E){var T=(E||k.target.value).trim().replace(/^#/,"");sb(T)&&u&&u(k,T);var O=ib(T);isNaN(O)||u&&u(k,O),f(T)}function v(k){x.current=!1,f(e.value),p&&p(k)}var w={};n==="bottom"&&(w.flexDirection="column"),n==="top"&&(w.flexDirection="column-reverse"),n==="left"&&(w.flexDirection="row-reverse");var j=M({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},w,l),C=M({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},d),N=M({value:b,onChange:_,onBlur:v,autoComplete:"off",onFocus:()=>x.current=!0},h,{style:C,onFocusCapture:k=>{var E=k.target;E.setSelectionRange(E.value.length,E.value.length)}});return a.jsxs("div",{className:[r,i||""].filter(Boolean).join(" "),style:j,children:[m?m(N,t):a.jsx("input",M({ref:t},N)),o&&a.jsx("span",{style:M({color:"var(--editable-input-label-color)",textTransform:"capitalize"},c),children:o})]})});Dt.displayName="EditableInput";var lb=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],oc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-editable-input-rgba",hsva:n,placement:o="bottom",rProps:s={},gProps:i={},bProps:l={},aProps:c={},className:d,style:u,onChange:p}=e,m=De(e,lb),h=n?Sn(n):{};function b(v){var w=Number(v.target.value);w&&w>255&&(v.target.value="255"),w&&w<0&&(v.target.value="0")}var f=v=>{var w=Number(v.target.value);w&&w>100&&(v.target.value="100"),w&&w<0&&(v.target.value="0")},x=(v,w,j)=>{typeof v=="number"&&(w==="a"&&(v<0&&(v=0),v>100&&(v=100),p&&p(Mt(cr(M({},h,{a:v/100}))))),v>255&&(v=255,j.target.value="255"),v<0&&(v=0,j.target.value="0"),w==="r"&&p&&p(Mt(cr(M({},h,{r:v})))),w==="g"&&p&&p(Mt(cr(M({},h,{g:v})))),w==="b"&&p&&p(Mt(cr(M({},h,{b:v})))))},_=h.a?Math.round(h.a*100)/100:0;return a.jsxs("div",M({ref:t,className:[r,d||""].filter(Boolean).join(" ")},m,{style:M({fontSize:11,display:"flex"},u),children:[a.jsx(Dt,M({label:"R",value:h.r||0,onBlur:b,placement:o,onChange:(v,w)=>x(w,"r",v)},s,{style:M({},s.style)})),a.jsx(Dt,M({label:"G",value:h.g||0,onBlur:b,placement:o,onChange:(v,w)=>x(w,"g",v)},i,{style:M({marginLeft:5},s.style)})),a.jsx(Dt,M({label:"B",value:h.b||0,onBlur:b,placement:o,onChange:(v,w)=>x(w,"b",v)},l,{style:M({marginLeft:5},l.style)})),c&&a.jsx(Dt,M({label:"A",value:parseInt(String(_*100),10),onBlur:f,placement:o,onChange:(v,w)=>x(w,"a",v)},c,{style:M({marginLeft:5},c.style)}))]}))});oc.displayName="EditableInputRGBA";var cb=["prefixCls","className","hue","onChange","direction"],ac=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-hue",className:n,hue:o=0,onChange:s,direction:i="horizontal"}=e,l=De(e,cb);return a.jsx(Cn,M({ref:t,className:r+" "+(n||"")},l,{direction:i,background:"linear-gradient(to "+(i==="horizontal"?"right":"bottom")+", rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%)",hsva:{h:o,s:100,v:100,a:o/360},onChange:(c,d)=>{s&&s({h:i==="horizontal"?360*d.left:360*d.top})}}))});ac.displayName="Hue";var db=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],sc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-swatch",className:n,color:o,colors:s=[],style:i,rectProps:l={},onChange:c,addonAfter:d,addonBefore:u,rectRender:p}=e,m=De(e,db),h=M({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},l.style),b=(f,x)=>{c&&c(dr(f),Mt(dr(f)),x)};return a.jsxs("div",M({ref:t},m,{className:[r,n||""].filter(Boolean).join(" "),style:M({display:"flex",flexWrap:"wrap",position:"relative"},i),children:[u&&y.isValidElement(u)&&u,s&&Array.isArray(s)&&s.map((f,x)=>{var _="",v="";typeof f=="string"&&(_=f,v=f),typeof f=="object"&&f.color&&(_=f.title||f.color,v=f.color);var w=o&&o.toLocaleLowerCase()===v.toLocaleLowerCase(),j=p&&p({title:_,color:v,checked:!!w,style:M({},h,{background:v}),onClick:N=>b(v,N)});if(j)return a.jsx(y.Fragment,{children:j},x);var C=l.children&&y.isValidElement(l.children)?y.cloneElement(l.children,{color:v,checked:w}):null;return a.jsx("div",M({tabIndex:0,title:_,onClick:N=>b(v,N)},l,{children:C,style:M({},h,{background:v})}),x)}),d&&y.isValidElement(d)&&d]}))});sc.displayName="Swatch";var ub=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],pb=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],ic=e=>a.jsx("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),lc=y.forwardRef((e,t)=>{var{prefixCls:r="w-color-sketch",className:n,onChange:o,width:s=218,presetColors:i=pb,color:l,editableDisable:c=!0,disableAlpha:d=!1,style:u}=e,p=De(e,ub),[m,h]=y.useState({h:209,s:36,v:90,a:1});y.useEffect(()=>{typeof l=="string"&&Xo(l)&&h(dr(l)),typeof l=="object"&&h(l)},[l]);var b=N=>{h(N),o&&o(Mt(N))},f=(N,k)=>{typeof N=="string"&&Xo(N)&&/(3|6)/.test(String(N.length))&&b(dr(N))},x=N=>b(M({},m,{a:N.a})),_=N=>b(M({},m,N,{a:m.a})),v=M({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:s},u),w={borderRadius:2,background:G0(m),boxShadow:"var(--sketch-alpha-box-shadow)"},j={borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},C={marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"};return a.jsxs("div",M({},p,{className:r+" "+(n||""),ref:t,style:v,children:[a.jsxs("div",{style:{padding:"10px 10px 8px"},children:[a.jsx(nc,{hsva:m,style:{width:"auto",height:150},onChange:_}),a.jsxs("div",{style:{display:"flex",marginTop:4},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx(ac,{width:"auto",height:10,hue:m.h,pointer:ic,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:N=>b(M({},m,N))}),!d&&a.jsx(Cn,{width:"auto",height:10,hsva:m,pointer:ic,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:x})]}),!d&&a.jsx(Cn,{width:24,height:24,hsva:m,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:w},pointer:()=>a.jsx(y.Fragment,{})})]})]}),c&&a.jsxs("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[a.jsx(Dt,{label:"Hex",value:Yo(m).replace(/^#/,"").toLocaleUpperCase(),onChange:(N,k)=>f(k),style:{minWidth:58}}),a.jsx(oc,{hsva:m,style:{marginLeft:6},aProps:d?!1:{},onChange:N=>b(N.hsva)})]}),i&&i.length>0&&a.jsx(sc,{style:j,colors:i,color:Yo(m),onChange:N=>b(N),rectProps:{style:C}})]}))});lc.displayName="Sketch";const cc=({selectedColor:e,handleColor:t,text:r,wrapperStyles:n})=>a.jsxs("div",{style:n,className:"ecr-admin-control",children:[a.jsxs("p",{className:"ecr-admin-control__label",children:[r,":"]}),a.jsxs("div",{className:"ecr-admin-control__row ecr-admin-control__row--color",children:[a.jsxs(Rt,{children:[a.jsx(Lt,{style:{padding:0,backgroundColor:"transparent"},children:a.jsx("div",{style:{backgroundColor:e},className:"ecr-admin-control__swatch"})}),a.jsx(It,{className:"ecr-admin-popover ecr-admin-color-selector-popover",children:a.jsx(lc,{color:e,disableAlpha:!0,onChange:o=>{t(o.hex)}})})]}),a.jsx("input",{className:"ecr-admin-control__hex",type:"text",value:e,onChange:o=>t(o.target.value)})]})]}),mb=[{value:"left",title:"Align Left",Icon:Lp},{value:"center",title:"Align Center",Icon:Ip},{value:"right",title:"Align Right",Icon:zp},{value:"hidden",title:"Hidden",Icon:Mp}],fb=({alignment:e,handleWidgetTitleAlignment:t})=>a.jsxs("div",{className:"ecr-admin-group-title_alignment",children:[a.jsx("p",{className:"ecr-admin-group-title_alignment-label",children:"Alignment:"}),a.jsx("div",{className:"ecr-admin-group-title_alignment-options",children:mb.map(({value:r,title:n,Icon:o})=>a.jsx(re,{onClick:()=>t(r),style:{width:40,...e===r?{backgroundColor:"#2563eb",color:"#fff"}:{}},size:"icon-sm",variant:"ghost",title:n,children:a.jsx(o,{size:18})},r))})]}),hb=({styles:e,setStyles:t,setIsEdited:r})=>{const n=o=>{t(s=>{const i=o(s);return r(!0),i})};return a.jsxs("div",{className:"ecr-admin-group-title-customization__content",children:[a.jsx(fb,{alignment:e.widgetTitle?.alignment??"hidden",handleWidgetTitleAlignment:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,alignment:o}}))}),a.jsx(cc,{selectedColor:e.widgetTitle?.color??"#000000",handleColor:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,color:o}})),text:"Title Color",wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}}),a.jsx(lr,{label:"Font size",min:10,max:200,value:e?.widgetTitle?.fontSize??24,onChange:o=>n(s=>({...s,widgetTitle:{...s.widgetTitle,fontSize:o}})),name:"font_size",id:"font-size",hideSlider:!0,wrapperStyles:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}})]})},gb=(e=700)=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useCallback(s=>{Ul(s),r(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r(!1)},e)},[e]);return y.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),[t,o]},xb=({gid:e})=>{const[t,r]=gb(),n=`[reelswp-group id='${e}']`;return a.jsxs("div",{className:"ecr-admin-shortcode",children:[a.jsx("span",{className:"ecr-admin-shortcode__badge",children:n}),a.jsxs("div",{className:"ecr-admin-shortcode__copy",children:[a.jsx("button",{onClick:()=>r(n),className:"ecr-admin-shortcode__button",title:"Copy",children:a.jsx(Mf,{color:"#ffffff",size:12})}),a.jsx("span",{className:D("ecr-admin-shortcode__tooltip",t?"ecr-admin-shortcode__tooltip--visible":"ecr-admin-shortcode__tooltip--hidden"),children:"Copied!"})]})]})},dc=y.createContext({requestLeave:e=>e()}),bb=({value:e,children:t})=>a.jsx(dc.Provider,{value:e,children:t}),uc=()=>y.useContext(dc);function vb(e){return H({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(e)}const _b=({link:e,usedFor:t})=>a.jsx("div",{className:"ecr-product-card-one",style:{width:"100%"},children:a.jsx(yb,{link:e,usedFor:t})}),yb=({link:e,usedFor:t})=>a.jsx(a.Fragment,{children:a.jsxs("div",{className:"ecr-product-card-one-content-wrapper",children:[t==="admin"?a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||yn,alt:"Product thumbnail"}):a.jsx("a",{href:e.buttonUrl,target:"_blank",draggable:!1,children:a.jsx("img",{className:"ecr-product-card-one__thumb",src:e.thumbnail||yn,alt:"Product thumbnail",draggable:!1})}),a.jsxs("div",{className:"ecr-product-card-one__content",children:[t==="admin"?a.jsx("p",{className:"ecr-product-card-one__title",children:e.buttonText}):a.jsx("a",{className:"ecr-product-card-one__title",href:e.buttonUrl,target:"_blank",draggable:!1,children:e.buttonText}),a.jsxs("div",{className:"ecr-product-card-one__meta",children:[Number(e.rating)>0?a.jsxs("span",{className:"ecr-product-card-one__rating",children:[a.jsx(vb,{className:"ecr-product-card-one__star"}),e.rating]}):null,a.jsx("div",{className:"ecr-product-card-one__price",dangerouslySetInnerHTML:{__html:e.price}})]})]})]})}),wb=({link:e,usedFor:t})=>{const r=t==="admin";return a.jsx("div",{style:{width:"100%"},className:"ecr-thumb__link-wrapper",children:a.jsx("a",{href:r?void 0:e.buttonUrl,target:r?void 0:"_blank",rel:r?void 0:"noopener noreferrer",className:`ecr-thumb__link ${e.customClass??""}`,onClick:r?n=>n.preventDefault():void 0,"aria-disabled":r,tabIndex:r?-1:void 0,draggable:!1,children:e.buttonText})})},kn=({link:e,usedFor:t,style:r})=>a.jsx("div",{className:"ecr-admin-reelitem-links",style:r,children:e.btn_type==="product"?a.jsx(_b,{link:e,usedFor:t},e.btn_uuid):a.jsx(wb,{link:e,usedFor:t},e.btn_uuid)}),pc=({reel:e,styles:t,gid:r,togglingId:n,onRemove:o})=>{const s=Se(),{requestLeave:i}=uc(),l=n===e.story_uuid,c=`?view=${K.cr}&from=${K.mg}&sid=${e.id}${r?`&gid=${r}`:""}`,d=t.appearance??"overlay",u={width:`${t?.size}px`,border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t?.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t?.shape==="rectangle"?"9/16":"1/1"},p=e.links&&e.links.length>0?e.links[0]:null;return a.jsxs("div",{className:D("ecr-admin-reelitem",t?.hoverEffect),children:[a.jsxs("div",{style:u,className:"ecr-admin-reelitem__frame",children:[a.jsx(Yn,{story:e,styles:t}),d==="overlay"&&t.shape==="rectangle"&&p&&a.jsx(kn,{link:p,usedFor:"admin",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}}),a.jsxs("div",{className:"ecr-admin-reelitem__actions",children:[a.jsx(re,{title:"Edit Story",size:"icon-sm",asChild:!0,className:"ecr-admin-reelitem__button",disabled:l,children:a.jsx(ht,{to:c,className:D("ecr-admin-reelitem__link",l?"ecr-admin-reelitem__link--disabled":"ecr-admin-reelitem__link--active"),onClick:m=>{m.preventDefault(),i(()=>s(c))},children:a.jsx(Pr,{className:"ecr-admin-reelitem__icon"})})}),a.jsx(re,{onClick:()=>o(e,"remove"),className:"ecr-admin-reelitem__button ecr-admin-reelitem__button--danger",size:"icon-sm",title:"Remove Story",disabled:l,children:l?a.jsx(tt,{className:"ecr-admin-reelitem__spinner",size:18}):a.jsx(cs,{size:18})})]})]}),d==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-admin-reel__title",children:e.title}):null]})},mc=(e,t)=>{const r=y.useRef(null),n=y.useRef(null),o=y.useRef(null),[s,i]=y.useState(!1),[l,c]=y.useState(!1),[d,u]=y.useState(!1),[p,m]=y.useState(300),h=()=>{const f=r.current;if(!f)return;const x=f.scrollLeft,_=f.scrollWidth,v=f.clientWidth;c(x>0),u(x+v<_-1)};y.useEffect(()=>{const f=r.current,x=n.current;f&&x&&(i(x.scrollWidth>f.clientWidth),m(f.clientWidth-100),h())},[e,t]);const b=f=>{const x=r.current;x&&(x.scrollBy({left:f,behavior:"smooth"}),o.current&&clearTimeout(o.current),o.current=setTimeout(h,300))};return y.useEffect(()=>{const f=r.current;if(!f)return;let x=!1,_,v;const w=O=>{x=!0,_=O.pageX-f.offsetLeft,v=f.scrollLeft,f.style.cursor="grabbing"},j=()=>{x=!1,f.style.cursor="default"},C=()=>{x=!1,f.style.cursor="default"},N=O=>{if(!x)return;O.preventDefault();const A=(O.pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-A,h()},k=O=>{x=!0,_=O.touches[0].pageX-f.offsetLeft,v=f.scrollLeft},E=()=>{x=!1},T=O=>{if(!x)return;const A=(O.touches[0].pageX-f.offsetLeft-_)*1.5;f.scrollLeft=v-A,h()};return f.addEventListener("mousedown",w),f.addEventListener("mouseleave",j),f.addEventListener("mouseup",C),f.addEventListener("mousemove",N),f.addEventListener("touchstart",k,{passive:!0}),f.addEventListener("touchend",E),f.addEventListener("touchmove",T,{passive:!0}),()=>{f.removeEventListener("mousedown",w),f.removeEventListener("mouseleave",j),f.removeEventListener("mouseup",C),f.removeEventListener("mousemove",N),f.removeEventListener("touchstart",k),f.removeEventListener("touchend",E),f.removeEventListener("touchmove",T)}},[t]),y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),{thumbsContainerRef:r,thumbsWrapperRef:n,isOverflowing:s,canScrollLeft:l,canScrollRight:d,scrollBy:b,scrollStep:p}},fc=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=mc([e],!0);return a.jsxs("div",{className:"ecr-admin-editor-carousel",children:[a.jsx("div",{ref:s,className:"ecr-admin-editor-carousel__viewport",children:a.jsx("div",{ref:i,style:{...!e.length&&{margin:"auto"},gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:D("ecr-admin-editor-carousel__track",t.hoverEffect==="zoom-in"&&"ecr-admin-editor-carousel__track--padded"),children:e.length>0?e.map(m=>a.jsx(pc,{reel:m,styles:t,gid:r,togglingId:n,onRemove:o},m.id)):a.jsx("div",{className:"ecr-admin-editor-carousel__empty",children:a.jsxs("p",{className:"ecr-admin-editor-carousel__empty-text",children:[a.jsx(nt,{className:"ecr-admin-editor-carousel__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--left",children:a.jsx(Gt,{size:20})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-admin-editor-carousel__nav ecr-admin-editor-carousel__nav--right",children:a.jsx(Kt,{size:20})})]})},jb=({reels:e,styles:t,gid:r,togglingId:n,handleRemoveReel:o})=>{const s={columnGap:`${t?.gap}px`};return a.jsx("div",{style:s,className:D("ecr-admin-editor-grid",t?.hoverEffect==="zoom-in"&&"ecr-admin-editor-grid--padded"),children:e.length>0?e.map(i=>a.jsx(pc,{reel:i,styles:t,gid:r,togglingId:n,onRemove:o},i.id)):a.jsx("div",{className:"ecr-admin-editor-grid__empty",children:a.jsxs("p",{className:"ecr-admin-editor-grid__empty-text",children:[a.jsx(nt,{className:"ecr-admin-editor-grid__empty-icon"}),a.jsx("span",{children:"No reels have been added to this widget yet. Select some from the list on the left to get started."})]})})})},hc=({title:e})=>a.jsx("p",{className:"ecr-reel_title",children:e}),Sb=({reel:e,styles:t})=>{const r=e?.files?.[0],n=!!r?.mime_type?.startsWith("image"),[o,s]=y.useState(!1),[i,l]=y.useState(!0),[c,d]=y.useState(!1),u=y.useRef(null);y.useEffect(()=>{u.current&&(u.current.muted=i)},[i]),y.useEffect(()=>{u.current&&(o?u.current.pause():u.current.play().catch(()=>{}))},[o]);const p=()=>{u.current&&s(f=>!f)},m=()=>{u.current&&l(f=>!f)},h=t?.playerAppearance??"overlay",b=e.links&&e.links.length>0?e.links[0]:null;return a.jsx("div",{className:"ecr-preview-player",children:a.jsxs("div",{className:"ecr-preview-player__stage",children:[a.jsx(xt,{className:"ecr-player__nav--left ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Gt,{size:24})}),a.jsx(xt,{className:"ecr-player__nav--right ecr-preview-player__nav--disabled",type:"button",disabled:!0,"aria-disabled":"true",children:a.jsx(Kt,{size:24})}),a.jsxs("div",{className:"ecr-player__frame",style:{backgroundColor:c?"transparent":"#000"},children:[a.jsx("button",{type:"button",className:"ecr-player__close","aria-label":"Close preview",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),r?a.jsx("div",{className:"ecr-player__media-frame",children:n?a.jsx("img",{src:r.url,alt:e?.title||"Reel preview",className:"ecr-preview-player__media-item",loading:"lazy"}):a.jsxs(a.Fragment,{children:[a.jsx("video",{style:{height:c?"100%":"auto"},ref:u,className:"ecr-preview-player__media-item",src:r.url,poster:e?.thumbnail,autoPlay:!0,muted:i,loop:!0,playsInline:!0,onClick:p,onLoadedMetadata:f=>{const x=f.currentTarget,_=x.videoWidth,v=x.videoHeight;d(()=>v>_)}}),a.jsxs("div",{className:"ecr-player__controls",children:[o?a.jsx(qn,{size:20,className:"ecr-player__control-icon",onClick:p}):a.jsx(Vn,{size:20,className:"ecr-player__control-icon",onClick:p}),i?a.jsx(Wn,{size:20,className:"ecr-player__control-icon",onClick:m}):a.jsx(Gn,{size:20,className:"ecr-player__control-icon",onClick:m})]})]})}):a.jsx("div",{className:"ecr-preview-player__empty",children:"No preview available"})]}),h==="overlay"&&b?a.jsx(kn,{link:b,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,h==="title"?a.jsx(hc,{title:e.title}):null]})})},Cb={carousel:fc,grid:jb},kb=({gid:e,reels:t,styles:r,handleRemoveReel:n,togglingId:o,currentTab:s})=>{const i=r.template??"carousel",l=Cb[i]||fc;return a.jsxs("div",{className:"ecr-admin-existing",children:[a.jsxs("div",{className:"ecr-admin-existing__header",children:[a.jsxs("div",{className:"ecr-admin-existing__title-wrapper",children:[a.jsx("p",{className:"ecr-admin-existing__title",children:"Attached videos"}),a.jsx("small",{className:"ecr-admin-existing__subtitle",children:"These reels will be shown in this reel widget"})]}),e&&a.jsx(xb,{gid:e})]}),a.jsx("div",{className:"scrollbarThin ecr-admin-existing__body",children:s==="thumbnail"?a.jsx(l,{reels:t,styles:r,gid:e,togglingId:o,handleRemoveReel:n}):t.length>0?a.jsx(Sb,{reel:t[0],styles:r}):a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[a.jsx(nt,{style:{width:"40px",height:"40px",color:"#f59e0b"}}),"No reels available for preview."]})})]})},gc=()=>a.jsx("div",{className:"ecr-admin-reellist__loader",children:a.jsx("div",{className:"ecr-admin-reellist__spinner"})}),Nb=({gid:e,allReels:t,handleSelectReel:r,searchTerm:n,setSearchTerm:o,isSearching:s,togglingId:i,lastStoryElementRef:l})=>{const c=Se(),{requestLeave:d}=uc(),u=`?view=${K.cr}&from=${K.mg}${e?`&gid=${e}`:""}`,p=t.filter(m=>!m?.files[0]?.mime_type.startsWith("image"));return a.jsxs("div",{className:"ecr-admin-reellist",children:[a.jsxs("div",{className:"ecr-admin-reellist__header",children:[a.jsx("p",{className:"ecr-admin-reellist__title",children:"All reels"}),a.jsx("small",{className:"ecr-admin-reellist__subtitle",children:"Choose reels to attach in this widget"})]}),a.jsxs("div",{className:"ecr-admin-reellist__body",children:[a.jsx(Rr,{to:u,text:"Add Reel",Icon:gt,className:"ecr-admin-reellist__add-button",textColor:"#2563eb",onNavigate:m=>d(()=>c(m))}),a.jsx("div",{className:"ecr-admin-reellist__search",children:a.jsx("input",{type:"text",placeholder:"Search reels...",value:n,onChange:m=>o(m.target.value),className:"ecr-admin-reellist__search-input"})}),a.jsx("div",{className:"scrollbarThin ecr-admin-reellist__grid",children:s&&t.length===0?a.jsx(gc,{}):a.jsxs("div",{className:"ecr-admin-reellist__items",children:[p.length===0?a.jsx("p",{className:"ecr-admin-reellist__empty",children:"No reels are available to add."}):p.map((m,h)=>a.jsx("div",{ref:p.length===h+1?l:null,className:"ecr-admin-reellist__item",children:a.jsxs("button",{title:"Click to add this reel",onClick:()=>r(m,"add"),disabled:i==m.story_uuid,className:"ecr-admin-reellist__card",children:[a.jsx("div",{className:"ecr-admin-reellist__media",children:a.jsx("video",{className:"ecr-admin-reellist__thumb",src:m?.files[0]?.url,poster:m?.thumbnail})}),a.jsx("span",{className:"ecr-admin-reellist__label",children:m.title||`Reel #${m.id}`}),i==m.story_uuid?a.jsx("div",{className:"ecr-admin-reellist__overlay",children:a.jsx(tt,{className:"ecr-admin-reellist__overlay-icon"})}):null]})},m.id)),s&&t.length>0&&a.jsx(gc,{})]})})]})]})};function xc(e){const t=e+"CollectionProvider",[r,n]=He(t),[o,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=f=>{const{scope:x,children:_}=f,v=y.useRef(null),w=y.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:w,collectionRef:v,children:_})};i.displayName=t;const l=e+"CollectionSlot",c=rt(l),d=y.forwardRef((f,x)=>{const{scope:_,children:v}=f,w=s(l,_),j=Y(x,w.collectionRef);return a.jsx(c,{ref:j,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=rt(u),h=y.forwardRef((f,x)=>{const{scope:_,children:v,...w}=f,j=y.useRef(null),C=Y(x,j),N=s(u,_);return y.useEffect(()=>(N.itemMap.set(j,{ref:j,...w}),()=>void N.itemMap.delete(j))),a.jsx(m,{[p]:"",ref:C,children:v})});h.displayName=u;function b(f){const x=s(e+"CollectionConsumer",f);return y.useCallback(()=>{const v=x.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((N,k)=>w.indexOf(N.ref.current)-w.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:d,ItemSlot:h},b,n]}var Eb=g.createContext(void 0);function Zo(e){const t=g.useContext(Eb);return e||t||"ltr"}var Qo="rovingFocusGroup.onEntryFocus",Tb={bubbles:!1,cancelable:!0},pr="RovingFocusGroup",[ea,bc,Ab]=xc(pr),[Pb,vc]=He(pr,[Ab]),[Ob,Rb]=Pb(pr),_c=g.forwardRef((e,t)=>a.jsx(ea.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(ea.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Lb,{...e,ref:t})})}));_c.displayName=pr;var Lb=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...p}=e,m=g.useRef(null),h=Y(t,m),b=Zo(s),[f,x]=lt({prop:i,defaultProp:l??null,onChange:c,caller:pr}),[_,v]=g.useState(!1),w=Ve(d),j=bc(r),C=g.useRef(!1),[N,k]=g.useState(0);return g.useEffect(()=>{const E=m.current;if(E)return E.addEventListener(Qo,w),()=>E.removeEventListener(Qo,w)},[w]),a.jsx(Ob,{scope:r,orientation:n,dir:b,loop:o,currentTabStopId:f,onItemFocus:g.useCallback(E=>x(E),[x]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:g.useCallback(()=>k(E=>E-1),[]),children:a.jsx(W.div,{tabIndex:_||N===0?-1:0,"data-orientation":n,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:V(e.onMouseDown,()=>{C.current=!0}),onFocus:V(e.onFocus,E=>{const T=!C.current;if(E.target===E.currentTarget&&T&&!_){const O=new CustomEvent(Qo,Tb);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const L=j().filter(R=>R.focusable),A=L.find(R=>R.active),I=L.find(R=>R.id===f),$=[A,I,...L].filter(Boolean).map(R=>R.ref.current);jc($,u)}}C.current=!1}),onBlur:V(e.onBlur,()=>v(!1))})})}),yc="RovingFocusGroupItem",wc=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:s,children:i,...l}=e,c=Ne(),d=s||c,u=Rb(yc,r),p=u.currentTabStopId===d,m=bc(r),{onFocusableItemAdd:h,onFocusableItemRemove:b,currentTabStopId:f}=u;return g.useEffect(()=>{if(n)return h(),()=>b()},[n,h,b]),a.jsx(ea.ItemSlot,{scope:r,id:d,focusable:n,active:o,children:a.jsx(W.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:V(e.onMouseDown,x=>{n?u.onItemFocus(d):x.preventDefault()}),onFocus:V(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:V(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=Mb(x,u.orientation,u.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=m().filter(j=>j.focusable).map(j=>j.ref.current);if(_==="last")w.reverse();else if(_==="prev"||_==="next"){_==="prev"&&w.reverse();const j=w.indexOf(x.currentTarget);w=u.loop?Db(w,j+1):w.slice(j+1)}setTimeout(()=>jc(w))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:f!=null}):i})})});wc.displayName=yc;var Ib={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Mb(e,t,r){const n=zb(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Ib[n]}function jc(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Db(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Fb=_c,$b=wc,Nn="Tabs",[Bb]=He(Nn,[vc]),Sc=vc(),[Ub,ta]=Bb(Nn),Cc=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Zo(l),[p,m]=lt({prop:n,onChange:o,defaultProp:s??"",caller:Nn});return a.jsx(Ub,{scope:r,baseId:Ne(),value:p,onValueChange:m,orientation:i,dir:u,activationMode:c,children:a.jsx(W.div,{dir:u,"data-orientation":i,...d,ref:t})})});Cc.displayName=Nn;var kc="TabsList",Nc=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,s=ta(kc,r),i=Sc(r);return a.jsx(Fb,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(W.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});Nc.displayName=kc;var Ec="TabsTrigger",Tc=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...s}=e,i=ta(Ec,r),l=Sc(r),c=Oc(i.baseId,n),d=Rc(i.baseId,n),u=n===i.value;return a.jsx($b,{asChild:!0,...l,focusable:!o,active:u,children:a.jsx(W.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:V(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?i.onValueChange(n):p.preventDefault()}),onKeyDown:V(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(n)}),onFocus:V(e.onFocus,()=>{const p=i.activationMode!=="manual";!u&&!o&&p&&i.onValueChange(n)})})})});Tc.displayName=Ec;var Ac="TabsContent",Pc=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:s,...i}=e,l=ta(Ac,r),c=Oc(l.baseId,n),d=Rc(l.baseId,n),u=n===l.value,p=g.useRef(u);return g.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(Ke,{present:o||u,children:({present:m})=>a.jsx(W.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&s})})});Pc.displayName=Ac;function Oc(e,t){return`${e}-trigger-${t}`}function Rc(e,t){return`${e}-content-${t}`}var Hb=Cc,Vb=Nc,Wb=Tc,qb=Pc;function Gb({className:e,...t}){return a.jsx(Hb,{"data-slot":"tabs",className:D("ecr-tabs",e),...t})}function Kb({className:e,...t}){return a.jsx(Vb,{"data-slot":"tabs-list",className:D("ecr-tabs__list",e),...t})}function Lc({className:e,...t}){return a.jsx(Wb,{"data-slot":"tabs-trigger",className:D("ecr-tabs__trigger",e),...t})}function Ic({className:e,...t}){return a.jsx(qb,{"data-slot":"tabs-content",className:D("ecr-tabs__content",e),...t})}function zc(e,[t,r]){return Math.min(r,Math.max(t,e))}function Yb(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Mc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Xb="VisuallyHidden",Jb=g.forwardRef((e,t)=>a.jsx(W.span,{...e,ref:t,style:{...Mc,...e.style}}));Jb.displayName=Xb;var Zb=[" ","Enter","ArrowUp","ArrowDown"],Qb=[" ","Enter"],dt="Select",[En,Tn,ev]=xc(dt),[Ft]=He(dt,[ev,on]),An=on(),[tv,Je]=Ft(dt),[rv,nv]=Ft(dt),Dc=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:p,disabled:m,required:h,form:b}=e,f=An(t),[x,_]=g.useState(null),[v,w]=g.useState(null),[j,C]=g.useState(!1),N=Zo(d),[k,E]=lt({prop:n,defaultProp:o??!1,onChange:s,caller:dt}),[T,O]=lt({prop:i,defaultProp:l,onChange:c,caller:dt}),L=g.useRef(null),A=x?b||!!x.closest("form"):!0,[I,z]=g.useState(new Set),$=Array.from(I).map(R=>R.props.value).join(";");return a.jsx(Wi,{...f,children:a.jsxs(tv,{required:h,scope:t,trigger:x,onTriggerChange:_,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:C,contentId:Ne(),value:T,onValueChange:O,open:k,onOpenChange:E,dir:N,triggerPointerDownPosRef:L,disabled:m,children:[a.jsx(En.Provider,{scope:t,children:a.jsx(rv,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(R=>{z(U=>new Set(U).add(R))},[]),onNativeOptionRemove:g.useCallback(R=>{z(U=>{const P=new Set(U);return P.delete(R),P})},[]),children:r})}),A?a.jsxs(sd,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:p,value:T,onChange:R=>O(R.target.value),disabled:m,form:b,children:[T===void 0?a.jsx("option",{value:""}):null,Array.from(I)]},$):null]})})};Dc.displayName=dt;var Fc="SelectTrigger",$c=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,s=An(r),i=Je(Fc,r),l=i.disabled||n,c=Y(t,i.onTriggerChange),d=Tn(r),u=g.useRef("touch"),[p,m,h]=ld(f=>{const x=d().filter(w=>!w.disabled),_=x.find(w=>w.value===i.value),v=cd(x,f,_);v!==void 0&&i.onValueChange(v.value)}),b=f=>{l||(i.onOpenChange(!0),h()),f&&(i.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return a.jsx(Po,{asChild:!0,...s,children:a.jsx(W.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":id(i.value)?"":void 0,...o,ref:c,onClick:V(o.onClick,f=>{f.currentTarget.focus(),u.current!=="mouse"&&b(f)}),onPointerDown:V(o.onPointerDown,f=>{u.current=f.pointerType;const x=f.target;x.hasPointerCapture(f.pointerId)&&x.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(b(f),f.preventDefault())}),onKeyDown:V(o.onKeyDown,f=>{const x=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&m(f.key),!(x&&f.key===" ")&&Zb.includes(f.key)&&(b(),f.preventDefault())})})})});$c.displayName=Fc;var Bc="SelectValue",Uc=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:s,placeholder:i="",...l}=e,c=Je(Bc,r),{onValueNodeHasChildrenChange:d}=c,u=s!==void 0,p=Y(t,c.onValueNodeChange);return se(()=>{d(u)},[d,u]),a.jsx(W.span,{...l,ref:p,style:{pointerEvents:"none"},children:id(c.value)?a.jsx(a.Fragment,{children:i}):s})});Uc.displayName=Bc;var ov="SelectIcon",Hc=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return a.jsx(W.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});Hc.displayName=ov;var av="SelectPortal",Vc=e=>a.jsx(an,{asChild:!0,...e});Vc.displayName=av;var ut="SelectContent",Wc=g.forwardRef((e,t)=>{const r=Je(ut,e.__scopeSelect),[n,o]=g.useState();if(se(()=>{o(new DocumentFragment)},[]),!r.open){const s=n;return s?vr.createPortal(a.jsx(qc,{scope:e.__scopeSelect,children:a.jsx(En.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Gc,{...e,ref:t})});Wc.displayName=ut;var je=10,[qc,Ze]=Ft(ut),sv="SelectContentImpl",iv=rt("SelectContent.RemoveScroll"),Gc=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:b,hideWhenDetached:f,avoidCollisions:x,..._}=e,v=Je(ut,r),[w,j]=g.useState(null),[C,N]=g.useState(null),k=Y(t,F=>j(F)),[E,T]=g.useState(null),[O,L]=g.useState(null),A=Tn(r),[I,z]=g.useState(!1),$=g.useRef(!1);g.useEffect(()=>{if(w)return Ro(w)},[w]),ho();const R=g.useCallback(F=>{const[te,...le]=A().map(ne=>ne.ref.current),[J]=le.slice(-1),Q=document.activeElement;for(const ne of F)if(ne===Q||(ne?.scrollIntoView({block:"nearest"}),ne===te&&C&&(C.scrollTop=0),ne===J&&C&&(C.scrollTop=C.scrollHeight),ne?.focus(),document.activeElement!==Q))return},[A,C]),U=g.useCallback(()=>R([E,w]),[R,E,w]);g.useEffect(()=>{I&&U()},[I,U]);const{onOpenChange:P,triggerPointerDownPosRef:q}=v;g.useEffect(()=>{if(w){let F={x:0,y:0};const te=J=>{F={x:Math.abs(Math.round(J.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(J.pageY)-(q.current?.y??0))}},le=J=>{F.x<=10&&F.y<=10?J.preventDefault():w.contains(J.target)||P(!1),document.removeEventListener("pointermove",te),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",le,{capture:!0})}}},[w,P,q]),g.useEffect(()=>{const F=()=>P(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[P]);const[X,Z]=ld(F=>{const te=A().filter(Q=>!Q.disabled),le=te.find(Q=>Q.ref.current===document.activeElement),J=cd(te,F,le);J&&setTimeout(()=>J.ref.current.focus())}),pe=g.useCallback((F,te,le)=>{const J=!$.current&&!le;(v.value!==void 0&&v.value===te||J)&&(T(F),J&&($.current=!0))},[v.value]),Fe=g.useCallback(()=>w?.focus(),[w]),ge=g.useCallback((F,te,le)=>{const J=!$.current&&!le;(v.value!==void 0&&v.value===te||J)&&L(F)},[v.value]),$e=n==="popper"?ra:Kc,pt=$e===ra?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:b,hideWhenDetached:f,avoidCollisions:x}:{};return a.jsx(qc,{scope:r,content:w,viewport:C,onViewportChange:N,itemRefCallback:pe,selectedItem:E,onItemLeave:Fe,itemTextRefCallback:ge,focusSelectedItem:U,selectedItemText:O,position:n,isPositioned:I,searchRef:X,children:a.jsx(hn,{as:iv,allowPinchZoom:!0,children:a.jsx(Gr,{asChild:!0,trapped:v.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:V(o,F=>{v.trigger?.focus({preventScroll:!0}),F.preventDefault()}),children:a.jsx(qr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:a.jsx($e,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:F=>F.preventDefault(),..._,...pt,onPlaced:()=>z(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:V(_.onKeyDown,F=>{const te=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!te&&F.key.length===1&&Z(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let J=A().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(F.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const Q=F.target,ne=J.indexOf(Q);J=J.slice(ne+1)}setTimeout(()=>R(J)),F.preventDefault()}})})})})})})});Gc.displayName=sv;var lv="SelectItemAlignedPosition",Kc=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,s=Je(ut,r),i=Ze(ut,r),[l,c]=g.useState(null),[d,u]=g.useState(null),p=Y(t,k=>u(k)),m=Tn(r),h=g.useRef(!1),b=g.useRef(!0),{viewport:f,selectedItem:x,selectedItemText:_,focusSelectedItem:v}=i,w=g.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&d&&f&&x&&_){const k=s.trigger.getBoundingClientRect(),E=d.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),O=_.getBoundingClientRect();if(s.dir!=="rtl"){const Q=O.left-E.left,ne=T.left-Q,xe=k.left-ne,mt=k.width+xe,ma=Math.max(mt,E.width),fa=window.innerWidth-je,ha=zc(ne,[je,Math.max(je,fa-ma)]);l.style.minWidth=mt+"px",l.style.left=ha+"px"}else{const Q=E.right-O.right,ne=window.innerWidth-T.right-Q,xe=window.innerWidth-k.right-ne,mt=k.width+xe,ma=Math.max(mt,E.width),fa=window.innerWidth-je,ha=zc(ne,[je,Math.max(je,fa-ma)]);l.style.minWidth=mt+"px",l.style.right=ha+"px"}const L=m(),A=window.innerHeight-je*2,I=f.scrollHeight,z=window.getComputedStyle(d),$=parseInt(z.borderTopWidth,10),R=parseInt(z.paddingTop,10),U=parseInt(z.borderBottomWidth,10),P=parseInt(z.paddingBottom,10),q=$+R+I+P+U,X=Math.min(x.offsetHeight*5,q),Z=window.getComputedStyle(f),pe=parseInt(Z.paddingTop,10),Fe=parseInt(Z.paddingBottom,10),ge=k.top+k.height/2-je,$e=A-ge,pt=x.offsetHeight/2,F=x.offsetTop+pt,te=$+R+F,le=q-te;if(te<=ge){const Q=L.length>0&&x===L[L.length-1].ref.current;l.style.bottom="0px";const ne=d.clientHeight-f.offsetTop-f.offsetHeight,xe=Math.max($e,pt+(Q?Fe:0)+ne+U),mt=te+xe;l.style.height=mt+"px"}else{const Q=L.length>0&&x===L[0].ref.current;l.style.top="0px";const xe=Math.max(ge,$+f.offsetTop+(Q?pe:0)+pt)+le;l.style.height=xe+"px",f.scrollTop=te-ge+f.offsetTop}l.style.margin=`${je}px 0`,l.style.minHeight=X+"px",l.style.maxHeight=A+"px",n?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,l,d,f,x,_,s.dir,n]);se(()=>w(),[w]);const[j,C]=g.useState();se(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const N=g.useCallback(k=>{k&&b.current===!0&&(w(),v?.(),b.current=!1)},[w,v]);return a.jsx(dv,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:a.jsx(W.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Kc.displayName=lv;var cv="SelectPopperPosition",ra=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=je,...s}=e,i=An(r);return a.jsx(qi,{...i,...s,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ra.displayName=cv;var[dv,na]=Ft(ut,{}),oa="SelectViewport",Yc=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,s=Ze(oa,r),i=na(oa,r),l=Y(t,s.onViewportChange),c=g.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),a.jsx(En.Slot,{scope:r,children:a.jsx(W.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:V(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=i;if(m?.current&&p){const h=Math.abs(c.current-u.scrollTop);if(h>0){const b=window.innerHeight-je*2,f=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),_=Math.max(f,x);if(_<b){const v=_+h,w=Math.min(b,v),j=v-w;p.style.height=w+"px",p.style.bottom==="0px"&&(u.scrollTop=j>0?j:0,p.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Yc.displayName=oa;var Xc="SelectGroup",[uv,pv]=Ft(Xc),mv=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ne();return a.jsx(uv,{scope:r,id:o,children:a.jsx(W.div,{role:"group","aria-labelledby":o,...n,ref:t})})});mv.displayName=Xc;var Jc="SelectLabel",fv=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=pv(Jc,r);return a.jsx(W.div,{id:o.id,...n,ref:t})});fv.displayName=Jc;var Pn="SelectItem",[hv,Zc]=Ft(Pn),Qc=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:s,...i}=e,l=Je(Pn,r),c=Ze(Pn,r),d=l.value===n,[u,p]=g.useState(s??""),[m,h]=g.useState(!1),b=Y(t,v=>c.itemRefCallback?.(v,n,o)),f=Ne(),x=g.useRef("touch"),_=()=>{o||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(hv,{scope:r,value:n,disabled:o,textId:f,isSelected:d,onItemTextChange:g.useCallback(v=>{p(w=>w||(v?.textContent??"").trim())},[]),children:a.jsx(En.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:a.jsx(W.div,{role:"option","aria-labelledby":f,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:b,onFocus:V(i.onFocus,()=>h(!0)),onBlur:V(i.onBlur,()=>h(!1)),onClick:V(i.onClick,()=>{x.current!=="mouse"&&_()}),onPointerUp:V(i.onPointerUp,()=>{x.current==="mouse"&&_()}),onPointerDown:V(i.onPointerDown,v=>{x.current=v.pointerType}),onPointerMove:V(i.onPointerMove,v=>{x.current=v.pointerType,o?c.onItemLeave?.():x.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:V(i.onPointerLeave,v=>{v.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:V(i.onKeyDown,v=>{c.searchRef?.current!==""&&v.key===" "||(Qb.includes(v.key)&&_(),v.key===" "&&v.preventDefault())})})})})});Qc.displayName=Pn;var mr="SelectItemText",ed=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...s}=e,i=Je(mr,r),l=Ze(mr,r),c=Zc(mr,r),d=nv(mr,r),[u,p]=g.useState(null),m=Y(t,_=>p(_),c.onItemTextChange,_=>l.itemTextRefCallback?.(_,c.value,c.disabled)),h=u?.textContent,b=g.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:f,onNativeOptionRemove:x}=d;return se(()=>(f(b),()=>x(b)),[f,x,b]),a.jsxs(a.Fragment,{children:[a.jsx(W.span,{id:c.textId,...s,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?vr.createPortal(s.children,i.valueNode):null]})});ed.displayName=mr;var td="SelectItemIndicator",rd=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Zc(td,r).isSelected?a.jsx(W.span,{"aria-hidden":!0,...n,ref:t}):null});rd.displayName=td;var aa="SelectScrollUpButton",nd=g.forwardRef((e,t)=>{const r=Ze(aa,e.__scopeSelect),n=na(aa,e.__scopeSelect),[o,s]=g.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollTop>0;s(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});nd.displayName=aa;var sa="SelectScrollDownButton",od=g.forwardRef((e,t)=>{const r=Ze(sa,e.__scopeSelect),n=na(sa,e.__scopeSelect),[o,s]=g.useState(!1),i=Y(t,n.onScrollButtonChange);return se(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;s(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?a.jsx(ad,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});od.displayName=sa;var ad=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,s=Ze("SelectScrollButton",r),i=g.useRef(null),l=Tn(r),c=g.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return g.useEffect(()=>()=>c(),[c]),se(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),a.jsx(W.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:V(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:V(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:V(o.onPointerLeave,()=>{c()})})}),gv="SelectSeparator",xv=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(W.div,{"aria-hidden":!0,...n,ref:t})});xv.displayName=gv;var ia="SelectArrow",bv=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=An(r),s=Je(ia,r),i=Ze(ia,r);return s.open&&i.position==="popper"?a.jsx(Gi,{...o,...n,ref:t}):null});bv.displayName=ia;var vv="SelectBubbleInput",sd=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=g.useRef(null),s=Y(n,o),i=Yb(t);return g.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const p=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(p)}},[i,t]),a.jsx(W.select,{...r,style:{...Mc,...r.style},ref:s,defaultValue:t})});sd.displayName=vv;function id(e){return e===""||e===void 0}function ld(e){const t=Ve(e),r=g.useRef(""),n=g.useRef(0),o=g.useCallback(i=>{const l=r.current+i;t(l),(function c(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),s=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,s]}function cd(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let i=_v(e,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==r));const c=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==r?c:void 0}function _v(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var yv=Dc,wv=$c,jv=Uc,Sv=Hc,Cv=Vc,kv=Wc,Nv=Yc,Ev=Qc,Tv=ed,Av=rd,Pv=nd,Ov=od;function fr({...e}){return a.jsx(yv,{"data-slot":"select",...e})}function hr({...e}){return a.jsx(jv,{"data-slot":"select-value",...e})}function gr({className:e,size:t="default",children:r,...n}){return a.jsxs(wv,{"data-slot":"select-trigger","data-size":t,className:D("ecr-select__trigger",e),...n,children:[r,a.jsx(Sv,{asChild:!0,children:a.jsx(po,{className:"ecr-select__icon"})})]})}function xr({className:e,children:t,position:r="popper",align:n="center",...o}){const s=typeof document<"u"?document.getElementById("ecommreels-admin-app")??document.body:void 0;return a.jsx(Cv,{container:s,children:a.jsxs(kv,{"data-slot":"select-content",className:D("ecr-select__content",e),position:r,align:n,...o,children:[a.jsx(Rv,{}),a.jsx(Nv,{className:D("ecr-select__viewport"),children:t}),a.jsx(Lv,{})]})})}function br({className:e,children:t,...r}){return a.jsxs(Ev,{"data-slot":"select-item",className:D("ecr-select__item",e),...r,children:[a.jsx("span",{className:"ecr-select__check",children:a.jsx(Av,{children:a.jsx(If,{className:"ecr-select__check-icon"})})}),a.jsx(Tv,{children:t})]})}function Rv({className:e,...t}){return a.jsx(Pv,{"data-slot":"select-scroll-up-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(zf,{className:"ecr-select__icon"})})}function Lv({className:e,...t}){return a.jsx(Ov,{"data-slot":"select-scroll-down-button",className:D("ecr-select__scroll-button",e),...t,children:a.jsx(po,{className:"ecr-select__icon"})})}const Iv=({appearance:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:qu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),zv={vertical:a.jsx(a.Fragment,{children:"Offer a mobile-first experience with vertical scroll Reels in your widget for better engagement and infinite scrolling!"})};function Mv(){return a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Slide Direction:"}),a.jsxs(fr,{defaultValue:Ya[0].value,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Ya.map(e=>a.jsx(br,{value:e.value,className:"ecr-admin-control__option",children:e.label},e.value)),Vu.map(e=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:e.label}),a.jsx(qt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(ir,{name:e.label,text:zv[e.value]})})]})},e.value))]})]})]})}const Dv=({styles:e,updateStyles:t})=>a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsx(Mv,{}),a.jsx(Iv,{appearance:e?.playerAppearance??"overlay",handleLinkLayout:r=>t(n=>({...n,playerAppearance:r}))})]});var On="Collapsible",[Fv]=He(On),[$v,la]=Fv(On),dd=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:o,disabled:s,onOpenChange:i,...l}=e,[c,d]=lt({prop:n,defaultProp:o??!1,onChange:i,caller:On});return a.jsx($v,{scope:r,disabled:s,contentId:Ne(),open:c,onOpenToggle:g.useCallback(()=>d(u=>!u),[d]),children:a.jsx(W.div,{"data-state":da(c),"data-disabled":s?"":void 0,...l,ref:t})})});dd.displayName=On;var ud="CollapsibleTrigger",pd=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,o=la(ud,r);return a.jsx(W.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":da(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:t,onClick:V(e.onClick,o.onOpenToggle)})});pd.displayName=ud;var ca="CollapsibleContent",md=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=la(ca,e.__scopeCollapsible);return a.jsx(Ke,{present:r||o.open,children:({present:s})=>a.jsx(Bv,{...n,ref:t,present:s})})});md.displayName=ca;var Bv=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:o,...s}=e,i=la(ca,r),[l,c]=g.useState(n),d=g.useRef(null),u=Y(t,d),p=g.useRef(0),m=p.current,h=g.useRef(0),b=h.current,f=i.open||l,x=g.useRef(f),_=g.useRef(void 0);return g.useEffect(()=>{const v=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(v)},[]),se(()=>{const v=d.current;if(v){_.current=_.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();p.current=w.height,h.current=w.width,x.current||(v.style.transitionDuration=_.current.transitionDuration,v.style.animationName=_.current.animationName),c(n)}},[i.open,n]),a.jsx(W.div,{"data-state":da(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!f,...s,ref:u,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:f&&o})});function da(e){return e?"open":"closed"}var Uv=dd,Hv=pd,Vv=md;function fd({className:e,...t}){return a.jsx(Uv,{"data-slot":"collapsible",className:D("ecr-collapsible",e),...t})}function hd({className:e,children:t,...r}){return a.jsxs(Hv,{"data-slot":"collapsible-trigger",className:D("ecr-collapsible__trigger",e),...r,children:[a.jsx("span",{className:"ecr-collapsible__trigger-label",children:t}),a.jsx(po,{className:"ecr-collapsible__trigger-icon"})]})}function gd({className:e,...t}){return a.jsx(Vv,{"data-slot":"collapsible-content",className:D("ecr-collapsible__content",e),...t})}const ua=({label:e,text:t})=>a.jsxs(Rt,{children:[a.jsx(Lt,{style:{textAlign:"left",padding:0,backgroundColor:"transparent"},children:a.jsxs("label",{className:"ecr-admin-switch",children:[a.jsxs("span",{className:"ecr-admin-switch__label",children:[e,": ",a.jsx(qt,{size:20})]}),a.jsx(U0,{className:"ecr-admin-switch__icon",size:24})]})}),a.jsx(It,{className:"ecr-admin-popover",children:a.jsx(ir,{name:e,text:t})})]}),Wv=({linkLayout:e,handleLinkLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Appearance:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Wu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),qv=({hoverEffect:e,handleHoverEffect:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Hove Effect:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsx(xr,{children:Hu.map(r=>a.jsx(br,{value:r.value,className:"ecr-admin-control__option",children:r.label},r.value))})]})]}),Gv=[{value:"rectangle",label:"Rectangle"},{value:"circle",label:"Circle"}],Kv=({selectedShape:e,handleShape:t})=>{const r=n=>{t(n.target.id)};return a.jsxs("div",{className:"ecr-admin-control",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Shape:"}),a.jsx("div",{className:"ecr-admin-control__row",children:Gv.map(n=>a.jsxs("div",{className:"ecr-admin-control__choice",children:[a.jsx("input",{type:"radio",name:"shape",id:n.value,checked:e===n.value,onChange:r,style:{display:"none"}}),a.jsxs("label",{className:"ecr-admin-control__choice-label",htmlFor:n.value,children:[e===n.value?a.jsx($p,{color:"#2563eb",size:16}):a.jsx(Bp,{color:"#8c95a9",size:16}),n.label]})]},n.value))})]})},Yv=Object.values(Ka),Xv={marquee:a.jsx(a.Fragment,{children:"Create infinite, auto-scrolling video playlists with the Marquee layout template for endless engagement!"}),stacked:a.jsx(a.Fragment,{children:"Display Reels in a stacked layout for an interactive and shopable video experience!"})},Jv=({selectedLayout:e,handleLayout:t})=>a.jsxs("div",{className:"ecr-admin-control ecr-admin-control--row",children:[a.jsx("p",{className:"ecr-admin-control__label",children:"Template:"}),a.jsxs(fr,{value:e,onValueChange:t,children:[a.jsx(gr,{className:"ecr-admin-control__trigger",children:a.jsx(hr,{placeholder:"Layout"})}),a.jsxs(xr,{children:[Yv.map(r=>a.jsx(br,{value:r,className:"ecr-admin-control__option",children:r},r)),Uu.map(r=>a.jsx("div",{children:a.jsxs(Rt,{modal:!0,children:[a.jsxs(Lt,{className:"ecr-admin-control__lock-trigger",children:[a.jsx("span",{className:"ecr-admin-control__option",children:r}),a.jsx(qt,{size:18})]}),a.jsx(It,{className:"ecr-admin-control__popover",children:a.jsx(ir,{name:r,text:Xv[r]})})]})},r))]})]})]}),Zv=({styles:e,updateStyles:t})=>{const[r,n]=y.useState("layout"),o=r==="layout",s=r==="style",i=l=>{n(r!==l?l:null)};return a.jsxs("div",{className:"ecr-admin-thumb-controls",children:[a.jsxs(fd,{open:o,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>i("layout"),children:[a.jsx(Df,{size:16})," ",a.jsx("span",{children:"Layout"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(Kv,{selectedShape:e?.shape,handleShape:l=>t(c=>({...c,shape:l}))}),a.jsx(Jv,{selectedLayout:e?.template??"carousel",handleLayout:l=>t(c=>({...c,template:l}))}),a.jsx(Wv,{linkLayout:e?.appearance??"overlay",handleLinkLayout:l=>t(c=>({...c,appearance:l}))}),a.jsx(lr,{label:"Size",min:150,max:400,value:e?.size??150,onChange:l=>t(c=>({...c,size:l})),name:"size",id:"size"}),a.jsx(lr,{label:"Gap",min:0,max:80,value:e?.gap??0,onChange:l=>t(c=>({...c,gap:l})),name:"column_gap",id:"column-gap"}),a.jsx(ua,{label:"Show Views",text:a.jsx(a.Fragment,{children:"Hide view counts to remove distractions and provide a cleaner, more focused visual experience!"})}),a.jsx(ua,{label:"Autoplay",text:a.jsx(a.Fragment,{children:"Enable autoplay for videos on your product and pages, capturing users' attention instantly!"})}),a.jsx(ua,{label:"Drag to Sort",text:a.jsx(a.Fragment,{children:"Easily rearrange your best-performing Reels to keep your content fresh and in the right order!"})})]})]}),a.jsxs(fd,{open:s,className:"ecr-admin-thumb-controls__section",children:[a.jsxs(hd,{className:"ecr-admin-thumb-controls__section-trigger",type:"button",onClick:()=>i("style"),children:[a.jsx(Bf,{size:16}),a.jsx("span",{children:"Styles"})]}),a.jsxs(gd,{className:"ecr-admin-thumb-controls__section-content",children:[a.jsx(lr,{label:"Border Width",min:0,max:12,value:e?.border?.border_width??0,onChange:l=>t(c=>({...c,border:{...c.border,border_width:l}})),name:"border_width",id:"border-width"}),a.jsx(cc,{selectedColor:e?.border?.border_color,handleColor:l=>t(c=>({...c,border:{...c.border,border_color:l}})),text:"Border Color"}),e?.shape==="rectangle"&&a.jsx(lr,{label:"Border Radius",min:0,max:99,value:e?.border?.border_radius??0,onChange:l=>t(c=>({...c,border:{...c.border,border_radius:l}})),name:"border_radius",id:"border-radius"}),a.jsx(qv,{hoverEffect:e?.hoverEffect||"none",handleHoverEffect:l=>t(c=>({...c,hoverEffect:l}))})]})]})]})},Qv=({styles:e,setStyles:t,isExpanded:r,setIsEdited:n,tabs:o,currentTab:s,setCurrentTab:i})=>{const l=d=>{t(u=>{const p=d(u);return n(!0),p})},c=d=>{(d===o.thumbnail||d===o.preview)&&i(d)};return a.jsxs("div",{className:D("ecr-admin-sidepanel",r?"ecr-admin-sidepanel--expanded":"ecr-admin-sidepanel--collapsed"),children:[a.jsxs("div",{className:"ecr-admin-sidepanel__header",children:[a.jsx("p",{className:"ecr-admin-sidepanel__title",children:"Customization"}),a.jsx("small",{className:"ecr-admin-sidepanel__subtitle",children:"Customize your widget however you like"})]}),a.jsx("div",{className:"ecr-admin-sidepanel__body",children:a.jsxs(Gb,{value:s,onValueChange:c,className:"ecr-admin-sidepanel__tabs",children:[a.jsxs(Kb,{className:"ecr-admin-sidepanel__tabs-list",children:[a.jsx(Lc,{value:o.thumbnail,children:"Thumbnail"}),a.jsx(Lc,{value:o.preview,children:"Preview"})]}),a.jsx(Ic,{value:o.thumbnail,children:a.jsx(Zv,{styles:e,updateStyles:l})}),a.jsx(Ic,{value:o.preview,children:a.jsx(Dv,{styles:e,updateStyles:l})})]})})]})},e_=e=>{const t=Se(),[r,n]=y.useState(""),[o,s]=y.useState([]),[i,l]=y.useState(et),[c,d]=y.useState(!0),[u,p]=y.useState(!1),[m,h]=y.useState(!1);y.useEffect(()=>{(async()=>{if(!e){d(!1);return}d(!0);try{const v=(await ue.get(`stories/${e}`)).data;n(v.group_name),s(v.stories),l(v.styles??et)}catch(_){_ instanceof Error?G.error(_.message):G.error("Something went wrong. Try again later!")}finally{d(!1)}})()},[e]);const b=async x=>{const _=o.map(j=>j.id),v={group_name:r,styles:i,story_ids:_};e&&(v.group_id=e);const w=await ue.post("stories/manage-group-stories",v);if(!e){const j=w.data.group_id;t(`?view=${K.mg}&gid=${j}`,{replace:!0})}return{...w.data,isNewGroup:!e}};return{groupTitle:r,setGroupTitle:n,thisGroupReels:o,setThisGroupReels:s,styles:i,setStyles:l,isLoading:c,isSaving:u,isEdited:m,setIsEdited:h,handleSave:async()=>{try{p(!0);const x=await b();return h(!1),G.success("Changes saved successfully!"),x}catch(x){return x instanceof Error?G.error(x.message):G.error("Something went wrong. Try again later!"),null}finally{p(!1)}}}},t_=e=>{const[t,r]=y.useState(!1),n=y.useRef(null),o=y.useRef(null),s=y.useRef(!1),i=y.useRef(typeof window<"u"?window.location.hash:"");return y.useEffect(()=>{e||(n.current=null,o.current=null,r(!1))},[e]),y.useEffect(()=>{if(!e)return;const p=m=>{m.preventDefault(),m.returnValue=""};return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[e]),y.useEffect(()=>{const p=()=>{const m=window.location.hash;if(!e){i.current=m;return}if(s.current){s.current=!1,i.current=m;return}m!==i.current&&(o.current=m,window.location.hash=i.current,r(!0))};return window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[e]),{showLeaveModal:t,requestLeave:p=>{if(!e){p();return}n.current=p,r(!0)},confirmLeave:()=>{if(r(!1),n.current){const p=n.current;n.current=null,s.current=!0,p();return}if(o.current){const p=o.current;o.current=null,s.current=!0,window.location.hash=p}},cancelLeave:()=>{n.current=null,o.current=null,r(!1)},allowNextNavigation:p=>{s.current=!0,p()}}},xd={thumbnail:"thumbnail",preview:"preview"},r_=()=>{const e=Se(),{state:t}=Ht(),[r]=Vt(),n=r.get("gid"),{groupTitle:o,setGroupTitle:s,thisGroupReels:i,setThisGroupReels:l,styles:c,setStyles:d,isLoading:u,isSaving:p,isEdited:m,setIsEdited:h,handleSave:b}=e_(n),{allReels:f,setAllReels:x,searchTerm:_,setSearchTerm:v,isSearching:w,lastStoryElementRef:j}=Xs(n),[C,N]=y.useState(""),[k,E]=y.useState(!0),[T,O]=y.useState(xd.thumbnail),{showLeaveModal:L,requestLeave:A,confirmLeave:I,cancelLeave:z,allowNextNavigation:$}=t_(m),R=async(P,q)=>{try{N(P.story_uuid);const X=q==="add"?[P,...i]:i.filter(Z=>Z.story_uuid!==P.story_uuid);l(X),x(q==="add"?Z=>Z.filter(pe=>pe.story_uuid!==P.story_uuid):Z=>[...Z,P]),h(!0)}catch(X){X instanceof Error?G.error(X.message):G.error("Something went wrong. Please try again later!")}finally{N("")}};y.useEffect(()=>{if(!u&&t){const P=f.findIndex(q=>q.id==t.storyId);if(P!==-1){const q=f[P];x(X=>X.filter(Z=>Z.id!=q.id)),l(X=>[q,...X]),h(!0)}}},[t,f,u,x,l,h]);const U=async()=>{const P=await b();P?.isNewGroup&&$(()=>{e(`?view=${K.mg}&gid=${P.group_id}`,{replace:!0})})};return u?a.jsx(Lr,{}):a.jsxs(bb,{value:{requestLeave:A},children:[a.jsx(vt,{left:[a.jsx(_t,{name:"Manage Widget",Icon:Pr},"page"),a.jsx(Xt,{cb:()=>A(()=>e(`?view=${K.ag}`))},"back")],center:[a.jsxs("div",{className:"ecr-admin-group-title__wrapper",children:[a.jsx(Js,{placeholder:"Enter group title",title:o,setTitle:s,setIsEdited:h,style:{paddingInline:"32px"}}),o&&a.jsxs(Uo,{children:[a.jsx(Ho,{className:"ecr-admin-group-title-customization__trigger",children:a.jsx(V0,{})}),a.jsxs(Vo,{className:"ecr-admin-group-title-customization-dialog",children:[a.jsx(Wo,{children:a.jsx(qo,{children:"Customize title appearance"})}),a.jsx(hb,{styles:c,setStyles:d,setIsEdited:h}),a.jsx("div",{style:{display:"flex",justifyContent:"end",marginTop:40},children:a.jsx(x0,{asChild:!0,children:a.jsx(re,{style:{paddingInline:40},variant:"outline",children:"Ok"})})})]})]})]},"title")],right:[a.jsx(H0,{isExpanded:k,setIsExpanded:E},"toggle"),a.jsx(lo,{onSave:U,isSaving:p,disabled:!m},"save")]}),a.jsx(Jt,{breads:[{label:"Dashboard",href:`?view=${K.ag}`},{label:"Manage Widget"}],onNavigate:P=>A(()=>e(P))}),a.jsxs("div",{className:"ecr-admin-group-edit",children:[a.jsx(Nb,{allReels:f,gid:n,handleSelectReel:R,searchTerm:_,setSearchTerm:v,isSearching:w,togglingId:C,lastStoryElementRef:j}),a.jsx(kb,{gid:n,reels:i,styles:c,handleRemoveReel:R,togglingId:C,currentTab:T}),a.jsx(Qv,{isExpanded:k,setIsEdited:h,styles:c,setStyles:d,tabs:xd,setCurrentTab:O,currentTab:T})]}),L&&a.jsx(Or,{onReject:z,onAccept:I,isLoading:!1,message:"You have unsaved changes. Leave this page without saving?"})]})};function n_(){const[e]=Vt(),t=e.get("view")||K.ag;let r;switch(t){case K.settings:r=a.jsx(M0,{});break;case K.ar:r=a.jsx(jf,{});break;case K.stat:r=a.jsx($0,{});break;case K.cr:r=a.jsx(E0,{});break;case K.mg:r=a.jsx(r_,{});break;default:r=a.jsx(I0,{})}return a.jsxs("div",{children:[r,a.jsx(Bu,{position:"top-right",toastOptions:{style:{padding:"16px",marginTop:"24px",fontSize:"16px"}}})]})}const bd=async(e,t,r,n={})=>{try{if(await ue.post(`group/${e}/story/${t}/view`),n.isActive&&!n.isActive())return;r(o=>({...o,[t]:Number(o[t]||0)+1}))}catch{}},o_=()=>a.jsx(a.Fragment,{children:a.jsx("div",{className:"ecr-player__loader",children:a.jsxs("div",{className:"ecr-loader",children:[a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"}),a.jsx("div",{className:"ecr-loader__ball"})]})})}),a_=()=>{const e=y.useContext(pa),{stories:t,styles:r,groupId:n,isPlaying:o,setIsPlaying:s,setStoryViews:i}=e,[l,c]=y.useState(null),[d,u]=y.useState(!0),[p,m]=y.useState(0),[h,b]=y.useState(!1),f=y.useRef(!0),x=t.length-1,[_,v]=y.useState({index:0,story_uuid:t[0]?.story_uuid}),w=A=>!!A?.files?.[0]?.mime_type?.startsWith("video"),j=y.useCallback((A,I=1)=>{if(t.length===0)return null;let z=A;for(let $=0;$<t.length;$+=1){const R=t[z];if(w(R))return{story:R,index:z};z=(z+I+t.length)%t.length}return null},[t]),C=y.useCallback(()=>{const A=o,I=t.findIndex(R=>String(R.story_uuid)===A),z=I>=0?t[I]:null,$=w(z)?{story:z,index:I}:j(Math.max(I,0),1);$?.story?(c($.story),I!==$.index&&$.story.story_uuid!==o&&s($.story.story_uuid)):c(null),u(!1)},[o,t,s,j]);y.useEffect(()=>{C()},[o,t,C]),y.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),y.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const N=(A=1)=>{u(!0);const I=t.findIndex(P=>String(P.story_uuid)===String(o)),z=A>0?1:-1,$=A>0?x>I?I+1:0:I>0?I-1:x,R=j($,z);if(!R?.story){u(!1);return}const U=R.story;if(U.story_uuid===o){u(!1),s(null);return}v({index:0,story_uuid:U.story_uuid}),n&&bd(n,U.id,i,{isActive:()=>f.current}),s(U.story_uuid),u(!1)},k=()=>{const A=l?.files??[];_?.index>0?v(I=>({index:I.index-1,story_uuid:A[I.index-1].story_uuid})):N(-1)},E=()=>{const A=l?.files??[];_?.index+1<A.length?v(I=>({index:I.index+1,story_uuid:A[I.index+1].story_uuid})):(N(),A[0]?.story_uuid&&v({index:0,story_uuid:A[0].story_uuid}))},T=A=>{A.target===A.currentTarget&&s(null)},O=r?.playerAppearance??"overlay",L=l?.links&&l.links.length>0?l.links[0]:null;return a.jsx("div",{onClick:T,style:{zIndex:999999999999999,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(8px)"},className:"ecommreels-story-modal ecr-player",children:l&&a.jsxs("div",{className:"ecr-player__stage",children:[a.jsx(xt,{onClick:k,className:"ecr-player__nav--left",children:a.jsx(Gt,{size:24})}),a.jsx(xt,{onClick:E,className:"ecr-player__nav--right",children:a.jsx(Kt,{size:24})}),a.jsxs("div",{id:"player",className:"ecr-player__frame",children:[l&&a.jsx(ns,{playingStory:l,duration:p,currentFileIndex:_,isPaused:h},`${l.story_uuid}-${_.index}`),a.jsx("div",{onClick:()=>s(null),className:"ecr-player__close",children:a.jsx(Yt,{className:"ecr-player__close-icon"})}),d?a.jsx(o_,{}):l?.files.length>0&&a.jsx(is,{currentFileIndex:_,files:l?.files,setDuration:m,setIsPlaying:s,isPaused:h,setIsPaused:b,handlePrevFile:k,handleNextFile:E,storyId:l.id,storyTitle:l?.title}),O==="overlay"&&L?a.jsx(kn,{link:L,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"8px",width:"95%",borderRadius:"6px"}}):null,O==="title"?a.jsx(hc,{title:l.title}):null]})]})})},vd=({story:e,styles:t,handlePlaying:r,template:n,storyViews:o,setStoryViews:s})=>{const i=e.links&&e.links.length>0?e.links[0]:null,l=t.appearance??"overlay";return a.jsxs("div",{className:`ecr-thumb ${t.hoverEffect??""}`,style:{width:n==="carousel"?`${t?.size}px`:"auto"},children:[a.jsxs("div",{onClick:()=>r({sid:e.id,story_uuid:e.story_uuid}),className:"ecr-thumb__frame",style:{border:`${t?.border?.border_width}px solid ${t?.border?.border_color}`,borderRadius:t.shape==="rectangle"?`${t?.border?.border_radius}px`:"50%",aspectRatio:t.shape==="rectangle"?"9/16":"1/1"},children:[a.jsx(Yn,{story:e,styles:t,storyViews:o,setStoryViews:s}),l==="overlay"&&t.shape==="rectangle"&&i&&a.jsx(kn,{link:i,usedFor:"user",usedIn:"thumb",style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"4px",width:"calc(100% - 8px)",borderRadius:"6px"}})]}),l==="title"?a.jsx("p",{style:{width:`${t?.size}px`},className:"ecr-reel__title",children:e.title}):null]})},s_=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>{const{thumbsContainerRef:s,thumbsWrapperRef:i,isOverflowing:l,canScrollLeft:c,canScrollRight:d,scrollBy:u,scrollStep:p}=mc([e],!0);return a.jsxs("div",{className:"ecr-front-carousel",children:[a.jsx("div",{ref:s,className:"ecr-front-carousel__viewport",children:a.jsx("div",{ref:i,style:{gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:t.hoverEffect==="zoom-in"?"ecr-front-carousel__track ecr-front-carousel__track--zoom":"ecr-front-carousel__track",children:e?.map(m=>m?.files[0]?.mime_type.startsWith("video")?a.jsx(vd,{story:m,styles:t,handlePlaying:r,template:"carousel",storyViews:n,setStoryViews:o},m.story_uuid):null)})}),l&&c&&a.jsx("button",{onClick:()=>u(-p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--left",children:a.jsx(Gt,{size:20,style:{width:"20px",height:"20px"}})}),l&&d&&a.jsx("button",{onClick:()=>u(p),className:"ecr-front-carousel__nav ecr-front-carousel__nav--right",children:a.jsx(Kt,{size:20,style:{width:"20px",height:"20px"}})})]})},_d=({stories:e,styles:t,handlePlaying:r,storyViews:n,setStoryViews:o})=>a.jsx("div",{className:"ecr-front-grid",children:a.jsx("div",{style:{paddingBlock:`${t.topBottomSpacing}px`,gap:`${t.gap}px`,"--thumbnail-size":`${t?.size}px`},className:"ecr-front-grid__list",children:e?.map(s=>s?.files[0]?.mime_type.startsWith("video")?a.jsx(vd,{story:s,styles:t,handlePlaying:r,template:"grid",storyViews:n,setStoryViews:o},s.story_uuid):null)})}),i_={carousel:s_,grid:_d},l_=()=>{const e=y.useContext(pa),{groupTitle:t,styles:r,stories:n,groupId:o,setIsPlaying:s,storyViews:i,setStoryViews:l}=e,c=y.useRef(!0);y.useEffect(()=>(c.current=!0,()=>{c.current=!1}),[]);const d=r.template??"carousel",u=i_[d]||_d,p=({sid:m,story_uuid:h})=>{s(h),o&&bd(o,m,l,{isActive:()=>c.current})};return a.jsxs("div",{children:[r?.widgetTitle&&r?.widgetTitle?.alignment!=="hidden"&&t?a.jsx("h2",{style:{textAlign:r.widgetTitle?.alignment,fontSize:r.widgetTitle?.fontSize,color:r.widgetTitle?.color,marginBottom:24},children:t}):null,a.jsx(u,{stories:n,styles:r,handlePlaying:p,storyViews:i,setStoryViews:l})]})},c_=e=>{const[t,r]=y.useState(""),[n,o]=y.useState([]),[s,i]=y.useState(et),[l,c]=y.useState(!1),[d,u]=y.useState(null),p=y.useCallback(async()=>{const m=e?.trim();if(!m){o([]),i(et),c(!1),u(null);return}const h=new AbortController;c(!0),u(null);try{const b=await ue.get(`stories/${m}`,{signal:h.signal});if(h.signal.aborted)return;r(b.data.group_name),o(b.data.stories),i(b.data.styles||et)}catch(b){if(h.signal.aborted)return;u(b)}finally{c(!1)}return()=>{h.abort()}},[e]);return y.useEffect(()=>{p()},[e]),{groupTitle:t,stories:n,styles:s,isLoading:l,error:d}},pa=y.createContext(void 0),yd=({groupId:e})=>{const[t,r]=y.useState(null),[n,o]=y.useState({}),{groupTitle:s,stories:i,styles:l}=c_(e);return a.jsxs(pa.Provider,{value:{groupTitle:s,groupId:e,stories:i,styles:l,isPlaying:t,setIsPlaying:r,storyViews:n,setStoryViews:o},children:[t&&a.jsx(a_,{}),a.jsx(l_,{})]})};ga(()=>{const e=document.getElementById("ecommreels-admin-app");e&&Rn.createRoot(e).render(a.jsx(Xd,{children:a.jsx(n_,{})}))}),ga(()=>{const e=document.querySelectorAll(".ecommreels-short-code"),t=document.querySelectorAll(".reelswp-group-short-code");e.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Rn.createRoot(n).render(a.jsx(yd,{groupId:o}))}),t.forEach(r=>{const n=r,o=n.dataset.id;if(!o)return;Rn.createRoot(n).render(a.jsx(yd,{groupId:o}))})})})(React,wp.domReady,wp.element,ReactDOM);
  • ecomm-reels/trunk/ecomm-reels.php

    r3449375 r3450956  
    33 * Plugin Name:       ReelsWp - Shoppable Videos & Vertical Reels Carousels
    44 * Description:       Create Insta style reels and stories with ReelsWP and add them anywhere on your WordPress site. Add fast, mobile friendly video grid and carousel layouts to your homepage, blog or news articles, and product pages.
    5  * Version:           4.0.6
     5 * Version:           4.0.7
    66 * Requires at least: 5.8
    77 * Requires PHP:      7.4
     
    2020define('ECOMMREELS_ASSETS', plugins_url('/', __FILE__));
    2121define('ECOMMREELS_FILE_PREFIX', 'class-');
    22 define('WP_REELS_VER', '4.0.6');
     22define('WP_REELS_VER', '4.0.7');
    2323
    2424// 1) Composer autoloader (optional, guarded)
  • ecomm-reels/trunk/includes/domain/repositories/StoriesRepo.php

    r3444846 r3450956  
    198198
    199199        if (!empty($story['links']) && is_array($story['links'])) {
    200             $first_custom_link = null;
    201             foreach ($story['links'] as $link) {
    202                 if (isset($link['btn_type']) && $link['btn_type'] === 'custom') {
    203                     $first_custom_link = $link;
    204                     break;
    205                 }
    206             }
    207             $story['links'] = $first_custom_link ? [$first_custom_link] : [];
    208         }
    209 
     200            $first_link = reset($story['links']);
     201            $story['links'] = $first_link ? [$first_link] : [];
     202        }
    210203        return $story;
    211204    }
     
    268261    }
    269262}
    270 
  • ecomm-reels/trunk/readme.txt

    r3449375 r3450956  
    55Tested up to: 6.9
    66Requires PHP: 7.4
    7 Stable tag: 4.0.6
     7Stable tag: 4.0.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    100100== Changelog ==
    101101
     102= 4.0.7 - 2026-01-31 =
     103- New: Added Product linking functionality to the reels.
     104
    102105= 4.0.6 - 2026-01-29 =
    103106- New: Added an "Only Title" option in the Preview Appearance control.
Note: See TracChangeset for help on using the changeset viewer.