react-grab 0.1.14 → 0.1.16

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-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-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: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)}.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-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-2{width:calc(var(--spacing)*2)}.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)}.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}.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\\/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}.\\[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)}}}.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}}';
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, WINDOW_REFOCUS_GRACE_PERIOD_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, 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_MIN_SIZE_PX, ARROW_MAX_LABEL_WIDTH_RATIO, ARROW_CENTER_PERCENT, ARROW_LABEL_MARGIN_PX, 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, MAX_RECENT_ITEMS, DROPDOWN_VIEWPORT_PADDING_PX, DROPDOWN_ANCHOR_GAP_PX, DROPDOWN_ICON_SIZE_PX, DROPDOWN_MIN_WIDTH_PX, DROPDOWN_MAX_WIDTH_PX, 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.14";
2155
+ VERSION = "0.1.16";
2156
2156
  VIEWPORT_MARGIN_PX = 8;
2157
2157
  OFFSCREEN_POSITION = -1e3;
2158
2158
  SELECTION_LERP_FACTOR = 0.95;
@@ -2163,8 +2163,9 @@ var init_constants = __esm({
2163
2163
  KEYDOWN_SPAM_TIMEOUT_MS = 200;
2164
2164
  BLUR_DEACTIVATION_THRESHOLD_MS = 500;
2165
2165
  WINDOW_REFOCUS_GRACE_PERIOD_MS = 200;
2166
- INPUT_FOCUS_ACTIVATION_DELAY_MS = 200;
2167
- INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS = 400;
2166
+ INPUT_FOCUS_ACTIVATION_DELAY_MS = 400;
2167
+ INPUT_TEXT_SELECTION_ACTIVATION_DELAY_MS = 600;
2168
+ DEFERRED_EXECUTION_DELAY_MS = 0;
2168
2169
  DEFAULT_KEY_HOLD_DURATION_MS = 100;
2169
2170
  MIN_HOLD_FOR_ACTIVATION_AFTER_COPY_MS = 200;
2170
2171
  RECENT_THRESHOLD_MS = 1e4;
@@ -2177,6 +2178,7 @@ var init_constants = __esm({
2177
2178
  BOUNDS_RECALC_INTERVAL_MS = 100;
2178
2179
  AUTO_SCROLL_EDGE_THRESHOLD_PX = 25;
2179
2180
  AUTO_SCROLL_SPEED_PX = 10;
2181
+ Z_INDEX_HOST = 2147483647;
2180
2182
  Z_INDEX_LABEL = 2147483647;
2181
2183
  Z_INDEX_OVERLAY_CANVAS = 2147483645;
2182
2184
  DRAG_LERP_FACTOR = 0.7;
@@ -2197,6 +2199,7 @@ var init_constants = __esm({
2197
2199
  ARROW_CENTER_PERCENT = 50;
2198
2200
  ARROW_LABEL_MARGIN_PX = 16;
2199
2201
  LABEL_GAP_PX = 4;
2202
+ PREVIEW_TEXT_MAX_LENGTH = 100;
2200
2203
  PREVIEW_ATTR_VALUE_MAX_LENGTH = 15;
2201
2204
  PREVIEW_MAX_ATTRS = 3;
2202
2205
  PREVIEW_PRIORITY_ATTRS = [
@@ -2239,6 +2242,7 @@ var init_constants = __esm({
2239
2242
  TOOLBAR_COLLAPSED_SHORT_PX = 14;
2240
2243
  TOOLBAR_COLLAPSED_LONG_PX = 28;
2241
2244
  TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS = 150;
2245
+ TOGGLE_ANIMATION_BUFFER_MS = 50;
2242
2246
  TOOLBAR_DEFAULT_WIDTH_PX = 78;
2243
2247
  TOOLBAR_DEFAULT_HEIGHT_PX = 28;
2244
2248
  TOOLBAR_SHAKE_TOOLTIP_DURATION_MS = 1500;
@@ -2248,6 +2252,8 @@ var init_constants = __esm({
2248
2252
  DRAG_SELECTION_MAX_SAMPLES_PER_AXIS = 20;
2249
2253
  DRAG_SELECTION_MAX_TOTAL_SAMPLE_POINTS = 100;
2250
2254
  DRAG_SELECTION_EDGE_INSET_PX = 1;
2255
+ MAX_ARROW_NAVIGATION_HISTORY = 50;
2256
+ MAX_MEMORY_SESSIONS = 50;
2251
2257
  MAX_TRANSFORM_ANCESTOR_DEPTH = 6;
2252
2258
  TRANSFORM_EARLY_BAIL_DEPTH = 3;
2253
2259
  ELEMENT_POSITION_CACHE_DISTANCE_THRESHOLD_PX = 2;
@@ -2255,7 +2261,9 @@ var init_constants = __esm({
2255
2261
  VISIBILITY_CACHE_TTL_MS = 50;
2256
2262
  ZOOM_DETECTION_THRESHOLD = 0.01;
2257
2263
  MOUNT_ROOT_RECHECK_DELAY_MS = 1e3;
2258
- MAX_RECENT_ITEMS = 20;
2264
+ MAX_HISTORY_ITEMS = 20;
2265
+ DROPDOWN_ANIMATION_DURATION_MS = 100;
2266
+ DROPDOWN_HOVER_OPEN_DELAY_MS = 200;
2259
2267
  DROPDOWN_VIEWPORT_PADDING_PX = 8;
2260
2268
  DROPDOWN_ANCHOR_GAP_PX = 8;
2261
2269
  DROPDOWN_ICON_SIZE_PX = 11;
@@ -2263,6 +2271,8 @@ var init_constants = __esm({
2263
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,
@@ -2751,9 +2759,6 @@ var init_store2 = __esm({
2751
2759
  setLastGrabbed: (element) => {
2752
2760
  setStore("lastGrabbedElement", element);
2753
2761
  },
2754
- setLastCopied: (element) => {
2755
- setStore("lastCopiedElement", element);
2756
- },
2757
2762
  clearLastCopied: () => {
2758
2763
  setStore("lastCopiedElement", null);
2759
2764
  },
@@ -2770,19 +2775,9 @@ var init_store2 = __esm({
2770
2775
  setStore("selectionFilePath", filePath);
2771
2776
  setStore("selectionLineNumber", lineNumber);
2772
2777
  },
2773
- clearSelectionSource: () => {
2774
- setStore("selectionFilePath", null);
2775
- setStore("selectionLineNumber", null);
2776
- },
2777
2778
  setPendingClickData: (data) => {
2778
2779
  setStore("pendingClickData", data);
2779
2780
  },
2780
- clearPendingClickData: () => {
2781
- setStore("pendingClickData", null);
2782
- },
2783
- setReplySessionId: (sessionId) => {
2784
- setStore("replySessionId", sessionId);
2785
- },
2786
2781
  clearReplySessionId: () => {
2787
2782
  setStore("replySessionId", null);
2788
2783
  },
@@ -2827,22 +2822,12 @@ var init_store2 = __esm({
2827
2822
  (instances) => instances.filter((instance) => instance.id !== instanceId)
2828
2823
  );
2829
2824
  },
2830
- removeLabelsForElement: (element) => {
2831
- setStore(
2832
- "labelInstances",
2833
- (instances) => instances.filter((instance) => instance.element !== element)
2834
- );
2835
- },
2836
2825
  clearLabelInstances: () => {
2837
2826
  setStore("labelInstances", []);
2838
2827
  },
2839
2828
  setHasAgentProvider: (value) => {
2840
2829
  setStore("hasAgentProvider", value);
2841
2830
  },
2842
- setUndoRedoState: (canUndo, canRedo) => {
2843
- setStore("canUndo", canUndo);
2844
- setStore("canRedo", canRedo);
2845
- },
2846
2831
  setAgentCapabilities: (capabilities) => {
2847
2832
  setStore("supportsUndo", capabilities.supportsUndo);
2848
2833
  setStore("supportsFollowUp", capabilities.supportsFollowUp);
@@ -2959,9 +2944,6 @@ var init_store2 = __esm({
2959
2944
  },
2960
2945
  setSelectedAgent: (agent) => {
2961
2946
  setStore("selectedAgent", agent);
2962
- },
2963
- clearSelectedAgent: () => {
2964
- setStore("selectedAgent", null);
2965
2947
  }
2966
2948
  };
2967
2949
  return { store, setStore, actions, isActive, isHolding };
@@ -3068,7 +3050,7 @@ var init_mount_root = __esm({
3068
3050
  }
3069
3051
  const host = document.createElement("div");
3070
3052
  host.setAttribute(ATTRIBUTE_NAME, "true");
3071
- host.style.zIndex = "2147483646";
3053
+ host.style.zIndex = String(Z_INDEX_HOST);
3072
3054
  host.style.position = "fixed";
3073
3055
  host.style.inset = "0";
3074
3056
  host.style.pointerEvents = "none";
@@ -3084,9 +3066,7 @@ var init_mount_root = __esm({
3084
3066
  const doc = document.body ?? document.documentElement;
3085
3067
  doc.appendChild(host);
3086
3068
  setTimeout(() => {
3087
- if (!doc.contains(host)) {
3088
- doc.appendChild(host);
3089
- }
3069
+ doc.appendChild(host);
3090
3070
  }, MOUNT_ROOT_RECHECK_DELAY_MS);
3091
3071
  return root;
3092
3072
  };
@@ -7065,8 +7045,8 @@ var init_selection_label = __esm({
7065
7045
  _tmpl$1 = /* @__PURE__ */ template(`<span class="text-[11px] font-sans text-black/50 ml-4">`);
7066
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">`);
7067
7047
  DEFAULT_OFFSCREEN_POSITION = {
7068
- left: -9999,
7069
- top: -9999,
7048
+ left: SELECTION_LABEL_OFFSCREEN_PX,
7049
+ top: SELECTION_LABEL_OFFSCREEN_PX,
7070
7050
  arrowLeftPercent: ARROW_CENTER_PERCENT,
7071
7051
  arrowLeftOffset: 0,
7072
7052
  edgeOffsetX: 0
@@ -7152,32 +7132,22 @@ var init_selection_label = __esm({
7152
7132
  lastValidPosition = null;
7153
7133
  }
7154
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]);
7155
7136
  createEffect(() => {
7156
- void props.tagName;
7157
- void props.componentName;
7158
- void props.elementsCount;
7159
- void props.statusText;
7160
- void props.inputValue;
7161
- void props.hasAgent;
7162
- void props.isPromptMode;
7163
- void props.isPendingDismiss;
7164
- void props.error;
7165
- void props.isPendingAbort;
7166
- void props.visible;
7167
- void props.status;
7168
- void props.actionCycleState?.items;
7169
- void props.actionCycleState?.activeIndex;
7170
- void props.actionCycleState?.isVisible;
7137
+ void sizeAffectingSignature();
7171
7138
  queueMicrotask(measureContainer);
7172
7139
  });
7173
7140
  createEffect(() => {
7174
7141
  if (props.isPromptMode && inputRef && props.onSubmit) {
7175
- setTimeout(() => {
7142
+ const focusTimeout = setTimeout(() => {
7176
7143
  inputRef?.focus();
7177
- }, 0);
7144
+ }, DEFERRED_EXECUTION_DELAY_MS);
7145
+ onCleanup(() => {
7146
+ clearTimeout(focusTimeout);
7147
+ });
7178
7148
  }
7179
7149
  });
7180
- const computedPosition = () => {
7150
+ const positionComputation = createMemo(() => {
7181
7151
  viewportVersion();
7182
7152
  const bounds = props.selectionBounds;
7183
7153
  const labelWidth = measuredWidth();
@@ -7185,13 +7155,19 @@ var init_selection_label = __esm({
7185
7155
  const hasMeasurements = labelWidth > 0 && labelHeight > 0;
7186
7156
  const hasValidBounds = bounds && bounds.width > 0 && bounds.height > 0;
7187
7157
  if (!hasMeasurements || !hasValidBounds) {
7188
- return lastValidPosition ?? DEFAULT_OFFSCREEN_POSITION;
7158
+ return {
7159
+ position: lastValidPosition ?? DEFAULT_OFFSCREEN_POSITION,
7160
+ computedArrowPosition: null
7161
+ };
7189
7162
  }
7190
7163
  const viewportWidth = window.innerWidth;
7191
7164
  const viewportHeight = window.innerHeight;
7192
7165
  const isSelectionVisibleInViewport = bounds.x + bounds.width > 0 && bounds.x < viewportWidth && bounds.y + bounds.height > 0 && bounds.y < viewportHeight;
7193
7166
  if (!isSelectionVisibleInViewport) {
7194
- return DEFAULT_OFFSCREEN_POSITION;
7167
+ return {
7168
+ position: DEFAULT_OFFSCREEN_POSITION,
7169
+ computedArrowPosition: null
7170
+ };
7195
7171
  }
7196
7172
  const selectionCenterX = bounds.x + bounds.width / 2;
7197
7173
  const cursorX = props.mouseX ?? selectionCenterX;
@@ -7215,9 +7191,6 @@ var init_selection_label = __esm({
7215
7191
  const fitsBelow = positionTop + labelHeight <= viewportHeight - VIEWPORT_MARGIN_PX;
7216
7192
  if (!fitsBelow) {
7217
7193
  positionTop = selectionTop - totalHeightNeeded;
7218
- setArrowPosition("top");
7219
- } else {
7220
- setArrowPosition("bottom");
7221
7194
  }
7222
7195
  if (positionTop < VIEWPORT_MARGIN_PX) {
7223
7196
  positionTop = VIEWPORT_MARGIN_PX;
@@ -7229,19 +7202,29 @@ var init_selection_label = __esm({
7229
7202
  const arrowMaxPx = Math.max(labelWidth - ARROW_LABEL_MARGIN_PX, labelHalfWidth);
7230
7203
  const clampedArrowCenterPx = Math.max(arrowMinPx, Math.min(arrowMaxPx, arrowCenterPx));
7231
7204
  const arrowLeftOffset = clampedArrowCenterPx - labelHalfWidth;
7232
- const position = {
7233
- left: anchorX,
7234
- top: positionTop,
7235
- arrowLeftPercent,
7236
- arrowLeftOffset,
7237
- edgeOffsetX
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
7238
7215
  };
7239
- lastValidPosition = position;
7240
- setHadValidBounds(true);
7241
- return position;
7242
- };
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
+ });
7243
7226
  const handleKeyDown = (event) => {
7244
- if (event.isComposing || event.keyCode === 229) {
7227
+ if (event.isComposing || event.keyCode === IME_COMPOSING_KEY_CODE) {
7245
7228
  return;
7246
7229
  }
7247
7230
  event.stopPropagation();
@@ -7257,8 +7240,11 @@ var init_selection_label = __esm({
7257
7240
  }
7258
7241
  };
7259
7242
  const handleInput = (event) => {
7260
- const target = event.target;
7261
- props.onInputChange?.(target.value);
7243
+ const inputTarget = event.target;
7244
+ if (!(inputTarget instanceof HTMLTextAreaElement)) {
7245
+ return;
7246
+ }
7247
+ props.onInputChange?.(inputTarget.value);
7262
7248
  };
7263
7249
  const tagDisplayResult = () => getTagDisplay({
7264
7250
  tagName: props.tagName,
@@ -8668,7 +8654,7 @@ var init_tooltip = __esm({
8668
8654
  get children() {
8669
8655
  var _el$ = _tmpl$21();
8670
8656
  insert(_el$, () => props.children);
8671
- 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")));
8672
8658
  return _el$;
8673
8659
  }
8674
8660
  });
@@ -8689,6 +8675,23 @@ var init_get_toolbar_icon_color = __esm({
8689
8675
  }
8690
8676
  });
8691
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
+
8692
8695
  // src/components/toolbar/index.tsx
8693
8696
  var _tmpl$28, _tmpl$29, Toolbar;
8694
8697
  var init_toolbar = __esm({
@@ -8719,20 +8722,23 @@ var init_toolbar = __esm({
8719
8722
  init_freeze_pseudo_states();
8720
8723
  init_tooltip();
8721
8724
  init_get_toolbar_icon_color();
8725
+ init_toolbar_layout();
8722
8726
  _tmpl$28 = /* @__PURE__ */ template(`<div style=z-index:2147483647>Enable to continue`);
8723
- _tmpl$29 = /* @__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 class="flex items-center"><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><div class="relative overflow-visible min-w-0"><button data-react-grab-ignore-events data-react-grab-toolbar-recent class="contain-layout flex items-center justify-center cursor-pointer interactive-scale touch-hitbox mr-1.5"></button></div></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">`);
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">`);
8724
8728
  Toolbar = (props) => {
8725
8729
  let containerRef;
8726
8730
  let expandableButtonsRef;
8727
8731
  let unfreezeUpdatesCallback = null;
8728
8732
  let lastKnownExpandableWidth = 0;
8733
+ let lastKnownExpandableHeight = 0;
8734
+ const savedState = loadToolbarState();
8729
8735
  const [isVisible, setIsVisible] = createSignal(false);
8730
8736
  const [isCollapsed, setIsCollapsed] = createSignal(false);
8731
8737
  const [isDragging, setIsDragging] = createSignal(false);
8732
8738
  const [isSnapping, setIsSnapping] = createSignal(false);
8733
8739
  const [isResizing, setIsResizing] = createSignal(false);
8734
- const [snapEdge, setSnapEdge] = createSignal("bottom");
8735
- const [positionRatio, setPositionRatio] = createSignal(0.5);
8740
+ const [snapEdge, setSnapEdge] = createSignal(savedState?.edge ?? "bottom");
8741
+ const [positionRatio, setPositionRatio] = createSignal(savedState?.ratio ?? 0.5);
8736
8742
  const [position, setPosition] = createSignal({
8737
8743
  x: 0,
8738
8744
  y: 0
@@ -8753,21 +8759,62 @@ var init_toolbar = __esm({
8753
8759
  const [isToggleTooltipVisible, setIsToggleTooltipVisible] = createSignal(false);
8754
8760
  const [isShakeTooltipVisible, setIsShakeTooltipVisible] = createSignal(false);
8755
8761
  const [isToggleAnimating, setIsToggleAnimating] = createSignal(false);
8756
- const [isRecentTooltipVisible, setIsRecentTooltipVisible] = createSignal(false);
8757
- const recentTooltipLabel = () => {
8758
- const count = props.recentItemCount ?? 0;
8759
- return count > 0 ? `Recent (${count})` : "Recent";
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}`;
8760
8805
  };
8761
- const tooltipPosition = () => snapEdge() === "top" ? "bottom" : "top";
8762
8806
  const stopEventPropagation = (event) => {
8763
8807
  event.stopPropagation();
8764
8808
  event.stopImmediatePropagation();
8765
8809
  };
8766
- const createFreezeHandlers = (setTooltipVisible, onHoverChange) => ({
8810
+ const createFreezeHandlers = (setTooltipVisible, onHoverChange, options) => ({
8767
8811
  onMouseEnter: () => {
8812
+ if (isDragging()) return;
8768
8813
  setTooltipVisible(true);
8769
- props.onSelectHoverChange?.(true);
8770
- if (!unfreezeUpdatesCallback) {
8814
+ if (options?.shouldSetSelectHoverState !== false) {
8815
+ props.onSelectHoverChange?.(true);
8816
+ }
8817
+ if (options?.shouldFreezeInteractions !== false && !unfreezeUpdatesCallback) {
8771
8818
  unfreezeUpdatesCallback = freezeUpdates();
8772
8819
  freezeGlobalAnimations();
8773
8820
  freezePseudoStates();
@@ -8776,8 +8823,10 @@ var init_toolbar = __esm({
8776
8823
  },
8777
8824
  onMouseLeave: () => {
8778
8825
  setTooltipVisible(false);
8779
- props.onSelectHoverChange?.(false);
8780
- if (!props.isActive && !props.isContextMenuOpen) {
8826
+ if (options?.shouldSetSelectHoverState !== false) {
8827
+ props.onSelectHoverChange?.(false);
8828
+ }
8829
+ if (options?.shouldFreezeInteractions !== false && !props.isActive && !props.isContextMenuOpen) {
8781
8830
  unfreezeUpdatesCallback?.();
8782
8831
  unfreezeUpdatesCallback = null;
8783
8832
  unfreezeGlobalAnimations();
@@ -8795,7 +8844,7 @@ var init_toolbar = __esm({
8795
8844
  left: "rounded-l-none rounded-r-[10px]",
8796
8845
  right: "rounded-r-none rounded-l-[10px]"
8797
8846
  }[edge];
8798
- 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";
8799
8848
  return `${roundedClass} ${paddingClass}`;
8800
8849
  };
8801
8850
  let shakeTooltipTimeout;
@@ -8869,15 +8918,18 @@ var init_toolbar = __esm({
8869
8918
  });
8870
8919
  }
8871
8920
  };
8872
- createEffect(on(() => props.recentItemCount ?? 0, () => {
8921
+ createEffect(on(() => props.historyItemCount ?? 0, () => {
8873
8922
  if (isCollapsed()) return;
8874
- if (recentItemCountTimeout) {
8875
- clearTimeout(recentItemCountTimeout);
8923
+ if (historyItemCountTimeout) {
8924
+ clearTimeout(historyItemCountTimeout);
8876
8925
  }
8877
- recentItemCountTimeout = setTimeout(reclampToolbarToViewport, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
8926
+ historyItemCountTimeout = setTimeout(() => {
8927
+ measureExpandableDimension();
8928
+ reclampToolbarToViewport();
8929
+ }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
8878
8930
  onCleanup(() => {
8879
- if (recentItemCountTimeout) {
8880
- clearTimeout(recentItemCountTimeout);
8931
+ if (historyItemCountTimeout) {
8932
+ clearTimeout(historyItemCountTimeout);
8881
8933
  }
8882
8934
  });
8883
8935
  }, {
@@ -9009,7 +9061,7 @@ var init_toolbar = __esm({
9009
9061
  };
9010
9062
  const handleToggle = createDragAwareHandler(() => props.onToggle?.());
9011
9063
  const handleComment = createDragAwareHandler(() => props.onComment?.());
9012
- const handleRecent = createDragAwareHandler(() => props.onToggleRecent?.());
9064
+ const handleHistory = createDragAwareHandler(() => props.onToggleHistory?.());
9013
9065
  const handleToggleCollapse = createDragAwareHandler(() => {
9014
9066
  const rect = containerRef?.getBoundingClientRect();
9015
9067
  const wasCollapsed = isCollapsed();
@@ -9056,32 +9108,112 @@ var init_toolbar = __esm({
9056
9108
  const isCurrentlyEnabled = Boolean(props.enabled);
9057
9109
  const edge = snapEdge();
9058
9110
  const preTogglePosition = position();
9059
- const expandableWidth = lastKnownExpandableWidth;
9060
- const shouldCompensatePosition = expandableWidth > 0 && edge !== "left";
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
+ }
9061
9147
  if (shouldCompensatePosition) {
9148
+ setIsRapidRetoggle(isToggleAnimating());
9062
9149
  setIsToggleAnimating(true);
9063
9150
  }
9064
9151
  props.onToggleEnabled?.();
9065
- if (expandableWidth > 0) {
9066
- const widthChange = isCurrentlyEnabled ? -expandableWidth : expandableWidth;
9067
- expandedDimensions = {
9068
- width: expandedDimensions.width + widthChange,
9069
- height: expandedDimensions.height
9070
- };
9071
- }
9072
9152
  if (shouldCompensatePosition) {
9073
- const viewport = getVisualViewport();
9074
- const positionOffset = isCurrentlyEnabled ? expandableWidth : -expandableWidth;
9075
- const clampMin = viewport.offsetLeft + TOOLBAR_SNAP_MARGIN_PX;
9076
- const clampMax = viewport.offsetLeft + viewport.width - expandedDimensions.width - TOOLBAR_SNAP_MARGIN_PX;
9077
- const compensatedX = clampToViewport2(preTogglePosition.x + positionOffset, clampMin, clampMax);
9078
- setPosition({
9079
- x: compensatedX,
9080
- y: preTogglePosition.y
9081
- });
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
+ }
9082
9207
  clearTimeout(toggleAnimationTimeout);
9083
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));
9084
9215
  setIsToggleAnimating(false);
9216
+ setIsRapidRetoggle(false);
9085
9217
  const newRatio = getRatioFromPosition(edge, position().x, position().y, expandedDimensions.width, expandedDimensions.height);
9086
9218
  setPositionRatio(newRatio);
9087
9219
  saveAndNotify({
@@ -9091,20 +9223,13 @@ var init_toolbar = __esm({
9091
9223
  enabled: !isCurrentlyEnabled
9092
9224
  });
9093
9225
  }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
9094
- } else if (!isCurrentlyEnabled && lastKnownExpandableWidth === 0) {
9095
- clearTimeout(toggleAnimationTimeout);
9096
- toggleAnimationTimeout = setTimeout(() => {
9097
- if (expandableButtonsRef) {
9098
- lastKnownExpandableWidth = expandableButtonsRef.offsetWidth;
9099
- }
9100
- const rect = containerRef?.getBoundingClientRect();
9101
- if (rect) {
9102
- expandedDimensions = {
9103
- width: rect.width,
9104
- height: rect.height
9105
- };
9106
- }
9107
- }, TOOLBAR_COLLAPSE_ANIMATION_DURATION_MS);
9226
+ } else {
9227
+ saveAndNotify({
9228
+ edge,
9229
+ ratio: positionRatio(),
9230
+ collapsed: isCollapsed(),
9231
+ enabled: !isCurrentlyEnabled
9232
+ });
9108
9233
  }
9109
9234
  });
9110
9235
  const getSnapPosition = (currentX, currentY, elementWidth, elementHeight, velocityX, velocityY) => {
@@ -9150,6 +9275,12 @@ var init_toolbar = __esm({
9150
9275
  const distanceMoved = Math.sqrt(Math.pow(event.clientX - pointerStartPosition.x, 2) + Math.pow(event.clientY - pointerStartPosition.y, 2));
9151
9276
  if (distanceMoved > TOOLBAR_DRAG_THRESHOLD_PX) {
9152
9277
  setHasDragMoved(true);
9278
+ if (unfreezeUpdatesCallback) {
9279
+ unfreezeUpdatesCallback();
9280
+ unfreezeUpdatesCallback = null;
9281
+ unfreezeGlobalAnimations();
9282
+ unfreezePseudoStates();
9283
+ }
9153
9284
  }
9154
9285
  if (!hasDragMoved()) return;
9155
9286
  const now = performance.now();
@@ -9193,11 +9324,16 @@ var init_toolbar = __esm({
9193
9324
  setPositionRatio(ratio);
9194
9325
  setIsSnapping(true);
9195
9326
  requestAnimationFrame(() => {
9327
+ const postRenderRect = containerRef?.getBoundingClientRect();
9328
+ if (postRenderRect) {
9329
+ expandedDimensions = {
9330
+ width: postRenderRect.width,
9331
+ height: postRenderRect.height
9332
+ };
9333
+ }
9196
9334
  requestAnimationFrame(() => {
9197
- setPosition({
9198
- x: snap.x,
9199
- y: snap.y
9200
- });
9335
+ const snappedPosition = getPositionFromEdgeAndRatio(snap.edge, ratio, expandedDimensions.width, expandedDimensions.height);
9336
+ setPosition(snappedPosition);
9201
9337
  saveAndNotify({
9202
9338
  edge: snap.edge,
9203
9339
  ratio,
@@ -9206,6 +9342,9 @@ var init_toolbar = __esm({
9206
9342
  });
9207
9343
  snapAnimationTimeout = setTimeout(() => {
9208
9344
  setIsSnapping(false);
9345
+ if (props.enabled) {
9346
+ measureExpandableDimension();
9347
+ }
9209
9348
  }, TOOLBAR_SNAP_ANIMATION_DURATION_MS);
9210
9349
  });
9211
9350
  });
@@ -9293,7 +9432,8 @@ var init_toolbar = __esm({
9293
9432
  let collapseAnimationTimeout;
9294
9433
  let snapAnimationTimeout;
9295
9434
  let toggleAnimationTimeout;
9296
- let recentItemCountTimeout;
9435
+ let toggleAnimationRafId;
9436
+ let historyItemCountTimeout;
9297
9437
  const handleResize = () => {
9298
9438
  if (isDragging()) return;
9299
9439
  setIsResizing(true);
@@ -9321,12 +9461,9 @@ var init_toolbar = __esm({
9321
9461
  if (containerRef) {
9322
9462
  props.onContainerRef?.(containerRef);
9323
9463
  }
9324
- const savedState = loadToolbarState();
9325
9464
  const rect = containerRef?.getBoundingClientRect();
9326
9465
  const viewport = getVisualViewport();
9327
9466
  if (savedState) {
9328
- setSnapEdge(savedState.edge);
9329
- setPositionRatio(savedState.ratio);
9330
9467
  if (rect) {
9331
9468
  expandedDimensions = {
9332
9469
  width: rect.width,
@@ -9357,8 +9494,8 @@ var init_toolbar = __esm({
9357
9494
  const defaultPosition = getPositionFromEdgeAndRatio("bottom", 0.5, expandedDimensions.width, expandedDimensions.height);
9358
9495
  setPosition(defaultPosition);
9359
9496
  }
9360
- if (props.enabled && expandableButtonsRef) {
9361
- lastKnownExpandableWidth = expandableButtonsRef.offsetWidth;
9497
+ if (props.enabled) {
9498
+ measureExpandableDimension();
9362
9499
  }
9363
9500
  if (props.onSubscribeToStateChanges) {
9364
9501
  const unsubscribe = props.onSubscribeToStateChanges((state) => {
@@ -9418,7 +9555,10 @@ var init_toolbar = __esm({
9418
9555
  clearTimeout(shakeTooltipTimeout);
9419
9556
  clearTimeout(snapAnimationTimeout);
9420
9557
  clearTimeout(toggleAnimationTimeout);
9421
- clearTimeout(recentItemCountTimeout);
9558
+ clearTimeout(historyItemCountTimeout);
9559
+ if (toggleAnimationRafId !== void 0) {
9560
+ cancelAnimationFrame(toggleAnimationRafId);
9561
+ }
9422
9562
  unfreezeUpdatesCallback?.();
9423
9563
  });
9424
9564
  const currentPosition = () => {
@@ -9441,9 +9581,12 @@ var init_toolbar = __esm({
9441
9581
  if (isSnapping()) {
9442
9582
  return "transition-[transform,opacity] duration-300 ease-out";
9443
9583
  }
9444
- if (isCollapseAnimating() || isToggleAnimating()) {
9584
+ if (isCollapseAnimating()) {
9445
9585
  return "transition-[transform,opacity] duration-150 ease-out";
9446
9586
  }
9587
+ if (isToggleAnimating()) {
9588
+ return "transition-opacity duration-150 ease-out";
9589
+ }
9447
9590
  return "transition-opacity duration-300 ease-out";
9448
9591
  };
9449
9592
  const getTransformOrigin = () => {
@@ -9503,7 +9646,11 @@ var init_toolbar = __esm({
9503
9646
  stopEventPropagation(event);
9504
9647
  handlePointerDown(event);
9505
9648
  });
9506
- spread(_el$8, mergeProps(() => createFreezeHandlers(setIsSelectTooltipVisible)), false, true);
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);
9507
9654
  insert(_el$8, createComponent(IconSelect, {
9508
9655
  size: 14,
9509
9656
  get ["class"]() {
@@ -9512,12 +9659,12 @@ var init_toolbar = __esm({
9512
9659
  }));
9513
9660
  insert(_el$7, createComponent(Tooltip, {
9514
9661
  get visible() {
9515
- return memo(() => !!isSelectTooltipVisible())() && !isCollapsed();
9662
+ return memo(() => !!isSelectTooltipVisible())() && isTooltipAllowed();
9516
9663
  },
9517
9664
  get position() {
9518
9665
  return tooltipPosition();
9519
9666
  },
9520
- children: "Select"
9667
+ children: "Select element"
9521
9668
  }), null);
9522
9669
  _el$1.$$click = (event) => {
9523
9670
  setIsCommentTooltipVisible(false);
@@ -9528,7 +9675,11 @@ var init_toolbar = __esm({
9528
9675
  stopEventPropagation(event);
9529
9676
  handlePointerDown(event);
9530
9677
  });
9531
- spread(_el$1, mergeProps(() => createFreezeHandlers(setIsCommentTooltipVisible)), false, true);
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);
9532
9683
  insert(_el$1, createComponent(IconComment, {
9533
9684
  size: 14,
9534
9685
  get ["class"]() {
@@ -9537,49 +9688,63 @@ var init_toolbar = __esm({
9537
9688
  }));
9538
9689
  insert(_el$0, createComponent(Tooltip, {
9539
9690
  get visible() {
9540
- return memo(() => !!isCommentTooltipVisible())() && !isCollapsed();
9691
+ return memo(() => !!isCommentTooltipVisible())() && isTooltipAllowed();
9541
9692
  },
9542
9693
  get position() {
9543
9694
  return tooltipPosition();
9544
9695
  },
9545
- children: "Comment"
9696
+ children: "Add comment"
9546
9697
  }), null);
9547
9698
  _el$12.$$click = (event) => {
9548
- setIsRecentTooltipVisible(false);
9549
- handleRecent(event);
9699
+ setIsHistoryTooltipVisible(false);
9700
+ handleHistory(event);
9550
9701
  };
9551
9702
  addEventListener(_el$12, "mousedown", stopEventPropagation);
9552
9703
  addEventListener(_el$12, "pointerdown", (event) => {
9553
9704
  stopEventPropagation(event);
9554
9705
  handlePointerDown(event);
9555
9706
  });
9556
- spread(_el$12, mergeProps(() => createFreezeHandlers(setIsRecentTooltipVisible, props.onRecentButtonHover)), false, true);
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);
9557
9718
  insert(_el$12, createComponent(Show, {
9558
9719
  get when() {
9559
- return props.hasUnreadRecentItems;
9720
+ return props.hasUnreadHistoryItems;
9560
9721
  },
9561
9722
  get fallback() {
9562
9723
  return createComponent(IconInbox, {
9563
9724
  size: 14,
9564
- "class": "text-[#B3B3B3] transition-colors"
9725
+ get ["class"]() {
9726
+ return historyIconClass();
9727
+ }
9565
9728
  });
9566
9729
  },
9567
9730
  get children() {
9568
9731
  return createComponent(IconInboxUnread, {
9569
9732
  size: 14,
9570
- "class": "text-[#B3B3B3] transition-colors"
9733
+ get ["class"]() {
9734
+ return historyIconClass();
9735
+ }
9571
9736
  });
9572
9737
  }
9573
9738
  }));
9574
9739
  insert(_el$11, createComponent(Tooltip, {
9575
9740
  get visible() {
9576
- return memo(() => !!isRecentTooltipVisible())() && !isCollapsed();
9741
+ return memo(() => !!isHistoryTooltipVisible())() && isTooltipAllowed();
9577
9742
  },
9578
9743
  get position() {
9579
9744
  return tooltipPosition();
9580
9745
  },
9581
9746
  get children() {
9582
- return recentTooltipLabel();
9747
+ return historyTooltipLabel();
9583
9748
  }
9584
9749
  }), null);
9585
9750
  _el$14.addEventListener("mouseleave", () => setIsToggleTooltipVisible(false));
@@ -9590,7 +9755,7 @@ var init_toolbar = __esm({
9590
9755
  };
9591
9756
  insert(_el$13, createComponent(Tooltip, {
9592
9757
  get visible() {
9593
- return memo(() => !!isToggleTooltipVisible())() && !isCollapsed();
9758
+ return memo(() => !!isToggleTooltipVisible())() && isTooltipAllowed();
9594
9759
  },
9595
9760
  get position() {
9596
9761
  return tooltipPosition();
@@ -9612,23 +9777,29 @@ var init_toolbar = __esm({
9612
9777
  },
9613
9778
  get children() {
9614
9779
  var _el$18 = _tmpl$28();
9615
- createRenderEffect(() => className(_el$18, 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")));
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())));
9616
9781
  return _el$18;
9617
9782
  }
9618
9783
  }), null);
9619
9784
  createRenderEffect((_p$) => {
9620
- 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("grid transition-all duration-150 ease-out", props.enabled && (props.recentItemCount ?? 0) > 0 ? "grid-cols-[1fr] opacity-100" : "grid-cols-[0fr] opacity-0 pointer-events-none"), _v$0 = cn("relative w-5 h-3 rounded-full transition-colors", props.enabled ? "bg-black" : "bg-black/25"), _v$1 = 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"));
9621
9786
  _v$ !== _p$.e && className(_el$, _p$.e = _v$);
9622
9787
  _v$2 !== _p$.t && setStyleProperty(_el$, "transform", _p$.t = _v$2);
9623
9788
  _v$3 !== _p$.a && setStyleProperty(_el$, "transform-origin", _p$.a = _v$3);
9624
9789
  _v$4 !== _p$.o && className(_el$2, _p$.o = _v$4);
9625
9790
  _v$5 !== _p$.i && setStyleProperty(_el$2, "transform-origin", _p$.i = _v$5);
9626
9791
  _v$6 !== _p$.n && className(_el$3, _p$.n = _v$6);
9627
- _v$7 !== _p$.s && className(_el$6, _p$.s = _v$7);
9628
- _v$8 !== _p$.h && className(_el$9, _p$.h = _v$8);
9629
- _v$9 !== _p$.r && className(_el$10, _p$.r = _v$9);
9630
- _v$0 !== _p$.d && className(_el$15, _p$.d = _v$0);
9631
- _v$1 !== _p$.l && className(_el$16, _p$.l = _v$1);
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);
9632
9803
  return _p$;
9633
9804
  }, {
9634
9805
  e: void 0,
@@ -9641,7 +9812,13 @@ var init_toolbar = __esm({
9641
9812
  h: void 0,
9642
9813
  r: void 0,
9643
9814
  d: void 0,
9644
- l: 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
9645
9822
  });
9646
9823
  return _el$;
9647
9824
  })();
@@ -10023,10 +10200,10 @@ var init_icon_copy = __esm({
10023
10200
  }
10024
10201
  });
10025
10202
 
10026
- // src/components/recent-dropdown.tsx
10027
- var _tmpl$37, _tmpl$211, _tmpl$38, _tmpl$45, DEFAULT_OFFSCREEN_POSITION2, ITEM_ACTION_CLASS, formatRelativeTime, RecentDropdown;
10028
- var init_recent_dropdown = __esm({
10029
- "src/components/recent-dropdown.tsx"() {
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, getHistoryItemDisplayName, HistoryDropdown;
10205
+ var init_history_dropdown = __esm({
10206
+ "src/components/history-dropdown.tsx"() {
10030
10207
  "use strict";
10031
10208
  init_web();
10032
10209
  init_web();
@@ -10036,23 +10213,30 @@ var init_recent_dropdown = __esm({
10036
10213
  init_web();
10037
10214
  init_web();
10038
10215
  init_web();
10216
+ init_web();
10039
10217
  init_solid();
10040
10218
  init_constants();
10041
10219
  init_clamp_to_viewport();
10042
10220
  init_cn();
10043
- init_is_event_from_overlay();
10044
10221
  init_icon_trash();
10045
10222
  init_icon_copy();
10223
+ init_icon_check();
10046
10224
  init_tooltip();
10047
- _tmpl$37 = /* @__PURE__ */ template(`<div class="flex items-center gap-[5px]"><div class=relative><button data-react-grab-ignore-events data-react-grab-recent-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-recent-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"><span class="text-[11px] font-sans text-black/50">\u21B5`);
10048
- _tmpl$211 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-recent-dropdown 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 justify-between px-2 pt-1.5 pb-1"><span class="text-[11px] font-medium text-black/40">Recent</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">`);
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">`);
10049
10227
  _tmpl$38 = /* @__PURE__ */ template(`<span class="text-[11px] leading-3 font-sans text-black/40 truncate mt-0.5">`);
10050
- _tmpl$45 = /* @__PURE__ */ template(`<div data-react-grab-ignore-events data-react-grab-recent-item class="group contain-layout flex items-start justify-between w-full px-2 py-1 cursor-pointer transition-colors 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-recent-item-remove></button><button data-react-grab-ignore-events data-react-grab-recent-item-copy>`);
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>`);
10051
10229
  DEFAULT_OFFSCREEN_POSITION2 = {
10052
10230
  left: -9999,
10053
10231
  top: -9999
10054
10232
  };
10055
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
+ };
10056
10240
  formatRelativeTime = (timestamp) => {
10057
10241
  const elapsedSeconds = Math.floor((Date.now() - timestamp) / 1e3);
10058
10242
  if (elapsedSeconds < 60) return "now";
@@ -10062,24 +10246,59 @@ var init_recent_dropdown = __esm({
10062
10246
  if (elapsedHours < 24) return `${elapsedHours}h`;
10063
10247
  return `${Math.floor(elapsedHours / 24)}d`;
10064
10248
  };
10065
- RecentDropdown = (props) => {
10249
+ getHistoryItemDisplayName = (item) => {
10250
+ if (item.elementsCount && item.elementsCount > 1) {
10251
+ return `${item.elementsCount} elements`;
10252
+ }
10253
+ return item.componentName ?? item.tagName;
10254
+ };
10255
+ HistoryDropdown = (props) => {
10066
10256
  let containerRef;
10067
10257
  const [measuredWidth, setMeasuredWidth] = createSignal(0);
10068
10258
  const [measuredHeight, setMeasuredHeight] = createSignal(0);
10069
10259
  const [activeHeaderTooltip, setActiveHeaderTooltip] = createSignal(null);
10260
+ const [isCopyAllConfirmed, setIsCopyAllConfirmed] = createSignal(false);
10261
+ const [confirmedCopyItemId, setConfirmedCopyItemId] = createSignal(null);
10262
+ let copyAllFeedbackTimeout;
10263
+ let copyItemFeedbackTimeout;
10264
+ let exitAnimationTimeout;
10265
+ let enterAnimationFrameId;
10070
10266
  const isVisible = () => props.position !== null;
10267
+ const [shouldMount, setShouldMount] = createSignal(false);
10268
+ const [isAnimatedIn, setIsAnimatedIn] = createSignal(false);
10269
+ const [lastAnchorEdge, setLastAnchorEdge] = createSignal("bottom");
10071
10270
  const measureContainer = () => {
10072
10271
  if (containerRef) {
10073
- const rect = containerRef.getBoundingClientRect();
10074
- setMeasuredWidth(rect.width);
10075
- setMeasuredHeight(rect.height);
10272
+ setMeasuredWidth(containerRef.offsetWidth);
10273
+ setMeasuredHeight(containerRef.offsetHeight);
10076
10274
  }
10077
10275
  };
10078
10276
  createEffect(() => {
10079
10277
  if (isVisible()) {
10080
- requestAnimationFrame(measureContainer);
10278
+ if (props.position) setLastAnchorEdge(props.position.edge);
10279
+ clearTimeout(exitAnimationTimeout);
10280
+ setShouldMount(true);
10281
+ if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
10282
+ enterAnimationFrameId = requestAnimationFrame(() => {
10283
+ measureContainer();
10284
+ void containerRef?.offsetHeight;
10285
+ setIsAnimatedIn(true);
10286
+ });
10287
+ } else {
10288
+ if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
10289
+ setIsAnimatedIn(false);
10290
+ exitAnimationTimeout = setTimeout(() => {
10291
+ setShouldMount(false);
10292
+ }, DROPDOWN_ANIMATION_DURATION_MS);
10081
10293
  }
10082
10294
  });
10295
+ createEffect(on(isAnimatedIn, (animatedIn) => {
10296
+ if (animatedIn && containerRef?.matches(":hover")) {
10297
+ props.onDropdownHover?.(true);
10298
+ }
10299
+ }, {
10300
+ defer: true
10301
+ }));
10083
10302
  const computedPosition = () => {
10084
10303
  const anchor = props.position;
10085
10304
  const width = measuredWidth();
@@ -10096,7 +10315,7 @@ var init_recent_dropdown = __esm({
10096
10315
  rawLeft = edge === "left" ? anchor.x + DROPDOWN_ANCHOR_GAP_PX : anchor.x - width - DROPDOWN_ANCHOR_GAP_PX;
10097
10316
  rawTop = anchor.y - height / 2;
10098
10317
  } else {
10099
- rawLeft = anchor.x - anchor.toolbarWidth / 2;
10318
+ rawLeft = anchor.x - width / 2;
10100
10319
  rawTop = edge === "top" ? anchor.y + DROPDOWN_ANCHOR_GAP_PX : anchor.y - height - DROPDOWN_ANCHOR_GAP_PX;
10101
10320
  }
10102
10321
  return {
@@ -10104,8 +10323,15 @@ var init_recent_dropdown = __esm({
10104
10323
  top: clampToViewport(rawTop, height, window.innerHeight, DROPDOWN_VIEWPORT_PADDING_PX)
10105
10324
  };
10106
10325
  };
10107
- const clampedMaxWidth = () => Math.min(DROPDOWN_MAX_WIDTH_PX, window.innerWidth - computedPosition().left - DROPDOWN_VIEWPORT_PADDING_PX);
10108
- const clampedMaxHeight = () => window.innerHeight - computedPosition().top - DROPDOWN_VIEWPORT_PADDING_PX;
10326
+ const displayPosition = createMemo((previousPosition) => {
10327
+ const position = computedPosition();
10328
+ if (position.left !== DEFAULT_OFFSCREEN_POSITION2.left) {
10329
+ return position;
10330
+ }
10331
+ return previousPosition;
10332
+ }, DEFAULT_OFFSCREEN_POSITION2);
10333
+ const clampedMaxWidth = () => Math.min(DROPDOWN_MAX_WIDTH_PX, window.innerWidth - displayPosition().left - DROPDOWN_VIEWPORT_PADDING_PX);
10334
+ const clampedMaxHeight = () => window.innerHeight - displayPosition().top - DROPDOWN_VIEWPORT_PADDING_PX;
10109
10335
  const panelMinWidth = () => Math.max(DROPDOWN_MIN_WIDTH_PX, props.position?.toolbarWidth ?? 0);
10110
10336
  const handleMenuEvent = (event) => {
10111
10337
  if (event.type === "contextmenu") {
@@ -10115,11 +10341,6 @@ var init_recent_dropdown = __esm({
10115
10341
  };
10116
10342
  onMount(() => {
10117
10343
  measureContainer();
10118
- const handleClickOutside = (event) => {
10119
- if (!isVisible() || isEventFromOverlay(event, "data-react-grab-ignore-events")) return;
10120
- if (event instanceof MouseEvent && event.button === 2) return;
10121
- props.onDismiss?.();
10122
- };
10123
10344
  const handleKeyDown = (event) => {
10124
10345
  if (!isVisible()) return;
10125
10346
  if (event.code === "Escape") {
@@ -10127,31 +10348,15 @@ var init_recent_dropdown = __esm({
10127
10348
  event.stopPropagation();
10128
10349
  props.onDismiss?.();
10129
10350
  }
10130
- if (event.code === "Enter" && props.items.length > 0) {
10131
- event.preventDefault();
10132
- event.stopPropagation();
10133
- props.onCopyAll?.();
10134
- }
10135
10351
  };
10136
- const frameId = requestAnimationFrame(() => {
10137
- window.addEventListener("mousedown", handleClickOutside, {
10138
- capture: true
10139
- });
10140
- window.addEventListener("touchstart", handleClickOutside, {
10141
- capture: true
10142
- });
10143
- });
10144
10352
  window.addEventListener("keydown", handleKeyDown, {
10145
10353
  capture: true
10146
10354
  });
10147
10355
  onCleanup(() => {
10148
- cancelAnimationFrame(frameId);
10149
- window.removeEventListener("mousedown", handleClickOutside, {
10150
- capture: true
10151
- });
10152
- window.removeEventListener("touchstart", handleClickOutside, {
10153
- capture: true
10154
- });
10356
+ clearTimeout(copyAllFeedbackTimeout);
10357
+ clearTimeout(copyItemFeedbackTimeout);
10358
+ clearTimeout(exitAnimationTimeout);
10359
+ if (enterAnimationFrameId !== void 0) cancelAnimationFrame(enterAnimationFrameId);
10155
10360
  window.removeEventListener("keydown", handleKeyDown, {
10156
10361
  capture: true
10157
10362
  });
@@ -10159,10 +10364,12 @@ var init_recent_dropdown = __esm({
10159
10364
  });
10160
10365
  return createComponent(Show, {
10161
10366
  get when() {
10162
- return isVisible();
10367
+ return shouldMount();
10163
10368
  },
10164
10369
  get children() {
10165
- var _el$ = _tmpl$211(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$1 = _el$3.nextSibling, _el$10 = _el$1.firstChild;
10370
+ 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;
10371
+ _el$.addEventListener("mouseleave", () => props.onDropdownHover?.(false));
10372
+ _el$.addEventListener("mouseenter", () => props.onDropdownHover?.(true));
10166
10373
  _el$.$$contextmenu = handleMenuEvent;
10167
10374
  _el$.$$click = handleMenuEvent;
10168
10375
  _el$.$$mousedown = handleMenuEvent;
@@ -10174,7 +10381,7 @@ var init_recent_dropdown = __esm({
10174
10381
  return props.items.length > 0;
10175
10382
  },
10176
10383
  get children() {
10177
- 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, _el$0 = _el$9.firstChild;
10384
+ 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;
10178
10385
  _el$7.addEventListener("mouseleave", () => setActiveHeaderTooltip(null));
10179
10386
  _el$7.addEventListener("mouseenter", () => setActiveHeaderTooltip("clear"));
10180
10387
  _el$7.$$click = (event) => {
@@ -10198,16 +10405,36 @@ var init_recent_dropdown = __esm({
10198
10405
  });
10199
10406
  _el$9.addEventListener("mouseenter", () => {
10200
10407
  setActiveHeaderTooltip("copy");
10201
- props.onCopyAllHover?.(true);
10408
+ if (!isCopyAllConfirmed()) {
10409
+ props.onCopyAllHover?.(true);
10410
+ }
10202
10411
  });
10203
10412
  _el$9.$$click = (event) => {
10204
10413
  event.stopPropagation();
10205
10414
  setActiveHeaderTooltip(null);
10206
10415
  props.onCopyAll?.();
10416
+ setIsCopyAllConfirmed(true);
10417
+ clearTimeout(copyAllFeedbackTimeout);
10418
+ copyAllFeedbackTimeout = setTimeout(() => {
10419
+ setIsCopyAllConfirmed(false);
10420
+ }, FEEDBACK_DURATION_MS);
10207
10421
  };
10208
- insert(_el$9, createComponent(IconCopy, {
10209
- size: DROPDOWN_ICON_SIZE_PX
10210
- }), _el$0);
10422
+ insert(_el$9, createComponent(Show, {
10423
+ get when() {
10424
+ return isCopyAllConfirmed();
10425
+ },
10426
+ get fallback() {
10427
+ return createComponent(IconCopy, {
10428
+ size: DROPDOWN_ICON_SIZE_PX
10429
+ });
10430
+ },
10431
+ get children() {
10432
+ return createComponent(IconCheck, {
10433
+ size: DROPDOWN_ICON_SIZE_PX,
10434
+ "class": "text-black"
10435
+ });
10436
+ }
10437
+ }));
10211
10438
  insert(_el$8, createComponent(Tooltip, {
10212
10439
  get visible() {
10213
10440
  return activeHeaderTooltip() === "copy";
@@ -10218,72 +10445,103 @@ var init_recent_dropdown = __esm({
10218
10445
  return _el$5;
10219
10446
  }
10220
10447
  }), null);
10221
- insert(_el$10, createComponent(For, {
10448
+ insert(_el$1, createComponent(For, {
10222
10449
  get each() {
10223
10450
  return props.items;
10224
10451
  },
10225
10452
  children: (item) => (() => {
10226
- var _el$11 = _tmpl$45(), _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$15 = _el$12.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$16.nextSibling, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling;
10227
- _el$11.addEventListener("mouseleave", () => props.onItemHover?.(null));
10228
- _el$11.addEventListener("mouseenter", () => props.onItemHover?.(item.id));
10229
- _el$11.$$keydown = (event) => {
10453
+ 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;
10454
+ _el$10.addEventListener("mouseleave", () => props.onItemHover?.(null));
10455
+ _el$10.addEventListener("mouseenter", () => props.onItemHover?.(item.id));
10456
+ _el$10.$$keydown = (event) => {
10230
10457
  if (event.code === "Space" && event.currentTarget === event.target) {
10231
10458
  event.preventDefault();
10232
10459
  event.stopPropagation();
10233
10460
  props.onSelectItem?.(item);
10234
10461
  }
10235
10462
  };
10236
- _el$11.$$click = (event) => {
10463
+ _el$10.$$click = (event) => {
10237
10464
  event.stopPropagation();
10238
10465
  props.onSelectItem?.(item);
10466
+ setConfirmedCopyItemId(item.id);
10467
+ clearTimeout(copyItemFeedbackTimeout);
10468
+ copyItemFeedbackTimeout = setTimeout(() => {
10469
+ setConfirmedCopyItemId(null);
10470
+ }, FEEDBACK_DURATION_MS);
10239
10471
  };
10240
- _el$11.$$pointerdown = (event) => event.stopPropagation();
10241
- insert(_el$13, () => item.componentName ?? item.tagName);
10242
- insert(_el$12, createComponent(Show, {
10472
+ _el$10.$$pointerdown = (event) => event.stopPropagation();
10473
+ insert(_el$12, () => getHistoryItemDisplayName(item));
10474
+ insert(_el$11, createComponent(Show, {
10243
10475
  get when() {
10244
10476
  return item.commentText;
10245
10477
  },
10246
10478
  get children() {
10247
- var _el$14 = _tmpl$38();
10248
- insert(_el$14, () => item.commentText);
10249
- return _el$14;
10479
+ var _el$13 = _tmpl$38();
10480
+ insert(_el$13, () => item.commentText);
10481
+ return _el$13;
10250
10482
  }
10251
10483
  }), null);
10252
- insert(_el$16, () => formatRelativeTime(item.timestamp));
10253
- _el$18.$$click = (event) => {
10484
+ insert(_el$15, () => formatRelativeTime(item.timestamp));
10485
+ _el$17.$$click = (event) => {
10254
10486
  event.stopPropagation();
10255
10487
  props.onRemoveItem?.(item);
10256
10488
  };
10257
- insert(_el$18, createComponent(IconTrash, {
10489
+ insert(_el$17, createComponent(IconTrash, {
10258
10490
  size: DROPDOWN_ICON_SIZE_PX
10259
10491
  }));
10260
- _el$19.$$click = (event) => {
10492
+ _el$18.$$click = (event) => {
10261
10493
  event.stopPropagation();
10262
10494
  props.onCopyItem?.(item);
10495
+ setConfirmedCopyItemId(item.id);
10496
+ clearTimeout(copyItemFeedbackTimeout);
10497
+ copyItemFeedbackTimeout = setTimeout(() => {
10498
+ setConfirmedCopyItemId(null);
10499
+ }, FEEDBACK_DURATION_MS);
10263
10500
  };
10264
- insert(_el$19, createComponent(IconCopy, {
10265
- size: DROPDOWN_ICON_SIZE_PX
10501
+ insert(_el$18, createComponent(Show, {
10502
+ get when() {
10503
+ return confirmedCopyItemId() === item.id;
10504
+ },
10505
+ get fallback() {
10506
+ return createComponent(IconCopy, {
10507
+ size: DROPDOWN_ICON_SIZE_PX
10508
+ });
10509
+ },
10510
+ get children() {
10511
+ return createComponent(IconCheck, {
10512
+ size: DROPDOWN_ICON_SIZE_PX,
10513
+ "class": "text-black"
10514
+ });
10515
+ }
10266
10516
  }));
10267
10517
  createRenderEffect((_p$) => {
10268
- var _v$7 = cn(ITEM_ACTION_CLASS, "hover:text-[#B91C1C]"), _v$8 = cn(ITEM_ACTION_CLASS, "hover:text-black/60");
10269
- _v$7 !== _p$.e && className(_el$18, _p$.e = _v$7);
10270
- _v$8 !== _p$.t && className(_el$19, _p$.t = _v$8);
10518
+ var _v$1 = {
10519
+ "opacity-40 hover:opacity-100": Boolean(props.disconnectedItemIds?.has(item.id))
10520
+ }, _v$10 = cn(ITEM_ACTION_CLASS, "hover:text-[#B91C1C]"), _v$11 = cn(ITEM_ACTION_CLASS, "hover:text-black/60");
10521
+ _p$.e = classList(_el$10, _v$1, _p$.e);
10522
+ _v$10 !== _p$.t && className(_el$17, _p$.t = _v$10);
10523
+ _v$11 !== _p$.a && className(_el$18, _p$.a = _v$11);
10271
10524
  return _p$;
10272
10525
  }, {
10273
10526
  e: void 0,
10274
- t: void 0
10527
+ t: void 0,
10528
+ a: void 0
10275
10529
  });
10276
- return _el$11;
10530
+ return _el$10;
10277
10531
  })()
10278
10532
  }));
10279
10533
  createRenderEffect((_p$) => {
10280
- var _v$ = `${computedPosition().top}px`, _v$2 = `${computedPosition().left}px`, _v$3 = 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$4 = `${panelMinWidth()}px`, _v$5 = `${clampedMaxWidth()}px`, _v$6 = `${clampedMaxHeight()}px`;
10534
+ 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`;
10281
10535
  _v$ !== _p$.e && setStyleProperty(_el$, "top", _p$.e = _v$);
10282
10536
  _v$2 !== _p$.t && setStyleProperty(_el$, "left", _p$.t = _v$2);
10283
- _v$3 !== _p$.a && className(_el$2, _p$.a = _v$3);
10284
- _v$4 !== _p$.o && setStyleProperty(_el$2, "min-width", _p$.o = _v$4);
10285
- _v$5 !== _p$.i && setStyleProperty(_el$2, "max-width", _p$.i = _v$5);
10286
- _v$6 !== _p$.n && setStyleProperty(_el$2, "max-height", _p$.n = _v$6);
10537
+ _v$3 !== _p$.a && setStyleProperty(_el$, "pointer-events", _p$.a = _v$3);
10538
+ _v$4 !== _p$.o && setStyleProperty(_el$, "transform-origin", _p$.o = _v$4);
10539
+ _v$5 !== _p$.i && setStyleProperty(_el$, "opacity", _p$.i = _v$5);
10540
+ _v$6 !== _p$.n && setStyleProperty(_el$, "transform", _p$.n = _v$6);
10541
+ _v$7 !== _p$.s && className(_el$2, _p$.s = _v$7);
10542
+ _v$8 !== _p$.h && setStyleProperty(_el$2, "min-width", _p$.h = _v$8);
10543
+ _v$9 !== _p$.r && setStyleProperty(_el$2, "max-width", _p$.r = _v$9);
10544
+ _v$0 !== _p$.d && setStyleProperty(_el$2, "max-height", _p$.d = _v$0);
10287
10545
  return _p$;
10288
10546
  }, {
10289
10547
  e: void 0,
@@ -10291,7 +10549,11 @@ var init_recent_dropdown = __esm({
10291
10549
  a: void 0,
10292
10550
  o: void 0,
10293
10551
  i: void 0,
10294
- n: void 0
10552
+ n: void 0,
10553
+ s: void 0,
10554
+ h: void 0,
10555
+ r: void 0,
10556
+ d: void 0
10295
10557
  });
10296
10558
  return _el$;
10297
10559
  }
@@ -10314,11 +10576,12 @@ var init_renderer = __esm({
10314
10576
  init_solid();
10315
10577
  init_constants();
10316
10578
  init_build_open_file_url();
10579
+ init_is_element_connected();
10317
10580
  init_overlay_canvas();
10318
10581
  init_selection_label();
10319
10582
  init_toolbar();
10320
10583
  init_context_menu();
10321
- init_recent_dropdown();
10584
+ init_history_dropdown();
10322
10585
  _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)">`);
10323
10586
  ReactGrabRenderer = (props) => {
10324
10587
  return [createComponent(OverlayCanvas, {
@@ -10533,6 +10796,9 @@ var init_renderer = __esm({
10533
10796
  get componentName() {
10534
10797
  return instance().componentName;
10535
10798
  },
10799
+ get elementsCount() {
10800
+ return instance().elementsCount;
10801
+ },
10536
10802
  get selectionBounds() {
10537
10803
  return instance().bounds;
10538
10804
  },
@@ -10562,7 +10828,12 @@ var init_renderer = __esm({
10562
10828
  return instance().hideArrow;
10563
10829
  },
10564
10830
  get onShowContextMenu() {
10565
- return (instance().status === "copied" || instance().status === "fading") && instance().element && (document.body ?? document.documentElement).contains(instance().element) ? () => props.onShowContextMenuInstance?.(instance().id) : void 0;
10831
+ const currentInstance = instance();
10832
+ const hasCompletedStatus = currentInstance.status === "copied" || currentInstance.status === "fading";
10833
+ if (!hasCompletedStatus || !isElementConnected(currentInstance.element)) {
10834
+ return void 0;
10835
+ }
10836
+ return () => props.onShowContextMenuInstance?.(currentInstance.id);
10566
10837
  },
10567
10838
  onHoverChange: (isHovered) => props.onLabelInstanceHoverChange?.(instance().id, isHovered)
10568
10839
  })
@@ -10608,17 +10879,23 @@ var init_renderer = __esm({
10608
10879
  get onContainerRef() {
10609
10880
  return props.onToolbarRef;
10610
10881
  },
10611
- get recentItemCount() {
10612
- return props.recentItemCount;
10882
+ get historyItemCount() {
10883
+ return props.historyItemCount;
10884
+ },
10885
+ get hasUnreadHistoryItems() {
10886
+ return props.hasUnreadHistoryItems;
10613
10887
  },
10614
- get hasUnreadRecentItems() {
10615
- return props.hasUnreadRecentItems;
10888
+ get onToggleHistory() {
10889
+ return props.onToggleHistory;
10616
10890
  },
10617
- get onToggleRecent() {
10618
- return props.onToggleRecent;
10891
+ get onHistoryButtonHover() {
10892
+ return props.onHistoryButtonHover;
10619
10893
  },
10620
- get onRecentButtonHover() {
10621
- return props.onRecentButtonHover;
10894
+ get isHistoryDropdownOpen() {
10895
+ return Boolean(props.historyDropdownPosition);
10896
+ },
10897
+ get isHistoryPinned() {
10898
+ return props.isHistoryPinned;
10622
10899
  }
10623
10900
  });
10624
10901
  }
@@ -10652,36 +10929,42 @@ var init_renderer = __esm({
10652
10929
  return props.onContextMenuHide ?? (() => {
10653
10930
  });
10654
10931
  }
10655
- }), createComponent(RecentDropdown, {
10932
+ }), createComponent(HistoryDropdown, {
10656
10933
  get position() {
10657
- return props.recentDropdownPosition ?? null;
10934
+ return props.historyDropdownPosition ?? null;
10658
10935
  },
10659
10936
  get items() {
10660
- return props.recentItems ?? [];
10937
+ return props.historyItems ?? [];
10938
+ },
10939
+ get disconnectedItemIds() {
10940
+ return props.historyDisconnectedItemIds;
10661
10941
  },
10662
10942
  get onSelectItem() {
10663
- return props.onRecentItemSelect;
10943
+ return props.onHistoryItemSelect;
10664
10944
  },
10665
10945
  get onRemoveItem() {
10666
- return props.onRecentItemRemove;
10946
+ return props.onHistoryItemRemove;
10667
10947
  },
10668
10948
  get onCopyItem() {
10669
- return props.onRecentItemCopy;
10949
+ return props.onHistoryItemCopy;
10670
10950
  },
10671
10951
  get onItemHover() {
10672
- return props.onRecentItemHover;
10952
+ return props.onHistoryItemHover;
10673
10953
  },
10674
10954
  get onCopyAll() {
10675
- return props.onRecentCopyAll;
10955
+ return props.onHistoryCopyAll;
10676
10956
  },
10677
10957
  get onCopyAllHover() {
10678
- return props.onRecentCopyAllHover;
10958
+ return props.onHistoryCopyAllHover;
10679
10959
  },
10680
10960
  get onClearAll() {
10681
- return props.onRecentClear;
10961
+ return props.onHistoryClear;
10682
10962
  },
10683
10963
  get onDismiss() {
10684
- return props.onRecentDismiss;
10964
+ return props.onHistoryDismiss;
10965
+ },
10966
+ get onDropdownHover() {
10967
+ return props.onHistoryDropdownHover;
10685
10968
  }
10686
10969
  })];
10687
10970
  };
@@ -11373,8 +11656,17 @@ var init_is_capitalized = __esm({
11373
11656
  }
11374
11657
  });
11375
11658
 
11659
+ // src/utils/truncate-string.ts
11660
+ var truncateString;
11661
+ var init_truncate_string = __esm({
11662
+ "src/utils/truncate-string.ts"() {
11663
+ "use strict";
11664
+ truncateString = (text, maxLength) => text.length > maxLength ? `${text.slice(0, maxLength)}...` : text;
11665
+ }
11666
+ });
11667
+
11376
11668
  // src/core/context.ts
11377
- 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;
11669
+ 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;
11378
11670
  var init_context = __esm({
11379
11671
  "src/core/context.ts"() {
11380
11672
  "use strict";
@@ -11383,6 +11675,7 @@ var init_context = __esm({
11383
11675
  init_dist();
11384
11676
  init_constants();
11385
11677
  init_get_tag_name();
11678
+ init_truncate_string();
11386
11679
  NEXT_INTERNAL_COMPONENT_NAMES = /* @__PURE__ */ new Set([
11387
11680
  "InnerLayoutRouter",
11388
11681
  "RedirectErrorBoundary",
@@ -11466,6 +11759,19 @@ var init_context = __esm({
11466
11759
  }
11467
11760
  return null;
11468
11761
  };
11762
+ resolveSourceFromStack = (stack) => {
11763
+ if (!stack || stack.length === 0) return null;
11764
+ for (const frame of stack) {
11765
+ if (frame.fileName && Pe2(frame.fileName)) {
11766
+ return {
11767
+ filePath: Ne2(frame.fileName),
11768
+ lineNumber: frame.lineNumber,
11769
+ componentName: frame.functionName && checkIsSourceComponentName(frame.functionName) ? frame.functionName : null
11770
+ };
11771
+ }
11772
+ }
11773
+ return null;
11774
+ };
11469
11775
  isUsefulComponentName = (name) => {
11470
11776
  if (!name) return false;
11471
11777
  if (checkIsInternalComponentName(name)) return false;
@@ -11574,7 +11880,7 @@ var init_context = __esm({
11574
11880
  for (const { name, value } of element.attributes) {
11575
11881
  attrsText += ` ${name}="${value}"`;
11576
11882
  }
11577
- const truncatedText = text.length > 100 ? `${text.slice(0, 100)}...` : text;
11883
+ const truncatedText = truncateString(text, PREVIEW_TEXT_MAX_LENGTH);
11578
11884
  if (truncatedText.length > 0) {
11579
11885
  return `<${tagName}${attrsText}>
11580
11886
  ${truncatedText}
@@ -11582,7 +11888,7 @@ var init_context = __esm({
11582
11888
  }
11583
11889
  return `<${tagName}${attrsText} />`;
11584
11890
  };
11585
- truncateAttrValue = (value) => value.length > PREVIEW_ATTR_VALUE_MAX_LENGTH ? `${value.slice(0, PREVIEW_ATTR_VALUE_MAX_LENGTH)}...` : value;
11891
+ truncateAttrValue = (value) => truncateString(value, PREVIEW_ATTR_VALUE_MAX_LENGTH);
11586
11892
  formatPriorityAttrs = (element, options = {}) => {
11587
11893
  const { truncate = true, maxAttrs = PREVIEW_MAX_ATTRS } = options;
11588
11894
  const priorityAttrs = [];
@@ -11628,7 +11934,7 @@ var init_context = __esm({
11628
11934
  const formatElements = (elements) => {
11629
11935
  if (elements.length === 0) return "";
11630
11936
  if (elements.length <= 2) {
11631
- return elements.map((el) => `<${getTagName(el)} ...>`).join("\n ");
11937
+ return elements.map((childElement) => `<${getTagName(childElement)} ...>`).join("\n ");
11632
11938
  }
11633
11939
  return `(${elements.length} elements)`;
11634
11940
  };
@@ -11637,9 +11943,8 @@ var init_context = __esm({
11637
11943
  if (topElementsStr) content += `
11638
11944
  ${topElementsStr}`;
11639
11945
  if (text.length > 0) {
11640
- const truncatedText = text.length > 100 ? `${text.slice(0, 100)}...` : text;
11641
11946
  content += `
11642
- ${truncatedText}`;
11947
+ ${truncateString(text, PREVIEW_TEXT_MAX_LENGTH)}`;
11643
11948
  }
11644
11949
  const bottomElementsStr = formatElements(bottomElements);
11645
11950
  if (bottomElementsStr) content += `
@@ -11671,6 +11976,7 @@ var init_noop_api = __esm({
11671
11976
  targetElement: null,
11672
11977
  dragBounds: null,
11673
11978
  grabbedBoxes: [],
11979
+ labelInstances: [],
11674
11980
  selectionFilePath: null,
11675
11981
  toolbarState: null
11676
11982
  };
@@ -11821,14 +12127,23 @@ ${content}`)
11821
12127
  };
11822
12128
  };
11823
12129
  copyContent = (content, options) => {
11824
- const elementName = options?.name ?? "div";
12130
+ const elementName = options?.componentName ?? "div";
11825
12131
  const { plainText, htmlContent, lexicalData } = createClipboardData(
11826
12132
  content,
11827
12133
  elementName
11828
12134
  );
12135
+ const entries = options?.entries ?? [
12136
+ {
12137
+ tagName: options?.tagName,
12138
+ componentName: elementName,
12139
+ content,
12140
+ commentText: options?.commentText
12141
+ }
12142
+ ];
11829
12143
  const reactGrabMetadata = {
11830
12144
  version: VERSION,
11831
12145
  content,
12146
+ entries,
11832
12147
  timestamp: Date.now()
11833
12148
  };
11834
12149
  const copyHandler = (event) => {
@@ -11908,6 +12223,7 @@ var init_copy = __esm({
11908
12223
  await hooks.onBeforeCopy(elements);
11909
12224
  try {
11910
12225
  let generatedContent;
12226
+ let entries;
11911
12227
  if (options.getContent) {
11912
12228
  generatedContent = await options.getContent(elements);
11913
12229
  } else {
@@ -11919,8 +12235,14 @@ var init_copy = __esm({
11919
12235
  (snippet, index) => snippet.trim() ? hooks.transformSnippet(snippet, elements[index]) : Promise.resolve("")
11920
12236
  )
11921
12237
  );
11922
- const nonEmptySnippets = transformedSnippets.filter((s3) => s3.trim());
11923
- generatedContent = joinSnippets(nonEmptySnippets);
12238
+ const snippetElementPairs = transformedSnippets.map((snippet, index) => ({ snippet, element: elements[index] })).filter(({ snippet }) => snippet.trim());
12239
+ generatedContent = joinSnippets(
12240
+ snippetElementPairs.map(({ snippet }) => snippet)
12241
+ );
12242
+ entries = snippetElementPairs.map(({ snippet, element }) => ({
12243
+ tagName: element.localName,
12244
+ content: snippet
12245
+ }));
11924
12246
  }
11925
12247
  if (generatedContent.trim()) {
11926
12248
  const transformedContent = await hooks.transformCopyContent(
@@ -11930,7 +12252,10 @@ var init_copy = __esm({
11930
12252
  copiedContent = extraPrompt ? `${extraPrompt}
11931
12253
 
11932
12254
  ${transformedContent}` : transformedContent;
11933
- didCopy = copyContent(copiedContent, { name: options.componentName });
12255
+ didCopy = copyContent(copiedContent, {
12256
+ componentName: options.componentName,
12257
+ entries
12258
+ });
11934
12259
  }
11935
12260
  } catch (error) {
11936
12261
  const resolvedError = error instanceof Error ? error : new Error(String(error));
@@ -12531,7 +12856,7 @@ var init_delay = __esm({
12531
12856
  });
12532
12857
 
12533
12858
  // src/core/theme.ts
12534
- var DEFAULT_THEME, mergeThemeWithBase, deepMergeTheme;
12859
+ var DEFAULT_THEME, deepMergeTheme;
12535
12860
  var init_theme = __esm({
12536
12861
  "src/core/theme.ts"() {
12537
12862
  "use strict";
@@ -12557,7 +12882,7 @@ var init_theme = __esm({
12557
12882
  enabled: true
12558
12883
  }
12559
12884
  };
12560
- mergeThemeWithBase = (baseTheme, partialTheme) => ({
12885
+ deepMergeTheme = (baseTheme, partialTheme) => ({
12561
12886
  enabled: partialTheme.enabled ?? baseTheme.enabled,
12562
12887
  hue: partialTheme.hue ?? baseTheme.hue,
12563
12888
  selectionBox: {
@@ -12579,7 +12904,6 @@ var init_theme = __esm({
12579
12904
  enabled: partialTheme.toolbar?.enabled ?? baseTheme.toolbar.enabled
12580
12905
  }
12581
12906
  });
12582
- deepMergeTheme = mergeThemeWithBase;
12583
12907
  }
12584
12908
  });
12585
12909
 
@@ -12643,15 +12967,7 @@ var init_plugin_registry = __esm({
12643
12967
  if (plugins.has(plugin.name)) {
12644
12968
  unregister(plugin.name);
12645
12969
  }
12646
- let config;
12647
- if (plugin.setup) {
12648
- const setupResult = plugin.setup(
12649
- api
12650
- );
12651
- config = setupResult ?? {};
12652
- } else {
12653
- config = {};
12654
- }
12970
+ const config = plugin.setup?.(api) ?? {};
12655
12971
  if (plugin.theme) {
12656
12972
  config.theme = config.theme ? deepMergeTheme(
12657
12973
  deepMergeTheme(DEFAULT_THEME, plugin.theme),
@@ -12773,10 +13089,11 @@ var init_plugin_registry = __esm({
12773
13089
  });
12774
13090
 
12775
13091
  // src/core/agent/session.ts
12776
- var STORAGE_KEY2, generateSessionId, createSession, memorySessions, saveSessions, saveSessionById, loadSessions, clearSessions, clearSessionById, updateSession;
13092
+ var STORAGE_KEY2, generateSessionId, createSession, memorySessions, evictOldestMemorySessions, saveSessions, saveSessionById, loadSessions, clearSessions, clearSessionById, updateSession;
12777
13093
  var init_session = __esm({
12778
13094
  "src/core/agent/session.ts"() {
12779
13095
  "use strict";
13096
+ init_constants();
12780
13097
  STORAGE_KEY2 = "react-grab:agent-sessions";
12781
13098
  generateSessionId = () => `session-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
12782
13099
  createSession = (context, position, selectionBounds, tagName, componentName) => {
@@ -12795,10 +13112,19 @@ var init_session = __esm({
12795
13112
  };
12796
13113
  };
12797
13114
  memorySessions = /* @__PURE__ */ new Map();
13115
+ evictOldestMemorySessions = () => {
13116
+ while (memorySessions.size > MAX_MEMORY_SESSIONS) {
13117
+ const oldestKey = memorySessions.keys().next().value;
13118
+ if (oldestKey !== void 0) {
13119
+ memorySessions.delete(oldestKey);
13120
+ }
13121
+ }
13122
+ };
12798
13123
  saveSessions = (sessions, storage) => {
12799
13124
  if (!storage) {
12800
13125
  memorySessions.clear();
12801
13126
  sessions.forEach((session, id) => memorySessions.set(id, session));
13127
+ evictOldestMemorySessions();
12802
13128
  return;
12803
13129
  }
12804
13130
  try {
@@ -12807,6 +13133,7 @@ var init_session = __esm({
12807
13133
  } catch {
12808
13134
  memorySessions.clear();
12809
13135
  sessions.forEach((session, id) => memorySessions.set(id, session));
13136
+ evictOldestMemorySessions();
12810
13137
  }
12811
13138
  };
12812
13139
  saveSessionById = (session, storage) => {
@@ -12893,12 +13220,14 @@ var init_manager = __esm({
12893
13220
  return agentOptions;
12894
13221
  };
12895
13222
  const isProcessing = () => Array.from(sessions().values()).some((session) => session.isStreaming);
12896
- const executeSessionStream = async (session, streamIterator, activeAgent) => {
13223
+ const executeSessionStream = async (session, streamIterator, abortController, activeAgent) => {
12897
13224
  const effectiveAgent = activeAgent ?? agentOptions;
12898
13225
  const storage = effectiveAgent?.storage;
12899
13226
  let wasAborted = false;
13227
+ const isCurrentExecution = () => abortControllers.get(session.id) === abortController;
12900
13228
  try {
12901
13229
  for await (const status of streamIterator) {
13230
+ if (!isCurrentExecution()) break;
12902
13231
  const currentSessions = sessions();
12903
13232
  const currentSession = currentSessions.get(session.id);
12904
13233
  if (!currentSession) break;
@@ -12910,6 +13239,7 @@ var init_manager = __esm({
12910
13239
  setSessions((prev) => new Map(prev).set(session.id, updatedSession));
12911
13240
  effectiveAgent?.onStatus?.(status, updatedSession);
12912
13241
  }
13242
+ if (!isCurrentExecution()) return;
12913
13243
  const finalSessions = sessions();
12914
13244
  const finalSession = finalSessions.get(session.id);
12915
13245
  if (finalSession) {
@@ -12951,6 +13281,7 @@ var init_manager = __esm({
12951
13281
  }
12952
13282
  }
12953
13283
  } catch (error) {
13284
+ if (!isCurrentExecution()) return;
12954
13285
  const currentSessions = sessions();
12955
13286
  const currentSession = currentSessions.get(session.id);
12956
13287
  if (error instanceof Error && error.name === "AbortError") {
@@ -12977,8 +13308,16 @@ var init_manager = __esm({
12977
13308
  }
12978
13309
  }
12979
13310
  } finally {
13311
+ if (!isCurrentExecution()) {
13312
+ return;
13313
+ }
12980
13314
  abortControllers.delete(session.id);
12981
13315
  if (wasAborted) {
13316
+ const dismissTimeout = dismissTimeouts.get(session.id);
13317
+ if (dismissTimeout) {
13318
+ clearTimeout(dismissTimeout);
13319
+ dismissTimeouts.delete(session.id);
13320
+ }
12982
13321
  sessionMetadata.delete(session.id);
12983
13322
  clearSessionById(session.id, storage);
12984
13323
  setSessions((prev) => {
@@ -13030,6 +13369,11 @@ var init_manager = __esm({
13030
13369
  clearSessions(storage);
13031
13370
  return;
13032
13371
  }
13372
+ dismissTimeouts.forEach((timeoutId) => clearTimeout(timeoutId));
13373
+ dismissTimeouts.clear();
13374
+ abortControllers.forEach((controller) => controller.abort());
13375
+ abortControllers.clear();
13376
+ sessionMetadata.clear();
13033
13377
  const resumableSessionsMap = new Map(
13034
13378
  resumableSessions.map((session) => [session.id, session])
13035
13379
  );
@@ -13064,7 +13408,11 @@ var init_manager = __esm({
13064
13408
  abortController.signal,
13065
13409
  storage
13066
13410
  );
13067
- void executeSessionStream(existingSession, streamIterator);
13411
+ void executeSessionStream(
13412
+ existingSession,
13413
+ streamIterator,
13414
+ abortController
13415
+ );
13068
13416
  }
13069
13417
  };
13070
13418
  const startSession = async (params) => {
@@ -13143,7 +13491,12 @@ var init_manager = __esm({
13143
13491
  transformedContext,
13144
13492
  abortController.signal
13145
13493
  );
13146
- void executeSessionStream(session, streamIterator, activeAgent);
13494
+ void executeSessionStream(
13495
+ session,
13496
+ streamIterator,
13497
+ abortController,
13498
+ activeAgent
13499
+ );
13147
13500
  };
13148
13501
  const abort = (sessionId) => {
13149
13502
  if (sessionId) {
@@ -13185,6 +13538,11 @@ var init_manager = __esm({
13185
13538
  if (existingTimeout) clearTimeout(existingTimeout);
13186
13539
  const timeoutId = setTimeout(() => {
13187
13540
  dismissTimeouts.delete(sessionId);
13541
+ const controller = abortControllers.get(sessionId);
13542
+ if (controller) {
13543
+ controller.abort();
13544
+ abortControllers.delete(sessionId);
13545
+ }
13188
13546
  sessionMetadata.delete(sessionId);
13189
13547
  clearSessionById(sessionId, activeAgent?.storage);
13190
13548
  setSessions((prev) => {
@@ -13299,7 +13657,12 @@ var init_manager = __esm({
13299
13657
  contextWithSessionId,
13300
13658
  abortController.signal
13301
13659
  );
13302
- void executeSessionStream(retriedSession, streamIterator, activeAgent);
13660
+ void executeSessionStream(
13661
+ retriedSession,
13662
+ streamIterator,
13663
+ abortController,
13664
+ activeAgent
13665
+ );
13303
13666
  };
13304
13667
  const updateSessionBoundsOnViewportChange = () => {
13305
13668
  const currentSessions = sessions();
@@ -13385,6 +13748,7 @@ var createArrowNavigator;
13385
13748
  var init_arrow_navigation = __esm({
13386
13749
  "src/core/arrow-navigation.ts"() {
13387
13750
  "use strict";
13751
+ init_constants();
13388
13752
  init_get_element_at_position();
13389
13753
  init_is_element_connected();
13390
13754
  createArrowNavigator = (isValidGrabbableElement2, createElementBounds2) => {
@@ -13403,6 +13767,11 @@ var init_arrow_navigation = __esm({
13403
13767
  const nextElement = findVerticalNext(currentElement, 1);
13404
13768
  if (nextElement) {
13405
13769
  navigationHistory.push(currentElement);
13770
+ if (navigationHistory.length > MAX_ARROW_NAVIGATION_HISTORY) {
13771
+ navigationHistory = navigationHistory.slice(
13772
+ -MAX_ARROW_NAVIGATION_HISTORY
13773
+ );
13774
+ }
13406
13775
  }
13407
13776
  return nextElement;
13408
13777
  };
@@ -13478,12 +13847,12 @@ var init_arrow_navigation = __esm({
13478
13847
  return null;
13479
13848
  }
13480
13849
  };
13481
- const clearHistory = () => {
13850
+ const clearHistory2 = () => {
13482
13851
  navigationHistory = [];
13483
13852
  };
13484
13853
  return {
13485
13854
  findNext,
13486
- clearHistory
13855
+ clearHistory: clearHistory2
13487
13856
  };
13488
13857
  };
13489
13858
  }
@@ -13496,13 +13865,10 @@ var init_keyboard_handlers = __esm({
13496
13865
  "use strict";
13497
13866
  init_parse_activation_key();
13498
13867
  getRequiredModifiers = (options) => {
13499
- const modifiers = getModifiersFromActivationKey(options.activationKey);
13500
- return {
13501
- metaKey: modifiers.metaKey,
13502
- ctrlKey: modifiers.ctrlKey,
13503
- shiftKey: modifiers.shiftKey,
13504
- altKey: modifiers.altKey
13505
- };
13868
+ const { metaKey, ctrlKey, shiftKey, altKey } = getModifiersFromActivationKey(
13869
+ options.activationKey
13870
+ );
13871
+ return { metaKey, ctrlKey, shiftKey, altKey };
13506
13872
  };
13507
13873
  setupKeyboardEventClaimer = () => {
13508
13874
  const claimedEvents = /* @__PURE__ */ new WeakSet();
@@ -13618,7 +13984,7 @@ var init_log_intro = __esm({
13618
13984
  init_is_extension_context();
13619
13985
  logIntro = () => {
13620
13986
  try {
13621
- const version = "0.1.14";
13987
+ const version = "0.1.16";
13622
13988
  const logoDataUri = `data:image/svg+xml;base64,${btoa(LOGO_SVG)}`;
13623
13989
  console.log(
13624
13990
  `%cReact Grab${version ? ` v${version}` : ""}%c
@@ -13635,7 +14001,7 @@ https://react-grab.com`,
13635
14001
  priority: "low",
13636
14002
  cache: "no-store"
13637
14003
  }
13638
- ).then((res) => res.text()).then((latestVersion) => {
14004
+ ).then((response) => response.text()).then((latestVersion) => {
13639
14005
  if (latestVersion && latestVersion !== version) {
13640
14006
  console.warn(
13641
14007
  `[React Grab] v${version} is outdated (latest: v${latestVersion})`
@@ -13774,6 +14140,7 @@ var copyHtmlPlugin;
13774
14140
  var init_copy_html = __esm({
13775
14141
  "src/core/plugins/copy-html.ts"() {
13776
14142
  "use strict";
14143
+ init_copy_content();
13777
14144
  copyHtmlPlugin = {
13778
14145
  name: "copy-html",
13779
14146
  actions: [
@@ -13791,8 +14158,7 @@ var init_copy_html = __esm({
13791
14158
  context.elements
13792
14159
  );
13793
14160
  if (!transformedHtml) return false;
13794
- await navigator.clipboard.writeText(transformedHtml);
13795
- return true;
14161
+ return copyContent(transformedHtml);
13796
14162
  });
13797
14163
  }
13798
14164
  }
@@ -13860,18 +14226,23 @@ var init_comment = __esm({
13860
14226
  }
13861
14227
  });
13862
14228
 
13863
- // src/utils/recent-storage.ts
13864
- var SESSION_STORAGE_KEY, loadFromSessionStorage, saveToSessionStorage, recentItems, generateRecentItemId, loadRecent, addRecentItem, removeRecentItem, clearRecent;
13865
- var init_recent_storage = __esm({
13866
- "src/utils/recent-storage.ts"() {
14229
+ // src/utils/history-storage.ts
14230
+ var SESSION_STORAGE_KEY, loadFromSessionStorage, saveToSessionStorage, historyItems, generateHistoryItemId, loadHistory, addHistoryItem, removeHistoryItem, clearHistory;
14231
+ var init_history_storage = __esm({
14232
+ "src/utils/history-storage.ts"() {
13867
14233
  "use strict";
13868
14234
  init_constants();
13869
- SESSION_STORAGE_KEY = "react-grab-recent-items";
14235
+ SESSION_STORAGE_KEY = "react-grab-history-items";
13870
14236
  loadFromSessionStorage = () => {
13871
14237
  try {
13872
- const serializedRecentItems = sessionStorage.getItem(SESSION_STORAGE_KEY);
13873
- if (!serializedRecentItems) return [];
13874
- return JSON.parse(serializedRecentItems);
14238
+ const serializedHistoryItems = sessionStorage.getItem(SESSION_STORAGE_KEY);
14239
+ if (!serializedHistoryItems) return [];
14240
+ const parsedHistoryItems = JSON.parse(serializedHistoryItems);
14241
+ return parsedHistoryItems.map((historyItem) => ({
14242
+ ...historyItem,
14243
+ elementsCount: Math.max(1, historyItem.elementsCount ?? 1),
14244
+ previewBounds: historyItem.previewBounds ?? []
14245
+ }));
13875
14246
  } catch {
13876
14247
  return [];
13877
14248
  }
@@ -13882,27 +14253,27 @@ var init_recent_storage = __esm({
13882
14253
  } catch {
13883
14254
  }
13884
14255
  };
13885
- recentItems = loadFromSessionStorage();
13886
- generateRecentItemId = () => `recent-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
13887
- loadRecent = () => recentItems;
13888
- addRecentItem = (item) => {
14256
+ historyItems = loadFromSessionStorage();
14257
+ generateHistoryItemId = () => `history-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
14258
+ loadHistory = () => historyItems;
14259
+ addHistoryItem = (item) => {
13889
14260
  const newItem = {
13890
14261
  ...item,
13891
- id: generateRecentItemId()
14262
+ id: generateHistoryItemId()
13892
14263
  };
13893
- recentItems = [newItem, ...recentItems].slice(0, MAX_RECENT_ITEMS);
13894
- saveToSessionStorage(recentItems);
13895
- return recentItems;
14264
+ historyItems = [newItem, ...historyItems].slice(0, MAX_HISTORY_ITEMS);
14265
+ saveToSessionStorage(historyItems);
14266
+ return historyItems;
13896
14267
  };
13897
- removeRecentItem = (itemId) => {
13898
- recentItems = recentItems.filter((item) => item.id !== itemId);
13899
- saveToSessionStorage(recentItems);
13900
- return recentItems;
14268
+ removeHistoryItem = (itemId) => {
14269
+ historyItems = historyItems.filter((item) => item.id !== itemId);
14270
+ saveToSessionStorage(historyItems);
14271
+ return historyItems;
13901
14272
  };
13902
- clearRecent = () => {
13903
- recentItems = [];
13904
- saveToSessionStorage(recentItems);
13905
- return recentItems;
14273
+ clearHistory = () => {
14274
+ historyItems = [];
14275
+ saveToSessionStorage(historyItems);
14276
+ return historyItems;
13906
14277
  };
13907
14278
  }
13908
14279
  });
@@ -13976,7 +14347,7 @@ var init_core = __esm({
13976
14347
  init_freeze_animations();
13977
14348
  init_freeze_pseudo_states();
13978
14349
  init_freeze_updates();
13979
- init_recent_storage();
14350
+ init_history_storage();
13980
14351
  init_copy_content();
13981
14352
  init_join_snippets();
13982
14353
  init_context();
@@ -14054,13 +14425,42 @@ var init_core = __esm({
14054
14425
  const [toolbarShakeCount, setToolbarShakeCount] = createSignal(0);
14055
14426
  const [currentToolbarState, setCurrentToolbarState] = createSignal(savedToolbarState);
14056
14427
  const [isToolbarSelectHovered, setIsToolbarSelectHovered] = createSignal(false);
14057
- const [recentItems2, setRecentItems] = createSignal(loadRecent());
14058
- const [recentDropdownPosition, setRecentDropdownPosition] = createSignal(null);
14428
+ const [historyItems2, setHistoryItems] = createSignal(loadHistory());
14429
+ const [historyDropdownPosition, setHistoryDropdownPosition] = createSignal(null);
14059
14430
  let toolbarElement;
14060
- let recentPositionFrameId = null;
14061
- const recentElementMap = /* @__PURE__ */ new Map();
14062
- const [hasUnreadRecentItems, setHasUnreadRecentItems] = createSignal(false);
14063
- let recentHoverPreviews = [];
14431
+ let historyPositionFrameId = null;
14432
+ const historyElementMap = /* @__PURE__ */ new Map();
14433
+ const [hasUnreadHistoryItems, setHasUnreadHistoryItems] = createSignal(false);
14434
+ const [isHistoryHoverOpen, setIsHistoryHoverOpen] = createSignal(false);
14435
+ let historyHoverPreviews = [];
14436
+ const getMappedHistoryElements = (historyItemId) => historyElementMap.get(historyItemId) ?? [];
14437
+ const getConnectedHistoryElements = (historyItemId) => getMappedHistoryElements(historyItemId).filter((mappedElement) => isElementConnected(mappedElement));
14438
+ const getFirstConnectedHistoryElement = (historyItemId) => getConnectedHistoryElements(historyItemId)[0];
14439
+ const getHistoryPreviewBounds = (historyItem) => {
14440
+ const connectedElements = getConnectedHistoryElements(historyItem.id);
14441
+ if (connectedElements.length > 0) {
14442
+ return connectedElements.map((element) => createElementBounds(element));
14443
+ }
14444
+ return historyItem.previewBounds ?? [];
14445
+ };
14446
+ const historyDisconnectedItemIds = createMemo(() => {
14447
+ void historyDropdownPosition();
14448
+ const disconnectedIds = /* @__PURE__ */ new Set();
14449
+ for (const item of historyItems2()) {
14450
+ if (getConnectedHistoryElements(item.id).length === 0) {
14451
+ disconnectedIds.add(item.id);
14452
+ }
14453
+ }
14454
+ return disconnectedIds;
14455
+ }, void 0, {
14456
+ equals: (prev, next) => {
14457
+ if (prev.size !== next.size) return false;
14458
+ for (const id of next) {
14459
+ if (!prev.has(id)) return false;
14460
+ }
14461
+ return true;
14462
+ }
14463
+ });
14064
14464
  const pendingAbortSessionId = createMemo(() => store.pendingAbortSessionId);
14065
14465
  const hasAgentProvider = createMemo(() => store.hasAgentProvider);
14066
14466
  const clearHoldTimer = () => {
@@ -14104,18 +14504,15 @@ var init_core = __esm({
14104
14504
  }, FEEDBACK_DURATION_MS);
14105
14505
  onCleanup(() => clearTimeout(timerId));
14106
14506
  });
14107
- let previouslyHoldingKeys = false;
14108
- createEffect(() => {
14109
- const currentlyHolding = isHoldingKeys();
14110
- const currentlyActive = isActivated();
14111
- if (previouslyHoldingKeys && !currentlyHolding && currentlyActive) {
14112
- if (pluginRegistry.store.options.activationMode !== "hold") {
14113
- actions.setWasActivatedByToggle(true);
14114
- }
14115
- pluginRegistry.hooks.onActivate();
14507
+ createEffect(on(isHoldingKeys, (currentlyHolding, previouslyHolding = false) => {
14508
+ if (!previouslyHolding || currentlyHolding || !isActivated()) {
14509
+ return;
14116
14510
  }
14117
- previouslyHoldingKeys = currentlyHolding;
14118
- });
14511
+ if (pluginRegistry.store.options.activationMode !== "hold") {
14512
+ actions.setWasActivatedByToggle(true);
14513
+ }
14514
+ pluginRegistry.hooks.onActivate();
14515
+ }));
14119
14516
  const preparePromptMode = (element, positionX, positionY) => {
14120
14517
  setCopyStartPosition(element, positionX, positionY);
14121
14518
  actions.clearInputText();
@@ -14217,7 +14614,7 @@ var init_core = __esm({
14217
14614
  if (!componentName) {
14218
14615
  componentName = getComponentDisplayName(element);
14219
14616
  }
14220
- const textContent = element instanceof HTMLElement ? element.innerText?.slice(0, 100) : void 0;
14617
+ const textContent = element instanceof HTMLElement ? element.innerText?.slice(0, PREVIEW_TEXT_MAX_LENGTH) : void 0;
14221
14618
  return {
14222
14619
  tagName: getTagName(element),
14223
14620
  id: element.id || void 0,
@@ -14260,9 +14657,6 @@ var init_core = __esm({
14260
14657
  actions.addLabelInstance(instance);
14261
14658
  return instanceId;
14262
14659
  };
14263
- const updateLabelInstance = (instanceId, status, errorMessage) => {
14264
- actions.updateLabelInstance(instanceId, status, errorMessage);
14265
- };
14266
14660
  const removeLabelInstance = (instanceId) => {
14267
14661
  labelFadeTimeouts.delete(instanceId);
14268
14662
  actions.removeLabelInstance(instanceId);
@@ -14279,7 +14673,7 @@ var init_core = __esm({
14279
14673
  cancelLabelFade(instanceId);
14280
14674
  const timeoutId = window.setTimeout(() => {
14281
14675
  labelFadeTimeouts.delete(instanceId);
14282
- updateLabelInstance(instanceId, "fading");
14676
+ actions.updateLabelInstance(instanceId, "fading");
14283
14677
  setTimeout(() => {
14284
14678
  removeLabelInstance(instanceId);
14285
14679
  }, FADE_COMPLETE_BUFFER_MS);
@@ -14307,7 +14701,7 @@ var init_core = __esm({
14307
14701
  await operation().finally(() => {
14308
14702
  actions.completeCopy(element);
14309
14703
  if (instanceId) {
14310
- updateLabelInstance(instanceId, "copied");
14704
+ actions.updateLabelInstance(instanceId, "copied");
14311
14705
  scheduleLabelFade(instanceId);
14312
14706
  }
14313
14707
  if (shouldDeactivateAfter) {
@@ -14341,41 +14735,44 @@ var init_core = __esm({
14341
14735
  onAfterCopy: pluginRegistry.hooks.onAfterCopy,
14342
14736
  onCopySuccess: (copiedElements, content) => {
14343
14737
  pluginRegistry.hooks.onCopySuccess(copiedElements, content);
14344
- const primaryElement = copiedElements[0];
14738
+ const hasCopiedElements = copiedElements.length > 0;
14345
14739
  const isComment = Boolean(extraPrompt);
14346
- if (primaryElement) {
14347
- const currentItems = recentItems2();
14348
- for (const [existingItemId, mappedElement] of recentElementMap.entries()) {
14349
- if (mappedElement !== primaryElement) continue;
14740
+ if (hasCopiedElements) {
14741
+ const currentItems = historyItems2();
14742
+ for (const [existingItemId, mappedElements] of historyElementMap.entries()) {
14743
+ const isSameSelection = mappedElements.length === copiedElements.length && mappedElements.every((element, index) => element === copiedElements[index]);
14744
+ if (!isSameSelection) continue;
14350
14745
  const existingItem = currentItems.find((item) => item.id === existingItemId);
14351
14746
  if (!existingItem) continue;
14352
14747
  const shouldDedup = isComment ? existingItem.isComment && existingItem.commentText === extraPrompt : !existingItem.isComment;
14353
14748
  if (shouldDedup) {
14354
- removeRecentItem(existingItemId);
14355
- recentElementMap.delete(existingItemId);
14749
+ removeHistoryItem(existingItemId);
14750
+ historyElementMap.delete(existingItemId);
14356
14751
  break;
14357
14752
  }
14358
14753
  }
14359
14754
  }
14360
- const updatedRecentItems = addRecentItem({
14755
+ const updatedHistoryItems = addHistoryItem({
14361
14756
  content,
14362
14757
  elementName: elementName ?? "element",
14363
14758
  tagName: tagName ?? "div",
14364
14759
  componentName: componentName ?? void 0,
14760
+ elementsCount: copiedElements.length,
14761
+ previewBounds: copiedElements.map((element) => createElementBounds(element)),
14365
14762
  isComment,
14366
14763
  commentText: extraPrompt ?? void 0,
14367
14764
  timestamp: Date.now()
14368
14765
  });
14369
- setRecentItems(updatedRecentItems);
14370
- setHasUnreadRecentItems(true);
14371
- const newestRecentItem = updatedRecentItems[0];
14372
- if (newestRecentItem && primaryElement) {
14373
- recentElementMap.set(newestRecentItem.id, primaryElement);
14766
+ setHistoryItems(updatedHistoryItems);
14767
+ setHasUnreadHistoryItems(true);
14768
+ const newestHistoryItem = updatedHistoryItems[0];
14769
+ if (newestHistoryItem && hasCopiedElements) {
14770
+ historyElementMap.set(newestHistoryItem.id, [...copiedElements]);
14374
14771
  }
14375
- const currentItemIds = new Set(updatedRecentItems.map((item) => item.id));
14376
- for (const mapItemId of recentElementMap.keys()) {
14772
+ const currentItemIds = new Set(updatedHistoryItems.map((item) => item.id));
14773
+ for (const mapItemId of historyElementMap.keys()) {
14377
14774
  if (!currentItemIds.has(mapItemId)) {
14378
- recentElementMap.delete(mapItemId);
14775
+ historyElementMap.delete(mapItemId);
14379
14776
  }
14380
14777
  }
14381
14778
  },
@@ -14437,9 +14834,10 @@ var init_core = __esm({
14437
14834
  }, BOUNDS_RECALC_INTERVAL_MS);
14438
14835
  onCleanup(() => clearInterval(intervalId));
14439
14836
  });
14440
- createEffect(on(() => effectiveElement(), (element) => {
14837
+ createEffect(on(effectiveElement, (element) => {
14441
14838
  if (componentNameDebounceTimerId !== null) {
14442
14839
  clearTimeout(componentNameDebounceTimerId);
14840
+ componentNameDebounceTimerId = null;
14443
14841
  }
14444
14842
  if (!element) {
14445
14843
  setDebouncedElementForComponentName(null);
@@ -14449,13 +14847,13 @@ var init_core = __esm({
14449
14847
  componentNameDebounceTimerId = null;
14450
14848
  setDebouncedElementForComponentName(element);
14451
14849
  }, COMPONENT_NAME_DEBOUNCE_MS);
14452
- onCleanup(() => {
14453
- if (componentNameDebounceTimerId !== null) {
14454
- clearTimeout(componentNameDebounceTimerId);
14455
- componentNameDebounceTimerId = null;
14456
- }
14457
- });
14458
14850
  }));
14851
+ onCleanup(() => {
14852
+ if (componentNameDebounceTimerId !== null) {
14853
+ clearTimeout(componentNameDebounceTimerId);
14854
+ componentNameDebounceTimerId = null;
14855
+ }
14856
+ });
14459
14857
  createEffect(() => {
14460
14858
  const elements = store.frozenElements;
14461
14859
  const cleanup = freezeAnimations(elements);
@@ -14479,7 +14877,7 @@ var init_core = __esm({
14479
14877
  };
14480
14878
  const selectionElement = createMemo(() => getSelectionElement());
14481
14879
  const isSelectionElementVisible = () => {
14482
- const element = getSelectionElement();
14880
+ const element = selectionElement();
14483
14881
  if (!element) return false;
14484
14882
  if (store.isTouchMode && isDragging()) {
14485
14883
  return isRendererActive();
@@ -14512,7 +14910,7 @@ var init_core = __esm({
14512
14910
  }
14513
14911
  return createFlatOverlayBounds(combineBounds(frozenBounds));
14514
14912
  }
14515
- const element = getSelectionElement();
14913
+ const element = selectionElement();
14516
14914
  if (!element) return void 0;
14517
14915
  return createElementBounds(element);
14518
14916
  });
@@ -14631,7 +15029,19 @@ var init_core = __esm({
14631
15029
  });
14632
15030
  }));
14633
15031
  createEffect(on(() => store.viewportVersion, () => agentManager._internal.updateBoundsOnViewportChange()));
14634
- 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]) => {
15032
+ const stateChangeGrabbedBoxes = createMemo(() => store.grabbedBoxes.map((box) => ({
15033
+ id: box.id,
15034
+ bounds: box.bounds,
15035
+ createdAt: box.createdAt
15036
+ })));
15037
+ const stateChangeLabelInstances = createMemo(() => store.labelInstances.map((instance) => ({
15038
+ id: instance.id,
15039
+ status: instance.status,
15040
+ tagName: instance.tagName,
15041
+ componentName: instance.componentName,
15042
+ createdAt: instance.createdAt
15043
+ })));
15044
+ 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]) => {
14635
15045
  const isSelectionBoxVisible = Boolean(themeEnabled && selectionBoxEnabled && active && !copying && !justCopied && !dragging && effectiveTarget != null);
14636
15046
  const isDragBoxVisible = Boolean(themeEnabled && dragBoxEnabled && active && !copying && draggingBeyondThreshold);
14637
15047
  pluginRegistry.hooks.onStateChange({
@@ -14649,12 +15059,9 @@ var init_core = __esm({
14649
15059
  width: drag.width,
14650
15060
  height: drag.height
14651
15061
  } : null,
14652
- grabbedBoxes: grabbedBoxes.map((box) => ({
14653
- id: box.id,
14654
- bounds: box.bounds,
14655
- createdAt: box.createdAt
14656
- })),
14657
- selectionFilePath: store.selectionFilePath,
15062
+ grabbedBoxes,
15063
+ labelInstances,
15064
+ selectionFilePath,
14658
15065
  toolbarState
14659
15066
  });
14660
15067
  }));
@@ -14783,7 +15190,7 @@ var init_core = __esm({
14783
15190
  actions.setInputText(value);
14784
15191
  };
14785
15192
  const handleInputSubmit = () => {
14786
- actions.setLastCopied(null);
15193
+ actions.clearLastCopied();
14787
15194
  const frozenElements2 = [...store.frozenElements];
14788
15195
  const element = store.frozenElement || targetElement();
14789
15196
  const prompt = isPromptMode() ? store.inputText.trim() : "";
@@ -14792,7 +15199,7 @@ var init_core = __esm({
14792
15199
  return;
14793
15200
  }
14794
15201
  const elements = frozenElements2.length > 0 ? frozenElements2 : element ? [element] : [];
14795
- const currentSelectionBounds = elements.map((el) => createElementBounds(el));
15202
+ const currentSelectionBounds = elements.map((selectedElement) => createElementBounds(selectedElement));
14796
15203
  const firstBounds = currentSelectionBounds[0];
14797
15204
  const currentX = firstBounds.x + firstBounds.width / 2;
14798
15205
  const currentY = firstBounds.y + firstBounds.height / 2;
@@ -14801,8 +15208,8 @@ var init_core = __esm({
14801
15208
  const currentReplySessionId = store.replySessionId;
14802
15209
  const selectedAgent = store.selectedAgent;
14803
15210
  deactivateRenderer();
14804
- actions.setReplySessionId(null);
14805
- actions.clearSelectedAgent();
15211
+ actions.clearReplySessionId();
15212
+ actions.setSelectedAgent(null);
14806
15213
  void agentManager.session.start({
14807
15214
  elements,
14808
15215
  prompt,
@@ -14833,7 +15240,7 @@ var init_core = __esm({
14833
15240
  });
14834
15241
  };
14835
15242
  const handleInputCancel = () => {
14836
- actions.setLastCopied(null);
15243
+ actions.clearLastCopied();
14837
15244
  if (!isPromptMode()) return;
14838
15245
  const currentInput = store.inputText.trim();
14839
15246
  if (currentInput && !isPendingDismiss()) {
@@ -14931,7 +15338,7 @@ var init_core = __esm({
14931
15338
  };
14932
15339
  saveToolbarState(newState);
14933
15340
  setCurrentToolbarState(newState);
14934
- toolbarStateChangeCallbacks.forEach((cb) => cb(newState));
15341
+ toolbarStateChangeCallbacks.forEach((callback) => callback(newState));
14935
15342
  if (!newEnabled) {
14936
15343
  if (isHoldingKeys()) {
14937
15344
  actions.release();
@@ -14939,7 +15346,7 @@ var init_core = __esm({
14939
15346
  if (isActivated()) {
14940
15347
  deactivateRenderer();
14941
15348
  }
14942
- dismissRecentDropdown();
15349
+ dismissHistoryDropdown();
14943
15350
  if (toggleFeedbackTimerId !== null) {
14944
15351
  window.clearTimeout(toggleFeedbackTimerId);
14945
15352
  toggleFeedbackTimerId = null;
@@ -15160,7 +15567,7 @@ var init_core = __esm({
15160
15567
  actions.setPointer(center);
15161
15568
  preparePromptMode(copiedElement, center.x, center.y);
15162
15569
  actions.setFrozenElement(copiedElement);
15163
- actions.setLastCopied(null);
15570
+ actions.clearLastCopied();
15164
15571
  activatePromptMode();
15165
15572
  if (!isActivated()) {
15166
15573
  activateRenderer();
@@ -15251,7 +15658,7 @@ var init_core = __esm({
15251
15658
  }
15252
15659
  isScreenshotInProgress = false;
15253
15660
  rendererRoot.style.visibility = "";
15254
- updateLabelInstance(instanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
15661
+ actions.updateLabelInstance(instanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
15255
15662
  scheduleLabelFade(instanceId);
15256
15663
  if (shouldDeactivate) {
15257
15664
  deactivateRenderer();
@@ -15377,9 +15784,13 @@ var init_core = __esm({
15377
15784
  return;
15378
15785
  }
15379
15786
  if (!isTargetKeyCombination(event, pluginRegistry.store.options)) {
15380
- if (isActivated() && !store.wasActivatedByToggle && (event.metaKey || event.ctrlKey)) {
15381
- if (!MODIFIER_KEYS.includes(event.key) && !isEnterCode(event.code)) {
15787
+ if ((event.metaKey || event.ctrlKey) && !MODIFIER_KEYS.includes(event.key) && !isEnterCode(event.code)) {
15788
+ if (isActivated() && !store.wasActivatedByToggle) {
15382
15789
  deactivateRenderer();
15790
+ } else if (isHoldingKeys()) {
15791
+ clearHoldTimer();
15792
+ resetCopyConfirmation();
15793
+ actions.release();
15383
15794
  }
15384
15795
  }
15385
15796
  if (!isEnterCode(event.code) || !isHoldingKeys()) {
@@ -15448,6 +15859,10 @@ var init_core = __esm({
15448
15859
  handleInputCancel();
15449
15860
  return;
15450
15861
  }
15862
+ if (event.key === "Escape" && historyDropdownPosition() !== null) {
15863
+ dismissHistoryDropdown();
15864
+ return;
15865
+ }
15451
15866
  const isFromOverlay = isEventFromOverlay(event, "data-react-grab-ignore-events") && !isEnterToActivateInput;
15452
15867
  if (isPromptMode() || isFromOverlay) {
15453
15868
  if (event.key === "Escape") {
@@ -15632,7 +16047,7 @@ var init_core = __esm({
15632
16047
  actions.setPointer(position);
15633
16048
  actions.freeze();
15634
16049
  actions.showContextMenu(position, element);
15635
- dismissRecentDropdown();
16050
+ dismissHistoryDropdown();
15636
16051
  pluginRegistry.hooks.onContextMenu(element, position);
15637
16052
  }, {
15638
16053
  capture: true
@@ -15672,6 +16087,13 @@ var init_core = __esm({
15672
16087
  }
15673
16088
  }
15674
16089
  });
16090
+ eventListenerManager.addWindowListener("blur", () => {
16091
+ if (isHoldingKeys()) {
16092
+ clearHoldTimer();
16093
+ actions.release();
16094
+ resetCopyConfirmation();
16095
+ }
16096
+ });
15675
16097
  eventListenerManager.addWindowListener("focus", () => {
15676
16098
  lastWindowFocusTimestamp = Date.now();
15677
16099
  });
@@ -15764,11 +16186,17 @@ var init_core = __esm({
15764
16186
  });
15765
16187
  onCleanup(() => {
15766
16188
  eventListenerManager.abort();
16189
+ if (dragPreviewDebounceTimerId !== null) {
16190
+ window.clearTimeout(dragPreviewDebounceTimerId);
16191
+ }
15767
16192
  if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
15768
16193
  if (toggleFeedbackTimerId) window.clearTimeout(toggleFeedbackTimerId);
15769
16194
  if (actionCycleIdleTimeoutId) {
15770
16195
  window.clearTimeout(actionCycleIdleTimeoutId);
15771
16196
  }
16197
+ if (historyPositionFrameId !== null) {
16198
+ cancelAnimationFrame(historyPositionFrameId);
16199
+ }
15772
16200
  grabbedBoxTimeouts.forEach((timeoutId) => window.clearTimeout(timeoutId));
15773
16201
  grabbedBoxTimeouts.clear();
15774
16202
  autoScroller.stop();
@@ -15778,16 +16206,21 @@ var init_core = __esm({
15778
16206
  keyboardClaimer.restore();
15779
16207
  });
15780
16208
  const rendererRoot = mountRoot(styles_default);
16209
+ const isThemeEnabled = createMemo(() => pluginRegistry.store.theme.enabled);
16210
+ const isSelectionBoxThemeEnabled = createMemo(() => pluginRegistry.store.theme.selectionBox.enabled);
16211
+ const isElementLabelThemeEnabled = createMemo(() => pluginRegistry.store.theme.elementLabel.enabled);
16212
+ const isDragBoxThemeEnabled = createMemo(() => pluginRegistry.store.theme.dragBox.enabled);
16213
+ const isSelectionSuppressed = createMemo(() => didJustCopy());
16214
+ const hasDragPreviewBounds = createMemo(() => dragPreviewBounds().length > 0);
15781
16215
  const selectionVisible = createMemo(() => {
15782
- if (!pluginRegistry.store.theme.enabled) return false;
15783
- if (!pluginRegistry.store.theme.selectionBox.enabled) return false;
15784
- if (didJustCopy()) return false;
15785
- const hasDragPreview = dragPreviewBounds().length > 0;
15786
- if (hasDragPreview) return true;
16216
+ if (!isThemeEnabled()) return false;
16217
+ if (!isSelectionBoxThemeEnabled()) return false;
16218
+ if (isSelectionSuppressed()) return false;
16219
+ if (hasDragPreviewBounds()) return true;
15787
16220
  return isSelectionElementVisible();
15788
16221
  });
15789
16222
  const selectionTagName = createMemo(() => {
15790
- const element = getSelectionElement();
16223
+ const element = selectionElement();
15791
16224
  if (!element) return void 0;
15792
16225
  return getTagName(element) || void 0;
15793
16226
  });
@@ -15808,13 +16241,13 @@ var init_core = __esm({
15808
16241
  const selectionComponentName = resolvedComponentName;
15809
16242
  const selectionLabelVisible = createMemo(() => {
15810
16243
  if (store.contextMenuPosition !== null) return false;
15811
- if (!pluginRegistry.store.theme.elementLabel.enabled) return false;
15812
- if (didJustCopy()) return false;
16244
+ if (!isElementLabelThemeEnabled()) return false;
16245
+ if (isSelectionSuppressed()) return false;
15813
16246
  return isSelectionElementVisible();
15814
16247
  });
15815
16248
  const labelInstanceCache = /* @__PURE__ */ new Map();
15816
16249
  const computedLabelInstances = createMemo(() => {
15817
- if (!pluginRegistry.store.theme.enabled) return [];
16250
+ if (!isThemeEnabled()) return [];
15818
16251
  if (!pluginRegistry.store.theme.grabbedBoxes.enabled) return [];
15819
16252
  void store.viewportVersion;
15820
16253
  const currentIds = new Set(store.labelInstances.map((i2) => i2.id));
@@ -15846,7 +16279,7 @@ var init_core = __esm({
15846
16279
  });
15847
16280
  });
15848
16281
  const computedGrabbedBoxes = createMemo(() => {
15849
- if (!pluginRegistry.store.theme.enabled) return [];
16282
+ if (!isThemeEnabled()) return [];
15850
16283
  if (!pluginRegistry.store.theme.grabbedBoxes.enabled) return [];
15851
16284
  void store.viewportVersion;
15852
16285
  return store.grabbedBoxes.map((box) => {
@@ -15859,11 +16292,11 @@ var init_core = __esm({
15859
16292
  };
15860
16293
  });
15861
16294
  });
15862
- const dragVisible = createMemo(() => pluginRegistry.store.theme.enabled && pluginRegistry.store.theme.dragBox.enabled && isRendererActive() && isDraggingBeyondThreshold());
16295
+ const dragVisible = createMemo(() => isThemeEnabled() && isDragBoxThemeEnabled() && isRendererActive() && isDraggingBeyondThreshold());
15863
16296
  const labelVariant = createMemo(() => isCopying() ? "processing" : "hover");
15864
16297
  const labelVisible = createMemo(() => {
15865
- if (!pluginRegistry.store.theme.enabled) return false;
15866
- const themeEnabled = pluginRegistry.store.theme.elementLabel.enabled;
16298
+ if (!isThemeEnabled()) return false;
16299
+ const themeEnabled = isElementLabelThemeEnabled();
15867
16300
  const inPromptMode = isPromptMode();
15868
16301
  const copying = isCopying();
15869
16302
  const rendererActive = isRendererActive();
@@ -15908,16 +16341,7 @@ var init_core = __esm({
15908
16341
  const [contextMenuFilePath] = createResource(() => store.contextMenuElement, async (element) => {
15909
16342
  if (!element) return null;
15910
16343
  const stack = await getStack(element);
15911
- if (!stack || stack.length === 0) return null;
15912
- for (const frame of stack) {
15913
- if (frame.fileName && Pe2(frame.fileName)) {
15914
- return {
15915
- filePath: Ne2(frame.fileName),
15916
- lineNumber: frame.lineNumber
15917
- };
15918
- }
15919
- }
15920
- return null;
16344
+ return resolveSourceFromStack(stack);
15921
16345
  });
15922
16346
  const createPerformWithFeedback = (element, elements, tagName, componentName, options) => {
15923
16347
  return async (action) => {
@@ -15949,7 +16373,7 @@ var init_core = __esm({
15949
16373
  } catch (error) {
15950
16374
  errorMessage = error instanceof Error && error.message ? error.message : "Action failed";
15951
16375
  }
15952
- updateLabelInstance(labelInstanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
16376
+ actions.updateLabelInstance(labelInstanceId, didSucceed ? "copied" : "error", didSucceed ? void 0 : errorMessage || "Unknown error");
15953
16377
  scheduleLabelFade(labelInstanceId);
15954
16378
  } else {
15955
16379
  try {
@@ -15967,7 +16391,7 @@ var init_core = __esm({
15967
16391
  const deferHideContextMenu = () => {
15968
16392
  setTimeout(() => {
15969
16393
  actions.hideContextMenu();
15970
- }, 0);
16394
+ }, DEFERRED_EXECUTION_DELAY_MS);
15971
16395
  };
15972
16396
  const buildActionContext = (options) => {
15973
16397
  const {
@@ -16000,6 +16424,7 @@ var init_core = __esm({
16000
16424
  if (agent) {
16001
16425
  actions.setSelectedAgent(agent);
16002
16426
  }
16427
+ actions.clearLabelInstances();
16003
16428
  onBeforePrompt?.();
16004
16429
  preparePromptMode(element, position.x, position.y);
16005
16430
  actions.setPointer({
@@ -16068,6 +16493,7 @@ var init_core = __esm({
16068
16493
  if (agent) {
16069
16494
  actions.setSelectedAgent(agent);
16070
16495
  }
16496
+ actions.clearLabelInstances();
16071
16497
  actions.clearInputText();
16072
16498
  actions.enterPromptMode(position, element);
16073
16499
  deferHideContextMenu();
@@ -16078,54 +16504,64 @@ var init_core = __esm({
16078
16504
  setTimeout(() => {
16079
16505
  actions.hideContextMenu();
16080
16506
  deactivateRenderer();
16081
- }, 0);
16507
+ }, DEFERRED_EXECUTION_DELAY_MS);
16082
16508
  };
16083
- const clearRecentHoverPreviews = () => {
16509
+ const clearHistoryHoverPreviews = () => {
16084
16510
  for (const {
16085
16511
  boxId,
16086
16512
  labelId
16087
- } of recentHoverPreviews) {
16513
+ } of historyHoverPreviews) {
16088
16514
  actions.removeGrabbedBox(boxId);
16089
16515
  if (labelId) {
16090
16516
  actions.removeLabelInstance(labelId);
16091
16517
  }
16092
16518
  }
16093
- recentHoverPreviews = [];
16519
+ historyHoverPreviews = [];
16094
16520
  };
16095
- const addRecentItemPreview = (item, element, idPrefix) => {
16096
- const bounds = createElementBounds(element);
16097
- const boxId = `${idPrefix}-${item.id}`;
16098
- actions.addGrabbedBox({
16099
- id: boxId,
16100
- bounds,
16101
- createdAt: 0,
16102
- element
16103
- });
16104
- let labelId = null;
16105
- if (item.isComment && item.commentText) {
16106
- labelId = `${idPrefix}-label-${item.id}`;
16107
- actions.addLabelInstance({
16108
- id: labelId,
16521
+ const addHistoryItemPreview = (item, previewBounds, previewElements, idPrefix) => {
16522
+ if (previewBounds.length === 0) return;
16523
+ const hasCommentText = item.isComment && item.commentText;
16524
+ for (const [index, bounds] of previewBounds.entries()) {
16525
+ const previewElement = previewElements[index];
16526
+ const boxId = `${idPrefix}-${item.id}-${index}`;
16527
+ actions.addGrabbedBox({
16528
+ id: boxId,
16109
16529
  bounds,
16110
- tagName: item.tagName,
16111
- componentName: item.componentName,
16112
- status: "idle",
16113
- isPromptMode: true,
16114
- inputValue: item.commentText,
16115
16530
  createdAt: 0,
16116
- element,
16117
- mouseX: bounds.x + bounds.width / 2
16531
+ element: previewElement
16532
+ });
16533
+ let labelId = null;
16534
+ if (index === 0) {
16535
+ labelId = `${idPrefix}-label-${item.id}`;
16536
+ actions.addLabelInstance({
16537
+ id: labelId,
16538
+ bounds,
16539
+ tagName: item.tagName,
16540
+ componentName: item.componentName,
16541
+ elementsCount: item.elementsCount,
16542
+ status: "idle",
16543
+ isPromptMode: Boolean(hasCommentText),
16544
+ inputValue: hasCommentText ? item.commentText : void 0,
16545
+ createdAt: 0,
16546
+ element: previewElement,
16547
+ mouseX: bounds.x + bounds.width / 2
16548
+ });
16549
+ }
16550
+ historyHoverPreviews.push({
16551
+ boxId,
16552
+ labelId
16118
16553
  });
16119
16554
  }
16120
- recentHoverPreviews.push({
16121
- boxId,
16122
- labelId
16123
- });
16555
+ };
16556
+ const showHistoryItemPreview = (item, idPrefix) => {
16557
+ const previewBounds = getHistoryPreviewBounds(item);
16558
+ const connectedElements = getConnectedHistoryElements(item.id);
16559
+ addHistoryItemPreview(item, previewBounds, connectedElements, idPrefix);
16124
16560
  };
16125
16561
  const stopTrackingToolbarPosition = () => {
16126
- if (recentPositionFrameId !== null) {
16127
- cancelAnimationFrame(recentPositionFrameId);
16128
- recentPositionFrameId = null;
16562
+ if (historyPositionFrameId !== null) {
16563
+ cancelAnimationFrame(historyPositionFrameId);
16564
+ historyPositionFrameId = null;
16129
16565
  }
16130
16566
  };
16131
16567
  const getNearestEdge = (rect) => {
@@ -16156,143 +16592,202 @@ var init_core = __esm({
16156
16592
  anchorX = toolbarRect.left + toolbarRect.width / 2;
16157
16593
  anchorY = edge === "top" ? toolbarRect.bottom : toolbarRect.top;
16158
16594
  }
16159
- setRecentDropdownPosition({
16595
+ setHistoryDropdownPosition({
16160
16596
  x: anchorX,
16161
16597
  y: anchorY,
16162
16598
  edge,
16163
16599
  toolbarWidth: toolbarRect.width
16164
16600
  });
16165
- recentPositionFrameId = requestAnimationFrame(updatePosition);
16601
+ historyPositionFrameId = requestAnimationFrame(updatePosition);
16166
16602
  };
16167
- recentPositionFrameId = requestAnimationFrame(updatePosition);
16603
+ historyPositionFrameId = requestAnimationFrame(updatePosition);
16168
16604
  };
16169
- const dismissRecentDropdown = () => {
16605
+ const dismissHistoryDropdown = () => {
16606
+ cancelHistoryHoverOpenTimeout();
16607
+ cancelHistoryHoverCloseTimeout();
16170
16608
  stopTrackingToolbarPosition();
16171
- clearRecentHoverPreviews();
16172
- setRecentDropdownPosition(null);
16609
+ clearHistoryHoverPreviews();
16610
+ setHistoryDropdownPosition(null);
16611
+ setIsHistoryHoverOpen(false);
16612
+ };
16613
+ const openHistoryDropdown = () => {
16614
+ actions.hideContextMenu();
16615
+ setHistoryItems(loadHistory());
16616
+ setHasUnreadHistoryItems(false);
16617
+ startTrackingToolbarPosition();
16618
+ };
16619
+ let historyHoverOpenTimeoutId = null;
16620
+ let historyHoverCloseTimeoutId = null;
16621
+ const cancelHistoryHoverOpenTimeout = () => {
16622
+ if (historyHoverOpenTimeoutId !== null) {
16623
+ clearTimeout(historyHoverOpenTimeoutId);
16624
+ historyHoverOpenTimeoutId = null;
16625
+ }
16626
+ };
16627
+ const cancelHistoryHoverCloseTimeout = () => {
16628
+ if (historyHoverCloseTimeoutId !== null) {
16629
+ clearTimeout(historyHoverCloseTimeoutId);
16630
+ historyHoverCloseTimeoutId = null;
16631
+ }
16173
16632
  };
16174
- const handleToggleRecent = () => {
16175
- const isCurrentlyOpen = recentDropdownPosition() !== null;
16633
+ const handleToggleHistory = () => {
16634
+ cancelHistoryHoverOpenTimeout();
16635
+ cancelHistoryHoverCloseTimeout();
16636
+ const isCurrentlyOpen = historyDropdownPosition() !== null;
16176
16637
  if (isCurrentlyOpen) {
16177
- dismissRecentDropdown();
16638
+ if (isHistoryHoverOpen()) {
16639
+ clearHistoryHoverPreviews();
16640
+ setIsHistoryHoverOpen(false);
16641
+ } else {
16642
+ dismissHistoryDropdown();
16643
+ }
16178
16644
  } else {
16179
- clearRecentHoverPreviews();
16180
- actions.hideContextMenu();
16181
- setRecentItems(loadRecent());
16182
- setHasUnreadRecentItems(false);
16183
- startTrackingToolbarPosition();
16645
+ clearHistoryHoverPreviews();
16646
+ openHistoryDropdown();
16184
16647
  }
16185
16648
  };
16186
- const copyRecentItemContent = (item) => {
16649
+ const copyHistoryItemContent = (item) => {
16187
16650
  copyContent(item.content, {
16188
- name: item.elementName
16651
+ tagName: item.tagName,
16652
+ componentName: item.componentName ?? item.elementName,
16653
+ commentText: item.commentText
16189
16654
  });
16190
- const element = recentElementMap.get(item.id);
16191
- if (element && isElementConnected(element)) {
16655
+ const element = getFirstConnectedHistoryElement(item.id);
16656
+ if (!element) return;
16657
+ actions.clearLabelInstances();
16658
+ requestAnimationFrame(() => {
16659
+ if (!isElementConnected(element)) return;
16192
16660
  const bounds = createElementBounds(element);
16193
16661
  const instanceId = createLabelInstance(bounds, item.tagName, item.componentName, "copied", {
16194
16662
  element,
16195
16663
  mouseX: bounds.x + bounds.width / 2
16196
16664
  });
16197
16665
  scheduleLabelFade(instanceId);
16198
- }
16666
+ });
16199
16667
  };
16200
- const handleRecentItemSelect = (item) => {
16201
- dismissRecentDropdown();
16202
- const element = recentElementMap.get(item.id);
16203
- if (item.isComment && item.commentText) {
16204
- if (element && isElementConnected(element)) {
16205
- const bounds = createElementBounds(element);
16206
- const centerX = bounds.x + bounds.width / 2;
16207
- const centerY = bounds.y + bounds.height / 2;
16208
- actions.enterPromptMode({
16209
- x: centerX,
16210
- y: centerY
16211
- }, element);
16212
- actions.setInputText(item.commentText);
16213
- } else {
16214
- copyContent(item.content, {
16215
- name: item.elementName
16216
- });
16217
- }
16668
+ const handleHistoryItemSelect = (item) => {
16669
+ clearHistoryHoverPreviews();
16670
+ if (isPromptMode()) {
16671
+ actions.exitPromptMode();
16672
+ actions.clearInputText();
16673
+ }
16674
+ const element = getFirstConnectedHistoryElement(item.id);
16675
+ if (item.isComment && item.commentText && element) {
16676
+ const bounds = createElementBounds(element);
16677
+ const centerX = bounds.x + bounds.width / 2;
16678
+ const centerY = bounds.y + bounds.height / 2;
16679
+ actions.enterPromptMode({
16680
+ x: centerX,
16681
+ y: centerY
16682
+ }, element);
16683
+ actions.setInputText(item.commentText);
16218
16684
  } else {
16219
- copyRecentItemContent(item);
16685
+ copyHistoryItemContent(item);
16220
16686
  }
16221
16687
  };
16222
- const handleRecentItemRemove = (item) => {
16223
- clearRecentHoverPreviews();
16224
- recentElementMap.delete(item.id);
16225
- const updatedRecentItems = removeRecentItem(item.id);
16226
- setRecentItems(updatedRecentItems);
16227
- if (updatedRecentItems.length === 0) {
16228
- setHasUnreadRecentItems(false);
16229
- dismissRecentDropdown();
16688
+ const handleHistoryItemRemove = (item) => {
16689
+ clearHistoryHoverPreviews();
16690
+ historyElementMap.delete(item.id);
16691
+ const updatedHistoryItems = removeHistoryItem(item.id);
16692
+ setHistoryItems(updatedHistoryItems);
16693
+ if (updatedHistoryItems.length === 0) {
16694
+ setHasUnreadHistoryItems(false);
16695
+ dismissHistoryDropdown();
16230
16696
  }
16231
16697
  };
16232
- const handleRecentCopyAll = () => {
16233
- const currentRecentItems = recentItems2();
16234
- if (currentRecentItems.length === 0) return;
16235
- const combinedContent = joinSnippets(currentRecentItems.map((recentItem) => recentItem.content));
16236
- const firstItem = currentRecentItems[0];
16698
+ const handleHistoryCopyAll = () => {
16699
+ clearHistoryHoverPreviews();
16700
+ const currentHistoryItems = historyItems2();
16701
+ if (currentHistoryItems.length === 0) return;
16702
+ const combinedContent = joinSnippets(currentHistoryItems.map((historyItem) => historyItem.content));
16703
+ const firstItem = currentHistoryItems[0];
16237
16704
  copyContent(combinedContent, {
16238
- name: firstItem.componentName ?? firstItem.tagName
16705
+ componentName: firstItem.componentName ?? firstItem.tagName,
16706
+ entries: currentHistoryItems.map((historyItem) => ({
16707
+ tagName: historyItem.tagName,
16708
+ componentName: historyItem.componentName ?? historyItem.elementName,
16709
+ content: historyItem.content,
16710
+ commentText: historyItem.commentText
16711
+ }))
16239
16712
  });
16240
- dismissRecentDropdown();
16241
16713
  actions.clearLabelInstances();
16242
- for (const recentItem of currentRecentItems) {
16243
- const element = recentElementMap.get(recentItem.id);
16244
- if (!element || !isElementConnected(element)) continue;
16245
- const bounds = createElementBounds(element);
16246
- const labelId = `label-${Date.now()}-${Math.random().toString(36).slice(2)}`;
16247
- actions.addLabelInstance({
16248
- id: labelId,
16249
- bounds,
16250
- tagName: recentItem.tagName,
16251
- componentName: recentItem.componentName,
16252
- status: "copied",
16253
- createdAt: Date.now(),
16254
- element,
16255
- mouseX: bounds.x + bounds.width / 2
16714
+ requestAnimationFrame(() => {
16715
+ batch(() => {
16716
+ for (const historyItem of currentHistoryItems) {
16717
+ const connectedElements = getConnectedHistoryElements(historyItem.id);
16718
+ for (const element of connectedElements) {
16719
+ const bounds = createElementBounds(element);
16720
+ const labelId = `label-${Date.now()}-${Math.random().toString(36).slice(2)}`;
16721
+ actions.addLabelInstance({
16722
+ id: labelId,
16723
+ bounds,
16724
+ tagName: historyItem.tagName,
16725
+ componentName: historyItem.componentName,
16726
+ status: "copied",
16727
+ createdAt: Date.now(),
16728
+ element,
16729
+ mouseX: bounds.x + bounds.width / 2
16730
+ });
16731
+ scheduleLabelFade(labelId);
16732
+ }
16733
+ }
16256
16734
  });
16257
- scheduleLabelFade(labelId);
16258
- }
16735
+ });
16259
16736
  };
16260
- const handleRecentItemHover = (recentItemId) => {
16261
- clearRecentHoverPreviews();
16262
- if (recentItemId) {
16263
- const item = recentItems2().find((innerItem) => innerItem.id === recentItemId);
16264
- const element = recentElementMap.get(recentItemId);
16265
- if (item && element && isElementConnected(element)) {
16266
- addRecentItemPreview(item, element, "recent-hover");
16737
+ const handleHistoryItemHover = (historyItemId) => {
16738
+ clearHistoryHoverPreviews();
16739
+ if (!historyItemId) return;
16740
+ const item = historyItems2().find((innerItem) => innerItem.id === historyItemId);
16741
+ if (!item) return;
16742
+ showHistoryItemPreview(item, "history-hover");
16743
+ };
16744
+ const handleHistoryButtonHover = (isHovered) => {
16745
+ cancelHistoryHoverOpenTimeout();
16746
+ clearHistoryHoverPreviews();
16747
+ if (isHovered) {
16748
+ cancelHistoryHoverCloseTimeout();
16749
+ if (historyDropdownPosition() === null) {
16750
+ showAllHistoryItemPreviews();
16751
+ historyHoverOpenTimeoutId = setTimeout(() => {
16752
+ historyHoverOpenTimeoutId = null;
16753
+ setIsHistoryHoverOpen(true);
16754
+ openHistoryDropdown();
16755
+ }, DROPDOWN_HOVER_OPEN_DELAY_MS);
16267
16756
  }
16757
+ } else if (isHistoryHoverOpen()) {
16758
+ historyHoverCloseTimeoutId = setTimeout(() => {
16759
+ historyHoverCloseTimeoutId = null;
16760
+ dismissHistoryDropdown();
16761
+ }, DROPDOWN_HOVER_OPEN_DELAY_MS);
16268
16762
  }
16269
16763
  };
16270
- const handleRecentButtonHover = (isHovered) => {
16271
- clearRecentHoverPreviews();
16272
- if (isHovered && recentDropdownPosition() === null) {
16273
- showAllRecentItemPreviews();
16764
+ const handleHistoryDropdownHover = (isHovered) => {
16765
+ if (isHovered) {
16766
+ cancelHistoryHoverCloseTimeout();
16767
+ } else if (isHistoryHoverOpen()) {
16768
+ historyHoverCloseTimeoutId = setTimeout(() => {
16769
+ historyHoverCloseTimeoutId = null;
16770
+ dismissHistoryDropdown();
16771
+ }, DROPDOWN_HOVER_OPEN_DELAY_MS);
16274
16772
  }
16275
16773
  };
16276
- const handleRecentCopyAllHover = (isHovered) => {
16277
- clearRecentHoverPreviews();
16774
+ const handleHistoryCopyAllHover = (isHovered) => {
16775
+ clearHistoryHoverPreviews();
16278
16776
  if (isHovered) {
16279
- showAllRecentItemPreviews();
16777
+ showAllHistoryItemPreviews();
16280
16778
  }
16281
16779
  };
16282
- const showAllRecentItemPreviews = () => {
16283
- for (const item of recentItems2()) {
16284
- const element = recentElementMap.get(item.id);
16285
- if (element && isElementConnected(element)) {
16286
- addRecentItemPreview(item, element, "recent-all-hover");
16287
- }
16780
+ const showAllHistoryItemPreviews = () => {
16781
+ for (const item of historyItems2()) {
16782
+ showHistoryItemPreview(item, "history-all-hover");
16288
16783
  }
16289
16784
  };
16290
- const handleRecentClear = () => {
16291
- recentElementMap.clear();
16292
- const updatedRecentItems = clearRecent();
16293
- setRecentItems(updatedRecentItems);
16294
- setHasUnreadRecentItems(false);
16295
- dismissRecentDropdown();
16785
+ const handleHistoryClear = () => {
16786
+ historyElementMap.clear();
16787
+ const updatedHistoryItems = clearHistory();
16788
+ setHistoryItems(updatedHistoryItems);
16789
+ setHasUnreadHistoryItems(false);
16790
+ dismissHistoryDropdown();
16296
16791
  };
16297
16792
  const handleShowContextMenuSession = (sessionId) => {
16298
16793
  const session = agentManager.sessions().get(sessionId);
@@ -16309,7 +16804,7 @@ var init_core = __esm({
16309
16804
  actions.setFrozenElement(element);
16310
16805
  actions.freeze();
16311
16806
  actions.showContextMenu(session.position, element);
16312
- }, 0);
16807
+ }, DEFERRED_EXECUTION_DELAY_MS);
16313
16808
  };
16314
16809
  const handleShowContextMenuInstance = (instanceId) => {
16315
16810
  const instance = store.labelInstances.find((labelInstance) => labelInstance.id === instanceId);
@@ -16334,7 +16829,7 @@ var init_core = __esm({
16334
16829
  }
16335
16830
  actions.freeze();
16336
16831
  actions.showContextMenu(position, instance.element);
16337
- }, 0);
16832
+ }, DEFERRED_EXECUTION_DELAY_MS);
16338
16833
  };
16339
16834
  createEffect(() => {
16340
16835
  const hue = pluginRegistry.store.theme.hue;
@@ -16481,7 +16976,7 @@ var init_core = __esm({
16481
16976
  },
16482
16977
  onToolbarStateChange: (state) => {
16483
16978
  setCurrentToolbarState(state);
16484
- toolbarStateChangeCallbacks.forEach((cb) => cb(state));
16979
+ toolbarStateChangeCallbacks.forEach((callback) => callback(state));
16485
16980
  },
16486
16981
  onSubscribeToToolbarStateChanges: (callback) => {
16487
16982
  toolbarStateChangeCallbacks.add(callback);
@@ -16516,28 +17011,35 @@ var init_core = __esm({
16516
17011
  },
16517
17012
  onContextMenuDismiss: handleContextMenuDismiss,
16518
17013
  onContextMenuHide: deferHideContextMenu,
16519
- get recentItems() {
16520
- return recentItems2();
17014
+ get historyItems() {
17015
+ return historyItems2();
17016
+ },
17017
+ get historyDisconnectedItemIds() {
17018
+ return historyDisconnectedItemIds();
16521
17019
  },
16522
- get recentItemCount() {
16523
- return recentItems2().length;
17020
+ get historyItemCount() {
17021
+ return historyItems2().length;
16524
17022
  },
16525
- get hasUnreadRecentItems() {
16526
- return hasUnreadRecentItems();
17023
+ get hasUnreadHistoryItems() {
17024
+ return hasUnreadHistoryItems();
16527
17025
  },
16528
- get recentDropdownPosition() {
16529
- return recentDropdownPosition();
17026
+ get historyDropdownPosition() {
17027
+ return historyDropdownPosition();
16530
17028
  },
16531
- onToggleRecent: handleToggleRecent,
16532
- onRecentButtonHover: handleRecentButtonHover,
16533
- onRecentItemSelect: handleRecentItemSelect,
16534
- onRecentItemRemove: handleRecentItemRemove,
16535
- onRecentItemCopy: copyRecentItemContent,
16536
- onRecentItemHover: handleRecentItemHover,
16537
- onRecentCopyAll: handleRecentCopyAll,
16538
- onRecentCopyAllHover: handleRecentCopyAllHover,
16539
- onRecentClear: handleRecentClear,
16540
- onRecentDismiss: dismissRecentDropdown
17029
+ get isHistoryPinned() {
17030
+ return memo(() => historyDropdownPosition() !== null)() && !isHistoryHoverOpen();
17031
+ },
17032
+ onToggleHistory: handleToggleHistory,
17033
+ onHistoryButtonHover: handleHistoryButtonHover,
17034
+ onHistoryItemSelect: handleHistoryItemSelect,
17035
+ onHistoryItemRemove: handleHistoryItemRemove,
17036
+ onHistoryItemCopy: copyHistoryItemContent,
17037
+ onHistoryItemHover: handleHistoryItemHover,
17038
+ onHistoryCopyAll: handleHistoryCopyAll,
17039
+ onHistoryCopyAllHover: handleHistoryCopyAllHover,
17040
+ onHistoryClear: handleHistoryClear,
17041
+ onHistoryDismiss: dismissHistoryDropdown,
17042
+ onHistoryDropdownHover: handleHistoryDropdownHover
16541
17043
  });
16542
17044
  }, rendererRoot);
16543
17045
  }
@@ -16640,7 +17142,7 @@ var init_core = __esm({
16640
17142
  if (state.enabled !== void 0 && state.enabled !== isEnabled()) {
16641
17143
  setIsEnabled(state.enabled);
16642
17144
  }
16643
- toolbarStateChangeCallbacks.forEach((cb) => cb(newState));
17145
+ toolbarStateChangeCallbacks.forEach((callback) => callback(newState));
16644
17146
  },
16645
17147
  onToolbarStateChange: (callback) => {
16646
17148
  toolbarStateChangeCallbacks.add(callback);
@@ -16650,6 +17152,8 @@ var init_core = __esm({
16650
17152
  },
16651
17153
  dispose: () => {
16652
17154
  hasInited = false;
17155
+ cancelHistoryHoverOpenTimeout();
17156
+ cancelHistoryHoverCloseTimeout();
16653
17157
  stopTrackingToolbarPosition();
16654
17158
  toolbarStateChangeCallbacks.clear();
16655
17159
  dispose2();
@@ -16657,17 +17161,13 @@ var init_core = __esm({
16657
17161
  copyElement: copyElementAPI,
16658
17162
  getSource: async (element) => {
16659
17163
  const stack = await getStack(element);
16660
- if (!stack) return null;
16661
- for (const frame of stack) {
16662
- if (frame.fileName && Pe2(frame.fileName)) {
16663
- return {
16664
- filePath: Ne2(frame.fileName),
16665
- lineNumber: frame.lineNumber ?? null,
16666
- componentName: frame.functionName && checkIsSourceComponentName(frame.functionName) ? frame.functionName : null
16667
- };
16668
- }
16669
- }
16670
- return null;
17164
+ const source = resolveSourceFromStack(stack);
17165
+ if (!source) return null;
17166
+ return {
17167
+ filePath: source.filePath,
17168
+ lineNumber: source.lineNumber ?? null,
17169
+ componentName: source.componentName
17170
+ };
16671
17171
  },
16672
17172
  getState: () => ({
16673
17173
  isActive: isActivated(),
@@ -16684,6 +17184,13 @@ var init_core = __esm({
16684
17184
  bounds: box.bounds,
16685
17185
  createdAt: box.createdAt
16686
17186
  })),
17187
+ labelInstances: store.labelInstances.map((instance) => ({
17188
+ id: instance.id,
17189
+ status: instance.status,
17190
+ tagName: instance.tagName,
17191
+ componentName: instance.componentName,
17192
+ createdAt: instance.createdAt
17193
+ })),
16687
17194
  selectionFilePath: store.selectionFilePath,
16688
17195
  toolbarState: currentToolbarState()
16689
17196
  }),