{"version":3,"sources":["#style-inject:#style-inject","../src/styles/global.css","../src/ElementSelector.tsx","../src/utils.ts","../src/ElementHighlighter.tsx","../src/ElementInspector.tsx","../src/constants.ts","../src/components/bubble-menu/MenuArrow.tsx","../src/components/MentionChat.tsx","../src/stores/workflows.ts","../src/stores/elementEvent.ts","../src/components/ui/mention.tsx","../src/Icons.tsx","../src/components/PromptForm.tsx","../src/components/bubble-menu/ExpandedMenu.tsx","../src/components/BubbleMenuButton.tsx","../src/components/bubble-menu/FloatingButton.tsx","../src/components/bubble-menu/BubbleMenu.tsx","../src/components/ElementTagLabel.tsx","../src/components/highlights/HoveredElement.tsx","../src/components/highlights/SelectedElements.tsx","../src/components/InspectionOverlay.tsx","../src/hooks/useDarkMode.ts","../src/hooks/useElementBubblePosition.ts","../src/hooks/useElementSelection.ts","../src/hooks/useIframeMessaging.ts","../src/hooks/useInspector.ts"],"sourcesContent":["\n          export default function styleInject(css, { insertAt } = {}) {\n            if (!css || typeof document === 'undefined') return\n          \n            const head = document.head || document.getElementsByTagName('head')[0]\n            const style = document.createElement('style')\n            style.type = 'text/css'\n          \n            if (insertAt === 'top') {\n              if (head.firstChild) {\n                head.insertBefore(style, head.firstChild)\n              } else {\n                head.appendChild(style)\n              }\n            } else {\n              head.appendChild(style)\n            }\n          \n            if (style.styleSheet) {\n              style.styleSheet.cssText = css\n            } else {\n              style.appendChild(document.createTextNode(css))\n            }\n          }\n          ","import styleInject from '#style-inject';styleInject(\"/*! tailwindcss v4.1.10 | MIT License | https://tailwindcss.com */\\n@layer properties;\\n@layer theme, base, components, utilities;\\n@layer theme {\\n  :root,\\n  :host {\\n    --font-sans:\\n      ui-sans-serif,\\n      system-ui,\\n      sans-serif,\\n      \\\"Apple Color Emoji\\\",\\n      \\\"Segoe UI Emoji\\\",\\n      \\\"Segoe UI Symbol\\\",\\n      \\\"Noto Color Emoji\\\";\\n    --font-mono:\\n      ui-monospace,\\n      SFMono-Regular,\\n      Menlo,\\n      Monaco,\\n      Consolas,\\n      \\\"Liberation Mono\\\",\\n      \\\"Courier New\\\",\\n      monospace;\\n    --color-red-400: oklch(70.4% 0.191 22.216);\\n    --color-red-700: oklch(50.5% 0.213 27.518);\\n    --color-blue-50: oklch(97% 0.014 254.604);\\n    --color-blue-200: oklch(88.2% 0.059 254.128);\\n    --color-blue-500: oklch(62.3% 0.214 259.815);\\n    --color-blue-700: oklch(48.8% 0.243 264.376);\\n    --color-blue-800: oklch(42.4% 0.199 265.638);\\n    --color-blue-950: oklch(28.2% 0.091 267.935);\\n    --color-indigo-500: oklch(58.5% 0.233 277.117);\\n    --color-gray-300: oklch(87.2% 0.01 258.338);\\n    --color-gray-500: oklch(55.1% 0.027 264.364);\\n    --color-gray-600: oklch(44.6% 0.03 256.802);\\n    --color-gray-700: oklch(37.3% 0.034 259.733);\\n    --color-gray-800: oklch(27.8% 0.033 256.848);\\n    --color-black: #000;\\n    --color-white: #fff;\\n    --spacing: 0.25rem;\\n    --text-xs: 0.75rem;\\n    --text-xs--line-height: calc(1 / 0.75);\\n    --text-sm: 0.875rem;\\n    --text-sm--line-height: calc(1.25 / 0.875);\\n    --text-base: 1rem;\\n    --text-base--line-height: calc(1.5 / 1);\\n    --font-weight-medium: 500;\\n    --font-weight-semibold: 600;\\n    --radius-sm: 0.25rem;\\n    --radius-md: 0.375rem;\\n    --radius-xl: 0.75rem;\\n    --animate-spin: spin 1s linear infinite;\\n    --default-transition-duration: 150ms;\\n    --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\\n    --default-font-family: var(--font-sans);\\n    --default-mono-font-family: var(--font-mono);\\n  }\\n}\\n@layer base {\\n  *,\\n  ::after,\\n  ::before,\\n  ::backdrop,\\n  ::file-selector-button {\\n    box-sizing: border-box;\\n    margin: 0;\\n    padding: 0;\\n    border: 0 solid;\\n  }\\n  html,\\n  :host {\\n    line-height: 1.5;\\n    -webkit-text-size-adjust: 100%;\\n    -moz-tab-size: 4;\\n    -o-tab-size: 4;\\n    tab-size: 4;\\n    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \\\"Apple Color Emoji\\\", \\\"Segoe UI Emoji\\\", \\\"Segoe UI Symbol\\\", \\\"Noto Color Emoji\\\");\\n    font-feature-settings: var(--default-font-feature-settings, normal);\\n    font-variation-settings: var(--default-font-variation-settings, normal);\\n    -webkit-tap-highlight-color: transparent;\\n  }\\n  hr {\\n    height: 0;\\n    color: inherit;\\n    border-top-width: 1px;\\n  }\\n  abbr:where([title]) {\\n    -webkit-text-decoration: underline dotted;\\n    text-decoration: underline dotted;\\n  }\\n  h1,\\n  h2,\\n  h3,\\n  h4,\\n  h5,\\n  h6 {\\n    font-size: inherit;\\n    font-weight: inherit;\\n  }\\n  a {\\n    color: inherit;\\n    -webkit-text-decoration: inherit;\\n    text-decoration: inherit;\\n  }\\n  b,\\n  strong {\\n    font-weight: bolder;\\n  }\\n  code,\\n  kbd,\\n  samp,\\n  pre {\\n    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \\\"Liberation Mono\\\", \\\"Courier New\\\", monospace);\\n    font-feature-settings: var(--default-mono-font-feature-settings, normal);\\n    font-variation-settings: var(--default-mono-font-variation-settings, normal);\\n    font-size: 1em;\\n  }\\n  small {\\n    font-size: 80%;\\n  }\\n  sub,\\n  sup {\\n    font-size: 75%;\\n    line-height: 0;\\n    position: relative;\\n    vertical-align: baseline;\\n  }\\n  sub {\\n    bottom: -0.25em;\\n  }\\n  sup {\\n    top: -0.5em;\\n  }\\n  table {\\n    text-indent: 0;\\n    border-color: inherit;\\n    border-collapse: collapse;\\n  }\\n  :-moz-focusring {\\n    outline: auto;\\n  }\\n  progress {\\n    vertical-align: baseline;\\n  }\\n  summary {\\n    display: list-item;\\n  }\\n  ol,\\n  ul,\\n  menu {\\n    list-style: none;\\n  }\\n  img,\\n  svg,\\n  video,\\n  canvas,\\n  audio,\\n  iframe,\\n  embed,\\n  object {\\n    display: block;\\n    vertical-align: middle;\\n  }\\n  img,\\n  video {\\n    max-width: 100%;\\n    height: auto;\\n  }\\n  button,\\n  input,\\n  select,\\n  optgroup,\\n  textarea,\\n  ::file-selector-button {\\n    font: inherit;\\n    font-feature-settings: inherit;\\n    font-variation-settings: inherit;\\n    letter-spacing: inherit;\\n    color: inherit;\\n    border-radius: 0;\\n    background-color: transparent;\\n    opacity: 1;\\n  }\\n  :where(select:is([multiple], [size])) optgroup {\\n    font-weight: bolder;\\n  }\\n  :where(select:is([multiple], [size])) optgroup option {\\n    padding-inline-start: 20px;\\n  }\\n  ::file-selector-button {\\n    margin-inline-end: 4px;\\n  }\\n  ::-moz-placeholder {\\n    opacity: 1;\\n  }\\n  ::placeholder {\\n    opacity: 1;\\n  }\\n  @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\\n    ::-moz-placeholder {\\n      color: currentcolor;\\n      @supports (color: color-mix(in lab, red, red)) {\\n        color: color-mix(in oklab, currentcolor 50%, transparent);\\n      }\\n    }\\n    ::placeholder {\\n      color: currentcolor;\\n      @supports (color: color-mix(in lab, red, red)) {\\n        color: color-mix(in oklab, currentcolor 50%, transparent);\\n      }\\n    }\\n  }\\n  textarea {\\n    resize: vertical;\\n  }\\n  ::-webkit-search-decoration {\\n    -webkit-appearance: none;\\n  }\\n  ::-webkit-date-and-time-value {\\n    min-height: 1lh;\\n    text-align: inherit;\\n  }\\n  ::-webkit-datetime-edit {\\n    display: inline-flex;\\n  }\\n  ::-webkit-datetime-edit-fields-wrapper {\\n    padding: 0;\\n  }\\n  ::-webkit-datetime-edit,\\n  ::-webkit-datetime-edit-year-field,\\n  ::-webkit-datetime-edit-month-field,\\n  ::-webkit-datetime-edit-day-field,\\n  ::-webkit-datetime-edit-hour-field,\\n  ::-webkit-datetime-edit-minute-field,\\n  ::-webkit-datetime-edit-second-field,\\n  ::-webkit-datetime-edit-millisecond-field,\\n  ::-webkit-datetime-edit-meridiem-field {\\n    padding-block: 0;\\n  }\\n  :-moz-ui-invalid {\\n    box-shadow: none;\\n  }\\n  button,\\n  input:where([type=button], [type=reset], [type=submit]),\\n  ::file-selector-button {\\n    -webkit-appearance: button;\\n    -moz-appearance: button;\\n    appearance: button;\\n  }\\n  ::-webkit-inner-spin-button,\\n  ::-webkit-outer-spin-button {\\n    height: auto;\\n  }\\n  [hidden]:where(:not([hidden=until-found])) {\\n    display: none !important;\\n  }\\n}\\n@layer utilities {\\n  .pointer-events-auto {\\n    pointer-events: auto;\\n  }\\n  .pointer-events-none {\\n    pointer-events: none;\\n  }\\n  .visible {\\n    visibility: visible;\\n  }\\n  .sr-only {\\n    position: absolute;\\n    width: 1px;\\n    height: 1px;\\n    padding: 0;\\n    margin: -1px;\\n    overflow: hidden;\\n    clip: rect(0, 0, 0, 0);\\n    white-space: nowrap;\\n    border-width: 0;\\n  }\\n  .absolute {\\n    position: absolute;\\n  }\\n  .fixed {\\n    position: fixed;\\n  }\\n  .relative {\\n    position: relative;\\n  }\\n  .inset-0 {\\n    inset: calc(var(--spacing) * 0);\\n  }\\n  .inset-y-0 {\\n    inset-block: calc(var(--spacing) * 0);\\n  }\\n  .top-0 {\\n    top: calc(var(--spacing) * 0);\\n  }\\n  .top-\\\\[0\\\\.5px\\\\] {\\n    top: 0.5px;\\n  }\\n  .right-0 {\\n    right: calc(var(--spacing) * 0);\\n  }\\n  .right-6 {\\n    right: calc(var(--spacing) * 6);\\n  }\\n  .bottom-6 {\\n    bottom: calc(var(--spacing) * 6);\\n  }\\n  .left-\\\\[0\\\\.5px\\\\] {\\n    left: 0.5px;\\n  }\\n  .z-50 {\\n    z-index: 50;\\n  }\\n  .z-\\\\[9998\\\\] {\\n    z-index: 9998;\\n  }\\n  .z-\\\\[9999\\\\] {\\n    z-index: 9999;\\n  }\\n  .z-\\\\[10000\\\\] {\\n    z-index: 10000;\\n  }\\n  .z-\\\\[10001\\\\] {\\n    z-index: 10001;\\n  }\\n  .container {\\n    width: 100%;\\n    @media (width >= 40rem) {\\n      max-width: 40rem;\\n    }\\n    @media (width >= 48rem) {\\n      max-width: 48rem;\\n    }\\n    @media (width >= 64rem) {\\n      max-width: 64rem;\\n    }\\n    @media (width >= 80rem) {\\n      max-width: 80rem;\\n    }\\n    @media (width >= 96rem) {\\n      max-width: 96rem;\\n    }\\n  }\\n  .mt-3 {\\n    margin-top: calc(var(--spacing) * 3);\\n  }\\n  .mr-2 {\\n    margin-right: calc(var(--spacing) * 2);\\n  }\\n  .mb-2 {\\n    margin-bottom: calc(var(--spacing) * 2);\\n  }\\n  .mb-4 {\\n    margin-bottom: calc(var(--spacing) * 4);\\n  }\\n  .mb-6 {\\n    margin-bottom: calc(var(--spacing) * 6);\\n  }\\n  .-ml-1 {\\n    margin-left: calc(var(--spacing) * -1);\\n  }\\n  .block {\\n    display: block;\\n  }\\n  .flex {\\n    display: flex;\\n  }\\n  .inline {\\n    display: inline;\\n  }\\n  .inline-flex {\\n    display: inline-flex;\\n  }\\n  .table {\\n    display: table;\\n  }\\n  .field-sizing-content {\\n    field-sizing: content;\\n  }\\n  .h-0 {\\n    height: calc(var(--spacing) * 0);\\n  }\\n  .h-4 {\\n    height: calc(var(--spacing) * 4);\\n  }\\n  .h-6 {\\n    height: calc(var(--spacing) * 6);\\n  }\\n  .h-8 {\\n    height: calc(var(--spacing) * 8);\\n  }\\n  .h-screen {\\n    height: 100vh;\\n  }\\n  .min-h-16 {\\n    min-height: calc(var(--spacing) * 16);\\n  }\\n  .w-0 {\\n    width: calc(var(--spacing) * 0);\\n  }\\n  .w-4 {\\n    width: calc(var(--spacing) * 4);\\n  }\\n  .w-6 {\\n    width: calc(var(--spacing) * 6);\\n  }\\n  .w-8 {\\n    width: calc(var(--spacing) * 8);\\n  }\\n  .w-\\\\[350px\\\\] {\\n    width: 350px;\\n  }\\n  .w-full {\\n    width: 100%;\\n  }\\n  .w-screen {\\n    width: 100vw;\\n  }\\n  .min-w-\\\\[8rem\\\\] {\\n    min-width: 8rem;\\n  }\\n  .min-w-\\\\[300px\\\\] {\\n    min-width: 300px;\\n  }\\n  .border-collapse {\\n    border-collapse: collapse;\\n  }\\n  .-translate-y-1 {\\n    --tw-translate-y: calc(var(--spacing) * -1);\\n    translate: var(--tw-translate-x) var(--tw-translate-y);\\n  }\\n  .transform {\\n    transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\\n  }\\n  .animate-spin {\\n    animation: var(--animate-spin);\\n  }\\n  .cursor-cell {\\n    cursor: cell;\\n  }\\n  .cursor-default {\\n    cursor: default;\\n  }\\n  .cursor-not-allowed {\\n    cursor: not-allowed;\\n  }\\n  .cursor-pointer {\\n    cursor: pointer;\\n  }\\n  .resize {\\n    resize: both;\\n  }\\n  .resize-none {\\n    resize: none;\\n  }\\n  .appearance-none {\\n    -webkit-appearance: none;\\n    -moz-appearance: none;\\n    appearance: none;\\n  }\\n  .items-center {\\n    align-items: center;\\n  }\\n  .justify-between {\\n    justify-content: space-between;\\n  }\\n  .justify-center {\\n    justify-content: center;\\n  }\\n  .gap-1 {\\n    gap: calc(var(--spacing) * 1);\\n  }\\n  .gap-1\\\\.5 {\\n    gap: calc(var(--spacing) * 1.5);\\n  }\\n  .gap-2 {\\n    gap: calc(var(--spacing) * 2);\\n  }\\n  .overflow-hidden {\\n    overflow: hidden;\\n  }\\n  .overflow-y-auto {\\n    overflow-y: auto;\\n  }\\n  .rounded {\\n    border-radius: 0.25rem;\\n  }\\n  .rounded-full {\\n    border-radius: calc(infinity * 1px);\\n  }\\n  .rounded-md {\\n    border-radius: var(--radius-md);\\n  }\\n  .rounded-sm {\\n    border-radius: var(--radius-sm);\\n  }\\n  .rounded-xl {\\n    border-radius: var(--radius-xl);\\n  }\\n  .border {\\n    border-style: var(--tw-border-style);\\n    border-width: 1px;\\n  }\\n  .border-2 {\\n    border-style: var(--tw-border-style);\\n    border-width: 2px;\\n  }\\n  .border-t-8 {\\n    border-top-style: var(--tw-border-style);\\n    border-top-width: 8px;\\n  }\\n  .border-r-8 {\\n    border-right-style: var(--tw-border-style);\\n    border-right-width: 8px;\\n  }\\n  .border-b-8 {\\n    border-bottom-style: var(--tw-border-style);\\n    border-bottom-width: 8px;\\n  }\\n  .border-l-8 {\\n    border-left-style: var(--tw-border-style);\\n    border-left-width: 8px;\\n  }\\n  .\\\\!border-none {\\n    --tw-border-style: none !important;\\n    border-style: none !important;\\n  }\\n  .border-none {\\n    --tw-border-style: none;\\n    border-style: none;\\n  }\\n  .border-gray-300 {\\n    border-color: var(--color-gray-300);\\n  }\\n  .border-red-400 {\\n    border-color: var(--color-red-400);\\n  }\\n  .border-transparent {\\n    border-color: transparent;\\n  }\\n  .border-t-gray-800 {\\n    border-top-color: var(--color-gray-800);\\n  }\\n  .border-t-white {\\n    border-top-color: var(--color-white);\\n  }\\n  .border-b-gray-800 {\\n    border-bottom-color: var(--color-gray-800);\\n  }\\n  .border-b-white {\\n    border-bottom-color: var(--color-white);\\n  }\\n  .bg-\\\\[\\\\#3b82f6\\\\] {\\n    background-color: #3b82f6;\\n  }\\n  .bg-\\\\[\\\\#93c5fd\\\\] {\\n    background-color: #93c5fd;\\n  }\\n  .bg-\\\\[\\\\#2563eb\\\\] {\\n    background-color: #2563eb;\\n  }\\n  .bg-\\\\[rgba\\\\(52\\\\,53\\\\,65\\\\,0\\\\.8\\\\)\\\\] {\\n    background-color: rgba(52, 53, 65, 0.8);\\n  }\\n  .bg-transparent {\\n    background-color: transparent;\\n  }\\n  .bg-white {\\n    background-color: var(--color-white);\\n  }\\n  .fill-black {\\n    fill: var(--color-black);\\n  }\\n  .p-1 {\\n    padding: calc(var(--spacing) * 1);\\n  }\\n  .p-2 {\\n    padding: calc(var(--spacing) * 2);\\n  }\\n  .p-4 {\\n    padding: calc(var(--spacing) * 4);\\n  }\\n  .px-0 {\\n    padding-inline: calc(var(--spacing) * 0);\\n  }\\n  .px-0\\\\.5 {\\n    padding-inline: calc(var(--spacing) * 0.5);\\n  }\\n  .px-1 {\\n    padding-inline: calc(var(--spacing) * 1);\\n  }\\n  .px-1\\\\.5 {\\n    padding-inline: calc(var(--spacing) * 1.5);\\n  }\\n  .px-2 {\\n    padding-inline: calc(var(--spacing) * 2);\\n  }\\n  .px-3 {\\n    padding-inline: calc(var(--spacing) * 3);\\n  }\\n  .px-4 {\\n    padding-inline: calc(var(--spacing) * 4);\\n  }\\n  .py-0 {\\n    padding-block: calc(var(--spacing) * 0);\\n  }\\n  .py-0\\\\.5 {\\n    padding-block: calc(var(--spacing) * 0.5);\\n  }\\n  .py-1 {\\n    padding-block: calc(var(--spacing) * 1);\\n  }\\n  .py-1\\\\.5 {\\n    padding-block: calc(var(--spacing) * 1.5);\\n  }\\n  .py-2 {\\n    padding-block: calc(var(--spacing) * 2);\\n  }\\n  .py-3 {\\n    padding-block: calc(var(--spacing) * 3);\\n  }\\n  .pr-\\\\[40px\\\\] {\\n    padding-right: 40px;\\n  }\\n  .text-base {\\n    font-size: var(--text-base);\\n    line-height: var(--tw-leading, var(--text-base--line-height));\\n  }\\n  .text-sm {\\n    font-size: var(--text-sm);\\n    line-height: var(--tw-leading, var(--text-sm--line-height));\\n  }\\n  .text-xs {\\n    font-size: var(--text-xs);\\n    line-height: var(--tw-leading, var(--text-xs--line-height));\\n  }\\n  .text-\\\\[15px\\\\] {\\n    font-size: 15px;\\n  }\\n  .font-medium {\\n    --tw-font-weight: var(--font-weight-medium);\\n    font-weight: var(--font-weight-medium);\\n  }\\n  .font-semibold {\\n    --tw-font-weight: var(--font-weight-semibold);\\n    font-weight: var(--font-weight-semibold);\\n  }\\n  .\\\\!whitespace-nowrap {\\n    white-space: nowrap !important;\\n  }\\n  .text-blue-500 {\\n    color: var(--color-blue-500);\\n  }\\n  .text-gray-500 {\\n    color: var(--color-gray-500);\\n  }\\n  .text-gray-700 {\\n    color: var(--color-gray-700);\\n  }\\n  .text-red-400 {\\n    color: var(--color-red-400);\\n  }\\n  .text-white {\\n    color: var(--color-white);\\n  }\\n  .underline {\\n    text-decoration-line: underline;\\n  }\\n  .opacity-0 {\\n    opacity: 0%;\\n  }\\n  .opacity-25 {\\n    opacity: 25%;\\n  }\\n  .opacity-50 {\\n    opacity: 50%;\\n  }\\n  .opacity-75 {\\n    opacity: 75%;\\n  }\\n  .opacity-100 {\\n    opacity: 100%;\\n  }\\n  .\\\\!shadow-none {\\n    --tw-shadow: 0 0 #0000 !important;\\n    box-shadow:\\n      var(--tw-inset-shadow),\\n      var(--tw-inset-ring-shadow),\\n      var(--tw-ring-offset-shadow),\\n      var(--tw-ring-shadow),\\n      var(--tw-shadow) !important;\\n  }\\n  .shadow-lg {\\n    --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\\n    box-shadow:\\n      var(--tw-inset-shadow),\\n      var(--tw-inset-ring-shadow),\\n      var(--tw-ring-offset-shadow),\\n      var(--tw-ring-shadow),\\n      var(--tw-shadow);\\n  }\\n  .shadow-md {\\n    --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\\n    box-shadow:\\n      var(--tw-inset-shadow),\\n      var(--tw-inset-ring-shadow),\\n      var(--tw-ring-offset-shadow),\\n      var(--tw-ring-shadow),\\n      var(--tw-shadow);\\n  }\\n  .shadow-sm {\\n    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\\n    box-shadow:\\n      var(--tw-inset-shadow),\\n      var(--tw-inset-ring-shadow),\\n      var(--tw-ring-offset-shadow),\\n      var(--tw-ring-shadow),\\n      var(--tw-shadow);\\n  }\\n  .shadow-xs {\\n    --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05));\\n    box-shadow:\\n      var(--tw-inset-shadow),\\n      var(--tw-inset-ring-shadow),\\n      var(--tw-ring-offset-shadow),\\n      var(--tw-ring-shadow),\\n      var(--tw-shadow);\\n  }\\n  .\\\\!ring-0 {\\n    --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;\\n    box-shadow:\\n      var(--tw-inset-shadow),\\n      var(--tw-inset-ring-shadow),\\n      var(--tw-ring-offset-shadow),\\n      var(--tw-ring-shadow),\\n      var(--tw-shadow) !important;\\n  }\\n  .ring {\\n    --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\\n    box-shadow:\\n      var(--tw-inset-shadow),\\n      var(--tw-inset-ring-shadow),\\n      var(--tw-ring-offset-shadow),\\n      var(--tw-ring-shadow),\\n      var(--tw-shadow);\\n  }\\n  .outline-hidden {\\n    --tw-outline-style: none;\\n    outline-style: none;\\n    @media (forced-colors: active) {\\n      outline: 2px solid transparent;\\n      outline-offset: 2px;\\n    }\\n  }\\n  .outline {\\n    outline-style: var(--tw-outline-style);\\n    outline-width: 1px;\\n  }\\n  .transition {\\n    transition-property:\\n      color,\\n      background-color,\\n      border-color,\\n      outline-color,\\n      text-decoration-color,\\n      fill,\\n      stroke,\\n      --tw-gradient-from,\\n      --tw-gradient-via,\\n      --tw-gradient-to,\\n      opacity,\\n      box-shadow,\\n      transform,\\n      translate,\\n      scale,\\n      rotate,\\n      filter,\\n      -webkit-backdrop-filter,\\n      backdrop-filter,\\n      display,\\n      visibility,\\n      content-visibility,\\n      overlay,\\n      pointer-events;\\n    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\\n    transition-duration: var(--tw-duration, var(--default-transition-duration));\\n  }\\n  .transition-\\\\[color\\\\,box-shadow\\\\] {\\n    transition-property: color, box-shadow;\\n    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\\n    transition-duration: var(--tw-duration, var(--default-transition-duration));\\n  }\\n  .transition-all {\\n    transition-property: all;\\n    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\\n    transition-duration: var(--tw-duration, var(--default-transition-duration));\\n  }\\n  .transition-colors {\\n    transition-property:\\n      color,\\n      background-color,\\n      border-color,\\n      outline-color,\\n      text-decoration-color,\\n      fill,\\n      stroke,\\n      --tw-gradient-from,\\n      --tw-gradient-via,\\n      --tw-gradient-to;\\n    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\\n    transition-duration: var(--tw-duration, var(--default-transition-duration));\\n  }\\n  .duration-100 {\\n    --tw-duration: 100ms;\\n    transition-duration: 100ms;\\n  }\\n  .duration-150 {\\n    --tw-duration: 150ms;\\n    transition-duration: 150ms;\\n  }\\n  .duration-200 {\\n    --tw-duration: 200ms;\\n    transition-duration: 200ms;\\n  }\\n  .outline-none {\\n    --tw-outline-style: none;\\n    outline-style: none;\\n  }\\n  .select-none {\\n    -webkit-user-select: none;\\n    -moz-user-select: none;\\n    user-select: none;\\n  }\\n  .hover\\\\:border-red-700 {\\n    &:hover {\\n      @media (hover: hover) {\\n        border-color: var(--color-red-700);\\n      }\\n    }\\n  }\\n  .hover\\\\:bg-\\\\[\\\\#1d4ed8\\\\] {\\n    &:hover {\\n      @media (hover: hover) {\\n        background-color: #1d4ed8;\\n      }\\n    }\\n  }\\n  .hover\\\\:bg-\\\\[\\\\#60a5fa\\\\] {\\n    &:hover {\\n      @media (hover: hover) {\\n        background-color: #60a5fa;\\n      }\\n    }\\n  }\\n  .hover\\\\:bg-\\\\[\\\\#2563eb\\\\] {\\n    &:hover {\\n      @media (hover: hover) {\\n        background-color: #2563eb;\\n      }\\n    }\\n  }\\n  .hover\\\\:text-blue-700 {\\n    &:hover {\\n      @media (hover: hover) {\\n        color: var(--color-blue-700);\\n      }\\n    }\\n  }\\n  .hover\\\\:text-red-700 {\\n    &:hover {\\n      @media (hover: hover) {\\n        color: var(--color-red-700);\\n      }\\n    }\\n  }\\n  .focus\\\\:border-indigo-500 {\\n    &:focus {\\n      border-color: var(--color-indigo-500);\\n    }\\n  }\\n  .focus\\\\:ring-0 {\\n    &:focus {\\n      --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\\n      box-shadow:\\n        var(--tw-inset-shadow),\\n        var(--tw-inset-ring-shadow),\\n        var(--tw-ring-offset-shadow),\\n        var(--tw-ring-shadow),\\n        var(--tw-shadow);\\n    }\\n  }\\n  .focus\\\\:ring-indigo-500 {\\n    &:focus {\\n      --tw-ring-color: var(--color-indigo-500);\\n    }\\n  }\\n  .focus\\\\:outline-none {\\n    &:focus {\\n      --tw-outline-style: none;\\n      outline-style: none;\\n    }\\n  }\\n  .focus-visible\\\\:ring-1 {\\n    &:focus-visible {\\n      --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\\n      box-shadow:\\n        var(--tw-inset-shadow),\\n        var(--tw-inset-ring-shadow),\\n        var(--tw-ring-offset-shadow),\\n        var(--tw-ring-shadow),\\n        var(--tw-shadow);\\n    }\\n  }\\n  .focus-visible\\\\:ring-\\\\[3px\\\\] {\\n    &:focus-visible {\\n      --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\\n      box-shadow:\\n        var(--tw-inset-shadow),\\n        var(--tw-inset-ring-shadow),\\n        var(--tw-ring-offset-shadow),\\n        var(--tw-ring-shadow),\\n        var(--tw-shadow);\\n    }\\n  }\\n  .focus-visible\\\\:outline-hidden {\\n    &:focus-visible {\\n      --tw-outline-style: none;\\n      outline-style: none;\\n      @media (forced-colors: active) {\\n        outline: 2px solid transparent;\\n        outline-offset: 2px;\\n      }\\n    }\\n  }\\n  .disabled\\\\:cursor-not-allowed {\\n    &:disabled {\\n      cursor: not-allowed;\\n    }\\n  }\\n  .disabled\\\\:opacity-50 {\\n    &:disabled {\\n      opacity: 50%;\\n    }\\n  }\\n  .data-disabled\\\\:pointer-events-none {\\n    &[data-disabled] {\\n      pointer-events: none;\\n    }\\n  }\\n  .data-disabled\\\\:opacity-50 {\\n    &[data-disabled] {\\n      opacity: 50%;\\n    }\\n  }\\n  .\\\\*\\\\*\\\\:data-tag\\\\:rounded {\\n    :is(& *) {\\n      &[data-tag] {\\n        border-radius: 0.25rem;\\n      }\\n    }\\n  }\\n  .\\\\*\\\\*\\\\:data-tag\\\\:bg-blue-200 {\\n    :is(& *) {\\n      &[data-tag] {\\n        background-color: var(--color-blue-200);\\n      }\\n    }\\n  }\\n  .\\\\*\\\\*\\\\:data-tag\\\\:py-px {\\n    :is(& *) {\\n      &[data-tag] {\\n        padding-block: 1px;\\n      }\\n    }\\n  }\\n  .\\\\*\\\\*\\\\:data-tag\\\\:text-blue-950 {\\n    :is(& *) {\\n      &[data-tag] {\\n        color: var(--color-blue-950);\\n      }\\n    }\\n  }\\n  .md\\\\:text-sm {\\n    @media (width >= 48rem) {\\n      font-size: var(--text-sm);\\n      line-height: var(--tw-leading, var(--text-sm--line-height));\\n    }\\n  }\\n  .dark\\\\:text-gray-600 {\\n    @media (prefers-color-scheme: dark) {\\n      color: var(--color-gray-600);\\n    }\\n  }\\n  .dark\\\\:\\\\*\\\\*\\\\:data-tag\\\\:bg-blue-800 {\\n    @media (prefers-color-scheme: dark) {\\n      :is(& *) {\\n        &[data-tag] {\\n          background-color: var(--color-blue-800);\\n        }\\n      }\\n    }\\n  }\\n  .dark\\\\:\\\\*\\\\*\\\\:data-tag\\\\:text-blue-50 {\\n    @media (prefers-color-scheme: dark) {\\n      :is(& *) {\\n        &[data-tag] {\\n          color: var(--color-blue-50);\\n        }\\n      }\\n    }\\n  }\\n}\\nbody span[data-tag] {\\n  background-color: #ebf5fb !important;\\n  color: #1566a4 !important;\\n  border-radius: 4px !important;\\n}\\n.bg-\\\\[\\\\#3b82f6\\\\] {\\n  background-color: #3b82f6;\\n}\\n.hover\\\\:bg-\\\\[\\\\#2563eb\\\\]:hover {\\n  background-color: #2563eb;\\n}\\n.-translate-y-1\\\\/2 {\\n  transform: translateY(-50%);\\n}\\n.border-red-400 {\\n  border-color: #ff6467;\\n}\\n.border-t-8 {\\n  border-top-width: 8px !important;\\n}\\n.border-b-8 {\\n  border-bottom-width: 8px !important;\\n}\\n.border-r-8 {\\n  border-right-width: 8px !important;\\n}\\n.border-l-8 {\\n  border-left-width: 8px !important;\\n}\\n.border-transparent {\\n  border-color: transparent !important;\\n}\\n.border-t-white {\\n  border-top-color: white !important;\\n}\\n.border-b-white {\\n  border-bottom-color: white !important;\\n}\\n.shadow-lg {\\n  box-shadow:\\n    0 0 #0000,\\n    0 0 #0000,\\n    0 0 #0000,\\n    0 0 #0000,\\n    0 10px 15px -3px #0000001a,\\n    0 4px 6px -4px #0000001a;\\n}\\n.text-red-400 {\\n  color: #ff6467;\\n}\\n.hover\\\\:border-red-700 {\\n  border-color: #c10007;\\n}\\n.hover\\\\:text-red-700 {\\n  color: #c10007;\\n}\\n.bg-\\\\[\\\\#4f39f6\\\\] {\\n  background-color: #4f39f6;\\n}\\n.hover\\\\:bg-\\\\[\\\\#432dd7\\\\]:hover {\\n  background-color: #432dd7;\\n}\\n.text-gray-700 {\\n  color: #364153;\\n}\\n.text-xs {\\n  font-size: 12px;\\n}\\n.text-white {\\n  color: white;\\n}\\n.pr-\\\\[40px\\\\] {\\n  padding-right: 40px !important;\\n}\\n.text-blue-500 {\\n  color: #2b7fff;\\n}\\n.element-inspector-menu {\\n  color: black;\\n}\\n@property --tw-translate-x { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-y { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-translate-z { syntax: \\\"*\\\"; inherits: false; initial-value: 0; }\\n@property --tw-rotate-x { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-rotate-y { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-rotate-z { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-skew-x { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-skew-y { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-border-style { syntax: \\\"*\\\"; inherits: false; initial-value: solid; }\\n@property --tw-font-weight { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-inset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-shadow-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-shadow-alpha { syntax: \\\"<percentage>\\\"; inherits: false; initial-value: 100%; }\\n@property --tw-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-inset-ring-color { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-inset-ring-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-ring-inset { syntax: \\\"*\\\"; inherits: false; }\\n@property --tw-ring-offset-width { syntax: \\\"<length>\\\"; inherits: false; initial-value: 0px; }\\n@property --tw-ring-offset-color { syntax: \\\"*\\\"; inherits: false; initial-value: #fff; }\\n@property --tw-ring-offset-shadow { syntax: \\\"*\\\"; inherits: false; initial-value: 0 0 #0000; }\\n@property --tw-outline-style { syntax: \\\"*\\\"; inherits: false; initial-value: solid; }\\n@property --tw-duration { syntax: \\\"*\\\"; inherits: false; }\\n@keyframes spin {\\n  to {\\n    transform: rotate(360deg);\\n  }\\n}\\n@layer properties {\\n  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\\n    *,\\n    ::before,\\n    ::after,\\n    ::backdrop {\\n      --tw-translate-x: 0;\\n      --tw-translate-y: 0;\\n      --tw-translate-z: 0;\\n      --tw-rotate-x: initial;\\n      --tw-rotate-y: initial;\\n      --tw-rotate-z: initial;\\n      --tw-skew-x: initial;\\n      --tw-skew-y: initial;\\n      --tw-border-style: solid;\\n      --tw-font-weight: initial;\\n      --tw-shadow: 0 0 #0000;\\n      --tw-shadow-color: initial;\\n      --tw-shadow-alpha: 100%;\\n      --tw-inset-shadow: 0 0 #0000;\\n      --tw-inset-shadow-color: initial;\\n      --tw-inset-shadow-alpha: 100%;\\n      --tw-ring-color: initial;\\n      --tw-ring-shadow: 0 0 #0000;\\n      --tw-inset-ring-color: initial;\\n      --tw-inset-ring-shadow: 0 0 #0000;\\n      --tw-ring-inset: initial;\\n      --tw-ring-offset-width: 0px;\\n      --tw-ring-offset-color: #fff;\\n      --tw-ring-offset-shadow: 0 0 #0000;\\n      --tw-outline-style: solid;\\n      --tw-duration: initial;\\n    }\\n  }\\n}\\n\")","\"use client\";\nimport React, { useCallback, useRef } from 'react';\nimport { getMostSpecificElementAtPoint } from './utils';\nimport { cn } from \"./utils\";\n\nexport interface ElementSelectorProps {\n  /**\n   * Callback when an element is hovered\n   */\n  onElementHovered: (element: HTMLElement) => void;\n  \n  /**\n   * Callback when an element is no longer hovered\n   */\n  onElementUnhovered: () => void;\n  \n  /**\n   * Callback when an element is selected\n   */\n  onElementSelected: (element: HTMLElement) => void;\n  \n  /**\n   * List of elements to ignore during selection\n   */\n  ignoreList?: HTMLElement[];\n  \n  /**\n   * CSS selector for elements to exclude\n   */\n  excludeSelector?: string;\n  \n  /**\n   * CSS class name for the selector overlay\n   */\n  className?: string;\n  \n  /**\n   * Custom styles for the selector overlay\n   */\n  style?: React.CSSProperties;\n}\n\n/**\n * ElementSelector component that creates an overlay to select DOM elements\n */\nexport function ElementSelector({\n  onElementHovered,\n  onElementUnhovered,\n  onElementSelected,\n  ignoreList = [],\n  excludeSelector = '',\n  className = '',\n  style = {},\n}: ElementSelectorProps) {\n  const lastHoveredElement = useRef<HTMLElement | null>(null);\n\n  const handleMouseMove = useCallback(\n    (event: React.MouseEvent<HTMLDivElement>) => {\n      const { clientX, clientY } = event;\n      \n      // Hide the overlay temporarily to get accurate element detection\n      const overlayElement = event.currentTarget;\n      if (overlayElement) {\n        overlayElement.style.pointerEvents = 'none';\n      }\n      \n      // Get element at this point (with overlay hidden)\n      const refElement = getMostSpecificElementAtPoint(clientX, clientY, excludeSelector);\n      \n      // Restore the overlay\n      if (overlayElement) {\n        overlayElement.style.pointerEvents = 'auto';\n      }\n      \n      // Ignore if element is in the ignore list\n      if (ignoreList.includes(refElement)) return;\n      \n      // Ignore if element is the overlay itself or a child of it\n      if (refElement === overlayElement || \n          (overlayElement && overlayElement.contains(refElement))) {\n        return;\n      }\n      \n      // Only trigger callback if the hovered element has changed\n      if (lastHoveredElement.current !== refElement) {\n        lastHoveredElement.current = refElement;\n        onElementHovered(refElement);\n      }\n    },\n    [onElementHovered, ignoreList, excludeSelector]\n  );\n\n  const handleMouseLeave = useCallback(() => {\n    lastHoveredElement.current = null;\n    onElementUnhovered();\n  }, [onElementUnhovered]);\n\n  const handleMouseClick = useCallback(\n    (event: React.MouseEvent<HTMLDivElement>) => {\n      // Prevent the default action and stop propagation\n      event.preventDefault();\n      event.stopPropagation();\n      \n      const { clientX, clientY } = event;\n      \n      // Hide the overlay temporarily to get accurate element detection\n      const overlayElement = event.currentTarget;\n      if (overlayElement) {\n        overlayElement.style.pointerEvents = 'none';\n      }\n      \n      // Get the most accurate element at click position\n      const clickedElement = getMostSpecificElementAtPoint(clientX, clientY, excludeSelector);\n      \n      // Restore the overlay\n      if (overlayElement) {\n        overlayElement.style.pointerEvents = 'auto';\n      }\n      \n      // Don't select if it's the overlay\n      if (\n        clickedElement === overlayElement || \n        (overlayElement && overlayElement.contains(clickedElement))\n      ) {\n        return;\n      }\n      \n      // Update last hovered element and trigger selection\n      lastHoveredElement.current = clickedElement;\n      onElementSelected(clickedElement);\n    },\n    [onElementSelected, ignoreList, excludeSelector]\n  );\n\n  return (\n    <div\n      className={cn(\n        \"element-selector fixed inset-0 h-screen w-screen cursor-cell z-[9999] pointer-events-auto\",\n        className\n      )}\n      data-element-selector=\"true\"\n      style={style}\n      onMouseMove={handleMouseMove}\n      onMouseLeave={handleMouseLeave}\n      onClick={handleMouseClick}\n      role=\"button\"\n      tabIndex={0}\n    />\n  );\n}\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Utility functions for DOM element inspection and manipulation\n */\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\n/**\n * Checks if a point is within an element's bounds\n * @param element - The element to check\n * @param clientX - The x coordinate\n * @param clientY - The y coordinate\n * @returns Whether the point is within the element's bounds\n */\nexport const isElementAtPoint = (\n  element: HTMLElement,\n  clientX: number,\n  clientY: number,\n): boolean => {\n  const boundingRect = element.getBoundingClientRect();\n\n  const isInHorizontalBounds =\n    clientX >= boundingRect.left &&\n    clientX <= boundingRect.left + boundingRect.width;\n  const isInVerticalBounds =\n    clientY >= boundingRect.top &&\n    clientY <= boundingRect.top + boundingRect.height;\n\n  return isInHorizontalBounds && isInVerticalBounds;\n};\n\n/**\n * Calculates the percentage offsets from a point to an element\n * @param refElement - The reference element\n * @param x - The x coordinate\n * @param y - The y coordinate\n * @returns The percentage offsets\n */\nexport function getOffsetsFromPointToElement(\n  refElement: HTMLElement,\n  x: number,\n  y: number,\n): { offsetTop: number; offsetLeft: number } {\n  const referenceClientBounds = refElement.getBoundingClientRect();\n\n  const offsetTop =\n    ((y - referenceClientBounds.top) * 100) / referenceClientBounds.height;\n  const offsetLeft =\n    ((x - referenceClientBounds.left) * 100) / referenceClientBounds.width;\n\n  return {\n    offsetTop,\n    offsetLeft,\n  };\n}\n\n/**\n * Gets the XPath for an element\n * @param element - The element to get the XPath for\n * @param useId - Whether to use the element's ID if available\n * @returns The XPath for the element\n */\nexport const getXPathForElement = (element: HTMLElement, useId = true): string => {\n  if (element.id && useId) {\n    return `//*[@id=\"${element.id}\"]`;\n  }\n\n  let nodeElem: HTMLElement | null = element;\n  const parts: string[] = [];\n  while (nodeElem && Node.ELEMENT_NODE === nodeElem.nodeType) {\n    let nbOfPreviousSiblings = 0;\n    let hasNextSiblings = false;\n    let sibling = nodeElem.previousSibling;\n    while (sibling) {\n      if (\n        sibling.nodeType !== Node.DOCUMENT_TYPE_NODE &&\n        sibling.nodeName === nodeElem.nodeName\n      ) {\n        nbOfPreviousSiblings++;\n      }\n      sibling = sibling.previousSibling;\n    }\n    sibling = nodeElem.nextSibling;\n    while (sibling) {\n      if (sibling.nodeName === nodeElem.nodeName) {\n        hasNextSiblings = true;\n        break;\n      }\n      sibling = sibling.nextSibling;\n    }\n    const prefix = nodeElem.prefix ? `${nodeElem.prefix}:` : '';\n    const nth =\n      nbOfPreviousSiblings || hasNextSiblings\n        ? `[${nbOfPreviousSiblings + 1}]`\n        : '';\n    parts.push(prefix + nodeElem.localName + nth);\n    nodeElem = nodeElem.parentElement;\n  }\n  return parts.length ? `/${parts.reverse().join('/')}` : '';\n};\n\n/**\n * Extracts relevant attributes from an HTMLElement\n * @param element - The element to get attributes from\n * @returns An object containing the element's attributes\n */\nexport function getElementAttributes(element: HTMLElement): { [key: string]: string } {\n  const attrs: { [key: string]: string } = {};\n  const priorityAttrs = [\n    'id',\n    'class',\n    'name',\n    'type',\n    'href',\n    'src',\n    'alt',\n    'for',\n    'placeholder',\n  ];\n  const dataAttrs: { name: string; value: string }[] = [];\n\n  for (let i = 0; i < element.attributes.length; i++) {\n    const attr = element.attributes[i];\n    if (attr.name.startsWith('data-')) {\n      dataAttrs.push({ name: attr.name, value: attr.value });\n    } else if (\n      priorityAttrs.includes(attr.name.toLowerCase()) ||\n      attr.name.toLowerCase() !== 'style'\n    ) {\n      attrs[attr.name] = attr.value;\n    }\n  }\n  \n  dataAttrs.forEach((da) => {\n    attrs[da.name] = da.value;\n  });\n  \n  return attrs;\n}\n\n/**\n * Generates a detailed context string for a single HTMLElement\n * @param element - The element to generate context for\n * @param index - The index of the element\n * @param totalElements - The total number of elements\n * @returns A string containing the element's context\n */\nexport function generateElementContext(\n  element: HTMLElement,\n  index: number,\n  totalElements: number,\n): string {\n  let context = \"\";\n  \n  // Only add element numbering if there are multiple elements\n  if (totalElements > 1) {\n    context += `#### Element ${index + 1}\\n`;\n  }\n  \n  context += `- **Tag**: ${element.tagName.toLowerCase()}\\n`;\n\n  const id = element.id;\n  if (id) {\n    context += `- **ID**: ${id}\\n`;\n  }\n\n  const classes = Array.from(element.classList).join(', ');\n  if (classes) {\n    context += `- **Classes**: ${classes}\\n`;\n  }\n\n  const attributes = getElementAttributes(element);\n  if (Object.keys(attributes).length > 0) {\n    context += `- **Attributes**:\\n`;\n    for (const [key, value] of Object.entries(attributes)) {\n      if (key.toLowerCase() !== 'class' || !classes) {\n        context += `  - ${key}: ${value}\\n`;\n      }\n    }\n  }\n\n  const text = element.innerText?.trim();\n  if (text) {\n    const maxLength = 100;\n    context += `- **Text**: ${text.length > maxLength ? `${text.substring(0, maxLength)}...` : text}\\n`;\n  }\n\n  context += `- **Structural Context**:\\n`;\n  if (element.parentElement) {\n    const parent = element.parentElement;\n    context += `  - **Parent**:\\n`;\n    context += `    - Tag: ${parent.tagName.toLowerCase()}\\n`;\n    if (parent.id) {\n      context += `    - ID: ${parent.id}\\n`;\n    }\n    const parentClasses = Array.from(parent.classList).join(', ');\n    if (parentClasses) {\n      context += `    - Classes: ${parentClasses}\\n`;\n    }\n  } else {\n    context += `  - **Parent**: No parent element found (likely root or disconnected)\\n`;\n  }\n\n  try {\n    const styles = window.getComputedStyle(element);\n    const relevantStyles = {\n      color: styles.color,\n      backgroundColor: styles.backgroundColor,\n      fontSize: styles.fontSize,\n      fontWeight: styles.fontWeight,\n      display: styles.display,\n    };\n    context += `- **Styles**:\\n`;\n    for (const [key, value] of Object.entries(relevantStyles)) {\n      context += `  - ${key}: ${value}\\n`;\n    }\n  } catch (e) {\n    context += `- **Styles**: Could not retrieve computed styles\\n`;\n  }\n\n  context += `\\n`;\n  return context;\n}\n\n/**\n * Creates a prompt containing information about the selected elements\n * @param selectedElements - The selected elements\n * @param userPrompt - The user's prompt\n * @param url - The page URL\n * @returns A string containing the prompt\n */\nexport function createElementsPrompt(\n  selectedElements: HTMLElement[],\n  userPrompt: string,\n): string {\n  if (!selectedElements || selectedElements.length === 0) {\n    return `\n${userPrompt}\n\n### Context\nNo specific element was selected on the page. Please analyze the page code in general or ask for clarification.`.trim();\n  }\n\n  let detailedContext = '';\n  const totalElements = selectedElements.length;\n  \n  selectedElements.forEach((element, index) => {\n    detailedContext += generateElementContext(element, index, totalElements);\n  });\n\n  // Use singular or plural based on number of selected elements\n  const sectionHeader = totalElements > 1 ? '### Selected Elements' : '### Selected Element';\n\n  return `\n${userPrompt}\n\n${sectionHeader}\n${detailedContext.trim()}`.trim();\n}\n\n/**\n * Finds the most specific/innermost element at a given point\n * @param x - The x coordinate\n * @param y - The y coordinate\n * @param excludeSelector - CSS selector to exclude elements\n * @returns The most specific element at the point\n */\nexport function getMostSpecificElementAtPoint(\n  x: number,\n  y: number,\n  excludeSelector?: string\n): HTMLElement {\n  // Add a default exclude for the element selector itself\n  const fullExcludeSelector = excludeSelector \n    ? `${excludeSelector}, .element-selector, [data-element-selector=\"true\"]` \n    : `.element-selector, [data-element-selector=\"true\"]`;\n    \n  const elements = document.elementsFromPoint(x, y);\n  \n  // Filter out excluded elements and SVG elements\n  const eligibleElements = elements.filter(element => {\n    // Skip the element selector and any specified excludes\n    if (fullExcludeSelector && \n       (element.matches(fullExcludeSelector) || \n        element.closest(fullExcludeSelector))) {\n      return false;\n    }\n    \n    // Skip SVG child elements (but allow the SVG element itself)\n    if (element.tagName !== 'svg' && element.closest('svg')) {\n      return false;\n    }\n    \n    // Skip the element selector class or attribute\n    if (element.classList.contains('element-selector') || \n        element.hasAttribute('data-element-selector')) {\n      return false;\n    }\n    \n    return isElementAtPoint(element as HTMLElement, x, y);\n  }) as HTMLElement[];\n  \n  if (eligibleElements.length === 0) {\n    return document.body;\n  }\n\n  return eligibleElements[0];\n  \n  // Sort elements by various criteria to find the most specific one\n  const sortedElements = [...eligibleElements].sort((a, b) => {\n    // 1. First check depth - deeper DOM elements are more specific\n    const aDepth = getElementDepth(a);\n    const bDepth = getElementDepth(b);\n    \n    if (aDepth !== bDepth) {\n      return bDepth - aDepth; // Higher depth is more specific\n    }\n    \n    // 2. If at same depth, prefer elements with less children\n    const aChildren = a.children.length;\n    const bChildren = b.children.length;\n    \n    if (aChildren !== bChildren) {\n      return aChildren - bChildren; // Fewer children is more specific\n    }\n    \n    // 3. If still tied, use element area\n    const aRect = a.getBoundingClientRect();\n    const bRect = b.getBoundingClientRect();\n    const aArea = aRect.width * aRect.height;\n    const bArea = bRect.width * bRect.height;\n    return aArea - bArea; // Smaller area is more specific\n  });\n  \n  // Return the most specific eligible element\n  return sortedElements[0];\n}\n\n/**\n * Helper function to calculate the depth of an element in the DOM tree\n * @param element - The element to check\n * @returns The depth of the element\n */\nfunction getElementDepth(element: HTMLElement): number {\n  let depth = 0;\n  let current = element;\n  \n  while (current.parentElement) {\n    depth++;\n    current = current.parentElement;\n  }\n  \n  return depth;\n}\n\n/**\n * Extracts common properties from an HTML element\n */\nexport const extractElementProperties = (el: HTMLElement) => {\n  // Extract only direct text nodes, excluding child element text\n  const getDirectTextContent = (element: HTMLElement): string => {\n    // Check if element has any child elements with text content\n    const hasChildElementsWithText = Array.from(element.children).some(child => {\n      return child.textContent && child.textContent.trim().length > 0;\n    });\n    \n    // If there are child elements with text, return empty string\n    if (hasChildElementsWithText) {\n      return '';\n    }\n    \n    // Otherwise, extract direct text nodes only\n    let text = '';\n    for (const node of element.childNodes) {\n      if (node.nodeType === Node.TEXT_NODE) {\n        text += node.textContent || '';\n      }\n    }\n    return text.trim();\n  };\n\n  // Check if the element's data-simplify-id is duplicated\n  const checkIsDuplicated = (element: HTMLElement): boolean => {\n    const simplifyId = element.getAttribute('data-simplify-id');\n    if (!simplifyId) {\n      return false;\n    }\n    const elementsWithSameId = document.querySelectorAll(`[data-simplify-id=\"${simplifyId}\"]`);\n    return elementsWithSameId.length > 1;\n  };\n\n  // Extract inline styles in camelCase\n  const getElementStyles = (element: HTMLElement): Record<string, string> => {\n    const styles: Record<string, string> = {};\n    for (let i = 0; i < element.style.length; i++) {\n      const prop = element.style[i];\n      const value = element.style.getPropertyValue(prop);\n      if (value) {\n        // Convert kebab-case to camelCase\n        const camelProp = prop.replace(/-([a-z])/g, (g) => g[1].toUpperCase());\n        styles[camelProp] = value;\n      }\n    }\n    return styles;\n  };\n\n  return {\n    tagName: el.tagName,\n    id: el.id,\n    className: typeof el.className === 'string' ? el.className : (el.className as any).baseVal || '',\n    style: getElementStyles(el),\n    isDuplicated: checkIsDuplicated(el),\n    textContent: getDirectTextContent(el),\n    attributes: Array.from(el.attributes).map(attr => ({\n      name: attr.name,\n      value: attr.value\n    })),\n  };\n};\n\n/**\n * Maps an HTML element to a serializable object representation\n */\nexport const getAllFormElements = (): string[] => {\n  const formElements = Array.from(\n    document.querySelectorAll('[data-name][data-description]')\n  ).filter((formEl): formEl is HTMLElement => formEl instanceof HTMLElement);\n  const dataNames = formElements.map((el) => el.getAttribute(\"data-name\") || \"\");\n  return dataNames.filter(Boolean); // Remove any empty strings if attribute is missing\n};\n\n/**\n * Interface for event handler payload\n */\ninterface EventHandlerPayload {\n  event: string;\n  action: string;\n  elements: any[];\n}\n\n/**\n * Generates a prompt for adding an event handler to a selected element\n * @param payload The event handler configuration\n * @returns A string prompt describing how to add the event handler\n */\nexport function generateEventHandlerPrompt(\n  payload: EventHandlerPayload,\n): string {\n  const { event, action, elements } = payload;\n  if (!event || !action || elements?.length === 0) {\n    return \"\";\n  }\n  let actionDescription = \"\";\n  if (action === \"triggerWorkflow\") {\n    actionDescription = `trigger the following workflow`;\n  }\n  return `\\n\\n###\\n- Add an event handler to this element that will listen for the \"${event}\" event and ${actionDescription} when triggered.`;\n}\n","\"use client\";\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport { cn } from './utils';\n\nexport interface ElementHighlighterProps {\n  /**\n   * The element to highlight\n   */\n  element: HTMLElement;\n  \n  /**\n   * CSS class for the highlighter\n   */\n  className?: string;\n  \n  /**\n   * Custom styles for the highlighter\n   */\n  style?: React.CSSProperties;\n  \n  /**\n   * Update rate in frames per second (0 to disable updates)\n   */\n  updateRate?: number;\n  \n  /**\n   * Content to render inside the highlighter\n   */\n  children?: React.ReactNode;\n  \n  /**\n   * Border color for the highlighter\n   */\n  borderColor?: string;\n  \n  /**\n   * Background color for the highlighter\n   */\n  backgroundColor?: string;\n}\n\n/**\n * A component that highlights a DOM element with a border\n */\nexport function ElementHighlighter({\n  element,\n  className = '',\n  style = {},\n  updateRate = 30,\n  children,\n  borderColor = 'rgba(59, 130, 246, 0.8)',\n  backgroundColor = 'rgba(59, 130, 246, 0.2)',\n}: ElementHighlighterProps) {\n  const boxRef = useRef<HTMLDivElement>(null);\n  const updateIntervalRef = useRef<number | null>(null);\n\n  const updateBoxPosition = useCallback(() => {\n    if (boxRef.current && element) {\n      const referenceRect = element.getBoundingClientRect();\n\n      boxRef.current.style.top = `${referenceRect.top - 8}px`;\n      boxRef.current.style.left = `${referenceRect.left - 8}px`;\n      boxRef.current.style.width = `${referenceRect.width + 16}px`;\n      boxRef.current.style.height = `${referenceRect.height + 16}px`;\n    }\n  }, [element]);\n\n  // Set up the interval for updating the box position\n  useEffect(() => {\n    updateBoxPosition();\n    \n    if (updateRate > 0) {\n      const intervalId = window.setInterval(() => {\n        updateBoxPosition();\n      }, 1000 / updateRate);\n      \n      updateIntervalRef.current = intervalId;\n      \n      return () => {\n        if (updateIntervalRef.current !== null) {\n          window.clearInterval(updateIntervalRef.current);\n        }\n      };\n    }\n  }, [updateBoxPosition, updateRate]);\n\n  // Also update on window resize\n  useEffect(() => {\n    const handleResize = () => {\n      updateBoxPosition();\n    };\n    \n    window.addEventListener('resize', handleResize);\n    return () => {\n      window.removeEventListener('resize', handleResize);\n    };\n  }, [updateBoxPosition]);\n\n  // Apply custom border and background colors via inline style\n  // since these are dynamic values passed as props\n  const customStyle = {\n    ...style,\n    borderColor,\n    // backgroundColor,\n  };\n\n  return (\n    <div\n      className={cn(\n        \"element-highlighter fixed flex items-center justify-center rounded-md border-2 transition-all duration-100 z-[9998] pointer-events-none\",\n        className\n      )}\n      style={customStyle}\n      ref={boxRef}\n    >\n      {children}\n    </div>\n  );\n}\n","\"use client\";\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport { BubbleMenu, InspectionOverlay } from './components';\nimport {\n  useDarkMode,\n  useElementBubblePosition,\n  useElementSelection,\n  useIframeMessaging,\n  useInspector\n} from './hooks';\nimport { UI_CONSTANTS } from './constants';\n\n// Function to send DOM structure to parent window\nexport const sendDomStructure = () => {\n  // Just send the entire HTML body content as a string\n  const bodyHTML = document.body.outerHTML;\n  window.parent.postMessage({ \n    type: 'DOM_STRUCTURE_UPDATED', \n    payload: bodyHTML \n  }, '*');\n};\n\n// Function to setup DOM observer\nexport const setupDomObserver = (callback: () => void) => {\n  let debounceTimeout: number | undefined;\n  \n  const observer = new MutationObserver(() => {\n    // Debounce DOM updates to avoid performance issues\n    if (debounceTimeout) window.clearTimeout(debounceTimeout);\n    debounceTimeout = window.setTimeout(() => {\n      callback();\n    }, 500); // Wait 500ms after changes stop\n  });\n  \n  // Start observing with configuration\n  observer.observe(document.body, {\n    childList: true,\n    subtree: true,\n    attributes: true,\n    characterData: false\n  });\n  \n  return {\n    disconnect: () => {\n      if (debounceTimeout) window.clearTimeout(debounceTimeout);\n      observer.disconnect();\n    }\n  };\n};\n\nexport interface ElementInspectorProps {\n  /**\n   * Initial state of the inspector (active or not)\n   */\n  initialIsActive?: boolean;\n  \n  /**\n   * CSS selector for elements to exclude from selection\n   */\n  excludeSelector?: string;\n  \n  /**\n   * Custom label for selected elements\n   */\n  elementLabel?: (element: HTMLElement) => React.ReactNode;\n  \n  /**\n   * Custom styles for the selector\n   */\n  selectorStyle?: React.CSSProperties;\n  \n  /**\n   * Custom styles for the highlighter\n   */\n  highlighterStyle?: React.CSSProperties;\n  \n  /**\n   * Whether to show the floating bubble menu button\n   * @default false\n   */\n  showBubbleMenuButton?: boolean;\n}\n\n/**\n * A component that allows inspecting and selecting DOM elements with a UI for interaction\n */\nexport function ElementInspector({\n  initialIsActive = true,\n  excludeSelector = '.element-inspector-bubble, .element-inspector-controls, .element-inspector-mention',\n  elementLabel,\n  selectorStyle,\n  highlighterStyle,\n  showBubbleMenuButton = false,\n}: ElementInspectorProps) {\n  // Custom hooks\n  const isDarkMode = useDarkMode();\n  const {\n    sendSelectedElements, \n    sendPrompt,\n    shouldEnableInspect,\n  } = useIframeMessaging();\n  \n  // Element selection hook\n  const { \n    hoveredElement, \n    selectedElements, \n    handleElementHovered, \n    handleElementUnhovered, \n    handleElementSelected,\n    clearSelections \n  } = useElementSelection({\n    onElementsSelected: (elements) => {\n      sendSelectedElements(elements);\n    }\n  });\n  \n  // Bubble position hook\n  const { bubblePosition, isMenuAboveElement } = useElementBubblePosition({\n    selectedElements,\n    menuWidth: UI_CONSTANTS.MENU_WIDTH,\n    spacing: UI_CONSTANTS.SPACING\n  });\n  \n  // Inspector state hook\n  const {\n    isInspecting,\n    userPrompt,\n    setUserPrompt,\n    toggleInspection,\n    handlePromptSubmit,\n  } =  useInspector({\n    // Use shouldEnableInspect from iframe messaging if in iframe, otherwise use initialIsActive\n    initialIsActive: shouldEnableInspect,\n    onPromptGenerated: (prompt, elements) => {\n      sendPrompt(prompt, elements);\n    }\n  });\n  \n  // Handle menu toggle - clear selections when toggling off\n  const handleMenuToggle = useCallback(() => {\n    toggleInspection();\n    if (isInspecting) {\n      clearSelections();\n    }\n  }, [isInspecting, toggleInspection, clearSelections]);\n  \n  // Handle form submission with selected elements\n  const onSubmitPrompt = useCallback((e: React.FormEvent) => {\n    handlePromptSubmit(e, selectedElements);\n  }, [handlePromptSubmit, selectedElements]);\n  \n  // Update inspection state when shouldEnableInspect changes (from iframe messages)\n  useEffect(() => {\n    if (isInspecting !== shouldEnableInspect) {\n      toggleInspection();\n    }\n  }, [isInspecting, shouldEnableInspect, toggleInspection]);\n\n  // Reference to store observer\n  const observerRef = useRef<{ disconnect: () => void } | null>(null);\n  \n  // Send ready message to parent window when component mounts\n  useEffect(() => {\n    // Send UI builder ready message\n    window.parent.postMessage({ type: 'UI_BUILDER_READY' }, '*');\n    \n    // Send initial DOM structure\n    sendDomStructure();\n    \n    // Set up observer for DOM changes\n    observerRef.current = setupDomObserver(sendDomStructure);\n    \n    // Clean up observer when component unmounts\n    return () => {\n      if (observerRef.current) {\n        observerRef.current.disconnect();\n      }\n    };\n  }, []);\n\n  return (\n    <div>\n      {/* Element Inspector Components */}\n      <InspectionOverlay\n        isInspecting={isInspecting}\n        hoveredElement={hoveredElement}\n        selectedElements={selectedElements}\n        onElementHovered={handleElementHovered}\n        onElementSelected={handleElementSelected}\n        onElementUnhovered={handleElementUnhovered}\n        excludeSelector={excludeSelector}\n        selectorStyle={selectorStyle}\n        highlighterStyle={highlighterStyle}\n        elementLabel={elementLabel}\n      />\n\n      {/* Bubble Menu */}\n      <BubbleMenu\n        isInspecting={isInspecting}\n        selectedElements={selectedElements}\n        bubblePosition={bubblePosition}\n        isMenuAboveElement={isMenuAboveElement}\n        userPrompt={userPrompt}\n        setUserPrompt={setUserPrompt}\n        onSubmitPrompt={onSubmitPrompt}\n        onToggleInspection={handleMenuToggle}\n        isDarkMode={isDarkMode}\n        showBubbleMenuButton={showBubbleMenuButton}\n      />\n    </div>\n  );\n}\n","/**\n * Shared constants for the element prompt builder\n */\n\n// UI Dimensions\nexport const UI_CONSTANTS = {\n  // Menu dimensions\n  MENU_WIDTH: 350, // Width of the control menu in pixels\n  MENU_HEIGHT: 52, // Height of the control menu in pixels\n  \n  // Spacing and offsets\n  SPACING: 10, // Standard spacing for margins and padding\n  ARROW_LEFT_OFFSET: 20, // Left offset for the arrow from menu edge\n  \n  // Z-index values\n  Z_INDEX: 10000, // Standard z-index for UI elements\n};\n","\"use client\";\nimport React from \"react\";\nimport { cn } from \"../../utils\";\nimport { UI_CONSTANTS } from \"../../constants\";\n\ninterface MenuArrowProps {\n  isMenuAboveElement: boolean;\n  bubblePosition: { top: number; left: number };\n  isDarkMode: boolean;\n  isVisible: boolean;\n}\n\nexport const MenuArrow: React.FC<MenuArrowProps> = ({\n  isMenuAboveElement,\n  bubblePosition,\n  isDarkMode,\n  isVisible,\n}) => {\n  const menuHeight =\n    document.querySelector(\".element-inspector-menu\")?.clientHeight ||\n    UI_CONSTANTS.MENU_HEIGHT;\n  // Calculate the top position based on menu position\n  const topPosition = isMenuAboveElement\n    ? `${bubblePosition.top + menuHeight}px` // Arrow at bottom of menu\n    : `${bubblePosition.top - 8}px`; // Arrow at top of menu\n\n  const leftPosition = `${bubblePosition.left + UI_CONSTANTS.ARROW_LEFT_OFFSET}px`;\n\n  return (\n    <div\n      className={cn(\n        \"element-inspector-menu-arrow pointer-events-none fixed z-[10001] h-0 w-0 border-r-8 border-l-8 border-transparent transition-all duration-150\",\n        {\n          \"border-t-8\": isMenuAboveElement,\n          \"border-b-8\": !isMenuAboveElement,\n          \"border-t-white\": isMenuAboveElement && !isDarkMode,\n          \"border-t-gray-800\": isMenuAboveElement && isDarkMode,\n          \"border-b-white\": !isMenuAboveElement && !isDarkMode,\n          \"border-b-gray-800\": !isMenuAboveElement && isDarkMode,\n          \"opacity-0\": !isVisible,\n          \"opacity-100\": isVisible,\n        },\n      )}\n      style={{\n        top: topPosition,\n        left: leftPosition,\n      }}\n      aria-hidden=\"true\"\n    />\n  );\n};\n","import React, { CSSProperties, useEffect, useRef, useState } from \"react\";\nimport { useWorkflowsStore } from \"../stores/workflows\";\nimport { useEleventEventStore } from \"../stores/elementEvent\";\nimport { cn } from \"../utils\";\nimport { Mention, MentionInput } from \"./ui/mention\";\nimport { IconTick, IconAi, CarretDown, IconMinus } from \"../Icons\";\n\ninterface MentionChatProps {\n  handleInputChange?: (value: string) => void;\n  onSubmit?: (event: React.UIEvent | React.FormEvent) => void;\n  style?: CSSProperties;\n  onFileChange?: (files: FileList | undefined) => void;\n  selectedElements?: HTMLElement[];\n}\n\nexport const MentionChat: React.FC<MentionChatProps> = ({\n  onSubmit,\n  handleInputChange,\n  selectedElements = [],\n}) => {\n  const mentionInputRef = useRef<HTMLInputElement>(null);\n  const [values, setValues] = useState<string[]>([]);\n  const [inputValue, setInputValue] = useState(\"\");\n  const workflows = useWorkflowsStore.getState().workflows || [];\n  const selectedWorkflow = useWorkflowsStore((state) => state.workflowId);\n  const { selectedAction, selectedEvent, showEventForm } = useEleventEventStore((state) => state);\n  const { setSelectedAction, setSelectedEvent, setShowEventForm } = useEleventEventStore.getState();\n\n  // Helper function to check if any selected element is an input, textarea, or button\n  const hasValidSelectedElement = React.useMemo(() => {\n    if (!selectedElements.length) return false;\n\n    return selectedElements.some((element) => {\n      const tagName = element.tagName.toLowerCase();\n      return (\n        tagName === \"input\" || tagName === \"textarea\" || tagName === \"button\"\n      );\n    });\n  }, [selectedElements]);\n\n  // Helper function to get available events for the selected element\n  const getAvailableEvents = React.useMemo(() => {\n    if (!selectedElements.length) return [\"click\"];\n\n    // Get the first valid element\n    const validElement = selectedElements.find((element) => {\n      const tagName = element.tagName.toLowerCase();\n      return (\n        tagName === \"input\" || tagName === \"textarea\" || tagName === \"button\"\n      );\n    });\n\n    if (!validElement) return [\"click\"];\n\n    const tagName = validElement.tagName.toLowerCase();\n    if (tagName === \"button\") {\n      return [\"onClick\"];\n    } else if (tagName === \"input\" || tagName === \"textarea\") {\n      return [\n        \"onChange\",\n        \"onFocus\",\n        \"onBlur\",\n        \"onKeyDown\",\n        \"onKeyUp\",\n        \"onPaste\",\n      ];\n    }\n\n    return [\"click\"];\n  }, [selectedElements]);\n\n  useEffect(() => {\n    handleInputChange?.(inputValue);\n    if (!inputValue.trim()) {\n      setValues([]);\n      return;\n    }\n  }, [inputValue]);\n\n  useEffect(() => {\n    if (!mentionInputRef.current) return;\n    mentionInputRef.current.parentElement\n      ?.querySelector(\"div\")\n      ?.classList?.add(\"!whitespace-nowrap\");\n  }, [mentionInputRef.current]);\n\n  // Reset selectedAction when event selection changes\n  useEffect(() => {\n    if (!selectedEvent) {\n      setSelectedAction(\"\");\n    }\n  }, [selectedEvent]);\n\n  const toggleEventForm = (e: React.MouseEvent<HTMLButtonElement>) => {\n    e.preventDefault();\n    setShowEventForm(!showEventForm);\n  };\n\n  // Function to clear the form and hide it\n  const clearAndHideForm = () => {\n    setInputValue(\"\");\n    setSelectedEvent(\"\");\n    setSelectedAction(\"\");\n    setShowEventForm(false);\n    useWorkflowsStore.getState().setWorkflowId(\"\");\n    handleWorkflowChange({ target: { value: \"\" } } as React.ChangeEvent<HTMLSelectElement>);\n  };\n\n  // Add a handler for workflow selection\n  const handleWorkflowChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n    const workflowId = e.target.value;\n    useWorkflowsStore.getState().setWorkflowId(workflowId);\n    window.parent.postMessage(\n      {\n        type: \"ELEMENT_INSPECTOR_MENTIONED\",\n        payload: { workflowId },\n      },\n      \"*\",\n    );\n  };\n\n  const handleInputKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n    if (e.key === \"Enter\") {\n      handleSubmit(e);\n    }\n  };\n\n  const handleSubmit = (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>) => {\n    e.preventDefault();\n    if (inputValue.trim() === \"\") return;\n    onSubmit?.(e as React.UIEvent | React.FormEvent);\n    clearAndHideForm();\n  }\n\n  return (\n    <Mention\n      trigger=\"/\"\n      className={cn(\n        \"text-md text-bolt-elements-textPrimary placeholder-bolt-elements-textTertiary w-full resize-none bg-transparent focus:outline-none\",\n        \"element-inspector-mention\",\n      )}\n      inputValue={inputValue}\n      value={values}\n      onInputValueChange={setInputValue}\n      onValueChange={setValues}\n    >\n      <div className={`relative flex items-center gap-1`}>\n        <div className=\"flex h-6 w-6 items-center justify-center\">\n          <IconAi />\n        </div>\n        <MentionInput\n          id=\"mention-chat-input\"\n          onKeyDown={handleInputKeyDown}\n          value={inputValue}\n          ref={mentionInputRef}\n          placeholder={\"Tell me how to modify this element...\"}\n          className={cn(\n            \"text-bolt-elements-textPrimary placeholder-bolt-elements-textTertiary w-full min-w-[300px] !border-none bg-transparent px-0 pr-[40px] text-sm !shadow-none !ring-0 focus:outline-none\",\n          )}\n        />\n        {inputValue.trim() !== \"\" && (\n          <button\n            type=\"button\"\n            onClick={handleSubmit}\n            className=\"absolute right-0 flex items-center justify-center rounded-full bg-[#3b82f6] p-1 text-white transition hover:bg-[#2563eb]\"\n          >\n            <IconTick />\n          </button>\n        )}\n      </div>\n      {hasValidSelectedElement &&\n        (!showEventForm ? (\n          <button\n            onClick={toggleEventForm}\n            className=\"inline-flex cursor-pointer items-center border-none bg-transparent text-xs text-blue-500 underline transition-colors hover:text-blue-700 focus:ring-0 focus:outline-none\"\n          >\n            Add event\n          </button>\n        ) : (\n          <div\n            className=\"edit-event-handler relative mt-3 border-none bg-white outline-none\"\n            style={{ zIndex: 10002 }}\n          >\n            <div className=\"relative mb-6\">\n              <button\n                onClick={clearAndHideForm}\n                className=\"absolute top-0 right-0 cursor-pointer rounded-full border border-red-400 bg-white text-red-400 transition-colors duration-200 hover:border-red-700 hover:text-red-700 focus:outline-none\"\n              >\n                <IconMinus />\n              </button>\n              <label className=\"mb-2 block text-sm font-semibold text-gray-700\">\n                Event\n              </label>\n              <div className=\"relative\">\n                <select\n                  className=\"block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500 focus:outline-none\"\n                  onChange={(e) => setSelectedEvent(e.target.value)}\n                  value={selectedEvent}\n                >\n                  <option value=\"\">Select an event</option>\n                  {getAvailableEvents.map((event) => (\n                    <option key={event} value={event}>\n                      {event}\n                    </option>\n                  ))}\n                </select>\n                <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700\">\n                  <CarretDown />\n                </div>\n              </div>\n            </div>\n\n            <div className={selectedAction ? `mb-6` : \"\"}>\n              <label className=\"mb-2 block text-sm font-semibold text-gray-700\">\n                Action\n              </label>\n              <div className=\"relative\">\n                <select\n                  className={`block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500 focus:outline-none ${!selectedEvent ? \"cursor-not-allowed opacity-50\" : \"\"}`}\n                  onChange={(e) => setSelectedAction(e.target.value)}\n                  value={selectedAction}\n                  disabled={!selectedEvent}\n                >\n                  <option value=\"\">Select an action</option>\n                  <option value=\"triggerWorkflow\">Trigger workflow</option>\n                </select>\n                <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700\">\n                  <CarretDown />\n                </div>\n              </div>\n            </div>\n\n            {selectedAction === \"triggerWorkflow\" && (\n              <div>\n                <label className=\"mb-2 block text-sm font-medium text-gray-700\">\n                  Workflow\n                </label>\n                <div className=\"relative\">\n                  <select\n                    className=\"block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500 focus:outline-none\"\n                    onChange={handleWorkflowChange}\n                    value={selectedWorkflow}\n                  >\n                    <option value=\"\">Select a workflow</option>\n                    {workflows.map((workflow) => (\n                      <option key={workflow.id} value={workflow.id}>\n                        {workflow.name}\n                      </option>\n                    ))}\n                  </select>\n                  <div className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700\">\n                    <CarretDown />\n                  </div>\n                </div>\n              </div>\n            )}\n          </div>\n        ))}\n    </Mention>\n  );\n};\n","import { create } from \"zustand\";\n\n/**\n * Interface for the workflows store state and actions\n */\nexport interface WorkflowsState {\n  // State properties\n  workflows: any[];\n\n  workflowId: string;\n\n  // Actions\n  setWorkflowId: (data: string) => void;\n  setWorkflows: (data: any[]) => void;\n}\n\n/**\n * Zustand store for workflows\n */\nexport const useWorkflowsStore = create<WorkflowsState>()((set, get) => ({\n  // Initial state\n  workflows: [],\n  workflowId: \"\",\n\n  // Actions to update workflows state\n  setWorkflowId: (workflowId: string) =>\n    set({ workflowId }),\n  setWorkflows: (data) =>\n    set({\n      workflows: data,\n    }),\n  getworkflows: () => {\n    return get().workflows;\n  },\n}));\n","import { create } from \"zustand\";\n\n/**\n * Interface for the eleventEvent store state and actions\n */\nexport interface ElementEventState {\n  // State properties\n  selectedAction: string;\n  selectedEvent: string;\n  showEventForm: boolean;\n\n  // Actions\n  setSelectedAction: (value: string) => void;\n  setSelectedEvent: (value: string) => void;\n  setShowEventForm: (value: boolean) => void;\n}\n\n/**\n * Zustand store for eleventEvent\n */\nexport const useEleventEventStore = create<ElementEventState>()((set, get) => ({\n  // Initial state\n  selectedAction: \"\",\n  selectedEvent: \"\",\n  showEventForm: false,\n\n  // Actions to update eleventEvent state\n  setSelectedAction: (selectedAction: string) =>\n    set({ selectedAction }),\n  setSelectedEvent: (selectedEvent) =>\n    set({\n      selectedEvent,\n    }),\n  setShowEventForm: (showEventForm: boolean) =>\n    set({\n      showEventForm,\n    }),\n  getSelectedAction: () => {\n    return get().selectedAction;\n  },\n  getSelectedEvent: () => {\n    return get().selectedEvent;\n  },\n  getShowEventForm: () => {\n    return get().showEventForm;\n  },\n}));\n","import * as MentionPrimitive from \"@diceui/mention\";\nimport * as React from \"react\";\n \nimport { cn } from \"../../utils\";\n \nconst Mention = React.forwardRef<\n  React.ComponentRef<typeof MentionPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof MentionPrimitive.Root>\n>(({ className, ...props }, ref) => (\n  <MentionPrimitive.Root\n    data-slot=\"mention\"\n    ref={ref}\n    className={cn(\n      \"**:data-tag:rounded **:data-tag:bg-blue-200 **:data-tag:py-px **:data-tag:text-blue-950 dark:**:data-tag:bg-blue-800 dark:**:data-tag:text-blue-50\",\n      className,\n    )}\n    {...props}\n  />\n));\nMention.displayName = MentionPrimitive.Root.displayName;\n \nconst MentionLabel = React.forwardRef<\n  React.ComponentRef<typeof MentionPrimitive.Label>,\n  React.ComponentPropsWithoutRef<typeof MentionPrimitive.Label>\n>(({ className, ...props }, ref) => (\n  <MentionPrimitive.Label\n    data-slot=\"mention-label\"\n    ref={ref}\n    className={cn(\"px-0.5 py-1.5 font-semibold text-sm\", className)}\n    {...props}\n  />\n));\nMentionLabel.displayName = MentionPrimitive.Label.displayName;\n \nconst MentionInput = React.forwardRef<\n  React.ComponentRef<typeof MentionPrimitive.Input>,\n  React.ComponentPropsWithoutRef<typeof MentionPrimitive.Input>\n>(({ className, ...props }, ref) => (\n  <MentionPrimitive.Input\n    data-slot=\"mention-input\"\n    ref={ref}\n    className={cn(\n      \"flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n      className,\n    )}\n    {...props}\n  />\n));\nMentionInput.displayName = MentionPrimitive.Input.displayName;\n \nconst MentionContent = React.forwardRef<\n  React.ComponentRef<typeof MentionPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof MentionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n  <MentionPrimitive.Portal>\n    <MentionPrimitive.Content\n      data-slot=\"mention-content\"\n      ref={ref}\n      className={cn(\n        \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in\",\n        className,\n      )}\n      {...props}\n    >\n      {children}\n    </MentionPrimitive.Content>\n  </MentionPrimitive.Portal>\n));\nMentionContent.displayName = MentionPrimitive.Content.displayName;\n \nconst MentionItem = React.forwardRef<\n  React.ComponentRef<typeof MentionPrimitive.Item>,\n  React.ComponentPropsWithoutRef<typeof MentionPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n  <MentionPrimitive.Item\n    data-slot=\"mention-item\"\n    ref={ref}\n    className={cn(\n      \"relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-50\",\n      className,\n    )}\n    {...props}\n  >\n    {children}\n  </MentionPrimitive.Item>\n));\nMentionItem.displayName = MentionPrimitive.Item.displayName;\n \nexport { Mention, MentionContent, MentionInput, MentionItem, MentionLabel };","\"use client\";\n\n// Custom icon components\nexport const IconPointer = () => (\n  <svg 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\" className=\"lucide lucide-mouse-pointer-click-icon lucide-mouse-pointer-click\"><path d=\"M14 4.1 12 6\"/><path d=\"m5.1 8-2.9-.8\"/><path d=\"m6 12-1.9 2\"/><path d=\"M7.2 2.2 8 5.1\"/><path d=\"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z\"/></svg>\n);\n\nexport const IconSquareDashedPointer = () => (\n  <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" className=\"lucide lucide-square-dashed-mouse-pointer-icon lucide-square-dashed-mouse-pointer\"><path d=\"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z\"/><path d=\"M5 3a2 2 0 0 0-2 2\"/><path d=\"M19 3a2 2 0 0 1 2 2\"/><path d=\"M5 21a2 2 0 0 1-2-2\"/><path d=\"M9 3h1\"/><path d=\"M9 21h2\"/><path d=\"M14 3h1\"/><path d=\"M3 9v1\"/><path d=\"M21 9v2\"/><path d=\"M3 14v1\"/></svg>\n);\n\nexport const IconX = () => (\n  <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n    <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n  </svg>\n);\n\nexport const IconSend = () => (\n  <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <path d=\"m22 2-7 20-4-9-9-4Z\"/>\n    <path d=\"M22 2 11 13\"/>\n  </svg>\n);\n\nexport const IconTick = () => (\n  <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n    <polyline points=\"20 6 9 17 4 12\"/>\n  </svg>\n);\n\nexport const IconAi = () => (\n  <svg width=\"23\" height=\"23\" viewBox=\"0 0 23 23\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M9.55507 5.34461L10.1322 6.94742C10.7733 8.72633 12.1742 10.1272 13.9531 10.7683L15.5559 11.3455C15.7004 11.3979 15.7004 11.6028 15.5559 11.6545L13.9531 12.2317C12.1742 12.8728 10.7733 14.2736 10.1322 16.0525L9.55507 17.6554C9.5026 17.7998 9.29776 17.7998 9.24601 17.6554L8.66885 16.0525C8.02772 14.2736 6.62688 12.8728 4.84797 12.2317L3.24516 11.6545C3.10069 11.602 3.10069 11.3972 3.24516 11.3455L4.84797 10.7683C6.62688 10.1272 8.02772 8.72633 8.66885 6.94742L9.24601 5.34461C9.29776 5.19942 9.5026 5.19942 9.55507 5.34461Z\" fill=\"black\"/>\n    <path d=\"M16.7699 1.49284L17.0624 2.30431C17.3873 3.2049 18.0967 3.91431 18.9973 4.23918L19.8088 4.53172C19.8821 4.55831 19.8821 4.66181 19.8088 4.6884L18.9973 4.98093C18.0967 5.30581 17.3873 6.01521 17.0624 6.91581L16.7699 7.72728C16.7433 7.80059 16.6398 7.80059 16.6132 7.72728L16.3207 6.91581C15.9958 6.01521 15.2864 5.30581 14.3858 4.98093L13.5743 4.6884C13.501 4.66181 13.501 4.55831 13.5743 4.53172L14.3858 4.23918C15.2864 3.91431 15.9958 3.2049 16.3207 2.30431L16.6132 1.49284C16.6398 1.41881 16.744 1.41881 16.7699 1.49284Z\" fill=\"black\"/>\n    <path d=\"M16.7699 15.2734L17.0624 16.0849C17.3873 16.9855 18.0967 17.6949 18.9973 18.0198L19.8088 18.3123C19.8821 18.3389 19.8821 18.4424 19.8088 18.469L18.9973 18.7615C18.0967 19.0864 17.3873 19.7958 17.0624 20.6964L16.7699 21.5079C16.7433 21.5812 16.6398 21.5812 16.6132 21.5079L16.3207 20.6964C15.9958 19.7958 15.2864 19.0864 14.3858 18.7615L13.5743 18.469C13.501 18.4424 13.501 18.3389 13.5743 18.3123L14.3858 18.0198C15.2864 17.6949 15.9958 16.9855 16.3207 16.0849L16.6132 15.2734C16.6398 15.2001 16.744 15.2001 16.7699 15.2734Z\" fill=\"black\"/>\n  </svg>\n\n);\n\nexport const IconSpinner = () => {\n  return (\n    <svg className=\"animate-spin -ml-1 mr-2 h-4 w-4 text-white\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\n      <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\"></circle>\n      <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"></path>\n    </svg>\n  );\n};\n\nexport const CarretDown = () => (\n  <svg\n    className=\"h-4 w-4\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n    viewBox=\"0 0 20 20\"\n    fill=\"currentColor\"\n  >\n    <path\n      fillRule=\"evenodd\"\n      d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\"\n      clipRule=\"evenodd\"\n    />\n  </svg>\n);\n\nexport const IconMinus = () => (\n  <svg\n    width=\"12\"\n    height=\"12\"\n    viewBox=\"0 0 24 24\"\n    fill=\"none\"\n    xmlns=\"http://www.w3.org/2000/svg\"\n  >\n    <path\n      d=\"M5 12H19\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    />\n  </svg>\n);\n","\"use client\";\nimport React from \"react\";\nimport { MentionChat } from \"./MentionChat\";\n\ninterface PromptFormProps {\n  /**\n   * Function to update the prompt text\n   */\n  setUserPrompt: (value: string) => void;\n\n  /**\n   * Form submission handler\n   */\n  handlePromptSubmit: (e: React.FormEvent) => void;\n\n  /**\n   * The currently selected HTML elements\n   */\n  selectedElements: HTMLElement[];\n}\n\n/**\n * Form component for entering and submitting prompts for selected elements\n */\nexport function PromptForm({\n  setUserPrompt,\n  handlePromptSubmit,\n  selectedElements,\n}: PromptFormProps) {\n  return (\n    <form onSubmit={handlePromptSubmit}>\n      <div className=\"flex gap-2 items-center w-full\">\n        <div className=\"flex items-center relative gap-1.5 w-full\">\n          <MentionChat\n            onSubmit={handlePromptSubmit}\n            handleInputChange={setUserPrompt}\n            selectedElements={selectedElements}\n          />\n        </div>\n      </div>\n    </form>\n  );\n}\n","\"use client\";\nimport React from \"react\";\nimport { PromptForm } from \"../PromptForm\";\n\ninterface ExpandedMenuProps {\n  bubblePosition: { top: number; left: number };\n  userPrompt: string;\n  setUserPrompt: (prompt: string) => void;\n  onSubmitPrompt: (e: React.FormEvent) => void;\n  selectedElements: HTMLElement[];\n  selectedElementsCount: number;\n  isDarkMode: boolean;\n}\n\nexport const ExpandedMenu: React.FC<ExpandedMenuProps> = ({\n  bubblePosition,\n  setUserPrompt,\n  onSubmitPrompt,\n  selectedElements,\n}) => {\n  return (\n    <div\n      className={`element-inspector-menu fixed z-[10000] w-[350px] overflow-y-auto rounded-xl bg-white p-4 shadow-lg`}\n      style={{ top: bubblePosition.top, left: bubblePosition.left }}\n    >\n      <PromptForm\n        setUserPrompt={setUserPrompt}\n        handlePromptSubmit={onSubmitPrompt}\n        selectedElements={selectedElements}\n      />\n    </div>\n  );\n};\n","\"use client\";\nimport React from \"react\";\nimport { IconSquareDashedPointer } from \"../Icons\";\nimport { cn } from \"../utils\";\n\ninterface BubbleMenuButtonProps {\n  /**\n   * Whether the inspector is currently active\n   */\n  isInspecting: boolean;\n\n  /**\n   * Click handler for the button\n   */\n  onClick: () => void;\n}\n\n/**\n * The main floating button for toggling the element inspector\n */\nexport function BubbleMenuButton({\n  isInspecting,\n  onClick,\n}: BubbleMenuButtonProps) {\n  const title = isInspecting\n    ? \"Disable Element Inspector\"\n    : \"Enable Element Inspector\";\n\n  return (\n    <button\n      onClick={onClick}\n      className={cn(\n        \"flex items-center justify-center p-2 rounded-full shadow-md transition-colors\",\n        isInspecting \n          ? \"bg-[#2563eb] hover:bg-[#1d4ed8]\" \n          : \"bg-[#93c5fd] hover:bg-[#60a5fa]\"\n      )}\n      title={title}\n    >\n      <IconSquareDashedPointer />\n    </button>\n  );\n}\n","\"use client\";\nimport React from \"react\";\nimport { BubbleMenuButton } from \"../BubbleMenuButton\";\n\ninterface FloatingButtonProps {\n  isInspecting: boolean;\n  onToggle: () => void;\n}\n\nexport const FloatingButton: React.FC<FloatingButtonProps> = ({\n  isInspecting,\n  onToggle,\n}) => {\n  return (\n    <div className=\"element-inspector-floating-button-container fixed bottom-6 right-6 z-[10000]\">\n      <BubbleMenuButton isInspecting={isInspecting} onClick={onToggle} />\n    </div>\n  );\n};\n","\"use client\";\nimport React from \"react\";\nimport { MenuArrow } from \"./MenuArrow\";\nimport { ExpandedMenu } from \"./ExpandedMenu\";\nimport { FloatingButton } from \"./FloatingButton\";\n\ninterface BubbleMenuProps {\n  isInspecting: boolean;\n  selectedElements: HTMLElement[];\n  bubblePosition: { top: number; left: number };\n  isMenuAboveElement: boolean;\n  userPrompt: string;\n  setUserPrompt: (prompt: string) => void;\n  onSubmitPrompt: (e: React.FormEvent) => void;\n  onToggleInspection: () => void;\n  isDarkMode: boolean;\n  showBubbleMenuButton: boolean;\n}\n\nexport const BubbleMenu: React.FC<BubbleMenuProps> = ({\n  isInspecting,\n  selectedElements,\n  bubblePosition,\n  isMenuAboveElement,\n  userPrompt,\n  setUserPrompt,\n  onSubmitPrompt,\n  onToggleInspection,\n  isDarkMode,\n  showBubbleMenuButton,\n}) => {\n  const showMenu = isInspecting && selectedElements.length > 0;\n\n  return (\n    <div className=\"element-inspector-bubble\">\n      {/* Expanded Menu with Arrow */}\n      {showMenu && (\n        <>\n          <MenuArrow\n            isMenuAboveElement={isMenuAboveElement}\n            bubblePosition={bubblePosition}\n            isDarkMode={isDarkMode}\n            isVisible={selectedElements.length > 0}\n          />\n\n          <ExpandedMenu\n            bubblePosition={bubblePosition}\n            userPrompt={userPrompt}\n            setUserPrompt={setUserPrompt}\n            onSubmitPrompt={onSubmitPrompt}\n            selectedElements={selectedElements}\n            selectedElementsCount={selectedElements.length}\n            isDarkMode={isDarkMode}\n          />\n        </>\n      )}\n\n      {/* Floating Button */}\n      {showBubbleMenuButton && (\n        <FloatingButton\n          isInspecting={isInspecting}\n          onToggle={onToggleInspection}\n        />\n      )}\n    </div>\n  );\n};\n","\"use client\";\nimport React from \"react\";\n\ninterface ElementTagLabelProps {\n  /**\n   * The HTML element to display the tag for\n   */\n  element: HTMLElement;\n}\n\n/**\n * A label that displays the tag name of an HTML element\n */\nexport function ElementTagLabel({ element }: ElementTagLabelProps) {\n  return (\n    <div className=\"absolute top-[0.5px] left-[0.5px] bg-[rgba(52,53,65,0.8)] rounded text-xs text-white py-0.5 px-1.5 pointer-events-none\">\n      {element.tagName.toLowerCase()}\n    </div>\n  );\n}\n","\"use client\";\nimport React from \"react\";\nimport { ElementHighlighter } from \"../../ElementHighlighter\";\nimport { ElementTagLabel } from \"../ElementTagLabel\";\n\ninterface HoveredElementProps {\n  hoveredElement: HTMLElement | null;\n  elementLabel?: (element: HTMLElement) => React.ReactNode;\n  highlighterStyle?: React.CSSProperties;\n}\n\nexport const HoveredElement: React.FC<HoveredElementProps> = ({\n  hoveredElement,\n  elementLabel,\n  highlighterStyle,\n}) => {\n  if (!hoveredElement) return null;\n\n  return (\n    <ElementHighlighter\n      element={hoveredElement}\n      borderColor=\"rgba(59, 130, 246, 0.8)\" // Blue border\n      // backgroundColor=\"rgba(59, 130, 246, 0.2)\" // Light blue background\n      style={highlighterStyle}\n    >\n      {elementLabel ? (\n        elementLabel(hoveredElement)\n      ) : (\n        <ElementTagLabel element={hoveredElement} />\n      )}\n    </ElementHighlighter>\n  );\n};\n","\"use client\";\nimport React from \"react\";\nimport { ElementHighlighter } from \"../../ElementHighlighter\";\nimport { ElementTagLabel } from \"../ElementTagLabel\";\n\ninterface SelectedElementsProps {\n  selectedElements: HTMLElement[];\n  elementLabel?: (element: HTMLElement) => React.ReactNode;\n  highlighterStyle?: React.CSSProperties;\n}\n\nexport const SelectedElements: React.FC<SelectedElementsProps> = ({\n  selectedElements,\n  elementLabel,\n  highlighterStyle,\n}) => {\n  return (\n    <>\n      {selectedElements.map((element, index) => {\n        // Add data attribute to mark as selected for tracking\n        element.setAttribute(\"data-element-inspector-selected\", \"true\");\n        return (\n          <ElementHighlighter\n            key={`selected-${index}`}\n            element={element}\n            borderColor=\"rgba(34, 197, 94, 0.8)\" // Green border\n            // backgroundColor=\"rgba(34, 197, 94, 0.2)\" // Light green background\n            style={highlighterStyle}\n          >\n            {elementLabel ? (\n              elementLabel(element)\n            ) : (\n              <ElementTagLabel element={element} />\n            )}\n          </ElementHighlighter>\n        );\n      })}\n    </>\n  );\n};\n","\"use client\";\nimport React from 'react';\nimport { ElementSelector } from '../ElementSelector';\nimport { HoveredElement } from './highlights/HoveredElement';\nimport { SelectedElements } from './highlights/SelectedElements';\n\ninterface InspectionOverlayProps {\n  isInspecting: boolean;\n  hoveredElement: HTMLElement | null;\n  selectedElements: HTMLElement[];\n  onElementHovered: (element: HTMLElement) => void;\n  onElementSelected: (element: HTMLElement) => void;\n  onElementUnhovered: () => void;\n  excludeSelector: string;\n  selectorStyle?: React.CSSProperties;\n  highlighterStyle?: React.CSSProperties;\n  elementLabel?: (element: HTMLElement) => React.ReactNode;\n}\n\nexport const InspectionOverlay: React.FC<InspectionOverlayProps> = ({\n  isInspecting,\n  hoveredElement,\n  selectedElements,\n  onElementHovered,\n  onElementSelected,\n  onElementUnhovered,\n  excludeSelector,\n  selectorStyle,\n  highlighterStyle,\n  elementLabel,\n}) => {\n  if (!isInspecting) return null;\n  \n  return (\n    <>\n      {/* Element selection overlay */}\n      <ElementSelector\n        onElementHovered={onElementHovered}\n        onElementSelected={onElementSelected}\n        onElementUnhovered={onElementUnhovered}\n        ignoreList={selectedElements}\n        excludeSelector={excludeSelector}\n        style={selectorStyle}\n      />\n      \n      {/* Highlight for hovered element */}\n      <HoveredElement \n        hoveredElement={hoveredElement}\n        elementLabel={elementLabel}\n        highlighterStyle={highlighterStyle}\n      />\n      \n      {/* Highlights for selected elements */}\n      <SelectedElements\n        selectedElements={selectedElements}\n        elementLabel={elementLabel}\n        highlighterStyle={highlighterStyle}\n      />\n    </>\n  );\n};\n","import { useState, useEffect } from 'react';\n\n/**\n * Custom hook to detect and track dark mode preferences\n */\nexport function useDarkMode() {\n  const [isDarkMode, setIsDarkMode] = useState(false);\n  \n  useEffect(() => {\n    // Check initial dark mode preference\n    const isDark = window.matchMedia && \n      window.matchMedia('(prefers-color-scheme: dark)').matches;\n    setIsDarkMode(isDark);\n    \n    // Listen for changes in color scheme preference\n    const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n    const handleChange = (e: MediaQueryListEvent) => setIsDarkMode(e.matches);\n    \n    mediaQuery.addEventListener('change', handleChange);\n    return () => mediaQuery.removeEventListener('change', handleChange);\n  }, []);\n  \n  return isDarkMode;\n}\n","import { useState, useEffect } from 'react';\nimport { UI_CONSTANTS } from '../constants';\nimport { useEleventEventStore } from '../stores/elementEvent';\n\ninterface BubblePosition {\n  top: number;\n  left: number;\n  arrowOffset: number;\n}\n\ninterface UseElementBubblePositionProps {\n  selectedElements: HTMLElement[];\n  menuWidth?: number;\n  spacing?: number;\n}\n\n/**\n * Custom hook to calculate and update the position of a bubble menu\n * relative to selected elements\n */\nexport function useElementBubblePosition({\n  selectedElements,\n  menuWidth = UI_CONSTANTS.MENU_WIDTH,\n  spacing = UI_CONSTANTS.SPACING,\n}: UseElementBubblePositionProps) {\n  const { selectedAction, selectedEvent, showEventForm } = useEleventEventStore((state) => state);\n  const [bubblePosition, setBubblePosition] = useState<BubblePosition>({ \n    top: 0, \n    left: 0, \n    arrowOffset: UI_CONSTANTS.ARROW_LEFT_OFFSET \n  });\n  const [isMenuAboveElement, setIsMenuAboveElement] = useState(false);\n  \n  // Calculate and update bubble position based on selected elements\n  useEffect(() => {\n    if (selectedElements.length === 0) return;\n    \n    const updateBubblePosition = () => {\n      const lastElement = selectedElements[selectedElements.length - 1];\n      const rect = lastElement.getBoundingClientRect();\n      const viewportWidth = window.innerWidth;\n      const viewportHeight = window.innerHeight;\n      \n      // Calculate element center point for arrow positioning\n      const elementCenterX = rect.left + (rect.width / 2);\n\n      const menuHeight = document.querySelector('.element-inspector-menu')?.clientHeight || UI_CONSTANTS.MENU_HEIGHT\n      \n      // Check if element is near the bottom of the viewport\n      const isNearBottom = (rect.bottom + menuHeight + spacing * 2 > viewportHeight);\n      \n      // Update state to indicate menu position\n      setIsMenuAboveElement(isNearBottom);\n      \n      // Position calculations - below or above the element based on position\n      let top = isNearBottom \n        ? rect.top + window.scrollY - menuHeight - spacing // spacing above the element\n        : rect.bottom + window.scrollY + spacing; // spacing below the element\n        \n      // Initialize left position - align with the element's left edge\n      // (changed from centering to better work with left-aligned arrow)\n      let left = rect.left + window.scrollX;\n      \n      // Special case for elements very close to the bottom of the page\n      if (isNearBottom && rect.top < menuHeight + spacing * 2) {\n        // If there's not enough space above or below, position beside the element\n        const spaceRight = viewportWidth - rect.right;\n        if (spaceRight >= menuWidth + spacing * 2) {\n          // Place to the right\n          top = rect.top + window.scrollY;\n          left = rect.right + window.scrollX + spacing;\n        } else {\n          // As a last resort, position at top of page with enough space for scrolling\n          top = window.scrollY + spacing;\n        }\n      }\n      \n      // Ensure the bubble stays within viewport bounds horizontally\n      left = Math.max(spacing, Math.min(left, viewportWidth - menuWidth - spacing));\n      \n      // Calculate arrow position relative to the menu - should point to element center\n      const arrowOffset = elementCenterX - left - window.scrollX;\n\n      const scrolledPixels = window.scrollY || window.pageYOffset;\n      \n      // Ensure the bubble stays within viewport bounds vertically\n      top = Math.max(spacing, top) - scrolledPixels;\n      \n      setBubblePosition({ \n        top, \n        left, \n        // Keep arrow within menu bounds (spacing*2 to width-spacing*2)\n        arrowOffset: Math.min(Math.max(spacing * 2, arrowOffset), menuWidth - spacing * 2)\n      });\n    };\n    \n    // Initial calculation\n    updateBubblePosition();\n    \n    // Re-calculate on window resize or scroll\n    window.addEventListener('resize', updateBubblePosition);\n    window.addEventListener('scroll', updateBubblePosition);\n    \n    return () => {\n      window.removeEventListener('resize', updateBubblePosition);\n      window.removeEventListener('scroll', updateBubblePosition);\n    };\n  }, [selectedElements, menuWidth, spacing, selectedAction, selectedEvent, showEventForm]);\n  \n  return { bubblePosition, isMenuAboveElement };\n}\n","import { useState, useCallback, useEffect } from 'react';\n\ninterface UseElementSelectionProps {\n  /**\n   * Callback when elements are selected\n   */\n  onElementsSelected?: (elements: HTMLElement[]) => void;\n}\n\n/**\n * Custom hook to manage element selection and hovering\n */\nexport function useElementSelection({ onElementsSelected }: UseElementSelectionProps = {}) {\n  const [hoveredElement, setHoveredElement] = useState<HTMLElement | null>(null);\n  const [selectedElements, setSelectedElements] = useState<HTMLElement[]>([]);\n\n  // Element hover handlers\n  const handleElementHovered = useCallback((element: HTMLElement) => {\n    setHoveredElement(element);\n  }, []);\n\n  const handleElementUnhovered = useCallback(() => {\n    setHoveredElement(null);\n  }, []);\n\n  // Element selection handler\n  const handleElementSelected = useCallback((element: HTMLElement) => {\n    const isElementSelected = selectedElements.includes(element);\n    \n    // If element is already selected, remove it\n    if (isElementSelected) {\n      // Remove data attribute\n      element.removeAttribute('data-element-inspector-selected');\n      \n      const newSelectedElements = selectedElements.filter(el => el !== element);\n      setSelectedElements(newSelectedElements);\n      onElementsSelected?.(newSelectedElements);\n    } \n    // If element is not selected, unselect old elements and select only this one\n    else {\n      // Remove data attribute from previously selected elements\n      selectedElements.forEach(el => {\n        el.removeAttribute('data-element-inspector-selected');\n      });\n      \n      // Add data attribute to newly selected element\n      element.setAttribute('data-element-inspector-selected', 'true');\n      \n      const newSelectedElements = [element];\n      setSelectedElements(newSelectedElements);\n      onElementsSelected?.(newSelectedElements);\n    }\n  }, [selectedElements, onElementsSelected]);\n\n  // Clear all selections\n  const clearSelections = useCallback(() => {\n    // Remove data attributes from currently selected elements\n    selectedElements.forEach(element => {\n      element.removeAttribute('data-element-inspector-selected');\n    });\n    \n    setSelectedElements([]);\n    onElementsSelected?.([]);\n  }, [selectedElements, onElementsSelected]);\n\n  // Listen for the clearElementSelections event\n  useEffect(() => {\n    const handleClearSelections = () => {\n      clearSelections();\n    };\n\n    document.addEventListener('clearElementSelections', handleClearSelections);\n    \n    return () => {\n      document.removeEventListener('clearElementSelections', handleClearSelections);\n    };\n  }, [clearSelections]);\n\n  // Clean up data attributes when component unmounts\n  useEffect(() => {\n    return () => {\n      // Cleanup data attributes\n      selectedElements.forEach(element => {\n        element.removeAttribute('data-element-inspector-selected');\n      });\n    };\n  }, [selectedElements]);\n\n  return {\n    hoveredElement,\n    selectedElements,\n    handleElementHovered,\n    handleElementUnhovered,\n    handleElementSelected,\n    clearSelections\n  };\n}\n","import kebabCase from \"lodash/kebabCase\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { useWorkflowsStore } from \"../stores/workflows\";\nimport { useEleventEventStore } from \"../stores/elementEvent\";\nimport {\n  extractElementProperties,\n  generateEventHandlerPrompt,\n  getAllFormElements,\n} from \"../utils\";\n\ntype TabType = 'chat' | 'design' | 'workflow' | null;\n\n/**\n * Custom hook to handle cross-frame communication\n */\nexport function useIframeMessaging() {\n  const [activeTab, setActiveTab] = useState<TabType>(null);\n  const [shouldEnableInspect, setShouldEnableInspect] = useState<boolean>(false);\n  \n  // Effect to listen for messages from the parent window\n  useEffect(() => {    \n    const handleMessage = (event: MessageEvent) => {\n      if (event.data?.type === 'TAB_CHANGED') {\n        const { activeTab: newActiveTab } = event.data.payload || {};\n        \n        setActiveTab(newActiveTab as TabType);\n        \n        // Disable inspect mode for chat tab\n        if (newActiveTab === 'chat') {\n          setShouldEnableInspect(false);\n        }\n        // Enable inspect mode for design and workflow tabs\n        else if (newActiveTab === 'design' || newActiveTab === 'workflow') {\n          setShouldEnableInspect(true);\n        }\n      } else if (event.data?.type === 'WORKFLOW_LIST') {\n        useWorkflowsStore.getState().setWorkflows(event.data.workflows);\n      } else if (event.data?.type === 'ELEMENT_INSPECTOR_UPDATE') {\n        const { target, text, style, src, element } = event.data;\n        \n        // Find element with matching data-simplify-id\n        if (target) {\n          const targetElement = document.querySelector(`[data-simplify-id=\"${target}\"]`) as HTMLElement;\n          \n          if (targetElement) {\n            // Replace HTML if element is provided\n            if (element !== undefined) {\n              const allTargetElements = document.querySelectorAll(`[data-simplify-id=\"${target}\"]`);\n              allTargetElements.forEach((el) => {\n                (el as HTMLElement).innerHTML = element;\n              });\n            }\n            \n            // Update text content if provided\n            if (text !== undefined) {\n              targetElement.textContent = text;\n            }\n            \n            // Update src attribute if provided (for img, iframe, video, audio, etc.)\n            if (src !== undefined) {\n              targetElement.setAttribute('src', src);\n            }\n            \n            // Apply styles if provided\n            if (style && typeof style === 'object') {\n              // Find all elements with the same data-simplify-id\n              const allTargetElements = document.querySelectorAll(`[data-simplify-id=\"${target}\"]`);\n              \n              allTargetElements.forEach((element) => {\n                const el = element as HTMLElement;\n                Object.entries(style).forEach(([key, value]) => {\n                  if (value === 'default') {\n                    // Remove the style property if value is \"default\"\n                    el.style.removeProperty(kebabCase(key));\n                  } else {\n                    // Apply the style\n                    el.style[key as any] = value as string;\n                  }\n                });\n              });\n            }\n          }\n        }\n      }\n    };\n    \n    window.addEventListener('message', handleMessage);\n    return () => {\n      window.removeEventListener('message', handleMessage);\n    };  }, [activeTab]);\n\n  // Send selected elements to parent window\n  const sendSelectedElements = useCallback((elements: HTMLElement[]) => {\n    window.parent.postMessage({\n      type: 'ELEMENT_INSPECTOR_SELECTED',\n      payload: {\n        referenceInputs: getAllFormElements(),\n        elements: elements.map(el => extractElementProperties(el))\n      }\n    }, '*');\n  }, []);\n  \n  // Send generated prompt to parent window\n  const sendPrompt = useCallback((prompt: string, elements: HTMLElement[]) => {\n    let finalPrompt = prompt\n    const workflowId = useWorkflowsStore.getState().workflowId\n    if (!!workflowId && !!prompt) {\n      const { selectedEvent, selectedAction } = useEleventEventStore.getState();\n      finalPrompt += generateEventHandlerPrompt({\n        event: selectedEvent,\n        action: selectedAction,\n        elements\n      })\n    }\n    \n    window.parent.postMessage({\n      type: 'ELEMENT_INSPECTOR_PROMPT',\n      payload: {\n        workflowId,\n        prompt: finalPrompt,\n        activeTab,\n        referenceInputs: getAllFormElements(),\n        elements: elements.map(el => extractElementProperties(el))\n      }\n    }, '*');\n  }, [activeTab]);\n  \n  return {\n    sendSelectedElements,\n    sendPrompt,\n    activeTab,\n    shouldEnableInspect\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\nimport { createElementsPrompt } from '../utils';\n\ninterface UseInspectorProps {\n  initialIsActive?: boolean;\n  onPromptGenerated?: (prompt: string, elements: HTMLElement[]) => void;\n}\n\n/**\n * Custom hook to manage the inspector state and prompt generation\n */\nexport function useInspector({\n  initialIsActive = true,\n  onPromptGenerated\n}: UseInspectorProps = {}) {\n  const [isInspecting, setIsInspecting] = useState(initialIsActive);\n  const [userPrompt, setUserPrompt] = useState('');\n  \n  // Toggle inspection mode\n  const toggleInspection = useCallback(() => {\n    setIsInspecting(prev => !prev);\n  }, []);\n  \n  // Handle ESC key to exit inspection mode\n  useEffect(() => {\n    const handleKeyDown = (event: KeyboardEvent) => {\n      if (event.key === 'Escape' && isInspecting) {\n        setIsInspecting(false);\n      }\n    };\n\n    window.addEventListener('keydown', handleKeyDown);\n    return () => {\n      window.removeEventListener('keydown', handleKeyDown);\n    };\n  }, [isInspecting]);\n  \n  // Generate prompt from selected elements and user input\n  const generatePrompt = useCallback((elements: HTMLElement[], prompt: string) => {\n    if (elements.length === 0 || !prompt.trim()) return;\n    \n    const generatedPrompt = createElementsPrompt(elements, prompt);\n    \n    // Dispatch custom event for local handlers\n    const promptEvent = new CustomEvent('promptGenerated', {\n      detail: { prompt: generatedPrompt, elements }\n    });\n    document.dispatchEvent(promptEvent);\n    \n    // Call the callback if provided\n    onPromptGenerated?.(generatedPrompt, elements);\n    \n    // Clear the prompt input\n    setUserPrompt('');\n  }, [onPromptGenerated]);\n  \n  // Handle form submission\n  const handlePromptSubmit = useCallback((e: React.FormEvent, elements: HTMLElement[]) => {\n    e.preventDefault();\n    generatePrompt(elements, userPrompt);\n  }, [userPrompt, generatePrompt]);\n  \n  return {\n    isInspecting,\n    userPrompt,\n    setUserPrompt,\n    toggleInspection,\n    handlePromptSubmit,\n    generatePrompt\n  };\n}\n"],"mappings":";AACyB,SAAR,YAA6B,KAAK,EAAE,SAAS,IAAI,CAAC,GAAG;AAC1D,MAAI,CAAC,OAAO,OAAO,aA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,MAAM;AACzC,qBAAiB;AACjB,QAAI,cAAc;AAChB,sBAAgB;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,cAAc,kBAAkB,eAAe,CAAC;AAGpD,QAAM,iBAAiBA,aAAY,CAAC,MAAuB;AACzD,uBAAmB,GAAG,gBAAgB;AAAA,EACxC,GAAG,CAAC,oBAAoB,gBAAgB,CAAC;AAGzC,EAAAC,WAAU,MAAM;AACd,QAAI,iBAAiB,qBAAqB;AACxC,uBAAiB;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,cAAc,qBAAqB,gBAAgB,CAAC;AAGxD,QAAM,cAAcC,QAA0C,IAAI;AAGlE,EAAAD,WAAU,MAAM;AAEd,WAAO,OAAO,YAAY,EAAE,MAAM,mBAAmB,GAAG,GAAG;AAG3D,qBAAiB;AAGjB,gBAAY,UAAU,iBAAiB,gBAAgB;AAGvD,WAAO,MAAM;AACX,UAAI,YAAY,SAAS;AACvB,oBAAY,QAAQ,WAAW;AAAA,MACjC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SACE,gBAAAF,MAAC,SAEC;AAAA,oBAAAD;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,kBAAkB;AAAA,QAClB,mBAAmB;AAAA,QACnB,oBAAoB;AAAA,QACpB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,IAGA,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,oBAAoB;AAAA,QACpB;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["useCallback","useRef","jsx","useRef","useCallback","useCallback","useEffect","useRef","jsx","React","useEffect","useRef","create","React","jsx","jsx","jsx","jsx","jsx","jsx","jsxs","useRef","React","tagName","useEffect","jsx","jsx","jsx","jsx","jsx","jsxs","jsx","jsx","Fragment","jsx","Fragment","jsx","jsxs","useState","useEffect","useState","useEffect","useState","useEffect","useState","useCallback","useEffect","useCallback","useEffect","useState","useState","useEffect","element","useCallback","useState","useCallback","useEffect","useState","useCallback","useEffect","jsx","jsxs","useCallback","useEffect","useRef"]}