react-grab 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.cjs CHANGED
@@ -1896,7 +1896,7 @@ var init_web = __esm({
1896
1896
  var styles_default;
1897
1897
  var init_styles = __esm({
1898
1898
  "dist/styles.css"() {
1899
- styles_default = '/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:"Geist",ui-sans-serif,system-ui,sans-serif;--font-mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--radius-sm:.25rem;--ease-out:cubic-bezier(0,0,.2,1);--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--transition-fast:.1s;--transition-normal:.15s;--transition-slow:.2s}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;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");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.touch-hitbox{position:relative}.touch-hitbox:before{content:"";width:100%;min-width:32px;height:100%;min-height:32px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-0{top:calc(var(--spacing)*0)}.top-0\\.5{top:calc(var(--spacing)*.5)}.top-full{top:100%}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-0\\.5{left:calc(var(--spacing)*.5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing)*2.5)}.z-10{z-index:10}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-0\\.5{margin-inline:calc(var(--spacing)*.5)}.-my-1\\.5{margin-block:calc(var(--spacing)*-1.5)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-2\\.5{margin-top:calc(var(--spacing)*2.5)}.mr-1\\.5{margin-right:calc(var(--spacing)*1.5)}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2\\.5{margin-bottom:calc(var(--spacing)*2.5)}.-ml-\\[2px\\]{margin-left:-2px}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.size-1\\.5{width:calc(var(--spacing)*1.5);height:calc(var(--spacing)*1.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-\\[18px\\]{width:18px;height:18px}.h-0{height:calc(var(--spacing)*0)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-\\[17px\\]{height:17px}.h-fit{height:fit-content}.min-h-4{min-height:calc(var(--spacing)*4)}.w-0{width:calc(var(--spacing)*0)}.w-2{width:calc(var(--spacing)*2)}.w-5{width:calc(var(--spacing)*5)}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition-property:transform;transition-duration:var(--transition-normal);transition-timing-function:cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transform:scale(.97)}.press-scale{transition-property:transform;transition-duration:var(--transition-fast);transition-timing-function:ease-out}.press-scale:active{transform:scale(.97)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#B3B3B3\\]{border-color:#b3b3b3}.border-t-\\[\\#D9D9D9\\]{border-top-color:#d9d9d9}.bg-\\[\\#FEF2F2\\]{background-color:#fef2f2}.bg-black{background-color:var(--color-black)}.bg-black\\/5{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bg-black\\/5{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.bg-black\\/25{background-color:#00000040}@supports (color:color-mix(in lab, red, red)){.bg-black\\/25{background-color:color-mix(in oklab,var(--color-black)25%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:calc(var(--spacing)*0)}.px-0\\.25{padding-inline:calc(var(--spacing)*.25)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-\\[3px\\]{padding-inline:3px}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-0\\.25{padding-block:calc(var(--spacing)*.25)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-px{padding-block:1px}.pt-1\\.5{padding-top:calc(var(--spacing)*1.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.text-left{text-align:left}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.leading-3{--tw-leading:calc(var(--spacing)*3);line-height:calc(var(--spacing)*3)}.leading-3\\.5{--tw-leading:calc(var(--spacing)*3.5);line-height:calc(var(--spacing)*3.5)}.leading-4{--tw-leading:calc(var(--spacing)*4);line-height:calc(var(--spacing)*4)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#71717a\\]{color:#71717a}.text-\\[\\#B3B3B3\\]{color:#b3b3b3}.text-\\[\\#B91C1C\\]{color:#b91c1c}.text-black{color:var(--color-black)}.text-black\\/30{color:#0000004d}@supports (color:color-mix(in lab, red, red)){.text-black\\/30{color:color-mix(in oklab,var(--color-black)30%,transparent)}}.text-black\\/40{color:#0006}@supports (color:color-mix(in lab, red, red)){.text-black\\/40{color:color-mix(in oklab,var(--color-black)40%,transparent)}}.text-black\\/50{color:#00000080}@supports (color:color-mix(in lab, red, red)){.text-black\\/50{color:color-mix(in oklab,var(--color-black)50%,transparent)}}.text-black\\/60{color:#0009}@supports (color:color-mix(in lab, red, red)){.text-black\\/60{color:color-mix(in oklab,var(--color-black)60%,transparent)}}.text-black\\/70{color:#000000b3}@supports (color:color-mix(in lab, red, red)){.text-black\\/70{color:color-mix(in oklab,var(--color-black)70%,transparent)}}.text-black\\/85{color:#000000d9}@supports (color:color-mix(in lab, red, red)){.text-black\\/85{color:color-mix(in oklab,var(--color-black)85%,transparent)}}.text-white{color:var(--color-white)}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter-\\[drop-shadow\\(0px_1px_2px_\\#51515140\\)\\]{filter:drop-shadow(0 1px 2px #51515140)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,)var(--tw-contain-layout,)var(--tw-contain-paint,)var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-\\[\\#FEE2E2\\]:hover{background-color:#fee2e2}.hover\\:bg-black\\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/5:hover{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.hover\\:bg-black\\/10:hover{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/10:hover{background-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.hover\\:text-black:hover{color:var(--color-black)}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}}@keyframes shake{0%,to{transform:translate(0)}15%{transform:translate(-3px)}30%{transform:translate(3px)}45%{transform:translate(-3px)}60%{transform:translate(3px)}75%{transform:translate(-2px)}90%{transform:translate(2px)}}@keyframes pop-in{0%{opacity:0;transform:scale(.9)}70%{opacity:1;transform:scale(1.02)}to{opacity:1;transform:scale(1)}}@keyframes pop-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes slide-in-bottom{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-top{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-left{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes slide-in-right{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}@keyframes success-pop{0%{opacity:0;transform:scale(.9)}60%{opacity:1;transform:scale(1.1)}80%{transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}@keyframes icon-loader-spin{0%{opacity:1}50%{opacity:.5}to{opacity:.2}}.icon-loader-bar{animation:.5s linear infinite icon-loader-spin}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-text{color:#0000;background:linear-gradient(90deg,#71717a 0%,#a1a1aa 25%,#71717a 50%,#a1a1aa 75%,#71717a 100%) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake{will-change:transform;animation:.3s ease-out shake}.animate-pop-in{animation:pop-in var(--transition-normal)ease-out;will-change:transform,opacity}.animate-pop-out{animation:pop-out var(--transition-normal)ease-out forwards;will-change:transform,opacity}.animate-slide-in-bottom{animation:slide-in-bottom var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-top{animation:slide-in-top var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-left{animation:slide-in-left var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-right{animation:slide-in-right var(--transition-slow)ease-out;will-change:transform,opacity}.animate-success-pop{will-change:transform,opacity;animation:.25s ease-out success-pop}.animate-tooltip-fade-in{animation:tooltip-fade-in var(--transition-fast)ease-out;will-change:transform,opacity}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';
1899
+ styles_default = '/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:"Geist",ui-sans-serif,system-ui,sans-serif;--font-mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;--color-yellow-500:oklch(79.5% .184 86.047);--color-black:#000;--color-white:#fff;--spacing:4px;--text-sm:14px;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--radius-sm:4px;--ease-out:cubic-bezier(0,0,.2,1);--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--transition-fast:.1s;--transition-normal:.15s;--transition-slow:.2s}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;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");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.touch-hitbox{position:relative}.touch-hitbox:before{content:"";width:100%;min-width:32px;height:100%;min-height:32px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-0{top:calc(var(--spacing)*0)}.top-0\\.5{top:calc(var(--spacing)*.5)}.top-1\\/2{top:50%}.top-full{top:100%}.right-full{right:100%}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-0\\.5{left:calc(var(--spacing)*.5)}.left-1\\.5{left:calc(var(--spacing)*1.5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing)*2.5)}.left-full{left:100%}.z-10{z-index:10}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.m-0{margin:calc(var(--spacing)*0)}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-0\\.5{margin-inline:calc(var(--spacing)*.5)}.-my-1\\.5{margin-block:calc(var(--spacing)*-1.5)}.my-0\\.5{margin-block:calc(var(--spacing)*.5)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-2\\.5{margin-top:calc(var(--spacing)*2.5)}.mr-0\\.5{margin-right:calc(var(--spacing)*.5)}.mr-1\\.5{margin-right:calc(var(--spacing)*1.5)}.mr-2\\.5{margin-right:calc(var(--spacing)*2.5)}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2\\.5{margin-bottom:calc(var(--spacing)*2.5)}.-ml-\\[2px\\]{margin-left:-2px}.ml-0\\.5{margin-left:calc(var(--spacing)*.5)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2\\.5{margin-left:calc(var(--spacing)*2.5)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-auto{margin-left:auto}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.size-1\\.5{width:calc(var(--spacing)*1.5);height:calc(var(--spacing)*1.5)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-\\[18px\\]{width:18px;height:18px}.h-0{height:calc(var(--spacing)*0)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-2\\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-\\[17px\\]{height:17px}.h-fit{height:fit-content}.max-h-\\[240px\\]{max-height:240px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-4{min-height:calc(var(--spacing)*4)}.w-0{width:calc(var(--spacing)*0)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition-property:transform;transition-duration:var(--transition-normal);transition-timing-function:cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transform:scale(.97)}.press-scale{transition-property:transform;transition-duration:var(--transition-fast);transition-timing-function:ease-out}.press-scale:active{transform:scale(.97)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.grid-rows-\\[0fr\\]{grid-template-rows:0fr}.grid-rows-\\[1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#B3B3B3\\]{border-color:#b3b3b3}.border-t-\\[\\#D9D9D9\\]{border-top-color:#d9d9d9}.bg-\\[\\#FEF2F2\\]{background-color:#fef2f2}.bg-black{background-color:var(--color-black)}.bg-black\\/5{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.bg-black\\/5{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.bg-black\\/25{background-color:#00000040}@supports (color:color-mix(in lab, red, red)){.bg-black\\/25{background-color:color-mix(in oklab,var(--color-black)25%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-500{background-color:var(--color-yellow-500)}.p-0{padding:calc(var(--spacing)*0)}.px-0\\.25{padding-inline:calc(var(--spacing)*.25)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-\\[3px\\]{padding-inline:3px}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-0\\.25{padding-block:calc(var(--spacing)*.25)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-px{padding-block:1px}.pt-1\\.5{padding-top:calc(var(--spacing)*1.5)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.text-left{text-align:left}.font-sans{font-family:var(--font-sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-3{--tw-leading:calc(var(--spacing)*3);line-height:calc(var(--spacing)*3)}.leading-3\\.5{--tw-leading:calc(var(--spacing)*3.5);line-height:calc(var(--spacing)*3.5)}.leading-4{--tw-leading:calc(var(--spacing)*4);line-height:calc(var(--spacing)*4)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#71717a\\]{color:#71717a}.text-\\[\\#B3B3B3\\]{color:#b3b3b3}.text-\\[\\#B91C1C\\]{color:#b91c1c}.text-black{color:var(--color-black)}.text-black\\/25{color:#00000040}@supports (color:color-mix(in lab, red, red)){.text-black\\/25{color:color-mix(in oklab,var(--color-black)25%,transparent)}}.text-black\\/30{color:#0000004d}@supports (color:color-mix(in lab, red, red)){.text-black\\/30{color:color-mix(in oklab,var(--color-black)30%,transparent)}}.text-black\\/40{color:#0006}@supports (color:color-mix(in lab, red, red)){.text-black\\/40{color:color-mix(in oklab,var(--color-black)40%,transparent)}}.text-black\\/50{color:#00000080}@supports (color:color-mix(in lab, red, red)){.text-black\\/50{color:color-mix(in oklab,var(--color-black)50%,transparent)}}.text-black\\/60{color:#0009}@supports (color:color-mix(in lab, red, red)){.text-black\\/60{color:color-mix(in oklab,var(--color-black)60%,transparent)}}.text-black\\/70{color:#000000b3}@supports (color:color-mix(in lab, red, red)){.text-black\\/70{color:color-mix(in oklab,var(--color-black)70%,transparent)}}.text-black\\/80{color:#000c}@supports (color:color-mix(in lab, red, red)){.text-black\\/80{color:color-mix(in oklab,var(--color-black)80%,transparent)}}.text-black\\/85{color:#000000d9}@supports (color:color-mix(in lab, red, red)){.text-black\\/85{color:color-mix(in oklab,var(--color-black)85%,transparent)}}.text-white{color:var(--color-white)}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter-\\[drop-shadow\\(0px_1px_2px_\\#51515140\\)\\]{filter:drop-shadow(0 1px 2px #51515140)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-columns\\,opacity\\]{transition-property:grid-template-columns,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\,opacity\\]{transition-property:grid-template-rows,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-\\[opacity\\,transform\\]{will-change:opacity,transform}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,)var(--tw-contain-layout,)var(--tw-contain-paint,)var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}.\\[grid-area\\:1\\/1\\]{grid-area:1/1}.group-focus-within\\:invisible:is(:where(.group):focus-within *){visibility:hidden}.group-focus-within\\:visible:is(:where(.group):focus-within *){visibility:visible}@media (hover:hover){.group-hover\\:invisible:is(:where(.group):hover *){visibility:hidden}.group-hover\\:visible:is(:where(.group):hover *){visibility:visible}}.focus-within\\:bg-black\\/5:focus-within{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.focus-within\\:bg-black\\/5:focus-within{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}@media (hover:hover){.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-\\[\\#FEE2E2\\]:hover{background-color:#fee2e2}.hover\\:bg-black\\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/5:hover{background-color:color-mix(in oklab,var(--color-black)5%,transparent)}}.hover\\:bg-black\\/10:hover{background-color:#0000001a}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-black\\/10:hover{background-color:color-mix(in oklab,var(--color-black)10%,transparent)}}.hover\\:text-\\[\\#B91C1C\\]:hover{color:#b91c1c}.hover\\:text-black:hover{color:var(--color-black)}.hover\\:text-black\\/60:hover{color:#0009}@supports (color:color-mix(in lab, red, red)){.hover\\:text-black\\/60:hover{color:color-mix(in oklab,var(--color-black)60%,transparent)}}.hover\\:opacity-100:hover{opacity:1}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}}:host{all:initial;direction:ltr}@keyframes shake{0%,to{transform:translate(0)}15%{transform:translate(-3px)}30%{transform:translate(3px)}45%{transform:translate(-3px)}60%{transform:translate(3px)}75%{transform:translate(-2px)}90%{transform:translate(2px)}}@keyframes pop-in{0%{opacity:0;transform:scale(.9)}70%{opacity:1;transform:scale(1.02)}to{opacity:1;transform:scale(1)}}@keyframes pop-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes slide-in-bottom{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-top{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-in-left{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes slide-in-right{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}@keyframes success-pop{0%{opacity:0;transform:scale(.9)}60%{opacity:1;transform:scale(1.1)}80%{transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}@keyframes icon-loader-spin{0%{opacity:1}50%{opacity:.5}to{opacity:.2}}.icon-loader-bar{animation:.5s linear infinite icon-loader-spin}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-text{color:#0000;background:linear-gradient(90deg,#71717a 0%,#a1a1aa 25%,#71717a 50%,#a1a1aa 75%,#71717a 100%) 0 0/200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake{will-change:transform;animation:.3s ease-out shake}.animate-pop-in{animation:pop-in var(--transition-normal)ease-out;will-change:transform,opacity}.animate-pop-out{animation:pop-out var(--transition-normal)ease-out forwards;will-change:transform,opacity}.animate-slide-in-bottom{animation:slide-in-bottom var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-top{animation:slide-in-top var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-left{animation:slide-in-left var(--transition-slow)ease-out;will-change:transform,opacity}.animate-slide-in-right{animation:slide-in-right var(--transition-slow)ease-out;will-change:transform,opacity}.animate-success-pop{will-change:transform,opacity;animation:.25s ease-out success-pop}.animate-tooltip-fade-in{animation:tooltip-fade-in var(--transition-fast)ease-out;will-change:transform,opacity}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}';
1900
1900
  }
1901
1901
  });
1902
1902
 
@@ -2148,11 +2148,11 @@ var init_store = __esm({
2148
2148
  });
2149
2149
 
2150
2150
  // src/constants.ts
2151
- var VERSION, VIEWPORT_MARGIN_PX, OFFSCREEN_POSITION, SELECTION_LERP_FACTOR, FEEDBACK_DURATION_MS, FADE_DURATION_MS, FADE_COMPLETE_BUFFER_MS, DISMISS_ANIMATION_BUFFER_MS, KEYDOWN_SPAM_TIMEOUT_MS, BLUR_DEACTIVATION_THRESHOLD_MS, INPUT_FOCUS_ACTIVATION_DELAY_MS, INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS, DEFAULT_KEY_HOLD_DURATION_MS, MIN_HOLD_FOR_ACTIVATION_AFTER_COPY_MS, RECENT_THRESHOLD_MS, ACTION_CYCLE_IDLE_TRIGGER_MS, ACTION_CYCLE_INPUT_THROTTLE_MS, ACTION_CYCLE_SCROLL_THRESHOLD_PX, ACTION_CYCLE_SCROLL_LINE_HEIGHT_PX, ACTION_CYCLE_ACTION_IDS, DRAG_THRESHOLD_PX, ELEMENT_DETECTION_THROTTLE_MS, COMPONENT_NAME_DEBOUNCE_MS, DRAG_PREVIEW_DEBOUNCE_MS, BOUNDS_CACHE_TTL_MS, BOUNDS_RECALC_INTERVAL_MS, AUTO_SCROLL_EDGE_THRESHOLD_PX, AUTO_SCROLL_SPEED_PX, Z_INDEX_LABEL, Z_INDEX_OVERLAY_CANVAS, DRAG_LERP_FACTOR, LERP_CONVERGENCE_THRESHOLD_PX, FADE_OUT_BUFFER_MS, MIN_DEVICE_PIXEL_RATIO, GRAB_PURPLE_RGB, OVERLAY_CROSSHAIR_COLOR, OVERLAY_BORDER_COLOR_DRAG, OVERLAY_FILL_COLOR_DRAG, OVERLAY_BORDER_COLOR_DEFAULT, OVERLAY_FILL_COLOR_DEFAULT, FROZEN_GLOW_COLOR, FROZEN_GLOW_EDGE_PX, ARROW_HEIGHT_PX, ARROW_CENTER_PERCENT, LABEL_GAP_PX, PREVIEW_ATTR_VALUE_MAX_LENGTH, PREVIEW_MAX_ATTRS, PREVIEW_PRIORITY_ATTRS, SCREENSHOT_CAPTURE_DELAY_MS, VIDEO_METADATA_TIMEOUT_MS, VIDEO_READY_POLL_INTERVAL_MS, VIDEO_READY_TIMEOUT_MS, MODIFIER_KEYS, ARROW_KEYS, FROZEN_ELEMENT_ATTRIBUTE, USER_IGNORE_ATTRIBUTE, VIEWPORT_COVERAGE_THRESHOLD, OVERLAY_Z_INDEX_THRESHOLD, DEV_TOOLS_OVERLAY_Z_INDEX_THRESHOLD, TOOLTIP_DELAY_MS, TOOLTIP_GRACE_PERIOD_MS, TOOLBAR_SNAP_MARGIN_PX, TOOLBAR_FADE_IN_DELAY_MS, TOOLBAR_SNAP_ANIMATION_DURATION_MS, TOOLBAR_DRAG_THRESHOLD_PX, TOOLBAR_VELOCITY_MULTIPLIER_MS, TOOLBAR_COLLAPSED_SHORT_PX, TOOLBAR_COLLAPSED_LONG_PX, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS, TOOLBAR_DEFAULT_WIDTH_PX, TOOLBAR_DEFAULT_HEIGHT_PX, TOOLBAR_SHAKE_TOOLTIP_DURATION_MS, DRAG_SELECTION_COVERAGE_THRESHOLD, DRAG_SELECTION_SAMPLE_SPACING_PX, DRAG_SELECTION_MIN_SAMPLES_PER_AXIS, DRAG_SELECTION_MAX_SAMPLES_PER_AXIS, DRAG_SELECTION_MAX_TOTAL_SAMPLE_POINTS, DRAG_SELECTION_EDGE_INSET_PX, MAX_TRANSFORM_ANCESTOR_DEPTH, TRANSFORM_EARLY_BAIL_DEPTH, ELEMENT_POSITION_CACHE_DISTANCE_THRESHOLD_PX, ELEMENT_POSITION_THROTTLE_MS, VISIBILITY_CACHE_TTL_MS, ZOOM_DETECTION_THRESHOLD, MOUNT_ROOT_RECHECK_DELAY_MS, PANEL_STYLES, LOGO_SVG;
2151
+ var VERSION, VIEWPORT_MARGIN_PX, OFFSCREEN_POSITION, SELECTION_LERP_FACTOR, FEEDBACK_DURATION_MS, FADE_DURATION_MS, FADE_COMPLETE_BUFFER_MS, DISMISS_ANIMATION_BUFFER_MS, KEYDOWN_SPAM_TIMEOUT_MS, BLUR_DEACTIVATION_THRESHOLD_MS, WINDOW_REFOCUS_GRACE_PERIOD_MS, INPUT_FOCUS_ACTIVATION_DELAY_MS, INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS, DEFERRED_EXECUTION_DELAY_MS, DEFAULT_KEY_HOLD_DURATION_MS, MIN_HOLD_FOR_ACTIVATION_AFTER_COPY_MS, RECENT_THRESHOLD_MS, ACTION_CYCLE_IDLE_TRIGGER_MS, DRAG_THRESHOLD_PX, ELEMENT_DETECTION_THROTTLE_MS, COMPONENT_NAME_DEBOUNCE_MS, DRAG_PREVIEW_DEBOUNCE_MS, BOUNDS_CACHE_TTL_MS, BOUNDS_RECALC_INTERVAL_MS, AUTO_SCROLL_EDGE_THRESHOLD_PX, AUTO_SCROLL_SPEED_PX, Z_INDEX_HOST, Z_INDEX_LABEL, Z_INDEX_OVERLAY_CANVAS, DRAG_LERP_FACTOR, LERP_CONVERGENCE_THRESHOLD_PX, FADE_OUT_BUFFER_MS, MIN_DEVICE_PIXEL_RATIO, GRAB_PURPLE_RGB, OVERLAY_CROSSHAIR_COLOR, OVERLAY_BORDER_COLOR_DRAG, OVERLAY_FILL_COLOR_DRAG, OVERLAY_BORDER_COLOR_DEFAULT, OVERLAY_FILL_COLOR_DEFAULT, FROZEN_GLOW_COLOR, FROZEN_GLOW_EDGE_PX, ARROW_HEIGHT_PX, ARROW_MIN_SIZE_PX, ARROW_MAX_LABEL_WIDTH_RATIO, ARROW_CENTER_PERCENT, ARROW_LABEL_MARGIN_PX, LABEL_GAP_PX, PREVIEW_TEXT_MAX_LENGTH, PREVIEW_ATTR_VALUE_MAX_LENGTH, PREVIEW_MAX_ATTRS, PREVIEW_PRIORITY_ATTRS, SCREENSHOT_CAPTURE_DELAY_MS, VIDEO_METADATA_TIMEOUT_MS, VIDEO_READY_POLL_INTERVAL_MS, VIDEO_READY_TIMEOUT_MS, MODIFIER_KEYS, ARROW_KEYS, FROZEN_ELEMENT_ATTRIBUTE, USER_IGNORE_ATTRIBUTE, VIEWPORT_COVERAGE_THRESHOLD, OVERLAY_Z_INDEX_THRESHOLD, DEV_TOOLS_OVERLAY_Z_INDEX_THRESHOLD, TOOLTIP_DELAY_MS, TOOLTIP_GRACE_PERIOD_MS, TOOLBAR_SNAP_MARGIN_PX, TOOLBAR_FADE_IN_DELAY_MS, TOOLBAR_SNAP_ANIMATION_DURATION_MS, TOOLBAR_DRAG_THRESHOLD_PX, TOOLBAR_VELOCITY_MULTIPLIER_MS, TOOLBAR_COLLAPSED_SHORT_PX, TOOLBAR_COLLAPSED_LONG_PX, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS, TOGGLE_ANIMATION_BUFFER_MS, TOOLBAR_DEFAULT_WIDTH_PX, TOOLBAR_DEFAULT_HEIGHT_PX, TOOLBAR_SHAKE_TOOLTIP_DURATION_MS, DRAG_SELECTION_COVERAGE_THRESHOLD, DRAG_SELECTION_SAMPLE_SPACING_PX, DRAG_SELECTION_MIN_SAMPLES_PER_AXIS, DRAG_SELECTION_MAX_SAMPLES_PER_AXIS, DRAG_SELECTION_MAX_TOTAL_SAMPLE_POINTS, DRAG_SELECTION_EDGE_INSET_PX, MAX_ARROW_NAVIGATION_HISTORY, MAX_MEMORY_SESSIONS, MAX_TRANSFORM_ANCESTOR_DEPTH, TRANSFORM_EARLY_BAIL_DEPTH, ELEMENT_POSITION_CACHE_DISTANCE_THRESHOLD_PX, ELEMENT_POSITION_THROTTLE_MS, VISIBILITY_CACHE_TTL_MS, ZOOM_DETECTION_THRESHOLD, MOUNT_ROOT_RECHECK_DELAY_MS, MAX_HISTORY_ITEMS, DROPDOWN_ANIMATION_DURATION_MS, DROPDOWN_HOVER_OPEN_DELAY_MS, DROPDOWN_VIEWPORT_PADDING_PX, DROPDOWN_ANCHOR_GAP_PX, DROPDOWN_ICON_SIZE_PX, DROPDOWN_MIN_WIDTH_PX, DROPDOWN_MAX_WIDTH_PX, PANEL_STYLES, LOGO_SVG, IME_COMPOSING_KEY_CODE, SELECTION_LABEL_OFFSCREEN_PX;
2152
2152
  var init_constants = __esm({
2153
2153
  "src/constants.ts"() {
2154
2154
  "use strict";
2155
- VERSION = "0.1.13";
2155
+ VERSION = "0.1.15";
2156
2156
  VIEWPORT_MARGIN_PX = 8;
2157
2157
  OFFSCREEN_POSITION = -1e3;
2158
2158
  SELECTION_LERP_FACTOR = 0.95;
@@ -2162,22 +2162,14 @@ var init_constants = __esm({
2162
2162
  DISMISS_ANIMATION_BUFFER_MS = 50;
2163
2163
  KEYDOWN_SPAM_TIMEOUT_MS = 200;
2164
2164
  BLUR_DEACTIVATION_THRESHOLD_MS = 500;
2165
- INPUT_FOCUS_ACTIVATION_DELAY_MS = 150;
2166
- INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS = 300;
2167
- DEFAULT_KEY_HOLD_DURATION_MS = 75;
2165
+ WINDOW_REFOCUS_GRACE_PERIOD_MS = 200;
2166
+ INPUT_FOCUS_ACTIVATION_DELAY_MS = 400;
2167
+ INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS = 600;
2168
+ DEFERRED_EXECUTION_DELAY_MS = 0;
2169
+ DEFAULT_KEY_HOLD_DURATION_MS = 100;
2168
2170
  MIN_HOLD_FOR_ACTIVATION_AFTER_COPY_MS = 200;
2169
2171
  RECENT_THRESHOLD_MS = 1e4;
2170
2172
  ACTION_CYCLE_IDLE_TRIGGER_MS = 600;
2171
- ACTION_CYCLE_INPUT_THROTTLE_MS = 100;
2172
- ACTION_CYCLE_SCROLL_THRESHOLD_PX = 30;
2173
- ACTION_CYCLE_SCROLL_LINE_HEIGHT_PX = 16;
2174
- ACTION_CYCLE_ACTION_IDS = [
2175
- "copy",
2176
- "comment",
2177
- "screenshot",
2178
- "copy-html",
2179
- "open"
2180
- ];
2181
2173
  DRAG_THRESHOLD_PX = 2;
2182
2174
  ELEMENT_DETECTION_THROTTLE_MS = 32;
2183
2175
  COMPONENT_NAME_DEBOUNCE_MS = 100;
@@ -2186,6 +2178,7 @@ var init_constants = __esm({
2186
2178
  BOUNDS_RECALC_INTERVAL_MS = 100;
2187
2179
  AUTO_SCROLL_EDGE_THRESHOLD_PX = 25;
2188
2180
  AUTO_SCROLL_SPEED_PX = 10;
2181
+ Z_INDEX_HOST = 2147483647;
2189
2182
  Z_INDEX_LABEL = 2147483647;
2190
2183
  Z_INDEX_OVERLAY_CANVAS = 2147483645;
2191
2184
  DRAG_LERP_FACTOR = 0.7;
@@ -2201,8 +2194,12 @@ var init_constants = __esm({
2201
2194
  FROZEN_GLOW_COLOR = `rgba(${GRAB_PURPLE_RGB}, 0.15)`;
2202
2195
  FROZEN_GLOW_EDGE_PX = 50;
2203
2196
  ARROW_HEIGHT_PX = 8;
2197
+ ARROW_MIN_SIZE_PX = 4;
2198
+ ARROW_MAX_LABEL_WIDTH_RATIO = 0.2;
2204
2199
  ARROW_CENTER_PERCENT = 50;
2200
+ ARROW_LABEL_MARGIN_PX = 16;
2205
2201
  LABEL_GAP_PX = 4;
2202
+ PREVIEW_TEXT_MAX_LENGTH = 100;
2206
2203
  PREVIEW_ATTR_VALUE_MAX_LENGTH = 15;
2207
2204
  PREVIEW_MAX_ATTRS = 3;
2208
2205
  PREVIEW_PRIORITY_ATTRS = [
@@ -2245,6 +2242,7 @@ var init_constants = __esm({
2245
2242
  TOOLBAR_COLLAPSED_SHORT_PX = 14;
2246
2243
  TOOLBAR_COLLAPSED_LONG_PX = 28;
2247
2244
  TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS = 150;
2245
+ TOGGLE_ANIMATION_BUFFER_MS = 50;
2248
2246
  TOOLBAR_DEFAULT_WIDTH_PX = 78;
2249
2247
  TOOLBAR_DEFAULT_HEIGHT_PX = 28;
2250
2248
  TOOLBAR_SHAKE_TOOLTIP_DURATION_MS = 1500;
@@ -2254,6 +2252,8 @@ var init_constants = __esm({
2254
2252
  DRAG_SELECTION_MAX_SAMPLES_PER_AXIS = 20;
2255
2253
  DRAG_SELECTION_MAX_TOTAL_SAMPLE_POINTS = 100;
2256
2254
  DRAG_SELECTION_EDGE_INSET_PX = 1;
2255
+ MAX_ARROW_NAVIGATION_HISTORY = 50;
2256
+ MAX_MEMORY_SESSIONS = 50;
2257
2257
  MAX_TRANSFORM_ANCESTOR_DEPTH = 6;
2258
2258
  TRANSFORM_EARLY_BAIL_DEPTH = 3;
2259
2259
  ELEMENT_POSITION_CACHE_DISTANCE_THRESHOLD_PX = 2;
@@ -2261,8 +2261,18 @@ var init_constants = __esm({
2261
2261
  VISIBILITY_CACHE_TTL_MS = 50;
2262
2262
  ZOOM_DETECTION_THRESHOLD = 0.01;
2263
2263
  MOUNT_ROOT_RECHECK_DELAY_MS = 1e3;
2264
+ MAX_HISTORY_ITEMS = 20;
2265
+ DROPDOWN_ANIMATION_DURATION_MS = 100;
2266
+ DROPDOWN_HOVER_OPEN_DELAY_MS = 200;
2267
+ DROPDOWN_VIEWPORT_PADDING_PX = 8;
2268
+ DROPDOWN_ANCHOR_GAP_PX = 8;
2269
+ DROPDOWN_ICON_SIZE_PX = 11;
2270
+ DROPDOWN_MIN_WIDTH_PX = 180;
2271
+ DROPDOWN_MAX_WIDTH_PX = 280;
2264
2272
  PANEL_STYLES = "bg-white";
2265
2273
  LOGO_SVG = `<svg width="294" height="294" viewBox="0 0 294 294" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_0_3)"><mask id="mask0_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="294" height="294"><path d="M294 0H0V294H294V0Z" fill="white"/></mask><g mask="url(#mask0_0_3)"><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z" fill="white"/><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z" fill="#FF40E0"/></g><mask id="mask1_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="102" y="84" width="161" height="162"><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z" fill="white"/></mask><g mask="url(#mask1_0_3)"><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z" fill="#FF40E0" stroke="#FF40E0" stroke-width="0.817337" stroke-linecap="round" stroke-linejoin="round"/></g></g><defs><clipPath id="clip0_0_3"><rect width="294" height="294" fill="white"/></clipPath></defs></svg>`;
2274
+ IME_COMPOSING_KEY_CODE = 229;
2275
+ SELECTION_LABEL_OFFSCREEN_PX = -9999;
2266
2276
  }
2267
2277
  });
2268
2278
 
@@ -2472,8 +2482,6 @@ var init_store2 = __esm({
2472
2482
  theme: input.theme,
2473
2483
  activationTimestamp: null,
2474
2484
  previouslyFocusedElement: null,
2475
- canUndo: false,
2476
- canRedo: false,
2477
2485
  isAgentConnected: false,
2478
2486
  supportsUndo: false,
2479
2487
  supportsFollowUp: false,
@@ -2527,6 +2535,7 @@ var init_store2 = __esm({
2527
2535
  setStore("contextMenuElement", null);
2528
2536
  setStore("contextMenuClickOffset", null);
2529
2537
  setStore("selectedAgent", null);
2538
+ setStore("lastCopiedElement", null);
2530
2539
  },
2531
2540
  toggle: () => {
2532
2541
  if (store.activationTimestamp !== null) {
@@ -2750,9 +2759,6 @@ var init_store2 = __esm({
2750
2759
  setLastGrabbed: (element) => {
2751
2760
  setStore("lastGrabbedElement", element);
2752
2761
  },
2753
- setLastCopied: (element) => {
2754
- setStore("lastCopiedElement", element);
2755
- },
2756
2762
  clearLastCopied: () => {
2757
2763
  setStore("lastCopiedElement", null);
2758
2764
  },
@@ -2769,19 +2775,9 @@ var init_store2 = __esm({
2769
2775
  setStore("selectionFilePath", filePath);
2770
2776
  setStore("selectionLineNumber", lineNumber);
2771
2777
  },
2772
- clearSelectionSource: () => {
2773
- setStore("selectionFilePath", null);
2774
- setStore("selectionLineNumber", null);
2775
- },
2776
2778
  setPendingClickData: (data) => {
2777
2779
  setStore("pendingClickData", data);
2778
2780
  },
2779
- clearPendingClickData: () => {
2780
- setStore("pendingClickData", null);
2781
- },
2782
- setReplySessionId: (sessionId) => {
2783
- setStore("replySessionId", sessionId);
2784
- },
2785
2781
  clearReplySessionId: () => {
2786
2782
  setStore("replySessionId", null);
2787
2783
  },
@@ -2826,22 +2822,12 @@ var init_store2 = __esm({
2826
2822
  (instances) => instances.filter((instance) => instance.id !== instanceId)
2827
2823
  );
2828
2824
  },
2829
- removeLabelsForElement: (element) => {
2830
- setStore(
2831
- "labelInstances",
2832
- (instances) => instances.filter((instance) => instance.element !== element)
2833
- );
2834
- },
2835
2825
  clearLabelInstances: () => {
2836
2826
  setStore("labelInstances", []);
2837
2827
  },
2838
2828
  setHasAgentProvider: (value) => {
2839
2829
  setStore("hasAgentProvider", value);
2840
2830
  },
2841
- setUndoRedoState: (canUndo, canRedo) => {
2842
- setStore("canUndo", canUndo);
2843
- setStore("canRedo", canRedo);
2844
- },
2845
2831
  setAgentCapabilities: (capabilities) => {
2846
2832
  setStore("supportsUndo", capabilities.supportsUndo);
2847
2833
  setStore("supportsFollowUp", capabilities.supportsFollowUp);
@@ -2958,9 +2944,6 @@ var init_store2 = __esm({
2958
2944
  },
2959
2945
  setSelectedAgent: (agent) => {
2960
2946
  setStore("selectedAgent", agent);
2961
- },
2962
- clearSelectedAgent: () => {
2963
- setStore("selectedAgent", null);
2964
2947
  }
2965
2948
  };
2966
2949
  return { store, setStore, actions, isActive, isHolding };
@@ -3067,7 +3050,7 @@ var init_mount_root = __esm({
3067
3050
  }
3068
3051
  const host = document.createElement("div");
3069
3052
  host.setAttribute(ATTRIBUTE_NAME, "true");
3070
- host.style.zIndex = "2147483646";
3053
+ host.style.zIndex = String(Z_INDEX_HOST);
3071
3054
  host.style.position = "fixed";
3072
3055
  host.style.inset = "0";
3073
3056
  host.style.pointerEvents = "none";
@@ -3083,9 +3066,7 @@ var init_mount_root = __esm({
3083
3066
  const doc = document.body ?? document.documentElement;
3084
3067
  doc.appendChild(host);
3085
3068
  setTimeout(() => {
3086
- if (!doc.contains(host)) {
3087
- doc.appendChild(host);
3088
- }
3069
+ doc.appendChild(host);
3089
3070
  }, MOUNT_ROOT_RECHECK_DELAY_MS);
3090
3071
  return root;
3091
3072
  };
@@ -3603,6 +3584,20 @@ var init_overlay_canvas = __esm({
3603
3584
  }
3604
3585
  });
3605
3586
 
3587
+ // src/utils/get-arrow-size.ts
3588
+ var getArrowSize;
3589
+ var init_get_arrow_size = __esm({
3590
+ "src/utils/get-arrow-size.ts"() {
3591
+ "use strict";
3592
+ init_constants();
3593
+ getArrowSize = (labelWidth) => {
3594
+ if (labelWidth <= 0) return ARROW_HEIGHT_PX;
3595
+ const scaledSize = labelWidth * ARROW_MAX_LABEL_WIDTH_RATIO;
3596
+ return Math.max(ARROW_MIN_SIZE_PX, Math.min(ARROW_HEIGHT_PX, scaledSize));
3597
+ };
3598
+ }
3599
+ });
3600
+
3606
3601
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
3607
3602
  function r2(e2) {
3608
3603
  var t2, f3, n2 = "";
@@ -6252,21 +6247,24 @@ var init_arrow = __esm({
6252
6247
  init_web();
6253
6248
  init_web();
6254
6249
  init_web();
6255
- _tmpl$5 = /* @__PURE__ */ template(`<div class="absolute w-0 h-0 z-10"style="border-left:8px solid transparent;border-right:8px solid transparent">`);
6250
+ init_get_arrow_size();
6251
+ _tmpl$5 = /* @__PURE__ */ template(`<div data-react-grab-arrow class="absolute w-0 h-0 z-10">`);
6256
6252
  Arrow = (props) => {
6257
6253
  const arrowColor = () => props.color ?? "white";
6258
6254
  const isBottom = () => props.position === "bottom";
6255
+ const arrowSize = () => getArrowSize(props.labelWidth ?? 0);
6259
6256
  return (() => {
6260
6257
  var _el$ = _tmpl$5();
6261
6258
  createRenderEffect((_p$) => {
6262
- var _v$ = `calc(${props.leftPercent}% + ${props.leftOffsetPx}px)`, _v$2 = isBottom() ? "0" : void 0, _v$3 = isBottom() ? void 0 : "0", _v$4 = isBottom() ? "translateX(-50%) translateY(-100%)" : "translateX(-50%) translateY(100%)", _v$5 = isBottom() ? `8px solid ${arrowColor()}` : void 0, _v$6 = isBottom() ? void 0 : `8px solid ${arrowColor()}`, _v$7 = isBottom() ? "drop-shadow(-1px -1px 0 rgba(0,0,0,0.06)) drop-shadow(1px -1px 0 rgba(0,0,0,0.06))" : "drop-shadow(-1px 1px 0 rgba(0,0,0,0.06)) drop-shadow(1px 1px 0 rgba(0,0,0,0.06))";
6259
+ var _v$ = `calc(${props.leftPercent}% + ${props.leftOffsetPx}px)`, _v$2 = isBottom() ? "0" : void 0, _v$3 = isBottom() ? void 0 : "0", _v$4 = isBottom() ? "translateX(-50%) translateY(-100%)" : "translateX(-50%) translateY(100%)", _v$5 = `${arrowSize()}px solid transparent`, _v$6 = `${arrowSize()}px solid transparent`, _v$7 = isBottom() ? `${arrowSize()}px solid ${arrowColor()}` : void 0, _v$8 = isBottom() ? void 0 : `${arrowSize()}px solid ${arrowColor()}`;
6263
6260
  _v$ !== _p$.e && setStyleProperty(_el$, "left", _p$.e = _v$);
6264
6261
  _v$2 !== _p$.t && setStyleProperty(_el$, "top", _p$.t = _v$2);
6265
6262
  _v$3 !== _p$.a && setStyleProperty(_el$, "bottom", _p$.a = _v$3);
6266
6263
  _v$4 !== _p$.o && setStyleProperty(_el$, "transform", _p$.o = _v$4);
6267
- _v$5 !== _p$.i && setStyleProperty(_el$, "border-bottom", _p$.i = _v$5);
6268
- _v$6 !== _p$.n && setStyleProperty(_el$, "border-top", _p$.n = _v$6);
6269
- _v$7 !== _p$.s && setStyleProperty(_el$, "filter", _p$.s = _v$7);
6264
+ _v$5 !== _p$.i && setStyleProperty(_el$, "border-left", _p$.i = _v$5);
6265
+ _v$6 !== _p$.n && setStyleProperty(_el$, "border-right", _p$.n = _v$6);
6266
+ _v$7 !== _p$.s && setStyleProperty(_el$, "border-bottom", _p$.s = _v$7);
6267
+ _v$8 !== _p$.h && setStyleProperty(_el$, "border-top", _p$.h = _v$8);
6270
6268
  return _p$;
6271
6269
  }, {
6272
6270
  e: void 0,
@@ -6275,7 +6273,8 @@ var init_arrow = __esm({
6275
6273
  o: void 0,
6276
6274
  i: void 0,
6277
6275
  n: void 0,
6278
- s: void 0
6276
+ s: void 0,
6277
+ h: void 0
6279
6278
  });
6280
6279
  return _el$;
6281
6280
  })();
@@ -7003,7 +7002,7 @@ var init_completion_view = __esm({
7003
7002
  });
7004
7003
 
7005
7004
  // src/components/selection-label/index.tsx
7006
- var _tmpl$16, _tmpl$26, _tmpl$34, _tmpl$43, _tmpl$53, _tmpl$63, _tmpl$73, _tmpl$83, _tmpl$92, _tmpl$0, _tmpl$1, DEFAULT_OFFSCREEN_POSITION, SelectionLabel;
7005
+ var _tmpl$16, _tmpl$26, _tmpl$34, _tmpl$43, _tmpl$53, _tmpl$63, _tmpl$73, _tmpl$83, _tmpl$92, _tmpl$0, _tmpl$1, _tmpl$102, DEFAULT_OFFSCREEN_POSITION, SelectionLabel;
7007
7006
  var init_selection_label = __esm({
7008
7007
  "src/components/selection-label/index.tsx"() {
7009
7008
  "use strict";
@@ -7019,6 +7018,7 @@ var init_selection_label = __esm({
7019
7018
  init_web();
7020
7019
  init_solid();
7021
7020
  init_constants();
7021
+ init_get_arrow_size();
7022
7022
  init_is_keyboard_event_triggered_by_input();
7023
7023
  init_cn();
7024
7024
  init_get_tag_display();
@@ -7038,26 +7038,29 @@ var init_selection_label = __esm({
7038
7038
  _tmpl$43 = /* @__PURE__ */ template(`<div class="flex flex-col w-[calc(100%+16px)] -mx-2 -my-1.5">`);
7039
7039
  _tmpl$53 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col items-start w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 py-1.5 w-fit h-fit px-2">`);
7040
7040
  _tmpl$63 = /* @__PURE__ */ template(`<div class="flex items-center gap-1 w-full mb-1 overflow-hidden"><span class="text-black/40 text-[11px] leading-3 font-medium truncate italic">`);
7041
- _tmpl$73 = /* @__PURE__ */ template(`<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events data-react-grab-input class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="Add context"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button data-react-grab-submit class="contain-layout shrink-0 flex items-center justify-center size-4 rounded-full bg-black cursor-pointer ml-1 interactive-scale">`);
7042
- _tmpl$83 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit min-w-[150px] max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2 max-w-full">`);
7043
- _tmpl$92 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-selection-label style=z-index:2147483647><div>`);
7044
- _tmpl$0 = /* @__PURE__ */ template(`<span class="text-[11px] font-sans text-black/50 ml-4">`);
7045
- _tmpl$1 = /* @__PURE__ */ template(`<div class="contain-layout flex items-center justify-between w-full px-2 py-1 transition-colors"><span class="text-[13px] leading-4 font-sans font-medium text-black">`);
7041
+ _tmpl$73 = /* @__PURE__ */ template(`<button data-react-grab-submit class="contain-layout shrink-0 flex items-center justify-center size-4 rounded-full bg-black cursor-pointer ml-1 interactive-scale">`);
7042
+ _tmpl$83 = /* @__PURE__ */ template(`<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events data-react-grab-input class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="Add context"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none>`);
7043
+ _tmpl$92 = /* @__PURE__ */ template(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit min-w-[150px] max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2 max-w-full">`);
7044
+ _tmpl$0 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-selection-label style=z-index:2147483647><div>`);
7045
+ _tmpl$1 = /* @__PURE__ */ template(`<span class="text-[11px] font-sans text-black/50 ml-4">`);
7046
+ _tmpl$102 = /* @__PURE__ */ template(`<div class="contain-layout flex items-center justify-between w-full px-2 py-1 transition-colors"><span class="text-[13px] leading-4 font-sans font-medium text-black">`);
7046
7047
  DEFAULT_OFFSCREEN_POSITION = {
7047
- left: -9999,
7048
- top: -9999,
7048
+ left: SELECTION_LABEL_OFFSCREEN_PX,
7049
+ top: SELECTION_LABEL_OFFSCREEN_PX,
7049
7050
  arrowLeftPercent: ARROW_CENTER_PERCENT,
7050
7051
  arrowLeftOffset: 0,
7051
7052
  edgeOffsetX: 0
7052
7053
  };
7053
7054
  SelectionLabel = (props) => {
7054
7055
  let containerRef;
7056
+ let panelRef;
7055
7057
  let inputRef;
7056
7058
  let isTagCurrentlyHovered = false;
7057
7059
  let lastValidPosition = null;
7058
7060
  let lastElementIdentity = null;
7059
7061
  const [measuredWidth, setMeasuredWidth] = createSignal(0);
7060
7062
  const [measuredHeight, setMeasuredHeight] = createSignal(0);
7063
+ const [panelWidth, setPanelWidth] = createSignal(0);
7061
7064
  const [arrowPosition, setArrowPosition] = createSignal("bottom");
7062
7065
  const [viewportVersion, setViewportVersion] = createSignal(0);
7063
7066
  const [hadValidBounds, setHadValidBounds] = createSignal(false);
@@ -7081,6 +7084,9 @@ var init_selection_label = __esm({
7081
7084
  setMeasuredWidth(rect.width);
7082
7085
  setMeasuredHeight(rect.height);
7083
7086
  }
7087
+ if (panelRef) {
7088
+ setPanelWidth(panelRef.getBoundingClientRect().width);
7089
+ }
7084
7090
  };
7085
7091
  const handleTagHoverChange = (hovered) => {
7086
7092
  isTagCurrentlyHovered = hovered;
@@ -7126,32 +7132,22 @@ var init_selection_label = __esm({
7126
7132
  lastValidPosition = null;
7127
7133
  }
7128
7134
  });
7135
+ const sizeAffectingSignature = createMemo(() => [props.tagName, props.componentName, props.elementsCount, props.statusText, props.inputValue, props.hasAgent, props.isPromptMode, props.isPendingDismiss, props.error, props.isPendingAbort, props.visible, props.status, props.actionCycleState?.items, props.actionCycleState?.activeIndex, props.actionCycleState?.isVisible]);
7129
7136
  createEffect(() => {
7130
- void props.tagName;
7131
- void props.componentName;
7132
- void props.elementsCount;
7133
- void props.statusText;
7134
- void props.inputValue;
7135
- void props.hasAgent;
7136
- void props.isPromptMode;
7137
- void props.isPendingDismiss;
7138
- void props.error;
7139
- void props.isPendingAbort;
7140
- void props.visible;
7141
- void props.status;
7142
- void props.actionCycleState?.items;
7143
- void props.actionCycleState?.activeIndex;
7144
- void props.actionCycleState?.isVisible;
7137
+ void sizeAffectingSignature();
7145
7138
  queueMicrotask(measureContainer);
7146
7139
  });
7147
7140
  createEffect(() => {
7148
- if (props.isPromptMode && inputRef) {
7149
- setTimeout(() => {
7141
+ if (props.isPromptMode && inputRef && props.onSubmit) {
7142
+ const focusTimeout = setTimeout(() => {
7150
7143
  inputRef?.focus();
7151
- }, 0);
7144
+ }, DEFERRED_EXECUTION_DELAY_MS);
7145
+ onCleanup(() => {
7146
+ clearTimeout(focusTimeout);
7147
+ });
7152
7148
  }
7153
7149
  });
7154
- const computedPosition = () => {
7150
+ const positionComputation = createMemo(() => {
7155
7151
  viewportVersion();
7156
7152
  const bounds = props.selectionBounds;
7157
7153
  const labelWidth = measuredWidth();
@@ -7159,21 +7155,28 @@ var init_selection_label = __esm({
7159
7155
  const hasMeasurements = labelWidth > 0 && labelHeight > 0;
7160
7156
  const hasValidBounds = bounds && bounds.width > 0 && bounds.height > 0;
7161
7157
  if (!hasMeasurements || !hasValidBounds) {
7162
- return lastValidPosition ?? DEFAULT_OFFSCREEN_POSITION;
7158
+ return {
7159
+ position: lastValidPosition ?? DEFAULT_OFFSCREEN_POSITION,
7160
+ computedArrowPosition: null
7161
+ };
7163
7162
  }
7164
7163
  const viewportWidth = window.innerWidth;
7165
7164
  const viewportHeight = window.innerHeight;
7166
7165
  const isSelectionVisibleInViewport = bounds.x + bounds.width > 0 && bounds.x < viewportWidth && bounds.y + bounds.height > 0 && bounds.y < viewportHeight;
7167
7166
  if (!isSelectionVisibleInViewport) {
7168
- return DEFAULT_OFFSCREEN_POSITION;
7167
+ return {
7168
+ position: DEFAULT_OFFSCREEN_POSITION,
7169
+ computedArrowPosition: null
7170
+ };
7169
7171
  }
7170
7172
  const selectionCenterX = bounds.x + bounds.width / 2;
7171
7173
  const cursorX = props.mouseX ?? selectionCenterX;
7172
7174
  const selectionBottom = bounds.y + bounds.height;
7173
7175
  const selectionTop = bounds.y;
7176
+ const actualArrowHeight = props.hideArrow ? 0 : getArrowSize(panelWidth());
7174
7177
  const anchorX = cursorX;
7175
7178
  let edgeOffsetX = 0;
7176
- let positionTop = selectionBottom + ARROW_HEIGHT_PX + LABEL_GAP_PX;
7179
+ let positionTop = selectionBottom + actualArrowHeight + LABEL_GAP_PX;
7177
7180
  if (labelWidth > 0) {
7178
7181
  const labelLeft = anchorX - labelWidth / 2;
7179
7182
  const labelRight = anchorX + labelWidth / 2;
@@ -7184,32 +7187,44 @@ var init_selection_label = __esm({
7184
7187
  edgeOffsetX = VIEWPORT_MARGIN_PX - labelLeft;
7185
7188
  }
7186
7189
  }
7187
- const totalHeightNeeded = labelHeight + ARROW_HEIGHT_PX + LABEL_GAP_PX;
7190
+ const totalHeightNeeded = labelHeight + actualArrowHeight + LABEL_GAP_PX;
7188
7191
  const fitsBelow = positionTop + labelHeight <= viewportHeight - VIEWPORT_MARGIN_PX;
7189
7192
  if (!fitsBelow) {
7190
7193
  positionTop = selectionTop - totalHeightNeeded;
7191
- setArrowPosition("top");
7192
- } else {
7193
- setArrowPosition("bottom");
7194
7194
  }
7195
7195
  if (positionTop < VIEWPORT_MARGIN_PX) {
7196
7196
  positionTop = VIEWPORT_MARGIN_PX;
7197
7197
  }
7198
7198
  const arrowLeftPercent = ARROW_CENTER_PERCENT;
7199
- const arrowLeftOffset = -edgeOffsetX;
7200
- const position = {
7201
- left: anchorX,
7202
- top: positionTop,
7203
- arrowLeftPercent,
7204
- arrowLeftOffset,
7205
- edgeOffsetX
7199
+ const labelHalfWidth = labelWidth / 2;
7200
+ const arrowCenterPx = labelHalfWidth - edgeOffsetX;
7201
+ const arrowMinPx = Math.min(ARROW_LABEL_MARGIN_PX, labelHalfWidth);
7202
+ const arrowMaxPx = Math.max(labelWidth - ARROW_LABEL_MARGIN_PX, labelHalfWidth);
7203
+ const clampedArrowCenterPx = Math.max(arrowMinPx, Math.min(arrowMaxPx, arrowCenterPx));
7204
+ const arrowLeftOffset = clampedArrowCenterPx - labelHalfWidth;
7205
+ const computedArrowPosition = fitsBelow ? "bottom" : "top";
7206
+ return {
7207
+ position: {
7208
+ left: anchorX,
7209
+ top: positionTop,
7210
+ arrowLeftPercent,
7211
+ arrowLeftOffset,
7212
+ edgeOffsetX
7213
+ },
7214
+ computedArrowPosition
7206
7215
  };
7207
- lastValidPosition = position;
7208
- setHadValidBounds(true);
7209
- return position;
7210
- };
7216
+ });
7217
+ const computedPosition = () => positionComputation().position;
7218
+ createEffect(() => {
7219
+ const result = positionComputation();
7220
+ if (result.computedArrowPosition !== null) {
7221
+ lastValidPosition = result.position;
7222
+ setHadValidBounds(true);
7223
+ setArrowPosition(result.computedArrowPosition);
7224
+ }
7225
+ });
7211
7226
  const handleKeyDown = (event) => {
7212
- if (event.isComposing || event.keyCode === 229) {
7227
+ if (event.isComposing || event.keyCode === IME_COMPOSING_KEY_CODE) {
7213
7228
  return;
7214
7229
  }
7215
7230
  event.stopPropagation();
@@ -7225,8 +7240,11 @@ var init_selection_label = __esm({
7225
7240
  }
7226
7241
  };
7227
7242
  const handleInput = (event) => {
7228
- const target = event.target;
7229
- props.onInputChange?.(target.value);
7243
+ const inputTarget = event.target;
7244
+ if (!(inputTarget instanceof HTMLTextAreaElement)) {
7245
+ return;
7246
+ }
7247
+ props.onInputChange?.(inputTarget.value);
7230
7248
  };
7231
7249
  const tagDisplayResult = () => getTagDisplay({
7232
7250
  tagName: props.tagName,
@@ -7249,7 +7267,7 @@ var init_selection_label = __esm({
7249
7267
  const handleContainerPointerDown = (event) => {
7250
7268
  event.stopPropagation();
7251
7269
  event.stopImmediatePropagation();
7252
- const isEditableInputVisible = canInteract() && props.isPromptMode && !props.isPendingDismiss;
7270
+ const isEditableInputVisible = canInteract() && props.isPromptMode && !props.isPendingDismiss && props.onSubmit;
7253
7271
  if (isEditableInputVisible && inputRef) {
7254
7272
  inputRef.focus();
7255
7273
  }
@@ -7260,7 +7278,7 @@ var init_selection_label = __esm({
7260
7278
  return memo(() => props.visible !== false)() && (props.selectionBounds || shouldPersistDuringFade());
7261
7279
  },
7262
7280
  get children() {
7263
- var _el$ = _tmpl$92(), _el$2 = _el$.firstChild;
7281
+ var _el$ = _tmpl$0(), _el$2 = _el$.firstChild;
7264
7282
  _el$.addEventListener("mouseleave", () => props.onHoverChange?.(false));
7265
7283
  _el$.addEventListener("mouseenter", () => props.onHoverChange?.(true));
7266
7284
  _el$.$$click = (event) => {
@@ -7270,15 +7288,25 @@ var init_selection_label = __esm({
7270
7288
  _el$.$$pointerdown = handleContainerPointerDown;
7271
7289
  var _ref$ = containerRef;
7272
7290
  typeof _ref$ === "function" ? use(_ref$, _el$) : containerRef = _el$;
7273
- insert(_el$, createComponent(Arrow, {
7274
- get position() {
7275
- return arrowPosition();
7276
- },
7277
- get leftPercent() {
7278
- return computedPosition().arrowLeftPercent;
7291
+ insert(_el$, createComponent(Show, {
7292
+ get when() {
7293
+ return !props.hideArrow;
7279
7294
  },
7280
- get leftOffsetPx() {
7281
- return computedPosition().arrowLeftOffset;
7295
+ get children() {
7296
+ return createComponent(Arrow, {
7297
+ get position() {
7298
+ return arrowPosition();
7299
+ },
7300
+ get leftPercent() {
7301
+ return computedPosition().arrowLeftPercent;
7302
+ },
7303
+ get leftOffsetPx() {
7304
+ return computedPosition().arrowLeftOffset;
7305
+ },
7306
+ get labelWidth() {
7307
+ return panelWidth();
7308
+ }
7309
+ });
7282
7310
  }
7283
7311
  }), _el$2);
7284
7312
  insert(_el$, createComponent(Show, {
@@ -7321,6 +7349,8 @@ var init_selection_label = __esm({
7321
7349
  });
7322
7350
  }
7323
7351
  }), _el$2);
7352
+ var _ref$2 = panelRef;
7353
+ typeof _ref$2 === "function" ? use(_ref$2, _el$2) : panelRef = _el$2;
7324
7354
  insert(_el$2, createComponent(Show, {
7325
7355
  get when() {
7326
7356
  return memo(() => props.status === "copying")() && !props.isPendingAbort;
@@ -7340,8 +7370,8 @@ var init_selection_label = __esm({
7340
7370
  return createComponent(BottomSection, {
7341
7371
  get children() {
7342
7372
  var _el$6 = _tmpl$26(), _el$7 = _el$6.firstChild;
7343
- var _ref$2 = inputRef;
7344
- typeof _ref$2 === "function" ? use(_ref$2, _el$7) : inputRef = _el$7;
7373
+ var _ref$3 = inputRef;
7374
+ typeof _ref$3 === "function" ? use(_ref$3, _el$7) : inputRef = _el$7;
7345
7375
  insert(_el$6, createComponent(Show, {
7346
7376
  get when() {
7347
7377
  return props.onAbort;
@@ -7417,23 +7447,23 @@ var init_selection_label = __esm({
7417
7447
  return actionCycleItems();
7418
7448
  },
7419
7449
  children: (item, itemIndex) => (() => {
7420
- var _el$17 = _tmpl$1(), _el$18 = _el$17.firstChild;
7450
+ var _el$17 = _tmpl$102(), _el$18 = _el$17.firstChild;
7421
7451
  insert(_el$18, () => item.label);
7422
7452
  insert(_el$17, createComponent(Show, {
7423
7453
  get when() {
7424
7454
  return item.shortcut;
7425
7455
  },
7426
7456
  get children() {
7427
- var _el$19 = _tmpl$0();
7457
+ var _el$19 = _tmpl$1();
7428
7458
  insert(_el$19, () => formatShortcut(item.shortcut));
7429
7459
  return _el$19;
7430
7460
  }
7431
7461
  }), null);
7432
7462
  createRenderEffect((_p$) => {
7433
- var _v$9 = item.label.toLowerCase(), _v$0 = !!(itemIndex() === actionCycleActiveIndex()), _v$1 = !!(itemIndex() === actionCycleItems().length - 1);
7434
- _v$9 !== _p$.e && setAttribute(_el$17, "data-react-grab-action-cycle-item", _p$.e = _v$9);
7435
- _v$0 !== _p$.t && _el$17.classList.toggle("bg-black/5", _p$.t = _v$0);
7436
- _v$1 !== _p$.a && _el$17.classList.toggle("rounded-b-[6px]", _p$.a = _v$1);
7463
+ var _v$1 = item.label.toLowerCase(), _v$10 = !!(itemIndex() === actionCycleActiveIndex()), _v$11 = !!(itemIndex() === actionCycleItems().length - 1);
7464
+ _v$1 !== _p$.e && setAttribute(_el$17, "data-react-grab-action-cycle-item", _p$.e = _v$1);
7465
+ _v$10 !== _p$.t && _el$17.classList.toggle("bg-black/5", _p$.t = _v$10);
7466
+ _v$11 !== _p$.a && _el$17.classList.toggle("rounded-b-[6px]", _p$.a = _v$11);
7437
7467
  return _p$;
7438
7468
  }, {
7439
7469
  e: void 0,
@@ -7456,7 +7486,7 @@ var init_selection_label = __esm({
7456
7486
  return memo(() => !!(canInteract() && props.isPromptMode))() && !props.isPendingDismiss;
7457
7487
  },
7458
7488
  get children() {
7459
- var _el$10 = _tmpl$83(), _el$11 = _el$10.firstChild;
7489
+ var _el$10 = _tmpl$92(), _el$11 = _el$10.firstChild;
7460
7490
  insert(_el$11, createComponent(TagBadge, {
7461
7491
  get tagName() {
7462
7492
  return tagDisplay();
@@ -7487,17 +7517,34 @@ var init_selection_label = __esm({
7487
7517
  return _el$12;
7488
7518
  }
7489
7519
  }), (() => {
7490
- var _el$14 = _tmpl$73(), _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling;
7520
+ var _el$14 = _tmpl$83(), _el$15 = _el$14.firstChild;
7491
7521
  _el$15.$$keydown = handleKeyDown;
7492
7522
  _el$15.$$input = handleInput;
7493
- var _ref$3 = inputRef;
7494
- typeof _ref$3 === "function" ? use(_ref$3, _el$15) : inputRef = _el$15;
7495
- _el$16.$$click = () => props.onSubmit?.();
7496
- insert(_el$16, createComponent(IconSubmit, {
7497
- size: 10,
7498
- "class": "text-white"
7499
- }));
7500
- createRenderEffect((_$p) => setStyleProperty(_el$14, "padding-left", props.replyToPrompt ? "14px" : "0"));
7523
+ var _ref$4 = inputRef;
7524
+ typeof _ref$4 === "function" ? use(_ref$4, _el$15) : inputRef = _el$15;
7525
+ insert(_el$14, createComponent(Show, {
7526
+ get when() {
7527
+ return props.onSubmit;
7528
+ },
7529
+ get children() {
7530
+ var _el$16 = _tmpl$73();
7531
+ _el$16.$$click = () => props.onSubmit?.();
7532
+ insert(_el$16, createComponent(IconSubmit, {
7533
+ size: 10,
7534
+ "class": "text-white"
7535
+ }));
7536
+ return _el$16;
7537
+ }
7538
+ }), null);
7539
+ createRenderEffect((_p$) => {
7540
+ var _v$ = props.replyToPrompt ? "14px" : "0", _v$2 = !props.onSubmit;
7541
+ _v$ !== _p$.e && setStyleProperty(_el$14, "padding-left", _p$.e = _v$);
7542
+ _v$2 !== _p$.t && (_el$15.readOnly = _p$.t = _v$2);
7543
+ return _p$;
7544
+ }, {
7545
+ e: void 0,
7546
+ t: void 0
7547
+ });
7501
7548
  createRenderEffect(() => _el$15.value = props.inputValue ?? "");
7502
7549
  return _el$14;
7503
7550
  })()];
@@ -7540,15 +7587,15 @@ var init_selection_label = __esm({
7540
7587
  }
7541
7588
  }), null);
7542
7589
  createRenderEffect((_p$) => {
7543
- var _v$ = cn("fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-opacity duration-100 ease-out"), _v$2 = `${computedPosition().top}px`, _v$3 = `${computedPosition().left}px`, _v$4 = `translateX(calc(-50% + ${computedPosition().edgeOffsetX}px))`, _v$5 = shouldEnablePointerEvents() ? "auto" : "none", _v$6 = props.status === "fading" || isInternalFading() ? 0 : 1, _v$7 = cn("contain-layout flex items-center gap-[5px] rounded-[10px] antialiased w-fit h-fit p-0 [font-synthesis:none] [corner-shape:superellipse(1.25)]", PANEL_STYLES), _v$8 = isCompletedStatus() && !props.error ? "none" : void 0;
7544
- _v$ !== _p$.e && className(_el$, _p$.e = _v$);
7545
- _v$2 !== _p$.t && setStyleProperty(_el$, "top", _p$.t = _v$2);
7546
- _v$3 !== _p$.a && setStyleProperty(_el$, "left", _p$.a = _v$3);
7547
- _v$4 !== _p$.o && setStyleProperty(_el$, "transform", _p$.o = _v$4);
7548
- _v$5 !== _p$.i && setStyleProperty(_el$, "pointer-events", _p$.i = _v$5);
7549
- _v$6 !== _p$.n && setStyleProperty(_el$, "opacity", _p$.n = _v$6);
7550
- _v$7 !== _p$.s && className(_el$2, _p$.s = _v$7);
7551
- _v$8 !== _p$.h && setStyleProperty(_el$2, "display", _p$.h = _v$8);
7590
+ var _v$3 = cn("fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-opacity duration-100 ease-out"), _v$4 = `${computedPosition().top}px`, _v$5 = `${computedPosition().left}px`, _v$6 = `translateX(calc(-50% + ${computedPosition().edgeOffsetX}px))`, _v$7 = shouldEnablePointerEvents() ? "auto" : "none", _v$8 = props.status === "fading" || isInternalFading() ? 0 : 1, _v$9 = cn("contain-layout flex items-center gap-[5px] rounded-[10px] antialiased w-fit h-fit p-0 [font-synthesis:none] [corner-shape:superellipse(1.25)]", PANEL_STYLES), _v$0 = isCompletedStatus() && !props.error ? "none" : void 0;
7591
+ _v$3 !== _p$.e && className(_el$, _p$.e = _v$3);
7592
+ _v$4 !== _p$.t && setStyleProperty(_el$, "top", _p$.t = _v$4);
7593
+ _v$5 !== _p$.a && setStyleProperty(_el$, "left", _p$.a = _v$5);
7594
+ _v$6 !== _p$.o && setStyleProperty(_el$, "transform", _p$.o = _v$6);
7595
+ _v$7 !== _p$.i && setStyleProperty(_el$, "pointer-events", _p$.i = _v$7);
7596
+ _v$8 !== _p$.n && setStyleProperty(_el$, "opacity", _p$.n = _v$8);
7597
+ _v$9 !== _p$.s && className(_el$2, _p$.s = _v$9);
7598
+ _v$0 !== _p$.h && setStyleProperty(_el$2, "display", _p$.h = _v$0);
7552
7599
  return _p$;
7553
7600
  }, {
7554
7601
  e: void 0,
@@ -7698,6 +7745,55 @@ var init_icon_comment = __esm({
7698
7745
  }
7699
7746
  });
7700
7747
 
7748
+ // src/components/icons/icon-inbox.tsx
7749
+ var _tmpl$20, _tmpl$27, IconInbox, IconInboxUnread;
7750
+ var init_icon_inbox = __esm({
7751
+ "src/components/icons/icon-inbox.tsx"() {
7752
+ "use strict";
7753
+ init_web();
7754
+ init_web();
7755
+ init_web();
7756
+ _tmpl$20 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path d="M12.8277 1.75C15.0033 1.74998 15.7381 1.74997 17.0981 1.93282C18.5025 2.12164 19.6563 2.52175 20.5687 3.43414C21.4811 4.34653 21.8812 5.50033 22.07 6.90471C22.234 8.12428 22.2509 10.047 22.2526 12L22.2494 12.75H20.2528C20.2528 10.4826 20.2507 8.38258 20.0878 7.17121C19.9288 5.9886 19.6333 5.3272 19.1545 4.84835C18.6756 4.3695 18.0142 4.07399 16.8316 3.91499C15.6202 3.75212 15.0203 3.75 12.7528 3.75C10.4854 3.75 8.3854 3.75212 7.17403 3.91499C5.99143 4.07399 5.33003 4.3695 4.85118 4.84835C4.37232 5.3272 4.07681 5.9886 3.91782 7.17121C3.75495 8.38258 3.75283 10.4826 3.75283 12.75L1.75195 12.7518L1.75302 11.9999C1.75475 10.0469 1.77169 8.12426 1.93565 6.90471C2.12447 5.50033 2.52457 4.34653 3.43696 3.43414C4.34935 2.52175 5.50316 2.12164 6.90754 1.93282C8.26767 1.74996 10.0024 1.74998 12.1783 1.75H12.1784H12.8277H12.8277Z"></path><path d="M22.2453 13.5037C22.2368 15.2454 22.1975 16.6539 21.9924 17.7892C21.7834 18.9461 21.3919 19.8839 20.6368 20.6391C19.7786 21.4973 18.6863 21.8843 17.3097 22.0694C15.9662 22.25 14.2455 22.25 12.0548 22.25H11.9405C9.74978 22.25 8.02911 22.25 6.6857 22.0694C5.30904 21.8843 4.21679 21.4973 3.35859 20.6391C2.60342 19.8839 2.21192 18.9461 2.00296 17.7892C1.79789 16.6539 1.75858 15.2454 1.75 13.5037L1.75107 12.7518L3.75194 12.75L7.42333 12.75C8.70352 12.75 9.55879 13.7898 9.96929 14.6123C10.2595 15.1938 10.8231 15.75 11.9977 15.75C13.1723 15.75 13.7358 15.1938 14.0261 14.6123C14.4366 13.7898 15.2918 12.75 16.572 12.75L20.2519 12.75H22.2486L22.2453 13.5037Z">`);
7757
+ _tmpl$27 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill=#404040 d="M14.25 5.5C14.25 3.15279 16.1528 1.25 18.5 1.25C20.8472 1.25 22.75 3.15279 22.75 5.5C22.75 7.84721 20.8472 9.75 18.5 9.75C16.1528 9.75 14.25 7.84721 14.25 5.5Z"></path><path d="M20.2156 10.9897C19.9813 11.0629 19.8641 11.0994 19.8057 11.1792C19.7474 11.259 19.748 11.373 19.7491 11.6009C19.7513 12.0381 19.7518 12.4898 19.7519 12.9499C19.752 13.1155 19.6176 13.25 19.4519 13.25L16.072 13.25C14.7918 13.25 13.9366 14.2898 13.5261 15.1123C13.2358 15.6938 12.6723 16.25 11.4977 16.25C10.3231 16.25 9.7595 15.6938 9.46929 15.1123C9.05879 14.2898 8.20352 13.25 6.92333 13.25L3.55194 13.25C3.38626 13.25 3.25193 13.1155 3.25197 12.9499C3.25245 10.7983 3.26128 8.82894 3.41693 7.67121C3.57593 6.4886 3.87144 5.8272 4.35029 5.34835C4.82915 4.8695 5.49055 4.57399 6.67315 4.41499C7.88452 4.25212 9.9845 4.25 12.2519 4.25C12.3035 4.25 12.3542 4.25 12.4041 4.25001C12.6299 4.25002 12.7427 4.25003 12.822 4.19171C12.9014 4.13339 12.9377 4.0171 13.0103 3.78451C13.0682 3.59881 13.1354 3.41715 13.2111 3.24007C13.4166 2.75982 13.5193 2.51969 13.4304 2.38492C13.3415 2.25015 13.1029 2.25011 12.6257 2.25002C12.5291 2.25 12.4296 2.25 12.3268 2.25H11.6775C9.50152 2.24998 7.76678 2.24996 6.40666 2.43283C5.00228 2.62164 3.84847 3.02175 2.93608 3.93414C2.02369 4.84653 1.62358 6.00033 1.43477 7.40471C1.2708 8.62426 1.25387 10.5469 1.25214 12.4999L1.25 14.0037C1.25858 15.7454 1.29789 17.1539 1.50296 18.2892C1.71192 19.4461 2.10342 20.3839 2.85859 21.1391C3.71679 21.9973 4.80904 22.3843 6.1857 22.5694C7.52911 22.75 9.24978 22.75 11.4405 22.75H11.5548C13.7455 22.75 15.4662 22.75 16.8097 22.5694C18.1863 22.3843 19.2786 21.9973 20.1368 21.1391C20.8919 20.3839 21.2834 19.4461 21.4924 18.2892C21.6975 17.1539 21.7368 15.7454 21.7453 14.0037L21.7517 12.5C21.7514 12.1187 21.7505 11.7385 21.748 11.3645C21.7449 10.8942 21.7433 10.6591 21.6087 10.5709C21.4741 10.4828 21.2371 10.5844 20.763 10.7876C20.585 10.8638 20.4023 10.9314 20.2156 10.9897Z">`);
7758
+ IconInbox = (props) => {
7759
+ const size = () => props.size ?? 14;
7760
+ return (() => {
7761
+ var _el$ = _tmpl$20();
7762
+ createRenderEffect((_p$) => {
7763
+ var _v$ = size(), _v$2 = size(), _v$3 = props.class;
7764
+ _v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
7765
+ _v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
7766
+ _v$3 !== _p$.a && setAttribute(_el$, "class", _p$.a = _v$3);
7767
+ return _p$;
7768
+ }, {
7769
+ e: void 0,
7770
+ t: void 0,
7771
+ a: void 0
7772
+ });
7773
+ return _el$;
7774
+ })();
7775
+ };
7776
+ IconInboxUnread = (props) => {
7777
+ const size = () => props.size ?? 14;
7778
+ return (() => {
7779
+ var _el$2 = _tmpl$27();
7780
+ createRenderEffect((_p$) => {
7781
+ var _v$4 = size(), _v$5 = size(), _v$6 = props.class;
7782
+ _v$4 !== _p$.e && setAttribute(_el$2, "width", _p$.e = _v$4);
7783
+ _v$5 !== _p$.t && setAttribute(_el$2, "height", _p$.t = _v$5);
7784
+ _v$6 !== _p$.a && setAttribute(_el$2, "class", _p$.a = _v$6);
7785
+ return _p$;
7786
+ }, {
7787
+ e: void 0,
7788
+ t: void 0,
7789
+ a: void 0
7790
+ });
7791
+ return _el$2;
7792
+ })();
7793
+ };
7794
+ }
7795
+ });
7796
+
7701
7797
  // src/utils/freeze-updates.ts
7702
7798
  var isUpdatesPaused, getOrCache, patchedDispatchers, wrappedDispatchCache, wrappedStartTransitionCache, pendingStoreCallbacks, pendingTransitionCallbacks, pendingStateUpdates, pausedQueueStates, pausedContextStates, renderersWithPatchedDispatcher, typedFiberRoots, getFiberRoot, collectFiberRoots, mergePendingChains, pauseHookQueue, resumeHookQueue, pauseContextDependency, resumeContextDependency, forEachHookQueue, forEachContextDependency, traverseFibers, pauseFiber, resumeFiber, patchDispatcher, installDispatcherPatching, scheduleReactUpdate, invokeCallbacks, initializeFreezeSupport, freezeUpdates;
7703
7799
  var init_freeze_updates = __esm({
@@ -8170,7 +8266,28 @@ var init_freeze_animations = __esm({
8170
8266
  );
8171
8267
  };
8172
8268
  unfreezeGlobalAnimations = () => {
8173
- globalAnimationStyleElement?.remove();
8269
+ if (!globalAnimationStyleElement) return;
8270
+ globalAnimationStyleElement.textContent = `
8271
+ *, *::before, *::after {
8272
+ transition: none !important;
8273
+ }
8274
+ `;
8275
+ for (const animation of document.getAnimations()) {
8276
+ if (animation.effect instanceof KeyframeEffect) {
8277
+ const target = animation.effect.target;
8278
+ if (target instanceof Element) {
8279
+ const rootNode = target.getRootNode();
8280
+ if (rootNode instanceof ShadowRoot) {
8281
+ continue;
8282
+ }
8283
+ }
8284
+ }
8285
+ try {
8286
+ animation.finish();
8287
+ } catch {
8288
+ }
8289
+ }
8290
+ globalAnimationStyleElement.remove();
8174
8291
  globalAnimationStyleElement = null;
8175
8292
  };
8176
8293
  }
@@ -8479,7 +8596,7 @@ var init_freeze_pseudo_states = __esm({
8479
8596
  });
8480
8597
 
8481
8598
  // src/components/tooltip.tsx
8482
- var _tmpl$20, tooltipCloseTimestamp, wasTooltipRecentlyVisible, Tooltip;
8599
+ var _tmpl$21, tooltipCloseTimestamp, wasTooltipRecentlyVisible, Tooltip;
8483
8600
  var init_tooltip = __esm({
8484
8601
  "src/components/tooltip.tsx"() {
8485
8602
  "use strict";
@@ -8491,7 +8608,7 @@ var init_tooltip = __esm({
8491
8608
  init_solid();
8492
8609
  init_cn();
8493
8610
  init_constants();
8494
- _tmpl$20 = /* @__PURE__ */ template(`<div style=z-index:2147483647>`);
8611
+ _tmpl$21 = /* @__PURE__ */ template(`<div style=z-index:2147483647>`);
8495
8612
  tooltipCloseTimestamp = 0;
8496
8613
  wasTooltipRecentlyVisible = () => {
8497
8614
  return Date.now() - tooltipCloseTimestamp < TOOLTIP_GRACE_PERIOD_MS;
@@ -8535,9 +8652,9 @@ var init_tooltip = __esm({
8535
8652
  return delayedVisible();
8536
8653
  },
8537
8654
  get children() {
8538
- var _el$ = _tmpl$20();
8655
+ var _el$ = _tmpl$21();
8539
8656
  insert(_el$, () => props.children);
8540
- createRenderEffect(() => className(_el$, cn("absolute left-1/2 -translate-x-1/2 whitespace-nowrap px-1.5 py-0.5 rounded-[10px] text-[10px] text-black/60 pointer-events-none [corner-shape:superellipse(1.25)]", PANEL_STYLES, props.position === "top" ? "bottom-full mb-2.5" : "top-full mt-2.5", shouldAnimate() && "animate-tooltip-fade-in")));
8657
+ createRenderEffect(() => className(_el$, cn("absolute whitespace-nowrap px-1.5 py-0.5 rounded-[10px] text-[10px] text-black/60 pointer-events-none [corner-shape:superellipse(1.25)]", PANEL_STYLES, props.position === "left" || props.position === "right" ? "top-1/2 -translate-y-1/2" : "left-1/2 -translate-x-1/2", props.position === "top" && "bottom-full mb-2.5", props.position === "bottom" && "top-full mt-2.5", props.position === "left" && "right-full mr-2.5", props.position === "right" && "left-full ml-2.5", shouldAnimate() && "animate-tooltip-fade-in")));
8541
8658
  return _el$;
8542
8659
  }
8543
8660
  });
@@ -8558,8 +8675,25 @@ var init_get_toolbar_icon_color = __esm({
8558
8675
  }
8559
8676
  });
8560
8677
 
8678
+ // src/utils/toolbar-layout.ts
8679
+ var getExpandGridClass, getButtonSpacingClass, getMinDimensionClass;
8680
+ var init_toolbar_layout = __esm({
8681
+ "src/utils/toolbar-layout.ts"() {
8682
+ "use strict";
8683
+ getExpandGridClass = (isVertical, isExpanded, collapsedExtra) => {
8684
+ if (isExpanded) {
8685
+ return isVertical ? "grid-rows-[1fr] opacity-100" : "grid-cols-[1fr] opacity-100";
8686
+ }
8687
+ const base = isVertical ? "grid-rows-[0fr] opacity-0" : "grid-cols-[0fr] opacity-0";
8688
+ return collapsedExtra ? `${base} ${collapsedExtra}` : base;
8689
+ };
8690
+ getButtonSpacingClass = (isVertical) => isVertical ? "mb-1.5" : "mr-1.5";
8691
+ getMinDimensionClass = (isVertical) => isVertical ? "min-h-0" : "min-w-0";
8692
+ }
8693
+ });
8694
+
8561
8695
  // src/components/toolbar/index.tsx
8562
- var _tmpl$21, _tmpl$27, Toolbar;
8696
+ var _tmpl$28, _tmpl$29, Toolbar;
8563
8697
  var init_toolbar = __esm({
8564
8698
  "src/components/toolbar/index.tsx"() {
8565
8699
  "use strict";
@@ -8581,24 +8715,30 @@ var init_toolbar = __esm({
8581
8715
  init_icon_select();
8582
8716
  init_icon_chevron();
8583
8717
  init_icon_comment();
8718
+ init_icon_inbox();
8584
8719
  init_constants();
8585
8720
  init_freeze_updates();
8586
8721
  init_freeze_animations();
8587
8722
  init_freeze_pseudo_states();
8588
8723
  init_tooltip();
8589
8724
  init_get_toolbar_icon_color();
8590
- _tmpl$21 = /* @__PURE__ */ template(`<div style=z-index:2147483647>Enable to continue`);
8591
- _tmpl$27 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-toolbar style=z-index:2147483647><div><div><div class="flex items-center min-w-0"><div><div class="relative overflow-visible min-w-0"><button data-react-grab-ignore-events data-react-grab-toolbar-toggle class="contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox mr-1.5"></button></div></div><div><div class="relative overflow-visible min-w-0"><button data-react-grab-ignore-events data-react-grab-toolbar-comment class="contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox mr-1.5"></button></div></div><div class="relative shrink-0 overflow-visible"><button data-react-grab-ignore-events data-react-grab-toolbar-enabled class="contain-layout flex items-center justify-center cursor-pointer interactive-scale outline-none mx-0.5"><div><div></div></div></button></div></div></div><button data-react-grab-ignore-events data-react-grab-toolbar-collapse class="contain-layout shrink-0 flex items-center justify-center cursor-pointer interactive-scale">`);
8725
+ init_toolbar_layout();
8726
+ _tmpl$28 = /* @__PURE__ */ template(`<div style=z-index:2147483647>Enable to continue`);
8727
+ _tmpl$29 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-toolbar style=z-index:2147483647><div><div><div><div><div><div><button data-react-grab-ignore-events data-react-grab-toolbar-toggle></button></div></div><div><div><button data-react-grab-ignore-events data-react-grab-toolbar-comment></button></div></div><div><div><button data-react-grab-ignore-events data-react-grab-toolbar-history></button></div></div></div><div class="relative shrink-0 overflow-visible"><button data-react-grab-ignore-events data-react-grab-toolbar-enabled><div><div></div></div></button></div></div></div><button data-react-grab-ignore-events data-react-grab-toolbar-collapse class="contain-layout shrink-0 flex items-center justify-center cursor-pointer interactive-scale">`);
8592
8728
  Toolbar = (props) => {
8593
8729
  let containerRef;
8730
+ let expandableButtonsRef;
8594
8731
  let unfreezeUpdatesCallback = null;
8732
+ let lastKnownExpandableWidth = 0;
8733
+ let lastKnownExpandableHeight = 0;
8734
+ const savedState = loadToolbarState();
8595
8735
  const [isVisible, setIsVisible] = createSignal(false);
8596
8736
  const [isCollapsed, setIsCollapsed] = createSignal(false);
8597
8737
  const [isDragging, setIsDragging] = createSignal(false);
8598
8738
  const [isSnapping, setIsSnapping] = createSignal(false);
8599
8739
  const [isResizing, setIsResizing] = createSignal(false);
8600
- const [snapEdge, setSnapEdge] = createSignal("bottom");
8601
- const [positionRatio, setPositionRatio] = createSignal(0.5);
8740
+ const [snapEdge, setSnapEdge] = createSignal(savedState?.edge ?? "bottom");
8741
+ const [positionRatio, setPositionRatio] = createSignal(savedState?.ratio ?? 0.5);
8602
8742
  const [position, setPosition] = createSignal({
8603
8743
  x: 0,
8604
8744
  y: 0
@@ -8618,30 +8758,81 @@ var init_toolbar = __esm({
8618
8758
  const [isCommentTooltipVisible, setIsCommentTooltipVisible] = createSignal(false);
8619
8759
  const [isToggleTooltipVisible, setIsToggleTooltipVisible] = createSignal(false);
8620
8760
  const [isShakeTooltipVisible, setIsShakeTooltipVisible] = createSignal(false);
8621
- const tooltipPosition = () => snapEdge() === "top" ? "bottom" : "top";
8761
+ const [isToggleAnimating, setIsToggleAnimating] = createSignal(false);
8762
+ const [isRapidRetoggle, setIsRapidRetoggle] = createSignal(false);
8763
+ const [isHistoryTooltipVisible, setIsHistoryTooltipVisible] = createSignal(false);
8764
+ const historyTooltipLabel = () => {
8765
+ const count = props.historyItemCount ?? 0;
8766
+ return count > 0 ? `History (${count})` : "History";
8767
+ };
8768
+ const historyIconClass = () => cn("transition-colors", props.isHistoryPinned ? "text-black/80" : "text-[#B3B3B3]");
8769
+ const isVertical = () => snapEdge() === "left" || snapEdge() === "right";
8770
+ const measureExpandableDimension = () => {
8771
+ if (!expandableButtonsRef) return;
8772
+ const rect = expandableButtonsRef.getBoundingClientRect();
8773
+ if (isVertical()) {
8774
+ lastKnownExpandableHeight = rect.height;
8775
+ } else {
8776
+ lastKnownExpandableWidth = rect.width;
8777
+ }
8778
+ };
8779
+ const isTooltipAllowed = () => !isCollapsed() && !props.isHistoryDropdownOpen;
8780
+ const tooltipPosition = () => {
8781
+ const edge = snapEdge();
8782
+ switch (edge) {
8783
+ case "top":
8784
+ return "bottom";
8785
+ case "bottom":
8786
+ return "top";
8787
+ case "left":
8788
+ return "right";
8789
+ case "right":
8790
+ return "left";
8791
+ }
8792
+ };
8793
+ const expandGridClass = (isExpanded, collapsedExtra) => getExpandGridClass(isVertical(), isExpanded, collapsedExtra);
8794
+ const gridTransitionClass = () => isVertical() ? "transition-[grid-template-rows,opacity] duration-150 ease-out" : "transition-[grid-template-columns,opacity] duration-150 ease-out";
8795
+ const buttonSpacingClass = () => getButtonSpacingClass(isVertical());
8796
+ const minDimensionClass = () => getMinDimensionClass(isVertical());
8797
+ const shakeTooltipPositionClass = () => {
8798
+ const tooltipSide = tooltipPosition();
8799
+ if (isVertical()) {
8800
+ const placementClass2 = tooltipSide === "left" ? "right-full mr-0.5" : "left-full ml-0.5";
8801
+ return `top-1/2 -translate-y-1/2 ${placementClass2}`;
8802
+ }
8803
+ const placementClass = tooltipSide === "top" ? "bottom-full mb-0.5" : "top-full mt-0.5";
8804
+ return `left-1/2 -translate-x-1/2 ${placementClass}`;
8805
+ };
8622
8806
  const stopEventPropagation = (event) => {
8623
8807
  event.stopPropagation();
8624
8808
  event.stopImmediatePropagation();
8625
8809
  };
8626
- const createFreezeHandlers = (setTooltipVisible) => ({
8810
+ const createFreezeHandlers = (setTooltipVisible, onHoverChange, options) => ({
8627
8811
  onMouseEnter: () => {
8812
+ if (isDragging()) return;
8628
8813
  setTooltipVisible(true);
8629
- props.onSelectHoverChange?.(true);
8630
- if (!unfreezeUpdatesCallback) {
8814
+ if (options?.shouldSetSelectHoverState !== false) {
8815
+ props.onSelectHoverChange?.(true);
8816
+ }
8817
+ if (options?.shouldFreezeInteractions !== false && !unfreezeUpdatesCallback) {
8631
8818
  unfreezeUpdatesCallback = freezeUpdates();
8632
8819
  freezeGlobalAnimations();
8633
8820
  freezePseudoStates();
8634
8821
  }
8822
+ onHoverChange?.(true);
8635
8823
  },
8636
8824
  onMouseLeave: () => {
8637
8825
  setTooltipVisible(false);
8638
- props.onSelectHoverChange?.(false);
8639
- if (!props.isActive && !props.isContextMenuOpen) {
8826
+ if (options?.shouldSetSelectHoverState !== false) {
8827
+ props.onSelectHoverChange?.(false);
8828
+ }
8829
+ if (options?.shouldFreezeInteractions !== false && !props.isActive && !props.isContextMenuOpen) {
8640
8830
  unfreezeUpdatesCallback?.();
8641
8831
  unfreezeUpdatesCallback = null;
8642
8832
  unfreezeGlobalAnimations();
8643
8833
  unfreezePseudoStates();
8644
8834
  }
8835
+ onHoverChange?.(false);
8645
8836
  }
8646
8837
  });
8647
8838
  const collapsedEdgeClasses = () => {
@@ -8653,7 +8844,7 @@ var init_toolbar = __esm({
8653
8844
  left: "rounded-l-none rounded-r-[10px]",
8654
8845
  right: "rounded-r-none rounded-l-[10px]"
8655
8846
  }[edge];
8656
- const paddingClass = edge === "top" || edge === "bottom" ? "px-2 py-0.25" : "px-0.25 py-2";
8847
+ const paddingClass = isVertical() ? "px-0.25 py-2" : "px-2 py-0.25";
8657
8848
  return `${roundedClass} ${paddingClass}`;
8658
8849
  };
8659
8850
  let shakeTooltipTimeout;
@@ -8683,6 +8874,67 @@ var init_toolbar = __esm({
8683
8874
  unfreezeUpdatesCallback = null;
8684
8875
  }
8685
8876
  }));
8877
+ const reclampToolbarToViewport = () => {
8878
+ if (!containerRef) return;
8879
+ const rect = containerRef.getBoundingClientRect();
8880
+ expandedDimensions = {
8881
+ width: rect.width,
8882
+ height: rect.height
8883
+ };
8884
+ const currentPos = position();
8885
+ const viewport = getVisualViewport();
8886
+ const edge = snapEdge();
8887
+ let clampedX = currentPos.x;
8888
+ let clampedY = currentPos.y;
8889
+ if (edge === "top" || edge === "bottom") {
8890
+ const minX = viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX;
8891
+ const maxX = Math.max(minX, viewport.offsetLeft + viewport.width - rect.width - TOOLBAR_SNAP_MARGIN_PX);
8892
+ clampedX = clampToViewport2(currentPos.x, minX, maxX);
8893
+ clampedY = edge === "top" ? viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX : viewport.offsetTop + viewport.height - rect.height - TOOLBAR_SNAP_MARGIN_PX;
8894
+ } else {
8895
+ const minY = viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX;
8896
+ const maxY = Math.max(minY, viewport.offsetTop + viewport.height - rect.height - TOOLBAR_SNAP_MARGIN_PX);
8897
+ clampedY = clampToViewport2(currentPos.y, minY, maxY);
8898
+ clampedX = edge === "left" ? viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX : viewport.offsetLeft + viewport.width - rect.width - TOOLBAR_SNAP_MARGIN_PX;
8899
+ }
8900
+ const newRatio = getRatioFromPosition(edge, clampedX, clampedY, rect.width, rect.height);
8901
+ setPositionRatio(newRatio);
8902
+ const didPositionChange = clampedX !== currentPos.x || clampedY !== currentPos.y;
8903
+ if (didPositionChange) {
8904
+ setIsCollapseAnimating(true);
8905
+ requestAnimationFrame(() => {
8906
+ requestAnimationFrame(() => {
8907
+ setPosition({
8908
+ x: clampedX,
8909
+ y: clampedY
8910
+ });
8911
+ if (collapseAnimationTimeout) {
8912
+ clearTimeout(collapseAnimationTimeout);
8913
+ }
8914
+ collapseAnimationTimeout = setTimeout(() => {
8915
+ setIsCollapseAnimating(false);
8916
+ }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
8917
+ });
8918
+ });
8919
+ }
8920
+ };
8921
+ createEffect(on(() => props.historyItemCount ?? 0, () => {
8922
+ if (isCollapsed()) return;
8923
+ if (historyItemCountTimeout) {
8924
+ clearTimeout(historyItemCountTimeout);
8925
+ }
8926
+ historyItemCountTimeout = setTimeout(() => {
8927
+ measureExpandableDimension();
8928
+ reclampToolbarToViewport();
8929
+ }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
8930
+ onCleanup(() => {
8931
+ if (historyItemCountTimeout) {
8932
+ clearTimeout(historyItemCountTimeout);
8933
+ }
8934
+ });
8935
+ }, {
8936
+ defer: true
8937
+ }));
8686
8938
  let lastPointerPosition = {
8687
8939
  x: 0,
8688
8940
  y: 0,
@@ -8700,7 +8952,7 @@ var init_toolbar = __esm({
8700
8952
  width: TOOLBAR_COLLAPSED_SHORT_PX,
8701
8953
  height: TOOLBAR_COLLAPSED_SHORT_PX
8702
8954
  });
8703
- const clampToViewport = (value, min, max) => Math.max(min, Math.min(value, max));
8955
+ const clampToViewport2 = (value, min, max) => Math.max(min, Math.min(value, max));
8704
8956
  const getVisualViewport = () => {
8705
8957
  const visualViewport = window.visualViewport;
8706
8958
  if (visualViewport) {
@@ -8733,7 +8985,7 @@ var init_toolbar = __esm({
8733
8985
  if (edge === "top" || edge === "bottom") {
8734
8986
  const xOffset = (expandedWidth - actualCollapsedWidth) / 2;
8735
8987
  const newExpandedX = collapsedPosition.x - xOffset;
8736
- const clampedX = clampToViewport(newExpandedX, viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX, viewport.offsetLeft + viewportWidth - expandedWidth - TOOLBAR_SNAP_MARGIN_PX);
8988
+ const clampedX = clampToViewport2(newExpandedX, viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX, viewport.offsetLeft + viewportWidth - expandedWidth - TOOLBAR_SNAP_MARGIN_PX);
8737
8989
  const newExpandedY = edge === "top" ? viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX : viewport.offsetTop + viewportHeight - expandedHeight - TOOLBAR_SNAP_MARGIN_PX;
8738
8990
  newPosition = {
8739
8991
  x: clampedX,
@@ -8742,7 +8994,7 @@ var init_toolbar = __esm({
8742
8994
  } else {
8743
8995
  const yOffset = (expandedHeight - actualCollapsedHeight) / 2;
8744
8996
  const newExpandedY = collapsedPosition.y - yOffset;
8745
- const clampedY = clampToViewport(newExpandedY, viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX, viewport.offsetTop + viewportHeight - expandedHeight - TOOLBAR_SNAP_MARGIN_PX);
8997
+ const clampedY = clampToViewport2(newExpandedY, viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX, viewport.offsetTop + viewportHeight - expandedHeight - TOOLBAR_SNAP_MARGIN_PX);
8746
8998
  const newExpandedX = edge === "left" ? viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX : viewport.offsetLeft + viewportWidth - expandedWidth - TOOLBAR_SNAP_MARGIN_PX;
8747
8999
  newPosition = {
8748
9000
  x: newExpandedX,
@@ -8809,6 +9061,7 @@ var init_toolbar = __esm({
8809
9061
  };
8810
9062
  const handleToggle = createDragAwareHandler(() => props.onToggle?.());
8811
9063
  const handleComment = createDragAwareHandler(() => props.onComment?.());
9064
+ const handleHistory = createDragAwareHandler(() => props.onToggleHistory?.());
8812
9065
  const handleToggleCollapse = createDragAwareHandler(() => {
8813
9066
  const rect = containerRef?.getBoundingClientRect();
8814
9067
  const wasCollapsed = isCollapsed();
@@ -8851,7 +9104,134 @@ var init_toolbar = __esm({
8851
9104
  }
8852
9105
  }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
8853
9106
  });
8854
- const handleToggleEnabled = createDragAwareHandler(() => props.onToggleEnabled?.());
9107
+ const handleToggleEnabled = createDragAwareHandler(() => {
9108
+ const isCurrentlyEnabled = Boolean(props.enabled);
9109
+ const edge = snapEdge();
9110
+ const preTogglePosition = position();
9111
+ const isVerticalEdge = edge === "left" || edge === "right";
9112
+ const readExpandableDimension = () => isVerticalEdge ? lastKnownExpandableHeight : lastKnownExpandableWidth;
9113
+ if (isCurrentlyEnabled && expandableButtonsRef && !isToggleAnimating()) {
9114
+ measureExpandableDimension();
9115
+ }
9116
+ let expandableDimension = readExpandableDimension();
9117
+ let shouldCompensatePosition = expandableDimension > 0;
9118
+ let currentRenderedDimension = 0;
9119
+ if (expandableButtonsRef) {
9120
+ const expandableRect = expandableButtonsRef.getBoundingClientRect();
9121
+ currentRenderedDimension = isVerticalEdge ? expandableRect.height : expandableRect.width;
9122
+ }
9123
+ if (!isCurrentlyEnabled && expandableDimension === 0 && expandableButtonsRef) {
9124
+ const hasHistoryItems = (props.historyItemCount ?? 0) > 0;
9125
+ const expandedWrappers = Array.from(expandableButtonsRef.children).filter((child) => {
9126
+ if (!(child instanceof HTMLElement)) return false;
9127
+ const isHistoryGrid = child.classList.contains("pointer-events-none");
9128
+ return !(isHistoryGrid && !hasHistoryItems);
9129
+ });
9130
+ const gridProperty = isVerticalEdge ? "gridTemplateRows" : "gridTemplateColumns";
9131
+ for (const wrapper of expandedWrappers) {
9132
+ wrapper.style.transition = "none";
9133
+ wrapper.style[gridProperty] = "1fr";
9134
+ }
9135
+ void expandableButtonsRef.offsetWidth;
9136
+ measureExpandableDimension();
9137
+ expandableDimension = readExpandableDimension();
9138
+ for (const wrapper of expandedWrappers) {
9139
+ wrapper.style[gridProperty] = "";
9140
+ }
9141
+ void expandableButtonsRef.offsetWidth;
9142
+ for (const wrapper of expandedWrappers) {
9143
+ wrapper.style.transition = "";
9144
+ }
9145
+ shouldCompensatePosition = expandableDimension > 0;
9146
+ }
9147
+ if (shouldCompensatePosition) {
9148
+ setIsRapidRetoggle(isToggleAnimating());
9149
+ setIsToggleAnimating(true);
9150
+ }
9151
+ props.onToggleEnabled?.();
9152
+ if (shouldCompensatePosition) {
9153
+ const dimensionChange = isCurrentlyEnabled ? -expandableDimension : expandableDimension;
9154
+ if (isVerticalEdge) {
9155
+ expandedDimensions = {
9156
+ width: expandedDimensions.width,
9157
+ height: expandedDimensions.height + dimensionChange
9158
+ };
9159
+ } else {
9160
+ expandedDimensions = {
9161
+ width: expandedDimensions.width + dimensionChange,
9162
+ height: expandedDimensions.height
9163
+ };
9164
+ }
9165
+ const collapsedAxisPosition = isVerticalEdge ? preTogglePosition.y + currentRenderedDimension : preTogglePosition.x + currentRenderedDimension;
9166
+ const computeClampedPosition = (expandDimension) => {
9167
+ const viewport = getVisualViewport();
9168
+ const targetAxisPosition = collapsedAxisPosition - expandDimension;
9169
+ if (isVerticalEdge) {
9170
+ const clampMin2 = viewport.offsetTop + TOOLBAR_SNAP_MARGIN_PX;
9171
+ const clampMax2 = viewport.offsetTop + viewport.height - expandedDimensions.height - TOOLBAR_SNAP_MARGIN_PX;
9172
+ return {
9173
+ x: preTogglePosition.x,
9174
+ y: clampToViewport2(targetAxisPosition, clampMin2, clampMax2)
9175
+ };
9176
+ }
9177
+ const clampMin = viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX;
9178
+ const clampMax = viewport.offsetLeft + viewport.width - expandedDimensions.width - TOOLBAR_SNAP_MARGIN_PX;
9179
+ return {
9180
+ x: clampToViewport2(targetAxisPosition, clampMin, clampMax),
9181
+ y: preTogglePosition.y
9182
+ };
9183
+ };
9184
+ if (toggleAnimationRafId !== void 0) {
9185
+ cancelAnimationFrame(toggleAnimationRafId);
9186
+ }
9187
+ if (isRapidRetoggle()) {
9188
+ const finalExpandDimension = isCurrentlyEnabled ? 0 : expandableDimension;
9189
+ setPosition(computeClampedPosition(finalExpandDimension));
9190
+ toggleAnimationRafId = void 0;
9191
+ } else {
9192
+ const animationStartTime = performance.now();
9193
+ const syncPositionWithGrid = () => {
9194
+ const elapsed = performance.now() - animationStartTime;
9195
+ if (elapsed > TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS + TOGGLE_ANIMATION_BUFFER_MS) {
9196
+ toggleAnimationRafId = void 0;
9197
+ return;
9198
+ }
9199
+ if (expandableButtonsRef) {
9200
+ const currentExpandDimension = isVerticalEdge ? expandableButtonsRef.getBoundingClientRect().height : expandableButtonsRef.getBoundingClientRect().width;
9201
+ setPosition(computeClampedPosition(currentExpandDimension));
9202
+ }
9203
+ toggleAnimationRafId = requestAnimationFrame(syncPositionWithGrid);
9204
+ };
9205
+ toggleAnimationRafId = requestAnimationFrame(syncPositionWithGrid);
9206
+ }
9207
+ clearTimeout(toggleAnimationTimeout);
9208
+ toggleAnimationTimeout = setTimeout(() => {
9209
+ if (toggleAnimationRafId !== void 0) {
9210
+ cancelAnimationFrame(toggleAnimationRafId);
9211
+ toggleAnimationRafId = void 0;
9212
+ }
9213
+ const finalExpandDimension = isCurrentlyEnabled ? 0 : expandableDimension;
9214
+ setPosition(computeClampedPosition(finalExpandDimension));
9215
+ setIsToggleAnimating(false);
9216
+ setIsRapidRetoggle(false);
9217
+ const newRatio = getRatioFromPosition(edge, position().x, position().y, expandedDimensions.width, expandedDimensions.height);
9218
+ setPositionRatio(newRatio);
9219
+ saveAndNotify({
9220
+ edge,
9221
+ ratio: newRatio,
9222
+ collapsed: isCollapsed(),
9223
+ enabled: !isCurrentlyEnabled
9224
+ });
9225
+ }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
9226
+ } else {
9227
+ saveAndNotify({
9228
+ edge,
9229
+ ratio: positionRatio(),
9230
+ collapsed: isCollapsed(),
9231
+ enabled: !isCurrentlyEnabled
9232
+ });
9233
+ }
9234
+ });
8855
9235
  const getSnapPosition = (currentX, currentY, elementWidth, elementHeight, velocityX, velocityY) => {
8856
9236
  const viewport = getVisualViewport();
8857
9237
  const viewportWidth = viewport.width;
@@ -8895,6 +9275,12 @@ var init_toolbar = __esm({
8895
9275
  const distanceMoved = Math.sqrt(Math.pow(event.clientX - pointerStartPosition.x, 2) + Math.pow(event.clientY - pointerStartPosition.y, 2));
8896
9276
  if (distanceMoved > TOOLBAR_DRAG_THRESHOLD_PX) {
8897
9277
  setHasDragMoved(true);
9278
+ if (unfreezeUpdatesCallback) {
9279
+ unfreezeUpdatesCallback();
9280
+ unfreezeUpdatesCallback = null;
9281
+ unfreezeGlobalAnimations();
9282
+ unfreezePseudoStates();
9283
+ }
8898
9284
  }
8899
9285
  if (!hasDragMoved()) return;
8900
9286
  const now = performance.now();
@@ -8938,11 +9324,16 @@ var init_toolbar = __esm({
8938
9324
  setPositionRatio(ratio);
8939
9325
  setIsSnapping(true);
8940
9326
  requestAnimationFrame(() => {
9327
+ const postRenderRect = containerRef?.getBoundingClientRect();
9328
+ if (postRenderRect) {
9329
+ expandedDimensions = {
9330
+ width: postRenderRect.width,
9331
+ height: postRenderRect.height
9332
+ };
9333
+ }
8941
9334
  requestAnimationFrame(() => {
8942
- setPosition({
8943
- x: snap.x,
8944
- y: snap.y
8945
- });
9335
+ const snappedPosition = getPositionFromEdgeAndRatio(snap.edge, ratio, expandedDimensions.width, expandedDimensions.height);
9336
+ setPosition(snappedPosition);
8946
9337
  saveAndNotify({
8947
9338
  edge: snap.edge,
8948
9339
  ratio,
@@ -8951,6 +9342,9 @@ var init_toolbar = __esm({
8951
9342
  });
8952
9343
  snapAnimationTimeout = setTimeout(() => {
8953
9344
  setIsSnapping(false);
9345
+ if (props.enabled) {
9346
+ measureExpandableDimension();
9347
+ }
8954
9348
  }, TOOLBAR_SNAP_ANIMATION_DURATION_MS);
8955
9349
  });
8956
9350
  });
@@ -8998,7 +9392,7 @@ var init_toolbar = __esm({
8998
9392
  case "bottom": {
8999
9393
  const xOffset = (expandedWidth - collapsedWidth) / 2;
9000
9394
  const centeredX = pos.x + xOffset;
9001
- const clampedX = clampToViewport(centeredX, viewport.offsetLeft, viewport.offsetLeft + viewport.width - collapsedWidth);
9395
+ const clampedX = clampToViewport2(centeredX, viewport.offsetLeft, viewport.offsetLeft + viewport.width - collapsedWidth);
9002
9396
  return {
9003
9397
  x: clampedX,
9004
9398
  y: edge === "top" ? viewport.offsetTop : viewport.offsetTop + viewport.height - collapsedHeight
@@ -9008,7 +9402,7 @@ var init_toolbar = __esm({
9008
9402
  case "right": {
9009
9403
  const yOffset = (expandedHeight - collapsedHeight) / 2;
9010
9404
  const centeredY = pos.y + yOffset;
9011
- const clampedY = clampToViewport(centeredY, viewport.offsetTop, viewport.offsetTop + viewport.height - collapsedHeight);
9405
+ const clampedY = clampToViewport2(centeredY, viewport.offsetTop, viewport.offsetTop + viewport.height - collapsedHeight);
9012
9406
  return {
9013
9407
  x: edge === "left" ? viewport.offsetLeft : viewport.offsetLeft + viewport.width - collapsedWidth,
9014
9408
  y: clampedY
@@ -9037,6 +9431,9 @@ var init_toolbar = __esm({
9037
9431
  let resizeTimeout;
9038
9432
  let collapseAnimationTimeout;
9039
9433
  let snapAnimationTimeout;
9434
+ let toggleAnimationTimeout;
9435
+ let toggleAnimationRafId;
9436
+ let historyItemCountTimeout;
9040
9437
  const handleResize = () => {
9041
9438
  if (isDragging()) return;
9042
9439
  setIsResizing(true);
@@ -9061,12 +9458,12 @@ var init_toolbar = __esm({
9061
9458
  props.onStateChange?.(state);
9062
9459
  };
9063
9460
  onMount(() => {
9064
- const savedState = loadToolbarState();
9461
+ if (containerRef) {
9462
+ props.onContainerRef?.(containerRef);
9463
+ }
9065
9464
  const rect = containerRef?.getBoundingClientRect();
9066
9465
  const viewport = getVisualViewport();
9067
9466
  if (savedState) {
9068
- setSnapEdge(savedState.edge);
9069
- setPositionRatio(savedState.ratio);
9070
9467
  if (rect) {
9071
9468
  expandedDimensions = {
9072
9469
  width: rect.width,
@@ -9097,9 +9494,12 @@ var init_toolbar = __esm({
9097
9494
  const defaultPosition = getPositionFromEdgeAndRatio("bottom", 0.5, expandedDimensions.width, expandedDimensions.height);
9098
9495
  setPosition(defaultPosition);
9099
9496
  }
9497
+ if (props.enabled) {
9498
+ measureExpandableDimension();
9499
+ }
9100
9500
  if (props.onSubscribeToStateChanges) {
9101
9501
  const unsubscribe = props.onSubscribeToStateChanges((state) => {
9102
- if (isCollapseAnimating()) return;
9502
+ if (isCollapseAnimating() || isToggleAnimating()) return;
9103
9503
  const rect2 = containerRef?.getBoundingClientRect();
9104
9504
  if (!rect2) return;
9105
9505
  const didCollapsedChange = isCollapsed() !== state.collapsed;
@@ -9114,18 +9514,14 @@ var init_toolbar = __esm({
9114
9514
  } = calculateExpandedPositionFromCollapsed(collapsedPos, state.edge);
9115
9515
  setPosition(newPos);
9116
9516
  setPositionRatio(newRatio);
9117
- if (collapseAnimationTimeout) {
9118
- clearTimeout(collapseAnimationTimeout);
9119
- }
9517
+ clearTimeout(collapseAnimationTimeout);
9120
9518
  collapseAnimationTimeout = setTimeout(() => {
9121
9519
  setIsCollapseAnimating(false);
9122
9520
  }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
9123
9521
  } else {
9124
9522
  if (didCollapsedChange) {
9125
9523
  setIsCollapseAnimating(true);
9126
- if (collapseAnimationTimeout) {
9127
- clearTimeout(collapseAnimationTimeout);
9128
- }
9524
+ clearTimeout(collapseAnimationTimeout);
9129
9525
  collapseAnimationTimeout = setTimeout(() => {
9130
9526
  setIsCollapseAnimating(false);
9131
9527
  }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
@@ -9154,17 +9550,14 @@ var init_toolbar = __esm({
9154
9550
  window.visualViewport?.removeEventListener("scroll", handleResize);
9155
9551
  window.removeEventListener("pointermove", handleWindowPointerMove);
9156
9552
  window.removeEventListener("pointerup", handleWindowPointerUp);
9157
- if (resizeTimeout) {
9158
- clearTimeout(resizeTimeout);
9159
- }
9160
- if (collapseAnimationTimeout) {
9161
- clearTimeout(collapseAnimationTimeout);
9162
- }
9163
- if (shakeTooltipTimeout) {
9164
- clearTimeout(shakeTooltipTimeout);
9165
- }
9166
- if (snapAnimationTimeout) {
9167
- clearTimeout(snapAnimationTimeout);
9553
+ clearTimeout(resizeTimeout);
9554
+ clearTimeout(collapseAnimationTimeout);
9555
+ clearTimeout(shakeTooltipTimeout);
9556
+ clearTimeout(snapAnimationTimeout);
9557
+ clearTimeout(toggleAnimationTimeout);
9558
+ clearTimeout(historyItemCountTimeout);
9559
+ if (toggleAnimationRafId !== void 0) {
9560
+ cancelAnimationFrame(toggleAnimationRafId);
9168
9561
  }
9169
9562
  unfreezeUpdatesCallback?.();
9170
9563
  });
@@ -9191,6 +9584,9 @@ var init_toolbar = __esm({
9191
9584
  if (isCollapseAnimating()) {
9192
9585
  return "transition-[transform,opacity] duration-150 ease-out";
9193
9586
  }
9587
+ if (isToggleAnimating()) {
9588
+ return "transition-opacity duration-150 ease-out";
9589
+ }
9194
9590
  return "transition-opacity duration-300 ease-out";
9195
9591
  };
9196
9592
  const getTransformOrigin = () => {
@@ -9209,7 +9605,7 @@ var init_toolbar = __esm({
9209
9605
  }
9210
9606
  };
9211
9607
  return (() => {
9212
- var _el$ = _tmpl$27(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$1 = _el$8.nextSibling, _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$3.nextSibling;
9608
+ var _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$6.nextSibling, _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$9.nextSibling, _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$5.nextSibling, _el$14 = _el$13.firstChild, _el$15 = _el$14.firstChild, _el$16 = _el$15.firstChild, _el$17 = _el$3.nextSibling;
9213
9609
  _el$.$$pointerdown = handlePointerDown;
9214
9610
  var _ref$ = containerRef;
9215
9611
  typeof _ref$ === "function" ? use(_ref$, _el$) : containerRef = _el$;
@@ -9239,65 +9635,127 @@ var init_toolbar = __esm({
9239
9635
  }
9240
9636
  };
9241
9637
  _el$2.addEventListener("animationend", () => setIsShaking(false));
9242
- _el$7.$$click = (event) => {
9638
+ var _ref$2 = expandableButtonsRef;
9639
+ typeof _ref$2 === "function" ? use(_ref$2, _el$5) : expandableButtonsRef = _el$5;
9640
+ _el$8.$$click = (event) => {
9243
9641
  setIsSelectTooltipVisible(false);
9244
9642
  handleToggle(event);
9245
9643
  };
9246
- addEventListener(_el$7, "mousedown", stopEventPropagation);
9247
- addEventListener(_el$7, "pointerdown", (event) => {
9644
+ addEventListener(_el$8, "mousedown", stopEventPropagation);
9645
+ addEventListener(_el$8, "pointerdown", (event) => {
9248
9646
  stopEventPropagation(event);
9249
9647
  handlePointerDown(event);
9250
9648
  });
9251
- spread(_el$7, mergeProps(() => createFreezeHandlers(setIsSelectTooltipVisible)), false, true);
9252
- insert(_el$7, createComponent(IconSelect, {
9649
+ spread(_el$8, mergeProps({
9650
+ get ["class"]() {
9651
+ return cn("contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox", buttonSpacingClass());
9652
+ }
9653
+ }, () => createFreezeHandlers(setIsSelectTooltipVisible)), false, true);
9654
+ insert(_el$8, createComponent(IconSelect, {
9253
9655
  size: 14,
9254
9656
  get ["class"]() {
9255
9657
  return cn("transition-colors", getToolbarIconColor(Boolean(props.isActive) && !props.isCommentMode, Boolean(props.isCommentMode)));
9256
9658
  }
9257
9659
  }));
9258
- insert(_el$6, createComponent(Tooltip, {
9660
+ insert(_el$7, createComponent(Tooltip, {
9259
9661
  get visible() {
9260
- return memo(() => !!isSelectTooltipVisible())() && !isCollapsed();
9662
+ return memo(() => !!isSelectTooltipVisible())() && isTooltipAllowed();
9261
9663
  },
9262
9664
  get position() {
9263
9665
  return tooltipPosition();
9264
9666
  },
9265
- children: "Select"
9667
+ children: "Select element"
9266
9668
  }), null);
9267
- _el$0.$$click = (event) => {
9669
+ _el$1.$$click = (event) => {
9268
9670
  setIsCommentTooltipVisible(false);
9269
9671
  handleComment(event);
9270
9672
  };
9271
- addEventListener(_el$0, "mousedown", stopEventPropagation);
9272
- addEventListener(_el$0, "pointerdown", (event) => {
9673
+ addEventListener(_el$1, "mousedown", stopEventPropagation);
9674
+ addEventListener(_el$1, "pointerdown", (event) => {
9273
9675
  stopEventPropagation(event);
9274
9676
  handlePointerDown(event);
9275
9677
  });
9276
- spread(_el$0, mergeProps(() => createFreezeHandlers(setIsCommentTooltipVisible)), false, true);
9277
- insert(_el$0, createComponent(IconComment, {
9678
+ spread(_el$1, mergeProps({
9679
+ get ["class"]() {
9680
+ return cn("contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox", buttonSpacingClass());
9681
+ }
9682
+ }, () => createFreezeHandlers(setIsCommentTooltipVisible)), false, true);
9683
+ insert(_el$1, createComponent(IconComment, {
9278
9684
  size: 14,
9279
9685
  get ["class"]() {
9280
9686
  return cn("transition-colors", getToolbarIconColor(Boolean(props.isCommentMode), Boolean(props.isActive) && !props.isCommentMode));
9281
9687
  }
9282
9688
  }));
9283
- insert(_el$9, createComponent(Tooltip, {
9689
+ insert(_el$0, createComponent(Tooltip, {
9690
+ get visible() {
9691
+ return memo(() => !!isCommentTooltipVisible())() && isTooltipAllowed();
9692
+ },
9693
+ get position() {
9694
+ return tooltipPosition();
9695
+ },
9696
+ children: "Add comment"
9697
+ }), null);
9698
+ _el$12.$$click = (event) => {
9699
+ setIsHistoryTooltipVisible(false);
9700
+ handleHistory(event);
9701
+ };
9702
+ addEventListener(_el$12, "mousedown", stopEventPropagation);
9703
+ addEventListener(_el$12, "pointerdown", (event) => {
9704
+ stopEventPropagation(event);
9705
+ handlePointerDown(event);
9706
+ });
9707
+ spread(_el$12, mergeProps({
9708
+ get ["class"]() {
9709
+ return cn("contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox", buttonSpacingClass());
9710
+ }
9711
+ }, () => createFreezeHandlers((visible) => {
9712
+ if (visible && props.isHistoryDropdownOpen) return;
9713
+ setIsHistoryTooltipVisible(visible);
9714
+ }, (isHovered) => props.onHistoryButtonHover?.(isHovered), {
9715
+ shouldFreezeInteractions: false,
9716
+ shouldSetSelectHoverState: false
9717
+ })), false, true);
9718
+ insert(_el$12, createComponent(Show, {
9719
+ get when() {
9720
+ return props.hasUnreadHistoryItems;
9721
+ },
9722
+ get fallback() {
9723
+ return createComponent(IconInbox, {
9724
+ size: 14,
9725
+ get ["class"]() {
9726
+ return historyIconClass();
9727
+ }
9728
+ });
9729
+ },
9730
+ get children() {
9731
+ return createComponent(IconInboxUnread, {
9732
+ size: 14,
9733
+ get ["class"]() {
9734
+ return historyIconClass();
9735
+ }
9736
+ });
9737
+ }
9738
+ }));
9739
+ insert(_el$11, createComponent(Tooltip, {
9284
9740
  get visible() {
9285
- return memo(() => !!isCommentTooltipVisible())() && !isCollapsed();
9741
+ return memo(() => !!isHistoryTooltipVisible())() && isTooltipAllowed();
9286
9742
  },
9287
9743
  get position() {
9288
9744
  return tooltipPosition();
9289
9745
  },
9290
- children: "Comment"
9746
+ get children() {
9747
+ return historyTooltipLabel();
9748
+ }
9291
9749
  }), null);
9292
- _el$10.addEventListener("mouseleave", () => setIsToggleTooltipVisible(false));
9293
- _el$10.addEventListener("mouseenter", () => setIsToggleTooltipVisible(true));
9294
- _el$10.$$click = (event) => {
9750
+ _el$14.addEventListener("mouseleave", () => setIsToggleTooltipVisible(false));
9751
+ _el$14.addEventListener("mouseenter", () => setIsToggleTooltipVisible(true));
9752
+ _el$14.$$click = (event) => {
9295
9753
  setIsToggleTooltipVisible(false);
9296
9754
  handleToggleEnabled(event);
9297
9755
  };
9298
- insert(_el$1, createComponent(Tooltip, {
9756
+ insert(_el$13, createComponent(Tooltip, {
9299
9757
  get visible() {
9300
- return memo(() => !!isToggleTooltipVisible())() && !isCollapsed();
9758
+ return memo(() => !!isToggleTooltipVisible())() && isTooltipAllowed();
9301
9759
  },
9302
9760
  get position() {
9303
9761
  return tooltipPosition();
@@ -9306,8 +9764,9 @@ var init_toolbar = __esm({
9306
9764
  return props.enabled ? "Disable" : "Enable";
9307
9765
  }
9308
9766
  }), null);
9309
- addEventListener(_el$13, "click", handleToggleCollapse, true);
9310
- insert(_el$13, createComponent(IconChevron, {
9767
+ addEventListener(_el$17, "click", handleToggleCollapse, true);
9768
+ insert(_el$17, createComponent(IconChevron, {
9769
+ size: 14,
9311
9770
  get ["class"]() {
9312
9771
  return cn("text-[#B3B3B3] transition-transform duration-150", chevronRotation());
9313
9772
  }
@@ -9317,23 +9776,30 @@ var init_toolbar = __esm({
9317
9776
  return isShakeTooltipVisible();
9318
9777
  },
9319
9778
  get children() {
9320
- var _el$14 = _tmpl$21();
9321
- createRenderEffect(() => className(_el$14, cn("absolute left-1/2 -translate-x-1/2 whitespace-nowrap px-1.5 py-0.5 rounded-[10px] text-[10px] text-black/60 pointer-events-none animate-tooltip-fade-in [corner-shape:superellipse(1.25)]", PANEL_STYLES, tooltipPosition() === "top" ? "bottom-full mb-0.5" : "top-full mt-0.5")));
9322
- return _el$14;
9779
+ var _el$18 = _tmpl$28();
9780
+ createRenderEffect(() => className(_el$18, cn("absolute whitespace-nowrap px-1.5 py-0.5 rounded-[10px] text-[10px] text-black/60 pointer-events-none animate-tooltip-fade-in [corner-shape:superellipse(1.25)]", PANEL_STYLES, shakeTooltipPositionClass())));
9781
+ return _el$18;
9323
9782
  }
9324
9783
  }), null);
9325
9784
  createRenderEffect((_p$) => {
9326
- var _v$ = cn("fixed left-0 top-0 font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none", getCursorClass(), getTransitionClass(), isVisible() ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"), _v$2 = `translate(${currentPosition().x}px, ${currentPosition().y}px)`, _v$3 = getTransformOrigin(), _v$4 = cn("flex items-center justify-center rounded-[10px] antialiased transition-all duration-150 ease-out relative overflow-visible [font-synthesis:none] [corner-shape:superellipse(1.25)]", PANEL_STYLES, !isCollapsed() && "py-1.5 gap-1.5 px-2", collapsedEdgeClasses(), isShaking() && "animate-shake"), _v$5 = getTransformOrigin(), _v$6 = cn("grid transition-all duration-150 ease-out", isCollapsed() ? "grid-cols-[0fr] opacity-0 pointer-events-none" : "grid-cols-[1fr] opacity-100"), _v$7 = cn("grid transition-all duration-150 ease-out", props.enabled ? "grid-cols-[1fr] opacity-100" : "grid-cols-[0fr] opacity-0"), _v$8 = cn("grid transition-all duration-150 ease-out", props.enabled ? "grid-cols-[1fr] opacity-100" : "grid-cols-[0fr] opacity-0"), _v$9 = cn("relative w-5 h-3 rounded-full transition-colors", props.enabled ? "bg-black" : "bg-black/25"), _v$0 = cn("absolute top-0.5 w-2 h-2 rounded-full bg-white transition-transform", props.enabled ? "left-2.5" : "left-0.5");
9785
+ var _v$ = cn("fixed left-0 top-0 font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none", getCursorClass(), getTransitionClass(), isVisible() ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"), _v$2 = `translate(${currentPosition().x}px, ${currentPosition().y}px)`, _v$3 = getTransformOrigin(), _v$4 = cn("flex items-center justify-center rounded-[10px] antialiased relative overflow-visible [font-synthesis:none] [corner-shape:superellipse(1.25)]", isVertical() && "flex-col", PANEL_STYLES, !isCollapsed() && (isVertical() ? "px-1.5 gap-1.5 py-2" : "py-1.5 gap-1.5 px-2"), collapsedEdgeClasses(), isShaking() && "animate-shake"), _v$5 = getTransformOrigin(), _v$6 = cn("grid", !isRapidRetoggle() && gridTransitionClass(), expandGridClass(!isCollapsed(), "pointer-events-none")), _v$7 = cn("flex", isVertical() ? "flex-col items-center min-h-0" : "items-center min-w-0"), _v$8 = cn("flex items-center", isVertical() && "flex-col"), _v$9 = cn("grid", !isRapidRetoggle() && gridTransitionClass(), expandGridClass(Boolean(props.enabled))), _v$0 = cn("relative overflow-visible", minDimensionClass()), _v$1 = cn("grid", !isRapidRetoggle() && gridTransitionClass(), expandGridClass(Boolean(props.enabled))), _v$10 = cn("relative overflow-visible", minDimensionClass()), _v$11 = cn("grid", !isRapidRetoggle() && gridTransitionClass(), expandGridClass(Boolean(props.enabled) && (props.historyItemCount ?? 0) > 0, "pointer-events-none")), _v$12 = cn("relative overflow-visible", minDimensionClass()), _v$13 = cn("contain-layout flex items-center justify-center cursor-pointer interactive-scale outline-none", isVertical() ? "my-0.5" : "mx-0.5"), _v$14 = cn("relative rounded-full transition-colors", isVertical() ? "w-3.5 h-2.5" : "w-5 h-3", props.enabled ? "bg-black" : "bg-black/25"), _v$15 = cn("absolute top-0.5 rounded-full bg-white transition-transform", isVertical() ? "w-1.5 h-1.5" : "w-2 h-2", !props.enabled && "left-0.5", props.enabled && (isVertical() ? "left-1.5" : "left-2.5"));
9327
9786
  _v$ !== _p$.e && className(_el$, _p$.e = _v$);
9328
9787
  _v$2 !== _p$.t && setStyleProperty(_el$, "transform", _p$.t = _v$2);
9329
9788
  _v$3 !== _p$.a && setStyleProperty(_el$, "transform-origin", _p$.a = _v$3);
9330
9789
  _v$4 !== _p$.o && className(_el$2, _p$.o = _v$4);
9331
9790
  _v$5 !== _p$.i && setStyleProperty(_el$2, "transform-origin", _p$.i = _v$5);
9332
9791
  _v$6 !== _p$.n && className(_el$3, _p$.n = _v$6);
9333
- _v$7 !== _p$.s && className(_el$5, _p$.s = _v$7);
9334
- _v$8 !== _p$.h && className(_el$8, _p$.h = _v$8);
9335
- _v$9 !== _p$.r && className(_el$11, _p$.r = _v$9);
9336
- _v$0 !== _p$.d && className(_el$12, _p$.d = _v$0);
9792
+ _v$7 !== _p$.s && className(_el$4, _p$.s = _v$7);
9793
+ _v$8 !== _p$.h && className(_el$5, _p$.h = _v$8);
9794
+ _v$9 !== _p$.r && className(_el$6, _p$.r = _v$9);
9795
+ _v$0 !== _p$.d && className(_el$7, _p$.d = _v$0);
9796
+ _v$1 !== _p$.l && className(_el$9, _p$.l = _v$1);
9797
+ _v$10 !== _p$.u && className(_el$0, _p$.u = _v$10);
9798
+ _v$11 !== _p$.c && className(_el$10, _p$.c = _v$11);
9799
+ _v$12 !== _p$.w && className(_el$11, _p$.w = _v$12);
9800
+ _v$13 !== _p$.m && className(_el$14, _p$.m = _v$13);
9801
+ _v$14 !== _p$.f && className(_el$15, _p$.f = _v$14);
9802
+ _v$15 !== _p$.y && className(_el$16, _p$.y = _v$15);
9337
9803
  return _p$;
9338
9804
  }, {
9339
9805
  e: void 0,
@@ -9345,7 +9811,14 @@ var init_toolbar = __esm({
9345
9811
  s: void 0,
9346
9812
  h: void 0,
9347
9813
  r: void 0,
9348
- d: void 0
9814
+ d: void 0,
9815
+ l: void 0,
9816
+ u: void 0,
9817
+ c: void 0,
9818
+ w: void 0,
9819
+ m: void 0,
9820
+ f: void 0,
9821
+ y: void 0
9349
9822
  });
9350
9823
  return _el$;
9351
9824
  })();
@@ -9386,7 +9859,7 @@ var init_is_event_from_overlay = __esm({
9386
9859
  });
9387
9860
 
9388
9861
  // src/components/context-menu.tsx
9389
- var _tmpl$28, _tmpl$29, _tmpl$35, _tmpl$44, ContextMenu;
9862
+ var _tmpl$30, _tmpl$210, _tmpl$35, _tmpl$44, ContextMenu;
9390
9863
  var init_context_menu = __esm({
9391
9864
  "src/components/context-menu.tsx"() {
9392
9865
  "use strict";
@@ -9409,8 +9882,8 @@ var init_context_menu = __esm({
9409
9882
  init_get_tag_display();
9410
9883
  init_resolve_action_enabled();
9411
9884
  init_is_event_from_overlay();
9412
- _tmpl$28 = /* @__PURE__ */ template(`<div class="flex flex-col w-[calc(100%+16px)] -mx-2 -my-1.5">`);
9413
- _tmpl$29 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-context-menu class="fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-opacity duration-150 ease-out"style=z-index:2147483647;pointer-events:auto><div><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2">`);
9885
+ _tmpl$30 = /* @__PURE__ */ template(`<div class="flex flex-col w-[calc(100%+16px)] -mx-2 -my-1.5">`);
9886
+ _tmpl$210 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-context-menu class="fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-opacity duration-150 ease-out"style=z-index:2147483647;pointer-events:auto><div><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2">`);
9414
9887
  _tmpl$35 = /* @__PURE__ */ template(`<span class="text-[11px] font-sans text-black/50 ml-4">`);
9415
9888
  _tmpl$44 = /* @__PURE__ */ template(`<button data-react-grab-ignore-events class="contain-layout flex items-center justify-between w-full px-2 py-1 cursor-pointer transition-colors hover:bg-black/5 text-left border-none bg-transparent disabled:opacity-40 disabled:cursor-default disabled:hover:bg-transparent"><span class="text-[13px] leading-4 font-sans font-medium text-black">`);
9416
9889
  ContextMenu = (props) => {
@@ -9564,7 +10037,7 @@ var init_context_menu = __esm({
9564
10037
  return isVisible();
9565
10038
  },
9566
10039
  get children() {
9567
- var _el$ = _tmpl$29(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
10040
+ var _el$ = _tmpl$210(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
9568
10041
  _el$.$$contextmenu = handleMenuEvent;
9569
10042
  _el$.$$click = handleMenuEvent;
9570
10043
  _el$.$$mousedown = handleMenuEvent;
@@ -9604,7 +10077,7 @@ var init_context_menu = __esm({
9604
10077
  }));
9605
10078
  insert(_el$2, createComponent(BottomSection, {
9606
10079
  get children() {
9607
- var _el$4 = _tmpl$28();
10080
+ var _el$4 = _tmpl$30();
9608
10081
  insert(_el$4, createComponent(For, {
9609
10082
  get each() {
9610
10083
  return menuItems();
@@ -9658,10 +10131,436 @@ var init_context_menu = __esm({
9658
10131
  }
9659
10132
  });
9660
10133
 
9661
- // src/components/renderer.tsx
9662
- var _tmpl$30, ReactGrabRenderer;
9663
- var init_renderer = __esm({
9664
- "src/components/renderer.tsx"() {
10134
+ // src/utils/clamp-to-viewport.ts
10135
+ var clampToViewport;
10136
+ var init_clamp_to_viewport = __esm({
10137
+ "src/utils/clamp-to-viewport.ts"() {
10138
+ "use strict";
10139
+ clampToViewport = (value, elementSize, viewportSize, padding) => Math.max(padding, Math.min(value, viewportSize - elementSize - padding));
10140
+ }
10141
+ });
10142
+
10143
+ // src/components/icons/icon-trash.tsx
10144
+ var _tmpl$31, IconTrash;
10145
+ var init_icon_trash = __esm({
10146
+ "src/components/icons/icon-trash.tsx"() {
10147
+ "use strict";
10148
+ init_web();
10149
+ init_web();
10150
+ init_web();
10151
+ _tmpl$31 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M4.63751 20.1665L3.82444 6.75092L3.73431 5.06621C3.72513 4.89447 3.8619 4.75018 4.03388 4.75018H19.9945C20.1685 4.75018 20.306 4.89769 20.2938 5.07124L20.1756 6.75092L19.3625 20.1665C19.2745 21.618 18.0717 22.7502 16.6176 22.7502H7.38247C5.9283 22.7502 4.72548 21.618 4.63751 20.1665ZM8.74963 16.5002C8.74963 16.9144 9.08542 17.2502 9.49963 17.2502C9.91385 17.2502 10.2496 16.9144 10.2496 16.5002V10.5002C10.2496 10.086 9.91385 9.75018 9.49963 9.75018C9.08542 9.75018 8.74963 10.086 8.74963 10.5002V16.5002ZM14.4996 9.75018C14.9138 9.75018 15.2496 10.086 15.2496 10.5002V16.5002C15.2496 16.9144 14.9138 17.2502 14.4996 17.2502C14.0854 17.2502 13.7496 16.9144 13.7496 16.5002V10.5002C13.7496 10.086 14.0854 9.75018 14.4996 9.75018Z"></path><path fill-rule=evenodd clip-rule=evenodd d="M8.31879 2.46286C8.63394 1.7275 9.35702 1.2507 10.1571 1.2507H13.8383C14.6383 1.2507 15.3614 1.7275 15.6766 2.46286L16.6569 4.75034H19.2239C19.2903 4.75034 19.3523 4.75034 19.4102 4.7507H19.4637C19.4857 4.74973 19.5079 4.74972 19.5303 4.7507H20.9977C21.55 4.7507 21.9977 5.19842 21.9977 5.7507C21.9977 6.30299 21.55 6.7507 20.9977 6.7507H2.99768C2.4454 6.7507 1.99768 6.30299 1.99768 5.7507C1.99768 5.19842 2.4454 4.7507 2.99768 4.7507H4.46507C4.48746 4.74972 4.50968 4.74973 4.53167 4.7507H4.58469C4.6426 4.75034 4.70457 4.75034 4.77093 4.75034H7.33844L8.31879 2.46286ZM13.8903 3.37192L14.481 4.75034H9.5144L10.1052 3.37192C10.1367 3.29838 10.209 3.2507 10.289 3.2507L13.7064 3.2507C13.7864 3.2507 13.8587 3.29838 13.8903 3.37192Z">`);
10152
+ IconTrash = (props) => {
10153
+ const size = () => props.size ?? 14;
10154
+ return (() => {
10155
+ var _el$ = _tmpl$31();
10156
+ createRenderEffect((_p$) => {
10157
+ var _v$ = size(), _v$2 = size(), _v$3 = props.class;
10158
+ _v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
10159
+ _v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
10160
+ _v$3 !== _p$.a && setAttribute(_el$, "class", _p$.a = _v$3);
10161
+ return _p$;
10162
+ }, {
10163
+ e: void 0,
10164
+ t: void 0,
10165
+ a: void 0
10166
+ });
10167
+ return _el$;
10168
+ })();
10169
+ };
10170
+ }
10171
+ });
10172
+
10173
+ // src/components/icons/icon-copy.tsx
10174
+ var _tmpl$36, IconCopy;
10175
+ var init_icon_copy = __esm({
10176
+ "src/components/icons/icon-copy.tsx"() {
10177
+ "use strict";
10178
+ init_web();
10179
+ init_web();
10180
+ init_web();
10181
+ _tmpl$36 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path d="M16.0549 8.25C17.4225 8.24998 18.5248 8.24996 19.3918 8.36652C20.2919 8.48754 21.0497 8.74643 21.6517 9.34835C22.2536 9.95027 22.5125 10.7081 22.6335 11.6083C22.75 12.4752 22.75 13.5775 22.75 14.9451V14.9451V16.0549V16.0549C22.75 17.4225 22.75 18.5248 22.6335 19.3918C22.5125 20.2919 22.2536 21.0497 21.6517 21.6517C21.0497 22.2536 20.2919 22.5125 19.3918 22.6335C18.5248 22.75 17.4225 22.75 16.0549 22.75H16.0549H14.9451H14.9451C13.5775 22.75 12.4752 22.75 11.6082 22.6335C10.7081 22.5125 9.95027 22.2536 9.34835 21.6516C8.74643 21.0497 8.48754 20.2919 8.36652 19.3918C8.24996 18.5248 8.24998 17.4225 8.25 16.0549V16.0549V14.9451V14.9451C8.24998 13.5775 8.24996 12.4752 8.36652 11.6082C8.48754 10.7081 8.74643 9.95027 9.34835 9.34835C9.95027 8.74643 10.7081 8.48754 11.6083 8.36652C12.4752 8.24996 13.5775 8.24998 14.9451 8.25H14.9451H16.0549H16.0549Z"></path><path d="M6.75 14.8569C6.74991 13.5627 6.74983 12.3758 6.8799 11.4084C7.0232 10.3425 7.36034 9.21504 8.28769 8.28769C9.21504 7.36034 10.3425 7.0232 11.4084 6.8799C12.3758 6.74983 13.5627 6.74991 14.8569 6.75L17.0931 6.75C17.3891 6.75 17.5371 6.75 17.6261 6.65419C17.7151 6.55838 17.7045 6.4142 17.6833 6.12584C17.6648 5.87546 17.6412 5.63892 17.6111 5.41544C17.4818 4.45589 17.2232 3.6585 16.6718 2.98663C16.4744 2.74612 16.2539 2.52558 16.0134 2.3282C15.3044 1.74638 14.4557 1.49055 13.4248 1.36868C12.4205 1.24998 11.1512 1.24999 9.54893 1.25H9.45109C7.84883 1.24999 6.57947 1.24998 5.57525 1.36868C4.54428 1.49054 3.69558 1.74638 2.98663 2.3282C2.74612 2.52558 2.52558 2.74612 2.3282 2.98663C1.74638 3.69558 1.49055 4.54428 1.36868 5.57525C1.24998 6.57947 1.24999 7.84882 1.25 9.45108V9.54891C1.24999 11.1512 1.24998 12.4205 1.36868 13.4247C1.49054 14.4557 1.74638 15.3044 2.3282 16.0134C2.52558 16.2539 2.74612 16.4744 2.98663 16.6718C3.6585 17.2232 4.45589 17.4818 5.41544 17.6111C5.63892 17.6412 5.87546 17.6648 6.12584 17.6833C6.4142 17.7045 6.55838 17.7151 6.65419 17.6261C6.75 17.5371 6.75 17.3891 6.75 17.0931V14.8569Z">`);
10182
+ IconCopy = (props) => {
10183
+ const size = () => props.size ?? 14;
10184
+ return (() => {
10185
+ var _el$ = _tmpl$36();
10186
+ createRenderEffect((_p$) => {
10187
+ var _v$ = size(), _v$2 = size(), _v$3 = props.class;
10188
+ _v$ !== _p$.e && setAttribute(_el$, "width", _p$.e = _v$);
10189
+ _v$2 !== _p$.t && setAttribute(_el$, "height", _p$.t = _v$2);
10190
+ _v$3 !== _p$.a && setAttribute(_el$, "class", _p$.a = _v$3);
10191
+ return _p$;
10192
+ }, {
10193
+ e: void 0,
10194
+ t: void 0,
10195
+ a: void 0
10196
+ });
10197
+ return _el$;
10198
+ })();
10199
+ };
10200
+ }
10201
+ });
10202
+
10203
+ // src/components/history-dropdown.tsx
10204
+ var _tmpl$37, _tmpl$211, _tmpl$38, _tmpl$45, DEFAULT_OFFSCREEN_POSITION2, ITEM_ACTION_CLASS, EDGE_TO_TRANSFORM_ORIGIN, formatRelativeTime, HistoryDropdown;
10205
+ var init_history_dropdown = __esm({
10206
+ "src/components/history-dropdown.tsx"() {
10207
+ "use strict";
10208
+ init_web();
10209
+ init_web();
10210
+ init_web();
10211
+ init_web();
10212
+ init_web();
10213
+ init_web();
10214
+ init_web();
10215
+ init_web();
10216
+ init_web();
10217
+ init_solid();
10218
+ init_constants();
10219
+ init_clamp_to_viewport();
10220
+ init_cn();
10221
+ init_icon_trash();
10222
+ init_icon_copy();
10223
+ init_icon_check();
10224
+ init_tooltip();
10225
+ _tmpl$37 = /* @__PURE__ */ template(`<div class="flex items-center gap-[5px]"><div class=relative><button data-react-grab-ignore-events data-react-grab-history-clear class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-[#FEF2F2] cursor-pointer transition-all hover:bg-[#FEE2E2] press-scale h-[17px] text-[#B91C1C]"></button></div><div class=relative><button data-react-grab-ignore-events data-react-grab-history-copy-all class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] press-scale h-[17px] text-black/60">`);
10226
+ _tmpl$211 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-history-dropdown class="fixed font-sans text-[13px] antialiased filter-[drop-shadow(0px_1px_2px_#51515140)] select-none transition-[opacity,transform] duration-100 ease-out will-change-[opacity,transform]"style=z-index:2147483647><div><div class="contain-layout shrink-0 flex items-center justify-between px-2 pt-1.5 pb-1"><span class="text-[11px] font-medium text-black/40">History</span></div><div class="min-h-0 [border-top-width:0.5px] border-t-solid border-t-[#D9D9D9] px-2 py-1.5"><div class="flex flex-col max-h-[240px] overflow-y-auto -mx-2 -my-1.5"style="scrollbar-color:rgba(0,0,0,0.15) transparent">`);
10227
+ _tmpl$38 = /* @__PURE__ */ template(`<span class="text-[11px] leading-3 font-sans text-black/40 truncate mt-0.5">`);
10228
+ _tmpl$45 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-history-item class="group contain-layout flex items-start justify-between w-full px-2 py-1 cursor-pointer hover:bg-black/5 focus-within:bg-black/5 text-left gap-2"tabindex=0><span class="flex flex-col min-w-0 flex-1"><span class="text-[12px] leading-4 font-sans font-medium text-black truncate"></span></span><span class="shrink-0 grid"><span class="text-[10px] font-sans text-black/25 group-hover:invisible group-focus-within:invisible [grid-area:1/1] flex items-center justify-end"></span><span class="invisible group-hover:visible group-focus-within:visible [grid-area:1/1] flex items-center justify-end gap-1.5"><button data-react-grab-ignore-events data-react-grab-history-item-remove></button><button data-react-grab-ignore-events data-react-grab-history-item-copy>`);
10229
+ DEFAULT_OFFSCREEN_POSITION2 = {
10230
+ left: -9999,
10231
+ top: -9999
10232
+ };
10233
+ ITEM_ACTION_CLASS = "flex items-center justify-center cursor-pointer text-black/25 transition-colors press-scale";
10234
+ EDGE_TO_TRANSFORM_ORIGIN = {
10235
+ left: "left center",
10236
+ right: "right center",
10237
+ top: "center top",
10238
+ bottom: "center bottom"
10239
+ };
10240
+ formatRelativeTime = (timestamp) => {
10241
+ const elapsedSeconds = Math.floor((Date.now() - timestamp) / 1e3);
10242
+ if (elapsedSeconds < 60) return "now";
10243
+ const elapsedMinutes = Math.floor(elapsedSeconds / 60);
10244
+ if (elapsedMinutes < 60) return `${elapsedMinutes}m`;
10245
+ const elapsedHours = Math.floor(elapsedMinutes / 60);
10246
+ if (elapsedHours < 24) return `${elapsedHours}h`;
10247
+ return `${Math.floor(elapsedHours / 24)}d`;
10248
+ };
10249
+ HistoryDropdown = (props) => {
10250
+ let containerRef;
10251
+ const [measuredWidth, setMeasuredWidth] = createSignal(0);
10252
+ const [measuredHeight, setMeasuredHeight] = createSignal(0);
10253
+ const [activeHeaderTooltip, setActiveHeaderTooltip] = createSignal(null);
10254
+ const [isCopyAllConfirmed, setIsCopyAllConfirmed] = createSignal(false);
10255
+ const [confirmedCopyItemId, setConfirmedCopyItemId] = createSignal(null);
10256
+ let copyAllFeedbackTimeout;
10257
+ let copyItemFeedbackTimeout;
10258
+ let exitAnimationTimeout;
10259
+ let enterAnimationFrameId;
10260
+ const isVisible = () => props.position !== null;
10261
+ const [shouldMount, setShouldMount] = createSignal(false);
10262
+ const [isAnimatedIn, setIsAnimatedIn] = createSignal(false);
10263
+ const [lastAnchorEdge, setLastAnchorEdge] = createSignal("bottom");
10264
+ const measureContainer = () => {
10265
+ if (containerRef) {
10266
+ setMeasuredWidth(containerRef.offsetWidth);
10267
+ setMeasuredHeight(containerRef.offsetHeight);
10268
+ }
10269
+ };
10270
+ createEffect(() => {
10271
+ if (isVisible()) {
10272
+ if (props.position) setLastAnchorEdge(props.position.edge);
10273
+ clearTimeout(exitAnimationTimeout);
10274
+ setShouldMount(true);
10275
+ if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
10276
+ enterAnimationFrameId = requestAnimationFrame(() => {
10277
+ measureContainer();
10278
+ void containerRef?.offsetHeight;
10279
+ setIsAnimatedIn(true);
10280
+ });
10281
+ } else {
10282
+ if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
10283
+ setIsAnimatedIn(false);
10284
+ exitAnimationTimeout = setTimeout(() => {
10285
+ setShouldMount(false);
10286
+ }, DROPDOWN_ANIMATION_DURATION_MS);
10287
+ }
10288
+ });
10289
+ createEffect(on(isAnimatedIn, (animatedIn) => {
10290
+ if (animatedIn && containerRef?.matches(":hover")) {
10291
+ props.onDropdownHover?.(true);
10292
+ }
10293
+ }, {
10294
+ defer: true
10295
+ }));
10296
+ const computedPosition = () => {
10297
+ const anchor = props.position;
10298
+ const width = measuredWidth();
10299
+ const height = measuredHeight();
10300
+ if (!anchor || width === 0 || height === 0) {
10301
+ return DEFAULT_OFFSCREEN_POSITION2;
10302
+ }
10303
+ const {
10304
+ edge
10305
+ } = anchor;
10306
+ let rawLeft;
10307
+ let rawTop;
10308
+ if (edge === "left" || edge === "right") {
10309
+ rawLeft = edge === "left" ? anchor.x + DROPDOWN_ANCHOR_GAP_PX : anchor.x - width - DROPDOWN_ANCHOR_GAP_PX;
10310
+ rawTop = anchor.y - height / 2;
10311
+ } else {
10312
+ rawLeft = anchor.x - width / 2;
10313
+ rawTop = edge === "top" ? anchor.y + DROPDOWN_ANCHOR_GAP_PX : anchor.y - height - DROPDOWN_ANCHOR_GAP_PX;
10314
+ }
10315
+ return {
10316
+ left: clampToViewport(rawLeft, width, window.innerWidth, DROPDOWN_VIEWPORT_PADDING_PX),
10317
+ top: clampToViewport(rawTop, height, window.innerHeight, DROPDOWN_VIEWPORT_PADDING_PX)
10318
+ };
10319
+ };
10320
+ const displayPosition = createMemo((previousPosition) => {
10321
+ const position = computedPosition();
10322
+ if (position.left !== DEFAULT_OFFSCREEN_POSITION2.left) {
10323
+ return position;
10324
+ }
10325
+ return previousPosition;
10326
+ }, DEFAULT_OFFSCREEN_POSITION2);
10327
+ const clampedMaxWidth = () => Math.min(DROPDOWN_MAX_WIDTH_PX, window.innerWidth - displayPosition().left - DROPDOWN_VIEWPORT_PADDING_PX);
10328
+ const clampedMaxHeight = () => window.innerHeight - displayPosition().top - DROPDOWN_VIEWPORT_PADDING_PX;
10329
+ const panelMinWidth = () => Math.max(DROPDOWN_MIN_WIDTH_PX, props.position?.toolbarWidth ?? 0);
10330
+ const handleMenuEvent = (event) => {
10331
+ if (event.type === "contextmenu") {
10332
+ event.preventDefault();
10333
+ }
10334
+ event.stopImmediatePropagation();
10335
+ };
10336
+ onMount(() => {
10337
+ measureContainer();
10338
+ const handleKeyDown = (event) => {
10339
+ if (!isVisible()) return;
10340
+ if (event.code === "Escape") {
10341
+ event.preventDefault();
10342
+ event.stopPropagation();
10343
+ props.onDismiss?.();
10344
+ }
10345
+ };
10346
+ window.addEventListener("keydown", handleKeyDown, {
10347
+ capture: true
10348
+ });
10349
+ onCleanup(() => {
10350
+ clearTimeout(copyAllFeedbackTimeout);
10351
+ clearTimeout(copyItemFeedbackTimeout);
10352
+ clearTimeout(exitAnimationTimeout);
10353
+ if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
10354
+ window.removeEventListener("keydown", handleKeyDown, {
10355
+ capture: true
10356
+ });
10357
+ });
10358
+ });
10359
+ return createComponent(Show, {
10360
+ get when() {
10361
+ return shouldMount();
10362
+ },
10363
+ get children() {
10364
+ var _el$ = _tmpl$211(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$0 = _el$3.nextSibling, _el$1 = _el$0.firstChild;
10365
+ _el$.addEventListener("mouseleave", () => props.onDropdownHover?.(false));
10366
+ _el$.addEventListener("mouseenter", () => props.onDropdownHover?.(true));
10367
+ _el$.$$contextmenu = handleMenuEvent;
10368
+ _el$.$$click = handleMenuEvent;
10369
+ _el$.$$mousedown = handleMenuEvent;
10370
+ _el$.$$pointerdown = handleMenuEvent;
10371
+ var _ref$ = containerRef;
10372
+ typeof _ref$ === "function" ? use(_ref$, _el$) : containerRef = _el$;
10373
+ insert(_el$3, createComponent(Show, {
10374
+ get when() {
10375
+ return props.items.length > 0;
10376
+ },
10377
+ get children() {
10378
+ var _el$5 = _tmpl$37(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$6.nextSibling, _el$9 = _el$8.firstChild;
10379
+ _el$7.addEventListener("mouseleave", () => setActiveHeaderTooltip(null));
10380
+ _el$7.addEventListener("mouseenter", () => setActiveHeaderTooltip("clear"));
10381
+ _el$7.$$click = (event) => {
10382
+ event.stopPropagation();
10383
+ setActiveHeaderTooltip(null);
10384
+ props.onClearAll?.();
10385
+ };
10386
+ insert(_el$7, createComponent(IconTrash, {
10387
+ size: DROPDOWN_ICON_SIZE_PX
10388
+ }));
10389
+ insert(_el$6, createComponent(Tooltip, {
10390
+ get visible() {
10391
+ return activeHeaderTooltip() === "clear";
10392
+ },
10393
+ position: "top",
10394
+ children: "Clear all"
10395
+ }), null);
10396
+ _el$9.addEventListener("mouseleave", () => {
10397
+ setActiveHeaderTooltip(null);
10398
+ props.onCopyAllHover?.(false);
10399
+ });
10400
+ _el$9.addEventListener("mouseenter", () => {
10401
+ setActiveHeaderTooltip("copy");
10402
+ if (!isCopyAllConfirmed()) {
10403
+ props.onCopyAllHover?.(true);
10404
+ }
10405
+ });
10406
+ _el$9.$$click = (event) => {
10407
+ event.stopPropagation();
10408
+ setActiveHeaderTooltip(null);
10409
+ props.onCopyAll?.();
10410
+ setIsCopyAllConfirmed(true);
10411
+ clearTimeout(copyAllFeedbackTimeout);
10412
+ copyAllFeedbackTimeout = setTimeout(() => {
10413
+ setIsCopyAllConfirmed(false);
10414
+ }, FEEDBACK_DURATION_MS);
10415
+ };
10416
+ insert(_el$9, createComponent(Show, {
10417
+ get when() {
10418
+ return isCopyAllConfirmed();
10419
+ },
10420
+ get fallback() {
10421
+ return createComponent(IconCopy, {
10422
+ size: DROPDOWN_ICON_SIZE_PX
10423
+ });
10424
+ },
10425
+ get children() {
10426
+ return createComponent(IconCheck, {
10427
+ size: DROPDOWN_ICON_SIZE_PX,
10428
+ "class": "text-black"
10429
+ });
10430
+ }
10431
+ }));
10432
+ insert(_el$8, createComponent(Tooltip, {
10433
+ get visible() {
10434
+ return activeHeaderTooltip() === "copy";
10435
+ },
10436
+ position: "top",
10437
+ children: "Copy all"
10438
+ }), null);
10439
+ return _el$5;
10440
+ }
10441
+ }), null);
10442
+ insert(_el$1, createComponent(For, {
10443
+ get each() {
10444
+ return props.items;
10445
+ },
10446
+ children: (item) => (() => {
10447
+ var _el$10 = _tmpl$45(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$14 = _el$11.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling;
10448
+ _el$10.addEventListener("mouseleave", () => props.onItemHover?.(null));
10449
+ _el$10.addEventListener("mouseenter", () => props.onItemHover?.(item.id));
10450
+ _el$10.$$keydown = (event) => {
10451
+ if (event.code === "Space" && event.currentTarget === event.target) {
10452
+ event.preventDefault();
10453
+ event.stopPropagation();
10454
+ props.onSelectItem?.(item);
10455
+ }
10456
+ };
10457
+ _el$10.$$click = (event) => {
10458
+ event.stopPropagation();
10459
+ props.onSelectItem?.(item);
10460
+ setConfirmedCopyItemId(item.id);
10461
+ clearTimeout(copyItemFeedbackTimeout);
10462
+ copyItemFeedbackTimeout = setTimeout(() => {
10463
+ setConfirmedCopyItemId(null);
10464
+ }, FEEDBACK_DURATION_MS);
10465
+ };
10466
+ _el$10.$$pointerdown = (event) => event.stopPropagation();
10467
+ insert(_el$12, () => item.componentName ?? item.tagName);
10468
+ insert(_el$11, createComponent(Show, {
10469
+ get when() {
10470
+ return item.commentText;
10471
+ },
10472
+ get children() {
10473
+ var _el$13 = _tmpl$38();
10474
+ insert(_el$13, () => item.commentText);
10475
+ return _el$13;
10476
+ }
10477
+ }), null);
10478
+ insert(_el$15, () => formatRelativeTime(item.timestamp));
10479
+ _el$17.$$click = (event) => {
10480
+ event.stopPropagation();
10481
+ props.onRemoveItem?.(item);
10482
+ };
10483
+ insert(_el$17, createComponent(IconTrash, {
10484
+ size: DROPDOWN_ICON_SIZE_PX
10485
+ }));
10486
+ _el$18.$$click = (event) => {
10487
+ event.stopPropagation();
10488
+ props.onCopyItem?.(item);
10489
+ setConfirmedCopyItemId(item.id);
10490
+ clearTimeout(copyItemFeedbackTimeout);
10491
+ copyItemFeedbackTimeout = setTimeout(() => {
10492
+ setConfirmedCopyItemId(null);
10493
+ }, FEEDBACK_DURATION_MS);
10494
+ };
10495
+ insert(_el$18, createComponent(Show, {
10496
+ get when() {
10497
+ return confirmedCopyItemId() === item.id;
10498
+ },
10499
+ get fallback() {
10500
+ return createComponent(IconCopy, {
10501
+ size: DROPDOWN_ICON_SIZE_PX
10502
+ });
10503
+ },
10504
+ get children() {
10505
+ return createComponent(IconCheck, {
10506
+ size: DROPDOWN_ICON_SIZE_PX,
10507
+ "class": "text-black"
10508
+ });
10509
+ }
10510
+ }));
10511
+ createRenderEffect((_p$) => {
10512
+ var _v$1 = {
10513
+ "opacity-40 hover:opacity-100": Boolean(props.disconnectedItemIds?.has(item.id))
10514
+ }, _v$10 = cn(ITEM_ACTION_CLASS, "hover:text-[#B91C1C]"), _v$11 = cn(ITEM_ACTION_CLASS, "hover:text-black/60");
10515
+ _p$.e = classList(_el$10, _v$1, _p$.e);
10516
+ _v$10 !== _p$.t && className(_el$17, _p$.t = _v$10);
10517
+ _v$11 !== _p$.a && className(_el$18, _p$.a = _v$11);
10518
+ return _p$;
10519
+ }, {
10520
+ e: void 0,
10521
+ t: void 0,
10522
+ a: void 0
10523
+ });
10524
+ return _el$10;
10525
+ })()
10526
+ }));
10527
+ createRenderEffect((_p$) => {
10528
+ var _v$ = `${displayPosition().top}px`, _v$2 = `${displayPosition().left}px`, _v$3 = isAnimatedIn() ? "auto" : "none", _v$4 = EDGE_TO_TRANSFORM_ORIGIN[lastAnchorEdge()], _v$5 = isAnimatedIn() ? "1" : "0", _v$6 = isAnimatedIn() ? "scale(1)" : "scale(0.95)", _v$7 = cn("contain-layout flex flex-col rounded-[10px] antialiased w-fit h-fit overflow-hidden [font-synthesis:none] [corner-shape:superellipse(1.25)]", PANEL_STYLES), _v$8 = `${panelMinWidth()}px`, _v$9 = `${clampedMaxWidth()}px`, _v$0 = `${clampedMaxHeight()}px`;
10529
+ _v$ !== _p$.e && setStyleProperty(_el$, "top", _p$.e = _v$);
10530
+ _v$2 !== _p$.t && setStyleProperty(_el$, "left", _p$.t = _v$2);
10531
+ _v$3 !== _p$.a && setStyleProperty(_el$, "pointer-events", _p$.a = _v$3);
10532
+ _v$4 !== _p$.o && setStyleProperty(_el$, "transform-origin", _p$.o = _v$4);
10533
+ _v$5 !== _p$.i && setStyleProperty(_el$, "opacity", _p$.i = _v$5);
10534
+ _v$6 !== _p$.n && setStyleProperty(_el$, "transform", _p$.n = _v$6);
10535
+ _v$7 !== _p$.s && className(_el$2, _p$.s = _v$7);
10536
+ _v$8 !== _p$.h && setStyleProperty(_el$2, "min-width", _p$.h = _v$8);
10537
+ _v$9 !== _p$.r && setStyleProperty(_el$2, "max-width", _p$.r = _v$9);
10538
+ _v$0 !== _p$.d && setStyleProperty(_el$2, "max-height", _p$.d = _v$0);
10539
+ return _p$;
10540
+ }, {
10541
+ e: void 0,
10542
+ t: void 0,
10543
+ a: void 0,
10544
+ o: void 0,
10545
+ i: void 0,
10546
+ n: void 0,
10547
+ s: void 0,
10548
+ h: void 0,
10549
+ r: void 0,
10550
+ d: void 0
10551
+ });
10552
+ return _el$;
10553
+ }
10554
+ });
10555
+ };
10556
+ delegateEvents(["pointerdown", "mousedown", "click", "contextmenu", "keydown"]);
10557
+ }
10558
+ });
10559
+
10560
+ // src/components/renderer.tsx
10561
+ var _tmpl$39, ReactGrabRenderer;
10562
+ var init_renderer = __esm({
10563
+ "src/components/renderer.tsx"() {
9665
10564
  "use strict";
9666
10565
  init_web();
9667
10566
  init_web();
@@ -9675,7 +10574,8 @@ var init_renderer = __esm({
9675
10574
  init_selection_label();
9676
10575
  init_toolbar();
9677
10576
  init_context_menu();
9678
- _tmpl$30 = /* @__PURE__ */ template(`<div style="position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;transition:opacity 100ms ease-out;will-change:opacity;contain:strict;transform:translateZ(0)">`);
10577
+ init_history_dropdown();
10578
+ _tmpl$39 = /* @__PURE__ */ template(`<div style="position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;transition:opacity 100ms ease-out;will-change:opacity;contain:strict;transform:translateZ(0)">`);
9679
10579
  ReactGrabRenderer = (props) => {
9680
10580
  return [createComponent(OverlayCanvas, {
9681
10581
  get crosshairVisible() {
@@ -9718,7 +10618,7 @@ var init_renderer = __esm({
9718
10618
  return props.labelInstances;
9719
10619
  }
9720
10620
  }), (() => {
9721
- var _el$ = _tmpl$30();
10621
+ var _el$ = _tmpl$39();
9722
10622
  setStyleProperty(_el$, "z-index", Z_INDEX_OVERLAY_CANVAS);
9723
10623
  setStyleProperty(_el$, "box-shadow", `inset 0 0 ${FROZEN_GLOW_EDGE_PX}px ${FROZEN_GLOW_COLOR}`);
9724
10624
  createRenderEffect((_$p) => setStyleProperty(_el$, "opacity", props.isFrozen ? 1 : 0));
@@ -9899,9 +10799,24 @@ var init_renderer = __esm({
9899
10799
  get status() {
9900
10800
  return instance().status;
9901
10801
  },
10802
+ get statusText() {
10803
+ return instance().statusText;
10804
+ },
10805
+ get hasAgent() {
10806
+ return Boolean(instance().statusText);
10807
+ },
10808
+ get isPromptMode() {
10809
+ return instance().isPromptMode;
10810
+ },
10811
+ get inputValue() {
10812
+ return instance().inputValue;
10813
+ },
9902
10814
  get error() {
9903
10815
  return instance().errorMessage;
9904
10816
  },
10817
+ get hideArrow() {
10818
+ return instance().hideArrow;
10819
+ },
9905
10820
  get onShowContextMenu() {
9906
10821
  return (instance().status === "copied" || instance().status === "fading") && instance().element && (document.body ?? document.documentElement).contains(instance().element) ? () => props.onShowContextMenuInstance?.(instance().id) : void 0;
9907
10822
  },
@@ -9945,6 +10860,27 @@ var init_renderer = __esm({
9945
10860
  },
9946
10861
  get onSelectHoverChange() {
9947
10862
  return props.onToolbarSelectHoverChange;
10863
+ },
10864
+ get onContainerRef() {
10865
+ return props.onToolbarRef;
10866
+ },
10867
+ get historyItemCount() {
10868
+ return props.historyItemCount;
10869
+ },
10870
+ get hasUnreadHistoryItems() {
10871
+ return props.hasUnreadHistoryItems;
10872
+ },
10873
+ get onToggleHistory() {
10874
+ return props.onToggleHistory;
10875
+ },
10876
+ get onHistoryButtonHover() {
10877
+ return props.onHistoryButtonHover;
10878
+ },
10879
+ get isHistoryDropdownOpen() {
10880
+ return Boolean(props.historyDropdownPosition);
10881
+ },
10882
+ get isHistoryPinned() {
10883
+ return props.isHistoryPinned;
9948
10884
  }
9949
10885
  });
9950
10886
  }
@@ -9978,6 +10914,43 @@ var init_renderer = __esm({
9978
10914
  return props.onContextMenuHide ?? (() => {
9979
10915
  });
9980
10916
  }
10917
+ }), createComponent(HistoryDropdown, {
10918
+ get position() {
10919
+ return props.historyDropdownPosition ?? null;
10920
+ },
10921
+ get items() {
10922
+ return props.historyItems ?? [];
10923
+ },
10924
+ get disconnectedItemIds() {
10925
+ return props.historyDisconnectedItemIds;
10926
+ },
10927
+ get onSelectItem() {
10928
+ return props.onHistoryItemSelect;
10929
+ },
10930
+ get onRemoveItem() {
10931
+ return props.onHistoryItemRemove;
10932
+ },
10933
+ get onCopyItem() {
10934
+ return props.onHistoryItemCopy;
10935
+ },
10936
+ get onItemHover() {
10937
+ return props.onHistoryItemHover;
10938
+ },
10939
+ get onCopyAll() {
10940
+ return props.onHistoryCopyAll;
10941
+ },
10942
+ get onCopyAllHover() {
10943
+ return props.onHistoryCopyAllHover;
10944
+ },
10945
+ get onClearAll() {
10946
+ return props.onHistoryClear;
10947
+ },
10948
+ get onDismiss() {
10949
+ return props.onHistoryDismiss;
10950
+ },
10951
+ get onDropdownHover() {
10952
+ return props.onHistoryDropdownHover;
10953
+ }
9981
10954
  })];
9982
10955
  };
9983
10956
  }
@@ -10668,8 +11641,17 @@ var init_is_capitalized = __esm({
10668
11641
  }
10669
11642
  });
10670
11643
 
11644
+ // src/utils/truncate-string.ts
11645
+ var truncateString;
11646
+ var init_truncate_string = __esm({
11647
+ "src/utils/truncate-string.ts"() {
11648
+ "use strict";
11649
+ truncateString = (text, maxLength) => text.length > maxLength ? `${text.slice(0, maxLength)}...` : text;
11650
+ }
11651
+ });
11652
+
10671
11653
  // src/core/context.ts
10672
- var NEXT_INTERNAL_COMPONENT_NAMES, REACT_INTERNAL_COMPONENT_NAMES, checkIsNextProject, checkIsInternalComponentName, checkIsSourceComponentName, stackCache, fetchStackForElement, getStack, getNearestComponentName, isUsefulComponentName, getComponentDisplayName, hasSourceFiles, getComponentNamesFromFiber, getElementContext, getFallbackContext, truncateAttrValue, formatPriorityAttrs, getHTMLPreview;
11654
+ var NEXT_INTERNAL_COMPONENT_NAMES, REACT_INTERNAL_COMPONENT_NAMES, checkIsNextProject, checkIsInternalComponentName, checkIsSourceComponentName, stackCache, fetchStackForElement, getStack, getNearestComponentName, resolveSourceFromStack, isUsefulComponentName, getComponentDisplayName, hasSourceFiles, getComponentNamesFromFiber, getElementContext, getFallbackContext, truncateAttrValue, formatPriorityAttrs, getHTMLPreview;
10673
11655
  var init_context = __esm({
10674
11656
  "src/core/context.ts"() {
10675
11657
  "use strict";
@@ -10678,6 +11660,7 @@ var init_context = __esm({
10678
11660
  init_dist();
10679
11661
  init_constants();
10680
11662
  init_get_tag_name();
11663
+ init_truncate_string();
10681
11664
  NEXT_INTERNAL_COMPONENT_NAMES = /* @__PURE__ */ new Set([
10682
11665
  "InnerLayoutRouter",
10683
11666
  "RedirectErrorBoundary",
@@ -10761,6 +11744,19 @@ var init_context = __esm({
10761
11744
  }
10762
11745
  return null;
10763
11746
  };
11747
+ resolveSourceFromStack = (stack) => {
11748
+ if (!stack || stack.length === 0) return null;
11749
+ for (const frame of stack) {
11750
+ if (frame.fileName && Pe2(frame.fileName)) {
11751
+ return {
11752
+ filePath: Ne2(frame.fileName),
11753
+ lineNumber: frame.lineNumber,
11754
+ componentName: frame.functionName && checkIsSourceComponentName(frame.functionName) ? frame.functionName : null
11755
+ };
11756
+ }
11757
+ }
11758
+ return null;
11759
+ };
10764
11760
  isUsefulComponentName = (name) => {
10765
11761
  if (!name) return false;
10766
11762
  if (checkIsInternalComponentName(name)) return false;
@@ -10869,7 +11865,7 @@ var init_context = __esm({
10869
11865
  for (const { name, value } of element.attributes) {
10870
11866
  attrsText += ` ${name}="${value}"`;
10871
11867
  }
10872
- const truncatedText = text.length > 100 ? `${text.slice(0, 100)}...` : text;
11868
+ const truncatedText = truncateString(text, PREVIEW_TEXT_MAX_LENGTH);
10873
11869
  if (truncatedText.length > 0) {
10874
11870
  return `<${tagName}${attrsText}>
10875
11871
  ${truncatedText}
@@ -10877,7 +11873,7 @@ var init_context = __esm({
10877
11873
  }
10878
11874
  return `<${tagName}${attrsText} />`;
10879
11875
  };
10880
- truncateAttrValue = (value) => value.length > PREVIEW_ATTR_VALUE_MAX_LENGTH ? `${value.slice(0, PREVIEW_ATTR_VALUE_MAX_LENGTH)}...` : value;
11876
+ truncateAttrValue = (value) => truncateString(value, PREVIEW_ATTR_VALUE_MAX_LENGTH);
10881
11877
  formatPriorityAttrs = (element, options = {}) => {
10882
11878
  const { truncate = true, maxAttrs = PREVIEW_MAX_ATTRS } = options;
10883
11879
  const priorityAttrs = [];
@@ -10923,7 +11919,7 @@ var init_context = __esm({
10923
11919
  const formatElements = (elements) => {
10924
11920
  if (elements.length === 0) return "";
10925
11921
  if (elements.length <= 2) {
10926
- return elements.map((el) => `<${getTagName(el)} ...>`).join("\n ");
11922
+ return elements.map((childElement) => `<${getTagName(childElement)} ...>`).join("\n ");
10927
11923
  }
10928
11924
  return `(${elements.length} elements)`;
10929
11925
  };
@@ -10932,9 +11928,8 @@ var init_context = __esm({
10932
11928
  if (topElementsStr) content += `
10933
11929
  ${topElementsStr}`;
10934
11930
  if (text.length > 0) {
10935
- const truncatedText = text.length > 100 ? `${text.slice(0, 100)}...` : text;
10936
11931
  content += `
10937
- ${truncatedText}`;
11932
+ ${truncateString(text, PREVIEW_TEXT_MAX_LENGTH)}`;
10938
11933
  }
10939
11934
  const bottomElementsStr = formatElements(bottomElements);
10940
11935
  if (bottomElementsStr) content += `
@@ -10966,6 +11961,7 @@ var init_noop_api = __esm({
10966
11961
  targetElement: null,
10967
11962
  dragBounds: null,
10968
11963
  grabbedBoxes: [],
11964
+ labelInstances: [],
10969
11965
  selectionFilePath: null,
10970
11966
  toolbarState: null
10971
11967
  };
@@ -11034,20 +12030,18 @@ var init_events = __esm({
11034
12030
  });
11035
12031
 
11036
12032
  // src/utils/copy-content.ts
11037
- var LEXICAL_EDITOR_MIME_TYPE, REACT_GRAB_MIME_TYPE, generateUuid, createMentionNode, createTextNode, createLexicalClipboardData, copyContent;
12033
+ var LEXICAL_EDITOR_MIME_TYPE, REACT_GRAB_MIME_TYPE, generateUuid, createMentionNode, createTextNode, escapeHtml, createClipboardData, copyContent;
11038
12034
  var init_copy_content = __esm({
11039
12035
  "src/utils/copy-content.ts"() {
11040
12036
  "use strict";
11041
12037
  init_constants();
11042
12038
  LEXICAL_EDITOR_MIME_TYPE = "application/x-lexical-editor";
11043
12039
  REACT_GRAB_MIME_TYPE = "application/x-react-grab";
11044
- generateUuid = () => {
11045
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (char) => {
11046
- const random = Math.random() * 16 | 0;
11047
- const value = char === "x" ? random : random & 3 | 8;
11048
- return value.toString(16);
11049
- });
11050
- };
12040
+ generateUuid = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (character) => {
12041
+ const randomNibble = Math.random() * 16 | 0;
12042
+ const hexValue = character === "x" ? randomNibble : randomNibble & 3 | 8;
12043
+ return hexValue.toString(16);
12044
+ });
11051
12045
  createMentionNode = (displayName, mentionKey, typeaheadType, metadata) => ({
11052
12046
  detail: 1,
11053
12047
  format: 0,
@@ -11071,7 +12065,8 @@ var init_copy_content = __esm({
11071
12065
  type: "text",
11072
12066
  version: 1
11073
12067
  });
11074
- createLexicalClipboardData = (content, elementName) => {
12068
+ escapeHtml = (text) => text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
12069
+ createClipboardData = (content, elementName) => {
11075
12070
  const mentionKey = String(Math.floor(Math.random() * 1e4));
11076
12071
  const namespaceUuid = generateUuid();
11077
12072
  const displayName = `<${elementName}>`;
@@ -11094,16 +12089,12 @@ var init_copy_content = __esm({
11094
12089
  selection: { type: 0 },
11095
12090
  selectedOption
11096
12091
  };
11097
- const escapedMentionMetadata = JSON.stringify(mentionMetadata).replace(
11098
- /"/g,
11099
- "&quot;"
11100
- );
11101
12092
  return {
11102
12093
  plainText: `@${displayName}
11103
12094
 
11104
12095
  ${content}
11105
12096
  `,
11106
- htmlContent: `<meta charset='utf-8'><span data-mention-key="${mentionKey}" data-lexical-mention="true" data-mention-name="${displayName}" data-typeahead-type="[object Object]" data-mention-metadata="${escapedMentionMetadata}">@${displayName}</span><pre><code>${content}</code></pre>`,
12097
+ htmlContent: `<meta charset='utf-8'><pre><code>${escapeHtml(content)}</code></pre>`,
11107
12098
  lexicalData: JSON.stringify({
11108
12099
  namespace: `chat-input${namespaceUuid}-pane`,
11109
12100
  nodes: [
@@ -11121,14 +12112,23 @@ ${content}`)
11121
12112
  };
11122
12113
  };
11123
12114
  copyContent = (content, options) => {
11124
- const elementName = options?.name ?? "div";
11125
- const { plainText, htmlContent, lexicalData } = createLexicalClipboardData(
12115
+ const elementName = options?.componentName ?? "div";
12116
+ const { plainText, htmlContent, lexicalData } = createClipboardData(
11126
12117
  content,
11127
12118
  elementName
11128
12119
  );
12120
+ const entries = options?.entries ?? [
12121
+ {
12122
+ tagName: options?.tagName,
12123
+ componentName: elementName,
12124
+ content,
12125
+ commentText: options?.commentText
12126
+ }
12127
+ ];
11129
12128
  const reactGrabMetadata = {
11130
12129
  version: VERSION,
11131
12130
  content,
12131
+ entries,
11132
12132
  timestamp: Date.now()
11133
12133
  };
11134
12134
  const copyHandler = (event) => {
@@ -11181,6 +12181,19 @@ var init_generate_snippet = __esm({
11181
12181
  }
11182
12182
  });
11183
12183
 
12184
+ // src/utils/join-snippets.ts
12185
+ var joinSnippets;
12186
+ var init_join_snippets = __esm({
12187
+ "src/utils/join-snippets.ts"() {
12188
+ "use strict";
12189
+ joinSnippets = (snippets) => {
12190
+ if (snippets.length <= 1) return snippets[0] ?? "";
12191
+ return snippets.map((snippet, index) => `[${index + 1}]
12192
+ ${snippet}`).join("\n\n");
12193
+ };
12194
+ }
12195
+ });
12196
+
11184
12197
  // src/core/copy.ts
11185
12198
  var tryCopyWithFallback;
11186
12199
  var init_copy = __esm({
@@ -11188,12 +12201,14 @@ var init_copy = __esm({
11188
12201
  "use strict";
11189
12202
  init_copy_content();
11190
12203
  init_generate_snippet();
12204
+ init_join_snippets();
11191
12205
  tryCopyWithFallback = async (options, hooks, elements, extraPrompt) => {
11192
12206
  let didCopy = false;
11193
12207
  let copiedContent = "";
11194
12208
  await hooks.onBeforeCopy(elements);
11195
12209
  try {
11196
12210
  let generatedContent;
12211
+ let entries;
11197
12212
  if (options.getContent) {
11198
12213
  generatedContent = await options.getContent(elements);
11199
12214
  } else {
@@ -11205,7 +12220,14 @@ var init_copy = __esm({
11205
12220
  (snippet, index) => snippet.trim() ? hooks.transformSnippet(snippet, elements[index]) : Promise.resolve("")
11206
12221
  )
11207
12222
  );
11208
- generatedContent = transformedSnippets.filter((s3) => s3.trim()).join("\n\n");
12223
+ const snippetElementPairs = transformedSnippets.map((snippet, index) => ({ snippet, element: elements[index] })).filter(({ snippet }) => snippet.trim());
12224
+ generatedContent = joinSnippets(
12225
+ snippetElementPairs.map(({ snippet }) => snippet)
12226
+ );
12227
+ entries = snippetElementPairs.map(({ snippet, element }) => ({
12228
+ tagName: element.localName,
12229
+ content: snippet
12230
+ }));
11209
12231
  }
11210
12232
  if (generatedContent.trim()) {
11211
12233
  const transformedContent = await hooks.transformCopyContent(
@@ -11215,7 +12237,10 @@ var init_copy = __esm({
11215
12237
  copiedContent = extraPrompt ? `${extraPrompt}
11216
12238
 
11217
12239
  ${transformedContent}` : transformedContent;
11218
- didCopy = copyContent(copiedContent, { name: options.componentName });
12240
+ didCopy = copyContent(copiedContent, {
12241
+ componentName: options.componentName,
12242
+ entries
12243
+ });
11219
12244
  }
11220
12245
  } catch (error) {
11221
12246
  const resolvedError = error instanceof Error ? error : new Error(String(error));
@@ -11815,46 +12840,8 @@ var init_delay = __esm({
11815
12840
  }
11816
12841
  });
11817
12842
 
11818
- // src/utils/create-scroll-cycler.ts
11819
- var createScrollCycler;
11820
- var init_create_scroll_cycler = __esm({
11821
- "src/utils/create-scroll-cycler.ts"() {
11822
- "use strict";
11823
- createScrollCycler = (options) => {
11824
- const { thresholdPx, throttleMs, lineHeightPx, onStep } = options;
11825
- let accumulatedDelta = 0;
11826
- let currentDirection = null;
11827
- let lastStepTimestamp = 0;
11828
- const handleWheel = (event) => {
11829
- const primaryAxisDelta = Math.abs(event.deltaY) >= Math.abs(event.deltaX) ? event.deltaY : event.deltaX;
11830
- if (primaryAxisDelta === 0) return;
11831
- let normalizedDelta = primaryAxisDelta;
11832
- if (event.deltaMode === 1) {
11833
- normalizedDelta *= lineHeightPx;
11834
- } else if (event.deltaMode === 2) {
11835
- normalizedDelta *= window.innerHeight;
11836
- }
11837
- const direction = normalizedDelta > 0 ? 1 : -1;
11838
- if (currentDirection !== direction) {
11839
- currentDirection = direction;
11840
- accumulatedDelta = 0;
11841
- }
11842
- accumulatedDelta += Math.abs(normalizedDelta);
11843
- const now = Date.now();
11844
- if (now - lastStepTimestamp < throttleMs || accumulatedDelta < thresholdPx) {
11845
- return;
11846
- }
11847
- accumulatedDelta -= thresholdPx;
11848
- lastStepTimestamp = now;
11849
- onStep(direction < 0 ? "backward" : "forward");
11850
- };
11851
- return { handleWheel };
11852
- };
11853
- }
11854
- });
11855
-
11856
12843
  // src/core/theme.ts
11857
- var DEFAULT_THEME, mergeThemeWithBase, deepMergeTheme;
12844
+ var DEFAULT_THEME, deepMergeTheme;
11858
12845
  var init_theme = __esm({
11859
12846
  "src/core/theme.ts"() {
11860
12847
  "use strict";
@@ -11880,7 +12867,7 @@ var init_theme = __esm({
11880
12867
  enabled: true
11881
12868
  }
11882
12869
  };
11883
- mergeThemeWithBase = (baseTheme, partialTheme) => ({
12870
+ deepMergeTheme = (baseTheme, partialTheme) => ({
11884
12871
  enabled: partialTheme.enabled ?? baseTheme.enabled,
11885
12872
  hue: partialTheme.hue ?? baseTheme.hue,
11886
12873
  selectionBox: {
@@ -11902,7 +12889,6 @@ var init_theme = __esm({
11902
12889
  enabled: partialTheme.toolbar?.enabled ?? baseTheme.toolbar.enabled
11903
12890
  }
11904
12891
  });
11905
- deepMergeTheme = mergeThemeWithBase;
11906
12892
  }
11907
12893
  });
11908
12894
 
@@ -11966,15 +12952,7 @@ var init_plugin_registry = __esm({
11966
12952
  if (plugins.has(plugin.name)) {
11967
12953
  unregister(plugin.name);
11968
12954
  }
11969
- let config;
11970
- if (plugin.setup) {
11971
- const setupResult = plugin.setup(
11972
- api
11973
- );
11974
- config = setupResult ?? {};
11975
- } else {
11976
- config = {};
11977
- }
12955
+ const config = plugin.setup?.(api) ?? {};
11978
12956
  if (plugin.theme) {
11979
12957
  config.theme = config.theme ? deepMergeTheme(
11980
12958
  deepMergeTheme(DEFAULT_THEME, plugin.theme),
@@ -12096,10 +13074,11 @@ var init_plugin_registry = __esm({
12096
13074
  });
12097
13075
 
12098
13076
  // src/core/agent/session.ts
12099
- var STORAGE_KEY2, generateSessionId, createSession, memorySessions, saveSessions, saveSessionById, loadSessions, clearSessions, clearSessionById, updateSession;
13077
+ var STORAGE_KEY2, generateSessionId, createSession, memorySessions, evictOldestMemorySessions, saveSessions, saveSessionById, loadSessions, clearSessions, clearSessionById, updateSession;
12100
13078
  var init_session = __esm({
12101
13079
  "src/core/agent/session.ts"() {
12102
13080
  "use strict";
13081
+ init_constants();
12103
13082
  STORAGE_KEY2 = "react-grab:agent-sessions";
12104
13083
  generateSessionId = () => `session-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
12105
13084
  createSession = (context, position, selectionBounds, tagName, componentName) => {
@@ -12118,10 +13097,19 @@ var init_session = __esm({
12118
13097
  };
12119
13098
  };
12120
13099
  memorySessions = /* @__PURE__ */ new Map();
13100
+ evictOldestMemorySessions = () => {
13101
+ while (memorySessions.size > MAX_MEMORY_SESSIONS) {
13102
+ const oldestKey = memorySessions.keys().next().value;
13103
+ if (oldestKey !== void 0) {
13104
+ memorySessions.delete(oldestKey);
13105
+ }
13106
+ }
13107
+ };
12121
13108
  saveSessions = (sessions, storage) => {
12122
13109
  if (!storage) {
12123
13110
  memorySessions.clear();
12124
13111
  sessions.forEach((session, id) => memorySessions.set(id, session));
13112
+ evictOldestMemorySessions();
12125
13113
  return;
12126
13114
  }
12127
13115
  try {
@@ -12130,6 +13118,7 @@ var init_session = __esm({
12130
13118
  } catch {
12131
13119
  memorySessions.clear();
12132
13120
  sessions.forEach((session, id) => memorySessions.set(id, session));
13121
+ evictOldestMemorySessions();
12133
13122
  }
12134
13123
  };
12135
13124
  saveSessionById = (session, storage) => {
@@ -12216,12 +13205,14 @@ var init_manager = __esm({
12216
13205
  return agentOptions;
12217
13206
  };
12218
13207
  const isProcessing = () => Array.from(sessions().values()).some((session) => session.isStreaming);
12219
- const executeSessionStream = async (session, streamIterator, activeAgent) => {
13208
+ const executeSessionStream = async (session, streamIterator, abortController, activeAgent) => {
12220
13209
  const effectiveAgent = activeAgent ?? agentOptions;
12221
13210
  const storage = effectiveAgent?.storage;
12222
13211
  let wasAborted = false;
13212
+ const isCurrentExecution = () => abortControllers.get(session.id) === abortController;
12223
13213
  try {
12224
13214
  for await (const status of streamIterator) {
13215
+ if (!isCurrentExecution()) break;
12225
13216
  const currentSessions = sessions();
12226
13217
  const currentSession = currentSessions.get(session.id);
12227
13218
  if (!currentSession) break;
@@ -12233,6 +13224,7 @@ var init_manager = __esm({
12233
13224
  setSessions((prev) => new Map(prev).set(session.id, updatedSession));
12234
13225
  effectiveAgent?.onStatus?.(status, updatedSession);
12235
13226
  }
13227
+ if (!isCurrentExecution()) return;
12236
13228
  const finalSessions = sessions();
12237
13229
  const finalSession = finalSessions.get(session.id);
12238
13230
  if (finalSession) {
@@ -12274,6 +13266,7 @@ var init_manager = __esm({
12274
13266
  }
12275
13267
  }
12276
13268
  } catch (error) {
13269
+ if (!isCurrentExecution()) return;
12277
13270
  const currentSessions = sessions();
12278
13271
  const currentSession = currentSessions.get(session.id);
12279
13272
  if (error instanceof Error && error.name === "AbortError") {
@@ -12300,8 +13293,16 @@ var init_manager = __esm({
12300
13293
  }
12301
13294
  }
12302
13295
  } finally {
13296
+ if (!isCurrentExecution()) {
13297
+ return;
13298
+ }
12303
13299
  abortControllers.delete(session.id);
12304
13300
  if (wasAborted) {
13301
+ const dismissTimeout = dismissTimeouts.get(session.id);
13302
+ if (dismissTimeout) {
13303
+ clearTimeout(dismissTimeout);
13304
+ dismissTimeouts.delete(session.id);
13305
+ }
12305
13306
  sessionMetadata.delete(session.id);
12306
13307
  clearSessionById(session.id, storage);
12307
13308
  setSessions((prev) => {
@@ -12353,6 +13354,11 @@ var init_manager = __esm({
12353
13354
  clearSessions(storage);
12354
13355
  return;
12355
13356
  }
13357
+ dismissTimeouts.forEach((timeoutId) => clearTimeout(timeoutId));
13358
+ dismissTimeouts.clear();
13359
+ abortControllers.forEach((controller) => controller.abort());
13360
+ abortControllers.clear();
13361
+ sessionMetadata.clear();
12356
13362
  const resumableSessionsMap = new Map(
12357
13363
  resumableSessions.map((session) => [session.id, session])
12358
13364
  );
@@ -12387,7 +13393,11 @@ var init_manager = __esm({
12387
13393
  abortController.signal,
12388
13394
  storage
12389
13395
  );
12390
- void executeSessionStream(existingSession, streamIterator);
13396
+ void executeSessionStream(
13397
+ existingSession,
13398
+ streamIterator,
13399
+ abortController
13400
+ );
12391
13401
  }
12392
13402
  };
12393
13403
  const startSession = async (params) => {
@@ -12466,7 +13476,12 @@ var init_manager = __esm({
12466
13476
  transformedContext,
12467
13477
  abortController.signal
12468
13478
  );
12469
- void executeSessionStream(session, streamIterator, activeAgent);
13479
+ void executeSessionStream(
13480
+ session,
13481
+ streamIterator,
13482
+ abortController,
13483
+ activeAgent
13484
+ );
12470
13485
  };
12471
13486
  const abort = (sessionId) => {
12472
13487
  if (sessionId) {
@@ -12508,6 +13523,11 @@ var init_manager = __esm({
12508
13523
  if (existingTimeout) clearTimeout(existingTimeout);
12509
13524
  const timeoutId = setTimeout(() => {
12510
13525
  dismissTimeouts.delete(sessionId);
13526
+ const controller = abortControllers.get(sessionId);
13527
+ if (controller) {
13528
+ controller.abort();
13529
+ abortControllers.delete(sessionId);
13530
+ }
12511
13531
  sessionMetadata.delete(sessionId);
12512
13532
  clearSessionById(sessionId, activeAgent?.storage);
12513
13533
  setSessions((prev) => {
@@ -12622,7 +13642,12 @@ var init_manager = __esm({
12622
13642
  contextWithSessionId,
12623
13643
  abortController.signal
12624
13644
  );
12625
- void executeSessionStream(retriedSession, streamIterator, activeAgent);
13645
+ void executeSessionStream(
13646
+ retriedSession,
13647
+ streamIterator,
13648
+ abortController,
13649
+ activeAgent
13650
+ );
12626
13651
  };
12627
13652
  const updateSessionBoundsOnViewportChange = () => {
12628
13653
  const currentSessions = sessions();
@@ -12708,6 +13733,7 @@ var createArrowNavigator;
12708
13733
  var init_arrow_navigation = __esm({
12709
13734
  "src/core/arrow-navigation.ts"() {
12710
13735
  "use strict";
13736
+ init_constants();
12711
13737
  init_get_element_at_position();
12712
13738
  init_is_element_connected();
12713
13739
  createArrowNavigator = (isValidGrabbableElement2, createElementBounds2) => {
@@ -12726,6 +13752,11 @@ var init_arrow_navigation = __esm({
12726
13752
  const nextElement = findVerticalNext(currentElement, 1);
12727
13753
  if (nextElement) {
12728
13754
  navigationHistory.push(currentElement);
13755
+ if (navigationHistory.length > MAX_ARROW_NAVIGATION_HISTORY) {
13756
+ navigationHistory = navigationHistory.slice(
13757
+ -MAX_ARROW_NAVIGATION_HISTORY
13758
+ );
13759
+ }
12729
13760
  }
12730
13761
  return nextElement;
12731
13762
  };
@@ -12801,12 +13832,12 @@ var init_arrow_navigation = __esm({
12801
13832
  return null;
12802
13833
  }
12803
13834
  };
12804
- const clearHistory = () => {
13835
+ const clearHistory2 = () => {
12805
13836
  navigationHistory = [];
12806
13837
  };
12807
13838
  return {
12808
13839
  findNext,
12809
- clearHistory
13840
+ clearHistory: clearHistory2
12810
13841
  };
12811
13842
  };
12812
13843
  }
@@ -12819,13 +13850,10 @@ var init_keyboard_handlers = __esm({
12819
13850
  "use strict";
12820
13851
  init_parse_activation_key();
12821
13852
  getRequiredModifiers = (options) => {
12822
- const modifiers = getModifiersFromActivationKey(options.activationKey);
12823
- return {
12824
- metaKey: modifiers.metaKey,
12825
- ctrlKey: modifiers.ctrlKey,
12826
- shiftKey: modifiers.shiftKey,
12827
- altKey: modifiers.altKey
12828
- };
13853
+ const { metaKey, ctrlKey, shiftKey, altKey } = getModifiersFromActivationKey(
13854
+ options.activationKey
13855
+ );
13856
+ return { metaKey, ctrlKey, shiftKey, altKey };
12829
13857
  };
12830
13858
  setupKeyboardEventClaimer = () => {
12831
13859
  const claimedEvents = /* @__PURE__ */ new WeakSet();
@@ -12941,7 +13969,7 @@ var init_log_intro = __esm({
12941
13969
  init_is_extension_context();
12942
13970
  logIntro = () => {
12943
13971
  try {
12944
- const version = "0.1.13";
13972
+ const version = "0.1.15";
12945
13973
  const logoDataUri = `data:image/svg+xml;base64,${btoa(LOGO_SVG)}`;
12946
13974
  console.log(
12947
13975
  `%cReact Grab${version ? ` v${version}` : ""}%c
@@ -12958,7 +13986,7 @@ https://react-grab.com`,
12958
13986
  priority: "low",
12959
13987
  cache: "no-store"
12960
13988
  }
12961
- ).then((res) => res.text()).then((latestVersion) => {
13989
+ ).then((response) => response.text()).then((latestVersion) => {
12962
13990
  if (latestVersion && latestVersion !== version) {
12963
13991
  console.warn(
12964
13992
  `[React Grab] v${version} is outdated (latest: v${latestVersion})`
@@ -13183,6 +14211,53 @@ var init_comment = __esm({
13183
14211
  }
13184
14212
  });
13185
14213
 
14214
+ // src/utils/history-storage.ts
14215
+ var SESSION_STORAGE_KEY, loadFromSessionStorage, saveToSessionStorage, historyItems, generateHistoryItemId, loadHistory, addHistoryItem, removeHistoryItem, clearHistory;
14216
+ var init_history_storage = __esm({
14217
+ "src/utils/history-storage.ts"() {
14218
+ "use strict";
14219
+ init_constants();
14220
+ SESSION_STORAGE_KEY = "react-grab-history-items";
14221
+ loadFromSessionStorage = () => {
14222
+ try {
14223
+ const serializedHistoryItems = sessionStorage.getItem(SESSION_STORAGE_KEY);
14224
+ if (!serializedHistoryItems) return [];
14225
+ return JSON.parse(serializedHistoryItems);
14226
+ } catch {
14227
+ return [];
14228
+ }
14229
+ };
14230
+ saveToSessionStorage = (items) => {
14231
+ try {
14232
+ sessionStorage.setItem(SESSION_STORAGE_KEY, JSON.stringify(items));
14233
+ } catch {
14234
+ }
14235
+ };
14236
+ historyItems = loadFromSessionStorage();
14237
+ generateHistoryItemId = () => `history-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
14238
+ loadHistory = () => historyItems;
14239
+ addHistoryItem = (item) => {
14240
+ const newItem = {
14241
+ ...item,
14242
+ id: generateHistoryItemId()
14243
+ };
14244
+ historyItems = [newItem, ...historyItems].slice(0, MAX_HISTORY_ITEMS);
14245
+ saveToSessionStorage(historyItems);
14246
+ return historyItems;
14247
+ };
14248
+ removeHistoryItem = (itemId) => {
14249
+ historyItems = historyItems.filter((item) => item.id !== itemId);
14250
+ saveToSessionStorage(historyItems);
14251
+ return historyItems;
14252
+ };
14253
+ clearHistory = () => {
14254
+ historyItems = [];
14255
+ saveToSessionStorage(historyItems);
14256
+ return historyItems;
14257
+ };
14258
+ }
14259
+ });
14260
+
13186
14261
  // src/core/index.tsx
13187
14262
  var core_exports = {};
13188
14263
  __export(core_exports, {
@@ -13232,7 +14307,6 @@ var init_core = __esm({
13232
14307
  init_is_screenshot_supported();
13233
14308
  init_delay();
13234
14309
  init_resolve_action_enabled();
13235
- init_create_scroll_cycler();
13236
14310
  init_theme();
13237
14311
  init_plugin_registry();
13238
14312
  init_agent();
@@ -13253,6 +14327,9 @@ var init_core = __esm({
13253
14327
  init_freeze_animations();
13254
14328
  init_freeze_pseudo_states();
13255
14329
  init_freeze_updates();
14330
+ init_history_storage();
14331
+ init_copy_content();
14332
+ init_join_snippets();
13256
14333
  init_context();
13257
14334
  init_dist();
13258
14335
  init_theme();
@@ -13328,6 +14405,33 @@ var init_core = __esm({
13328
14405
  const [toolbarShakeCount, setToolbarShakeCount] = createSignal(0);
13329
14406
  const [currentToolbarState, setCurrentToolbarState] = createSignal(savedToolbarState);
13330
14407
  const [isToolbarSelectHovered, setIsToolbarSelectHovered] = createSignal(false);
14408
+ const [historyItems2, setHistoryItems] = createSignal(loadHistory());
14409
+ const [historyDropdownPosition, setHistoryDropdownPosition] = createSignal(null);
14410
+ let toolbarElement;
14411
+ let historyPositionFrameId = null;
14412
+ const historyElementMap = /* @__PURE__ */ new Map();
14413
+ const [hasUnreadHistoryItems, setHasUnreadHistoryItems] = createSignal(false);
14414
+ const [isHistoryHoverOpen, setIsHistoryHoverOpen] = createSignal(false);
14415
+ let historyHoverPreviews = [];
14416
+ const historyDisconnectedItemIds = createMemo(() => {
14417
+ void historyDropdownPosition();
14418
+ const disconnectedIds = /* @__PURE__ */ new Set();
14419
+ for (const item of historyItems2()) {
14420
+ const element = historyElementMap.get(item.id);
14421
+ if (!element || !isElementConnected(element)) {
14422
+ disconnectedIds.add(item.id);
14423
+ }
14424
+ }
14425
+ return disconnectedIds;
14426
+ }, void 0, {
14427
+ equals: (prev, next) => {
14428
+ if (prev.size !== next.size) return false;
14429
+ for (const id of next) {
14430
+ if (!prev.has(id)) return false;
14431
+ }
14432
+ return true;
14433
+ }
14434
+ });
13331
14435
  const pendingAbortSessionId = createMemo(() => store.pendingAbortSessionId);
13332
14436
  const hasAgentProvider = createMemo(() => store.hasAgentProvider);
13333
14437
  const clearHoldTimer = () => {
@@ -13371,26 +14475,18 @@ var init_core = __esm({
13371
14475
  }, FEEDBACK_DURATION_MS);
13372
14476
  onCleanup(() => clearTimeout(timerId));
13373
14477
  });
13374
- let previouslyHoldingKeys = false;
13375
- createEffect(() => {
13376
- const currentlyHolding = isHoldingKeys();
13377
- const currentlyActive = isActivated();
13378
- if (previouslyHoldingKeys && !currentlyHolding && currentlyActive) {
13379
- if (pluginRegistry.store.options.activationMode !== "hold") {
13380
- actions.setWasActivatedByToggle(true);
13381
- }
13382
- pluginRegistry.hooks.onActivate();
14478
+ createEffect(on(isHoldingKeys, (currentlyHolding, previouslyHolding = false) => {
14479
+ if (!previouslyHolding || currentlyHolding || !isActivated()) {
14480
+ return;
13383
14481
  }
13384
- previouslyHoldingKeys = currentlyHolding;
13385
- });
13386
- const elementInputCache = /* @__PURE__ */ new WeakMap();
13387
- const loadCachedInput = (element) => {
13388
- const cachedInput = elementInputCache.get(element);
13389
- actions.setInputText(cachedInput ?? "");
13390
- };
14482
+ if (pluginRegistry.store.options.activationMode !== "hold") {
14483
+ actions.setWasActivatedByToggle(true);
14484
+ }
14485
+ pluginRegistry.hooks.onActivate();
14486
+ }));
13391
14487
  const preparePromptMode = (element, positionX, positionY) => {
13392
14488
  setCopyStartPosition(element, positionX, positionY);
13393
- loadCachedInput(element);
14489
+ actions.clearInputText();
13394
14490
  };
13395
14491
  const activatePromptMode = () => {
13396
14492
  const element = store.frozenElement || targetElement();
@@ -13430,6 +14526,7 @@ var init_core = __esm({
13430
14526
  let copyWaitingForConfirmation = false;
13431
14527
  let holdTimerFiredWaitingForConfirmation = false;
13432
14528
  let isScreenshotInProgress = false;
14529
+ let lastWindowFocusTimestamp = 0;
13433
14530
  let inToggleFeedbackPeriod = false;
13434
14531
  let toggleFeedbackTimerId = null;
13435
14532
  let actionCycleIdleTimeoutId = null;
@@ -13488,7 +14585,7 @@ var init_core = __esm({
13488
14585
  if (!componentName) {
13489
14586
  componentName = getComponentDisplayName(element);
13490
14587
  }
13491
- const textContent = element instanceof HTMLElement ? element.innerText?.slice(0, 100) : void 0;
14588
+ const textContent = element instanceof HTMLElement ? element.innerText?.slice(0, PREVIEW_TEXT_MAX_LENGTH) : void 0;
13492
14589
  return {
13493
14590
  tagName: getTagName(element),
13494
14591
  id: element.id || void 0,
@@ -13506,32 +14603,31 @@ var init_core = __esm({
13506
14603
  }
13507
14604
  }));
13508
14605
  };
13509
- const createLabelInstance = (bounds, tagName, componentName, status, element, mouseX, elements, boundsMultiple) => {
14606
+ const createLabelInstance = (bounds, tagName, componentName, status, options) => {
13510
14607
  actions.clearLabelInstances();
13511
14608
  const instanceId = `label-${Date.now()}-${Math.random().toString(36).slice(2)}`;
13512
14609
  const boundsCenterX = bounds.x + bounds.width / 2;
13513
14610
  const boundsHalfWidth = bounds.width / 2;
14611
+ const mouseX = options?.mouseX;
13514
14612
  const mouseXOffset = mouseX !== void 0 ? mouseX - boundsCenterX : void 0;
13515
14613
  const instance = {
13516
14614
  id: instanceId,
13517
14615
  bounds,
13518
- boundsMultiple,
14616
+ boundsMultiple: options?.boundsMultiple,
13519
14617
  tagName,
13520
14618
  componentName,
13521
14619
  status,
13522
14620
  createdAt: Date.now(),
13523
- element,
13524
- elements,
14621
+ element: options?.element,
14622
+ elements: options?.elements,
13525
14623
  mouseX,
13526
14624
  mouseXOffsetFromCenter: mouseXOffset,
13527
- mouseXOffsetRatio: mouseXOffset !== void 0 && boundsHalfWidth > 0 ? mouseXOffset / boundsHalfWidth : void 0
14625
+ mouseXOffsetRatio: mouseXOffset !== void 0 && boundsHalfWidth > 0 ? mouseXOffset / boundsHalfWidth : void 0,
14626
+ hideArrow: options?.hideArrow
13528
14627
  };
13529
14628
  actions.addLabelInstance(instance);
13530
14629
  return instanceId;
13531
14630
  };
13532
- const updateLabelInstance = (instanceId, status, errorMessage) => {
13533
- actions.updateLabelInstance(instanceId, status, errorMessage);
13534
- };
13535
14631
  const removeLabelInstance = (instanceId) => {
13536
14632
  labelFadeTimeouts.delete(instanceId);
13537
14633
  actions.removeLabelInstance(instanceId);
@@ -13548,7 +14644,7 @@ var init_core = __esm({
13548
14644
  cancelLabelFade(instanceId);
13549
14645
  const timeoutId = window.setTimeout(() => {
13550
14646
  labelFadeTimeouts.delete(instanceId);
13551
- updateLabelInstance(instanceId, "fading");
14647
+ actions.updateLabelInstance(instanceId, "fading");
13552
14648
  setTimeout(() => {
13553
14649
  removeLabelInstance(instanceId);
13554
14650
  }, FADE_COMPLETE_BUFFER_MS);
@@ -13568,11 +14664,15 @@ var init_core = __esm({
13568
14664
  const executeCopyOperation = async (positionX, positionY, operation, bounds, tagName, componentName, element, shouldDeactivateAfter, elements) => {
13569
14665
  inToggleFeedbackPeriod = false;
13570
14666
  actions.startCopy();
13571
- const instanceId = bounds && tagName ? createLabelInstance(bounds, tagName, componentName, "copying", element, positionX, elements) : null;
14667
+ const instanceId = bounds && tagName ? createLabelInstance(bounds, tagName, componentName, "copying", {
14668
+ element,
14669
+ mouseX: positionX,
14670
+ elements
14671
+ }) : null;
13572
14672
  await operation().finally(() => {
13573
14673
  actions.completeCopy(element);
13574
14674
  if (instanceId) {
13575
- updateLabelInstance(instanceId, "copied");
14675
+ actions.updateLabelInstance(instanceId, "copied");
13576
14676
  scheduleLabelFade(instanceId);
13577
14677
  }
13578
14678
  if (shouldDeactivateAfter) {
@@ -13590,9 +14690,9 @@ var init_core = __esm({
13590
14690
  }
13591
14691
  });
13592
14692
  };
13593
- const copyWithFallback = (elements, extraPrompt) => {
14693
+ const copyWithFallback = (elements, extraPrompt, resolvedComponentName2) => {
13594
14694
  const firstElement = elements[0];
13595
- const componentName = firstElement ? getComponentDisplayName(firstElement) : null;
14695
+ const componentName = resolvedComponentName2 ?? (firstElement ? getComponentDisplayName(firstElement) : null);
13596
14696
  const tagName = firstElement ? getTagName(firstElement) : null;
13597
14697
  const elementName = componentName ?? tagName ?? void 0;
13598
14698
  return tryCopyWithFallback({
@@ -13604,11 +14704,50 @@ var init_core = __esm({
13604
14704
  transformSnippet: pluginRegistry.hooks.transformSnippet,
13605
14705
  transformCopyContent: pluginRegistry.hooks.transformCopyContent,
13606
14706
  onAfterCopy: pluginRegistry.hooks.onAfterCopy,
13607
- onCopySuccess: pluginRegistry.hooks.onCopySuccess,
14707
+ onCopySuccess: (copiedElements, content) => {
14708
+ pluginRegistry.hooks.onCopySuccess(copiedElements, content);
14709
+ const primaryElement = copiedElements[0];
14710
+ const isComment = Boolean(extraPrompt);
14711
+ if (primaryElement) {
14712
+ const currentItems = historyItems2();
14713
+ for (const [existingItemId, mappedElement] of historyElementMap.entries()) {
14714
+ if (mappedElement !== primaryElement) continue;
14715
+ const existingItem = currentItems.find((item) => item.id === existingItemId);
14716
+ if (!existingItem) continue;
14717
+ const shouldDedup = isComment ? existingItem.isComment && existingItem.commentText === extraPrompt : !existingItem.isComment;
14718
+ if (shouldDedup) {
14719
+ removeHistoryItem(existingItemId);
14720
+ historyElementMap.delete(existingItemId);
14721
+ break;
14722
+ }
14723
+ }
14724
+ }
14725
+ const updatedHistoryItems = addHistoryItem({
14726
+ content,
14727
+ elementName: elementName ?? "element",
14728
+ tagName: tagName ?? "div",
14729
+ componentName: componentName ?? void 0,
14730
+ isComment,
14731
+ commentText: extraPrompt ?? void 0,
14732
+ timestamp: Date.now()
14733
+ });
14734
+ setHistoryItems(updatedHistoryItems);
14735
+ setHasUnreadHistoryItems(true);
14736
+ const newestHistoryItem = updatedHistoryItems[0];
14737
+ if (newestHistoryItem && primaryElement) {
14738
+ historyElementMap.set(newestHistoryItem.id, primaryElement);
14739
+ }
14740
+ const currentItemIds = new Set(updatedHistoryItems.map((item) => item.id));
14741
+ for (const mapItemId of historyElementMap.keys()) {
14742
+ if (!currentItemIds.has(mapItemId)) {
14743
+ historyElementMap.delete(mapItemId);
14744
+ }
14745
+ }
14746
+ },
13608
14747
  onCopyError: pluginRegistry.hooks.onCopyError
13609
14748
  }, elements, extraPrompt);
13610
14749
  };
13611
- const copyElementsToClipboard = async (targetElements, extraPrompt) => {
14750
+ const copyElementsToClipboard = async (targetElements, extraPrompt, resolvedComponentName2) => {
13612
14751
  if (targetElements.length === 0) return;
13613
14752
  for (const element of targetElements) {
13614
14753
  pluginRegistry.hooks.onElementSelect(element);
@@ -13617,7 +14756,7 @@ var init_core = __esm({
13617
14756
  }
13618
14757
  }
13619
14758
  await new Promise((resolve) => requestAnimationFrame(resolve));
13620
- await copyWithFallback(targetElements, extraPrompt);
14759
+ await copyWithFallback(targetElements, extraPrompt, resolvedComponentName2);
13621
14760
  void notifyElementsSelected(targetElements);
13622
14761
  };
13623
14762
  const performCopyWithLabel = ({
@@ -13641,7 +14780,7 @@ var init_core = __esm({
13641
14780
  const labelPositionX = allElements.length > 1 ? overlayBounds.x + overlayBounds.width / 2 : positionX;
13642
14781
  const tagName = getTagName(element);
13643
14782
  void getNearestComponentName(element).then((componentName) => {
13644
- void executeCopyOperation(labelPositionX, positionY, () => copyElementsToClipboard(allElements, extraPrompt), overlayBounds, tagName, componentName ?? void 0, element, shouldDeactivateAfter, elements).then(() => {
14783
+ void executeCopyOperation(labelPositionX, positionY, () => copyElementsToClipboard(allElements, extraPrompt, componentName ?? void 0), overlayBounds, tagName, componentName ?? void 0, element, shouldDeactivateAfter, elements).then(() => {
13645
14784
  onComplete?.();
13646
14785
  });
13647
14786
  });
@@ -13663,9 +14802,10 @@ var init_core = __esm({
13663
14802
  }, BOUNDS_RECALC_INTERVAL_MS);
13664
14803
  onCleanup(() => clearInterval(intervalId));
13665
14804
  });
13666
- createEffect(on(() => effectiveElement(), (element) => {
14805
+ createEffect(on(effectiveElement, (element) => {
13667
14806
  if (componentNameDebounceTimerId !== null) {
13668
14807
  clearTimeout(componentNameDebounceTimerId);
14808
+ componentNameDebounceTimerId = null;
13669
14809
  }
13670
14810
  if (!element) {
13671
14811
  setDebouncedElementForComponentName(null);
@@ -13675,13 +14815,13 @@ var init_core = __esm({
13675
14815
  componentNameDebounceTimerId = null;
13676
14816
  setDebouncedElementForComponentName(element);
13677
14817
  }, COMPONENT_NAME_DEBOUNCE_MS);
13678
- onCleanup(() => {
13679
- if (componentNameDebounceTimerId !== null) {
13680
- clearTimeout(componentNameDebounceTimerId);
13681
- componentNameDebounceTimerId = null;
13682
- }
13683
- });
13684
14818
  }));
14819
+ onCleanup(() => {
14820
+ if (componentNameDebounceTimerId !== null) {
14821
+ clearTimeout(componentNameDebounceTimerId);
14822
+ componentNameDebounceTimerId = null;
14823
+ }
14824
+ });
13685
14825
  createEffect(() => {
13686
14826
  const elements = store.frozenElements;
13687
14827
  const cleanup = freezeAnimations(elements);
@@ -13705,7 +14845,7 @@ var init_core = __esm({
13705
14845
  };
13706
14846
  const selectionElement = createMemo(() => getSelectionElement());
13707
14847
  const isSelectionElementVisible = () => {
13708
- const element = getSelectionElement();
14848
+ const element = selectionElement();
13709
14849
  if (!element) return false;
13710
14850
  if (store.isTouchMode && isDragging()) {
13711
14851
  return isRendererActive();
@@ -13738,7 +14878,7 @@ var init_core = __esm({
13738
14878
  }
13739
14879
  return createFlatOverlayBounds(combineBounds(frozenBounds));
13740
14880
  }
13741
- const element = getSelectionElement();
14881
+ const element = selectionElement();
13742
14882
  if (!element) return void 0;
13743
14883
  return createElementBounds(element);
13744
14884
  });
@@ -13857,7 +14997,19 @@ var init_core = __esm({
13857
14997
  });
13858
14998
  }));
13859
14999
  createEffect(on(() => store.viewportVersion, () => agentManager._internal.updateBoundsOnViewportChange()));
13860
- createEffect(on(() => [isActivated(), isDragging(), isCopying(), isPromptMode(), crosshairVisible(), targetElement(), dragBounds(), store.grabbedBoxes, pluginRegistry.store.theme.enabled, pluginRegistry.store.theme.selectionBox.enabled, pluginRegistry.store.theme.dragBox.enabled, isDraggingBeyondThreshold(), effectiveElement(), didJustCopy(), currentToolbarState()], ([active, dragging, copying, inputMode, isCrosshairVisible, target, drag, grabbedBoxes, themeEnabled, selectionBoxEnabled, dragBoxEnabled, draggingBeyondThreshold, effectiveTarget, justCopied, toolbarState]) => {
15000
+ const stateChangeGrabbedBoxes = createMemo(() => store.grabbedBoxes.map((box) => ({
15001
+ id: box.id,
15002
+ bounds: box.bounds,
15003
+ createdAt: box.createdAt
15004
+ })));
15005
+ const stateChangeLabelInstances = createMemo(() => store.labelInstances.map((instance) => ({
15006
+ id: instance.id,
15007
+ status: instance.status,
15008
+ tagName: instance.tagName,
15009
+ componentName: instance.componentName,
15010
+ createdAt: instance.createdAt
15011
+ })));
15012
+ createEffect(on(() => [isActivated(), isDragging(), isCopying(), isPromptMode(), crosshairVisible(), targetElement(), dragBounds(), pluginRegistry.store.theme.enabled, pluginRegistry.store.theme.selectionBox.enabled, pluginRegistry.store.theme.dragBox.enabled, isDraggingBeyondThreshold(), effectiveElement(), didJustCopy(), currentToolbarState(), stateChangeGrabbedBoxes(), stateChangeLabelInstances(), store.selectionFilePath], ([active, dragging, copying, inputMode, isCrosshairVisible, target, drag, themeEnabled, selectionBoxEnabled, dragBoxEnabled, draggingBeyondThreshold, effectiveTarget, justCopied, toolbarState, grabbedBoxes, labelInstances, selectionFilePath]) => {
13861
15013
  const isSelectionBoxVisible = Boolean(themeEnabled && selectionBoxEnabled && active && !copying && !justCopied && !dragging && effectiveTarget != null);
13862
15014
  const isDragBoxVisible = Boolean(themeEnabled && dragBoxEnabled && active && !copying && draggingBeyondThreshold);
13863
15015
  pluginRegistry.hooks.onStateChange({
@@ -13875,12 +15027,9 @@ var init_core = __esm({
13875
15027
  width: drag.width,
13876
15028
  height: drag.height
13877
15029
  } : null,
13878
- grabbedBoxes: grabbedBoxes.map((box) => ({
13879
- id: box.id,
13880
- bounds: box.bounds,
13881
- createdAt: box.createdAt
13882
- })),
13883
- selectionFilePath: store.selectionFilePath,
15030
+ grabbedBoxes,
15031
+ labelInstances,
15032
+ selectionFilePath,
13884
15033
  toolbarState
13885
15034
  });
13886
15035
  }));
@@ -14009,7 +15158,7 @@ var init_core = __esm({
14009
15158
  actions.setInputText(value);
14010
15159
  };
14011
15160
  const handleInputSubmit = () => {
14012
- actions.setLastCopied(null);
15161
+ actions.clearLastCopied();
14013
15162
  const frozenElements2 = [...store.frozenElements];
14014
15163
  const element = store.frozenElement || targetElement();
14015
15164
  const prompt = isPromptMode() ? store.inputText.trim() : "";
@@ -14018,18 +15167,17 @@ var init_core = __esm({
14018
15167
  return;
14019
15168
  }
14020
15169
  const elements = frozenElements2.length > 0 ? frozenElements2 : element ? [element] : [];
14021
- const currentSelectionBounds = elements.map((el) => createElementBounds(el));
15170
+ const currentSelectionBounds = elements.map((selectedElement) => createElementBounds(selectedElement));
14022
15171
  const firstBounds = currentSelectionBounds[0];
14023
15172
  const currentX = firstBounds.x + firstBounds.width / 2;
14024
15173
  const currentY = firstBounds.y + firstBounds.height / 2;
14025
15174
  const labelPositionX = currentX + store.copyOffsetFromCenterX;
14026
15175
  if ((store.selectedAgent || hasAgentProvider()) && prompt) {
14027
- elementInputCache.delete(element);
14028
15176
  const currentReplySessionId = store.replySessionId;
14029
15177
  const selectedAgent = store.selectedAgent;
14030
15178
  deactivateRenderer();
14031
- actions.setReplySessionId(null);
14032
- actions.clearSelectedAgent();
15179
+ actions.clearReplySessionId();
15180
+ actions.setSelectedAgent(null);
14033
15181
  void agentManager.session.start({
14034
15182
  elements,
14035
15183
  prompt,
@@ -14050,11 +15198,6 @@ var init_core = __esm({
14050
15198
  actions.exitPromptMode();
14051
15199
  actions.clearInputText();
14052
15200
  actions.clearReplySessionId();
14053
- if (prompt) {
14054
- elementInputCache.set(element, prompt);
14055
- } else {
14056
- elementInputCache.delete(element);
14057
- }
14058
15201
  performCopyWithLabel({
14059
15202
  element,
14060
15203
  positionX: labelPositionX,
@@ -14065,17 +15208,13 @@ var init_core = __esm({
14065
15208
  });
14066
15209
  };
14067
15210
  const handleInputCancel = () => {
14068
- actions.setLastCopied(null);
15211
+ actions.clearLastCopied();
14069
15212
  if (!isPromptMode()) return;
14070
15213
  const currentInput = store.inputText.trim();
14071
15214
  if (currentInput && !isPendingDismiss()) {
14072
15215
  actions.setPendingDismiss(true);
14073
15216
  return;
14074
15217
  }
14075
- const element = store.frozenElement || targetElement();
14076
- if (element && currentInput) {
14077
- elementInputCache.set(element, currentInput);
14078
- }
14079
15218
  actions.clearInputText();
14080
15219
  actions.clearReplySessionId();
14081
15220
  deactivateRenderer();
@@ -14137,7 +15276,7 @@ var init_core = __esm({
14137
15276
  };
14138
15277
  const enterCommentModeForElement = (element, positionX, positionY) => {
14139
15278
  actions.setPendingCommentMode(false);
14140
- loadCachedInput(element);
15279
+ actions.clearInputText();
14141
15280
  actions.enterPromptMode({
14142
15281
  x: positionX,
14143
15282
  y: positionY
@@ -14167,7 +15306,7 @@ var init_core = __esm({
14167
15306
  };
14168
15307
  saveToolbarState(newState);
14169
15308
  setCurrentToolbarState(newState);
14170
- toolbarStateChangeCallbacks.forEach((cb) => cb(newState));
15309
+ toolbarStateChangeCallbacks.forEach((callback) => callback(newState));
14171
15310
  if (!newEnabled) {
14172
15311
  if (isHoldingKeys()) {
14173
15312
  actions.release();
@@ -14175,6 +15314,7 @@ var init_core = __esm({
14175
15314
  if (isActivated()) {
14176
15315
  deactivateRenderer();
14177
15316
  }
15317
+ dismissHistoryDropdown();
14178
15318
  if (toggleFeedbackTimerId !== null) {
14179
15319
  window.clearTimeout(toggleFeedbackTimerId);
14180
15320
  toggleFeedbackTimerId = null;
@@ -14384,6 +15524,7 @@ var init_core = __esm({
14384
15524
  };
14385
15525
  const handleEnterKeyActivation = (event) => {
14386
15526
  if (!isEnterCode(event.code)) return false;
15527
+ if (isKeyboardEventTriggeredByInput(event)) return false;
14387
15528
  const copiedElement = store.lastCopiedElement;
14388
15529
  const canActivateFromCopied = !isHoldingKeys() && !isPromptMode() && !isActivated() && copiedElement && isElementConnected(copiedElement) && !store.labelInstances.some((instance) => instance.status === "copied" || instance.status === "fading");
14389
15530
  if (canActivateFromCopied) {
@@ -14394,7 +15535,7 @@ var init_core = __esm({
14394
15535
  actions.setPointer(center);
14395
15536
  preparePromptMode(copiedElement, center.x, center.y);
14396
15537
  actions.setFrozenElement(copiedElement);
14397
- actions.setLastCopied(null);
15538
+ actions.clearLastCopied();
14398
15539
  activatePromptMode();
14399
15540
  if (!isActivated()) {
14400
15541
  activateRenderer();
@@ -14461,7 +15602,11 @@ var init_core = __esm({
14461
15602
  const shouldDeactivate = store.wasActivatedByToggle;
14462
15603
  const overlayBounds = createFlatOverlayBounds(bounds);
14463
15604
  const selectionBoundsArray = allBounds.length > 1 ? allBounds : singleBounds ? [singleBounds] : [];
14464
- const instanceId = createLabelInstance(overlayBounds, tagName, void 0, "copying", element ?? void 0, bounds.x + bounds.width / 2, void 0, selectionBoundsArray);
15605
+ const instanceId = createLabelInstance(overlayBounds, tagName, void 0, "copying", {
15606
+ element: element ?? void 0,
15607
+ mouseX: bounds.x + bounds.width / 2,
15608
+ boundsMultiple: selectionBoundsArray
15609
+ });
14465
15610
  isScreenshotInProgress = true;
14466
15611
  rendererRoot.style.visibility = "hidden";
14467
15612
  const elementsForScreenshot = store.frozenElements.length > 0 ? [...store.frozenElements] : element ? [element] : [];
@@ -14481,7 +15626,7 @@ var init_core = __esm({
14481
15626
  }
14482
15627
  isScreenshotInProgress = false;
14483
15628
  rendererRoot.style.visibility = "";
14484
- updateLabelInstance(instanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
15629
+ actions.updateLabelInstance(instanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
14485
15630
  scheduleLabelFade(instanceId);
14486
15631
  if (shouldDeactivate) {
14487
15632
  deactivateRenderer();
@@ -14540,13 +15685,9 @@ var init_core = __esm({
14540
15685
  });
14541
15686
  };
14542
15687
  const availableActionCycleItems = createMemo(() => {
14543
- const element = selectionElement();
14544
- if (!element) return [];
14545
- const actionsById = new Map(pluginRegistry.store.actions.map((action) => [action.id, action]));
15688
+ if (!selectionElement()) return [];
14546
15689
  const cycleItems = [];
14547
- for (const actionId of ACTION_CYCLE_ACTION_IDS) {
14548
- const action = actionsById.get(actionId);
14549
- if (!action) continue;
15690
+ for (const action of pluginRegistry.store.actions) {
14550
15691
  const isStaticallyDisabled = typeof action.enabled === "boolean" && !action.enabled;
14551
15692
  if (isStaticallyDisabled) continue;
14552
15693
  cycleItems.push({
@@ -14582,33 +15723,23 @@ var init_core = __esm({
14582
15723
  }
14583
15724
  }, ACTION_CYCLE_IDLE_TRIGGER_MS);
14584
15725
  };
14585
- const applyActionCycleItems = (cycleItems, direction) => {
15726
+ const advanceActionCycle = () => {
15727
+ if (!canCycleActions()) return false;
15728
+ const cycleItems = availableActionCycleItems();
14586
15729
  if (cycleItems.length === 0) return false;
14587
15730
  setActionCycleItems(cycleItems);
14588
15731
  const currentIndex = actionCycleActiveIndex();
14589
15732
  const isCurrentIndexValid = currentIndex !== null && currentIndex < cycleItems.length;
14590
- const stepOffset = direction === "forward" ? 1 : -1;
14591
- let nextIndex;
14592
- if (!isCurrentIndexValid) {
14593
- nextIndex = direction === "forward" ? 0 : cycleItems.length - 1;
14594
- } else {
14595
- nextIndex = (currentIndex + stepOffset + cycleItems.length) % cycleItems.length;
14596
- }
15733
+ const nextIndex = isCurrentIndexValid ? (currentIndex + 1) % cycleItems.length : 0;
14597
15734
  setActionCycleActiveIndex(nextIndex);
14598
15735
  scheduleActionCycleActivation();
14599
15736
  return true;
14600
15737
  };
14601
- const handleActionCycleInput = (direction) => {
14602
- if (!canCycleActions()) return false;
14603
- const cycleItems = availableActionCycleItems();
14604
- if (cycleItems.length === 0) return false;
14605
- return applyActionCycleItems(cycleItems, direction);
14606
- };
14607
15738
  const handleActionCycleKey = (event) => {
14608
15739
  if (event.code !== "KeyC") return false;
14609
15740
  if (event.altKey || event.repeat) return false;
14610
15741
  if (isKeyboardEventTriggeredByInput(event)) return false;
14611
- if (!handleActionCycleInput("forward")) return false;
15742
+ if (!advanceActionCycle()) return false;
14612
15743
  event.preventDefault();
14613
15744
  event.stopPropagation();
14614
15745
  if (event.metaKey || event.ctrlKey) {
@@ -14616,31 +15747,18 @@ var init_core = __esm({
14616
15747
  }
14617
15748
  return true;
14618
15749
  };
14619
- const actionCycleScrollCycler = createScrollCycler({
14620
- thresholdPx: ACTION_CYCLE_SCROLL_THRESHOLD_PX,
14621
- throttleMs: ACTION_CYCLE_INPUT_THROTTLE_MS,
14622
- lineHeightPx: ACTION_CYCLE_SCROLL_LINE_HEIGHT_PX,
14623
- onStep: handleActionCycleInput
14624
- });
14625
- const handleActionCycleWheel = (event) => {
14626
- if (!canCycleActions()) return;
14627
- const isActionCycleActive = actionCycleActiveIndex() !== null;
14628
- if (!isActionCycleActive) {
14629
- const cycleItems = availableActionCycleItems();
14630
- if (cycleItems.length === 0) return;
14631
- }
14632
- event.preventDefault();
14633
- event.stopPropagation();
14634
- actionCycleScrollCycler.handleWheel(event);
14635
- };
14636
15750
  const handleActivationKeys = (event) => {
14637
15751
  if (!pluginRegistry.store.options.allowActivationInsideInput && isKeyboardEventTriggeredByInput(event)) {
14638
15752
  return;
14639
15753
  }
14640
15754
  if (!isTargetKeyCombination(event, pluginRegistry.store.options)) {
14641
- if (isActivated() && !store.wasActivatedByToggle && (event.metaKey || event.ctrlKey)) {
14642
- if (!MODIFIER_KEYS.includes(event.key) && !isEnterCode(event.code)) {
15755
+ if ((event.metaKey || event.ctrlKey) && !MODIFIER_KEYS.includes(event.key) && !isEnterCode(event.code)) {
15756
+ if (isActivated() && !store.wasActivatedByToggle) {
14643
15757
  deactivateRenderer();
15758
+ } else if (isHoldingKeys()) {
15759
+ clearHoldTimer();
15760
+ resetCopyConfirmation();
15761
+ actions.release();
14644
15762
  }
14645
15763
  }
14646
15764
  if (!isEnterCode(event.code) || !isHoldingKeys()) {
@@ -14709,6 +15827,10 @@ var init_core = __esm({
14709
15827
  handleInputCancel();
14710
15828
  return;
14711
15829
  }
15830
+ if (event.key === "Escape" && historyDropdownPosition() !== null) {
15831
+ dismissHistoryDropdown();
15832
+ return;
15833
+ }
14712
15834
  const isFromOverlay = isEventFromOverlay(event, "data-react-grab-ignore-events") && !isEnterToActivateInput;
14713
15835
  if (isPromptMode() || isFromOverlay) {
14714
15836
  if (event.key === "Escape") {
@@ -14740,18 +15862,18 @@ var init_core = __esm({
14740
15862
  return;
14741
15863
  }
14742
15864
  }
14743
- if (handleActionCycleKey(event)) return;
15865
+ const didWindowJustRegainFocus = Date.now() - lastWindowFocusTimestamp < WINDOW_REFOCUS_GRACE_PERIOD_MS;
15866
+ if (!didWindowJustRegainFocus && handleActionCycleKey(event)) return;
14744
15867
  if (handleArrowNavigation(event)) return;
14745
15868
  if (handleEnterKeyActivation(event)) return;
14746
15869
  if (handleOpenFileShortcut(event)) return;
14747
15870
  if (handleScreenshotShortcut(event)) return;
14748
- handleActivationKeys(event);
15871
+ if (!didWindowJustRegainFocus) {
15872
+ handleActivationKeys(event);
15873
+ }
14749
15874
  }, {
14750
15875
  capture: true
14751
15876
  });
14752
- eventListenerManager.addWindowListener("wheel", handleActionCycleWheel, {
14753
- passive: false
14754
- });
14755
15877
  eventListenerManager.addWindowListener("keyup", (event) => {
14756
15878
  if (blockEnterIfNeeded(event)) return;
14757
15879
  const requiredModifiers = getRequiredModifiers(pluginRegistry.store.options);
@@ -14822,6 +15944,7 @@ var init_core = __esm({
14822
15944
  actions.setTouchMode(isTouchPointer);
14823
15945
  if (isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
14824
15946
  if (store.contextMenuPosition !== null) return;
15947
+ if (isTouchPointer && !isHoldingKeys() && !isActivated()) return;
14825
15948
  const isActiveState = isTouchPointer ? isHoldingKeys() : isActivated();
14826
15949
  if (isActiveState && !isPromptMode() && isToggleFrozen()) {
14827
15950
  actions.unfreeze();
@@ -14892,6 +16015,7 @@ var init_core = __esm({
14892
16015
  actions.setPointer(position);
14893
16016
  actions.freeze();
14894
16017
  actions.showContextMenu(position, element);
16018
+ dismissHistoryDropdown();
14895
16019
  pluginRegistry.hooks.onContextMenu(element, position);
14896
16020
  }, {
14897
16021
  capture: true
@@ -14931,7 +16055,18 @@ var init_core = __esm({
14931
16055
  }
14932
16056
  }
14933
16057
  });
16058
+ eventListenerManager.addWindowListener("blur", () => {
16059
+ if (isHoldingKeys()) {
16060
+ clearHoldTimer();
16061
+ actions.release();
16062
+ resetCopyConfirmation();
16063
+ }
16064
+ });
16065
+ eventListenerManager.addWindowListener("focus", () => {
16066
+ lastWindowFocusTimestamp = Date.now();
16067
+ });
14934
16068
  const redetectElementUnderPointer = () => {
16069
+ if (store.isTouchMode && !isHoldingKeys() && !isActivated()) return;
14935
16070
  if (isEnabled() && !isPromptMode() && !isToggleFrozen() && !isDragging() && store.contextMenuPosition === null && store.frozenElements.length === 0) {
14936
16071
  const candidate = getElementAtPosition(store.pointer.x, store.pointer.y);
14937
16072
  actions.setDetectedElement(candidate);
@@ -15019,11 +16154,17 @@ var init_core = __esm({
15019
16154
  });
15020
16155
  onCleanup(() => {
15021
16156
  eventListenerManager.abort();
16157
+ if (dragPreviewDebounceTimerId !== null) {
16158
+ window.clearTimeout(dragPreviewDebounceTimerId);
16159
+ }
15022
16160
  if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
15023
16161
  if (toggleFeedbackTimerId) window.clearTimeout(toggleFeedbackTimerId);
15024
16162
  if (actionCycleIdleTimeoutId) {
15025
16163
  window.clearTimeout(actionCycleIdleTimeoutId);
15026
16164
  }
16165
+ if (historyPositionFrameId !== null) {
16166
+ cancelAnimationFrame(historyPositionFrameId);
16167
+ }
15027
16168
  grabbedBoxTimeouts.forEach((timeoutId) => window.clearTimeout(timeoutId));
15028
16169
  grabbedBoxTimeouts.clear();
15029
16170
  autoScroller.stop();
@@ -15033,16 +16174,21 @@ var init_core = __esm({
15033
16174
  keyboardClaimer.restore();
15034
16175
  });
15035
16176
  const rendererRoot = mountRoot(styles_default);
16177
+ const isThemeEnabled = createMemo(() => pluginRegistry.store.theme.enabled);
16178
+ const isSelectionBoxThemeEnabled = createMemo(() => pluginRegistry.store.theme.selectionBox.enabled);
16179
+ const isElementLabelThemeEnabled = createMemo(() => pluginRegistry.store.theme.elementLabel.enabled);
16180
+ const isDragBoxThemeEnabled = createMemo(() => pluginRegistry.store.theme.dragBox.enabled);
16181
+ const isSelectionSuppressed = createMemo(() => didJustCopy());
16182
+ const hasDragPreviewBounds = createMemo(() => dragPreviewBounds().length > 0);
15036
16183
  const selectionVisible = createMemo(() => {
15037
- if (!pluginRegistry.store.theme.enabled) return false;
15038
- if (!pluginRegistry.store.theme.selectionBox.enabled) return false;
15039
- if (didJustCopy()) return false;
15040
- const hasDragPreview = dragPreviewBounds().length > 0;
15041
- if (hasDragPreview) return true;
16184
+ if (!isThemeEnabled()) return false;
16185
+ if (!isSelectionBoxThemeEnabled()) return false;
16186
+ if (isSelectionSuppressed()) return false;
16187
+ if (hasDragPreviewBounds()) return true;
15042
16188
  return isSelectionElementVisible();
15043
16189
  });
15044
16190
  const selectionTagName = createMemo(() => {
15045
- const element = getSelectionElement();
16191
+ const element = selectionElement();
15046
16192
  if (!element) return void 0;
15047
16193
  return getTagName(element) || void 0;
15048
16194
  });
@@ -15063,13 +16209,13 @@ var init_core = __esm({
15063
16209
  const selectionComponentName = resolvedComponentName;
15064
16210
  const selectionLabelVisible = createMemo(() => {
15065
16211
  if (store.contextMenuPosition !== null) return false;
15066
- if (!pluginRegistry.store.theme.elementLabel.enabled) return false;
15067
- if (didJustCopy()) return false;
16212
+ if (!isElementLabelThemeEnabled()) return false;
16213
+ if (isSelectionSuppressed()) return false;
15068
16214
  return isSelectionElementVisible();
15069
16215
  });
15070
16216
  const labelInstanceCache = /* @__PURE__ */ new Map();
15071
16217
  const computedLabelInstances = createMemo(() => {
15072
- if (!pluginRegistry.store.theme.enabled) return [];
16218
+ if (!isThemeEnabled()) return [];
15073
16219
  if (!pluginRegistry.store.theme.grabbedBoxes.enabled) return [];
15074
16220
  void store.viewportVersion;
15075
16221
  const currentIds = new Set(store.labelInstances.map((i2) => i2.id));
@@ -15101,7 +16247,7 @@ var init_core = __esm({
15101
16247
  });
15102
16248
  });
15103
16249
  const computedGrabbedBoxes = createMemo(() => {
15104
- if (!pluginRegistry.store.theme.enabled) return [];
16250
+ if (!isThemeEnabled()) return [];
15105
16251
  if (!pluginRegistry.store.theme.grabbedBoxes.enabled) return [];
15106
16252
  void store.viewportVersion;
15107
16253
  return store.grabbedBoxes.map((box) => {
@@ -15114,11 +16260,11 @@ var init_core = __esm({
15114
16260
  };
15115
16261
  });
15116
16262
  });
15117
- const dragVisible = createMemo(() => pluginRegistry.store.theme.enabled && pluginRegistry.store.theme.dragBox.enabled && isRendererActive() && isDraggingBeyondThreshold());
16263
+ const dragVisible = createMemo(() => isThemeEnabled() && isDragBoxThemeEnabled() && isRendererActive() && isDraggingBeyondThreshold());
15118
16264
  const labelVariant = createMemo(() => isCopying() ? "processing" : "hover");
15119
16265
  const labelVisible = createMemo(() => {
15120
- if (!pluginRegistry.store.theme.enabled) return false;
15121
- const themeEnabled = pluginRegistry.store.theme.elementLabel.enabled;
16266
+ if (!isThemeEnabled()) return false;
16267
+ const themeEnabled = isElementLabelThemeEnabled();
15122
16268
  const inPromptMode = isPromptMode();
15123
16269
  const copying = isCopying();
15124
16270
  const rendererActive = isRendererActive();
@@ -15163,16 +16309,7 @@ var init_core = __esm({
15163
16309
  const [contextMenuFilePath] = createResource(() => store.contextMenuElement, async (element) => {
15164
16310
  if (!element) return null;
15165
16311
  const stack = await getStack(element);
15166
- if (!stack || stack.length === 0) return null;
15167
- for (const frame of stack) {
15168
- if (frame.fileName && Pe2(frame.fileName)) {
15169
- return {
15170
- filePath: Ne2(frame.fileName),
15171
- lineNumber: frame.lineNumber
15172
- };
15173
- }
15174
- }
15175
- return null;
16312
+ return resolveSourceFromStack(stack);
15176
16313
  });
15177
16314
  const createPerformWithFeedback = (element, elements, tagName, componentName, options) => {
15178
16315
  return async (action) => {
@@ -15188,7 +16325,12 @@ var init_core = __esm({
15188
16325
  actions.hideContextMenu();
15189
16326
  if (labelBounds) {
15190
16327
  const labelPositionX = hasMultipleElements ? labelBounds.x + labelBounds.width / 2 : position.x;
15191
- const labelInstanceId = createLabelInstance(labelBounds, tagName || "element", componentName, "copying", element, labelPositionX, hasMultipleElements ? elements : void 0, selectionBoundsForLabel);
16328
+ const labelInstanceId = createLabelInstance(labelBounds, tagName || "element", componentName, "copying", {
16329
+ element,
16330
+ mouseX: labelPositionX,
16331
+ elements: hasMultipleElements ? elements : void 0,
16332
+ boundsMultiple: selectionBoundsForLabel
16333
+ });
15192
16334
  let didSucceed = false;
15193
16335
  let errorMessage;
15194
16336
  try {
@@ -15199,7 +16341,7 @@ var init_core = __esm({
15199
16341
  } catch (error) {
15200
16342
  errorMessage = error instanceof Error && error.message ? error.message : "Action failed";
15201
16343
  }
15202
- updateLabelInstance(labelInstanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
16344
+ actions.updateLabelInstance(labelInstanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
15203
16345
  scheduleLabelFade(labelInstanceId);
15204
16346
  } else {
15205
16347
  try {
@@ -15217,7 +16359,7 @@ var init_core = __esm({
15217
16359
  const deferHideContextMenu = () => {
15218
16360
  setTimeout(() => {
15219
16361
  actions.hideContextMenu();
15220
- }, 0);
16362
+ }, DEFERRED_EXECUTION_DELAY_MS);
15221
16363
  };
15222
16364
  const buildActionContext = (options) => {
15223
16365
  const {
@@ -15250,6 +16392,7 @@ var init_core = __esm({
15250
16392
  if (agent) {
15251
16393
  actions.setSelectedAgent(agent);
15252
16394
  }
16395
+ actions.clearLabelInstances();
15253
16396
  onBeforePrompt?.();
15254
16397
  preparePromptMode(element, position.x, position.y);
15255
16398
  actions.setPointer({
@@ -15318,7 +16461,8 @@ var init_core = __esm({
15318
16461
  if (agent) {
15319
16462
  actions.setSelectedAgent(agent);
15320
16463
  }
15321
- loadCachedInput(element);
16464
+ actions.clearLabelInstances();
16465
+ actions.clearInputText();
15322
16466
  actions.enterPromptMode(position, element);
15323
16467
  deferHideContextMenu();
15324
16468
  }
@@ -15328,7 +16472,283 @@ var init_core = __esm({
15328
16472
  setTimeout(() => {
15329
16473
  actions.hideContextMenu();
15330
16474
  deactivateRenderer();
15331
- }, 0);
16475
+ }, DEFERRED_EXECUTION_DELAY_MS);
16476
+ };
16477
+ const clearHistoryHoverPreviews = () => {
16478
+ for (const {
16479
+ boxId,
16480
+ labelId
16481
+ } of historyHoverPreviews) {
16482
+ actions.removeGrabbedBox(boxId);
16483
+ if (labelId) {
16484
+ actions.removeLabelInstance(labelId);
16485
+ }
16486
+ }
16487
+ historyHoverPreviews = [];
16488
+ };
16489
+ const addHistoryItemPreview = (item, element, idPrefix) => {
16490
+ const bounds = createElementBounds(element);
16491
+ const boxId = `${idPrefix}-${item.id}`;
16492
+ actions.addGrabbedBox({
16493
+ id: boxId,
16494
+ bounds,
16495
+ createdAt: 0,
16496
+ element
16497
+ });
16498
+ const hasCommentText = item.isComment && item.commentText;
16499
+ const labelId = `${idPrefix}-label-${item.id}`;
16500
+ actions.addLabelInstance({
16501
+ id: labelId,
16502
+ bounds,
16503
+ tagName: item.tagName,
16504
+ componentName: item.componentName,
16505
+ status: "idle",
16506
+ isPromptMode: Boolean(hasCommentText),
16507
+ inputValue: hasCommentText ? item.commentText : void 0,
16508
+ createdAt: 0,
16509
+ element,
16510
+ mouseX: bounds.x + bounds.width / 2
16511
+ });
16512
+ historyHoverPreviews.push({
16513
+ boxId,
16514
+ labelId
16515
+ });
16516
+ };
16517
+ const stopTrackingToolbarPosition = () => {
16518
+ if (historyPositionFrameId !== null) {
16519
+ cancelAnimationFrame(historyPositionFrameId);
16520
+ historyPositionFrameId = null;
16521
+ }
16522
+ };
16523
+ const getNearestEdge = (rect) => {
16524
+ const centerX = rect.left + rect.width / 2;
16525
+ const centerY = rect.top + rect.height / 2;
16526
+ const distanceToTop = centerY;
16527
+ const distanceToBottom = window.innerHeight - centerY;
16528
+ const distanceToLeft = centerX;
16529
+ const distanceToRight = window.innerWidth - centerX;
16530
+ const minimumDistance = Math.min(distanceToTop, distanceToBottom, distanceToLeft, distanceToRight);
16531
+ if (minimumDistance === distanceToTop) return "top";
16532
+ if (minimumDistance === distanceToLeft) return "left";
16533
+ if (minimumDistance === distanceToRight) return "right";
16534
+ return "bottom";
16535
+ };
16536
+ const startTrackingToolbarPosition = () => {
16537
+ stopTrackingToolbarPosition();
16538
+ const updatePosition = () => {
16539
+ if (!toolbarElement) return;
16540
+ const toolbarRect = toolbarElement.getBoundingClientRect();
16541
+ const edge = getNearestEdge(toolbarRect);
16542
+ let anchorX;
16543
+ let anchorY;
16544
+ if (edge === "left" || edge === "right") {
16545
+ anchorX = edge === "left" ? toolbarRect.right : toolbarRect.left;
16546
+ anchorY = toolbarRect.top + toolbarRect.height / 2;
16547
+ } else {
16548
+ anchorX = toolbarRect.left + toolbarRect.width / 2;
16549
+ anchorY = edge === "top" ? toolbarRect.bottom : toolbarRect.top;
16550
+ }
16551
+ setHistoryDropdownPosition({
16552
+ x: anchorX,
16553
+ y: anchorY,
16554
+ edge,
16555
+ toolbarWidth: toolbarRect.width
16556
+ });
16557
+ historyPositionFrameId = requestAnimationFrame(updatePosition);
16558
+ };
16559
+ historyPositionFrameId = requestAnimationFrame(updatePosition);
16560
+ };
16561
+ const dismissHistoryDropdown = () => {
16562
+ cancelHistoryHoverOpenTimeout();
16563
+ cancelHistoryHoverCloseTimeout();
16564
+ stopTrackingToolbarPosition();
16565
+ clearHistoryHoverPreviews();
16566
+ setHistoryDropdownPosition(null);
16567
+ setIsHistoryHoverOpen(false);
16568
+ };
16569
+ const openHistoryDropdown = () => {
16570
+ actions.hideContextMenu();
16571
+ setHistoryItems(loadHistory());
16572
+ setHasUnreadHistoryItems(false);
16573
+ startTrackingToolbarPosition();
16574
+ };
16575
+ let historyHoverOpenTimeoutId = null;
16576
+ let historyHoverCloseTimeoutId = null;
16577
+ const cancelHistoryHoverOpenTimeout = () => {
16578
+ if (historyHoverOpenTimeoutId !== null) {
16579
+ clearTimeout(historyHoverOpenTimeoutId);
16580
+ historyHoverOpenTimeoutId = null;
16581
+ }
16582
+ };
16583
+ const cancelHistoryHoverCloseTimeout = () => {
16584
+ if (historyHoverCloseTimeoutId !== null) {
16585
+ clearTimeout(historyHoverCloseTimeoutId);
16586
+ historyHoverCloseTimeoutId = null;
16587
+ }
16588
+ };
16589
+ const handleToggleHistory = () => {
16590
+ cancelHistoryHoverOpenTimeout();
16591
+ cancelHistoryHoverCloseTimeout();
16592
+ const isCurrentlyOpen = historyDropdownPosition() !== null;
16593
+ if (isCurrentlyOpen) {
16594
+ if (isHistoryHoverOpen()) {
16595
+ clearHistoryHoverPreviews();
16596
+ setIsHistoryHoverOpen(false);
16597
+ } else {
16598
+ dismissHistoryDropdown();
16599
+ }
16600
+ } else {
16601
+ clearHistoryHoverPreviews();
16602
+ openHistoryDropdown();
16603
+ }
16604
+ };
16605
+ const copyHistoryItemContent = (item) => {
16606
+ copyContent(item.content, {
16607
+ tagName: item.tagName,
16608
+ componentName: item.componentName ?? item.elementName,
16609
+ commentText: item.commentText
16610
+ });
16611
+ const element = historyElementMap.get(item.id);
16612
+ if (!element || !isElementConnected(element)) return;
16613
+ actions.clearLabelInstances();
16614
+ requestAnimationFrame(() => {
16615
+ if (!isElementConnected(element)) return;
16616
+ const bounds = createElementBounds(element);
16617
+ const instanceId = createLabelInstance(bounds, item.tagName, item.componentName, "copied", {
16618
+ element,
16619
+ mouseX: bounds.x + bounds.width / 2
16620
+ });
16621
+ scheduleLabelFade(instanceId);
16622
+ });
16623
+ };
16624
+ const handleHistoryItemSelect = (item) => {
16625
+ clearHistoryHoverPreviews();
16626
+ if (isPromptMode()) {
16627
+ actions.exitPromptMode();
16628
+ actions.clearInputText();
16629
+ }
16630
+ const element = historyElementMap.get(item.id);
16631
+ if (item.isComment && item.commentText && element && isElementConnected(element)) {
16632
+ const bounds = createElementBounds(element);
16633
+ const centerX = bounds.x + bounds.width / 2;
16634
+ const centerY = bounds.y + bounds.height / 2;
16635
+ actions.enterPromptMode({
16636
+ x: centerX,
16637
+ y: centerY
16638
+ }, element);
16639
+ actions.setInputText(item.commentText);
16640
+ } else {
16641
+ copyHistoryItemContent(item);
16642
+ }
16643
+ };
16644
+ const handleHistoryItemRemove = (item) => {
16645
+ clearHistoryHoverPreviews();
16646
+ historyElementMap.delete(item.id);
16647
+ const updatedHistoryItems = removeHistoryItem(item.id);
16648
+ setHistoryItems(updatedHistoryItems);
16649
+ if (updatedHistoryItems.length === 0) {
16650
+ setHasUnreadHistoryItems(false);
16651
+ dismissHistoryDropdown();
16652
+ }
16653
+ };
16654
+ const handleHistoryCopyAll = () => {
16655
+ clearHistoryHoverPreviews();
16656
+ const currentHistoryItems = historyItems2();
16657
+ if (currentHistoryItems.length === 0) return;
16658
+ const combinedContent = joinSnippets(currentHistoryItems.map((historyItem) => historyItem.content));
16659
+ const firstItem = currentHistoryItems[0];
16660
+ copyContent(combinedContent, {
16661
+ componentName: firstItem.componentName ?? firstItem.tagName,
16662
+ entries: currentHistoryItems.map((historyItem) => ({
16663
+ tagName: historyItem.tagName,
16664
+ componentName: historyItem.componentName ?? historyItem.elementName,
16665
+ content: historyItem.content,
16666
+ commentText: historyItem.commentText
16667
+ }))
16668
+ });
16669
+ actions.clearLabelInstances();
16670
+ requestAnimationFrame(() => {
16671
+ batch(() => {
16672
+ for (const historyItem of currentHistoryItems) {
16673
+ const element = historyElementMap.get(historyItem.id);
16674
+ if (!element || !isElementConnected(element)) continue;
16675
+ const bounds = createElementBounds(element);
16676
+ const labelId = `label-${Date.now()}-${Math.random().toString(36).slice(2)}`;
16677
+ actions.addLabelInstance({
16678
+ id: labelId,
16679
+ bounds,
16680
+ tagName: historyItem.tagName,
16681
+ componentName: historyItem.componentName,
16682
+ status: "copied",
16683
+ createdAt: Date.now(),
16684
+ element,
16685
+ mouseX: bounds.x + bounds.width / 2
16686
+ });
16687
+ scheduleLabelFade(labelId);
16688
+ }
16689
+ });
16690
+ });
16691
+ };
16692
+ const handleHistoryItemHover = (historyItemId) => {
16693
+ clearHistoryHoverPreviews();
16694
+ if (historyItemId) {
16695
+ const item = historyItems2().find((innerItem) => innerItem.id === historyItemId);
16696
+ const element = historyElementMap.get(historyItemId);
16697
+ if (item && element && isElementConnected(element)) {
16698
+ addHistoryItemPreview(item, element, "history-hover");
16699
+ }
16700
+ }
16701
+ };
16702
+ const handleHistoryButtonHover = (isHovered) => {
16703
+ cancelHistoryHoverOpenTimeout();
16704
+ clearHistoryHoverPreviews();
16705
+ if (isHovered) {
16706
+ cancelHistoryHoverCloseTimeout();
16707
+ if (historyDropdownPosition() === null) {
16708
+ showAllHistoryItemPreviews();
16709
+ historyHoverOpenTimeoutId = setTimeout(() => {
16710
+ historyHoverOpenTimeoutId = null;
16711
+ setIsHistoryHoverOpen(true);
16712
+ openHistoryDropdown();
16713
+ }, DROPDOWN_HOVER_OPEN_DELAY_MS);
16714
+ }
16715
+ } else if (isHistoryHoverOpen()) {
16716
+ historyHoverCloseTimeoutId = setTimeout(() => {
16717
+ historyHoverCloseTimeoutId = null;
16718
+ dismissHistoryDropdown();
16719
+ }, DROPDOWN_HOVER_OPEN_DELAY_MS);
16720
+ }
16721
+ };
16722
+ const handleHistoryDropdownHover = (isHovered) => {
16723
+ if (isHovered) {
16724
+ cancelHistoryHoverCloseTimeout();
16725
+ } else if (isHistoryHoverOpen()) {
16726
+ historyHoverCloseTimeoutId = setTimeout(() => {
16727
+ historyHoverCloseTimeoutId = null;
16728
+ dismissHistoryDropdown();
16729
+ }, DROPDOWN_HOVER_OPEN_DELAY_MS);
16730
+ }
16731
+ };
16732
+ const handleHistoryCopyAllHover = (isHovered) => {
16733
+ clearHistoryHoverPreviews();
16734
+ if (isHovered) {
16735
+ showAllHistoryItemPreviews();
16736
+ }
16737
+ };
16738
+ const showAllHistoryItemPreviews = () => {
16739
+ for (const item of historyItems2()) {
16740
+ const element = historyElementMap.get(item.id);
16741
+ if (element && isElementConnected(element)) {
16742
+ addHistoryItemPreview(item, element, "history-all-hover");
16743
+ }
16744
+ }
16745
+ };
16746
+ const handleHistoryClear = () => {
16747
+ historyElementMap.clear();
16748
+ const updatedHistoryItems = clearHistory();
16749
+ setHistoryItems(updatedHistoryItems);
16750
+ setHasUnreadHistoryItems(false);
16751
+ dismissHistoryDropdown();
15332
16752
  };
15333
16753
  const handleShowContextMenuSession = (sessionId) => {
15334
16754
  const session = agentManager.sessions().get(sessionId);
@@ -15345,7 +16765,7 @@ var init_core = __esm({
15345
16765
  actions.setFrozenElement(element);
15346
16766
  actions.freeze();
15347
16767
  actions.showContextMenu(session.position, element);
15348
- }, 0);
16768
+ }, DEFERRED_EXECUTION_DELAY_MS);
15349
16769
  };
15350
16770
  const handleShowContextMenuInstance = (instanceId) => {
15351
16771
  const instance = store.labelInstances.find((labelInstance) => labelInstance.id === instanceId);
@@ -15370,7 +16790,7 @@ var init_core = __esm({
15370
16790
  }
15371
16791
  actions.freeze();
15372
16792
  actions.showContextMenu(position, instance.element);
15373
- }, 0);
16793
+ }, DEFERRED_EXECUTION_DELAY_MS);
15374
16794
  };
15375
16795
  createEffect(() => {
15376
16796
  const hue = pluginRegistry.store.theme.hue;
@@ -15517,7 +16937,7 @@ var init_core = __esm({
15517
16937
  },
15518
16938
  onToolbarStateChange: (state) => {
15519
16939
  setCurrentToolbarState(state);
15520
- toolbarStateChangeCallbacks.forEach((cb) => cb(state));
16940
+ toolbarStateChangeCallbacks.forEach((callback) => callback(state));
15521
16941
  },
15522
16942
  onSubscribeToToolbarStateChanges: (callback) => {
15523
16943
  toolbarStateChangeCallbacks.add(callback);
@@ -15526,6 +16946,9 @@ var init_core = __esm({
15526
16946
  };
15527
16947
  },
15528
16948
  onToolbarSelectHoverChange: setIsToolbarSelectHovered,
16949
+ onToolbarRef: (element) => {
16950
+ toolbarElement = element;
16951
+ },
15529
16952
  get contextMenuPosition() {
15530
16953
  return contextMenuPosition();
15531
16954
  },
@@ -15548,7 +16971,36 @@ var init_core = __esm({
15548
16971
  return contextMenuActionContext();
15549
16972
  },
15550
16973
  onContextMenuDismiss: handleContextMenuDismiss,
15551
- onContextMenuHide: deferHideContextMenu
16974
+ onContextMenuHide: deferHideContextMenu,
16975
+ get historyItems() {
16976
+ return historyItems2();
16977
+ },
16978
+ get historyDisconnectedItemIds() {
16979
+ return historyDisconnectedItemIds();
16980
+ },
16981
+ get historyItemCount() {
16982
+ return historyItems2().length;
16983
+ },
16984
+ get hasUnreadHistoryItems() {
16985
+ return hasUnreadHistoryItems();
16986
+ },
16987
+ get historyDropdownPosition() {
16988
+ return historyDropdownPosition();
16989
+ },
16990
+ get isHistoryPinned() {
16991
+ return memo(() => historyDropdownPosition() !== null)() && !isHistoryHoverOpen();
16992
+ },
16993
+ onToggleHistory: handleToggleHistory,
16994
+ onHistoryButtonHover: handleHistoryButtonHover,
16995
+ onHistoryItemSelect: handleHistoryItemSelect,
16996
+ onHistoryItemRemove: handleHistoryItemRemove,
16997
+ onHistoryItemCopy: copyHistoryItemContent,
16998
+ onHistoryItemHover: handleHistoryItemHover,
16999
+ onHistoryCopyAll: handleHistoryCopyAll,
17000
+ onHistoryCopyAllHover: handleHistoryCopyAllHover,
17001
+ onHistoryClear: handleHistoryClear,
17002
+ onHistoryDismiss: dismissHistoryDropdown,
17003
+ onHistoryDropdownHover: handleHistoryDropdownHover
15552
17004
  });
15553
17005
  }, rendererRoot);
15554
17006
  }
@@ -15651,7 +17103,7 @@ var init_core = __esm({
15651
17103
  if (state.enabled !== void 0 && state.enabled !== isEnabled()) {
15652
17104
  setIsEnabled(state.enabled);
15653
17105
  }
15654
- toolbarStateChangeCallbacks.forEach((cb) => cb(newState));
17106
+ toolbarStateChangeCallbacks.forEach((callback) => callback(newState));
15655
17107
  },
15656
17108
  onToolbarStateChange: (callback) => {
15657
17109
  toolbarStateChangeCallbacks.add(callback);
@@ -15661,23 +17113,22 @@ var init_core = __esm({
15661
17113
  },
15662
17114
  dispose: () => {
15663
17115
  hasInited = false;
17116
+ cancelHistoryHoverOpenTimeout();
17117
+ cancelHistoryHoverCloseTimeout();
17118
+ stopTrackingToolbarPosition();
15664
17119
  toolbarStateChangeCallbacks.clear();
15665
17120
  dispose2();
15666
17121
  },
15667
17122
  copyElement: copyElementAPI,
15668
17123
  getSource: async (element) => {
15669
17124
  const stack = await getStack(element);
15670
- if (!stack) return null;
15671
- for (const frame of stack) {
15672
- if (frame.fileName && Pe2(frame.fileName)) {
15673
- return {
15674
- filePath: Ne2(frame.fileName),
15675
- lineNumber: frame.lineNumber ?? null,
15676
- componentName: frame.functionName && checkIsSourceComponentName(frame.functionName) ? frame.functionName : null
15677
- };
15678
- }
15679
- }
15680
- return null;
17125
+ const source = resolveSourceFromStack(stack);
17126
+ if (!source) return null;
17127
+ return {
17128
+ filePath: source.filePath,
17129
+ lineNumber: source.lineNumber ?? null,
17130
+ componentName: source.componentName
17131
+ };
15681
17132
  },
15682
17133
  getState: () => ({
15683
17134
  isActive: isActivated(),
@@ -15694,6 +17145,13 @@ var init_core = __esm({
15694
17145
  bounds: box.bounds,
15695
17146
  createdAt: box.createdAt
15696
17147
  })),
17148
+ labelInstances: store.labelInstances.map((instance) => ({
17149
+ id: instance.id,
17150
+ status: instance.status,
17151
+ tagName: instance.tagName,
17152
+ componentName: instance.componentName,
17153
+ createdAt: instance.createdAt
17154
+ })),
15697
17155
  selectionFilePath: store.selectionFilePath,
15698
17156
  toolbarState: currentToolbarState()
15699
17157
  }),